{
  "address": "0xAe4ef5e45C42dA513d2B48E184B64A05c18d8154",
  "abi": [
    {
      "inputs": [
        {
          "internalType": "address",
          "name": "_libAddressManager",
          "type": "address"
        }
      ],
      "stateMutability": "nonpayable",
      "type": "constructor"
    },
    {
      "inputs": [
        {
          "internalType": "address",
          "name": "_libAddressManager",
          "type": "address"
        },
        {
          "internalType": "uint256",
          "name": "_stateTransitionIndex",
          "type": "uint256"
        },
        {
          "internalType": "bytes32",
          "name": "_preStateRoot",
          "type": "bytes32"
        },
        {
          "internalType": "bytes32",
          "name": "_transactionHash",
          "type": "bytes32"
        }
      ],
      "name": "create",
      "outputs": [
        {
          "internalType": "contract iOVM_StateTransitioner",
          "name": "",
          "type": "address"
        }
      ],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "libAddressManager",
      "outputs": [
        {
          "internalType": "contract Lib_AddressManager",
          "name": "",
          "type": "address"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "string",
          "name": "_name",
          "type": "string"
        }
      ],
      "name": "resolve",
      "outputs": [
        {
          "internalType": "address",
          "name": "",
          "type": "address"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    }
  ],
  "transactionHash": "0x48ded21f964908ff5fd32f2b5b6dd820218680d145577e87789ee6c4f4823e92",
  "receipt": {
    "to": null,
    "from": "0xd033f09cB85621F98F7A84C64dB381ac16Eff818",
    "contractAddress": "0xAe4ef5e45C42dA513d2B48E184B64A05c18d8154",
    "transactionIndex": 101,
    "gasUsed": "4209012",
    "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "blockHash": "0xbc5cd27fe7a430f5560b1eded2d0f4aaf6f7098bd3a96fd809546ed514b71c4f",
    "transactionHash": "0x48ded21f964908ff5fd32f2b5b6dd820218680d145577e87789ee6c4f4823e92",
    "logs": [],
    "blockNumber": 12410849,
    "cumulativeGasUsed": "8881804",
    "status": 1,
    "byzantium": true
  },
  "args": [
    "0x668E5b997b9aE88a56cd40409119d4Db9e6d752E"
  ],
  "solcInputHash": "f2bdab652d5102f5f11e78dae866798d",
  "metadata": "{\"compiler\":{\"version\":\"0.7.6+commit.7338295f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_libAddressManager\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_libAddressManager\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_stateTransitionIndex\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_preStateRoot\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"_transactionHash\",\"type\":\"bytes32\"}],\"name\":\"create\",\"outputs\":[{\"internalType\":\"contract iOVM_StateTransitioner\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"libAddressManager\",\"outputs\":[{\"internalType\":\"contract Lib_AddressManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"The State Transitioner Factory is used by the Fraud Verifier to create a new State Transitioner during the initialization of a fraud proof. Compiler used: solc Runtime target: EVM\",\"kind\":\"dev\",\"methods\":{\"create(address,uint256,bytes32,bytes32)\":{\"params\":{\"_libAddressManager\":\"Address of the Address Manager.\",\"_preStateRoot\":\"State root before the transition was executed.\",\"_stateTransitionIndex\":\"Index of the state transition being verified.\",\"_transactionHash\":\"Hash of the executed transaction.\"},\"returns\":{\"_0\":\"New OVM_StateTransitioner instance.\"}},\"resolve(string)\":{\"params\":{\"_name\":\"Name to resolve an address for.\"},\"returns\":{\"_0\":\"Address associated with the given name.\"}}},\"title\":\"OVM_StateTransitionerFactory\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"create(address,uint256,bytes32,bytes32)\":{\"notice\":\"Creates a new OVM_StateTransitioner\"},\"resolve(string)\":{\"notice\":\"Resolves the address associated with a given name.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/optimistic-ethereum/OVM/verification/OVM_StateTransitionerFactory.sol\":\"OVM_StateTransitionerFactory\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\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 () internal {\\n        address msgSender = _msgSender();\\n        _owner = msgSender;\\n        emit OwnershipTransferred(address(0), msgSender);\\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 called by any account other than the owner.\\n     */\\n    modifier onlyOwner() {\\n        require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n        _;\\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        emit OwnershipTransferred(_owner, address(0));\\n        _owner = 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        emit OwnershipTransferred(_owner, newOwner);\\n        _owner = newOwner;\\n    }\\n}\\n\",\"keccak256\":\"0x15e2d5bd4c28a88548074c54d220e8086f638a71ed07e6b3ba5a70066fcf458d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <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 GSN 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 payable) {\\n        return msg.sender;\\n    }\\n\\n    function _msgData() internal view virtual returns (bytes memory) {\\n        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n        return msg.data;\\n    }\\n}\\n\",\"keccak256\":\"0x8d3cb350f04ff49cfb10aef08d87f19dcbaecc8027b0bed12f3275cd12f38cf0\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/OVM/verification/Abs_FraudContributor.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\nimport { iOVM_BondManager } from \\\"../../iOVM/verification/iOVM_BondManager.sol\\\";\\nimport { Lib_AddressResolver } from \\\"../../libraries/resolver/Lib_AddressResolver.sol\\\";\\n\\n/// Minimal contract to be inherited by contracts consumed by users that provide\\n/// data for fraud proofs\\nabstract contract Abs_FraudContributor is Lib_AddressResolver {\\n    /// Decorate your functions with this modifier to store how much total gas was\\n    /// consumed by the sender, to reward users fairly\\n    modifier contributesToFraudProof(bytes32 preStateRoot, bytes32 txHash) {\\n        uint256 startGas = gasleft();\\n        _;\\n        uint256 gasSpent = startGas - gasleft();\\n        iOVM_BondManager(resolve('OVM_BondManager')).recordGasSpent(preStateRoot, txHash, msg.sender, gasSpent);\\n    }\\n}\\n\",\"keccak256\":\"0x6c27d089a297103cb93b30f7649ab68691cc6b948c315f1037e5de1fe9bf5903\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/OVM/verification/OVM_StateTransitioner.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// @unsupported: ovm\\npragma solidity >0.5.0 <0.8.0;\\npragma experimental ABIEncoderV2;\\n\\n/* Library Imports */\\nimport { Lib_OVMCodec } from \\\"../../libraries/codec/Lib_OVMCodec.sol\\\";\\nimport { Lib_AddressResolver } from \\\"../../libraries/resolver/Lib_AddressResolver.sol\\\";\\nimport { Lib_EthUtils } from \\\"../../libraries/utils/Lib_EthUtils.sol\\\";\\nimport { Lib_Bytes32Utils } from \\\"../../libraries/utils/Lib_Bytes32Utils.sol\\\";\\nimport { Lib_BytesUtils } from \\\"../../libraries/utils/Lib_BytesUtils.sol\\\";\\nimport { Lib_SecureMerkleTrie } from \\\"../../libraries/trie/Lib_SecureMerkleTrie.sol\\\";\\nimport { Lib_RLPWriter } from \\\"../../libraries/rlp/Lib_RLPWriter.sol\\\";\\nimport { Lib_RLPReader } from \\\"../../libraries/rlp/Lib_RLPReader.sol\\\";\\n\\n/* Interface Imports */\\nimport { iOVM_StateTransitioner } from \\\"../../iOVM/verification/iOVM_StateTransitioner.sol\\\";\\nimport { iOVM_BondManager } from \\\"../../iOVM/verification/iOVM_BondManager.sol\\\";\\nimport { iOVM_ExecutionManager } from \\\"../../iOVM/execution/iOVM_ExecutionManager.sol\\\";\\nimport { iOVM_StateManager } from \\\"../../iOVM/execution/iOVM_StateManager.sol\\\";\\nimport { iOVM_StateManagerFactory } from \\\"../../iOVM/execution/iOVM_StateManagerFactory.sol\\\";\\n\\n/* Contract Imports */\\nimport { Abs_FraudContributor } from \\\"./Abs_FraudContributor.sol\\\";\\n\\n/**\\n * @title OVM_StateTransitioner\\n * @dev The State Transitioner coordinates the execution of a state transition during the evaluation of a\\n * fraud proof. It feeds verified input to the Execution Manager's run(), and controls a State Manager (which is\\n * uniquely created for each fraud proof).\\n * Once a fraud proof has been initialized, this contract is provided with the pre-state root and verifies\\n * that the OVM storage slots committed to the State Mangager are contained in that state\\n * This contract controls the State Manager and Execution Manager, and uses them to calculate the\\n * post-state root by applying the transaction. The Fraud Verifier can then check for fraud by comparing\\n * the calculated post-state root with the proposed post-state root.\\n *\\n * Compiler used: solc\\n * Runtime target: EVM\\n */\\ncontract OVM_StateTransitioner is Lib_AddressResolver, Abs_FraudContributor, iOVM_StateTransitioner {\\n\\n    /*******************\\n     * Data Structures *\\n     *******************/\\n\\n    enum TransitionPhase {\\n        PRE_EXECUTION,\\n        POST_EXECUTION,\\n        COMPLETE\\n    }\\n\\n\\n    /*******************************************\\n     * Contract Variables: Contract References *\\n     *******************************************/\\n\\n    iOVM_StateManager public ovmStateManager;\\n\\n\\n    /*******************************************\\n     * Contract Variables: Internal Accounting *\\n     *******************************************/\\n\\n    bytes32 internal preStateRoot;\\n    bytes32 internal postStateRoot;\\n    TransitionPhase public phase;\\n    uint256 internal stateTransitionIndex;\\n    bytes32 internal transactionHash;\\n\\n\\n    /*************\\n     * Constants *\\n     *************/\\n\\n    bytes32 internal constant EMPTY_ACCOUNT_CODE_HASH = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;\\n    bytes32 internal constant EMPTY_ACCOUNT_STORAGE_ROOT = 0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421;\\n\\n\\n    /***************\\n     * Constructor *\\n     ***************/\\n\\n    /**\\n     * @param _libAddressManager Address of the Address Manager.\\n     * @param _stateTransitionIndex Index of the state transition being verified.\\n     * @param _preStateRoot State root before the transition was executed.\\n     * @param _transactionHash Hash of the executed transaction.\\n     */\\n    constructor(\\n        address _libAddressManager,\\n        uint256 _stateTransitionIndex,\\n        bytes32 _preStateRoot,\\n        bytes32 _transactionHash\\n    )\\n        Lib_AddressResolver(_libAddressManager)\\n    {\\n        stateTransitionIndex = _stateTransitionIndex;\\n        preStateRoot = _preStateRoot;\\n        postStateRoot = _preStateRoot;\\n        transactionHash = _transactionHash;\\n\\n        ovmStateManager = iOVM_StateManagerFactory(resolve(\\\"OVM_StateManagerFactory\\\")).create(address(this));\\n    }\\n\\n\\n    /**********************\\n     * Function Modifiers *\\n     **********************/\\n\\n    /**\\n     * Checks that a function is only run during a specific phase.\\n     * @param _phase Phase the function must run within.\\n     */\\n    modifier onlyDuringPhase(\\n        TransitionPhase _phase\\n    ) {\\n        require(\\n            phase == _phase,\\n            \\\"Function must be called during the correct phase.\\\"\\n        );\\n        _;\\n    }\\n\\n\\n    /**********************************\\n     * Public Functions: State Access *\\n     **********************************/\\n\\n    /**\\n     * Retrieves the state root before execution.\\n     * @return _preStateRoot State root before execution.\\n     */\\n    function getPreStateRoot()\\n        override\\n        external\\n        view\\n        returns (\\n            bytes32 _preStateRoot\\n        )\\n    {\\n        return preStateRoot;\\n    }\\n\\n    /**\\n     * Retrieves the state root after execution.\\n     * @return _postStateRoot State root after execution.\\n     */\\n    function getPostStateRoot()\\n        override\\n        external\\n        view\\n        returns (\\n            bytes32 _postStateRoot\\n        )\\n    {\\n        return postStateRoot;\\n    }\\n\\n    /**\\n     * Checks whether the transitioner is complete.\\n     * @return _complete Whether or not the transition process is finished.\\n     */\\n    function isComplete()\\n        override\\n        external\\n        view\\n        returns (\\n            bool _complete\\n        )\\n    {\\n        return phase == TransitionPhase.COMPLETE;\\n    }\\n\\n\\n    /***********************************\\n     * Public Functions: Pre-Execution *\\n     ***********************************/\\n\\n    /**\\n     * Allows a user to prove the initial state of a contract.\\n     * @param _ovmContractAddress Address of the contract on the OVM.\\n     * @param _ethContractAddress Address of the corresponding contract on L1.\\n     * @param _stateTrieWitness Proof of the account state.\\n     */\\n    function proveContractState(\\n        address _ovmContractAddress,\\n        address _ethContractAddress,\\n        bytes memory _stateTrieWitness\\n    )\\n        override\\n        external\\n        onlyDuringPhase(TransitionPhase.PRE_EXECUTION)\\n        contributesToFraudProof(preStateRoot, transactionHash)\\n    {\\n        // Exit quickly to avoid unnecessary work.\\n        require(\\n            (\\n                ovmStateManager.hasAccount(_ovmContractAddress) == false\\n                && ovmStateManager.hasEmptyAccount(_ovmContractAddress) == false\\n            ),\\n            \\\"Account state has already been proven.\\\"\\n        );\\n\\n        // Function will fail if the proof is not a valid inclusion or exclusion proof.\\n        (\\n            bool exists,\\n            bytes memory encodedAccount\\n        ) = Lib_SecureMerkleTrie.get(\\n            abi.encodePacked(_ovmContractAddress),\\n            _stateTrieWitness,\\n            preStateRoot\\n        );\\n\\n        if (exists == true) {\\n            // Account exists, this was an inclusion proof.\\n            Lib_OVMCodec.EVMAccount memory account = Lib_OVMCodec.decodeEVMAccount(\\n                encodedAccount\\n            );\\n\\n            address ethContractAddress = _ethContractAddress;\\n            if (account.codeHash == EMPTY_ACCOUNT_CODE_HASH) {\\n                // Use a known empty contract to prevent an attack in which a user provides a\\n                // contract address here and then later deploys code to it.\\n                ethContractAddress = 0x0000000000000000000000000000000000000000;\\n            } else {\\n                // Otherwise, make sure that the code at the provided eth address matches the hash\\n                // of the code stored on L2.\\n                require(\\n                    Lib_EthUtils.getCodeHash(ethContractAddress) == account.codeHash,\\n                    \\\"OVM_StateTransitioner: Provided L1 contract code hash does not match L2 contract code hash.\\\"\\n                );\\n            }\\n\\n            ovmStateManager.putAccount(\\n                _ovmContractAddress,\\n                Lib_OVMCodec.Account({\\n                    nonce: account.nonce,\\n                    balance: account.balance,\\n                    storageRoot: account.storageRoot,\\n                    codeHash: account.codeHash,\\n                    ethAddress: ethContractAddress,\\n                    isFresh: false\\n                })\\n            );\\n        } else {\\n            // Account does not exist, this was an exclusion proof.\\n            ovmStateManager.putEmptyAccount(_ovmContractAddress);\\n        }\\n    }\\n\\n    /**\\n     * Allows a user to prove the initial state of a contract storage slot.\\n     * @param _ovmContractAddress Address of the contract on the OVM.\\n     * @param _key Claimed account slot key.\\n     * @param _storageTrieWitness Proof of the storage slot.\\n     */\\n    function proveStorageSlot(\\n        address _ovmContractAddress,\\n        bytes32 _key,\\n        bytes memory _storageTrieWitness\\n    )\\n        override\\n        external\\n        onlyDuringPhase(TransitionPhase.PRE_EXECUTION)\\n        contributesToFraudProof(preStateRoot, transactionHash)\\n    {\\n        // Exit quickly to avoid unnecessary work.\\n        require(\\n            ovmStateManager.hasContractStorage(_ovmContractAddress, _key) == false,\\n            \\\"Storage slot has already been proven.\\\"\\n        );\\n\\n        require(\\n            ovmStateManager.hasAccount(_ovmContractAddress) == true,\\n            \\\"Contract must be verified before proving a storage slot.\\\"\\n        );\\n\\n        bytes32 storageRoot = ovmStateManager.getAccountStorageRoot(_ovmContractAddress);\\n        bytes32 value;\\n\\n        if (storageRoot == EMPTY_ACCOUNT_STORAGE_ROOT) {\\n            // Storage trie was empty, so the user is always allowed to insert zero-byte values.\\n            value = bytes32(0);\\n        } else {\\n            // Function will fail if the proof is not a valid inclusion or exclusion proof.\\n            (\\n                bool exists,\\n                bytes memory encodedValue\\n            ) = Lib_SecureMerkleTrie.get(\\n                abi.encodePacked(_key),\\n                _storageTrieWitness,\\n                storageRoot\\n            );\\n\\n            if (exists == true) {\\n                // Inclusion proof.\\n                // Stored values are RLP encoded, with leading zeros removed.\\n                value = Lib_BytesUtils.toBytes32PadLeft(\\n                    Lib_RLPReader.readBytes(encodedValue)\\n                );\\n            } else {\\n                // Exclusion proof, can only be zero bytes.\\n                value = bytes32(0);\\n            }\\n        }\\n\\n        ovmStateManager.putContractStorage(\\n            _ovmContractAddress,\\n            _key,\\n            value\\n        );\\n    }\\n\\n\\n    /*******************************\\n     * Public Functions: Execution *\\n     *******************************/\\n\\n    /**\\n     * Executes the state transition.\\n     * @param _transaction OVM transaction to execute.\\n     */\\n    function applyTransaction(\\n        Lib_OVMCodec.Transaction memory _transaction\\n    )\\n        override\\n        external\\n        onlyDuringPhase(TransitionPhase.PRE_EXECUTION)\\n        contributesToFraudProof(preStateRoot, transactionHash)\\n    {\\n        require(\\n            Lib_OVMCodec.hashTransaction(_transaction) == transactionHash,\\n            \\\"Invalid transaction provided.\\\"\\n        );\\n\\n        // We require gas to complete the logic here in run() before/after execution,\\n        // But must ensure the full _tx.gasLimit can be given to the ovmCALL (determinism)\\n        // This includes 1/64 of the gas getting lost because of EIP-150 (lost twice--first\\n        // going into EM, then going into the code contract).\\n        require(\\n            gasleft() >= 100000 + _transaction.gasLimit * 1032 / 1000, // 1032/1000 = 1.032 = (64/63)^2 rounded up\\n            \\\"Not enough gas to execute transaction deterministically.\\\"\\n        );\\n\\n        iOVM_ExecutionManager ovmExecutionManager = iOVM_ExecutionManager(resolve(\\\"OVM_ExecutionManager\\\"));\\n\\n        // We call `setExecutionManager` right before `run` (and not earlier) just in case the\\n        // OVM_ExecutionManager address was updated between the time when this contract was created\\n        // and when `applyTransaction` was called.\\n        ovmStateManager.setExecutionManager(address(ovmExecutionManager));\\n\\n        // `run` always succeeds *unless* the user hasn't provided enough gas to `applyTransaction`\\n        // or an INVALID_STATE_ACCESS flag was triggered. Either way, we won't get beyond this line\\n        // if that's the case.\\n        ovmExecutionManager.run(_transaction, address(ovmStateManager));\\n\\n        // Prevent the Execution Manager from calling this SM again.\\n        ovmStateManager.setExecutionManager(address(0));\\n        phase = TransitionPhase.POST_EXECUTION;\\n    }\\n\\n\\n    /************************************\\n     * Public Functions: Post-Execution *\\n     ************************************/\\n\\n    /**\\n     * Allows a user to commit the final state of a contract.\\n     * @param _ovmContractAddress Address of the contract on the OVM.\\n     * @param _stateTrieWitness Proof of the account state.\\n     */\\n    function commitContractState(\\n        address _ovmContractAddress,\\n        bytes memory _stateTrieWitness\\n    )\\n        override\\n        external\\n        onlyDuringPhase(TransitionPhase.POST_EXECUTION)\\n        contributesToFraudProof(preStateRoot, transactionHash)\\n    {\\n        require(\\n            ovmStateManager.getTotalUncommittedContractStorage() == 0,\\n            \\\"All storage must be committed before committing account states.\\\"\\n        );\\n\\n        require (\\n            ovmStateManager.commitAccount(_ovmContractAddress) == true,\\n            \\\"Account state wasn't changed or has already been committed.\\\"\\n        );\\n\\n        Lib_OVMCodec.Account memory account = ovmStateManager.getAccount(_ovmContractAddress);\\n\\n        postStateRoot = Lib_SecureMerkleTrie.update(\\n            abi.encodePacked(_ovmContractAddress),\\n            Lib_OVMCodec.encodeEVMAccount(\\n                Lib_OVMCodec.toEVMAccount(account)\\n            ),\\n            _stateTrieWitness,\\n            postStateRoot\\n        );\\n\\n        // Emit an event to help clients figure out the proof ordering.\\n        emit AccountCommitted(\\n            _ovmContractAddress\\n        );\\n    }\\n\\n    /**\\n     * Allows a user to commit the final state of a contract storage slot.\\n     * @param _ovmContractAddress Address of the contract on the OVM.\\n     * @param _key Claimed account slot key.\\n     * @param _storageTrieWitness Proof of the storage slot.\\n     */\\n    function commitStorageSlot(\\n        address _ovmContractAddress,\\n        bytes32 _key,\\n        bytes memory _storageTrieWitness\\n    )\\n        override\\n        external\\n        onlyDuringPhase(TransitionPhase.POST_EXECUTION)\\n        contributesToFraudProof(preStateRoot, transactionHash)\\n    {\\n        require(\\n            ovmStateManager.commitContractStorage(_ovmContractAddress, _key) == true,\\n            \\\"Storage slot value wasn't changed or has already been committed.\\\"\\n        );\\n\\n        Lib_OVMCodec.Account memory account = ovmStateManager.getAccount(_ovmContractAddress);\\n        bytes32 value = ovmStateManager.getContractStorage(_ovmContractAddress, _key);\\n\\n        account.storageRoot = Lib_SecureMerkleTrie.update(\\n            abi.encodePacked(_key),\\n            Lib_RLPWriter.writeBytes(\\n                Lib_Bytes32Utils.removeLeadingZeros(value)\\n            ),\\n            _storageTrieWitness,\\n            account.storageRoot\\n        );\\n\\n        ovmStateManager.putAccount(_ovmContractAddress, account);\\n\\n        // Emit an event to help clients figure out the proof ordering.\\n        emit ContractStorageCommitted(\\n            _ovmContractAddress,\\n            _key\\n        );\\n    }\\n\\n\\n    /**********************************\\n     * Public Functions: Finalization *\\n     **********************************/\\n\\n    /**\\n     * Finalizes the transition process.\\n     */\\n    function completeTransition()\\n        override\\n        external\\n        onlyDuringPhase(TransitionPhase.POST_EXECUTION)\\n    {\\n        require(\\n            ovmStateManager.getTotalUncommittedAccounts() == 0,\\n            \\\"All accounts must be committed before completing a transition.\\\"\\n        );\\n\\n        require(\\n            ovmStateManager.getTotalUncommittedContractStorage() == 0,\\n            \\\"All storage must be committed before completing a transition.\\\"\\n        );\\n\\n        phase = TransitionPhase.COMPLETE;\\n    }\\n}\\n\",\"keccak256\":\"0x53231f64d413623b2b8c4ba1b596c9cbbe4712c9b406a42198aeaa8387a293d9\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/OVM/verification/OVM_StateTransitionerFactory.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// @unsupported: ovm\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* Library Imports */\\nimport { Lib_AddressResolver } from \\\"../../libraries/resolver/Lib_AddressResolver.sol\\\";\\n\\n/* Interface Imports */\\nimport { iOVM_StateTransitioner } from \\\"../../iOVM/verification/iOVM_StateTransitioner.sol\\\";\\nimport { iOVM_StateTransitionerFactory } from \\\"../../iOVM/verification/iOVM_StateTransitionerFactory.sol\\\";\\nimport { iOVM_FraudVerifier } from \\\"../../iOVM/verification/iOVM_FraudVerifier.sol\\\";\\n\\n/* Contract Imports */\\nimport { OVM_StateTransitioner } from \\\"./OVM_StateTransitioner.sol\\\";\\n\\n/**\\n * @title OVM_StateTransitionerFactory\\n * @dev The State Transitioner Factory is used by the Fraud Verifier to create a new State\\n * Transitioner during the initialization of a fraud proof.\\n *\\n * Compiler used: solc\\n * Runtime target: EVM\\n */\\ncontract OVM_StateTransitionerFactory is iOVM_StateTransitionerFactory, Lib_AddressResolver {\\n\\n    /***************\\n     * Constructor *\\n     ***************/\\n\\n    constructor(\\n        address _libAddressManager\\n    )\\n        Lib_AddressResolver(_libAddressManager)\\n    {}\\n\\n\\n    /********************\\n     * Public Functions *\\n     ********************/\\n\\n    /**\\n     * Creates a new OVM_StateTransitioner\\n     * @param _libAddressManager Address of the Address Manager.\\n     * @param _stateTransitionIndex Index of the state transition being verified.\\n     * @param _preStateRoot State root before the transition was executed.\\n     * @param _transactionHash Hash of the executed transaction.\\n     * @return New OVM_StateTransitioner instance.\\n     */\\n    function create(\\n        address _libAddressManager,\\n        uint256 _stateTransitionIndex,\\n        bytes32 _preStateRoot,\\n        bytes32 _transactionHash\\n    )\\n        override\\n        public\\n        returns (\\n            iOVM_StateTransitioner\\n        )\\n    {\\n        require(\\n            msg.sender == resolve(\\\"OVM_FraudVerifier\\\"),\\n            \\\"Create can only be done by the OVM_FraudVerifier.\\\"\\n        );\\n\\n        return new OVM_StateTransitioner(\\n            _libAddressManager,\\n            _stateTransitionIndex,\\n            _preStateRoot,\\n            _transactionHash\\n        );\\n    }\\n}\\n\",\"keccak256\":\"0x65ef11334a2d6931b6d3a85e7b29c39c774d19443e7040e132a58be505e3b52c\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/iOVM/execution/iOVM_ExecutionManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\npragma experimental ABIEncoderV2;\\n\\n/* Library Imports */\\nimport { Lib_OVMCodec } from \\\"../../libraries/codec/Lib_OVMCodec.sol\\\";\\n\\ninterface iOVM_ExecutionManager {\\n    /**********\\n     * Enums *\\n     *********/\\n\\n    enum RevertFlag {\\n        OUT_OF_GAS,\\n        INTENTIONAL_REVERT,\\n        EXCEEDS_NUISANCE_GAS,\\n        INVALID_STATE_ACCESS,\\n        UNSAFE_BYTECODE,\\n        CREATE_COLLISION,\\n        STATIC_VIOLATION,\\n        CREATOR_NOT_ALLOWED\\n    }\\n\\n    enum GasMetadataKey {\\n        CURRENT_EPOCH_START_TIMESTAMP,\\n        CUMULATIVE_SEQUENCER_QUEUE_GAS,\\n        CUMULATIVE_L1TOL2_QUEUE_GAS,\\n        PREV_EPOCH_SEQUENCER_QUEUE_GAS,\\n        PREV_EPOCH_L1TOL2_QUEUE_GAS\\n    }\\n\\n    /***********\\n     * Structs *\\n     ***********/\\n\\n    struct GasMeterConfig {\\n        uint256 minTransactionGasLimit;\\n        uint256 maxTransactionGasLimit;\\n        uint256 maxGasPerQueuePerEpoch;\\n        uint256 secondsPerEpoch;\\n    }\\n\\n    struct GlobalContext {\\n        uint256 ovmCHAINID;\\n    }\\n\\n    struct TransactionContext {\\n        Lib_OVMCodec.QueueOrigin ovmL1QUEUEORIGIN;\\n        uint256 ovmTIMESTAMP;\\n        uint256 ovmNUMBER;\\n        uint256 ovmGASLIMIT;\\n        uint256 ovmTXGASLIMIT;\\n        address ovmL1TXORIGIN;\\n    }\\n\\n    struct TransactionRecord {\\n        uint256 ovmGasRefund;\\n    }\\n\\n    struct MessageContext {\\n        address ovmCALLER;\\n        address ovmADDRESS;\\n        bool isStatic;\\n    }\\n\\n    struct MessageRecord {\\n        uint256 nuisanceGasLeft;\\n    }\\n\\n\\n    /************************************\\n     * Transaction Execution Entrypoint *\\n     ************************************/\\n\\n    function run(\\n        Lib_OVMCodec.Transaction calldata _transaction,\\n        address _txStateManager\\n    ) external returns (bytes memory);\\n\\n\\n    /*******************\\n     * Context Opcodes *\\n     *******************/\\n\\n    function ovmCALLER() external view returns (address _caller);\\n    function ovmADDRESS() external view returns (address _address);\\n    function ovmTIMESTAMP() external view returns (uint256 _timestamp);\\n    function ovmNUMBER() external view returns (uint256 _number);\\n    function ovmGASLIMIT() external view returns (uint256 _gasLimit);\\n    function ovmCHAINID() external view returns (uint256 _chainId);\\n\\n\\n    /**********************\\n     * L2 Context Opcodes *\\n     **********************/\\n\\n    function ovmL1QUEUEORIGIN() external view returns (Lib_OVMCodec.QueueOrigin _queueOrigin);\\n    function ovmL1TXORIGIN() external view returns (address _l1TxOrigin);\\n\\n\\n    /*******************\\n     * Halting Opcodes *\\n     *******************/\\n\\n    function ovmREVERT(bytes memory _data) external;\\n\\n\\n    /*****************************\\n     * Contract Creation Opcodes *\\n     *****************************/\\n\\n    function ovmCREATE(bytes memory _bytecode) external returns (address _contract, bytes memory _revertdata);\\n    function ovmCREATE2(bytes memory _bytecode, bytes32 _salt) external returns (address _contract, bytes memory _revertdata);\\n\\n\\n    /*******************************\\n     * Account Abstraction Opcodes *\\n     ******************************/\\n\\n    function ovmGETNONCE() external returns (uint256 _nonce);\\n    function ovmINCREMENTNONCE() external;\\n    function ovmCREATEEOA(bytes32 _messageHash, uint8 _v, bytes32 _r, bytes32 _s) external;\\n\\n\\n    /****************************\\n     * Contract Calling Opcodes *\\n     ****************************/\\n\\n    function ovmCALL(uint256 _gasLimit, address _address, bytes memory _calldata) external returns (bool _success, bytes memory _returndata);\\n    function ovmSTATICCALL(uint256 _gasLimit, address _address, bytes memory _calldata) external returns (bool _success, bytes memory _returndata);\\n    function ovmDELEGATECALL(uint256 _gasLimit, address _address, bytes memory _calldata) external returns (bool _success, bytes memory _returndata);\\n\\n\\n    /****************************\\n     * Contract Storage Opcodes *\\n     ****************************/\\n\\n    function ovmSLOAD(bytes32 _key) external returns (bytes32 _value);\\n    function ovmSSTORE(bytes32 _key, bytes32 _value) external;\\n\\n\\n    /*************************\\n     * Contract Code Opcodes *\\n     *************************/\\n\\n    function ovmEXTCODECOPY(address _contract, uint256 _offset, uint256 _length) external returns (bytes memory _code);\\n    function ovmEXTCODESIZE(address _contract) external returns (uint256 _size);\\n    function ovmEXTCODEHASH(address _contract) external returns (bytes32 _hash);\\n\\n\\n    /***************************************\\n     * Public Functions: Execution Context *\\n     ***************************************/\\n\\n    function getMaxTransactionGasLimit() external view returns (uint _maxTransactionGasLimit);\\n}\\n\",\"keccak256\":\"0xf023d5d6fc6a03bd52f7a57af6e21076de77e8925d065bb79db062e73e43b684\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/iOVM/execution/iOVM_StateManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\npragma experimental ABIEncoderV2;\\n\\n/* Library Imports */\\nimport { Lib_OVMCodec } from \\\"../../libraries/codec/Lib_OVMCodec.sol\\\";\\n\\n/**\\n * @title iOVM_StateManager\\n */\\ninterface iOVM_StateManager {\\n\\n    /*******************\\n     * Data Structures *\\n     *******************/\\n\\n    enum ItemState {\\n        ITEM_UNTOUCHED,\\n        ITEM_LOADED,\\n        ITEM_CHANGED,\\n        ITEM_COMMITTED\\n    }\\n\\n    /***************************\\n     * Public Functions: Misc *\\n     ***************************/\\n\\n    function isAuthenticated(address _address) external view returns (bool);\\n\\n    /***************************\\n     * Public Functions: Setup *\\n     ***************************/\\n\\n    function owner() external view returns (address _owner);\\n    function ovmExecutionManager() external view returns (address _ovmExecutionManager);\\n    function setExecutionManager(address _ovmExecutionManager) external;\\n\\n\\n    /************************************\\n     * Public Functions: Account Access *\\n     ************************************/\\n\\n    function putAccount(address _address, Lib_OVMCodec.Account memory _account) external;\\n    function putEmptyAccount(address _address) external;\\n    function getAccount(address _address) external view returns (Lib_OVMCodec.Account memory _account);\\n    function hasAccount(address _address) external view returns (bool _exists);\\n    function hasEmptyAccount(address _address) external view returns (bool _exists);\\n    function setAccountNonce(address _address, uint256 _nonce) external;\\n    function getAccountNonce(address _address) external view returns (uint256 _nonce);\\n    function getAccountEthAddress(address _address) external view returns (address _ethAddress);\\n    function getAccountStorageRoot(address _address) external view returns (bytes32 _storageRoot);\\n    function initPendingAccount(address _address) external;\\n    function commitPendingAccount(address _address, address _ethAddress, bytes32 _codeHash) external;\\n    function testAndSetAccountLoaded(address _address) external returns (bool _wasAccountAlreadyLoaded);\\n    function testAndSetAccountChanged(address _address) external returns (bool _wasAccountAlreadyChanged);\\n    function commitAccount(address _address) external returns (bool _wasAccountCommitted);\\n    function incrementTotalUncommittedAccounts() external;\\n    function getTotalUncommittedAccounts() external view returns (uint256 _total);\\n    function wasAccountChanged(address _address) external view returns (bool);\\n    function wasAccountCommitted(address _address) external view returns (bool);\\n\\n\\n    /************************************\\n     * Public Functions: Storage Access *\\n     ************************************/\\n\\n    function putContractStorage(address _contract, bytes32 _key, bytes32 _value) external;\\n    function getContractStorage(address _contract, bytes32 _key) external view returns (bytes32 _value);\\n    function hasContractStorage(address _contract, bytes32 _key) external view returns (bool _exists);\\n    function testAndSetContractStorageLoaded(address _contract, bytes32 _key) external returns (bool _wasContractStorageAlreadyLoaded);\\n    function testAndSetContractStorageChanged(address _contract, bytes32 _key) external returns (bool _wasContractStorageAlreadyChanged);\\n    function commitContractStorage(address _contract, bytes32 _key) external returns (bool _wasContractStorageCommitted);\\n    function incrementTotalUncommittedContractStorage() external;\\n    function getTotalUncommittedContractStorage() external view returns (uint256 _total);\\n    function wasContractStorageChanged(address _contract, bytes32 _key) external view returns (bool);\\n    function wasContractStorageCommitted(address _contract, bytes32 _key) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x7a11dbd1f61593ba34debe07e39eef59967307f7f372ba9855bee0953585d08d\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/iOVM/execution/iOVM_StateManagerFactory.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* Contract Imports */\\nimport { iOVM_StateManager } from \\\"./iOVM_StateManager.sol\\\";\\n\\n/**\\n * @title iOVM_StateManagerFactory\\n */\\ninterface iOVM_StateManagerFactory {\\n\\n    /***************************************\\n     * Public Functions: Contract Creation *\\n     ***************************************/\\n\\n    function create(\\n        address _owner\\n    )\\n        external\\n        returns (\\n            iOVM_StateManager _ovmStateManager\\n        );\\n}\\n\",\"keccak256\":\"0x27a90fc43889d0c7d1db50f37907ef7386d9b415d15a1e91a0a068cba59afd36\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/iOVM/verification/iOVM_BondManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\ninterface ERC20 {\\n    function transfer(address, uint256) external returns (bool);\\n    function transferFrom(address, address, uint256) external returns (bool);\\n}\\n\\n/// All the errors which may be encountered on the bond manager\\nlibrary Errors {\\n    string constant ERC20_ERR = \\\"BondManager: Could not post bond\\\";\\n    string constant ALREADY_FINALIZED = \\\"BondManager: Fraud proof for this pre-state root has already been finalized\\\";\\n    string constant SLASHED = \\\"BondManager: Cannot finalize withdrawal, you probably got slashed\\\";\\n    string constant WRONG_STATE = \\\"BondManager: Wrong bond state for proposer\\\";\\n    string constant CANNOT_CLAIM = \\\"BondManager: Cannot claim yet. Dispute must be finalized first\\\";\\n\\n    string constant WITHDRAWAL_PENDING = \\\"BondManager: Withdrawal already pending\\\";\\n    string constant TOO_EARLY = \\\"BondManager: Too early to finalize your withdrawal\\\";\\n\\n    string constant ONLY_TRANSITIONER = \\\"BondManager: Only the transitioner for this pre-state root may call this function\\\";\\n    string constant ONLY_FRAUD_VERIFIER = \\\"BondManager: Only the fraud verifier may call this function\\\";\\n    string constant ONLY_STATE_COMMITMENT_CHAIN = \\\"BondManager: Only the state commitment chain may call this function\\\";\\n    string constant WAIT_FOR_DISPUTES = \\\"BondManager: Wait for other potential disputes\\\";\\n}\\n\\n/**\\n * @title iOVM_BondManager\\n */\\ninterface iOVM_BondManager {\\n\\n    /*******************\\n     * Data Structures *\\n     *******************/\\n\\n    /// The lifecycle of a proposer's bond\\n    enum State {\\n        // Before depositing or after getting slashed, a user is uncollateralized\\n        NOT_COLLATERALIZED,\\n        // After depositing, a user is collateralized\\n        COLLATERALIZED,\\n        // After a user has initiated a withdrawal\\n        WITHDRAWING\\n    }\\n\\n    /// A bond posted by a proposer\\n    struct Bond {\\n        // The user's state\\n        State state;\\n        // The timestamp at which a proposer issued their withdrawal request\\n        uint32 withdrawalTimestamp;\\n        // The time when the first disputed was initiated for this bond\\n        uint256 firstDisputeAt;\\n        // The earliest observed state root for this bond which has had fraud\\n        bytes32 earliestDisputedStateRoot;\\n        // The state root's timestamp\\n        uint256 earliestTimestamp;\\n    }\\n\\n    // Per pre-state root, store the number of state provisions that were made\\n    // and how many of these calls were made by each user. Payouts will then be\\n    // claimed by users proportionally for that dispute.\\n    struct Rewards {\\n        // Flag to check if rewards for a fraud proof are claimable\\n        bool canClaim;\\n        // Total number of `recordGasSpent` calls made\\n        uint256 total;\\n        // The gas spent by each user to provide witness data. The sum of all\\n        // values inside this map MUST be equal to the value of `total`\\n        mapping(address => uint256) gasSpent;\\n    }\\n\\n\\n    /********************\\n     * Public Functions *\\n     ********************/\\n\\n    function recordGasSpent(\\n        bytes32 _preStateRoot,\\n        bytes32 _txHash,\\n        address _who,\\n        uint256 _gasSpent\\n    ) external;\\n\\n    function finalize(\\n        bytes32 _preStateRoot,\\n        address _publisher,\\n        uint256 _timestamp\\n    ) external;\\n\\n    function deposit() external;\\n\\n    function startWithdrawal() external;\\n\\n    function finalizeWithdrawal() external;\\n\\n    function claim(\\n        address _who\\n    ) external;\\n\\n    function isCollateralized(\\n        address _who\\n    ) external view returns (bool);\\n\\n    function getGasSpent(\\n        bytes32 _preStateRoot,\\n        address _who\\n    ) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x3c2a8a399487857158649db1896749d86e39cba545a8aeb2e2bb0f3bdfa7a5b1\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/iOVM/verification/iOVM_FraudVerifier.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\npragma experimental ABIEncoderV2;\\n\\n/* Library Imports */\\nimport { Lib_OVMCodec } from \\\"../../libraries/codec/Lib_OVMCodec.sol\\\";\\n\\n/* Interface Imports */\\nimport { iOVM_StateTransitioner } from \\\"./iOVM_StateTransitioner.sol\\\";\\n\\n/**\\n * @title iOVM_FraudVerifier\\n */\\ninterface iOVM_FraudVerifier {\\n\\n    /**********\\n     * Events *\\n     **********/\\n\\n    event FraudProofInitialized(\\n        bytes32 _preStateRoot,\\n        uint256 _preStateRootIndex,\\n        bytes32 _transactionHash,\\n        address _who\\n    );\\n\\n    event FraudProofFinalized(\\n        bytes32 _preStateRoot,\\n        uint256 _preStateRootIndex,\\n        bytes32 _transactionHash,\\n        address _who\\n    );\\n\\n\\n    /***************************************\\n     * Public Functions: Transition Status *\\n     ***************************************/\\n\\n    function getStateTransitioner(bytes32 _preStateRoot, bytes32 _txHash) external view returns (iOVM_StateTransitioner _transitioner);\\n\\n\\n    /****************************************\\n     * Public Functions: Fraud Verification *\\n     ****************************************/\\n\\n    function initializeFraudVerification(\\n        bytes32 _preStateRoot,\\n        Lib_OVMCodec.ChainBatchHeader calldata _preStateRootBatchHeader,\\n        Lib_OVMCodec.ChainInclusionProof calldata _preStateRootProof,\\n        Lib_OVMCodec.Transaction calldata _transaction,\\n        Lib_OVMCodec.TransactionChainElement calldata _txChainElement,\\n        Lib_OVMCodec.ChainBatchHeader calldata _transactionBatchHeader,\\n        Lib_OVMCodec.ChainInclusionProof calldata _transactionProof\\n    ) external;\\n\\n    function finalizeFraudVerification(\\n        bytes32 _preStateRoot,\\n        Lib_OVMCodec.ChainBatchHeader calldata _preStateRootBatchHeader,\\n        Lib_OVMCodec.ChainInclusionProof calldata _preStateRootProof,\\n        bytes32 _txHash,\\n        bytes32 _postStateRoot,\\n        Lib_OVMCodec.ChainBatchHeader calldata _postStateRootBatchHeader,\\n        Lib_OVMCodec.ChainInclusionProof calldata _postStateRootProof\\n    ) external;\\n}\\n\",\"keccak256\":\"0x5efd7bb18164bbd3e9d58379e8203fbf2a7ee802b1a48dff3ceaaec1523b1751\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/iOVM/verification/iOVM_StateTransitioner.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\npragma experimental ABIEncoderV2;\\n\\n/* Library Imports */\\nimport { Lib_OVMCodec } from \\\"../../libraries/codec/Lib_OVMCodec.sol\\\";\\n\\n/**\\n * @title iOVM_StateTransitioner\\n */\\ninterface iOVM_StateTransitioner {\\n\\n    /**********\\n     * Events *\\n     **********/\\n\\n    event AccountCommitted(\\n        address _address\\n    );\\n\\n    event ContractStorageCommitted(\\n        address _address,\\n        bytes32 _key\\n    );\\n\\n\\n    /**********************************\\n     * Public Functions: State Access *\\n     **********************************/\\n\\n    function getPreStateRoot() external view returns (bytes32 _preStateRoot);\\n    function getPostStateRoot() external view returns (bytes32 _postStateRoot);\\n    function isComplete() external view returns (bool _complete);\\n\\n\\n    /***********************************\\n     * Public Functions: Pre-Execution *\\n     ***********************************/\\n\\n    function proveContractState(\\n        address _ovmContractAddress,\\n        address _ethContractAddress,\\n        bytes calldata _stateTrieWitness\\n    ) external;\\n\\n    function proveStorageSlot(\\n        address _ovmContractAddress,\\n        bytes32 _key,\\n        bytes calldata _storageTrieWitness\\n    ) external;\\n\\n\\n    /*******************************\\n     * Public Functions: Execution *\\n     *******************************/\\n\\n    function applyTransaction(\\n        Lib_OVMCodec.Transaction calldata _transaction\\n    ) external;\\n\\n\\n    /************************************\\n     * Public Functions: Post-Execution *\\n     ************************************/\\n\\n    function commitContractState(\\n        address _ovmContractAddress,\\n        bytes calldata _stateTrieWitness\\n    ) external;\\n\\n    function commitStorageSlot(\\n        address _ovmContractAddress,\\n        bytes32 _key,\\n        bytes calldata _storageTrieWitness\\n    ) external;\\n\\n\\n    /**********************************\\n     * Public Functions: Finalization *\\n     **********************************/\\n\\n    function completeTransition() external;\\n}\\n\",\"keccak256\":\"0x3d044ac0a3bb6ad3d529f904b3191117511f9c379678ca03010e1ebdfcb5c34b\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/iOVM/verification/iOVM_StateTransitionerFactory.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* Contract Imports */\\nimport { iOVM_StateTransitioner } from \\\"./iOVM_StateTransitioner.sol\\\";\\n\\n/**\\n * @title iOVM_StateTransitionerFactory\\n */\\ninterface iOVM_StateTransitionerFactory {\\n\\n    /***************************************\\n     * Public Functions: Contract Creation *\\n     ***************************************/\\n\\n    function create(\\n        address _proxyManager,\\n        uint256 _stateTransitionIndex,\\n        bytes32 _preStateRoot,\\n        bytes32 _transactionHash\\n    )\\n        external\\n        returns (\\n            iOVM_StateTransitioner _ovmStateTransitioner\\n        );\\n}\\n\",\"keccak256\":\"0x60a0f0c104e4c0c7863268a93005762e8146d393f9cfddfdd6a2d6585c5911fc\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/codec/Lib_OVMCodec.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\npragma experimental ABIEncoderV2;\\n\\n/* Library Imports */\\nimport { Lib_RLPReader } from \\\"../rlp/Lib_RLPReader.sol\\\";\\nimport { Lib_RLPWriter } from \\\"../rlp/Lib_RLPWriter.sol\\\";\\nimport { Lib_BytesUtils } from \\\"../utils/Lib_BytesUtils.sol\\\";\\nimport { Lib_Bytes32Utils } from \\\"../utils/Lib_Bytes32Utils.sol\\\";\\n\\n/**\\n * @title Lib_OVMCodec\\n */\\nlibrary Lib_OVMCodec {\\n\\n    /*********\\n     * Enums *\\n     *********/\\n\\n    enum QueueOrigin {\\n        SEQUENCER_QUEUE,\\n        L1TOL2_QUEUE\\n    }\\n\\n\\n    /***********\\n     * Structs *\\n     ***********/\\n\\n    struct Account {\\n        uint256 nonce;\\n        uint256 balance;\\n        bytes32 storageRoot;\\n        bytes32 codeHash;\\n        address ethAddress;\\n        bool isFresh;\\n    }\\n\\n    struct EVMAccount {\\n        uint256 nonce;\\n        uint256 balance;\\n        bytes32 storageRoot;\\n        bytes32 codeHash;\\n    }\\n\\n    struct ChainBatchHeader {\\n        uint256 batchIndex;\\n        bytes32 batchRoot;\\n        uint256 batchSize;\\n        uint256 prevTotalElements;\\n        bytes extraData;\\n    }\\n\\n    struct ChainInclusionProof {\\n        uint256 index;\\n        bytes32[] siblings;\\n    }\\n\\n    struct Transaction {\\n        uint256 timestamp;\\n        uint256 blockNumber;\\n        QueueOrigin l1QueueOrigin;\\n        address l1TxOrigin;\\n        address entrypoint;\\n        uint256 gasLimit;\\n        bytes data;\\n    }\\n\\n    struct TransactionChainElement {\\n        bool isSequenced;\\n        uint256 queueIndex;  // QUEUED TX ONLY\\n        uint256 timestamp;   // SEQUENCER TX ONLY\\n        uint256 blockNumber; // SEQUENCER TX ONLY\\n        bytes txData;        // SEQUENCER TX ONLY\\n    }\\n\\n    struct QueueElement {\\n        bytes32 transactionHash;\\n        uint40 timestamp;\\n        uint40 blockNumber;\\n    }\\n\\n\\n    /**********************\\n     * Internal Functions *\\n     **********************/\\n\\n    /**\\n     * Encodes a standard OVM transaction.\\n     * @param _transaction OVM transaction to encode.\\n     * @return Encoded transaction bytes.\\n     */\\n    function encodeTransaction(\\n        Transaction memory _transaction\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes memory\\n        )\\n    {\\n        return abi.encodePacked(\\n            _transaction.timestamp,\\n            _transaction.blockNumber,\\n            _transaction.l1QueueOrigin,\\n            _transaction.l1TxOrigin,\\n            _transaction.entrypoint,\\n            _transaction.gasLimit,\\n            _transaction.data\\n        );\\n    }\\n\\n    /**\\n     * Hashes a standard OVM transaction.\\n     * @param _transaction OVM transaction to encode.\\n     * @return Hashed transaction\\n     */\\n    function hashTransaction(\\n        Transaction memory _transaction\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes32\\n        )\\n    {\\n        return keccak256(encodeTransaction(_transaction));\\n    }\\n\\n    /**\\n     * Converts an OVM account to an EVM account.\\n     * @param _in OVM account to convert.\\n     * @return Converted EVM account.\\n     */\\n    function toEVMAccount(\\n        Account memory _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            EVMAccount memory\\n        )\\n    {\\n        return EVMAccount({\\n            nonce: _in.nonce,\\n            balance: _in.balance,\\n            storageRoot: _in.storageRoot,\\n            codeHash: _in.codeHash\\n        });\\n    }\\n\\n    /**\\n     * @notice RLP-encodes an account state struct.\\n     * @param _account Account state struct.\\n     * @return RLP-encoded account state.\\n     */\\n    function encodeEVMAccount(\\n        EVMAccount memory _account\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes memory\\n        )\\n    {\\n        bytes[] memory raw = new bytes[](4);\\n\\n        // Unfortunately we can't create this array outright because\\n        // Lib_RLPWriter.writeList will reject fixed-size arrays. Assigning\\n        // index-by-index circumvents this issue.\\n        raw[0] = Lib_RLPWriter.writeBytes(\\n            Lib_Bytes32Utils.removeLeadingZeros(\\n                bytes32(_account.nonce)\\n            )\\n        );\\n        raw[1] = Lib_RLPWriter.writeBytes(\\n            Lib_Bytes32Utils.removeLeadingZeros(\\n                bytes32(_account.balance)\\n            )\\n        );\\n        raw[2] = Lib_RLPWriter.writeBytes(abi.encodePacked(_account.storageRoot));\\n        raw[3] = Lib_RLPWriter.writeBytes(abi.encodePacked(_account.codeHash));\\n\\n        return Lib_RLPWriter.writeList(raw);\\n    }\\n\\n    /**\\n     * @notice Decodes an RLP-encoded account state into a useful struct.\\n     * @param _encoded RLP-encoded account state.\\n     * @return Account state struct.\\n     */\\n    function decodeEVMAccount(\\n        bytes memory _encoded\\n    )\\n        internal\\n        pure\\n        returns (\\n            EVMAccount memory\\n        )\\n    {\\n        Lib_RLPReader.RLPItem[] memory accountState = Lib_RLPReader.readList(_encoded);\\n\\n        return EVMAccount({\\n            nonce: Lib_RLPReader.readUint256(accountState[0]),\\n            balance: Lib_RLPReader.readUint256(accountState[1]),\\n            storageRoot: Lib_RLPReader.readBytes32(accountState[2]),\\n            codeHash: Lib_RLPReader.readBytes32(accountState[3])\\n        });\\n    }\\n\\n    /**\\n     * Calculates a hash for a given batch header.\\n     * @param _batchHeader Header to hash.\\n     * @return Hash of the header.\\n     */\\n    function hashBatchHeader(\\n        Lib_OVMCodec.ChainBatchHeader memory _batchHeader\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes32\\n        )\\n    {\\n        return keccak256(\\n            abi.encode(\\n                _batchHeader.batchRoot,\\n                _batchHeader.batchSize,\\n                _batchHeader.prevTotalElements,\\n                _batchHeader.extraData\\n            )\\n        );\\n    }\\n}\\n\",\"keccak256\":\"0xd85ba2066057a2677926f484b938c7c2ef33ff3853f3b71cda252f4a54f30e05\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* External Imports */\\nimport { Ownable } from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\n/**\\n * @title Lib_AddressManager\\n */\\ncontract Lib_AddressManager is Ownable {\\n\\n    /**********\\n     * Events *\\n     **********/\\n\\n    event AddressSet(\\n        string _name,\\n        address _newAddress\\n    );\\n\\n\\n    /*************\\n     * Variables *\\n     *************/\\n\\n    mapping (bytes32 => address) private addresses;\\n\\n\\n    /********************\\n     * Public Functions *\\n     ********************/\\n\\n    /**\\n     * Changes the address associated with a particular name.\\n     * @param _name String name to associate an address with.\\n     * @param _address Address to associate with the name.\\n     */\\n    function setAddress(\\n        string memory _name,\\n        address _address\\n    )\\n        external\\n        onlyOwner\\n    {\\n        addresses[_getNameHash(_name)] = _address;\\n\\n        emit AddressSet(\\n            _name,\\n            _address\\n        );\\n    }\\n\\n    /**\\n     * Retrieves the address associated with a given name.\\n     * @param _name Name to retrieve an address for.\\n     * @return Address associated with the given name.\\n     */\\n    function getAddress(\\n        string memory _name\\n    )\\n        external\\n        view\\n        returns (\\n            address\\n        )\\n    {\\n        return addresses[_getNameHash(_name)];\\n    }\\n\\n\\n    /**********************\\n     * Internal Functions *\\n     **********************/\\n\\n    /**\\n     * Computes the hash of a name.\\n     * @param _name Name to compute a hash for.\\n     * @return Hash of the given name.\\n     */\\n    function _getNameHash(\\n        string memory _name\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes32\\n        )\\n    {\\n        return keccak256(abi.encodePacked(_name));\\n    }\\n}\\n\",\"keccak256\":\"0xcc9fc5c64f1101a5c6c397594086b1608189a9edc5c9635e1ac38f70aeeeecbf\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/resolver/Lib_AddressResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* Library Imports */\\nimport { Lib_AddressManager } from \\\"./Lib_AddressManager.sol\\\";\\n\\n/**\\n * @title Lib_AddressResolver\\n */\\nabstract contract Lib_AddressResolver {\\n\\n    /*************\\n     * Variables *\\n     *************/\\n\\n    Lib_AddressManager public libAddressManager;\\n\\n\\n    /***************\\n     * Constructor *\\n     ***************/\\n\\n    /**\\n     * @param _libAddressManager Address of the Lib_AddressManager.\\n     */\\n    constructor(\\n        address _libAddressManager\\n    ) {\\n        libAddressManager = Lib_AddressManager(_libAddressManager);\\n    }\\n\\n\\n    /********************\\n     * Public Functions *\\n     ********************/\\n\\n    /**\\n     * Resolves the address associated with a given name.\\n     * @param _name Name to resolve an address for.\\n     * @return Address associated with the given name.\\n     */\\n    function resolve(\\n        string memory _name\\n    )\\n        public\\n        view\\n        returns (\\n            address\\n        )\\n    {\\n        return libAddressManager.getAddress(_name);\\n    }\\n}\\n\",\"keccak256\":\"0x65981feeabff6a81783ea97d44baf988a18a86c8cb374c46fdb71819cbacc7c0\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/rlp/Lib_RLPReader.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/**\\n * @title Lib_RLPReader\\n * @dev Adapted from \\\"RLPReader\\\" by Hamdi Allam (hamdi.allam97@gmail.com).\\n */\\nlibrary Lib_RLPReader {\\n\\n    /*************\\n     * Constants *\\n     *************/\\n\\n    uint256 constant internal MAX_LIST_LENGTH = 32;\\n\\n\\n    /*********\\n     * Enums *\\n     *********/\\n\\n    enum RLPItemType {\\n        DATA_ITEM,\\n        LIST_ITEM\\n    }\\n\\n\\n    /***********\\n     * Structs *\\n     ***********/\\n\\n    struct RLPItem {\\n        uint256 length;\\n        uint256 ptr;\\n    }\\n\\n\\n    /**********************\\n     * Internal Functions *\\n     **********************/\\n\\n    /**\\n     * Converts bytes to a reference to memory position and length.\\n     * @param _in Input bytes to convert.\\n     * @return Output memory reference.\\n     */\\n    function toRLPItem(\\n        bytes memory _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            RLPItem memory\\n        )\\n    {\\n        uint256 ptr;\\n        assembly {\\n            ptr := add(_in, 32)\\n        }\\n\\n        return RLPItem({\\n            length: _in.length,\\n            ptr: ptr\\n        });\\n    }\\n\\n    /**\\n     * Reads an RLP list value into a list of RLP items.\\n     * @param _in RLP list value.\\n     * @return Decoded RLP list items.\\n     */\\n    function readList(\\n        RLPItem memory _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            RLPItem[] memory\\n        )\\n    {\\n        (\\n            uint256 listOffset,\\n            ,\\n            RLPItemType itemType\\n        ) = _decodeLength(_in);\\n\\n        require(\\n            itemType == RLPItemType.LIST_ITEM,\\n            \\\"Invalid RLP list value.\\\"\\n        );\\n\\n        // Solidity in-memory arrays can't be increased in size, but *can* be decreased in size by\\n        // writing to the length. Since we can't know the number of RLP items without looping over\\n        // the entire input, we'd have to loop twice to accurately size this array. It's easier to\\n        // simply set a reasonable maximum list length and decrease the size before we finish.\\n        RLPItem[] memory out = new RLPItem[](MAX_LIST_LENGTH);\\n\\n        uint256 itemCount = 0;\\n        uint256 offset = listOffset;\\n        while (offset < _in.length) {\\n            require(\\n                itemCount < MAX_LIST_LENGTH,\\n                \\\"Provided RLP list exceeds max list length.\\\"\\n            );\\n\\n            (\\n                uint256 itemOffset,\\n                uint256 itemLength,\\n            ) = _decodeLength(RLPItem({\\n                length: _in.length - offset,\\n                ptr: _in.ptr + offset\\n            }));\\n\\n            out[itemCount] = RLPItem({\\n                length: itemLength + itemOffset,\\n                ptr: _in.ptr + offset\\n            });\\n\\n            itemCount += 1;\\n            offset += itemOffset + itemLength;\\n        }\\n\\n        // Decrease the array size to match the actual item count.\\n        assembly {\\n            mstore(out, itemCount)\\n        }\\n\\n        return out;\\n    }\\n\\n    /**\\n     * Reads an RLP list value into a list of RLP items.\\n     * @param _in RLP list value.\\n     * @return Decoded RLP list items.\\n     */\\n    function readList(\\n        bytes memory _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            RLPItem[] memory\\n        )\\n    {\\n        return readList(\\n            toRLPItem(_in)\\n        );\\n    }\\n\\n    /**\\n     * Reads an RLP bytes value into bytes.\\n     * @param _in RLP bytes value.\\n     * @return Decoded bytes.\\n     */\\n    function readBytes(\\n        RLPItem memory _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes memory\\n        )\\n    {\\n        (\\n            uint256 itemOffset,\\n            uint256 itemLength,\\n            RLPItemType itemType\\n        ) = _decodeLength(_in);\\n\\n        require(\\n            itemType == RLPItemType.DATA_ITEM,\\n            \\\"Invalid RLP bytes value.\\\"\\n        );\\n\\n        return _copy(_in.ptr, itemOffset, itemLength);\\n    }\\n\\n    /**\\n     * Reads an RLP bytes value into bytes.\\n     * @param _in RLP bytes value.\\n     * @return Decoded bytes.\\n     */\\n    function readBytes(\\n        bytes memory _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes memory\\n        )\\n    {\\n        return readBytes(\\n            toRLPItem(_in)\\n        );\\n    }\\n\\n    /**\\n     * Reads an RLP string value into a string.\\n     * @param _in RLP string value.\\n     * @return Decoded string.\\n     */\\n    function readString(\\n        RLPItem memory _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            string memory\\n        )\\n    {\\n        return string(readBytes(_in));\\n    }\\n\\n    /**\\n     * Reads an RLP string value into a string.\\n     * @param _in RLP string value.\\n     * @return Decoded string.\\n     */\\n    function readString(\\n        bytes memory _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            string memory\\n        )\\n    {\\n        return readString(\\n            toRLPItem(_in)\\n        );\\n    }\\n\\n    /**\\n     * Reads an RLP bytes32 value into a bytes32.\\n     * @param _in RLP bytes32 value.\\n     * @return Decoded bytes32.\\n     */\\n    function readBytes32(\\n        RLPItem memory _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes32\\n        )\\n    {\\n        require(\\n            _in.length <= 33,\\n            \\\"Invalid RLP bytes32 value.\\\"\\n        );\\n\\n        (\\n            uint256 itemOffset,\\n            uint256 itemLength,\\n            RLPItemType itemType\\n        ) = _decodeLength(_in);\\n\\n        require(\\n            itemType == RLPItemType.DATA_ITEM,\\n            \\\"Invalid RLP bytes32 value.\\\"\\n        );\\n\\n        uint256 ptr = _in.ptr + itemOffset;\\n        bytes32 out;\\n        assembly {\\n            out := mload(ptr)\\n\\n            // Shift the bytes over to match the item size.\\n            if lt(itemLength, 32) {\\n                out := div(out, exp(256, sub(32, itemLength)))\\n            }\\n        }\\n\\n        return out;\\n    }\\n\\n    /**\\n     * Reads an RLP bytes32 value into a bytes32.\\n     * @param _in RLP bytes32 value.\\n     * @return Decoded bytes32.\\n     */\\n    function readBytes32(\\n        bytes memory _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes32\\n        )\\n    {\\n        return readBytes32(\\n            toRLPItem(_in)\\n        );\\n    }\\n\\n    /**\\n     * Reads an RLP uint256 value into a uint256.\\n     * @param _in RLP uint256 value.\\n     * @return Decoded uint256.\\n     */\\n    function readUint256(\\n        RLPItem memory _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            uint256\\n        )\\n    {\\n        return uint256(readBytes32(_in));\\n    }\\n\\n    /**\\n     * Reads an RLP uint256 value into a uint256.\\n     * @param _in RLP uint256 value.\\n     * @return Decoded uint256.\\n     */\\n    function readUint256(\\n        bytes memory _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            uint256\\n        )\\n    {\\n        return readUint256(\\n            toRLPItem(_in)\\n        );\\n    }\\n\\n    /**\\n     * Reads an RLP bool value into a bool.\\n     * @param _in RLP bool value.\\n     * @return Decoded bool.\\n     */\\n    function readBool(\\n        RLPItem memory _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            bool\\n        )\\n    {\\n        require(\\n            _in.length == 1,\\n            \\\"Invalid RLP boolean value.\\\"\\n        );\\n\\n        uint256 ptr = _in.ptr;\\n        uint256 out;\\n        assembly {\\n            out := byte(0, mload(ptr))\\n        }\\n\\n        require(\\n            out == 0 || out == 1,\\n            \\\"Lib_RLPReader: Invalid RLP boolean value, must be 0 or 1\\\"\\n        );\\n\\n        return out != 0;\\n    }\\n\\n    /**\\n     * Reads an RLP bool value into a bool.\\n     * @param _in RLP bool value.\\n     * @return Decoded bool.\\n     */\\n    function readBool(\\n        bytes memory _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            bool\\n        )\\n    {\\n        return readBool(\\n            toRLPItem(_in)\\n        );\\n    }\\n\\n    /**\\n     * Reads an RLP address value into a address.\\n     * @param _in RLP address value.\\n     * @return Decoded address.\\n     */\\n    function readAddress(\\n        RLPItem memory _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            address\\n        )\\n    {\\n        if (_in.length == 1) {\\n            return address(0);\\n        }\\n\\n        require(\\n            _in.length == 21,\\n            \\\"Invalid RLP address value.\\\"\\n        );\\n\\n        return address(readUint256(_in));\\n    }\\n\\n    /**\\n     * Reads an RLP address value into a address.\\n     * @param _in RLP address value.\\n     * @return Decoded address.\\n     */\\n    function readAddress(\\n        bytes memory _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            address\\n        )\\n    {\\n        return readAddress(\\n            toRLPItem(_in)\\n        );\\n    }\\n\\n    /**\\n     * Reads the raw bytes of an RLP item.\\n     * @param _in RLP item to read.\\n     * @return Raw RLP bytes.\\n     */\\n    function readRawBytes(\\n        RLPItem memory _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes memory\\n        )\\n    {\\n        return _copy(_in);\\n    }\\n\\n\\n    /*********************\\n     * Private Functions *\\n     *********************/\\n\\n    /**\\n     * Decodes the length of an RLP item.\\n     * @param _in RLP item to decode.\\n     * @return Offset of the encoded data.\\n     * @return Length of the encoded data.\\n     * @return RLP item type (LIST_ITEM or DATA_ITEM).\\n     */\\n    function _decodeLength(\\n        RLPItem memory _in\\n    )\\n        private\\n        pure\\n        returns (\\n            uint256,\\n            uint256,\\n            RLPItemType\\n        )\\n    {\\n        require(\\n            _in.length > 0,\\n            \\\"RLP item cannot be null.\\\"\\n        );\\n\\n        uint256 ptr = _in.ptr;\\n        uint256 prefix;\\n        assembly {\\n            prefix := byte(0, mload(ptr))\\n        }\\n\\n        if (prefix <= 0x7f) {\\n            // Single byte.\\n\\n            return (0, 1, RLPItemType.DATA_ITEM);\\n        } else if (prefix <= 0xb7) {\\n            // Short string.\\n\\n            uint256 strLen = prefix - 0x80;\\n\\n            require(\\n                _in.length > strLen,\\n                \\\"Invalid RLP short string.\\\"\\n            );\\n\\n            return (1, strLen, RLPItemType.DATA_ITEM);\\n        } else if (prefix <= 0xbf) {\\n            // Long string.\\n            uint256 lenOfStrLen = prefix - 0xb7;\\n\\n            require(\\n                _in.length > lenOfStrLen,\\n                \\\"Invalid RLP long string length.\\\"\\n            );\\n\\n            uint256 strLen;\\n            assembly {\\n                // Pick out the string length.\\n                strLen := div(\\n                    mload(add(ptr, 1)),\\n                    exp(256, sub(32, lenOfStrLen))\\n                )\\n            }\\n\\n            require(\\n                _in.length > lenOfStrLen + strLen,\\n                \\\"Invalid RLP long string.\\\"\\n            );\\n\\n            return (1 + lenOfStrLen, strLen, RLPItemType.DATA_ITEM);\\n        } else if (prefix <= 0xf7) {\\n            // Short list.\\n            uint256 listLen = prefix - 0xc0;\\n\\n            require(\\n                _in.length > listLen,\\n                \\\"Invalid RLP short list.\\\"\\n            );\\n\\n            return (1, listLen, RLPItemType.LIST_ITEM);\\n        } else {\\n            // Long list.\\n            uint256 lenOfListLen = prefix - 0xf7;\\n\\n            require(\\n                _in.length > lenOfListLen,\\n                \\\"Invalid RLP long list length.\\\"\\n            );\\n\\n            uint256 listLen;\\n            assembly {\\n                // Pick out the list length.\\n                listLen := div(\\n                    mload(add(ptr, 1)),\\n                    exp(256, sub(32, lenOfListLen))\\n                )\\n            }\\n\\n            require(\\n                _in.length > lenOfListLen + listLen,\\n                \\\"Invalid RLP long list.\\\"\\n            );\\n\\n            return (1 + lenOfListLen, listLen, RLPItemType.LIST_ITEM);\\n        }\\n    }\\n\\n    /**\\n     * Copies the bytes from a memory location.\\n     * @param _src Pointer to the location to read from.\\n     * @param _offset Offset to start reading from.\\n     * @param _length Number of bytes to read.\\n     * @return Copied bytes.\\n     */\\n    function _copy(\\n        uint256 _src,\\n        uint256 _offset,\\n        uint256 _length\\n    )\\n        private\\n        pure\\n        returns (\\n            bytes memory\\n        )\\n    {\\n        bytes memory out = new bytes(_length);\\n        if (out.length == 0) {\\n            return out;\\n        }\\n\\n        uint256 src = _src + _offset;\\n        uint256 dest;\\n        assembly {\\n            dest := add(out, 32)\\n        }\\n\\n        // Copy over as many complete words as we can.\\n        for (uint256 i = 0; i < _length / 32; i++) {\\n            assembly {\\n                mstore(dest, mload(src))\\n            }\\n\\n            src += 32;\\n            dest += 32;\\n        }\\n\\n        // Pick out the remaining bytes.\\n        uint256 mask = 256 ** (32 - (_length % 32)) - 1;\\n        assembly {\\n            mstore(\\n                dest,\\n                or(\\n                    and(mload(src), not(mask)),\\n                    and(mload(dest), mask)\\n                )\\n            )\\n        }\\n\\n        return out;\\n    }\\n\\n    /**\\n     * Copies an RLP item into bytes.\\n     * @param _in RLP item to copy.\\n     * @return Copied bytes.\\n     */\\n    function _copy(\\n        RLPItem memory _in\\n    )\\n        private\\n        pure\\n        returns (\\n            bytes memory\\n        )\\n    {\\n        return _copy(_in.ptr, 0, _in.length);\\n    }\\n}\\n\",\"keccak256\":\"0x829174c61216dce35fdb888383b6022e0365eb7fbdc71ad79d98b108091969fe\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/rlp/Lib_RLPWriter.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\npragma experimental ABIEncoderV2;\\n\\n/**\\n * @title Lib_RLPWriter\\n * @author Bakaoh (with modifications)\\n */\\nlibrary Lib_RLPWriter {\\n\\n    /**********************\\n     * Internal Functions *\\n     **********************/\\n\\n    /**\\n     * RLP encodes a byte string.\\n     * @param _in The byte string to encode.\\n     * @return The RLP encoded string in bytes.\\n     */\\n    function writeBytes(\\n        bytes memory _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes memory\\n        )\\n    {\\n        bytes memory encoded;\\n\\n        if (_in.length == 1 && uint8(_in[0]) < 128) {\\n            encoded = _in;\\n        } else {\\n            encoded = abi.encodePacked(_writeLength(_in.length, 128), _in);\\n        }\\n\\n        return encoded;\\n    }\\n\\n    /**\\n     * RLP encodes a list of RLP encoded byte byte strings.\\n     * @param _in The list of RLP encoded byte strings.\\n     * @return The RLP encoded list of items in bytes.\\n     */\\n    function writeList(\\n        bytes[] memory _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes memory\\n        )\\n    {\\n        bytes memory list = _flatten(_in);\\n        return abi.encodePacked(_writeLength(list.length, 192), list);\\n    }\\n\\n    /**\\n     * RLP encodes a string.\\n     * @param _in The string to encode.\\n     * @return The RLP encoded string in bytes.\\n     */\\n    function writeString(\\n        string memory _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes memory\\n        )\\n    {\\n        return writeBytes(bytes(_in));\\n    }\\n\\n    /**\\n     * RLP encodes an address.\\n     * @param _in The address to encode.\\n     * @return The RLP encoded address in bytes.\\n     */\\n    function writeAddress(\\n        address _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes memory\\n        )\\n    {\\n        return writeBytes(abi.encodePacked(_in));\\n    }\\n\\n    /**\\n     * RLP encodes a bytes32 value.\\n     * @param _in The bytes32 to encode.\\n     * @return _out The RLP encoded bytes32 in bytes.\\n     */\\n    function writeBytes32(\\n        bytes32 _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes memory _out\\n        )\\n    {\\n        return writeBytes(abi.encodePacked(_in));\\n    }\\n\\n    /**\\n     * RLP encodes a uint.\\n     * @param _in The uint256 to encode.\\n     * @return The RLP encoded uint256 in bytes.\\n     */\\n    function writeUint(\\n        uint256 _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes memory\\n        )\\n    {\\n        return writeBytes(_toBinary(_in));\\n    }\\n\\n    /**\\n     * RLP encodes a bool.\\n     * @param _in The bool to encode.\\n     * @return The RLP encoded bool in bytes.\\n     */\\n    function writeBool(\\n        bool _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes memory\\n        )\\n    {\\n        bytes memory encoded = new bytes(1);\\n        encoded[0] = (_in ? bytes1(0x01) : bytes1(0x80));\\n        return encoded;\\n    }\\n\\n\\n    /*********************\\n     * Private Functions *\\n     *********************/\\n\\n    /**\\n     * Encode the first byte, followed by the `len` in binary form if `length` is more than 55.\\n     * @param _len The length of the string or the payload.\\n     * @param _offset 128 if item is string, 192 if item is list.\\n     * @return RLP encoded bytes.\\n     */\\n    function _writeLength(\\n        uint256 _len,\\n        uint256 _offset\\n    )\\n        private\\n        pure\\n        returns (\\n            bytes memory\\n        )\\n    {\\n        bytes memory encoded;\\n\\n        if (_len < 56) {\\n            encoded = new bytes(1);\\n            encoded[0] = byte(uint8(_len) + uint8(_offset));\\n        } else {\\n            uint256 lenLen;\\n            uint256 i = 1;\\n            while (_len / i != 0) {\\n                lenLen++;\\n                i *= 256;\\n            }\\n\\n            encoded = new bytes(lenLen + 1);\\n            encoded[0] = byte(uint8(lenLen) + uint8(_offset) + 55);\\n            for(i = 1; i <= lenLen; i++) {\\n                encoded[i] = byte(uint8((_len / (256**(lenLen-i))) % 256));\\n            }\\n        }\\n\\n        return encoded;\\n    }\\n\\n    /**\\n     * Encode integer in big endian binary form with no leading zeroes.\\n     * @notice TODO: This should be optimized with assembly to save gas costs.\\n     * @param _x The integer to encode.\\n     * @return RLP encoded bytes.\\n     */\\n    function _toBinary(\\n        uint256 _x\\n    )\\n        private\\n        pure\\n        returns (\\n            bytes memory\\n        )\\n    {\\n        bytes memory b = abi.encodePacked(_x);\\n\\n        uint256 i = 0;\\n        for (; i < 32; i++) {\\n            if (b[i] != 0) {\\n                break;\\n            }\\n        }\\n\\n        bytes memory res = new bytes(32 - i);\\n        for (uint256 j = 0; j < res.length; j++) {\\n            res[j] = b[i++];\\n        }\\n\\n        return res;\\n    }\\n\\n    /**\\n     * Copies a piece of memory to another location.\\n     * @notice From: https://github.com/Arachnid/solidity-stringutils/blob/master/src/strings.sol.\\n     * @param _dest Destination location.\\n     * @param _src Source location.\\n     * @param _len Length of memory to copy.\\n     */\\n    function _memcpy(\\n        uint256 _dest,\\n        uint256 _src,\\n        uint256 _len\\n    )\\n        private\\n        pure\\n    {\\n        uint256 dest = _dest;\\n        uint256 src = _src;\\n        uint256 len = _len;\\n\\n        for(; len >= 32; len -= 32) {\\n            assembly {\\n                mstore(dest, mload(src))\\n            }\\n            dest += 32;\\n            src += 32;\\n        }\\n\\n        uint256 mask = 256 ** (32 - len) - 1;\\n        assembly {\\n            let srcpart := and(mload(src), not(mask))\\n            let destpart := and(mload(dest), mask)\\n            mstore(dest, or(destpart, srcpart))\\n        }\\n    }\\n\\n    /**\\n     * Flattens a list of byte strings into one byte string.\\n     * @notice From: https://github.com/sammayo/solidity-rlp-encoder/blob/master/RLPEncode.sol.\\n     * @param _list List of byte strings to flatten.\\n     * @return The flattened byte string.\\n     */\\n    function _flatten(\\n        bytes[] memory _list\\n    )\\n        private\\n        pure\\n        returns (\\n            bytes memory\\n        )\\n    {\\n        if (_list.length == 0) {\\n            return new bytes(0);\\n        }\\n\\n        uint256 len;\\n        uint256 i = 0;\\n        for (; i < _list.length; i++) {\\n            len += _list[i].length;\\n        }\\n\\n        bytes memory flattened = new bytes(len);\\n        uint256 flattenedPtr;\\n        assembly { flattenedPtr := add(flattened, 0x20) }\\n\\n        for(i = 0; i < _list.length; i++) {\\n            bytes memory item = _list[i];\\n\\n            uint256 listPtr;\\n            assembly { listPtr := add(item, 0x20)}\\n\\n            _memcpy(flattenedPtr, listPtr, item.length);\\n            flattenedPtr += _list[i].length;\\n        }\\n\\n        return flattened;\\n    }\\n}\\n\",\"keccak256\":\"0xb60ee4b03ad372c3deff21d454ab714dd0c18ee3e6f9d45532e209fc59d5a54d\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/trie/Lib_MerkleTrie.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* Library Imports */\\nimport { Lib_BytesUtils } from \\\"../utils/Lib_BytesUtils.sol\\\";\\nimport { Lib_RLPReader } from \\\"../rlp/Lib_RLPReader.sol\\\";\\nimport { Lib_RLPWriter } from \\\"../rlp/Lib_RLPWriter.sol\\\";\\n\\n/**\\n * @title Lib_MerkleTrie\\n */\\nlibrary Lib_MerkleTrie {\\n\\n    /*******************\\n     * Data Structures *\\n     *******************/\\n\\n    enum NodeType {\\n        BranchNode,\\n        ExtensionNode,\\n        LeafNode\\n    }\\n\\n    struct TrieNode {\\n        bytes encoded;\\n        Lib_RLPReader.RLPItem[] decoded;\\n    }\\n\\n\\n    /**********************\\n     * Contract Constants *\\n     **********************/\\n\\n    // TREE_RADIX determines the number of elements per branch node.\\n    uint256 constant TREE_RADIX = 16;\\n    // Branch nodes have TREE_RADIX elements plus an additional `value` slot.\\n    uint256 constant BRANCH_NODE_LENGTH = TREE_RADIX + 1;\\n    // Leaf nodes and extension nodes always have two elements, a `path` and a `value`.\\n    uint256 constant LEAF_OR_EXTENSION_NODE_LENGTH = 2;\\n\\n    // Prefixes are prepended to the `path` within a leaf or extension node and\\n    // allow us to differentiate between the two node types. `ODD` or `EVEN` is\\n    // determined by the number of nibbles within the unprefixed `path`. If the\\n    // number of nibbles if even, we need to insert an extra padding nibble so\\n    // the resulting prefixed `path` has an even number of nibbles.\\n    uint8 constant PREFIX_EXTENSION_EVEN = 0;\\n    uint8 constant PREFIX_EXTENSION_ODD = 1;\\n    uint8 constant PREFIX_LEAF_EVEN = 2;\\n    uint8 constant PREFIX_LEAF_ODD = 3;\\n\\n    // Just a utility constant. RLP represents `NULL` as 0x80.\\n    bytes1 constant RLP_NULL = bytes1(0x80);\\n    bytes constant RLP_NULL_BYTES = hex'80';\\n    bytes32 constant internal KECCAK256_RLP_NULL_BYTES = keccak256(RLP_NULL_BYTES);\\n\\n\\n    /**********************\\n     * Internal Functions *\\n     **********************/\\n\\n    /**\\n     * @notice Verifies a proof that a given key/value pair is present in the\\n     * Merkle trie.\\n     * @param _key Key of the node to search for, as a hex string.\\n     * @param _value Value of the node to search for, as a hex string.\\n     * @param _proof Merkle trie inclusion proof for the desired node. Unlike\\n     * traditional Merkle trees, this proof is executed top-down and consists\\n     * of a list of RLP-encoded nodes that make a path down to the target node.\\n     * @param _root Known root of the Merkle trie. Used to verify that the\\n     * included proof is correctly constructed.\\n     * @return _verified `true` if the k/v pair exists in the trie, `false` otherwise.\\n     */\\n    function verifyInclusionProof(\\n        bytes memory _key,\\n        bytes memory _value,\\n        bytes memory _proof,\\n        bytes32 _root\\n    )\\n        internal\\n        pure\\n        returns (\\n            bool _verified\\n        )\\n    {\\n        (\\n            bool exists,\\n            bytes memory value\\n        ) = get(_key, _proof, _root);\\n\\n        return (\\n            exists && Lib_BytesUtils.equal(_value, value)\\n        );\\n    }\\n\\n    /**\\n     * @notice Updates a Merkle trie and returns a new root hash.\\n     * @param _key Key of the node to update, as a hex string.\\n     * @param _value Value of the node to update, as a hex string.\\n     * @param _proof Merkle trie inclusion proof for the node *nearest* the\\n     * target node. If the key exists, we can simply update the value.\\n     * Otherwise, we need to modify the trie to handle the new k/v pair.\\n     * @param _root Known root of the Merkle trie. Used to verify that the\\n     * included proof is correctly constructed.\\n     * @return _updatedRoot Root hash of the newly constructed trie.\\n     */\\n    function update(\\n        bytes memory _key,\\n        bytes memory _value,\\n        bytes memory _proof,\\n        bytes32 _root\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes32 _updatedRoot\\n        )\\n    {\\n        // Special case when inserting the very first node.\\n        if (_root == KECCAK256_RLP_NULL_BYTES) {\\n            return getSingleNodeRootHash(_key, _value);\\n        }\\n\\n        TrieNode[] memory proof = _parseProof(_proof);\\n        (uint256 pathLength, bytes memory keyRemainder, ) = _walkNodePath(proof, _key, _root);\\n        TrieNode[] memory newPath = _getNewPath(proof, pathLength, _key, keyRemainder, _value);\\n\\n        return _getUpdatedTrieRoot(newPath, _key);\\n    }\\n\\n    /**\\n     * @notice Retrieves the value associated with a given key.\\n     * @param _key Key to search for, as hex bytes.\\n     * @param _proof Merkle trie inclusion proof for the key.\\n     * @param _root Known root of the Merkle trie.\\n     * @return _exists Whether or not the key exists.\\n     * @return _value Value of the key if it exists.\\n     */\\n    function get(\\n        bytes memory _key,\\n        bytes memory _proof,\\n        bytes32 _root\\n    )\\n        internal\\n        pure\\n        returns (\\n            bool _exists,\\n            bytes memory _value\\n        )\\n    {\\n        TrieNode[] memory proof = _parseProof(_proof);\\n        (uint256 pathLength, bytes memory keyRemainder, bool isFinalNode) = _walkNodePath(proof, _key, _root);\\n\\n        bool exists = keyRemainder.length == 0;\\n\\n        require(\\n            exists || isFinalNode,\\n            \\\"Provided proof is invalid.\\\"\\n        );\\n\\n        bytes memory value = exists ? _getNodeValue(proof[pathLength - 1]) : bytes('');\\n\\n        return (\\n            exists,\\n            value\\n        );\\n    }\\n\\n    /**\\n     * Computes the root hash for a trie with a single node.\\n     * @param _key Key for the single node.\\n     * @param _value Value for the single node.\\n     * @return _updatedRoot Hash of the trie.\\n     */\\n    function getSingleNodeRootHash(\\n        bytes memory _key,\\n        bytes memory _value\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes32 _updatedRoot\\n        )\\n    {\\n        return keccak256(_makeLeafNode(\\n            Lib_BytesUtils.toNibbles(_key),\\n            _value\\n        ).encoded);\\n    }\\n\\n\\n    /*********************\\n     * Private Functions *\\n     *********************/\\n\\n    /**\\n     * @notice Walks through a proof using a provided key.\\n     * @param _proof Inclusion proof to walk through.\\n     * @param _key Key to use for the walk.\\n     * @param _root Known root of the trie.\\n     * @return _pathLength Length of the final path\\n     * @return _keyRemainder Portion of the key remaining after the walk.\\n     * @return _isFinalNode Whether or not we've hit a dead end.\\n     */\\n    function _walkNodePath(\\n        TrieNode[] memory _proof,\\n        bytes memory _key,\\n        bytes32 _root\\n    )\\n        private\\n        pure\\n        returns (\\n            uint256 _pathLength,\\n            bytes memory _keyRemainder,\\n            bool _isFinalNode\\n        )\\n    {\\n        uint256 pathLength = 0;\\n        bytes memory key = Lib_BytesUtils.toNibbles(_key);\\n\\n        bytes32 currentNodeID = _root;\\n        uint256 currentKeyIndex = 0;\\n        uint256 currentKeyIncrement = 0;\\n        TrieNode memory currentNode;\\n\\n        // Proof is top-down, so we start at the first element (root).\\n        for (uint256 i = 0; i < _proof.length; i++) {\\n            currentNode = _proof[i];\\n            currentKeyIndex += currentKeyIncrement;\\n\\n            // Keep track of the proof elements we actually need.\\n            // It's expensive to resize arrays, so this simply reduces gas costs.\\n            pathLength += 1;\\n\\n            if (currentKeyIndex == 0) {\\n                // First proof element is always the root node.\\n                require(\\n                    keccak256(currentNode.encoded) == currentNodeID,\\n                    \\\"Invalid root hash\\\"\\n                );\\n            } else if (currentNode.encoded.length >= 32) {\\n                // Nodes 32 bytes or larger are hashed inside branch nodes.\\n                require(\\n                    keccak256(currentNode.encoded) == currentNodeID,\\n                    \\\"Invalid large internal hash\\\"\\n                );\\n            } else {\\n                // Nodes smaller than 31 bytes aren't hashed.\\n                require(\\n                    Lib_BytesUtils.toBytes32(currentNode.encoded) == currentNodeID,\\n                    \\\"Invalid internal node hash\\\"\\n                );\\n            }\\n\\n            if (currentNode.decoded.length == BRANCH_NODE_LENGTH) {\\n                if (currentKeyIndex == key.length) {\\n                    // We've hit the end of the key, meaning the value should be within this branch node.\\n                    break;\\n                } else {\\n                    // We're not at the end of the key yet.\\n                    // Figure out what the next node ID should be and continue.\\n                    uint8 branchKey = uint8(key[currentKeyIndex]);\\n                    Lib_RLPReader.RLPItem memory nextNode = currentNode.decoded[branchKey];\\n                    currentNodeID = _getNodeID(nextNode);\\n                    currentKeyIncrement = 1;\\n                    continue;\\n                }\\n            } else if (currentNode.decoded.length == LEAF_OR_EXTENSION_NODE_LENGTH) {\\n                bytes memory path = _getNodePath(currentNode);\\n                uint8 prefix = uint8(path[0]);\\n                uint8 offset = 2 - prefix % 2;\\n                bytes memory pathRemainder = Lib_BytesUtils.slice(path, offset);\\n                bytes memory keyRemainder = Lib_BytesUtils.slice(key, currentKeyIndex);\\n                uint256 sharedNibbleLength = _getSharedNibbleLength(pathRemainder, keyRemainder);\\n\\n                if (prefix == PREFIX_LEAF_EVEN || prefix == PREFIX_LEAF_ODD) {\\n                    if (\\n                        pathRemainder.length == sharedNibbleLength &&\\n                        keyRemainder.length == sharedNibbleLength\\n                    ) {\\n                        // The key within this leaf matches our key exactly.\\n                        // Increment the key index to reflect that we have no remainder.\\n                        currentKeyIndex += sharedNibbleLength;\\n                    }\\n\\n                    // We've hit a leaf node, so our next node should be NULL.\\n                    currentNodeID = bytes32(RLP_NULL);\\n                    break;\\n                } else if (prefix == PREFIX_EXTENSION_EVEN || prefix == PREFIX_EXTENSION_ODD) {\\n                    if (sharedNibbleLength != pathRemainder.length) {\\n                        // Our extension node is not identical to the remainder.\\n                        // We've hit the end of this path, updates will need to modify this extension.\\n                        currentNodeID = bytes32(RLP_NULL);\\n                        break;\\n                    } else {\\n                        // Our extension shares some nibbles.\\n                        // Carry on to the next node.\\n                        currentNodeID = _getNodeID(currentNode.decoded[1]);\\n                        currentKeyIncrement = sharedNibbleLength;\\n                        continue;\\n                    }\\n                } else {\\n                    revert(\\\"Received a node with an unknown prefix\\\");\\n                }\\n            } else {\\n                revert(\\\"Received an unparseable node.\\\");\\n            }\\n        }\\n\\n        // If our node ID is NULL, then we're at a dead end.\\n        bool isFinalNode = currentNodeID == bytes32(RLP_NULL);\\n        return (pathLength, Lib_BytesUtils.slice(key, currentKeyIndex), isFinalNode);\\n    }\\n\\n    /**\\n     * @notice Creates new nodes to support a k/v pair insertion into a given Merkle trie path.\\n     * @param _path Path to the node nearest the k/v pair.\\n     * @param _pathLength Length of the path. Necessary because the provided path may include\\n     *  additional nodes (e.g., it comes directly from a proof) and we can't resize in-memory\\n     *  arrays without costly duplication.\\n     * @param _key Full original key.\\n     * @param _keyRemainder Portion of the initial key that must be inserted into the trie.\\n     * @param _value Value to insert at the given key.\\n     * @return _newPath A new path with the inserted k/v pair and extra supporting nodes.\\n     */\\n    function _getNewPath(\\n        TrieNode[] memory _path,\\n        uint256 _pathLength,\\n        bytes memory _key,\\n        bytes memory _keyRemainder,\\n        bytes memory _value\\n    )\\n        private\\n        pure\\n        returns (\\n            TrieNode[] memory _newPath\\n        )\\n    {\\n        bytes memory keyRemainder = _keyRemainder;\\n\\n        // Most of our logic depends on the status of the last node in the path.\\n        TrieNode memory lastNode = _path[_pathLength - 1];\\n        NodeType lastNodeType = _getNodeType(lastNode);\\n\\n        // Create an array for newly created nodes.\\n        // We need up to three new nodes, depending on the contents of the last node.\\n        // Since array resizing is expensive, we'll keep track of the size manually.\\n        // We're using an explicit `totalNewNodes += 1` after insertions for clarity.\\n        TrieNode[] memory newNodes = new TrieNode[](3);\\n        uint256 totalNewNodes = 0;\\n\\n        // Reference: https://github.com/ethereumjs/merkle-patricia-tree/blob/c0a10395aab37d42c175a47114ebfcbd7efcf059/src/baseTrie.ts#L294-L313\\n        bool matchLeaf = false;\\n        if (lastNodeType == NodeType.LeafNode) {\\n            uint256 l = 0;\\n            if (_path.length > 0) {\\n                for (uint256 i = 0; i < _path.length - 1; i++) {\\n                    if (_getNodeType(_path[i]) == NodeType.BranchNode) {\\n                        l++;\\n                    } else {\\n                        l += _getNodeKey(_path[i]).length;\\n                    }\\n                }\\n            }\\n\\n            if (\\n                _getSharedNibbleLength(\\n                    _getNodeKey(lastNode),\\n                    Lib_BytesUtils.slice(Lib_BytesUtils.toNibbles(_key), l)\\n                ) == _getNodeKey(lastNode).length\\n                && keyRemainder.length == 0\\n            ) {\\n                matchLeaf = true;\\n            }\\n        }\\n\\n        if (matchLeaf) {\\n            // We've found a leaf node with the given key.\\n            // Simply need to update the value of the node to match.\\n            newNodes[totalNewNodes] = _makeLeafNode(_getNodeKey(lastNode), _value);\\n            totalNewNodes += 1;\\n        } else if (lastNodeType == NodeType.BranchNode) {\\n            if (keyRemainder.length == 0) {\\n                // We've found a branch node with the given key.\\n                // Simply need to update the value of the node to match.\\n                newNodes[totalNewNodes] = _editBranchValue(lastNode, _value);\\n                totalNewNodes += 1;\\n            } else {\\n                // We've found a branch node, but it doesn't contain our key.\\n                // Reinsert the old branch for now.\\n                newNodes[totalNewNodes] = lastNode;\\n                totalNewNodes += 1;\\n                // Create a new leaf node, slicing our remainder since the first byte points\\n                // to our branch node.\\n                newNodes[totalNewNodes] = _makeLeafNode(Lib_BytesUtils.slice(keyRemainder, 1), _value);\\n                totalNewNodes += 1;\\n            }\\n        } else {\\n            // Our last node is either an extension node or a leaf node with a different key.\\n            bytes memory lastNodeKey = _getNodeKey(lastNode);\\n            uint256 sharedNibbleLength = _getSharedNibbleLength(lastNodeKey, keyRemainder);\\n\\n            if (sharedNibbleLength != 0) {\\n                // We've got some shared nibbles between the last node and our key remainder.\\n                // We'll need to insert an extension node that covers these shared nibbles.\\n                bytes memory nextNodeKey = Lib_BytesUtils.slice(lastNodeKey, 0, sharedNibbleLength);\\n                newNodes[totalNewNodes] = _makeExtensionNode(nextNodeKey, _getNodeHash(_value));\\n                totalNewNodes += 1;\\n\\n                // Cut down the keys since we've just covered these shared nibbles.\\n                lastNodeKey = Lib_BytesUtils.slice(lastNodeKey, sharedNibbleLength);\\n                keyRemainder = Lib_BytesUtils.slice(keyRemainder, sharedNibbleLength);\\n            }\\n\\n            // Create an empty branch to fill in.\\n            TrieNode memory newBranch = _makeEmptyBranchNode();\\n\\n            if (lastNodeKey.length == 0) {\\n                // Key remainder was larger than the key for our last node.\\n                // The value within our last node is therefore going to be shifted into\\n                // a branch value slot.\\n                newBranch = _editBranchValue(newBranch, _getNodeValue(lastNode));\\n            } else {\\n                // Last node key was larger than the key remainder.\\n                // We're going to modify some index of our branch.\\n                uint8 branchKey = uint8(lastNodeKey[0]);\\n                // Move on to the next nibble.\\n                lastNodeKey = Lib_BytesUtils.slice(lastNodeKey, 1);\\n\\n                if (lastNodeType == NodeType.LeafNode) {\\n                    // We're dealing with a leaf node.\\n                    // We'll modify the key and insert the old leaf node into the branch index.\\n                    TrieNode memory modifiedLastNode = _makeLeafNode(lastNodeKey, _getNodeValue(lastNode));\\n                    newBranch = _editBranchIndex(newBranch, branchKey, _getNodeHash(modifiedLastNode.encoded));\\n                } else if (lastNodeKey.length != 0) {\\n                    // We're dealing with a shrinking extension node.\\n                    // We need to modify the node to decrease the size of the key.\\n                    TrieNode memory modifiedLastNode = _makeExtensionNode(lastNodeKey, _getNodeValue(lastNode));\\n                    newBranch = _editBranchIndex(newBranch, branchKey, _getNodeHash(modifiedLastNode.encoded));\\n                } else {\\n                    // We're dealing with an unnecessary extension node.\\n                    // We're going to delete the node entirely.\\n                    // Simply insert its current value into the branch index.\\n                    newBranch = _editBranchIndex(newBranch, branchKey, _getNodeValue(lastNode));\\n                }\\n            }\\n\\n            if (keyRemainder.length == 0) {\\n                // We've got nothing left in the key remainder.\\n                // Simply insert the value into the branch value slot.\\n                newBranch = _editBranchValue(newBranch, _value);\\n                // Push the branch into the list of new nodes.\\n                newNodes[totalNewNodes] = newBranch;\\n                totalNewNodes += 1;\\n            } else {\\n                // We've got some key remainder to work with.\\n                // We'll be inserting a leaf node into the trie.\\n                // First, move on to the next nibble.\\n                keyRemainder = Lib_BytesUtils.slice(keyRemainder, 1);\\n                // Push the branch into the list of new nodes.\\n                newNodes[totalNewNodes] = newBranch;\\n                totalNewNodes += 1;\\n                // Push a new leaf node for our k/v pair.\\n                newNodes[totalNewNodes] = _makeLeafNode(keyRemainder, _value);\\n                totalNewNodes += 1;\\n            }\\n        }\\n\\n        // Finally, join the old path with our newly created nodes.\\n        // Since we're overwriting the last node in the path, we use `_pathLength - 1`.\\n        return _joinNodeArrays(_path, _pathLength - 1, newNodes, totalNewNodes);\\n    }\\n\\n    /**\\n     * @notice Computes the trie root from a given path.\\n     * @param _nodes Path to some k/v pair.\\n     * @param _key Key for the k/v pair.\\n     * @return _updatedRoot Root hash for the updated trie.\\n     */\\n    function _getUpdatedTrieRoot(\\n        TrieNode[] memory _nodes,\\n        bytes memory _key\\n    )\\n        private\\n        pure\\n        returns (\\n            bytes32 _updatedRoot\\n        )\\n    {\\n        bytes memory key = Lib_BytesUtils.toNibbles(_key);\\n\\n        // Some variables to keep track of during iteration.\\n        TrieNode memory currentNode;\\n        NodeType currentNodeType;\\n        bytes memory previousNodeHash;\\n\\n        // Run through the path backwards to rebuild our root hash.\\n        for (uint256 i = _nodes.length; i > 0; i--) {\\n            // Pick out the current node.\\n            currentNode = _nodes[i - 1];\\n            currentNodeType = _getNodeType(currentNode);\\n\\n            if (currentNodeType == NodeType.LeafNode) {\\n                // Leaf nodes are already correctly encoded.\\n                // Shift the key over to account for the nodes key.\\n                bytes memory nodeKey = _getNodeKey(currentNode);\\n                key = Lib_BytesUtils.slice(key, 0, key.length - nodeKey.length);\\n            } else if (currentNodeType == NodeType.ExtensionNode) {\\n                // Shift the key over to account for the nodes key.\\n                bytes memory nodeKey = _getNodeKey(currentNode);\\n                key = Lib_BytesUtils.slice(key, 0, key.length - nodeKey.length);\\n\\n                // If this node is the last element in the path, it'll be correctly encoded\\n                // and we can skip this part.\\n                if (previousNodeHash.length > 0) {\\n                    // Re-encode the node based on the previous node.\\n                    currentNode = _editExtensionNodeValue(currentNode, previousNodeHash);\\n                }\\n            } else if (currentNodeType == NodeType.BranchNode) {\\n                // If this node is the last element in the path, it'll be correctly encoded\\n                // and we can skip this part.\\n                if (previousNodeHash.length > 0) {\\n                    // Re-encode the node based on the previous node.\\n                    uint8 branchKey = uint8(key[key.length - 1]);\\n                    key = Lib_BytesUtils.slice(key, 0, key.length - 1);\\n                    currentNode = _editBranchIndex(currentNode, branchKey, previousNodeHash);\\n                }\\n            }\\n\\n            // Compute the node hash for the next iteration.\\n            previousNodeHash = _getNodeHash(currentNode.encoded);\\n        }\\n\\n        // Current node should be the root at this point.\\n        // Simply return the hash of its encoding.\\n        return keccak256(currentNode.encoded);\\n    }\\n\\n    /**\\n     * @notice Parses an RLP-encoded proof into something more useful.\\n     * @param _proof RLP-encoded proof to parse.\\n     * @return _parsed Proof parsed into easily accessible structs.\\n     */\\n    function _parseProof(\\n        bytes memory _proof\\n    )\\n        private\\n        pure\\n        returns (\\n            TrieNode[] memory _parsed\\n        )\\n    {\\n        Lib_RLPReader.RLPItem[] memory nodes = Lib_RLPReader.readList(_proof);\\n        TrieNode[] memory proof = new TrieNode[](nodes.length);\\n\\n        for (uint256 i = 0; i < nodes.length; i++) {\\n            bytes memory encoded = Lib_RLPReader.readBytes(nodes[i]);\\n            proof[i] = TrieNode({\\n                encoded: encoded,\\n                decoded: Lib_RLPReader.readList(encoded)\\n            });\\n        }\\n\\n        return proof;\\n    }\\n\\n    /**\\n     * @notice Picks out the ID for a node. Node ID is referred to as the\\n     * \\\"hash\\\" within the specification, but nodes < 32 bytes are not actually\\n     * hashed.\\n     * @param _node Node to pull an ID for.\\n     * @return _nodeID ID for the node, depending on the size of its contents.\\n     */\\n    function _getNodeID(\\n        Lib_RLPReader.RLPItem memory _node\\n    )\\n        private\\n        pure\\n        returns (\\n            bytes32 _nodeID\\n        )\\n    {\\n        bytes memory nodeID;\\n\\n        if (_node.length < 32) {\\n            // Nodes smaller than 32 bytes are RLP encoded.\\n            nodeID = Lib_RLPReader.readRawBytes(_node);\\n        } else {\\n            // Nodes 32 bytes or larger are hashed.\\n            nodeID = Lib_RLPReader.readBytes(_node);\\n        }\\n\\n        return Lib_BytesUtils.toBytes32(nodeID);\\n    }\\n\\n    /**\\n     * @notice Gets the path for a leaf or extension node.\\n     * @param _node Node to get a path for.\\n     * @return _path Node path, converted to an array of nibbles.\\n     */\\n    function _getNodePath(\\n        TrieNode memory _node\\n    )\\n        private\\n        pure\\n        returns (\\n            bytes memory _path\\n        )\\n    {\\n        return Lib_BytesUtils.toNibbles(Lib_RLPReader.readBytes(_node.decoded[0]));\\n    }\\n\\n    /**\\n     * @notice Gets the key for a leaf or extension node. Keys are essentially\\n     * just paths without any prefix.\\n     * @param _node Node to get a key for.\\n     * @return _key Node key, converted to an array of nibbles.\\n     */\\n    function _getNodeKey(\\n        TrieNode memory _node\\n    )\\n        private\\n        pure\\n        returns (\\n            bytes memory _key\\n        )\\n    {\\n        return _removeHexPrefix(_getNodePath(_node));\\n    }\\n\\n    /**\\n     * @notice Gets the path for a node.\\n     * @param _node Node to get a value for.\\n     * @return _value Node value, as hex bytes.\\n     */\\n    function _getNodeValue(\\n        TrieNode memory _node\\n    )\\n        private\\n        pure\\n        returns (\\n            bytes memory _value\\n        )\\n    {\\n        return Lib_RLPReader.readBytes(_node.decoded[_node.decoded.length - 1]);\\n    }\\n\\n    /**\\n     * @notice Computes the node hash for an encoded node. Nodes < 32 bytes\\n     * are not hashed, all others are keccak256 hashed.\\n     * @param _encoded Encoded node to hash.\\n     * @return _hash Hash of the encoded node. Simply the input if < 32 bytes.\\n     */\\n    function _getNodeHash(\\n        bytes memory _encoded\\n    )\\n        private\\n        pure\\n        returns (\\n            bytes memory _hash\\n        )\\n    {\\n        if (_encoded.length < 32) {\\n            return _encoded;\\n        } else {\\n            return abi.encodePacked(keccak256(_encoded));\\n        }\\n    }\\n\\n    /**\\n     * @notice Determines the type for a given node.\\n     * @param _node Node to determine a type for.\\n     * @return _type Type of the node; BranchNode/ExtensionNode/LeafNode.\\n     */\\n    function _getNodeType(\\n        TrieNode memory _node\\n    )\\n        private\\n        pure\\n        returns (\\n            NodeType _type\\n        )\\n    {\\n        if (_node.decoded.length == BRANCH_NODE_LENGTH) {\\n            return NodeType.BranchNode;\\n        } else if (_node.decoded.length == LEAF_OR_EXTENSION_NODE_LENGTH) {\\n            bytes memory path = _getNodePath(_node);\\n            uint8 prefix = uint8(path[0]);\\n\\n            if (prefix == PREFIX_LEAF_EVEN || prefix == PREFIX_LEAF_ODD) {\\n                return NodeType.LeafNode;\\n            } else if (prefix == PREFIX_EXTENSION_EVEN || prefix == PREFIX_EXTENSION_ODD) {\\n                return NodeType.ExtensionNode;\\n            }\\n        }\\n\\n        revert(\\\"Invalid node type\\\");\\n    }\\n\\n    /**\\n     * @notice Utility; determines the number of nibbles shared between two\\n     * nibble arrays.\\n     * @param _a First nibble array.\\n     * @param _b Second nibble array.\\n     * @return _shared Number of shared nibbles.\\n     */\\n    function _getSharedNibbleLength(\\n        bytes memory _a,\\n        bytes memory _b\\n    )\\n        private\\n        pure\\n        returns (\\n            uint256 _shared\\n        )\\n    {\\n        uint256 i = 0;\\n        while (_a.length > i && _b.length > i && _a[i] == _b[i]) {\\n            i++;\\n        }\\n        return i;\\n    }\\n\\n    /**\\n     * @notice Utility; converts an RLP-encoded node into our nice struct.\\n     * @param _raw RLP-encoded node to convert.\\n     * @return _node Node as a TrieNode struct.\\n     */\\n    function _makeNode(\\n        bytes[] memory _raw\\n    )\\n        private\\n        pure\\n        returns (\\n            TrieNode memory _node\\n        )\\n    {\\n        bytes memory encoded = Lib_RLPWriter.writeList(_raw);\\n\\n        return TrieNode({\\n            encoded: encoded,\\n            decoded: Lib_RLPReader.readList(encoded)\\n        });\\n    }\\n\\n    /**\\n     * @notice Utility; converts an RLP-decoded node into our nice struct.\\n     * @param _items RLP-decoded node to convert.\\n     * @return _node Node as a TrieNode struct.\\n     */\\n    function _makeNode(\\n        Lib_RLPReader.RLPItem[] memory _items\\n    )\\n        private\\n        pure\\n        returns (\\n            TrieNode memory _node\\n        )\\n    {\\n        bytes[] memory raw = new bytes[](_items.length);\\n        for (uint256 i = 0; i < _items.length; i++) {\\n            raw[i] = Lib_RLPReader.readRawBytes(_items[i]);\\n        }\\n        return _makeNode(raw);\\n    }\\n\\n    /**\\n     * @notice Creates a new extension node.\\n     * @param _key Key for the extension node, unprefixed.\\n     * @param _value Value for the extension node.\\n     * @return _node New extension node with the given k/v pair.\\n     */\\n    function _makeExtensionNode(\\n        bytes memory _key,\\n        bytes memory _value\\n    )\\n        private\\n        pure\\n        returns (\\n            TrieNode memory _node\\n        )\\n    {\\n        bytes[] memory raw = new bytes[](2);\\n        bytes memory key = _addHexPrefix(_key, false);\\n        raw[0] = Lib_RLPWriter.writeBytes(Lib_BytesUtils.fromNibbles(key));\\n        raw[1] = Lib_RLPWriter.writeBytes(_value);\\n        return _makeNode(raw);\\n    }\\n\\n    /**\\n     * Creates a new extension node with the same key but a different value.\\n     * @param _node Extension node to copy and modify.\\n     * @param _value New value for the extension node.\\n     * @return New node with the same key and different value.\\n     */\\n    function _editExtensionNodeValue(\\n        TrieNode memory _node,\\n        bytes memory _value\\n    )\\n        private\\n        pure\\n        returns (\\n            TrieNode memory\\n        )\\n    {\\n        bytes[] memory raw = new bytes[](2);\\n        bytes memory key = _addHexPrefix(_getNodeKey(_node), false);\\n        raw[0] = Lib_RLPWriter.writeBytes(Lib_BytesUtils.fromNibbles(key));\\n        if (_value.length < 32) {\\n            raw[1] = _value;\\n        } else {\\n            raw[1] = Lib_RLPWriter.writeBytes(_value);\\n        }\\n        return _makeNode(raw);\\n    }\\n\\n    /**\\n     * @notice Creates a new leaf node.\\n     * @dev This function is essentially identical to `_makeExtensionNode`.\\n     * Although we could route both to a single method with a flag, it's\\n     * more gas efficient to keep them separate and duplicate the logic.\\n     * @param _key Key for the leaf node, unprefixed.\\n     * @param _value Value for the leaf node.\\n     * @return _node New leaf node with the given k/v pair.\\n     */\\n    function _makeLeafNode(\\n        bytes memory _key,\\n        bytes memory _value\\n    )\\n        private\\n        pure\\n        returns (\\n            TrieNode memory _node\\n        )\\n    {\\n        bytes[] memory raw = new bytes[](2);\\n        bytes memory key = _addHexPrefix(_key, true);\\n        raw[0] = Lib_RLPWriter.writeBytes(Lib_BytesUtils.fromNibbles(key));\\n        raw[1] = Lib_RLPWriter.writeBytes(_value);\\n        return _makeNode(raw);\\n    }\\n\\n    /**\\n     * @notice Creates an empty branch node.\\n     * @return _node Empty branch node as a TrieNode struct.\\n     */\\n    function _makeEmptyBranchNode()\\n        private\\n        pure\\n        returns (\\n            TrieNode memory _node\\n        )\\n    {\\n        bytes[] memory raw = new bytes[](BRANCH_NODE_LENGTH);\\n        for (uint256 i = 0; i < raw.length; i++) {\\n            raw[i] = RLP_NULL_BYTES;\\n        }\\n        return _makeNode(raw);\\n    }\\n\\n    /**\\n     * @notice Modifies the value slot for a given branch.\\n     * @param _branch Branch node to modify.\\n     * @param _value Value to insert into the branch.\\n     * @return _updatedNode Modified branch node.\\n     */\\n    function _editBranchValue(\\n        TrieNode memory _branch,\\n        bytes memory _value\\n    )\\n        private\\n        pure\\n        returns (\\n            TrieNode memory _updatedNode\\n        )\\n    {\\n        bytes memory encoded = Lib_RLPWriter.writeBytes(_value);\\n        _branch.decoded[_branch.decoded.length - 1] = Lib_RLPReader.toRLPItem(encoded);\\n        return _makeNode(_branch.decoded);\\n    }\\n\\n    /**\\n     * @notice Modifies a slot at an index for a given branch.\\n     * @param _branch Branch node to modify.\\n     * @param _index Slot index to modify.\\n     * @param _value Value to insert into the slot.\\n     * @return _updatedNode Modified branch node.\\n     */\\n    function _editBranchIndex(\\n        TrieNode memory _branch,\\n        uint8 _index,\\n        bytes memory _value\\n    )\\n        private\\n        pure\\n        returns (\\n            TrieNode memory _updatedNode\\n        )\\n    {\\n        bytes memory encoded = _value.length < 32 ? _value : Lib_RLPWriter.writeBytes(_value);\\n        _branch.decoded[_index] = Lib_RLPReader.toRLPItem(encoded);\\n        return _makeNode(_branch.decoded);\\n    }\\n\\n    /**\\n     * @notice Utility; adds a prefix to a key.\\n     * @param _key Key to prefix.\\n     * @param _isLeaf Whether or not the key belongs to a leaf.\\n     * @return _prefixedKey Prefixed key.\\n     */\\n    function _addHexPrefix(\\n        bytes memory _key,\\n        bool _isLeaf\\n    )\\n        private\\n        pure\\n        returns (\\n            bytes memory _prefixedKey\\n        )\\n    {\\n        uint8 prefix = _isLeaf ? uint8(0x02) : uint8(0x00);\\n        uint8 offset = uint8(_key.length % 2);\\n        bytes memory prefixed = new bytes(2 - offset);\\n        prefixed[0] = bytes1(prefix + offset);\\n        return abi.encodePacked(prefixed, _key);\\n    }\\n\\n    /**\\n     * @notice Utility; removes a prefix from a path.\\n     * @param _path Path to remove the prefix from.\\n     * @return _unprefixedKey Unprefixed key.\\n     */\\n    function _removeHexPrefix(\\n        bytes memory _path\\n    )\\n        private\\n        pure\\n        returns (\\n            bytes memory _unprefixedKey\\n        )\\n    {\\n        if (uint8(_path[0]) % 2 == 0) {\\n            return Lib_BytesUtils.slice(_path, 2);\\n        } else {\\n            return Lib_BytesUtils.slice(_path, 1);\\n        }\\n    }\\n\\n    /**\\n     * @notice Utility; combines two node arrays. Array lengths are required\\n     * because the actual lengths may be longer than the filled lengths.\\n     * Array resizing is extremely costly and should be avoided.\\n     * @param _a First array to join.\\n     * @param _aLength Length of the first array.\\n     * @param _b Second array to join.\\n     * @param _bLength Length of the second array.\\n     * @return _joined Combined node array.\\n     */\\n    function _joinNodeArrays(\\n        TrieNode[] memory _a,\\n        uint256 _aLength,\\n        TrieNode[] memory _b,\\n        uint256 _bLength\\n    )\\n        private\\n        pure\\n        returns (\\n            TrieNode[] memory _joined\\n        )\\n    {\\n        TrieNode[] memory ret = new TrieNode[](_aLength + _bLength);\\n\\n        // Copy elements from the first array.\\n        for (uint256 i = 0; i < _aLength; i++) {\\n            ret[i] = _a[i];\\n        }\\n\\n        // Copy elements from the second array.\\n        for (uint256 i = 0; i < _bLength; i++) {\\n            ret[i + _aLength] = _b[i];\\n        }\\n\\n        return ret;\\n    }\\n}\\n\",\"keccak256\":\"0x4bb09d0b4f965b57cdc6b3ace49967bcfe7f2580fa0b7863dfe288081247d876\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/trie/Lib_SecureMerkleTrie.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\npragma experimental ABIEncoderV2;\\n\\n/* Library Imports */\\nimport { Lib_MerkleTrie } from \\\"./Lib_MerkleTrie.sol\\\";\\n\\n/**\\n * @title Lib_SecureMerkleTrie\\n */\\nlibrary Lib_SecureMerkleTrie {\\n\\n    /**********************\\n     * Internal Functions *\\n     **********************/\\n\\n    /**\\n     * @notice Verifies a proof that a given key/value pair is present in the\\n     * Merkle trie.\\n     * @param _key Key of the node to search for, as a hex string.\\n     * @param _value Value of the node to search for, as a hex string.\\n     * @param _proof Merkle trie inclusion proof for the desired node. Unlike\\n     * traditional Merkle trees, this proof is executed top-down and consists\\n     * of a list of RLP-encoded nodes that make a path down to the target node.\\n     * @param _root Known root of the Merkle trie. Used to verify that the\\n     * included proof is correctly constructed.\\n     * @return _verified `true` if the k/v pair exists in the trie, `false` otherwise.\\n     */\\n    function verifyInclusionProof(\\n        bytes memory _key,\\n        bytes memory _value,\\n        bytes memory _proof,\\n        bytes32 _root\\n    )\\n        internal\\n        pure\\n        returns (\\n            bool _verified\\n        )\\n    {\\n        bytes memory key = _getSecureKey(_key);\\n        return Lib_MerkleTrie.verifyInclusionProof(key, _value, _proof, _root);\\n    }\\n\\n    /**\\n     * @notice Updates a Merkle trie and returns a new root hash.\\n     * @param _key Key of the node to update, as a hex string.\\n     * @param _value Value of the node to update, as a hex string.\\n     * @param _proof Merkle trie inclusion proof for the node *nearest* the\\n     * target node. If the key exists, we can simply update the value.\\n     * Otherwise, we need to modify the trie to handle the new k/v pair.\\n     * @param _root Known root of the Merkle trie. Used to verify that the\\n     * included proof is correctly constructed.\\n     * @return _updatedRoot Root hash of the newly constructed trie.\\n     */\\n    function update(\\n        bytes memory _key,\\n        bytes memory _value,\\n        bytes memory _proof,\\n        bytes32 _root\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes32 _updatedRoot\\n        )\\n    {\\n        bytes memory key = _getSecureKey(_key);\\n        return Lib_MerkleTrie.update(key, _value, _proof, _root);\\n    }\\n\\n    /**\\n     * @notice Retrieves the value associated with a given key.\\n     * @param _key Key to search for, as hex bytes.\\n     * @param _proof Merkle trie inclusion proof for the key.\\n     * @param _root Known root of the Merkle trie.\\n     * @return _exists Whether or not the key exists.\\n     * @return _value Value of the key if it exists.\\n     */\\n    function get(\\n        bytes memory _key,\\n        bytes memory _proof,\\n        bytes32 _root\\n    )\\n        internal\\n        pure\\n        returns (\\n            bool _exists,\\n            bytes memory _value\\n        )\\n    {\\n        bytes memory key = _getSecureKey(_key);\\n        return Lib_MerkleTrie.get(key, _proof, _root);\\n    }\\n\\n    /**\\n     * Computes the root hash for a trie with a single node.\\n     * @param _key Key for the single node.\\n     * @param _value Value for the single node.\\n     * @return _updatedRoot Hash of the trie.\\n     */\\n    function getSingleNodeRootHash(\\n        bytes memory _key,\\n        bytes memory _value\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes32 _updatedRoot\\n        )\\n    {\\n        bytes memory key = _getSecureKey(_key);\\n        return Lib_MerkleTrie.getSingleNodeRootHash(key, _value);\\n    }\\n\\n\\n    /*********************\\n     * Private Functions *\\n     *********************/\\n\\n    /**\\n     * Computes the secure counterpart to a key.\\n     * @param _key Key to get a secure key from.\\n     * @return _secureKey Secure version of the key.\\n     */\\n    function _getSecureKey(\\n        bytes memory _key\\n    )\\n        private\\n        pure\\n        returns (\\n            bytes memory _secureKey\\n        )\\n    {\\n        return abi.encodePacked(keccak256(_key));\\n    }\\n}\",\"keccak256\":\"0xbbdd600165307d2131340599afa9dc0991f8f63727ba3a834bca5a3d7f501da8\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/utils/Lib_Bytes32Utils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/**\\n * @title Lib_Byte32Utils\\n */\\nlibrary Lib_Bytes32Utils {\\n\\n    /**********************\\n     * Internal Functions *\\n     **********************/\\n\\n    /**\\n     * Converts a bytes32 value to a boolean. Anything non-zero will be converted to \\\"true.\\\"\\n     * @param _in Input bytes32 value.\\n     * @return Bytes32 as a boolean.\\n     */\\n    function toBool(\\n        bytes32 _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            bool\\n        )\\n    {\\n        return _in != 0;\\n    }\\n\\n    /**\\n     * Converts a boolean to a bytes32 value.\\n     * @param _in Input boolean value.\\n     * @return Boolean as a bytes32.\\n     */\\n    function fromBool(\\n        bool _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes32\\n        )\\n    {\\n        return bytes32(uint256(_in ? 1 : 0));\\n    }\\n\\n    /**\\n     * Converts a bytes32 value to an address. Takes the *last* 20 bytes.\\n     * @param _in Input bytes32 value.\\n     * @return Bytes32 as an address.\\n     */\\n    function toAddress(\\n        bytes32 _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            address\\n        )\\n    {\\n        return address(uint160(uint256(_in)));\\n    }\\n\\n    /**\\n     * Converts an address to a bytes32.\\n     * @param _in Input address value.\\n     * @return Address as a bytes32.\\n     */\\n    function fromAddress(\\n        address _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes32\\n        )\\n    {\\n        return bytes32(uint256(_in));\\n    }\\n\\n    /**\\n     * Removes the leading zeros from a bytes32 value and returns a new (smaller) bytes value.\\n     * @param _in Input bytes32 value.\\n     * @return Bytes32 without any leading zeros.\\n     */\\n    function removeLeadingZeros(\\n        bytes32 _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes memory\\n        )\\n    {\\n        bytes memory out;\\n\\n        assembly {\\n            // Figure out how many leading zero bytes to remove.\\n            let shift := 0\\n            for { let i := 0 } and(lt(i, 32), eq(byte(i, _in), 0)) { i := add(i, 1) } {\\n                shift := add(shift, 1)\\n            }\\n\\n            // Reserve some space for our output and fix the free memory pointer.\\n            out := mload(0x40)\\n            mstore(0x40, add(out, 0x40))\\n\\n            // Shift the value and store it into the output bytes.\\n            mstore(add(out, 0x20), shl(mul(shift, 8), _in))\\n\\n            // Store the new size (with leading zero bytes removed) in the output byte size.\\n            mstore(out, sub(32, shift))\\n        }\\n\\n        return out;\\n    }\\n}\\n\",\"keccak256\":\"0xfa2def593e3fc56a31852c3744aefdaa93cec74e721bfcfeb1e5d166c7c60b64\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/utils/Lib_BytesUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/**\\n * @title Lib_BytesUtils\\n */\\nlibrary Lib_BytesUtils {\\n\\n    /**********************\\n     * Internal Functions *\\n     **********************/\\n\\n    function slice(\\n        bytes memory _bytes,\\n        uint256 _start,\\n        uint256 _length\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes memory\\n        )\\n    {\\n        require(_length + 31 >= _length, \\\"slice_overflow\\\");\\n        require(_start + _length >= _start, \\\"slice_overflow\\\");\\n        require(_bytes.length >= _start + _length, \\\"slice_outOfBounds\\\");\\n\\n        bytes memory tempBytes;\\n\\n        assembly {\\n            switch iszero(_length)\\n            case 0 {\\n                // Get a location of some free memory and store it in tempBytes as\\n                // Solidity does for memory variables.\\n                tempBytes := mload(0x40)\\n\\n                // The first word of the slice result is potentially a partial\\n                // word read from the original array. To read it, we calculate\\n                // the length of that partial word and start copying that many\\n                // bytes into the array. The first word we copy will start with\\n                // data we don't care about, but the last `lengthmod` bytes will\\n                // land at the beginning of the contents of the new array. When\\n                // we're done copying, we overwrite the full first word with\\n                // the actual length of the slice.\\n                let lengthmod := and(_length, 31)\\n\\n                // The multiplication in the next line is necessary\\n                // because when slicing multiples of 32 bytes (lengthmod == 0)\\n                // the following copy loop was copying the origin's length\\n                // and then ending prematurely not copying everything it should.\\n                let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod)))\\n                let end := add(mc, _length)\\n\\n                for {\\n                    // The multiplication in the next line has the same exact purpose\\n                    // as the one above.\\n                    let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start)\\n                } lt(mc, end) {\\n                    mc := add(mc, 0x20)\\n                    cc := add(cc, 0x20)\\n                } {\\n                    mstore(mc, mload(cc))\\n                }\\n\\n                mstore(tempBytes, _length)\\n\\n                //update free-memory pointer\\n                //allocating the array padded to 32 bytes like the compiler does now\\n                mstore(0x40, and(add(mc, 31), not(31)))\\n            }\\n            //if we want a zero-length slice let's just return a zero-length array\\n            default {\\n                tempBytes := mload(0x40)\\n\\n                //zero out the 32 bytes slice we are about to return\\n                //we need to do it because Solidity does not garbage collect\\n                mstore(tempBytes, 0)\\n\\n                mstore(0x40, add(tempBytes, 0x20))\\n            }\\n        }\\n\\n        return tempBytes;\\n    }\\n\\n    function slice(\\n        bytes memory _bytes,\\n        uint256 _start\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes memory\\n        )\\n    {\\n        if (_start >= _bytes.length) {\\n            return bytes('');\\n        }\\n\\n        return slice(_bytes, _start, _bytes.length - _start);\\n    }\\n\\n    function toBytes32PadLeft(\\n        bytes memory _bytes\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes32\\n        )\\n    {\\n        bytes32 ret;\\n        uint256 len = _bytes.length <= 32 ? _bytes.length : 32;\\n        assembly {\\n            ret := shr(mul(sub(32, len), 8), mload(add(_bytes, 32)))\\n        }\\n        return ret;\\n    }\\n\\n    function toBytes32(\\n        bytes memory _bytes\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes32\\n        )\\n    {\\n        if (_bytes.length < 32) {\\n            bytes32 ret;\\n            assembly {\\n                ret := mload(add(_bytes, 32))\\n            }\\n            return ret;\\n        }\\n\\n        return abi.decode(_bytes,(bytes32)); // will truncate if input length > 32 bytes\\n    }\\n\\n    function toUint256(\\n        bytes memory _bytes\\n    )\\n        internal\\n        pure\\n        returns (\\n            uint256\\n        )\\n    {\\n        return uint256(toBytes32(_bytes));\\n    }\\n\\n    function toUint24(\\n        bytes memory _bytes,\\n        uint256 _start\\n    )\\n        internal\\n        pure\\n        returns (\\n            uint24\\n        )\\n    {\\n        require(_start + 3 >= _start, \\\"toUint24_overflow\\\");\\n        require(_bytes.length >= _start + 3 , \\\"toUint24_outOfBounds\\\");\\n        uint24 tempUint;\\n\\n        assembly {\\n            tempUint := mload(add(add(_bytes, 0x3), _start))\\n        }\\n\\n        return tempUint;\\n    }\\n\\n    function toUint8(\\n        bytes memory _bytes,\\n        uint256 _start\\n    )\\n        internal\\n        pure\\n        returns (\\n            uint8\\n        )\\n    {\\n        require(_start + 1 >= _start, \\\"toUint8_overflow\\\");\\n        require(_bytes.length >= _start + 1 , \\\"toUint8_outOfBounds\\\");\\n        uint8 tempUint;\\n\\n        assembly {\\n            tempUint := mload(add(add(_bytes, 0x1), _start))\\n        }\\n\\n        return tempUint;\\n    }\\n\\n    function toAddress(\\n        bytes memory _bytes,\\n        uint256 _start\\n    )\\n        internal\\n        pure\\n        returns (\\n            address\\n        )\\n    {\\n        require(_start + 20 >= _start, \\\"toAddress_overflow\\\");\\n        require(_bytes.length >= _start + 20, \\\"toAddress_outOfBounds\\\");\\n        address tempAddress;\\n\\n        assembly {\\n            tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000)\\n        }\\n\\n        return tempAddress;\\n    }\\n\\n    function toNibbles(\\n        bytes memory _bytes\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes memory\\n        )\\n    {\\n        bytes memory nibbles = new bytes(_bytes.length * 2);\\n\\n        for (uint256 i = 0; i < _bytes.length; i++) {\\n            nibbles[i * 2] = _bytes[i] >> 4;\\n            nibbles[i * 2 + 1] = bytes1(uint8(_bytes[i]) % 16);\\n        }\\n\\n        return nibbles;\\n    }\\n\\n    function fromNibbles(\\n        bytes memory _bytes\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes memory\\n        )\\n    {\\n        bytes memory ret = new bytes(_bytes.length / 2);\\n\\n        for (uint256 i = 0; i < ret.length; i++) {\\n            ret[i] = (_bytes[i * 2] << 4) | (_bytes[i * 2 + 1]);\\n        }\\n\\n        return ret;\\n    }\\n\\n    function equal(\\n        bytes memory _bytes,\\n        bytes memory _other\\n    )\\n        internal\\n        pure\\n        returns (\\n            bool\\n        )\\n    {\\n        return keccak256(_bytes) == keccak256(_other);\\n    }\\n}\\n\",\"keccak256\":\"0xd27e37973f1e0f64798725b7a0de12989dac992fba0d72970249d7e1f70e17c5\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/utils/Lib_EthUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// @unsupported: ovm\\npragma solidity >0.5.0 <0.8.0;\\npragma experimental ABIEncoderV2;\\n\\n/* Library Imports */\\nimport { Lib_RLPWriter } from \\\"../rlp/Lib_RLPWriter.sol\\\";\\nimport { Lib_Bytes32Utils } from \\\"./Lib_Bytes32Utils.sol\\\";\\n\\n/**\\n * @title Lib_EthUtils\\n */\\nlibrary Lib_EthUtils {\\n\\n    /**********************\\n     * Internal Functions *\\n     **********************/\\n\\n    /**\\n     * Gets the code for a given address.\\n     * @param _address Address to get code for.\\n     * @param _offset Offset to start reading from.\\n     * @param _length Number of bytes to read.\\n     * @return Code read from the contract.\\n     */\\n    function getCode(\\n        address _address,\\n        uint256 _offset,\\n        uint256 _length\\n    )\\n        internal\\n        view\\n        returns (\\n            bytes memory\\n        )\\n    {\\n        bytes memory code;\\n        assembly {\\n            code := mload(0x40)\\n            mstore(0x40, add(code, add(_length, 0x20)))\\n            mstore(code, _length)\\n            extcodecopy(_address, add(code, 0x20), _offset, _length)\\n        }\\n\\n        return code;\\n    }\\n\\n    /**\\n     * Gets the full code for a given address.\\n     * @param _address Address to get code for.\\n     * @return Full code of the contract.\\n     */\\n    function getCode(\\n        address _address\\n    )\\n        internal\\n        view\\n        returns (\\n            bytes memory\\n        )\\n    {\\n        return getCode(\\n            _address,\\n            0,\\n            getCodeSize(_address)\\n        );\\n    }\\n\\n    /**\\n     * Gets the size of a contract's code in bytes.\\n     * @param _address Address to get code size for.\\n     * @return Size of the contract's code in bytes.\\n     */\\n    function getCodeSize(\\n        address _address\\n    )\\n        internal\\n        view\\n        returns (\\n            uint256\\n        )\\n    {\\n        uint256 codeSize;\\n        assembly {\\n            codeSize := extcodesize(_address)\\n        }\\n\\n        return codeSize;\\n    }\\n\\n    /**\\n     * Gets the hash of a contract's code.\\n     * @param _address Address to get a code hash for.\\n     * @return Hash of the contract's code.\\n     */\\n    function getCodeHash(\\n        address _address\\n    )\\n        internal\\n        view\\n        returns (\\n            bytes32\\n        )\\n    {\\n        bytes32 codeHash;\\n        assembly {\\n            codeHash := extcodehash(_address)\\n        }\\n\\n        return codeHash;\\n    }\\n\\n    /**\\n     * Creates a contract with some given initialization code.\\n     * @param _code Contract initialization code.\\n     * @return Address of the created contract.\\n     */\\n    function createContract(\\n        bytes memory _code\\n    )\\n        internal\\n        returns (\\n            address\\n        )\\n    {\\n        address created;\\n        assembly {\\n            created := create(\\n                0,\\n                add(_code, 0x20),\\n                mload(_code)\\n            )\\n        }\\n\\n        return created;\\n    }\\n\\n    /**\\n     * Computes the address that would be generated by CREATE.\\n     * @param _creator Address creating the contract.\\n     * @param _nonce Creator's nonce.\\n     * @return Address to be generated by CREATE.\\n     */\\n    function getAddressForCREATE(\\n        address _creator,\\n        uint256 _nonce\\n    )\\n        internal\\n        pure\\n        returns (\\n            address\\n        )\\n    {\\n        bytes[] memory encoded = new bytes[](2);\\n        encoded[0] = Lib_RLPWriter.writeAddress(_creator);\\n        encoded[1] = Lib_RLPWriter.writeUint(_nonce);\\n\\n        bytes memory encodedList = Lib_RLPWriter.writeList(encoded);\\n        return Lib_Bytes32Utils.toAddress(keccak256(encodedList));\\n    }\\n\\n    /**\\n     * Computes the address that would be generated by CREATE2.\\n     * @param _creator Address creating the contract.\\n     * @param _bytecode Bytecode of the contract to be created.\\n     * @param _salt 32 byte salt value mixed into the hash.\\n     * @return Address to be generated by CREATE2.\\n     */\\n    function getAddressForCREATE2(\\n        address _creator,\\n        bytes memory _bytecode,\\n        bytes32 _salt\\n    )\\n        internal\\n        pure\\n        returns (\\n            address\\n        )\\n    {\\n        bytes32 hashedData = keccak256(abi.encodePacked(\\n            byte(0xff),\\n            _creator,\\n            _salt,\\n            keccak256(_bytecode)\\n        ));\\n\\n        return Lib_Bytes32Utils.toAddress(hashedData);\\n    }\\n}\\n\",\"keccak256\":\"0xf29a67d78e61cb472d524b779b32cfcb39a587f4096500d5419e6425ed367d49\",\"license\":\"MIT\"}},\"version\":1}",
  "bytecode": "[encoded data, 38488 characters]",
  "deployedBytecode": "[encoded data, 38286 characters]",
  "devdoc": {
    "details": "The State Transitioner Factory is used by the Fraud Verifier to create a new State Transitioner during the initialization of a fraud proof. Compiler used: solc Runtime target: EVM",
    "kind": "dev",
    "methods": {
      "create(address,uint256,bytes32,bytes32)": {
        "params": {
          "_libAddressManager": "Address of the Address Manager.",
          "_preStateRoot": "State root before the transition was executed.",
          "_stateTransitionIndex": "Index of the state transition being verified.",
          "_transactionHash": "Hash of the executed transaction."
        },
        "returns": {
          "_0": "New OVM_StateTransitioner instance."
        }
      },
      "resolve(string)": {
        "params": {
          "_name": "Name to resolve an address for."
        },
        "returns": {
          "_0": "Address associated with the given name."
        }
      }
    },
    "title": "OVM_StateTransitionerFactory",
    "version": 1
  },
  "userdoc": {
    "kind": "user",
    "methods": {
      "create(address,uint256,bytes32,bytes32)": {
        "notice": "Creates a new OVM_StateTransitioner"
      },
      "resolve(string)": {
        "notice": "Resolves the address associated with a given name."
      }
    },
    "version": 1
  },
  "storageLayout": {
    "storage": [
      {
        "astId": 12856,
        "contract": "contracts/optimistic-ethereum/OVM/verification/OVM_StateTransitionerFactory.sol:OVM_StateTransitionerFactory",
        "label": "libAddressManager",
        "offset": 0,
        "slot": "0",
        "type": "t_contract(Lib_AddressManager)12849"
      }
    ],
    "types": {
      "t_contract(Lib_AddressManager)12849": {
        "encoding": "inplace",
        "label": "contract Lib_AddressManager",
        "numberOfBytes": "20"
      }
    }
  }
}