diff --git a/onchain/rollups/deploy/03_authority.ts b/onchain/rollups/deploy/03_authority.ts deleted file mode 100644 index 2e07dab4c..000000000 --- a/onchain/rollups/deploy/03_authority.ts +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright Cartesi Pte. Ltd. - -// Licensed under the Apache License, Version 2.0 (the "License"); you may not -// use this file except in compliance with the License. You may obtain a copy -// of the license at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations -// under the License. - -import { HardhatRuntimeEnvironment } from "hardhat/types"; -import { DeployFunction, DeployOptions } from "hardhat-deploy/types"; -import { Authority__factory } from "../src/types"; - -const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { - const { deployments, ethers, getNamedAccounts, network } = hre; - const { deployer } = await getNamedAccounts(); - const [deployerSigner] = await ethers.getSigners(); - - // IoTeX does not support the deterministic deployment through the contract used by hardhat-deploy - const deterministicDeployment = network.name !== "iotex_testnet"; - - const opts: DeployOptions = { - deterministicDeployment, - from: deployer, - log: true, - }; - - const Authority = await deployments.deploy("Authority", { - ...opts, - args: [deployer], - }); - - const History = await deployments.deploy("History", { - ...opts, - args: [Authority.address], - }); - - const authority = Authority__factory.connect( - Authority.address, - deployerSigner - ); - - const currentHistory = await authority.getHistory(); - - if (currentHistory != History.address) { - const tx = await authority.setHistory(History.address); - const receipt = await tx.wait(); - if (receipt.status == 0) { - throw Error(`Could not link Authority to history: ${tx.hash}`); - } - } -}; - -export default func; -func.tags = ["Authority"]; diff --git a/onchain/rollups/deployments/arbitrum_goerli/Authority.json b/onchain/rollups/deployments/arbitrum_goerli/Authority.json deleted file mode 100644 index 9f7cd2d65..000000000 --- a/onchain/rollups/deployments/arbitrum_goerli/Authority.json +++ /dev/null @@ -1,466 +0,0 @@ -{ - "address": "0x35EC7d70cAff883844d94b54cD19634fFAb5d8CC", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_owner", - "type": "address" - }, - { - "internalType": "contract IInputBox", - "name": "_inputBox", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "application", - "type": "address" - } - ], - "name": "ApplicationJoined", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": false, - "internalType": "contract IInputBox", - "name": "inputBox", - "type": "address" - } - ], - "name": "ConsensusCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "contract IHistory", - "name": "history", - "type": "address" - } - ], - "name": "NewHistory", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_dapp", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_proofContext", - "type": "bytes" - } - ], - "name": "getClaim", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getHistory", - "outputs": [ - { - "internalType": "contract IHistory", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "join", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_consensus", - "type": "address" - } - ], - "name": "migrateHistoryToConsensus", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IHistory", - "name": "_history", - "type": "address" - } - ], - "name": "setHistory", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "_claimData", - "type": "bytes" - } - ], - "name": "submitClaim", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IERC20", - "name": "_token", - "type": "address" - }, - { - "internalType": "address", - "name": "_recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "withdrawERC20Tokens", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0xc52f2ca827c74caa94e79164bfc8de53f8c9f41fba9c879410ff9730e95a521b", - "receipt": { - "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", - "from": "0x18930e8a66a1DbE21D00581216789AAB7460Afd0", - "contractAddress": null, - "transactionIndex": 1, - "gasUsed": "3959806", - "logsBloom": "0x00000000000000000000000000000000000000000000000000800420000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000000000001000000000000000080000000001000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000020000000000000000000000000000000000080000001000000000000024000000000", - "blockHash": "0x6d5054d72e50121ac4f18f82b9ec6033f9979474cd05ea8916b0c43a048bcca8", - "transactionHash": "0xc52f2ca827c74caa94e79164bfc8de53f8c9f41fba9c879410ff9730e95a521b", - "logs": [ - { - "transactionIndex": 1, - "blockNumber": 20222793, - "transactionHash": "0xc52f2ca827c74caa94e79164bfc8de53f8c9f41fba9c879410ff9730e95a521b", - "address": "0x35EC7d70cAff883844d94b54cD19634fFAb5d8CC", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000004e59b44847b379578588920ca78fbf26c0b4956c" - ], - "data": "0x", - "logIndex": 0, - "blockHash": "0x6d5054d72e50121ac4f18f82b9ec6033f9979474cd05ea8916b0c43a048bcca8" - }, - { - "transactionIndex": 1, - "blockNumber": 20222793, - "transactionHash": "0xc52f2ca827c74caa94e79164bfc8de53f8c9f41fba9c879410ff9730e95a521b", - "address": "0x35EC7d70cAff883844d94b54cD19634fFAb5d8CC", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000004e59b44847b379578588920ca78fbf26c0b4956c", - "0x00000000000000000000000018930e8a66a1dbe21d00581216789aab7460afd0" - ], - "data": "0x", - "logIndex": 1, - "blockHash": "0x6d5054d72e50121ac4f18f82b9ec6033f9979474cd05ea8916b0c43a048bcca8" - }, - { - "transactionIndex": 1, - "blockNumber": 20222793, - "transactionHash": "0xc52f2ca827c74caa94e79164bfc8de53f8c9f41fba9c879410ff9730e95a521b", - "address": "0x35EC7d70cAff883844d94b54cD19634fFAb5d8CC", - "topics": [ - "0x583f764398dc1f7529b3e4472cb331312f6b6d76744da14476f571a330d36e23" - ], - "data": "0x00000000000000000000000018930e8a66a1dbe21d00581216789aab7460afd00000000000000000000000005a723220579c0dcb8c9253e6b4c62e572e379945", - "logIndex": 2, - "blockHash": "0x6d5054d72e50121ac4f18f82b9ec6033f9979474cd05ea8916b0c43a048bcca8" - } - ], - "blockNumber": 20222793, - "cumulativeGasUsed": "3959806", - "status": 1, - "byzantium": true - }, - "args": [ - "0x18930e8a66a1DbE21D00581216789AAB7460Afd0", - "0x5a723220579C0DCb8C9253E6b4c62e572E379945" - ], - "numDeployments": 5, - "solcInputHash": "ccf852a6f03ad282136085842817ac99", - "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"contract IInputBox\",\"name\":\"_inputBox\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"application\",\"type\":\"address\"}],\"name\":\"ApplicationJoined\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"contract IInputBox\",\"name\":\"inputBox\",\"type\":\"address\"}],\"name\":\"ConsensusCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"contract IHistory\",\"name\":\"history\",\"type\":\"address\"}],\"name\":\"NewHistory\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dapp\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_proofContext\",\"type\":\"bytes\"}],\"name\":\"getClaim\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getHistory\",\"outputs\":[{\"internalType\":\"contract IHistory\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"join\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_consensus\",\"type\":\"address\"}],\"name\":\"migrateHistoryToConsensus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IHistory\",\"name\":\"_history\",\"type\":\"address\"}],\"name\":\"setHistory\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_claimData\",\"type\":\"bytes\"}],\"name\":\"submitClaim\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdrawERC20Tokens\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"This contract inherits `AbstractConsensus` and OpenZeppelin's `Ownable` contract. For more information on `Ownable`, please consult OpenZeppelin's official documentation.\",\"events\":{\"ApplicationJoined(address)\":{\"details\":\"MUST be triggered on a successful call to `join`.\",\"params\":{\"application\":\"The application\"}},\"ConsensusCreated(address,address)\":{\"details\":\"MUST be triggered during construction.\",\"params\":{\"inputBox\":\"The input box from which the authority fetches new inputs\",\"owner\":\"The address that initially owns the `Authority` contract\"}},\"NewHistory(address)\":{\"details\":\"MUST be triggered on a successful call to `setHistory`.\",\"params\":{\"history\":\"The new history contract\"}}},\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Emits a `ConsensusCreated` event.\",\"params\":{\"_inputBox\":\"The input box contract\",\"_owner\":\"The initial contract owner\"}},\"getClaim(address,bytes)\":{\"params\":{\"_dapp\":\"The DApp address\",\"_proofContext\":\"Data for retrieving the desired claim\"},\"returns\":{\"_0\":\"The claimed epoch hash\",\"_1\":\"The index of the first input of the epoch in the input box\",\"_2\":\"The index of the last input of the epoch in the input box\"}},\"getHistory()\":{\"returns\":{\"_0\":\"The current history contract\"}},\"migrateHistoryToConsensus(address)\":{\"details\":\"Can only be called by the `Authority` owner, and the `Authority` contract must have ownership over its current history contract.\",\"params\":{\"_consensus\":\"The new owner of the current history contract\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setHistory(address)\":{\"details\":\"Emits a `NewHistory` event. Can only be called by the `Authority` owner.\",\"params\":{\"_history\":\"The new history contract\"}},\"submitClaim(bytes)\":{\"details\":\"Can only be called by the `Authority` owner, and the `Authority` contract must have ownership over its current history contract.\",\"params\":{\"_claimData\":\"Data for submitting a claim\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"withdrawERC20Tokens(address,address,uint256)\":{\"details\":\"Can only be called by the `Authority` owner.\",\"params\":{\"_amount\":\"The amount of tokens to be withdrawn\",\"_recipient\":\"The recipient address\",\"_token\":\"The token contract\"}}},\"stateVariables\":{\"history\":{\"details\":\"See the `getHistory` and `setHistory` functions.\"}},\"title\":\"Authority consensus\",\"version\":1},\"userdoc\":{\"events\":{\"ApplicationJoined(address)\":{\"notice\":\"An application has joined the consensus' validation set.\"},\"ConsensusCreated(address,address)\":{\"notice\":\"The `Authority` contract was created.\"},\"NewHistory(address)\":{\"notice\":\"A new history contract is used to store claims.\"}},\"kind\":\"user\",\"methods\":{\"constructor\":{\"notice\":\"Constructs an `Authority` contract.\"},\"getClaim(address,bytes)\":{\"notice\":\"Get a claim from the current history. The encoding of `_proofContext` might vary depending on the implementation of the current history contract.\"},\"getHistory()\":{\"notice\":\"Get the current history contract.\"},\"join()\":{\"notice\":\"Emits an `ApplicationJoined` event with the message sender.\"},\"migrateHistoryToConsensus(address)\":{\"notice\":\"Transfer ownership over the current history contract to `_consensus`.\"},\"setHistory(address)\":{\"notice\":\"Make `Authority` point to another history contract.\"},\"submitClaim(bytes)\":{\"notice\":\"Submits a claim to the current history contract. The encoding of `_claimData` might vary depending on the implementation of the current history contract.\"},\"withdrawERC20Tokens(address,address,uint256)\":{\"notice\":\"Transfer some amount of ERC-20 tokens to a recipient.\"}},\"notice\":\"A consensus model controlled by a single address, the owner. Claims are stored in an auxiliary contract called `History`.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/consensus/authority/Authority.sol\":\"Authority\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"contracts/consensus/AbstractConsensus.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\nimport {IConsensus} from \\\"./IConsensus.sol\\\";\\n\\n/// @title Abstract Consensus\\n/// @notice An abstract contract that partially implements `IConsensus`.\\nabstract contract AbstractConsensus is IConsensus {\\n /// @notice Emits an `ApplicationJoined` event with the message sender.\\n function join() external override {\\n emit ApplicationJoined(msg.sender);\\n }\\n}\\n\",\"keccak256\":\"0x0483d8a8557c4e345eca5ad31ffea560737b08c75ade0430106136a89d755e13\",\"license\":\"Apache-2.0\"},\"contracts/consensus/IConsensus.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\n/// @title Consensus interface\\n///\\n/// @notice This contract defines a generic interface for consensuses.\\n/// We use the word \\\"consensus\\\" to designate a contract that provides claims\\n/// in the base layer regarding the state of off-chain machines running in\\n/// the execution layer. How this contract is able to reach consensus, who is\\n/// able to submit claims, and how are claims stored in the base layer are\\n/// some of the implementation details left unspecified by this interface.\\n///\\n/// From the point of view of a DApp, these claims are necessary to validate\\n/// on-chain action allowed by the off-chain machine in the form of vouchers\\n/// and notices. Each claim is composed of three parts: an epoch hash, a first\\n/// index, and a last index. We'll explain each of these parts below.\\n///\\n/// First, let us define the word \\\"epoch\\\". For finality reasons, we need to\\n/// divide the stream of inputs being fed into the off-chain machine into\\n/// batches of inputs, which we call \\\"epoches\\\". At the end of every epoch,\\n/// we summarize the state of the off-chain machine in a single hash, called\\n/// \\\"epoch hash\\\". Please note that this interface does not define how this\\n/// stream of inputs is being chopped up into epoches.\\n///\\n/// The other two parts are simply the indices of the first and last inputs\\n/// accepted during the epoch. Logically, the first index MUST BE less than\\n/// or equal to the last index. As a result, every epoch MUST accept at least\\n/// one input. This assumption stems from the fact that the state of a machine\\n/// can only change after an input is fed into it.\\n///\\n/// Examples of possible implementations of this interface include:\\n///\\n/// * An authority consensus, controlled by a single address who has full\\n/// control over epoch boundaries, claim submission, asset management, etc.\\n///\\n/// * A quorum consensus, controlled by a limited set of validators, that\\n/// vote on the state of the machine at the end of every epoch. Also, epoch\\n/// boundaries are determined by the timestamp in the base layer, and assets\\n/// are split equally amongst the validators.\\n///\\n/// * An NxN consensus, which allows anyone to submit and dispute claims\\n/// in the base layer. Epoch boundaries are determined in the same fashion\\n/// as in the quorum example.\\n///\\ninterface IConsensus {\\n /// @notice An application has joined the consensus' validation set.\\n /// @param application The application\\n /// @dev MUST be triggered on a successful call to `join`.\\n event ApplicationJoined(address application);\\n\\n /// @notice Get a specific claim regarding a specific DApp.\\n /// The encoding of `_proofContext` might vary\\n /// depending on the implementation.\\n /// @param _dapp The DApp address\\n /// @param _proofContext Data for retrieving the desired claim\\n /// @return epochHash_ The claimed epoch hash\\n /// @return firstInputIndex_ The index of the first input of the epoch in the input box\\n /// @return lastInputIndex_ The index of the last input of the epoch in the input box\\n function getClaim(\\n address _dapp,\\n bytes calldata _proofContext\\n )\\n external\\n view\\n returns (\\n bytes32 epochHash_,\\n uint256 firstInputIndex_,\\n uint256 lastInputIndex_\\n );\\n\\n /// @notice Signal the consensus that the message sender wants to join its validation set.\\n /// @dev MUST fire an `ApplicationJoined` event with the message sender as argument.\\n function join() external;\\n}\\n\",\"keccak256\":\"0x5d59c8dc3c1483e3173837d679093000077bf175c0b3ad7f02f0ffe611c0a89e\",\"license\":\"Apache-2.0\"},\"contracts/consensus/authority/Authority.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\nimport {Ownable} from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport {IERC20} from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport {IConsensus} from \\\"../IConsensus.sol\\\";\\nimport {AbstractConsensus} from \\\"../AbstractConsensus.sol\\\";\\nimport {IInputBox} from \\\"../../inputs/IInputBox.sol\\\";\\nimport {IHistory} from \\\"../../history/IHistory.sol\\\";\\n\\n/// @title Authority consensus\\n/// @notice A consensus model controlled by a single address, the owner.\\n/// Claims are stored in an auxiliary contract called `History`.\\n/// @dev This contract inherits `AbstractConsensus` and OpenZeppelin's `Ownable` contract.\\n/// For more information on `Ownable`, please consult OpenZeppelin's official documentation.\\ncontract Authority is AbstractConsensus, Ownable {\\n /// @notice The current history contract.\\n /// @dev See the `getHistory` and `setHistory` functions.\\n IHistory internal history;\\n\\n /// @notice The `Authority` contract was created.\\n /// @param owner The address that initially owns the `Authority` contract\\n /// @param inputBox The input box from which the authority fetches new inputs\\n /// @dev MUST be triggered during construction.\\n event ConsensusCreated(address owner, IInputBox inputBox);\\n\\n /// @notice A new history contract is used to store claims.\\n /// @param history The new history contract\\n /// @dev MUST be triggered on a successful call to `setHistory`.\\n event NewHistory(IHistory history);\\n\\n /// @notice Constructs an `Authority` contract.\\n /// @param _owner The initial contract owner\\n /// @param _inputBox The input box contract\\n /// @dev Emits a `ConsensusCreated` event.\\n constructor(address _owner, IInputBox _inputBox) {\\n // constructor in Ownable already called `transferOwnership(msg.sender)`, so\\n // we only need to call `transferOwnership(_owner)` if _owner != msg.sender\\n if (msg.sender != _owner) {\\n transferOwnership(_owner);\\n }\\n emit ConsensusCreated(_owner, _inputBox);\\n }\\n\\n /// @notice Submits a claim to the current history contract.\\n /// The encoding of `_claimData` might vary depending on the\\n /// implementation of the current history contract.\\n /// @param _claimData Data for submitting a claim\\n /// @dev Can only be called by the `Authority` owner,\\n /// and the `Authority` contract must have ownership over\\n /// its current history contract.\\n function submitClaim(bytes calldata _claimData) external onlyOwner {\\n history.submitClaim(_claimData);\\n }\\n\\n /// @notice Transfer ownership over the current history contract to `_consensus`.\\n /// @param _consensus The new owner of the current history contract\\n /// @dev Can only be called by the `Authority` owner,\\n /// and the `Authority` contract must have ownership over\\n /// its current history contract.\\n function migrateHistoryToConsensus(address _consensus) external onlyOwner {\\n history.migrateToConsensus(_consensus);\\n }\\n\\n /// @notice Make `Authority` point to another history contract.\\n /// @param _history The new history contract\\n /// @dev Emits a `NewHistory` event.\\n /// Can only be called by the `Authority` owner.\\n function setHistory(IHistory _history) external onlyOwner {\\n history = _history;\\n emit NewHistory(_history);\\n }\\n\\n /// @notice Get the current history contract.\\n /// @return The current history contract\\n function getHistory() external view returns (IHistory) {\\n return history;\\n }\\n\\n /// @notice Get a claim from the current history.\\n /// The encoding of `_proofContext` might vary depending on the\\n /// implementation of the current history contract.\\n /// @inheritdoc IConsensus\\n function getClaim(\\n address _dapp,\\n bytes calldata _proofContext\\n ) external view override returns (bytes32, uint256, uint256) {\\n return history.getClaim(_dapp, _proofContext);\\n }\\n\\n /// @notice Transfer some amount of ERC-20 tokens to a recipient.\\n /// @param _token The token contract\\n /// @param _recipient The recipient address\\n /// @param _amount The amount of tokens to be withdrawn\\n /// @dev Can only be called by the `Authority` owner.\\n function withdrawERC20Tokens(\\n IERC20 _token,\\n address _recipient,\\n uint256 _amount\\n ) external onlyOwner {\\n require(\\n _token.transfer(_recipient, _amount),\\n \\\"Authority: withdrawal failed\\\"\\n );\\n }\\n}\\n\",\"keccak256\":\"0x0a37f82a0c924deeb8fa5baa6ff0133054037170dadd0032b81f4c93c3ca1c91\",\"license\":\"Apache-2.0\"},\"contracts/history/IHistory.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\n/// @title History interface\\ninterface IHistory {\\n // Permissioned functions\\n\\n /// @notice Submit a claim.\\n /// The encoding of `_claimData` might vary\\n /// depending on the history implementation.\\n /// @param _claimData Data for submitting a claim\\n /// @dev Should have access control.\\n function submitClaim(bytes calldata _claimData) external;\\n\\n /// @notice Transfer ownership to another consensus.\\n /// @param _consensus The new consensus\\n /// @dev Should have access control.\\n function migrateToConsensus(address _consensus) external;\\n\\n // Permissionless functions\\n\\n /// @notice Get a specific claim regarding a specific DApp.\\n /// The encoding of `_proofContext` might vary\\n /// depending on the history implementation.\\n /// @param _dapp The DApp address\\n /// @param _proofContext Data for retrieving the desired claim\\n /// @return epochHash_ The claimed epoch hash\\n /// @return firstInputIndex_ The index of the first input of the epoch in the input box\\n /// @return lastInputIndex_ The index of the last input of the epoch in the input box\\n function getClaim(\\n address _dapp,\\n bytes calldata _proofContext\\n )\\n external\\n view\\n returns (\\n bytes32 epochHash_,\\n uint256 firstInputIndex_,\\n uint256 lastInputIndex_\\n );\\n}\\n\",\"keccak256\":\"0xfe0404f078a3a6f761beea8afbb2fac322fd2900f7ad2e2b866504c7aa54568f\",\"license\":\"Apache-2.0\"},\"contracts/inputs/IInputBox.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\n/// @title Input Box interface\\ninterface IInputBox {\\n /// @notice Emitted when an input is added to a DApp's input box.\\n /// @param dapp The address of the DApp\\n /// @param inboxInputIndex The index of the input in the input box\\n /// @param sender The address that sent the input\\n /// @param input The contents of the input\\n /// @dev MUST be triggered on a successful call to `addInput`.\\n event InputAdded(\\n address indexed dapp,\\n uint256 indexed inboxInputIndex,\\n address sender,\\n bytes input\\n );\\n\\n /// @notice Add an input to a DApp's input box.\\n /// @param _dapp The address of the DApp\\n /// @param _input The contents of the input\\n /// @return The hash of the input plus some extra metadata\\n /// @dev MUST fire an `InputAdded` event accordingly.\\n function addInput(\\n address _dapp,\\n bytes calldata _input\\n ) external returns (bytes32);\\n\\n /// @notice Get the number of inputs in a DApp's input box.\\n /// @param _dapp The address of the DApp\\n /// @return Number of inputs in the DApp's input box\\n function getNumberOfInputs(address _dapp) external view returns (uint256);\\n\\n /// @notice Get the hash of an input in a DApp's input box.\\n /// @param _dapp The address of the DApp\\n /// @param _index The index of the input in the DApp's input box\\n /// @return The hash of the input at the provided index in the DApp's input box\\n /// @dev `_index` MUST be in the interval `[0,n)` where `n` is the number of\\n /// inputs in the DApp's input box. See the `getNumberOfInputs` function.\\n function getInputHash(\\n address _dapp,\\n uint256 _index\\n ) external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x2addd467a24cde2131784103080aeb28df40d87ba19c5fd92bf96c0c074603df\",\"license\":\"Apache-2.0\"}},\"version\":1}", - "bytecode": "0x608060405234801561001057600080fd5b506040516109ef3803806109ef83398101604081905261002f916101da565b6100383361009b565b336001600160a01b0383161461005157610051826100eb565b604080516001600160a01b038085168252831660208201527f583f764398dc1f7529b3e4472cb331312f6b6d76744da14476f571a330d36e23910160405180910390a15050610214565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6100f3610169565b6001600160a01b03811661015d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b6101668161009b565b50565b6000546001600160a01b031633146101c35760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610154565b565b6001600160a01b038116811461016657600080fd5b600080604083850312156101ed57600080fd5b82516101f8816101c5565b6020840151909250610209816101c5565b809150509250929050565b6107cc806102236000396000f3fe608060405234801561001057600080fd5b506004361061009e5760003560e01c8063b688a36311610066578063b688a3631461010e578063bcdd1e1314610116578063d79a824014610129578063ddfdfbb014610157578063f2fde38b1461016a57600080fd5b8063159c5ea1146100a3578063715018a6146100b85780638da5cb5b146100c05780639368a3d3146100ea578063aa15efc8146100fd575b600080fd5b6100b66100b136600461058e565b61017d565b005b6100b66101d9565b6000546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b6100b66100f836600461058e565b6101ed565b6001546001600160a01b03166100cd565b6100b6610257565b6100b66101243660046105b2565b61028c565b61013c61013736600461063c565b61035d565b604080519384526020840192909252908201526060016100e1565b6100b6610165366004610691565b6103e6565b6100b661017836600461058e565b610456565b6101856104cf565b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f2bcd43869347a1d42f97ac6042f3d129817abd05a6125f9750fe3724e321d23e9060200160405180910390a150565b6101e16104cf565b6101eb6000610529565b565b6101f56104cf565b60015460405163fc41168360e01b81526001600160a01b0383811660048301529091169063fc41168390602401600060405180830381600087803b15801561023c57600080fd5b505af1158015610250573d6000803e3d6000fd5b5050505050565b6040513381527f27c2b702d3bff195a18baca2daf00b20a986177c5f1449af4e2d46a3c3e02ce59060200160405180910390a1565b6102946104cf565b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af11580156102e3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061030791906106d3565b6103585760405162461bcd60e51b815260206004820152601c60248201527f417574686f726974793a207769746864726177616c206661696c65640000000060448201526064015b60405180910390fd5b505050565b60015460405163035e6a0960e61b8152600091829182916001600160a01b03169063d79a8240906103969089908990899060040161071e565b606060405180830381865afa1580156103b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103d7919061074c565b92509250925093509350939050565b6103ee6104cf565b600154604051630ddfdfbb60e41b81526001600160a01b039091169063ddfdfbb090610420908590859060040161077a565b600060405180830381600087803b15801561043a57600080fd5b505af115801561044e573d6000803e3d6000fd5b505050505050565b61045e6104cf565b6001600160a01b0381166104c35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161034f565b6104cc81610529565b50565b6000546001600160a01b031633146101eb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161034f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146104cc57600080fd5b6000602082840312156105a057600080fd5b81356105ab81610579565b9392505050565b6000806000606084860312156105c757600080fd5b83356105d281610579565b925060208401356105e281610579565b929592945050506040919091013590565b60008083601f84011261060557600080fd5b50813567ffffffffffffffff81111561061d57600080fd5b60208301915083602082850101111561063557600080fd5b9250929050565b60008060006040848603121561065157600080fd5b833561065c81610579565b9250602084013567ffffffffffffffff81111561067857600080fd5b610684868287016105f3565b9497909650939450505050565b600080602083850312156106a457600080fd5b823567ffffffffffffffff8111156106bb57600080fd5b6106c7858286016105f3565b90969095509350505050565b6000602082840312156106e557600080fd5b815180151581146105ab57600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b038416815260406020820181905260009061074390830184866106f5565b95945050505050565b60008060006060848603121561076157600080fd5b8351925060208401519150604084015190509250925092565b60208152600061078e6020830184866106f5565b94935050505056fea264697066735822122021f66c26bc1cded7ab5457f04d0a74c5257b6aa88e7d69d7f9ad0713ba4679e664736f6c63430008130033", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061009e5760003560e01c8063b688a36311610066578063b688a3631461010e578063bcdd1e1314610116578063d79a824014610129578063ddfdfbb014610157578063f2fde38b1461016a57600080fd5b8063159c5ea1146100a3578063715018a6146100b85780638da5cb5b146100c05780639368a3d3146100ea578063aa15efc8146100fd575b600080fd5b6100b66100b136600461058e565b61017d565b005b6100b66101d9565b6000546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b6100b66100f836600461058e565b6101ed565b6001546001600160a01b03166100cd565b6100b6610257565b6100b66101243660046105b2565b61028c565b61013c61013736600461063c565b61035d565b604080519384526020840192909252908201526060016100e1565b6100b6610165366004610691565b6103e6565b6100b661017836600461058e565b610456565b6101856104cf565b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f2bcd43869347a1d42f97ac6042f3d129817abd05a6125f9750fe3724e321d23e9060200160405180910390a150565b6101e16104cf565b6101eb6000610529565b565b6101f56104cf565b60015460405163fc41168360e01b81526001600160a01b0383811660048301529091169063fc41168390602401600060405180830381600087803b15801561023c57600080fd5b505af1158015610250573d6000803e3d6000fd5b5050505050565b6040513381527f27c2b702d3bff195a18baca2daf00b20a986177c5f1449af4e2d46a3c3e02ce59060200160405180910390a1565b6102946104cf565b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af11580156102e3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061030791906106d3565b6103585760405162461bcd60e51b815260206004820152601c60248201527f417574686f726974793a207769746864726177616c206661696c65640000000060448201526064015b60405180910390fd5b505050565b60015460405163035e6a0960e61b8152600091829182916001600160a01b03169063d79a8240906103969089908990899060040161071e565b606060405180830381865afa1580156103b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103d7919061074c565b92509250925093509350939050565b6103ee6104cf565b600154604051630ddfdfbb60e41b81526001600160a01b039091169063ddfdfbb090610420908590859060040161077a565b600060405180830381600087803b15801561043a57600080fd5b505af115801561044e573d6000803e3d6000fd5b505050505050565b61045e6104cf565b6001600160a01b0381166104c35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161034f565b6104cc81610529565b50565b6000546001600160a01b031633146101eb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161034f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146104cc57600080fd5b6000602082840312156105a057600080fd5b81356105ab81610579565b9392505050565b6000806000606084860312156105c757600080fd5b83356105d281610579565b925060208401356105e281610579565b929592945050506040919091013590565b60008083601f84011261060557600080fd5b50813567ffffffffffffffff81111561061d57600080fd5b60208301915083602082850101111561063557600080fd5b9250929050565b60008060006040848603121561065157600080fd5b833561065c81610579565b9250602084013567ffffffffffffffff81111561067857600080fd5b610684868287016105f3565b9497909650939450505050565b600080602083850312156106a457600080fd5b823567ffffffffffffffff8111156106bb57600080fd5b6106c7858286016105f3565b90969095509350505050565b6000602082840312156106e557600080fd5b815180151581146105ab57600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b038416815260406020820181905260009061074390830184866106f5565b95945050505050565b60008060006060848603121561076157600080fd5b8351925060208401519150604084015190509250925092565b60208152600061078e6020830184866106f5565b94935050505056fea264697066735822122021f66c26bc1cded7ab5457f04d0a74c5257b6aa88e7d69d7f9ad0713ba4679e664736f6c63430008130033", - "devdoc": { - "details": "This contract inherits `AbstractConsensus` and OpenZeppelin's `Ownable` contract. For more information on `Ownable`, please consult OpenZeppelin's official documentation.", - "events": { - "ApplicationJoined(address)": { - "details": "MUST be triggered on a successful call to `join`.", - "params": { - "application": "The application" - } - }, - "ConsensusCreated(address,address)": { - "details": "MUST be triggered during construction.", - "params": { - "inputBox": "The input box from which the authority fetches new inputs", - "owner": "The address that initially owns the `Authority` contract" - } - }, - "NewHistory(address)": { - "details": "MUST be triggered on a successful call to `setHistory`.", - "params": { - "history": "The new history contract" - } - } - }, - "kind": "dev", - "methods": { - "constructor": { - "details": "Emits a `ConsensusCreated` event.", - "params": { - "_inputBox": "The input box contract", - "_owner": "The initial contract owner" - } - }, - "getClaim(address,bytes)": { - "params": { - "_dapp": "The DApp address", - "_proofContext": "Data for retrieving the desired claim" - }, - "returns": { - "_0": "The claimed epoch hash", - "_1": "The index of the first input of the epoch in the input box", - "_2": "The index of the last input of the epoch in the input box" - } - }, - "getHistory()": { - "returns": { - "_0": "The current history contract" - } - }, - "migrateHistoryToConsensus(address)": { - "details": "Can only be called by the `Authority` owner, and the `Authority` contract must have ownership over its current history contract.", - "params": { - "_consensus": "The new owner of the current history contract" - } - }, - "owner()": { - "details": "Returns the address of the current owner." - }, - "renounceOwnership()": { - "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." - }, - "setHistory(address)": { - "details": "Emits a `NewHistory` event. Can only be called by the `Authority` owner.", - "params": { - "_history": "The new history contract" - } - }, - "submitClaim(bytes)": { - "details": "Can only be called by the `Authority` owner, and the `Authority` contract must have ownership over its current history contract.", - "params": { - "_claimData": "Data for submitting a claim" - } - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." - }, - "withdrawERC20Tokens(address,address,uint256)": { - "details": "Can only be called by the `Authority` owner.", - "params": { - "_amount": "The amount of tokens to be withdrawn", - "_recipient": "The recipient address", - "_token": "The token contract" - } - } - }, - "stateVariables": { - "history": { - "details": "See the `getHistory` and `setHistory` functions." - } - }, - "title": "Authority consensus", - "version": 1 - }, - "userdoc": { - "events": { - "ApplicationJoined(address)": { - "notice": "An application has joined the consensus' validation set." - }, - "ConsensusCreated(address,address)": { - "notice": "The `Authority` contract was created." - }, - "NewHistory(address)": { - "notice": "A new history contract is used to store claims." - } - }, - "kind": "user", - "methods": { - "constructor": { - "notice": "Constructs an `Authority` contract." - }, - "getClaim(address,bytes)": { - "notice": "Get a claim from the current history. The encoding of `_proofContext` might vary depending on the implementation of the current history contract." - }, - "getHistory()": { - "notice": "Get the current history contract." - }, - "join()": { - "notice": "Emits an `ApplicationJoined` event with the message sender." - }, - "migrateHistoryToConsensus(address)": { - "notice": "Transfer ownership over the current history contract to `_consensus`." - }, - "setHistory(address)": { - "notice": "Make `Authority` point to another history contract." - }, - "submitClaim(bytes)": { - "notice": "Submits a claim to the current history contract. The encoding of `_claimData` might vary depending on the implementation of the current history contract." - }, - "withdrawERC20Tokens(address,address,uint256)": { - "notice": "Transfer some amount of ERC-20 tokens to a recipient." - } - }, - "notice": "A consensus model controlled by a single address, the owner. Claims are stored in an auxiliary contract called `History`.", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 1155, - "contract": "contracts/consensus/authority/Authority.sol:Authority", - "label": "_owner", - "offset": 0, - "slot": "0", - "type": "t_address" - }, - { - "astId": 2248, - "contract": "contracts/consensus/authority/Authority.sol:Authority", - "label": "history", - "offset": 0, - "slot": "1", - "type": "t_contract(IHistory)3266" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_contract(IHistory)3266": { - "encoding": "inplace", - "label": "contract IHistory", - "numberOfBytes": "20" - } - } - } -} \ No newline at end of file diff --git a/onchain/rollups/deployments/arbitrum_goerli/History.json b/onchain/rollups/deployments/arbitrum_goerli/History.json deleted file mode 100644 index 1b7ad93f7..000000000 --- a/onchain/rollups/deployments/arbitrum_goerli/History.json +++ /dev/null @@ -1,381 +0,0 @@ -{ - "address": "0xFB34DaDd5f3Aba55004C448AcFd24fAF5A4Ff83E", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_owner", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "dapp", - "type": "address" - }, - { - "components": [ - { - "internalType": "bytes32", - "name": "epochHash", - "type": "bytes32" - }, - { - "internalType": "uint128", - "name": "firstIndex", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "lastIndex", - "type": "uint128" - } - ], - "indexed": false, - "internalType": "struct History.Claim", - "name": "claim", - "type": "tuple" - } - ], - "name": "NewClaimToHistory", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_dapp", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_proofContext", - "type": "bytes" - } - ], - "name": "getClaim", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_consensus", - "type": "address" - } - ], - "name": "migrateToConsensus", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "_claimData", - "type": "bytes" - } - ], - "name": "submitClaim", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0x95a5c28741a5b14d1ede7d7029f49577ace735b6803afbf2d25b0d8146ed90b0", - "receipt": { - "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", - "from": "0x18930e8a66a1DbE21D00581216789AAB7460Afd0", - "contractAddress": null, - "transactionIndex": 1, - "gasUsed": "3655388", - "logsBloom": "0x00000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000100000000000002000000000000000000000000100000000000001000000000000010000000000000000000000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000000000001000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000020000000000000000000000000800000000080000000000000000000000000000000", - "blockHash": "0xccbc5c79ac3fb3f68c8b64744be0ce3ab8b07ac205d25f3c56e749590b202554", - "transactionHash": "0x95a5c28741a5b14d1ede7d7029f49577ace735b6803afbf2d25b0d8146ed90b0", - "logs": [ - { - "transactionIndex": 1, - "blockNumber": 20222800, - "transactionHash": "0x95a5c28741a5b14d1ede7d7029f49577ace735b6803afbf2d25b0d8146ed90b0", - "address": "0xFB34DaDd5f3Aba55004C448AcFd24fAF5A4Ff83E", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000004e59b44847b379578588920ca78fbf26c0b4956c" - ], - "data": "0x", - "logIndex": 0, - "blockHash": "0xccbc5c79ac3fb3f68c8b64744be0ce3ab8b07ac205d25f3c56e749590b202554" - }, - { - "transactionIndex": 1, - "blockNumber": 20222800, - "transactionHash": "0x95a5c28741a5b14d1ede7d7029f49577ace735b6803afbf2d25b0d8146ed90b0", - "address": "0xFB34DaDd5f3Aba55004C448AcFd24fAF5A4Ff83E", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000004e59b44847b379578588920ca78fbf26c0b4956c", - "0x00000000000000000000000035ec7d70caff883844d94b54cd19634ffab5d8cc" - ], - "data": "0x", - "logIndex": 1, - "blockHash": "0xccbc5c79ac3fb3f68c8b64744be0ce3ab8b07ac205d25f3c56e749590b202554" - } - ], - "blockNumber": 20222800, - "cumulativeGasUsed": "3655388", - "status": 1, - "byzantium": true - }, - "args": [ - "0x35EC7d70cAff883844d94b54cD19634fFAb5d8CC" - ], - "numDeployments": 5, - "solcInputHash": "ccf852a6f03ad282136085842817ac99", - "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dapp\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"epochHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint128\",\"name\":\"firstIndex\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"lastIndex\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"struct History.Claim\",\"name\":\"claim\",\"type\":\"tuple\"}],\"name\":\"NewClaimToHistory\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dapp\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_proofContext\",\"type\":\"bytes\"}],\"name\":\"getClaim\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_consensus\",\"type\":\"address\"}],\"name\":\"migrateToConsensus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_claimData\",\"type\":\"bytes\"}],\"name\":\"submitClaim\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"This contract inherits OpenZeppelin's `Ownable` contract. For more information on `Ownable`, please consult OpenZeppelin's official documentation.\",\"events\":{\"NewClaimToHistory(address,(bytes32,uint128,uint128))\":{\"details\":\"MUST be triggered on a successful call to `submitClaim`.\",\"params\":{\"claim\":\"The newly-submitted claim\",\"dapp\":\"The address of the DApp\"}}},\"kind\":\"dev\",\"methods\":{\"constructor\":{\"params\":{\"_owner\":\"The initial owner\"}},\"getClaim(address,bytes)\":{\"params\":{\"_dapp\":\"The DApp address\",\"_proofContext\":\"Data for retrieving the desired claim\"},\"returns\":{\"_0\":\"The claimed epoch hash\",\"_1\":\"The index of the first input of the epoch in the input box\",\"_2\":\"The index of the last input of the epoch in the input box\"}},\"migrateToConsensus(address)\":{\"details\":\"Emits an `OwnershipTransferred` event. Should have access control.\",\"params\":{\"_consensus\":\"The new consensus\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"submitClaim(bytes)\":{\"details\":\"Emits a `NewClaimToHistory` event. Should have access control.\",\"params\":{\"_claimData\":\"Data for submitting a claim\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"stateVariables\":{\"claims\":{\"details\":\"See the `getClaim` and `submitClaim` functions.\"}},\"title\":\"Simple History\",\"version\":1},\"userdoc\":{\"events\":{\"NewClaimToHistory(address,(bytes32,uint128,uint128))\":{\"notice\":\"A new claim regarding a specific DApp was submitted.\"}},\"kind\":\"user\",\"methods\":{\"constructor\":{\"notice\":\"Creates a `History` contract.\"},\"getClaim(address,bytes)\":{\"notice\":\"Get a specific claim regarding a specific DApp. There are several requirements for this function to be called successfully. * `_proofContext` MUST be well-encoded. In Solidity, it can be constructed as `abi.encode(claimIndex)`, where `claimIndex` is the claim index (type `uint256`). * `claimIndex` MUST be inside the interval `[0, n)` where `n` is the number of claims that have been submitted to `_dapp` already.\"},\"migrateToConsensus(address)\":{\"notice\":\"Transfer ownership to another consensus.\"},\"submitClaim(bytes)\":{\"notice\":\"Submit a claim regarding a DApp. There are several requirements for this function to be called successfully. * `_claimData` MUST be well-encoded. In Solidity, it can be constructed as `abi.encode(dapp, claim)`, where `dapp` is the DApp address (type `address`) and `claim` is the claim structure (type `Claim`). * `firstIndex` MUST be less than or equal to `lastIndex`. As a result, every claim MUST encompass AT LEAST one input. * If this is the DApp's first claim, then `firstIndex` MUST be `0`. Otherwise, `firstIndex` MUST be the `lastClaim.lastIndex + 1`. In other words, claims MUST NOT skip inputs.\"}},\"notice\":\"This contract stores claims for each DApp individually. This means that, for each DApp, the contract stores an array of `Claim` entries, where each `Claim` is composed of: * An epoch hash (`bytes32`) * A closed interval of input indices (`uint128`, `uint128`) The contract guarantees that the first interval starts at index 0, and that the following intervals don't have gaps or overlaps. Furthermore, claims can only be submitted by the contract owner through `submitClaim`, but can be retrieved by anyone with `getClaim`.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/history/History.sol\":\"History\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"contracts/history/History.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\nimport {Ownable} from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\nimport {IHistory} from \\\"./IHistory.sol\\\";\\n\\n/// @title Simple History\\n///\\n/// @notice This contract stores claims for each DApp individually.\\n/// This means that, for each DApp, the contract stores an array of\\n/// `Claim` entries, where each `Claim` is composed of:\\n///\\n/// * An epoch hash (`bytes32`)\\n/// * A closed interval of input indices (`uint128`, `uint128`)\\n///\\n/// The contract guarantees that the first interval starts at index 0,\\n/// and that the following intervals don't have gaps or overlaps.\\n///\\n/// Furthermore, claims can only be submitted by the contract owner\\n/// through `submitClaim`, but can be retrieved by anyone with `getClaim`.\\n///\\n/// @dev This contract inherits OpenZeppelin's `Ownable` contract.\\n/// For more information on `Ownable`, please consult OpenZeppelin's official documentation.\\ncontract History is IHistory, Ownable {\\n struct Claim {\\n bytes32 epochHash;\\n uint128 firstIndex;\\n uint128 lastIndex;\\n }\\n\\n /// @notice Mapping from DApp address to array of claims.\\n /// @dev See the `getClaim` and `submitClaim` functions.\\n mapping(address => Claim[]) internal claims;\\n\\n /// @notice A new claim regarding a specific DApp was submitted.\\n /// @param dapp The address of the DApp\\n /// @param claim The newly-submitted claim\\n /// @dev MUST be triggered on a successful call to `submitClaim`.\\n event NewClaimToHistory(address indexed dapp, Claim claim);\\n\\n /// @notice Creates a `History` contract.\\n /// @param _owner The initial owner\\n constructor(address _owner) {\\n // constructor in Ownable already called `transferOwnership(msg.sender)`, so\\n // we only need to call `transferOwnership(_owner)` if _owner != msg.sender\\n if (_owner != msg.sender) {\\n transferOwnership(_owner);\\n }\\n }\\n\\n /// @notice Submit a claim regarding a DApp.\\n /// There are several requirements for this function to be called successfully.\\n ///\\n /// * `_claimData` MUST be well-encoded. In Solidity, it can be constructed\\n /// as `abi.encode(dapp, claim)`, where `dapp` is the DApp address (type `address`)\\n /// and `claim` is the claim structure (type `Claim`).\\n ///\\n /// * `firstIndex` MUST be less than or equal to `lastIndex`.\\n /// As a result, every claim MUST encompass AT LEAST one input.\\n ///\\n /// * If this is the DApp's first claim, then `firstIndex` MUST be `0`.\\n /// Otherwise, `firstIndex` MUST be the `lastClaim.lastIndex + 1`.\\n /// In other words, claims MUST NOT skip inputs.\\n ///\\n /// @inheritdoc IHistory\\n /// @dev Emits a `NewClaimToHistory` event. Should have access control.\\n function submitClaim(\\n bytes calldata _claimData\\n ) external override onlyOwner {\\n (address dapp, Claim memory claim) = abi.decode(\\n _claimData,\\n (address, Claim)\\n );\\n\\n require(claim.firstIndex <= claim.lastIndex, \\\"History: FI > LI\\\");\\n\\n Claim[] storage dappClaims = claims[dapp];\\n uint256 numDAppClaims = dappClaims.length;\\n\\n require(\\n claim.firstIndex ==\\n (\\n (numDAppClaims == 0)\\n ? 0\\n : (dappClaims[numDAppClaims - 1].lastIndex + 1)\\n ),\\n \\\"History: unclaimed inputs\\\"\\n );\\n\\n dappClaims.push(claim);\\n\\n emit NewClaimToHistory(dapp, claim);\\n }\\n\\n /// @notice Get a specific claim regarding a specific DApp.\\n /// There are several requirements for this function to be called successfully.\\n ///\\n /// * `_proofContext` MUST be well-encoded. In Solidity, it can be constructed\\n /// as `abi.encode(claimIndex)`, where `claimIndex` is the claim index (type `uint256`).\\n ///\\n /// * `claimIndex` MUST be inside the interval `[0, n)` where `n` is the number of claims\\n /// that have been submitted to `_dapp` already.\\n ///\\n /// @inheritdoc IHistory\\n function getClaim(\\n address _dapp,\\n bytes calldata _proofContext\\n ) external view override returns (bytes32, uint256, uint256) {\\n uint256 claimIndex = abi.decode(_proofContext, (uint256));\\n\\n Claim memory claim = claims[_dapp][claimIndex];\\n\\n return (claim.epochHash, claim.firstIndex, claim.lastIndex);\\n }\\n\\n /// @inheritdoc IHistory\\n /// @dev Emits an `OwnershipTransferred` event. Should have access control.\\n function migrateToConsensus(\\n address _consensus\\n ) external override onlyOwner {\\n transferOwnership(_consensus);\\n }\\n}\\n\",\"keccak256\":\"0x607253a9e73d3fe0b98e2c5d7b6f9ee1dad48d7cf4a1284b4f1361d74178da7a\",\"license\":\"Apache-2.0\"},\"contracts/history/IHistory.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\n/// @title History interface\\ninterface IHistory {\\n // Permissioned functions\\n\\n /// @notice Submit a claim.\\n /// The encoding of `_claimData` might vary\\n /// depending on the history implementation.\\n /// @param _claimData Data for submitting a claim\\n /// @dev Should have access control.\\n function submitClaim(bytes calldata _claimData) external;\\n\\n /// @notice Transfer ownership to another consensus.\\n /// @param _consensus The new consensus\\n /// @dev Should have access control.\\n function migrateToConsensus(address _consensus) external;\\n\\n // Permissionless functions\\n\\n /// @notice Get a specific claim regarding a specific DApp.\\n /// The encoding of `_proofContext` might vary\\n /// depending on the history implementation.\\n /// @param _dapp The DApp address\\n /// @param _proofContext Data for retrieving the desired claim\\n /// @return epochHash_ The claimed epoch hash\\n /// @return firstInputIndex_ The index of the first input of the epoch in the input box\\n /// @return lastInputIndex_ The index of the last input of the epoch in the input box\\n function getClaim(\\n address _dapp,\\n bytes calldata _proofContext\\n )\\n external\\n view\\n returns (\\n bytes32 epochHash_,\\n uint256 firstInputIndex_,\\n uint256 lastInputIndex_\\n );\\n}\\n\",\"keccak256\":\"0xfe0404f078a3a6f761beea8afbb2fac322fd2900f7ad2e2b866504c7aa54568f\",\"license\":\"Apache-2.0\"}},\"version\":1}", - "bytecode": "0x608060405234801561001057600080fd5b5060405161091f38038061091f83398101604081905261002f91610181565b61003833610057565b6001600160a01b038116331461005157610051816100a7565b506101b1565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6100af610125565b6001600160a01b0381166101195760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b61012281610057565b50565b6000546001600160a01b0316331461017f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610110565b565b60006020828403121561019357600080fd5b81516001600160a01b03811681146101aa57600080fd5b9392505050565b61075f806101c06000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c8063715018a6146100675780638da5cb5b14610071578063d79a824014610091578063ddfdfbb0146100bf578063f2fde38b146100d2578063fc411683146100e5575b600080fd5b61006f6100f8565b005b6000546040516001600160a01b0390911681526020015b60405180910390f35b6100a461009f36600461052f565b61010c565b60408051938452602084019290925290820152606001610088565b61006f6100cd366004610584565b6101a5565b61006f6100e03660046105c6565b61039d565b61006f6100f33660046105c6565b610416565b610100610427565b61010a6000610481565b565b600080808061011d858701876105ea565b6001600160a01b0388166000908152600160205260408120805492935090918390811061014c5761014c610603565b60009182526020918290206040805160608101825260029390930290910180548084526001909101546001600160801b03808216958501869052600160801b90910416929091018290529a919950975095505050505050565b6101ad610427565b6000806101bc83850185610635565b9150915080604001516001600160801b031681602001516001600160801b031611156102225760405162461bcd60e51b815260206004820152601060248201526f486973746f72793a204649203e204c4960801b60448201526064015b60405180910390fd5b6001600160a01b038216600090815260016020526040902080548015610294578161024e6001836106e9565b8154811061025e5761025e610603565b906000526020600020906002020160010160109054906101000a90046001600160801b0316600161028f9190610702565b610297565b60005b6001600160801b031683602001516001600160801b0316146102fb5760405162461bcd60e51b815260206004820152601960248201527f486973746f72793a20756e636c61696d656420696e70757473000000000000006044820152606401610219565b8154600180820184556000848152602090819020865160029094020183815586820180516040808a0180516001600160801b03938416600160801b9185169190910217949096019390935582519586529051811692850192909252915116908201526001600160a01b038516907fb71880d7a0c514d48c0296b2721b0a4f9641a45117960f2ca86b5b7873c4ab2f9060600160405180910390a2505050505050565b6103a5610427565b6001600160a01b03811661040a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610219565b61041381610481565b50565b61041e610427565b6104138161039d565b6000546001600160a01b0316331461010a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610219565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038116811461041357600080fd5b60008083601f8401126104f857600080fd5b50813567ffffffffffffffff81111561051057600080fd5b60208301915083602082850101111561052857600080fd5b9250929050565b60008060006040848603121561054457600080fd5b833561054f816104d1565b9250602084013567ffffffffffffffff81111561056b57600080fd5b610577868287016104e6565b9497909650939450505050565b6000806020838503121561059757600080fd5b823567ffffffffffffffff8111156105ae57600080fd5b6105ba858286016104e6565b90969095509350505050565b6000602082840312156105d857600080fd5b81356105e3816104d1565b9392505050565b6000602082840312156105fc57600080fd5b5035919050565b634e487b7160e01b600052603260045260246000fd5b80356001600160801b038116811461063057600080fd5b919050565b600080828403608081121561064957600080fd5b8335610654816104d1565b92506060601f198201121561066857600080fd5b506040516060810181811067ffffffffffffffff8211171561069a57634e487b7160e01b600052604160045260246000fd5b8060405250602084013581526106b260408501610619565b60208201526106c360608501610619565b6040820152809150509250929050565b634e487b7160e01b600052601160045260246000fd5b818103818111156106fc576106fc6106d3565b92915050565b6001600160801b03818116838216019080821115610722576107226106d3565b509291505056fea26469706673582212201fc5dfb9d50cb3efefe40c7ced59b7b296f6d072ed8005ef3de36946cd77e28364736f6c63430008130033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100625760003560e01c8063715018a6146100675780638da5cb5b14610071578063d79a824014610091578063ddfdfbb0146100bf578063f2fde38b146100d2578063fc411683146100e5575b600080fd5b61006f6100f8565b005b6000546040516001600160a01b0390911681526020015b60405180910390f35b6100a461009f36600461052f565b61010c565b60408051938452602084019290925290820152606001610088565b61006f6100cd366004610584565b6101a5565b61006f6100e03660046105c6565b61039d565b61006f6100f33660046105c6565b610416565b610100610427565b61010a6000610481565b565b600080808061011d858701876105ea565b6001600160a01b0388166000908152600160205260408120805492935090918390811061014c5761014c610603565b60009182526020918290206040805160608101825260029390930290910180548084526001909101546001600160801b03808216958501869052600160801b90910416929091018290529a919950975095505050505050565b6101ad610427565b6000806101bc83850185610635565b9150915080604001516001600160801b031681602001516001600160801b031611156102225760405162461bcd60e51b815260206004820152601060248201526f486973746f72793a204649203e204c4960801b60448201526064015b60405180910390fd5b6001600160a01b038216600090815260016020526040902080548015610294578161024e6001836106e9565b8154811061025e5761025e610603565b906000526020600020906002020160010160109054906101000a90046001600160801b0316600161028f9190610702565b610297565b60005b6001600160801b031683602001516001600160801b0316146102fb5760405162461bcd60e51b815260206004820152601960248201527f486973746f72793a20756e636c61696d656420696e70757473000000000000006044820152606401610219565b8154600180820184556000848152602090819020865160029094020183815586820180516040808a0180516001600160801b03938416600160801b9185169190910217949096019390935582519586529051811692850192909252915116908201526001600160a01b038516907fb71880d7a0c514d48c0296b2721b0a4f9641a45117960f2ca86b5b7873c4ab2f9060600160405180910390a2505050505050565b6103a5610427565b6001600160a01b03811661040a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610219565b61041381610481565b50565b61041e610427565b6104138161039d565b6000546001600160a01b0316331461010a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610219565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038116811461041357600080fd5b60008083601f8401126104f857600080fd5b50813567ffffffffffffffff81111561051057600080fd5b60208301915083602082850101111561052857600080fd5b9250929050565b60008060006040848603121561054457600080fd5b833561054f816104d1565b9250602084013567ffffffffffffffff81111561056b57600080fd5b610577868287016104e6565b9497909650939450505050565b6000806020838503121561059757600080fd5b823567ffffffffffffffff8111156105ae57600080fd5b6105ba858286016104e6565b90969095509350505050565b6000602082840312156105d857600080fd5b81356105e3816104d1565b9392505050565b6000602082840312156105fc57600080fd5b5035919050565b634e487b7160e01b600052603260045260246000fd5b80356001600160801b038116811461063057600080fd5b919050565b600080828403608081121561064957600080fd5b8335610654816104d1565b92506060601f198201121561066857600080fd5b506040516060810181811067ffffffffffffffff8211171561069a57634e487b7160e01b600052604160045260246000fd5b8060405250602084013581526106b260408501610619565b60208201526106c360608501610619565b6040820152809150509250929050565b634e487b7160e01b600052601160045260246000fd5b818103818111156106fc576106fc6106d3565b92915050565b6001600160801b03818116838216019080821115610722576107226106d3565b509291505056fea26469706673582212201fc5dfb9d50cb3efefe40c7ced59b7b296f6d072ed8005ef3de36946cd77e28364736f6c63430008130033", - "devdoc": { - "details": "This contract inherits OpenZeppelin's `Ownable` contract. For more information on `Ownable`, please consult OpenZeppelin's official documentation.", - "events": { - "NewClaimToHistory(address,(bytes32,uint128,uint128))": { - "details": "MUST be triggered on a successful call to `submitClaim`.", - "params": { - "claim": "The newly-submitted claim", - "dapp": "The address of the DApp" - } - } - }, - "kind": "dev", - "methods": { - "constructor": { - "params": { - "_owner": "The initial owner" - } - }, - "getClaim(address,bytes)": { - "params": { - "_dapp": "The DApp address", - "_proofContext": "Data for retrieving the desired claim" - }, - "returns": { - "_0": "The claimed epoch hash", - "_1": "The index of the first input of the epoch in the input box", - "_2": "The index of the last input of the epoch in the input box" - } - }, - "migrateToConsensus(address)": { - "details": "Emits an `OwnershipTransferred` event. Should have access control.", - "params": { - "_consensus": "The new consensus" - } - }, - "owner()": { - "details": "Returns the address of the current owner." - }, - "renounceOwnership()": { - "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." - }, - "submitClaim(bytes)": { - "details": "Emits a `NewClaimToHistory` event. Should have access control.", - "params": { - "_claimData": "Data for submitting a claim" - } - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." - } - }, - "stateVariables": { - "claims": { - "details": "See the `getClaim` and `submitClaim` functions." - } - }, - "title": "Simple History", - "version": 1 - }, - "userdoc": { - "events": { - "NewClaimToHistory(address,(bytes32,uint128,uint128))": { - "notice": "A new claim regarding a specific DApp was submitted." - } - }, - "kind": "user", - "methods": { - "constructor": { - "notice": "Creates a `History` contract." - }, - "getClaim(address,bytes)": { - "notice": "Get a specific claim regarding a specific DApp. There are several requirements for this function to be called successfully. * `_proofContext` MUST be well-encoded. In Solidity, it can be constructed as `abi.encode(claimIndex)`, where `claimIndex` is the claim index (type `uint256`). * `claimIndex` MUST be inside the interval `[0, n)` where `n` is the number of claims that have been submitted to `_dapp` already." - }, - "migrateToConsensus(address)": { - "notice": "Transfer ownership to another consensus." - }, - "submitClaim(bytes)": { - "notice": "Submit a claim regarding a DApp. There are several requirements for this function to be called successfully. * `_claimData` MUST be well-encoded. In Solidity, it can be constructed as `abi.encode(dapp, claim)`, where `dapp` is the DApp address (type `address`) and `claim` is the claim structure (type `Claim`). * `firstIndex` MUST be less than or equal to `lastIndex`. As a result, every claim MUST encompass AT LEAST one input. * If this is the DApp's first claim, then `firstIndex` MUST be `0`. Otherwise, `firstIndex` MUST be the `lastClaim.lastIndex + 1`. In other words, claims MUST NOT skip inputs." - } - }, - "notice": "This contract stores claims for each DApp individually. This means that, for each DApp, the contract stores an array of `Claim` entries, where each `Claim` is composed of: * An epoch hash (`bytes32`) * A closed interval of input indices (`uint128`, `uint128`) The contract guarantees that the first interval starts at index 0, and that the following intervals don't have gaps or overlaps. Furthermore, claims can only be submitted by the contract owner through `submitClaim`, but can be retrieved by anyone with `getClaim`.", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 1155, - "contract": "contracts/history/History.sol:History", - "label": "_owner", - "offset": 0, - "slot": "0", - "type": "t_address" - }, - { - "astId": 3072, - "contract": "contracts/history/History.sol:History", - "label": "claims", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_address,t_array(t_struct(Claim)3065_storage)dyn_storage)" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_struct(Claim)3065_storage)dyn_storage": { - "base": "t_struct(Claim)3065_storage", - "encoding": "dynamic_array", - "label": "struct History.Claim[]", - "numberOfBytes": "32" - }, - "t_bytes32": { - "encoding": "inplace", - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_array(t_struct(Claim)3065_storage)dyn_storage)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => struct History.Claim[])", - "numberOfBytes": "32", - "value": "t_array(t_struct(Claim)3065_storage)dyn_storage" - }, - "t_struct(Claim)3065_storage": { - "encoding": "inplace", - "label": "struct History.Claim", - "members": [ - { - "astId": 3060, - "contract": "contracts/history/History.sol:History", - "label": "epochHash", - "offset": 0, - "slot": "0", - "type": "t_bytes32" - }, - { - "astId": 3062, - "contract": "contracts/history/History.sol:History", - "label": "firstIndex", - "offset": 0, - "slot": "1", - "type": "t_uint128" - }, - { - "astId": 3064, - "contract": "contracts/history/History.sol:History", - "label": "lastIndex", - "offset": 16, - "slot": "1", - "type": "t_uint128" - } - ], - "numberOfBytes": "64" - }, - "t_uint128": { - "encoding": "inplace", - "label": "uint128", - "numberOfBytes": "16" - } - } - } -} \ No newline at end of file diff --git a/onchain/rollups/deployments/bsc_testnet/Authority.json b/onchain/rollups/deployments/bsc_testnet/Authority.json deleted file mode 100644 index 5e4e2595f..000000000 --- a/onchain/rollups/deployments/bsc_testnet/Authority.json +++ /dev/null @@ -1,466 +0,0 @@ -{ - "address": "0x35EC7d70cAff883844d94b54cD19634fFAb5d8CC", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_owner", - "type": "address" - }, - { - "internalType": "contract IInputBox", - "name": "_inputBox", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "application", - "type": "address" - } - ], - "name": "ApplicationJoined", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": false, - "internalType": "contract IInputBox", - "name": "inputBox", - "type": "address" - } - ], - "name": "ConsensusCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "contract IHistory", - "name": "history", - "type": "address" - } - ], - "name": "NewHistory", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_dapp", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_proofContext", - "type": "bytes" - } - ], - "name": "getClaim", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getHistory", - "outputs": [ - { - "internalType": "contract IHistory", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "join", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_consensus", - "type": "address" - } - ], - "name": "migrateHistoryToConsensus", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IHistory", - "name": "_history", - "type": "address" - } - ], - "name": "setHistory", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "_claimData", - "type": "bytes" - } - ], - "name": "submitClaim", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IERC20", - "name": "_token", - "type": "address" - }, - { - "internalType": "address", - "name": "_recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "withdrawERC20Tokens", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0x39d6add9d9e9562489a3ff25a078cafb107fa4baf0028d0fc100760e5aca6ccf", - "receipt": { - "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", - "from": "0x18930e8a66a1DbE21D00581216789AAB7460Afd0", - "contractAddress": null, - "transactionIndex": 2, - "gasUsed": "522430", - "logsBloom": "0x00000000000000000000000000000000000000000000000000800420000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000000000001000000000000000080000000001000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000020000000000000000000000000000000000080000001000000000000024000000000", - "blockHash": "0x3eba8a640072b72b4fe7e1d7d741bf4a75706c4c93de64ab95043caa6eae7514", - "transactionHash": "0x39d6add9d9e9562489a3ff25a078cafb107fa4baf0028d0fc100760e5aca6ccf", - "logs": [ - { - "transactionIndex": 2, - "blockNumber": 29884212, - "transactionHash": "0x39d6add9d9e9562489a3ff25a078cafb107fa4baf0028d0fc100760e5aca6ccf", - "address": "0x35EC7d70cAff883844d94b54cD19634fFAb5d8CC", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000004e59b44847b379578588920ca78fbf26c0b4956c" - ], - "data": "0x", - "logIndex": 17, - "blockHash": "0x3eba8a640072b72b4fe7e1d7d741bf4a75706c4c93de64ab95043caa6eae7514" - }, - { - "transactionIndex": 2, - "blockNumber": 29884212, - "transactionHash": "0x39d6add9d9e9562489a3ff25a078cafb107fa4baf0028d0fc100760e5aca6ccf", - "address": "0x35EC7d70cAff883844d94b54cD19634fFAb5d8CC", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000004e59b44847b379578588920ca78fbf26c0b4956c", - "0x00000000000000000000000018930e8a66a1dbe21d00581216789aab7460afd0" - ], - "data": "0x", - "logIndex": 18, - "blockHash": "0x3eba8a640072b72b4fe7e1d7d741bf4a75706c4c93de64ab95043caa6eae7514" - }, - { - "transactionIndex": 2, - "blockNumber": 29884212, - "transactionHash": "0x39d6add9d9e9562489a3ff25a078cafb107fa4baf0028d0fc100760e5aca6ccf", - "address": "0x35EC7d70cAff883844d94b54cD19634fFAb5d8CC", - "topics": [ - "0x583f764398dc1f7529b3e4472cb331312f6b6d76744da14476f571a330d36e23" - ], - "data": "0x00000000000000000000000018930e8a66a1dbe21d00581216789aab7460afd00000000000000000000000005a723220579c0dcb8c9253e6b4c62e572e379945", - "logIndex": 19, - "blockHash": "0x3eba8a640072b72b4fe7e1d7d741bf4a75706c4c93de64ab95043caa6eae7514" - } - ], - "blockNumber": 29884212, - "cumulativeGasUsed": "1611396", - "status": 1, - "byzantium": true - }, - "args": [ - "0x18930e8a66a1DbE21D00581216789AAB7460Afd0", - "0x5a723220579C0DCb8C9253E6b4c62e572E379945" - ], - "numDeployments": 5, - "solcInputHash": "ccf852a6f03ad282136085842817ac99", - "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"contract IInputBox\",\"name\":\"_inputBox\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"application\",\"type\":\"address\"}],\"name\":\"ApplicationJoined\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"contract IInputBox\",\"name\":\"inputBox\",\"type\":\"address\"}],\"name\":\"ConsensusCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"contract IHistory\",\"name\":\"history\",\"type\":\"address\"}],\"name\":\"NewHistory\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dapp\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_proofContext\",\"type\":\"bytes\"}],\"name\":\"getClaim\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getHistory\",\"outputs\":[{\"internalType\":\"contract IHistory\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"join\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_consensus\",\"type\":\"address\"}],\"name\":\"migrateHistoryToConsensus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IHistory\",\"name\":\"_history\",\"type\":\"address\"}],\"name\":\"setHistory\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_claimData\",\"type\":\"bytes\"}],\"name\":\"submitClaim\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdrawERC20Tokens\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"This contract inherits `AbstractConsensus` and OpenZeppelin's `Ownable` contract. For more information on `Ownable`, please consult OpenZeppelin's official documentation.\",\"events\":{\"ApplicationJoined(address)\":{\"details\":\"MUST be triggered on a successful call to `join`.\",\"params\":{\"application\":\"The application\"}},\"ConsensusCreated(address,address)\":{\"details\":\"MUST be triggered during construction.\",\"params\":{\"inputBox\":\"The input box from which the authority fetches new inputs\",\"owner\":\"The address that initially owns the `Authority` contract\"}},\"NewHistory(address)\":{\"details\":\"MUST be triggered on a successful call to `setHistory`.\",\"params\":{\"history\":\"The new history contract\"}}},\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Emits a `ConsensusCreated` event.\",\"params\":{\"_inputBox\":\"The input box contract\",\"_owner\":\"The initial contract owner\"}},\"getClaim(address,bytes)\":{\"params\":{\"_dapp\":\"The DApp address\",\"_proofContext\":\"Data for retrieving the desired claim\"},\"returns\":{\"_0\":\"The claimed epoch hash\",\"_1\":\"The index of the first input of the epoch in the input box\",\"_2\":\"The index of the last input of the epoch in the input box\"}},\"getHistory()\":{\"returns\":{\"_0\":\"The current history contract\"}},\"migrateHistoryToConsensus(address)\":{\"details\":\"Can only be called by the `Authority` owner, and the `Authority` contract must have ownership over its current history contract.\",\"params\":{\"_consensus\":\"The new owner of the current history contract\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setHistory(address)\":{\"details\":\"Emits a `NewHistory` event. Can only be called by the `Authority` owner.\",\"params\":{\"_history\":\"The new history contract\"}},\"submitClaim(bytes)\":{\"details\":\"Can only be called by the `Authority` owner, and the `Authority` contract must have ownership over its current history contract.\",\"params\":{\"_claimData\":\"Data for submitting a claim\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"withdrawERC20Tokens(address,address,uint256)\":{\"details\":\"Can only be called by the `Authority` owner.\",\"params\":{\"_amount\":\"The amount of tokens to be withdrawn\",\"_recipient\":\"The recipient address\",\"_token\":\"The token contract\"}}},\"stateVariables\":{\"history\":{\"details\":\"See the `getHistory` and `setHistory` functions.\"}},\"title\":\"Authority consensus\",\"version\":1},\"userdoc\":{\"events\":{\"ApplicationJoined(address)\":{\"notice\":\"An application has joined the consensus' validation set.\"},\"ConsensusCreated(address,address)\":{\"notice\":\"The `Authority` contract was created.\"},\"NewHistory(address)\":{\"notice\":\"A new history contract is used to store claims.\"}},\"kind\":\"user\",\"methods\":{\"constructor\":{\"notice\":\"Constructs an `Authority` contract.\"},\"getClaim(address,bytes)\":{\"notice\":\"Get a claim from the current history. The encoding of `_proofContext` might vary depending on the implementation of the current history contract.\"},\"getHistory()\":{\"notice\":\"Get the current history contract.\"},\"join()\":{\"notice\":\"Emits an `ApplicationJoined` event with the message sender.\"},\"migrateHistoryToConsensus(address)\":{\"notice\":\"Transfer ownership over the current history contract to `_consensus`.\"},\"setHistory(address)\":{\"notice\":\"Make `Authority` point to another history contract.\"},\"submitClaim(bytes)\":{\"notice\":\"Submits a claim to the current history contract. The encoding of `_claimData` might vary depending on the implementation of the current history contract.\"},\"withdrawERC20Tokens(address,address,uint256)\":{\"notice\":\"Transfer some amount of ERC-20 tokens to a recipient.\"}},\"notice\":\"A consensus model controlled by a single address, the owner. Claims are stored in an auxiliary contract called `History`.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/consensus/authority/Authority.sol\":\"Authority\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"contracts/consensus/AbstractConsensus.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\nimport {IConsensus} from \\\"./IConsensus.sol\\\";\\n\\n/// @title Abstract Consensus\\n/// @notice An abstract contract that partially implements `IConsensus`.\\nabstract contract AbstractConsensus is IConsensus {\\n /// @notice Emits an `ApplicationJoined` event with the message sender.\\n function join() external override {\\n emit ApplicationJoined(msg.sender);\\n }\\n}\\n\",\"keccak256\":\"0x0483d8a8557c4e345eca5ad31ffea560737b08c75ade0430106136a89d755e13\",\"license\":\"Apache-2.0\"},\"contracts/consensus/IConsensus.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\n/// @title Consensus interface\\n///\\n/// @notice This contract defines a generic interface for consensuses.\\n/// We use the word \\\"consensus\\\" to designate a contract that provides claims\\n/// in the base layer regarding the state of off-chain machines running in\\n/// the execution layer. How this contract is able to reach consensus, who is\\n/// able to submit claims, and how are claims stored in the base layer are\\n/// some of the implementation details left unspecified by this interface.\\n///\\n/// From the point of view of a DApp, these claims are necessary to validate\\n/// on-chain action allowed by the off-chain machine in the form of vouchers\\n/// and notices. Each claim is composed of three parts: an epoch hash, a first\\n/// index, and a last index. We'll explain each of these parts below.\\n///\\n/// First, let us define the word \\\"epoch\\\". For finality reasons, we need to\\n/// divide the stream of inputs being fed into the off-chain machine into\\n/// batches of inputs, which we call \\\"epoches\\\". At the end of every epoch,\\n/// we summarize the state of the off-chain machine in a single hash, called\\n/// \\\"epoch hash\\\". Please note that this interface does not define how this\\n/// stream of inputs is being chopped up into epoches.\\n///\\n/// The other two parts are simply the indices of the first and last inputs\\n/// accepted during the epoch. Logically, the first index MUST BE less than\\n/// or equal to the last index. As a result, every epoch MUST accept at least\\n/// one input. This assumption stems from the fact that the state of a machine\\n/// can only change after an input is fed into it.\\n///\\n/// Examples of possible implementations of this interface include:\\n///\\n/// * An authority consensus, controlled by a single address who has full\\n/// control over epoch boundaries, claim submission, asset management, etc.\\n///\\n/// * A quorum consensus, controlled by a limited set of validators, that\\n/// vote on the state of the machine at the end of every epoch. Also, epoch\\n/// boundaries are determined by the timestamp in the base layer, and assets\\n/// are split equally amongst the validators.\\n///\\n/// * An NxN consensus, which allows anyone to submit and dispute claims\\n/// in the base layer. Epoch boundaries are determined in the same fashion\\n/// as in the quorum example.\\n///\\ninterface IConsensus {\\n /// @notice An application has joined the consensus' validation set.\\n /// @param application The application\\n /// @dev MUST be triggered on a successful call to `join`.\\n event ApplicationJoined(address application);\\n\\n /// @notice Get a specific claim regarding a specific DApp.\\n /// The encoding of `_proofContext` might vary\\n /// depending on the implementation.\\n /// @param _dapp The DApp address\\n /// @param _proofContext Data for retrieving the desired claim\\n /// @return epochHash_ The claimed epoch hash\\n /// @return firstInputIndex_ The index of the first input of the epoch in the input box\\n /// @return lastInputIndex_ The index of the last input of the epoch in the input box\\n function getClaim(\\n address _dapp,\\n bytes calldata _proofContext\\n )\\n external\\n view\\n returns (\\n bytes32 epochHash_,\\n uint256 firstInputIndex_,\\n uint256 lastInputIndex_\\n );\\n\\n /// @notice Signal the consensus that the message sender wants to join its validation set.\\n /// @dev MUST fire an `ApplicationJoined` event with the message sender as argument.\\n function join() external;\\n}\\n\",\"keccak256\":\"0x5d59c8dc3c1483e3173837d679093000077bf175c0b3ad7f02f0ffe611c0a89e\",\"license\":\"Apache-2.0\"},\"contracts/consensus/authority/Authority.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\nimport {Ownable} from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport {IERC20} from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport {IConsensus} from \\\"../IConsensus.sol\\\";\\nimport {AbstractConsensus} from \\\"../AbstractConsensus.sol\\\";\\nimport {IInputBox} from \\\"../../inputs/IInputBox.sol\\\";\\nimport {IHistory} from \\\"../../history/IHistory.sol\\\";\\n\\n/// @title Authority consensus\\n/// @notice A consensus model controlled by a single address, the owner.\\n/// Claims are stored in an auxiliary contract called `History`.\\n/// @dev This contract inherits `AbstractConsensus` and OpenZeppelin's `Ownable` contract.\\n/// For more information on `Ownable`, please consult OpenZeppelin's official documentation.\\ncontract Authority is AbstractConsensus, Ownable {\\n /// @notice The current history contract.\\n /// @dev See the `getHistory` and `setHistory` functions.\\n IHistory internal history;\\n\\n /// @notice The `Authority` contract was created.\\n /// @param owner The address that initially owns the `Authority` contract\\n /// @param inputBox The input box from which the authority fetches new inputs\\n /// @dev MUST be triggered during construction.\\n event ConsensusCreated(address owner, IInputBox inputBox);\\n\\n /// @notice A new history contract is used to store claims.\\n /// @param history The new history contract\\n /// @dev MUST be triggered on a successful call to `setHistory`.\\n event NewHistory(IHistory history);\\n\\n /// @notice Constructs an `Authority` contract.\\n /// @param _owner The initial contract owner\\n /// @param _inputBox The input box contract\\n /// @dev Emits a `ConsensusCreated` event.\\n constructor(address _owner, IInputBox _inputBox) {\\n // constructor in Ownable already called `transferOwnership(msg.sender)`, so\\n // we only need to call `transferOwnership(_owner)` if _owner != msg.sender\\n if (msg.sender != _owner) {\\n transferOwnership(_owner);\\n }\\n emit ConsensusCreated(_owner, _inputBox);\\n }\\n\\n /// @notice Submits a claim to the current history contract.\\n /// The encoding of `_claimData` might vary depending on the\\n /// implementation of the current history contract.\\n /// @param _claimData Data for submitting a claim\\n /// @dev Can only be called by the `Authority` owner,\\n /// and the `Authority` contract must have ownership over\\n /// its current history contract.\\n function submitClaim(bytes calldata _claimData) external onlyOwner {\\n history.submitClaim(_claimData);\\n }\\n\\n /// @notice Transfer ownership over the current history contract to `_consensus`.\\n /// @param _consensus The new owner of the current history contract\\n /// @dev Can only be called by the `Authority` owner,\\n /// and the `Authority` contract must have ownership over\\n /// its current history contract.\\n function migrateHistoryToConsensus(address _consensus) external onlyOwner {\\n history.migrateToConsensus(_consensus);\\n }\\n\\n /// @notice Make `Authority` point to another history contract.\\n /// @param _history The new history contract\\n /// @dev Emits a `NewHistory` event.\\n /// Can only be called by the `Authority` owner.\\n function setHistory(IHistory _history) external onlyOwner {\\n history = _history;\\n emit NewHistory(_history);\\n }\\n\\n /// @notice Get the current history contract.\\n /// @return The current history contract\\n function getHistory() external view returns (IHistory) {\\n return history;\\n }\\n\\n /// @notice Get a claim from the current history.\\n /// The encoding of `_proofContext` might vary depending on the\\n /// implementation of the current history contract.\\n /// @inheritdoc IConsensus\\n function getClaim(\\n address _dapp,\\n bytes calldata _proofContext\\n ) external view override returns (bytes32, uint256, uint256) {\\n return history.getClaim(_dapp, _proofContext);\\n }\\n\\n /// @notice Transfer some amount of ERC-20 tokens to a recipient.\\n /// @param _token The token contract\\n /// @param _recipient The recipient address\\n /// @param _amount The amount of tokens to be withdrawn\\n /// @dev Can only be called by the `Authority` owner.\\n function withdrawERC20Tokens(\\n IERC20 _token,\\n address _recipient,\\n uint256 _amount\\n ) external onlyOwner {\\n require(\\n _token.transfer(_recipient, _amount),\\n \\\"Authority: withdrawal failed\\\"\\n );\\n }\\n}\\n\",\"keccak256\":\"0x0a37f82a0c924deeb8fa5baa6ff0133054037170dadd0032b81f4c93c3ca1c91\",\"license\":\"Apache-2.0\"},\"contracts/history/IHistory.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\n/// @title History interface\\ninterface IHistory {\\n // Permissioned functions\\n\\n /// @notice Submit a claim.\\n /// The encoding of `_claimData` might vary\\n /// depending on the history implementation.\\n /// @param _claimData Data for submitting a claim\\n /// @dev Should have access control.\\n function submitClaim(bytes calldata _claimData) external;\\n\\n /// @notice Transfer ownership to another consensus.\\n /// @param _consensus The new consensus\\n /// @dev Should have access control.\\n function migrateToConsensus(address _consensus) external;\\n\\n // Permissionless functions\\n\\n /// @notice Get a specific claim regarding a specific DApp.\\n /// The encoding of `_proofContext` might vary\\n /// depending on the history implementation.\\n /// @param _dapp The DApp address\\n /// @param _proofContext Data for retrieving the desired claim\\n /// @return epochHash_ The claimed epoch hash\\n /// @return firstInputIndex_ The index of the first input of the epoch in the input box\\n /// @return lastInputIndex_ The index of the last input of the epoch in the input box\\n function getClaim(\\n address _dapp,\\n bytes calldata _proofContext\\n )\\n external\\n view\\n returns (\\n bytes32 epochHash_,\\n uint256 firstInputIndex_,\\n uint256 lastInputIndex_\\n );\\n}\\n\",\"keccak256\":\"0xfe0404f078a3a6f761beea8afbb2fac322fd2900f7ad2e2b866504c7aa54568f\",\"license\":\"Apache-2.0\"},\"contracts/inputs/IInputBox.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\n/// @title Input Box interface\\ninterface IInputBox {\\n /// @notice Emitted when an input is added to a DApp's input box.\\n /// @param dapp The address of the DApp\\n /// @param inboxInputIndex The index of the input in the input box\\n /// @param sender The address that sent the input\\n /// @param input The contents of the input\\n /// @dev MUST be triggered on a successful call to `addInput`.\\n event InputAdded(\\n address indexed dapp,\\n uint256 indexed inboxInputIndex,\\n address sender,\\n bytes input\\n );\\n\\n /// @notice Add an input to a DApp's input box.\\n /// @param _dapp The address of the DApp\\n /// @param _input The contents of the input\\n /// @return The hash of the input plus some extra metadata\\n /// @dev MUST fire an `InputAdded` event accordingly.\\n function addInput(\\n address _dapp,\\n bytes calldata _input\\n ) external returns (bytes32);\\n\\n /// @notice Get the number of inputs in a DApp's input box.\\n /// @param _dapp The address of the DApp\\n /// @return Number of inputs in the DApp's input box\\n function getNumberOfInputs(address _dapp) external view returns (uint256);\\n\\n /// @notice Get the hash of an input in a DApp's input box.\\n /// @param _dapp The address of the DApp\\n /// @param _index The index of the input in the DApp's input box\\n /// @return The hash of the input at the provided index in the DApp's input box\\n /// @dev `_index` MUST be in the interval `[0,n)` where `n` is the number of\\n /// inputs in the DApp's input box. See the `getNumberOfInputs` function.\\n function getInputHash(\\n address _dapp,\\n uint256 _index\\n ) external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x2addd467a24cde2131784103080aeb28df40d87ba19c5fd92bf96c0c074603df\",\"license\":\"Apache-2.0\"}},\"version\":1}", - "bytecode": "0x608060405234801561001057600080fd5b506040516109ef3803806109ef83398101604081905261002f916101da565b6100383361009b565b336001600160a01b0383161461005157610051826100eb565b604080516001600160a01b038085168252831660208201527f583f764398dc1f7529b3e4472cb331312f6b6d76744da14476f571a330d36e23910160405180910390a15050610214565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6100f3610169565b6001600160a01b03811661015d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b6101668161009b565b50565b6000546001600160a01b031633146101c35760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610154565b565b6001600160a01b038116811461016657600080fd5b600080604083850312156101ed57600080fd5b82516101f8816101c5565b6020840151909250610209816101c5565b809150509250929050565b6107cc806102236000396000f3fe608060405234801561001057600080fd5b506004361061009e5760003560e01c8063b688a36311610066578063b688a3631461010e578063bcdd1e1314610116578063d79a824014610129578063ddfdfbb014610157578063f2fde38b1461016a57600080fd5b8063159c5ea1146100a3578063715018a6146100b85780638da5cb5b146100c05780639368a3d3146100ea578063aa15efc8146100fd575b600080fd5b6100b66100b136600461058e565b61017d565b005b6100b66101d9565b6000546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b6100b66100f836600461058e565b6101ed565b6001546001600160a01b03166100cd565b6100b6610257565b6100b66101243660046105b2565b61028c565b61013c61013736600461063c565b61035d565b604080519384526020840192909252908201526060016100e1565b6100b6610165366004610691565b6103e6565b6100b661017836600461058e565b610456565b6101856104cf565b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f2bcd43869347a1d42f97ac6042f3d129817abd05a6125f9750fe3724e321d23e9060200160405180910390a150565b6101e16104cf565b6101eb6000610529565b565b6101f56104cf565b60015460405163fc41168360e01b81526001600160a01b0383811660048301529091169063fc41168390602401600060405180830381600087803b15801561023c57600080fd5b505af1158015610250573d6000803e3d6000fd5b5050505050565b6040513381527f27c2b702d3bff195a18baca2daf00b20a986177c5f1449af4e2d46a3c3e02ce59060200160405180910390a1565b6102946104cf565b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af11580156102e3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061030791906106d3565b6103585760405162461bcd60e51b815260206004820152601c60248201527f417574686f726974793a207769746864726177616c206661696c65640000000060448201526064015b60405180910390fd5b505050565b60015460405163035e6a0960e61b8152600091829182916001600160a01b03169063d79a8240906103969089908990899060040161071e565b606060405180830381865afa1580156103b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103d7919061074c565b92509250925093509350939050565b6103ee6104cf565b600154604051630ddfdfbb60e41b81526001600160a01b039091169063ddfdfbb090610420908590859060040161077a565b600060405180830381600087803b15801561043a57600080fd5b505af115801561044e573d6000803e3d6000fd5b505050505050565b61045e6104cf565b6001600160a01b0381166104c35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161034f565b6104cc81610529565b50565b6000546001600160a01b031633146101eb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161034f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146104cc57600080fd5b6000602082840312156105a057600080fd5b81356105ab81610579565b9392505050565b6000806000606084860312156105c757600080fd5b83356105d281610579565b925060208401356105e281610579565b929592945050506040919091013590565b60008083601f84011261060557600080fd5b50813567ffffffffffffffff81111561061d57600080fd5b60208301915083602082850101111561063557600080fd5b9250929050565b60008060006040848603121561065157600080fd5b833561065c81610579565b9250602084013567ffffffffffffffff81111561067857600080fd5b610684868287016105f3565b9497909650939450505050565b600080602083850312156106a457600080fd5b823567ffffffffffffffff8111156106bb57600080fd5b6106c7858286016105f3565b90969095509350505050565b6000602082840312156106e557600080fd5b815180151581146105ab57600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b038416815260406020820181905260009061074390830184866106f5565b95945050505050565b60008060006060848603121561076157600080fd5b8351925060208401519150604084015190509250925092565b60208152600061078e6020830184866106f5565b94935050505056fea264697066735822122021f66c26bc1cded7ab5457f04d0a74c5257b6aa88e7d69d7f9ad0713ba4679e664736f6c63430008130033", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061009e5760003560e01c8063b688a36311610066578063b688a3631461010e578063bcdd1e1314610116578063d79a824014610129578063ddfdfbb014610157578063f2fde38b1461016a57600080fd5b8063159c5ea1146100a3578063715018a6146100b85780638da5cb5b146100c05780639368a3d3146100ea578063aa15efc8146100fd575b600080fd5b6100b66100b136600461058e565b61017d565b005b6100b66101d9565b6000546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b6100b66100f836600461058e565b6101ed565b6001546001600160a01b03166100cd565b6100b6610257565b6100b66101243660046105b2565b61028c565b61013c61013736600461063c565b61035d565b604080519384526020840192909252908201526060016100e1565b6100b6610165366004610691565b6103e6565b6100b661017836600461058e565b610456565b6101856104cf565b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f2bcd43869347a1d42f97ac6042f3d129817abd05a6125f9750fe3724e321d23e9060200160405180910390a150565b6101e16104cf565b6101eb6000610529565b565b6101f56104cf565b60015460405163fc41168360e01b81526001600160a01b0383811660048301529091169063fc41168390602401600060405180830381600087803b15801561023c57600080fd5b505af1158015610250573d6000803e3d6000fd5b5050505050565b6040513381527f27c2b702d3bff195a18baca2daf00b20a986177c5f1449af4e2d46a3c3e02ce59060200160405180910390a1565b6102946104cf565b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af11580156102e3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061030791906106d3565b6103585760405162461bcd60e51b815260206004820152601c60248201527f417574686f726974793a207769746864726177616c206661696c65640000000060448201526064015b60405180910390fd5b505050565b60015460405163035e6a0960e61b8152600091829182916001600160a01b03169063d79a8240906103969089908990899060040161071e565b606060405180830381865afa1580156103b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103d7919061074c565b92509250925093509350939050565b6103ee6104cf565b600154604051630ddfdfbb60e41b81526001600160a01b039091169063ddfdfbb090610420908590859060040161077a565b600060405180830381600087803b15801561043a57600080fd5b505af115801561044e573d6000803e3d6000fd5b505050505050565b61045e6104cf565b6001600160a01b0381166104c35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161034f565b6104cc81610529565b50565b6000546001600160a01b031633146101eb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161034f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146104cc57600080fd5b6000602082840312156105a057600080fd5b81356105ab81610579565b9392505050565b6000806000606084860312156105c757600080fd5b83356105d281610579565b925060208401356105e281610579565b929592945050506040919091013590565b60008083601f84011261060557600080fd5b50813567ffffffffffffffff81111561061d57600080fd5b60208301915083602082850101111561063557600080fd5b9250929050565b60008060006040848603121561065157600080fd5b833561065c81610579565b9250602084013567ffffffffffffffff81111561067857600080fd5b610684868287016105f3565b9497909650939450505050565b600080602083850312156106a457600080fd5b823567ffffffffffffffff8111156106bb57600080fd5b6106c7858286016105f3565b90969095509350505050565b6000602082840312156106e557600080fd5b815180151581146105ab57600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b038416815260406020820181905260009061074390830184866106f5565b95945050505050565b60008060006060848603121561076157600080fd5b8351925060208401519150604084015190509250925092565b60208152600061078e6020830184866106f5565b94935050505056fea264697066735822122021f66c26bc1cded7ab5457f04d0a74c5257b6aa88e7d69d7f9ad0713ba4679e664736f6c63430008130033", - "devdoc": { - "details": "This contract inherits `AbstractConsensus` and OpenZeppelin's `Ownable` contract. For more information on `Ownable`, please consult OpenZeppelin's official documentation.", - "events": { - "ApplicationJoined(address)": { - "details": "MUST be triggered on a successful call to `join`.", - "params": { - "application": "The application" - } - }, - "ConsensusCreated(address,address)": { - "details": "MUST be triggered during construction.", - "params": { - "inputBox": "The input box from which the authority fetches new inputs", - "owner": "The address that initially owns the `Authority` contract" - } - }, - "NewHistory(address)": { - "details": "MUST be triggered on a successful call to `setHistory`.", - "params": { - "history": "The new history contract" - } - } - }, - "kind": "dev", - "methods": { - "constructor": { - "details": "Emits a `ConsensusCreated` event.", - "params": { - "_inputBox": "The input box contract", - "_owner": "The initial contract owner" - } - }, - "getClaim(address,bytes)": { - "params": { - "_dapp": "The DApp address", - "_proofContext": "Data for retrieving the desired claim" - }, - "returns": { - "_0": "The claimed epoch hash", - "_1": "The index of the first input of the epoch in the input box", - "_2": "The index of the last input of the epoch in the input box" - } - }, - "getHistory()": { - "returns": { - "_0": "The current history contract" - } - }, - "migrateHistoryToConsensus(address)": { - "details": "Can only be called by the `Authority` owner, and the `Authority` contract must have ownership over its current history contract.", - "params": { - "_consensus": "The new owner of the current history contract" - } - }, - "owner()": { - "details": "Returns the address of the current owner." - }, - "renounceOwnership()": { - "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." - }, - "setHistory(address)": { - "details": "Emits a `NewHistory` event. Can only be called by the `Authority` owner.", - "params": { - "_history": "The new history contract" - } - }, - "submitClaim(bytes)": { - "details": "Can only be called by the `Authority` owner, and the `Authority` contract must have ownership over its current history contract.", - "params": { - "_claimData": "Data for submitting a claim" - } - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." - }, - "withdrawERC20Tokens(address,address,uint256)": { - "details": "Can only be called by the `Authority` owner.", - "params": { - "_amount": "The amount of tokens to be withdrawn", - "_recipient": "The recipient address", - "_token": "The token contract" - } - } - }, - "stateVariables": { - "history": { - "details": "See the `getHistory` and `setHistory` functions." - } - }, - "title": "Authority consensus", - "version": 1 - }, - "userdoc": { - "events": { - "ApplicationJoined(address)": { - "notice": "An application has joined the consensus' validation set." - }, - "ConsensusCreated(address,address)": { - "notice": "The `Authority` contract was created." - }, - "NewHistory(address)": { - "notice": "A new history contract is used to store claims." - } - }, - "kind": "user", - "methods": { - "constructor": { - "notice": "Constructs an `Authority` contract." - }, - "getClaim(address,bytes)": { - "notice": "Get a claim from the current history. The encoding of `_proofContext` might vary depending on the implementation of the current history contract." - }, - "getHistory()": { - "notice": "Get the current history contract." - }, - "join()": { - "notice": "Emits an `ApplicationJoined` event with the message sender." - }, - "migrateHistoryToConsensus(address)": { - "notice": "Transfer ownership over the current history contract to `_consensus`." - }, - "setHistory(address)": { - "notice": "Make `Authority` point to another history contract." - }, - "submitClaim(bytes)": { - "notice": "Submits a claim to the current history contract. The encoding of `_claimData` might vary depending on the implementation of the current history contract." - }, - "withdrawERC20Tokens(address,address,uint256)": { - "notice": "Transfer some amount of ERC-20 tokens to a recipient." - } - }, - "notice": "A consensus model controlled by a single address, the owner. Claims are stored in an auxiliary contract called `History`.", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 1155, - "contract": "contracts/consensus/authority/Authority.sol:Authority", - "label": "_owner", - "offset": 0, - "slot": "0", - "type": "t_address" - }, - { - "astId": 2248, - "contract": "contracts/consensus/authority/Authority.sol:Authority", - "label": "history", - "offset": 0, - "slot": "1", - "type": "t_contract(IHistory)3266" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_contract(IHistory)3266": { - "encoding": "inplace", - "label": "contract IHistory", - "numberOfBytes": "20" - } - } - } -} \ No newline at end of file diff --git a/onchain/rollups/deployments/bsc_testnet/History.json b/onchain/rollups/deployments/bsc_testnet/History.json deleted file mode 100644 index 691417643..000000000 --- a/onchain/rollups/deployments/bsc_testnet/History.json +++ /dev/null @@ -1,381 +0,0 @@ -{ - "address": "0xFB34DaDd5f3Aba55004C448AcFd24fAF5A4Ff83E", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_owner", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "dapp", - "type": "address" - }, - { - "components": [ - { - "internalType": "bytes32", - "name": "epochHash", - "type": "bytes32" - }, - { - "internalType": "uint128", - "name": "firstIndex", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "lastIndex", - "type": "uint128" - } - ], - "indexed": false, - "internalType": "struct History.Claim", - "name": "claim", - "type": "tuple" - } - ], - "name": "NewClaimToHistory", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_dapp", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_proofContext", - "type": "bytes" - } - ], - "name": "getClaim", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_consensus", - "type": "address" - } - ], - "name": "migrateToConsensus", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "_claimData", - "type": "bytes" - } - ], - "name": "submitClaim", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0xaa2d85412bd19a8dad87bae97c3a91906d8d6cd19e957630cefb9b58e6d19ae4", - "receipt": { - "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", - "from": "0x18930e8a66a1DbE21D00581216789AAB7460Afd0", - "contractAddress": null, - "transactionIndex": 5, - "gasUsed": "495374", - "logsBloom": "0x00000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000100000000000002000000000000000000000000100000000000001000000000000010000000000000000000000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000000000001000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000020000000000000000000000000800000000080000000000000000000000000000000", - "blockHash": "0xffb97bb754071cd859680acfc441f5e80e1028520a5bf0e76a98eb6c6898c4a4", - "transactionHash": "0xaa2d85412bd19a8dad87bae97c3a91906d8d6cd19e957630cefb9b58e6d19ae4", - "logs": [ - { - "transactionIndex": 5, - "blockNumber": 29884215, - "transactionHash": "0xaa2d85412bd19a8dad87bae97c3a91906d8d6cd19e957630cefb9b58e6d19ae4", - "address": "0xFB34DaDd5f3Aba55004C448AcFd24fAF5A4Ff83E", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000004e59b44847b379578588920ca78fbf26c0b4956c" - ], - "data": "0x", - "logIndex": 15, - "blockHash": "0xffb97bb754071cd859680acfc441f5e80e1028520a5bf0e76a98eb6c6898c4a4" - }, - { - "transactionIndex": 5, - "blockNumber": 29884215, - "transactionHash": "0xaa2d85412bd19a8dad87bae97c3a91906d8d6cd19e957630cefb9b58e6d19ae4", - "address": "0xFB34DaDd5f3Aba55004C448AcFd24fAF5A4Ff83E", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000004e59b44847b379578588920ca78fbf26c0b4956c", - "0x00000000000000000000000035ec7d70caff883844d94b54cd19634ffab5d8cc" - ], - "data": "0x", - "logIndex": 16, - "blockHash": "0xffb97bb754071cd859680acfc441f5e80e1028520a5bf0e76a98eb6c6898c4a4" - } - ], - "blockNumber": 29884215, - "cumulativeGasUsed": "1172826", - "status": 1, - "byzantium": true - }, - "args": [ - "0x35EC7d70cAff883844d94b54cD19634fFAb5d8CC" - ], - "numDeployments": 5, - "solcInputHash": "ccf852a6f03ad282136085842817ac99", - "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dapp\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"epochHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint128\",\"name\":\"firstIndex\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"lastIndex\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"struct History.Claim\",\"name\":\"claim\",\"type\":\"tuple\"}],\"name\":\"NewClaimToHistory\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dapp\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_proofContext\",\"type\":\"bytes\"}],\"name\":\"getClaim\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_consensus\",\"type\":\"address\"}],\"name\":\"migrateToConsensus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_claimData\",\"type\":\"bytes\"}],\"name\":\"submitClaim\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"This contract inherits OpenZeppelin's `Ownable` contract. For more information on `Ownable`, please consult OpenZeppelin's official documentation.\",\"events\":{\"NewClaimToHistory(address,(bytes32,uint128,uint128))\":{\"details\":\"MUST be triggered on a successful call to `submitClaim`.\",\"params\":{\"claim\":\"The newly-submitted claim\",\"dapp\":\"The address of the DApp\"}}},\"kind\":\"dev\",\"methods\":{\"constructor\":{\"params\":{\"_owner\":\"The initial owner\"}},\"getClaim(address,bytes)\":{\"params\":{\"_dapp\":\"The DApp address\",\"_proofContext\":\"Data for retrieving the desired claim\"},\"returns\":{\"_0\":\"The claimed epoch hash\",\"_1\":\"The index of the first input of the epoch in the input box\",\"_2\":\"The index of the last input of the epoch in the input box\"}},\"migrateToConsensus(address)\":{\"details\":\"Emits an `OwnershipTransferred` event. Should have access control.\",\"params\":{\"_consensus\":\"The new consensus\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"submitClaim(bytes)\":{\"details\":\"Emits a `NewClaimToHistory` event. Should have access control.\",\"params\":{\"_claimData\":\"Data for submitting a claim\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"stateVariables\":{\"claims\":{\"details\":\"See the `getClaim` and `submitClaim` functions.\"}},\"title\":\"Simple History\",\"version\":1},\"userdoc\":{\"events\":{\"NewClaimToHistory(address,(bytes32,uint128,uint128))\":{\"notice\":\"A new claim regarding a specific DApp was submitted.\"}},\"kind\":\"user\",\"methods\":{\"constructor\":{\"notice\":\"Creates a `History` contract.\"},\"getClaim(address,bytes)\":{\"notice\":\"Get a specific claim regarding a specific DApp. There are several requirements for this function to be called successfully. * `_proofContext` MUST be well-encoded. In Solidity, it can be constructed as `abi.encode(claimIndex)`, where `claimIndex` is the claim index (type `uint256`). * `claimIndex` MUST be inside the interval `[0, n)` where `n` is the number of claims that have been submitted to `_dapp` already.\"},\"migrateToConsensus(address)\":{\"notice\":\"Transfer ownership to another consensus.\"},\"submitClaim(bytes)\":{\"notice\":\"Submit a claim regarding a DApp. There are several requirements for this function to be called successfully. * `_claimData` MUST be well-encoded. In Solidity, it can be constructed as `abi.encode(dapp, claim)`, where `dapp` is the DApp address (type `address`) and `claim` is the claim structure (type `Claim`). * `firstIndex` MUST be less than or equal to `lastIndex`. As a result, every claim MUST encompass AT LEAST one input. * If this is the DApp's first claim, then `firstIndex` MUST be `0`. Otherwise, `firstIndex` MUST be the `lastClaim.lastIndex + 1`. In other words, claims MUST NOT skip inputs.\"}},\"notice\":\"This contract stores claims for each DApp individually. This means that, for each DApp, the contract stores an array of `Claim` entries, where each `Claim` is composed of: * An epoch hash (`bytes32`) * A closed interval of input indices (`uint128`, `uint128`) The contract guarantees that the first interval starts at index 0, and that the following intervals don't have gaps or overlaps. Furthermore, claims can only be submitted by the contract owner through `submitClaim`, but can be retrieved by anyone with `getClaim`.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/history/History.sol\":\"History\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"contracts/history/History.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\nimport {Ownable} from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\nimport {IHistory} from \\\"./IHistory.sol\\\";\\n\\n/// @title Simple History\\n///\\n/// @notice This contract stores claims for each DApp individually.\\n/// This means that, for each DApp, the contract stores an array of\\n/// `Claim` entries, where each `Claim` is composed of:\\n///\\n/// * An epoch hash (`bytes32`)\\n/// * A closed interval of input indices (`uint128`, `uint128`)\\n///\\n/// The contract guarantees that the first interval starts at index 0,\\n/// and that the following intervals don't have gaps or overlaps.\\n///\\n/// Furthermore, claims can only be submitted by the contract owner\\n/// through `submitClaim`, but can be retrieved by anyone with `getClaim`.\\n///\\n/// @dev This contract inherits OpenZeppelin's `Ownable` contract.\\n/// For more information on `Ownable`, please consult OpenZeppelin's official documentation.\\ncontract History is IHistory, Ownable {\\n struct Claim {\\n bytes32 epochHash;\\n uint128 firstIndex;\\n uint128 lastIndex;\\n }\\n\\n /// @notice Mapping from DApp address to array of claims.\\n /// @dev See the `getClaim` and `submitClaim` functions.\\n mapping(address => Claim[]) internal claims;\\n\\n /// @notice A new claim regarding a specific DApp was submitted.\\n /// @param dapp The address of the DApp\\n /// @param claim The newly-submitted claim\\n /// @dev MUST be triggered on a successful call to `submitClaim`.\\n event NewClaimToHistory(address indexed dapp, Claim claim);\\n\\n /// @notice Creates a `History` contract.\\n /// @param _owner The initial owner\\n constructor(address _owner) {\\n // constructor in Ownable already called `transferOwnership(msg.sender)`, so\\n // we only need to call `transferOwnership(_owner)` if _owner != msg.sender\\n if (_owner != msg.sender) {\\n transferOwnership(_owner);\\n }\\n }\\n\\n /// @notice Submit a claim regarding a DApp.\\n /// There are several requirements for this function to be called successfully.\\n ///\\n /// * `_claimData` MUST be well-encoded. In Solidity, it can be constructed\\n /// as `abi.encode(dapp, claim)`, where `dapp` is the DApp address (type `address`)\\n /// and `claim` is the claim structure (type `Claim`).\\n ///\\n /// * `firstIndex` MUST be less than or equal to `lastIndex`.\\n /// As a result, every claim MUST encompass AT LEAST one input.\\n ///\\n /// * If this is the DApp's first claim, then `firstIndex` MUST be `0`.\\n /// Otherwise, `firstIndex` MUST be the `lastClaim.lastIndex + 1`.\\n /// In other words, claims MUST NOT skip inputs.\\n ///\\n /// @inheritdoc IHistory\\n /// @dev Emits a `NewClaimToHistory` event. Should have access control.\\n function submitClaim(\\n bytes calldata _claimData\\n ) external override onlyOwner {\\n (address dapp, Claim memory claim) = abi.decode(\\n _claimData,\\n (address, Claim)\\n );\\n\\n require(claim.firstIndex <= claim.lastIndex, \\\"History: FI > LI\\\");\\n\\n Claim[] storage dappClaims = claims[dapp];\\n uint256 numDAppClaims = dappClaims.length;\\n\\n require(\\n claim.firstIndex ==\\n (\\n (numDAppClaims == 0)\\n ? 0\\n : (dappClaims[numDAppClaims - 1].lastIndex + 1)\\n ),\\n \\\"History: unclaimed inputs\\\"\\n );\\n\\n dappClaims.push(claim);\\n\\n emit NewClaimToHistory(dapp, claim);\\n }\\n\\n /// @notice Get a specific claim regarding a specific DApp.\\n /// There are several requirements for this function to be called successfully.\\n ///\\n /// * `_proofContext` MUST be well-encoded. In Solidity, it can be constructed\\n /// as `abi.encode(claimIndex)`, where `claimIndex` is the claim index (type `uint256`).\\n ///\\n /// * `claimIndex` MUST be inside the interval `[0, n)` where `n` is the number of claims\\n /// that have been submitted to `_dapp` already.\\n ///\\n /// @inheritdoc IHistory\\n function getClaim(\\n address _dapp,\\n bytes calldata _proofContext\\n ) external view override returns (bytes32, uint256, uint256) {\\n uint256 claimIndex = abi.decode(_proofContext, (uint256));\\n\\n Claim memory claim = claims[_dapp][claimIndex];\\n\\n return (claim.epochHash, claim.firstIndex, claim.lastIndex);\\n }\\n\\n /// @inheritdoc IHistory\\n /// @dev Emits an `OwnershipTransferred` event. Should have access control.\\n function migrateToConsensus(\\n address _consensus\\n ) external override onlyOwner {\\n transferOwnership(_consensus);\\n }\\n}\\n\",\"keccak256\":\"0x607253a9e73d3fe0b98e2c5d7b6f9ee1dad48d7cf4a1284b4f1361d74178da7a\",\"license\":\"Apache-2.0\"},\"contracts/history/IHistory.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\n/// @title History interface\\ninterface IHistory {\\n // Permissioned functions\\n\\n /// @notice Submit a claim.\\n /// The encoding of `_claimData` might vary\\n /// depending on the history implementation.\\n /// @param _claimData Data for submitting a claim\\n /// @dev Should have access control.\\n function submitClaim(bytes calldata _claimData) external;\\n\\n /// @notice Transfer ownership to another consensus.\\n /// @param _consensus The new consensus\\n /// @dev Should have access control.\\n function migrateToConsensus(address _consensus) external;\\n\\n // Permissionless functions\\n\\n /// @notice Get a specific claim regarding a specific DApp.\\n /// The encoding of `_proofContext` might vary\\n /// depending on the history implementation.\\n /// @param _dapp The DApp address\\n /// @param _proofContext Data for retrieving the desired claim\\n /// @return epochHash_ The claimed epoch hash\\n /// @return firstInputIndex_ The index of the first input of the epoch in the input box\\n /// @return lastInputIndex_ The index of the last input of the epoch in the input box\\n function getClaim(\\n address _dapp,\\n bytes calldata _proofContext\\n )\\n external\\n view\\n returns (\\n bytes32 epochHash_,\\n uint256 firstInputIndex_,\\n uint256 lastInputIndex_\\n );\\n}\\n\",\"keccak256\":\"0xfe0404f078a3a6f761beea8afbb2fac322fd2900f7ad2e2b866504c7aa54568f\",\"license\":\"Apache-2.0\"}},\"version\":1}", - "bytecode": "0x608060405234801561001057600080fd5b5060405161091f38038061091f83398101604081905261002f91610181565b61003833610057565b6001600160a01b038116331461005157610051816100a7565b506101b1565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6100af610125565b6001600160a01b0381166101195760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b61012281610057565b50565b6000546001600160a01b0316331461017f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610110565b565b60006020828403121561019357600080fd5b81516001600160a01b03811681146101aa57600080fd5b9392505050565b61075f806101c06000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c8063715018a6146100675780638da5cb5b14610071578063d79a824014610091578063ddfdfbb0146100bf578063f2fde38b146100d2578063fc411683146100e5575b600080fd5b61006f6100f8565b005b6000546040516001600160a01b0390911681526020015b60405180910390f35b6100a461009f36600461052f565b61010c565b60408051938452602084019290925290820152606001610088565b61006f6100cd366004610584565b6101a5565b61006f6100e03660046105c6565b61039d565b61006f6100f33660046105c6565b610416565b610100610427565b61010a6000610481565b565b600080808061011d858701876105ea565b6001600160a01b0388166000908152600160205260408120805492935090918390811061014c5761014c610603565b60009182526020918290206040805160608101825260029390930290910180548084526001909101546001600160801b03808216958501869052600160801b90910416929091018290529a919950975095505050505050565b6101ad610427565b6000806101bc83850185610635565b9150915080604001516001600160801b031681602001516001600160801b031611156102225760405162461bcd60e51b815260206004820152601060248201526f486973746f72793a204649203e204c4960801b60448201526064015b60405180910390fd5b6001600160a01b038216600090815260016020526040902080548015610294578161024e6001836106e9565b8154811061025e5761025e610603565b906000526020600020906002020160010160109054906101000a90046001600160801b0316600161028f9190610702565b610297565b60005b6001600160801b031683602001516001600160801b0316146102fb5760405162461bcd60e51b815260206004820152601960248201527f486973746f72793a20756e636c61696d656420696e70757473000000000000006044820152606401610219565b8154600180820184556000848152602090819020865160029094020183815586820180516040808a0180516001600160801b03938416600160801b9185169190910217949096019390935582519586529051811692850192909252915116908201526001600160a01b038516907fb71880d7a0c514d48c0296b2721b0a4f9641a45117960f2ca86b5b7873c4ab2f9060600160405180910390a2505050505050565b6103a5610427565b6001600160a01b03811661040a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610219565b61041381610481565b50565b61041e610427565b6104138161039d565b6000546001600160a01b0316331461010a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610219565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038116811461041357600080fd5b60008083601f8401126104f857600080fd5b50813567ffffffffffffffff81111561051057600080fd5b60208301915083602082850101111561052857600080fd5b9250929050565b60008060006040848603121561054457600080fd5b833561054f816104d1565b9250602084013567ffffffffffffffff81111561056b57600080fd5b610577868287016104e6565b9497909650939450505050565b6000806020838503121561059757600080fd5b823567ffffffffffffffff8111156105ae57600080fd5b6105ba858286016104e6565b90969095509350505050565b6000602082840312156105d857600080fd5b81356105e3816104d1565b9392505050565b6000602082840312156105fc57600080fd5b5035919050565b634e487b7160e01b600052603260045260246000fd5b80356001600160801b038116811461063057600080fd5b919050565b600080828403608081121561064957600080fd5b8335610654816104d1565b92506060601f198201121561066857600080fd5b506040516060810181811067ffffffffffffffff8211171561069a57634e487b7160e01b600052604160045260246000fd5b8060405250602084013581526106b260408501610619565b60208201526106c360608501610619565b6040820152809150509250929050565b634e487b7160e01b600052601160045260246000fd5b818103818111156106fc576106fc6106d3565b92915050565b6001600160801b03818116838216019080821115610722576107226106d3565b509291505056fea26469706673582212201fc5dfb9d50cb3efefe40c7ced59b7b296f6d072ed8005ef3de36946cd77e28364736f6c63430008130033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100625760003560e01c8063715018a6146100675780638da5cb5b14610071578063d79a824014610091578063ddfdfbb0146100bf578063f2fde38b146100d2578063fc411683146100e5575b600080fd5b61006f6100f8565b005b6000546040516001600160a01b0390911681526020015b60405180910390f35b6100a461009f36600461052f565b61010c565b60408051938452602084019290925290820152606001610088565b61006f6100cd366004610584565b6101a5565b61006f6100e03660046105c6565b61039d565b61006f6100f33660046105c6565b610416565b610100610427565b61010a6000610481565b565b600080808061011d858701876105ea565b6001600160a01b0388166000908152600160205260408120805492935090918390811061014c5761014c610603565b60009182526020918290206040805160608101825260029390930290910180548084526001909101546001600160801b03808216958501869052600160801b90910416929091018290529a919950975095505050505050565b6101ad610427565b6000806101bc83850185610635565b9150915080604001516001600160801b031681602001516001600160801b031611156102225760405162461bcd60e51b815260206004820152601060248201526f486973746f72793a204649203e204c4960801b60448201526064015b60405180910390fd5b6001600160a01b038216600090815260016020526040902080548015610294578161024e6001836106e9565b8154811061025e5761025e610603565b906000526020600020906002020160010160109054906101000a90046001600160801b0316600161028f9190610702565b610297565b60005b6001600160801b031683602001516001600160801b0316146102fb5760405162461bcd60e51b815260206004820152601960248201527f486973746f72793a20756e636c61696d656420696e70757473000000000000006044820152606401610219565b8154600180820184556000848152602090819020865160029094020183815586820180516040808a0180516001600160801b03938416600160801b9185169190910217949096019390935582519586529051811692850192909252915116908201526001600160a01b038516907fb71880d7a0c514d48c0296b2721b0a4f9641a45117960f2ca86b5b7873c4ab2f9060600160405180910390a2505050505050565b6103a5610427565b6001600160a01b03811661040a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610219565b61041381610481565b50565b61041e610427565b6104138161039d565b6000546001600160a01b0316331461010a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610219565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038116811461041357600080fd5b60008083601f8401126104f857600080fd5b50813567ffffffffffffffff81111561051057600080fd5b60208301915083602082850101111561052857600080fd5b9250929050565b60008060006040848603121561054457600080fd5b833561054f816104d1565b9250602084013567ffffffffffffffff81111561056b57600080fd5b610577868287016104e6565b9497909650939450505050565b6000806020838503121561059757600080fd5b823567ffffffffffffffff8111156105ae57600080fd5b6105ba858286016104e6565b90969095509350505050565b6000602082840312156105d857600080fd5b81356105e3816104d1565b9392505050565b6000602082840312156105fc57600080fd5b5035919050565b634e487b7160e01b600052603260045260246000fd5b80356001600160801b038116811461063057600080fd5b919050565b600080828403608081121561064957600080fd5b8335610654816104d1565b92506060601f198201121561066857600080fd5b506040516060810181811067ffffffffffffffff8211171561069a57634e487b7160e01b600052604160045260246000fd5b8060405250602084013581526106b260408501610619565b60208201526106c360608501610619565b6040820152809150509250929050565b634e487b7160e01b600052601160045260246000fd5b818103818111156106fc576106fc6106d3565b92915050565b6001600160801b03818116838216019080821115610722576107226106d3565b509291505056fea26469706673582212201fc5dfb9d50cb3efefe40c7ced59b7b296f6d072ed8005ef3de36946cd77e28364736f6c63430008130033", - "devdoc": { - "details": "This contract inherits OpenZeppelin's `Ownable` contract. For more information on `Ownable`, please consult OpenZeppelin's official documentation.", - "events": { - "NewClaimToHistory(address,(bytes32,uint128,uint128))": { - "details": "MUST be triggered on a successful call to `submitClaim`.", - "params": { - "claim": "The newly-submitted claim", - "dapp": "The address of the DApp" - } - } - }, - "kind": "dev", - "methods": { - "constructor": { - "params": { - "_owner": "The initial owner" - } - }, - "getClaim(address,bytes)": { - "params": { - "_dapp": "The DApp address", - "_proofContext": "Data for retrieving the desired claim" - }, - "returns": { - "_0": "The claimed epoch hash", - "_1": "The index of the first input of the epoch in the input box", - "_2": "The index of the last input of the epoch in the input box" - } - }, - "migrateToConsensus(address)": { - "details": "Emits an `OwnershipTransferred` event. Should have access control.", - "params": { - "_consensus": "The new consensus" - } - }, - "owner()": { - "details": "Returns the address of the current owner." - }, - "renounceOwnership()": { - "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." - }, - "submitClaim(bytes)": { - "details": "Emits a `NewClaimToHistory` event. Should have access control.", - "params": { - "_claimData": "Data for submitting a claim" - } - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." - } - }, - "stateVariables": { - "claims": { - "details": "See the `getClaim` and `submitClaim` functions." - } - }, - "title": "Simple History", - "version": 1 - }, - "userdoc": { - "events": { - "NewClaimToHistory(address,(bytes32,uint128,uint128))": { - "notice": "A new claim regarding a specific DApp was submitted." - } - }, - "kind": "user", - "methods": { - "constructor": { - "notice": "Creates a `History` contract." - }, - "getClaim(address,bytes)": { - "notice": "Get a specific claim regarding a specific DApp. There are several requirements for this function to be called successfully. * `_proofContext` MUST be well-encoded. In Solidity, it can be constructed as `abi.encode(claimIndex)`, where `claimIndex` is the claim index (type `uint256`). * `claimIndex` MUST be inside the interval `[0, n)` where `n` is the number of claims that have been submitted to `_dapp` already." - }, - "migrateToConsensus(address)": { - "notice": "Transfer ownership to another consensus." - }, - "submitClaim(bytes)": { - "notice": "Submit a claim regarding a DApp. There are several requirements for this function to be called successfully. * `_claimData` MUST be well-encoded. In Solidity, it can be constructed as `abi.encode(dapp, claim)`, where `dapp` is the DApp address (type `address`) and `claim` is the claim structure (type `Claim`). * `firstIndex` MUST be less than or equal to `lastIndex`. As a result, every claim MUST encompass AT LEAST one input. * If this is the DApp's first claim, then `firstIndex` MUST be `0`. Otherwise, `firstIndex` MUST be the `lastClaim.lastIndex + 1`. In other words, claims MUST NOT skip inputs." - } - }, - "notice": "This contract stores claims for each DApp individually. This means that, for each DApp, the contract stores an array of `Claim` entries, where each `Claim` is composed of: * An epoch hash (`bytes32`) * A closed interval of input indices (`uint128`, `uint128`) The contract guarantees that the first interval starts at index 0, and that the following intervals don't have gaps or overlaps. Furthermore, claims can only be submitted by the contract owner through `submitClaim`, but can be retrieved by anyone with `getClaim`.", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 1155, - "contract": "contracts/history/History.sol:History", - "label": "_owner", - "offset": 0, - "slot": "0", - "type": "t_address" - }, - { - "astId": 3072, - "contract": "contracts/history/History.sol:History", - "label": "claims", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_address,t_array(t_struct(Claim)3065_storage)dyn_storage)" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_struct(Claim)3065_storage)dyn_storage": { - "base": "t_struct(Claim)3065_storage", - "encoding": "dynamic_array", - "label": "struct History.Claim[]", - "numberOfBytes": "32" - }, - "t_bytes32": { - "encoding": "inplace", - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_array(t_struct(Claim)3065_storage)dyn_storage)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => struct History.Claim[])", - "numberOfBytes": "32", - "value": "t_array(t_struct(Claim)3065_storage)dyn_storage" - }, - "t_struct(Claim)3065_storage": { - "encoding": "inplace", - "label": "struct History.Claim", - "members": [ - { - "astId": 3060, - "contract": "contracts/history/History.sol:History", - "label": "epochHash", - "offset": 0, - "slot": "0", - "type": "t_bytes32" - }, - { - "astId": 3062, - "contract": "contracts/history/History.sol:History", - "label": "firstIndex", - "offset": 0, - "slot": "1", - "type": "t_uint128" - }, - { - "astId": 3064, - "contract": "contracts/history/History.sol:History", - "label": "lastIndex", - "offset": 16, - "slot": "1", - "type": "t_uint128" - } - ], - "numberOfBytes": "64" - }, - "t_uint128": { - "encoding": "inplace", - "label": "uint128", - "numberOfBytes": "16" - } - } - } -} \ No newline at end of file diff --git a/onchain/rollups/deployments/chiado/Authority.json b/onchain/rollups/deployments/chiado/Authority.json deleted file mode 100644 index 6ff5e7457..000000000 --- a/onchain/rollups/deployments/chiado/Authority.json +++ /dev/null @@ -1,466 +0,0 @@ -{ - "address": "0x35EC7d70cAff883844d94b54cD19634fFAb5d8CC", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_owner", - "type": "address" - }, - { - "internalType": "contract IInputBox", - "name": "_inputBox", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "application", - "type": "address" - } - ], - "name": "ApplicationJoined", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": false, - "internalType": "contract IInputBox", - "name": "inputBox", - "type": "address" - } - ], - "name": "ConsensusCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "contract IHistory", - "name": "history", - "type": "address" - } - ], - "name": "NewHistory", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_dapp", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_proofContext", - "type": "bytes" - } - ], - "name": "getClaim", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getHistory", - "outputs": [ - { - "internalType": "contract IHistory", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "join", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_consensus", - "type": "address" - } - ], - "name": "migrateHistoryToConsensus", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IHistory", - "name": "_history", - "type": "address" - } - ], - "name": "setHistory", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "_claimData", - "type": "bytes" - } - ], - "name": "submitClaim", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IERC20", - "name": "_token", - "type": "address" - }, - { - "internalType": "address", - "name": "_recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "withdrawERC20Tokens", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0x461f73ffecdd4e6541e7e6bce7231cb942dfa2a03890204835427f6eb56c81e6", - "receipt": { - "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", - "from": "0x18930e8a66a1DbE21D00581216789AAB7460Afd0", - "contractAddress": null, - "transactionIndex": 0, - "gasUsed": "521630", - "logsBloom": "0x00000000000000000000000000000000000000000000000000800420000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000000000001000000000000000080000000001000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000020000000000000000000000000000000000080000001000000000000024000000000", - "blockHash": "0x47d1dc2d9cc116da84ebd96329cf72ffb12db6dc86b3b36c84dd6f1cb83bd694", - "transactionHash": "0x461f73ffecdd4e6541e7e6bce7231cb942dfa2a03890204835427f6eb56c81e6", - "logs": [ - { - "transactionIndex": 0, - "blockNumber": 3985060, - "transactionHash": "0x461f73ffecdd4e6541e7e6bce7231cb942dfa2a03890204835427f6eb56c81e6", - "address": "0x35EC7d70cAff883844d94b54cD19634fFAb5d8CC", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000004e59b44847b379578588920ca78fbf26c0b4956c" - ], - "data": "0x", - "logIndex": 0, - "blockHash": "0x47d1dc2d9cc116da84ebd96329cf72ffb12db6dc86b3b36c84dd6f1cb83bd694" - }, - { - "transactionIndex": 0, - "blockNumber": 3985060, - "transactionHash": "0x461f73ffecdd4e6541e7e6bce7231cb942dfa2a03890204835427f6eb56c81e6", - "address": "0x35EC7d70cAff883844d94b54cD19634fFAb5d8CC", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000004e59b44847b379578588920ca78fbf26c0b4956c", - "0x00000000000000000000000018930e8a66a1dbe21d00581216789aab7460afd0" - ], - "data": "0x", - "logIndex": 1, - "blockHash": "0x47d1dc2d9cc116da84ebd96329cf72ffb12db6dc86b3b36c84dd6f1cb83bd694" - }, - { - "transactionIndex": 0, - "blockNumber": 3985060, - "transactionHash": "0x461f73ffecdd4e6541e7e6bce7231cb942dfa2a03890204835427f6eb56c81e6", - "address": "0x35EC7d70cAff883844d94b54cD19634fFAb5d8CC", - "topics": [ - "0x583f764398dc1f7529b3e4472cb331312f6b6d76744da14476f571a330d36e23" - ], - "data": "0x00000000000000000000000018930e8a66a1dbe21d00581216789aab7460afd00000000000000000000000005a723220579c0dcb8c9253e6b4c62e572e379945", - "logIndex": 2, - "blockHash": "0x47d1dc2d9cc116da84ebd96329cf72ffb12db6dc86b3b36c84dd6f1cb83bd694" - } - ], - "blockNumber": 3985060, - "cumulativeGasUsed": "521630", - "status": 1, - "byzantium": true - }, - "args": [ - "0x18930e8a66a1DbE21D00581216789AAB7460Afd0", - "0x5a723220579C0DCb8C9253E6b4c62e572E379945" - ], - "numDeployments": 5, - "solcInputHash": "ccf852a6f03ad282136085842817ac99", - "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"contract IInputBox\",\"name\":\"_inputBox\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"application\",\"type\":\"address\"}],\"name\":\"ApplicationJoined\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"contract IInputBox\",\"name\":\"inputBox\",\"type\":\"address\"}],\"name\":\"ConsensusCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"contract IHistory\",\"name\":\"history\",\"type\":\"address\"}],\"name\":\"NewHistory\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dapp\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_proofContext\",\"type\":\"bytes\"}],\"name\":\"getClaim\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getHistory\",\"outputs\":[{\"internalType\":\"contract IHistory\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"join\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_consensus\",\"type\":\"address\"}],\"name\":\"migrateHistoryToConsensus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IHistory\",\"name\":\"_history\",\"type\":\"address\"}],\"name\":\"setHistory\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_claimData\",\"type\":\"bytes\"}],\"name\":\"submitClaim\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdrawERC20Tokens\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"This contract inherits `AbstractConsensus` and OpenZeppelin's `Ownable` contract. For more information on `Ownable`, please consult OpenZeppelin's official documentation.\",\"events\":{\"ApplicationJoined(address)\":{\"details\":\"MUST be triggered on a successful call to `join`.\",\"params\":{\"application\":\"The application\"}},\"ConsensusCreated(address,address)\":{\"details\":\"MUST be triggered during construction.\",\"params\":{\"inputBox\":\"The input box from which the authority fetches new inputs\",\"owner\":\"The address that initially owns the `Authority` contract\"}},\"NewHistory(address)\":{\"details\":\"MUST be triggered on a successful call to `setHistory`.\",\"params\":{\"history\":\"The new history contract\"}}},\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Emits a `ConsensusCreated` event.\",\"params\":{\"_inputBox\":\"The input box contract\",\"_owner\":\"The initial contract owner\"}},\"getClaim(address,bytes)\":{\"params\":{\"_dapp\":\"The DApp address\",\"_proofContext\":\"Data for retrieving the desired claim\"},\"returns\":{\"_0\":\"The claimed epoch hash\",\"_1\":\"The index of the first input of the epoch in the input box\",\"_2\":\"The index of the last input of the epoch in the input box\"}},\"getHistory()\":{\"returns\":{\"_0\":\"The current history contract\"}},\"migrateHistoryToConsensus(address)\":{\"details\":\"Can only be called by the `Authority` owner, and the `Authority` contract must have ownership over its current history contract.\",\"params\":{\"_consensus\":\"The new owner of the current history contract\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setHistory(address)\":{\"details\":\"Emits a `NewHistory` event. Can only be called by the `Authority` owner.\",\"params\":{\"_history\":\"The new history contract\"}},\"submitClaim(bytes)\":{\"details\":\"Can only be called by the `Authority` owner, and the `Authority` contract must have ownership over its current history contract.\",\"params\":{\"_claimData\":\"Data for submitting a claim\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"withdrawERC20Tokens(address,address,uint256)\":{\"details\":\"Can only be called by the `Authority` owner.\",\"params\":{\"_amount\":\"The amount of tokens to be withdrawn\",\"_recipient\":\"The recipient address\",\"_token\":\"The token contract\"}}},\"stateVariables\":{\"history\":{\"details\":\"See the `getHistory` and `setHistory` functions.\"}},\"title\":\"Authority consensus\",\"version\":1},\"userdoc\":{\"events\":{\"ApplicationJoined(address)\":{\"notice\":\"An application has joined the consensus' validation set.\"},\"ConsensusCreated(address,address)\":{\"notice\":\"The `Authority` contract was created.\"},\"NewHistory(address)\":{\"notice\":\"A new history contract is used to store claims.\"}},\"kind\":\"user\",\"methods\":{\"constructor\":{\"notice\":\"Constructs an `Authority` contract.\"},\"getClaim(address,bytes)\":{\"notice\":\"Get a claim from the current history. The encoding of `_proofContext` might vary depending on the implementation of the current history contract.\"},\"getHistory()\":{\"notice\":\"Get the current history contract.\"},\"join()\":{\"notice\":\"Emits an `ApplicationJoined` event with the message sender.\"},\"migrateHistoryToConsensus(address)\":{\"notice\":\"Transfer ownership over the current history contract to `_consensus`.\"},\"setHistory(address)\":{\"notice\":\"Make `Authority` point to another history contract.\"},\"submitClaim(bytes)\":{\"notice\":\"Submits a claim to the current history contract. The encoding of `_claimData` might vary depending on the implementation of the current history contract.\"},\"withdrawERC20Tokens(address,address,uint256)\":{\"notice\":\"Transfer some amount of ERC-20 tokens to a recipient.\"}},\"notice\":\"A consensus model controlled by a single address, the owner. Claims are stored in an auxiliary contract called `History`.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/consensus/authority/Authority.sol\":\"Authority\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"contracts/consensus/AbstractConsensus.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\nimport {IConsensus} from \\\"./IConsensus.sol\\\";\\n\\n/// @title Abstract Consensus\\n/// @notice An abstract contract that partially implements `IConsensus`.\\nabstract contract AbstractConsensus is IConsensus {\\n /// @notice Emits an `ApplicationJoined` event with the message sender.\\n function join() external override {\\n emit ApplicationJoined(msg.sender);\\n }\\n}\\n\",\"keccak256\":\"0x0483d8a8557c4e345eca5ad31ffea560737b08c75ade0430106136a89d755e13\",\"license\":\"Apache-2.0\"},\"contracts/consensus/IConsensus.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\n/// @title Consensus interface\\n///\\n/// @notice This contract defines a generic interface for consensuses.\\n/// We use the word \\\"consensus\\\" to designate a contract that provides claims\\n/// in the base layer regarding the state of off-chain machines running in\\n/// the execution layer. How this contract is able to reach consensus, who is\\n/// able to submit claims, and how are claims stored in the base layer are\\n/// some of the implementation details left unspecified by this interface.\\n///\\n/// From the point of view of a DApp, these claims are necessary to validate\\n/// on-chain action allowed by the off-chain machine in the form of vouchers\\n/// and notices. Each claim is composed of three parts: an epoch hash, a first\\n/// index, and a last index. We'll explain each of these parts below.\\n///\\n/// First, let us define the word \\\"epoch\\\". For finality reasons, we need to\\n/// divide the stream of inputs being fed into the off-chain machine into\\n/// batches of inputs, which we call \\\"epoches\\\". At the end of every epoch,\\n/// we summarize the state of the off-chain machine in a single hash, called\\n/// \\\"epoch hash\\\". Please note that this interface does not define how this\\n/// stream of inputs is being chopped up into epoches.\\n///\\n/// The other two parts are simply the indices of the first and last inputs\\n/// accepted during the epoch. Logically, the first index MUST BE less than\\n/// or equal to the last index. As a result, every epoch MUST accept at least\\n/// one input. This assumption stems from the fact that the state of a machine\\n/// can only change after an input is fed into it.\\n///\\n/// Examples of possible implementations of this interface include:\\n///\\n/// * An authority consensus, controlled by a single address who has full\\n/// control over epoch boundaries, claim submission, asset management, etc.\\n///\\n/// * A quorum consensus, controlled by a limited set of validators, that\\n/// vote on the state of the machine at the end of every epoch. Also, epoch\\n/// boundaries are determined by the timestamp in the base layer, and assets\\n/// are split equally amongst the validators.\\n///\\n/// * An NxN consensus, which allows anyone to submit and dispute claims\\n/// in the base layer. Epoch boundaries are determined in the same fashion\\n/// as in the quorum example.\\n///\\ninterface IConsensus {\\n /// @notice An application has joined the consensus' validation set.\\n /// @param application The application\\n /// @dev MUST be triggered on a successful call to `join`.\\n event ApplicationJoined(address application);\\n\\n /// @notice Get a specific claim regarding a specific DApp.\\n /// The encoding of `_proofContext` might vary\\n /// depending on the implementation.\\n /// @param _dapp The DApp address\\n /// @param _proofContext Data for retrieving the desired claim\\n /// @return epochHash_ The claimed epoch hash\\n /// @return firstInputIndex_ The index of the first input of the epoch in the input box\\n /// @return lastInputIndex_ The index of the last input of the epoch in the input box\\n function getClaim(\\n address _dapp,\\n bytes calldata _proofContext\\n )\\n external\\n view\\n returns (\\n bytes32 epochHash_,\\n uint256 firstInputIndex_,\\n uint256 lastInputIndex_\\n );\\n\\n /// @notice Signal the consensus that the message sender wants to join its validation set.\\n /// @dev MUST fire an `ApplicationJoined` event with the message sender as argument.\\n function join() external;\\n}\\n\",\"keccak256\":\"0x5d59c8dc3c1483e3173837d679093000077bf175c0b3ad7f02f0ffe611c0a89e\",\"license\":\"Apache-2.0\"},\"contracts/consensus/authority/Authority.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\nimport {Ownable} from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport {IERC20} from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport {IConsensus} from \\\"../IConsensus.sol\\\";\\nimport {AbstractConsensus} from \\\"../AbstractConsensus.sol\\\";\\nimport {IInputBox} from \\\"../../inputs/IInputBox.sol\\\";\\nimport {IHistory} from \\\"../../history/IHistory.sol\\\";\\n\\n/// @title Authority consensus\\n/// @notice A consensus model controlled by a single address, the owner.\\n/// Claims are stored in an auxiliary contract called `History`.\\n/// @dev This contract inherits `AbstractConsensus` and OpenZeppelin's `Ownable` contract.\\n/// For more information on `Ownable`, please consult OpenZeppelin's official documentation.\\ncontract Authority is AbstractConsensus, Ownable {\\n /// @notice The current history contract.\\n /// @dev See the `getHistory` and `setHistory` functions.\\n IHistory internal history;\\n\\n /// @notice The `Authority` contract was created.\\n /// @param owner The address that initially owns the `Authority` contract\\n /// @param inputBox The input box from which the authority fetches new inputs\\n /// @dev MUST be triggered during construction.\\n event ConsensusCreated(address owner, IInputBox inputBox);\\n\\n /// @notice A new history contract is used to store claims.\\n /// @param history The new history contract\\n /// @dev MUST be triggered on a successful call to `setHistory`.\\n event NewHistory(IHistory history);\\n\\n /// @notice Constructs an `Authority` contract.\\n /// @param _owner The initial contract owner\\n /// @param _inputBox The input box contract\\n /// @dev Emits a `ConsensusCreated` event.\\n constructor(address _owner, IInputBox _inputBox) {\\n // constructor in Ownable already called `transferOwnership(msg.sender)`, so\\n // we only need to call `transferOwnership(_owner)` if _owner != msg.sender\\n if (msg.sender != _owner) {\\n transferOwnership(_owner);\\n }\\n emit ConsensusCreated(_owner, _inputBox);\\n }\\n\\n /// @notice Submits a claim to the current history contract.\\n /// The encoding of `_claimData` might vary depending on the\\n /// implementation of the current history contract.\\n /// @param _claimData Data for submitting a claim\\n /// @dev Can only be called by the `Authority` owner,\\n /// and the `Authority` contract must have ownership over\\n /// its current history contract.\\n function submitClaim(bytes calldata _claimData) external onlyOwner {\\n history.submitClaim(_claimData);\\n }\\n\\n /// @notice Transfer ownership over the current history contract to `_consensus`.\\n /// @param _consensus The new owner of the current history contract\\n /// @dev Can only be called by the `Authority` owner,\\n /// and the `Authority` contract must have ownership over\\n /// its current history contract.\\n function migrateHistoryToConsensus(address _consensus) external onlyOwner {\\n history.migrateToConsensus(_consensus);\\n }\\n\\n /// @notice Make `Authority` point to another history contract.\\n /// @param _history The new history contract\\n /// @dev Emits a `NewHistory` event.\\n /// Can only be called by the `Authority` owner.\\n function setHistory(IHistory _history) external onlyOwner {\\n history = _history;\\n emit NewHistory(_history);\\n }\\n\\n /// @notice Get the current history contract.\\n /// @return The current history contract\\n function getHistory() external view returns (IHistory) {\\n return history;\\n }\\n\\n /// @notice Get a claim from the current history.\\n /// The encoding of `_proofContext` might vary depending on the\\n /// implementation of the current history contract.\\n /// @inheritdoc IConsensus\\n function getClaim(\\n address _dapp,\\n bytes calldata _proofContext\\n ) external view override returns (bytes32, uint256, uint256) {\\n return history.getClaim(_dapp, _proofContext);\\n }\\n\\n /// @notice Transfer some amount of ERC-20 tokens to a recipient.\\n /// @param _token The token contract\\n /// @param _recipient The recipient address\\n /// @param _amount The amount of tokens to be withdrawn\\n /// @dev Can only be called by the `Authority` owner.\\n function withdrawERC20Tokens(\\n IERC20 _token,\\n address _recipient,\\n uint256 _amount\\n ) external onlyOwner {\\n require(\\n _token.transfer(_recipient, _amount),\\n \\\"Authority: withdrawal failed\\\"\\n );\\n }\\n}\\n\",\"keccak256\":\"0x0a37f82a0c924deeb8fa5baa6ff0133054037170dadd0032b81f4c93c3ca1c91\",\"license\":\"Apache-2.0\"},\"contracts/history/IHistory.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\n/// @title History interface\\ninterface IHistory {\\n // Permissioned functions\\n\\n /// @notice Submit a claim.\\n /// The encoding of `_claimData` might vary\\n /// depending on the history implementation.\\n /// @param _claimData Data for submitting a claim\\n /// @dev Should have access control.\\n function submitClaim(bytes calldata _claimData) external;\\n\\n /// @notice Transfer ownership to another consensus.\\n /// @param _consensus The new consensus\\n /// @dev Should have access control.\\n function migrateToConsensus(address _consensus) external;\\n\\n // Permissionless functions\\n\\n /// @notice Get a specific claim regarding a specific DApp.\\n /// The encoding of `_proofContext` might vary\\n /// depending on the history implementation.\\n /// @param _dapp The DApp address\\n /// @param _proofContext Data for retrieving the desired claim\\n /// @return epochHash_ The claimed epoch hash\\n /// @return firstInputIndex_ The index of the first input of the epoch in the input box\\n /// @return lastInputIndex_ The index of the last input of the epoch in the input box\\n function getClaim(\\n address _dapp,\\n bytes calldata _proofContext\\n )\\n external\\n view\\n returns (\\n bytes32 epochHash_,\\n uint256 firstInputIndex_,\\n uint256 lastInputIndex_\\n );\\n}\\n\",\"keccak256\":\"0xfe0404f078a3a6f761beea8afbb2fac322fd2900f7ad2e2b866504c7aa54568f\",\"license\":\"Apache-2.0\"},\"contracts/inputs/IInputBox.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\n/// @title Input Box interface\\ninterface IInputBox {\\n /// @notice Emitted when an input is added to a DApp's input box.\\n /// @param dapp The address of the DApp\\n /// @param inboxInputIndex The index of the input in the input box\\n /// @param sender The address that sent the input\\n /// @param input The contents of the input\\n /// @dev MUST be triggered on a successful call to `addInput`.\\n event InputAdded(\\n address indexed dapp,\\n uint256 indexed inboxInputIndex,\\n address sender,\\n bytes input\\n );\\n\\n /// @notice Add an input to a DApp's input box.\\n /// @param _dapp The address of the DApp\\n /// @param _input The contents of the input\\n /// @return The hash of the input plus some extra metadata\\n /// @dev MUST fire an `InputAdded` event accordingly.\\n function addInput(\\n address _dapp,\\n bytes calldata _input\\n ) external returns (bytes32);\\n\\n /// @notice Get the number of inputs in a DApp's input box.\\n /// @param _dapp The address of the DApp\\n /// @return Number of inputs in the DApp's input box\\n function getNumberOfInputs(address _dapp) external view returns (uint256);\\n\\n /// @notice Get the hash of an input in a DApp's input box.\\n /// @param _dapp The address of the DApp\\n /// @param _index The index of the input in the DApp's input box\\n /// @return The hash of the input at the provided index in the DApp's input box\\n /// @dev `_index` MUST be in the interval `[0,n)` where `n` is the number of\\n /// inputs in the DApp's input box. See the `getNumberOfInputs` function.\\n function getInputHash(\\n address _dapp,\\n uint256 _index\\n ) external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x2addd467a24cde2131784103080aeb28df40d87ba19c5fd92bf96c0c074603df\",\"license\":\"Apache-2.0\"}},\"version\":1}", - "bytecode": "0x608060405234801561001057600080fd5b506040516109ef3803806109ef83398101604081905261002f916101da565b6100383361009b565b336001600160a01b0383161461005157610051826100eb565b604080516001600160a01b038085168252831660208201527f583f764398dc1f7529b3e4472cb331312f6b6d76744da14476f571a330d36e23910160405180910390a15050610214565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6100f3610169565b6001600160a01b03811661015d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b6101668161009b565b50565b6000546001600160a01b031633146101c35760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610154565b565b6001600160a01b038116811461016657600080fd5b600080604083850312156101ed57600080fd5b82516101f8816101c5565b6020840151909250610209816101c5565b809150509250929050565b6107cc806102236000396000f3fe608060405234801561001057600080fd5b506004361061009e5760003560e01c8063b688a36311610066578063b688a3631461010e578063bcdd1e1314610116578063d79a824014610129578063ddfdfbb014610157578063f2fde38b1461016a57600080fd5b8063159c5ea1146100a3578063715018a6146100b85780638da5cb5b146100c05780639368a3d3146100ea578063aa15efc8146100fd575b600080fd5b6100b66100b136600461058e565b61017d565b005b6100b66101d9565b6000546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b6100b66100f836600461058e565b6101ed565b6001546001600160a01b03166100cd565b6100b6610257565b6100b66101243660046105b2565b61028c565b61013c61013736600461063c565b61035d565b604080519384526020840192909252908201526060016100e1565b6100b6610165366004610691565b6103e6565b6100b661017836600461058e565b610456565b6101856104cf565b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f2bcd43869347a1d42f97ac6042f3d129817abd05a6125f9750fe3724e321d23e9060200160405180910390a150565b6101e16104cf565b6101eb6000610529565b565b6101f56104cf565b60015460405163fc41168360e01b81526001600160a01b0383811660048301529091169063fc41168390602401600060405180830381600087803b15801561023c57600080fd5b505af1158015610250573d6000803e3d6000fd5b5050505050565b6040513381527f27c2b702d3bff195a18baca2daf00b20a986177c5f1449af4e2d46a3c3e02ce59060200160405180910390a1565b6102946104cf565b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af11580156102e3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061030791906106d3565b6103585760405162461bcd60e51b815260206004820152601c60248201527f417574686f726974793a207769746864726177616c206661696c65640000000060448201526064015b60405180910390fd5b505050565b60015460405163035e6a0960e61b8152600091829182916001600160a01b03169063d79a8240906103969089908990899060040161071e565b606060405180830381865afa1580156103b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103d7919061074c565b92509250925093509350939050565b6103ee6104cf565b600154604051630ddfdfbb60e41b81526001600160a01b039091169063ddfdfbb090610420908590859060040161077a565b600060405180830381600087803b15801561043a57600080fd5b505af115801561044e573d6000803e3d6000fd5b505050505050565b61045e6104cf565b6001600160a01b0381166104c35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161034f565b6104cc81610529565b50565b6000546001600160a01b031633146101eb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161034f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146104cc57600080fd5b6000602082840312156105a057600080fd5b81356105ab81610579565b9392505050565b6000806000606084860312156105c757600080fd5b83356105d281610579565b925060208401356105e281610579565b929592945050506040919091013590565b60008083601f84011261060557600080fd5b50813567ffffffffffffffff81111561061d57600080fd5b60208301915083602082850101111561063557600080fd5b9250929050565b60008060006040848603121561065157600080fd5b833561065c81610579565b9250602084013567ffffffffffffffff81111561067857600080fd5b610684868287016105f3565b9497909650939450505050565b600080602083850312156106a457600080fd5b823567ffffffffffffffff8111156106bb57600080fd5b6106c7858286016105f3565b90969095509350505050565b6000602082840312156106e557600080fd5b815180151581146105ab57600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b038416815260406020820181905260009061074390830184866106f5565b95945050505050565b60008060006060848603121561076157600080fd5b8351925060208401519150604084015190509250925092565b60208152600061078e6020830184866106f5565b94935050505056fea264697066735822122021f66c26bc1cded7ab5457f04d0a74c5257b6aa88e7d69d7f9ad0713ba4679e664736f6c63430008130033", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061009e5760003560e01c8063b688a36311610066578063b688a3631461010e578063bcdd1e1314610116578063d79a824014610129578063ddfdfbb014610157578063f2fde38b1461016a57600080fd5b8063159c5ea1146100a3578063715018a6146100b85780638da5cb5b146100c05780639368a3d3146100ea578063aa15efc8146100fd575b600080fd5b6100b66100b136600461058e565b61017d565b005b6100b66101d9565b6000546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b6100b66100f836600461058e565b6101ed565b6001546001600160a01b03166100cd565b6100b6610257565b6100b66101243660046105b2565b61028c565b61013c61013736600461063c565b61035d565b604080519384526020840192909252908201526060016100e1565b6100b6610165366004610691565b6103e6565b6100b661017836600461058e565b610456565b6101856104cf565b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f2bcd43869347a1d42f97ac6042f3d129817abd05a6125f9750fe3724e321d23e9060200160405180910390a150565b6101e16104cf565b6101eb6000610529565b565b6101f56104cf565b60015460405163fc41168360e01b81526001600160a01b0383811660048301529091169063fc41168390602401600060405180830381600087803b15801561023c57600080fd5b505af1158015610250573d6000803e3d6000fd5b5050505050565b6040513381527f27c2b702d3bff195a18baca2daf00b20a986177c5f1449af4e2d46a3c3e02ce59060200160405180910390a1565b6102946104cf565b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af11580156102e3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061030791906106d3565b6103585760405162461bcd60e51b815260206004820152601c60248201527f417574686f726974793a207769746864726177616c206661696c65640000000060448201526064015b60405180910390fd5b505050565b60015460405163035e6a0960e61b8152600091829182916001600160a01b03169063d79a8240906103969089908990899060040161071e565b606060405180830381865afa1580156103b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103d7919061074c565b92509250925093509350939050565b6103ee6104cf565b600154604051630ddfdfbb60e41b81526001600160a01b039091169063ddfdfbb090610420908590859060040161077a565b600060405180830381600087803b15801561043a57600080fd5b505af115801561044e573d6000803e3d6000fd5b505050505050565b61045e6104cf565b6001600160a01b0381166104c35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161034f565b6104cc81610529565b50565b6000546001600160a01b031633146101eb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161034f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146104cc57600080fd5b6000602082840312156105a057600080fd5b81356105ab81610579565b9392505050565b6000806000606084860312156105c757600080fd5b83356105d281610579565b925060208401356105e281610579565b929592945050506040919091013590565b60008083601f84011261060557600080fd5b50813567ffffffffffffffff81111561061d57600080fd5b60208301915083602082850101111561063557600080fd5b9250929050565b60008060006040848603121561065157600080fd5b833561065c81610579565b9250602084013567ffffffffffffffff81111561067857600080fd5b610684868287016105f3565b9497909650939450505050565b600080602083850312156106a457600080fd5b823567ffffffffffffffff8111156106bb57600080fd5b6106c7858286016105f3565b90969095509350505050565b6000602082840312156106e557600080fd5b815180151581146105ab57600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b038416815260406020820181905260009061074390830184866106f5565b95945050505050565b60008060006060848603121561076157600080fd5b8351925060208401519150604084015190509250925092565b60208152600061078e6020830184866106f5565b94935050505056fea264697066735822122021f66c26bc1cded7ab5457f04d0a74c5257b6aa88e7d69d7f9ad0713ba4679e664736f6c63430008130033", - "devdoc": { - "details": "This contract inherits `AbstractConsensus` and OpenZeppelin's `Ownable` contract. For more information on `Ownable`, please consult OpenZeppelin's official documentation.", - "events": { - "ApplicationJoined(address)": { - "details": "MUST be triggered on a successful call to `join`.", - "params": { - "application": "The application" - } - }, - "ConsensusCreated(address,address)": { - "details": "MUST be triggered during construction.", - "params": { - "inputBox": "The input box from which the authority fetches new inputs", - "owner": "The address that initially owns the `Authority` contract" - } - }, - "NewHistory(address)": { - "details": "MUST be triggered on a successful call to `setHistory`.", - "params": { - "history": "The new history contract" - } - } - }, - "kind": "dev", - "methods": { - "constructor": { - "details": "Emits a `ConsensusCreated` event.", - "params": { - "_inputBox": "The input box contract", - "_owner": "The initial contract owner" - } - }, - "getClaim(address,bytes)": { - "params": { - "_dapp": "The DApp address", - "_proofContext": "Data for retrieving the desired claim" - }, - "returns": { - "_0": "The claimed epoch hash", - "_1": "The index of the first input of the epoch in the input box", - "_2": "The index of the last input of the epoch in the input box" - } - }, - "getHistory()": { - "returns": { - "_0": "The current history contract" - } - }, - "migrateHistoryToConsensus(address)": { - "details": "Can only be called by the `Authority` owner, and the `Authority` contract must have ownership over its current history contract.", - "params": { - "_consensus": "The new owner of the current history contract" - } - }, - "owner()": { - "details": "Returns the address of the current owner." - }, - "renounceOwnership()": { - "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." - }, - "setHistory(address)": { - "details": "Emits a `NewHistory` event. Can only be called by the `Authority` owner.", - "params": { - "_history": "The new history contract" - } - }, - "submitClaim(bytes)": { - "details": "Can only be called by the `Authority` owner, and the `Authority` contract must have ownership over its current history contract.", - "params": { - "_claimData": "Data for submitting a claim" - } - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." - }, - "withdrawERC20Tokens(address,address,uint256)": { - "details": "Can only be called by the `Authority` owner.", - "params": { - "_amount": "The amount of tokens to be withdrawn", - "_recipient": "The recipient address", - "_token": "The token contract" - } - } - }, - "stateVariables": { - "history": { - "details": "See the `getHistory` and `setHistory` functions." - } - }, - "title": "Authority consensus", - "version": 1 - }, - "userdoc": { - "events": { - "ApplicationJoined(address)": { - "notice": "An application has joined the consensus' validation set." - }, - "ConsensusCreated(address,address)": { - "notice": "The `Authority` contract was created." - }, - "NewHistory(address)": { - "notice": "A new history contract is used to store claims." - } - }, - "kind": "user", - "methods": { - "constructor": { - "notice": "Constructs an `Authority` contract." - }, - "getClaim(address,bytes)": { - "notice": "Get a claim from the current history. The encoding of `_proofContext` might vary depending on the implementation of the current history contract." - }, - "getHistory()": { - "notice": "Get the current history contract." - }, - "join()": { - "notice": "Emits an `ApplicationJoined` event with the message sender." - }, - "migrateHistoryToConsensus(address)": { - "notice": "Transfer ownership over the current history contract to `_consensus`." - }, - "setHistory(address)": { - "notice": "Make `Authority` point to another history contract." - }, - "submitClaim(bytes)": { - "notice": "Submits a claim to the current history contract. The encoding of `_claimData` might vary depending on the implementation of the current history contract." - }, - "withdrawERC20Tokens(address,address,uint256)": { - "notice": "Transfer some amount of ERC-20 tokens to a recipient." - } - }, - "notice": "A consensus model controlled by a single address, the owner. Claims are stored in an auxiliary contract called `History`.", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 1155, - "contract": "contracts/consensus/authority/Authority.sol:Authority", - "label": "_owner", - "offset": 0, - "slot": "0", - "type": "t_address" - }, - { - "astId": 2248, - "contract": "contracts/consensus/authority/Authority.sol:Authority", - "label": "history", - "offset": 0, - "slot": "1", - "type": "t_contract(IHistory)3266" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_contract(IHistory)3266": { - "encoding": "inplace", - "label": "contract IHistory", - "numberOfBytes": "20" - } - } - } -} \ No newline at end of file diff --git a/onchain/rollups/deployments/chiado/History.json b/onchain/rollups/deployments/chiado/History.json deleted file mode 100644 index b37b605cf..000000000 --- a/onchain/rollups/deployments/chiado/History.json +++ /dev/null @@ -1,381 +0,0 @@ -{ - "address": "0xFB34DaDd5f3Aba55004C448AcFd24fAF5A4Ff83E", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_owner", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "dapp", - "type": "address" - }, - { - "components": [ - { - "internalType": "bytes32", - "name": "epochHash", - "type": "bytes32" - }, - { - "internalType": "uint128", - "name": "firstIndex", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "lastIndex", - "type": "uint128" - } - ], - "indexed": false, - "internalType": "struct History.Claim", - "name": "claim", - "type": "tuple" - } - ], - "name": "NewClaimToHistory", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_dapp", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_proofContext", - "type": "bytes" - } - ], - "name": "getClaim", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_consensus", - "type": "address" - } - ], - "name": "migrateToConsensus", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "_claimData", - "type": "bytes" - } - ], - "name": "submitClaim", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0xb40bd47cdeb4cd78dbe8c8e11f9e7f9d6707fc44323eccaa065d773f752ca804", - "receipt": { - "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", - "from": "0x18930e8a66a1DbE21D00581216789AAB7460Afd0", - "contractAddress": null, - "transactionIndex": 0, - "gasUsed": "494574", - "logsBloom": "0x00000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000100000000000002000000000000000000000000100000000000001000000000000010000000000000000000000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000000000001000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000020000000000000000000000000800000000080000000000000000000000000000000", - "blockHash": "0x045ee25c80735eb35e821279f208404c33549bb7df38f4e2aa832ebb28e4fb6f", - "transactionHash": "0xb40bd47cdeb4cd78dbe8c8e11f9e7f9d6707fc44323eccaa065d773f752ca804", - "logs": [ - { - "transactionIndex": 0, - "blockNumber": 3985062, - "transactionHash": "0xb40bd47cdeb4cd78dbe8c8e11f9e7f9d6707fc44323eccaa065d773f752ca804", - "address": "0xFB34DaDd5f3Aba55004C448AcFd24fAF5A4Ff83E", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000004e59b44847b379578588920ca78fbf26c0b4956c" - ], - "data": "0x", - "logIndex": 0, - "blockHash": "0x045ee25c80735eb35e821279f208404c33549bb7df38f4e2aa832ebb28e4fb6f" - }, - { - "transactionIndex": 0, - "blockNumber": 3985062, - "transactionHash": "0xb40bd47cdeb4cd78dbe8c8e11f9e7f9d6707fc44323eccaa065d773f752ca804", - "address": "0xFB34DaDd5f3Aba55004C448AcFd24fAF5A4Ff83E", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000004e59b44847b379578588920ca78fbf26c0b4956c", - "0x00000000000000000000000035ec7d70caff883844d94b54cd19634ffab5d8cc" - ], - "data": "0x", - "logIndex": 1, - "blockHash": "0x045ee25c80735eb35e821279f208404c33549bb7df38f4e2aa832ebb28e4fb6f" - } - ], - "blockNumber": 3985062, - "cumulativeGasUsed": "494574", - "status": 1, - "byzantium": true - }, - "args": [ - "0x35EC7d70cAff883844d94b54cD19634fFAb5d8CC" - ], - "numDeployments": 5, - "solcInputHash": "ccf852a6f03ad282136085842817ac99", - "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dapp\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"epochHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint128\",\"name\":\"firstIndex\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"lastIndex\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"struct History.Claim\",\"name\":\"claim\",\"type\":\"tuple\"}],\"name\":\"NewClaimToHistory\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dapp\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_proofContext\",\"type\":\"bytes\"}],\"name\":\"getClaim\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_consensus\",\"type\":\"address\"}],\"name\":\"migrateToConsensus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_claimData\",\"type\":\"bytes\"}],\"name\":\"submitClaim\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"This contract inherits OpenZeppelin's `Ownable` contract. For more information on `Ownable`, please consult OpenZeppelin's official documentation.\",\"events\":{\"NewClaimToHistory(address,(bytes32,uint128,uint128))\":{\"details\":\"MUST be triggered on a successful call to `submitClaim`.\",\"params\":{\"claim\":\"The newly-submitted claim\",\"dapp\":\"The address of the DApp\"}}},\"kind\":\"dev\",\"methods\":{\"constructor\":{\"params\":{\"_owner\":\"The initial owner\"}},\"getClaim(address,bytes)\":{\"params\":{\"_dapp\":\"The DApp address\",\"_proofContext\":\"Data for retrieving the desired claim\"},\"returns\":{\"_0\":\"The claimed epoch hash\",\"_1\":\"The index of the first input of the epoch in the input box\",\"_2\":\"The index of the last input of the epoch in the input box\"}},\"migrateToConsensus(address)\":{\"details\":\"Emits an `OwnershipTransferred` event. Should have access control.\",\"params\":{\"_consensus\":\"The new consensus\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"submitClaim(bytes)\":{\"details\":\"Emits a `NewClaimToHistory` event. Should have access control.\",\"params\":{\"_claimData\":\"Data for submitting a claim\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"stateVariables\":{\"claims\":{\"details\":\"See the `getClaim` and `submitClaim` functions.\"}},\"title\":\"Simple History\",\"version\":1},\"userdoc\":{\"events\":{\"NewClaimToHistory(address,(bytes32,uint128,uint128))\":{\"notice\":\"A new claim regarding a specific DApp was submitted.\"}},\"kind\":\"user\",\"methods\":{\"constructor\":{\"notice\":\"Creates a `History` contract.\"},\"getClaim(address,bytes)\":{\"notice\":\"Get a specific claim regarding a specific DApp. There are several requirements for this function to be called successfully. * `_proofContext` MUST be well-encoded. In Solidity, it can be constructed as `abi.encode(claimIndex)`, where `claimIndex` is the claim index (type `uint256`). * `claimIndex` MUST be inside the interval `[0, n)` where `n` is the number of claims that have been submitted to `_dapp` already.\"},\"migrateToConsensus(address)\":{\"notice\":\"Transfer ownership to another consensus.\"},\"submitClaim(bytes)\":{\"notice\":\"Submit a claim regarding a DApp. There are several requirements for this function to be called successfully. * `_claimData` MUST be well-encoded. In Solidity, it can be constructed as `abi.encode(dapp, claim)`, where `dapp` is the DApp address (type `address`) and `claim` is the claim structure (type `Claim`). * `firstIndex` MUST be less than or equal to `lastIndex`. As a result, every claim MUST encompass AT LEAST one input. * If this is the DApp's first claim, then `firstIndex` MUST be `0`. Otherwise, `firstIndex` MUST be the `lastClaim.lastIndex + 1`. In other words, claims MUST NOT skip inputs.\"}},\"notice\":\"This contract stores claims for each DApp individually. This means that, for each DApp, the contract stores an array of `Claim` entries, where each `Claim` is composed of: * An epoch hash (`bytes32`) * A closed interval of input indices (`uint128`, `uint128`) The contract guarantees that the first interval starts at index 0, and that the following intervals don't have gaps or overlaps. Furthermore, claims can only be submitted by the contract owner through `submitClaim`, but can be retrieved by anyone with `getClaim`.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/history/History.sol\":\"History\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"contracts/history/History.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\nimport {Ownable} from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\nimport {IHistory} from \\\"./IHistory.sol\\\";\\n\\n/// @title Simple History\\n///\\n/// @notice This contract stores claims for each DApp individually.\\n/// This means that, for each DApp, the contract stores an array of\\n/// `Claim` entries, where each `Claim` is composed of:\\n///\\n/// * An epoch hash (`bytes32`)\\n/// * A closed interval of input indices (`uint128`, `uint128`)\\n///\\n/// The contract guarantees that the first interval starts at index 0,\\n/// and that the following intervals don't have gaps or overlaps.\\n///\\n/// Furthermore, claims can only be submitted by the contract owner\\n/// through `submitClaim`, but can be retrieved by anyone with `getClaim`.\\n///\\n/// @dev This contract inherits OpenZeppelin's `Ownable` contract.\\n/// For more information on `Ownable`, please consult OpenZeppelin's official documentation.\\ncontract History is IHistory, Ownable {\\n struct Claim {\\n bytes32 epochHash;\\n uint128 firstIndex;\\n uint128 lastIndex;\\n }\\n\\n /// @notice Mapping from DApp address to array of claims.\\n /// @dev See the `getClaim` and `submitClaim` functions.\\n mapping(address => Claim[]) internal claims;\\n\\n /// @notice A new claim regarding a specific DApp was submitted.\\n /// @param dapp The address of the DApp\\n /// @param claim The newly-submitted claim\\n /// @dev MUST be triggered on a successful call to `submitClaim`.\\n event NewClaimToHistory(address indexed dapp, Claim claim);\\n\\n /// @notice Creates a `History` contract.\\n /// @param _owner The initial owner\\n constructor(address _owner) {\\n // constructor in Ownable already called `transferOwnership(msg.sender)`, so\\n // we only need to call `transferOwnership(_owner)` if _owner != msg.sender\\n if (_owner != msg.sender) {\\n transferOwnership(_owner);\\n }\\n }\\n\\n /// @notice Submit a claim regarding a DApp.\\n /// There are several requirements for this function to be called successfully.\\n ///\\n /// * `_claimData` MUST be well-encoded. In Solidity, it can be constructed\\n /// as `abi.encode(dapp, claim)`, where `dapp` is the DApp address (type `address`)\\n /// and `claim` is the claim structure (type `Claim`).\\n ///\\n /// * `firstIndex` MUST be less than or equal to `lastIndex`.\\n /// As a result, every claim MUST encompass AT LEAST one input.\\n ///\\n /// * If this is the DApp's first claim, then `firstIndex` MUST be `0`.\\n /// Otherwise, `firstIndex` MUST be the `lastClaim.lastIndex + 1`.\\n /// In other words, claims MUST NOT skip inputs.\\n ///\\n /// @inheritdoc IHistory\\n /// @dev Emits a `NewClaimToHistory` event. Should have access control.\\n function submitClaim(\\n bytes calldata _claimData\\n ) external override onlyOwner {\\n (address dapp, Claim memory claim) = abi.decode(\\n _claimData,\\n (address, Claim)\\n );\\n\\n require(claim.firstIndex <= claim.lastIndex, \\\"History: FI > LI\\\");\\n\\n Claim[] storage dappClaims = claims[dapp];\\n uint256 numDAppClaims = dappClaims.length;\\n\\n require(\\n claim.firstIndex ==\\n (\\n (numDAppClaims == 0)\\n ? 0\\n : (dappClaims[numDAppClaims - 1].lastIndex + 1)\\n ),\\n \\\"History: unclaimed inputs\\\"\\n );\\n\\n dappClaims.push(claim);\\n\\n emit NewClaimToHistory(dapp, claim);\\n }\\n\\n /// @notice Get a specific claim regarding a specific DApp.\\n /// There are several requirements for this function to be called successfully.\\n ///\\n /// * `_proofContext` MUST be well-encoded. In Solidity, it can be constructed\\n /// as `abi.encode(claimIndex)`, where `claimIndex` is the claim index (type `uint256`).\\n ///\\n /// * `claimIndex` MUST be inside the interval `[0, n)` where `n` is the number of claims\\n /// that have been submitted to `_dapp` already.\\n ///\\n /// @inheritdoc IHistory\\n function getClaim(\\n address _dapp,\\n bytes calldata _proofContext\\n ) external view override returns (bytes32, uint256, uint256) {\\n uint256 claimIndex = abi.decode(_proofContext, (uint256));\\n\\n Claim memory claim = claims[_dapp][claimIndex];\\n\\n return (claim.epochHash, claim.firstIndex, claim.lastIndex);\\n }\\n\\n /// @inheritdoc IHistory\\n /// @dev Emits an `OwnershipTransferred` event. Should have access control.\\n function migrateToConsensus(\\n address _consensus\\n ) external override onlyOwner {\\n transferOwnership(_consensus);\\n }\\n}\\n\",\"keccak256\":\"0x607253a9e73d3fe0b98e2c5d7b6f9ee1dad48d7cf4a1284b4f1361d74178da7a\",\"license\":\"Apache-2.0\"},\"contracts/history/IHistory.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\n/// @title History interface\\ninterface IHistory {\\n // Permissioned functions\\n\\n /// @notice Submit a claim.\\n /// The encoding of `_claimData` might vary\\n /// depending on the history implementation.\\n /// @param _claimData Data for submitting a claim\\n /// @dev Should have access control.\\n function submitClaim(bytes calldata _claimData) external;\\n\\n /// @notice Transfer ownership to another consensus.\\n /// @param _consensus The new consensus\\n /// @dev Should have access control.\\n function migrateToConsensus(address _consensus) external;\\n\\n // Permissionless functions\\n\\n /// @notice Get a specific claim regarding a specific DApp.\\n /// The encoding of `_proofContext` might vary\\n /// depending on the history implementation.\\n /// @param _dapp The DApp address\\n /// @param _proofContext Data for retrieving the desired claim\\n /// @return epochHash_ The claimed epoch hash\\n /// @return firstInputIndex_ The index of the first input of the epoch in the input box\\n /// @return lastInputIndex_ The index of the last input of the epoch in the input box\\n function getClaim(\\n address _dapp,\\n bytes calldata _proofContext\\n )\\n external\\n view\\n returns (\\n bytes32 epochHash_,\\n uint256 firstInputIndex_,\\n uint256 lastInputIndex_\\n );\\n}\\n\",\"keccak256\":\"0xfe0404f078a3a6f761beea8afbb2fac322fd2900f7ad2e2b866504c7aa54568f\",\"license\":\"Apache-2.0\"}},\"version\":1}", - "bytecode": "0x608060405234801561001057600080fd5b5060405161091f38038061091f83398101604081905261002f91610181565b61003833610057565b6001600160a01b038116331461005157610051816100a7565b506101b1565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6100af610125565b6001600160a01b0381166101195760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b61012281610057565b50565b6000546001600160a01b0316331461017f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610110565b565b60006020828403121561019357600080fd5b81516001600160a01b03811681146101aa57600080fd5b9392505050565b61075f806101c06000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c8063715018a6146100675780638da5cb5b14610071578063d79a824014610091578063ddfdfbb0146100bf578063f2fde38b146100d2578063fc411683146100e5575b600080fd5b61006f6100f8565b005b6000546040516001600160a01b0390911681526020015b60405180910390f35b6100a461009f36600461052f565b61010c565b60408051938452602084019290925290820152606001610088565b61006f6100cd366004610584565b6101a5565b61006f6100e03660046105c6565b61039d565b61006f6100f33660046105c6565b610416565b610100610427565b61010a6000610481565b565b600080808061011d858701876105ea565b6001600160a01b0388166000908152600160205260408120805492935090918390811061014c5761014c610603565b60009182526020918290206040805160608101825260029390930290910180548084526001909101546001600160801b03808216958501869052600160801b90910416929091018290529a919950975095505050505050565b6101ad610427565b6000806101bc83850185610635565b9150915080604001516001600160801b031681602001516001600160801b031611156102225760405162461bcd60e51b815260206004820152601060248201526f486973746f72793a204649203e204c4960801b60448201526064015b60405180910390fd5b6001600160a01b038216600090815260016020526040902080548015610294578161024e6001836106e9565b8154811061025e5761025e610603565b906000526020600020906002020160010160109054906101000a90046001600160801b0316600161028f9190610702565b610297565b60005b6001600160801b031683602001516001600160801b0316146102fb5760405162461bcd60e51b815260206004820152601960248201527f486973746f72793a20756e636c61696d656420696e70757473000000000000006044820152606401610219565b8154600180820184556000848152602090819020865160029094020183815586820180516040808a0180516001600160801b03938416600160801b9185169190910217949096019390935582519586529051811692850192909252915116908201526001600160a01b038516907fb71880d7a0c514d48c0296b2721b0a4f9641a45117960f2ca86b5b7873c4ab2f9060600160405180910390a2505050505050565b6103a5610427565b6001600160a01b03811661040a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610219565b61041381610481565b50565b61041e610427565b6104138161039d565b6000546001600160a01b0316331461010a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610219565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038116811461041357600080fd5b60008083601f8401126104f857600080fd5b50813567ffffffffffffffff81111561051057600080fd5b60208301915083602082850101111561052857600080fd5b9250929050565b60008060006040848603121561054457600080fd5b833561054f816104d1565b9250602084013567ffffffffffffffff81111561056b57600080fd5b610577868287016104e6565b9497909650939450505050565b6000806020838503121561059757600080fd5b823567ffffffffffffffff8111156105ae57600080fd5b6105ba858286016104e6565b90969095509350505050565b6000602082840312156105d857600080fd5b81356105e3816104d1565b9392505050565b6000602082840312156105fc57600080fd5b5035919050565b634e487b7160e01b600052603260045260246000fd5b80356001600160801b038116811461063057600080fd5b919050565b600080828403608081121561064957600080fd5b8335610654816104d1565b92506060601f198201121561066857600080fd5b506040516060810181811067ffffffffffffffff8211171561069a57634e487b7160e01b600052604160045260246000fd5b8060405250602084013581526106b260408501610619565b60208201526106c360608501610619565b6040820152809150509250929050565b634e487b7160e01b600052601160045260246000fd5b818103818111156106fc576106fc6106d3565b92915050565b6001600160801b03818116838216019080821115610722576107226106d3565b509291505056fea26469706673582212201fc5dfb9d50cb3efefe40c7ced59b7b296f6d072ed8005ef3de36946cd77e28364736f6c63430008130033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100625760003560e01c8063715018a6146100675780638da5cb5b14610071578063d79a824014610091578063ddfdfbb0146100bf578063f2fde38b146100d2578063fc411683146100e5575b600080fd5b61006f6100f8565b005b6000546040516001600160a01b0390911681526020015b60405180910390f35b6100a461009f36600461052f565b61010c565b60408051938452602084019290925290820152606001610088565b61006f6100cd366004610584565b6101a5565b61006f6100e03660046105c6565b61039d565b61006f6100f33660046105c6565b610416565b610100610427565b61010a6000610481565b565b600080808061011d858701876105ea565b6001600160a01b0388166000908152600160205260408120805492935090918390811061014c5761014c610603565b60009182526020918290206040805160608101825260029390930290910180548084526001909101546001600160801b03808216958501869052600160801b90910416929091018290529a919950975095505050505050565b6101ad610427565b6000806101bc83850185610635565b9150915080604001516001600160801b031681602001516001600160801b031611156102225760405162461bcd60e51b815260206004820152601060248201526f486973746f72793a204649203e204c4960801b60448201526064015b60405180910390fd5b6001600160a01b038216600090815260016020526040902080548015610294578161024e6001836106e9565b8154811061025e5761025e610603565b906000526020600020906002020160010160109054906101000a90046001600160801b0316600161028f9190610702565b610297565b60005b6001600160801b031683602001516001600160801b0316146102fb5760405162461bcd60e51b815260206004820152601960248201527f486973746f72793a20756e636c61696d656420696e70757473000000000000006044820152606401610219565b8154600180820184556000848152602090819020865160029094020183815586820180516040808a0180516001600160801b03938416600160801b9185169190910217949096019390935582519586529051811692850192909252915116908201526001600160a01b038516907fb71880d7a0c514d48c0296b2721b0a4f9641a45117960f2ca86b5b7873c4ab2f9060600160405180910390a2505050505050565b6103a5610427565b6001600160a01b03811661040a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610219565b61041381610481565b50565b61041e610427565b6104138161039d565b6000546001600160a01b0316331461010a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610219565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038116811461041357600080fd5b60008083601f8401126104f857600080fd5b50813567ffffffffffffffff81111561051057600080fd5b60208301915083602082850101111561052857600080fd5b9250929050565b60008060006040848603121561054457600080fd5b833561054f816104d1565b9250602084013567ffffffffffffffff81111561056b57600080fd5b610577868287016104e6565b9497909650939450505050565b6000806020838503121561059757600080fd5b823567ffffffffffffffff8111156105ae57600080fd5b6105ba858286016104e6565b90969095509350505050565b6000602082840312156105d857600080fd5b81356105e3816104d1565b9392505050565b6000602082840312156105fc57600080fd5b5035919050565b634e487b7160e01b600052603260045260246000fd5b80356001600160801b038116811461063057600080fd5b919050565b600080828403608081121561064957600080fd5b8335610654816104d1565b92506060601f198201121561066857600080fd5b506040516060810181811067ffffffffffffffff8211171561069a57634e487b7160e01b600052604160045260246000fd5b8060405250602084013581526106b260408501610619565b60208201526106c360608501610619565b6040820152809150509250929050565b634e487b7160e01b600052601160045260246000fd5b818103818111156106fc576106fc6106d3565b92915050565b6001600160801b03818116838216019080821115610722576107226106d3565b509291505056fea26469706673582212201fc5dfb9d50cb3efefe40c7ced59b7b296f6d072ed8005ef3de36946cd77e28364736f6c63430008130033", - "devdoc": { - "details": "This contract inherits OpenZeppelin's `Ownable` contract. For more information on `Ownable`, please consult OpenZeppelin's official documentation.", - "events": { - "NewClaimToHistory(address,(bytes32,uint128,uint128))": { - "details": "MUST be triggered on a successful call to `submitClaim`.", - "params": { - "claim": "The newly-submitted claim", - "dapp": "The address of the DApp" - } - } - }, - "kind": "dev", - "methods": { - "constructor": { - "params": { - "_owner": "The initial owner" - } - }, - "getClaim(address,bytes)": { - "params": { - "_dapp": "The DApp address", - "_proofContext": "Data for retrieving the desired claim" - }, - "returns": { - "_0": "The claimed epoch hash", - "_1": "The index of the first input of the epoch in the input box", - "_2": "The index of the last input of the epoch in the input box" - } - }, - "migrateToConsensus(address)": { - "details": "Emits an `OwnershipTransferred` event. Should have access control.", - "params": { - "_consensus": "The new consensus" - } - }, - "owner()": { - "details": "Returns the address of the current owner." - }, - "renounceOwnership()": { - "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." - }, - "submitClaim(bytes)": { - "details": "Emits a `NewClaimToHistory` event. Should have access control.", - "params": { - "_claimData": "Data for submitting a claim" - } - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." - } - }, - "stateVariables": { - "claims": { - "details": "See the `getClaim` and `submitClaim` functions." - } - }, - "title": "Simple History", - "version": 1 - }, - "userdoc": { - "events": { - "NewClaimToHistory(address,(bytes32,uint128,uint128))": { - "notice": "A new claim regarding a specific DApp was submitted." - } - }, - "kind": "user", - "methods": { - "constructor": { - "notice": "Creates a `History` contract." - }, - "getClaim(address,bytes)": { - "notice": "Get a specific claim regarding a specific DApp. There are several requirements for this function to be called successfully. * `_proofContext` MUST be well-encoded. In Solidity, it can be constructed as `abi.encode(claimIndex)`, where `claimIndex` is the claim index (type `uint256`). * `claimIndex` MUST be inside the interval `[0, n)` where `n` is the number of claims that have been submitted to `_dapp` already." - }, - "migrateToConsensus(address)": { - "notice": "Transfer ownership to another consensus." - }, - "submitClaim(bytes)": { - "notice": "Submit a claim regarding a DApp. There are several requirements for this function to be called successfully. * `_claimData` MUST be well-encoded. In Solidity, it can be constructed as `abi.encode(dapp, claim)`, where `dapp` is the DApp address (type `address`) and `claim` is the claim structure (type `Claim`). * `firstIndex` MUST be less than or equal to `lastIndex`. As a result, every claim MUST encompass AT LEAST one input. * If this is the DApp's first claim, then `firstIndex` MUST be `0`. Otherwise, `firstIndex` MUST be the `lastClaim.lastIndex + 1`. In other words, claims MUST NOT skip inputs." - } - }, - "notice": "This contract stores claims for each DApp individually. This means that, for each DApp, the contract stores an array of `Claim` entries, where each `Claim` is composed of: * An epoch hash (`bytes32`) * A closed interval of input indices (`uint128`, `uint128`) The contract guarantees that the first interval starts at index 0, and that the following intervals don't have gaps or overlaps. Furthermore, claims can only be submitted by the contract owner through `submitClaim`, but can be retrieved by anyone with `getClaim`.", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 1155, - "contract": "contracts/history/History.sol:History", - "label": "_owner", - "offset": 0, - "slot": "0", - "type": "t_address" - }, - { - "astId": 3072, - "contract": "contracts/history/History.sol:History", - "label": "claims", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_address,t_array(t_struct(Claim)3065_storage)dyn_storage)" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_struct(Claim)3065_storage)dyn_storage": { - "base": "t_struct(Claim)3065_storage", - "encoding": "dynamic_array", - "label": "struct History.Claim[]", - "numberOfBytes": "32" - }, - "t_bytes32": { - "encoding": "inplace", - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_array(t_struct(Claim)3065_storage)dyn_storage)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => struct History.Claim[])", - "numberOfBytes": "32", - "value": "t_array(t_struct(Claim)3065_storage)dyn_storage" - }, - "t_struct(Claim)3065_storage": { - "encoding": "inplace", - "label": "struct History.Claim", - "members": [ - { - "astId": 3060, - "contract": "contracts/history/History.sol:History", - "label": "epochHash", - "offset": 0, - "slot": "0", - "type": "t_bytes32" - }, - { - "astId": 3062, - "contract": "contracts/history/History.sol:History", - "label": "firstIndex", - "offset": 0, - "slot": "1", - "type": "t_uint128" - }, - { - "astId": 3064, - "contract": "contracts/history/History.sol:History", - "label": "lastIndex", - "offset": 16, - "slot": "1", - "type": "t_uint128" - } - ], - "numberOfBytes": "64" - }, - "t_uint128": { - "encoding": "inplace", - "label": "uint128", - "numberOfBytes": "16" - } - } - } -} \ No newline at end of file diff --git a/onchain/rollups/deployments/goerli/Authority.json b/onchain/rollups/deployments/goerli/Authority.json deleted file mode 100644 index 351e2b080..000000000 --- a/onchain/rollups/deployments/goerli/Authority.json +++ /dev/null @@ -1,466 +0,0 @@ -{ - "address": "0x35EC7d70cAff883844d94b54cD19634fFAb5d8CC", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_owner", - "type": "address" - }, - { - "internalType": "contract IInputBox", - "name": "_inputBox", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "application", - "type": "address" - } - ], - "name": "ApplicationJoined", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": false, - "internalType": "contract IInputBox", - "name": "inputBox", - "type": "address" - } - ], - "name": "ConsensusCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "contract IHistory", - "name": "history", - "type": "address" - } - ], - "name": "NewHistory", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_dapp", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_proofContext", - "type": "bytes" - } - ], - "name": "getClaim", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getHistory", - "outputs": [ - { - "internalType": "contract IHistory", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "join", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_consensus", - "type": "address" - } - ], - "name": "migrateHistoryToConsensus", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IHistory", - "name": "_history", - "type": "address" - } - ], - "name": "setHistory", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "_claimData", - "type": "bytes" - } - ], - "name": "submitClaim", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IERC20", - "name": "_token", - "type": "address" - }, - { - "internalType": "address", - "name": "_recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "withdrawERC20Tokens", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0x798e237f3db53e0d99d591a0033b91608e182c477d95f1c96e009d4b15d05a2b", - "receipt": { - "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", - "from": "0x18930e8a66a1DbE21D00581216789AAB7460Afd0", - "contractAddress": null, - "transactionIndex": 105, - "gasUsed": "521794", - "logsBloom": "0x00000000000000000000000000000000000000000000000000800420000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000000000001000000000000000080000000001000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000020000000000000000000000000000000000080000001000000000000024000000000", - "blockHash": "0x4011873bb5183e6bf90d2f0489801819039af8158de02059e823cd1fbcf0c4bd", - "transactionHash": "0x798e237f3db53e0d99d591a0033b91608e182c477d95f1c96e009d4b15d05a2b", - "logs": [ - { - "transactionIndex": 105, - "blockNumber": 9017159, - "transactionHash": "0x798e237f3db53e0d99d591a0033b91608e182c477d95f1c96e009d4b15d05a2b", - "address": "0x35EC7d70cAff883844d94b54cD19634fFAb5d8CC", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000004e59b44847b379578588920ca78fbf26c0b4956c" - ], - "data": "0x", - "logIndex": 201, - "blockHash": "0x4011873bb5183e6bf90d2f0489801819039af8158de02059e823cd1fbcf0c4bd" - }, - { - "transactionIndex": 105, - "blockNumber": 9017159, - "transactionHash": "0x798e237f3db53e0d99d591a0033b91608e182c477d95f1c96e009d4b15d05a2b", - "address": "0x35EC7d70cAff883844d94b54cD19634fFAb5d8CC", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000004e59b44847b379578588920ca78fbf26c0b4956c", - "0x00000000000000000000000018930e8a66a1dbe21d00581216789aab7460afd0" - ], - "data": "0x", - "logIndex": 202, - "blockHash": "0x4011873bb5183e6bf90d2f0489801819039af8158de02059e823cd1fbcf0c4bd" - }, - { - "transactionIndex": 105, - "blockNumber": 9017159, - "transactionHash": "0x798e237f3db53e0d99d591a0033b91608e182c477d95f1c96e009d4b15d05a2b", - "address": "0x35EC7d70cAff883844d94b54cD19634fFAb5d8CC", - "topics": [ - "0x583f764398dc1f7529b3e4472cb331312f6b6d76744da14476f571a330d36e23" - ], - "data": "0x00000000000000000000000018930e8a66a1dbe21d00581216789aab7460afd00000000000000000000000005a723220579c0dcb8c9253e6b4c62e572e379945", - "logIndex": 203, - "blockHash": "0x4011873bb5183e6bf90d2f0489801819039af8158de02059e823cd1fbcf0c4bd" - } - ], - "blockNumber": 9017159, - "cumulativeGasUsed": "28113095", - "status": 1, - "byzantium": true - }, - "args": [ - "0x18930e8a66a1DbE21D00581216789AAB7460Afd0", - "0x5a723220579C0DCb8C9253E6b4c62e572E379945" - ], - "numDeployments": 5, - "solcInputHash": "ccf852a6f03ad282136085842817ac99", - "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"contract IInputBox\",\"name\":\"_inputBox\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"application\",\"type\":\"address\"}],\"name\":\"ApplicationJoined\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"contract IInputBox\",\"name\":\"inputBox\",\"type\":\"address\"}],\"name\":\"ConsensusCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"contract IHistory\",\"name\":\"history\",\"type\":\"address\"}],\"name\":\"NewHistory\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dapp\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_proofContext\",\"type\":\"bytes\"}],\"name\":\"getClaim\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getHistory\",\"outputs\":[{\"internalType\":\"contract IHistory\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"join\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_consensus\",\"type\":\"address\"}],\"name\":\"migrateHistoryToConsensus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IHistory\",\"name\":\"_history\",\"type\":\"address\"}],\"name\":\"setHistory\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_claimData\",\"type\":\"bytes\"}],\"name\":\"submitClaim\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdrawERC20Tokens\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"This contract inherits `AbstractConsensus` and OpenZeppelin's `Ownable` contract. For more information on `Ownable`, please consult OpenZeppelin's official documentation.\",\"events\":{\"ApplicationJoined(address)\":{\"details\":\"MUST be triggered on a successful call to `join`.\",\"params\":{\"application\":\"The application\"}},\"ConsensusCreated(address,address)\":{\"details\":\"MUST be triggered during construction.\",\"params\":{\"inputBox\":\"The input box from which the authority fetches new inputs\",\"owner\":\"The address that initially owns the `Authority` contract\"}},\"NewHistory(address)\":{\"details\":\"MUST be triggered on a successful call to `setHistory`.\",\"params\":{\"history\":\"The new history contract\"}}},\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Emits a `ConsensusCreated` event.\",\"params\":{\"_inputBox\":\"The input box contract\",\"_owner\":\"The initial contract owner\"}},\"getClaim(address,bytes)\":{\"params\":{\"_dapp\":\"The DApp address\",\"_proofContext\":\"Data for retrieving the desired claim\"},\"returns\":{\"_0\":\"The claimed epoch hash\",\"_1\":\"The index of the first input of the epoch in the input box\",\"_2\":\"The index of the last input of the epoch in the input box\"}},\"getHistory()\":{\"returns\":{\"_0\":\"The current history contract\"}},\"migrateHistoryToConsensus(address)\":{\"details\":\"Can only be called by the `Authority` owner, and the `Authority` contract must have ownership over its current history contract.\",\"params\":{\"_consensus\":\"The new owner of the current history contract\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setHistory(address)\":{\"details\":\"Emits a `NewHistory` event. Can only be called by the `Authority` owner.\",\"params\":{\"_history\":\"The new history contract\"}},\"submitClaim(bytes)\":{\"details\":\"Can only be called by the `Authority` owner, and the `Authority` contract must have ownership over its current history contract.\",\"params\":{\"_claimData\":\"Data for submitting a claim\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"withdrawERC20Tokens(address,address,uint256)\":{\"details\":\"Can only be called by the `Authority` owner.\",\"params\":{\"_amount\":\"The amount of tokens to be withdrawn\",\"_recipient\":\"The recipient address\",\"_token\":\"The token contract\"}}},\"stateVariables\":{\"history\":{\"details\":\"See the `getHistory` and `setHistory` functions.\"}},\"title\":\"Authority consensus\",\"version\":1},\"userdoc\":{\"events\":{\"ApplicationJoined(address)\":{\"notice\":\"An application has joined the consensus' validation set.\"},\"ConsensusCreated(address,address)\":{\"notice\":\"The `Authority` contract was created.\"},\"NewHistory(address)\":{\"notice\":\"A new history contract is used to store claims.\"}},\"kind\":\"user\",\"methods\":{\"constructor\":{\"notice\":\"Constructs an `Authority` contract.\"},\"getClaim(address,bytes)\":{\"notice\":\"Get a claim from the current history. The encoding of `_proofContext` might vary depending on the implementation of the current history contract.\"},\"getHistory()\":{\"notice\":\"Get the current history contract.\"},\"join()\":{\"notice\":\"Emits an `ApplicationJoined` event with the message sender.\"},\"migrateHistoryToConsensus(address)\":{\"notice\":\"Transfer ownership over the current history contract to `_consensus`.\"},\"setHistory(address)\":{\"notice\":\"Make `Authority` point to another history contract.\"},\"submitClaim(bytes)\":{\"notice\":\"Submits a claim to the current history contract. The encoding of `_claimData` might vary depending on the implementation of the current history contract.\"},\"withdrawERC20Tokens(address,address,uint256)\":{\"notice\":\"Transfer some amount of ERC-20 tokens to a recipient.\"}},\"notice\":\"A consensus model controlled by a single address, the owner. Claims are stored in an auxiliary contract called `History`.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/consensus/authority/Authority.sol\":\"Authority\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"contracts/consensus/AbstractConsensus.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\nimport {IConsensus} from \\\"./IConsensus.sol\\\";\\n\\n/// @title Abstract Consensus\\n/// @notice An abstract contract that partially implements `IConsensus`.\\nabstract contract AbstractConsensus is IConsensus {\\n /// @notice Emits an `ApplicationJoined` event with the message sender.\\n function join() external override {\\n emit ApplicationJoined(msg.sender);\\n }\\n}\\n\",\"keccak256\":\"0x0483d8a8557c4e345eca5ad31ffea560737b08c75ade0430106136a89d755e13\",\"license\":\"Apache-2.0\"},\"contracts/consensus/IConsensus.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\n/// @title Consensus interface\\n///\\n/// @notice This contract defines a generic interface for consensuses.\\n/// We use the word \\\"consensus\\\" to designate a contract that provides claims\\n/// in the base layer regarding the state of off-chain machines running in\\n/// the execution layer. How this contract is able to reach consensus, who is\\n/// able to submit claims, and how are claims stored in the base layer are\\n/// some of the implementation details left unspecified by this interface.\\n///\\n/// From the point of view of a DApp, these claims are necessary to validate\\n/// on-chain action allowed by the off-chain machine in the form of vouchers\\n/// and notices. Each claim is composed of three parts: an epoch hash, a first\\n/// index, and a last index. We'll explain each of these parts below.\\n///\\n/// First, let us define the word \\\"epoch\\\". For finality reasons, we need to\\n/// divide the stream of inputs being fed into the off-chain machine into\\n/// batches of inputs, which we call \\\"epoches\\\". At the end of every epoch,\\n/// we summarize the state of the off-chain machine in a single hash, called\\n/// \\\"epoch hash\\\". Please note that this interface does not define how this\\n/// stream of inputs is being chopped up into epoches.\\n///\\n/// The other two parts are simply the indices of the first and last inputs\\n/// accepted during the epoch. Logically, the first index MUST BE less than\\n/// or equal to the last index. As a result, every epoch MUST accept at least\\n/// one input. This assumption stems from the fact that the state of a machine\\n/// can only change after an input is fed into it.\\n///\\n/// Examples of possible implementations of this interface include:\\n///\\n/// * An authority consensus, controlled by a single address who has full\\n/// control over epoch boundaries, claim submission, asset management, etc.\\n///\\n/// * A quorum consensus, controlled by a limited set of validators, that\\n/// vote on the state of the machine at the end of every epoch. Also, epoch\\n/// boundaries are determined by the timestamp in the base layer, and assets\\n/// are split equally amongst the validators.\\n///\\n/// * An NxN consensus, which allows anyone to submit and dispute claims\\n/// in the base layer. Epoch boundaries are determined in the same fashion\\n/// as in the quorum example.\\n///\\ninterface IConsensus {\\n /// @notice An application has joined the consensus' validation set.\\n /// @param application The application\\n /// @dev MUST be triggered on a successful call to `join`.\\n event ApplicationJoined(address application);\\n\\n /// @notice Get a specific claim regarding a specific DApp.\\n /// The encoding of `_proofContext` might vary\\n /// depending on the implementation.\\n /// @param _dapp The DApp address\\n /// @param _proofContext Data for retrieving the desired claim\\n /// @return epochHash_ The claimed epoch hash\\n /// @return firstInputIndex_ The index of the first input of the epoch in the input box\\n /// @return lastInputIndex_ The index of the last input of the epoch in the input box\\n function getClaim(\\n address _dapp,\\n bytes calldata _proofContext\\n )\\n external\\n view\\n returns (\\n bytes32 epochHash_,\\n uint256 firstInputIndex_,\\n uint256 lastInputIndex_\\n );\\n\\n /// @notice Signal the consensus that the message sender wants to join its validation set.\\n /// @dev MUST fire an `ApplicationJoined` event with the message sender as argument.\\n function join() external;\\n}\\n\",\"keccak256\":\"0x5d59c8dc3c1483e3173837d679093000077bf175c0b3ad7f02f0ffe611c0a89e\",\"license\":\"Apache-2.0\"},\"contracts/consensus/authority/Authority.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\nimport {Ownable} from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport {IERC20} from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport {IConsensus} from \\\"../IConsensus.sol\\\";\\nimport {AbstractConsensus} from \\\"../AbstractConsensus.sol\\\";\\nimport {IInputBox} from \\\"../../inputs/IInputBox.sol\\\";\\nimport {IHistory} from \\\"../../history/IHistory.sol\\\";\\n\\n/// @title Authority consensus\\n/// @notice A consensus model controlled by a single address, the owner.\\n/// Claims are stored in an auxiliary contract called `History`.\\n/// @dev This contract inherits `AbstractConsensus` and OpenZeppelin's `Ownable` contract.\\n/// For more information on `Ownable`, please consult OpenZeppelin's official documentation.\\ncontract Authority is AbstractConsensus, Ownable {\\n /// @notice The current history contract.\\n /// @dev See the `getHistory` and `setHistory` functions.\\n IHistory internal history;\\n\\n /// @notice The `Authority` contract was created.\\n /// @param owner The address that initially owns the `Authority` contract\\n /// @param inputBox The input box from which the authority fetches new inputs\\n /// @dev MUST be triggered during construction.\\n event ConsensusCreated(address owner, IInputBox inputBox);\\n\\n /// @notice A new history contract is used to store claims.\\n /// @param history The new history contract\\n /// @dev MUST be triggered on a successful call to `setHistory`.\\n event NewHistory(IHistory history);\\n\\n /// @notice Constructs an `Authority` contract.\\n /// @param _owner The initial contract owner\\n /// @param _inputBox The input box contract\\n /// @dev Emits a `ConsensusCreated` event.\\n constructor(address _owner, IInputBox _inputBox) {\\n // constructor in Ownable already called `transferOwnership(msg.sender)`, so\\n // we only need to call `transferOwnership(_owner)` if _owner != msg.sender\\n if (msg.sender != _owner) {\\n transferOwnership(_owner);\\n }\\n emit ConsensusCreated(_owner, _inputBox);\\n }\\n\\n /// @notice Submits a claim to the current history contract.\\n /// The encoding of `_claimData` might vary depending on the\\n /// implementation of the current history contract.\\n /// @param _claimData Data for submitting a claim\\n /// @dev Can only be called by the `Authority` owner,\\n /// and the `Authority` contract must have ownership over\\n /// its current history contract.\\n function submitClaim(bytes calldata _claimData) external onlyOwner {\\n history.submitClaim(_claimData);\\n }\\n\\n /// @notice Transfer ownership over the current history contract to `_consensus`.\\n /// @param _consensus The new owner of the current history contract\\n /// @dev Can only be called by the `Authority` owner,\\n /// and the `Authority` contract must have ownership over\\n /// its current history contract.\\n function migrateHistoryToConsensus(address _consensus) external onlyOwner {\\n history.migrateToConsensus(_consensus);\\n }\\n\\n /// @notice Make `Authority` point to another history contract.\\n /// @param _history The new history contract\\n /// @dev Emits a `NewHistory` event.\\n /// Can only be called by the `Authority` owner.\\n function setHistory(IHistory _history) external onlyOwner {\\n history = _history;\\n emit NewHistory(_history);\\n }\\n\\n /// @notice Get the current history contract.\\n /// @return The current history contract\\n function getHistory() external view returns (IHistory) {\\n return history;\\n }\\n\\n /// @notice Get a claim from the current history.\\n /// The encoding of `_proofContext` might vary depending on the\\n /// implementation of the current history contract.\\n /// @inheritdoc IConsensus\\n function getClaim(\\n address _dapp,\\n bytes calldata _proofContext\\n ) external view override returns (bytes32, uint256, uint256) {\\n return history.getClaim(_dapp, _proofContext);\\n }\\n\\n /// @notice Transfer some amount of ERC-20 tokens to a recipient.\\n /// @param _token The token contract\\n /// @param _recipient The recipient address\\n /// @param _amount The amount of tokens to be withdrawn\\n /// @dev Can only be called by the `Authority` owner.\\n function withdrawERC20Tokens(\\n IERC20 _token,\\n address _recipient,\\n uint256 _amount\\n ) external onlyOwner {\\n require(\\n _token.transfer(_recipient, _amount),\\n \\\"Authority: withdrawal failed\\\"\\n );\\n }\\n}\\n\",\"keccak256\":\"0x0a37f82a0c924deeb8fa5baa6ff0133054037170dadd0032b81f4c93c3ca1c91\",\"license\":\"Apache-2.0\"},\"contracts/history/IHistory.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\n/// @title History interface\\ninterface IHistory {\\n // Permissioned functions\\n\\n /// @notice Submit a claim.\\n /// The encoding of `_claimData` might vary\\n /// depending on the history implementation.\\n /// @param _claimData Data for submitting a claim\\n /// @dev Should have access control.\\n function submitClaim(bytes calldata _claimData) external;\\n\\n /// @notice Transfer ownership to another consensus.\\n /// @param _consensus The new consensus\\n /// @dev Should have access control.\\n function migrateToConsensus(address _consensus) external;\\n\\n // Permissionless functions\\n\\n /// @notice Get a specific claim regarding a specific DApp.\\n /// The encoding of `_proofContext` might vary\\n /// depending on the history implementation.\\n /// @param _dapp The DApp address\\n /// @param _proofContext Data for retrieving the desired claim\\n /// @return epochHash_ The claimed epoch hash\\n /// @return firstInputIndex_ The index of the first input of the epoch in the input box\\n /// @return lastInputIndex_ The index of the last input of the epoch in the input box\\n function getClaim(\\n address _dapp,\\n bytes calldata _proofContext\\n )\\n external\\n view\\n returns (\\n bytes32 epochHash_,\\n uint256 firstInputIndex_,\\n uint256 lastInputIndex_\\n );\\n}\\n\",\"keccak256\":\"0xfe0404f078a3a6f761beea8afbb2fac322fd2900f7ad2e2b866504c7aa54568f\",\"license\":\"Apache-2.0\"},\"contracts/inputs/IInputBox.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\n/// @title Input Box interface\\ninterface IInputBox {\\n /// @notice Emitted when an input is added to a DApp's input box.\\n /// @param dapp The address of the DApp\\n /// @param inboxInputIndex The index of the input in the input box\\n /// @param sender The address that sent the input\\n /// @param input The contents of the input\\n /// @dev MUST be triggered on a successful call to `addInput`.\\n event InputAdded(\\n address indexed dapp,\\n uint256 indexed inboxInputIndex,\\n address sender,\\n bytes input\\n );\\n\\n /// @notice Add an input to a DApp's input box.\\n /// @param _dapp The address of the DApp\\n /// @param _input The contents of the input\\n /// @return The hash of the input plus some extra metadata\\n /// @dev MUST fire an `InputAdded` event accordingly.\\n function addInput(\\n address _dapp,\\n bytes calldata _input\\n ) external returns (bytes32);\\n\\n /// @notice Get the number of inputs in a DApp's input box.\\n /// @param _dapp The address of the DApp\\n /// @return Number of inputs in the DApp's input box\\n function getNumberOfInputs(address _dapp) external view returns (uint256);\\n\\n /// @notice Get the hash of an input in a DApp's input box.\\n /// @param _dapp The address of the DApp\\n /// @param _index The index of the input in the DApp's input box\\n /// @return The hash of the input at the provided index in the DApp's input box\\n /// @dev `_index` MUST be in the interval `[0,n)` where `n` is the number of\\n /// inputs in the DApp's input box. See the `getNumberOfInputs` function.\\n function getInputHash(\\n address _dapp,\\n uint256 _index\\n ) external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x2addd467a24cde2131784103080aeb28df40d87ba19c5fd92bf96c0c074603df\",\"license\":\"Apache-2.0\"}},\"version\":1}", - "bytecode": "0x608060405234801561001057600080fd5b506040516109ef3803806109ef83398101604081905261002f916101da565b6100383361009b565b336001600160a01b0383161461005157610051826100eb565b604080516001600160a01b038085168252831660208201527f583f764398dc1f7529b3e4472cb331312f6b6d76744da14476f571a330d36e23910160405180910390a15050610214565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6100f3610169565b6001600160a01b03811661015d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b6101668161009b565b50565b6000546001600160a01b031633146101c35760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610154565b565b6001600160a01b038116811461016657600080fd5b600080604083850312156101ed57600080fd5b82516101f8816101c5565b6020840151909250610209816101c5565b809150509250929050565b6107cc806102236000396000f3fe608060405234801561001057600080fd5b506004361061009e5760003560e01c8063b688a36311610066578063b688a3631461010e578063bcdd1e1314610116578063d79a824014610129578063ddfdfbb014610157578063f2fde38b1461016a57600080fd5b8063159c5ea1146100a3578063715018a6146100b85780638da5cb5b146100c05780639368a3d3146100ea578063aa15efc8146100fd575b600080fd5b6100b66100b136600461058e565b61017d565b005b6100b66101d9565b6000546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b6100b66100f836600461058e565b6101ed565b6001546001600160a01b03166100cd565b6100b6610257565b6100b66101243660046105b2565b61028c565b61013c61013736600461063c565b61035d565b604080519384526020840192909252908201526060016100e1565b6100b6610165366004610691565b6103e6565b6100b661017836600461058e565b610456565b6101856104cf565b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f2bcd43869347a1d42f97ac6042f3d129817abd05a6125f9750fe3724e321d23e9060200160405180910390a150565b6101e16104cf565b6101eb6000610529565b565b6101f56104cf565b60015460405163fc41168360e01b81526001600160a01b0383811660048301529091169063fc41168390602401600060405180830381600087803b15801561023c57600080fd5b505af1158015610250573d6000803e3d6000fd5b5050505050565b6040513381527f27c2b702d3bff195a18baca2daf00b20a986177c5f1449af4e2d46a3c3e02ce59060200160405180910390a1565b6102946104cf565b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af11580156102e3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061030791906106d3565b6103585760405162461bcd60e51b815260206004820152601c60248201527f417574686f726974793a207769746864726177616c206661696c65640000000060448201526064015b60405180910390fd5b505050565b60015460405163035e6a0960e61b8152600091829182916001600160a01b03169063d79a8240906103969089908990899060040161071e565b606060405180830381865afa1580156103b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103d7919061074c565b92509250925093509350939050565b6103ee6104cf565b600154604051630ddfdfbb60e41b81526001600160a01b039091169063ddfdfbb090610420908590859060040161077a565b600060405180830381600087803b15801561043a57600080fd5b505af115801561044e573d6000803e3d6000fd5b505050505050565b61045e6104cf565b6001600160a01b0381166104c35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161034f565b6104cc81610529565b50565b6000546001600160a01b031633146101eb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161034f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146104cc57600080fd5b6000602082840312156105a057600080fd5b81356105ab81610579565b9392505050565b6000806000606084860312156105c757600080fd5b83356105d281610579565b925060208401356105e281610579565b929592945050506040919091013590565b60008083601f84011261060557600080fd5b50813567ffffffffffffffff81111561061d57600080fd5b60208301915083602082850101111561063557600080fd5b9250929050565b60008060006040848603121561065157600080fd5b833561065c81610579565b9250602084013567ffffffffffffffff81111561067857600080fd5b610684868287016105f3565b9497909650939450505050565b600080602083850312156106a457600080fd5b823567ffffffffffffffff8111156106bb57600080fd5b6106c7858286016105f3565b90969095509350505050565b6000602082840312156106e557600080fd5b815180151581146105ab57600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b038416815260406020820181905260009061074390830184866106f5565b95945050505050565b60008060006060848603121561076157600080fd5b8351925060208401519150604084015190509250925092565b60208152600061078e6020830184866106f5565b94935050505056fea264697066735822122021f66c26bc1cded7ab5457f04d0a74c5257b6aa88e7d69d7f9ad0713ba4679e664736f6c63430008130033", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061009e5760003560e01c8063b688a36311610066578063b688a3631461010e578063bcdd1e1314610116578063d79a824014610129578063ddfdfbb014610157578063f2fde38b1461016a57600080fd5b8063159c5ea1146100a3578063715018a6146100b85780638da5cb5b146100c05780639368a3d3146100ea578063aa15efc8146100fd575b600080fd5b6100b66100b136600461058e565b61017d565b005b6100b66101d9565b6000546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b6100b66100f836600461058e565b6101ed565b6001546001600160a01b03166100cd565b6100b6610257565b6100b66101243660046105b2565b61028c565b61013c61013736600461063c565b61035d565b604080519384526020840192909252908201526060016100e1565b6100b6610165366004610691565b6103e6565b6100b661017836600461058e565b610456565b6101856104cf565b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f2bcd43869347a1d42f97ac6042f3d129817abd05a6125f9750fe3724e321d23e9060200160405180910390a150565b6101e16104cf565b6101eb6000610529565b565b6101f56104cf565b60015460405163fc41168360e01b81526001600160a01b0383811660048301529091169063fc41168390602401600060405180830381600087803b15801561023c57600080fd5b505af1158015610250573d6000803e3d6000fd5b5050505050565b6040513381527f27c2b702d3bff195a18baca2daf00b20a986177c5f1449af4e2d46a3c3e02ce59060200160405180910390a1565b6102946104cf565b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af11580156102e3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061030791906106d3565b6103585760405162461bcd60e51b815260206004820152601c60248201527f417574686f726974793a207769746864726177616c206661696c65640000000060448201526064015b60405180910390fd5b505050565b60015460405163035e6a0960e61b8152600091829182916001600160a01b03169063d79a8240906103969089908990899060040161071e565b606060405180830381865afa1580156103b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103d7919061074c565b92509250925093509350939050565b6103ee6104cf565b600154604051630ddfdfbb60e41b81526001600160a01b039091169063ddfdfbb090610420908590859060040161077a565b600060405180830381600087803b15801561043a57600080fd5b505af115801561044e573d6000803e3d6000fd5b505050505050565b61045e6104cf565b6001600160a01b0381166104c35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161034f565b6104cc81610529565b50565b6000546001600160a01b031633146101eb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161034f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146104cc57600080fd5b6000602082840312156105a057600080fd5b81356105ab81610579565b9392505050565b6000806000606084860312156105c757600080fd5b83356105d281610579565b925060208401356105e281610579565b929592945050506040919091013590565b60008083601f84011261060557600080fd5b50813567ffffffffffffffff81111561061d57600080fd5b60208301915083602082850101111561063557600080fd5b9250929050565b60008060006040848603121561065157600080fd5b833561065c81610579565b9250602084013567ffffffffffffffff81111561067857600080fd5b610684868287016105f3565b9497909650939450505050565b600080602083850312156106a457600080fd5b823567ffffffffffffffff8111156106bb57600080fd5b6106c7858286016105f3565b90969095509350505050565b6000602082840312156106e557600080fd5b815180151581146105ab57600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b038416815260406020820181905260009061074390830184866106f5565b95945050505050565b60008060006060848603121561076157600080fd5b8351925060208401519150604084015190509250925092565b60208152600061078e6020830184866106f5565b94935050505056fea264697066735822122021f66c26bc1cded7ab5457f04d0a74c5257b6aa88e7d69d7f9ad0713ba4679e664736f6c63430008130033", - "devdoc": { - "details": "This contract inherits `AbstractConsensus` and OpenZeppelin's `Ownable` contract. For more information on `Ownable`, please consult OpenZeppelin's official documentation.", - "events": { - "ApplicationJoined(address)": { - "details": "MUST be triggered on a successful call to `join`.", - "params": { - "application": "The application" - } - }, - "ConsensusCreated(address,address)": { - "details": "MUST be triggered during construction.", - "params": { - "inputBox": "The input box from which the authority fetches new inputs", - "owner": "The address that initially owns the `Authority` contract" - } - }, - "NewHistory(address)": { - "details": "MUST be triggered on a successful call to `setHistory`.", - "params": { - "history": "The new history contract" - } - } - }, - "kind": "dev", - "methods": { - "constructor": { - "details": "Emits a `ConsensusCreated` event.", - "params": { - "_inputBox": "The input box contract", - "_owner": "The initial contract owner" - } - }, - "getClaim(address,bytes)": { - "params": { - "_dapp": "The DApp address", - "_proofContext": "Data for retrieving the desired claim" - }, - "returns": { - "_0": "The claimed epoch hash", - "_1": "The index of the first input of the epoch in the input box", - "_2": "The index of the last input of the epoch in the input box" - } - }, - "getHistory()": { - "returns": { - "_0": "The current history contract" - } - }, - "migrateHistoryToConsensus(address)": { - "details": "Can only be called by the `Authority` owner, and the `Authority` contract must have ownership over its current history contract.", - "params": { - "_consensus": "The new owner of the current history contract" - } - }, - "owner()": { - "details": "Returns the address of the current owner." - }, - "renounceOwnership()": { - "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." - }, - "setHistory(address)": { - "details": "Emits a `NewHistory` event. Can only be called by the `Authority` owner.", - "params": { - "_history": "The new history contract" - } - }, - "submitClaim(bytes)": { - "details": "Can only be called by the `Authority` owner, and the `Authority` contract must have ownership over its current history contract.", - "params": { - "_claimData": "Data for submitting a claim" - } - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." - }, - "withdrawERC20Tokens(address,address,uint256)": { - "details": "Can only be called by the `Authority` owner.", - "params": { - "_amount": "The amount of tokens to be withdrawn", - "_recipient": "The recipient address", - "_token": "The token contract" - } - } - }, - "stateVariables": { - "history": { - "details": "See the `getHistory` and `setHistory` functions." - } - }, - "title": "Authority consensus", - "version": 1 - }, - "userdoc": { - "events": { - "ApplicationJoined(address)": { - "notice": "An application has joined the consensus' validation set." - }, - "ConsensusCreated(address,address)": { - "notice": "The `Authority` contract was created." - }, - "NewHistory(address)": { - "notice": "A new history contract is used to store claims." - } - }, - "kind": "user", - "methods": { - "constructor": { - "notice": "Constructs an `Authority` contract." - }, - "getClaim(address,bytes)": { - "notice": "Get a claim from the current history. The encoding of `_proofContext` might vary depending on the implementation of the current history contract." - }, - "getHistory()": { - "notice": "Get the current history contract." - }, - "join()": { - "notice": "Emits an `ApplicationJoined` event with the message sender." - }, - "migrateHistoryToConsensus(address)": { - "notice": "Transfer ownership over the current history contract to `_consensus`." - }, - "setHistory(address)": { - "notice": "Make `Authority` point to another history contract." - }, - "submitClaim(bytes)": { - "notice": "Submits a claim to the current history contract. The encoding of `_claimData` might vary depending on the implementation of the current history contract." - }, - "withdrawERC20Tokens(address,address,uint256)": { - "notice": "Transfer some amount of ERC-20 tokens to a recipient." - } - }, - "notice": "A consensus model controlled by a single address, the owner. Claims are stored in an auxiliary contract called `History`.", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 1155, - "contract": "contracts/consensus/authority/Authority.sol:Authority", - "label": "_owner", - "offset": 0, - "slot": "0", - "type": "t_address" - }, - { - "astId": 2248, - "contract": "contracts/consensus/authority/Authority.sol:Authority", - "label": "history", - "offset": 0, - "slot": "1", - "type": "t_contract(IHistory)3266" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_contract(IHistory)3266": { - "encoding": "inplace", - "label": "contract IHistory", - "numberOfBytes": "20" - } - } - } -} \ No newline at end of file diff --git a/onchain/rollups/deployments/goerli/History.json b/onchain/rollups/deployments/goerli/History.json deleted file mode 100644 index 4d5e9800f..000000000 --- a/onchain/rollups/deployments/goerli/History.json +++ /dev/null @@ -1,381 +0,0 @@ -{ - "address": "0xFB34DaDd5f3Aba55004C448AcFd24fAF5A4Ff83E", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_owner", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "dapp", - "type": "address" - }, - { - "components": [ - { - "internalType": "bytes32", - "name": "epochHash", - "type": "bytes32" - }, - { - "internalType": "uint128", - "name": "firstIndex", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "lastIndex", - "type": "uint128" - } - ], - "indexed": false, - "internalType": "struct History.Claim", - "name": "claim", - "type": "tuple" - } - ], - "name": "NewClaimToHistory", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_dapp", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_proofContext", - "type": "bytes" - } - ], - "name": "getClaim", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_consensus", - "type": "address" - } - ], - "name": "migrateToConsensus", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "_claimData", - "type": "bytes" - } - ], - "name": "submitClaim", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0xc66ae188d4277a9fcd8fa7da95f824463cc0d5264eb63f0ae5165ada7a70c45c", - "receipt": { - "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", - "from": "0x18930e8a66a1DbE21D00581216789AAB7460Afd0", - "contractAddress": null, - "transactionIndex": 25, - "gasUsed": "494722", - "logsBloom": "0x00000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000100000000000002000000000000000000000000100000000000001000000000000010000000000000000000000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000000000001000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000020000000000000000000000000800000000080000000000000000000000000000000", - "blockHash": "0x9e6ad018c56dc214630c8e0b2c890e58089b036f60b059ac2c56849e593a1ce4", - "transactionHash": "0xc66ae188d4277a9fcd8fa7da95f824463cc0d5264eb63f0ae5165ada7a70c45c", - "logs": [ - { - "transactionIndex": 25, - "blockNumber": 9017160, - "transactionHash": "0xc66ae188d4277a9fcd8fa7da95f824463cc0d5264eb63f0ae5165ada7a70c45c", - "address": "0xFB34DaDd5f3Aba55004C448AcFd24fAF5A4Ff83E", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000004e59b44847b379578588920ca78fbf26c0b4956c" - ], - "data": "0x", - "logIndex": 56, - "blockHash": "0x9e6ad018c56dc214630c8e0b2c890e58089b036f60b059ac2c56849e593a1ce4" - }, - { - "transactionIndex": 25, - "blockNumber": 9017160, - "transactionHash": "0xc66ae188d4277a9fcd8fa7da95f824463cc0d5264eb63f0ae5165ada7a70c45c", - "address": "0xFB34DaDd5f3Aba55004C448AcFd24fAF5A4Ff83E", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000004e59b44847b379578588920ca78fbf26c0b4956c", - "0x00000000000000000000000035ec7d70caff883844d94b54cd19634ffab5d8cc" - ], - "data": "0x", - "logIndex": 57, - "blockHash": "0x9e6ad018c56dc214630c8e0b2c890e58089b036f60b059ac2c56849e593a1ce4" - } - ], - "blockNumber": 9017160, - "cumulativeGasUsed": "20667139", - "status": 1, - "byzantium": true - }, - "args": [ - "0x35EC7d70cAff883844d94b54cD19634fFAb5d8CC" - ], - "numDeployments": 5, - "solcInputHash": "ccf852a6f03ad282136085842817ac99", - "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dapp\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"epochHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint128\",\"name\":\"firstIndex\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"lastIndex\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"struct History.Claim\",\"name\":\"claim\",\"type\":\"tuple\"}],\"name\":\"NewClaimToHistory\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dapp\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_proofContext\",\"type\":\"bytes\"}],\"name\":\"getClaim\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_consensus\",\"type\":\"address\"}],\"name\":\"migrateToConsensus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_claimData\",\"type\":\"bytes\"}],\"name\":\"submitClaim\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"This contract inherits OpenZeppelin's `Ownable` contract. For more information on `Ownable`, please consult OpenZeppelin's official documentation.\",\"events\":{\"NewClaimToHistory(address,(bytes32,uint128,uint128))\":{\"details\":\"MUST be triggered on a successful call to `submitClaim`.\",\"params\":{\"claim\":\"The newly-submitted claim\",\"dapp\":\"The address of the DApp\"}}},\"kind\":\"dev\",\"methods\":{\"constructor\":{\"params\":{\"_owner\":\"The initial owner\"}},\"getClaim(address,bytes)\":{\"params\":{\"_dapp\":\"The DApp address\",\"_proofContext\":\"Data for retrieving the desired claim\"},\"returns\":{\"_0\":\"The claimed epoch hash\",\"_1\":\"The index of the first input of the epoch in the input box\",\"_2\":\"The index of the last input of the epoch in the input box\"}},\"migrateToConsensus(address)\":{\"details\":\"Emits an `OwnershipTransferred` event. Should have access control.\",\"params\":{\"_consensus\":\"The new consensus\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"submitClaim(bytes)\":{\"details\":\"Emits a `NewClaimToHistory` event. Should have access control.\",\"params\":{\"_claimData\":\"Data for submitting a claim\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"stateVariables\":{\"claims\":{\"details\":\"See the `getClaim` and `submitClaim` functions.\"}},\"title\":\"Simple History\",\"version\":1},\"userdoc\":{\"events\":{\"NewClaimToHistory(address,(bytes32,uint128,uint128))\":{\"notice\":\"A new claim regarding a specific DApp was submitted.\"}},\"kind\":\"user\",\"methods\":{\"constructor\":{\"notice\":\"Creates a `History` contract.\"},\"getClaim(address,bytes)\":{\"notice\":\"Get a specific claim regarding a specific DApp. There are several requirements for this function to be called successfully. * `_proofContext` MUST be well-encoded. In Solidity, it can be constructed as `abi.encode(claimIndex)`, where `claimIndex` is the claim index (type `uint256`). * `claimIndex` MUST be inside the interval `[0, n)` where `n` is the number of claims that have been submitted to `_dapp` already.\"},\"migrateToConsensus(address)\":{\"notice\":\"Transfer ownership to another consensus.\"},\"submitClaim(bytes)\":{\"notice\":\"Submit a claim regarding a DApp. There are several requirements for this function to be called successfully. * `_claimData` MUST be well-encoded. In Solidity, it can be constructed as `abi.encode(dapp, claim)`, where `dapp` is the DApp address (type `address`) and `claim` is the claim structure (type `Claim`). * `firstIndex` MUST be less than or equal to `lastIndex`. As a result, every claim MUST encompass AT LEAST one input. * If this is the DApp's first claim, then `firstIndex` MUST be `0`. Otherwise, `firstIndex` MUST be the `lastClaim.lastIndex + 1`. In other words, claims MUST NOT skip inputs.\"}},\"notice\":\"This contract stores claims for each DApp individually. This means that, for each DApp, the contract stores an array of `Claim` entries, where each `Claim` is composed of: * An epoch hash (`bytes32`) * A closed interval of input indices (`uint128`, `uint128`) The contract guarantees that the first interval starts at index 0, and that the following intervals don't have gaps or overlaps. Furthermore, claims can only be submitted by the contract owner through `submitClaim`, but can be retrieved by anyone with `getClaim`.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/history/History.sol\":\"History\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"contracts/history/History.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\nimport {Ownable} from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\nimport {IHistory} from \\\"./IHistory.sol\\\";\\n\\n/// @title Simple History\\n///\\n/// @notice This contract stores claims for each DApp individually.\\n/// This means that, for each DApp, the contract stores an array of\\n/// `Claim` entries, where each `Claim` is composed of:\\n///\\n/// * An epoch hash (`bytes32`)\\n/// * A closed interval of input indices (`uint128`, `uint128`)\\n///\\n/// The contract guarantees that the first interval starts at index 0,\\n/// and that the following intervals don't have gaps or overlaps.\\n///\\n/// Furthermore, claims can only be submitted by the contract owner\\n/// through `submitClaim`, but can be retrieved by anyone with `getClaim`.\\n///\\n/// @dev This contract inherits OpenZeppelin's `Ownable` contract.\\n/// For more information on `Ownable`, please consult OpenZeppelin's official documentation.\\ncontract History is IHistory, Ownable {\\n struct Claim {\\n bytes32 epochHash;\\n uint128 firstIndex;\\n uint128 lastIndex;\\n }\\n\\n /// @notice Mapping from DApp address to array of claims.\\n /// @dev See the `getClaim` and `submitClaim` functions.\\n mapping(address => Claim[]) internal claims;\\n\\n /// @notice A new claim regarding a specific DApp was submitted.\\n /// @param dapp The address of the DApp\\n /// @param claim The newly-submitted claim\\n /// @dev MUST be triggered on a successful call to `submitClaim`.\\n event NewClaimToHistory(address indexed dapp, Claim claim);\\n\\n /// @notice Creates a `History` contract.\\n /// @param _owner The initial owner\\n constructor(address _owner) {\\n // constructor in Ownable already called `transferOwnership(msg.sender)`, so\\n // we only need to call `transferOwnership(_owner)` if _owner != msg.sender\\n if (_owner != msg.sender) {\\n transferOwnership(_owner);\\n }\\n }\\n\\n /// @notice Submit a claim regarding a DApp.\\n /// There are several requirements for this function to be called successfully.\\n ///\\n /// * `_claimData` MUST be well-encoded. In Solidity, it can be constructed\\n /// as `abi.encode(dapp, claim)`, where `dapp` is the DApp address (type `address`)\\n /// and `claim` is the claim structure (type `Claim`).\\n ///\\n /// * `firstIndex` MUST be less than or equal to `lastIndex`.\\n /// As a result, every claim MUST encompass AT LEAST one input.\\n ///\\n /// * If this is the DApp's first claim, then `firstIndex` MUST be `0`.\\n /// Otherwise, `firstIndex` MUST be the `lastClaim.lastIndex + 1`.\\n /// In other words, claims MUST NOT skip inputs.\\n ///\\n /// @inheritdoc IHistory\\n /// @dev Emits a `NewClaimToHistory` event. Should have access control.\\n function submitClaim(\\n bytes calldata _claimData\\n ) external override onlyOwner {\\n (address dapp, Claim memory claim) = abi.decode(\\n _claimData,\\n (address, Claim)\\n );\\n\\n require(claim.firstIndex <= claim.lastIndex, \\\"History: FI > LI\\\");\\n\\n Claim[] storage dappClaims = claims[dapp];\\n uint256 numDAppClaims = dappClaims.length;\\n\\n require(\\n claim.firstIndex ==\\n (\\n (numDAppClaims == 0)\\n ? 0\\n : (dappClaims[numDAppClaims - 1].lastIndex + 1)\\n ),\\n \\\"History: unclaimed inputs\\\"\\n );\\n\\n dappClaims.push(claim);\\n\\n emit NewClaimToHistory(dapp, claim);\\n }\\n\\n /// @notice Get a specific claim regarding a specific DApp.\\n /// There are several requirements for this function to be called successfully.\\n ///\\n /// * `_proofContext` MUST be well-encoded. In Solidity, it can be constructed\\n /// as `abi.encode(claimIndex)`, where `claimIndex` is the claim index (type `uint256`).\\n ///\\n /// * `claimIndex` MUST be inside the interval `[0, n)` where `n` is the number of claims\\n /// that have been submitted to `_dapp` already.\\n ///\\n /// @inheritdoc IHistory\\n function getClaim(\\n address _dapp,\\n bytes calldata _proofContext\\n ) external view override returns (bytes32, uint256, uint256) {\\n uint256 claimIndex = abi.decode(_proofContext, (uint256));\\n\\n Claim memory claim = claims[_dapp][claimIndex];\\n\\n return (claim.epochHash, claim.firstIndex, claim.lastIndex);\\n }\\n\\n /// @inheritdoc IHistory\\n /// @dev Emits an `OwnershipTransferred` event. Should have access control.\\n function migrateToConsensus(\\n address _consensus\\n ) external override onlyOwner {\\n transferOwnership(_consensus);\\n }\\n}\\n\",\"keccak256\":\"0x607253a9e73d3fe0b98e2c5d7b6f9ee1dad48d7cf4a1284b4f1361d74178da7a\",\"license\":\"Apache-2.0\"},\"contracts/history/IHistory.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\n/// @title History interface\\ninterface IHistory {\\n // Permissioned functions\\n\\n /// @notice Submit a claim.\\n /// The encoding of `_claimData` might vary\\n /// depending on the history implementation.\\n /// @param _claimData Data for submitting a claim\\n /// @dev Should have access control.\\n function submitClaim(bytes calldata _claimData) external;\\n\\n /// @notice Transfer ownership to another consensus.\\n /// @param _consensus The new consensus\\n /// @dev Should have access control.\\n function migrateToConsensus(address _consensus) external;\\n\\n // Permissionless functions\\n\\n /// @notice Get a specific claim regarding a specific DApp.\\n /// The encoding of `_proofContext` might vary\\n /// depending on the history implementation.\\n /// @param _dapp The DApp address\\n /// @param _proofContext Data for retrieving the desired claim\\n /// @return epochHash_ The claimed epoch hash\\n /// @return firstInputIndex_ The index of the first input of the epoch in the input box\\n /// @return lastInputIndex_ The index of the last input of the epoch in the input box\\n function getClaim(\\n address _dapp,\\n bytes calldata _proofContext\\n )\\n external\\n view\\n returns (\\n bytes32 epochHash_,\\n uint256 firstInputIndex_,\\n uint256 lastInputIndex_\\n );\\n}\\n\",\"keccak256\":\"0xfe0404f078a3a6f761beea8afbb2fac322fd2900f7ad2e2b866504c7aa54568f\",\"license\":\"Apache-2.0\"}},\"version\":1}", - "bytecode": "0x608060405234801561001057600080fd5b5060405161091f38038061091f83398101604081905261002f91610181565b61003833610057565b6001600160a01b038116331461005157610051816100a7565b506101b1565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6100af610125565b6001600160a01b0381166101195760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b61012281610057565b50565b6000546001600160a01b0316331461017f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610110565b565b60006020828403121561019357600080fd5b81516001600160a01b03811681146101aa57600080fd5b9392505050565b61075f806101c06000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c8063715018a6146100675780638da5cb5b14610071578063d79a824014610091578063ddfdfbb0146100bf578063f2fde38b146100d2578063fc411683146100e5575b600080fd5b61006f6100f8565b005b6000546040516001600160a01b0390911681526020015b60405180910390f35b6100a461009f36600461052f565b61010c565b60408051938452602084019290925290820152606001610088565b61006f6100cd366004610584565b6101a5565b61006f6100e03660046105c6565b61039d565b61006f6100f33660046105c6565b610416565b610100610427565b61010a6000610481565b565b600080808061011d858701876105ea565b6001600160a01b0388166000908152600160205260408120805492935090918390811061014c5761014c610603565b60009182526020918290206040805160608101825260029390930290910180548084526001909101546001600160801b03808216958501869052600160801b90910416929091018290529a919950975095505050505050565b6101ad610427565b6000806101bc83850185610635565b9150915080604001516001600160801b031681602001516001600160801b031611156102225760405162461bcd60e51b815260206004820152601060248201526f486973746f72793a204649203e204c4960801b60448201526064015b60405180910390fd5b6001600160a01b038216600090815260016020526040902080548015610294578161024e6001836106e9565b8154811061025e5761025e610603565b906000526020600020906002020160010160109054906101000a90046001600160801b0316600161028f9190610702565b610297565b60005b6001600160801b031683602001516001600160801b0316146102fb5760405162461bcd60e51b815260206004820152601960248201527f486973746f72793a20756e636c61696d656420696e70757473000000000000006044820152606401610219565b8154600180820184556000848152602090819020865160029094020183815586820180516040808a0180516001600160801b03938416600160801b9185169190910217949096019390935582519586529051811692850192909252915116908201526001600160a01b038516907fb71880d7a0c514d48c0296b2721b0a4f9641a45117960f2ca86b5b7873c4ab2f9060600160405180910390a2505050505050565b6103a5610427565b6001600160a01b03811661040a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610219565b61041381610481565b50565b61041e610427565b6104138161039d565b6000546001600160a01b0316331461010a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610219565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038116811461041357600080fd5b60008083601f8401126104f857600080fd5b50813567ffffffffffffffff81111561051057600080fd5b60208301915083602082850101111561052857600080fd5b9250929050565b60008060006040848603121561054457600080fd5b833561054f816104d1565b9250602084013567ffffffffffffffff81111561056b57600080fd5b610577868287016104e6565b9497909650939450505050565b6000806020838503121561059757600080fd5b823567ffffffffffffffff8111156105ae57600080fd5b6105ba858286016104e6565b90969095509350505050565b6000602082840312156105d857600080fd5b81356105e3816104d1565b9392505050565b6000602082840312156105fc57600080fd5b5035919050565b634e487b7160e01b600052603260045260246000fd5b80356001600160801b038116811461063057600080fd5b919050565b600080828403608081121561064957600080fd5b8335610654816104d1565b92506060601f198201121561066857600080fd5b506040516060810181811067ffffffffffffffff8211171561069a57634e487b7160e01b600052604160045260246000fd5b8060405250602084013581526106b260408501610619565b60208201526106c360608501610619565b6040820152809150509250929050565b634e487b7160e01b600052601160045260246000fd5b818103818111156106fc576106fc6106d3565b92915050565b6001600160801b03818116838216019080821115610722576107226106d3565b509291505056fea26469706673582212201fc5dfb9d50cb3efefe40c7ced59b7b296f6d072ed8005ef3de36946cd77e28364736f6c63430008130033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100625760003560e01c8063715018a6146100675780638da5cb5b14610071578063d79a824014610091578063ddfdfbb0146100bf578063f2fde38b146100d2578063fc411683146100e5575b600080fd5b61006f6100f8565b005b6000546040516001600160a01b0390911681526020015b60405180910390f35b6100a461009f36600461052f565b61010c565b60408051938452602084019290925290820152606001610088565b61006f6100cd366004610584565b6101a5565b61006f6100e03660046105c6565b61039d565b61006f6100f33660046105c6565b610416565b610100610427565b61010a6000610481565b565b600080808061011d858701876105ea565b6001600160a01b0388166000908152600160205260408120805492935090918390811061014c5761014c610603565b60009182526020918290206040805160608101825260029390930290910180548084526001909101546001600160801b03808216958501869052600160801b90910416929091018290529a919950975095505050505050565b6101ad610427565b6000806101bc83850185610635565b9150915080604001516001600160801b031681602001516001600160801b031611156102225760405162461bcd60e51b815260206004820152601060248201526f486973746f72793a204649203e204c4960801b60448201526064015b60405180910390fd5b6001600160a01b038216600090815260016020526040902080548015610294578161024e6001836106e9565b8154811061025e5761025e610603565b906000526020600020906002020160010160109054906101000a90046001600160801b0316600161028f9190610702565b610297565b60005b6001600160801b031683602001516001600160801b0316146102fb5760405162461bcd60e51b815260206004820152601960248201527f486973746f72793a20756e636c61696d656420696e70757473000000000000006044820152606401610219565b8154600180820184556000848152602090819020865160029094020183815586820180516040808a0180516001600160801b03938416600160801b9185169190910217949096019390935582519586529051811692850192909252915116908201526001600160a01b038516907fb71880d7a0c514d48c0296b2721b0a4f9641a45117960f2ca86b5b7873c4ab2f9060600160405180910390a2505050505050565b6103a5610427565b6001600160a01b03811661040a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610219565b61041381610481565b50565b61041e610427565b6104138161039d565b6000546001600160a01b0316331461010a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610219565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038116811461041357600080fd5b60008083601f8401126104f857600080fd5b50813567ffffffffffffffff81111561051057600080fd5b60208301915083602082850101111561052857600080fd5b9250929050565b60008060006040848603121561054457600080fd5b833561054f816104d1565b9250602084013567ffffffffffffffff81111561056b57600080fd5b610577868287016104e6565b9497909650939450505050565b6000806020838503121561059757600080fd5b823567ffffffffffffffff8111156105ae57600080fd5b6105ba858286016104e6565b90969095509350505050565b6000602082840312156105d857600080fd5b81356105e3816104d1565b9392505050565b6000602082840312156105fc57600080fd5b5035919050565b634e487b7160e01b600052603260045260246000fd5b80356001600160801b038116811461063057600080fd5b919050565b600080828403608081121561064957600080fd5b8335610654816104d1565b92506060601f198201121561066857600080fd5b506040516060810181811067ffffffffffffffff8211171561069a57634e487b7160e01b600052604160045260246000fd5b8060405250602084013581526106b260408501610619565b60208201526106c360608501610619565b6040820152809150509250929050565b634e487b7160e01b600052601160045260246000fd5b818103818111156106fc576106fc6106d3565b92915050565b6001600160801b03818116838216019080821115610722576107226106d3565b509291505056fea26469706673582212201fc5dfb9d50cb3efefe40c7ced59b7b296f6d072ed8005ef3de36946cd77e28364736f6c63430008130033", - "devdoc": { - "details": "This contract inherits OpenZeppelin's `Ownable` contract. For more information on `Ownable`, please consult OpenZeppelin's official documentation.", - "events": { - "NewClaimToHistory(address,(bytes32,uint128,uint128))": { - "details": "MUST be triggered on a successful call to `submitClaim`.", - "params": { - "claim": "The newly-submitted claim", - "dapp": "The address of the DApp" - } - } - }, - "kind": "dev", - "methods": { - "constructor": { - "params": { - "_owner": "The initial owner" - } - }, - "getClaim(address,bytes)": { - "params": { - "_dapp": "The DApp address", - "_proofContext": "Data for retrieving the desired claim" - }, - "returns": { - "_0": "The claimed epoch hash", - "_1": "The index of the first input of the epoch in the input box", - "_2": "The index of the last input of the epoch in the input box" - } - }, - "migrateToConsensus(address)": { - "details": "Emits an `OwnershipTransferred` event. Should have access control.", - "params": { - "_consensus": "The new consensus" - } - }, - "owner()": { - "details": "Returns the address of the current owner." - }, - "renounceOwnership()": { - "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." - }, - "submitClaim(bytes)": { - "details": "Emits a `NewClaimToHistory` event. Should have access control.", - "params": { - "_claimData": "Data for submitting a claim" - } - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." - } - }, - "stateVariables": { - "claims": { - "details": "See the `getClaim` and `submitClaim` functions." - } - }, - "title": "Simple History", - "version": 1 - }, - "userdoc": { - "events": { - "NewClaimToHistory(address,(bytes32,uint128,uint128))": { - "notice": "A new claim regarding a specific DApp was submitted." - } - }, - "kind": "user", - "methods": { - "constructor": { - "notice": "Creates a `History` contract." - }, - "getClaim(address,bytes)": { - "notice": "Get a specific claim regarding a specific DApp. There are several requirements for this function to be called successfully. * `_proofContext` MUST be well-encoded. In Solidity, it can be constructed as `abi.encode(claimIndex)`, where `claimIndex` is the claim index (type `uint256`). * `claimIndex` MUST be inside the interval `[0, n)` where `n` is the number of claims that have been submitted to `_dapp` already." - }, - "migrateToConsensus(address)": { - "notice": "Transfer ownership to another consensus." - }, - "submitClaim(bytes)": { - "notice": "Submit a claim regarding a DApp. There are several requirements for this function to be called successfully. * `_claimData` MUST be well-encoded. In Solidity, it can be constructed as `abi.encode(dapp, claim)`, where `dapp` is the DApp address (type `address`) and `claim` is the claim structure (type `Claim`). * `firstIndex` MUST be less than or equal to `lastIndex`. As a result, every claim MUST encompass AT LEAST one input. * If this is the DApp's first claim, then `firstIndex` MUST be `0`. Otherwise, `firstIndex` MUST be the `lastClaim.lastIndex + 1`. In other words, claims MUST NOT skip inputs." - } - }, - "notice": "This contract stores claims for each DApp individually. This means that, for each DApp, the contract stores an array of `Claim` entries, where each `Claim` is composed of: * An epoch hash (`bytes32`) * A closed interval of input indices (`uint128`, `uint128`) The contract guarantees that the first interval starts at index 0, and that the following intervals don't have gaps or overlaps. Furthermore, claims can only be submitted by the contract owner through `submitClaim`, but can be retrieved by anyone with `getClaim`.", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 1155, - "contract": "contracts/history/History.sol:History", - "label": "_owner", - "offset": 0, - "slot": "0", - "type": "t_address" - }, - { - "astId": 3072, - "contract": "contracts/history/History.sol:History", - "label": "claims", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_address,t_array(t_struct(Claim)3065_storage)dyn_storage)" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_struct(Claim)3065_storage)dyn_storage": { - "base": "t_struct(Claim)3065_storage", - "encoding": "dynamic_array", - "label": "struct History.Claim[]", - "numberOfBytes": "32" - }, - "t_bytes32": { - "encoding": "inplace", - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_array(t_struct(Claim)3065_storage)dyn_storage)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => struct History.Claim[])", - "numberOfBytes": "32", - "value": "t_array(t_struct(Claim)3065_storage)dyn_storage" - }, - "t_struct(Claim)3065_storage": { - "encoding": "inplace", - "label": "struct History.Claim", - "members": [ - { - "astId": 3060, - "contract": "contracts/history/History.sol:History", - "label": "epochHash", - "offset": 0, - "slot": "0", - "type": "t_bytes32" - }, - { - "astId": 3062, - "contract": "contracts/history/History.sol:History", - "label": "firstIndex", - "offset": 0, - "slot": "1", - "type": "t_uint128" - }, - { - "astId": 3064, - "contract": "contracts/history/History.sol:History", - "label": "lastIndex", - "offset": 16, - "slot": "1", - "type": "t_uint128" - } - ], - "numberOfBytes": "64" - }, - "t_uint128": { - "encoding": "inplace", - "label": "uint128", - "numberOfBytes": "16" - } - } - } -} \ No newline at end of file diff --git a/onchain/rollups/deployments/iotex_testnet/Authority.json b/onchain/rollups/deployments/iotex_testnet/Authority.json deleted file mode 100644 index 94c60aa71..000000000 --- a/onchain/rollups/deployments/iotex_testnet/Authority.json +++ /dev/null @@ -1,452 +0,0 @@ -{ - "address": "0x951056281A282B3725e11D9fef72D7f7749c1408", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_owner", - "type": "address" - }, - { - "internalType": "contract IInputBox", - "name": "_inputBox", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "application", - "type": "address" - } - ], - "name": "ApplicationJoined", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": false, - "internalType": "contract IInputBox", - "name": "inputBox", - "type": "address" - } - ], - "name": "ConsensusCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "contract IHistory", - "name": "history", - "type": "address" - } - ], - "name": "NewHistory", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_dapp", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_proofContext", - "type": "bytes" - } - ], - "name": "getClaim", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getHistory", - "outputs": [ - { - "internalType": "contract IHistory", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "join", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_consensus", - "type": "address" - } - ], - "name": "migrateHistoryToConsensus", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IHistory", - "name": "_history", - "type": "address" - } - ], - "name": "setHistory", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "_claimData", - "type": "bytes" - } - ], - "name": "submitClaim", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IERC20", - "name": "_token", - "type": "address" - }, - { - "internalType": "address", - "name": "_recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "withdrawERC20Tokens", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0x1b9a2fd517443e9a06a540f6c81b88faf80c5e48e00b4598a3a3a25faa583320", - "receipt": { - "to": null, - "from": "0x18930e8a66a1DbE21D00581216789AAB7460Afd0", - "contractAddress": "0x951056281A282B3725e11D9fef72D7f7749c1408", - "transactionIndex": 0, - "gasUsed": "695771", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000008000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000004000000040000000000000000000000000000100000000000000000000010000000000000000002000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000", - "blockHash": "0x9a097cd0b82c6bd547d48ffc06af6cf1f5a48ba4c89323fce12069257bf08911", - "transactionHash": "0x1b9a2fd517443e9a06a540f6c81b88faf80c5e48e00b4598a3a3a25faa583320", - "logs": [ - { - "transactionIndex": 0, - "blockNumber": 20305520, - "transactionHash": "0x1b9a2fd517443e9a06a540f6c81b88faf80c5e48e00b4598a3a3a25faa583320", - "address": "0x951056281A282B3725e11D9fef72D7f7749c1408", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x00000000000000000000000018930e8a66a1dbe21d00581216789aab7460afd0" - ], - "data": "0x", - "logIndex": 0, - "blockHash": "0x9a097cd0b82c6bd547d48ffc06af6cf1f5a48ba4c89323fce12069257bf08911" - }, - { - "transactionIndex": 0, - "blockNumber": 20305520, - "transactionHash": "0x1b9a2fd517443e9a06a540f6c81b88faf80c5e48e00b4598a3a3a25faa583320", - "address": "0x951056281A282B3725e11D9fef72D7f7749c1408", - "topics": [ - "0x583f764398dc1f7529b3e4472cb331312f6b6d76744da14476f571a330d36e23" - ], - "data": "0x00000000000000000000000018930e8a66a1dbe21d00581216789aab7460afd0000000000000000000000000c97d900c8cbc72d7512c68a8a21cc98107e0581c", - "logIndex": 1, - "blockHash": "0x9a097cd0b82c6bd547d48ffc06af6cf1f5a48ba4c89323fce12069257bf08911" - } - ], - "blockNumber": 20305520, - "cumulativeGasUsed": "695771", - "status": 1, - "byzantium": true - }, - "args": [ - "0x18930e8a66a1DbE21D00581216789AAB7460Afd0", - "0xc97d900c8cBC72D7512C68a8a21cC98107E0581C" - ], - "numDeployments": 4, - "solcInputHash": "ccf852a6f03ad282136085842817ac99", - "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"contract IInputBox\",\"name\":\"_inputBox\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"application\",\"type\":\"address\"}],\"name\":\"ApplicationJoined\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"contract IInputBox\",\"name\":\"inputBox\",\"type\":\"address\"}],\"name\":\"ConsensusCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"contract IHistory\",\"name\":\"history\",\"type\":\"address\"}],\"name\":\"NewHistory\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dapp\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_proofContext\",\"type\":\"bytes\"}],\"name\":\"getClaim\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getHistory\",\"outputs\":[{\"internalType\":\"contract IHistory\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"join\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_consensus\",\"type\":\"address\"}],\"name\":\"migrateHistoryToConsensus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IHistory\",\"name\":\"_history\",\"type\":\"address\"}],\"name\":\"setHistory\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_claimData\",\"type\":\"bytes\"}],\"name\":\"submitClaim\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdrawERC20Tokens\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"This contract inherits `AbstractConsensus` and OpenZeppelin's `Ownable` contract. For more information on `Ownable`, please consult OpenZeppelin's official documentation.\",\"events\":{\"ApplicationJoined(address)\":{\"details\":\"MUST be triggered on a successful call to `join`.\",\"params\":{\"application\":\"The application\"}},\"ConsensusCreated(address,address)\":{\"details\":\"MUST be triggered during construction.\",\"params\":{\"inputBox\":\"The input box from which the authority fetches new inputs\",\"owner\":\"The address that initially owns the `Authority` contract\"}},\"NewHistory(address)\":{\"details\":\"MUST be triggered on a successful call to `setHistory`.\",\"params\":{\"history\":\"The new history contract\"}}},\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Emits a `ConsensusCreated` event.\",\"params\":{\"_inputBox\":\"The input box contract\",\"_owner\":\"The initial contract owner\"}},\"getClaim(address,bytes)\":{\"params\":{\"_dapp\":\"The DApp address\",\"_proofContext\":\"Data for retrieving the desired claim\"},\"returns\":{\"_0\":\"The claimed epoch hash\",\"_1\":\"The index of the first input of the epoch in the input box\",\"_2\":\"The index of the last input of the epoch in the input box\"}},\"getHistory()\":{\"returns\":{\"_0\":\"The current history contract\"}},\"migrateHistoryToConsensus(address)\":{\"details\":\"Can only be called by the `Authority` owner, and the `Authority` contract must have ownership over its current history contract.\",\"params\":{\"_consensus\":\"The new owner of the current history contract\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setHistory(address)\":{\"details\":\"Emits a `NewHistory` event. Can only be called by the `Authority` owner.\",\"params\":{\"_history\":\"The new history contract\"}},\"submitClaim(bytes)\":{\"details\":\"Can only be called by the `Authority` owner, and the `Authority` contract must have ownership over its current history contract.\",\"params\":{\"_claimData\":\"Data for submitting a claim\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"withdrawERC20Tokens(address,address,uint256)\":{\"details\":\"Can only be called by the `Authority` owner.\",\"params\":{\"_amount\":\"The amount of tokens to be withdrawn\",\"_recipient\":\"The recipient address\",\"_token\":\"The token contract\"}}},\"stateVariables\":{\"history\":{\"details\":\"See the `getHistory` and `setHistory` functions.\"}},\"title\":\"Authority consensus\",\"version\":1},\"userdoc\":{\"events\":{\"ApplicationJoined(address)\":{\"notice\":\"An application has joined the consensus' validation set.\"},\"ConsensusCreated(address,address)\":{\"notice\":\"The `Authority` contract was created.\"},\"NewHistory(address)\":{\"notice\":\"A new history contract is used to store claims.\"}},\"kind\":\"user\",\"methods\":{\"constructor\":{\"notice\":\"Constructs an `Authority` contract.\"},\"getClaim(address,bytes)\":{\"notice\":\"Get a claim from the current history. The encoding of `_proofContext` might vary depending on the implementation of the current history contract.\"},\"getHistory()\":{\"notice\":\"Get the current history contract.\"},\"join()\":{\"notice\":\"Emits an `ApplicationJoined` event with the message sender.\"},\"migrateHistoryToConsensus(address)\":{\"notice\":\"Transfer ownership over the current history contract to `_consensus`.\"},\"setHistory(address)\":{\"notice\":\"Make `Authority` point to another history contract.\"},\"submitClaim(bytes)\":{\"notice\":\"Submits a claim to the current history contract. The encoding of `_claimData` might vary depending on the implementation of the current history contract.\"},\"withdrawERC20Tokens(address,address,uint256)\":{\"notice\":\"Transfer some amount of ERC-20 tokens to a recipient.\"}},\"notice\":\"A consensus model controlled by a single address, the owner. Claims are stored in an auxiliary contract called `History`.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/consensus/authority/Authority.sol\":\"Authority\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"contracts/consensus/AbstractConsensus.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\nimport {IConsensus} from \\\"./IConsensus.sol\\\";\\n\\n/// @title Abstract Consensus\\n/// @notice An abstract contract that partially implements `IConsensus`.\\nabstract contract AbstractConsensus is IConsensus {\\n /// @notice Emits an `ApplicationJoined` event with the message sender.\\n function join() external override {\\n emit ApplicationJoined(msg.sender);\\n }\\n}\\n\",\"keccak256\":\"0x0483d8a8557c4e345eca5ad31ffea560737b08c75ade0430106136a89d755e13\",\"license\":\"Apache-2.0\"},\"contracts/consensus/IConsensus.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\n/// @title Consensus interface\\n///\\n/// @notice This contract defines a generic interface for consensuses.\\n/// We use the word \\\"consensus\\\" to designate a contract that provides claims\\n/// in the base layer regarding the state of off-chain machines running in\\n/// the execution layer. How this contract is able to reach consensus, who is\\n/// able to submit claims, and how are claims stored in the base layer are\\n/// some of the implementation details left unspecified by this interface.\\n///\\n/// From the point of view of a DApp, these claims are necessary to validate\\n/// on-chain action allowed by the off-chain machine in the form of vouchers\\n/// and notices. Each claim is composed of three parts: an epoch hash, a first\\n/// index, and a last index. We'll explain each of these parts below.\\n///\\n/// First, let us define the word \\\"epoch\\\". For finality reasons, we need to\\n/// divide the stream of inputs being fed into the off-chain machine into\\n/// batches of inputs, which we call \\\"epoches\\\". At the end of every epoch,\\n/// we summarize the state of the off-chain machine in a single hash, called\\n/// \\\"epoch hash\\\". Please note that this interface does not define how this\\n/// stream of inputs is being chopped up into epoches.\\n///\\n/// The other two parts are simply the indices of the first and last inputs\\n/// accepted during the epoch. Logically, the first index MUST BE less than\\n/// or equal to the last index. As a result, every epoch MUST accept at least\\n/// one input. This assumption stems from the fact that the state of a machine\\n/// can only change after an input is fed into it.\\n///\\n/// Examples of possible implementations of this interface include:\\n///\\n/// * An authority consensus, controlled by a single address who has full\\n/// control over epoch boundaries, claim submission, asset management, etc.\\n///\\n/// * A quorum consensus, controlled by a limited set of validators, that\\n/// vote on the state of the machine at the end of every epoch. Also, epoch\\n/// boundaries are determined by the timestamp in the base layer, and assets\\n/// are split equally amongst the validators.\\n///\\n/// * An NxN consensus, which allows anyone to submit and dispute claims\\n/// in the base layer. Epoch boundaries are determined in the same fashion\\n/// as in the quorum example.\\n///\\ninterface IConsensus {\\n /// @notice An application has joined the consensus' validation set.\\n /// @param application The application\\n /// @dev MUST be triggered on a successful call to `join`.\\n event ApplicationJoined(address application);\\n\\n /// @notice Get a specific claim regarding a specific DApp.\\n /// The encoding of `_proofContext` might vary\\n /// depending on the implementation.\\n /// @param _dapp The DApp address\\n /// @param _proofContext Data for retrieving the desired claim\\n /// @return epochHash_ The claimed epoch hash\\n /// @return firstInputIndex_ The index of the first input of the epoch in the input box\\n /// @return lastInputIndex_ The index of the last input of the epoch in the input box\\n function getClaim(\\n address _dapp,\\n bytes calldata _proofContext\\n )\\n external\\n view\\n returns (\\n bytes32 epochHash_,\\n uint256 firstInputIndex_,\\n uint256 lastInputIndex_\\n );\\n\\n /// @notice Signal the consensus that the message sender wants to join its validation set.\\n /// @dev MUST fire an `ApplicationJoined` event with the message sender as argument.\\n function join() external;\\n}\\n\",\"keccak256\":\"0x5d59c8dc3c1483e3173837d679093000077bf175c0b3ad7f02f0ffe611c0a89e\",\"license\":\"Apache-2.0\"},\"contracts/consensus/authority/Authority.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\nimport {Ownable} from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport {IERC20} from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport {IConsensus} from \\\"../IConsensus.sol\\\";\\nimport {AbstractConsensus} from \\\"../AbstractConsensus.sol\\\";\\nimport {IInputBox} from \\\"../../inputs/IInputBox.sol\\\";\\nimport {IHistory} from \\\"../../history/IHistory.sol\\\";\\n\\n/// @title Authority consensus\\n/// @notice A consensus model controlled by a single address, the owner.\\n/// Claims are stored in an auxiliary contract called `History`.\\n/// @dev This contract inherits `AbstractConsensus` and OpenZeppelin's `Ownable` contract.\\n/// For more information on `Ownable`, please consult OpenZeppelin's official documentation.\\ncontract Authority is AbstractConsensus, Ownable {\\n /// @notice The current history contract.\\n /// @dev See the `getHistory` and `setHistory` functions.\\n IHistory internal history;\\n\\n /// @notice The `Authority` contract was created.\\n /// @param owner The address that initially owns the `Authority` contract\\n /// @param inputBox The input box from which the authority fetches new inputs\\n /// @dev MUST be triggered during construction.\\n event ConsensusCreated(address owner, IInputBox inputBox);\\n\\n /// @notice A new history contract is used to store claims.\\n /// @param history The new history contract\\n /// @dev MUST be triggered on a successful call to `setHistory`.\\n event NewHistory(IHistory history);\\n\\n /// @notice Constructs an `Authority` contract.\\n /// @param _owner The initial contract owner\\n /// @param _inputBox The input box contract\\n /// @dev Emits a `ConsensusCreated` event.\\n constructor(address _owner, IInputBox _inputBox) {\\n // constructor in Ownable already called `transferOwnership(msg.sender)`, so\\n // we only need to call `transferOwnership(_owner)` if _owner != msg.sender\\n if (msg.sender != _owner) {\\n transferOwnership(_owner);\\n }\\n emit ConsensusCreated(_owner, _inputBox);\\n }\\n\\n /// @notice Submits a claim to the current history contract.\\n /// The encoding of `_claimData` might vary depending on the\\n /// implementation of the current history contract.\\n /// @param _claimData Data for submitting a claim\\n /// @dev Can only be called by the `Authority` owner,\\n /// and the `Authority` contract must have ownership over\\n /// its current history contract.\\n function submitClaim(bytes calldata _claimData) external onlyOwner {\\n history.submitClaim(_claimData);\\n }\\n\\n /// @notice Transfer ownership over the current history contract to `_consensus`.\\n /// @param _consensus The new owner of the current history contract\\n /// @dev Can only be called by the `Authority` owner,\\n /// and the `Authority` contract must have ownership over\\n /// its current history contract.\\n function migrateHistoryToConsensus(address _consensus) external onlyOwner {\\n history.migrateToConsensus(_consensus);\\n }\\n\\n /// @notice Make `Authority` point to another history contract.\\n /// @param _history The new history contract\\n /// @dev Emits a `NewHistory` event.\\n /// Can only be called by the `Authority` owner.\\n function setHistory(IHistory _history) external onlyOwner {\\n history = _history;\\n emit NewHistory(_history);\\n }\\n\\n /// @notice Get the current history contract.\\n /// @return The current history contract\\n function getHistory() external view returns (IHistory) {\\n return history;\\n }\\n\\n /// @notice Get a claim from the current history.\\n /// The encoding of `_proofContext` might vary depending on the\\n /// implementation of the current history contract.\\n /// @inheritdoc IConsensus\\n function getClaim(\\n address _dapp,\\n bytes calldata _proofContext\\n ) external view override returns (bytes32, uint256, uint256) {\\n return history.getClaim(_dapp, _proofContext);\\n }\\n\\n /// @notice Transfer some amount of ERC-20 tokens to a recipient.\\n /// @param _token The token contract\\n /// @param _recipient The recipient address\\n /// @param _amount The amount of tokens to be withdrawn\\n /// @dev Can only be called by the `Authority` owner.\\n function withdrawERC20Tokens(\\n IERC20 _token,\\n address _recipient,\\n uint256 _amount\\n ) external onlyOwner {\\n require(\\n _token.transfer(_recipient, _amount),\\n \\\"Authority: withdrawal failed\\\"\\n );\\n }\\n}\\n\",\"keccak256\":\"0x0a37f82a0c924deeb8fa5baa6ff0133054037170dadd0032b81f4c93c3ca1c91\",\"license\":\"Apache-2.0\"},\"contracts/history/IHistory.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\n/// @title History interface\\ninterface IHistory {\\n // Permissioned functions\\n\\n /// @notice Submit a claim.\\n /// The encoding of `_claimData` might vary\\n /// depending on the history implementation.\\n /// @param _claimData Data for submitting a claim\\n /// @dev Should have access control.\\n function submitClaim(bytes calldata _claimData) external;\\n\\n /// @notice Transfer ownership to another consensus.\\n /// @param _consensus The new consensus\\n /// @dev Should have access control.\\n function migrateToConsensus(address _consensus) external;\\n\\n // Permissionless functions\\n\\n /// @notice Get a specific claim regarding a specific DApp.\\n /// The encoding of `_proofContext` might vary\\n /// depending on the history implementation.\\n /// @param _dapp The DApp address\\n /// @param _proofContext Data for retrieving the desired claim\\n /// @return epochHash_ The claimed epoch hash\\n /// @return firstInputIndex_ The index of the first input of the epoch in the input box\\n /// @return lastInputIndex_ The index of the last input of the epoch in the input box\\n function getClaim(\\n address _dapp,\\n bytes calldata _proofContext\\n )\\n external\\n view\\n returns (\\n bytes32 epochHash_,\\n uint256 firstInputIndex_,\\n uint256 lastInputIndex_\\n );\\n}\\n\",\"keccak256\":\"0xfe0404f078a3a6f761beea8afbb2fac322fd2900f7ad2e2b866504c7aa54568f\",\"license\":\"Apache-2.0\"},\"contracts/inputs/IInputBox.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\n/// @title Input Box interface\\ninterface IInputBox {\\n /// @notice Emitted when an input is added to a DApp's input box.\\n /// @param dapp The address of the DApp\\n /// @param inboxInputIndex The index of the input in the input box\\n /// @param sender The address that sent the input\\n /// @param input The contents of the input\\n /// @dev MUST be triggered on a successful call to `addInput`.\\n event InputAdded(\\n address indexed dapp,\\n uint256 indexed inboxInputIndex,\\n address sender,\\n bytes input\\n );\\n\\n /// @notice Add an input to a DApp's input box.\\n /// @param _dapp The address of the DApp\\n /// @param _input The contents of the input\\n /// @return The hash of the input plus some extra metadata\\n /// @dev MUST fire an `InputAdded` event accordingly.\\n function addInput(\\n address _dapp,\\n bytes calldata _input\\n ) external returns (bytes32);\\n\\n /// @notice Get the number of inputs in a DApp's input box.\\n /// @param _dapp The address of the DApp\\n /// @return Number of inputs in the DApp's input box\\n function getNumberOfInputs(address _dapp) external view returns (uint256);\\n\\n /// @notice Get the hash of an input in a DApp's input box.\\n /// @param _dapp The address of the DApp\\n /// @param _index The index of the input in the DApp's input box\\n /// @return The hash of the input at the provided index in the DApp's input box\\n /// @dev `_index` MUST be in the interval `[0,n)` where `n` is the number of\\n /// inputs in the DApp's input box. See the `getNumberOfInputs` function.\\n function getInputHash(\\n address _dapp,\\n uint256 _index\\n ) external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x2addd467a24cde2131784103080aeb28df40d87ba19c5fd92bf96c0c074603df\",\"license\":\"Apache-2.0\"}},\"version\":1}", - "bytecode": "0x608060405234801561001057600080fd5b506040516109ef3803806109ef83398101604081905261002f916101da565b6100383361009b565b336001600160a01b0383161461005157610051826100eb565b604080516001600160a01b038085168252831660208201527f583f764398dc1f7529b3e4472cb331312f6b6d76744da14476f571a330d36e23910160405180910390a15050610214565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6100f3610169565b6001600160a01b03811661015d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b6101668161009b565b50565b6000546001600160a01b031633146101c35760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610154565b565b6001600160a01b038116811461016657600080fd5b600080604083850312156101ed57600080fd5b82516101f8816101c5565b6020840151909250610209816101c5565b809150509250929050565b6107cc806102236000396000f3fe608060405234801561001057600080fd5b506004361061009e5760003560e01c8063b688a36311610066578063b688a3631461010e578063bcdd1e1314610116578063d79a824014610129578063ddfdfbb014610157578063f2fde38b1461016a57600080fd5b8063159c5ea1146100a3578063715018a6146100b85780638da5cb5b146100c05780639368a3d3146100ea578063aa15efc8146100fd575b600080fd5b6100b66100b136600461058e565b61017d565b005b6100b66101d9565b6000546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b6100b66100f836600461058e565b6101ed565b6001546001600160a01b03166100cd565b6100b6610257565b6100b66101243660046105b2565b61028c565b61013c61013736600461063c565b61035d565b604080519384526020840192909252908201526060016100e1565b6100b6610165366004610691565b6103e6565b6100b661017836600461058e565b610456565b6101856104cf565b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f2bcd43869347a1d42f97ac6042f3d129817abd05a6125f9750fe3724e321d23e9060200160405180910390a150565b6101e16104cf565b6101eb6000610529565b565b6101f56104cf565b60015460405163fc41168360e01b81526001600160a01b0383811660048301529091169063fc41168390602401600060405180830381600087803b15801561023c57600080fd5b505af1158015610250573d6000803e3d6000fd5b5050505050565b6040513381527f27c2b702d3bff195a18baca2daf00b20a986177c5f1449af4e2d46a3c3e02ce59060200160405180910390a1565b6102946104cf565b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af11580156102e3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061030791906106d3565b6103585760405162461bcd60e51b815260206004820152601c60248201527f417574686f726974793a207769746864726177616c206661696c65640000000060448201526064015b60405180910390fd5b505050565b60015460405163035e6a0960e61b8152600091829182916001600160a01b03169063d79a8240906103969089908990899060040161071e565b606060405180830381865afa1580156103b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103d7919061074c565b92509250925093509350939050565b6103ee6104cf565b600154604051630ddfdfbb60e41b81526001600160a01b039091169063ddfdfbb090610420908590859060040161077a565b600060405180830381600087803b15801561043a57600080fd5b505af115801561044e573d6000803e3d6000fd5b505050505050565b61045e6104cf565b6001600160a01b0381166104c35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161034f565b6104cc81610529565b50565b6000546001600160a01b031633146101eb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161034f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146104cc57600080fd5b6000602082840312156105a057600080fd5b81356105ab81610579565b9392505050565b6000806000606084860312156105c757600080fd5b83356105d281610579565b925060208401356105e281610579565b929592945050506040919091013590565b60008083601f84011261060557600080fd5b50813567ffffffffffffffff81111561061d57600080fd5b60208301915083602082850101111561063557600080fd5b9250929050565b60008060006040848603121561065157600080fd5b833561065c81610579565b9250602084013567ffffffffffffffff81111561067857600080fd5b610684868287016105f3565b9497909650939450505050565b600080602083850312156106a457600080fd5b823567ffffffffffffffff8111156106bb57600080fd5b6106c7858286016105f3565b90969095509350505050565b6000602082840312156106e557600080fd5b815180151581146105ab57600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b038416815260406020820181905260009061074390830184866106f5565b95945050505050565b60008060006060848603121561076157600080fd5b8351925060208401519150604084015190509250925092565b60208152600061078e6020830184866106f5565b94935050505056fea264697066735822122021f66c26bc1cded7ab5457f04d0a74c5257b6aa88e7d69d7f9ad0713ba4679e664736f6c63430008130033", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061009e5760003560e01c8063b688a36311610066578063b688a3631461010e578063bcdd1e1314610116578063d79a824014610129578063ddfdfbb014610157578063f2fde38b1461016a57600080fd5b8063159c5ea1146100a3578063715018a6146100b85780638da5cb5b146100c05780639368a3d3146100ea578063aa15efc8146100fd575b600080fd5b6100b66100b136600461058e565b61017d565b005b6100b66101d9565b6000546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b6100b66100f836600461058e565b6101ed565b6001546001600160a01b03166100cd565b6100b6610257565b6100b66101243660046105b2565b61028c565b61013c61013736600461063c565b61035d565b604080519384526020840192909252908201526060016100e1565b6100b6610165366004610691565b6103e6565b6100b661017836600461058e565b610456565b6101856104cf565b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f2bcd43869347a1d42f97ac6042f3d129817abd05a6125f9750fe3724e321d23e9060200160405180910390a150565b6101e16104cf565b6101eb6000610529565b565b6101f56104cf565b60015460405163fc41168360e01b81526001600160a01b0383811660048301529091169063fc41168390602401600060405180830381600087803b15801561023c57600080fd5b505af1158015610250573d6000803e3d6000fd5b5050505050565b6040513381527f27c2b702d3bff195a18baca2daf00b20a986177c5f1449af4e2d46a3c3e02ce59060200160405180910390a1565b6102946104cf565b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af11580156102e3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061030791906106d3565b6103585760405162461bcd60e51b815260206004820152601c60248201527f417574686f726974793a207769746864726177616c206661696c65640000000060448201526064015b60405180910390fd5b505050565b60015460405163035e6a0960e61b8152600091829182916001600160a01b03169063d79a8240906103969089908990899060040161071e565b606060405180830381865afa1580156103b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103d7919061074c565b92509250925093509350939050565b6103ee6104cf565b600154604051630ddfdfbb60e41b81526001600160a01b039091169063ddfdfbb090610420908590859060040161077a565b600060405180830381600087803b15801561043a57600080fd5b505af115801561044e573d6000803e3d6000fd5b505050505050565b61045e6104cf565b6001600160a01b0381166104c35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161034f565b6104cc81610529565b50565b6000546001600160a01b031633146101eb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161034f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146104cc57600080fd5b6000602082840312156105a057600080fd5b81356105ab81610579565b9392505050565b6000806000606084860312156105c757600080fd5b83356105d281610579565b925060208401356105e281610579565b929592945050506040919091013590565b60008083601f84011261060557600080fd5b50813567ffffffffffffffff81111561061d57600080fd5b60208301915083602082850101111561063557600080fd5b9250929050565b60008060006040848603121561065157600080fd5b833561065c81610579565b9250602084013567ffffffffffffffff81111561067857600080fd5b610684868287016105f3565b9497909650939450505050565b600080602083850312156106a457600080fd5b823567ffffffffffffffff8111156106bb57600080fd5b6106c7858286016105f3565b90969095509350505050565b6000602082840312156106e557600080fd5b815180151581146105ab57600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b038416815260406020820181905260009061074390830184866106f5565b95945050505050565b60008060006060848603121561076157600080fd5b8351925060208401519150604084015190509250925092565b60208152600061078e6020830184866106f5565b94935050505056fea264697066735822122021f66c26bc1cded7ab5457f04d0a74c5257b6aa88e7d69d7f9ad0713ba4679e664736f6c63430008130033", - "devdoc": { - "details": "This contract inherits `AbstractConsensus` and OpenZeppelin's `Ownable` contract. For more information on `Ownable`, please consult OpenZeppelin's official documentation.", - "events": { - "ApplicationJoined(address)": { - "details": "MUST be triggered on a successful call to `join`.", - "params": { - "application": "The application" - } - }, - "ConsensusCreated(address,address)": { - "details": "MUST be triggered during construction.", - "params": { - "inputBox": "The input box from which the authority fetches new inputs", - "owner": "The address that initially owns the `Authority` contract" - } - }, - "NewHistory(address)": { - "details": "MUST be triggered on a successful call to `setHistory`.", - "params": { - "history": "The new history contract" - } - } - }, - "kind": "dev", - "methods": { - "constructor": { - "details": "Emits a `ConsensusCreated` event.", - "params": { - "_inputBox": "The input box contract", - "_owner": "The initial contract owner" - } - }, - "getClaim(address,bytes)": { - "params": { - "_dapp": "The DApp address", - "_proofContext": "Data for retrieving the desired claim" - }, - "returns": { - "_0": "The claimed epoch hash", - "_1": "The index of the first input of the epoch in the input box", - "_2": "The index of the last input of the epoch in the input box" - } - }, - "getHistory()": { - "returns": { - "_0": "The current history contract" - } - }, - "migrateHistoryToConsensus(address)": { - "details": "Can only be called by the `Authority` owner, and the `Authority` contract must have ownership over its current history contract.", - "params": { - "_consensus": "The new owner of the current history contract" - } - }, - "owner()": { - "details": "Returns the address of the current owner." - }, - "renounceOwnership()": { - "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." - }, - "setHistory(address)": { - "details": "Emits a `NewHistory` event. Can only be called by the `Authority` owner.", - "params": { - "_history": "The new history contract" - } - }, - "submitClaim(bytes)": { - "details": "Can only be called by the `Authority` owner, and the `Authority` contract must have ownership over its current history contract.", - "params": { - "_claimData": "Data for submitting a claim" - } - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." - }, - "withdrawERC20Tokens(address,address,uint256)": { - "details": "Can only be called by the `Authority` owner.", - "params": { - "_amount": "The amount of tokens to be withdrawn", - "_recipient": "The recipient address", - "_token": "The token contract" - } - } - }, - "stateVariables": { - "history": { - "details": "See the `getHistory` and `setHistory` functions." - } - }, - "title": "Authority consensus", - "version": 1 - }, - "userdoc": { - "events": { - "ApplicationJoined(address)": { - "notice": "An application has joined the consensus' validation set." - }, - "ConsensusCreated(address,address)": { - "notice": "The `Authority` contract was created." - }, - "NewHistory(address)": { - "notice": "A new history contract is used to store claims." - } - }, - "kind": "user", - "methods": { - "constructor": { - "notice": "Constructs an `Authority` contract." - }, - "getClaim(address,bytes)": { - "notice": "Get a claim from the current history. The encoding of `_proofContext` might vary depending on the implementation of the current history contract." - }, - "getHistory()": { - "notice": "Get the current history contract." - }, - "join()": { - "notice": "Emits an `ApplicationJoined` event with the message sender." - }, - "migrateHistoryToConsensus(address)": { - "notice": "Transfer ownership over the current history contract to `_consensus`." - }, - "setHistory(address)": { - "notice": "Make `Authority` point to another history contract." - }, - "submitClaim(bytes)": { - "notice": "Submits a claim to the current history contract. The encoding of `_claimData` might vary depending on the implementation of the current history contract." - }, - "withdrawERC20Tokens(address,address,uint256)": { - "notice": "Transfer some amount of ERC-20 tokens to a recipient." - } - }, - "notice": "A consensus model controlled by a single address, the owner. Claims are stored in an auxiliary contract called `History`.", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 1155, - "contract": "contracts/consensus/authority/Authority.sol:Authority", - "label": "_owner", - "offset": 0, - "slot": "0", - "type": "t_address" - }, - { - "astId": 2248, - "contract": "contracts/consensus/authority/Authority.sol:Authority", - "label": "history", - "offset": 0, - "slot": "1", - "type": "t_contract(IHistory)3266" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_contract(IHistory)3266": { - "encoding": "inplace", - "label": "contract IHistory", - "numberOfBytes": "20" - } - } - } -} \ No newline at end of file diff --git a/onchain/rollups/deployments/iotex_testnet/History.json b/onchain/rollups/deployments/iotex_testnet/History.json deleted file mode 100644 index 014229e15..000000000 --- a/onchain/rollups/deployments/iotex_testnet/History.json +++ /dev/null @@ -1,381 +0,0 @@ -{ - "address": "0x8f610cd3BA2404E1d918c406fa6CF7B187a643E6", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_owner", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "dapp", - "type": "address" - }, - { - "components": [ - { - "internalType": "bytes32", - "name": "epochHash", - "type": "bytes32" - }, - { - "internalType": "uint128", - "name": "firstIndex", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "lastIndex", - "type": "uint128" - } - ], - "indexed": false, - "internalType": "struct History.Claim", - "name": "claim", - "type": "tuple" - } - ], - "name": "NewClaimToHistory", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_dapp", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_proofContext", - "type": "bytes" - } - ], - "name": "getClaim", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_consensus", - "type": "address" - } - ], - "name": "migrateToConsensus", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "_claimData", - "type": "bytes" - } - ], - "name": "submitClaim", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0x150d25d4adabce856889a3ed972a69a6fc236cf248baa9808c8c8a102580d658", - "receipt": { - "to": null, - "from": "0x18930e8a66a1DbE21D00581216789AAB7460Afd0", - "contractAddress": "0x8f610cd3BA2404E1d918c406fa6CF7B187a643E6", - "transactionIndex": 0, - "gasUsed": "653319", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000400000000000000000000000000022000000000000000000000000000000000000000000000000000000000008000000000000000000000000008000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000004000000040000000000000000000000000000000000000000000000000010000000000000000002000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000", - "blockHash": "0xf6077451805bd431364074f22deff38a81cc2e4ffd0d34c11843b287709d03fe", - "transactionHash": "0x150d25d4adabce856889a3ed972a69a6fc236cf248baa9808c8c8a102580d658", - "logs": [ - { - "transactionIndex": 0, - "blockNumber": 20305523, - "transactionHash": "0x150d25d4adabce856889a3ed972a69a6fc236cf248baa9808c8c8a102580d658", - "address": "0x8f610cd3BA2404E1d918c406fa6CF7B187a643E6", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x00000000000000000000000018930e8a66a1dbe21d00581216789aab7460afd0" - ], - "data": "0x", - "logIndex": 0, - "blockHash": "0xf6077451805bd431364074f22deff38a81cc2e4ffd0d34c11843b287709d03fe" - }, - { - "transactionIndex": 0, - "blockNumber": 20305523, - "transactionHash": "0x150d25d4adabce856889a3ed972a69a6fc236cf248baa9808c8c8a102580d658", - "address": "0x8f610cd3BA2404E1d918c406fa6CF7B187a643E6", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x00000000000000000000000018930e8a66a1dbe21d00581216789aab7460afd0", - "0x000000000000000000000000951056281a282b3725e11d9fef72d7f7749c1408" - ], - "data": "0x", - "logIndex": 1, - "blockHash": "0xf6077451805bd431364074f22deff38a81cc2e4ffd0d34c11843b287709d03fe" - } - ], - "blockNumber": 20305523, - "cumulativeGasUsed": "653319", - "status": 1, - "byzantium": true - }, - "args": [ - "0x951056281A282B3725e11D9fef72D7f7749c1408" - ], - "numDeployments": 4, - "solcInputHash": "ccf852a6f03ad282136085842817ac99", - "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dapp\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"epochHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint128\",\"name\":\"firstIndex\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"lastIndex\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"struct History.Claim\",\"name\":\"claim\",\"type\":\"tuple\"}],\"name\":\"NewClaimToHistory\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dapp\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_proofContext\",\"type\":\"bytes\"}],\"name\":\"getClaim\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_consensus\",\"type\":\"address\"}],\"name\":\"migrateToConsensus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_claimData\",\"type\":\"bytes\"}],\"name\":\"submitClaim\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"This contract inherits OpenZeppelin's `Ownable` contract. For more information on `Ownable`, please consult OpenZeppelin's official documentation.\",\"events\":{\"NewClaimToHistory(address,(bytes32,uint128,uint128))\":{\"details\":\"MUST be triggered on a successful call to `submitClaim`.\",\"params\":{\"claim\":\"The newly-submitted claim\",\"dapp\":\"The address of the DApp\"}}},\"kind\":\"dev\",\"methods\":{\"constructor\":{\"params\":{\"_owner\":\"The initial owner\"}},\"getClaim(address,bytes)\":{\"params\":{\"_dapp\":\"The DApp address\",\"_proofContext\":\"Data for retrieving the desired claim\"},\"returns\":{\"_0\":\"The claimed epoch hash\",\"_1\":\"The index of the first input of the epoch in the input box\",\"_2\":\"The index of the last input of the epoch in the input box\"}},\"migrateToConsensus(address)\":{\"details\":\"Emits an `OwnershipTransferred` event. Should have access control.\",\"params\":{\"_consensus\":\"The new consensus\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"submitClaim(bytes)\":{\"details\":\"Emits a `NewClaimToHistory` event. Should have access control.\",\"params\":{\"_claimData\":\"Data for submitting a claim\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"stateVariables\":{\"claims\":{\"details\":\"See the `getClaim` and `submitClaim` functions.\"}},\"title\":\"Simple History\",\"version\":1},\"userdoc\":{\"events\":{\"NewClaimToHistory(address,(bytes32,uint128,uint128))\":{\"notice\":\"A new claim regarding a specific DApp was submitted.\"}},\"kind\":\"user\",\"methods\":{\"constructor\":{\"notice\":\"Creates a `History` contract.\"},\"getClaim(address,bytes)\":{\"notice\":\"Get a specific claim regarding a specific DApp. There are several requirements for this function to be called successfully. * `_proofContext` MUST be well-encoded. In Solidity, it can be constructed as `abi.encode(claimIndex)`, where `claimIndex` is the claim index (type `uint256`). * `claimIndex` MUST be inside the interval `[0, n)` where `n` is the number of claims that have been submitted to `_dapp` already.\"},\"migrateToConsensus(address)\":{\"notice\":\"Transfer ownership to another consensus.\"},\"submitClaim(bytes)\":{\"notice\":\"Submit a claim regarding a DApp. There are several requirements for this function to be called successfully. * `_claimData` MUST be well-encoded. In Solidity, it can be constructed as `abi.encode(dapp, claim)`, where `dapp` is the DApp address (type `address`) and `claim` is the claim structure (type `Claim`). * `firstIndex` MUST be less than or equal to `lastIndex`. As a result, every claim MUST encompass AT LEAST one input. * If this is the DApp's first claim, then `firstIndex` MUST be `0`. Otherwise, `firstIndex` MUST be the `lastClaim.lastIndex + 1`. In other words, claims MUST NOT skip inputs.\"}},\"notice\":\"This contract stores claims for each DApp individually. This means that, for each DApp, the contract stores an array of `Claim` entries, where each `Claim` is composed of: * An epoch hash (`bytes32`) * A closed interval of input indices (`uint128`, `uint128`) The contract guarantees that the first interval starts at index 0, and that the following intervals don't have gaps or overlaps. Furthermore, claims can only be submitted by the contract owner through `submitClaim`, but can be retrieved by anyone with `getClaim`.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/history/History.sol\":\"History\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"contracts/history/History.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\nimport {Ownable} from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\nimport {IHistory} from \\\"./IHistory.sol\\\";\\n\\n/// @title Simple History\\n///\\n/// @notice This contract stores claims for each DApp individually.\\n/// This means that, for each DApp, the contract stores an array of\\n/// `Claim` entries, where each `Claim` is composed of:\\n///\\n/// * An epoch hash (`bytes32`)\\n/// * A closed interval of input indices (`uint128`, `uint128`)\\n///\\n/// The contract guarantees that the first interval starts at index 0,\\n/// and that the following intervals don't have gaps or overlaps.\\n///\\n/// Furthermore, claims can only be submitted by the contract owner\\n/// through `submitClaim`, but can be retrieved by anyone with `getClaim`.\\n///\\n/// @dev This contract inherits OpenZeppelin's `Ownable` contract.\\n/// For more information on `Ownable`, please consult OpenZeppelin's official documentation.\\ncontract History is IHistory, Ownable {\\n struct Claim {\\n bytes32 epochHash;\\n uint128 firstIndex;\\n uint128 lastIndex;\\n }\\n\\n /// @notice Mapping from DApp address to array of claims.\\n /// @dev See the `getClaim` and `submitClaim` functions.\\n mapping(address => Claim[]) internal claims;\\n\\n /// @notice A new claim regarding a specific DApp was submitted.\\n /// @param dapp The address of the DApp\\n /// @param claim The newly-submitted claim\\n /// @dev MUST be triggered on a successful call to `submitClaim`.\\n event NewClaimToHistory(address indexed dapp, Claim claim);\\n\\n /// @notice Creates a `History` contract.\\n /// @param _owner The initial owner\\n constructor(address _owner) {\\n // constructor in Ownable already called `transferOwnership(msg.sender)`, so\\n // we only need to call `transferOwnership(_owner)` if _owner != msg.sender\\n if (_owner != msg.sender) {\\n transferOwnership(_owner);\\n }\\n }\\n\\n /// @notice Submit a claim regarding a DApp.\\n /// There are several requirements for this function to be called successfully.\\n ///\\n /// * `_claimData` MUST be well-encoded. In Solidity, it can be constructed\\n /// as `abi.encode(dapp, claim)`, where `dapp` is the DApp address (type `address`)\\n /// and `claim` is the claim structure (type `Claim`).\\n ///\\n /// * `firstIndex` MUST be less than or equal to `lastIndex`.\\n /// As a result, every claim MUST encompass AT LEAST one input.\\n ///\\n /// * If this is the DApp's first claim, then `firstIndex` MUST be `0`.\\n /// Otherwise, `firstIndex` MUST be the `lastClaim.lastIndex + 1`.\\n /// In other words, claims MUST NOT skip inputs.\\n ///\\n /// @inheritdoc IHistory\\n /// @dev Emits a `NewClaimToHistory` event. Should have access control.\\n function submitClaim(\\n bytes calldata _claimData\\n ) external override onlyOwner {\\n (address dapp, Claim memory claim) = abi.decode(\\n _claimData,\\n (address, Claim)\\n );\\n\\n require(claim.firstIndex <= claim.lastIndex, \\\"History: FI > LI\\\");\\n\\n Claim[] storage dappClaims = claims[dapp];\\n uint256 numDAppClaims = dappClaims.length;\\n\\n require(\\n claim.firstIndex ==\\n (\\n (numDAppClaims == 0)\\n ? 0\\n : (dappClaims[numDAppClaims - 1].lastIndex + 1)\\n ),\\n \\\"History: unclaimed inputs\\\"\\n );\\n\\n dappClaims.push(claim);\\n\\n emit NewClaimToHistory(dapp, claim);\\n }\\n\\n /// @notice Get a specific claim regarding a specific DApp.\\n /// There are several requirements for this function to be called successfully.\\n ///\\n /// * `_proofContext` MUST be well-encoded. In Solidity, it can be constructed\\n /// as `abi.encode(claimIndex)`, where `claimIndex` is the claim index (type `uint256`).\\n ///\\n /// * `claimIndex` MUST be inside the interval `[0, n)` where `n` is the number of claims\\n /// that have been submitted to `_dapp` already.\\n ///\\n /// @inheritdoc IHistory\\n function getClaim(\\n address _dapp,\\n bytes calldata _proofContext\\n ) external view override returns (bytes32, uint256, uint256) {\\n uint256 claimIndex = abi.decode(_proofContext, (uint256));\\n\\n Claim memory claim = claims[_dapp][claimIndex];\\n\\n return (claim.epochHash, claim.firstIndex, claim.lastIndex);\\n }\\n\\n /// @inheritdoc IHistory\\n /// @dev Emits an `OwnershipTransferred` event. Should have access control.\\n function migrateToConsensus(\\n address _consensus\\n ) external override onlyOwner {\\n transferOwnership(_consensus);\\n }\\n}\\n\",\"keccak256\":\"0x607253a9e73d3fe0b98e2c5d7b6f9ee1dad48d7cf4a1284b4f1361d74178da7a\",\"license\":\"Apache-2.0\"},\"contracts/history/IHistory.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\n/// @title History interface\\ninterface IHistory {\\n // Permissioned functions\\n\\n /// @notice Submit a claim.\\n /// The encoding of `_claimData` might vary\\n /// depending on the history implementation.\\n /// @param _claimData Data for submitting a claim\\n /// @dev Should have access control.\\n function submitClaim(bytes calldata _claimData) external;\\n\\n /// @notice Transfer ownership to another consensus.\\n /// @param _consensus The new consensus\\n /// @dev Should have access control.\\n function migrateToConsensus(address _consensus) external;\\n\\n // Permissionless functions\\n\\n /// @notice Get a specific claim regarding a specific DApp.\\n /// The encoding of `_proofContext` might vary\\n /// depending on the history implementation.\\n /// @param _dapp The DApp address\\n /// @param _proofContext Data for retrieving the desired claim\\n /// @return epochHash_ The claimed epoch hash\\n /// @return firstInputIndex_ The index of the first input of the epoch in the input box\\n /// @return lastInputIndex_ The index of the last input of the epoch in the input box\\n function getClaim(\\n address _dapp,\\n bytes calldata _proofContext\\n )\\n external\\n view\\n returns (\\n bytes32 epochHash_,\\n uint256 firstInputIndex_,\\n uint256 lastInputIndex_\\n );\\n}\\n\",\"keccak256\":\"0xfe0404f078a3a6f761beea8afbb2fac322fd2900f7ad2e2b866504c7aa54568f\",\"license\":\"Apache-2.0\"}},\"version\":1}", - "bytecode": "0x608060405234801561001057600080fd5b5060405161091f38038061091f83398101604081905261002f91610181565b61003833610057565b6001600160a01b038116331461005157610051816100a7565b506101b1565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6100af610125565b6001600160a01b0381166101195760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b61012281610057565b50565b6000546001600160a01b0316331461017f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610110565b565b60006020828403121561019357600080fd5b81516001600160a01b03811681146101aa57600080fd5b9392505050565b61075f806101c06000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c8063715018a6146100675780638da5cb5b14610071578063d79a824014610091578063ddfdfbb0146100bf578063f2fde38b146100d2578063fc411683146100e5575b600080fd5b61006f6100f8565b005b6000546040516001600160a01b0390911681526020015b60405180910390f35b6100a461009f36600461052f565b61010c565b60408051938452602084019290925290820152606001610088565b61006f6100cd366004610584565b6101a5565b61006f6100e03660046105c6565b61039d565b61006f6100f33660046105c6565b610416565b610100610427565b61010a6000610481565b565b600080808061011d858701876105ea565b6001600160a01b0388166000908152600160205260408120805492935090918390811061014c5761014c610603565b60009182526020918290206040805160608101825260029390930290910180548084526001909101546001600160801b03808216958501869052600160801b90910416929091018290529a919950975095505050505050565b6101ad610427565b6000806101bc83850185610635565b9150915080604001516001600160801b031681602001516001600160801b031611156102225760405162461bcd60e51b815260206004820152601060248201526f486973746f72793a204649203e204c4960801b60448201526064015b60405180910390fd5b6001600160a01b038216600090815260016020526040902080548015610294578161024e6001836106e9565b8154811061025e5761025e610603565b906000526020600020906002020160010160109054906101000a90046001600160801b0316600161028f9190610702565b610297565b60005b6001600160801b031683602001516001600160801b0316146102fb5760405162461bcd60e51b815260206004820152601960248201527f486973746f72793a20756e636c61696d656420696e70757473000000000000006044820152606401610219565b8154600180820184556000848152602090819020865160029094020183815586820180516040808a0180516001600160801b03938416600160801b9185169190910217949096019390935582519586529051811692850192909252915116908201526001600160a01b038516907fb71880d7a0c514d48c0296b2721b0a4f9641a45117960f2ca86b5b7873c4ab2f9060600160405180910390a2505050505050565b6103a5610427565b6001600160a01b03811661040a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610219565b61041381610481565b50565b61041e610427565b6104138161039d565b6000546001600160a01b0316331461010a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610219565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038116811461041357600080fd5b60008083601f8401126104f857600080fd5b50813567ffffffffffffffff81111561051057600080fd5b60208301915083602082850101111561052857600080fd5b9250929050565b60008060006040848603121561054457600080fd5b833561054f816104d1565b9250602084013567ffffffffffffffff81111561056b57600080fd5b610577868287016104e6565b9497909650939450505050565b6000806020838503121561059757600080fd5b823567ffffffffffffffff8111156105ae57600080fd5b6105ba858286016104e6565b90969095509350505050565b6000602082840312156105d857600080fd5b81356105e3816104d1565b9392505050565b6000602082840312156105fc57600080fd5b5035919050565b634e487b7160e01b600052603260045260246000fd5b80356001600160801b038116811461063057600080fd5b919050565b600080828403608081121561064957600080fd5b8335610654816104d1565b92506060601f198201121561066857600080fd5b506040516060810181811067ffffffffffffffff8211171561069a57634e487b7160e01b600052604160045260246000fd5b8060405250602084013581526106b260408501610619565b60208201526106c360608501610619565b6040820152809150509250929050565b634e487b7160e01b600052601160045260246000fd5b818103818111156106fc576106fc6106d3565b92915050565b6001600160801b03818116838216019080821115610722576107226106d3565b509291505056fea26469706673582212201fc5dfb9d50cb3efefe40c7ced59b7b296f6d072ed8005ef3de36946cd77e28364736f6c63430008130033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100625760003560e01c8063715018a6146100675780638da5cb5b14610071578063d79a824014610091578063ddfdfbb0146100bf578063f2fde38b146100d2578063fc411683146100e5575b600080fd5b61006f6100f8565b005b6000546040516001600160a01b0390911681526020015b60405180910390f35b6100a461009f36600461052f565b61010c565b60408051938452602084019290925290820152606001610088565b61006f6100cd366004610584565b6101a5565b61006f6100e03660046105c6565b61039d565b61006f6100f33660046105c6565b610416565b610100610427565b61010a6000610481565b565b600080808061011d858701876105ea565b6001600160a01b0388166000908152600160205260408120805492935090918390811061014c5761014c610603565b60009182526020918290206040805160608101825260029390930290910180548084526001909101546001600160801b03808216958501869052600160801b90910416929091018290529a919950975095505050505050565b6101ad610427565b6000806101bc83850185610635565b9150915080604001516001600160801b031681602001516001600160801b031611156102225760405162461bcd60e51b815260206004820152601060248201526f486973746f72793a204649203e204c4960801b60448201526064015b60405180910390fd5b6001600160a01b038216600090815260016020526040902080548015610294578161024e6001836106e9565b8154811061025e5761025e610603565b906000526020600020906002020160010160109054906101000a90046001600160801b0316600161028f9190610702565b610297565b60005b6001600160801b031683602001516001600160801b0316146102fb5760405162461bcd60e51b815260206004820152601960248201527f486973746f72793a20756e636c61696d656420696e70757473000000000000006044820152606401610219565b8154600180820184556000848152602090819020865160029094020183815586820180516040808a0180516001600160801b03938416600160801b9185169190910217949096019390935582519586529051811692850192909252915116908201526001600160a01b038516907fb71880d7a0c514d48c0296b2721b0a4f9641a45117960f2ca86b5b7873c4ab2f9060600160405180910390a2505050505050565b6103a5610427565b6001600160a01b03811661040a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610219565b61041381610481565b50565b61041e610427565b6104138161039d565b6000546001600160a01b0316331461010a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610219565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038116811461041357600080fd5b60008083601f8401126104f857600080fd5b50813567ffffffffffffffff81111561051057600080fd5b60208301915083602082850101111561052857600080fd5b9250929050565b60008060006040848603121561054457600080fd5b833561054f816104d1565b9250602084013567ffffffffffffffff81111561056b57600080fd5b610577868287016104e6565b9497909650939450505050565b6000806020838503121561059757600080fd5b823567ffffffffffffffff8111156105ae57600080fd5b6105ba858286016104e6565b90969095509350505050565b6000602082840312156105d857600080fd5b81356105e3816104d1565b9392505050565b6000602082840312156105fc57600080fd5b5035919050565b634e487b7160e01b600052603260045260246000fd5b80356001600160801b038116811461063057600080fd5b919050565b600080828403608081121561064957600080fd5b8335610654816104d1565b92506060601f198201121561066857600080fd5b506040516060810181811067ffffffffffffffff8211171561069a57634e487b7160e01b600052604160045260246000fd5b8060405250602084013581526106b260408501610619565b60208201526106c360608501610619565b6040820152809150509250929050565b634e487b7160e01b600052601160045260246000fd5b818103818111156106fc576106fc6106d3565b92915050565b6001600160801b03818116838216019080821115610722576107226106d3565b509291505056fea26469706673582212201fc5dfb9d50cb3efefe40c7ced59b7b296f6d072ed8005ef3de36946cd77e28364736f6c63430008130033", - "devdoc": { - "details": "This contract inherits OpenZeppelin's `Ownable` contract. For more information on `Ownable`, please consult OpenZeppelin's official documentation.", - "events": { - "NewClaimToHistory(address,(bytes32,uint128,uint128))": { - "details": "MUST be triggered on a successful call to `submitClaim`.", - "params": { - "claim": "The newly-submitted claim", - "dapp": "The address of the DApp" - } - } - }, - "kind": "dev", - "methods": { - "constructor": { - "params": { - "_owner": "The initial owner" - } - }, - "getClaim(address,bytes)": { - "params": { - "_dapp": "The DApp address", - "_proofContext": "Data for retrieving the desired claim" - }, - "returns": { - "_0": "The claimed epoch hash", - "_1": "The index of the first input of the epoch in the input box", - "_2": "The index of the last input of the epoch in the input box" - } - }, - "migrateToConsensus(address)": { - "details": "Emits an `OwnershipTransferred` event. Should have access control.", - "params": { - "_consensus": "The new consensus" - } - }, - "owner()": { - "details": "Returns the address of the current owner." - }, - "renounceOwnership()": { - "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." - }, - "submitClaim(bytes)": { - "details": "Emits a `NewClaimToHistory` event. Should have access control.", - "params": { - "_claimData": "Data for submitting a claim" - } - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." - } - }, - "stateVariables": { - "claims": { - "details": "See the `getClaim` and `submitClaim` functions." - } - }, - "title": "Simple History", - "version": 1 - }, - "userdoc": { - "events": { - "NewClaimToHistory(address,(bytes32,uint128,uint128))": { - "notice": "A new claim regarding a specific DApp was submitted." - } - }, - "kind": "user", - "methods": { - "constructor": { - "notice": "Creates a `History` contract." - }, - "getClaim(address,bytes)": { - "notice": "Get a specific claim regarding a specific DApp. There are several requirements for this function to be called successfully. * `_proofContext` MUST be well-encoded. In Solidity, it can be constructed as `abi.encode(claimIndex)`, where `claimIndex` is the claim index (type `uint256`). * `claimIndex` MUST be inside the interval `[0, n)` where `n` is the number of claims that have been submitted to `_dapp` already." - }, - "migrateToConsensus(address)": { - "notice": "Transfer ownership to another consensus." - }, - "submitClaim(bytes)": { - "notice": "Submit a claim regarding a DApp. There are several requirements for this function to be called successfully. * `_claimData` MUST be well-encoded. In Solidity, it can be constructed as `abi.encode(dapp, claim)`, where `dapp` is the DApp address (type `address`) and `claim` is the claim structure (type `Claim`). * `firstIndex` MUST be less than or equal to `lastIndex`. As a result, every claim MUST encompass AT LEAST one input. * If this is the DApp's first claim, then `firstIndex` MUST be `0`. Otherwise, `firstIndex` MUST be the `lastClaim.lastIndex + 1`. In other words, claims MUST NOT skip inputs." - } - }, - "notice": "This contract stores claims for each DApp individually. This means that, for each DApp, the contract stores an array of `Claim` entries, where each `Claim` is composed of: * An epoch hash (`bytes32`) * A closed interval of input indices (`uint128`, `uint128`) The contract guarantees that the first interval starts at index 0, and that the following intervals don't have gaps or overlaps. Furthermore, claims can only be submitted by the contract owner through `submitClaim`, but can be retrieved by anyone with `getClaim`.", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 1155, - "contract": "contracts/history/History.sol:History", - "label": "_owner", - "offset": 0, - "slot": "0", - "type": "t_address" - }, - { - "astId": 3072, - "contract": "contracts/history/History.sol:History", - "label": "claims", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_address,t_array(t_struct(Claim)3065_storage)dyn_storage)" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_struct(Claim)3065_storage)dyn_storage": { - "base": "t_struct(Claim)3065_storage", - "encoding": "dynamic_array", - "label": "struct History.Claim[]", - "numberOfBytes": "32" - }, - "t_bytes32": { - "encoding": "inplace", - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_array(t_struct(Claim)3065_storage)dyn_storage)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => struct History.Claim[])", - "numberOfBytes": "32", - "value": "t_array(t_struct(Claim)3065_storage)dyn_storage" - }, - "t_struct(Claim)3065_storage": { - "encoding": "inplace", - "label": "struct History.Claim", - "members": [ - { - "astId": 3060, - "contract": "contracts/history/History.sol:History", - "label": "epochHash", - "offset": 0, - "slot": "0", - "type": "t_bytes32" - }, - { - "astId": 3062, - "contract": "contracts/history/History.sol:History", - "label": "firstIndex", - "offset": 0, - "slot": "1", - "type": "t_uint128" - }, - { - "astId": 3064, - "contract": "contracts/history/History.sol:History", - "label": "lastIndex", - "offset": 16, - "slot": "1", - "type": "t_uint128" - } - ], - "numberOfBytes": "64" - }, - "t_uint128": { - "encoding": "inplace", - "label": "uint128", - "numberOfBytes": "16" - } - } - } -} \ No newline at end of file diff --git a/onchain/rollups/deployments/optimism_goerli/Authority.json b/onchain/rollups/deployments/optimism_goerli/Authority.json deleted file mode 100644 index 92b7cdef3..000000000 --- a/onchain/rollups/deployments/optimism_goerli/Authority.json +++ /dev/null @@ -1,466 +0,0 @@ -{ - "address": "0x35EC7d70cAff883844d94b54cD19634fFAb5d8CC", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_owner", - "type": "address" - }, - { - "internalType": "contract IInputBox", - "name": "_inputBox", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "application", - "type": "address" - } - ], - "name": "ApplicationJoined", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": false, - "internalType": "contract IInputBox", - "name": "inputBox", - "type": "address" - } - ], - "name": "ConsensusCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "contract IHistory", - "name": "history", - "type": "address" - } - ], - "name": "NewHistory", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_dapp", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_proofContext", - "type": "bytes" - } - ], - "name": "getClaim", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getHistory", - "outputs": [ - { - "internalType": "contract IHistory", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "join", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_consensus", - "type": "address" - } - ], - "name": "migrateHistoryToConsensus", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IHistory", - "name": "_history", - "type": "address" - } - ], - "name": "setHistory", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "_claimData", - "type": "bytes" - } - ], - "name": "submitClaim", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IERC20", - "name": "_token", - "type": "address" - }, - { - "internalType": "address", - "name": "_recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "withdrawERC20Tokens", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0x21617fed468de1ea3021ae004158440c3a66eab35d7654be5f1180063a236e9c", - "receipt": { - "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", - "from": "0x18930e8a66a1DbE21D00581216789AAB7460Afd0", - "contractAddress": null, - "transactionIndex": 1, - "gasUsed": "521630", - "logsBloom": "0x00000000000000000000000000000000000000000000000000800420000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000000000001000000000000000080000000001000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000020000000000000000000000000000000000080000001000000000000024000000000", - "blockHash": "0x99e138643de986c10f92a58e06b19cb79b8d3ba428ec24a0fe901e1020b1136c", - "transactionHash": "0x21617fed468de1ea3021ae004158440c3a66eab35d7654be5f1180063a236e9c", - "logs": [ - { - "transactionIndex": 1, - "blockNumber": 9458765, - "transactionHash": "0x21617fed468de1ea3021ae004158440c3a66eab35d7654be5f1180063a236e9c", - "address": "0x35EC7d70cAff883844d94b54cD19634fFAb5d8CC", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000004e59b44847b379578588920ca78fbf26c0b4956c" - ], - "data": "0x", - "logIndex": 0, - "blockHash": "0x99e138643de986c10f92a58e06b19cb79b8d3ba428ec24a0fe901e1020b1136c" - }, - { - "transactionIndex": 1, - "blockNumber": 9458765, - "transactionHash": "0x21617fed468de1ea3021ae004158440c3a66eab35d7654be5f1180063a236e9c", - "address": "0x35EC7d70cAff883844d94b54cD19634fFAb5d8CC", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000004e59b44847b379578588920ca78fbf26c0b4956c", - "0x00000000000000000000000018930e8a66a1dbe21d00581216789aab7460afd0" - ], - "data": "0x", - "logIndex": 1, - "blockHash": "0x99e138643de986c10f92a58e06b19cb79b8d3ba428ec24a0fe901e1020b1136c" - }, - { - "transactionIndex": 1, - "blockNumber": 9458765, - "transactionHash": "0x21617fed468de1ea3021ae004158440c3a66eab35d7654be5f1180063a236e9c", - "address": "0x35EC7d70cAff883844d94b54cD19634fFAb5d8CC", - "topics": [ - "0x583f764398dc1f7529b3e4472cb331312f6b6d76744da14476f571a330d36e23" - ], - "data": "0x00000000000000000000000018930e8a66a1dbe21d00581216789aab7460afd00000000000000000000000005a723220579c0dcb8c9253e6b4c62e572e379945", - "logIndex": 2, - "blockHash": "0x99e138643de986c10f92a58e06b19cb79b8d3ba428ec24a0fe901e1020b1136c" - } - ], - "blockNumber": 9458765, - "cumulativeGasUsed": "568543", - "status": 1, - "byzantium": true - }, - "args": [ - "0x18930e8a66a1DbE21D00581216789AAB7460Afd0", - "0x5a723220579C0DCb8C9253E6b4c62e572E379945" - ], - "numDeployments": 5, - "solcInputHash": "ccf852a6f03ad282136085842817ac99", - "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"contract IInputBox\",\"name\":\"_inputBox\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"application\",\"type\":\"address\"}],\"name\":\"ApplicationJoined\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"contract IInputBox\",\"name\":\"inputBox\",\"type\":\"address\"}],\"name\":\"ConsensusCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"contract IHistory\",\"name\":\"history\",\"type\":\"address\"}],\"name\":\"NewHistory\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dapp\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_proofContext\",\"type\":\"bytes\"}],\"name\":\"getClaim\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getHistory\",\"outputs\":[{\"internalType\":\"contract IHistory\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"join\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_consensus\",\"type\":\"address\"}],\"name\":\"migrateHistoryToConsensus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IHistory\",\"name\":\"_history\",\"type\":\"address\"}],\"name\":\"setHistory\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_claimData\",\"type\":\"bytes\"}],\"name\":\"submitClaim\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdrawERC20Tokens\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"This contract inherits `AbstractConsensus` and OpenZeppelin's `Ownable` contract. For more information on `Ownable`, please consult OpenZeppelin's official documentation.\",\"events\":{\"ApplicationJoined(address)\":{\"details\":\"MUST be triggered on a successful call to `join`.\",\"params\":{\"application\":\"The application\"}},\"ConsensusCreated(address,address)\":{\"details\":\"MUST be triggered during construction.\",\"params\":{\"inputBox\":\"The input box from which the authority fetches new inputs\",\"owner\":\"The address that initially owns the `Authority` contract\"}},\"NewHistory(address)\":{\"details\":\"MUST be triggered on a successful call to `setHistory`.\",\"params\":{\"history\":\"The new history contract\"}}},\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Emits a `ConsensusCreated` event.\",\"params\":{\"_inputBox\":\"The input box contract\",\"_owner\":\"The initial contract owner\"}},\"getClaim(address,bytes)\":{\"params\":{\"_dapp\":\"The DApp address\",\"_proofContext\":\"Data for retrieving the desired claim\"},\"returns\":{\"_0\":\"The claimed epoch hash\",\"_1\":\"The index of the first input of the epoch in the input box\",\"_2\":\"The index of the last input of the epoch in the input box\"}},\"getHistory()\":{\"returns\":{\"_0\":\"The current history contract\"}},\"migrateHistoryToConsensus(address)\":{\"details\":\"Can only be called by the `Authority` owner, and the `Authority` contract must have ownership over its current history contract.\",\"params\":{\"_consensus\":\"The new owner of the current history contract\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setHistory(address)\":{\"details\":\"Emits a `NewHistory` event. Can only be called by the `Authority` owner.\",\"params\":{\"_history\":\"The new history contract\"}},\"submitClaim(bytes)\":{\"details\":\"Can only be called by the `Authority` owner, and the `Authority` contract must have ownership over its current history contract.\",\"params\":{\"_claimData\":\"Data for submitting a claim\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"withdrawERC20Tokens(address,address,uint256)\":{\"details\":\"Can only be called by the `Authority` owner.\",\"params\":{\"_amount\":\"The amount of tokens to be withdrawn\",\"_recipient\":\"The recipient address\",\"_token\":\"The token contract\"}}},\"stateVariables\":{\"history\":{\"details\":\"See the `getHistory` and `setHistory` functions.\"}},\"title\":\"Authority consensus\",\"version\":1},\"userdoc\":{\"events\":{\"ApplicationJoined(address)\":{\"notice\":\"An application has joined the consensus' validation set.\"},\"ConsensusCreated(address,address)\":{\"notice\":\"The `Authority` contract was created.\"},\"NewHistory(address)\":{\"notice\":\"A new history contract is used to store claims.\"}},\"kind\":\"user\",\"methods\":{\"constructor\":{\"notice\":\"Constructs an `Authority` contract.\"},\"getClaim(address,bytes)\":{\"notice\":\"Get a claim from the current history. The encoding of `_proofContext` might vary depending on the implementation of the current history contract.\"},\"getHistory()\":{\"notice\":\"Get the current history contract.\"},\"join()\":{\"notice\":\"Emits an `ApplicationJoined` event with the message sender.\"},\"migrateHistoryToConsensus(address)\":{\"notice\":\"Transfer ownership over the current history contract to `_consensus`.\"},\"setHistory(address)\":{\"notice\":\"Make `Authority` point to another history contract.\"},\"submitClaim(bytes)\":{\"notice\":\"Submits a claim to the current history contract. The encoding of `_claimData` might vary depending on the implementation of the current history contract.\"},\"withdrawERC20Tokens(address,address,uint256)\":{\"notice\":\"Transfer some amount of ERC-20 tokens to a recipient.\"}},\"notice\":\"A consensus model controlled by a single address, the owner. Claims are stored in an auxiliary contract called `History`.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/consensus/authority/Authority.sol\":\"Authority\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"contracts/consensus/AbstractConsensus.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\nimport {IConsensus} from \\\"./IConsensus.sol\\\";\\n\\n/// @title Abstract Consensus\\n/// @notice An abstract contract that partially implements `IConsensus`.\\nabstract contract AbstractConsensus is IConsensus {\\n /// @notice Emits an `ApplicationJoined` event with the message sender.\\n function join() external override {\\n emit ApplicationJoined(msg.sender);\\n }\\n}\\n\",\"keccak256\":\"0x0483d8a8557c4e345eca5ad31ffea560737b08c75ade0430106136a89d755e13\",\"license\":\"Apache-2.0\"},\"contracts/consensus/IConsensus.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\n/// @title Consensus interface\\n///\\n/// @notice This contract defines a generic interface for consensuses.\\n/// We use the word \\\"consensus\\\" to designate a contract that provides claims\\n/// in the base layer regarding the state of off-chain machines running in\\n/// the execution layer. How this contract is able to reach consensus, who is\\n/// able to submit claims, and how are claims stored in the base layer are\\n/// some of the implementation details left unspecified by this interface.\\n///\\n/// From the point of view of a DApp, these claims are necessary to validate\\n/// on-chain action allowed by the off-chain machine in the form of vouchers\\n/// and notices. Each claim is composed of three parts: an epoch hash, a first\\n/// index, and a last index. We'll explain each of these parts below.\\n///\\n/// First, let us define the word \\\"epoch\\\". For finality reasons, we need to\\n/// divide the stream of inputs being fed into the off-chain machine into\\n/// batches of inputs, which we call \\\"epoches\\\". At the end of every epoch,\\n/// we summarize the state of the off-chain machine in a single hash, called\\n/// \\\"epoch hash\\\". Please note that this interface does not define how this\\n/// stream of inputs is being chopped up into epoches.\\n///\\n/// The other two parts are simply the indices of the first and last inputs\\n/// accepted during the epoch. Logically, the first index MUST BE less than\\n/// or equal to the last index. As a result, every epoch MUST accept at least\\n/// one input. This assumption stems from the fact that the state of a machine\\n/// can only change after an input is fed into it.\\n///\\n/// Examples of possible implementations of this interface include:\\n///\\n/// * An authority consensus, controlled by a single address who has full\\n/// control over epoch boundaries, claim submission, asset management, etc.\\n///\\n/// * A quorum consensus, controlled by a limited set of validators, that\\n/// vote on the state of the machine at the end of every epoch. Also, epoch\\n/// boundaries are determined by the timestamp in the base layer, and assets\\n/// are split equally amongst the validators.\\n///\\n/// * An NxN consensus, which allows anyone to submit and dispute claims\\n/// in the base layer. Epoch boundaries are determined in the same fashion\\n/// as in the quorum example.\\n///\\ninterface IConsensus {\\n /// @notice An application has joined the consensus' validation set.\\n /// @param application The application\\n /// @dev MUST be triggered on a successful call to `join`.\\n event ApplicationJoined(address application);\\n\\n /// @notice Get a specific claim regarding a specific DApp.\\n /// The encoding of `_proofContext` might vary\\n /// depending on the implementation.\\n /// @param _dapp The DApp address\\n /// @param _proofContext Data for retrieving the desired claim\\n /// @return epochHash_ The claimed epoch hash\\n /// @return firstInputIndex_ The index of the first input of the epoch in the input box\\n /// @return lastInputIndex_ The index of the last input of the epoch in the input box\\n function getClaim(\\n address _dapp,\\n bytes calldata _proofContext\\n )\\n external\\n view\\n returns (\\n bytes32 epochHash_,\\n uint256 firstInputIndex_,\\n uint256 lastInputIndex_\\n );\\n\\n /// @notice Signal the consensus that the message sender wants to join its validation set.\\n /// @dev MUST fire an `ApplicationJoined` event with the message sender as argument.\\n function join() external;\\n}\\n\",\"keccak256\":\"0x5d59c8dc3c1483e3173837d679093000077bf175c0b3ad7f02f0ffe611c0a89e\",\"license\":\"Apache-2.0\"},\"contracts/consensus/authority/Authority.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\nimport {Ownable} from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport {IERC20} from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport {IConsensus} from \\\"../IConsensus.sol\\\";\\nimport {AbstractConsensus} from \\\"../AbstractConsensus.sol\\\";\\nimport {IInputBox} from \\\"../../inputs/IInputBox.sol\\\";\\nimport {IHistory} from \\\"../../history/IHistory.sol\\\";\\n\\n/// @title Authority consensus\\n/// @notice A consensus model controlled by a single address, the owner.\\n/// Claims are stored in an auxiliary contract called `History`.\\n/// @dev This contract inherits `AbstractConsensus` and OpenZeppelin's `Ownable` contract.\\n/// For more information on `Ownable`, please consult OpenZeppelin's official documentation.\\ncontract Authority is AbstractConsensus, Ownable {\\n /// @notice The current history contract.\\n /// @dev See the `getHistory` and `setHistory` functions.\\n IHistory internal history;\\n\\n /// @notice The `Authority` contract was created.\\n /// @param owner The address that initially owns the `Authority` contract\\n /// @param inputBox The input box from which the authority fetches new inputs\\n /// @dev MUST be triggered during construction.\\n event ConsensusCreated(address owner, IInputBox inputBox);\\n\\n /// @notice A new history contract is used to store claims.\\n /// @param history The new history contract\\n /// @dev MUST be triggered on a successful call to `setHistory`.\\n event NewHistory(IHistory history);\\n\\n /// @notice Constructs an `Authority` contract.\\n /// @param _owner The initial contract owner\\n /// @param _inputBox The input box contract\\n /// @dev Emits a `ConsensusCreated` event.\\n constructor(address _owner, IInputBox _inputBox) {\\n // constructor in Ownable already called `transferOwnership(msg.sender)`, so\\n // we only need to call `transferOwnership(_owner)` if _owner != msg.sender\\n if (msg.sender != _owner) {\\n transferOwnership(_owner);\\n }\\n emit ConsensusCreated(_owner, _inputBox);\\n }\\n\\n /// @notice Submits a claim to the current history contract.\\n /// The encoding of `_claimData` might vary depending on the\\n /// implementation of the current history contract.\\n /// @param _claimData Data for submitting a claim\\n /// @dev Can only be called by the `Authority` owner,\\n /// and the `Authority` contract must have ownership over\\n /// its current history contract.\\n function submitClaim(bytes calldata _claimData) external onlyOwner {\\n history.submitClaim(_claimData);\\n }\\n\\n /// @notice Transfer ownership over the current history contract to `_consensus`.\\n /// @param _consensus The new owner of the current history contract\\n /// @dev Can only be called by the `Authority` owner,\\n /// and the `Authority` contract must have ownership over\\n /// its current history contract.\\n function migrateHistoryToConsensus(address _consensus) external onlyOwner {\\n history.migrateToConsensus(_consensus);\\n }\\n\\n /// @notice Make `Authority` point to another history contract.\\n /// @param _history The new history contract\\n /// @dev Emits a `NewHistory` event.\\n /// Can only be called by the `Authority` owner.\\n function setHistory(IHistory _history) external onlyOwner {\\n history = _history;\\n emit NewHistory(_history);\\n }\\n\\n /// @notice Get the current history contract.\\n /// @return The current history contract\\n function getHistory() external view returns (IHistory) {\\n return history;\\n }\\n\\n /// @notice Get a claim from the current history.\\n /// The encoding of `_proofContext` might vary depending on the\\n /// implementation of the current history contract.\\n /// @inheritdoc IConsensus\\n function getClaim(\\n address _dapp,\\n bytes calldata _proofContext\\n ) external view override returns (bytes32, uint256, uint256) {\\n return history.getClaim(_dapp, _proofContext);\\n }\\n\\n /// @notice Transfer some amount of ERC-20 tokens to a recipient.\\n /// @param _token The token contract\\n /// @param _recipient The recipient address\\n /// @param _amount The amount of tokens to be withdrawn\\n /// @dev Can only be called by the `Authority` owner.\\n function withdrawERC20Tokens(\\n IERC20 _token,\\n address _recipient,\\n uint256 _amount\\n ) external onlyOwner {\\n require(\\n _token.transfer(_recipient, _amount),\\n \\\"Authority: withdrawal failed\\\"\\n );\\n }\\n}\\n\",\"keccak256\":\"0x0a37f82a0c924deeb8fa5baa6ff0133054037170dadd0032b81f4c93c3ca1c91\",\"license\":\"Apache-2.0\"},\"contracts/history/IHistory.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\n/// @title History interface\\ninterface IHistory {\\n // Permissioned functions\\n\\n /// @notice Submit a claim.\\n /// The encoding of `_claimData` might vary\\n /// depending on the history implementation.\\n /// @param _claimData Data for submitting a claim\\n /// @dev Should have access control.\\n function submitClaim(bytes calldata _claimData) external;\\n\\n /// @notice Transfer ownership to another consensus.\\n /// @param _consensus The new consensus\\n /// @dev Should have access control.\\n function migrateToConsensus(address _consensus) external;\\n\\n // Permissionless functions\\n\\n /// @notice Get a specific claim regarding a specific DApp.\\n /// The encoding of `_proofContext` might vary\\n /// depending on the history implementation.\\n /// @param _dapp The DApp address\\n /// @param _proofContext Data for retrieving the desired claim\\n /// @return epochHash_ The claimed epoch hash\\n /// @return firstInputIndex_ The index of the first input of the epoch in the input box\\n /// @return lastInputIndex_ The index of the last input of the epoch in the input box\\n function getClaim(\\n address _dapp,\\n bytes calldata _proofContext\\n )\\n external\\n view\\n returns (\\n bytes32 epochHash_,\\n uint256 firstInputIndex_,\\n uint256 lastInputIndex_\\n );\\n}\\n\",\"keccak256\":\"0xfe0404f078a3a6f761beea8afbb2fac322fd2900f7ad2e2b866504c7aa54568f\",\"license\":\"Apache-2.0\"},\"contracts/inputs/IInputBox.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\n/// @title Input Box interface\\ninterface IInputBox {\\n /// @notice Emitted when an input is added to a DApp's input box.\\n /// @param dapp The address of the DApp\\n /// @param inboxInputIndex The index of the input in the input box\\n /// @param sender The address that sent the input\\n /// @param input The contents of the input\\n /// @dev MUST be triggered on a successful call to `addInput`.\\n event InputAdded(\\n address indexed dapp,\\n uint256 indexed inboxInputIndex,\\n address sender,\\n bytes input\\n );\\n\\n /// @notice Add an input to a DApp's input box.\\n /// @param _dapp The address of the DApp\\n /// @param _input The contents of the input\\n /// @return The hash of the input plus some extra metadata\\n /// @dev MUST fire an `InputAdded` event accordingly.\\n function addInput(\\n address _dapp,\\n bytes calldata _input\\n ) external returns (bytes32);\\n\\n /// @notice Get the number of inputs in a DApp's input box.\\n /// @param _dapp The address of the DApp\\n /// @return Number of inputs in the DApp's input box\\n function getNumberOfInputs(address _dapp) external view returns (uint256);\\n\\n /// @notice Get the hash of an input in a DApp's input box.\\n /// @param _dapp The address of the DApp\\n /// @param _index The index of the input in the DApp's input box\\n /// @return The hash of the input at the provided index in the DApp's input box\\n /// @dev `_index` MUST be in the interval `[0,n)` where `n` is the number of\\n /// inputs in the DApp's input box. See the `getNumberOfInputs` function.\\n function getInputHash(\\n address _dapp,\\n uint256 _index\\n ) external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x2addd467a24cde2131784103080aeb28df40d87ba19c5fd92bf96c0c074603df\",\"license\":\"Apache-2.0\"}},\"version\":1}", - "bytecode": "0x608060405234801561001057600080fd5b506040516109ef3803806109ef83398101604081905261002f916101da565b6100383361009b565b336001600160a01b0383161461005157610051826100eb565b604080516001600160a01b038085168252831660208201527f583f764398dc1f7529b3e4472cb331312f6b6d76744da14476f571a330d36e23910160405180910390a15050610214565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6100f3610169565b6001600160a01b03811661015d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b6101668161009b565b50565b6000546001600160a01b031633146101c35760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610154565b565b6001600160a01b038116811461016657600080fd5b600080604083850312156101ed57600080fd5b82516101f8816101c5565b6020840151909250610209816101c5565b809150509250929050565b6107cc806102236000396000f3fe608060405234801561001057600080fd5b506004361061009e5760003560e01c8063b688a36311610066578063b688a3631461010e578063bcdd1e1314610116578063d79a824014610129578063ddfdfbb014610157578063f2fde38b1461016a57600080fd5b8063159c5ea1146100a3578063715018a6146100b85780638da5cb5b146100c05780639368a3d3146100ea578063aa15efc8146100fd575b600080fd5b6100b66100b136600461058e565b61017d565b005b6100b66101d9565b6000546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b6100b66100f836600461058e565b6101ed565b6001546001600160a01b03166100cd565b6100b6610257565b6100b66101243660046105b2565b61028c565b61013c61013736600461063c565b61035d565b604080519384526020840192909252908201526060016100e1565b6100b6610165366004610691565b6103e6565b6100b661017836600461058e565b610456565b6101856104cf565b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f2bcd43869347a1d42f97ac6042f3d129817abd05a6125f9750fe3724e321d23e9060200160405180910390a150565b6101e16104cf565b6101eb6000610529565b565b6101f56104cf565b60015460405163fc41168360e01b81526001600160a01b0383811660048301529091169063fc41168390602401600060405180830381600087803b15801561023c57600080fd5b505af1158015610250573d6000803e3d6000fd5b5050505050565b6040513381527f27c2b702d3bff195a18baca2daf00b20a986177c5f1449af4e2d46a3c3e02ce59060200160405180910390a1565b6102946104cf565b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af11580156102e3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061030791906106d3565b6103585760405162461bcd60e51b815260206004820152601c60248201527f417574686f726974793a207769746864726177616c206661696c65640000000060448201526064015b60405180910390fd5b505050565b60015460405163035e6a0960e61b8152600091829182916001600160a01b03169063d79a8240906103969089908990899060040161071e565b606060405180830381865afa1580156103b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103d7919061074c565b92509250925093509350939050565b6103ee6104cf565b600154604051630ddfdfbb60e41b81526001600160a01b039091169063ddfdfbb090610420908590859060040161077a565b600060405180830381600087803b15801561043a57600080fd5b505af115801561044e573d6000803e3d6000fd5b505050505050565b61045e6104cf565b6001600160a01b0381166104c35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161034f565b6104cc81610529565b50565b6000546001600160a01b031633146101eb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161034f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146104cc57600080fd5b6000602082840312156105a057600080fd5b81356105ab81610579565b9392505050565b6000806000606084860312156105c757600080fd5b83356105d281610579565b925060208401356105e281610579565b929592945050506040919091013590565b60008083601f84011261060557600080fd5b50813567ffffffffffffffff81111561061d57600080fd5b60208301915083602082850101111561063557600080fd5b9250929050565b60008060006040848603121561065157600080fd5b833561065c81610579565b9250602084013567ffffffffffffffff81111561067857600080fd5b610684868287016105f3565b9497909650939450505050565b600080602083850312156106a457600080fd5b823567ffffffffffffffff8111156106bb57600080fd5b6106c7858286016105f3565b90969095509350505050565b6000602082840312156106e557600080fd5b815180151581146105ab57600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b038416815260406020820181905260009061074390830184866106f5565b95945050505050565b60008060006060848603121561076157600080fd5b8351925060208401519150604084015190509250925092565b60208152600061078e6020830184866106f5565b94935050505056fea264697066735822122021f66c26bc1cded7ab5457f04d0a74c5257b6aa88e7d69d7f9ad0713ba4679e664736f6c63430008130033", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061009e5760003560e01c8063b688a36311610066578063b688a3631461010e578063bcdd1e1314610116578063d79a824014610129578063ddfdfbb014610157578063f2fde38b1461016a57600080fd5b8063159c5ea1146100a3578063715018a6146100b85780638da5cb5b146100c05780639368a3d3146100ea578063aa15efc8146100fd575b600080fd5b6100b66100b136600461058e565b61017d565b005b6100b66101d9565b6000546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b6100b66100f836600461058e565b6101ed565b6001546001600160a01b03166100cd565b6100b6610257565b6100b66101243660046105b2565b61028c565b61013c61013736600461063c565b61035d565b604080519384526020840192909252908201526060016100e1565b6100b6610165366004610691565b6103e6565b6100b661017836600461058e565b610456565b6101856104cf565b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f2bcd43869347a1d42f97ac6042f3d129817abd05a6125f9750fe3724e321d23e9060200160405180910390a150565b6101e16104cf565b6101eb6000610529565b565b6101f56104cf565b60015460405163fc41168360e01b81526001600160a01b0383811660048301529091169063fc41168390602401600060405180830381600087803b15801561023c57600080fd5b505af1158015610250573d6000803e3d6000fd5b5050505050565b6040513381527f27c2b702d3bff195a18baca2daf00b20a986177c5f1449af4e2d46a3c3e02ce59060200160405180910390a1565b6102946104cf565b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af11580156102e3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061030791906106d3565b6103585760405162461bcd60e51b815260206004820152601c60248201527f417574686f726974793a207769746864726177616c206661696c65640000000060448201526064015b60405180910390fd5b505050565b60015460405163035e6a0960e61b8152600091829182916001600160a01b03169063d79a8240906103969089908990899060040161071e565b606060405180830381865afa1580156103b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103d7919061074c565b92509250925093509350939050565b6103ee6104cf565b600154604051630ddfdfbb60e41b81526001600160a01b039091169063ddfdfbb090610420908590859060040161077a565b600060405180830381600087803b15801561043a57600080fd5b505af115801561044e573d6000803e3d6000fd5b505050505050565b61045e6104cf565b6001600160a01b0381166104c35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161034f565b6104cc81610529565b50565b6000546001600160a01b031633146101eb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161034f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146104cc57600080fd5b6000602082840312156105a057600080fd5b81356105ab81610579565b9392505050565b6000806000606084860312156105c757600080fd5b83356105d281610579565b925060208401356105e281610579565b929592945050506040919091013590565b60008083601f84011261060557600080fd5b50813567ffffffffffffffff81111561061d57600080fd5b60208301915083602082850101111561063557600080fd5b9250929050565b60008060006040848603121561065157600080fd5b833561065c81610579565b9250602084013567ffffffffffffffff81111561067857600080fd5b610684868287016105f3565b9497909650939450505050565b600080602083850312156106a457600080fd5b823567ffffffffffffffff8111156106bb57600080fd5b6106c7858286016105f3565b90969095509350505050565b6000602082840312156106e557600080fd5b815180151581146105ab57600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b038416815260406020820181905260009061074390830184866106f5565b95945050505050565b60008060006060848603121561076157600080fd5b8351925060208401519150604084015190509250925092565b60208152600061078e6020830184866106f5565b94935050505056fea264697066735822122021f66c26bc1cded7ab5457f04d0a74c5257b6aa88e7d69d7f9ad0713ba4679e664736f6c63430008130033", - "devdoc": { - "details": "This contract inherits `AbstractConsensus` and OpenZeppelin's `Ownable` contract. For more information on `Ownable`, please consult OpenZeppelin's official documentation.", - "events": { - "ApplicationJoined(address)": { - "details": "MUST be triggered on a successful call to `join`.", - "params": { - "application": "The application" - } - }, - "ConsensusCreated(address,address)": { - "details": "MUST be triggered during construction.", - "params": { - "inputBox": "The input box from which the authority fetches new inputs", - "owner": "The address that initially owns the `Authority` contract" - } - }, - "NewHistory(address)": { - "details": "MUST be triggered on a successful call to `setHistory`.", - "params": { - "history": "The new history contract" - } - } - }, - "kind": "dev", - "methods": { - "constructor": { - "details": "Emits a `ConsensusCreated` event.", - "params": { - "_inputBox": "The input box contract", - "_owner": "The initial contract owner" - } - }, - "getClaim(address,bytes)": { - "params": { - "_dapp": "The DApp address", - "_proofContext": "Data for retrieving the desired claim" - }, - "returns": { - "_0": "The claimed epoch hash", - "_1": "The index of the first input of the epoch in the input box", - "_2": "The index of the last input of the epoch in the input box" - } - }, - "getHistory()": { - "returns": { - "_0": "The current history contract" - } - }, - "migrateHistoryToConsensus(address)": { - "details": "Can only be called by the `Authority` owner, and the `Authority` contract must have ownership over its current history contract.", - "params": { - "_consensus": "The new owner of the current history contract" - } - }, - "owner()": { - "details": "Returns the address of the current owner." - }, - "renounceOwnership()": { - "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." - }, - "setHistory(address)": { - "details": "Emits a `NewHistory` event. Can only be called by the `Authority` owner.", - "params": { - "_history": "The new history contract" - } - }, - "submitClaim(bytes)": { - "details": "Can only be called by the `Authority` owner, and the `Authority` contract must have ownership over its current history contract.", - "params": { - "_claimData": "Data for submitting a claim" - } - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." - }, - "withdrawERC20Tokens(address,address,uint256)": { - "details": "Can only be called by the `Authority` owner.", - "params": { - "_amount": "The amount of tokens to be withdrawn", - "_recipient": "The recipient address", - "_token": "The token contract" - } - } - }, - "stateVariables": { - "history": { - "details": "See the `getHistory` and `setHistory` functions." - } - }, - "title": "Authority consensus", - "version": 1 - }, - "userdoc": { - "events": { - "ApplicationJoined(address)": { - "notice": "An application has joined the consensus' validation set." - }, - "ConsensusCreated(address,address)": { - "notice": "The `Authority` contract was created." - }, - "NewHistory(address)": { - "notice": "A new history contract is used to store claims." - } - }, - "kind": "user", - "methods": { - "constructor": { - "notice": "Constructs an `Authority` contract." - }, - "getClaim(address,bytes)": { - "notice": "Get a claim from the current history. The encoding of `_proofContext` might vary depending on the implementation of the current history contract." - }, - "getHistory()": { - "notice": "Get the current history contract." - }, - "join()": { - "notice": "Emits an `ApplicationJoined` event with the message sender." - }, - "migrateHistoryToConsensus(address)": { - "notice": "Transfer ownership over the current history contract to `_consensus`." - }, - "setHistory(address)": { - "notice": "Make `Authority` point to another history contract." - }, - "submitClaim(bytes)": { - "notice": "Submits a claim to the current history contract. The encoding of `_claimData` might vary depending on the implementation of the current history contract." - }, - "withdrawERC20Tokens(address,address,uint256)": { - "notice": "Transfer some amount of ERC-20 tokens to a recipient." - } - }, - "notice": "A consensus model controlled by a single address, the owner. Claims are stored in an auxiliary contract called `History`.", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 1155, - "contract": "contracts/consensus/authority/Authority.sol:Authority", - "label": "_owner", - "offset": 0, - "slot": "0", - "type": "t_address" - }, - { - "astId": 2248, - "contract": "contracts/consensus/authority/Authority.sol:Authority", - "label": "history", - "offset": 0, - "slot": "1", - "type": "t_contract(IHistory)3266" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_contract(IHistory)3266": { - "encoding": "inplace", - "label": "contract IHistory", - "numberOfBytes": "20" - } - } - } -} \ No newline at end of file diff --git a/onchain/rollups/deployments/optimism_goerli/History.json b/onchain/rollups/deployments/optimism_goerli/History.json deleted file mode 100644 index 990862dab..000000000 --- a/onchain/rollups/deployments/optimism_goerli/History.json +++ /dev/null @@ -1,381 +0,0 @@ -{ - "address": "0xFB34DaDd5f3Aba55004C448AcFd24fAF5A4Ff83E", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_owner", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "dapp", - "type": "address" - }, - { - "components": [ - { - "internalType": "bytes32", - "name": "epochHash", - "type": "bytes32" - }, - { - "internalType": "uint128", - "name": "firstIndex", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "lastIndex", - "type": "uint128" - } - ], - "indexed": false, - "internalType": "struct History.Claim", - "name": "claim", - "type": "tuple" - } - ], - "name": "NewClaimToHistory", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_dapp", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_proofContext", - "type": "bytes" - } - ], - "name": "getClaim", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_consensus", - "type": "address" - } - ], - "name": "migrateToConsensus", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "_claimData", - "type": "bytes" - } - ], - "name": "submitClaim", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0xa5347566d3b3e566714b8e2d03c405cfd0b4a28015c28b8521ab3c428cc68a32", - "receipt": { - "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", - "from": "0x18930e8a66a1DbE21D00581216789AAB7460Afd0", - "contractAddress": null, - "transactionIndex": 2, - "gasUsed": "494574", - "logsBloom": "0x00000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000100000000000002000000000000000000000000100000000000001000000000000010000000000000000000000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000000000001000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000020000000000000000000000000800000000080000000000000000000000000000000", - "blockHash": "0xfdcbd2a208ba3f517d99e65ba7750a7c1d3b4e5e4d5eabad240b942d9f2c94cc", - "transactionHash": "0xa5347566d3b3e566714b8e2d03c405cfd0b4a28015c28b8521ab3c428cc68a32", - "logs": [ - { - "transactionIndex": 2, - "blockNumber": 9458769, - "transactionHash": "0xa5347566d3b3e566714b8e2d03c405cfd0b4a28015c28b8521ab3c428cc68a32", - "address": "0xFB34DaDd5f3Aba55004C448AcFd24fAF5A4Ff83E", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000004e59b44847b379578588920ca78fbf26c0b4956c" - ], - "data": "0x", - "logIndex": 3, - "blockHash": "0xfdcbd2a208ba3f517d99e65ba7750a7c1d3b4e5e4d5eabad240b942d9f2c94cc" - }, - { - "transactionIndex": 2, - "blockNumber": 9458769, - "transactionHash": "0xa5347566d3b3e566714b8e2d03c405cfd0b4a28015c28b8521ab3c428cc68a32", - "address": "0xFB34DaDd5f3Aba55004C448AcFd24fAF5A4Ff83E", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000004e59b44847b379578588920ca78fbf26c0b4956c", - "0x00000000000000000000000035ec7d70caff883844d94b54cd19634ffab5d8cc" - ], - "data": "0x", - "logIndex": 4, - "blockHash": "0xfdcbd2a208ba3f517d99e65ba7750a7c1d3b4e5e4d5eabad240b942d9f2c94cc" - } - ], - "blockNumber": 9458769, - "cumulativeGasUsed": "674253", - "status": 1, - "byzantium": true - }, - "args": [ - "0x35EC7d70cAff883844d94b54cD19634fFAb5d8CC" - ], - "numDeployments": 5, - "solcInputHash": "ccf852a6f03ad282136085842817ac99", - "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dapp\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"epochHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint128\",\"name\":\"firstIndex\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"lastIndex\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"struct History.Claim\",\"name\":\"claim\",\"type\":\"tuple\"}],\"name\":\"NewClaimToHistory\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dapp\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_proofContext\",\"type\":\"bytes\"}],\"name\":\"getClaim\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_consensus\",\"type\":\"address\"}],\"name\":\"migrateToConsensus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_claimData\",\"type\":\"bytes\"}],\"name\":\"submitClaim\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"This contract inherits OpenZeppelin's `Ownable` contract. For more information on `Ownable`, please consult OpenZeppelin's official documentation.\",\"events\":{\"NewClaimToHistory(address,(bytes32,uint128,uint128))\":{\"details\":\"MUST be triggered on a successful call to `submitClaim`.\",\"params\":{\"claim\":\"The newly-submitted claim\",\"dapp\":\"The address of the DApp\"}}},\"kind\":\"dev\",\"methods\":{\"constructor\":{\"params\":{\"_owner\":\"The initial owner\"}},\"getClaim(address,bytes)\":{\"params\":{\"_dapp\":\"The DApp address\",\"_proofContext\":\"Data for retrieving the desired claim\"},\"returns\":{\"_0\":\"The claimed epoch hash\",\"_1\":\"The index of the first input of the epoch in the input box\",\"_2\":\"The index of the last input of the epoch in the input box\"}},\"migrateToConsensus(address)\":{\"details\":\"Emits an `OwnershipTransferred` event. Should have access control.\",\"params\":{\"_consensus\":\"The new consensus\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"submitClaim(bytes)\":{\"details\":\"Emits a `NewClaimToHistory` event. Should have access control.\",\"params\":{\"_claimData\":\"Data for submitting a claim\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"stateVariables\":{\"claims\":{\"details\":\"See the `getClaim` and `submitClaim` functions.\"}},\"title\":\"Simple History\",\"version\":1},\"userdoc\":{\"events\":{\"NewClaimToHistory(address,(bytes32,uint128,uint128))\":{\"notice\":\"A new claim regarding a specific DApp was submitted.\"}},\"kind\":\"user\",\"methods\":{\"constructor\":{\"notice\":\"Creates a `History` contract.\"},\"getClaim(address,bytes)\":{\"notice\":\"Get a specific claim regarding a specific DApp. There are several requirements for this function to be called successfully. * `_proofContext` MUST be well-encoded. In Solidity, it can be constructed as `abi.encode(claimIndex)`, where `claimIndex` is the claim index (type `uint256`). * `claimIndex` MUST be inside the interval `[0, n)` where `n` is the number of claims that have been submitted to `_dapp` already.\"},\"migrateToConsensus(address)\":{\"notice\":\"Transfer ownership to another consensus.\"},\"submitClaim(bytes)\":{\"notice\":\"Submit a claim regarding a DApp. There are several requirements for this function to be called successfully. * `_claimData` MUST be well-encoded. In Solidity, it can be constructed as `abi.encode(dapp, claim)`, where `dapp` is the DApp address (type `address`) and `claim` is the claim structure (type `Claim`). * `firstIndex` MUST be less than or equal to `lastIndex`. As a result, every claim MUST encompass AT LEAST one input. * If this is the DApp's first claim, then `firstIndex` MUST be `0`. Otherwise, `firstIndex` MUST be the `lastClaim.lastIndex + 1`. In other words, claims MUST NOT skip inputs.\"}},\"notice\":\"This contract stores claims for each DApp individually. This means that, for each DApp, the contract stores an array of `Claim` entries, where each `Claim` is composed of: * An epoch hash (`bytes32`) * A closed interval of input indices (`uint128`, `uint128`) The contract guarantees that the first interval starts at index 0, and that the following intervals don't have gaps or overlaps. Furthermore, claims can only be submitted by the contract owner through `submitClaim`, but can be retrieved by anyone with `getClaim`.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/history/History.sol\":\"History\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"contracts/history/History.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\nimport {Ownable} from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\nimport {IHistory} from \\\"./IHistory.sol\\\";\\n\\n/// @title Simple History\\n///\\n/// @notice This contract stores claims for each DApp individually.\\n/// This means that, for each DApp, the contract stores an array of\\n/// `Claim` entries, where each `Claim` is composed of:\\n///\\n/// * An epoch hash (`bytes32`)\\n/// * A closed interval of input indices (`uint128`, `uint128`)\\n///\\n/// The contract guarantees that the first interval starts at index 0,\\n/// and that the following intervals don't have gaps or overlaps.\\n///\\n/// Furthermore, claims can only be submitted by the contract owner\\n/// through `submitClaim`, but can be retrieved by anyone with `getClaim`.\\n///\\n/// @dev This contract inherits OpenZeppelin's `Ownable` contract.\\n/// For more information on `Ownable`, please consult OpenZeppelin's official documentation.\\ncontract History is IHistory, Ownable {\\n struct Claim {\\n bytes32 epochHash;\\n uint128 firstIndex;\\n uint128 lastIndex;\\n }\\n\\n /// @notice Mapping from DApp address to array of claims.\\n /// @dev See the `getClaim` and `submitClaim` functions.\\n mapping(address => Claim[]) internal claims;\\n\\n /// @notice A new claim regarding a specific DApp was submitted.\\n /// @param dapp The address of the DApp\\n /// @param claim The newly-submitted claim\\n /// @dev MUST be triggered on a successful call to `submitClaim`.\\n event NewClaimToHistory(address indexed dapp, Claim claim);\\n\\n /// @notice Creates a `History` contract.\\n /// @param _owner The initial owner\\n constructor(address _owner) {\\n // constructor in Ownable already called `transferOwnership(msg.sender)`, so\\n // we only need to call `transferOwnership(_owner)` if _owner != msg.sender\\n if (_owner != msg.sender) {\\n transferOwnership(_owner);\\n }\\n }\\n\\n /// @notice Submit a claim regarding a DApp.\\n /// There are several requirements for this function to be called successfully.\\n ///\\n /// * `_claimData` MUST be well-encoded. In Solidity, it can be constructed\\n /// as `abi.encode(dapp, claim)`, where `dapp` is the DApp address (type `address`)\\n /// and `claim` is the claim structure (type `Claim`).\\n ///\\n /// * `firstIndex` MUST be less than or equal to `lastIndex`.\\n /// As a result, every claim MUST encompass AT LEAST one input.\\n ///\\n /// * If this is the DApp's first claim, then `firstIndex` MUST be `0`.\\n /// Otherwise, `firstIndex` MUST be the `lastClaim.lastIndex + 1`.\\n /// In other words, claims MUST NOT skip inputs.\\n ///\\n /// @inheritdoc IHistory\\n /// @dev Emits a `NewClaimToHistory` event. Should have access control.\\n function submitClaim(\\n bytes calldata _claimData\\n ) external override onlyOwner {\\n (address dapp, Claim memory claim) = abi.decode(\\n _claimData,\\n (address, Claim)\\n );\\n\\n require(claim.firstIndex <= claim.lastIndex, \\\"History: FI > LI\\\");\\n\\n Claim[] storage dappClaims = claims[dapp];\\n uint256 numDAppClaims = dappClaims.length;\\n\\n require(\\n claim.firstIndex ==\\n (\\n (numDAppClaims == 0)\\n ? 0\\n : (dappClaims[numDAppClaims - 1].lastIndex + 1)\\n ),\\n \\\"History: unclaimed inputs\\\"\\n );\\n\\n dappClaims.push(claim);\\n\\n emit NewClaimToHistory(dapp, claim);\\n }\\n\\n /// @notice Get a specific claim regarding a specific DApp.\\n /// There are several requirements for this function to be called successfully.\\n ///\\n /// * `_proofContext` MUST be well-encoded. In Solidity, it can be constructed\\n /// as `abi.encode(claimIndex)`, where `claimIndex` is the claim index (type `uint256`).\\n ///\\n /// * `claimIndex` MUST be inside the interval `[0, n)` where `n` is the number of claims\\n /// that have been submitted to `_dapp` already.\\n ///\\n /// @inheritdoc IHistory\\n function getClaim(\\n address _dapp,\\n bytes calldata _proofContext\\n ) external view override returns (bytes32, uint256, uint256) {\\n uint256 claimIndex = abi.decode(_proofContext, (uint256));\\n\\n Claim memory claim = claims[_dapp][claimIndex];\\n\\n return (claim.epochHash, claim.firstIndex, claim.lastIndex);\\n }\\n\\n /// @inheritdoc IHistory\\n /// @dev Emits an `OwnershipTransferred` event. Should have access control.\\n function migrateToConsensus(\\n address _consensus\\n ) external override onlyOwner {\\n transferOwnership(_consensus);\\n }\\n}\\n\",\"keccak256\":\"0x607253a9e73d3fe0b98e2c5d7b6f9ee1dad48d7cf4a1284b4f1361d74178da7a\",\"license\":\"Apache-2.0\"},\"contracts/history/IHistory.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\n/// @title History interface\\ninterface IHistory {\\n // Permissioned functions\\n\\n /// @notice Submit a claim.\\n /// The encoding of `_claimData` might vary\\n /// depending on the history implementation.\\n /// @param _claimData Data for submitting a claim\\n /// @dev Should have access control.\\n function submitClaim(bytes calldata _claimData) external;\\n\\n /// @notice Transfer ownership to another consensus.\\n /// @param _consensus The new consensus\\n /// @dev Should have access control.\\n function migrateToConsensus(address _consensus) external;\\n\\n // Permissionless functions\\n\\n /// @notice Get a specific claim regarding a specific DApp.\\n /// The encoding of `_proofContext` might vary\\n /// depending on the history implementation.\\n /// @param _dapp The DApp address\\n /// @param _proofContext Data for retrieving the desired claim\\n /// @return epochHash_ The claimed epoch hash\\n /// @return firstInputIndex_ The index of the first input of the epoch in the input box\\n /// @return lastInputIndex_ The index of the last input of the epoch in the input box\\n function getClaim(\\n address _dapp,\\n bytes calldata _proofContext\\n )\\n external\\n view\\n returns (\\n bytes32 epochHash_,\\n uint256 firstInputIndex_,\\n uint256 lastInputIndex_\\n );\\n}\\n\",\"keccak256\":\"0xfe0404f078a3a6f761beea8afbb2fac322fd2900f7ad2e2b866504c7aa54568f\",\"license\":\"Apache-2.0\"}},\"version\":1}", - "bytecode": "0x608060405234801561001057600080fd5b5060405161091f38038061091f83398101604081905261002f91610181565b61003833610057565b6001600160a01b038116331461005157610051816100a7565b506101b1565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6100af610125565b6001600160a01b0381166101195760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b61012281610057565b50565b6000546001600160a01b0316331461017f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610110565b565b60006020828403121561019357600080fd5b81516001600160a01b03811681146101aa57600080fd5b9392505050565b61075f806101c06000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c8063715018a6146100675780638da5cb5b14610071578063d79a824014610091578063ddfdfbb0146100bf578063f2fde38b146100d2578063fc411683146100e5575b600080fd5b61006f6100f8565b005b6000546040516001600160a01b0390911681526020015b60405180910390f35b6100a461009f36600461052f565b61010c565b60408051938452602084019290925290820152606001610088565b61006f6100cd366004610584565b6101a5565b61006f6100e03660046105c6565b61039d565b61006f6100f33660046105c6565b610416565b610100610427565b61010a6000610481565b565b600080808061011d858701876105ea565b6001600160a01b0388166000908152600160205260408120805492935090918390811061014c5761014c610603565b60009182526020918290206040805160608101825260029390930290910180548084526001909101546001600160801b03808216958501869052600160801b90910416929091018290529a919950975095505050505050565b6101ad610427565b6000806101bc83850185610635565b9150915080604001516001600160801b031681602001516001600160801b031611156102225760405162461bcd60e51b815260206004820152601060248201526f486973746f72793a204649203e204c4960801b60448201526064015b60405180910390fd5b6001600160a01b038216600090815260016020526040902080548015610294578161024e6001836106e9565b8154811061025e5761025e610603565b906000526020600020906002020160010160109054906101000a90046001600160801b0316600161028f9190610702565b610297565b60005b6001600160801b031683602001516001600160801b0316146102fb5760405162461bcd60e51b815260206004820152601960248201527f486973746f72793a20756e636c61696d656420696e70757473000000000000006044820152606401610219565b8154600180820184556000848152602090819020865160029094020183815586820180516040808a0180516001600160801b03938416600160801b9185169190910217949096019390935582519586529051811692850192909252915116908201526001600160a01b038516907fb71880d7a0c514d48c0296b2721b0a4f9641a45117960f2ca86b5b7873c4ab2f9060600160405180910390a2505050505050565b6103a5610427565b6001600160a01b03811661040a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610219565b61041381610481565b50565b61041e610427565b6104138161039d565b6000546001600160a01b0316331461010a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610219565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038116811461041357600080fd5b60008083601f8401126104f857600080fd5b50813567ffffffffffffffff81111561051057600080fd5b60208301915083602082850101111561052857600080fd5b9250929050565b60008060006040848603121561054457600080fd5b833561054f816104d1565b9250602084013567ffffffffffffffff81111561056b57600080fd5b610577868287016104e6565b9497909650939450505050565b6000806020838503121561059757600080fd5b823567ffffffffffffffff8111156105ae57600080fd5b6105ba858286016104e6565b90969095509350505050565b6000602082840312156105d857600080fd5b81356105e3816104d1565b9392505050565b6000602082840312156105fc57600080fd5b5035919050565b634e487b7160e01b600052603260045260246000fd5b80356001600160801b038116811461063057600080fd5b919050565b600080828403608081121561064957600080fd5b8335610654816104d1565b92506060601f198201121561066857600080fd5b506040516060810181811067ffffffffffffffff8211171561069a57634e487b7160e01b600052604160045260246000fd5b8060405250602084013581526106b260408501610619565b60208201526106c360608501610619565b6040820152809150509250929050565b634e487b7160e01b600052601160045260246000fd5b818103818111156106fc576106fc6106d3565b92915050565b6001600160801b03818116838216019080821115610722576107226106d3565b509291505056fea26469706673582212201fc5dfb9d50cb3efefe40c7ced59b7b296f6d072ed8005ef3de36946cd77e28364736f6c63430008130033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100625760003560e01c8063715018a6146100675780638da5cb5b14610071578063d79a824014610091578063ddfdfbb0146100bf578063f2fde38b146100d2578063fc411683146100e5575b600080fd5b61006f6100f8565b005b6000546040516001600160a01b0390911681526020015b60405180910390f35b6100a461009f36600461052f565b61010c565b60408051938452602084019290925290820152606001610088565b61006f6100cd366004610584565b6101a5565b61006f6100e03660046105c6565b61039d565b61006f6100f33660046105c6565b610416565b610100610427565b61010a6000610481565b565b600080808061011d858701876105ea565b6001600160a01b0388166000908152600160205260408120805492935090918390811061014c5761014c610603565b60009182526020918290206040805160608101825260029390930290910180548084526001909101546001600160801b03808216958501869052600160801b90910416929091018290529a919950975095505050505050565b6101ad610427565b6000806101bc83850185610635565b9150915080604001516001600160801b031681602001516001600160801b031611156102225760405162461bcd60e51b815260206004820152601060248201526f486973746f72793a204649203e204c4960801b60448201526064015b60405180910390fd5b6001600160a01b038216600090815260016020526040902080548015610294578161024e6001836106e9565b8154811061025e5761025e610603565b906000526020600020906002020160010160109054906101000a90046001600160801b0316600161028f9190610702565b610297565b60005b6001600160801b031683602001516001600160801b0316146102fb5760405162461bcd60e51b815260206004820152601960248201527f486973746f72793a20756e636c61696d656420696e70757473000000000000006044820152606401610219565b8154600180820184556000848152602090819020865160029094020183815586820180516040808a0180516001600160801b03938416600160801b9185169190910217949096019390935582519586529051811692850192909252915116908201526001600160a01b038516907fb71880d7a0c514d48c0296b2721b0a4f9641a45117960f2ca86b5b7873c4ab2f9060600160405180910390a2505050505050565b6103a5610427565b6001600160a01b03811661040a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610219565b61041381610481565b50565b61041e610427565b6104138161039d565b6000546001600160a01b0316331461010a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610219565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038116811461041357600080fd5b60008083601f8401126104f857600080fd5b50813567ffffffffffffffff81111561051057600080fd5b60208301915083602082850101111561052857600080fd5b9250929050565b60008060006040848603121561054457600080fd5b833561054f816104d1565b9250602084013567ffffffffffffffff81111561056b57600080fd5b610577868287016104e6565b9497909650939450505050565b6000806020838503121561059757600080fd5b823567ffffffffffffffff8111156105ae57600080fd5b6105ba858286016104e6565b90969095509350505050565b6000602082840312156105d857600080fd5b81356105e3816104d1565b9392505050565b6000602082840312156105fc57600080fd5b5035919050565b634e487b7160e01b600052603260045260246000fd5b80356001600160801b038116811461063057600080fd5b919050565b600080828403608081121561064957600080fd5b8335610654816104d1565b92506060601f198201121561066857600080fd5b506040516060810181811067ffffffffffffffff8211171561069a57634e487b7160e01b600052604160045260246000fd5b8060405250602084013581526106b260408501610619565b60208201526106c360608501610619565b6040820152809150509250929050565b634e487b7160e01b600052601160045260246000fd5b818103818111156106fc576106fc6106d3565b92915050565b6001600160801b03818116838216019080821115610722576107226106d3565b509291505056fea26469706673582212201fc5dfb9d50cb3efefe40c7ced59b7b296f6d072ed8005ef3de36946cd77e28364736f6c63430008130033", - "devdoc": { - "details": "This contract inherits OpenZeppelin's `Ownable` contract. For more information on `Ownable`, please consult OpenZeppelin's official documentation.", - "events": { - "NewClaimToHistory(address,(bytes32,uint128,uint128))": { - "details": "MUST be triggered on a successful call to `submitClaim`.", - "params": { - "claim": "The newly-submitted claim", - "dapp": "The address of the DApp" - } - } - }, - "kind": "dev", - "methods": { - "constructor": { - "params": { - "_owner": "The initial owner" - } - }, - "getClaim(address,bytes)": { - "params": { - "_dapp": "The DApp address", - "_proofContext": "Data for retrieving the desired claim" - }, - "returns": { - "_0": "The claimed epoch hash", - "_1": "The index of the first input of the epoch in the input box", - "_2": "The index of the last input of the epoch in the input box" - } - }, - "migrateToConsensus(address)": { - "details": "Emits an `OwnershipTransferred` event. Should have access control.", - "params": { - "_consensus": "The new consensus" - } - }, - "owner()": { - "details": "Returns the address of the current owner." - }, - "renounceOwnership()": { - "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." - }, - "submitClaim(bytes)": { - "details": "Emits a `NewClaimToHistory` event. Should have access control.", - "params": { - "_claimData": "Data for submitting a claim" - } - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." - } - }, - "stateVariables": { - "claims": { - "details": "See the `getClaim` and `submitClaim` functions." - } - }, - "title": "Simple History", - "version": 1 - }, - "userdoc": { - "events": { - "NewClaimToHistory(address,(bytes32,uint128,uint128))": { - "notice": "A new claim regarding a specific DApp was submitted." - } - }, - "kind": "user", - "methods": { - "constructor": { - "notice": "Creates a `History` contract." - }, - "getClaim(address,bytes)": { - "notice": "Get a specific claim regarding a specific DApp. There are several requirements for this function to be called successfully. * `_proofContext` MUST be well-encoded. In Solidity, it can be constructed as `abi.encode(claimIndex)`, where `claimIndex` is the claim index (type `uint256`). * `claimIndex` MUST be inside the interval `[0, n)` where `n` is the number of claims that have been submitted to `_dapp` already." - }, - "migrateToConsensus(address)": { - "notice": "Transfer ownership to another consensus." - }, - "submitClaim(bytes)": { - "notice": "Submit a claim regarding a DApp. There are several requirements for this function to be called successfully. * `_claimData` MUST be well-encoded. In Solidity, it can be constructed as `abi.encode(dapp, claim)`, where `dapp` is the DApp address (type `address`) and `claim` is the claim structure (type `Claim`). * `firstIndex` MUST be less than or equal to `lastIndex`. As a result, every claim MUST encompass AT LEAST one input. * If this is the DApp's first claim, then `firstIndex` MUST be `0`. Otherwise, `firstIndex` MUST be the `lastClaim.lastIndex + 1`. In other words, claims MUST NOT skip inputs." - } - }, - "notice": "This contract stores claims for each DApp individually. This means that, for each DApp, the contract stores an array of `Claim` entries, where each `Claim` is composed of: * An epoch hash (`bytes32`) * A closed interval of input indices (`uint128`, `uint128`) The contract guarantees that the first interval starts at index 0, and that the following intervals don't have gaps or overlaps. Furthermore, claims can only be submitted by the contract owner through `submitClaim`, but can be retrieved by anyone with `getClaim`.", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 1155, - "contract": "contracts/history/History.sol:History", - "label": "_owner", - "offset": 0, - "slot": "0", - "type": "t_address" - }, - { - "astId": 3072, - "contract": "contracts/history/History.sol:History", - "label": "claims", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_address,t_array(t_struct(Claim)3065_storage)dyn_storage)" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_struct(Claim)3065_storage)dyn_storage": { - "base": "t_struct(Claim)3065_storage", - "encoding": "dynamic_array", - "label": "struct History.Claim[]", - "numberOfBytes": "32" - }, - "t_bytes32": { - "encoding": "inplace", - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_array(t_struct(Claim)3065_storage)dyn_storage)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => struct History.Claim[])", - "numberOfBytes": "32", - "value": "t_array(t_struct(Claim)3065_storage)dyn_storage" - }, - "t_struct(Claim)3065_storage": { - "encoding": "inplace", - "label": "struct History.Claim", - "members": [ - { - "astId": 3060, - "contract": "contracts/history/History.sol:History", - "label": "epochHash", - "offset": 0, - "slot": "0", - "type": "t_bytes32" - }, - { - "astId": 3062, - "contract": "contracts/history/History.sol:History", - "label": "firstIndex", - "offset": 0, - "slot": "1", - "type": "t_uint128" - }, - { - "astId": 3064, - "contract": "contracts/history/History.sol:History", - "label": "lastIndex", - "offset": 16, - "slot": "1", - "type": "t_uint128" - } - ], - "numberOfBytes": "64" - }, - "t_uint128": { - "encoding": "inplace", - "label": "uint128", - "numberOfBytes": "16" - } - } - } -} \ No newline at end of file diff --git a/onchain/rollups/deployments/polygon_mumbai/Authority.json b/onchain/rollups/deployments/polygon_mumbai/Authority.json deleted file mode 100644 index e51d89ec8..000000000 --- a/onchain/rollups/deployments/polygon_mumbai/Authority.json +++ /dev/null @@ -1,481 +0,0 @@ -{ - "address": "0x35EC7d70cAff883844d94b54cD19634fFAb5d8CC", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_owner", - "type": "address" - }, - { - "internalType": "contract IInputBox", - "name": "_inputBox", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "application", - "type": "address" - } - ], - "name": "ApplicationJoined", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": false, - "internalType": "contract IInputBox", - "name": "inputBox", - "type": "address" - } - ], - "name": "ConsensusCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "contract IHistory", - "name": "history", - "type": "address" - } - ], - "name": "NewHistory", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_dapp", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_proofContext", - "type": "bytes" - } - ], - "name": "getClaim", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getHistory", - "outputs": [ - { - "internalType": "contract IHistory", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "join", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_consensus", - "type": "address" - } - ], - "name": "migrateHistoryToConsensus", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IHistory", - "name": "_history", - "type": "address" - } - ], - "name": "setHistory", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "_claimData", - "type": "bytes" - } - ], - "name": "submitClaim", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IERC20", - "name": "_token", - "type": "address" - }, - { - "internalType": "address", - "name": "_recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "withdrawERC20Tokens", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0x26ac30ff5b0300529798df7b389c82fff3fd497a1dff7794c5d11d4a41eb23d6", - "receipt": { - "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", - "from": "0x18930e8a66a1DbE21D00581216789AAB7460Afd0", - "contractAddress": null, - "transactionIndex": 1, - "gasUsed": "521630", - "logsBloom": "0x00000000000000000000000000000000000000000000000000800420000000000000000000000000000000000200000000008000000000000000000000008000000000000000000000000000000000800001000000000000000100000000000000000000020000000000000000000800000000000000000080000000000000400000000000000000000000000000000000000000001000000000000000080000200001000001000000080000000000000000000000000000000000000000004000000000000000000001000000000100000000000010000000100000000020000000000000000000000000000000000080000001000000000000024000100000", - "blockHash": "0x875ce6f29887dc192dc81b018b55a483cf8899c74803f0269d3be14430a5bf1a", - "transactionHash": "0x26ac30ff5b0300529798df7b389c82fff3fd497a1dff7794c5d11d4a41eb23d6", - "logs": [ - { - "transactionIndex": 1, - "blockNumber": 35713218, - "transactionHash": "0x26ac30ff5b0300529798df7b389c82fff3fd497a1dff7794c5d11d4a41eb23d6", - "address": "0x35EC7d70cAff883844d94b54cD19634fFAb5d8CC", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000004e59b44847b379578588920ca78fbf26c0b4956c" - ], - "data": "0x", - "logIndex": 2, - "blockHash": "0x875ce6f29887dc192dc81b018b55a483cf8899c74803f0269d3be14430a5bf1a" - }, - { - "transactionIndex": 1, - "blockNumber": 35713218, - "transactionHash": "0x26ac30ff5b0300529798df7b389c82fff3fd497a1dff7794c5d11d4a41eb23d6", - "address": "0x35EC7d70cAff883844d94b54cD19634fFAb5d8CC", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000004e59b44847b379578588920ca78fbf26c0b4956c", - "0x00000000000000000000000018930e8a66a1dbe21d00581216789aab7460afd0" - ], - "data": "0x", - "logIndex": 3, - "blockHash": "0x875ce6f29887dc192dc81b018b55a483cf8899c74803f0269d3be14430a5bf1a" - }, - { - "transactionIndex": 1, - "blockNumber": 35713218, - "transactionHash": "0x26ac30ff5b0300529798df7b389c82fff3fd497a1dff7794c5d11d4a41eb23d6", - "address": "0x35EC7d70cAff883844d94b54cD19634fFAb5d8CC", - "topics": [ - "0x583f764398dc1f7529b3e4472cb331312f6b6d76744da14476f571a330d36e23" - ], - "data": "0x00000000000000000000000018930e8a66a1dbe21d00581216789aab7460afd00000000000000000000000005a723220579c0dcb8c9253e6b4c62e572e379945", - "logIndex": 4, - "blockHash": "0x875ce6f29887dc192dc81b018b55a483cf8899c74803f0269d3be14430a5bf1a" - }, - { - "transactionIndex": 1, - "blockNumber": 35713218, - "transactionHash": "0x26ac30ff5b0300529798df7b389c82fff3fd497a1dff7794c5d11d4a41eb23d6", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x00000000000000000000000018930e8a66a1dbe21d00581216789aab7460afd0", - "0x0000000000000000000000003a22c8bc68e98b0faf40f349dd2b2890fae01484" - ], - "data": "0x0000000000000000000000000000000000000000000000000006f312eeb4050000000000000000000000000000000000000000000000000003b9c0de1dfa75040000000000000000000000000000000000000000000009138536e4211517b23200000000000000000000000000000000000000000000000003b2cdcb2f467004000000000000000000000000000000000000000000000913853dd73403cbb732", - "logIndex": 5, - "blockHash": "0x875ce6f29887dc192dc81b018b55a483cf8899c74803f0269d3be14430a5bf1a" - } - ], - "blockNumber": 35713218, - "cumulativeGasUsed": "672932", - "status": 1, - "byzantium": true - }, - "args": [ - "0x18930e8a66a1DbE21D00581216789AAB7460Afd0", - "0x5a723220579C0DCb8C9253E6b4c62e572E379945" - ], - "numDeployments": 5, - "solcInputHash": "ccf852a6f03ad282136085842817ac99", - "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"contract IInputBox\",\"name\":\"_inputBox\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"application\",\"type\":\"address\"}],\"name\":\"ApplicationJoined\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"contract IInputBox\",\"name\":\"inputBox\",\"type\":\"address\"}],\"name\":\"ConsensusCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"contract IHistory\",\"name\":\"history\",\"type\":\"address\"}],\"name\":\"NewHistory\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dapp\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_proofContext\",\"type\":\"bytes\"}],\"name\":\"getClaim\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getHistory\",\"outputs\":[{\"internalType\":\"contract IHistory\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"join\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_consensus\",\"type\":\"address\"}],\"name\":\"migrateHistoryToConsensus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IHistory\",\"name\":\"_history\",\"type\":\"address\"}],\"name\":\"setHistory\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_claimData\",\"type\":\"bytes\"}],\"name\":\"submitClaim\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdrawERC20Tokens\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"This contract inherits `AbstractConsensus` and OpenZeppelin's `Ownable` contract. For more information on `Ownable`, please consult OpenZeppelin's official documentation.\",\"events\":{\"ApplicationJoined(address)\":{\"details\":\"MUST be triggered on a successful call to `join`.\",\"params\":{\"application\":\"The application\"}},\"ConsensusCreated(address,address)\":{\"details\":\"MUST be triggered during construction.\",\"params\":{\"inputBox\":\"The input box from which the authority fetches new inputs\",\"owner\":\"The address that initially owns the `Authority` contract\"}},\"NewHistory(address)\":{\"details\":\"MUST be triggered on a successful call to `setHistory`.\",\"params\":{\"history\":\"The new history contract\"}}},\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Emits a `ConsensusCreated` event.\",\"params\":{\"_inputBox\":\"The input box contract\",\"_owner\":\"The initial contract owner\"}},\"getClaim(address,bytes)\":{\"params\":{\"_dapp\":\"The DApp address\",\"_proofContext\":\"Data for retrieving the desired claim\"},\"returns\":{\"_0\":\"The claimed epoch hash\",\"_1\":\"The index of the first input of the epoch in the input box\",\"_2\":\"The index of the last input of the epoch in the input box\"}},\"getHistory()\":{\"returns\":{\"_0\":\"The current history contract\"}},\"migrateHistoryToConsensus(address)\":{\"details\":\"Can only be called by the `Authority` owner, and the `Authority` contract must have ownership over its current history contract.\",\"params\":{\"_consensus\":\"The new owner of the current history contract\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setHistory(address)\":{\"details\":\"Emits a `NewHistory` event. Can only be called by the `Authority` owner.\",\"params\":{\"_history\":\"The new history contract\"}},\"submitClaim(bytes)\":{\"details\":\"Can only be called by the `Authority` owner, and the `Authority` contract must have ownership over its current history contract.\",\"params\":{\"_claimData\":\"Data for submitting a claim\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"withdrawERC20Tokens(address,address,uint256)\":{\"details\":\"Can only be called by the `Authority` owner.\",\"params\":{\"_amount\":\"The amount of tokens to be withdrawn\",\"_recipient\":\"The recipient address\",\"_token\":\"The token contract\"}}},\"stateVariables\":{\"history\":{\"details\":\"See the `getHistory` and `setHistory` functions.\"}},\"title\":\"Authority consensus\",\"version\":1},\"userdoc\":{\"events\":{\"ApplicationJoined(address)\":{\"notice\":\"An application has joined the consensus' validation set.\"},\"ConsensusCreated(address,address)\":{\"notice\":\"The `Authority` contract was created.\"},\"NewHistory(address)\":{\"notice\":\"A new history contract is used to store claims.\"}},\"kind\":\"user\",\"methods\":{\"constructor\":{\"notice\":\"Constructs an `Authority` contract.\"},\"getClaim(address,bytes)\":{\"notice\":\"Get a claim from the current history. The encoding of `_proofContext` might vary depending on the implementation of the current history contract.\"},\"getHistory()\":{\"notice\":\"Get the current history contract.\"},\"join()\":{\"notice\":\"Emits an `ApplicationJoined` event with the message sender.\"},\"migrateHistoryToConsensus(address)\":{\"notice\":\"Transfer ownership over the current history contract to `_consensus`.\"},\"setHistory(address)\":{\"notice\":\"Make `Authority` point to another history contract.\"},\"submitClaim(bytes)\":{\"notice\":\"Submits a claim to the current history contract. The encoding of `_claimData` might vary depending on the implementation of the current history contract.\"},\"withdrawERC20Tokens(address,address,uint256)\":{\"notice\":\"Transfer some amount of ERC-20 tokens to a recipient.\"}},\"notice\":\"A consensus model controlled by a single address, the owner. Claims are stored in an auxiliary contract called `History`.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/consensus/authority/Authority.sol\":\"Authority\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"contracts/consensus/AbstractConsensus.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\nimport {IConsensus} from \\\"./IConsensus.sol\\\";\\n\\n/// @title Abstract Consensus\\n/// @notice An abstract contract that partially implements `IConsensus`.\\nabstract contract AbstractConsensus is IConsensus {\\n /// @notice Emits an `ApplicationJoined` event with the message sender.\\n function join() external override {\\n emit ApplicationJoined(msg.sender);\\n }\\n}\\n\",\"keccak256\":\"0x0483d8a8557c4e345eca5ad31ffea560737b08c75ade0430106136a89d755e13\",\"license\":\"Apache-2.0\"},\"contracts/consensus/IConsensus.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\n/// @title Consensus interface\\n///\\n/// @notice This contract defines a generic interface for consensuses.\\n/// We use the word \\\"consensus\\\" to designate a contract that provides claims\\n/// in the base layer regarding the state of off-chain machines running in\\n/// the execution layer. How this contract is able to reach consensus, who is\\n/// able to submit claims, and how are claims stored in the base layer are\\n/// some of the implementation details left unspecified by this interface.\\n///\\n/// From the point of view of a DApp, these claims are necessary to validate\\n/// on-chain action allowed by the off-chain machine in the form of vouchers\\n/// and notices. Each claim is composed of three parts: an epoch hash, a first\\n/// index, and a last index. We'll explain each of these parts below.\\n///\\n/// First, let us define the word \\\"epoch\\\". For finality reasons, we need to\\n/// divide the stream of inputs being fed into the off-chain machine into\\n/// batches of inputs, which we call \\\"epoches\\\". At the end of every epoch,\\n/// we summarize the state of the off-chain machine in a single hash, called\\n/// \\\"epoch hash\\\". Please note that this interface does not define how this\\n/// stream of inputs is being chopped up into epoches.\\n///\\n/// The other two parts are simply the indices of the first and last inputs\\n/// accepted during the epoch. Logically, the first index MUST BE less than\\n/// or equal to the last index. As a result, every epoch MUST accept at least\\n/// one input. This assumption stems from the fact that the state of a machine\\n/// can only change after an input is fed into it.\\n///\\n/// Examples of possible implementations of this interface include:\\n///\\n/// * An authority consensus, controlled by a single address who has full\\n/// control over epoch boundaries, claim submission, asset management, etc.\\n///\\n/// * A quorum consensus, controlled by a limited set of validators, that\\n/// vote on the state of the machine at the end of every epoch. Also, epoch\\n/// boundaries are determined by the timestamp in the base layer, and assets\\n/// are split equally amongst the validators.\\n///\\n/// * An NxN consensus, which allows anyone to submit and dispute claims\\n/// in the base layer. Epoch boundaries are determined in the same fashion\\n/// as in the quorum example.\\n///\\ninterface IConsensus {\\n /// @notice An application has joined the consensus' validation set.\\n /// @param application The application\\n /// @dev MUST be triggered on a successful call to `join`.\\n event ApplicationJoined(address application);\\n\\n /// @notice Get a specific claim regarding a specific DApp.\\n /// The encoding of `_proofContext` might vary\\n /// depending on the implementation.\\n /// @param _dapp The DApp address\\n /// @param _proofContext Data for retrieving the desired claim\\n /// @return epochHash_ The claimed epoch hash\\n /// @return firstInputIndex_ The index of the first input of the epoch in the input box\\n /// @return lastInputIndex_ The index of the last input of the epoch in the input box\\n function getClaim(\\n address _dapp,\\n bytes calldata _proofContext\\n )\\n external\\n view\\n returns (\\n bytes32 epochHash_,\\n uint256 firstInputIndex_,\\n uint256 lastInputIndex_\\n );\\n\\n /// @notice Signal the consensus that the message sender wants to join its validation set.\\n /// @dev MUST fire an `ApplicationJoined` event with the message sender as argument.\\n function join() external;\\n}\\n\",\"keccak256\":\"0x5d59c8dc3c1483e3173837d679093000077bf175c0b3ad7f02f0ffe611c0a89e\",\"license\":\"Apache-2.0\"},\"contracts/consensus/authority/Authority.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\nimport {Ownable} from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport {IERC20} from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport {IConsensus} from \\\"../IConsensus.sol\\\";\\nimport {AbstractConsensus} from \\\"../AbstractConsensus.sol\\\";\\nimport {IInputBox} from \\\"../../inputs/IInputBox.sol\\\";\\nimport {IHistory} from \\\"../../history/IHistory.sol\\\";\\n\\n/// @title Authority consensus\\n/// @notice A consensus model controlled by a single address, the owner.\\n/// Claims are stored in an auxiliary contract called `History`.\\n/// @dev This contract inherits `AbstractConsensus` and OpenZeppelin's `Ownable` contract.\\n/// For more information on `Ownable`, please consult OpenZeppelin's official documentation.\\ncontract Authority is AbstractConsensus, Ownable {\\n /// @notice The current history contract.\\n /// @dev See the `getHistory` and `setHistory` functions.\\n IHistory internal history;\\n\\n /// @notice The `Authority` contract was created.\\n /// @param owner The address that initially owns the `Authority` contract\\n /// @param inputBox The input box from which the authority fetches new inputs\\n /// @dev MUST be triggered during construction.\\n event ConsensusCreated(address owner, IInputBox inputBox);\\n\\n /// @notice A new history contract is used to store claims.\\n /// @param history The new history contract\\n /// @dev MUST be triggered on a successful call to `setHistory`.\\n event NewHistory(IHistory history);\\n\\n /// @notice Constructs an `Authority` contract.\\n /// @param _owner The initial contract owner\\n /// @param _inputBox The input box contract\\n /// @dev Emits a `ConsensusCreated` event.\\n constructor(address _owner, IInputBox _inputBox) {\\n // constructor in Ownable already called `transferOwnership(msg.sender)`, so\\n // we only need to call `transferOwnership(_owner)` if _owner != msg.sender\\n if (msg.sender != _owner) {\\n transferOwnership(_owner);\\n }\\n emit ConsensusCreated(_owner, _inputBox);\\n }\\n\\n /// @notice Submits a claim to the current history contract.\\n /// The encoding of `_claimData` might vary depending on the\\n /// implementation of the current history contract.\\n /// @param _claimData Data for submitting a claim\\n /// @dev Can only be called by the `Authority` owner,\\n /// and the `Authority` contract must have ownership over\\n /// its current history contract.\\n function submitClaim(bytes calldata _claimData) external onlyOwner {\\n history.submitClaim(_claimData);\\n }\\n\\n /// @notice Transfer ownership over the current history contract to `_consensus`.\\n /// @param _consensus The new owner of the current history contract\\n /// @dev Can only be called by the `Authority` owner,\\n /// and the `Authority` contract must have ownership over\\n /// its current history contract.\\n function migrateHistoryToConsensus(address _consensus) external onlyOwner {\\n history.migrateToConsensus(_consensus);\\n }\\n\\n /// @notice Make `Authority` point to another history contract.\\n /// @param _history The new history contract\\n /// @dev Emits a `NewHistory` event.\\n /// Can only be called by the `Authority` owner.\\n function setHistory(IHistory _history) external onlyOwner {\\n history = _history;\\n emit NewHistory(_history);\\n }\\n\\n /// @notice Get the current history contract.\\n /// @return The current history contract\\n function getHistory() external view returns (IHistory) {\\n return history;\\n }\\n\\n /// @notice Get a claim from the current history.\\n /// The encoding of `_proofContext` might vary depending on the\\n /// implementation of the current history contract.\\n /// @inheritdoc IConsensus\\n function getClaim(\\n address _dapp,\\n bytes calldata _proofContext\\n ) external view override returns (bytes32, uint256, uint256) {\\n return history.getClaim(_dapp, _proofContext);\\n }\\n\\n /// @notice Transfer some amount of ERC-20 tokens to a recipient.\\n /// @param _token The token contract\\n /// @param _recipient The recipient address\\n /// @param _amount The amount of tokens to be withdrawn\\n /// @dev Can only be called by the `Authority` owner.\\n function withdrawERC20Tokens(\\n IERC20 _token,\\n address _recipient,\\n uint256 _amount\\n ) external onlyOwner {\\n require(\\n _token.transfer(_recipient, _amount),\\n \\\"Authority: withdrawal failed\\\"\\n );\\n }\\n}\\n\",\"keccak256\":\"0x0a37f82a0c924deeb8fa5baa6ff0133054037170dadd0032b81f4c93c3ca1c91\",\"license\":\"Apache-2.0\"},\"contracts/history/IHistory.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\n/// @title History interface\\ninterface IHistory {\\n // Permissioned functions\\n\\n /// @notice Submit a claim.\\n /// The encoding of `_claimData` might vary\\n /// depending on the history implementation.\\n /// @param _claimData Data for submitting a claim\\n /// @dev Should have access control.\\n function submitClaim(bytes calldata _claimData) external;\\n\\n /// @notice Transfer ownership to another consensus.\\n /// @param _consensus The new consensus\\n /// @dev Should have access control.\\n function migrateToConsensus(address _consensus) external;\\n\\n // Permissionless functions\\n\\n /// @notice Get a specific claim regarding a specific DApp.\\n /// The encoding of `_proofContext` might vary\\n /// depending on the history implementation.\\n /// @param _dapp The DApp address\\n /// @param _proofContext Data for retrieving the desired claim\\n /// @return epochHash_ The claimed epoch hash\\n /// @return firstInputIndex_ The index of the first input of the epoch in the input box\\n /// @return lastInputIndex_ The index of the last input of the epoch in the input box\\n function getClaim(\\n address _dapp,\\n bytes calldata _proofContext\\n )\\n external\\n view\\n returns (\\n bytes32 epochHash_,\\n uint256 firstInputIndex_,\\n uint256 lastInputIndex_\\n );\\n}\\n\",\"keccak256\":\"0xfe0404f078a3a6f761beea8afbb2fac322fd2900f7ad2e2b866504c7aa54568f\",\"license\":\"Apache-2.0\"},\"contracts/inputs/IInputBox.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\n/// @title Input Box interface\\ninterface IInputBox {\\n /// @notice Emitted when an input is added to a DApp's input box.\\n /// @param dapp The address of the DApp\\n /// @param inboxInputIndex The index of the input in the input box\\n /// @param sender The address that sent the input\\n /// @param input The contents of the input\\n /// @dev MUST be triggered on a successful call to `addInput`.\\n event InputAdded(\\n address indexed dapp,\\n uint256 indexed inboxInputIndex,\\n address sender,\\n bytes input\\n );\\n\\n /// @notice Add an input to a DApp's input box.\\n /// @param _dapp The address of the DApp\\n /// @param _input The contents of the input\\n /// @return The hash of the input plus some extra metadata\\n /// @dev MUST fire an `InputAdded` event accordingly.\\n function addInput(\\n address _dapp,\\n bytes calldata _input\\n ) external returns (bytes32);\\n\\n /// @notice Get the number of inputs in a DApp's input box.\\n /// @param _dapp The address of the DApp\\n /// @return Number of inputs in the DApp's input box\\n function getNumberOfInputs(address _dapp) external view returns (uint256);\\n\\n /// @notice Get the hash of an input in a DApp's input box.\\n /// @param _dapp The address of the DApp\\n /// @param _index The index of the input in the DApp's input box\\n /// @return The hash of the input at the provided index in the DApp's input box\\n /// @dev `_index` MUST be in the interval `[0,n)` where `n` is the number of\\n /// inputs in the DApp's input box. See the `getNumberOfInputs` function.\\n function getInputHash(\\n address _dapp,\\n uint256 _index\\n ) external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x2addd467a24cde2131784103080aeb28df40d87ba19c5fd92bf96c0c074603df\",\"license\":\"Apache-2.0\"}},\"version\":1}", - "bytecode": "0x608060405234801561001057600080fd5b506040516109ef3803806109ef83398101604081905261002f916101da565b6100383361009b565b336001600160a01b0383161461005157610051826100eb565b604080516001600160a01b038085168252831660208201527f583f764398dc1f7529b3e4472cb331312f6b6d76744da14476f571a330d36e23910160405180910390a15050610214565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6100f3610169565b6001600160a01b03811661015d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b6101668161009b565b50565b6000546001600160a01b031633146101c35760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610154565b565b6001600160a01b038116811461016657600080fd5b600080604083850312156101ed57600080fd5b82516101f8816101c5565b6020840151909250610209816101c5565b809150509250929050565b6107cc806102236000396000f3fe608060405234801561001057600080fd5b506004361061009e5760003560e01c8063b688a36311610066578063b688a3631461010e578063bcdd1e1314610116578063d79a824014610129578063ddfdfbb014610157578063f2fde38b1461016a57600080fd5b8063159c5ea1146100a3578063715018a6146100b85780638da5cb5b146100c05780639368a3d3146100ea578063aa15efc8146100fd575b600080fd5b6100b66100b136600461058e565b61017d565b005b6100b66101d9565b6000546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b6100b66100f836600461058e565b6101ed565b6001546001600160a01b03166100cd565b6100b6610257565b6100b66101243660046105b2565b61028c565b61013c61013736600461063c565b61035d565b604080519384526020840192909252908201526060016100e1565b6100b6610165366004610691565b6103e6565b6100b661017836600461058e565b610456565b6101856104cf565b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f2bcd43869347a1d42f97ac6042f3d129817abd05a6125f9750fe3724e321d23e9060200160405180910390a150565b6101e16104cf565b6101eb6000610529565b565b6101f56104cf565b60015460405163fc41168360e01b81526001600160a01b0383811660048301529091169063fc41168390602401600060405180830381600087803b15801561023c57600080fd5b505af1158015610250573d6000803e3d6000fd5b5050505050565b6040513381527f27c2b702d3bff195a18baca2daf00b20a986177c5f1449af4e2d46a3c3e02ce59060200160405180910390a1565b6102946104cf565b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af11580156102e3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061030791906106d3565b6103585760405162461bcd60e51b815260206004820152601c60248201527f417574686f726974793a207769746864726177616c206661696c65640000000060448201526064015b60405180910390fd5b505050565b60015460405163035e6a0960e61b8152600091829182916001600160a01b03169063d79a8240906103969089908990899060040161071e565b606060405180830381865afa1580156103b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103d7919061074c565b92509250925093509350939050565b6103ee6104cf565b600154604051630ddfdfbb60e41b81526001600160a01b039091169063ddfdfbb090610420908590859060040161077a565b600060405180830381600087803b15801561043a57600080fd5b505af115801561044e573d6000803e3d6000fd5b505050505050565b61045e6104cf565b6001600160a01b0381166104c35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161034f565b6104cc81610529565b50565b6000546001600160a01b031633146101eb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161034f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146104cc57600080fd5b6000602082840312156105a057600080fd5b81356105ab81610579565b9392505050565b6000806000606084860312156105c757600080fd5b83356105d281610579565b925060208401356105e281610579565b929592945050506040919091013590565b60008083601f84011261060557600080fd5b50813567ffffffffffffffff81111561061d57600080fd5b60208301915083602082850101111561063557600080fd5b9250929050565b60008060006040848603121561065157600080fd5b833561065c81610579565b9250602084013567ffffffffffffffff81111561067857600080fd5b610684868287016105f3565b9497909650939450505050565b600080602083850312156106a457600080fd5b823567ffffffffffffffff8111156106bb57600080fd5b6106c7858286016105f3565b90969095509350505050565b6000602082840312156106e557600080fd5b815180151581146105ab57600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b038416815260406020820181905260009061074390830184866106f5565b95945050505050565b60008060006060848603121561076157600080fd5b8351925060208401519150604084015190509250925092565b60208152600061078e6020830184866106f5565b94935050505056fea264697066735822122021f66c26bc1cded7ab5457f04d0a74c5257b6aa88e7d69d7f9ad0713ba4679e664736f6c63430008130033", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061009e5760003560e01c8063b688a36311610066578063b688a3631461010e578063bcdd1e1314610116578063d79a824014610129578063ddfdfbb014610157578063f2fde38b1461016a57600080fd5b8063159c5ea1146100a3578063715018a6146100b85780638da5cb5b146100c05780639368a3d3146100ea578063aa15efc8146100fd575b600080fd5b6100b66100b136600461058e565b61017d565b005b6100b66101d9565b6000546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b6100b66100f836600461058e565b6101ed565b6001546001600160a01b03166100cd565b6100b6610257565b6100b66101243660046105b2565b61028c565b61013c61013736600461063c565b61035d565b604080519384526020840192909252908201526060016100e1565b6100b6610165366004610691565b6103e6565b6100b661017836600461058e565b610456565b6101856104cf565b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f2bcd43869347a1d42f97ac6042f3d129817abd05a6125f9750fe3724e321d23e9060200160405180910390a150565b6101e16104cf565b6101eb6000610529565b565b6101f56104cf565b60015460405163fc41168360e01b81526001600160a01b0383811660048301529091169063fc41168390602401600060405180830381600087803b15801561023c57600080fd5b505af1158015610250573d6000803e3d6000fd5b5050505050565b6040513381527f27c2b702d3bff195a18baca2daf00b20a986177c5f1449af4e2d46a3c3e02ce59060200160405180910390a1565b6102946104cf565b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af11580156102e3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061030791906106d3565b6103585760405162461bcd60e51b815260206004820152601c60248201527f417574686f726974793a207769746864726177616c206661696c65640000000060448201526064015b60405180910390fd5b505050565b60015460405163035e6a0960e61b8152600091829182916001600160a01b03169063d79a8240906103969089908990899060040161071e565b606060405180830381865afa1580156103b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103d7919061074c565b92509250925093509350939050565b6103ee6104cf565b600154604051630ddfdfbb60e41b81526001600160a01b039091169063ddfdfbb090610420908590859060040161077a565b600060405180830381600087803b15801561043a57600080fd5b505af115801561044e573d6000803e3d6000fd5b505050505050565b61045e6104cf565b6001600160a01b0381166104c35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161034f565b6104cc81610529565b50565b6000546001600160a01b031633146101eb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161034f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146104cc57600080fd5b6000602082840312156105a057600080fd5b81356105ab81610579565b9392505050565b6000806000606084860312156105c757600080fd5b83356105d281610579565b925060208401356105e281610579565b929592945050506040919091013590565b60008083601f84011261060557600080fd5b50813567ffffffffffffffff81111561061d57600080fd5b60208301915083602082850101111561063557600080fd5b9250929050565b60008060006040848603121561065157600080fd5b833561065c81610579565b9250602084013567ffffffffffffffff81111561067857600080fd5b610684868287016105f3565b9497909650939450505050565b600080602083850312156106a457600080fd5b823567ffffffffffffffff8111156106bb57600080fd5b6106c7858286016105f3565b90969095509350505050565b6000602082840312156106e557600080fd5b815180151581146105ab57600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b038416815260406020820181905260009061074390830184866106f5565b95945050505050565b60008060006060848603121561076157600080fd5b8351925060208401519150604084015190509250925092565b60208152600061078e6020830184866106f5565b94935050505056fea264697066735822122021f66c26bc1cded7ab5457f04d0a74c5257b6aa88e7d69d7f9ad0713ba4679e664736f6c63430008130033", - "devdoc": { - "details": "This contract inherits `AbstractConsensus` and OpenZeppelin's `Ownable` contract. For more information on `Ownable`, please consult OpenZeppelin's official documentation.", - "events": { - "ApplicationJoined(address)": { - "details": "MUST be triggered on a successful call to `join`.", - "params": { - "application": "The application" - } - }, - "ConsensusCreated(address,address)": { - "details": "MUST be triggered during construction.", - "params": { - "inputBox": "The input box from which the authority fetches new inputs", - "owner": "The address that initially owns the `Authority` contract" - } - }, - "NewHistory(address)": { - "details": "MUST be triggered on a successful call to `setHistory`.", - "params": { - "history": "The new history contract" - } - } - }, - "kind": "dev", - "methods": { - "constructor": { - "details": "Emits a `ConsensusCreated` event.", - "params": { - "_inputBox": "The input box contract", - "_owner": "The initial contract owner" - } - }, - "getClaim(address,bytes)": { - "params": { - "_dapp": "The DApp address", - "_proofContext": "Data for retrieving the desired claim" - }, - "returns": { - "_0": "The claimed epoch hash", - "_1": "The index of the first input of the epoch in the input box", - "_2": "The index of the last input of the epoch in the input box" - } - }, - "getHistory()": { - "returns": { - "_0": "The current history contract" - } - }, - "migrateHistoryToConsensus(address)": { - "details": "Can only be called by the `Authority` owner, and the `Authority` contract must have ownership over its current history contract.", - "params": { - "_consensus": "The new owner of the current history contract" - } - }, - "owner()": { - "details": "Returns the address of the current owner." - }, - "renounceOwnership()": { - "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." - }, - "setHistory(address)": { - "details": "Emits a `NewHistory` event. Can only be called by the `Authority` owner.", - "params": { - "_history": "The new history contract" - } - }, - "submitClaim(bytes)": { - "details": "Can only be called by the `Authority` owner, and the `Authority` contract must have ownership over its current history contract.", - "params": { - "_claimData": "Data for submitting a claim" - } - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." - }, - "withdrawERC20Tokens(address,address,uint256)": { - "details": "Can only be called by the `Authority` owner.", - "params": { - "_amount": "The amount of tokens to be withdrawn", - "_recipient": "The recipient address", - "_token": "The token contract" - } - } - }, - "stateVariables": { - "history": { - "details": "See the `getHistory` and `setHistory` functions." - } - }, - "title": "Authority consensus", - "version": 1 - }, - "userdoc": { - "events": { - "ApplicationJoined(address)": { - "notice": "An application has joined the consensus' validation set." - }, - "ConsensusCreated(address,address)": { - "notice": "The `Authority` contract was created." - }, - "NewHistory(address)": { - "notice": "A new history contract is used to store claims." - } - }, - "kind": "user", - "methods": { - "constructor": { - "notice": "Constructs an `Authority` contract." - }, - "getClaim(address,bytes)": { - "notice": "Get a claim from the current history. The encoding of `_proofContext` might vary depending on the implementation of the current history contract." - }, - "getHistory()": { - "notice": "Get the current history contract." - }, - "join()": { - "notice": "Emits an `ApplicationJoined` event with the message sender." - }, - "migrateHistoryToConsensus(address)": { - "notice": "Transfer ownership over the current history contract to `_consensus`." - }, - "setHistory(address)": { - "notice": "Make `Authority` point to another history contract." - }, - "submitClaim(bytes)": { - "notice": "Submits a claim to the current history contract. The encoding of `_claimData` might vary depending on the implementation of the current history contract." - }, - "withdrawERC20Tokens(address,address,uint256)": { - "notice": "Transfer some amount of ERC-20 tokens to a recipient." - } - }, - "notice": "A consensus model controlled by a single address, the owner. Claims are stored in an auxiliary contract called `History`.", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 1155, - "contract": "contracts/consensus/authority/Authority.sol:Authority", - "label": "_owner", - "offset": 0, - "slot": "0", - "type": "t_address" - }, - { - "astId": 2248, - "contract": "contracts/consensus/authority/Authority.sol:Authority", - "label": "history", - "offset": 0, - "slot": "1", - "type": "t_contract(IHistory)3266" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_contract(IHistory)3266": { - "encoding": "inplace", - "label": "contract IHistory", - "numberOfBytes": "20" - } - } - } -} \ No newline at end of file diff --git a/onchain/rollups/deployments/polygon_mumbai/History.json b/onchain/rollups/deployments/polygon_mumbai/History.json deleted file mode 100644 index d3aa376f9..000000000 --- a/onchain/rollups/deployments/polygon_mumbai/History.json +++ /dev/null @@ -1,396 +0,0 @@ -{ - "address": "0xFB34DaDd5f3Aba55004C448AcFd24fAF5A4Ff83E", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_owner", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "dapp", - "type": "address" - }, - { - "components": [ - { - "internalType": "bytes32", - "name": "epochHash", - "type": "bytes32" - }, - { - "internalType": "uint128", - "name": "firstIndex", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "lastIndex", - "type": "uint128" - } - ], - "indexed": false, - "internalType": "struct History.Claim", - "name": "claim", - "type": "tuple" - } - ], - "name": "NewClaimToHistory", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_dapp", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_proofContext", - "type": "bytes" - } - ], - "name": "getClaim", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_consensus", - "type": "address" - } - ], - "name": "migrateToConsensus", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "_claimData", - "type": "bytes" - } - ], - "name": "submitClaim", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0x535b0e41f5b4368219458091237e1051e4a482efd094ae66d005270c28179d76", - "receipt": { - "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", - "from": "0x18930e8a66a1DbE21D00581216789AAB7460Afd0", - "contractAddress": null, - "transactionIndex": 1, - "gasUsed": "494574", - "logsBloom": "0x0000000000000000000000000000000000000000000000000080002000000000000000000000000000000000000000000000800000000010000000000000a000000000000000000000000100000000800001000000000000010100000000000000000000020000000000000000000800000000000000000080000000000000400000000000000000000000000000000000000000001000000000000000000000200000000001000000080000000000000000000000000000000000000000004000000000000000000201000000000100000000000000000000100000000020000000000000000000000000800000000080000000000000000000024000100000", - "blockHash": "0xdfc4f1cf6d47badd83796eccc6993c27a4d34aeb310cdd95183d4328aeb2f613", - "transactionHash": "0x535b0e41f5b4368219458091237e1051e4a482efd094ae66d005270c28179d76", - "logs": [ - { - "transactionIndex": 1, - "blockNumber": 35713221, - "transactionHash": "0x535b0e41f5b4368219458091237e1051e4a482efd094ae66d005270c28179d76", - "address": "0xFB34DaDd5f3Aba55004C448AcFd24fAF5A4Ff83E", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000004e59b44847b379578588920ca78fbf26c0b4956c" - ], - "data": "0x", - "logIndex": 1, - "blockHash": "0xdfc4f1cf6d47badd83796eccc6993c27a4d34aeb310cdd95183d4328aeb2f613" - }, - { - "transactionIndex": 1, - "blockNumber": 35713221, - "transactionHash": "0x535b0e41f5b4368219458091237e1051e4a482efd094ae66d005270c28179d76", - "address": "0xFB34DaDd5f3Aba55004C448AcFd24fAF5A4Ff83E", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000004e59b44847b379578588920ca78fbf26c0b4956c", - "0x00000000000000000000000035ec7d70caff883844d94b54cd19634ffab5d8cc" - ], - "data": "0x", - "logIndex": 2, - "blockHash": "0xdfc4f1cf6d47badd83796eccc6993c27a4d34aeb310cdd95183d4328aeb2f613" - }, - { - "transactionIndex": 1, - "blockNumber": 35713221, - "transactionHash": "0x535b0e41f5b4368219458091237e1051e4a482efd094ae66d005270c28179d76", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x00000000000000000000000018930e8a66a1dbe21d00581216789aab7460afd0", - "0x0000000000000000000000003a22c8bc68e98b0faf40f349dd2b2890fae01484" - ], - "data": "0x000000000000000000000000000000000000000000000000000329a991bddfca00000000000000000000000000000000000000000000000003b2cdcb2ec7162400000000000000000000000000000000000000000000091385c7c128bbce6f7a00000000000000000000000000000000000000000000000003afa4219d09365a00000000000000000000000000000000000000000000091385caead24d8c4f44", - "logIndex": 3, - "blockHash": "0xdfc4f1cf6d47badd83796eccc6993c27a4d34aeb310cdd95183d4328aeb2f613" - } - ], - "blockNumber": 35713221, - "cumulativeGasUsed": "1117877", - "status": 1, - "byzantium": true - }, - "args": [ - "0x35EC7d70cAff883844d94b54cD19634fFAb5d8CC" - ], - "numDeployments": 5, - "solcInputHash": "ccf852a6f03ad282136085842817ac99", - "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dapp\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"epochHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint128\",\"name\":\"firstIndex\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"lastIndex\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"struct History.Claim\",\"name\":\"claim\",\"type\":\"tuple\"}],\"name\":\"NewClaimToHistory\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dapp\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_proofContext\",\"type\":\"bytes\"}],\"name\":\"getClaim\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_consensus\",\"type\":\"address\"}],\"name\":\"migrateToConsensus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_claimData\",\"type\":\"bytes\"}],\"name\":\"submitClaim\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"This contract inherits OpenZeppelin's `Ownable` contract. For more information on `Ownable`, please consult OpenZeppelin's official documentation.\",\"events\":{\"NewClaimToHistory(address,(bytes32,uint128,uint128))\":{\"details\":\"MUST be triggered on a successful call to `submitClaim`.\",\"params\":{\"claim\":\"The newly-submitted claim\",\"dapp\":\"The address of the DApp\"}}},\"kind\":\"dev\",\"methods\":{\"constructor\":{\"params\":{\"_owner\":\"The initial owner\"}},\"getClaim(address,bytes)\":{\"params\":{\"_dapp\":\"The DApp address\",\"_proofContext\":\"Data for retrieving the desired claim\"},\"returns\":{\"_0\":\"The claimed epoch hash\",\"_1\":\"The index of the first input of the epoch in the input box\",\"_2\":\"The index of the last input of the epoch in the input box\"}},\"migrateToConsensus(address)\":{\"details\":\"Emits an `OwnershipTransferred` event. Should have access control.\",\"params\":{\"_consensus\":\"The new consensus\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"submitClaim(bytes)\":{\"details\":\"Emits a `NewClaimToHistory` event. Should have access control.\",\"params\":{\"_claimData\":\"Data for submitting a claim\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"stateVariables\":{\"claims\":{\"details\":\"See the `getClaim` and `submitClaim` functions.\"}},\"title\":\"Simple History\",\"version\":1},\"userdoc\":{\"events\":{\"NewClaimToHistory(address,(bytes32,uint128,uint128))\":{\"notice\":\"A new claim regarding a specific DApp was submitted.\"}},\"kind\":\"user\",\"methods\":{\"constructor\":{\"notice\":\"Creates a `History` contract.\"},\"getClaim(address,bytes)\":{\"notice\":\"Get a specific claim regarding a specific DApp. There are several requirements for this function to be called successfully. * `_proofContext` MUST be well-encoded. In Solidity, it can be constructed as `abi.encode(claimIndex)`, where `claimIndex` is the claim index (type `uint256`). * `claimIndex` MUST be inside the interval `[0, n)` where `n` is the number of claims that have been submitted to `_dapp` already.\"},\"migrateToConsensus(address)\":{\"notice\":\"Transfer ownership to another consensus.\"},\"submitClaim(bytes)\":{\"notice\":\"Submit a claim regarding a DApp. There are several requirements for this function to be called successfully. * `_claimData` MUST be well-encoded. In Solidity, it can be constructed as `abi.encode(dapp, claim)`, where `dapp` is the DApp address (type `address`) and `claim` is the claim structure (type `Claim`). * `firstIndex` MUST be less than or equal to `lastIndex`. As a result, every claim MUST encompass AT LEAST one input. * If this is the DApp's first claim, then `firstIndex` MUST be `0`. Otherwise, `firstIndex` MUST be the `lastClaim.lastIndex + 1`. In other words, claims MUST NOT skip inputs.\"}},\"notice\":\"This contract stores claims for each DApp individually. This means that, for each DApp, the contract stores an array of `Claim` entries, where each `Claim` is composed of: * An epoch hash (`bytes32`) * A closed interval of input indices (`uint128`, `uint128`) The contract guarantees that the first interval starts at index 0, and that the following intervals don't have gaps or overlaps. Furthermore, claims can only be submitted by the contract owner through `submitClaim`, but can be retrieved by anyone with `getClaim`.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/history/History.sol\":\"History\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"contracts/history/History.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\nimport {Ownable} from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\nimport {IHistory} from \\\"./IHistory.sol\\\";\\n\\n/// @title Simple History\\n///\\n/// @notice This contract stores claims for each DApp individually.\\n/// This means that, for each DApp, the contract stores an array of\\n/// `Claim` entries, where each `Claim` is composed of:\\n///\\n/// * An epoch hash (`bytes32`)\\n/// * A closed interval of input indices (`uint128`, `uint128`)\\n///\\n/// The contract guarantees that the first interval starts at index 0,\\n/// and that the following intervals don't have gaps or overlaps.\\n///\\n/// Furthermore, claims can only be submitted by the contract owner\\n/// through `submitClaim`, but can be retrieved by anyone with `getClaim`.\\n///\\n/// @dev This contract inherits OpenZeppelin's `Ownable` contract.\\n/// For more information on `Ownable`, please consult OpenZeppelin's official documentation.\\ncontract History is IHistory, Ownable {\\n struct Claim {\\n bytes32 epochHash;\\n uint128 firstIndex;\\n uint128 lastIndex;\\n }\\n\\n /// @notice Mapping from DApp address to array of claims.\\n /// @dev See the `getClaim` and `submitClaim` functions.\\n mapping(address => Claim[]) internal claims;\\n\\n /// @notice A new claim regarding a specific DApp was submitted.\\n /// @param dapp The address of the DApp\\n /// @param claim The newly-submitted claim\\n /// @dev MUST be triggered on a successful call to `submitClaim`.\\n event NewClaimToHistory(address indexed dapp, Claim claim);\\n\\n /// @notice Creates a `History` contract.\\n /// @param _owner The initial owner\\n constructor(address _owner) {\\n // constructor in Ownable already called `transferOwnership(msg.sender)`, so\\n // we only need to call `transferOwnership(_owner)` if _owner != msg.sender\\n if (_owner != msg.sender) {\\n transferOwnership(_owner);\\n }\\n }\\n\\n /// @notice Submit a claim regarding a DApp.\\n /// There are several requirements for this function to be called successfully.\\n ///\\n /// * `_claimData` MUST be well-encoded. In Solidity, it can be constructed\\n /// as `abi.encode(dapp, claim)`, where `dapp` is the DApp address (type `address`)\\n /// and `claim` is the claim structure (type `Claim`).\\n ///\\n /// * `firstIndex` MUST be less than or equal to `lastIndex`.\\n /// As a result, every claim MUST encompass AT LEAST one input.\\n ///\\n /// * If this is the DApp's first claim, then `firstIndex` MUST be `0`.\\n /// Otherwise, `firstIndex` MUST be the `lastClaim.lastIndex + 1`.\\n /// In other words, claims MUST NOT skip inputs.\\n ///\\n /// @inheritdoc IHistory\\n /// @dev Emits a `NewClaimToHistory` event. Should have access control.\\n function submitClaim(\\n bytes calldata _claimData\\n ) external override onlyOwner {\\n (address dapp, Claim memory claim) = abi.decode(\\n _claimData,\\n (address, Claim)\\n );\\n\\n require(claim.firstIndex <= claim.lastIndex, \\\"History: FI > LI\\\");\\n\\n Claim[] storage dappClaims = claims[dapp];\\n uint256 numDAppClaims = dappClaims.length;\\n\\n require(\\n claim.firstIndex ==\\n (\\n (numDAppClaims == 0)\\n ? 0\\n : (dappClaims[numDAppClaims - 1].lastIndex + 1)\\n ),\\n \\\"History: unclaimed inputs\\\"\\n );\\n\\n dappClaims.push(claim);\\n\\n emit NewClaimToHistory(dapp, claim);\\n }\\n\\n /// @notice Get a specific claim regarding a specific DApp.\\n /// There are several requirements for this function to be called successfully.\\n ///\\n /// * `_proofContext` MUST be well-encoded. In Solidity, it can be constructed\\n /// as `abi.encode(claimIndex)`, where `claimIndex` is the claim index (type `uint256`).\\n ///\\n /// * `claimIndex` MUST be inside the interval `[0, n)` where `n` is the number of claims\\n /// that have been submitted to `_dapp` already.\\n ///\\n /// @inheritdoc IHistory\\n function getClaim(\\n address _dapp,\\n bytes calldata _proofContext\\n ) external view override returns (bytes32, uint256, uint256) {\\n uint256 claimIndex = abi.decode(_proofContext, (uint256));\\n\\n Claim memory claim = claims[_dapp][claimIndex];\\n\\n return (claim.epochHash, claim.firstIndex, claim.lastIndex);\\n }\\n\\n /// @inheritdoc IHistory\\n /// @dev Emits an `OwnershipTransferred` event. Should have access control.\\n function migrateToConsensus(\\n address _consensus\\n ) external override onlyOwner {\\n transferOwnership(_consensus);\\n }\\n}\\n\",\"keccak256\":\"0x607253a9e73d3fe0b98e2c5d7b6f9ee1dad48d7cf4a1284b4f1361d74178da7a\",\"license\":\"Apache-2.0\"},\"contracts/history/IHistory.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\n/// @title History interface\\ninterface IHistory {\\n // Permissioned functions\\n\\n /// @notice Submit a claim.\\n /// The encoding of `_claimData` might vary\\n /// depending on the history implementation.\\n /// @param _claimData Data for submitting a claim\\n /// @dev Should have access control.\\n function submitClaim(bytes calldata _claimData) external;\\n\\n /// @notice Transfer ownership to another consensus.\\n /// @param _consensus The new consensus\\n /// @dev Should have access control.\\n function migrateToConsensus(address _consensus) external;\\n\\n // Permissionless functions\\n\\n /// @notice Get a specific claim regarding a specific DApp.\\n /// The encoding of `_proofContext` might vary\\n /// depending on the history implementation.\\n /// @param _dapp The DApp address\\n /// @param _proofContext Data for retrieving the desired claim\\n /// @return epochHash_ The claimed epoch hash\\n /// @return firstInputIndex_ The index of the first input of the epoch in the input box\\n /// @return lastInputIndex_ The index of the last input of the epoch in the input box\\n function getClaim(\\n address _dapp,\\n bytes calldata _proofContext\\n )\\n external\\n view\\n returns (\\n bytes32 epochHash_,\\n uint256 firstInputIndex_,\\n uint256 lastInputIndex_\\n );\\n}\\n\",\"keccak256\":\"0xfe0404f078a3a6f761beea8afbb2fac322fd2900f7ad2e2b866504c7aa54568f\",\"license\":\"Apache-2.0\"}},\"version\":1}", - "bytecode": "0x608060405234801561001057600080fd5b5060405161091f38038061091f83398101604081905261002f91610181565b61003833610057565b6001600160a01b038116331461005157610051816100a7565b506101b1565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6100af610125565b6001600160a01b0381166101195760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b61012281610057565b50565b6000546001600160a01b0316331461017f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610110565b565b60006020828403121561019357600080fd5b81516001600160a01b03811681146101aa57600080fd5b9392505050565b61075f806101c06000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c8063715018a6146100675780638da5cb5b14610071578063d79a824014610091578063ddfdfbb0146100bf578063f2fde38b146100d2578063fc411683146100e5575b600080fd5b61006f6100f8565b005b6000546040516001600160a01b0390911681526020015b60405180910390f35b6100a461009f36600461052f565b61010c565b60408051938452602084019290925290820152606001610088565b61006f6100cd366004610584565b6101a5565b61006f6100e03660046105c6565b61039d565b61006f6100f33660046105c6565b610416565b610100610427565b61010a6000610481565b565b600080808061011d858701876105ea565b6001600160a01b0388166000908152600160205260408120805492935090918390811061014c5761014c610603565b60009182526020918290206040805160608101825260029390930290910180548084526001909101546001600160801b03808216958501869052600160801b90910416929091018290529a919950975095505050505050565b6101ad610427565b6000806101bc83850185610635565b9150915080604001516001600160801b031681602001516001600160801b031611156102225760405162461bcd60e51b815260206004820152601060248201526f486973746f72793a204649203e204c4960801b60448201526064015b60405180910390fd5b6001600160a01b038216600090815260016020526040902080548015610294578161024e6001836106e9565b8154811061025e5761025e610603565b906000526020600020906002020160010160109054906101000a90046001600160801b0316600161028f9190610702565b610297565b60005b6001600160801b031683602001516001600160801b0316146102fb5760405162461bcd60e51b815260206004820152601960248201527f486973746f72793a20756e636c61696d656420696e70757473000000000000006044820152606401610219565b8154600180820184556000848152602090819020865160029094020183815586820180516040808a0180516001600160801b03938416600160801b9185169190910217949096019390935582519586529051811692850192909252915116908201526001600160a01b038516907fb71880d7a0c514d48c0296b2721b0a4f9641a45117960f2ca86b5b7873c4ab2f9060600160405180910390a2505050505050565b6103a5610427565b6001600160a01b03811661040a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610219565b61041381610481565b50565b61041e610427565b6104138161039d565b6000546001600160a01b0316331461010a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610219565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038116811461041357600080fd5b60008083601f8401126104f857600080fd5b50813567ffffffffffffffff81111561051057600080fd5b60208301915083602082850101111561052857600080fd5b9250929050565b60008060006040848603121561054457600080fd5b833561054f816104d1565b9250602084013567ffffffffffffffff81111561056b57600080fd5b610577868287016104e6565b9497909650939450505050565b6000806020838503121561059757600080fd5b823567ffffffffffffffff8111156105ae57600080fd5b6105ba858286016104e6565b90969095509350505050565b6000602082840312156105d857600080fd5b81356105e3816104d1565b9392505050565b6000602082840312156105fc57600080fd5b5035919050565b634e487b7160e01b600052603260045260246000fd5b80356001600160801b038116811461063057600080fd5b919050565b600080828403608081121561064957600080fd5b8335610654816104d1565b92506060601f198201121561066857600080fd5b506040516060810181811067ffffffffffffffff8211171561069a57634e487b7160e01b600052604160045260246000fd5b8060405250602084013581526106b260408501610619565b60208201526106c360608501610619565b6040820152809150509250929050565b634e487b7160e01b600052601160045260246000fd5b818103818111156106fc576106fc6106d3565b92915050565b6001600160801b03818116838216019080821115610722576107226106d3565b509291505056fea26469706673582212201fc5dfb9d50cb3efefe40c7ced59b7b296f6d072ed8005ef3de36946cd77e28364736f6c63430008130033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100625760003560e01c8063715018a6146100675780638da5cb5b14610071578063d79a824014610091578063ddfdfbb0146100bf578063f2fde38b146100d2578063fc411683146100e5575b600080fd5b61006f6100f8565b005b6000546040516001600160a01b0390911681526020015b60405180910390f35b6100a461009f36600461052f565b61010c565b60408051938452602084019290925290820152606001610088565b61006f6100cd366004610584565b6101a5565b61006f6100e03660046105c6565b61039d565b61006f6100f33660046105c6565b610416565b610100610427565b61010a6000610481565b565b600080808061011d858701876105ea565b6001600160a01b0388166000908152600160205260408120805492935090918390811061014c5761014c610603565b60009182526020918290206040805160608101825260029390930290910180548084526001909101546001600160801b03808216958501869052600160801b90910416929091018290529a919950975095505050505050565b6101ad610427565b6000806101bc83850185610635565b9150915080604001516001600160801b031681602001516001600160801b031611156102225760405162461bcd60e51b815260206004820152601060248201526f486973746f72793a204649203e204c4960801b60448201526064015b60405180910390fd5b6001600160a01b038216600090815260016020526040902080548015610294578161024e6001836106e9565b8154811061025e5761025e610603565b906000526020600020906002020160010160109054906101000a90046001600160801b0316600161028f9190610702565b610297565b60005b6001600160801b031683602001516001600160801b0316146102fb5760405162461bcd60e51b815260206004820152601960248201527f486973746f72793a20756e636c61696d656420696e70757473000000000000006044820152606401610219565b8154600180820184556000848152602090819020865160029094020183815586820180516040808a0180516001600160801b03938416600160801b9185169190910217949096019390935582519586529051811692850192909252915116908201526001600160a01b038516907fb71880d7a0c514d48c0296b2721b0a4f9641a45117960f2ca86b5b7873c4ab2f9060600160405180910390a2505050505050565b6103a5610427565b6001600160a01b03811661040a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610219565b61041381610481565b50565b61041e610427565b6104138161039d565b6000546001600160a01b0316331461010a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610219565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038116811461041357600080fd5b60008083601f8401126104f857600080fd5b50813567ffffffffffffffff81111561051057600080fd5b60208301915083602082850101111561052857600080fd5b9250929050565b60008060006040848603121561054457600080fd5b833561054f816104d1565b9250602084013567ffffffffffffffff81111561056b57600080fd5b610577868287016104e6565b9497909650939450505050565b6000806020838503121561059757600080fd5b823567ffffffffffffffff8111156105ae57600080fd5b6105ba858286016104e6565b90969095509350505050565b6000602082840312156105d857600080fd5b81356105e3816104d1565b9392505050565b6000602082840312156105fc57600080fd5b5035919050565b634e487b7160e01b600052603260045260246000fd5b80356001600160801b038116811461063057600080fd5b919050565b600080828403608081121561064957600080fd5b8335610654816104d1565b92506060601f198201121561066857600080fd5b506040516060810181811067ffffffffffffffff8211171561069a57634e487b7160e01b600052604160045260246000fd5b8060405250602084013581526106b260408501610619565b60208201526106c360608501610619565b6040820152809150509250929050565b634e487b7160e01b600052601160045260246000fd5b818103818111156106fc576106fc6106d3565b92915050565b6001600160801b03818116838216019080821115610722576107226106d3565b509291505056fea26469706673582212201fc5dfb9d50cb3efefe40c7ced59b7b296f6d072ed8005ef3de36946cd77e28364736f6c63430008130033", - "devdoc": { - "details": "This contract inherits OpenZeppelin's `Ownable` contract. For more information on `Ownable`, please consult OpenZeppelin's official documentation.", - "events": { - "NewClaimToHistory(address,(bytes32,uint128,uint128))": { - "details": "MUST be triggered on a successful call to `submitClaim`.", - "params": { - "claim": "The newly-submitted claim", - "dapp": "The address of the DApp" - } - } - }, - "kind": "dev", - "methods": { - "constructor": { - "params": { - "_owner": "The initial owner" - } - }, - "getClaim(address,bytes)": { - "params": { - "_dapp": "The DApp address", - "_proofContext": "Data for retrieving the desired claim" - }, - "returns": { - "_0": "The claimed epoch hash", - "_1": "The index of the first input of the epoch in the input box", - "_2": "The index of the last input of the epoch in the input box" - } - }, - "migrateToConsensus(address)": { - "details": "Emits an `OwnershipTransferred` event. Should have access control.", - "params": { - "_consensus": "The new consensus" - } - }, - "owner()": { - "details": "Returns the address of the current owner." - }, - "renounceOwnership()": { - "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." - }, - "submitClaim(bytes)": { - "details": "Emits a `NewClaimToHistory` event. Should have access control.", - "params": { - "_claimData": "Data for submitting a claim" - } - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." - } - }, - "stateVariables": { - "claims": { - "details": "See the `getClaim` and `submitClaim` functions." - } - }, - "title": "Simple History", - "version": 1 - }, - "userdoc": { - "events": { - "NewClaimToHistory(address,(bytes32,uint128,uint128))": { - "notice": "A new claim regarding a specific DApp was submitted." - } - }, - "kind": "user", - "methods": { - "constructor": { - "notice": "Creates a `History` contract." - }, - "getClaim(address,bytes)": { - "notice": "Get a specific claim regarding a specific DApp. There are several requirements for this function to be called successfully. * `_proofContext` MUST be well-encoded. In Solidity, it can be constructed as `abi.encode(claimIndex)`, where `claimIndex` is the claim index (type `uint256`). * `claimIndex` MUST be inside the interval `[0, n)` where `n` is the number of claims that have been submitted to `_dapp` already." - }, - "migrateToConsensus(address)": { - "notice": "Transfer ownership to another consensus." - }, - "submitClaim(bytes)": { - "notice": "Submit a claim regarding a DApp. There are several requirements for this function to be called successfully. * `_claimData` MUST be well-encoded. In Solidity, it can be constructed as `abi.encode(dapp, claim)`, where `dapp` is the DApp address (type `address`) and `claim` is the claim structure (type `Claim`). * `firstIndex` MUST be less than or equal to `lastIndex`. As a result, every claim MUST encompass AT LEAST one input. * If this is the DApp's first claim, then `firstIndex` MUST be `0`. Otherwise, `firstIndex` MUST be the `lastClaim.lastIndex + 1`. In other words, claims MUST NOT skip inputs." - } - }, - "notice": "This contract stores claims for each DApp individually. This means that, for each DApp, the contract stores an array of `Claim` entries, where each `Claim` is composed of: * An epoch hash (`bytes32`) * A closed interval of input indices (`uint128`, `uint128`) The contract guarantees that the first interval starts at index 0, and that the following intervals don't have gaps or overlaps. Furthermore, claims can only be submitted by the contract owner through `submitClaim`, but can be retrieved by anyone with `getClaim`.", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 1155, - "contract": "contracts/history/History.sol:History", - "label": "_owner", - "offset": 0, - "slot": "0", - "type": "t_address" - }, - { - "astId": 3072, - "contract": "contracts/history/History.sol:History", - "label": "claims", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_address,t_array(t_struct(Claim)3065_storage)dyn_storage)" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_struct(Claim)3065_storage)dyn_storage": { - "base": "t_struct(Claim)3065_storage", - "encoding": "dynamic_array", - "label": "struct History.Claim[]", - "numberOfBytes": "32" - }, - "t_bytes32": { - "encoding": "inplace", - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_array(t_struct(Claim)3065_storage)dyn_storage)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => struct History.Claim[])", - "numberOfBytes": "32", - "value": "t_array(t_struct(Claim)3065_storage)dyn_storage" - }, - "t_struct(Claim)3065_storage": { - "encoding": "inplace", - "label": "struct History.Claim", - "members": [ - { - "astId": 3060, - "contract": "contracts/history/History.sol:History", - "label": "epochHash", - "offset": 0, - "slot": "0", - "type": "t_bytes32" - }, - { - "astId": 3062, - "contract": "contracts/history/History.sol:History", - "label": "firstIndex", - "offset": 0, - "slot": "1", - "type": "t_uint128" - }, - { - "astId": 3064, - "contract": "contracts/history/History.sol:History", - "label": "lastIndex", - "offset": 16, - "slot": "1", - "type": "t_uint128" - } - ], - "numberOfBytes": "64" - }, - "t_uint128": { - "encoding": "inplace", - "label": "uint128", - "numberOfBytes": "16" - } - } - } -} \ No newline at end of file diff --git a/onchain/rollups/deployments/sepolia/Authority.json b/onchain/rollups/deployments/sepolia/Authority.json deleted file mode 100644 index c6809001a..000000000 --- a/onchain/rollups/deployments/sepolia/Authority.json +++ /dev/null @@ -1,466 +0,0 @@ -{ - "address": "0x35EC7d70cAff883844d94b54cD19634fFAb5d8CC", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_owner", - "type": "address" - }, - { - "internalType": "contract IInputBox", - "name": "_inputBox", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "application", - "type": "address" - } - ], - "name": "ApplicationJoined", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": false, - "internalType": "contract IInputBox", - "name": "inputBox", - "type": "address" - } - ], - "name": "ConsensusCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "contract IHistory", - "name": "history", - "type": "address" - } - ], - "name": "NewHistory", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_dapp", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_proofContext", - "type": "bytes" - } - ], - "name": "getClaim", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getHistory", - "outputs": [ - { - "internalType": "contract IHistory", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "join", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_consensus", - "type": "address" - } - ], - "name": "migrateHistoryToConsensus", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IHistory", - "name": "_history", - "type": "address" - } - ], - "name": "setHistory", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "_claimData", - "type": "bytes" - } - ], - "name": "submitClaim", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IERC20", - "name": "_token", - "type": "address" - }, - { - "internalType": "address", - "name": "_recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "withdrawERC20Tokens", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0xcd6bb55d5416035e85bed4e3a6e96559c193a40a21217aaf85f1514ec31e57e4", - "receipt": { - "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", - "from": "0x18930e8a66a1DbE21D00581216789AAB7460Afd0", - "contractAddress": null, - "transactionIndex": 3, - "gasUsed": "521794", - "logsBloom": "0x00000000000000000000000000000000000000000000000000800420000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000000000001000000000000000080000000001000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000020000000000000000000000000000000000080000001000000000000024000000000", - "blockHash": "0xa5b93952d99f057216a718077948d2f3917f4666d07abf03b2ddfbf7dff004dc", - "transactionHash": "0xcd6bb55d5416035e85bed4e3a6e96559c193a40a21217aaf85f1514ec31e57e4", - "logs": [ - { - "transactionIndex": 3, - "blockNumber": 3505362, - "transactionHash": "0xcd6bb55d5416035e85bed4e3a6e96559c193a40a21217aaf85f1514ec31e57e4", - "address": "0x35EC7d70cAff883844d94b54cD19634fFAb5d8CC", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000004e59b44847b379578588920ca78fbf26c0b4956c" - ], - "data": "0x", - "logIndex": 1, - "blockHash": "0xa5b93952d99f057216a718077948d2f3917f4666d07abf03b2ddfbf7dff004dc" - }, - { - "transactionIndex": 3, - "blockNumber": 3505362, - "transactionHash": "0xcd6bb55d5416035e85bed4e3a6e96559c193a40a21217aaf85f1514ec31e57e4", - "address": "0x35EC7d70cAff883844d94b54cD19634fFAb5d8CC", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000004e59b44847b379578588920ca78fbf26c0b4956c", - "0x00000000000000000000000018930e8a66a1dbe21d00581216789aab7460afd0" - ], - "data": "0x", - "logIndex": 2, - "blockHash": "0xa5b93952d99f057216a718077948d2f3917f4666d07abf03b2ddfbf7dff004dc" - }, - { - "transactionIndex": 3, - "blockNumber": 3505362, - "transactionHash": "0xcd6bb55d5416035e85bed4e3a6e96559c193a40a21217aaf85f1514ec31e57e4", - "address": "0x35EC7d70cAff883844d94b54cD19634fFAb5d8CC", - "topics": [ - "0x583f764398dc1f7529b3e4472cb331312f6b6d76744da14476f571a330d36e23" - ], - "data": "0x00000000000000000000000018930e8a66a1dbe21d00581216789aab7460afd00000000000000000000000005a723220579c0dcb8c9253e6b4c62e572e379945", - "logIndex": 3, - "blockHash": "0xa5b93952d99f057216a718077948d2f3917f4666d07abf03b2ddfbf7dff004dc" - } - ], - "blockNumber": 3505362, - "cumulativeGasUsed": "679224", - "status": 1, - "byzantium": true - }, - "args": [ - "0x18930e8a66a1DbE21D00581216789AAB7460Afd0", - "0x5a723220579C0DCb8C9253E6b4c62e572E379945" - ], - "numDeployments": 4, - "solcInputHash": "ccf852a6f03ad282136085842817ac99", - "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"contract IInputBox\",\"name\":\"_inputBox\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"application\",\"type\":\"address\"}],\"name\":\"ApplicationJoined\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"contract IInputBox\",\"name\":\"inputBox\",\"type\":\"address\"}],\"name\":\"ConsensusCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"contract IHistory\",\"name\":\"history\",\"type\":\"address\"}],\"name\":\"NewHistory\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dapp\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_proofContext\",\"type\":\"bytes\"}],\"name\":\"getClaim\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getHistory\",\"outputs\":[{\"internalType\":\"contract IHistory\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"join\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_consensus\",\"type\":\"address\"}],\"name\":\"migrateHistoryToConsensus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IHistory\",\"name\":\"_history\",\"type\":\"address\"}],\"name\":\"setHistory\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_claimData\",\"type\":\"bytes\"}],\"name\":\"submitClaim\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdrawERC20Tokens\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"This contract inherits `AbstractConsensus` and OpenZeppelin's `Ownable` contract. For more information on `Ownable`, please consult OpenZeppelin's official documentation.\",\"events\":{\"ApplicationJoined(address)\":{\"details\":\"MUST be triggered on a successful call to `join`.\",\"params\":{\"application\":\"The application\"}},\"ConsensusCreated(address,address)\":{\"details\":\"MUST be triggered during construction.\",\"params\":{\"inputBox\":\"The input box from which the authority fetches new inputs\",\"owner\":\"The address that initially owns the `Authority` contract\"}},\"NewHistory(address)\":{\"details\":\"MUST be triggered on a successful call to `setHistory`.\",\"params\":{\"history\":\"The new history contract\"}}},\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Emits a `ConsensusCreated` event.\",\"params\":{\"_inputBox\":\"The input box contract\",\"_owner\":\"The initial contract owner\"}},\"getClaim(address,bytes)\":{\"params\":{\"_dapp\":\"The DApp address\",\"_proofContext\":\"Data for retrieving the desired claim\"},\"returns\":{\"_0\":\"The claimed epoch hash\",\"_1\":\"The index of the first input of the epoch in the input box\",\"_2\":\"The index of the last input of the epoch in the input box\"}},\"getHistory()\":{\"returns\":{\"_0\":\"The current history contract\"}},\"migrateHistoryToConsensus(address)\":{\"details\":\"Can only be called by the `Authority` owner, and the `Authority` contract must have ownership over its current history contract.\",\"params\":{\"_consensus\":\"The new owner of the current history contract\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setHistory(address)\":{\"details\":\"Emits a `NewHistory` event. Can only be called by the `Authority` owner.\",\"params\":{\"_history\":\"The new history contract\"}},\"submitClaim(bytes)\":{\"details\":\"Can only be called by the `Authority` owner, and the `Authority` contract must have ownership over its current history contract.\",\"params\":{\"_claimData\":\"Data for submitting a claim\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"withdrawERC20Tokens(address,address,uint256)\":{\"details\":\"Can only be called by the `Authority` owner.\",\"params\":{\"_amount\":\"The amount of tokens to be withdrawn\",\"_recipient\":\"The recipient address\",\"_token\":\"The token contract\"}}},\"stateVariables\":{\"history\":{\"details\":\"See the `getHistory` and `setHistory` functions.\"}},\"title\":\"Authority consensus\",\"version\":1},\"userdoc\":{\"events\":{\"ApplicationJoined(address)\":{\"notice\":\"An application has joined the consensus' validation set.\"},\"ConsensusCreated(address,address)\":{\"notice\":\"The `Authority` contract was created.\"},\"NewHistory(address)\":{\"notice\":\"A new history contract is used to store claims.\"}},\"kind\":\"user\",\"methods\":{\"constructor\":{\"notice\":\"Constructs an `Authority` contract.\"},\"getClaim(address,bytes)\":{\"notice\":\"Get a claim from the current history. The encoding of `_proofContext` might vary depending on the implementation of the current history contract.\"},\"getHistory()\":{\"notice\":\"Get the current history contract.\"},\"join()\":{\"notice\":\"Emits an `ApplicationJoined` event with the message sender.\"},\"migrateHistoryToConsensus(address)\":{\"notice\":\"Transfer ownership over the current history contract to `_consensus`.\"},\"setHistory(address)\":{\"notice\":\"Make `Authority` point to another history contract.\"},\"submitClaim(bytes)\":{\"notice\":\"Submits a claim to the current history contract. The encoding of `_claimData` might vary depending on the implementation of the current history contract.\"},\"withdrawERC20Tokens(address,address,uint256)\":{\"notice\":\"Transfer some amount of ERC-20 tokens to a recipient.\"}},\"notice\":\"A consensus model controlled by a single address, the owner. Claims are stored in an auxiliary contract called `History`.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/consensus/authority/Authority.sol\":\"Authority\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"contracts/consensus/AbstractConsensus.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\nimport {IConsensus} from \\\"./IConsensus.sol\\\";\\n\\n/// @title Abstract Consensus\\n/// @notice An abstract contract that partially implements `IConsensus`.\\nabstract contract AbstractConsensus is IConsensus {\\n /// @notice Emits an `ApplicationJoined` event with the message sender.\\n function join() external override {\\n emit ApplicationJoined(msg.sender);\\n }\\n}\\n\",\"keccak256\":\"0x0483d8a8557c4e345eca5ad31ffea560737b08c75ade0430106136a89d755e13\",\"license\":\"Apache-2.0\"},\"contracts/consensus/IConsensus.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\n/// @title Consensus interface\\n///\\n/// @notice This contract defines a generic interface for consensuses.\\n/// We use the word \\\"consensus\\\" to designate a contract that provides claims\\n/// in the base layer regarding the state of off-chain machines running in\\n/// the execution layer. How this contract is able to reach consensus, who is\\n/// able to submit claims, and how are claims stored in the base layer are\\n/// some of the implementation details left unspecified by this interface.\\n///\\n/// From the point of view of a DApp, these claims are necessary to validate\\n/// on-chain action allowed by the off-chain machine in the form of vouchers\\n/// and notices. Each claim is composed of three parts: an epoch hash, a first\\n/// index, and a last index. We'll explain each of these parts below.\\n///\\n/// First, let us define the word \\\"epoch\\\". For finality reasons, we need to\\n/// divide the stream of inputs being fed into the off-chain machine into\\n/// batches of inputs, which we call \\\"epoches\\\". At the end of every epoch,\\n/// we summarize the state of the off-chain machine in a single hash, called\\n/// \\\"epoch hash\\\". Please note that this interface does not define how this\\n/// stream of inputs is being chopped up into epoches.\\n///\\n/// The other two parts are simply the indices of the first and last inputs\\n/// accepted during the epoch. Logically, the first index MUST BE less than\\n/// or equal to the last index. As a result, every epoch MUST accept at least\\n/// one input. This assumption stems from the fact that the state of a machine\\n/// can only change after an input is fed into it.\\n///\\n/// Examples of possible implementations of this interface include:\\n///\\n/// * An authority consensus, controlled by a single address who has full\\n/// control over epoch boundaries, claim submission, asset management, etc.\\n///\\n/// * A quorum consensus, controlled by a limited set of validators, that\\n/// vote on the state of the machine at the end of every epoch. Also, epoch\\n/// boundaries are determined by the timestamp in the base layer, and assets\\n/// are split equally amongst the validators.\\n///\\n/// * An NxN consensus, which allows anyone to submit and dispute claims\\n/// in the base layer. Epoch boundaries are determined in the same fashion\\n/// as in the quorum example.\\n///\\ninterface IConsensus {\\n /// @notice An application has joined the consensus' validation set.\\n /// @param application The application\\n /// @dev MUST be triggered on a successful call to `join`.\\n event ApplicationJoined(address application);\\n\\n /// @notice Get a specific claim regarding a specific DApp.\\n /// The encoding of `_proofContext` might vary\\n /// depending on the implementation.\\n /// @param _dapp The DApp address\\n /// @param _proofContext Data for retrieving the desired claim\\n /// @return epochHash_ The claimed epoch hash\\n /// @return firstInputIndex_ The index of the first input of the epoch in the input box\\n /// @return lastInputIndex_ The index of the last input of the epoch in the input box\\n function getClaim(\\n address _dapp,\\n bytes calldata _proofContext\\n )\\n external\\n view\\n returns (\\n bytes32 epochHash_,\\n uint256 firstInputIndex_,\\n uint256 lastInputIndex_\\n );\\n\\n /// @notice Signal the consensus that the message sender wants to join its validation set.\\n /// @dev MUST fire an `ApplicationJoined` event with the message sender as argument.\\n function join() external;\\n}\\n\",\"keccak256\":\"0x5d59c8dc3c1483e3173837d679093000077bf175c0b3ad7f02f0ffe611c0a89e\",\"license\":\"Apache-2.0\"},\"contracts/consensus/authority/Authority.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\nimport {Ownable} from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport {IERC20} from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport {IConsensus} from \\\"../IConsensus.sol\\\";\\nimport {AbstractConsensus} from \\\"../AbstractConsensus.sol\\\";\\nimport {IInputBox} from \\\"../../inputs/IInputBox.sol\\\";\\nimport {IHistory} from \\\"../../history/IHistory.sol\\\";\\n\\n/// @title Authority consensus\\n/// @notice A consensus model controlled by a single address, the owner.\\n/// Claims are stored in an auxiliary contract called `History`.\\n/// @dev This contract inherits `AbstractConsensus` and OpenZeppelin's `Ownable` contract.\\n/// For more information on `Ownable`, please consult OpenZeppelin's official documentation.\\ncontract Authority is AbstractConsensus, Ownable {\\n /// @notice The current history contract.\\n /// @dev See the `getHistory` and `setHistory` functions.\\n IHistory internal history;\\n\\n /// @notice The `Authority` contract was created.\\n /// @param owner The address that initially owns the `Authority` contract\\n /// @param inputBox The input box from which the authority fetches new inputs\\n /// @dev MUST be triggered during construction.\\n event ConsensusCreated(address owner, IInputBox inputBox);\\n\\n /// @notice A new history contract is used to store claims.\\n /// @param history The new history contract\\n /// @dev MUST be triggered on a successful call to `setHistory`.\\n event NewHistory(IHistory history);\\n\\n /// @notice Constructs an `Authority` contract.\\n /// @param _owner The initial contract owner\\n /// @param _inputBox The input box contract\\n /// @dev Emits a `ConsensusCreated` event.\\n constructor(address _owner, IInputBox _inputBox) {\\n // constructor in Ownable already called `transferOwnership(msg.sender)`, so\\n // we only need to call `transferOwnership(_owner)` if _owner != msg.sender\\n if (msg.sender != _owner) {\\n transferOwnership(_owner);\\n }\\n emit ConsensusCreated(_owner, _inputBox);\\n }\\n\\n /// @notice Submits a claim to the current history contract.\\n /// The encoding of `_claimData` might vary depending on the\\n /// implementation of the current history contract.\\n /// @param _claimData Data for submitting a claim\\n /// @dev Can only be called by the `Authority` owner,\\n /// and the `Authority` contract must have ownership over\\n /// its current history contract.\\n function submitClaim(bytes calldata _claimData) external onlyOwner {\\n history.submitClaim(_claimData);\\n }\\n\\n /// @notice Transfer ownership over the current history contract to `_consensus`.\\n /// @param _consensus The new owner of the current history contract\\n /// @dev Can only be called by the `Authority` owner,\\n /// and the `Authority` contract must have ownership over\\n /// its current history contract.\\n function migrateHistoryToConsensus(address _consensus) external onlyOwner {\\n history.migrateToConsensus(_consensus);\\n }\\n\\n /// @notice Make `Authority` point to another history contract.\\n /// @param _history The new history contract\\n /// @dev Emits a `NewHistory` event.\\n /// Can only be called by the `Authority` owner.\\n function setHistory(IHistory _history) external onlyOwner {\\n history = _history;\\n emit NewHistory(_history);\\n }\\n\\n /// @notice Get the current history contract.\\n /// @return The current history contract\\n function getHistory() external view returns (IHistory) {\\n return history;\\n }\\n\\n /// @notice Get a claim from the current history.\\n /// The encoding of `_proofContext` might vary depending on the\\n /// implementation of the current history contract.\\n /// @inheritdoc IConsensus\\n function getClaim(\\n address _dapp,\\n bytes calldata _proofContext\\n ) external view override returns (bytes32, uint256, uint256) {\\n return history.getClaim(_dapp, _proofContext);\\n }\\n\\n /// @notice Transfer some amount of ERC-20 tokens to a recipient.\\n /// @param _token The token contract\\n /// @param _recipient The recipient address\\n /// @param _amount The amount of tokens to be withdrawn\\n /// @dev Can only be called by the `Authority` owner.\\n function withdrawERC20Tokens(\\n IERC20 _token,\\n address _recipient,\\n uint256 _amount\\n ) external onlyOwner {\\n require(\\n _token.transfer(_recipient, _amount),\\n \\\"Authority: withdrawal failed\\\"\\n );\\n }\\n}\\n\",\"keccak256\":\"0x0a37f82a0c924deeb8fa5baa6ff0133054037170dadd0032b81f4c93c3ca1c91\",\"license\":\"Apache-2.0\"},\"contracts/history/IHistory.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\n/// @title History interface\\ninterface IHistory {\\n // Permissioned functions\\n\\n /// @notice Submit a claim.\\n /// The encoding of `_claimData` might vary\\n /// depending on the history implementation.\\n /// @param _claimData Data for submitting a claim\\n /// @dev Should have access control.\\n function submitClaim(bytes calldata _claimData) external;\\n\\n /// @notice Transfer ownership to another consensus.\\n /// @param _consensus The new consensus\\n /// @dev Should have access control.\\n function migrateToConsensus(address _consensus) external;\\n\\n // Permissionless functions\\n\\n /// @notice Get a specific claim regarding a specific DApp.\\n /// The encoding of `_proofContext` might vary\\n /// depending on the history implementation.\\n /// @param _dapp The DApp address\\n /// @param _proofContext Data for retrieving the desired claim\\n /// @return epochHash_ The claimed epoch hash\\n /// @return firstInputIndex_ The index of the first input of the epoch in the input box\\n /// @return lastInputIndex_ The index of the last input of the epoch in the input box\\n function getClaim(\\n address _dapp,\\n bytes calldata _proofContext\\n )\\n external\\n view\\n returns (\\n bytes32 epochHash_,\\n uint256 firstInputIndex_,\\n uint256 lastInputIndex_\\n );\\n}\\n\",\"keccak256\":\"0xfe0404f078a3a6f761beea8afbb2fac322fd2900f7ad2e2b866504c7aa54568f\",\"license\":\"Apache-2.0\"},\"contracts/inputs/IInputBox.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\n/// @title Input Box interface\\ninterface IInputBox {\\n /// @notice Emitted when an input is added to a DApp's input box.\\n /// @param dapp The address of the DApp\\n /// @param inboxInputIndex The index of the input in the input box\\n /// @param sender The address that sent the input\\n /// @param input The contents of the input\\n /// @dev MUST be triggered on a successful call to `addInput`.\\n event InputAdded(\\n address indexed dapp,\\n uint256 indexed inboxInputIndex,\\n address sender,\\n bytes input\\n );\\n\\n /// @notice Add an input to a DApp's input box.\\n /// @param _dapp The address of the DApp\\n /// @param _input The contents of the input\\n /// @return The hash of the input plus some extra metadata\\n /// @dev MUST fire an `InputAdded` event accordingly.\\n function addInput(\\n address _dapp,\\n bytes calldata _input\\n ) external returns (bytes32);\\n\\n /// @notice Get the number of inputs in a DApp's input box.\\n /// @param _dapp The address of the DApp\\n /// @return Number of inputs in the DApp's input box\\n function getNumberOfInputs(address _dapp) external view returns (uint256);\\n\\n /// @notice Get the hash of an input in a DApp's input box.\\n /// @param _dapp The address of the DApp\\n /// @param _index The index of the input in the DApp's input box\\n /// @return The hash of the input at the provided index in the DApp's input box\\n /// @dev `_index` MUST be in the interval `[0,n)` where `n` is the number of\\n /// inputs in the DApp's input box. See the `getNumberOfInputs` function.\\n function getInputHash(\\n address _dapp,\\n uint256 _index\\n ) external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x2addd467a24cde2131784103080aeb28df40d87ba19c5fd92bf96c0c074603df\",\"license\":\"Apache-2.0\"}},\"version\":1}", - "bytecode": "0x608060405234801561001057600080fd5b506040516109ef3803806109ef83398101604081905261002f916101da565b6100383361009b565b336001600160a01b0383161461005157610051826100eb565b604080516001600160a01b038085168252831660208201527f583f764398dc1f7529b3e4472cb331312f6b6d76744da14476f571a330d36e23910160405180910390a15050610214565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6100f3610169565b6001600160a01b03811661015d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b6101668161009b565b50565b6000546001600160a01b031633146101c35760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610154565b565b6001600160a01b038116811461016657600080fd5b600080604083850312156101ed57600080fd5b82516101f8816101c5565b6020840151909250610209816101c5565b809150509250929050565b6107cc806102236000396000f3fe608060405234801561001057600080fd5b506004361061009e5760003560e01c8063b688a36311610066578063b688a3631461010e578063bcdd1e1314610116578063d79a824014610129578063ddfdfbb014610157578063f2fde38b1461016a57600080fd5b8063159c5ea1146100a3578063715018a6146100b85780638da5cb5b146100c05780639368a3d3146100ea578063aa15efc8146100fd575b600080fd5b6100b66100b136600461058e565b61017d565b005b6100b66101d9565b6000546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b6100b66100f836600461058e565b6101ed565b6001546001600160a01b03166100cd565b6100b6610257565b6100b66101243660046105b2565b61028c565b61013c61013736600461063c565b61035d565b604080519384526020840192909252908201526060016100e1565b6100b6610165366004610691565b6103e6565b6100b661017836600461058e565b610456565b6101856104cf565b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f2bcd43869347a1d42f97ac6042f3d129817abd05a6125f9750fe3724e321d23e9060200160405180910390a150565b6101e16104cf565b6101eb6000610529565b565b6101f56104cf565b60015460405163fc41168360e01b81526001600160a01b0383811660048301529091169063fc41168390602401600060405180830381600087803b15801561023c57600080fd5b505af1158015610250573d6000803e3d6000fd5b5050505050565b6040513381527f27c2b702d3bff195a18baca2daf00b20a986177c5f1449af4e2d46a3c3e02ce59060200160405180910390a1565b6102946104cf565b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af11580156102e3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061030791906106d3565b6103585760405162461bcd60e51b815260206004820152601c60248201527f417574686f726974793a207769746864726177616c206661696c65640000000060448201526064015b60405180910390fd5b505050565b60015460405163035e6a0960e61b8152600091829182916001600160a01b03169063d79a8240906103969089908990899060040161071e565b606060405180830381865afa1580156103b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103d7919061074c565b92509250925093509350939050565b6103ee6104cf565b600154604051630ddfdfbb60e41b81526001600160a01b039091169063ddfdfbb090610420908590859060040161077a565b600060405180830381600087803b15801561043a57600080fd5b505af115801561044e573d6000803e3d6000fd5b505050505050565b61045e6104cf565b6001600160a01b0381166104c35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161034f565b6104cc81610529565b50565b6000546001600160a01b031633146101eb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161034f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146104cc57600080fd5b6000602082840312156105a057600080fd5b81356105ab81610579565b9392505050565b6000806000606084860312156105c757600080fd5b83356105d281610579565b925060208401356105e281610579565b929592945050506040919091013590565b60008083601f84011261060557600080fd5b50813567ffffffffffffffff81111561061d57600080fd5b60208301915083602082850101111561063557600080fd5b9250929050565b60008060006040848603121561065157600080fd5b833561065c81610579565b9250602084013567ffffffffffffffff81111561067857600080fd5b610684868287016105f3565b9497909650939450505050565b600080602083850312156106a457600080fd5b823567ffffffffffffffff8111156106bb57600080fd5b6106c7858286016105f3565b90969095509350505050565b6000602082840312156106e557600080fd5b815180151581146105ab57600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b038416815260406020820181905260009061074390830184866106f5565b95945050505050565b60008060006060848603121561076157600080fd5b8351925060208401519150604084015190509250925092565b60208152600061078e6020830184866106f5565b94935050505056fea264697066735822122021f66c26bc1cded7ab5457f04d0a74c5257b6aa88e7d69d7f9ad0713ba4679e664736f6c63430008130033", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061009e5760003560e01c8063b688a36311610066578063b688a3631461010e578063bcdd1e1314610116578063d79a824014610129578063ddfdfbb014610157578063f2fde38b1461016a57600080fd5b8063159c5ea1146100a3578063715018a6146100b85780638da5cb5b146100c05780639368a3d3146100ea578063aa15efc8146100fd575b600080fd5b6100b66100b136600461058e565b61017d565b005b6100b66101d9565b6000546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b6100b66100f836600461058e565b6101ed565b6001546001600160a01b03166100cd565b6100b6610257565b6100b66101243660046105b2565b61028c565b61013c61013736600461063c565b61035d565b604080519384526020840192909252908201526060016100e1565b6100b6610165366004610691565b6103e6565b6100b661017836600461058e565b610456565b6101856104cf565b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f2bcd43869347a1d42f97ac6042f3d129817abd05a6125f9750fe3724e321d23e9060200160405180910390a150565b6101e16104cf565b6101eb6000610529565b565b6101f56104cf565b60015460405163fc41168360e01b81526001600160a01b0383811660048301529091169063fc41168390602401600060405180830381600087803b15801561023c57600080fd5b505af1158015610250573d6000803e3d6000fd5b5050505050565b6040513381527f27c2b702d3bff195a18baca2daf00b20a986177c5f1449af4e2d46a3c3e02ce59060200160405180910390a1565b6102946104cf565b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af11580156102e3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061030791906106d3565b6103585760405162461bcd60e51b815260206004820152601c60248201527f417574686f726974793a207769746864726177616c206661696c65640000000060448201526064015b60405180910390fd5b505050565b60015460405163035e6a0960e61b8152600091829182916001600160a01b03169063d79a8240906103969089908990899060040161071e565b606060405180830381865afa1580156103b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103d7919061074c565b92509250925093509350939050565b6103ee6104cf565b600154604051630ddfdfbb60e41b81526001600160a01b039091169063ddfdfbb090610420908590859060040161077a565b600060405180830381600087803b15801561043a57600080fd5b505af115801561044e573d6000803e3d6000fd5b505050505050565b61045e6104cf565b6001600160a01b0381166104c35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161034f565b6104cc81610529565b50565b6000546001600160a01b031633146101eb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161034f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146104cc57600080fd5b6000602082840312156105a057600080fd5b81356105ab81610579565b9392505050565b6000806000606084860312156105c757600080fd5b83356105d281610579565b925060208401356105e281610579565b929592945050506040919091013590565b60008083601f84011261060557600080fd5b50813567ffffffffffffffff81111561061d57600080fd5b60208301915083602082850101111561063557600080fd5b9250929050565b60008060006040848603121561065157600080fd5b833561065c81610579565b9250602084013567ffffffffffffffff81111561067857600080fd5b610684868287016105f3565b9497909650939450505050565b600080602083850312156106a457600080fd5b823567ffffffffffffffff8111156106bb57600080fd5b6106c7858286016105f3565b90969095509350505050565b6000602082840312156106e557600080fd5b815180151581146105ab57600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b038416815260406020820181905260009061074390830184866106f5565b95945050505050565b60008060006060848603121561076157600080fd5b8351925060208401519150604084015190509250925092565b60208152600061078e6020830184866106f5565b94935050505056fea264697066735822122021f66c26bc1cded7ab5457f04d0a74c5257b6aa88e7d69d7f9ad0713ba4679e664736f6c63430008130033", - "devdoc": { - "details": "This contract inherits `AbstractConsensus` and OpenZeppelin's `Ownable` contract. For more information on `Ownable`, please consult OpenZeppelin's official documentation.", - "events": { - "ApplicationJoined(address)": { - "details": "MUST be triggered on a successful call to `join`.", - "params": { - "application": "The application" - } - }, - "ConsensusCreated(address,address)": { - "details": "MUST be triggered during construction.", - "params": { - "inputBox": "The input box from which the authority fetches new inputs", - "owner": "The address that initially owns the `Authority` contract" - } - }, - "NewHistory(address)": { - "details": "MUST be triggered on a successful call to `setHistory`.", - "params": { - "history": "The new history contract" - } - } - }, - "kind": "dev", - "methods": { - "constructor": { - "details": "Emits a `ConsensusCreated` event.", - "params": { - "_inputBox": "The input box contract", - "_owner": "The initial contract owner" - } - }, - "getClaim(address,bytes)": { - "params": { - "_dapp": "The DApp address", - "_proofContext": "Data for retrieving the desired claim" - }, - "returns": { - "_0": "The claimed epoch hash", - "_1": "The index of the first input of the epoch in the input box", - "_2": "The index of the last input of the epoch in the input box" - } - }, - "getHistory()": { - "returns": { - "_0": "The current history contract" - } - }, - "migrateHistoryToConsensus(address)": { - "details": "Can only be called by the `Authority` owner, and the `Authority` contract must have ownership over its current history contract.", - "params": { - "_consensus": "The new owner of the current history contract" - } - }, - "owner()": { - "details": "Returns the address of the current owner." - }, - "renounceOwnership()": { - "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." - }, - "setHistory(address)": { - "details": "Emits a `NewHistory` event. Can only be called by the `Authority` owner.", - "params": { - "_history": "The new history contract" - } - }, - "submitClaim(bytes)": { - "details": "Can only be called by the `Authority` owner, and the `Authority` contract must have ownership over its current history contract.", - "params": { - "_claimData": "Data for submitting a claim" - } - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." - }, - "withdrawERC20Tokens(address,address,uint256)": { - "details": "Can only be called by the `Authority` owner.", - "params": { - "_amount": "The amount of tokens to be withdrawn", - "_recipient": "The recipient address", - "_token": "The token contract" - } - } - }, - "stateVariables": { - "history": { - "details": "See the `getHistory` and `setHistory` functions." - } - }, - "title": "Authority consensus", - "version": 1 - }, - "userdoc": { - "events": { - "ApplicationJoined(address)": { - "notice": "An application has joined the consensus' validation set." - }, - "ConsensusCreated(address,address)": { - "notice": "The `Authority` contract was created." - }, - "NewHistory(address)": { - "notice": "A new history contract is used to store claims." - } - }, - "kind": "user", - "methods": { - "constructor": { - "notice": "Constructs an `Authority` contract." - }, - "getClaim(address,bytes)": { - "notice": "Get a claim from the current history. The encoding of `_proofContext` might vary depending on the implementation of the current history contract." - }, - "getHistory()": { - "notice": "Get the current history contract." - }, - "join()": { - "notice": "Emits an `ApplicationJoined` event with the message sender." - }, - "migrateHistoryToConsensus(address)": { - "notice": "Transfer ownership over the current history contract to `_consensus`." - }, - "setHistory(address)": { - "notice": "Make `Authority` point to another history contract." - }, - "submitClaim(bytes)": { - "notice": "Submits a claim to the current history contract. The encoding of `_claimData` might vary depending on the implementation of the current history contract." - }, - "withdrawERC20Tokens(address,address,uint256)": { - "notice": "Transfer some amount of ERC-20 tokens to a recipient." - } - }, - "notice": "A consensus model controlled by a single address, the owner. Claims are stored in an auxiliary contract called `History`.", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 1155, - "contract": "contracts/consensus/authority/Authority.sol:Authority", - "label": "_owner", - "offset": 0, - "slot": "0", - "type": "t_address" - }, - { - "astId": 2248, - "contract": "contracts/consensus/authority/Authority.sol:Authority", - "label": "history", - "offset": 0, - "slot": "1", - "type": "t_contract(IHistory)3266" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_contract(IHistory)3266": { - "encoding": "inplace", - "label": "contract IHistory", - "numberOfBytes": "20" - } - } - } -} \ No newline at end of file diff --git a/onchain/rollups/deployments/sepolia/History.json b/onchain/rollups/deployments/sepolia/History.json deleted file mode 100644 index d44dbdbbc..000000000 --- a/onchain/rollups/deployments/sepolia/History.json +++ /dev/null @@ -1,381 +0,0 @@ -{ - "address": "0xFB34DaDd5f3Aba55004C448AcFd24fAF5A4Ff83E", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_owner", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "dapp", - "type": "address" - }, - { - "components": [ - { - "internalType": "bytes32", - "name": "epochHash", - "type": "bytes32" - }, - { - "internalType": "uint128", - "name": "firstIndex", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "lastIndex", - "type": "uint128" - } - ], - "indexed": false, - "internalType": "struct History.Claim", - "name": "claim", - "type": "tuple" - } - ], - "name": "NewClaimToHistory", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_dapp", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_proofContext", - "type": "bytes" - } - ], - "name": "getClaim", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_consensus", - "type": "address" - } - ], - "name": "migrateToConsensus", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "_claimData", - "type": "bytes" - } - ], - "name": "submitClaim", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0x99c47a808152cd8b6a1980609a1e7ca0a9ae4d55a5e799434de8279585d34959", - "receipt": { - "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", - "from": "0x18930e8a66a1DbE21D00581216789AAB7460Afd0", - "contractAddress": null, - "transactionIndex": 14, - "gasUsed": "494722", - "logsBloom": "0x00000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000100000000000002000000000000000000000000100000000000001000000000000010000000000000000000000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000000000001000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000020000000000000000000000000800000000080000000000000000000000000000000", - "blockHash": "0xd21d4c565626c34e15d634de14b35140ea93a0a0ce1bf2b757c73d085300bdbc", - "transactionHash": "0x99c47a808152cd8b6a1980609a1e7ca0a9ae4d55a5e799434de8279585d34959", - "logs": [ - { - "transactionIndex": 14, - "blockNumber": 3505363, - "transactionHash": "0x99c47a808152cd8b6a1980609a1e7ca0a9ae4d55a5e799434de8279585d34959", - "address": "0xFB34DaDd5f3Aba55004C448AcFd24fAF5A4Ff83E", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000004e59b44847b379578588920ca78fbf26c0b4956c" - ], - "data": "0x", - "logIndex": 23, - "blockHash": "0xd21d4c565626c34e15d634de14b35140ea93a0a0ce1bf2b757c73d085300bdbc" - }, - { - "transactionIndex": 14, - "blockNumber": 3505363, - "transactionHash": "0x99c47a808152cd8b6a1980609a1e7ca0a9ae4d55a5e799434de8279585d34959", - "address": "0xFB34DaDd5f3Aba55004C448AcFd24fAF5A4Ff83E", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000004e59b44847b379578588920ca78fbf26c0b4956c", - "0x00000000000000000000000035ec7d70caff883844d94b54cd19634ffab5d8cc" - ], - "data": "0x", - "logIndex": 24, - "blockHash": "0xd21d4c565626c34e15d634de14b35140ea93a0a0ce1bf2b757c73d085300bdbc" - } - ], - "blockNumber": 3505363, - "cumulativeGasUsed": "1775325", - "status": 1, - "byzantium": true - }, - "args": [ - "0x35EC7d70cAff883844d94b54cD19634fFAb5d8CC" - ], - "numDeployments": 4, - "solcInputHash": "ccf852a6f03ad282136085842817ac99", - "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dapp\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"epochHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint128\",\"name\":\"firstIndex\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"lastIndex\",\"type\":\"uint128\"}],\"indexed\":false,\"internalType\":\"struct History.Claim\",\"name\":\"claim\",\"type\":\"tuple\"}],\"name\":\"NewClaimToHistory\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dapp\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_proofContext\",\"type\":\"bytes\"}],\"name\":\"getClaim\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_consensus\",\"type\":\"address\"}],\"name\":\"migrateToConsensus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_claimData\",\"type\":\"bytes\"}],\"name\":\"submitClaim\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"This contract inherits OpenZeppelin's `Ownable` contract. For more information on `Ownable`, please consult OpenZeppelin's official documentation.\",\"events\":{\"NewClaimToHistory(address,(bytes32,uint128,uint128))\":{\"details\":\"MUST be triggered on a successful call to `submitClaim`.\",\"params\":{\"claim\":\"The newly-submitted claim\",\"dapp\":\"The address of the DApp\"}}},\"kind\":\"dev\",\"methods\":{\"constructor\":{\"params\":{\"_owner\":\"The initial owner\"}},\"getClaim(address,bytes)\":{\"params\":{\"_dapp\":\"The DApp address\",\"_proofContext\":\"Data for retrieving the desired claim\"},\"returns\":{\"_0\":\"The claimed epoch hash\",\"_1\":\"The index of the first input of the epoch in the input box\",\"_2\":\"The index of the last input of the epoch in the input box\"}},\"migrateToConsensus(address)\":{\"details\":\"Emits an `OwnershipTransferred` event. Should have access control.\",\"params\":{\"_consensus\":\"The new consensus\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"submitClaim(bytes)\":{\"details\":\"Emits a `NewClaimToHistory` event. Should have access control.\",\"params\":{\"_claimData\":\"Data for submitting a claim\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"stateVariables\":{\"claims\":{\"details\":\"See the `getClaim` and `submitClaim` functions.\"}},\"title\":\"Simple History\",\"version\":1},\"userdoc\":{\"events\":{\"NewClaimToHistory(address,(bytes32,uint128,uint128))\":{\"notice\":\"A new claim regarding a specific DApp was submitted.\"}},\"kind\":\"user\",\"methods\":{\"constructor\":{\"notice\":\"Creates a `History` contract.\"},\"getClaim(address,bytes)\":{\"notice\":\"Get a specific claim regarding a specific DApp. There are several requirements for this function to be called successfully. * `_proofContext` MUST be well-encoded. In Solidity, it can be constructed as `abi.encode(claimIndex)`, where `claimIndex` is the claim index (type `uint256`). * `claimIndex` MUST be inside the interval `[0, n)` where `n` is the number of claims that have been submitted to `_dapp` already.\"},\"migrateToConsensus(address)\":{\"notice\":\"Transfer ownership to another consensus.\"},\"submitClaim(bytes)\":{\"notice\":\"Submit a claim regarding a DApp. There are several requirements for this function to be called successfully. * `_claimData` MUST be well-encoded. In Solidity, it can be constructed as `abi.encode(dapp, claim)`, where `dapp` is the DApp address (type `address`) and `claim` is the claim structure (type `Claim`). * `firstIndex` MUST be less than or equal to `lastIndex`. As a result, every claim MUST encompass AT LEAST one input. * If this is the DApp's first claim, then `firstIndex` MUST be `0`. Otherwise, `firstIndex` MUST be the `lastClaim.lastIndex + 1`. In other words, claims MUST NOT skip inputs.\"}},\"notice\":\"This contract stores claims for each DApp individually. This means that, for each DApp, the contract stores an array of `Claim` entries, where each `Claim` is composed of: * An epoch hash (`bytes32`) * A closed interval of input indices (`uint128`, `uint128`) The contract guarantees that the first interval starts at index 0, and that the following intervals don't have gaps or overlaps. Furthermore, claims can only be submitted by the contract owner through `submitClaim`, but can be retrieved by anyone with `getClaim`.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/history/History.sol\":\"History\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"contracts/history/History.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\nimport {Ownable} from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\nimport {IHistory} from \\\"./IHistory.sol\\\";\\n\\n/// @title Simple History\\n///\\n/// @notice This contract stores claims for each DApp individually.\\n/// This means that, for each DApp, the contract stores an array of\\n/// `Claim` entries, where each `Claim` is composed of:\\n///\\n/// * An epoch hash (`bytes32`)\\n/// * A closed interval of input indices (`uint128`, `uint128`)\\n///\\n/// The contract guarantees that the first interval starts at index 0,\\n/// and that the following intervals don't have gaps or overlaps.\\n///\\n/// Furthermore, claims can only be submitted by the contract owner\\n/// through `submitClaim`, but can be retrieved by anyone with `getClaim`.\\n///\\n/// @dev This contract inherits OpenZeppelin's `Ownable` contract.\\n/// For more information on `Ownable`, please consult OpenZeppelin's official documentation.\\ncontract History is IHistory, Ownable {\\n struct Claim {\\n bytes32 epochHash;\\n uint128 firstIndex;\\n uint128 lastIndex;\\n }\\n\\n /// @notice Mapping from DApp address to array of claims.\\n /// @dev See the `getClaim` and `submitClaim` functions.\\n mapping(address => Claim[]) internal claims;\\n\\n /// @notice A new claim regarding a specific DApp was submitted.\\n /// @param dapp The address of the DApp\\n /// @param claim The newly-submitted claim\\n /// @dev MUST be triggered on a successful call to `submitClaim`.\\n event NewClaimToHistory(address indexed dapp, Claim claim);\\n\\n /// @notice Creates a `History` contract.\\n /// @param _owner The initial owner\\n constructor(address _owner) {\\n // constructor in Ownable already called `transferOwnership(msg.sender)`, so\\n // we only need to call `transferOwnership(_owner)` if _owner != msg.sender\\n if (_owner != msg.sender) {\\n transferOwnership(_owner);\\n }\\n }\\n\\n /// @notice Submit a claim regarding a DApp.\\n /// There are several requirements for this function to be called successfully.\\n ///\\n /// * `_claimData` MUST be well-encoded. In Solidity, it can be constructed\\n /// as `abi.encode(dapp, claim)`, where `dapp` is the DApp address (type `address`)\\n /// and `claim` is the claim structure (type `Claim`).\\n ///\\n /// * `firstIndex` MUST be less than or equal to `lastIndex`.\\n /// As a result, every claim MUST encompass AT LEAST one input.\\n ///\\n /// * If this is the DApp's first claim, then `firstIndex` MUST be `0`.\\n /// Otherwise, `firstIndex` MUST be the `lastClaim.lastIndex + 1`.\\n /// In other words, claims MUST NOT skip inputs.\\n ///\\n /// @inheritdoc IHistory\\n /// @dev Emits a `NewClaimToHistory` event. Should have access control.\\n function submitClaim(\\n bytes calldata _claimData\\n ) external override onlyOwner {\\n (address dapp, Claim memory claim) = abi.decode(\\n _claimData,\\n (address, Claim)\\n );\\n\\n require(claim.firstIndex <= claim.lastIndex, \\\"History: FI > LI\\\");\\n\\n Claim[] storage dappClaims = claims[dapp];\\n uint256 numDAppClaims = dappClaims.length;\\n\\n require(\\n claim.firstIndex ==\\n (\\n (numDAppClaims == 0)\\n ? 0\\n : (dappClaims[numDAppClaims - 1].lastIndex + 1)\\n ),\\n \\\"History: unclaimed inputs\\\"\\n );\\n\\n dappClaims.push(claim);\\n\\n emit NewClaimToHistory(dapp, claim);\\n }\\n\\n /// @notice Get a specific claim regarding a specific DApp.\\n /// There are several requirements for this function to be called successfully.\\n ///\\n /// * `_proofContext` MUST be well-encoded. In Solidity, it can be constructed\\n /// as `abi.encode(claimIndex)`, where `claimIndex` is the claim index (type `uint256`).\\n ///\\n /// * `claimIndex` MUST be inside the interval `[0, n)` where `n` is the number of claims\\n /// that have been submitted to `_dapp` already.\\n ///\\n /// @inheritdoc IHistory\\n function getClaim(\\n address _dapp,\\n bytes calldata _proofContext\\n ) external view override returns (bytes32, uint256, uint256) {\\n uint256 claimIndex = abi.decode(_proofContext, (uint256));\\n\\n Claim memory claim = claims[_dapp][claimIndex];\\n\\n return (claim.epochHash, claim.firstIndex, claim.lastIndex);\\n }\\n\\n /// @inheritdoc IHistory\\n /// @dev Emits an `OwnershipTransferred` event. Should have access control.\\n function migrateToConsensus(\\n address _consensus\\n ) external override onlyOwner {\\n transferOwnership(_consensus);\\n }\\n}\\n\",\"keccak256\":\"0x607253a9e73d3fe0b98e2c5d7b6f9ee1dad48d7cf4a1284b4f1361d74178da7a\",\"license\":\"Apache-2.0\"},\"contracts/history/IHistory.sol\":{\"content\":\"// Copyright Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.8;\\n\\n/// @title History interface\\ninterface IHistory {\\n // Permissioned functions\\n\\n /// @notice Submit a claim.\\n /// The encoding of `_claimData` might vary\\n /// depending on the history implementation.\\n /// @param _claimData Data for submitting a claim\\n /// @dev Should have access control.\\n function submitClaim(bytes calldata _claimData) external;\\n\\n /// @notice Transfer ownership to another consensus.\\n /// @param _consensus The new consensus\\n /// @dev Should have access control.\\n function migrateToConsensus(address _consensus) external;\\n\\n // Permissionless functions\\n\\n /// @notice Get a specific claim regarding a specific DApp.\\n /// The encoding of `_proofContext` might vary\\n /// depending on the history implementation.\\n /// @param _dapp The DApp address\\n /// @param _proofContext Data for retrieving the desired claim\\n /// @return epochHash_ The claimed epoch hash\\n /// @return firstInputIndex_ The index of the first input of the epoch in the input box\\n /// @return lastInputIndex_ The index of the last input of the epoch in the input box\\n function getClaim(\\n address _dapp,\\n bytes calldata _proofContext\\n )\\n external\\n view\\n returns (\\n bytes32 epochHash_,\\n uint256 firstInputIndex_,\\n uint256 lastInputIndex_\\n );\\n}\\n\",\"keccak256\":\"0xfe0404f078a3a6f761beea8afbb2fac322fd2900f7ad2e2b866504c7aa54568f\",\"license\":\"Apache-2.0\"}},\"version\":1}", - "bytecode": "0x608060405234801561001057600080fd5b5060405161091f38038061091f83398101604081905261002f91610181565b61003833610057565b6001600160a01b038116331461005157610051816100a7565b506101b1565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6100af610125565b6001600160a01b0381166101195760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b61012281610057565b50565b6000546001600160a01b0316331461017f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610110565b565b60006020828403121561019357600080fd5b81516001600160a01b03811681146101aa57600080fd5b9392505050565b61075f806101c06000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c8063715018a6146100675780638da5cb5b14610071578063d79a824014610091578063ddfdfbb0146100bf578063f2fde38b146100d2578063fc411683146100e5575b600080fd5b61006f6100f8565b005b6000546040516001600160a01b0390911681526020015b60405180910390f35b6100a461009f36600461052f565b61010c565b60408051938452602084019290925290820152606001610088565b61006f6100cd366004610584565b6101a5565b61006f6100e03660046105c6565b61039d565b61006f6100f33660046105c6565b610416565b610100610427565b61010a6000610481565b565b600080808061011d858701876105ea565b6001600160a01b0388166000908152600160205260408120805492935090918390811061014c5761014c610603565b60009182526020918290206040805160608101825260029390930290910180548084526001909101546001600160801b03808216958501869052600160801b90910416929091018290529a919950975095505050505050565b6101ad610427565b6000806101bc83850185610635565b9150915080604001516001600160801b031681602001516001600160801b031611156102225760405162461bcd60e51b815260206004820152601060248201526f486973746f72793a204649203e204c4960801b60448201526064015b60405180910390fd5b6001600160a01b038216600090815260016020526040902080548015610294578161024e6001836106e9565b8154811061025e5761025e610603565b906000526020600020906002020160010160109054906101000a90046001600160801b0316600161028f9190610702565b610297565b60005b6001600160801b031683602001516001600160801b0316146102fb5760405162461bcd60e51b815260206004820152601960248201527f486973746f72793a20756e636c61696d656420696e70757473000000000000006044820152606401610219565b8154600180820184556000848152602090819020865160029094020183815586820180516040808a0180516001600160801b03938416600160801b9185169190910217949096019390935582519586529051811692850192909252915116908201526001600160a01b038516907fb71880d7a0c514d48c0296b2721b0a4f9641a45117960f2ca86b5b7873c4ab2f9060600160405180910390a2505050505050565b6103a5610427565b6001600160a01b03811661040a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610219565b61041381610481565b50565b61041e610427565b6104138161039d565b6000546001600160a01b0316331461010a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610219565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038116811461041357600080fd5b60008083601f8401126104f857600080fd5b50813567ffffffffffffffff81111561051057600080fd5b60208301915083602082850101111561052857600080fd5b9250929050565b60008060006040848603121561054457600080fd5b833561054f816104d1565b9250602084013567ffffffffffffffff81111561056b57600080fd5b610577868287016104e6565b9497909650939450505050565b6000806020838503121561059757600080fd5b823567ffffffffffffffff8111156105ae57600080fd5b6105ba858286016104e6565b90969095509350505050565b6000602082840312156105d857600080fd5b81356105e3816104d1565b9392505050565b6000602082840312156105fc57600080fd5b5035919050565b634e487b7160e01b600052603260045260246000fd5b80356001600160801b038116811461063057600080fd5b919050565b600080828403608081121561064957600080fd5b8335610654816104d1565b92506060601f198201121561066857600080fd5b506040516060810181811067ffffffffffffffff8211171561069a57634e487b7160e01b600052604160045260246000fd5b8060405250602084013581526106b260408501610619565b60208201526106c360608501610619565b6040820152809150509250929050565b634e487b7160e01b600052601160045260246000fd5b818103818111156106fc576106fc6106d3565b92915050565b6001600160801b03818116838216019080821115610722576107226106d3565b509291505056fea26469706673582212201fc5dfb9d50cb3efefe40c7ced59b7b296f6d072ed8005ef3de36946cd77e28364736f6c63430008130033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100625760003560e01c8063715018a6146100675780638da5cb5b14610071578063d79a824014610091578063ddfdfbb0146100bf578063f2fde38b146100d2578063fc411683146100e5575b600080fd5b61006f6100f8565b005b6000546040516001600160a01b0390911681526020015b60405180910390f35b6100a461009f36600461052f565b61010c565b60408051938452602084019290925290820152606001610088565b61006f6100cd366004610584565b6101a5565b61006f6100e03660046105c6565b61039d565b61006f6100f33660046105c6565b610416565b610100610427565b61010a6000610481565b565b600080808061011d858701876105ea565b6001600160a01b0388166000908152600160205260408120805492935090918390811061014c5761014c610603565b60009182526020918290206040805160608101825260029390930290910180548084526001909101546001600160801b03808216958501869052600160801b90910416929091018290529a919950975095505050505050565b6101ad610427565b6000806101bc83850185610635565b9150915080604001516001600160801b031681602001516001600160801b031611156102225760405162461bcd60e51b815260206004820152601060248201526f486973746f72793a204649203e204c4960801b60448201526064015b60405180910390fd5b6001600160a01b038216600090815260016020526040902080548015610294578161024e6001836106e9565b8154811061025e5761025e610603565b906000526020600020906002020160010160109054906101000a90046001600160801b0316600161028f9190610702565b610297565b60005b6001600160801b031683602001516001600160801b0316146102fb5760405162461bcd60e51b815260206004820152601960248201527f486973746f72793a20756e636c61696d656420696e70757473000000000000006044820152606401610219565b8154600180820184556000848152602090819020865160029094020183815586820180516040808a0180516001600160801b03938416600160801b9185169190910217949096019390935582519586529051811692850192909252915116908201526001600160a01b038516907fb71880d7a0c514d48c0296b2721b0a4f9641a45117960f2ca86b5b7873c4ab2f9060600160405180910390a2505050505050565b6103a5610427565b6001600160a01b03811661040a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610219565b61041381610481565b50565b61041e610427565b6104138161039d565b6000546001600160a01b0316331461010a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610219565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038116811461041357600080fd5b60008083601f8401126104f857600080fd5b50813567ffffffffffffffff81111561051057600080fd5b60208301915083602082850101111561052857600080fd5b9250929050565b60008060006040848603121561054457600080fd5b833561054f816104d1565b9250602084013567ffffffffffffffff81111561056b57600080fd5b610577868287016104e6565b9497909650939450505050565b6000806020838503121561059757600080fd5b823567ffffffffffffffff8111156105ae57600080fd5b6105ba858286016104e6565b90969095509350505050565b6000602082840312156105d857600080fd5b81356105e3816104d1565b9392505050565b6000602082840312156105fc57600080fd5b5035919050565b634e487b7160e01b600052603260045260246000fd5b80356001600160801b038116811461063057600080fd5b919050565b600080828403608081121561064957600080fd5b8335610654816104d1565b92506060601f198201121561066857600080fd5b506040516060810181811067ffffffffffffffff8211171561069a57634e487b7160e01b600052604160045260246000fd5b8060405250602084013581526106b260408501610619565b60208201526106c360608501610619565b6040820152809150509250929050565b634e487b7160e01b600052601160045260246000fd5b818103818111156106fc576106fc6106d3565b92915050565b6001600160801b03818116838216019080821115610722576107226106d3565b509291505056fea26469706673582212201fc5dfb9d50cb3efefe40c7ced59b7b296f6d072ed8005ef3de36946cd77e28364736f6c63430008130033", - "devdoc": { - "details": "This contract inherits OpenZeppelin's `Ownable` contract. For more information on `Ownable`, please consult OpenZeppelin's official documentation.", - "events": { - "NewClaimToHistory(address,(bytes32,uint128,uint128))": { - "details": "MUST be triggered on a successful call to `submitClaim`.", - "params": { - "claim": "The newly-submitted claim", - "dapp": "The address of the DApp" - } - } - }, - "kind": "dev", - "methods": { - "constructor": { - "params": { - "_owner": "The initial owner" - } - }, - "getClaim(address,bytes)": { - "params": { - "_dapp": "The DApp address", - "_proofContext": "Data for retrieving the desired claim" - }, - "returns": { - "_0": "The claimed epoch hash", - "_1": "The index of the first input of the epoch in the input box", - "_2": "The index of the last input of the epoch in the input box" - } - }, - "migrateToConsensus(address)": { - "details": "Emits an `OwnershipTransferred` event. Should have access control.", - "params": { - "_consensus": "The new consensus" - } - }, - "owner()": { - "details": "Returns the address of the current owner." - }, - "renounceOwnership()": { - "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." - }, - "submitClaim(bytes)": { - "details": "Emits a `NewClaimToHistory` event. Should have access control.", - "params": { - "_claimData": "Data for submitting a claim" - } - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." - } - }, - "stateVariables": { - "claims": { - "details": "See the `getClaim` and `submitClaim` functions." - } - }, - "title": "Simple History", - "version": 1 - }, - "userdoc": { - "events": { - "NewClaimToHistory(address,(bytes32,uint128,uint128))": { - "notice": "A new claim regarding a specific DApp was submitted." - } - }, - "kind": "user", - "methods": { - "constructor": { - "notice": "Creates a `History` contract." - }, - "getClaim(address,bytes)": { - "notice": "Get a specific claim regarding a specific DApp. There are several requirements for this function to be called successfully. * `_proofContext` MUST be well-encoded. In Solidity, it can be constructed as `abi.encode(claimIndex)`, where `claimIndex` is the claim index (type `uint256`). * `claimIndex` MUST be inside the interval `[0, n)` where `n` is the number of claims that have been submitted to `_dapp` already." - }, - "migrateToConsensus(address)": { - "notice": "Transfer ownership to another consensus." - }, - "submitClaim(bytes)": { - "notice": "Submit a claim regarding a DApp. There are several requirements for this function to be called successfully. * `_claimData` MUST be well-encoded. In Solidity, it can be constructed as `abi.encode(dapp, claim)`, where `dapp` is the DApp address (type `address`) and `claim` is the claim structure (type `Claim`). * `firstIndex` MUST be less than or equal to `lastIndex`. As a result, every claim MUST encompass AT LEAST one input. * If this is the DApp's first claim, then `firstIndex` MUST be `0`. Otherwise, `firstIndex` MUST be the `lastClaim.lastIndex + 1`. In other words, claims MUST NOT skip inputs." - } - }, - "notice": "This contract stores claims for each DApp individually. This means that, for each DApp, the contract stores an array of `Claim` entries, where each `Claim` is composed of: * An epoch hash (`bytes32`) * A closed interval of input indices (`uint128`, `uint128`) The contract guarantees that the first interval starts at index 0, and that the following intervals don't have gaps or overlaps. Furthermore, claims can only be submitted by the contract owner through `submitClaim`, but can be retrieved by anyone with `getClaim`.", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 1155, - "contract": "contracts/history/History.sol:History", - "label": "_owner", - "offset": 0, - "slot": "0", - "type": "t_address" - }, - { - "astId": 3072, - "contract": "contracts/history/History.sol:History", - "label": "claims", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_address,t_array(t_struct(Claim)3065_storage)dyn_storage)" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_struct(Claim)3065_storage)dyn_storage": { - "base": "t_struct(Claim)3065_storage", - "encoding": "dynamic_array", - "label": "struct History.Claim[]", - "numberOfBytes": "32" - }, - "t_bytes32": { - "encoding": "inplace", - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_array(t_struct(Claim)3065_storage)dyn_storage)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => struct History.Claim[])", - "numberOfBytes": "32", - "value": "t_array(t_struct(Claim)3065_storage)dyn_storage" - }, - "t_struct(Claim)3065_storage": { - "encoding": "inplace", - "label": "struct History.Claim", - "members": [ - { - "astId": 3060, - "contract": "contracts/history/History.sol:History", - "label": "epochHash", - "offset": 0, - "slot": "0", - "type": "t_bytes32" - }, - { - "astId": 3062, - "contract": "contracts/history/History.sol:History", - "label": "firstIndex", - "offset": 0, - "slot": "1", - "type": "t_uint128" - }, - { - "astId": 3064, - "contract": "contracts/history/History.sol:History", - "label": "lastIndex", - "offset": 16, - "slot": "1", - "type": "t_uint128" - } - ], - "numberOfBytes": "64" - }, - "t_uint128": { - "encoding": "inplace", - "label": "uint128", - "numberOfBytes": "16" - } - } - } -} \ No newline at end of file