{
  "address": "0x8FA5bfeeb7786D2a241527E8aE8cA1d7511A0E10",
  "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": "_contract",
          "type": "address"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    }
  ],
  "transactionHash": "0x32ce9e24c4f58a400a65acf1f0e955e7e262d307ffb52351da24e87fc29ebb1f",
  "receipt": {
    "to": null,
    "from": "0x77C4c8f491e5ff22a2C0E18b005c3BA0Fe36c1Bc",
    "contractAddress": "0x8FA5bfeeb7786D2a241527E8aE8cA1d7511A0E10",
    "transactionIndex": 21,
    "gasUsed": "4076323",
    "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "blockHash": "0xa16968075d2b47e35c15ac484379215070782ae9f3198140a373c08128fe8c8f",
    "transactionHash": "0x32ce9e24c4f58a400a65acf1f0e955e7e262d307ffb52351da24e87fc29ebb1f",
    "logs": [],
    "blockNumber": 12207895,
    "cumulativeGasUsed": "6184557",
    "status": 1,
    "byzantium": true
  },
  "args": [
    "0xd3EeD86464Ff13B4BFD81a3bB1e753b7ceBA3A39"
  ],
  "solcInputHash": "43ee6bb8ef92595aa6d0e22a6c464dff",
  "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\":\"_contract\",\"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.\"}}},\"title\":\"OVM_StateTransitionerFactory\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"create(address,uint256,bytes32,bytes32)\":{\"notice\":\"Creates a new OVM_StateTransitioner\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/optimistic-ethereum/OVM/verification/OVM_StateTransitionerFactory.sol\":\"OVM_StateTransitionerFactory\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"none\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"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        public\\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        public\\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        public\\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        public\\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        public\\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        public\\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        public\\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        public\\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        public\\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\":\"0xc363807221625338a396c52a4bc3b7439e63972ac87521670c47745641e91fa6\",\"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\":\"0xf9e4c100a38655d5198f13ae918b460244394f1cda29cddbd46b11b25aaafba5\",\"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;\\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\":\"0xa613e2f578d56aa80f0916df538b487f8213a18933e78fdecb9efeedae02cf9c\",\"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\\\";\\nimport { Lib_SafeExecutionManagerWrapper } from \\\"../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol\\\";\\n\\n/**\\n * @title Lib_OVMCodec\\n */\\nlibrary Lib_OVMCodec {\\n\\n    /*********\\n     * Enums *\\n     *********/\\n\\n    enum EOASignatureType {\\n        EIP155_TRANSACTION,\\n        ETH_SIGNED_MESSAGE\\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    struct EIP155Transaction {\\n        uint256 nonce;\\n        uint256 gasPrice;\\n        uint256 gasLimit;\\n        address to;\\n        uint256 value;\\n        bytes data;\\n        uint256 chainId;\\n    }\\n\\n\\n    /**********************\\n     * Internal Functions *\\n     **********************/\\n\\n    /**\\n     * Decodes an EOA transaction (i.e., native Ethereum RLP encoding).\\n     * @param _transaction Encoded EOA transaction.\\n     * @return Transaction decoded into a struct.\\n     */\\n    function decodeEIP155Transaction(\\n        bytes memory _transaction,\\n        bool _isEthSignedMessage\\n    )\\n        internal\\n        pure\\n        returns (\\n            EIP155Transaction memory\\n        )\\n    {\\n        if (_isEthSignedMessage) {\\n            (\\n                uint256 _nonce,\\n                uint256 _gasLimit,\\n                uint256 _gasPrice,\\n                uint256 _chainId,\\n                address _to,\\n                bytes memory _data\\n            ) = abi.decode(\\n                _transaction,\\n                (uint256, uint256, uint256, uint256, address ,bytes)\\n            );\\n            return EIP155Transaction({\\n                nonce: _nonce,\\n                gasPrice: _gasPrice,\\n                gasLimit: _gasLimit,\\n                to: _to,\\n                value: 0,\\n                data: _data,\\n                chainId: _chainId\\n            });\\n        } else {\\n            Lib_RLPReader.RLPItem[] memory decoded = Lib_RLPReader.readList(_transaction);\\n\\n            return EIP155Transaction({\\n                nonce: Lib_RLPReader.readUint256(decoded[0]),\\n                gasPrice: Lib_RLPReader.readUint256(decoded[1]),\\n                gasLimit: Lib_RLPReader.readUint256(decoded[2]),\\n                to: Lib_RLPReader.readAddress(decoded[3]),\\n                value: Lib_RLPReader.readUint256(decoded[4]),\\n                data: Lib_RLPReader.readBytes(decoded[5]),\\n                chainId:  Lib_RLPReader.readUint256(decoded[6])\\n            });\\n        }\\n    }\\n\\n    /**\\n     * Decompresses a compressed EIP155 transaction.\\n     * @param _transaction Compressed EIP155 transaction bytes.\\n     * @return Transaction parsed into a struct.\\n     */\\n    function decompressEIP155Transaction(\\n        bytes memory _transaction\\n    )\\n        internal\\n        returns (\\n            EIP155Transaction memory\\n        )\\n    {\\n        return EIP155Transaction({\\n            gasLimit: Lib_BytesUtils.toUint24(_transaction, 0),\\n            gasPrice: uint256(Lib_BytesUtils.toUint24(_transaction, 3)) * 1000000,\\n            nonce: Lib_BytesUtils.toUint24(_transaction, 6),\\n            to: Lib_BytesUtils.toAddress(_transaction, 9),\\n            data: Lib_BytesUtils.slice(_transaction, 29),\\n            chainId: Lib_SafeExecutionManagerWrapper.safeCHAINID(),\\n            value: 0\\n        });\\n    }\\n\\n    /**\\n     * Encodes an EOA transaction back into the original transaction.\\n     * @param _transaction EIP155transaction to encode.\\n     * @param _isEthSignedMessage Whether or not this was an eth signed message.\\n     * @return Encoded transaction.\\n     */\\n    function encodeEIP155Transaction(\\n        EIP155Transaction memory _transaction,\\n        bool _isEthSignedMessage\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes memory\\n        )\\n    {\\n        if (_isEthSignedMessage) {\\n            return abi.encode(\\n                _transaction.nonce,\\n                _transaction.gasLimit,\\n                _transaction.gasPrice,\\n                _transaction.chainId,\\n                _transaction.to,\\n                _transaction.data\\n            );\\n        } else {\\n            bytes[] memory raw = new bytes[](9);\\n\\n            raw[0] = Lib_RLPWriter.writeUint(_transaction.nonce);\\n            raw[1] = Lib_RLPWriter.writeUint(_transaction.gasPrice);\\n            raw[2] = Lib_RLPWriter.writeUint(_transaction.gasLimit);\\n            if (_transaction.to == address(0)) {\\n                raw[3] = Lib_RLPWriter.writeBytes('');\\n            } else {\\n                raw[3] = Lib_RLPWriter.writeAddress(_transaction.to);\\n            }\\n            raw[4] = Lib_RLPWriter.writeUint(0);\\n            raw[5] = Lib_RLPWriter.writeBytes(_transaction.data);\\n            raw[6] = Lib_RLPWriter.writeUint(_transaction.chainId);\\n            raw[7] = Lib_RLPWriter.writeBytes(bytes(''));\\n            raw[8] = Lib_RLPWriter.writeBytes(bytes(''));\\n\\n            return Lib_RLPWriter.writeList(raw);\\n        }\\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\":\"0xe7e518ba7bba3fa28c532f8902576c1bb4dfc1ec4b62bed6da50623248ba17c3\",\"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/* Contract Imports */\\nimport { Ownable } from \\\"./Lib_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     * Contract Variables: Internal Accounting *\\n     *******************************************/\\n\\n    mapping (bytes32 => address) private addresses;\\n\\n\\n    /********************\\n     * Public Functions *\\n     ********************/\\n\\n    function setAddress(\\n        string memory _name,\\n        address _address\\n    )\\n        public\\n        onlyOwner\\n    {\\n        emit AddressSet(_name, _address);\\n        addresses[_getNameHash(_name)] = _address;\\n    }\\n\\n    function getAddress(\\n        string memory _name\\n    )\\n        public\\n        view\\n        returns (address)\\n    {\\n        return addresses[_getNameHash(_name)];\\n    }\\n\\n\\n    /**********************\\n     * Internal Functions *\\n     **********************/\\n\\n    function _getNameHash(\\n        string memory _name\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes32 _hash\\n        )\\n    {\\n        return keccak256(abi.encodePacked(_name));\\n    }\\n}\\n\",\"keccak256\":\"0x3a490595cc21ff170e4027843093670ff845d5972481fbfb956b722ea564bb06\",\"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     * Contract Variables: Contract References *\\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    function resolve(\\n        string memory _name\\n    )\\n        public\\n        view\\n        returns (\\n            address _contract\\n        )\\n    {\\n        return libAddressManager.getAddress(_name);\\n    }\\n}\\n\",\"keccak256\":\"0xaa3ed342f6deb156c660fd83afa579a3b80db17eb465e8949cf5c1b114780143\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/resolver/Lib_Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/**\\n * @title Ownable\\n * @dev Adapted from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol\\n */\\nabstract contract Ownable {\\n\\n    /*************\\n     * Variables *\\n     *************/\\n\\n    address public owner;\\n\\n\\n    /**********\\n     * Events *\\n     **********/\\n\\n    event OwnershipTransferred(\\n        address indexed previousOwner,\\n        address indexed newOwner\\n    );\\n\\n\\n    /***************\\n     * Constructor *\\n     ***************/\\n\\n    constructor() {\\n        owner = msg.sender;\\n        emit OwnershipTransferred(address(0), owner);\\n    }\\n\\n\\n    /**********************\\n     * Function Modifiers *\\n     **********************/\\n\\n    modifier onlyOwner() {\\n        require(\\n            owner == msg.sender,\\n            \\\"Ownable: caller is not the owner\\\"\\n        );\\n        _;\\n    }\\n\\n\\n    /********************\\n     * Public Functions *\\n     ********************/\\n\\n    function renounceOwnership()\\n        public\\n        virtual\\n        onlyOwner\\n    {\\n        emit OwnershipTransferred(owner, address(0));\\n        owner = address(0);\\n    }\\n\\n    function transferOwnership(address _newOwner)\\n        public\\n        virtual\\n        onlyOwner\\n    {\\n        require(\\n            _newOwner != address(0),\\n            \\\"Ownable: new owner cannot be the zero address\\\"\\n        );\\n\\n        emit OwnershipTransferred(owner, _newOwner);\\n        owner = _newOwner;\\n    }\\n}\\n\",\"keccak256\":\"0xd9dfd9264e5b5fedd53a5b10fdf179c3f367614b0fe69179bce4e45119f5b739\",\"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\":\"0xbdb8fae0ca2483b4cc07607a5070fc25e33c54b4e4462b99e7c0b13aac48a09b\",\"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/* Library Imports */\\nimport { Lib_BytesUtils } from \\\"../utils/Lib_BytesUtils.sol\\\";\\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 _out The RLP encoded string in bytes.\\n     */\\n    function writeBytes(\\n        bytes memory _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes memory _out\\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 _out 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 _out\\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 _out The RLP encoded string in bytes.\\n     */\\n    function writeString(\\n        string memory _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes memory _out\\n        )\\n    {\\n        return writeBytes(bytes(_in));\\n    }\\n\\n    /**\\n     * RLP encodes an address.\\n     * @param _in The address to encode.\\n     * @return _out The RLP encoded address in bytes.\\n     */\\n    function writeAddress(\\n        address _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 _out The RLP encoded uint256 in bytes.\\n     */\\n    function writeUint(\\n        uint256 _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes memory _out\\n        )\\n    {\\n        return writeBytes(_toBinary(_in));\\n    }\\n\\n    /**\\n     * RLP encodes a bool.\\n     * @param _in The bool to encode.\\n     * @return _out The RLP encoded bool in bytes.\\n     */\\n    function writeBool(\\n        bool _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes memory _out\\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 _encoded RLP encoded bytes.\\n     */\\n    function _writeLength(\\n        uint256 _len,\\n        uint256 _offset\\n    )\\n        private\\n        pure\\n        returns (\\n            bytes memory _encoded\\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 _binary RLP encoded bytes.\\n     */\\n    function _toBinary(\\n        uint256 _x\\n    )\\n        private\\n        pure\\n        returns (\\n            bytes memory _binary\\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 _flattened The flattened byte string.\\n     */\\n    function _flatten(\\n        bytes[] memory _list\\n    )\\n        private\\n        pure\\n        returns (\\n            bytes memory _flattened\\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}\",\"keccak256\":\"0xbcb24619c1758cb0d9f3fe5c79495950045a9087046a02b9ce01df46ae09ae5b\",\"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 Verifies a proof that a given key is *not* present in\\n     * the Merkle trie.\\n     * @param _key Key of the node to search for, as a hex string.\\n     * @param _proof Merkle trie inclusion proof for the node *nearest* the\\n     * 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 key is absent in the trie, `false` otherwise.\\n     */\\n    function verifyExclusionProof(\\n        bytes memory _key,\\n        bytes memory _proof,\\n        bytes32 _root\\n    )\\n        internal\\n        pure\\n        returns (\\n            bool _verified\\n        )\\n    {\\n        (\\n            bool exists,\\n        ) = get(_key, _proof, _root);\\n\\n        return exists == false;\\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, 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 == 0) {\\n                        // Our extension node doesn't share any part of our key.\\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\\n     * 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\\n     * path may include additional nodes (e.g., it comes directly from a proof)\\n     * and we can't resize in-memory arrays without costly duplication.\\n     * @param _keyRemainder Portion of the initial key that must be inserted\\n     * 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 _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        if (keyRemainder.length == 0 && lastNodeType == NodeType.LeafNode) {\\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 = _makeExtensionNode(nodeKey, 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     * @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\":\"0x161f65220b8c5cf295232f8c58c2744fbc898bf77da5f9d9c5b2dd673dafc6f6\",\"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 Verifies a proof that a given key is *not* present in\\n     * the Merkle trie.\\n     * @param _key Key of the node to search for, as a hex string.\\n     * @param _proof Merkle trie inclusion proof for the node *nearest* the\\n     * 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 key is not present in the trie, `false` otherwise.\\n     */\\n    function verifyExclusionProof(\\n        bytes memory _key,\\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.verifyExclusionProof(key, _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\":\"0x79355346f74bb1eb9eeb733cb5d9677d50115c4f390307cbf608fe071a1ada0c\",\"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 (bytes memory)\\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 (bytes memory)\\n    {\\n        if (_bytes.length - _start == 0) {\\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 (bytes32)\\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 (bytes32)\\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 (uint256)\\n    {\\n        return uint256(toBytes32(_bytes));\\n    }\\n\\n    function toUint24(bytes memory _bytes, uint256 _start) internal pure returns (uint24) {\\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(bytes memory _bytes, uint256 _start) internal pure returns (uint8) {\\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(bytes memory _bytes, uint256 _start) internal pure returns (address) {\\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 (bytes memory)\\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 (bytes memory)\\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 (bool)\\n    {\\n        return keccak256(_bytes) == keccak256(_other);\\n    }\\n}\\n\",\"keccak256\":\"0x0adf22e1b22ba09911e859f64cb3b484e992be4f9fd3b09088e6225bf8d06ce0\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/utils/Lib_ErrorUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\npragma experimental ABIEncoderV2;\\n\\n/**\\n * @title Lib_ErrorUtils\\n */\\nlibrary Lib_ErrorUtils {\\n\\n    /**********************\\n     * Internal Functions *\\n     **********************/\\n\\n    /**\\n     * Encodes an error string into raw solidity-style revert data.\\n     * (i.e. ascii bytes, prefixed with bytes4(keccak(\\\"Error(string))\\\"))\\n     * Ref: https://docs.soliditylang.org/en/v0.8.2/control-structures.html?highlight=Error(string)#panic-via-assert-and-error-via-require\\n     * @param _reason Reason for the reversion.\\n     * @return Standard solidity revert data for the given reason.\\n     */\\n    function encodeRevertString(\\n        string memory _reason\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes memory\\n        )\\n    {\\n        return abi.encodeWithSignature(\\n            \\\"Error(string)\\\",\\n            _reason\\n        );\\n    }\\n}\\n\",\"keccak256\":\"0xfc64ec4a81fb50865b502a0004ed154e8598e1a313db77303fc95e41f536e6b7\",\"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: Code Access *\\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 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 _code\\n        )\\n    {\\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 _code Full code of the contract.\\n     */\\n    function getCode(\\n        address _address\\n    )\\n        internal\\n        view\\n        returns (\\n            bytes memory _code\\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 _codeSize Size of the contract's code in bytes.\\n     */\\n    function getCodeSize(\\n        address _address\\n    )\\n        internal\\n        view\\n        returns (\\n            uint256 _codeSize\\n        )\\n    {\\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 _codeHash Hash of the contract's code.\\n     */\\n    function getCodeHash(\\n        address _address\\n    )\\n        internal\\n        view\\n        returns (\\n            bytes32 _codeHash\\n        )\\n    {\\n        assembly {\\n            _codeHash := extcodehash(_address)\\n        }\\n\\n        return _codeHash;\\n    }\\n\\n\\n    /*****************************************\\n     * Internal Functions: Contract Creation *\\n     *****************************************/\\n\\n    /**\\n     * Creates a contract with some given initialization code.\\n     * @param _code Contract initialization code.\\n     * @return _created Address of the created contract.\\n     */\\n    function createContract(\\n        bytes memory _code\\n    )\\n        internal\\n        returns (\\n            address _created\\n        )\\n    {\\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 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 _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 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 (address _address)\\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\":\"0x5fdf009da11f90cb5e99e5cd160d07bb744a5a2055774a646bdf277ad6910595\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* Library Imports */\\nimport { Lib_ErrorUtils } from \\\"../utils/Lib_ErrorUtils.sol\\\";\\n\\n/**\\n * @title Lib_SafeExecutionManagerWrapper\\n * @dev The Safe Execution Manager Wrapper provides functions which facilitate writing OVM safe \\n * code using the standard solidity compiler, by routing all its operations through the Execution \\n * Manager.\\n * \\n * Compiler used: solc\\n * Runtime target: OVM\\n */\\nlibrary Lib_SafeExecutionManagerWrapper {\\n\\n    /**********************\\n     * Internal Functions *\\n     **********************/\\n\\n    /**\\n     * Performs a safe ovmCALL.\\n     * @param _gasLimit Gas limit for the call.\\n     * @param _target Address to call.\\n     * @param _calldata Data to send to the call.\\n     * @return _success Whether or not the call reverted.\\n     * @return _returndata Data returned by the call.\\n     */\\n    function safeCALL(\\n        uint256 _gasLimit,\\n        address _target,\\n        bytes memory _calldata\\n    )\\n        internal\\n        returns (\\n            bool _success,\\n            bytes memory _returndata\\n        )\\n    {\\n        bytes memory returndata = _safeExecutionManagerInteraction(\\n            abi.encodeWithSignature(\\n                \\\"ovmCALL(uint256,address,bytes)\\\",\\n                _gasLimit,\\n                _target,\\n                _calldata\\n            )\\n        );\\n\\n        return abi.decode(returndata, (bool, bytes));\\n    }\\n\\n    /**\\n     * Performs a safe ovmDELEGATECALL.\\n     * @param _gasLimit Gas limit for the call.\\n     * @param _target Address to call.\\n     * @param _calldata Data to send to the call.\\n     * @return _success Whether or not the call reverted.\\n     * @return _returndata Data returned by the call.\\n     */\\n    function safeDELEGATECALL(\\n        uint256 _gasLimit,\\n        address _target,\\n        bytes memory _calldata\\n    )\\n        internal\\n        returns (\\n            bool _success,\\n            bytes memory _returndata\\n        )\\n    {\\n        bytes memory returndata = _safeExecutionManagerInteraction(\\n            abi.encodeWithSignature(\\n                \\\"ovmDELEGATECALL(uint256,address,bytes)\\\",\\n                _gasLimit,\\n                _target,\\n                _calldata\\n            )\\n        );\\n\\n        return abi.decode(returndata, (bool, bytes));\\n    }\\n\\n    /**\\n     * Performs a safe ovmCREATE call.\\n     * @param _gasLimit Gas limit for the creation.\\n     * @param _bytecode Code for the new contract.\\n     * @return _contract Address of the created contract.\\n     */\\n    function safeCREATE(\\n        uint256 _gasLimit,\\n        bytes memory _bytecode\\n    )\\n        internal\\n        returns (\\n            address,\\n            bytes memory\\n        )\\n    {\\n        bytes memory returndata = _safeExecutionManagerInteraction(\\n            _gasLimit,\\n            abi.encodeWithSignature(\\n                \\\"ovmCREATE(bytes)\\\",\\n                _bytecode\\n            )\\n        );\\n\\n        return abi.decode(returndata, (address, bytes));\\n    }\\n\\n    /**\\n     * Performs a safe ovmEXTCODESIZE call.\\n     * @param _contract Address of the contract to query the size of.\\n     * @return _EXTCODESIZE Size of the requested contract in bytes.\\n     */\\n    function safeEXTCODESIZE(\\n        address _contract\\n    )\\n        internal\\n        returns (\\n            uint256 _EXTCODESIZE\\n        )\\n    {\\n        bytes memory returndata = _safeExecutionManagerInteraction(\\n            abi.encodeWithSignature(\\n                \\\"ovmEXTCODESIZE(address)\\\",\\n                _contract\\n            )\\n        );\\n\\n        return abi.decode(returndata, (uint256));\\n    }\\n\\n    /**\\n     * Performs a safe ovmCHAINID call.\\n     * @return _CHAINID Result of calling ovmCHAINID.\\n     */\\n    function safeCHAINID()\\n        internal\\n        returns (\\n            uint256 _CHAINID\\n        )\\n    {\\n        bytes memory returndata = _safeExecutionManagerInteraction(\\n            abi.encodeWithSignature(\\n                \\\"ovmCHAINID()\\\"\\n            )\\n        );\\n\\n        return abi.decode(returndata, (uint256));\\n    }\\n\\n    /**\\n     * Performs a safe ovmCALLER call.\\n     * @return _CALLER Result of calling ovmCALLER.\\n     */\\n    function safeCALLER()\\n        internal\\n        returns (\\n            address _CALLER\\n        )\\n    {\\n        bytes memory returndata = _safeExecutionManagerInteraction(\\n            abi.encodeWithSignature(\\n                \\\"ovmCALLER()\\\"\\n            )\\n        );\\n\\n        return abi.decode(returndata, (address));\\n    }\\n\\n    /**\\n     * Performs a safe ovmADDRESS call.\\n     * @return _ADDRESS Result of calling ovmADDRESS.\\n     */\\n    function safeADDRESS()\\n        internal\\n        returns (\\n            address _ADDRESS\\n        )\\n    {\\n        bytes memory returndata = _safeExecutionManagerInteraction(\\n            abi.encodeWithSignature(\\n                \\\"ovmADDRESS()\\\"\\n            )\\n        );\\n\\n        return abi.decode(returndata, (address));\\n    }\\n\\n    /**\\n     * Performs a safe ovmGETNONCE call.\\n     * @return _nonce Result of calling ovmGETNONCE.\\n     */\\n    function safeGETNONCE()\\n        internal\\n        returns (\\n            uint256 _nonce\\n        )\\n    {\\n        bytes memory returndata = _safeExecutionManagerInteraction(\\n            abi.encodeWithSignature(\\n                \\\"ovmGETNONCE()\\\"\\n            )\\n        );\\n\\n        return abi.decode(returndata, (uint256));\\n    }\\n\\n    /**\\n     * Performs a safe ovmINCREMENTNONCE call.\\n     */\\n    function safeINCREMENTNONCE()\\n        internal\\n    {\\n        _safeExecutionManagerInteraction(\\n            abi.encodeWithSignature(\\n                \\\"ovmINCREMENTNONCE()\\\"\\n            )\\n        );\\n    }\\n\\n    /**\\n     * Performs a safe ovmCREATEEOA call.\\n     * @param _messageHash Message hash which was signed by EOA\\n     * @param _v v value of signature (0 or 1)\\n     * @param _r r value of signature\\n     * @param _s s value of signature\\n     */\\n    function safeCREATEEOA(\\n        bytes32 _messageHash,\\n        uint8 _v,\\n        bytes32 _r,\\n        bytes32 _s\\n    )\\n        internal\\n    {\\n        _safeExecutionManagerInteraction(\\n            abi.encodeWithSignature(\\n                \\\"ovmCREATEEOA(bytes32,uint8,bytes32,bytes32)\\\",\\n                _messageHash,\\n                _v,\\n                _r,\\n                _s\\n            )\\n        );\\n    }\\n\\n    /**\\n     * Performs a safe REVERT.\\n     * @param _reason String revert reason to pass along with the REVERT.\\n     */\\n    function safeREVERT(\\n        string memory _reason\\n    )\\n        internal\\n    {\\n        _safeExecutionManagerInteraction(\\n            abi.encodeWithSignature(\\n                \\\"ovmREVERT(bytes)\\\",\\n                Lib_ErrorUtils.encodeRevertString(\\n                    _reason\\n                )\\n            )\\n        );\\n    }\\n\\n    /**\\n     * Performs a safe \\\"require\\\".\\n     * @param _condition Boolean condition that must be true or will revert.\\n     * @param _reason String revert reason to pass along with the REVERT.\\n     */\\n    function safeREQUIRE(\\n        bool _condition,\\n        string memory _reason\\n    )\\n        internal\\n    {\\n        if (!_condition) {\\n            safeREVERT(\\n                _reason\\n            );\\n        }\\n    }\\n\\n    /**\\n     * Performs a safe ovmSLOAD call.\\n     */\\n    function safeSLOAD(\\n        bytes32 _key\\n    )\\n        internal\\n        returns (\\n            bytes32\\n        )\\n    {\\n        bytes memory returndata = _safeExecutionManagerInteraction(\\n            abi.encodeWithSignature(\\n                \\\"ovmSLOAD(bytes32)\\\",\\n                _key\\n            )\\n        );\\n\\n        return abi.decode(returndata, (bytes32));\\n    }\\n\\n    /**\\n     * Performs a safe ovmSSTORE call.\\n     */\\n    function safeSSTORE(\\n        bytes32 _key,\\n        bytes32 _value\\n    )\\n        internal\\n    {\\n        _safeExecutionManagerInteraction(\\n            abi.encodeWithSignature(\\n                \\\"ovmSSTORE(bytes32,bytes32)\\\",\\n                _key,\\n                _value\\n            )\\n        );\\n    }\\n\\n    /*********************\\n     * Private Functions *\\n     *********************/\\n\\n    /**\\n     * Performs an ovm interaction and the necessary safety checks.\\n     * @param _gasLimit Gas limit for the interaction.\\n     * @param _calldata Data to send to the OVM_ExecutionManager (encoded with sighash).\\n     * @return _returndata Data sent back by the OVM_ExecutionManager.\\n     */\\n    function _safeExecutionManagerInteraction(\\n        uint256 _gasLimit,\\n        bytes memory _calldata\\n    )\\n        private\\n        returns (\\n            bytes memory _returndata\\n        )\\n    {\\n        address ovmExecutionManager = msg.sender;\\n        (\\n            bool success,\\n            bytes memory returndata\\n        ) = ovmExecutionManager.call{gas: _gasLimit}(_calldata);\\n\\n        if (success == false) {\\n            assembly {\\n                revert(add(returndata, 0x20), mload(returndata))\\n            }\\n        } else if (returndata.length == 1) {\\n            assembly {\\n                return(0, 1)\\n            }\\n        } else {\\n            return returndata;\\n        }\\n    }\\n\\n    function _safeExecutionManagerInteraction(\\n        bytes memory _calldata\\n    )\\n        private\\n        returns (\\n            bytes memory _returndata\\n        )\\n    {\\n        return _safeExecutionManagerInteraction(\\n            gasleft(),\\n            _calldata\\n        );\\n    }\\n}\\n\",\"keccak256\":\"0x41e146e7912af794a17cd43c5a276674be956bfa8f3ca5b451bcb82d81e6f492\",\"license\":\"MIT\"}},\"version\":1}",
  "bytecode": "[encoded data, 37272 characters]",
  "deployedBytecode": "[encoded data, 37070 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."
        }
      }
    },
    "title": "OVM_StateTransitionerFactory",
    "version": 1
  },
  "userdoc": {
    "kind": "user",
    "methods": {
      "create(address,uint256,bytes32,bytes32)": {
        "notice": "Creates a new OVM_StateTransitioner"
      }
    },
    "version": 1
  },
  "storageLayout": {
    "storage": [
      {
        "astId": 12554,
        "contract": "contracts/optimistic-ethereum/OVM/verification/OVM_StateTransitionerFactory.sol:OVM_StateTransitionerFactory",
        "label": "libAddressManager",
        "offset": 0,
        "slot": "0",
        "type": "t_contract(Lib_AddressManager)12547"
      }
    ],
    "types": {
      "t_contract(Lib_AddressManager)12547": {
        "encoding": "inplace",
        "label": "contract Lib_AddressManager",
        "numberOfBytes": "20"
      }
    }
  }
}