{
  "address": "0xBcca22E9F5579193E27dD39aD821A03778C44EFA",
  "abi": [
    {
      "inputs": [
        {
          "internalType": "address",
          "name": "_owner",
          "type": "address"
        }
      ],
      "name": "create",
      "outputs": [
        {
          "internalType": "contract iOVM_StateManager",
          "name": "",
          "type": "address"
        }
      ],
      "stateMutability": "nonpayable",
      "type": "function"
    }
  ],
  "transactionHash": "0xbefc4a1ae11208ff417f3167fcabd956d94f4fd8ae832129c13e5d394b303932",
  "receipt": {
    "to": null,
    "from": "0x18394B52d3Cb931dfA76F63251919D051953413d",
    "contractAddress": "0xBcca22E9F5579193E27dD39aD821A03778C44EFA",
    "transactionIndex": 2,
    "gasUsed": "1170970",
    "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "blockHash": "0xb0130c9836442cb4f4c73c270246496ba977f812b52c56872ab995ee92f5f234",
    "transactionHash": "0xbefc4a1ae11208ff417f3167fcabd956d94f4fd8ae832129c13e5d394b303932",
    "logs": [],
    "blockNumber": 25502632,
    "cumulativeGasUsed": "1357067",
    "status": 1,
    "byzantium": true
  },
  "args": [],
  "solcInputHash": "ef3f334bac4d7e77d91b457a0d89ab0a",
  "metadata": "{\"compiler\":{\"version\":\"0.7.6+commit.7338295f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"}],\"name\":\"create\",\"outputs\":[{\"internalType\":\"contract iOVM_StateManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"The State Manager Factory is called by a State Transitioner's init code, to create a new State Manager for use in the Fraud Verification process. Compiler used: solc Runtime target: EVM\",\"kind\":\"dev\",\"methods\":{\"create(address)\":{\"params\":{\"_owner\":\"Owner of the created contract.\"},\"returns\":{\"_0\":\"New OVM_StateManager instance.\"}}},\"title\":\"OVM_StateManagerFactory\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"create(address)\":{\"notice\":\"Creates a new OVM_StateManager\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/optimistic-ethereum/OVM/execution/OVM_StateManagerFactory.sol\":\"OVM_StateManagerFactory\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/optimistic-ethereum/OVM/execution/OVM_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/* Interface Imports */\\nimport { iOVM_StateManager } from \\\"../../iOVM/execution/iOVM_StateManager.sol\\\";\\n\\n/**\\n * @title OVM_StateManager\\n * @dev The State Manager contract holds all storage values for contracts in the OVM. It can only be written to by the\\n * the Execution Manager and State Transitioner. It runs on L1 during the setup and execution of a fraud proof.\\n * The same logic runs on L2, but has been implemented as a precompile in the L2 go-ethereum client\\n * (see https://github.com/ethereum-optimism/go-ethereum/blob/master/core/vm/ovm_state_manager.go).\\n *\\n * Compiler used: solc\\n * Runtime target: EVM\\n */\\ncontract OVM_StateManager is iOVM_StateManager {\\n\\n    /*************\\n     * Constants *\\n     *************/\\n\\n    bytes32 constant internal EMPTY_ACCOUNT_STORAGE_ROOT = 0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421;\\n    bytes32 constant internal EMPTY_ACCOUNT_CODE_HASH =    0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;\\n    bytes32 constant internal STORAGE_XOR_VALUE =          0xFEEDFACECAFEBEEFFEEDFACECAFEBEEFFEEDFACECAFEBEEFFEEDFACECAFEBEEF;\\n\\n\\n    /*************\\n     * Variables *\\n     *************/\\n\\n    address override public owner;\\n    address override public ovmExecutionManager;\\n    mapping (address => Lib_OVMCodec.Account) internal accounts;\\n    mapping (address => mapping (bytes32 => bytes32)) internal contractStorage;\\n    mapping (address => mapping (bytes32 => bool)) internal verifiedContractStorage;\\n    mapping (bytes32 => ItemState) internal itemStates;\\n    uint256 internal totalUncommittedAccounts;\\n    uint256 internal totalUncommittedContractStorage;\\n\\n\\n    /***************\\n     * Constructor *\\n     ***************/\\n\\n    /**\\n     * @param _owner Address of the owner of this contract.\\n     */\\n    constructor(\\n        address _owner\\n    )\\n    {\\n        owner = _owner;\\n    }\\n\\n\\n    /**********************\\n     * Function Modifiers *\\n     **********************/\\n\\n    /**\\n     * Simple authentication, this contract should only be accessible to the owner (which is expected to be the State Transitioner during `PRE_EXECUTION`\\n     * or the OVM_ExecutionManager during transaction execution.\\n     */\\n    modifier authenticated() {\\n        // owner is the State Transitioner\\n        require(\\n            msg.sender == owner || msg.sender == ovmExecutionManager,\\n            \\\"Function can only be called by authenticated addresses\\\"\\n        );\\n        _;\\n    }\\n\\n    /********************\\n     * Public Functions *\\n     ********************/\\n\\n    /**\\n     * Checks whether a given address is allowed to modify this contract.\\n     * @param _address Address to check.\\n     * @return Whether or not the address can modify this contract.\\n     */\\n    function isAuthenticated(\\n        address _address\\n    )\\n        override\\n        public\\n        view\\n        returns (\\n            bool\\n        )\\n    {\\n        return (_address == owner || _address == ovmExecutionManager);\\n    }\\n\\n    /**\\n     * Sets the address of the OVM_ExecutionManager.\\n     * @param _ovmExecutionManager Address of the OVM_ExecutionManager.\\n     */\\n    function setExecutionManager(\\n        address _ovmExecutionManager\\n    )\\n        override\\n        public\\n        authenticated\\n    {\\n        ovmExecutionManager = _ovmExecutionManager;\\n    }\\n\\n    /**\\n     * Inserts an account into the state.\\n     * @param _address Address of the account to insert.\\n     * @param _account Account to insert for the given address.\\n     */\\n    function putAccount(\\n        address _address,\\n        Lib_OVMCodec.Account memory _account\\n    )\\n        override\\n        public\\n        authenticated\\n    {\\n        accounts[_address] = _account;\\n    }\\n\\n    /**\\n     * Marks an account as empty.\\n     * @param _address Address of the account to mark.\\n     */\\n    function putEmptyAccount(\\n        address _address\\n    )\\n        override\\n        public\\n        authenticated\\n    {\\n        Lib_OVMCodec.Account storage account = accounts[_address];\\n        account.storageRoot = EMPTY_ACCOUNT_STORAGE_ROOT;\\n        account.codeHash = EMPTY_ACCOUNT_CODE_HASH;\\n    }\\n\\n    /**\\n     * Retrieves an account from the state.\\n     * @param _address Address of the account to retrieve.\\n     * @return Account for the given address.\\n     */\\n    function getAccount(\\n        address _address\\n    )\\n        override\\n        public\\n        view\\n        returns (\\n            Lib_OVMCodec.Account memory\\n        )\\n    {\\n        return accounts[_address];\\n    }\\n\\n    /**\\n     * Checks whether the state has a given account.\\n     * @param _address Address of the account to check.\\n     * @return Whether or not the state has the account.\\n     */\\n    function hasAccount(\\n        address _address\\n    )\\n        override\\n        public\\n        view\\n        returns (\\n            bool\\n        )\\n    {\\n        return accounts[_address].codeHash != bytes32(0);\\n    }\\n\\n    /**\\n     * Checks whether the state has a given known empty account.\\n     * @param _address Address of the account to check.\\n     * @return Whether or not the state has the empty account.\\n     */\\n    function hasEmptyAccount(\\n        address _address\\n    )\\n        override\\n        public\\n        view\\n        returns (\\n            bool\\n        )\\n    {\\n        return (\\n            accounts[_address].codeHash == EMPTY_ACCOUNT_CODE_HASH\\n            && accounts[_address].nonce == 0\\n        );\\n    }\\n\\n    /**\\n     * Sets the nonce of an account.\\n     * @param _address Address of the account to modify.\\n     * @param _nonce New account nonce.\\n     */\\n    function setAccountNonce(\\n        address _address,\\n        uint256 _nonce\\n    )\\n        override\\n        public\\n        authenticated\\n    {\\n        accounts[_address].nonce = _nonce;\\n    }\\n\\n    /**\\n     * Gets the nonce of an account.\\n     * @param _address Address of the account to access.\\n     * @return Nonce of the account.\\n     */\\n    function getAccountNonce(\\n        address _address\\n    )\\n        override\\n        public\\n        view\\n        returns (\\n            uint256\\n        )\\n    {\\n        return accounts[_address].nonce;\\n    }\\n\\n    /**\\n     * Retrieves the Ethereum address of an account.\\n     * @param _address Address of the account to access.\\n     * @return Corresponding Ethereum address.\\n     */\\n    function getAccountEthAddress(\\n        address _address\\n    )\\n        override\\n        public\\n        view\\n        returns (\\n            address\\n        )\\n    {\\n        return accounts[_address].ethAddress;\\n    }\\n\\n    /**\\n     * Retrieves the storage root of an account.\\n     * @param _address Address of the account to access.\\n     * @return Corresponding storage root.\\n     */\\n    function getAccountStorageRoot(\\n        address _address\\n    )\\n        override\\n        public\\n        view\\n        returns (\\n            bytes32\\n        )\\n    {\\n        return accounts[_address].storageRoot;\\n    }\\n\\n    /**\\n     * Initializes a pending account (during CREATE or CREATE2) with the default values.\\n     * @param _address Address of the account to initialize.\\n     */\\n    function initPendingAccount(\\n        address _address\\n    )\\n        override\\n        public\\n        authenticated\\n    {\\n        Lib_OVMCodec.Account storage account = accounts[_address];\\n        account.nonce = 1;\\n        account.storageRoot = EMPTY_ACCOUNT_STORAGE_ROOT;\\n        account.codeHash = EMPTY_ACCOUNT_CODE_HASH;\\n        account.isFresh = true;\\n    }\\n\\n    /**\\n     * Finalizes the creation of a pending account (during CREATE or CREATE2).\\n     * @param _address Address of the account to finalize.\\n     * @param _ethAddress Address of the account's associated contract on Ethereum.\\n     * @param _codeHash Hash of the account's code.\\n     */\\n    function commitPendingAccount(\\n        address _address,\\n        address _ethAddress,\\n        bytes32 _codeHash\\n    )\\n        override\\n        public\\n        authenticated\\n    {\\n        Lib_OVMCodec.Account storage account = accounts[_address];\\n        account.ethAddress = _ethAddress;\\n        account.codeHash = _codeHash;\\n    }\\n\\n    /**\\n     * Checks whether an account has already been retrieved, and marks it as retrieved if not.\\n     * @param _address Address of the account to check.\\n     * @return Whether or not the account was already loaded.\\n     */\\n    function testAndSetAccountLoaded(\\n        address _address\\n    )\\n        override\\n        public\\n        authenticated\\n        returns (\\n            bool\\n        )\\n    {\\n        return _testAndSetItemState(\\n            _getItemHash(_address),\\n            ItemState.ITEM_LOADED\\n        );\\n    }\\n\\n    /**\\n     * Checks whether an account has already been modified, and marks it as modified if not.\\n     * @param _address Address of the account to check.\\n     * @return Whether or not the account was already modified.\\n     */\\n    function testAndSetAccountChanged(\\n        address _address\\n    )\\n        override\\n        public\\n        authenticated\\n        returns (\\n            bool\\n        )\\n    {\\n        return _testAndSetItemState(\\n            _getItemHash(_address),\\n            ItemState.ITEM_CHANGED\\n        );\\n    }\\n\\n    /**\\n     * Attempts to mark an account as committed.\\n     * @param _address Address of the account to commit.\\n     * @return Whether or not the account was committed.\\n     */\\n    function commitAccount(\\n        address _address\\n    )\\n        override\\n        public\\n        authenticated\\n        returns (\\n            bool\\n        )\\n    {\\n        bytes32 item = _getItemHash(_address);\\n        if (itemStates[item] != ItemState.ITEM_CHANGED) {\\n            return false;\\n        }\\n\\n        itemStates[item] = ItemState.ITEM_COMMITTED;\\n        totalUncommittedAccounts -= 1;\\n\\n        return true;\\n    }\\n\\n    /**\\n     * Increments the total number of uncommitted accounts.\\n     */\\n    function incrementTotalUncommittedAccounts()\\n        override\\n        public\\n        authenticated\\n    {\\n        totalUncommittedAccounts += 1;\\n    }\\n\\n    /**\\n     * Gets the total number of uncommitted accounts.\\n     * @return Total uncommitted accounts.\\n     */\\n    function getTotalUncommittedAccounts()\\n        override\\n        public\\n        view\\n        returns (\\n            uint256\\n        )\\n    {\\n        return totalUncommittedAccounts;\\n    }\\n\\n    /**\\n     * Checks whether a given account was changed during execution.\\n     * @param _address Address to check.\\n     * @return Whether or not the account was changed.\\n     */\\n    function wasAccountChanged(\\n        address _address\\n    )\\n        override\\n        public\\n        view\\n        returns (\\n            bool\\n        )\\n    {\\n        bytes32 item = _getItemHash(_address);\\n        return itemStates[item] >= ItemState.ITEM_CHANGED;\\n    }\\n\\n    /**\\n     * Checks whether a given account was committed after execution.\\n     * @param _address Address to check.\\n     * @return Whether or not the account was committed.\\n     */\\n    function wasAccountCommitted(\\n        address _address\\n    )\\n        override\\n        public\\n        view\\n        returns (\\n            bool\\n        )\\n    {\\n        bytes32 item = _getItemHash(_address);\\n        return itemStates[item] >= ItemState.ITEM_COMMITTED;\\n    }\\n\\n\\n    /************************************\\n     * Public Functions: Storage Access *\\n     ************************************/\\n\\n    /**\\n     * Changes a contract storage slot value.\\n     * @param _contract Address of the contract to modify.\\n     * @param _key 32 byte storage slot key.\\n     * @param _value 32 byte storage slot value.\\n     */\\n    function putContractStorage(\\n        address _contract,\\n        bytes32 _key,\\n        bytes32 _value\\n    )\\n        override\\n        public\\n        authenticated\\n    {\\n        // A hilarious optimization. `SSTORE`ing a value of `bytes32(0)` is common enough that it's\\n        // worth populating this with a non-zero value in advance (during the fraud proof\\n        // initialization phase) to cut the execution-time cost down to 5000 gas.\\n        contractStorage[_contract][_key] = _value ^ STORAGE_XOR_VALUE;\\n\\n        // Only used when initially populating the contract storage. OVM_ExecutionManager will\\n        // perform a `hasContractStorage` INVALID_STATE_ACCESS check before putting any contract\\n        // storage because writing to zero when the actual value is nonzero causes a gas\\n        // discrepancy. Could be moved into a new `putVerifiedContractStorage` function, or\\n        // something along those lines.\\n        if (verifiedContractStorage[_contract][_key] == false) {\\n            verifiedContractStorage[_contract][_key] = true;\\n        }\\n    }\\n\\n    /**\\n     * Retrieves a contract storage slot value.\\n     * @param _contract Address of the contract to access.\\n     * @param _key 32 byte storage slot key.\\n     * @return 32 byte storage slot value.\\n     */\\n    function getContractStorage(\\n        address _contract,\\n        bytes32 _key\\n    )\\n        override\\n        public\\n        view\\n        returns (\\n            bytes32\\n        )\\n    {\\n        // Storage XOR system doesn't work for newly created contracts that haven't set this\\n        // storage slot value yet.\\n        if (\\n            verifiedContractStorage[_contract][_key] == false\\n            && accounts[_contract].isFresh\\n        ) {\\n            return bytes32(0);\\n        }\\n\\n        // See `putContractStorage` for more information about the XOR here.\\n        return contractStorage[_contract][_key] ^ STORAGE_XOR_VALUE;\\n    }\\n\\n    /**\\n     * Checks whether a contract storage slot exists in the state.\\n     * @param _contract Address of the contract to access.\\n     * @param _key 32 byte storage slot key.\\n     * @return Whether or not the key was set in the state.\\n     */\\n    function hasContractStorage(\\n        address _contract,\\n        bytes32 _key\\n    )\\n        override\\n        public\\n        view\\n        returns (\\n            bool\\n        )\\n    {\\n        return verifiedContractStorage[_contract][_key] || accounts[_contract].isFresh;\\n    }\\n\\n    /**\\n     * Checks whether a storage slot has already been retrieved, and marks it as retrieved if not.\\n     * @param _contract Address of the contract to check.\\n     * @param _key 32 byte storage slot key.\\n     * @return Whether or not the slot was already loaded.\\n     */\\n    function testAndSetContractStorageLoaded(\\n        address _contract,\\n        bytes32 _key\\n    )\\n        override\\n        public\\n        authenticated\\n        returns (\\n            bool\\n        )\\n    {\\n        return _testAndSetItemState(\\n            _getItemHash(_contract, _key),\\n            ItemState.ITEM_LOADED\\n        );\\n    }\\n\\n    /**\\n     * Checks whether a storage slot has already been modified, and marks it as modified if not.\\n     * @param _contract Address of the contract to check.\\n     * @param _key 32 byte storage slot key.\\n     * @return Whether or not the slot was already modified.\\n     */\\n    function testAndSetContractStorageChanged(\\n        address _contract,\\n        bytes32 _key\\n    )\\n        override\\n        public\\n        authenticated\\n        returns (\\n            bool\\n        )\\n    {\\n        return _testAndSetItemState(\\n            _getItemHash(_contract, _key),\\n            ItemState.ITEM_CHANGED\\n        );\\n    }\\n\\n    /**\\n     * Attempts to mark a storage slot as committed.\\n     * @param _contract Address of the account to commit.\\n     * @param _key 32 byte slot key to commit.\\n     * @return Whether or not the slot was committed.\\n     */\\n    function commitContractStorage(\\n        address _contract,\\n        bytes32 _key\\n    )\\n        override\\n        public\\n        authenticated\\n        returns (\\n            bool\\n        )\\n    {\\n        bytes32 item = _getItemHash(_contract, _key);\\n        if (itemStates[item] != ItemState.ITEM_CHANGED) {\\n            return false;\\n        }\\n\\n        itemStates[item] = ItemState.ITEM_COMMITTED;\\n        totalUncommittedContractStorage -= 1;\\n\\n        return true;\\n    }\\n\\n    /**\\n     * Increments the total number of uncommitted storage slots.\\n     */\\n    function incrementTotalUncommittedContractStorage()\\n        override\\n        public\\n        authenticated\\n    {\\n        totalUncommittedContractStorage += 1;\\n    }\\n\\n    /**\\n     * Gets the total number of uncommitted storage slots.\\n     * @return Total uncommitted storage slots.\\n     */\\n    function getTotalUncommittedContractStorage()\\n        override\\n        public\\n        view\\n        returns (\\n            uint256\\n        )\\n    {\\n        return totalUncommittedContractStorage;\\n    }\\n\\n    /**\\n     * Checks whether a given storage slot was changed during execution.\\n     * @param _contract Address to check.\\n     * @param _key Key of the storage slot to check.\\n     * @return Whether or not the storage slot was changed.\\n     */\\n    function wasContractStorageChanged(\\n        address _contract,\\n        bytes32 _key\\n    )\\n        override\\n        public\\n        view\\n        returns (\\n            bool\\n        )\\n    {\\n        bytes32 item = _getItemHash(_contract, _key);\\n        return itemStates[item] >= ItemState.ITEM_CHANGED;\\n    }\\n\\n    /**\\n     * Checks whether a given storage slot was committed after execution.\\n     * @param _contract Address to check.\\n     * @param _key Key of the storage slot to check.\\n     * @return Whether or not the storage slot was committed.\\n     */\\n    function wasContractStorageCommitted(\\n        address _contract,\\n        bytes32 _key\\n    )\\n        override\\n        public\\n        view\\n        returns (\\n            bool\\n        )\\n    {\\n        bytes32 item = _getItemHash(_contract, _key);\\n        return itemStates[item] >= ItemState.ITEM_COMMITTED;\\n    }\\n\\n\\n    /**********************\\n     * Internal Functions *\\n     **********************/\\n\\n    /**\\n     * Generates a unique hash for an address.\\n     * @param _address Address to generate a hash for.\\n     * @return Unique hash for the given address.\\n     */\\n    function _getItemHash(\\n        address _address\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes32\\n        )\\n    {\\n        return keccak256(abi.encodePacked(_address));\\n    }\\n\\n    /**\\n     * Generates a unique hash for an address/key pair.\\n     * @param _contract Address to generate a hash for.\\n     * @param _key Key to generate a hash for.\\n     * @return Unique hash for the given pair.\\n     */\\n    function _getItemHash(\\n        address _contract,\\n        bytes32 _key\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes32\\n        )\\n    {\\n        return keccak256(abi.encodePacked(\\n            _contract,\\n            _key\\n        ));\\n    }\\n\\n    /**\\n     * Checks whether an item is in a particular state (ITEM_LOADED or ITEM_CHANGED) and sets the\\n     * item to the provided state if not.\\n     * @param _item 32 byte item ID to check.\\n     * @param _minItemState Minimum state that must be satisfied by the item.\\n     * @return Whether or not the item was already in the state.\\n     */\\n    function _testAndSetItemState(\\n        bytes32 _item,\\n        ItemState _minItemState\\n    )\\n        internal\\n        returns (\\n            bool\\n        )\\n    {\\n        bool wasItemState = itemStates[_item] >= _minItemState;\\n\\n        if (wasItemState == false) {\\n            itemStates[_item] = _minItemState;\\n        }\\n\\n        return wasItemState;\\n    }\\n}\\n\",\"keccak256\":\"0x0df9654f9f958038435c2b2a2c7793b20fa16afe866a69cbed32a371aaa4c78b\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/OVM/execution/OVM_StateManagerFactory.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* Interface Imports */\\nimport { iOVM_StateManager } from \\\"../../iOVM/execution/iOVM_StateManager.sol\\\";\\nimport { iOVM_StateManagerFactory } from \\\"../../iOVM/execution/iOVM_StateManagerFactory.sol\\\";\\n\\n/* Contract Imports */\\nimport { OVM_StateManager } from \\\"./OVM_StateManager.sol\\\";\\n\\n/**\\n * @title OVM_StateManagerFactory\\n * @dev The State Manager Factory is called by a State Transitioner's init code, to create a new\\n * State Manager for use in the Fraud Verification process.\\n *\\n * Compiler used: solc\\n * Runtime target: EVM\\n */\\ncontract OVM_StateManagerFactory is iOVM_StateManagerFactory {\\n\\n    /********************\\n     * Public Functions *\\n     ********************/\\n\\n    /**\\n     * Creates a new OVM_StateManager\\n     * @param _owner Owner of the created contract.\\n     * @return New OVM_StateManager instance.\\n     */\\n    function create(\\n        address _owner\\n    )\\n        override\\n        public\\n        returns (\\n            iOVM_StateManager\\n        )\\n    {\\n        return new OVM_StateManager(_owner);\\n    }\\n}\\n\",\"keccak256\":\"0xc557f05b8a82eee7b36a389795fe4acc0803bcf5ae33e15e9cba8226e9ab49fc\",\"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/libraries/codec/Lib_OVMCodec.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\npragma experimental ABIEncoderV2;\\n\\n/* Library Imports */\\nimport { Lib_RLPReader } from \\\"../rlp/Lib_RLPReader.sol\\\";\\nimport { Lib_RLPWriter } from \\\"../rlp/Lib_RLPWriter.sol\\\";\\nimport { Lib_BytesUtils } from \\\"../utils/Lib_BytesUtils.sol\\\";\\nimport { Lib_Bytes32Utils } from \\\"../utils/Lib_Bytes32Utils.sol\\\";\\n\\n/**\\n * @title Lib_OVMCodec\\n */\\nlibrary Lib_OVMCodec {\\n\\n    /*********\\n     * Enums *\\n     *********/\\n\\n    enum QueueOrigin {\\n        SEQUENCER_QUEUE,\\n        L1TOL2_QUEUE\\n    }\\n\\n\\n    /***********\\n     * Structs *\\n     ***********/\\n\\n    struct Account {\\n        uint256 nonce;\\n        uint256 balance;\\n        bytes32 storageRoot;\\n        bytes32 codeHash;\\n        address ethAddress;\\n        bool isFresh;\\n    }\\n\\n    struct EVMAccount {\\n        uint256 nonce;\\n        uint256 balance;\\n        bytes32 storageRoot;\\n        bytes32 codeHash;\\n    }\\n\\n    struct ChainBatchHeader {\\n        uint256 batchIndex;\\n        bytes32 batchRoot;\\n        uint256 batchSize;\\n        uint256 prevTotalElements;\\n        bytes extraData;\\n    }\\n\\n    struct ChainInclusionProof {\\n        uint256 index;\\n        bytes32[] siblings;\\n    }\\n\\n    struct Transaction {\\n        uint256 timestamp;\\n        uint256 blockNumber;\\n        QueueOrigin l1QueueOrigin;\\n        address l1TxOrigin;\\n        address entrypoint;\\n        uint256 gasLimit;\\n        bytes data;\\n    }\\n\\n    struct TransactionChainElement {\\n        bool isSequenced;\\n        uint256 queueIndex;  // QUEUED TX ONLY\\n        uint256 timestamp;   // SEQUENCER TX ONLY\\n        uint256 blockNumber; // SEQUENCER TX ONLY\\n        bytes txData;        // SEQUENCER TX ONLY\\n    }\\n\\n    struct QueueElement {\\n        bytes32 transactionHash;\\n        uint40 timestamp;\\n        uint40 blockNumber;\\n    }\\n\\n\\n    /**********************\\n     * Internal Functions *\\n     **********************/\\n\\n    /**\\n     * Encodes a standard OVM transaction.\\n     * @param _transaction OVM transaction to encode.\\n     * @return Encoded transaction bytes.\\n     */\\n    function encodeTransaction(\\n        Transaction memory _transaction\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes memory\\n        )\\n    {\\n        return abi.encodePacked(\\n            _transaction.timestamp,\\n            _transaction.blockNumber,\\n            _transaction.l1QueueOrigin,\\n            _transaction.l1TxOrigin,\\n            _transaction.entrypoint,\\n            _transaction.gasLimit,\\n            _transaction.data\\n        );\\n    }\\n\\n    /**\\n     * Hashes a standard OVM transaction.\\n     * @param _transaction OVM transaction to encode.\\n     * @return Hashed transaction\\n     */\\n    function hashTransaction(\\n        Transaction memory _transaction\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes32\\n        )\\n    {\\n        return keccak256(encodeTransaction(_transaction));\\n    }\\n\\n    /**\\n     * Converts an OVM account to an EVM account.\\n     * @param _in OVM account to convert.\\n     * @return Converted EVM account.\\n     */\\n    function toEVMAccount(\\n        Account memory _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            EVMAccount memory\\n        )\\n    {\\n        return EVMAccount({\\n            nonce: _in.nonce,\\n            balance: _in.balance,\\n            storageRoot: _in.storageRoot,\\n            codeHash: _in.codeHash\\n        });\\n    }\\n\\n    /**\\n     * @notice RLP-encodes an account state struct.\\n     * @param _account Account state struct.\\n     * @return RLP-encoded account state.\\n     */\\n    function encodeEVMAccount(\\n        EVMAccount memory _account\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes memory\\n        )\\n    {\\n        bytes[] memory raw = new bytes[](4);\\n\\n        // Unfortunately we can't create this array outright because\\n        // Lib_RLPWriter.writeList will reject fixed-size arrays. Assigning\\n        // index-by-index circumvents this issue.\\n        raw[0] = Lib_RLPWriter.writeBytes(\\n            Lib_Bytes32Utils.removeLeadingZeros(\\n                bytes32(_account.nonce)\\n            )\\n        );\\n        raw[1] = Lib_RLPWriter.writeBytes(\\n            Lib_Bytes32Utils.removeLeadingZeros(\\n                bytes32(_account.balance)\\n            )\\n        );\\n        raw[2] = Lib_RLPWriter.writeBytes(abi.encodePacked(_account.storageRoot));\\n        raw[3] = Lib_RLPWriter.writeBytes(abi.encodePacked(_account.codeHash));\\n\\n        return Lib_RLPWriter.writeList(raw);\\n    }\\n\\n    /**\\n     * @notice Decodes an RLP-encoded account state into a useful struct.\\n     * @param _encoded RLP-encoded account state.\\n     * @return Account state struct.\\n     */\\n    function decodeEVMAccount(\\n        bytes memory _encoded\\n    )\\n        internal\\n        pure\\n        returns (\\n            EVMAccount memory\\n        )\\n    {\\n        Lib_RLPReader.RLPItem[] memory accountState = Lib_RLPReader.readList(_encoded);\\n\\n        return EVMAccount({\\n            nonce: Lib_RLPReader.readUint256(accountState[0]),\\n            balance: Lib_RLPReader.readUint256(accountState[1]),\\n            storageRoot: Lib_RLPReader.readBytes32(accountState[2]),\\n            codeHash: Lib_RLPReader.readBytes32(accountState[3])\\n        });\\n    }\\n\\n    /**\\n     * Calculates a hash for a given batch header.\\n     * @param _batchHeader Header to hash.\\n     * @return Hash of the header.\\n     */\\n    function hashBatchHeader(\\n        Lib_OVMCodec.ChainBatchHeader memory _batchHeader\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes32\\n        )\\n    {\\n        return keccak256(\\n            abi.encode(\\n                _batchHeader.batchRoot,\\n                _batchHeader.batchSize,\\n                _batchHeader.prevTotalElements,\\n                _batchHeader.extraData\\n            )\\n        );\\n    }\\n}\\n\",\"keccak256\":\"0xd85ba2066057a2677926f484b938c7c2ef33ff3853f3b71cda252f4a54f30e05\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/rlp/Lib_RLPReader.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/**\\n * @title Lib_RLPReader\\n * @dev Adapted from \\\"RLPReader\\\" by Hamdi Allam (hamdi.allam97@gmail.com).\\n */\\nlibrary Lib_RLPReader {\\n\\n    /*************\\n     * Constants *\\n     *************/\\n\\n    uint256 constant internal MAX_LIST_LENGTH = 32;\\n\\n\\n    /*********\\n     * Enums *\\n     *********/\\n\\n    enum RLPItemType {\\n        DATA_ITEM,\\n        LIST_ITEM\\n    }\\n\\n\\n    /***********\\n     * Structs *\\n     ***********/\\n\\n    struct RLPItem {\\n        uint256 length;\\n        uint256 ptr;\\n    }\\n\\n\\n    /**********************\\n     * Internal Functions *\\n     **********************/\\n\\n    /**\\n     * Converts bytes to a reference to memory position and length.\\n     * @param _in Input bytes to convert.\\n     * @return Output memory reference.\\n     */\\n    function toRLPItem(\\n        bytes memory _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            RLPItem memory\\n        )\\n    {\\n        uint256 ptr;\\n        assembly {\\n            ptr := add(_in, 32)\\n        }\\n\\n        return RLPItem({\\n            length: _in.length,\\n            ptr: ptr\\n        });\\n    }\\n\\n    /**\\n     * Reads an RLP list value into a list of RLP items.\\n     * @param _in RLP list value.\\n     * @return Decoded RLP list items.\\n     */\\n    function readList(\\n        RLPItem memory _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            RLPItem[] memory\\n        )\\n    {\\n        (\\n            uint256 listOffset,\\n            ,\\n            RLPItemType itemType\\n        ) = _decodeLength(_in);\\n\\n        require(\\n            itemType == RLPItemType.LIST_ITEM,\\n            \\\"Invalid RLP list value.\\\"\\n        );\\n\\n        // Solidity in-memory arrays can't be increased in size, but *can* be decreased in size by\\n        // writing to the length. Since we can't know the number of RLP items without looping over\\n        // the entire input, we'd have to loop twice to accurately size this array. It's easier to\\n        // simply set a reasonable maximum list length and decrease the size before we finish.\\n        RLPItem[] memory out = new RLPItem[](MAX_LIST_LENGTH);\\n\\n        uint256 itemCount = 0;\\n        uint256 offset = listOffset;\\n        while (offset < _in.length) {\\n            require(\\n                itemCount < MAX_LIST_LENGTH,\\n                \\\"Provided RLP list exceeds max list length.\\\"\\n            );\\n\\n            (\\n                uint256 itemOffset,\\n                uint256 itemLength,\\n            ) = _decodeLength(RLPItem({\\n                length: _in.length - offset,\\n                ptr: _in.ptr + offset\\n            }));\\n\\n            out[itemCount] = RLPItem({\\n                length: itemLength + itemOffset,\\n                ptr: _in.ptr + offset\\n            });\\n\\n            itemCount += 1;\\n            offset += itemOffset + itemLength;\\n        }\\n\\n        // Decrease the array size to match the actual item count.\\n        assembly {\\n            mstore(out, itemCount)\\n        }\\n\\n        return out;\\n    }\\n\\n    /**\\n     * Reads an RLP list value into a list of RLP items.\\n     * @param _in RLP list value.\\n     * @return Decoded RLP list items.\\n     */\\n    function readList(\\n        bytes memory _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            RLPItem[] memory\\n        )\\n    {\\n        return readList(\\n            toRLPItem(_in)\\n        );\\n    }\\n\\n    /**\\n     * Reads an RLP bytes value into bytes.\\n     * @param _in RLP bytes value.\\n     * @return Decoded bytes.\\n     */\\n    function readBytes(\\n        RLPItem memory _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes memory\\n        )\\n    {\\n        (\\n            uint256 itemOffset,\\n            uint256 itemLength,\\n            RLPItemType itemType\\n        ) = _decodeLength(_in);\\n\\n        require(\\n            itemType == RLPItemType.DATA_ITEM,\\n            \\\"Invalid RLP bytes value.\\\"\\n        );\\n\\n        return _copy(_in.ptr, itemOffset, itemLength);\\n    }\\n\\n    /**\\n     * Reads an RLP bytes value into bytes.\\n     * @param _in RLP bytes value.\\n     * @return Decoded bytes.\\n     */\\n    function readBytes(\\n        bytes memory _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes memory\\n        )\\n    {\\n        return readBytes(\\n            toRLPItem(_in)\\n        );\\n    }\\n\\n    /**\\n     * Reads an RLP string value into a string.\\n     * @param _in RLP string value.\\n     * @return Decoded string.\\n     */\\n    function readString(\\n        RLPItem memory _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            string memory\\n        )\\n    {\\n        return string(readBytes(_in));\\n    }\\n\\n    /**\\n     * Reads an RLP string value into a string.\\n     * @param _in RLP string value.\\n     * @return Decoded string.\\n     */\\n    function readString(\\n        bytes memory _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            string memory\\n        )\\n    {\\n        return readString(\\n            toRLPItem(_in)\\n        );\\n    }\\n\\n    /**\\n     * Reads an RLP bytes32 value into a bytes32.\\n     * @param _in RLP bytes32 value.\\n     * @return Decoded bytes32.\\n     */\\n    function readBytes32(\\n        RLPItem memory _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes32\\n        )\\n    {\\n        require(\\n            _in.length <= 33,\\n            \\\"Invalid RLP bytes32 value.\\\"\\n        );\\n\\n        (\\n            uint256 itemOffset,\\n            uint256 itemLength,\\n            RLPItemType itemType\\n        ) = _decodeLength(_in);\\n\\n        require(\\n            itemType == RLPItemType.DATA_ITEM,\\n            \\\"Invalid RLP bytes32 value.\\\"\\n        );\\n\\n        uint256 ptr = _in.ptr + itemOffset;\\n        bytes32 out;\\n        assembly {\\n            out := mload(ptr)\\n\\n            // Shift the bytes over to match the item size.\\n            if lt(itemLength, 32) {\\n                out := div(out, exp(256, sub(32, itemLength)))\\n            }\\n        }\\n\\n        return out;\\n    }\\n\\n    /**\\n     * Reads an RLP bytes32 value into a bytes32.\\n     * @param _in RLP bytes32 value.\\n     * @return Decoded bytes32.\\n     */\\n    function readBytes32(\\n        bytes memory _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes32\\n        )\\n    {\\n        return readBytes32(\\n            toRLPItem(_in)\\n        );\\n    }\\n\\n    /**\\n     * Reads an RLP uint256 value into a uint256.\\n     * @param _in RLP uint256 value.\\n     * @return Decoded uint256.\\n     */\\n    function readUint256(\\n        RLPItem memory _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            uint256\\n        )\\n    {\\n        return uint256(readBytes32(_in));\\n    }\\n\\n    /**\\n     * Reads an RLP uint256 value into a uint256.\\n     * @param _in RLP uint256 value.\\n     * @return Decoded uint256.\\n     */\\n    function readUint256(\\n        bytes memory _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            uint256\\n        )\\n    {\\n        return readUint256(\\n            toRLPItem(_in)\\n        );\\n    }\\n\\n    /**\\n     * Reads an RLP bool value into a bool.\\n     * @param _in RLP bool value.\\n     * @return Decoded bool.\\n     */\\n    function readBool(\\n        RLPItem memory _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            bool\\n        )\\n    {\\n        require(\\n            _in.length == 1,\\n            \\\"Invalid RLP boolean value.\\\"\\n        );\\n\\n        uint256 ptr = _in.ptr;\\n        uint256 out;\\n        assembly {\\n            out := byte(0, mload(ptr))\\n        }\\n\\n        require(\\n            out == 0 || out == 1,\\n            \\\"Lib_RLPReader: Invalid RLP boolean value, must be 0 or 1\\\"\\n        );\\n\\n        return out != 0;\\n    }\\n\\n    /**\\n     * Reads an RLP bool value into a bool.\\n     * @param _in RLP bool value.\\n     * @return Decoded bool.\\n     */\\n    function readBool(\\n        bytes memory _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            bool\\n        )\\n    {\\n        return readBool(\\n            toRLPItem(_in)\\n        );\\n    }\\n\\n    /**\\n     * Reads an RLP address value into a address.\\n     * @param _in RLP address value.\\n     * @return Decoded address.\\n     */\\n    function readAddress(\\n        RLPItem memory _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            address\\n        )\\n    {\\n        if (_in.length == 1) {\\n            return address(0);\\n        }\\n\\n        require(\\n            _in.length == 21,\\n            \\\"Invalid RLP address value.\\\"\\n        );\\n\\n        return address(readUint256(_in));\\n    }\\n\\n    /**\\n     * Reads an RLP address value into a address.\\n     * @param _in RLP address value.\\n     * @return Decoded address.\\n     */\\n    function readAddress(\\n        bytes memory _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            address\\n        )\\n    {\\n        return readAddress(\\n            toRLPItem(_in)\\n        );\\n    }\\n\\n    /**\\n     * Reads the raw bytes of an RLP item.\\n     * @param _in RLP item to read.\\n     * @return Raw RLP bytes.\\n     */\\n    function readRawBytes(\\n        RLPItem memory _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes memory\\n        )\\n    {\\n        return _copy(_in);\\n    }\\n\\n\\n    /*********************\\n     * Private Functions *\\n     *********************/\\n\\n    /**\\n     * Decodes the length of an RLP item.\\n     * @param _in RLP item to decode.\\n     * @return Offset of the encoded data.\\n     * @return Length of the encoded data.\\n     * @return RLP item type (LIST_ITEM or DATA_ITEM).\\n     */\\n    function _decodeLength(\\n        RLPItem memory _in\\n    )\\n        private\\n        pure\\n        returns (\\n            uint256,\\n            uint256,\\n            RLPItemType\\n        )\\n    {\\n        require(\\n            _in.length > 0,\\n            \\\"RLP item cannot be null.\\\"\\n        );\\n\\n        uint256 ptr = _in.ptr;\\n        uint256 prefix;\\n        assembly {\\n            prefix := byte(0, mload(ptr))\\n        }\\n\\n        if (prefix <= 0x7f) {\\n            // Single byte.\\n\\n            return (0, 1, RLPItemType.DATA_ITEM);\\n        } else if (prefix <= 0xb7) {\\n            // Short string.\\n\\n            uint256 strLen = prefix - 0x80;\\n\\n            require(\\n                _in.length > strLen,\\n                \\\"Invalid RLP short string.\\\"\\n            );\\n\\n            return (1, strLen, RLPItemType.DATA_ITEM);\\n        } else if (prefix <= 0xbf) {\\n            // Long string.\\n            uint256 lenOfStrLen = prefix - 0xb7;\\n\\n            require(\\n                _in.length > lenOfStrLen,\\n                \\\"Invalid RLP long string length.\\\"\\n            );\\n\\n            uint256 strLen;\\n            assembly {\\n                // Pick out the string length.\\n                strLen := div(\\n                    mload(add(ptr, 1)),\\n                    exp(256, sub(32, lenOfStrLen))\\n                )\\n            }\\n\\n            require(\\n                _in.length > lenOfStrLen + strLen,\\n                \\\"Invalid RLP long string.\\\"\\n            );\\n\\n            return (1 + lenOfStrLen, strLen, RLPItemType.DATA_ITEM);\\n        } else if (prefix <= 0xf7) {\\n            // Short list.\\n            uint256 listLen = prefix - 0xc0;\\n\\n            require(\\n                _in.length > listLen,\\n                \\\"Invalid RLP short list.\\\"\\n            );\\n\\n            return (1, listLen, RLPItemType.LIST_ITEM);\\n        } else {\\n            // Long list.\\n            uint256 lenOfListLen = prefix - 0xf7;\\n\\n            require(\\n                _in.length > lenOfListLen,\\n                \\\"Invalid RLP long list length.\\\"\\n            );\\n\\n            uint256 listLen;\\n            assembly {\\n                // Pick out the list length.\\n                listLen := div(\\n                    mload(add(ptr, 1)),\\n                    exp(256, sub(32, lenOfListLen))\\n                )\\n            }\\n\\n            require(\\n                _in.length > lenOfListLen + listLen,\\n                \\\"Invalid RLP long list.\\\"\\n            );\\n\\n            return (1 + lenOfListLen, listLen, RLPItemType.LIST_ITEM);\\n        }\\n    }\\n\\n    /**\\n     * Copies the bytes from a memory location.\\n     * @param _src Pointer to the location to read from.\\n     * @param _offset Offset to start reading from.\\n     * @param _length Number of bytes to read.\\n     * @return Copied bytes.\\n     */\\n    function _copy(\\n        uint256 _src,\\n        uint256 _offset,\\n        uint256 _length\\n    )\\n        private\\n        pure\\n        returns (\\n            bytes memory\\n        )\\n    {\\n        bytes memory out = new bytes(_length);\\n        if (out.length == 0) {\\n            return out;\\n        }\\n\\n        uint256 src = _src + _offset;\\n        uint256 dest;\\n        assembly {\\n            dest := add(out, 32)\\n        }\\n\\n        // Copy over as many complete words as we can.\\n        for (uint256 i = 0; i < _length / 32; i++) {\\n            assembly {\\n                mstore(dest, mload(src))\\n            }\\n\\n            src += 32;\\n            dest += 32;\\n        }\\n\\n        // Pick out the remaining bytes.\\n        uint256 mask = 256 ** (32 - (_length % 32)) - 1;\\n        assembly {\\n            mstore(\\n                dest,\\n                or(\\n                    and(mload(src), not(mask)),\\n                    and(mload(dest), mask)\\n                )\\n            )\\n        }\\n\\n        return out;\\n    }\\n\\n    /**\\n     * Copies an RLP item into bytes.\\n     * @param _in RLP item to copy.\\n     * @return Copied bytes.\\n     */\\n    function _copy(\\n        RLPItem memory _in\\n    )\\n        private\\n        pure\\n        returns (\\n            bytes memory\\n        )\\n    {\\n        return _copy(_in.ptr, 0, _in.length);\\n    }\\n}\\n\",\"keccak256\":\"0x829174c61216dce35fdb888383b6022e0365eb7fbdc71ad79d98b108091969fe\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/rlp/Lib_RLPWriter.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\npragma experimental ABIEncoderV2;\\n\\n/**\\n * @title Lib_RLPWriter\\n * @author Bakaoh (with modifications)\\n */\\nlibrary Lib_RLPWriter {\\n\\n    /**********************\\n     * Internal Functions *\\n     **********************/\\n\\n    /**\\n     * RLP encodes a byte string.\\n     * @param _in The byte string to encode.\\n     * @return The RLP encoded string in bytes.\\n     */\\n    function writeBytes(\\n        bytes memory _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes memory\\n        )\\n    {\\n        bytes memory encoded;\\n\\n        if (_in.length == 1 && uint8(_in[0]) < 128) {\\n            encoded = _in;\\n        } else {\\n            encoded = abi.encodePacked(_writeLength(_in.length, 128), _in);\\n        }\\n\\n        return encoded;\\n    }\\n\\n    /**\\n     * RLP encodes a list of RLP encoded byte byte strings.\\n     * @param _in The list of RLP encoded byte strings.\\n     * @return The RLP encoded list of items in bytes.\\n     */\\n    function writeList(\\n        bytes[] memory _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes memory\\n        )\\n    {\\n        bytes memory list = _flatten(_in);\\n        return abi.encodePacked(_writeLength(list.length, 192), list);\\n    }\\n\\n    /**\\n     * RLP encodes a string.\\n     * @param _in The string to encode.\\n     * @return The RLP encoded string in bytes.\\n     */\\n    function writeString(\\n        string memory _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes memory\\n        )\\n    {\\n        return writeBytes(bytes(_in));\\n    }\\n\\n    /**\\n     * RLP encodes an address.\\n     * @param _in The address to encode.\\n     * @return The RLP encoded address in bytes.\\n     */\\n    function writeAddress(\\n        address _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes memory\\n        )\\n    {\\n        return writeBytes(abi.encodePacked(_in));\\n    }\\n\\n    /**\\n     * RLP encodes a bytes32 value.\\n     * @param _in The bytes32 to encode.\\n     * @return _out The RLP encoded bytes32 in bytes.\\n     */\\n    function writeBytes32(\\n        bytes32 _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes memory _out\\n        )\\n    {\\n        return writeBytes(abi.encodePacked(_in));\\n    }\\n\\n    /**\\n     * RLP encodes a uint.\\n     * @param _in The uint256 to encode.\\n     * @return The RLP encoded uint256 in bytes.\\n     */\\n    function writeUint(\\n        uint256 _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes memory\\n        )\\n    {\\n        return writeBytes(_toBinary(_in));\\n    }\\n\\n    /**\\n     * RLP encodes a bool.\\n     * @param _in The bool to encode.\\n     * @return The RLP encoded bool in bytes.\\n     */\\n    function writeBool(\\n        bool _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes memory\\n        )\\n    {\\n        bytes memory encoded = new bytes(1);\\n        encoded[0] = (_in ? bytes1(0x01) : bytes1(0x80));\\n        return encoded;\\n    }\\n\\n\\n    /*********************\\n     * Private Functions *\\n     *********************/\\n\\n    /**\\n     * Encode the first byte, followed by the `len` in binary form if `length` is more than 55.\\n     * @param _len The length of the string or the payload.\\n     * @param _offset 128 if item is string, 192 if item is list.\\n     * @return RLP encoded bytes.\\n     */\\n    function _writeLength(\\n        uint256 _len,\\n        uint256 _offset\\n    )\\n        private\\n        pure\\n        returns (\\n            bytes memory\\n        )\\n    {\\n        bytes memory encoded;\\n\\n        if (_len < 56) {\\n            encoded = new bytes(1);\\n            encoded[0] = byte(uint8(_len) + uint8(_offset));\\n        } else {\\n            uint256 lenLen;\\n            uint256 i = 1;\\n            while (_len / i != 0) {\\n                lenLen++;\\n                i *= 256;\\n            }\\n\\n            encoded = new bytes(lenLen + 1);\\n            encoded[0] = byte(uint8(lenLen) + uint8(_offset) + 55);\\n            for(i = 1; i <= lenLen; i++) {\\n                encoded[i] = byte(uint8((_len / (256**(lenLen-i))) % 256));\\n            }\\n        }\\n\\n        return encoded;\\n    }\\n\\n    /**\\n     * Encode integer in big endian binary form with no leading zeroes.\\n     * @notice TODO: This should be optimized with assembly to save gas costs.\\n     * @param _x The integer to encode.\\n     * @return RLP encoded bytes.\\n     */\\n    function _toBinary(\\n        uint256 _x\\n    )\\n        private\\n        pure\\n        returns (\\n            bytes memory\\n        )\\n    {\\n        bytes memory b = abi.encodePacked(_x);\\n\\n        uint256 i = 0;\\n        for (; i < 32; i++) {\\n            if (b[i] != 0) {\\n                break;\\n            }\\n        }\\n\\n        bytes memory res = new bytes(32 - i);\\n        for (uint256 j = 0; j < res.length; j++) {\\n            res[j] = b[i++];\\n        }\\n\\n        return res;\\n    }\\n\\n    /**\\n     * Copies a piece of memory to another location.\\n     * @notice From: https://github.com/Arachnid/solidity-stringutils/blob/master/src/strings.sol.\\n     * @param _dest Destination location.\\n     * @param _src Source location.\\n     * @param _len Length of memory to copy.\\n     */\\n    function _memcpy(\\n        uint256 _dest,\\n        uint256 _src,\\n        uint256 _len\\n    )\\n        private\\n        pure\\n    {\\n        uint256 dest = _dest;\\n        uint256 src = _src;\\n        uint256 len = _len;\\n\\n        for(; len >= 32; len -= 32) {\\n            assembly {\\n                mstore(dest, mload(src))\\n            }\\n            dest += 32;\\n            src += 32;\\n        }\\n\\n        uint256 mask = 256 ** (32 - len) - 1;\\n        assembly {\\n            let srcpart := and(mload(src), not(mask))\\n            let destpart := and(mload(dest), mask)\\n            mstore(dest, or(destpart, srcpart))\\n        }\\n    }\\n\\n    /**\\n     * Flattens a list of byte strings into one byte string.\\n     * @notice From: https://github.com/sammayo/solidity-rlp-encoder/blob/master/RLPEncode.sol.\\n     * @param _list List of byte strings to flatten.\\n     * @return The flattened byte string.\\n     */\\n    function _flatten(\\n        bytes[] memory _list\\n    )\\n        private\\n        pure\\n        returns (\\n            bytes memory\\n        )\\n    {\\n        if (_list.length == 0) {\\n            return new bytes(0);\\n        }\\n\\n        uint256 len;\\n        uint256 i = 0;\\n        for (; i < _list.length; i++) {\\n            len += _list[i].length;\\n        }\\n\\n        bytes memory flattened = new bytes(len);\\n        uint256 flattenedPtr;\\n        assembly { flattenedPtr := add(flattened, 0x20) }\\n\\n        for(i = 0; i < _list.length; i++) {\\n            bytes memory item = _list[i];\\n\\n            uint256 listPtr;\\n            assembly { listPtr := add(item, 0x20)}\\n\\n            _memcpy(flattenedPtr, listPtr, item.length);\\n            flattenedPtr += _list[i].length;\\n        }\\n\\n        return flattened;\\n    }\\n}\\n\",\"keccak256\":\"0xb60ee4b03ad372c3deff21d454ab714dd0c18ee3e6f9d45532e209fc59d5a54d\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/utils/Lib_Bytes32Utils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/**\\n * @title Lib_Byte32Utils\\n */\\nlibrary Lib_Bytes32Utils {\\n\\n    /**********************\\n     * Internal Functions *\\n     **********************/\\n\\n    /**\\n     * Converts a bytes32 value to a boolean. Anything non-zero will be converted to \\\"true.\\\"\\n     * @param _in Input bytes32 value.\\n     * @return Bytes32 as a boolean.\\n     */\\n    function toBool(\\n        bytes32 _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            bool\\n        )\\n    {\\n        return _in != 0;\\n    }\\n\\n    /**\\n     * Converts a boolean to a bytes32 value.\\n     * @param _in Input boolean value.\\n     * @return Boolean as a bytes32.\\n     */\\n    function fromBool(\\n        bool _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes32\\n        )\\n    {\\n        return bytes32(uint256(_in ? 1 : 0));\\n    }\\n\\n    /**\\n     * Converts a bytes32 value to an address. Takes the *last* 20 bytes.\\n     * @param _in Input bytes32 value.\\n     * @return Bytes32 as an address.\\n     */\\n    function toAddress(\\n        bytes32 _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            address\\n        )\\n    {\\n        return address(uint160(uint256(_in)));\\n    }\\n\\n    /**\\n     * Converts an address to a bytes32.\\n     * @param _in Input address value.\\n     * @return Address as a bytes32.\\n     */\\n    function fromAddress(\\n        address _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes32\\n        )\\n    {\\n        return bytes32(uint256(_in));\\n    }\\n\\n    /**\\n     * Removes the leading zeros from a bytes32 value and returns a new (smaller) bytes value.\\n     * @param _in Input bytes32 value.\\n     * @return Bytes32 without any leading zeros.\\n     */\\n    function removeLeadingZeros(\\n        bytes32 _in\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes memory\\n        )\\n    {\\n        bytes memory out;\\n\\n        assembly {\\n            // Figure out how many leading zero bytes to remove.\\n            let shift := 0\\n            for { let i := 0 } and(lt(i, 32), eq(byte(i, _in), 0)) { i := add(i, 1) } {\\n                shift := add(shift, 1)\\n            }\\n\\n            // Reserve some space for our output and fix the free memory pointer.\\n            out := mload(0x40)\\n            mstore(0x40, add(out, 0x40))\\n\\n            // Shift the value and store it into the output bytes.\\n            mstore(add(out, 0x20), shl(mul(shift, 8), _in))\\n\\n            // Store the new size (with leading zero bytes removed) in the output byte size.\\n            mstore(out, sub(32, shift))\\n        }\\n\\n        return out;\\n    }\\n}\\n\",\"keccak256\":\"0xfa2def593e3fc56a31852c3744aefdaa93cec74e721bfcfeb1e5d166c7c60b64\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/utils/Lib_BytesUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/**\\n * @title Lib_BytesUtils\\n */\\nlibrary Lib_BytesUtils {\\n\\n    /**********************\\n     * Internal Functions *\\n     **********************/\\n\\n    function slice(\\n        bytes memory _bytes,\\n        uint256 _start,\\n        uint256 _length\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes memory\\n        )\\n    {\\n        require(_length + 31 >= _length, \\\"slice_overflow\\\");\\n        require(_start + _length >= _start, \\\"slice_overflow\\\");\\n        require(_bytes.length >= _start + _length, \\\"slice_outOfBounds\\\");\\n\\n        bytes memory tempBytes;\\n\\n        assembly {\\n            switch iszero(_length)\\n            case 0 {\\n                // Get a location of some free memory and store it in tempBytes as\\n                // Solidity does for memory variables.\\n                tempBytes := mload(0x40)\\n\\n                // The first word of the slice result is potentially a partial\\n                // word read from the original array. To read it, we calculate\\n                // the length of that partial word and start copying that many\\n                // bytes into the array. The first word we copy will start with\\n                // data we don't care about, but the last `lengthmod` bytes will\\n                // land at the beginning of the contents of the new array. When\\n                // we're done copying, we overwrite the full first word with\\n                // the actual length of the slice.\\n                let lengthmod := and(_length, 31)\\n\\n                // The multiplication in the next line is necessary\\n                // because when slicing multiples of 32 bytes (lengthmod == 0)\\n                // the following copy loop was copying the origin's length\\n                // and then ending prematurely not copying everything it should.\\n                let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod)))\\n                let end := add(mc, _length)\\n\\n                for {\\n                    // The multiplication in the next line has the same exact purpose\\n                    // as the one above.\\n                    let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start)\\n                } lt(mc, end) {\\n                    mc := add(mc, 0x20)\\n                    cc := add(cc, 0x20)\\n                } {\\n                    mstore(mc, mload(cc))\\n                }\\n\\n                mstore(tempBytes, _length)\\n\\n                //update free-memory pointer\\n                //allocating the array padded to 32 bytes like the compiler does now\\n                mstore(0x40, and(add(mc, 31), not(31)))\\n            }\\n            //if we want a zero-length slice let's just return a zero-length array\\n            default {\\n                tempBytes := mload(0x40)\\n\\n                //zero out the 32 bytes slice we are about to return\\n                //we need to do it because Solidity does not garbage collect\\n                mstore(tempBytes, 0)\\n\\n                mstore(0x40, add(tempBytes, 0x20))\\n            }\\n        }\\n\\n        return tempBytes;\\n    }\\n\\n    function slice(\\n        bytes memory _bytes,\\n        uint256 _start\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes memory\\n        )\\n    {\\n        if (_start >= _bytes.length) {\\n            return bytes('');\\n        }\\n\\n        return slice(_bytes, _start, _bytes.length - _start);\\n    }\\n\\n    function toBytes32PadLeft(\\n        bytes memory _bytes\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes32\\n        )\\n    {\\n        bytes32 ret;\\n        uint256 len = _bytes.length <= 32 ? _bytes.length : 32;\\n        assembly {\\n            ret := shr(mul(sub(32, len), 8), mload(add(_bytes, 32)))\\n        }\\n        return ret;\\n    }\\n\\n    function toBytes32(\\n        bytes memory _bytes\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes32\\n        )\\n    {\\n        if (_bytes.length < 32) {\\n            bytes32 ret;\\n            assembly {\\n                ret := mload(add(_bytes, 32))\\n            }\\n            return ret;\\n        }\\n\\n        return abi.decode(_bytes,(bytes32)); // will truncate if input length > 32 bytes\\n    }\\n\\n    function toUint256(\\n        bytes memory _bytes\\n    )\\n        internal\\n        pure\\n        returns (\\n            uint256\\n        )\\n    {\\n        return uint256(toBytes32(_bytes));\\n    }\\n\\n    function toUint24(\\n        bytes memory _bytes,\\n        uint256 _start\\n    )\\n        internal\\n        pure\\n        returns (\\n            uint24\\n        )\\n    {\\n        require(_start + 3 >= _start, \\\"toUint24_overflow\\\");\\n        require(_bytes.length >= _start + 3 , \\\"toUint24_outOfBounds\\\");\\n        uint24 tempUint;\\n\\n        assembly {\\n            tempUint := mload(add(add(_bytes, 0x3), _start))\\n        }\\n\\n        return tempUint;\\n    }\\n\\n    function toUint8(\\n        bytes memory _bytes,\\n        uint256 _start\\n    )\\n        internal\\n        pure\\n        returns (\\n            uint8\\n        )\\n    {\\n        require(_start + 1 >= _start, \\\"toUint8_overflow\\\");\\n        require(_bytes.length >= _start + 1 , \\\"toUint8_outOfBounds\\\");\\n        uint8 tempUint;\\n\\n        assembly {\\n            tempUint := mload(add(add(_bytes, 0x1), _start))\\n        }\\n\\n        return tempUint;\\n    }\\n\\n    function toAddress(\\n        bytes memory _bytes,\\n        uint256 _start\\n    )\\n        internal\\n        pure\\n        returns (\\n            address\\n        )\\n    {\\n        require(_start + 20 >= _start, \\\"toAddress_overflow\\\");\\n        require(_bytes.length >= _start + 20, \\\"toAddress_outOfBounds\\\");\\n        address tempAddress;\\n\\n        assembly {\\n            tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000)\\n        }\\n\\n        return tempAddress;\\n    }\\n\\n    function toNibbles(\\n        bytes memory _bytes\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes memory\\n        )\\n    {\\n        bytes memory nibbles = new bytes(_bytes.length * 2);\\n\\n        for (uint256 i = 0; i < _bytes.length; i++) {\\n            nibbles[i * 2] = _bytes[i] >> 4;\\n            nibbles[i * 2 + 1] = bytes1(uint8(_bytes[i]) % 16);\\n        }\\n\\n        return nibbles;\\n    }\\n\\n    function fromNibbles(\\n        bytes memory _bytes\\n    )\\n        internal\\n        pure\\n        returns (\\n            bytes memory\\n        )\\n    {\\n        bytes memory ret = new bytes(_bytes.length / 2);\\n\\n        for (uint256 i = 0; i < ret.length; i++) {\\n            ret[i] = (_bytes[i * 2] << 4) | (_bytes[i * 2 + 1]);\\n        }\\n\\n        return ret;\\n    }\\n\\n    function equal(\\n        bytes memory _bytes,\\n        bytes memory _other\\n    )\\n        internal\\n        pure\\n        returns (\\n            bool\\n        )\\n    {\\n        return keccak256(_bytes) == keccak256(_other);\\n    }\\n}\\n\",\"keccak256\":\"0xd27e37973f1e0f64798725b7a0de12989dac992fba0d72970249d7e1f70e17c5\",\"license\":\"MIT\"}},\"version\":1}",
  "bytecode": "[encoded data, 10416 characters]",
  "deployedBytecode": "[encoded data, 10352 characters]",
  "devdoc": {
    "details": "The State Manager Factory is called by a State Transitioner's init code, to create a new State Manager for use in the Fraud Verification process. Compiler used: solc Runtime target: EVM",
    "kind": "dev",
    "methods": {
      "create(address)": {
        "params": {
          "_owner": "Owner of the created contract."
        },
        "returns": {
          "_0": "New OVM_StateManager instance."
        }
      }
    },
    "title": "OVM_StateManagerFactory",
    "version": 1
  },
  "userdoc": {
    "kind": "user",
    "methods": {
      "create(address)": {
        "notice": "Creates a new OVM_StateManager"
      }
    },
    "version": 1
  },
  "storageLayout": {
    "storage": [],
    "types": null
  }
}