Commit b799caab authored by Karl Floersch's avatar Karl Floersch Committed by GitHub

feat: v0.3.0 release candidate (#603)

* feat: Attempt to decode txs as RLP first (#563)
Co-authored-by: default avatarsmartcontracts <smartcontracts@doge.org>

* l2geth: remove eth_sendRawEthSignTransaction endpoint (#589)

* feat[contracts]: Use standard RLP transaction format (#566)

* feat[contracts]: Use standard RLP transaction format

* fix[l2geth]: Encode transaction as RLP

* fix: Correct gas estimation in integration tests

* fix: Correct gas estimation in integration tests

* Update packages/contracts/contracts/optimistic-ethereum/OVM/predeploys/OVM_SequencerEntrypoint.sol
Co-authored-by: default avatarben-chain <ben@pseudonym.party>

* fix[contracts]: Use isCreate instead of checking target address

* fix[contracts]: Minor optimization in SequencerEntrypoint

* fix[contracts]: Pass max gas to contract call in EOA contract
Co-authored-by: default avatarben-chain <ben@pseudonym.party>

* feat[contracts]: Make ProxyEOA compatible with eip1967 (#592)

* feat[contracts]: Make ProxyEOA compatible with eip1967

* fix[contracts]: Fix bug introduced by indirect constant

* chore[contracts]: Add changeset

* Update .changeset/old-cycles-invite.md
Co-authored-by: default avatarGeorgios Konstantopoulos <me@gakonst.com>

* l2geth: remove ovmsigner (#591)

* l2geth: remove ovmsigner

Also reduce the diff

Co-authored-by: smartcontracts

* l2geth: add changeset

* l2geth: set rlp encoded tx in txmeta in RPC layer (#644)

* l2geth: set rlp encoded tx in txmeta in RPC layer

* l2geth: remove extra setter of txmeta

* chore: add changeset

* feat: Have ExecutionManager pass data upwards (#643)

* feat[contracts]: Make ExecutionManager return data

* fix[l2geth]: fix linting error

* fix[contracts]: Fix build error

* fix[contracts]: fix failing unit tests

* Add changeset
Co-authored-by: default avatarKarl Floersch <karl@karlfloersch.com>

* rpc: only allow txs with no calldata when there is value (#645)

* l2geth: api checks for 0 value

* chore: add changeset

* l2geth: remove check for specific gasprice

* feat[contracts]: Add value transfer support to ECDSAContractAccount (#619)

* feat[contracts]: Use standard RLP transaction format (#566)

* feat[contracts]: Use standard RLP transaction format

* fix[l2geth]: Encode transaction as RLP

* fix: Correct gas estimation in integration tests

* fix: Correct gas estimation in integration tests

* Update packages/contracts/contracts/optimistic-ethereum/OVM/predeploys/OVM_SequencerEntrypoint.sol
Co-authored-by: default avatarben-chain <ben@pseudonym.party>

* fix[contracts]: Use isCreate instead of checking target address

* fix[contracts]: Minor optimization in SequencerEntrypoint

* fix[contracts]: Pass max gas to contract call in EOA contract
Co-authored-by: default avatarben-chain <ben@pseudonym.party>

* feat[contracts]: Add value transfer to contract account

* fix[contracts]: Tweak transfer logic and add tests

* fix[geth]: Remove logic that rejects value gt 0 txs

* fix: nonce issue in rpc tests

* fix: use correct wallet in rpc value tests

* Update rpc.spec.ts

* cleanup: remove double definition

* chore: add changeset

* chore: add changeset

* tests: delete dead test

* l2geth: log the tx value

* l2geth: pass through zero value at top level

* test: receipt passes

* test: more specifically set balance
Co-authored-by: default avatarben-chain <ben@pseudonym.party>
Co-authored-by: default avatarMark Tyneway <mark.tyneway@gmail.com>

* dtl: remove legacy encoding (#618)

* dtl: remove legacy decoding

* tests: remove dead test

* chore: add changeset

* Add Goerli v3 deployment (#651)

* Add Goerli v3 deployment

* Add Goerli v3 to README

* dtlL fix syncing off by one (#687)

* dtl: syncing off by one error

* chore: add changeset

* dtl: index the value field (#686)

* chore: add changeset

* chore: add changeset

* dtl: pass through value field

* core-utils: update and test toRpcString

* lint: fix

* l2geth: parse value fields

* chore: add changeset

* rpc: gas fixes (#695)

* l2geth: prevent fees lower than 21000

* l2geth: remove old check for too high tx gaslimit

* tests: update to use new min gas estimated value

* chore: add changeset

* test: update expected values

* test: remove dead test

* examples: fix waffle example + gas changes in tests (#724)

* examples: fix waffle example

* tests: update gas price in assertion

* chore: add changeset

* l2geth: estimate gas assertion in decimal

* test: use configurable key

* ops: delete extra whitespace (#731)

* fix: prevent eth sendtransaction (#725)

* api: prevent unsafe calls

* api: fill in txmeta

* chore: add changeset

* chore: add changeset

* l2geth + contracts:  standard interface for systems contracts and userland contracts (#721)

* l2geth: fix call returndata parsing

* contracts: standardize simulateMessage and run to return bytes

* chore: add changeset

* chore: add changeset

* l2geth: more simple decoding

* contracts: remove named arguments

* chore: fix linter errors

* Add contract deployment to Kovan (#715)

* fix: remove type check in rollup client (#750)

* l2geth: remove tx type check in client

* chore: add changeset

* dtl: prevent null reference in L1 handler (#757)

* dtl: prevent reference of null value

* chore: add changeset

* test: eth_call exceptions (#800)

* feat[l2geth]: Pass up contract revert reasons during DoEstimateGas (#774)

* wip: Starting work on geth revert reasons during estimate gas

fix: error in comment

fix: I got things backwards

fix: Use UnpackValues instead of Unpack

Update l2geth/accounts/abi/abi.go
Co-authored-by: default avatarGeorgios Konstantopoulos <me@gakonst.com>

* Add integration test for reverts

fix: build error

* chore: Add changeset
Co-authored-by: default avatarGeorgios Konstantopoulos <me@gakonst.com>

* chore: add changeset (#831)

* Migrate ETH between gateways (#778)

* add migrate ETH functionality

* contracts: add eth gateway docstring (#832)
Co-authored-by: default avatarMark Tyneway <mark.tyneway@gmail.com>
Co-authored-by: default avatarsmartcontracts <smartcontracts@doge.org>
Co-authored-by: default avatarMark Tyneway <mark.tyneway@gmail.com>
Co-authored-by: default avatarsmartcontracts <kelvinfichter@gmail.com>
Co-authored-by: default avatarben-chain <ben@pseudonym.party>
Co-authored-by: default avatarGeorgios Konstantopoulos <me@gakonst.com>
Co-authored-by: default avatarMaurelian <maurelian@protonmail.ch>
Co-authored-by: default avatarKevin Ho <kevinjho1996@gmail.com>
parent 20747fd5
---
"@eth-optimism/data-transport-layer": patch
---
Parse and index the value field in the data transport layer
---
"@eth-optimism/data-transport-layer": patch
---
Account for the off by one with regards to the l2geth block number and the CTC index
---
"@eth-optimism/l2geth": patch
---
Add value parsing to the rollup client
---
"@eth-optimism/l2geth": patch
---
Removes the extra setting of the txmeta in the syncservice and instead sets the raw tx in the txmeta at the rpc layer
---
'@eth-optimism/l2geth': patch
---
Fill in the raw transaction into the txmeta in the `eth_sendTransaction` codepath
---
'@eth-optimism/integration-tests': patch
'@eth-optimism/l2geth': patch
---
Add support for parsed revert reasons in DoEstimateGas
---
"@eth-optimism/integration-tests": patch
"@eth-optimism/l2geth": patch
---
Update minimum response from estimate gas
---
"@eth-optimism/integration-tests": patch
"@eth-optimism/l2geth": patch
"@eth-optimism/contracts": patch
---
Add value transfer support to ECDSAContractAccount
---
'@eth-optimism/l2geth': patch
---
Ignore the deprecated type field in the API
---
"@eth-optimism/l2geth": patch
---
Return bytes from both ExecutionManager.run and ExecutionManager.simulateMessage and be sure to properly ABI decode the return values and the nested (bool, returndata)
---
"@eth-optimism/data-transport-layer": patch
---
Remove legacy transaction deserialization to support RLP batch encoding
---
'@eth-optimism/l2geth': patch
---
Block access to RPCs related to signing transactions
---
'@eth-optimism/integration-tests': patch
---
Update expected gas prices based on minimum of 21k value
---
"@eth-optimism/l2geth": patch
"@eth-optimism/contracts": patch
---
Add ExecutionManager return data & RLP encoding
---
"@eth-optimism/contracts": patch
---
Makes ProxyEOA compatible with EIP1967, not backwards compatible since the storage slot changes.
---
"@eth-optimism/l2geth": patch
---
Update gas related things in the RPC to allow transactions with high gas limits and prevent gas estimations from being too small
---
'@eth-optimism/l2geth': minor
'@eth-optimism/contracts': minor
'@eth-optimism/data-transport-layer': minor
'@eth-optimism/batch-submitter': minor
'@eth-optimism/hardhat-ovm': minor
'@eth-optimism/message-relayer': minor
---
Updates to use RLP encoded transactions in batches for the `v0.3.0` release
---
"@eth-optimism/l2geth": patch
---
Remove the OVMSigner
---
"@eth-optimism/l2geth": patch
---
Prevent 0 value transactions with calldata via RPC
---
"@eth-optimism/core-utils": patch
---
Update toRpcHexString to accept ethers.BigNumber and add tests
---
'@eth-optimism/data-transport-layer': patch
---
Prevent access of null value in L1 transaction deserialization
---
"@eth-optimism/contracts": patch
---
Update ABI of simulateMessage to match run
...@@ -9,30 +9,26 @@ const { getArtifact } = require('./getArtifact') ...@@ -9,30 +9,26 @@ const { getArtifact } = require('./getArtifact')
use(solidity) use(solidity)
const config = {
l2Url: process.env.L2_URL || 'http://127.0.0.1:8545',
l1Url: process.env.L1_URL || 'http://127.0.0.1:9545',
useL2: process.env.TARGET === 'OVM',
privateKey: process.env.PRIVATE_KEY || '0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80'
}
describe('ERC20 smart contract', () => { describe('ERC20 smart contract', () => {
let ERC20, let ERC20,
provider, provider
wallet,
walletTo, if (config.useL2) {
walletEmpty, provider = new ethers.providers.JsonRpcProvider(config.l2Url)
walletAddress,
walletToAddress,
walletEmptyAddress
const privateKey = ethers.Wallet.createRandom().privateKey
const privateKeyEmpty = ethers.Wallet.createRandom().privateKey
const useL2 = process.env.TARGET === 'OVM'
if (useL2 == true) {
provider = new ethers.providers.JsonRpcProvider('http://127.0.0.1:8545')
provider.pollingInterval = 100 provider.pollingInterval = 100
provider.getGasPrice = async () => ethers.BigNumber.from(0) provider.getGasPrice = async () => ethers.BigNumber.from(0)
} else { } else {
provider = new ethers.providers.JsonRpcProvider('http://127.0.0.1:9545') provider = new ethers.providers.JsonRpcProvider(config.l1Url)
} }
walletTo = new ethers.Wallet(privateKey, provider) const wallet = new ethers.Wallet(config.privateKey).connect(provider)
walletEmpty = new ethers.Wallet(privateKeyEmpty, provider)
// parameters to use for our test coin // parameters to use for our test coin
const COIN_NAME = 'OVM Test Coin' const COIN_NAME = 'OVM Test Coin'
...@@ -41,12 +37,7 @@ describe('ERC20 smart contract', () => { ...@@ -41,12 +37,7 @@ describe('ERC20 smart contract', () => {
describe('when using a deployed contract instance', () => { describe('when using a deployed contract instance', () => {
before(async () => { before(async () => {
wallet = await provider.getSigner(0) const Artifact__ERC20 = getArtifact(config.useL2)
walletAddress = await wallet.getAddress()
walletToAddress = await walletTo.getAddress()
walletEmptyAddress = await walletEmpty.getAddress()
const Artifact__ERC20 = getArtifact(useL2)
const Factory__ERC20 = new ethers.ContractFactory( const Factory__ERC20 = new ethers.ContractFactory(
Artifact__ERC20.abi, Artifact__ERC20.abi,
Artifact__ERC20.bytecode, Artifact__ERC20.bytecode,
...@@ -64,7 +55,8 @@ describe('ERC20 smart contract', () => { ...@@ -64,7 +55,8 @@ describe('ERC20 smart contract', () => {
}) })
it('should assigns initial balance', async () => { it('should assigns initial balance', async () => {
expect(await ERC20.balanceOf(walletAddress)).to.equal(1000) const address = await wallet.getAddress()
expect(await ERC20.balanceOf(address)).to.equal(1000)
}) })
it('should correctly set vanity information', async () => { it('should correctly set vanity information', async () => {
...@@ -79,29 +71,35 @@ describe('ERC20 smart contract', () => { ...@@ -79,29 +71,35 @@ describe('ERC20 smart contract', () => {
}) })
it('should transfer amount to destination account', async () => { it('should transfer amount to destination account', async () => {
const tx = await ERC20.connect(wallet).transfer(walletToAddress, 7) const freshWallet = ethers.Wallet.createRandom()
const destination = await freshWallet.getAddress()
const tx = await ERC20.connect(wallet).transfer(destination, 7)
await tx.wait() await tx.wait()
const walletToBalance = await ERC20.balanceOf(walletToAddress) const walletToBalance = await ERC20.balanceOf(destination)
expect(walletToBalance.toString()).to.equal('7') expect(walletToBalance.toString()).to.equal('7')
}) })
it('should emit Transfer event', async () => { it('should emit Transfer event', async () => {
const tx = ERC20.connect(wallet).transfer(walletToAddress, 7) const address = await wallet.getAddress()
const tx = ERC20.connect(wallet).transfer(address, 7)
await expect(tx) await expect(tx)
.to.emit(ERC20, 'Transfer') .to.emit(ERC20, 'Transfer')
.withArgs(walletAddress, walletToAddress, 7) .withArgs(address, address, 7)
}) })
it('should not transfer above the amount', async () => { it('should not transfer above the amount', async () => {
const walletToBalanceBefore = await ERC20.balanceOf(walletToAddress) const address = await wallet.getAddress()
await expect(ERC20.transfer(walletToAddress, 1007)).to.be.reverted const walletToBalanceBefore = await ERC20.balanceOf(address)
const walletToBalanceAfter = await ERC20.balanceOf(walletToAddress) await expect(ERC20.transfer(address, 1007)).to.be.reverted
const walletToBalanceAfter = await ERC20.balanceOf(address)
expect(walletToBalanceBefore).to.eq(walletToBalanceAfter) expect(walletToBalanceBefore).to.eq(walletToBalanceAfter)
}) })
it('should not transfer from empty account', async () => { it('should not transfer from empty account', async () => {
const ERC20FromOtherWallet = ERC20.connect(walletEmpty) const emptyWallet = ethers.Wallet.createRandom()
await expect(ERC20FromOtherWallet.transfer(walletEmptyAddress, 1)).to.be const address = await emptyWallet.getAddress()
const ERC20FromOtherWallet = ERC20.connect(emptyWallet)
await expect(ERC20FromOtherWallet.transfer(address, 1)).to.be
.reverted .reverted
}) })
}) })
......
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0;
import { Reverter } from './Reverter.sol';
contract ConstructorReverter is Reverter {
constructor() {
doRevert();
}
}
...@@ -33,7 +33,7 @@ contract ERC20 { ...@@ -33,7 +33,7 @@ contract ERC20 {
} }
function transfer(address _to, uint256 _value) public returns (bool success) { function transfer(address _to, uint256 _value) public returns (bool success) {
require(balances[msg.sender] >= _value); require(balances[msg.sender] >= _value, "insufficient balance");
balances[msg.sender] -= _value; balances[msg.sender] -= _value;
balances[_to] += _value; balances[_to] += _value;
emit Transfer(msg.sender, _to, _value); emit Transfer(msg.sender, _to, _value);
......
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0;
contract Reverter {
string constant public revertMessage = "This is a simple reversion.";
function doRevert() public pure {
revert(revertMessage);
}
}
...@@ -2,6 +2,7 @@ import { HardhatUserConfig } from 'hardhat/types' ...@@ -2,6 +2,7 @@ import { HardhatUserConfig } from 'hardhat/types'
// Hardhat plugins // Hardhat plugins
import '@nomiclabs/hardhat-ethers' import '@nomiclabs/hardhat-ethers'
import '@nomiclabs/hardhat-waffle'
import '@eth-optimism/hardhat-ovm' import '@eth-optimism/hardhat-ovm'
import 'hardhat-gas-reporter' import 'hardhat-gas-reporter'
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
"@eth-optimism/hardhat-ovm": "^0.1.1", "@eth-optimism/hardhat-ovm": "^0.1.1",
"@ethersproject/providers": "^5.0.24", "@ethersproject/providers": "^5.0.24",
"@nomiclabs/hardhat-ethers": "^2.0.2", "@nomiclabs/hardhat-ethers": "^2.0.2",
"@nomiclabs/hardhat-waffle": "^2.0.1",
"@types/chai-as-promised": "^7.1.3", "@types/chai-as-promised": "^7.1.3",
"@types/chai": "^4.2.17", "@types/chai": "^4.2.17",
"@types/mocha": "^8.2.2", "@types/mocha": "^8.2.2",
......
import { Contract, ContractFactory, Wallet } from 'ethers' import { Contract, ContractFactory, Wallet } from 'ethers'
import { ethers } from 'hardhat' import { ethers } from 'hardhat'
import { expect } from 'chai' import chai, { expect } from 'chai'
import { GWEI } from './shared/utils' import { GWEI } from './shared/utils'
import { OptimismEnv } from './shared/env' import { OptimismEnv } from './shared/env'
import { solidity } from 'ethereum-waffle'
chai.use(solidity)
describe('Basic ERC20 interactions', async () => { describe('Basic ERC20 interactions', async () => {
const initialAmount = 1000 const initialAmount = 1000
...@@ -79,4 +82,10 @@ describe('Basic ERC20 interactions', async () => { ...@@ -79,4 +82,10 @@ describe('Basic ERC20 interactions', async () => {
expect(receiverBalance.toNumber()).to.equal(100) expect(receiverBalance.toNumber()).to.equal(100)
expect(senderBalance.toNumber()).to.equal(900) expect(senderBalance.toNumber()).to.equal(900)
}) })
it('should revert if trying to transfer too much', async () => {
await expect(
ERC20.transfer(other.address, initialAmount * 2)
).to.be.revertedWith('insufficient balance')
})
}) })
...@@ -25,13 +25,4 @@ describe('Fee Payment Integration Tests', async () => { ...@@ -25,13 +25,4 @@ describe('Fee Payment Integration Tests', async () => {
tx.gasPrice.mul(tx.gasLimit).add(amount) tx.gasPrice.mul(tx.gasLimit).add(amount)
) )
}) })
it('sequencer rejects transaction with a non-multiple-of-1M gasPrice', async () => {
const gasPrice = BigNumber.from(1_000_000 - 1)
await expect(
env.ovmEth.transfer(other, 0, { gasPrice })
).to.be.eventually.rejectedWith(
'Gas price must be a multiple of 1,000,000 wei'
)
})
}) })
...@@ -45,13 +45,13 @@ describe('Native ETH Integration Tests', async () => { ...@@ -45,13 +45,13 @@ describe('Native ETH Integration Tests', async () => {
const amount = utils.parseEther('0.5') const amount = utils.parseEther('0.5')
const addr = '0x' + '1234'.repeat(10) const addr = '0x' + '1234'.repeat(10)
const gas = await env.ovmEth.estimateGas.transfer(addr, amount) const gas = await env.ovmEth.estimateGas.transfer(addr, amount)
expect(gas).to.be.deep.eq(BigNumber.from(17344)) expect(gas).to.be.deep.eq(BigNumber.from(21000))
}) })
it('Should estimate gas for ETH withdraw', async () => { it('Should estimate gas for ETH withdraw', async () => {
const amount = utils.parseEther('0.5') const amount = utils.parseEther('0.5')
const gas = await env.ovmEth.estimateGas.withdraw(amount) const gas = await env.ovmEth.estimateGas.withdraw(amount)
expect(gas).to.be.deep.eq(BigNumber.from(14400)) expect(gas).to.be.deep.eq(BigNumber.from(21000))
}) })
}) })
......
import { injectL2Context } from '@eth-optimism/core-utils' import { injectL2Context } from '@eth-optimism/core-utils'
import { Wallet, BigNumber } from 'ethers' import { Wallet, BigNumber, Contract } from 'ethers'
import { ethers } from 'hardhat'
import chai, { expect } from 'chai' import chai, { expect } from 'chai'
import { sleep, l2Provider, GWEI } from './shared/utils' import {
sleep,
l2Provider,
GWEI,
encodeSolidityRevertMessage,
} from './shared/utils'
import chaiAsPromised from 'chai-as-promised' import chaiAsPromised from 'chai-as-promised'
import { OptimismEnv } from './shared/env' import { OptimismEnv } from './shared/env'
import {
TransactionReceipt,
TransactionRequest,
} from '@ethersproject/providers'
import { solidity } from 'ethereum-waffle'
chai.use(chaiAsPromised) chai.use(chaiAsPromised)
chai.use(solidity)
describe('Basic RPC tests', () => { describe('Basic RPC tests', () => {
let env: OptimismEnv let env: OptimismEnv
let wallet: Wallet
const DEFAULT_TRANSACTION = { const DEFAULT_TRANSACTION = {
to: '0x' + '1234'.repeat(10), to: '0x' + '1234'.repeat(10),
...@@ -18,10 +31,33 @@ describe('Basic RPC tests', () => { ...@@ -18,10 +31,33 @@ describe('Basic RPC tests', () => {
} }
const provider = injectL2Context(l2Provider) const provider = injectL2Context(l2Provider)
const wallet = Wallet.createRandom().connect(provider)
let Reverter: Contract
let revertMessage: string
let revertingTx: TransactionRequest
let revertingDeployTx: TransactionRequest
before(async () => { before(async () => {
env = await OptimismEnv.new() env = await OptimismEnv.new()
wallet = env.l2Wallet
const Factory__Reverter = await ethers.getContractFactory(
'Reverter',
wallet
)
Reverter = await Factory__Reverter.connect(env.l2Wallet).deploy()
await Reverter.deployTransaction.wait()
revertMessage = await Reverter.revertMessage()
revertingTx = {
to: Reverter.address,
data: Reverter.interface.encodeFunctionData('doRevert'),
}
const Factory__ConstructorReverter = await ethers.getContractFactory(
'ConstructorReverter',
wallet
)
revertingDeployTx = {
data: Factory__ConstructorReverter.bytecode,
}
}) })
describe('eth_sendRawTransaction', () => { describe('eth_sendRawTransaction', () => {
...@@ -59,20 +95,124 @@ describe('Basic RPC tests', () => { ...@@ -59,20 +95,124 @@ describe('Basic RPC tests', () => {
).to.be.rejectedWith('Cannot submit unprotected transaction') ).to.be.rejectedWith('Cannot submit unprotected transaction')
}) })
it('should not accept a transaction with a value', async () => { it('should accept a transaction with a value', async () => {
const tx = { const tx = {
...DEFAULT_TRANSACTION, ...DEFAULT_TRANSACTION,
chainId: await wallet.getChainId(), chainId: await env.l2Wallet.getChainId(),
value: 100, data: '0x',
value: ethers.utils.parseEther('5'),
} }
await expect(
provider.sendTransaction(await wallet.signTransaction(tx)) const balanceBefore = await provider.getBalance(env.l2Wallet.address)
).to.be.rejectedWith( const result = await env.l2Wallet.sendTransaction(tx)
'Cannot send transaction with non-zero value. Use WETH.transfer()' const receipt = await result.wait()
expect(receipt.status).to.deep.equal(1)
expect(await provider.getBalance(env.l2Wallet.address)).to.deep.equal(
balanceBefore.sub(ethers.utils.parseEther('5'))
)
})
it('should reject a transaction with higher value than user balance', async () => {
const balance = await env.l2Wallet.getBalance()
const tx = {
...DEFAULT_TRANSACTION,
chainId: await env.l2Wallet.getChainId(),
data: '0x',
value: balance.add(ethers.utils.parseEther('1')),
}
await expect(env.l2Wallet.sendTransaction(tx)).to.be.rejectedWith(
'invalid transaction: insufficient funds for gas * price + value'
) )
}) })
}) })
describe('eth_call', () => {
let expectedReverterRevertData: string
before(async () => {
expectedReverterRevertData = encodeSolidityRevertMessage(revertMessage)
})
it('should correctly return solidity revert data from a call', async () => {
const revertData = await provider.call(revertingTx)
const expectedRevertData = encodeSolidityRevertMessage(revertMessage)
expect(revertData).to.eq(expectedRevertData)
})
it('should produce error when called from ethers', async () => {
await expect(Reverter.doRevert()).to.be.revertedWith(revertMessage)
})
it('should correctly return revert data from contract creation', async () => {
const revertData = await provider.call(revertingDeployTx)
expect(revertData).to.eq(expectedReverterRevertData)
})
it('should return the correct error message when attempting to deploy unsafe initcode', async () => {
// PUSH1 0x00 PUSH1 0x00 SSTORE
const unsafeCode = '0x6000600055'
const tx: TransactionRequest = {
data: unsafeCode,
}
const result = await provider.call(tx)
const expected = encodeSolidityRevertMessage(
'Contract creation code contains unsafe opcodes. Did you use the right compiler or pass an unsafe constructor argument?'
)
expect(result).to.eq(expected)
})
})
describe('eth_getTransactionReceipt', () => {
it('correctly exposes revert data for contract calls', async () => {
const req: TransactionRequest = {
...revertingTx,
gasLimit: 8_999_999, // override gas estimation
}
const tx = await wallet.sendTransaction(req)
let errored = false
try {
await tx.wait()
} catch (e) {
errored = true
}
expect(errored).to.be.true
const receipt: TransactionReceipt = await provider.getTransactionReceipt(
tx.hash
)
expect(receipt.status).to.eq(0)
})
it('correctly exposes revert data for contract creations', async () => {
const req: TransactionRequest = {
...revertingDeployTx,
gasLimit: 8_999_999, // override gas estimation
}
const tx = await wallet.sendTransaction(req)
let errored = false
try {
await tx.wait()
} catch (e) {
errored = true
}
expect(errored).to.be.true
const receipt: TransactionReceipt = await provider.getTransactionReceipt(
tx.hash
)
expect(receipt.status).to.eq(0)
})
})
describe('eth_getTransactionByHash', () => { describe('eth_getTransactionByHash', () => {
it('should be able to get all relevant l1/l2 transaction data', async () => { it('should be able to get all relevant l1/l2 transaction data', async () => {
const tx = DEFAULT_TRANSACTION const tx = DEFAULT_TRANSACTION
...@@ -168,10 +308,23 @@ describe('Basic RPC tests', () => { ...@@ -168,10 +308,23 @@ describe('Basic RPC tests', () => {
// we normalize by gwei here because the RPC does it as well, since the // we normalize by gwei here because the RPC does it as well, since the
// user provides a 1gwei gas price when submitting txs via the eth_gasPrice // user provides a 1gwei gas price when submitting txs via the eth_gasPrice
// rpc call // rpc call. The smallest possible value for the expected cost is 21000
const expected = expectedCost[i].mul(l1GasPrice).div(GWEI) let expected = expectedCost[i].mul(l1GasPrice).div(GWEI)
if (expected.lt(BigNumber.from(21000))) {
expected = BigNumber.from(21000)
}
expect(estimate).to.be.deep.eq(expected) expect(estimate).to.be.deep.eq(expected)
} }
}) })
it('should fail for a reverting call transaction', async () => {
await expect(provider.send('eth_estimateGas', [revertingTx])).to.be
.reverted
})
it('should fail for a reverting deploy transaction', async () => {
await expect(provider.send('eth_estimateGas', [revertingDeployTx])).to.be
.reverted
})
}) })
}) })
...@@ -4,7 +4,7 @@ import { ...@@ -4,7 +4,7 @@ import {
getContractFactory, getContractFactory,
getContractInterface, getContractInterface,
} from '@eth-optimism/contracts' } from '@eth-optimism/contracts'
import { Watcher } from '@eth-optimism/core-utils' import { remove0x, Watcher } from '@eth-optimism/core-utils'
import { import {
Contract, Contract,
Wallet, Wallet,
...@@ -12,6 +12,7 @@ import { ...@@ -12,6 +12,7 @@ import {
providers, providers,
BigNumberish, BigNumberish,
BigNumber, BigNumber,
utils,
} from 'ethers' } from 'ethers'
import { cleanEnv, str, num } from 'envalid' import { cleanEnv, str, num } from 'envalid'
...@@ -100,3 +101,8 @@ export const fundUser = async ( ...@@ -100,3 +101,8 @@ export const fundUser = async (
} }
export const sleep = (ms: number) => new Promise((r) => setTimeout(r, ms)) export const sleep = (ms: number) => new Promise((r) => setTimeout(r, ms))
const abiCoder = new utils.AbiCoder()
export const encodeSolidityRevertMessage = (_reason: string): string => {
return '0x08c379a0' + remove0x(abiCoder.encode(['string'], [_reason]))
}
...@@ -19,10 +19,12 @@ package abi ...@@ -19,10 +19,12 @@ package abi
import ( import (
"bytes" "bytes"
"encoding/json" "encoding/json"
"errors"
"fmt" "fmt"
"io" "io"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
) )
// The ABI holds information about a contract's context and available // The ABI holds information about a contract's context and available
...@@ -192,3 +194,25 @@ func (abi *ABI) EventByID(topic common.Hash) (*Event, error) { ...@@ -192,3 +194,25 @@ func (abi *ABI) EventByID(topic common.Hash) (*Event, error) {
} }
return nil, fmt.Errorf("no event with id: %#x", topic.Hex()) return nil, fmt.Errorf("no event with id: %#x", topic.Hex())
} }
// RevertSelector is a special function selector for revert reason unpacking.
var RevertSelector = crypto.Keccak256([]byte("Error(string)"))[:4]
// UnpackRevert resolves the abi-encoded revert reason. According to the solidity
// docs https://docs.soliditylang.org/en/v0.8.4/control-structures.html#revert,
// the provided revert reason is abi-encoded as if it were a call to a function
// `Error(string)`. So it's a special tool for it.
func UnpackRevert(data []byte) (string, error) {
if len(data) < 4 {
return "", errors.New("invalid data for unpacking")
}
if !bytes.Equal(data[:4], RevertSelector) {
return "", errors.New("invalid data for unpacking")
}
typ, _ := NewType("string", "", nil)
unpacked, err := (Arguments{{Type: typ}}).UnpackValues(data[4:])
if err != nil {
return "", err
}
return unpacked[0].(string), nil
}
...@@ -252,7 +252,7 @@ func (st *StateTransition) TransitionDb() (ret []byte, usedGas uint64, failed bo ...@@ -252,7 +252,7 @@ func (st *StateTransition) TransitionDb() (ret []byte, usedGas uint64, failed bo
l1MessageSender = msg.L1MessageSender().Hex() l1MessageSender = msg.L1MessageSender().Hex()
} }
if st.evm.EthCallSender == nil { if st.evm.EthCallSender == nil {
log.Debug("Applying transaction", "ID", st.evm.Id, "from", sender.Address().Hex(), "to", to, "nonce", msg.Nonce(), "gasPrice", msg.GasPrice().Uint64(), "gasLimit", msg.Gas(), "l1MessageSender", l1MessageSender, "data", hexutil.Encode(msg.Data())) log.Debug("Applying transaction", "ID", st.evm.Id, "from", sender.Address().Hex(), "to", to, "nonce", msg.Nonce(), "gasPrice", msg.GasPrice().Uint64(), "gasLimit", msg.Gas(), "value", msg.Value().Uint64(), "l1MessageSender", l1MessageSender, "data", hexutil.Encode(msg.Data()))
} }
} }
......
...@@ -148,7 +148,7 @@ func modMessage( ...@@ -148,7 +148,7 @@ func modMessage(
from, from,
to, to,
msg.Nonce(), msg.Nonce(),
msg.Value(), common.Big0,
gasLimit, gasLimit,
msg.GasPrice(), msg.GasPrice(),
data, data,
......
...@@ -17,67 +17,16 @@ ...@@ -17,67 +17,16 @@
package types package types
import ( import (
"bytes"
"crypto/ecdsa" "crypto/ecdsa"
"encoding/binary"
"errors" "errors"
"fmt" "fmt"
"math/big" "math/big"
"strings"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/params"
"golang.org/x/crypto/sha3"
) )
var codec abi.ABI
func init() {
const abidata = `
[
{
"type": "function",
"name": "encode",
"constant": true,
"inputs": [
{
"name": "nonce",
"type": "uint256"
},
{
"name": "gasLimit",
"type": "uint256"
},
{
"name": "gasPrice",
"type": "uint256"
},
{
"name": "chainId",
"type": "uint256"
},
{
"name": "to",
"type": "address"
},
{
"name": "data",
"type": "bytes"
}
]
}
]
`
var err error
codec, err = abi.JSON(strings.NewReader(abidata))
if err != nil {
panic(fmt.Errorf("unable to create Eth Sign abi reader: %v", err))
}
}
var ( var (
ErrInvalidChainId = errors.New("invalid chain id for signer") ErrInvalidChainId = errors.New("invalid chain id for signer")
) )
...@@ -91,7 +40,16 @@ type sigCache struct { ...@@ -91,7 +40,16 @@ type sigCache struct {
// MakeSigner returns a Signer based on the given chain config and block number. // MakeSigner returns a Signer based on the given chain config and block number.
func MakeSigner(config *params.ChainConfig, blockNumber *big.Int) Signer { func MakeSigner(config *params.ChainConfig, blockNumber *big.Int) Signer {
return NewOVMSigner(config.ChainID) var signer Signer
switch {
case config.IsEIP155(blockNumber):
signer = NewEIP155Signer(config.ChainID)
case config.IsHomestead(blockNumber):
signer = HomesteadSigner{}
default:
signer = FrontierSigner{}
}
return signer
} }
// SignTx signs the transaction using the given signer and private key // SignTx signs the transaction using the given signer and private key
...@@ -144,97 +102,6 @@ type Signer interface { ...@@ -144,97 +102,6 @@ type Signer interface {
Equal(Signer) bool Equal(Signer) bool
} }
// OVMSigner implements Signers using the EIP155 rules along with a new
// `eth_sign` based signature hash.
type OVMSigner struct {
EIP155Signer
}
func NewOVMSigner(chainId *big.Int) OVMSigner {
signer := NewEIP155Signer(chainId)
return OVMSigner{signer}
}
func (s OVMSigner) Equal(s2 Signer) bool {
ovm, ok := s2.(OVMSigner)
return ok && ovm.chainId.Cmp(s.chainId) == 0
}
// Hash returns the hash to be signed by the sender.
// It does not uniquely identify the transaction.
func (s OVMSigner) Hash(tx *Transaction) common.Hash {
if tx.IsEthSignSighash() {
msg := s.OVMSignerTemplateSighashPreimage(tx)
hasher := sha3.NewLegacyKeccak256()
hasher.Write(msg[:])
digest := hasher.Sum(nil)
return common.BytesToHash(digest)
}
return rlpHash([]interface{}{
tx.data.AccountNonce,
tx.data.Price,
tx.data.GasLimit,
tx.data.Recipient,
tx.data.Amount,
tx.data.Payload,
s.chainId, uint(0), uint(0),
})
}
// Sender will ecrecover the public key that created the signature
// and then hash the public key to create an address. In the
// case of L1ToL2 transactions, Layer One did the authentication
// for us so there is no signature involved. The concept of a "from"
// is only required for bookkeeping within this codebase
func (s OVMSigner) Sender(tx *Transaction) (common.Address, error) {
qo := tx.QueueOrigin()
if qo != nil && qo.Uint64() == uint64(QueueOriginL1ToL2) {
return common.Address{}, nil
}
if !tx.Protected() {
return HomesteadSigner{}.Sender(tx)
}
if tx.ChainId().Cmp(s.chainId) != 0 {
return common.Address{}, ErrInvalidChainId
}
V := new(big.Int).Sub(tx.data.V, s.chainIdMul)
V.Sub(V, big8)
return recoverPlain(s.Hash(tx), tx.data.R, tx.data.S, V, true)
}
// OVMSignerTemplateSighashPreimage creates the preimage for the `eth_sign` like
// signature hash. The transaction is `ABI.encodePacked`.
func (s OVMSigner) OVMSignerTemplateSighashPreimage(tx *Transaction) []byte {
data := []interface{}{
big.NewInt(int64(tx.data.AccountNonce)),
big.NewInt(int64(tx.data.GasLimit)),
tx.data.Price,
s.chainId,
*tx.data.Recipient,
tx.data.Payload,
}
ret, err := codec.Pack("encode", data...)
if err != nil {
panic(fmt.Errorf("unable to pack Eth Sign data: %v", err))
}
hasher := sha3.NewLegacyKeccak256()
// Slice off the function selector before hashing
hasher.Write(ret[4:])
digest := hasher.Sum(nil)
preimage := new(bytes.Buffer)
prefix := []byte("\x19Ethereum Signed Message:\n32")
binary.Write(preimage, binary.BigEndian, prefix)
binary.Write(preimage, binary.BigEndian, digest)
return preimage.Bytes()
}
// EIP155Transaction implements Signer using the EIP155 rules. // EIP155Transaction implements Signer using the EIP155 rules.
type EIP155Signer struct { type EIP155Signer struct {
chainId, chainIdMul *big.Int chainId, chainIdMul *big.Int
......
...@@ -136,100 +136,3 @@ func TestChainId(t *testing.T) { ...@@ -136,100 +136,3 @@ func TestChainId(t *testing.T) {
t.Error("expected no error") t.Error("expected no error")
} }
} }
func TestOVMSigner(t *testing.T) {
key, _ := defaultTestKey()
tx := NewTransaction(0, common.Address{}, new(big.Int), 0, new(big.Int), nil)
txMeta := NewTransactionMeta(nil, 0, nil, SighashEthSign, QueueOriginSequencer, nil, nil, nil)
tx.SetTransactionMeta(txMeta)
var err error
tx, err = SignTx(tx, NewOVMSigner(big.NewInt(1)), key)
if err != nil {
t.Fatal(err)
}
_, err = Sender(NewOVMSigner(big.NewInt(2)), tx)
if err != ErrInvalidChainId {
t.Error("expected error:", ErrInvalidChainId)
}
_, err = Sender(NewOVMSigner(big.NewInt(1)), tx)
if err != nil {
t.Error("expected no error")
}
}
func TestOVMSignerHash(t *testing.T) {
signer := NewOVMSigner(big.NewInt(1))
txNil := NewTransaction(0, common.Address{}, new(big.Int), 0, new(big.Int), nil)
txEIP155 := NewTransaction(0, common.Address{}, new(big.Int), 0, new(big.Int), nil)
hashNil := signer.Hash(txNil)
hashEIP155 := signer.Hash(txEIP155)
if hashNil != hashEIP155 {
t.Errorf("Signature hashes should be equal: %s != %s", hashNil.Hex(), hashEIP155.Hex())
}
// The signature hash should be different when using `SighashEthSign`
txEthSign := NewTransaction(0, common.Address{}, new(big.Int), 0, new(big.Int), nil)
txMeta := NewTransactionMeta(nil, 0, nil, SighashEthSign, QueueOriginSequencer, nil, nil, nil)
txEthSign.SetTransactionMeta(txMeta)
hashEthSign := signer.Hash(txEthSign)
if hashEIP155 == hashEthSign {
t.Errorf("Signature hashes should not be equal: %s == %s", hashEIP155.Hex(), hashEthSign.Hex())
}
}
func TestOVMSignerSender(t *testing.T) {
// Create a keypair to sign transactions with and the corresponding address
// from the public key.
key, _ := crypto.GenerateKey()
addr := crypto.PubkeyToAddress(key.PublicKey)
// This test makes sure that both the EIP155 and EthSign signature hash
// codepaths work when using the OVMSigner.
signer := NewOVMSigner(big.NewInt(1))
var err error
// Create a transaction with EIP155 signature hash, sign the transaction,
// recover the address and assert that the address matches the key.
txEIP155 := NewTransaction(0, addr, new(big.Int), 0, new(big.Int), nil)
txEIP155, err = SignTx(txEIP155, signer, key)
if err != nil {
t.Errorf("No error expected")
}
recEIP155, err := signer.Sender(txEIP155)
if err != nil {
t.Errorf("No error expected")
}
if addr != recEIP155 {
t.Errorf("Recovered address doesn't match. Got %s, expected %s", recEIP155.Hex(), addr.Hex())
}
// Create a transaction with EthSign signature hash, sign the transaction,
// recover the address and assert that the address matches the key.
txEthSign := NewTransaction(0, addr, new(big.Int), 0, new(big.Int), nil)
txMeta := NewTransactionMeta(nil, 0, nil, SighashEthSign, QueueOriginSequencer, nil, nil, nil)
txEthSign.SetTransactionMeta(txMeta)
txEthSign, err = SignTx(txEthSign, signer, key)
if err != nil {
t.Errorf("No error expected")
}
recEthSign, err := signer.Sender(txEthSign)
if err != nil {
t.Errorf("No error expected")
}
if addr != recEthSign {
t.Errorf("Recovered address doesn't match. Got %s, expected %s", recEthSign.Hex(), addr.Hex())
}
}
...@@ -208,7 +208,7 @@ func TestTransactionJSON(t *testing.T) { ...@@ -208,7 +208,7 @@ func TestTransactionJSON(t *testing.T) {
if err != nil { if err != nil {
t.Fatalf("could not generate key: %v", err) t.Fatalf("could not generate key: %v", err)
} }
signer := NewOVMSigner(common.Big1) signer := NewEIP155Signer(common.Big1)
transactions := make([]*Transaction, 0, 50) transactions := make([]*Transaction, 0, 50)
for i := uint64(0); i < 25; i++ { for i := uint64(0); i < 25; i++ {
......
...@@ -17,13 +17,15 @@ ...@@ -17,13 +17,15 @@
package vm package vm
import ( import (
"bytes"
"crypto/rand" "crypto/rand"
"encoding/hex" "encoding/hex"
"fmt"
"math/big" "math/big"
"strings"
"sync/atomic" "sync/atomic"
"time" "time"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto"
...@@ -32,10 +34,66 @@ import ( ...@@ -32,10 +34,66 @@ import (
"github.com/ethereum/go-ethereum/rollup/dump" "github.com/ethereum/go-ethereum/rollup/dump"
) )
// codec is a decoder for the return values of the execution manager. It decodes
// (bool, bytes) from the bytes that are returned from both
// `ExecutionManager.run()` and `ExecutionManager.simulateMessage()`
var codec abi.ABI
// innerData represents the results returned from the ExecutionManager
// that are wrapped in `bytes`
type innerData struct {
Success bool `abi:"_success"`
ReturnData []byte `abi:"_returndata"`
}
// runReturnData represents the actual return data of the ExecutionManager.
// It wraps (bool, bytes) in an ABI encoded bytes
type runReturnData struct {
ReturnData []byte `abi:"_returndata"`
}
// Will be removed when we update EM to return data in `run`. // Will be removed when we update EM to return data in `run`.
var deadPrefix, fortyTwoPrefix, zeroPrefix []byte var deadPrefix, fortyTwoPrefix, zeroPrefix []byte
func init() { func init() {
const abidata = `
[
{
"type": "function",
"name": "call",
"constant": true,
"inputs": [],
"outputs": [
{
"name": "_success",
"type": "bool"
},
{
"name": "_returndata",
"type": "bytes"
}
]
},
{
"type": "function",
"name": "blob",
"constant": true,
"inputs": [],
"outputs": [
{
"name": "_returndata",
"type": "bytes"
}
]
}
]
`
var err error
codec, err = abi.JSON(strings.NewReader(abidata))
if err != nil {
panic(fmt.Errorf("unable to create abi decoder: %v", err))
}
deadPrefix = hexutil.MustDecode("0xdeaddeaddeaddeaddeaddeaddeaddeaddead") deadPrefix = hexutil.MustDecode("0xdeaddeaddeaddeaddeaddeaddeaddeaddead")
zeroPrefix = hexutil.MustDecode("0x000000000000000000000000000000000000") zeroPrefix = hexutil.MustDecode("0x000000000000000000000000000000000000")
fortyTwoPrefix = hexutil.MustDecode("0x420000000000000000000000000000000000") fortyTwoPrefix = hexutil.MustDecode("0x420000000000000000000000000000000000")
...@@ -133,13 +191,10 @@ type Context struct { ...@@ -133,13 +191,10 @@ type Context struct {
Difficulty *big.Int // Provides information for DIFFICULTY Difficulty *big.Int // Provides information for DIFFICULTY
// OVM_ADDITION // OVM_ADDITION
EthCallSender *common.Address EthCallSender *common.Address
OriginalTargetAddress *common.Address OvmExecutionManager dump.OvmDumpAccount
OriginalTargetResult []byte OvmStateManager dump.OvmDumpAccount
OriginalTargetReached bool OvmSafetyChecker dump.OvmDumpAccount
OvmExecutionManager dump.OvmDumpAccount
OvmStateManager dump.OvmDumpAccount
OvmSafetyChecker dump.OvmDumpAccount
} }
// EVM is the Ethereum Virtual Machine base object and provides // EVM is the Ethereum Virtual Machine base object and provides
...@@ -251,34 +306,6 @@ func (evm *EVM) Interpreter() Interpreter { ...@@ -251,34 +306,6 @@ func (evm *EVM) Interpreter() Interpreter {
// the necessary steps to create accounts and reverses the state in case of an // the necessary steps to create accounts and reverses the state in case of an
// execution error or failed value transfer. // execution error or failed value transfer.
func (evm *EVM) Call(caller ContractRef, addr common.Address, input []byte, gas uint64, value *big.Int) (ret []byte, leftOverGas uint64, err error) { func (evm *EVM) Call(caller ContractRef, addr common.Address, input []byte, gas uint64, value *big.Int) (ret []byte, leftOverGas uint64, err error) {
var isTarget = false
if UsingOVM {
// OVM_ENABLED
if evm.depth == 0 {
// We're inside a new transaction, so make sure to wipe these variables beforehand.
evm.Context.OriginalTargetAddress = nil
evm.Context.OriginalTargetResult = []byte("00")
evm.Context.OriginalTargetReached = false
}
if caller.Address() == evm.Context.OvmExecutionManager.Address &&
!bytes.HasPrefix(addr.Bytes(), deadPrefix) &&
!bytes.HasPrefix(addr.Bytes(), zeroPrefix) &&
!bytes.HasPrefix(addr.Bytes(), fortyTwoPrefix) &&
evm.Context.OriginalTargetAddress == nil {
// Whew. Okay, so: we consider ourselves to be at a "target" as long as we were called
// by the execution manager, and we're not a precompile or "dead" address.
evm.Context.OriginalTargetAddress = &addr
evm.Context.OriginalTargetReached = true
isTarget = true
}
// Handle eth_call
if evm.Context.EthCallSender != nil && (caller.Address() == common.Address{}) {
evm.Context.OriginalTargetReached = true
isTarget = true
}
}
if evm.vmConfig.NoRecursion && evm.depth > 0 { if evm.vmConfig.NoRecursion && evm.depth > 0 {
return nil, gas, nil return nil, gas, nil
} }
...@@ -356,61 +383,39 @@ func (evm *EVM) Call(caller ContractRef, addr common.Address, input []byte, gas ...@@ -356,61 +383,39 @@ func (evm *EVM) Call(caller ContractRef, addr common.Address, input []byte, gas
if UsingOVM { if UsingOVM {
// OVM_ENABLED // OVM_ENABLED
if isTarget {
// If this was our target contract, store the result so that it can be later re-inserted
// into the user-facing return data (as seen below).
evm.Context.OriginalTargetResult = ret
}
if evm.depth == 0 { if evm.depth == 0 {
// We're back at the root-level message call, so we'll need to modify the return data // We're back at the root-level message call, so we'll need to modify the return data
// sent to us by the OVM_ExecutionManager to instead be the intended return data. // sent to us by the OVM_ExecutionManager to instead be the intended return data.
if !evm.Context.OriginalTargetReached { // Attempt to decode the returndata as as ExecutionManager.run when
// If we didn't get to the target contract, then our execution somehow failed // it is not an `eth_call` and as ExecutionManager.simulateMessage
// (perhaps due to insufficient gas). Just return an error that represents this. // when it is an `eth_call`. If the data is not decodable as ABI
ret = common.FromHex("0x") // encoded bytes, then return nothing. If the data is able to be
err = ErrOvmExecutionFailed // decoded as bytes, then attempt to decode as (bool, bytes)
} else if len(evm.Context.OriginalTargetResult) >= 96 { isDecodable := true
// We expect that EOA contracts return at least 96 bytes of data, where the first returnData := runReturnData{}
// 32 bytes are the boolean success value and the next 64 bytes are unnecessary if err := codec.Unpack(&returnData, "blob", ret); err != nil {
// ABI encoding data. The actual return data starts at the 96th byte and can be isDecodable = false
// empty. }
success := evm.Context.OriginalTargetResult[:32]
ret = evm.Context.OriginalTargetResult[96:]
if !bytes.Equal(success, AbiBytesTrue) && !bytes.Equal(success, AbiBytesFalse) {
// If the first 32 bytes not either are the ABI encoding of "true" or "false",
// then the user hasn't correctly ABI encoded the result. We return the null
// hex string as a default here (an annoying default that would convince most
// people to just use the standard form).
ret = common.FromHex("0x")
} else if bytes.Equal(success, AbiBytesFalse) {
// If the first 32 bytes are the ABI encoding of "false", then we need to add an
// artificial error that represents the revert.
err = errExecutionReverted
// We also currently need to add an extra four empty bytes to the return data switch isDecodable {
// to appease ethers.js. Our return correctly inserts the four specific bytes case true:
// that represent a "string error" to clients, but somehow the returndata size inner := innerData{}
// is a multiple of 32 (when we expect size % 32 == 4). ethers.js checks that // If this fails to decode, the nil values will be set in
// [size % 32 == 4] before trying to decode a string error result. Adding these // `inner`, meaning that it will be interpreted as reverted
// four empty bytes tricks ethers into correctly decoding the error string. // execution with empty returndata
// ovmTODO: Figure out how to actually deal with this. _ = codec.Unpack(&inner, "call", returnData.ReturnData)
// ovmTODO: This may actually be completely broken if the first four bytes of if !inner.Success {
// the return data are **not** the specific "string error" bytes. err = errExecutionReverted
ret = append(ret, make([]byte, 4)...)
} }
} else { ret = inner.ReturnData
// User hasn't conformed the standard format, just return "null" for the success case false:
// (with no return data) to convince them to use the standard. ret = []byte{}
ret = common.FromHex("0x")
} }
}
if evm.Context.EthCallSender == nil { if evm.Context.EthCallSender == nil {
log.Debug("Reached the end of an OVM execution", "ID", evm.Id, "Return Data", hexutil.Encode(ret), "Error", err) log.Debug("Reached the end of an OVM execution", "ID", evm.Id, "Return Data", hexutil.Encode(ret), "Error", err)
}
} }
} }
......
...@@ -297,20 +297,11 @@ func (b *EthAPIBackend) SubscribeLogsEvent(ch chan<- []*types.Log) event.Subscri ...@@ -297,20 +297,11 @@ func (b *EthAPIBackend) SubscribeLogsEvent(ch chan<- []*types.Log) event.Subscri
// a lock can be used around the remotes for when the sequencer is reorganizing. // a lock can be used around the remotes for when the sequencer is reorganizing.
func (b *EthAPIBackend) SendTx(ctx context.Context, signedTx *types.Transaction) error { func (b *EthAPIBackend) SendTx(ctx context.Context, signedTx *types.Transaction) error {
if b.UsingOVM { if b.UsingOVM {
// The value field is not rolled up so it must be set to 0
if signedTx.Value().Cmp(new(big.Int)) != 0 {
return fmt.Errorf("Cannot send transaction with non-zero value. Use WETH.transfer()")
}
to := signedTx.To() to := signedTx.To()
if to != nil { if to != nil {
if *to == (common.Address{}) { if *to == (common.Address{}) {
return errors.New("Cannot send transaction to zero address") return errors.New("Cannot send transaction to zero address")
} }
// Prevent transactions from being submitted if the gas limit too high
if signedTx.Gas() >= b.gasLimit {
return fmt.Errorf("Transaction gasLimit (%d) is greater than max gasLimit (%d)", signedTx.Gas(), b.gasLimit)
}
// Prevent QueueOriginSequencer transactions that are too large to // Prevent QueueOriginSequencer transactions that are too large to
// be included in a batch. The `MaxCallDataSize` should be set to // be included in a batch. The `MaxCallDataSize` should be set to
// the layer one consensus max transaction size in bytes minus the // the layer one consensus max transaction size in bytes minus the
...@@ -320,6 +311,14 @@ func (b *EthAPIBackend) SendTx(ctx context.Context, signedTx *types.Transaction) ...@@ -320,6 +311,14 @@ func (b *EthAPIBackend) SendTx(ctx context.Context, signedTx *types.Transaction)
if len(signedTx.Data()) > b.MaxCallDataSize { if len(signedTx.Data()) > b.MaxCallDataSize {
return fmt.Errorf("Calldata cannot be larger than %d, sent %d", b.MaxCallDataSize, len(signedTx.Data())) return fmt.Errorf("Calldata cannot be larger than %d, sent %d", b.MaxCallDataSize, len(signedTx.Data()))
} }
// If there is a value field set then reject transactions that
// contain calldata. The feature of sending transactions with value
// and calldata will be added in the future.
if signedTx.Value().Cmp(common.Big0) != 0 {
if len(signedTx.Data()) > 0 {
return errors.New("Cannot send transactions with value and calldata")
}
}
} }
return b.eth.syncService.ApplyTransaction(signedTx) return b.eth.syncService.ApplyTransaction(signedTx)
} }
......
package eth
import (
"context"
"fmt"
"math/big"
"testing"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
)
func TestGasLimit(t *testing.T) {
backend := &EthAPIBackend{
extRPCEnabled: false,
eth: nil,
gpo: nil,
verifier: false,
gasLimit: 0,
UsingOVM: true,
}
nonce := uint64(0)
to := common.HexToAddress("0x5A0b54D5dc17e0AadC383d2db43B0a0D3E029c4c")
value := big.NewInt(0)
gasPrice := big.NewInt(0)
data := []byte{}
// Set the gas limit to 1 so that the transaction will not be
// able to be added.
gasLimit := uint64(1)
tx := types.NewTransaction(nonce, to, value, gasLimit, gasPrice, data)
err := backend.SendTx(context.Background(), tx)
if err == nil {
t.Fatal("Transaction with too large of gas limit accepted")
}
if err.Error() != fmt.Sprintf("Transaction gasLimit (%d) is greater than max gasLimit (%d)", gasLimit, backend.GasLimit()) {
t.Fatalf("Unexpected error type: %s", err)
}
}
...@@ -27,6 +27,7 @@ import ( ...@@ -27,6 +27,7 @@ import (
"github.com/davecgh/go-spew/spew" "github.com/davecgh/go-spew/spew"
"github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/accounts/keystore" "github.com/ethereum/go-ethereum/accounts/keystore"
"github.com/ethereum/go-ethereum/accounts/scwallet" "github.com/ethereum/go-ethereum/accounts/scwallet"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
...@@ -52,6 +53,8 @@ const ( ...@@ -52,6 +53,8 @@ const (
defaultGasPrice = params.GWei defaultGasPrice = params.GWei
) )
var errOVMUnsupported = errors.New("OVM: Unsupported RPC Method")
// PublicEthereumAPI provides an API to access Ethereum related information. // PublicEthereumAPI provides an API to access Ethereum related information.
// It offers only methods that operate on public data that is freely available to anyone. // It offers only methods that operate on public data that is freely available to anyone.
type PublicEthereumAPI struct { type PublicEthereumAPI struct {
...@@ -1043,6 +1046,9 @@ func DoEstimateGas(ctx context.Context, b Backend, args CallArgs, blockNrOrHash ...@@ -1043,6 +1046,9 @@ func DoEstimateGas(ctx context.Context, b Backend, args CallArgs, blockNrOrHash
// 3. calculate the fee and normalize by the default gas price // 3. calculate the fee and normalize by the default gas price
fee := core.CalculateRollupFee(*args.Data, uint64(gasUsed), dataPrice, executionPrice).Uint64() / defaultGasPrice fee := core.CalculateRollupFee(*args.Data, uint64(gasUsed), dataPrice, executionPrice).Uint64() / defaultGasPrice
if fee < 21000 {
fee = 21000
}
return (hexutil.Uint64)(fee), nil return (hexutil.Uint64)(fee), nil
} }
...@@ -1082,19 +1088,21 @@ func legacyDoEstimateGas(ctx context.Context, b Backend, args CallArgs, blockNrO ...@@ -1082,19 +1088,21 @@ func legacyDoEstimateGas(ctx context.Context, b Backend, args CallArgs, blockNrO
args.From = &common.Address{} args.From = &common.Address{}
} }
// Create a helper to check if a gas allowance results in an executable transaction // Create a helper to check if a gas allowance results in an executable transaction
executable := func(gas uint64) bool { executable := func(gas uint64) (bool, []byte) {
args.Gas = (*hexutil.Uint64)(&gas) args.Gas = (*hexutil.Uint64)(&gas)
_, _, failed, err := DoCall(ctx, b, args, blockNrOrHash, nil, vm.Config{}, 0, gasCap) res, _, failed, err := DoCall(ctx, b, args, blockNrOrHash, nil, vm.Config{}, 0, gasCap)
if err != nil || failed { if err != nil || failed {
return false return false, res
} }
return true return true, res
} }
// Execute the binary search and hone in on an executable gas limit // Execute the binary search and hone in on an executable gas limit
for lo+1 < hi { for lo+1 < hi {
mid := (hi + lo) / 2 mid := (hi + lo) / 2
if !executable(mid) { ok, _ := executable(mid)
if !ok {
lo = mid lo = mid
} else { } else {
hi = mid hi = mid
...@@ -1102,7 +1110,16 @@ func legacyDoEstimateGas(ctx context.Context, b Backend, args CallArgs, blockNrO ...@@ -1102,7 +1110,16 @@ func legacyDoEstimateGas(ctx context.Context, b Backend, args CallArgs, blockNrO
} }
// Reject the transaction as invalid if it still fails at the highest allowance // Reject the transaction as invalid if it still fails at the highest allowance
if hi == cap { if hi == cap {
if !executable(hi) { ok, res := executable(hi)
if !ok {
if len(res) >= 4 && bytes.Equal(res[:4], abi.RevertSelector) {
reason, errUnpack := abi.UnpackRevert(res)
err := errors.New("execution reverted")
if errUnpack == nil {
err = fmt.Errorf("execution reverted: %v", reason)
}
return 0, err
}
return 0, fmt.Errorf("gas required exceeds allowance (%d) or always failing transaction", cap) return 0, fmt.Errorf("gas required exceeds allowance (%d) or always failing transaction", cap)
} }
} }
...@@ -1286,7 +1303,10 @@ type RPCTransaction struct { ...@@ -1286,7 +1303,10 @@ type RPCTransaction struct {
// newRPCTransaction returns a transaction that will serialize to the RPC // newRPCTransaction returns a transaction that will serialize to the RPC
// representation, with the given location metadata set (if available). // representation, with the given location metadata set (if available).
func newRPCTransaction(tx *types.Transaction, blockHash common.Hash, blockNumber uint64, index uint64) *RPCTransaction { func newRPCTransaction(tx *types.Transaction, blockHash common.Hash, blockNumber uint64, index uint64) *RPCTransaction {
var signer types.Signer = types.NewOVMSigner(tx.ChainId()) var signer types.Signer = types.FrontierSigner{}
if tx.Protected() {
signer = types.NewEIP155Signer(tx.ChainId())
}
from, _ := types.Sender(signer, tx) from, _ := types.Sender(signer, tx)
v, r, s := tx.RawSignatureValues() v, r, s := tx.RawSignatureValues()
...@@ -1514,7 +1534,7 @@ func (s *PublicTransactionPoolAPI) GetTransactionReceipt(ctx context.Context, ha ...@@ -1514,7 +1534,7 @@ func (s *PublicTransactionPoolAPI) GetTransactionReceipt(ctx context.Context, ha
var signer types.Signer = types.FrontierSigner{} var signer types.Signer = types.FrontierSigner{}
if tx.Protected() { if tx.Protected() {
signer = types.NewOVMSigner(tx.ChainId()) signer = types.NewEIP155Signer(tx.ChainId())
} }
from, _ := types.Sender(signer, tx) from, _ := types.Sender(signer, tx)
...@@ -1648,12 +1668,14 @@ func (args *SendTxArgs) toTransaction() *types.Transaction { ...@@ -1648,12 +1668,14 @@ func (args *SendTxArgs) toTransaction() *types.Transaction {
} }
if args.To == nil { if args.To == nil {
tx := types.NewContractCreation(uint64(*args.Nonce), (*big.Int)(args.Value), uint64(*args.Gas), (*big.Int)(args.GasPrice), input) tx := types.NewContractCreation(uint64(*args.Nonce), (*big.Int)(args.Value), uint64(*args.Gas), (*big.Int)(args.GasPrice), input)
txMeta := types.NewTransactionMeta(args.L1BlockNumber, 0, nil, types.SighashEIP155, types.QueueOriginSequencer, nil, nil, nil) raw, _ := rlp.EncodeToBytes(tx)
txMeta := types.NewTransactionMeta(args.L1BlockNumber, 0, nil, types.SighashEIP155, types.QueueOriginSequencer, nil, nil, raw)
tx.SetTransactionMeta(txMeta) tx.SetTransactionMeta(txMeta)
return tx return tx
} }
tx := types.NewTransaction(uint64(*args.Nonce), *args.To, (*big.Int)(args.Value), uint64(*args.Gas), (*big.Int)(args.GasPrice), input) tx := types.NewTransaction(uint64(*args.Nonce), *args.To, (*big.Int)(args.Value), uint64(*args.Gas), (*big.Int)(args.GasPrice), input)
txMeta := types.NewTransactionMeta(args.L1BlockNumber, 0, args.L1MessageSender, args.SignatureHashType, types.QueueOriginSequencer, nil, nil, nil) raw, _ := rlp.EncodeToBytes(tx)
txMeta := types.NewTransactionMeta(args.L1BlockNumber, 0, args.L1MessageSender, args.SignatureHashType, types.QueueOriginSequencer, nil, nil, raw)
tx.SetTransactionMeta(txMeta) tx.SetTransactionMeta(txMeta)
return tx return tx
} }
...@@ -1683,10 +1705,9 @@ func SubmitTransaction(ctx context.Context, b Backend, tx *types.Transaction) (c ...@@ -1683,10 +1705,9 @@ func SubmitTransaction(ctx context.Context, b Backend, tx *types.Transaction) (c
// SendTransaction creates a transaction for the given argument, sign it and submit it to the // SendTransaction creates a transaction for the given argument, sign it and submit it to the
// transaction pool. // transaction pool.
func (s *PublicTransactionPoolAPI) SendTransaction(ctx context.Context, args SendTxArgs) (common.Hash, error) { func (s *PublicTransactionPoolAPI) SendTransaction(ctx context.Context, args SendTxArgs) (common.Hash, error) {
if s.b.IsVerifier() { if vm.UsingOVM {
return common.Hash{}, errors.New("Cannot send transaction in verifier mode") return common.Hash{}, errOVMUnsupported
} }
// Look up the wallet containing the requested signer // Look up the wallet containing the requested signer
account := accounts.Account{Address: args.From} account := accounts.Account{Address: args.From}
...@@ -1719,6 +1740,9 @@ func (s *PublicTransactionPoolAPI) SendTransaction(ctx context.Context, args Sen ...@@ -1719,6 +1740,9 @@ func (s *PublicTransactionPoolAPI) SendTransaction(ctx context.Context, args Sen
// FillTransaction fills the defaults (nonce, gas, gasPrice) on a given unsigned transaction, // FillTransaction fills the defaults (nonce, gas, gasPrice) on a given unsigned transaction,
// and returns it to the caller for further processing (signing + broadcast) // and returns it to the caller for further processing (signing + broadcast)
func (s *PublicTransactionPoolAPI) FillTransaction(ctx context.Context, args SendTxArgs) (*SignTransactionResult, error) { func (s *PublicTransactionPoolAPI) FillTransaction(ctx context.Context, args SendTxArgs) (*SignTransactionResult, error) {
if vm.UsingOVM {
return nil, errOVMUnsupported
}
// Set some sanity defaults and terminate on failure // Set some sanity defaults and terminate on failure
if err := args.setDefaults(ctx, s.b); err != nil { if err := args.setDefaults(ctx, s.b); err != nil {
return nil, err return nil, err
...@@ -1747,39 +1771,8 @@ func (s *PublicTransactionPoolAPI) SendRawTransaction(ctx context.Context, encod ...@@ -1747,39 +1771,8 @@ func (s *PublicTransactionPoolAPI) SendRawTransaction(ctx context.Context, encod
if err := rlp.DecodeBytes(encodedTx, tx); err != nil { if err := rlp.DecodeBytes(encodedTx, tx); err != nil {
return common.Hash{}, err return common.Hash{}, err
} }
// L1Timestamp and L1BlockNumber will be set right before execution
if new(big.Int).Mod(tx.GasPrice(), big.NewInt(1000000)).Cmp(big.NewInt(0)) != 0 { txMeta := types.NewTransactionMeta(nil, 0, nil, types.SighashEIP155, types.QueueOriginSequencer, nil, nil, encodedTx)
return common.Hash{}, errors.New("Gas price must be a multiple of 1,000,000 wei")
}
// L1Timestamp and L1BlockNumber will be set by the miner
txMeta := types.NewTransactionMeta(nil, 0, nil, types.SighashEIP155, types.QueueOriginSequencer, nil, nil, nil)
tx.SetTransactionMeta(txMeta)
return SubmitTransaction(ctx, s.b, tx)
}
// SendRawEthSignTransaction will add the signed transaction to the mempool.
// The signature hash was computed with `eth_sign`, meaning that the
// `abi.encodedPacked` transaction was prefixed with the string
// "Ethereum Signed Message".
func (s *PublicTransactionPoolAPI) SendRawEthSignTransaction(ctx context.Context, encodedTx hexutil.Bytes) (common.Hash, error) {
if s.b.IsVerifier() {
return common.Hash{}, errors.New("Cannot send raw ethsign transaction in verifier mode")
}
if s.b.IsSyncing() {
return common.Hash{}, errors.New("Cannot send raw transaction while syncing")
}
tx := new(types.Transaction)
if err := rlp.DecodeBytes(encodedTx, tx); err != nil {
return common.Hash{}, err
}
if new(big.Int).Mod(tx.GasPrice(), big.NewInt(1000000)).Cmp(big.NewInt(0)) != 0 {
return common.Hash{}, errors.New("Gas price must be a multiple of 1,000,000 wei")
}
// L1Timestamp and L1BlockNumber will be set by the miner
txMeta := types.NewTransactionMeta(nil, 0, nil, types.SighashEthSign, types.QueueOriginSequencer, nil, nil, nil)
tx.SetTransactionMeta(txMeta) tx.SetTransactionMeta(txMeta)
return SubmitTransaction(ctx, s.b, tx) return SubmitTransaction(ctx, s.b, tx)
} }
...@@ -1794,6 +1787,9 @@ func (s *PublicTransactionPoolAPI) SendRawEthSignTransaction(ctx context.Context ...@@ -1794,6 +1787,9 @@ func (s *PublicTransactionPoolAPI) SendRawEthSignTransaction(ctx context.Context
// //
// https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign // https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign
func (s *PublicTransactionPoolAPI) Sign(addr common.Address, data hexutil.Bytes) (hexutil.Bytes, error) { func (s *PublicTransactionPoolAPI) Sign(addr common.Address, data hexutil.Bytes) (hexutil.Bytes, error) {
if vm.UsingOVM {
return nil, errOVMUnsupported
}
// Look up the wallet containing the requested signer // Look up the wallet containing the requested signer
account := accounts.Account{Address: addr} account := accounts.Account{Address: addr}
...@@ -1819,6 +1815,9 @@ type SignTransactionResult struct { ...@@ -1819,6 +1815,9 @@ type SignTransactionResult struct {
// The node needs to have the private key of the account corresponding with // The node needs to have the private key of the account corresponding with
// the given from address and it needs to be unlocked. // the given from address and it needs to be unlocked.
func (s *PublicTransactionPoolAPI) SignTransaction(ctx context.Context, args SendTxArgs) (*SignTransactionResult, error) { func (s *PublicTransactionPoolAPI) SignTransaction(ctx context.Context, args SendTxArgs) (*SignTransactionResult, error) {
if vm.UsingOVM {
return nil, errOVMUnsupported
}
if args.Gas == nil { if args.Gas == nil {
return nil, fmt.Errorf("gas not specified") return nil, fmt.Errorf("gas not specified")
} }
...@@ -1859,7 +1858,7 @@ func (s *PublicTransactionPoolAPI) PendingTransactions() ([]*RPCTransaction, err ...@@ -1859,7 +1858,7 @@ func (s *PublicTransactionPoolAPI) PendingTransactions() ([]*RPCTransaction, err
for _, tx := range pending { for _, tx := range pending {
var signer types.Signer = types.HomesteadSigner{} var signer types.Signer = types.HomesteadSigner{}
if tx.Protected() { if tx.Protected() {
signer = types.NewOVMSigner(tx.ChainId()) signer = types.NewEIP155Signer(tx.ChainId())
} }
from, _ := types.Sender(signer, tx) from, _ := types.Sender(signer, tx)
if _, exists := accounts[from]; exists { if _, exists := accounts[from]; exists {
...@@ -1887,7 +1886,7 @@ func (s *PublicTransactionPoolAPI) Resend(ctx context.Context, sendArgs SendTxAr ...@@ -1887,7 +1886,7 @@ func (s *PublicTransactionPoolAPI) Resend(ctx context.Context, sendArgs SendTxAr
for _, p := range pending { for _, p := range pending {
var signer types.Signer = types.HomesteadSigner{} var signer types.Signer = types.HomesteadSigner{}
if p.Protected() { if p.Protected() {
signer = types.NewOVMSigner(p.ChainId()) signer = types.NewEIP155Signer(p.ChainId())
} }
wantSigHash := signer.Hash(matchTx) wantSigHash := signer.Hash(matchTx)
......
...@@ -646,7 +646,7 @@ func (w *worker) makeCurrent(parent *types.Block, header *types.Header) error { ...@@ -646,7 +646,7 @@ func (w *worker) makeCurrent(parent *types.Block, header *types.Header) error {
return err return err
} }
env := &environment{ env := &environment{
signer: types.NewOVMSigner(w.chainConfig.ChainID), signer: types.NewEIP155Signer(w.chainConfig.ChainID),
state: state, state: state,
ancestors: mapset.NewSet(), ancestors: mapset.NewSet(),
family: mapset.NewSet(), family: mapset.NewSet(),
......
...@@ -132,7 +132,7 @@ type RollupClient interface { ...@@ -132,7 +132,7 @@ type RollupClient interface {
// Client is an HTTP based RollupClient // Client is an HTTP based RollupClient
type Client struct { type Client struct {
client *resty.Client client *resty.Client
signer *types.OVMSigner signer *types.EIP155Signer
} }
// TransactionResponse represents the response from the remote server when // TransactionResponse represents the response from the remote server when
...@@ -154,7 +154,7 @@ func NewClient(url string, chainID *big.Int) *Client { ...@@ -154,7 +154,7 @@ func NewClient(url string, chainID *big.Int) *Client {
client := resty.New() client := resty.New()
client.SetHostURL(url) client.SetHostURL(url)
client.SetHeader("User-Agent", "sequencer") client.SetHeader("User-Agent", "sequencer")
signer := types.NewOVMSigner(chainID) signer := types.NewEIP155Signer(chainID)
return &Client{ return &Client{
client: client, client: client,
...@@ -274,7 +274,7 @@ func (c *Client) GetLatestEnqueue() (*types.Transaction, error) { ...@@ -274,7 +274,7 @@ func (c *Client) GetLatestEnqueue() (*types.Transaction, error) {
// batchedTransactionToTransaction converts a transaction into a // batchedTransactionToTransaction converts a transaction into a
// types.Transaction that can be consumed by the SyncService // types.Transaction that can be consumed by the SyncService
func batchedTransactionToTransaction(res *transaction, signer *types.OVMSigner) (*types.Transaction, error) { func batchedTransactionToTransaction(res *transaction, signer *types.EIP155Signer) (*types.Transaction, error) {
// `nil` transactions are not found // `nil` transactions are not found
if res == nil { if res == nil {
return nil, errElementNotFound return nil, errElementNotFound
...@@ -289,18 +289,7 @@ func batchedTransactionToTransaction(res *transaction, signer *types.OVMSigner) ...@@ -289,18 +289,7 @@ func batchedTransactionToTransaction(res *transaction, signer *types.OVMSigner)
} else { } else {
return nil, fmt.Errorf("Unknown queue origin: %s", res.QueueOrigin) return nil, fmt.Errorf("Unknown queue origin: %s", res.QueueOrigin)
} }
// The transaction type must be EIP155 or EthSign. Throughout this sighashType := types.SighashEIP155
// codebase, it is referred to as "sighash type" but it could actually
// be generalized to transaction type. Right now the only different
// types use a different signature hashing scheme.
var sighashType types.SignatureHashType
if res.Type == EIP155 {
sighashType = types.SighashEIP155
} else if res.Type == ETH_SIGN {
sighashType = types.SighashEthSign
} else {
return nil, fmt.Errorf("Unknown transaction type: %s", res.Type)
}
// Transactions that have been decoded are // Transactions that have been decoded are
// Queue Origin Sequencer transactions // Queue Origin Sequencer transactions
if res.Decoded != nil { if res.Decoded != nil {
...@@ -542,7 +531,7 @@ func (c *Client) GetTransactionBatch(index uint64) (*Batch, []*types.Transaction ...@@ -542,7 +531,7 @@ func (c *Client) GetTransactionBatch(index uint64) (*Batch, []*types.Transaction
// parseTransactionBatchResponse will turn a TransactionBatchResponse into a // parseTransactionBatchResponse will turn a TransactionBatchResponse into a
// Batch and its corresponding types.Transactions // Batch and its corresponding types.Transactions
func parseTransactionBatchResponse(txBatch *TransactionBatchResponse, signer *types.OVMSigner) (*Batch, []*types.Transaction, error) { func parseTransactionBatchResponse(txBatch *TransactionBatchResponse, signer *types.EIP155Signer) (*Batch, []*types.Transaction, error) {
if txBatch == nil { if txBatch == nil {
return nil, nil, nil return nil, nil, nil
} }
......
package rollup package rollup
import ( import (
"bytes"
"context" "context"
"errors" "errors"
"fmt" "fmt"
...@@ -11,7 +10,6 @@ import ( ...@@ -11,7 +10,6 @@ import (
"sync/atomic" "sync/atomic"
"time" "time"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/event"
...@@ -707,7 +705,6 @@ func (s *SyncService) maybeApplyTransaction(tx *types.Transaction) error { ...@@ -707,7 +705,6 @@ func (s *SyncService) maybeApplyTransaction(tx *types.Transaction) error {
// Lower level API used to apply a transaction, must only be used with // Lower level API used to apply a transaction, must only be used with
// transactions that came from L1. // transactions that came from L1.
func (s *SyncService) applyTransaction(tx *types.Transaction) error { func (s *SyncService) applyTransaction(tx *types.Transaction) error {
tx = fixType(tx)
txs := types.Transactions{tx} txs := types.Transactions{tx}
s.txFeed.Send(core.NewTxsEvent{Txs: txs}) s.txFeed.Send(core.NewTxsEvent{Txs: txs})
return nil return nil
...@@ -745,114 +742,5 @@ func (s *SyncService) ApplyTransaction(tx *types.Transaction) error { ...@@ -745,114 +742,5 @@ func (s *SyncService) ApplyTransaction(tx *types.Transaction) error {
tx.SetL1Timestamp(ts) tx.SetL1Timestamp(ts)
tx.SetL1BlockNumber(bn) tx.SetL1BlockNumber(bn)
} }
// Set the raw transaction data in the meta
txRaw, err := getRawTransaction(tx)
if err != nil {
return fmt.Errorf("invalid transaction: %w", err)
}
meta := tx.GetMeta()
newMeta := types.NewTransactionMeta(
meta.L1BlockNumber,
meta.L1Timestamp,
meta.L1MessageSender,
meta.SignatureHashType,
types.QueueOrigin(meta.QueueOrigin.Uint64()),
meta.Index,
meta.QueueIndex,
txRaw,
)
tx.SetTransactionMeta(newMeta)
return s.applyTransaction(tx) return s.applyTransaction(tx)
} }
func getRawTransaction(tx *types.Transaction) ([]byte, error) {
if tx == nil {
return nil, errors.New("Cannot process nil transaction")
}
v, r, s := tx.RawSignatureValues()
// V parameter here will include the chain ID, so we need to recover the original V. If the V
// does not equal zero or one, we have an invalid parameter and need to throw an error.
// This is technically a duplicate check because it happens inside of
// `tx.AsMessage` as well.
v = new(big.Int).SetUint64(v.Uint64() - 35 - 2*tx.ChainId().Uint64())
if v.Uint64() != 0 && v.Uint64() != 1 {
return nil, fmt.Errorf("invalid signature v parameter: %d", v.Uint64())
}
// Since we use a fixed encoding, we need to insert some placeholder address to represent that
// the user wants to create a contract (in this case, the zero address).
var target common.Address
if tx.To() == nil {
target = common.Address{}
} else {
target = *tx.To()
}
// Divide the gas price by one million to compress it
// before it is send to the sequencer entrypoint. This is to save
// space on calldata.
gasPrice := new(big.Int).Div(tx.GasPrice(), new(big.Int).SetUint64(1000000))
// Sequencer uses a custom encoding structure --
// We originally receive sequencer transactions encoded in this way, but we decode them before
// inserting into Geth so we can make transactions easily parseable. However, this means that
// we need to re-encode the transactions before executing them.
var data = new(bytes.Buffer)
data.WriteByte(getSignatureType(tx)) // 1 byte: 00 == EIP 155, 02 == ETH Sign Message
data.Write(fillBytes(r, 32)) // 32 bytes: Signature `r` parameter
data.Write(fillBytes(s, 32)) // 32 bytes: Signature `s` parameter
data.Write(fillBytes(v, 1)) // 1 byte: Signature `v` parameter
data.Write(fillBytes(new(big.Int).SetUint64(tx.Gas()), 3)) // 3 bytes: Gas limit
data.Write(fillBytes(gasPrice, 3)) // 3 bytes: Gas price
data.Write(fillBytes(new(big.Int).SetUint64(tx.Nonce()), 3)) // 3 bytes: Nonce
data.Write(target.Bytes()) // 20 bytes: Target address
data.Write(tx.Data())
return data.Bytes(), nil
}
func fillBytes(x *big.Int, size int) []byte {
b := x.Bytes()
switch {
case len(b) > size:
panic("math/big: value won't fit requested size")
case len(b) == size:
return b
default:
buf := make([]byte, size)
copy(buf[size-len(b):], b)
return buf
}
}
func getSignatureType(tx *types.Transaction) uint8 {
if tx.SignatureHashType() == 0 {
return 0
} else if tx.SignatureHashType() == 1 {
return 2
} else {
return 1
}
}
// This is a temporary fix to patch the enums being used in the raw data
func fixType(tx *types.Transaction) *types.Transaction {
meta := tx.GetMeta()
raw := meta.RawTransaction
if len(raw) == 0 {
log.Error("Transaction with no raw detected")
return tx
}
if raw[0] == 0x00 {
return tx
} else if raw[0] == 0x01 {
raw[0] = 0x02
}
queueOrigin := types.QueueOrigin(meta.QueueOrigin.Uint64())
fixed := types.NewTransactionMeta(meta.L1BlockNumber, meta.L1Timestamp, meta.L1MessageSender, meta.SignatureHashType, queueOrigin, meta.Index, meta.QueueIndex, raw)
tx.SetTransactionMeta(fixed)
return tx
}
...@@ -21,7 +21,7 @@ services: ...@@ -21,7 +21,7 @@ services:
- ${L1CHAIN_HTTP_PORT:-9545}:8545 - ${L1CHAIN_HTTP_PORT:-9545}:8545
deployer: deployer:
depends_on: depends_on:
- l1_chain - l1_chain
image: ethereumoptimism/deployer image: ethereumoptimism/deployer
build: build:
...@@ -42,7 +42,7 @@ services: ...@@ -42,7 +42,7 @@ services:
- ${DEPLOYER_PORT:-8080}:8081 - ${DEPLOYER_PORT:-8080}:8081
dtl: dtl:
depends_on: depends_on:
- l1_chain - l1_chain
- deployer - deployer
- l2geth - l2geth
......
...@@ -7,8 +7,7 @@ pragma experimental ABIEncoderV2; ...@@ -7,8 +7,7 @@ pragma experimental ABIEncoderV2;
import { iOVM_ECDSAContractAccount } from "../../iOVM/accounts/iOVM_ECDSAContractAccount.sol"; import { iOVM_ECDSAContractAccount } from "../../iOVM/accounts/iOVM_ECDSAContractAccount.sol";
/* Library Imports */ /* Library Imports */
import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol"; import { Lib_EIP155Tx } from "../../libraries/codec/Lib_EIP155Tx.sol";
import { Lib_ECDSAUtils } from "../../libraries/utils/Lib_ECDSAUtils.sol";
import { Lib_ExecutionManagerWrapper } from "../../libraries/wrappers/Lib_ExecutionManagerWrapper.sol"; import { Lib_ExecutionManagerWrapper } from "../../libraries/wrappers/Lib_ExecutionManagerWrapper.sol";
/* Contract Imports */ /* Contract Imports */
...@@ -20,14 +19,21 @@ import { SafeMath } from "@openzeppelin/contracts/math/SafeMath.sol"; ...@@ -20,14 +19,21 @@ import { SafeMath } from "@openzeppelin/contracts/math/SafeMath.sol";
/** /**
* @title OVM_ECDSAContractAccount * @title OVM_ECDSAContractAccount
* @dev The ECDSA Contract Account can be used as the implementation for a ProxyEOA deployed by the * @dev The ECDSA Contract Account can be used as the implementation for a ProxyEOA deployed by the
* ovmCREATEEOA operation. It enables backwards compatibility with Ethereum's Layer 1, by * ovmCREATEEOA operation. It enables backwards compatibility with Ethereum's Layer 1, by
* providing eth_sign and EIP155 formatted transaction encodings. * providing EIP155 formatted transaction encodings.
* *
* Compiler used: optimistic-solc * Compiler used: optimistic-solc
* Runtime target: OVM * Runtime target: OVM
*/ */
contract OVM_ECDSAContractAccount is iOVM_ECDSAContractAccount { contract OVM_ECDSAContractAccount is iOVM_ECDSAContractAccount {
/*************
* Libraries *
*************/
using Lib_EIP155Tx for Lib_EIP155Tx.EIP155Tx;
/************* /*************
* Constants * * Constants *
*************/ *************/
...@@ -44,20 +50,12 @@ contract OVM_ECDSAContractAccount is iOVM_ECDSAContractAccount { ...@@ -44,20 +50,12 @@ contract OVM_ECDSAContractAccount is iOVM_ECDSAContractAccount {
/** /**
* Executes a signed transaction. * Executes a signed transaction.
* @param _transaction Signed EOA transaction. * @param _encodedTransaction Signed EIP155 transaction.
* @param _signatureType Hashing scheme used for the transaction (e.g., ETH signed message).
* @param _v Signature `v` parameter.
* @param _r Signature `r` parameter.
* @param _s Signature `s` parameter.
* @return Whether or not the call returned (rather than reverted). * @return Whether or not the call returned (rather than reverted).
* @return Data returned by the call. * @return Data returned by the call.
*/ */
function execute( function execute(
bytes memory _transaction, bytes memory _encodedTransaction
Lib_OVMCodec.EOASignatureType _signatureType,
uint8 _v,
bytes32 _r,
bytes32 _s
) )
override override
public public
...@@ -66,50 +64,30 @@ contract OVM_ECDSAContractAccount is iOVM_ECDSAContractAccount { ...@@ -66,50 +64,30 @@ contract OVM_ECDSAContractAccount is iOVM_ECDSAContractAccount {
bytes memory bytes memory
) )
{ {
bool isEthSign = _signatureType == Lib_OVMCodec.EOASignatureType.ETH_SIGNED_MESSAGE; // Attempt to decode the transaction.
Lib_EIP155Tx.EIP155Tx memory transaction = Lib_EIP155Tx.decode(
_encodedTransaction,
Lib_ExecutionManagerWrapper.ovmCHAINID()
);
// Address of this contract within the ovm (ovmADDRESS) should be the same as the // Address of this contract within the ovm (ovmADDRESS) should be the same as the
// recovered address of the user who signed this message. This is how we manage to shim // recovered address of the user who signed this message. This is how we manage to shim
// account abstraction even though the user isn't a contract. // account abstraction even though the user isn't a contract.
// Need to make sure that the transaction nonce is right and bump it if so.
require( require(
Lib_ECDSAUtils.recover( transaction.sender() == address(this),
_transaction,
isEthSign,
_v,
_r,
_s
) == address(this),
"Signature provided for EOA transaction execution is invalid." "Signature provided for EOA transaction execution is invalid."
); );
Lib_OVMCodec.EIP155Transaction memory decodedTx = Lib_OVMCodec.decodeEIP155Transaction(
_transaction,
isEthSign
);
// Grab the chain ID of the current network.
uint256 chainId;
assembly {
chainId := chainid()
}
// Need to make sure that the transaction chainId is correct.
require(
decodedTx.chainId == chainId,
"Transaction chainId does not match expected OVM chainId."
);
// Need to make sure that the transaction nonce is right. // Need to make sure that the transaction nonce is right.
require( require(
decodedTx.nonce == Lib_ExecutionManagerWrapper.ovmGETNONCE(), transaction.nonce == Lib_ExecutionManagerWrapper.ovmGETNONCE(),
"Transaction nonce does not match the expected nonce." "Transaction nonce does not match the expected nonce."
); );
// TEMPORARY: Disable gas checks for mainnet. // TEMPORARY: Disable gas checks for mainnet.
// // Need to make sure that the gas is sufficient to execute the transaction. // // Need to make sure that the gas is sufficient to execute the transaction.
// require( // require(
// gasleft() >= SafeMath.add(decodedTx.gasLimit, EXECUTION_VALIDATION_GAS_OVERHEAD), // gasleft() >= SafeMath.add(transaction.gasLimit, EXECUTION_VALIDATION_GAS_OVERHEAD),
// "Gas is not sufficient to execute the transaction." // "Gas is not sufficient to execute the transaction."
// ); // );
...@@ -117,15 +95,21 @@ contract OVM_ECDSAContractAccount is iOVM_ECDSAContractAccount { ...@@ -117,15 +95,21 @@ contract OVM_ECDSAContractAccount is iOVM_ECDSAContractAccount {
require( require(
ovmETH.transfer( ovmETH.transfer(
msg.sender, msg.sender,
SafeMath.mul(decodedTx.gasLimit, decodedTx.gasPrice) SafeMath.mul(transaction.gasLimit, transaction.gasPrice)
), ),
"Fee was not transferred to relayer." "Fee was not transferred to relayer."
); );
// Contract creations are signalled by sending a transaction to the zero address. // Contract creations are signalled by sending a transaction to the zero address.
if (decodedTx.to == address(0)) { if (transaction.isCreate) {
// TEMPORARY: Disable value transfer for contract creations.
require(
transaction.value == 0,
"Value transfer in contract creation not supported."
);
(address created, bytes memory revertdata) = Lib_ExecutionManagerWrapper.ovmCREATE( (address created, bytes memory revertdata) = Lib_ExecutionManagerWrapper.ovmCREATE(
decodedTx.data transaction.data
); );
// Return true if the contract creation succeeded, false w/ revertdata otherwise. // Return true if the contract creation succeeded, false w/ revertdata otherwise.
...@@ -140,7 +124,25 @@ contract OVM_ECDSAContractAccount is iOVM_ECDSAContractAccount { ...@@ -140,7 +124,25 @@ contract OVM_ECDSAContractAccount is iOVM_ECDSAContractAccount {
// cases, but since this is a contract we'd end up bumping the nonce twice. // cases, but since this is a contract we'd end up bumping the nonce twice.
Lib_ExecutionManagerWrapper.ovmINCREMENTNONCE(); Lib_ExecutionManagerWrapper.ovmINCREMENTNONCE();
return decodedTx.to.call(decodedTx.data); // Value transfer currently only supported for CALL but not for CREATE.
if (transaction.value > 0) {
// TEMPORARY: Block value transfer if the transaction has input data.
require(
transaction.data.length == 0,
"Value is nonzero but input data was provided."
);
require(
ovmETH.transfer(
transaction.to,
transaction.value
),
"Value could not be transferred to recipient."
);
return (true, bytes(""));
} else {
return transaction.to.call(transaction.data);
}
} }
} }
} }
...@@ -16,12 +16,21 @@ import { Lib_Bytes32Utils } from "../../libraries/utils/Lib_Bytes32Utils.sol"; ...@@ -16,12 +16,21 @@ import { Lib_Bytes32Utils } from "../../libraries/utils/Lib_Bytes32Utils.sol";
*/ */
contract OVM_ProxyEOA { contract OVM_ProxyEOA {
/**********
* Events *
**********/
event Upgraded(
address indexed implementation
);
/************* /*************
* Constants * * Constants *
*************/ *************/
address constant DEFAULT_IMPLEMENTATION = 0x4200000000000000000000000000000000000003; address constant DEFAULT_IMPLEMENTATION = 0x4200000000000000000000000000000000000003;
bytes32 constant IMPLEMENTATION_KEY = 0xdeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddead; bytes32 constant IMPLEMENTATION_KEY = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; //bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1);
/********************* /*********************
...@@ -68,6 +77,7 @@ contract OVM_ProxyEOA { ...@@ -68,6 +77,7 @@ contract OVM_ProxyEOA {
); );
_setImplementation(_implementation); _setImplementation(_implementation);
emit Upgraded(_implementation);
} }
/** /**
......
...@@ -174,4 +174,25 @@ contract OVM_L1ETHGateway is iOVM_L1ETHGateway, OVM_CrossDomainEnabled, Lib_Addr ...@@ -174,4 +174,25 @@ contract OVM_L1ETHGateway is iOVM_L1ETHGateway, OVM_CrossDomainEnabled, Lib_Addr
(bool success, ) = _to.call{value: _value}(new bytes(0)); (bool success, ) = _to.call{value: _value}(new bytes(0));
require(success, 'TransferHelper::safeTransferETH: ETH transfer failed'); require(success, 'TransferHelper::safeTransferETH: ETH transfer failed');
} }
/*****************************
* Temporary - Migrating ETH *
*****************************/
/**
* @dev Migrates entire ETH balance to another gateway
* @param _to Gateway Proxy address to migrate ETH to
*/
function migrateEth(address payable _to) external {
address owner = Lib_AddressManager(libAddressManager).owner();
require(msg.sender == owner, "Only the owner can migrate ETH");
uint256 balance = address(this).balance;
OVM_L1ETHGateway(_to).donateETH{value:balance}();
}
/**
* @dev Adds ETH balance to the account. This is meant to allow for ETH
* to be migrated from an old gateway to a new gateway
*/
function donateETH() external payable {}
} }
...@@ -162,11 +162,14 @@ contract OVM_ExecutionManager is iOVM_ExecutionManager, Lib_AddressResolver { ...@@ -162,11 +162,14 @@ contract OVM_ExecutionManager is iOVM_ExecutionManager, Lib_AddressResolver {
) )
override override
external external
returns (
bytes memory
)
{ {
// Make sure that run() is not re-enterable. This condition should always be satisfied // Make sure that run() is not re-enterable. This condition should always be satisfied
// Once run has been called once, due to the behavior of _isValidInput(). // Once run has been called once, due to the behavior of _isValidInput().
if (transactionContext.ovmNUMBER != DEFAULT_UINT256) { if (transactionContext.ovmNUMBER != DEFAULT_UINT256) {
return; return bytes("");
} }
// Store our OVM_StateManager instance (significantly easier than attempting to pass the // Store our OVM_StateManager instance (significantly easier than attempting to pass the
...@@ -194,7 +197,7 @@ contract OVM_ExecutionManager is iOVM_ExecutionManager, Lib_AddressResolver { ...@@ -194,7 +197,7 @@ contract OVM_ExecutionManager is iOVM_ExecutionManager, Lib_AddressResolver {
// reverts for INVALID_STATE_ACCESS. // reverts for INVALID_STATE_ACCESS.
if (_isValidInput(_transaction) == false) { if (_isValidInput(_transaction) == false) {
_resetContext(); _resetContext();
return; return bytes("");
} }
// TEMPORARY: Gas metering is disabled for minnet. // TEMPORARY: Gas metering is disabled for minnet.
...@@ -202,7 +205,7 @@ contract OVM_ExecutionManager is iOVM_ExecutionManager, Lib_AddressResolver { ...@@ -202,7 +205,7 @@ contract OVM_ExecutionManager is iOVM_ExecutionManager, Lib_AddressResolver {
// uint256 gasProvided = gasleft(); // uint256 gasProvided = gasleft();
// Run the transaction, make sure to meter the gas usage. // Run the transaction, make sure to meter the gas usage.
ovmCALL( (, bytes memory returndata) = ovmCALL(
_transaction.gasLimit - gasMeterConfig.minTransactionGasLimit, _transaction.gasLimit - gasMeterConfig.minTransactionGasLimit,
_transaction.entrypoint, _transaction.entrypoint,
_transaction.data _transaction.data
...@@ -215,6 +218,8 @@ contract OVM_ExecutionManager is iOVM_ExecutionManager, Lib_AddressResolver { ...@@ -215,6 +218,8 @@ contract OVM_ExecutionManager is iOVM_ExecutionManager, Lib_AddressResolver {
// Wipe the execution context. // Wipe the execution context.
_resetContext(); _resetContext();
return returndata;
} }
...@@ -1877,7 +1882,6 @@ contract OVM_ExecutionManager is iOVM_ExecutionManager, Lib_AddressResolver { ...@@ -1877,7 +1882,6 @@ contract OVM_ExecutionManager is iOVM_ExecutionManager, Lib_AddressResolver {
) )
external external
returns ( returns (
bool,
bytes memory bytes memory
) )
{ {
...@@ -1894,18 +1898,19 @@ contract OVM_ExecutionManager is iOVM_ExecutionManager, Lib_AddressResolver { ...@@ -1894,18 +1898,19 @@ contract OVM_ExecutionManager is iOVM_ExecutionManager, Lib_AddressResolver {
if (isCreate) { if (isCreate) {
(address created, bytes memory revertData) = ovmCREATE(_transaction.data); (address created, bytes memory revertData) = ovmCREATE(_transaction.data);
if (created == address(0)) { if (created == address(0)) {
return (false, revertData); return abi.encode(false, revertData);
} else { } else {
// The eth_call RPC endpoint for to = undefined will return the deployed bytecode // The eth_call RPC endpoint for to = undefined will return the deployed bytecode
// in the success case, differing from standard create messages. // in the success case, differing from standard create messages.
return (true, Lib_EthUtils.getCode(created)); return abi.encode(true, Lib_EthUtils.getCode(created));
} }
} else { } else {
return ovmCALL( (bool success, bytes memory returndata) = ovmCALL(
_transaction.gasLimit, _transaction.gasLimit,
_transaction.entrypoint, _transaction.entrypoint,
_transaction.data _transaction.data
); );
return abi.encode(success, returndata);
} }
} }
} }
...@@ -2,13 +2,8 @@ ...@@ -2,13 +2,8 @@
// @unsupported: evm // @unsupported: evm
pragma solidity >0.5.0 <0.8.0; pragma solidity >0.5.0 <0.8.0;
/* Interface Imports */
import { iOVM_ECDSAContractAccount } from "../../iOVM/accounts/iOVM_ECDSAContractAccount.sol";
/* Library Imports */ /* Library Imports */
import { Lib_BytesUtils } from "../../libraries/utils/Lib_BytesUtils.sol"; import { Lib_EIP155Tx } from "../../libraries/codec/Lib_EIP155Tx.sol";
import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
import { Lib_ECDSAUtils } from "../../libraries/utils/Lib_ECDSAUtils.sol";
import { Lib_ExecutionManagerWrapper } from "../../libraries/wrappers/Lib_ExecutionManagerWrapper.sol"; import { Lib_ExecutionManagerWrapper } from "../../libraries/wrappers/Lib_ExecutionManagerWrapper.sol";
/** /**
...@@ -16,22 +11,16 @@ import { Lib_ExecutionManagerWrapper } from "../../libraries/wrappers/Lib_Execut ...@@ -16,22 +11,16 @@ import { Lib_ExecutionManagerWrapper } from "../../libraries/wrappers/Lib_Execut
* @dev The Sequencer Entrypoint is a predeploy which, despite its name, can in fact be called by * @dev The Sequencer Entrypoint is a predeploy which, despite its name, can in fact be called by
* any account. It accepts a more efficient compressed calldata format, which it decompresses and * any account. It accepts a more efficient compressed calldata format, which it decompresses and
* encodes to the standard EIP155 transaction format. * encodes to the standard EIP155 transaction format.
* This contract is the implementation referenced by the Proxy Sequencer Entrypoint, thus enabling
* the Optimism team to upgrade the decompression of calldata from the Sequencer.
*
* Compiler used: optimistic-solc * Compiler used: optimistic-solc
* Runtime target: OVM * Runtime target: OVM
*/ */
contract OVM_SequencerEntrypoint { contract OVM_SequencerEntrypoint {
/********* /*************
* Enums * * Libraries *
*********/ *************/
enum TransactionType { using Lib_EIP155Tx for Lib_EIP155Tx.EIP155Tx;
NATIVE_ETH_TRANSACTION,
ETH_SIGNED_MESSAGE
}
/********************* /*********************
...@@ -39,104 +28,56 @@ contract OVM_SequencerEntrypoint { ...@@ -39,104 +28,56 @@ contract OVM_SequencerEntrypoint {
*********************/ *********************/
/** /**
* Uses a custom "compressed" format to save on calldata gas: * Expects an RLP-encoded EIP155 transaction as input. See the EIP for a more detailed
* calldata[00:01]: transaction type (0 == EIP 155, 2 == Eth Sign Message) * description of this transaction format:
* calldata[01:33]: signature "r" parameter * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md
* calldata[33:65]: signature "s" parameter
* calldata[65:66]: signature "v" parameter
* calldata[66:69]: transaction gas limit
* calldata[69:72]: transaction gas price
* calldata[72:75]: transaction nonce
* calldata[75:95]: transaction target address
* calldata[95:XX]: transaction data
*/ */
fallback() fallback()
external external
{ {
TransactionType transactionType = _getTransactionType(Lib_BytesUtils.toUint8(msg.data, 0)); // We use this twice, so it's more gas efficient to store a copy of it (barely).
bytes memory encodedTx = msg.data;
bytes32 r = Lib_BytesUtils.toBytes32(Lib_BytesUtils.slice(msg.data, 1, 32));
bytes32 s = Lib_BytesUtils.toBytes32(Lib_BytesUtils.slice(msg.data, 33, 32));
uint8 v = Lib_BytesUtils.toUint8(msg.data, 65);
// Remainder is the transaction to execute.
bytes memory compressedTx = Lib_BytesUtils.slice(msg.data, 66);
bool isEthSignedMessage = transactionType == TransactionType.ETH_SIGNED_MESSAGE;
// Grab the chain ID for the current network.
uint256 chainId;
assembly {
chainId := chainid()
}
// Need to decompress and then re-encode the transaction based on the original encoding. // Decode the tx with the correct chain ID.
bytes memory encodedTx = Lib_OVMCodec.encodeEIP155Transaction( Lib_EIP155Tx.EIP155Tx memory transaction = Lib_EIP155Tx.decode(
Lib_OVMCodec.decompressEIP155Transaction(
compressedTx,
chainId
),
isEthSignedMessage
);
address target = Lib_ECDSAUtils.recover(
encodedTx, encodedTx,
isEthSignedMessage, Lib_ExecutionManagerWrapper.ovmCHAINID()
v,
r,
s
); );
// Value is computed on the fly. Keep it in the stack to save some gas.
address target = transaction.sender();
bool isEmptyContract; bool isEmptyContract;
assembly { assembly {
isEmptyContract := iszero(extcodesize(target)) isEmptyContract := iszero(extcodesize(target))
} }
// If the account is empty, deploy the default EOA to that address.
if (isEmptyContract) { if (isEmptyContract) {
// ProxyEOA has not yet been deployed for this EOA. Lib_ExecutionManagerWrapper.ovmCREATEEOA(
bytes32 messageHash = Lib_ECDSAUtils.getMessageHash(encodedTx, isEthSignedMessage); transaction.hash(),
Lib_ExecutionManagerWrapper.ovmCREATEEOA(messageHash, v, r, s); transaction.recoveryParam,
transaction.r,
transaction.s
);
} }
Lib_OVMCodec.EOASignatureType sigtype; // Forward the transaction over to the EOA.
if (isEthSignedMessage) { (bool success, bytes memory returndata) = target.call(
sigtype = Lib_OVMCodec.EOASignatureType.ETH_SIGNED_MESSAGE; abi.encodeWithSignature(
} else { "execute(bytes)",
sigtype = Lib_OVMCodec.EOASignatureType.EIP155_TRANSACTION; encodedTx
} )
iOVM_ECDSAContractAccount(target).execute(
encodedTx,
sigtype,
v,
r,
s
); );
}
if (success) {
/********************** assembly {
* Internal Functions * return(add(returndata, 0x20), mload(returndata))
**********************/ }
/**
* Converts a uint256 into a TransactionType enum.
* @param _transactionType Transaction type index.
* @return _txType Transaction type enum value.
*/
function _getTransactionType(
uint8 _transactionType
)
internal
returns (
TransactionType _txType
)
{
if (_transactionType == 0) {
return TransactionType.NATIVE_ETH_TRANSACTION;
} if (_transactionType == 2) {
return TransactionType.ETH_SIGNED_MESSAGE;
} else { } else {
revert("Transaction type must be 0 or 2"); assembly {
revert(add(returndata, 0x20), mload(returndata))
}
} }
} }
} }
...@@ -15,10 +15,11 @@ interface iOVM_ECDSAContractAccount { ...@@ -15,10 +15,11 @@ interface iOVM_ECDSAContractAccount {
********************/ ********************/
function execute( function execute(
bytes memory _transaction, bytes memory _encodedTransaction
Lib_OVMCodec.EOASignatureType _signatureType, )
uint8 _v, external
bytes32 _r, returns (
bytes32 _s bool,
) external returns (bool _success, bytes memory _returndata); bytes memory
);
} }
...@@ -75,7 +75,7 @@ interface iOVM_ExecutionManager { ...@@ -75,7 +75,7 @@ interface iOVM_ExecutionManager {
function run( function run(
Lib_OVMCodec.Transaction calldata _transaction, Lib_OVMCodec.Transaction calldata _transaction,
address _txStateManager address _txStateManager
) external; ) external returns (bytes memory);
/******************* /*******************
......
// SPDX-License-Identifier: MIT
pragma solidity >0.5.0 <0.8.0;
pragma experimental ABIEncoderV2;
/* Library Imports */
import { Lib_RLPReader } from "../rlp/Lib_RLPReader.sol";
import { Lib_RLPWriter } from "../rlp/Lib_RLPWriter.sol";
/**
* @title Lib_EIP155Tx
* @dev A simple library for dealing with the transaction type defined by EIP155:
* https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md
*/
library Lib_EIP155Tx {
/***********
* Structs *
***********/
// Struct representing an EIP155 transaction. See EIP link above for more information.
struct EIP155Tx {
// These fields correspond to the actual RLP-encoded fields specified by EIP155.
uint256 nonce;
uint256 gasPrice;
uint256 gasLimit;
address to;
uint256 value;
bytes data;
uint8 v;
bytes32 r;
bytes32 s;
// Chain ID to associate this transaction with. Used all over the place, seemed easier to
// set this once when we create the transaction rather than providing it as an input to
// each function. I don't see a strong need to have a transaction with a mutable chain ID.
uint256 chainId;
// The ECDSA "recovery parameter," should always be 0 or 1. EIP155 specifies that:
// `v = {0,1} + CHAIN_ID * 2 + 35`
// Where `{0,1}` is a stand in for our `recovery_parameter`. Now computing our formula for
// the recovery parameter:
// 1. `v = {0,1} + CHAIN_ID * 2 + 35`
// 2. `v = recovery_parameter + CHAIN_ID * 2 + 35`
// 3. `v - CHAIN_ID * 2 - 35 = recovery_parameter`
// So we're left with the final formula:
// `recovery_parameter = v - CHAIN_ID * 2 - 35`
// NOTE: This variable is a uint8 because `v` is inherently limited to a uint8. If we
// didn't use a uint8, then recovery_parameter would always be a negative number for chain
// IDs greater than 110 (`255 - 110 * 2 - 35 = 0`). So we need to wrap around to support
// anything larger.
uint8 recoveryParam;
// Whether or not the transaction is a creation. Necessary because we can't make an address
// "nil". Using the zero address creates a potential conflict if the user did actually
// intend to send a transaction to the zero address.
bool isCreate;
}
// Lets us use nicer syntax.
using Lib_EIP155Tx for EIP155Tx;
/**********************
* Internal Functions *
**********************/
/**
* Decodes an EIP155 transaction and attaches a given Chain ID.
* Transaction *must* be RLP-encoded.
* @param _encoded RLP-encoded EIP155 transaction.
* @param _chainId Chain ID to assocaite with this transaction.
* @return Parsed transaction.
*/
function decode(
bytes memory _encoded,
uint256 _chainId
)
internal
pure
returns (
EIP155Tx memory
)
{
Lib_RLPReader.RLPItem[] memory decoded = Lib_RLPReader.readList(_encoded);
// Note formula above about how recoveryParam is computed.
uint8 v = uint8(Lib_RLPReader.readUint256(decoded[6]));
uint8 recoveryParam = uint8(v - 2 * _chainId - 35);
// Recovery param being anything other than 0 or 1 indicates that we have the wrong chain
// ID.
require(
recoveryParam < 2,
"Lib_EIP155Tx: Transaction signed with wrong chain ID"
);
// Creations can be detected by looking at the byte length here.
bool isCreate = Lib_RLPReader.readBytes(decoded[3]).length == 0;
return EIP155Tx({
nonce: Lib_RLPReader.readUint256(decoded[0]),
gasPrice: Lib_RLPReader.readUint256(decoded[1]),
gasLimit: Lib_RLPReader.readUint256(decoded[2]),
to: Lib_RLPReader.readAddress(decoded[3]),
value: Lib_RLPReader.readUint256(decoded[4]),
data: Lib_RLPReader.readBytes(decoded[5]),
v: v,
r: Lib_RLPReader.readBytes32(decoded[7]),
s: Lib_RLPReader.readBytes32(decoded[8]),
chainId: _chainId,
recoveryParam: recoveryParam,
isCreate: isCreate
});
}
/**
* Encodes an EIP155 transaction into RLP.
* @param _transaction EIP155 transaction to encode.
* @param _includeSignature Whether or not to encode the signature.
* @return RLP-encoded transaction.
*/
function encode(
EIP155Tx memory _transaction,
bool _includeSignature
)
internal
pure
returns (
bytes memory
)
{
bytes[] memory raw = new bytes[](9);
raw[0] = Lib_RLPWriter.writeUint(_transaction.nonce);
raw[1] = Lib_RLPWriter.writeUint(_transaction.gasPrice);
raw[2] = Lib_RLPWriter.writeUint(_transaction.gasLimit);
// We write the encoding of empty bytes when the transaction is a creation, *not* the zero
// address as one might assume.
if (_transaction.isCreate) {
raw[3] = Lib_RLPWriter.writeBytes('');
} else {
raw[3] = Lib_RLPWriter.writeAddress(_transaction.to);
}
raw[4] = Lib_RLPWriter.writeUint(_transaction.value);
raw[5] = Lib_RLPWriter.writeBytes(_transaction.data);
if (_includeSignature) {
raw[6] = Lib_RLPWriter.writeUint(_transaction.v);
raw[7] = Lib_RLPWriter.writeBytes32(_transaction.r);
raw[8] = Lib_RLPWriter.writeBytes32(_transaction.s);
} else {
// Chain ID *is* included in the unsigned transaction.
raw[6] = Lib_RLPWriter.writeUint(_transaction.chainId);
raw[7] = Lib_RLPWriter.writeBytes('');
raw[8] = Lib_RLPWriter.writeBytes('');
}
return Lib_RLPWriter.writeList(raw);
}
/**
* Computes the hash of an EIP155 transaction. Assumes that you don't want to include the
* signature in this hash because that's a very uncommon usecase. If you really want to include
* the signature, just encode with the signature and take the hash yourself.
*/
function hash(
EIP155Tx memory _transaction
)
internal
pure
returns (
bytes32
)
{
return keccak256(
_transaction.encode(false)
);
}
/**
* Computes the sender of an EIP155 transaction.
* @param _transaction EIP155 transaction to get a sender for.
* @return Address corresponding to the private key that signed this transaction.
*/
function sender(
EIP155Tx memory _transaction
)
internal
pure
returns (
address
)
{
return ecrecover(
_transaction.hash(),
_transaction.recoveryParam + 27,
_transaction.r,
_transaction.s
);
}
}
...@@ -17,11 +17,6 @@ library Lib_OVMCodec { ...@@ -17,11 +17,6 @@ library Lib_OVMCodec {
* Enums * * Enums *
*********/ *********/
enum EOASignatureType {
EIP155_TRANSACTION,
ETH_SIGNED_MESSAGE
}
enum QueueOrigin { enum QueueOrigin {
SEQUENCER_QUEUE, SEQUENCER_QUEUE,
L1TOL2_QUEUE L1TOL2_QUEUE
...@@ -85,144 +80,11 @@ library Lib_OVMCodec { ...@@ -85,144 +80,11 @@ library Lib_OVMCodec {
uint40 blockNumber; uint40 blockNumber;
} }
struct EIP155Transaction {
uint256 nonce;
uint256 gasPrice;
uint256 gasLimit;
address to;
uint256 value;
bytes data;
uint256 chainId;
}
/********************** /**********************
* Internal Functions * * Internal Functions *
**********************/ **********************/
/**
* Decodes an EOA transaction (i.e., native Ethereum RLP encoding).
* @param _transaction Encoded EOA transaction.
* @return Transaction decoded into a struct.
*/
function decodeEIP155Transaction(
bytes memory _transaction,
bool _isEthSignedMessage
)
internal
pure
returns (
EIP155Transaction memory
)
{
if (_isEthSignedMessage) {
(
uint256 _nonce,
uint256 _gasLimit,
uint256 _gasPrice,
uint256 _chainId,
address _to,
bytes memory _data
) = abi.decode(
_transaction,
(uint256, uint256, uint256, uint256, address ,bytes)
);
return EIP155Transaction({
nonce: _nonce,
gasPrice: _gasPrice,
gasLimit: _gasLimit,
to: _to,
value: 0,
data: _data,
chainId: _chainId
});
} else {
Lib_RLPReader.RLPItem[] memory decoded = Lib_RLPReader.readList(_transaction);
return EIP155Transaction({
nonce: Lib_RLPReader.readUint256(decoded[0]),
gasPrice: Lib_RLPReader.readUint256(decoded[1]),
gasLimit: Lib_RLPReader.readUint256(decoded[2]),
to: Lib_RLPReader.readAddress(decoded[3]),
value: Lib_RLPReader.readUint256(decoded[4]),
data: Lib_RLPReader.readBytes(decoded[5]),
chainId: Lib_RLPReader.readUint256(decoded[6])
});
}
}
/**
* Decompresses a compressed EIP155 transaction.
* @param _transaction Compressed EIP155 transaction bytes.
* @param _chainId Chain ID this transaction was signed with.
* @return Transaction parsed into a struct.
*/
function decompressEIP155Transaction(
bytes memory _transaction,
uint256 _chainId
)
internal
returns (
EIP155Transaction memory
)
{
return EIP155Transaction({
gasLimit: Lib_BytesUtils.toUint24(_transaction, 0),
gasPrice: uint256(Lib_BytesUtils.toUint24(_transaction, 3)) * 1000000,
nonce: Lib_BytesUtils.toUint24(_transaction, 6),
to: Lib_BytesUtils.toAddress(_transaction, 9),
data: Lib_BytesUtils.slice(_transaction, 29),
chainId: _chainId,
value: 0
});
}
/**
* Encodes an EOA transaction back into the original transaction.
* @param _transaction EIP155transaction to encode.
* @param _isEthSignedMessage Whether or not this was an eth signed message.
* @return Encoded transaction.
*/
function encodeEIP155Transaction(
EIP155Transaction memory _transaction,
bool _isEthSignedMessage
)
internal
pure
returns (
bytes memory
)
{
if (_isEthSignedMessage) {
return abi.encode(
_transaction.nonce,
_transaction.gasLimit,
_transaction.gasPrice,
_transaction.chainId,
_transaction.to,
_transaction.data
);
} else {
bytes[] memory raw = new bytes[](9);
raw[0] = Lib_RLPWriter.writeUint(_transaction.nonce);
raw[1] = Lib_RLPWriter.writeUint(_transaction.gasPrice);
raw[2] = Lib_RLPWriter.writeUint(_transaction.gasLimit);
if (_transaction.to == address(0)) {
raw[3] = Lib_RLPWriter.writeBytes('');
} else {
raw[3] = Lib_RLPWriter.writeAddress(_transaction.to);
}
raw[4] = Lib_RLPWriter.writeUint(0);
raw[5] = Lib_RLPWriter.writeBytes(_transaction.data);
raw[6] = Lib_RLPWriter.writeUint(_transaction.chainId);
raw[7] = Lib_RLPWriter.writeBytes(bytes(''));
raw[8] = Lib_RLPWriter.writeBytes(bytes(''));
return Lib_RLPWriter.writeList(raw);
}
}
/** /**
* Encodes a standard OVM transaction. * Encodes a standard OVM transaction.
* @param _transaction OVM transaction to encode. * @param _transaction OVM transaction to encode.
......
...@@ -89,6 +89,23 @@ library Lib_RLPWriter { ...@@ -89,6 +89,23 @@ library Lib_RLPWriter {
return writeBytes(abi.encodePacked(_in)); return writeBytes(abi.encodePacked(_in));
} }
/**
* RLP encodes a bytes32 value.
* @param _in The bytes32 to encode.
* @return _out The RLP encoded bytes32 in bytes.
*/
function writeBytes32(
bytes32 _in
)
internal
pure
returns (
bytes memory _out
)
{
return writeBytes(abi.encodePacked(_in));
}
/** /**
* RLP encodes a uint. * RLP encodes a uint.
* @param _in The uint256 to encode. * @param _in The uint256 to encode.
......
// SPDX-License-Identifier: MIT
pragma solidity >0.5.0 <0.8.0;
/**
* @title Lib_ECDSAUtils
*/
library Lib_ECDSAUtils {
/**************************************
* Internal Functions: ECDSA Recovery *
**************************************/
/**
* Recovers a signed address given a message and signature.
* @param _message Message that was originally signed.
* @param _isEthSignedMessage Whether or not the user used the `Ethereum Signed Message` prefix.
* @param _v Signature `v` parameter.
* @param _r Signature `r` parameter.
* @param _s Signature `s` parameter.
* @return _sender Signer address.
*/
function recover(
bytes memory _message,
bool _isEthSignedMessage,
uint8 _v,
bytes32 _r,
bytes32 _s
)
internal
pure
returns (
address _sender
)
{
bytes32 messageHash = getMessageHash(_message, _isEthSignedMessage);
return ecrecover(
messageHash,
_v + 27,
_r,
_s
);
}
function getMessageHash(
bytes memory _message,
bool _isEthSignedMessage
)
internal
pure
returns (bytes32) {
if (_isEthSignedMessage) {
return getEthSignedMessageHash(_message);
}
return getNativeMessageHash(_message);
}
/*************************************
* Private Functions: ECDSA Recovery *
*************************************/
/**
* Gets the native message hash (simple keccak256) for a message.
* @param _message Message to hash.
* @return _messageHash Native message hash.
*/
function getNativeMessageHash(
bytes memory _message
)
private
pure
returns (
bytes32 _messageHash
)
{
return keccak256(_message);
}
/**
* Gets the hash of a message with the `Ethereum Signed Message` prefix.
* @param _message Message to hash.
* @return _messageHash Prefixed message hash.
*/
function getEthSignedMessageHash(
bytes memory _message
)
private
pure
returns (
bytes32 _messageHash
)
{
bytes memory prefix = "\x19Ethereum Signed Message:\n32";
bytes32 messageHash = keccak256(_message);
return keccak256(abi.encodePacked(prefix, messageHash));
}
}
\ No newline at end of file
...@@ -118,6 +118,25 @@ library Lib_ExecutionManagerWrapper { ...@@ -118,6 +118,25 @@ library Lib_ExecutionManagerWrapper {
return abi.decode(returndata, (address)); return abi.decode(returndata, (address));
} }
/**
* Calls the ovmCHAINID opcode.
* @return Chain ID of the current network.
*/
function ovmCHAINID()
internal
returns (
uint256
)
{
bytes memory returndata = _safeExecutionManagerInteraction(
abi.encodeWithSignature(
"ovmCHAINID()"
)
);
return abi.decode(returndata, (uint256));
}
/********************* /*********************
* Private Functions * * Private Functions *
......
// SPDX-License-Identifier: MIT
pragma solidity >0.5.0 <0.8.0;
pragma experimental ABIEncoderV2;
/* Library Imports */
import { Lib_EIP155Tx } from "../../optimistic-ethereum/libraries/codec/Lib_EIP155Tx.sol";
/**
* @title TestLib_EIP155Tx
*/
contract TestLib_EIP155Tx {
function decode(
bytes memory _encoded,
uint256 _chainId
)
public
pure
returns (
Lib_EIP155Tx.EIP155Tx memory
)
{
return Lib_EIP155Tx.decode(
_encoded,
_chainId
);
}
function encode(
Lib_EIP155Tx.EIP155Tx memory _transaction,
bool _includeSignature
)
public
pure
returns (
bytes memory
)
{
return Lib_EIP155Tx.encode(
_transaction,
_includeSignature
);
}
function hash(
Lib_EIP155Tx.EIP155Tx memory _transaction
)
public
pure
returns (
bytes32
)
{
return Lib_EIP155Tx.hash(
_transaction
);
}
function sender(
Lib_EIP155Tx.EIP155Tx memory _transaction
)
public
pure
returns (
address
)
{
return Lib_EIP155Tx.sender(
_transaction
);
}
}
...@@ -9,20 +9,6 @@ import { Lib_OVMCodec } from "../../optimistic-ethereum/libraries/codec/Lib_OVMC ...@@ -9,20 +9,6 @@ import { Lib_OVMCodec } from "../../optimistic-ethereum/libraries/codec/Lib_OVMC
* @title TestLib_OVMCodec * @title TestLib_OVMCodec
*/ */
contract TestLib_OVMCodec { contract TestLib_OVMCodec {
function decodeEIP155Transaction(
bytes memory _transaction,
bool _isEthSignedMessage
)
public
pure
returns (
Lib_OVMCodec.EIP155Transaction memory _decoded
)
{
return Lib_OVMCodec.decodeEIP155Transaction(_transaction, _isEthSignedMessage);
}
function encodeTransaction( function encodeTransaction(
Lib_OVMCodec.Transaction memory _transaction Lib_OVMCodec.Transaction memory _transaction
) )
...@@ -46,19 +32,4 @@ contract TestLib_OVMCodec { ...@@ -46,19 +32,4 @@ contract TestLib_OVMCodec {
{ {
return Lib_OVMCodec.hashTransaction(_transaction); return Lib_OVMCodec.hashTransaction(_transaction);
} }
function decompressEIP155Transaction(
bytes memory _transaction,
uint256 _chainId
)
public
returns (
Lib_OVMCodec.EIP155Transaction memory _decompressed
)
{
return Lib_OVMCodec.decompressEIP155Transaction(
_transaction,
_chainId
);
}
} }
// SPDX-License-Identifier: MIT
pragma solidity >0.5.0 <0.8.0;
/* Library Imports */
import { Lib_ECDSAUtils } from "../../optimistic-ethereum/libraries/utils/Lib_ECDSAUtils.sol";
/**
* @title TestLib_ECDSAUtils
*/
contract TestLib_ECDSAUtils {
function recover(
bytes memory _message,
bool _isEthSignedMessage,
uint8 _v,
bytes32 _r,
bytes32 _s
)
public
pure
returns (
address _sender
)
{
return Lib_ECDSAUtils.recover(
_message,
_isEthSignedMessage,
_v,
_r,
_s
);
}
}
...@@ -49,6 +49,7 @@ Network : __mainnet (chain id: 1)__ ...@@ -49,6 +49,7 @@ Network : __mainnet (chain id: 1)__
|Proxy__OVM_L1ETHGateway|[0xF20C38fCdDF0C790319Fd7431d17ea0c2bC9959c](https://etherscan.io/address/0xF20C38fCdDF0C790319Fd7431d17ea0c2bC9959c)| |Proxy__OVM_L1ETHGateway|[0xF20C38fCdDF0C790319Fd7431d17ea0c2bC9959c](https://etherscan.io/address/0xF20C38fCdDF0C790319Fd7431d17ea0c2bC9959c)|
|mockOVM_BondManager|[0x99EDa8472E93Aa28E5470eEDEc6e32081E14DaFC](https://etherscan.io/address/0x99EDa8472E93Aa28E5470eEDEc6e32081E14DaFC)| |mockOVM_BondManager|[0x99EDa8472E93Aa28E5470eEDEc6e32081E14DaFC](https://etherscan.io/address/0x99EDa8472E93Aa28E5470eEDEc6e32081E14DaFC)|
--- ---
## KOVAN ## KOVAN
Network : __kovan (chain id: 42)__ Network : __kovan (chain id: 42)__
...@@ -72,4 +73,3 @@ Network : __kovan (chain id: 42)__ ...@@ -72,4 +73,3 @@ Network : __kovan (chain id: 42)__
|Proxy__OVM_L1CrossDomainMessenger|[0x48062eD9b6488EC41c4CfbF2f568D7773819d8C9](https://kovan.etherscan.io/address/0x48062eD9b6488EC41c4CfbF2f568D7773819d8C9)| |Proxy__OVM_L1CrossDomainMessenger|[0x48062eD9b6488EC41c4CfbF2f568D7773819d8C9](https://kovan.etherscan.io/address/0x48062eD9b6488EC41c4CfbF2f568D7773819d8C9)|
|Proxy__OVM_L1ETHGateway|[0xf3902e50dA095bD2e954AB320E8eafDA6152dFDa](https://kovan.etherscan.io/address/0xf3902e50dA095bD2e954AB320E8eafDA6152dFDa)| |Proxy__OVM_L1ETHGateway|[0xf3902e50dA095bD2e954AB320E8eafDA6152dFDa](https://kovan.etherscan.io/address/0xf3902e50dA095bD2e954AB320E8eafDA6152dFDa)|
|mockOVM_BondManager|[0x77e244ec49014cFb9c4572453568eCC3AbB70A2d](https://kovan.etherscan.io/address/0x77e244ec49014cFb9c4572453568eCC3AbB70A2d)| |mockOVM_BondManager|[0x77e244ec49014cFb9c4572453568eCC3AbB70A2d](https://kovan.etherscan.io/address/0x77e244ec49014cFb9c4572453568eCC3AbB70A2d)|
---
{
"address": "0xE3d08F0D900A2D53cB794cf82d7127764BcC3092",
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "string",
"name": "_name",
"type": "string"
},
{
"indexed": false,
"internalType": "address",
"name": "_newAddress",
"type": "address"
}
],
"name": "AddressSet",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"inputs": [
{
"internalType": "string",
"name": "_name",
"type": "string"
}
],
"name": "getAddress",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "_name",
"type": "string"
},
{
"internalType": "address",
"name": "_address",
"type": "address"
}
],
"name": "setAddress",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"transactionHash": "0x8449a49f743929a260b94925095e1a7a33d42a5a58a92910e6ac9aa7b309ec67",
"receipt": {
"to": null,
"from": "0x4107438C1b1579f258AF9d1AC06194C4a0F55040",
"contractAddress": "0xE3d08F0D900A2D53cB794cf82d7127764BcC3092",
"transactionIndex": 14,
"gasUsed": "427277",
"logsBloom": "0x00000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000010000000000000000000000000002000000000000000000000000000001000000000100000000000000000000000000020000000000000000000800000000000000000000000000000000400000000000000000000000000100000000000000000000000000000000000000000000000000000000000010000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000",
"blockHash": "0x8afc36c046678b1417a5f68af6d0c5ea406e27e7d485ebfd00a47420d00ab9fe",
"transactionHash": "0x8449a49f743929a260b94925095e1a7a33d42a5a58a92910e6ac9aa7b309ec67",
"logs": [
{
"transactionIndex": 14,
"blockNumber": 4694083,
"transactionHash": "0x8449a49f743929a260b94925095e1a7a33d42a5a58a92910e6ac9aa7b309ec67",
"address": "0xE3d08F0D900A2D53cB794cf82d7127764BcC3092",
"topics": [
"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000004107438c1b1579f258af9d1ac06194c4a0f55040"
],
"data": "0x",
"logIndex": 19,
"blockHash": "0x8afc36c046678b1417a5f68af6d0c5ea406e27e7d485ebfd00a47420d00ab9fe"
}
],
"blockNumber": 4694083,
"cumulativeGasUsed": "1932419",
"status": 1,
"byzantium": true
},
"args": [],
"solcInputHash": "dde656dd41f49cad9eac9bc7065fd6a7",
"metadata": "{\"compiler\":{\"version\":\"0.7.6+commit.7338295f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_newAddress\",\"type\":\"address\"}],\"name\":\"AddressSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"}],\"name\":\"getAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"setAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"getAddress(string)\":{\"params\":{\"_name\":\"Name to retrieve an address for.\"},\"returns\":{\"_0\":\"Address associated with the given name.\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setAddress(string,address)\":{\"params\":{\"_address\":\"Address to associate with the name.\",\"_name\":\"String name to associate an address with.\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"title\":\"Lib_AddressManager\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"getAddress(string)\":{\"notice\":\"Retrieves the address associated with a given name.\"},\"setAddress(string,address)\":{\"notice\":\"Changes the address associated with a particular name.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol\":\"Lib_AddressManager\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor () internal {\\n address msgSender = _msgSender();\\n _owner = msgSender;\\n emit OwnershipTransferred(address(0), msgSender);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x15e2d5bd4c28a88548074c54d220e8086f638a71ed07e6b3ba5a70066fcf458d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with GSN meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address payable) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes memory) {\\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x8d3cb350f04ff49cfb10aef08d87f19dcbaecc8027b0bed12f3275cd12f38cf0\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* External Imports */\\nimport { Ownable } from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\n/**\\n * @title Lib_AddressManager\\n */\\ncontract Lib_AddressManager is Ownable {\\n\\n /**********\\n * Events *\\n **********/\\n\\n event AddressSet(\\n string _name,\\n address _newAddress\\n );\\n\\n\\n /*************\\n * Variables *\\n *************/\\n\\n mapping (bytes32 => address) private addresses;\\n\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Changes the address associated with a particular name.\\n * @param _name String name to associate an address with.\\n * @param _address Address to associate with the name.\\n */\\n function setAddress(\\n string memory _name,\\n address _address\\n )\\n public\\n onlyOwner\\n {\\n addresses[_getNameHash(_name)] = _address;\\n\\n emit AddressSet(\\n _name,\\n _address\\n );\\n }\\n\\n /**\\n * Retrieves the address associated with a given name.\\n * @param _name Name to retrieve an address for.\\n * @return Address associated with the given name.\\n */\\n function getAddress(\\n string memory _name\\n )\\n public\\n view\\n returns (\\n address\\n )\\n {\\n return addresses[_getNameHash(_name)];\\n }\\n\\n\\n /**********************\\n * Internal Functions *\\n **********************/\\n\\n /**\\n * Computes the hash of a name.\\n * @param _name Name to compute a hash for.\\n * @return Hash of the given name.\\n */\\n function _getNameHash(\\n string memory _name\\n )\\n internal\\n pure\\n returns (\\n bytes32\\n )\\n {\\n return keccak256(abi.encodePacked(_name));\\n }\\n}\\n\",\"keccak256\":\"0x2ce671a0e004df88b136bea5a3c59d0732cea8887c8496da1d509e0200b03d7d\",\"license\":\"MIT\"}},\"version\":1}",
"bytecode": "0x608060405234801561001057600080fd5b50600061001b61006a565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35061006e565b3390565b6106508061007d6000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c8063715018a61461005c5780638da5cb5b146100665780639b2ea4bd1461008a578063bf40fac11461013b578063f2fde38b146101e1575b600080fd5b610064610207565b005b61006e6102c5565b604080516001600160a01b039092168252519081900360200190f35b610064600480360360408110156100a057600080fd5b8101906020810181356401000000008111156100bb57600080fd5b8201836020820111156100cd57600080fd5b803590602001918460018302840111640100000000831117156100ef57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550505090356001600160a01b031691506102d49050565b61006e6004803603602081101561015157600080fd5b81019060208101813564010000000081111561016c57600080fd5b82018360208201111561017e57600080fd5b803590602001918460018302840111640100000000831117156101a057600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610436945050505050565b610064600480360360208110156101f757600080fd5b50356001600160a01b0316610465565b61020f610579565b6001600160a01b03166102206102c5565b6001600160a01b03161461027b576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b6102dc610579565b6001600160a01b03166102ed6102c5565b6001600160a01b031614610348576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b80600160006103568561057d565b815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b031602179055507f188466739ff00cc68bfb2367d23ae4b855264264fe1624caa8884399af23454c82826040518080602001836001600160a01b03168152602001828103825284818151815260200191508051906020019080838360005b838110156103f75781810151838201526020016103df565b50505050905090810190601f1680156104245780820380516001836020036101000a031916815260200191505b50935050505060405180910390a15050565b6000600160006104458461057d565b81526020810191909152604001600020546001600160a01b031692915050565b61046d610579565b6001600160a01b031661047e6102c5565b6001600160a01b0316146104d9576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b03811661051e5760405162461bcd60e51b81526004018080602001828103825260268152602001806105f56026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b3390565b6000816040516020018082805190602001908083835b602083106105b25780518252601f199092019160209182019101610593565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405160208183030381529060405280519060200120905091905056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a26469706673582212209107a301dfba06b8649cc1baf4f5d6df1fb45110fdd8dc25d143490e81f3587e64736f6c63430007060033",
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100575760003560e01c8063715018a61461005c5780638da5cb5b146100665780639b2ea4bd1461008a578063bf40fac11461013b578063f2fde38b146101e1575b600080fd5b610064610207565b005b61006e6102c5565b604080516001600160a01b039092168252519081900360200190f35b610064600480360360408110156100a057600080fd5b8101906020810181356401000000008111156100bb57600080fd5b8201836020820111156100cd57600080fd5b803590602001918460018302840111640100000000831117156100ef57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550505090356001600160a01b031691506102d49050565b61006e6004803603602081101561015157600080fd5b81019060208101813564010000000081111561016c57600080fd5b82018360208201111561017e57600080fd5b803590602001918460018302840111640100000000831117156101a057600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610436945050505050565b610064600480360360208110156101f757600080fd5b50356001600160a01b0316610465565b61020f610579565b6001600160a01b03166102206102c5565b6001600160a01b03161461027b576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b6102dc610579565b6001600160a01b03166102ed6102c5565b6001600160a01b031614610348576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b80600160006103568561057d565b815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b031602179055507f188466739ff00cc68bfb2367d23ae4b855264264fe1624caa8884399af23454c82826040518080602001836001600160a01b03168152602001828103825284818151815260200191508051906020019080838360005b838110156103f75781810151838201526020016103df565b50505050905090810190601f1680156104245780820380516001836020036101000a031916815260200191505b50935050505060405180910390a15050565b6000600160006104458461057d565b81526020810191909152604001600020546001600160a01b031692915050565b61046d610579565b6001600160a01b031661047e6102c5565b6001600160a01b0316146104d9576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b03811661051e5760405162461bcd60e51b81526004018080602001828103825260268152602001806105f56026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b3390565b6000816040516020018082805190602001908083835b602083106105b25780518252601f199092019160209182019101610593565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405160208183030381529060405280519060200120905091905056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a26469706673582212209107a301dfba06b8649cc1baf4f5d6df1fb45110fdd8dc25d143490e81f3587e64736f6c63430007060033",
"devdoc": {
"kind": "dev",
"methods": {
"getAddress(string)": {
"params": {
"_name": "Name to retrieve an address for."
},
"returns": {
"_0": "Address associated with the given name."
}
},
"owner()": {
"details": "Returns the address of the current owner."
},
"renounceOwnership()": {
"details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner."
},
"setAddress(string,address)": {
"params": {
"_address": "Address to associate with the name.",
"_name": "String name to associate an address with."
}
},
"transferOwnership(address)": {
"details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner."
}
},
"title": "Lib_AddressManager",
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {
"getAddress(string)": {
"notice": "Retrieves the address associated with a given name."
},
"setAddress(string,address)": {
"notice": "Changes the address associated with a particular name."
}
},
"version": 1
},
"storageLayout": {
"storage": [
{
"astId": 7,
"contract": "contracts/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol:Lib_AddressManager",
"label": "_owner",
"offset": 0,
"slot": "0",
"type": "t_address"
},
{
"astId": 11992,
"contract": "contracts/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol:Lib_AddressManager",
"label": "addresses",
"offset": 0,
"slot": "1",
"type": "t_mapping(t_bytes32,t_address)"
}
],
"types": {
"t_address": {
"encoding": "inplace",
"label": "address",
"numberOfBytes": "20"
},
"t_bytes32": {
"encoding": "inplace",
"label": "bytes32",
"numberOfBytes": "32"
},
"t_mapping(t_bytes32,t_address)": {
"encoding": "mapping",
"key": "t_bytes32",
"label": "mapping(bytes32 => address)",
"numberOfBytes": "32",
"value": "t_address"
}
}
}
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"address": "0x7b439CD647b76F45252858C19093a53b4c5FD4B4",
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "_libAddressManager",
"type": "address"
},
{
"internalType": "string",
"name": "_owner",
"type": "string"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_index",
"type": "uint256"
},
{
"internalType": "bytes27",
"name": "_globalMetadata",
"type": "bytes27"
}
],
"name": "deleteElementsAfterInclusive",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_index",
"type": "uint256"
}
],
"name": "deleteElementsAfterInclusive",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_index",
"type": "uint256"
}
],
"name": "get",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getGlobalMetadata",
"outputs": [
{
"internalType": "bytes27",
"name": "",
"type": "bytes27"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "length",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "libAddressManager",
"outputs": [
{
"internalType": "contract Lib_AddressManager",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "_object",
"type": "bytes32"
},
{
"internalType": "bytes27",
"name": "_globalMetadata",
"type": "bytes27"
}
],
"name": "push",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "_object",
"type": "bytes32"
}
],
"name": "push",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "_name",
"type": "string"
}
],
"name": "resolve",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes27",
"name": "_globalMetadata",
"type": "bytes27"
}
],
"name": "setGlobalMetadata",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_index",
"type": "uint256"
}
],
"name": "setNextOverwritableIndex",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"transactionHash": "0xccaaa6192d2aa73dae4313be6a950378b1b5d86850e6494dec408f625a0713b3",
"receipt": {
"to": null,
"from": "0x4107438C1b1579f258AF9d1AC06194C4a0F55040",
"contractAddress": "0x7b439CD647b76F45252858C19093a53b4c5FD4B4",
"transactionIndex": 7,
"gasUsed": "970990",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blockHash": "0x0689af29938844183d2d0c03d93df4c01f711064da67936dc6b2b77310b729b6",
"transactionHash": "0xccaaa6192d2aa73dae4313be6a950378b1b5d86850e6494dec408f625a0713b3",
"logs": [],
"blockNumber": 4694091,
"cumulativeGasUsed": "2858675",
"status": 1,
"byzantium": true
},
"args": [
"0xE3d08F0D900A2D53cB794cf82d7127764BcC3092",
"OVM_CanonicalTransactionChain"
],
"solcInputHash": "dde656dd41f49cad9eac9bc7065fd6a7",
"metadata": "{\"compiler\":{\"version\":\"0.7.6+commit.7338295f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_libAddressManager\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_owner\",\"type\":\"string\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_index\",\"type\":\"uint256\"},{\"internalType\":\"bytes27\",\"name\":\"_globalMetadata\",\"type\":\"bytes27\"}],\"name\":\"deleteElementsAfterInclusive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_index\",\"type\":\"uint256\"}],\"name\":\"deleteElementsAfterInclusive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_index\",\"type\":\"uint256\"}],\"name\":\"get\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getGlobalMetadata\",\"outputs\":[{\"internalType\":\"bytes27\",\"name\":\"\",\"type\":\"bytes27\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"length\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"libAddressManager\",\"outputs\":[{\"internalType\":\"contract Lib_AddressManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_object\",\"type\":\"bytes32\"},{\"internalType\":\"bytes27\",\"name\":\"_globalMetadata\",\"type\":\"bytes27\"}],\"name\":\"push\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_object\",\"type\":\"bytes32\"}],\"name\":\"push\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes27\",\"name\":\"_globalMetadata\",\"type\":\"bytes27\"}],\"name\":\"setGlobalMetadata\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_index\",\"type\":\"uint256\"}],\"name\":\"setNextOverwritableIndex\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"The Chain Storage Container provides its owner contract with read, write and delete functionality. This provides gas efficiency gains by enabling it to overwrite storage slots which can no longer be used in a fraud proof due to the fraud window having passed, and the associated chain state or transactions being finalized. Three distinct Chain Storage Containers will be deployed on Layer 1: 1. Stores transaction batches for the Canonical Transaction Chain 2. Stores queued transactions for the Canonical Transaction Chain 3. Stores chain state batches for the State Commitment Chain Compiler used: solc Runtime target: EVM\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"params\":{\"_libAddressManager\":\"Address of the Address Manager.\",\"_owner\":\"Name of the contract that owns this container (will be resolved later).\"}},\"deleteElementsAfterInclusive(uint256)\":{\"params\":{\"_index\":\"Object index to delete from.\"}},\"deleteElementsAfterInclusive(uint256,bytes27)\":{\"params\":{\"_globalMetadata\":\"New global metadata for the container.\",\"_index\":\"Object index to delete from.\"}},\"get(uint256)\":{\"params\":{\"_index\":\"Index of the particular object to access.\"},\"returns\":{\"_0\":\"32 byte object value.\"}},\"getGlobalMetadata()\":{\"returns\":{\"_0\":\"Container global metadata field.\"}},\"length()\":{\"returns\":{\"_0\":\"Number of objects in the container.\"}},\"push(bytes32)\":{\"params\":{\"_object\":\"A 32 byte value to insert into the container.\"}},\"push(bytes32,bytes27)\":{\"params\":{\"_globalMetadata\":\"New global metadata for the container.\",\"_object\":\"A 32 byte value to insert into the container.\"}},\"resolve(string)\":{\"params\":{\"_name\":\"Name to resolve an address for.\"},\"returns\":{\"_0\":\"Address associated with the given name.\"}},\"setGlobalMetadata(bytes27)\":{\"params\":{\"_globalMetadata\":\"New global metadata to set.\"}}},\"title\":\"OVM_ChainStorageContainer\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"deleteElementsAfterInclusive(uint256)\":{\"notice\":\"Removes all objects after and including a given index.\"},\"deleteElementsAfterInclusive(uint256,bytes27)\":{\"notice\":\"Removes all objects after and including a given index. Also allows setting the global metadata field.\"},\"get(uint256)\":{\"notice\":\"Retrieves an object from the container.\"},\"getGlobalMetadata()\":{\"notice\":\"Retrieves the container's global metadata field.\"},\"length()\":{\"notice\":\"Retrieves the number of objects stored in the container.\"},\"push(bytes32)\":{\"notice\":\"Pushes an object into the container.\"},\"push(bytes32,bytes27)\":{\"notice\":\"Pushes an object into the container. Function allows setting the global metadata since we'll need to touch the \\\"length\\\" storage slot anyway, which also contains the global metadata (it's an optimization).\"},\"resolve(string)\":{\"notice\":\"Resolves the address associated with a given name.\"},\"setGlobalMetadata(bytes27)\":{\"notice\":\"Sets the container's global metadata field. We're using `bytes27` here because we use five bytes to maintain the length of the underlying data structure, meaning we have an extra 27 bytes to store arbitrary data.\"},\"setNextOverwritableIndex(uint256)\":{\"notice\":\"Marks an index as overwritable, meaing the underlying buffer can start to write values over any objects before and including the given index.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol\":\"OVM_ChainStorageContainer\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor () internal {\\n address msgSender = _msgSender();\\n _owner = msgSender;\\n emit OwnershipTransferred(address(0), msgSender);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x15e2d5bd4c28a88548074c54d220e8086f638a71ed07e6b3ba5a70066fcf458d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with GSN meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address payable) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes memory) {\\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x8d3cb350f04ff49cfb10aef08d87f19dcbaecc8027b0bed12f3275cd12f38cf0\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* Library Imports */\\nimport { Lib_RingBuffer } from \\\"../../libraries/utils/Lib_RingBuffer.sol\\\";\\nimport { Lib_AddressResolver } from \\\"../../libraries/resolver/Lib_AddressResolver.sol\\\";\\n\\n/* Interface Imports */\\nimport { iOVM_ChainStorageContainer } from \\\"../../iOVM/chain/iOVM_ChainStorageContainer.sol\\\";\\n\\n/**\\n * @title OVM_ChainStorageContainer\\n * @dev The Chain Storage Container provides its owner contract with read, write and delete functionality.\\n * This provides gas efficiency gains by enabling it to overwrite storage slots which can no longer be used\\n * in a fraud proof due to the fraud window having passed, and the associated chain state or\\n * transactions being finalized.\\n * Three distinct Chain Storage Containers will be deployed on Layer 1:\\n * 1. Stores transaction batches for the Canonical Transaction Chain\\n * 2. Stores queued transactions for the Canonical Transaction Chain\\n * 3. Stores chain state batches for the State Commitment Chain\\n *\\n * Compiler used: solc\\n * Runtime target: EVM\\n */\\ncontract OVM_ChainStorageContainer is iOVM_ChainStorageContainer, Lib_AddressResolver {\\n\\n /*************\\n * Libraries *\\n *************/\\n\\n using Lib_RingBuffer for Lib_RingBuffer.RingBuffer;\\n\\n\\n /*************\\n * Variables *\\n *************/\\n\\n string public owner;\\n Lib_RingBuffer.RingBuffer internal buffer;\\n\\n\\n /***************\\n * Constructor *\\n ***************/\\n\\n /**\\n * @param _libAddressManager Address of the Address Manager.\\n * @param _owner Name of the contract that owns this container (will be resolved later).\\n */\\n constructor(\\n address _libAddressManager,\\n string memory _owner\\n )\\n Lib_AddressResolver(_libAddressManager)\\n {\\n owner = _owner;\\n }\\n\\n\\n /**********************\\n * Function Modifiers *\\n **********************/\\n\\n modifier onlyOwner() {\\n require(\\n msg.sender == resolve(owner),\\n \\\"OVM_ChainStorageContainer: Function can only be called by the owner.\\\"\\n );\\n _;\\n }\\n\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function setGlobalMetadata(\\n bytes27 _globalMetadata\\n )\\n override\\n public\\n onlyOwner\\n {\\n return buffer.setExtraData(_globalMetadata);\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function getGlobalMetadata()\\n override\\n public\\n view\\n returns (\\n bytes27\\n )\\n {\\n return buffer.getExtraData();\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function length()\\n override\\n public\\n view\\n returns (\\n uint256\\n )\\n {\\n return uint256(buffer.getLength());\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function push(\\n bytes32 _object\\n )\\n override\\n public\\n onlyOwner\\n {\\n buffer.push(_object);\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function push(\\n bytes32 _object,\\n bytes27 _globalMetadata\\n )\\n override\\n public\\n onlyOwner\\n {\\n buffer.push(_object, _globalMetadata);\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function get(\\n uint256 _index\\n )\\n override\\n public\\n view\\n returns (\\n bytes32\\n )\\n {\\n return buffer.get(uint40(_index));\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function deleteElementsAfterInclusive(\\n uint256 _index\\n )\\n override\\n public\\n onlyOwner\\n {\\n buffer.deleteElementsAfterInclusive(\\n uint40(_index)\\n );\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function deleteElementsAfterInclusive(\\n uint256 _index,\\n bytes27 _globalMetadata\\n )\\n override\\n public\\n onlyOwner\\n {\\n buffer.deleteElementsAfterInclusive(\\n uint40(_index),\\n _globalMetadata\\n );\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function setNextOverwritableIndex(\\n uint256 _index\\n )\\n override\\n public\\n onlyOwner\\n {\\n buffer.nextOverwritableIndex = _index;\\n }\\n}\\n\",\"keccak256\":\"0x93325c961516aa2a22bf1aacf4029353d5e3b693e04b485753170337b50224e6\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/iOVM/chain/iOVM_ChainStorageContainer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/**\\n * @title iOVM_ChainStorageContainer\\n */\\ninterface iOVM_ChainStorageContainer {\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Sets the container's global metadata field. We're using `bytes27` here because we use five\\n * bytes to maintain the length of the underlying data structure, meaning we have an extra\\n * 27 bytes to store arbitrary data.\\n * @param _globalMetadata New global metadata to set.\\n */\\n function setGlobalMetadata(\\n bytes27 _globalMetadata\\n )\\n external;\\n\\n /**\\n * Retrieves the container's global metadata field.\\n * @return Container global metadata field.\\n */\\n function getGlobalMetadata()\\n external\\n view\\n returns (\\n bytes27\\n );\\n\\n /**\\n * Retrieves the number of objects stored in the container.\\n * @return Number of objects in the container.\\n */\\n function length()\\n external\\n view\\n returns (\\n uint256\\n );\\n\\n /**\\n * Pushes an object into the container.\\n * @param _object A 32 byte value to insert into the container.\\n */\\n function push(\\n bytes32 _object\\n )\\n external;\\n\\n /**\\n * Pushes an object into the container. Function allows setting the global metadata since\\n * we'll need to touch the \\\"length\\\" storage slot anyway, which also contains the global\\n * metadata (it's an optimization).\\n * @param _object A 32 byte value to insert into the container.\\n * @param _globalMetadata New global metadata for the container.\\n */\\n function push(\\n bytes32 _object,\\n bytes27 _globalMetadata\\n )\\n external;\\n\\n /**\\n * Retrieves an object from the container.\\n * @param _index Index of the particular object to access.\\n * @return 32 byte object value.\\n */\\n function get(\\n uint256 _index\\n )\\n external\\n view\\n returns (\\n bytes32\\n );\\n\\n /**\\n * Removes all objects after and including a given index.\\n * @param _index Object index to delete from.\\n */\\n function deleteElementsAfterInclusive(\\n uint256 _index\\n )\\n external;\\n\\n /**\\n * Removes all objects after and including a given index. Also allows setting the global\\n * metadata field.\\n * @param _index Object index to delete from.\\n * @param _globalMetadata New global metadata for the container.\\n */\\n function deleteElementsAfterInclusive(\\n uint256 _index,\\n bytes27 _globalMetadata\\n )\\n external;\\n\\n /**\\n * Marks an index as overwritable, meaing the underlying buffer can start to write values over\\n * any objects before and including the given index.\\n */\\n function setNextOverwritableIndex(\\n uint256 _index\\n )\\n external;\\n}\\n\",\"keccak256\":\"0x2d7973a0ad84c23ec62624d3f1e3aeb198cc72686ff1e6cfa17155556b320c94\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* External Imports */\\nimport { Ownable } from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\n/**\\n * @title Lib_AddressManager\\n */\\ncontract Lib_AddressManager is Ownable {\\n\\n /**********\\n * Events *\\n **********/\\n\\n event AddressSet(\\n string _name,\\n address _newAddress\\n );\\n\\n\\n /*************\\n * Variables *\\n *************/\\n\\n mapping (bytes32 => address) private addresses;\\n\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Changes the address associated with a particular name.\\n * @param _name String name to associate an address with.\\n * @param _address Address to associate with the name.\\n */\\n function setAddress(\\n string memory _name,\\n address _address\\n )\\n public\\n onlyOwner\\n {\\n addresses[_getNameHash(_name)] = _address;\\n\\n emit AddressSet(\\n _name,\\n _address\\n );\\n }\\n\\n /**\\n * Retrieves the address associated with a given name.\\n * @param _name Name to retrieve an address for.\\n * @return Address associated with the given name.\\n */\\n function getAddress(\\n string memory _name\\n )\\n public\\n view\\n returns (\\n address\\n )\\n {\\n return addresses[_getNameHash(_name)];\\n }\\n\\n\\n /**********************\\n * Internal Functions *\\n **********************/\\n\\n /**\\n * Computes the hash of a name.\\n * @param _name Name to compute a hash for.\\n * @return Hash of the given name.\\n */\\n function _getNameHash(\\n string memory _name\\n )\\n internal\\n pure\\n returns (\\n bytes32\\n )\\n {\\n return keccak256(abi.encodePacked(_name));\\n }\\n}\\n\",\"keccak256\":\"0x2ce671a0e004df88b136bea5a3c59d0732cea8887c8496da1d509e0200b03d7d\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/resolver/Lib_AddressResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* Library Imports */\\nimport { Lib_AddressManager } from \\\"./Lib_AddressManager.sol\\\";\\n\\n/**\\n * @title Lib_AddressResolver\\n */\\nabstract contract Lib_AddressResolver {\\n\\n /*************\\n * Variables *\\n *************/\\n\\n Lib_AddressManager public libAddressManager;\\n\\n\\n /***************\\n * Constructor *\\n ***************/\\n\\n /**\\n * @param _libAddressManager Address of the Lib_AddressManager.\\n */\\n constructor(\\n address _libAddressManager\\n ) {\\n libAddressManager = Lib_AddressManager(_libAddressManager);\\n }\\n\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Resolves the address associated with a given name.\\n * @param _name Name to resolve an address for.\\n * @return Address associated with the given name.\\n */\\n function resolve(\\n string memory _name\\n )\\n public\\n view\\n returns (\\n address\\n )\\n {\\n return libAddressManager.getAddress(_name);\\n }\\n}\\n\",\"keccak256\":\"0x65981feeabff6a81783ea97d44baf988a18a86c8cb374c46fdb71819cbacc7c0\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/utils/Lib_RingBuffer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\nlibrary Lib_RingBuffer {\\n using Lib_RingBuffer for RingBuffer;\\n\\n /***********\\n * Structs *\\n ***********/\\n\\n struct Buffer {\\n uint256 length;\\n mapping (uint256 => bytes32) buf;\\n }\\n\\n struct RingBuffer {\\n bytes32 contextA;\\n bytes32 contextB;\\n Buffer bufferA;\\n Buffer bufferB;\\n uint256 nextOverwritableIndex;\\n }\\n\\n struct RingBufferContext {\\n // contextA\\n uint40 globalIndex;\\n bytes27 extraData;\\n\\n // contextB\\n uint64 currBufferIndex;\\n uint40 prevResetIndex;\\n uint40 currResetIndex;\\n }\\n\\n\\n /*************\\n * Constants *\\n *************/\\n\\n uint256 constant MIN_CAPACITY = 16;\\n\\n\\n /**********************\\n * Internal Functions *\\n **********************/\\n\\n /**\\n * Pushes a single element to the buffer.\\n * @param _self Buffer to access.\\n * @param _value Value to push to the buffer.\\n * @param _extraData Optional global extra data.\\n */\\n function push(\\n RingBuffer storage _self,\\n bytes32 _value,\\n bytes27 _extraData\\n )\\n internal\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n Buffer storage currBuffer = _self.getBuffer(ctx.currBufferIndex);\\n\\n // Set a minimum capacity.\\n if (currBuffer.length == 0) {\\n currBuffer.length = MIN_CAPACITY;\\n }\\n\\n // Check if we need to expand the buffer.\\n if (ctx.globalIndex - ctx.currResetIndex >= currBuffer.length) {\\n if (ctx.currResetIndex < _self.nextOverwritableIndex) {\\n // We're going to overwrite the inactive buffer.\\n // Bump the buffer index, reset the delete offset, and set our reset indices.\\n ctx.currBufferIndex++;\\n ctx.prevResetIndex = ctx.currResetIndex;\\n ctx.currResetIndex = ctx.globalIndex;\\n\\n // Swap over to the next buffer.\\n currBuffer = _self.getBuffer(ctx.currBufferIndex);\\n } else {\\n // We're not overwriting yet, double the length of the current buffer.\\n currBuffer.length *= 2;\\n }\\n }\\n\\n // Index to write to is the difference of the global and reset indices.\\n uint256 writeHead = ctx.globalIndex - ctx.currResetIndex;\\n currBuffer.buf[writeHead] = _value;\\n\\n // Bump the global index and insert our extra data, then save the context.\\n ctx.globalIndex++;\\n ctx.extraData = _extraData;\\n _self.setContext(ctx);\\n }\\n\\n /**\\n * Pushes a single element to the buffer.\\n * @param _self Buffer to access.\\n * @param _value Value to push to the buffer.\\n */\\n function push(\\n RingBuffer storage _self,\\n bytes32 _value\\n )\\n internal\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n\\n _self.push(\\n _value,\\n ctx.extraData\\n );\\n }\\n\\n /**\\n * Retrieves an element from the buffer.\\n * @param _self Buffer to access.\\n * @param _index Element index to retrieve.\\n * @return Value of the element at the given index.\\n */\\n function get(\\n RingBuffer storage _self,\\n uint256 _index\\n )\\n internal\\n view\\n returns (\\n bytes32\\n )\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n\\n require(\\n _index < ctx.globalIndex,\\n \\\"Index out of bounds.\\\"\\n );\\n\\n Buffer storage currBuffer = _self.getBuffer(ctx.currBufferIndex);\\n Buffer storage prevBuffer = _self.getBuffer(ctx.currBufferIndex + 1);\\n\\n if (_index >= ctx.currResetIndex) {\\n // We're trying to load an element from the current buffer.\\n // Relative index is just the difference from the reset index.\\n uint256 relativeIndex = _index - ctx.currResetIndex;\\n\\n // Shouldn't happen but why not check.\\n require(\\n relativeIndex < currBuffer.length,\\n \\\"Index out of bounds.\\\"\\n );\\n\\n return currBuffer.buf[relativeIndex];\\n } else {\\n // We're trying to load an element from the previous buffer.\\n // Relative index is the difference from the reset index in the other direction.\\n uint256 relativeIndex = ctx.currResetIndex - _index;\\n\\n // Condition only fails in the case that we deleted and flipped buffers.\\n require(\\n ctx.currResetIndex > ctx.prevResetIndex,\\n \\\"Index out of bounds.\\\"\\n );\\n\\n // Make sure we're not trying to read beyond the array.\\n require(\\n relativeIndex <= prevBuffer.length,\\n \\\"Index out of bounds.\\\"\\n );\\n\\n return prevBuffer.buf[prevBuffer.length - relativeIndex];\\n }\\n }\\n\\n /**\\n * Deletes all elements after (and including) a given index.\\n * @param _self Buffer to access.\\n * @param _index Index of the element to delete from (inclusive).\\n * @param _extraData Optional global extra data.\\n */\\n function deleteElementsAfterInclusive(\\n RingBuffer storage _self,\\n uint40 _index,\\n bytes27 _extraData\\n )\\n internal\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n\\n require(\\n _index < ctx.globalIndex && _index >= ctx.prevResetIndex,\\n \\\"Index out of bounds.\\\"\\n );\\n\\n if (_index < ctx.currResetIndex) {\\n // We're switching back to the previous buffer.\\n // Reduce the buffer index, set the current reset index back to match the previous one.\\n // We use the equality of these two values to prevent reading beyond this buffer.\\n ctx.currBufferIndex--;\\n ctx.currResetIndex = ctx.prevResetIndex;\\n }\\n\\n // Set our global index and extra data, save the context.\\n ctx.globalIndex = _index;\\n ctx.extraData = _extraData;\\n _self.setContext(ctx);\\n }\\n\\n /**\\n * Deletes all elements after (and including) a given index.\\n * @param _self Buffer to access.\\n * @param _index Index of the element to delete from (inclusive).\\n */\\n function deleteElementsAfterInclusive(\\n RingBuffer storage _self,\\n uint40 _index\\n )\\n internal\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n _self.deleteElementsAfterInclusive(\\n _index,\\n ctx.extraData\\n );\\n }\\n\\n /**\\n * Retrieves the current global index.\\n * @param _self Buffer to access.\\n * @return Current global index.\\n */\\n function getLength(\\n RingBuffer storage _self\\n )\\n internal\\n view\\n returns (\\n uint40\\n )\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n return ctx.globalIndex;\\n }\\n\\n /**\\n * Changes current global extra data.\\n * @param _self Buffer to access.\\n * @param _extraData New global extra data.\\n */\\n function setExtraData(\\n RingBuffer storage _self,\\n bytes27 _extraData\\n )\\n internal\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n ctx.extraData = _extraData;\\n _self.setContext(ctx);\\n }\\n\\n /**\\n * Retrieves the current global extra data.\\n * @param _self Buffer to access.\\n * @return Current global extra data.\\n */\\n function getExtraData(\\n RingBuffer storage _self\\n )\\n internal\\n view\\n returns (\\n bytes27\\n )\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n return ctx.extraData;\\n }\\n\\n /**\\n * Sets the current ring buffer context.\\n * @param _self Buffer to access.\\n * @param _ctx Current ring buffer context.\\n */\\n function setContext(\\n RingBuffer storage _self,\\n RingBufferContext memory _ctx\\n )\\n internal\\n {\\n bytes32 contextA;\\n bytes32 contextB;\\n\\n uint40 globalIndex = _ctx.globalIndex;\\n bytes27 extraData = _ctx.extraData;\\n assembly {\\n contextA := globalIndex\\n contextA := or(contextA, extraData)\\n }\\n\\n uint64 currBufferIndex = _ctx.currBufferIndex;\\n uint40 prevResetIndex = _ctx.prevResetIndex;\\n uint40 currResetIndex = _ctx.currResetIndex;\\n assembly {\\n contextB := currBufferIndex\\n contextB := or(contextB, shl(64, prevResetIndex))\\n contextB := or(contextB, shl(104, currResetIndex))\\n }\\n\\n if (_self.contextA != contextA) {\\n _self.contextA = contextA;\\n }\\n\\n if (_self.contextB != contextB) {\\n _self.contextB = contextB;\\n }\\n }\\n\\n /**\\n * Retrieves the current ring buffer context.\\n * @param _self Buffer to access.\\n * @return Current ring buffer context.\\n */\\n function getContext(\\n RingBuffer storage _self\\n )\\n internal\\n view\\n returns (\\n RingBufferContext memory\\n )\\n {\\n bytes32 contextA = _self.contextA;\\n bytes32 contextB = _self.contextB;\\n\\n uint40 globalIndex;\\n bytes27 extraData;\\n assembly {\\n globalIndex := and(contextA, 0x000000000000000000000000000000000000000000000000000000FFFFFFFFFF)\\n extraData := and(contextA, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000)\\n }\\n\\n uint64 currBufferIndex;\\n uint40 prevResetIndex;\\n uint40 currResetIndex;\\n assembly {\\n currBufferIndex := and(contextB, 0x000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFF)\\n prevResetIndex := shr(64, and(contextB, 0x00000000000000000000000000000000000000FFFFFFFFFF0000000000000000))\\n currResetIndex := shr(104, and(contextB, 0x0000000000000000000000000000FFFFFFFFFF00000000000000000000000000))\\n }\\n\\n return RingBufferContext({\\n globalIndex: globalIndex,\\n extraData: extraData,\\n currBufferIndex: currBufferIndex,\\n prevResetIndex: prevResetIndex,\\n currResetIndex: currResetIndex\\n });\\n }\\n\\n /**\\n * Retrieves the a buffer from the ring buffer by index.\\n * @param _self Buffer to access.\\n * @param _which Index of the sub buffer to access.\\n * @return Sub buffer for the index.\\n */\\n function getBuffer(\\n RingBuffer storage _self,\\n uint256 _which\\n )\\n internal\\n view\\n returns (\\n Buffer storage\\n )\\n {\\n return _which % 2 == 0 ? _self.bufferA : _self.bufferB;\\n }\\n}\\n\",\"keccak256\":\"0xe30fc56d4499f98582e1f800dfa3b343f171163a557266c31a56449d5fd3ffae\",\"license\":\"MIT\"}},\"version\":1}",
"bytecode": "0x60806040523480156200001157600080fd5b506040516200118d3803806200118d833981810160405260408110156200003757600080fd5b8151602083018051604051929492938301929190846401000000008211156200005f57600080fd5b9083019060208201858111156200007557600080fd5b82516401000000008111828201881017156200009057600080fd5b82525081516020918201929091019080838360005b83811015620000bf578181015183820152602001620000a5565b50505050905090810190601f168015620000ed5780820380516001836020036101000a031916815260200191505b506040525050600080546001600160a01b0319166001600160a01b038516179055508051620001249060019060208401906200012d565b505050620001d9565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282620001655760008555620001b0565b82601f106200018057805160ff1916838001178555620001b0565b82800160010185558215620001b0579182015b82811115620001b057825182559160200191906001019062000193565b50620001be929150620001c2565b5090565b5b80821115620001be5760008155600101620001c3565b610fa480620001e96000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c80634651d91e116100715780634651d91e1461021a5780638da5cb5b146102375780639507d39a146102b4578063b298e36b146102d1578063ccf8f969146102ee578063fa9e936c14610311576100b4565b8063167fd681146100b95780631f7b6d32146100e65780632015276c1461010057806329061de21461012b578063299ca47814610150578063461a447814610174575b600080fd5b6100e4600480360360408110156100cf57600080fd5b508035906020013564ffffffffff191661032e565b005b6100ee610423565b60408051918252519081900360200190f35b6100e46004803603604081101561011657600080fd5b508035906020013564ffffffffff191661043b565b6100e46004803603602081101561014157600080fd5b503564ffffffffff19166104f7565b6101586105b5565b604080516001600160a01b039092168252519081900360200190f35b6101586004803603602081101561018a57600080fd5b8101906020810181356401000000008111156101a557600080fd5b8201836020820111156101b757600080fd5b803590602001918460018302840111640100000000831117156101d957600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506105c4945050505050565b6100e46004803603602081101561023057600080fd5b50356106a0565b61023f61075b565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610279578181015183820152602001610261565b50505050905090810190601f1680156102a65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6100ee600480360360208110156102ca57600080fd5b50356107e8565b6100e4600480360360208110156102e757600080fd5b5035610802565b6102f66108bd565b6040805164ffffffffff199092168252519081900360200190f35b6100e46004803603602081101561032757600080fd5b50356108ce565b60018054604080516020601f6002600019610100878916150201909516949094049384018190048102820181019092528281526103c493909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b820191906000526020600020905b81548152906001019060200180831161039d57829003601f168201915b50505050506105c4565b6001600160a01b0316336001600160a01b0316146104135760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b61041f60028383610983565b5050565b600061042f6002610a75565b64ffffffffff16905090565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261049c93909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146104eb5760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b61041f60028383610a89565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261055893909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146105a75760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b6105b2600282610b90565b50565b6000546001600160a01b031681565b6000805460405163bf40fac160e01b81526020600482018181528551602484015285516001600160a01b039094169363bf40fac19387938392604490920191908501908083838b5b8381101561062457818101518382015260200161060c565b50505050905090810190601f1680156106515780820380516001836020036101000a031916815260200191505b509250505060206040518083038186803b15801561066e57600080fd5b505afa158015610682573d6000803e3d6000fd5b505050506040513d602081101561069857600080fd5b505192915050565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261070193909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146107505760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b6105b2600282610bba565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156107e05780601f106107b5576101008083540402835291602001916107e0565b820191906000526020600020905b8154815290600101906020018083116107c357829003601f168201915b505050505081565b60006107fc600264ffffffffff8416610be0565b92915050565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261086393909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146108b25760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b6105b2600282610de9565b60006108c96002610e0f565b905090565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261092f93909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b03161461097e5760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b600855565b600061098e84610e26565b9050806000015164ffffffffff168364ffffffffff161080156109c35750806060015164ffffffffff168364ffffffffff1610155b610a0b576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b806080015164ffffffffff168364ffffffffff161015610a4d576040810180516000190167ffffffffffffffff169052606081015164ffffffffff1660808201525b64ffffffffff8316815264ffffffffff1982166020820152610a6f8482610e86565b50505050565b600080610a8183610e26565b519392505050565b6000610a9484610e26565b90506000610ab9826040015167ffffffffffffffff1686610edc90919063ffffffff16565b8054909150610ac757601081555b8054608083015183510364ffffffffff1610610b3e578460060154826080015164ffffffffff161015610b365760408201805160010167ffffffffffffffff169081905260808301805164ffffffffff90811660608601528451169052610b2f908690610edc565b9050610b3e565b805460020281555b608082015182510364ffffffffff9081166000818152600184810160209081526040909220889055855101909216845264ffffffffff19851691840191909152610b888684610e86565b505050505050565b6000610b9b83610e26565b64ffffffffff19831660208201529050610bb58382610e86565b505050565b6000610bc583610e26565b9050610bb5828260200151856109839092919063ffffffff16565b600080610bec84610e26565b805190915064ffffffffff168310610c42576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b6000610c65826040015167ffffffffffffffff1686610edc90919063ffffffff16565b90506000610c8d836040015160010167ffffffffffffffff1687610edc90919063ffffffff16565b9050826080015164ffffffffff168510610d1a576080830151825464ffffffffff9091168603908110610cfe576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b6000908152600190920160205250604090205491506107fc9050565b6080830151606084015164ffffffffff9182168781039290911610610d7d576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b8154811115610dca576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b81540360009081526001909101602052604090205492506107fc915050565b6000610df483610e26565b9050610bb582826020015185610a899092919063ffffffff16565b600080610e1b83610e26565b602001519392505050565b610e2e610efc565b5080546001909101546040805160a08101825264ffffffffff808516825264ffffffffff19909416602082015267ffffffffffffffff8316818301529082901c8316606082015260689190911c909116608082015290565b80516020820151604080840151606085015160808601518754858717969483901b8417606883901b1795939291908714610ebe578689555b85896001015414610ed157600189018690555b505050505050505050565b60006002820615610ef05782600401610ef5565b826002015b9392505050565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101919091529056fe4f564d5f436861696e53746f72616765436f6e7461696e65723a2046756e6374696f6e2063616e206f6e6c792062652063616c6c656420627920746865206f776e65722ea2646970667358221220376cbc00341dd082d644157f6511fcd1ac26a6a924d04ae6532cfcab93d9191864736f6c63430007060033",
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100b45760003560e01c80634651d91e116100715780634651d91e1461021a5780638da5cb5b146102375780639507d39a146102b4578063b298e36b146102d1578063ccf8f969146102ee578063fa9e936c14610311576100b4565b8063167fd681146100b95780631f7b6d32146100e65780632015276c1461010057806329061de21461012b578063299ca47814610150578063461a447814610174575b600080fd5b6100e4600480360360408110156100cf57600080fd5b508035906020013564ffffffffff191661032e565b005b6100ee610423565b60408051918252519081900360200190f35b6100e46004803603604081101561011657600080fd5b508035906020013564ffffffffff191661043b565b6100e46004803603602081101561014157600080fd5b503564ffffffffff19166104f7565b6101586105b5565b604080516001600160a01b039092168252519081900360200190f35b6101586004803603602081101561018a57600080fd5b8101906020810181356401000000008111156101a557600080fd5b8201836020820111156101b757600080fd5b803590602001918460018302840111640100000000831117156101d957600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506105c4945050505050565b6100e46004803603602081101561023057600080fd5b50356106a0565b61023f61075b565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610279578181015183820152602001610261565b50505050905090810190601f1680156102a65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6100ee600480360360208110156102ca57600080fd5b50356107e8565b6100e4600480360360208110156102e757600080fd5b5035610802565b6102f66108bd565b6040805164ffffffffff199092168252519081900360200190f35b6100e46004803603602081101561032757600080fd5b50356108ce565b60018054604080516020601f6002600019610100878916150201909516949094049384018190048102820181019092528281526103c493909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b820191906000526020600020905b81548152906001019060200180831161039d57829003601f168201915b50505050506105c4565b6001600160a01b0316336001600160a01b0316146104135760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b61041f60028383610983565b5050565b600061042f6002610a75565b64ffffffffff16905090565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261049c93909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146104eb5760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b61041f60028383610a89565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261055893909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146105a75760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b6105b2600282610b90565b50565b6000546001600160a01b031681565b6000805460405163bf40fac160e01b81526020600482018181528551602484015285516001600160a01b039094169363bf40fac19387938392604490920191908501908083838b5b8381101561062457818101518382015260200161060c565b50505050905090810190601f1680156106515780820380516001836020036101000a031916815260200191505b509250505060206040518083038186803b15801561066e57600080fd5b505afa158015610682573d6000803e3d6000fd5b505050506040513d602081101561069857600080fd5b505192915050565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261070193909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146107505760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b6105b2600282610bba565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156107e05780601f106107b5576101008083540402835291602001916107e0565b820191906000526020600020905b8154815290600101906020018083116107c357829003601f168201915b505050505081565b60006107fc600264ffffffffff8416610be0565b92915050565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261086393909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146108b25760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b6105b2600282610de9565b60006108c96002610e0f565b905090565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261092f93909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b03161461097e5760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b600855565b600061098e84610e26565b9050806000015164ffffffffff168364ffffffffff161080156109c35750806060015164ffffffffff168364ffffffffff1610155b610a0b576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b806080015164ffffffffff168364ffffffffff161015610a4d576040810180516000190167ffffffffffffffff169052606081015164ffffffffff1660808201525b64ffffffffff8316815264ffffffffff1982166020820152610a6f8482610e86565b50505050565b600080610a8183610e26565b519392505050565b6000610a9484610e26565b90506000610ab9826040015167ffffffffffffffff1686610edc90919063ffffffff16565b8054909150610ac757601081555b8054608083015183510364ffffffffff1610610b3e578460060154826080015164ffffffffff161015610b365760408201805160010167ffffffffffffffff169081905260808301805164ffffffffff90811660608601528451169052610b2f908690610edc565b9050610b3e565b805460020281555b608082015182510364ffffffffff9081166000818152600184810160209081526040909220889055855101909216845264ffffffffff19851691840191909152610b888684610e86565b505050505050565b6000610b9b83610e26565b64ffffffffff19831660208201529050610bb58382610e86565b505050565b6000610bc583610e26565b9050610bb5828260200151856109839092919063ffffffff16565b600080610bec84610e26565b805190915064ffffffffff168310610c42576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b6000610c65826040015167ffffffffffffffff1686610edc90919063ffffffff16565b90506000610c8d836040015160010167ffffffffffffffff1687610edc90919063ffffffff16565b9050826080015164ffffffffff168510610d1a576080830151825464ffffffffff9091168603908110610cfe576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b6000908152600190920160205250604090205491506107fc9050565b6080830151606084015164ffffffffff9182168781039290911610610d7d576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b8154811115610dca576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b81540360009081526001909101602052604090205492506107fc915050565b6000610df483610e26565b9050610bb582826020015185610a899092919063ffffffff16565b600080610e1b83610e26565b602001519392505050565b610e2e610efc565b5080546001909101546040805160a08101825264ffffffffff808516825264ffffffffff19909416602082015267ffffffffffffffff8316818301529082901c8316606082015260689190911c909116608082015290565b80516020820151604080840151606085015160808601518754858717969483901b8417606883901b1795939291908714610ebe578689555b85896001015414610ed157600189018690555b505050505050505050565b60006002820615610ef05782600401610ef5565b826002015b9392505050565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101919091529056fe4f564d5f436861696e53746f72616765436f6e7461696e65723a2046756e6374696f6e2063616e206f6e6c792062652063616c6c656420627920746865206f776e65722ea2646970667358221220376cbc00341dd082d644157f6511fcd1ac26a6a924d04ae6532cfcab93d9191864736f6c63430007060033",
"devdoc": {
"details": "The Chain Storage Container provides its owner contract with read, write and delete functionality. This provides gas efficiency gains by enabling it to overwrite storage slots which can no longer be used in a fraud proof due to the fraud window having passed, and the associated chain state or transactions being finalized. Three distinct Chain Storage Containers will be deployed on Layer 1: 1. Stores transaction batches for the Canonical Transaction Chain 2. Stores queued transactions for the Canonical Transaction Chain 3. Stores chain state batches for the State Commitment Chain Compiler used: solc Runtime target: EVM",
"kind": "dev",
"methods": {
"constructor": {
"params": {
"_libAddressManager": "Address of the Address Manager.",
"_owner": "Name of the contract that owns this container (will be resolved later)."
}
},
"deleteElementsAfterInclusive(uint256)": {
"params": {
"_index": "Object index to delete from."
}
},
"deleteElementsAfterInclusive(uint256,bytes27)": {
"params": {
"_globalMetadata": "New global metadata for the container.",
"_index": "Object index to delete from."
}
},
"get(uint256)": {
"params": {
"_index": "Index of the particular object to access."
},
"returns": {
"_0": "32 byte object value."
}
},
"getGlobalMetadata()": {
"returns": {
"_0": "Container global metadata field."
}
},
"length()": {
"returns": {
"_0": "Number of objects in the container."
}
},
"push(bytes32)": {
"params": {
"_object": "A 32 byte value to insert into the container."
}
},
"push(bytes32,bytes27)": {
"params": {
"_globalMetadata": "New global metadata for the container.",
"_object": "A 32 byte value to insert into the container."
}
},
"resolve(string)": {
"params": {
"_name": "Name to resolve an address for."
},
"returns": {
"_0": "Address associated with the given name."
}
},
"setGlobalMetadata(bytes27)": {
"params": {
"_globalMetadata": "New global metadata to set."
}
}
},
"title": "OVM_ChainStorageContainer",
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {
"deleteElementsAfterInclusive(uint256)": {
"notice": "Removes all objects after and including a given index."
},
"deleteElementsAfterInclusive(uint256,bytes27)": {
"notice": "Removes all objects after and including a given index. Also allows setting the global metadata field."
},
"get(uint256)": {
"notice": "Retrieves an object from the container."
},
"getGlobalMetadata()": {
"notice": "Retrieves the container's global metadata field."
},
"length()": {
"notice": "Retrieves the number of objects stored in the container."
},
"push(bytes32)": {
"notice": "Pushes an object into the container."
},
"push(bytes32,bytes27)": {
"notice": "Pushes an object into the container. Function allows setting the global metadata since we'll need to touch the \"length\" storage slot anyway, which also contains the global metadata (it's an optimization)."
},
"resolve(string)": {
"notice": "Resolves the address associated with a given name."
},
"setGlobalMetadata(bytes27)": {
"notice": "Sets the container's global metadata field. We're using `bytes27` here because we use five bytes to maintain the length of the underlying data structure, meaning we have an extra 27 bytes to store arbitrary data."
},
"setNextOverwritableIndex(uint256)": {
"notice": "Marks an index as overwritable, meaing the underlying buffer can start to write values over any objects before and including the given index."
}
},
"version": 1
},
"storageLayout": {
"storage": [
{
"astId": 12055,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "libAddressManager",
"offset": 0,
"slot": "0",
"type": "t_contract(Lib_AddressManager)12048"
},
{
"astId": 3712,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "owner",
"offset": 0,
"slot": "1",
"type": "t_string_storage"
},
{
"astId": 3714,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "buffer",
"offset": 0,
"slot": "2",
"type": "t_struct(RingBuffer)17101_storage"
}
],
"types": {
"t_bytes32": {
"encoding": "inplace",
"label": "bytes32",
"numberOfBytes": "32"
},
"t_contract(Lib_AddressManager)12048": {
"encoding": "inplace",
"label": "contract Lib_AddressManager",
"numberOfBytes": "20"
},
"t_mapping(t_uint256,t_bytes32)": {
"encoding": "mapping",
"key": "t_uint256",
"label": "mapping(uint256 => bytes32)",
"numberOfBytes": "32",
"value": "t_bytes32"
},
"t_string_storage": {
"encoding": "bytes",
"label": "string",
"numberOfBytes": "32"
},
"t_struct(Buffer)17090_storage": {
"encoding": "inplace",
"label": "struct Lib_RingBuffer.Buffer",
"members": [
{
"astId": 17085,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "length",
"offset": 0,
"slot": "0",
"type": "t_uint256"
},
{
"astId": 17089,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "buf",
"offset": 0,
"slot": "1",
"type": "t_mapping(t_uint256,t_bytes32)"
}
],
"numberOfBytes": "64"
},
"t_struct(RingBuffer)17101_storage": {
"encoding": "inplace",
"label": "struct Lib_RingBuffer.RingBuffer",
"members": [
{
"astId": 17092,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "contextA",
"offset": 0,
"slot": "0",
"type": "t_bytes32"
},
{
"astId": 17094,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "contextB",
"offset": 0,
"slot": "1",
"type": "t_bytes32"
},
{
"astId": 17096,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "bufferA",
"offset": 0,
"slot": "2",
"type": "t_struct(Buffer)17090_storage"
},
{
"astId": 17098,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "bufferB",
"offset": 0,
"slot": "4",
"type": "t_struct(Buffer)17090_storage"
},
{
"astId": 17100,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "nextOverwritableIndex",
"offset": 0,
"slot": "6",
"type": "t_uint256"
}
],
"numberOfBytes": "224"
},
"t_uint256": {
"encoding": "inplace",
"label": "uint256",
"numberOfBytes": "32"
}
}
}
}
\ No newline at end of file
{
"address": "0xeD5fF8cFFba09fa5fF3104a63bA321733c4553d9",
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "_libAddressManager",
"type": "address"
},
{
"internalType": "string",
"name": "_owner",
"type": "string"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_index",
"type": "uint256"
},
{
"internalType": "bytes27",
"name": "_globalMetadata",
"type": "bytes27"
}
],
"name": "deleteElementsAfterInclusive",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_index",
"type": "uint256"
}
],
"name": "deleteElementsAfterInclusive",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_index",
"type": "uint256"
}
],
"name": "get",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getGlobalMetadata",
"outputs": [
{
"internalType": "bytes27",
"name": "",
"type": "bytes27"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "length",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "libAddressManager",
"outputs": [
{
"internalType": "contract Lib_AddressManager",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "_object",
"type": "bytes32"
},
{
"internalType": "bytes27",
"name": "_globalMetadata",
"type": "bytes27"
}
],
"name": "push",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "_object",
"type": "bytes32"
}
],
"name": "push",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "_name",
"type": "string"
}
],
"name": "resolve",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes27",
"name": "_globalMetadata",
"type": "bytes27"
}
],
"name": "setGlobalMetadata",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_index",
"type": "uint256"
}
],
"name": "setNextOverwritableIndex",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"transactionHash": "0xc18d4e89a763706311175193d4f75a4677a551fb0d8c2ee18f4157192460084f",
"receipt": {
"to": null,
"from": "0x4107438C1b1579f258AF9d1AC06194C4a0F55040",
"contractAddress": "0xeD5fF8cFFba09fa5fF3104a63bA321733c4553d9",
"transactionIndex": 4,
"gasUsed": "970990",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blockHash": "0x9fa346bec2f0265f5d068bef12fcde397f7f3a0e808ecdda6516881286575e60",
"transactionHash": "0xc18d4e89a763706311175193d4f75a4677a551fb0d8c2ee18f4157192460084f",
"logs": [],
"blockNumber": 4694093,
"cumulativeGasUsed": "1626532",
"status": 1,
"byzantium": true
},
"args": [
"0xE3d08F0D900A2D53cB794cf82d7127764BcC3092",
"OVM_CanonicalTransactionChain"
],
"solcInputHash": "dde656dd41f49cad9eac9bc7065fd6a7",
"metadata": "{\"compiler\":{\"version\":\"0.7.6+commit.7338295f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_libAddressManager\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_owner\",\"type\":\"string\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_index\",\"type\":\"uint256\"},{\"internalType\":\"bytes27\",\"name\":\"_globalMetadata\",\"type\":\"bytes27\"}],\"name\":\"deleteElementsAfterInclusive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_index\",\"type\":\"uint256\"}],\"name\":\"deleteElementsAfterInclusive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_index\",\"type\":\"uint256\"}],\"name\":\"get\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getGlobalMetadata\",\"outputs\":[{\"internalType\":\"bytes27\",\"name\":\"\",\"type\":\"bytes27\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"length\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"libAddressManager\",\"outputs\":[{\"internalType\":\"contract Lib_AddressManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_object\",\"type\":\"bytes32\"},{\"internalType\":\"bytes27\",\"name\":\"_globalMetadata\",\"type\":\"bytes27\"}],\"name\":\"push\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_object\",\"type\":\"bytes32\"}],\"name\":\"push\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes27\",\"name\":\"_globalMetadata\",\"type\":\"bytes27\"}],\"name\":\"setGlobalMetadata\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_index\",\"type\":\"uint256\"}],\"name\":\"setNextOverwritableIndex\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"The Chain Storage Container provides its owner contract with read, write and delete functionality. This provides gas efficiency gains by enabling it to overwrite storage slots which can no longer be used in a fraud proof due to the fraud window having passed, and the associated chain state or transactions being finalized. Three distinct Chain Storage Containers will be deployed on Layer 1: 1. Stores transaction batches for the Canonical Transaction Chain 2. Stores queued transactions for the Canonical Transaction Chain 3. Stores chain state batches for the State Commitment Chain Compiler used: solc Runtime target: EVM\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"params\":{\"_libAddressManager\":\"Address of the Address Manager.\",\"_owner\":\"Name of the contract that owns this container (will be resolved later).\"}},\"deleteElementsAfterInclusive(uint256)\":{\"params\":{\"_index\":\"Object index to delete from.\"}},\"deleteElementsAfterInclusive(uint256,bytes27)\":{\"params\":{\"_globalMetadata\":\"New global metadata for the container.\",\"_index\":\"Object index to delete from.\"}},\"get(uint256)\":{\"params\":{\"_index\":\"Index of the particular object to access.\"},\"returns\":{\"_0\":\"32 byte object value.\"}},\"getGlobalMetadata()\":{\"returns\":{\"_0\":\"Container global metadata field.\"}},\"length()\":{\"returns\":{\"_0\":\"Number of objects in the container.\"}},\"push(bytes32)\":{\"params\":{\"_object\":\"A 32 byte value to insert into the container.\"}},\"push(bytes32,bytes27)\":{\"params\":{\"_globalMetadata\":\"New global metadata for the container.\",\"_object\":\"A 32 byte value to insert into the container.\"}},\"resolve(string)\":{\"params\":{\"_name\":\"Name to resolve an address for.\"},\"returns\":{\"_0\":\"Address associated with the given name.\"}},\"setGlobalMetadata(bytes27)\":{\"params\":{\"_globalMetadata\":\"New global metadata to set.\"}}},\"title\":\"OVM_ChainStorageContainer\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"deleteElementsAfterInclusive(uint256)\":{\"notice\":\"Removes all objects after and including a given index.\"},\"deleteElementsAfterInclusive(uint256,bytes27)\":{\"notice\":\"Removes all objects after and including a given index. Also allows setting the global metadata field.\"},\"get(uint256)\":{\"notice\":\"Retrieves an object from the container.\"},\"getGlobalMetadata()\":{\"notice\":\"Retrieves the container's global metadata field.\"},\"length()\":{\"notice\":\"Retrieves the number of objects stored in the container.\"},\"push(bytes32)\":{\"notice\":\"Pushes an object into the container.\"},\"push(bytes32,bytes27)\":{\"notice\":\"Pushes an object into the container. Function allows setting the global metadata since we'll need to touch the \\\"length\\\" storage slot anyway, which also contains the global metadata (it's an optimization).\"},\"resolve(string)\":{\"notice\":\"Resolves the address associated with a given name.\"},\"setGlobalMetadata(bytes27)\":{\"notice\":\"Sets the container's global metadata field. We're using `bytes27` here because we use five bytes to maintain the length of the underlying data structure, meaning we have an extra 27 bytes to store arbitrary data.\"},\"setNextOverwritableIndex(uint256)\":{\"notice\":\"Marks an index as overwritable, meaing the underlying buffer can start to write values over any objects before and including the given index.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol\":\"OVM_ChainStorageContainer\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor () internal {\\n address msgSender = _msgSender();\\n _owner = msgSender;\\n emit OwnershipTransferred(address(0), msgSender);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x15e2d5bd4c28a88548074c54d220e8086f638a71ed07e6b3ba5a70066fcf458d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with GSN meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address payable) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes memory) {\\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x8d3cb350f04ff49cfb10aef08d87f19dcbaecc8027b0bed12f3275cd12f38cf0\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* Library Imports */\\nimport { Lib_RingBuffer } from \\\"../../libraries/utils/Lib_RingBuffer.sol\\\";\\nimport { Lib_AddressResolver } from \\\"../../libraries/resolver/Lib_AddressResolver.sol\\\";\\n\\n/* Interface Imports */\\nimport { iOVM_ChainStorageContainer } from \\\"../../iOVM/chain/iOVM_ChainStorageContainer.sol\\\";\\n\\n/**\\n * @title OVM_ChainStorageContainer\\n * @dev The Chain Storage Container provides its owner contract with read, write and delete functionality.\\n * This provides gas efficiency gains by enabling it to overwrite storage slots which can no longer be used\\n * in a fraud proof due to the fraud window having passed, and the associated chain state or\\n * transactions being finalized.\\n * Three distinct Chain Storage Containers will be deployed on Layer 1:\\n * 1. Stores transaction batches for the Canonical Transaction Chain\\n * 2. Stores queued transactions for the Canonical Transaction Chain\\n * 3. Stores chain state batches for the State Commitment Chain\\n *\\n * Compiler used: solc\\n * Runtime target: EVM\\n */\\ncontract OVM_ChainStorageContainer is iOVM_ChainStorageContainer, Lib_AddressResolver {\\n\\n /*************\\n * Libraries *\\n *************/\\n\\n using Lib_RingBuffer for Lib_RingBuffer.RingBuffer;\\n\\n\\n /*************\\n * Variables *\\n *************/\\n\\n string public owner;\\n Lib_RingBuffer.RingBuffer internal buffer;\\n\\n\\n /***************\\n * Constructor *\\n ***************/\\n\\n /**\\n * @param _libAddressManager Address of the Address Manager.\\n * @param _owner Name of the contract that owns this container (will be resolved later).\\n */\\n constructor(\\n address _libAddressManager,\\n string memory _owner\\n )\\n Lib_AddressResolver(_libAddressManager)\\n {\\n owner = _owner;\\n }\\n\\n\\n /**********************\\n * Function Modifiers *\\n **********************/\\n\\n modifier onlyOwner() {\\n require(\\n msg.sender == resolve(owner),\\n \\\"OVM_ChainStorageContainer: Function can only be called by the owner.\\\"\\n );\\n _;\\n }\\n\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function setGlobalMetadata(\\n bytes27 _globalMetadata\\n )\\n override\\n public\\n onlyOwner\\n {\\n return buffer.setExtraData(_globalMetadata);\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function getGlobalMetadata()\\n override\\n public\\n view\\n returns (\\n bytes27\\n )\\n {\\n return buffer.getExtraData();\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function length()\\n override\\n public\\n view\\n returns (\\n uint256\\n )\\n {\\n return uint256(buffer.getLength());\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function push(\\n bytes32 _object\\n )\\n override\\n public\\n onlyOwner\\n {\\n buffer.push(_object);\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function push(\\n bytes32 _object,\\n bytes27 _globalMetadata\\n )\\n override\\n public\\n onlyOwner\\n {\\n buffer.push(_object, _globalMetadata);\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function get(\\n uint256 _index\\n )\\n override\\n public\\n view\\n returns (\\n bytes32\\n )\\n {\\n return buffer.get(uint40(_index));\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function deleteElementsAfterInclusive(\\n uint256 _index\\n )\\n override\\n public\\n onlyOwner\\n {\\n buffer.deleteElementsAfterInclusive(\\n uint40(_index)\\n );\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function deleteElementsAfterInclusive(\\n uint256 _index,\\n bytes27 _globalMetadata\\n )\\n override\\n public\\n onlyOwner\\n {\\n buffer.deleteElementsAfterInclusive(\\n uint40(_index),\\n _globalMetadata\\n );\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function setNextOverwritableIndex(\\n uint256 _index\\n )\\n override\\n public\\n onlyOwner\\n {\\n buffer.nextOverwritableIndex = _index;\\n }\\n}\\n\",\"keccak256\":\"0x93325c961516aa2a22bf1aacf4029353d5e3b693e04b485753170337b50224e6\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/iOVM/chain/iOVM_ChainStorageContainer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/**\\n * @title iOVM_ChainStorageContainer\\n */\\ninterface iOVM_ChainStorageContainer {\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Sets the container's global metadata field. We're using `bytes27` here because we use five\\n * bytes to maintain the length of the underlying data structure, meaning we have an extra\\n * 27 bytes to store arbitrary data.\\n * @param _globalMetadata New global metadata to set.\\n */\\n function setGlobalMetadata(\\n bytes27 _globalMetadata\\n )\\n external;\\n\\n /**\\n * Retrieves the container's global metadata field.\\n * @return Container global metadata field.\\n */\\n function getGlobalMetadata()\\n external\\n view\\n returns (\\n bytes27\\n );\\n\\n /**\\n * Retrieves the number of objects stored in the container.\\n * @return Number of objects in the container.\\n */\\n function length()\\n external\\n view\\n returns (\\n uint256\\n );\\n\\n /**\\n * Pushes an object into the container.\\n * @param _object A 32 byte value to insert into the container.\\n */\\n function push(\\n bytes32 _object\\n )\\n external;\\n\\n /**\\n * Pushes an object into the container. Function allows setting the global metadata since\\n * we'll need to touch the \\\"length\\\" storage slot anyway, which also contains the global\\n * metadata (it's an optimization).\\n * @param _object A 32 byte value to insert into the container.\\n * @param _globalMetadata New global metadata for the container.\\n */\\n function push(\\n bytes32 _object,\\n bytes27 _globalMetadata\\n )\\n external;\\n\\n /**\\n * Retrieves an object from the container.\\n * @param _index Index of the particular object to access.\\n * @return 32 byte object value.\\n */\\n function get(\\n uint256 _index\\n )\\n external\\n view\\n returns (\\n bytes32\\n );\\n\\n /**\\n * Removes all objects after and including a given index.\\n * @param _index Object index to delete from.\\n */\\n function deleteElementsAfterInclusive(\\n uint256 _index\\n )\\n external;\\n\\n /**\\n * Removes all objects after and including a given index. Also allows setting the global\\n * metadata field.\\n * @param _index Object index to delete from.\\n * @param _globalMetadata New global metadata for the container.\\n */\\n function deleteElementsAfterInclusive(\\n uint256 _index,\\n bytes27 _globalMetadata\\n )\\n external;\\n\\n /**\\n * Marks an index as overwritable, meaing the underlying buffer can start to write values over\\n * any objects before and including the given index.\\n */\\n function setNextOverwritableIndex(\\n uint256 _index\\n )\\n external;\\n}\\n\",\"keccak256\":\"0x2d7973a0ad84c23ec62624d3f1e3aeb198cc72686ff1e6cfa17155556b320c94\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* External Imports */\\nimport { Ownable } from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\n/**\\n * @title Lib_AddressManager\\n */\\ncontract Lib_AddressManager is Ownable {\\n\\n /**********\\n * Events *\\n **********/\\n\\n event AddressSet(\\n string _name,\\n address _newAddress\\n );\\n\\n\\n /*************\\n * Variables *\\n *************/\\n\\n mapping (bytes32 => address) private addresses;\\n\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Changes the address associated with a particular name.\\n * @param _name String name to associate an address with.\\n * @param _address Address to associate with the name.\\n */\\n function setAddress(\\n string memory _name,\\n address _address\\n )\\n public\\n onlyOwner\\n {\\n addresses[_getNameHash(_name)] = _address;\\n\\n emit AddressSet(\\n _name,\\n _address\\n );\\n }\\n\\n /**\\n * Retrieves the address associated with a given name.\\n * @param _name Name to retrieve an address for.\\n * @return Address associated with the given name.\\n */\\n function getAddress(\\n string memory _name\\n )\\n public\\n view\\n returns (\\n address\\n )\\n {\\n return addresses[_getNameHash(_name)];\\n }\\n\\n\\n /**********************\\n * Internal Functions *\\n **********************/\\n\\n /**\\n * Computes the hash of a name.\\n * @param _name Name to compute a hash for.\\n * @return Hash of the given name.\\n */\\n function _getNameHash(\\n string memory _name\\n )\\n internal\\n pure\\n returns (\\n bytes32\\n )\\n {\\n return keccak256(abi.encodePacked(_name));\\n }\\n}\\n\",\"keccak256\":\"0x2ce671a0e004df88b136bea5a3c59d0732cea8887c8496da1d509e0200b03d7d\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/resolver/Lib_AddressResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* Library Imports */\\nimport { Lib_AddressManager } from \\\"./Lib_AddressManager.sol\\\";\\n\\n/**\\n * @title Lib_AddressResolver\\n */\\nabstract contract Lib_AddressResolver {\\n\\n /*************\\n * Variables *\\n *************/\\n\\n Lib_AddressManager public libAddressManager;\\n\\n\\n /***************\\n * Constructor *\\n ***************/\\n\\n /**\\n * @param _libAddressManager Address of the Lib_AddressManager.\\n */\\n constructor(\\n address _libAddressManager\\n ) {\\n libAddressManager = Lib_AddressManager(_libAddressManager);\\n }\\n\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Resolves the address associated with a given name.\\n * @param _name Name to resolve an address for.\\n * @return Address associated with the given name.\\n */\\n function resolve(\\n string memory _name\\n )\\n public\\n view\\n returns (\\n address\\n )\\n {\\n return libAddressManager.getAddress(_name);\\n }\\n}\\n\",\"keccak256\":\"0x65981feeabff6a81783ea97d44baf988a18a86c8cb374c46fdb71819cbacc7c0\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/utils/Lib_RingBuffer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\nlibrary Lib_RingBuffer {\\n using Lib_RingBuffer for RingBuffer;\\n\\n /***********\\n * Structs *\\n ***********/\\n\\n struct Buffer {\\n uint256 length;\\n mapping (uint256 => bytes32) buf;\\n }\\n\\n struct RingBuffer {\\n bytes32 contextA;\\n bytes32 contextB;\\n Buffer bufferA;\\n Buffer bufferB;\\n uint256 nextOverwritableIndex;\\n }\\n\\n struct RingBufferContext {\\n // contextA\\n uint40 globalIndex;\\n bytes27 extraData;\\n\\n // contextB\\n uint64 currBufferIndex;\\n uint40 prevResetIndex;\\n uint40 currResetIndex;\\n }\\n\\n\\n /*************\\n * Constants *\\n *************/\\n\\n uint256 constant MIN_CAPACITY = 16;\\n\\n\\n /**********************\\n * Internal Functions *\\n **********************/\\n\\n /**\\n * Pushes a single element to the buffer.\\n * @param _self Buffer to access.\\n * @param _value Value to push to the buffer.\\n * @param _extraData Optional global extra data.\\n */\\n function push(\\n RingBuffer storage _self,\\n bytes32 _value,\\n bytes27 _extraData\\n )\\n internal\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n Buffer storage currBuffer = _self.getBuffer(ctx.currBufferIndex);\\n\\n // Set a minimum capacity.\\n if (currBuffer.length == 0) {\\n currBuffer.length = MIN_CAPACITY;\\n }\\n\\n // Check if we need to expand the buffer.\\n if (ctx.globalIndex - ctx.currResetIndex >= currBuffer.length) {\\n if (ctx.currResetIndex < _self.nextOverwritableIndex) {\\n // We're going to overwrite the inactive buffer.\\n // Bump the buffer index, reset the delete offset, and set our reset indices.\\n ctx.currBufferIndex++;\\n ctx.prevResetIndex = ctx.currResetIndex;\\n ctx.currResetIndex = ctx.globalIndex;\\n\\n // Swap over to the next buffer.\\n currBuffer = _self.getBuffer(ctx.currBufferIndex);\\n } else {\\n // We're not overwriting yet, double the length of the current buffer.\\n currBuffer.length *= 2;\\n }\\n }\\n\\n // Index to write to is the difference of the global and reset indices.\\n uint256 writeHead = ctx.globalIndex - ctx.currResetIndex;\\n currBuffer.buf[writeHead] = _value;\\n\\n // Bump the global index and insert our extra data, then save the context.\\n ctx.globalIndex++;\\n ctx.extraData = _extraData;\\n _self.setContext(ctx);\\n }\\n\\n /**\\n * Pushes a single element to the buffer.\\n * @param _self Buffer to access.\\n * @param _value Value to push to the buffer.\\n */\\n function push(\\n RingBuffer storage _self,\\n bytes32 _value\\n )\\n internal\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n\\n _self.push(\\n _value,\\n ctx.extraData\\n );\\n }\\n\\n /**\\n * Retrieves an element from the buffer.\\n * @param _self Buffer to access.\\n * @param _index Element index to retrieve.\\n * @return Value of the element at the given index.\\n */\\n function get(\\n RingBuffer storage _self,\\n uint256 _index\\n )\\n internal\\n view\\n returns (\\n bytes32\\n )\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n\\n require(\\n _index < ctx.globalIndex,\\n \\\"Index out of bounds.\\\"\\n );\\n\\n Buffer storage currBuffer = _self.getBuffer(ctx.currBufferIndex);\\n Buffer storage prevBuffer = _self.getBuffer(ctx.currBufferIndex + 1);\\n\\n if (_index >= ctx.currResetIndex) {\\n // We're trying to load an element from the current buffer.\\n // Relative index is just the difference from the reset index.\\n uint256 relativeIndex = _index - ctx.currResetIndex;\\n\\n // Shouldn't happen but why not check.\\n require(\\n relativeIndex < currBuffer.length,\\n \\\"Index out of bounds.\\\"\\n );\\n\\n return currBuffer.buf[relativeIndex];\\n } else {\\n // We're trying to load an element from the previous buffer.\\n // Relative index is the difference from the reset index in the other direction.\\n uint256 relativeIndex = ctx.currResetIndex - _index;\\n\\n // Condition only fails in the case that we deleted and flipped buffers.\\n require(\\n ctx.currResetIndex > ctx.prevResetIndex,\\n \\\"Index out of bounds.\\\"\\n );\\n\\n // Make sure we're not trying to read beyond the array.\\n require(\\n relativeIndex <= prevBuffer.length,\\n \\\"Index out of bounds.\\\"\\n );\\n\\n return prevBuffer.buf[prevBuffer.length - relativeIndex];\\n }\\n }\\n\\n /**\\n * Deletes all elements after (and including) a given index.\\n * @param _self Buffer to access.\\n * @param _index Index of the element to delete from (inclusive).\\n * @param _extraData Optional global extra data.\\n */\\n function deleteElementsAfterInclusive(\\n RingBuffer storage _self,\\n uint40 _index,\\n bytes27 _extraData\\n )\\n internal\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n\\n require(\\n _index < ctx.globalIndex && _index >= ctx.prevResetIndex,\\n \\\"Index out of bounds.\\\"\\n );\\n\\n if (_index < ctx.currResetIndex) {\\n // We're switching back to the previous buffer.\\n // Reduce the buffer index, set the current reset index back to match the previous one.\\n // We use the equality of these two values to prevent reading beyond this buffer.\\n ctx.currBufferIndex--;\\n ctx.currResetIndex = ctx.prevResetIndex;\\n }\\n\\n // Set our global index and extra data, save the context.\\n ctx.globalIndex = _index;\\n ctx.extraData = _extraData;\\n _self.setContext(ctx);\\n }\\n\\n /**\\n * Deletes all elements after (and including) a given index.\\n * @param _self Buffer to access.\\n * @param _index Index of the element to delete from (inclusive).\\n */\\n function deleteElementsAfterInclusive(\\n RingBuffer storage _self,\\n uint40 _index\\n )\\n internal\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n _self.deleteElementsAfterInclusive(\\n _index,\\n ctx.extraData\\n );\\n }\\n\\n /**\\n * Retrieves the current global index.\\n * @param _self Buffer to access.\\n * @return Current global index.\\n */\\n function getLength(\\n RingBuffer storage _self\\n )\\n internal\\n view\\n returns (\\n uint40\\n )\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n return ctx.globalIndex;\\n }\\n\\n /**\\n * Changes current global extra data.\\n * @param _self Buffer to access.\\n * @param _extraData New global extra data.\\n */\\n function setExtraData(\\n RingBuffer storage _self,\\n bytes27 _extraData\\n )\\n internal\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n ctx.extraData = _extraData;\\n _self.setContext(ctx);\\n }\\n\\n /**\\n * Retrieves the current global extra data.\\n * @param _self Buffer to access.\\n * @return Current global extra data.\\n */\\n function getExtraData(\\n RingBuffer storage _self\\n )\\n internal\\n view\\n returns (\\n bytes27\\n )\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n return ctx.extraData;\\n }\\n\\n /**\\n * Sets the current ring buffer context.\\n * @param _self Buffer to access.\\n * @param _ctx Current ring buffer context.\\n */\\n function setContext(\\n RingBuffer storage _self,\\n RingBufferContext memory _ctx\\n )\\n internal\\n {\\n bytes32 contextA;\\n bytes32 contextB;\\n\\n uint40 globalIndex = _ctx.globalIndex;\\n bytes27 extraData = _ctx.extraData;\\n assembly {\\n contextA := globalIndex\\n contextA := or(contextA, extraData)\\n }\\n\\n uint64 currBufferIndex = _ctx.currBufferIndex;\\n uint40 prevResetIndex = _ctx.prevResetIndex;\\n uint40 currResetIndex = _ctx.currResetIndex;\\n assembly {\\n contextB := currBufferIndex\\n contextB := or(contextB, shl(64, prevResetIndex))\\n contextB := or(contextB, shl(104, currResetIndex))\\n }\\n\\n if (_self.contextA != contextA) {\\n _self.contextA = contextA;\\n }\\n\\n if (_self.contextB != contextB) {\\n _self.contextB = contextB;\\n }\\n }\\n\\n /**\\n * Retrieves the current ring buffer context.\\n * @param _self Buffer to access.\\n * @return Current ring buffer context.\\n */\\n function getContext(\\n RingBuffer storage _self\\n )\\n internal\\n view\\n returns (\\n RingBufferContext memory\\n )\\n {\\n bytes32 contextA = _self.contextA;\\n bytes32 contextB = _self.contextB;\\n\\n uint40 globalIndex;\\n bytes27 extraData;\\n assembly {\\n globalIndex := and(contextA, 0x000000000000000000000000000000000000000000000000000000FFFFFFFFFF)\\n extraData := and(contextA, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000)\\n }\\n\\n uint64 currBufferIndex;\\n uint40 prevResetIndex;\\n uint40 currResetIndex;\\n assembly {\\n currBufferIndex := and(contextB, 0x000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFF)\\n prevResetIndex := shr(64, and(contextB, 0x00000000000000000000000000000000000000FFFFFFFFFF0000000000000000))\\n currResetIndex := shr(104, and(contextB, 0x0000000000000000000000000000FFFFFFFFFF00000000000000000000000000))\\n }\\n\\n return RingBufferContext({\\n globalIndex: globalIndex,\\n extraData: extraData,\\n currBufferIndex: currBufferIndex,\\n prevResetIndex: prevResetIndex,\\n currResetIndex: currResetIndex\\n });\\n }\\n\\n /**\\n * Retrieves the a buffer from the ring buffer by index.\\n * @param _self Buffer to access.\\n * @param _which Index of the sub buffer to access.\\n * @return Sub buffer for the index.\\n */\\n function getBuffer(\\n RingBuffer storage _self,\\n uint256 _which\\n )\\n internal\\n view\\n returns (\\n Buffer storage\\n )\\n {\\n return _which % 2 == 0 ? _self.bufferA : _self.bufferB;\\n }\\n}\\n\",\"keccak256\":\"0xe30fc56d4499f98582e1f800dfa3b343f171163a557266c31a56449d5fd3ffae\",\"license\":\"MIT\"}},\"version\":1}",
"bytecode": "0x60806040523480156200001157600080fd5b506040516200118d3803806200118d833981810160405260408110156200003757600080fd5b8151602083018051604051929492938301929190846401000000008211156200005f57600080fd5b9083019060208201858111156200007557600080fd5b82516401000000008111828201881017156200009057600080fd5b82525081516020918201929091019080838360005b83811015620000bf578181015183820152602001620000a5565b50505050905090810190601f168015620000ed5780820380516001836020036101000a031916815260200191505b506040525050600080546001600160a01b0319166001600160a01b038516179055508051620001249060019060208401906200012d565b505050620001d9565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282620001655760008555620001b0565b82601f106200018057805160ff1916838001178555620001b0565b82800160010185558215620001b0579182015b82811115620001b057825182559160200191906001019062000193565b50620001be929150620001c2565b5090565b5b80821115620001be5760008155600101620001c3565b610fa480620001e96000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c80634651d91e116100715780634651d91e1461021a5780638da5cb5b146102375780639507d39a146102b4578063b298e36b146102d1578063ccf8f969146102ee578063fa9e936c14610311576100b4565b8063167fd681146100b95780631f7b6d32146100e65780632015276c1461010057806329061de21461012b578063299ca47814610150578063461a447814610174575b600080fd5b6100e4600480360360408110156100cf57600080fd5b508035906020013564ffffffffff191661032e565b005b6100ee610423565b60408051918252519081900360200190f35b6100e46004803603604081101561011657600080fd5b508035906020013564ffffffffff191661043b565b6100e46004803603602081101561014157600080fd5b503564ffffffffff19166104f7565b6101586105b5565b604080516001600160a01b039092168252519081900360200190f35b6101586004803603602081101561018a57600080fd5b8101906020810181356401000000008111156101a557600080fd5b8201836020820111156101b757600080fd5b803590602001918460018302840111640100000000831117156101d957600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506105c4945050505050565b6100e46004803603602081101561023057600080fd5b50356106a0565b61023f61075b565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610279578181015183820152602001610261565b50505050905090810190601f1680156102a65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6100ee600480360360208110156102ca57600080fd5b50356107e8565b6100e4600480360360208110156102e757600080fd5b5035610802565b6102f66108bd565b6040805164ffffffffff199092168252519081900360200190f35b6100e46004803603602081101561032757600080fd5b50356108ce565b60018054604080516020601f6002600019610100878916150201909516949094049384018190048102820181019092528281526103c493909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b820191906000526020600020905b81548152906001019060200180831161039d57829003601f168201915b50505050506105c4565b6001600160a01b0316336001600160a01b0316146104135760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b61041f60028383610983565b5050565b600061042f6002610a75565b64ffffffffff16905090565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261049c93909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146104eb5760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b61041f60028383610a89565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261055893909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146105a75760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b6105b2600282610b90565b50565b6000546001600160a01b031681565b6000805460405163bf40fac160e01b81526020600482018181528551602484015285516001600160a01b039094169363bf40fac19387938392604490920191908501908083838b5b8381101561062457818101518382015260200161060c565b50505050905090810190601f1680156106515780820380516001836020036101000a031916815260200191505b509250505060206040518083038186803b15801561066e57600080fd5b505afa158015610682573d6000803e3d6000fd5b505050506040513d602081101561069857600080fd5b505192915050565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261070193909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146107505760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b6105b2600282610bba565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156107e05780601f106107b5576101008083540402835291602001916107e0565b820191906000526020600020905b8154815290600101906020018083116107c357829003601f168201915b505050505081565b60006107fc600264ffffffffff8416610be0565b92915050565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261086393909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146108b25760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b6105b2600282610de9565b60006108c96002610e0f565b905090565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261092f93909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b03161461097e5760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b600855565b600061098e84610e26565b9050806000015164ffffffffff168364ffffffffff161080156109c35750806060015164ffffffffff168364ffffffffff1610155b610a0b576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b806080015164ffffffffff168364ffffffffff161015610a4d576040810180516000190167ffffffffffffffff169052606081015164ffffffffff1660808201525b64ffffffffff8316815264ffffffffff1982166020820152610a6f8482610e86565b50505050565b600080610a8183610e26565b519392505050565b6000610a9484610e26565b90506000610ab9826040015167ffffffffffffffff1686610edc90919063ffffffff16565b8054909150610ac757601081555b8054608083015183510364ffffffffff1610610b3e578460060154826080015164ffffffffff161015610b365760408201805160010167ffffffffffffffff169081905260808301805164ffffffffff90811660608601528451169052610b2f908690610edc565b9050610b3e565b805460020281555b608082015182510364ffffffffff9081166000818152600184810160209081526040909220889055855101909216845264ffffffffff19851691840191909152610b888684610e86565b505050505050565b6000610b9b83610e26565b64ffffffffff19831660208201529050610bb58382610e86565b505050565b6000610bc583610e26565b9050610bb5828260200151856109839092919063ffffffff16565b600080610bec84610e26565b805190915064ffffffffff168310610c42576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b6000610c65826040015167ffffffffffffffff1686610edc90919063ffffffff16565b90506000610c8d836040015160010167ffffffffffffffff1687610edc90919063ffffffff16565b9050826080015164ffffffffff168510610d1a576080830151825464ffffffffff9091168603908110610cfe576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b6000908152600190920160205250604090205491506107fc9050565b6080830151606084015164ffffffffff9182168781039290911610610d7d576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b8154811115610dca576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b81540360009081526001909101602052604090205492506107fc915050565b6000610df483610e26565b9050610bb582826020015185610a899092919063ffffffff16565b600080610e1b83610e26565b602001519392505050565b610e2e610efc565b5080546001909101546040805160a08101825264ffffffffff808516825264ffffffffff19909416602082015267ffffffffffffffff8316818301529082901c8316606082015260689190911c909116608082015290565b80516020820151604080840151606085015160808601518754858717969483901b8417606883901b1795939291908714610ebe578689555b85896001015414610ed157600189018690555b505050505050505050565b60006002820615610ef05782600401610ef5565b826002015b9392505050565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101919091529056fe4f564d5f436861696e53746f72616765436f6e7461696e65723a2046756e6374696f6e2063616e206f6e6c792062652063616c6c656420627920746865206f776e65722ea2646970667358221220376cbc00341dd082d644157f6511fcd1ac26a6a924d04ae6532cfcab93d9191864736f6c63430007060033",
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100b45760003560e01c80634651d91e116100715780634651d91e1461021a5780638da5cb5b146102375780639507d39a146102b4578063b298e36b146102d1578063ccf8f969146102ee578063fa9e936c14610311576100b4565b8063167fd681146100b95780631f7b6d32146100e65780632015276c1461010057806329061de21461012b578063299ca47814610150578063461a447814610174575b600080fd5b6100e4600480360360408110156100cf57600080fd5b508035906020013564ffffffffff191661032e565b005b6100ee610423565b60408051918252519081900360200190f35b6100e46004803603604081101561011657600080fd5b508035906020013564ffffffffff191661043b565b6100e46004803603602081101561014157600080fd5b503564ffffffffff19166104f7565b6101586105b5565b604080516001600160a01b039092168252519081900360200190f35b6101586004803603602081101561018a57600080fd5b8101906020810181356401000000008111156101a557600080fd5b8201836020820111156101b757600080fd5b803590602001918460018302840111640100000000831117156101d957600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506105c4945050505050565b6100e46004803603602081101561023057600080fd5b50356106a0565b61023f61075b565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610279578181015183820152602001610261565b50505050905090810190601f1680156102a65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6100ee600480360360208110156102ca57600080fd5b50356107e8565b6100e4600480360360208110156102e757600080fd5b5035610802565b6102f66108bd565b6040805164ffffffffff199092168252519081900360200190f35b6100e46004803603602081101561032757600080fd5b50356108ce565b60018054604080516020601f6002600019610100878916150201909516949094049384018190048102820181019092528281526103c493909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b820191906000526020600020905b81548152906001019060200180831161039d57829003601f168201915b50505050506105c4565b6001600160a01b0316336001600160a01b0316146104135760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b61041f60028383610983565b5050565b600061042f6002610a75565b64ffffffffff16905090565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261049c93909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146104eb5760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b61041f60028383610a89565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261055893909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146105a75760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b6105b2600282610b90565b50565b6000546001600160a01b031681565b6000805460405163bf40fac160e01b81526020600482018181528551602484015285516001600160a01b039094169363bf40fac19387938392604490920191908501908083838b5b8381101561062457818101518382015260200161060c565b50505050905090810190601f1680156106515780820380516001836020036101000a031916815260200191505b509250505060206040518083038186803b15801561066e57600080fd5b505afa158015610682573d6000803e3d6000fd5b505050506040513d602081101561069857600080fd5b505192915050565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261070193909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146107505760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b6105b2600282610bba565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156107e05780601f106107b5576101008083540402835291602001916107e0565b820191906000526020600020905b8154815290600101906020018083116107c357829003601f168201915b505050505081565b60006107fc600264ffffffffff8416610be0565b92915050565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261086393909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146108b25760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b6105b2600282610de9565b60006108c96002610e0f565b905090565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261092f93909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b03161461097e5760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b600855565b600061098e84610e26565b9050806000015164ffffffffff168364ffffffffff161080156109c35750806060015164ffffffffff168364ffffffffff1610155b610a0b576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b806080015164ffffffffff168364ffffffffff161015610a4d576040810180516000190167ffffffffffffffff169052606081015164ffffffffff1660808201525b64ffffffffff8316815264ffffffffff1982166020820152610a6f8482610e86565b50505050565b600080610a8183610e26565b519392505050565b6000610a9484610e26565b90506000610ab9826040015167ffffffffffffffff1686610edc90919063ffffffff16565b8054909150610ac757601081555b8054608083015183510364ffffffffff1610610b3e578460060154826080015164ffffffffff161015610b365760408201805160010167ffffffffffffffff169081905260808301805164ffffffffff90811660608601528451169052610b2f908690610edc565b9050610b3e565b805460020281555b608082015182510364ffffffffff9081166000818152600184810160209081526040909220889055855101909216845264ffffffffff19851691840191909152610b888684610e86565b505050505050565b6000610b9b83610e26565b64ffffffffff19831660208201529050610bb58382610e86565b505050565b6000610bc583610e26565b9050610bb5828260200151856109839092919063ffffffff16565b600080610bec84610e26565b805190915064ffffffffff168310610c42576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b6000610c65826040015167ffffffffffffffff1686610edc90919063ffffffff16565b90506000610c8d836040015160010167ffffffffffffffff1687610edc90919063ffffffff16565b9050826080015164ffffffffff168510610d1a576080830151825464ffffffffff9091168603908110610cfe576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b6000908152600190920160205250604090205491506107fc9050565b6080830151606084015164ffffffffff9182168781039290911610610d7d576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b8154811115610dca576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b81540360009081526001909101602052604090205492506107fc915050565b6000610df483610e26565b9050610bb582826020015185610a899092919063ffffffff16565b600080610e1b83610e26565b602001519392505050565b610e2e610efc565b5080546001909101546040805160a08101825264ffffffffff808516825264ffffffffff19909416602082015267ffffffffffffffff8316818301529082901c8316606082015260689190911c909116608082015290565b80516020820151604080840151606085015160808601518754858717969483901b8417606883901b1795939291908714610ebe578689555b85896001015414610ed157600189018690555b505050505050505050565b60006002820615610ef05782600401610ef5565b826002015b9392505050565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101919091529056fe4f564d5f436861696e53746f72616765436f6e7461696e65723a2046756e6374696f6e2063616e206f6e6c792062652063616c6c656420627920746865206f776e65722ea2646970667358221220376cbc00341dd082d644157f6511fcd1ac26a6a924d04ae6532cfcab93d9191864736f6c63430007060033",
"devdoc": {
"details": "The Chain Storage Container provides its owner contract with read, write and delete functionality. This provides gas efficiency gains by enabling it to overwrite storage slots which can no longer be used in a fraud proof due to the fraud window having passed, and the associated chain state or transactions being finalized. Three distinct Chain Storage Containers will be deployed on Layer 1: 1. Stores transaction batches for the Canonical Transaction Chain 2. Stores queued transactions for the Canonical Transaction Chain 3. Stores chain state batches for the State Commitment Chain Compiler used: solc Runtime target: EVM",
"kind": "dev",
"methods": {
"constructor": {
"params": {
"_libAddressManager": "Address of the Address Manager.",
"_owner": "Name of the contract that owns this container (will be resolved later)."
}
},
"deleteElementsAfterInclusive(uint256)": {
"params": {
"_index": "Object index to delete from."
}
},
"deleteElementsAfterInclusive(uint256,bytes27)": {
"params": {
"_globalMetadata": "New global metadata for the container.",
"_index": "Object index to delete from."
}
},
"get(uint256)": {
"params": {
"_index": "Index of the particular object to access."
},
"returns": {
"_0": "32 byte object value."
}
},
"getGlobalMetadata()": {
"returns": {
"_0": "Container global metadata field."
}
},
"length()": {
"returns": {
"_0": "Number of objects in the container."
}
},
"push(bytes32)": {
"params": {
"_object": "A 32 byte value to insert into the container."
}
},
"push(bytes32,bytes27)": {
"params": {
"_globalMetadata": "New global metadata for the container.",
"_object": "A 32 byte value to insert into the container."
}
},
"resolve(string)": {
"params": {
"_name": "Name to resolve an address for."
},
"returns": {
"_0": "Address associated with the given name."
}
},
"setGlobalMetadata(bytes27)": {
"params": {
"_globalMetadata": "New global metadata to set."
}
}
},
"title": "OVM_ChainStorageContainer",
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {
"deleteElementsAfterInclusive(uint256)": {
"notice": "Removes all objects after and including a given index."
},
"deleteElementsAfterInclusive(uint256,bytes27)": {
"notice": "Removes all objects after and including a given index. Also allows setting the global metadata field."
},
"get(uint256)": {
"notice": "Retrieves an object from the container."
},
"getGlobalMetadata()": {
"notice": "Retrieves the container's global metadata field."
},
"length()": {
"notice": "Retrieves the number of objects stored in the container."
},
"push(bytes32)": {
"notice": "Pushes an object into the container."
},
"push(bytes32,bytes27)": {
"notice": "Pushes an object into the container. Function allows setting the global metadata since we'll need to touch the \"length\" storage slot anyway, which also contains the global metadata (it's an optimization)."
},
"resolve(string)": {
"notice": "Resolves the address associated with a given name."
},
"setGlobalMetadata(bytes27)": {
"notice": "Sets the container's global metadata field. We're using `bytes27` here because we use five bytes to maintain the length of the underlying data structure, meaning we have an extra 27 bytes to store arbitrary data."
},
"setNextOverwritableIndex(uint256)": {
"notice": "Marks an index as overwritable, meaing the underlying buffer can start to write values over any objects before and including the given index."
}
},
"version": 1
},
"storageLayout": {
"storage": [
{
"astId": 12055,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "libAddressManager",
"offset": 0,
"slot": "0",
"type": "t_contract(Lib_AddressManager)12048"
},
{
"astId": 3712,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "owner",
"offset": 0,
"slot": "1",
"type": "t_string_storage"
},
{
"astId": 3714,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "buffer",
"offset": 0,
"slot": "2",
"type": "t_struct(RingBuffer)17101_storage"
}
],
"types": {
"t_bytes32": {
"encoding": "inplace",
"label": "bytes32",
"numberOfBytes": "32"
},
"t_contract(Lib_AddressManager)12048": {
"encoding": "inplace",
"label": "contract Lib_AddressManager",
"numberOfBytes": "20"
},
"t_mapping(t_uint256,t_bytes32)": {
"encoding": "mapping",
"key": "t_uint256",
"label": "mapping(uint256 => bytes32)",
"numberOfBytes": "32",
"value": "t_bytes32"
},
"t_string_storage": {
"encoding": "bytes",
"label": "string",
"numberOfBytes": "32"
},
"t_struct(Buffer)17090_storage": {
"encoding": "inplace",
"label": "struct Lib_RingBuffer.Buffer",
"members": [
{
"astId": 17085,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "length",
"offset": 0,
"slot": "0",
"type": "t_uint256"
},
{
"astId": 17089,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "buf",
"offset": 0,
"slot": "1",
"type": "t_mapping(t_uint256,t_bytes32)"
}
],
"numberOfBytes": "64"
},
"t_struct(RingBuffer)17101_storage": {
"encoding": "inplace",
"label": "struct Lib_RingBuffer.RingBuffer",
"members": [
{
"astId": 17092,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "contextA",
"offset": 0,
"slot": "0",
"type": "t_bytes32"
},
{
"astId": 17094,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "contextB",
"offset": 0,
"slot": "1",
"type": "t_bytes32"
},
{
"astId": 17096,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "bufferA",
"offset": 0,
"slot": "2",
"type": "t_struct(Buffer)17090_storage"
},
{
"astId": 17098,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "bufferB",
"offset": 0,
"slot": "4",
"type": "t_struct(Buffer)17090_storage"
},
{
"astId": 17100,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "nextOverwritableIndex",
"offset": 0,
"slot": "6",
"type": "t_uint256"
}
],
"numberOfBytes": "224"
},
"t_uint256": {
"encoding": "inplace",
"label": "uint256",
"numberOfBytes": "32"
}
}
}
}
\ No newline at end of file
{
"address": "0x2A622E327D7A204b39355202d41BD9B752C8df54",
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "_libAddressManager",
"type": "address"
},
{
"internalType": "string",
"name": "_owner",
"type": "string"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_index",
"type": "uint256"
},
{
"internalType": "bytes27",
"name": "_globalMetadata",
"type": "bytes27"
}
],
"name": "deleteElementsAfterInclusive",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_index",
"type": "uint256"
}
],
"name": "deleteElementsAfterInclusive",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_index",
"type": "uint256"
}
],
"name": "get",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getGlobalMetadata",
"outputs": [
{
"internalType": "bytes27",
"name": "",
"type": "bytes27"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "length",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "libAddressManager",
"outputs": [
{
"internalType": "contract Lib_AddressManager",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "_object",
"type": "bytes32"
},
{
"internalType": "bytes27",
"name": "_globalMetadata",
"type": "bytes27"
}
],
"name": "push",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "_object",
"type": "bytes32"
}
],
"name": "push",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "_name",
"type": "string"
}
],
"name": "resolve",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes27",
"name": "_globalMetadata",
"type": "bytes27"
}
],
"name": "setGlobalMetadata",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_index",
"type": "uint256"
}
],
"name": "setNextOverwritableIndex",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"transactionHash": "0x60b610c9b4ebbbbfb38e22d209b0d25a52527cb323941014114a4a2c362e2863",
"receipt": {
"to": null,
"from": "0x4107438C1b1579f258AF9d1AC06194C4a0F55040",
"contractAddress": "0x2A622E327D7A204b39355202d41BD9B752C8df54",
"transactionIndex": 3,
"gasUsed": "970930",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blockHash": "0xa654708146fc0e44c144ff624caea84d6cf5519c3421882cacb260ca6823123b",
"transactionHash": "0x60b610c9b4ebbbbfb38e22d209b0d25a52527cb323941014114a4a2c362e2863",
"logs": [],
"blockNumber": 4694097,
"cumulativeGasUsed": "1184521",
"status": 1,
"byzantium": true
},
"args": [
"0xE3d08F0D900A2D53cB794cf82d7127764BcC3092",
"OVM_StateCommitmentChain"
],
"solcInputHash": "dde656dd41f49cad9eac9bc7065fd6a7",
"metadata": "{\"compiler\":{\"version\":\"0.7.6+commit.7338295f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_libAddressManager\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_owner\",\"type\":\"string\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_index\",\"type\":\"uint256\"},{\"internalType\":\"bytes27\",\"name\":\"_globalMetadata\",\"type\":\"bytes27\"}],\"name\":\"deleteElementsAfterInclusive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_index\",\"type\":\"uint256\"}],\"name\":\"deleteElementsAfterInclusive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_index\",\"type\":\"uint256\"}],\"name\":\"get\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getGlobalMetadata\",\"outputs\":[{\"internalType\":\"bytes27\",\"name\":\"\",\"type\":\"bytes27\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"length\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"libAddressManager\",\"outputs\":[{\"internalType\":\"contract Lib_AddressManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_object\",\"type\":\"bytes32\"},{\"internalType\":\"bytes27\",\"name\":\"_globalMetadata\",\"type\":\"bytes27\"}],\"name\":\"push\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_object\",\"type\":\"bytes32\"}],\"name\":\"push\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes27\",\"name\":\"_globalMetadata\",\"type\":\"bytes27\"}],\"name\":\"setGlobalMetadata\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_index\",\"type\":\"uint256\"}],\"name\":\"setNextOverwritableIndex\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"The Chain Storage Container provides its owner contract with read, write and delete functionality. This provides gas efficiency gains by enabling it to overwrite storage slots which can no longer be used in a fraud proof due to the fraud window having passed, and the associated chain state or transactions being finalized. Three distinct Chain Storage Containers will be deployed on Layer 1: 1. Stores transaction batches for the Canonical Transaction Chain 2. Stores queued transactions for the Canonical Transaction Chain 3. Stores chain state batches for the State Commitment Chain Compiler used: solc Runtime target: EVM\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"params\":{\"_libAddressManager\":\"Address of the Address Manager.\",\"_owner\":\"Name of the contract that owns this container (will be resolved later).\"}},\"deleteElementsAfterInclusive(uint256)\":{\"params\":{\"_index\":\"Object index to delete from.\"}},\"deleteElementsAfterInclusive(uint256,bytes27)\":{\"params\":{\"_globalMetadata\":\"New global metadata for the container.\",\"_index\":\"Object index to delete from.\"}},\"get(uint256)\":{\"params\":{\"_index\":\"Index of the particular object to access.\"},\"returns\":{\"_0\":\"32 byte object value.\"}},\"getGlobalMetadata()\":{\"returns\":{\"_0\":\"Container global metadata field.\"}},\"length()\":{\"returns\":{\"_0\":\"Number of objects in the container.\"}},\"push(bytes32)\":{\"params\":{\"_object\":\"A 32 byte value to insert into the container.\"}},\"push(bytes32,bytes27)\":{\"params\":{\"_globalMetadata\":\"New global metadata for the container.\",\"_object\":\"A 32 byte value to insert into the container.\"}},\"resolve(string)\":{\"params\":{\"_name\":\"Name to resolve an address for.\"},\"returns\":{\"_0\":\"Address associated with the given name.\"}},\"setGlobalMetadata(bytes27)\":{\"params\":{\"_globalMetadata\":\"New global metadata to set.\"}}},\"title\":\"OVM_ChainStorageContainer\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"deleteElementsAfterInclusive(uint256)\":{\"notice\":\"Removes all objects after and including a given index.\"},\"deleteElementsAfterInclusive(uint256,bytes27)\":{\"notice\":\"Removes all objects after and including a given index. Also allows setting the global metadata field.\"},\"get(uint256)\":{\"notice\":\"Retrieves an object from the container.\"},\"getGlobalMetadata()\":{\"notice\":\"Retrieves the container's global metadata field.\"},\"length()\":{\"notice\":\"Retrieves the number of objects stored in the container.\"},\"push(bytes32)\":{\"notice\":\"Pushes an object into the container.\"},\"push(bytes32,bytes27)\":{\"notice\":\"Pushes an object into the container. Function allows setting the global metadata since we'll need to touch the \\\"length\\\" storage slot anyway, which also contains the global metadata (it's an optimization).\"},\"resolve(string)\":{\"notice\":\"Resolves the address associated with a given name.\"},\"setGlobalMetadata(bytes27)\":{\"notice\":\"Sets the container's global metadata field. We're using `bytes27` here because we use five bytes to maintain the length of the underlying data structure, meaning we have an extra 27 bytes to store arbitrary data.\"},\"setNextOverwritableIndex(uint256)\":{\"notice\":\"Marks an index as overwritable, meaing the underlying buffer can start to write values over any objects before and including the given index.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol\":\"OVM_ChainStorageContainer\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor () internal {\\n address msgSender = _msgSender();\\n _owner = msgSender;\\n emit OwnershipTransferred(address(0), msgSender);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x15e2d5bd4c28a88548074c54d220e8086f638a71ed07e6b3ba5a70066fcf458d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with GSN meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address payable) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes memory) {\\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x8d3cb350f04ff49cfb10aef08d87f19dcbaecc8027b0bed12f3275cd12f38cf0\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* Library Imports */\\nimport { Lib_RingBuffer } from \\\"../../libraries/utils/Lib_RingBuffer.sol\\\";\\nimport { Lib_AddressResolver } from \\\"../../libraries/resolver/Lib_AddressResolver.sol\\\";\\n\\n/* Interface Imports */\\nimport { iOVM_ChainStorageContainer } from \\\"../../iOVM/chain/iOVM_ChainStorageContainer.sol\\\";\\n\\n/**\\n * @title OVM_ChainStorageContainer\\n * @dev The Chain Storage Container provides its owner contract with read, write and delete functionality.\\n * This provides gas efficiency gains by enabling it to overwrite storage slots which can no longer be used\\n * in a fraud proof due to the fraud window having passed, and the associated chain state or\\n * transactions being finalized.\\n * Three distinct Chain Storage Containers will be deployed on Layer 1:\\n * 1. Stores transaction batches for the Canonical Transaction Chain\\n * 2. Stores queued transactions for the Canonical Transaction Chain\\n * 3. Stores chain state batches for the State Commitment Chain\\n *\\n * Compiler used: solc\\n * Runtime target: EVM\\n */\\ncontract OVM_ChainStorageContainer is iOVM_ChainStorageContainer, Lib_AddressResolver {\\n\\n /*************\\n * Libraries *\\n *************/\\n\\n using Lib_RingBuffer for Lib_RingBuffer.RingBuffer;\\n\\n\\n /*************\\n * Variables *\\n *************/\\n\\n string public owner;\\n Lib_RingBuffer.RingBuffer internal buffer;\\n\\n\\n /***************\\n * Constructor *\\n ***************/\\n\\n /**\\n * @param _libAddressManager Address of the Address Manager.\\n * @param _owner Name of the contract that owns this container (will be resolved later).\\n */\\n constructor(\\n address _libAddressManager,\\n string memory _owner\\n )\\n Lib_AddressResolver(_libAddressManager)\\n {\\n owner = _owner;\\n }\\n\\n\\n /**********************\\n * Function Modifiers *\\n **********************/\\n\\n modifier onlyOwner() {\\n require(\\n msg.sender == resolve(owner),\\n \\\"OVM_ChainStorageContainer: Function can only be called by the owner.\\\"\\n );\\n _;\\n }\\n\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function setGlobalMetadata(\\n bytes27 _globalMetadata\\n )\\n override\\n public\\n onlyOwner\\n {\\n return buffer.setExtraData(_globalMetadata);\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function getGlobalMetadata()\\n override\\n public\\n view\\n returns (\\n bytes27\\n )\\n {\\n return buffer.getExtraData();\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function length()\\n override\\n public\\n view\\n returns (\\n uint256\\n )\\n {\\n return uint256(buffer.getLength());\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function push(\\n bytes32 _object\\n )\\n override\\n public\\n onlyOwner\\n {\\n buffer.push(_object);\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function push(\\n bytes32 _object,\\n bytes27 _globalMetadata\\n )\\n override\\n public\\n onlyOwner\\n {\\n buffer.push(_object, _globalMetadata);\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function get(\\n uint256 _index\\n )\\n override\\n public\\n view\\n returns (\\n bytes32\\n )\\n {\\n return buffer.get(uint40(_index));\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function deleteElementsAfterInclusive(\\n uint256 _index\\n )\\n override\\n public\\n onlyOwner\\n {\\n buffer.deleteElementsAfterInclusive(\\n uint40(_index)\\n );\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function deleteElementsAfterInclusive(\\n uint256 _index,\\n bytes27 _globalMetadata\\n )\\n override\\n public\\n onlyOwner\\n {\\n buffer.deleteElementsAfterInclusive(\\n uint40(_index),\\n _globalMetadata\\n );\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function setNextOverwritableIndex(\\n uint256 _index\\n )\\n override\\n public\\n onlyOwner\\n {\\n buffer.nextOverwritableIndex = _index;\\n }\\n}\\n\",\"keccak256\":\"0x93325c961516aa2a22bf1aacf4029353d5e3b693e04b485753170337b50224e6\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/iOVM/chain/iOVM_ChainStorageContainer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/**\\n * @title iOVM_ChainStorageContainer\\n */\\ninterface iOVM_ChainStorageContainer {\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Sets the container's global metadata field. We're using `bytes27` here because we use five\\n * bytes to maintain the length of the underlying data structure, meaning we have an extra\\n * 27 bytes to store arbitrary data.\\n * @param _globalMetadata New global metadata to set.\\n */\\n function setGlobalMetadata(\\n bytes27 _globalMetadata\\n )\\n external;\\n\\n /**\\n * Retrieves the container's global metadata field.\\n * @return Container global metadata field.\\n */\\n function getGlobalMetadata()\\n external\\n view\\n returns (\\n bytes27\\n );\\n\\n /**\\n * Retrieves the number of objects stored in the container.\\n * @return Number of objects in the container.\\n */\\n function length()\\n external\\n view\\n returns (\\n uint256\\n );\\n\\n /**\\n * Pushes an object into the container.\\n * @param _object A 32 byte value to insert into the container.\\n */\\n function push(\\n bytes32 _object\\n )\\n external;\\n\\n /**\\n * Pushes an object into the container. Function allows setting the global metadata since\\n * we'll need to touch the \\\"length\\\" storage slot anyway, which also contains the global\\n * metadata (it's an optimization).\\n * @param _object A 32 byte value to insert into the container.\\n * @param _globalMetadata New global metadata for the container.\\n */\\n function push(\\n bytes32 _object,\\n bytes27 _globalMetadata\\n )\\n external;\\n\\n /**\\n * Retrieves an object from the container.\\n * @param _index Index of the particular object to access.\\n * @return 32 byte object value.\\n */\\n function get(\\n uint256 _index\\n )\\n external\\n view\\n returns (\\n bytes32\\n );\\n\\n /**\\n * Removes all objects after and including a given index.\\n * @param _index Object index to delete from.\\n */\\n function deleteElementsAfterInclusive(\\n uint256 _index\\n )\\n external;\\n\\n /**\\n * Removes all objects after and including a given index. Also allows setting the global\\n * metadata field.\\n * @param _index Object index to delete from.\\n * @param _globalMetadata New global metadata for the container.\\n */\\n function deleteElementsAfterInclusive(\\n uint256 _index,\\n bytes27 _globalMetadata\\n )\\n external;\\n\\n /**\\n * Marks an index as overwritable, meaing the underlying buffer can start to write values over\\n * any objects before and including the given index.\\n */\\n function setNextOverwritableIndex(\\n uint256 _index\\n )\\n external;\\n}\\n\",\"keccak256\":\"0x2d7973a0ad84c23ec62624d3f1e3aeb198cc72686ff1e6cfa17155556b320c94\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* External Imports */\\nimport { Ownable } from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\n/**\\n * @title Lib_AddressManager\\n */\\ncontract Lib_AddressManager is Ownable {\\n\\n /**********\\n * Events *\\n **********/\\n\\n event AddressSet(\\n string _name,\\n address _newAddress\\n );\\n\\n\\n /*************\\n * Variables *\\n *************/\\n\\n mapping (bytes32 => address) private addresses;\\n\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Changes the address associated with a particular name.\\n * @param _name String name to associate an address with.\\n * @param _address Address to associate with the name.\\n */\\n function setAddress(\\n string memory _name,\\n address _address\\n )\\n public\\n onlyOwner\\n {\\n addresses[_getNameHash(_name)] = _address;\\n\\n emit AddressSet(\\n _name,\\n _address\\n );\\n }\\n\\n /**\\n * Retrieves the address associated with a given name.\\n * @param _name Name to retrieve an address for.\\n * @return Address associated with the given name.\\n */\\n function getAddress(\\n string memory _name\\n )\\n public\\n view\\n returns (\\n address\\n )\\n {\\n return addresses[_getNameHash(_name)];\\n }\\n\\n\\n /**********************\\n * Internal Functions *\\n **********************/\\n\\n /**\\n * Computes the hash of a name.\\n * @param _name Name to compute a hash for.\\n * @return Hash of the given name.\\n */\\n function _getNameHash(\\n string memory _name\\n )\\n internal\\n pure\\n returns (\\n bytes32\\n )\\n {\\n return keccak256(abi.encodePacked(_name));\\n }\\n}\\n\",\"keccak256\":\"0x2ce671a0e004df88b136bea5a3c59d0732cea8887c8496da1d509e0200b03d7d\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/resolver/Lib_AddressResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* Library Imports */\\nimport { Lib_AddressManager } from \\\"./Lib_AddressManager.sol\\\";\\n\\n/**\\n * @title Lib_AddressResolver\\n */\\nabstract contract Lib_AddressResolver {\\n\\n /*************\\n * Variables *\\n *************/\\n\\n Lib_AddressManager public libAddressManager;\\n\\n\\n /***************\\n * Constructor *\\n ***************/\\n\\n /**\\n * @param _libAddressManager Address of the Lib_AddressManager.\\n */\\n constructor(\\n address _libAddressManager\\n ) {\\n libAddressManager = Lib_AddressManager(_libAddressManager);\\n }\\n\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Resolves the address associated with a given name.\\n * @param _name Name to resolve an address for.\\n * @return Address associated with the given name.\\n */\\n function resolve(\\n string memory _name\\n )\\n public\\n view\\n returns (\\n address\\n )\\n {\\n return libAddressManager.getAddress(_name);\\n }\\n}\\n\",\"keccak256\":\"0x65981feeabff6a81783ea97d44baf988a18a86c8cb374c46fdb71819cbacc7c0\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/utils/Lib_RingBuffer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\nlibrary Lib_RingBuffer {\\n using Lib_RingBuffer for RingBuffer;\\n\\n /***********\\n * Structs *\\n ***********/\\n\\n struct Buffer {\\n uint256 length;\\n mapping (uint256 => bytes32) buf;\\n }\\n\\n struct RingBuffer {\\n bytes32 contextA;\\n bytes32 contextB;\\n Buffer bufferA;\\n Buffer bufferB;\\n uint256 nextOverwritableIndex;\\n }\\n\\n struct RingBufferContext {\\n // contextA\\n uint40 globalIndex;\\n bytes27 extraData;\\n\\n // contextB\\n uint64 currBufferIndex;\\n uint40 prevResetIndex;\\n uint40 currResetIndex;\\n }\\n\\n\\n /*************\\n * Constants *\\n *************/\\n\\n uint256 constant MIN_CAPACITY = 16;\\n\\n\\n /**********************\\n * Internal Functions *\\n **********************/\\n\\n /**\\n * Pushes a single element to the buffer.\\n * @param _self Buffer to access.\\n * @param _value Value to push to the buffer.\\n * @param _extraData Optional global extra data.\\n */\\n function push(\\n RingBuffer storage _self,\\n bytes32 _value,\\n bytes27 _extraData\\n )\\n internal\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n Buffer storage currBuffer = _self.getBuffer(ctx.currBufferIndex);\\n\\n // Set a minimum capacity.\\n if (currBuffer.length == 0) {\\n currBuffer.length = MIN_CAPACITY;\\n }\\n\\n // Check if we need to expand the buffer.\\n if (ctx.globalIndex - ctx.currResetIndex >= currBuffer.length) {\\n if (ctx.currResetIndex < _self.nextOverwritableIndex) {\\n // We're going to overwrite the inactive buffer.\\n // Bump the buffer index, reset the delete offset, and set our reset indices.\\n ctx.currBufferIndex++;\\n ctx.prevResetIndex = ctx.currResetIndex;\\n ctx.currResetIndex = ctx.globalIndex;\\n\\n // Swap over to the next buffer.\\n currBuffer = _self.getBuffer(ctx.currBufferIndex);\\n } else {\\n // We're not overwriting yet, double the length of the current buffer.\\n currBuffer.length *= 2;\\n }\\n }\\n\\n // Index to write to is the difference of the global and reset indices.\\n uint256 writeHead = ctx.globalIndex - ctx.currResetIndex;\\n currBuffer.buf[writeHead] = _value;\\n\\n // Bump the global index and insert our extra data, then save the context.\\n ctx.globalIndex++;\\n ctx.extraData = _extraData;\\n _self.setContext(ctx);\\n }\\n\\n /**\\n * Pushes a single element to the buffer.\\n * @param _self Buffer to access.\\n * @param _value Value to push to the buffer.\\n */\\n function push(\\n RingBuffer storage _self,\\n bytes32 _value\\n )\\n internal\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n\\n _self.push(\\n _value,\\n ctx.extraData\\n );\\n }\\n\\n /**\\n * Retrieves an element from the buffer.\\n * @param _self Buffer to access.\\n * @param _index Element index to retrieve.\\n * @return Value of the element at the given index.\\n */\\n function get(\\n RingBuffer storage _self,\\n uint256 _index\\n )\\n internal\\n view\\n returns (\\n bytes32\\n )\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n\\n require(\\n _index < ctx.globalIndex,\\n \\\"Index out of bounds.\\\"\\n );\\n\\n Buffer storage currBuffer = _self.getBuffer(ctx.currBufferIndex);\\n Buffer storage prevBuffer = _self.getBuffer(ctx.currBufferIndex + 1);\\n\\n if (_index >= ctx.currResetIndex) {\\n // We're trying to load an element from the current buffer.\\n // Relative index is just the difference from the reset index.\\n uint256 relativeIndex = _index - ctx.currResetIndex;\\n\\n // Shouldn't happen but why not check.\\n require(\\n relativeIndex < currBuffer.length,\\n \\\"Index out of bounds.\\\"\\n );\\n\\n return currBuffer.buf[relativeIndex];\\n } else {\\n // We're trying to load an element from the previous buffer.\\n // Relative index is the difference from the reset index in the other direction.\\n uint256 relativeIndex = ctx.currResetIndex - _index;\\n\\n // Condition only fails in the case that we deleted and flipped buffers.\\n require(\\n ctx.currResetIndex > ctx.prevResetIndex,\\n \\\"Index out of bounds.\\\"\\n );\\n\\n // Make sure we're not trying to read beyond the array.\\n require(\\n relativeIndex <= prevBuffer.length,\\n \\\"Index out of bounds.\\\"\\n );\\n\\n return prevBuffer.buf[prevBuffer.length - relativeIndex];\\n }\\n }\\n\\n /**\\n * Deletes all elements after (and including) a given index.\\n * @param _self Buffer to access.\\n * @param _index Index of the element to delete from (inclusive).\\n * @param _extraData Optional global extra data.\\n */\\n function deleteElementsAfterInclusive(\\n RingBuffer storage _self,\\n uint40 _index,\\n bytes27 _extraData\\n )\\n internal\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n\\n require(\\n _index < ctx.globalIndex && _index >= ctx.prevResetIndex,\\n \\\"Index out of bounds.\\\"\\n );\\n\\n if (_index < ctx.currResetIndex) {\\n // We're switching back to the previous buffer.\\n // Reduce the buffer index, set the current reset index back to match the previous one.\\n // We use the equality of these two values to prevent reading beyond this buffer.\\n ctx.currBufferIndex--;\\n ctx.currResetIndex = ctx.prevResetIndex;\\n }\\n\\n // Set our global index and extra data, save the context.\\n ctx.globalIndex = _index;\\n ctx.extraData = _extraData;\\n _self.setContext(ctx);\\n }\\n\\n /**\\n * Deletes all elements after (and including) a given index.\\n * @param _self Buffer to access.\\n * @param _index Index of the element to delete from (inclusive).\\n */\\n function deleteElementsAfterInclusive(\\n RingBuffer storage _self,\\n uint40 _index\\n )\\n internal\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n _self.deleteElementsAfterInclusive(\\n _index,\\n ctx.extraData\\n );\\n }\\n\\n /**\\n * Retrieves the current global index.\\n * @param _self Buffer to access.\\n * @return Current global index.\\n */\\n function getLength(\\n RingBuffer storage _self\\n )\\n internal\\n view\\n returns (\\n uint40\\n )\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n return ctx.globalIndex;\\n }\\n\\n /**\\n * Changes current global extra data.\\n * @param _self Buffer to access.\\n * @param _extraData New global extra data.\\n */\\n function setExtraData(\\n RingBuffer storage _self,\\n bytes27 _extraData\\n )\\n internal\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n ctx.extraData = _extraData;\\n _self.setContext(ctx);\\n }\\n\\n /**\\n * Retrieves the current global extra data.\\n * @param _self Buffer to access.\\n * @return Current global extra data.\\n */\\n function getExtraData(\\n RingBuffer storage _self\\n )\\n internal\\n view\\n returns (\\n bytes27\\n )\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n return ctx.extraData;\\n }\\n\\n /**\\n * Sets the current ring buffer context.\\n * @param _self Buffer to access.\\n * @param _ctx Current ring buffer context.\\n */\\n function setContext(\\n RingBuffer storage _self,\\n RingBufferContext memory _ctx\\n )\\n internal\\n {\\n bytes32 contextA;\\n bytes32 contextB;\\n\\n uint40 globalIndex = _ctx.globalIndex;\\n bytes27 extraData = _ctx.extraData;\\n assembly {\\n contextA := globalIndex\\n contextA := or(contextA, extraData)\\n }\\n\\n uint64 currBufferIndex = _ctx.currBufferIndex;\\n uint40 prevResetIndex = _ctx.prevResetIndex;\\n uint40 currResetIndex = _ctx.currResetIndex;\\n assembly {\\n contextB := currBufferIndex\\n contextB := or(contextB, shl(64, prevResetIndex))\\n contextB := or(contextB, shl(104, currResetIndex))\\n }\\n\\n if (_self.contextA != contextA) {\\n _self.contextA = contextA;\\n }\\n\\n if (_self.contextB != contextB) {\\n _self.contextB = contextB;\\n }\\n }\\n\\n /**\\n * Retrieves the current ring buffer context.\\n * @param _self Buffer to access.\\n * @return Current ring buffer context.\\n */\\n function getContext(\\n RingBuffer storage _self\\n )\\n internal\\n view\\n returns (\\n RingBufferContext memory\\n )\\n {\\n bytes32 contextA = _self.contextA;\\n bytes32 contextB = _self.contextB;\\n\\n uint40 globalIndex;\\n bytes27 extraData;\\n assembly {\\n globalIndex := and(contextA, 0x000000000000000000000000000000000000000000000000000000FFFFFFFFFF)\\n extraData := and(contextA, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000)\\n }\\n\\n uint64 currBufferIndex;\\n uint40 prevResetIndex;\\n uint40 currResetIndex;\\n assembly {\\n currBufferIndex := and(contextB, 0x000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFF)\\n prevResetIndex := shr(64, and(contextB, 0x00000000000000000000000000000000000000FFFFFFFFFF0000000000000000))\\n currResetIndex := shr(104, and(contextB, 0x0000000000000000000000000000FFFFFFFFFF00000000000000000000000000))\\n }\\n\\n return RingBufferContext({\\n globalIndex: globalIndex,\\n extraData: extraData,\\n currBufferIndex: currBufferIndex,\\n prevResetIndex: prevResetIndex,\\n currResetIndex: currResetIndex\\n });\\n }\\n\\n /**\\n * Retrieves the a buffer from the ring buffer by index.\\n * @param _self Buffer to access.\\n * @param _which Index of the sub buffer to access.\\n * @return Sub buffer for the index.\\n */\\n function getBuffer(\\n RingBuffer storage _self,\\n uint256 _which\\n )\\n internal\\n view\\n returns (\\n Buffer storage\\n )\\n {\\n return _which % 2 == 0 ? _self.bufferA : _self.bufferB;\\n }\\n}\\n\",\"keccak256\":\"0xe30fc56d4499f98582e1f800dfa3b343f171163a557266c31a56449d5fd3ffae\",\"license\":\"MIT\"}},\"version\":1}",
"bytecode": "0x60806040523480156200001157600080fd5b506040516200118d3803806200118d833981810160405260408110156200003757600080fd5b8151602083018051604051929492938301929190846401000000008211156200005f57600080fd5b9083019060208201858111156200007557600080fd5b82516401000000008111828201881017156200009057600080fd5b82525081516020918201929091019080838360005b83811015620000bf578181015183820152602001620000a5565b50505050905090810190601f168015620000ed5780820380516001836020036101000a031916815260200191505b506040525050600080546001600160a01b0319166001600160a01b038516179055508051620001249060019060208401906200012d565b505050620001d9565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282620001655760008555620001b0565b82601f106200018057805160ff1916838001178555620001b0565b82800160010185558215620001b0579182015b82811115620001b057825182559160200191906001019062000193565b50620001be929150620001c2565b5090565b5b80821115620001be5760008155600101620001c3565b610fa480620001e96000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c80634651d91e116100715780634651d91e1461021a5780638da5cb5b146102375780639507d39a146102b4578063b298e36b146102d1578063ccf8f969146102ee578063fa9e936c14610311576100b4565b8063167fd681146100b95780631f7b6d32146100e65780632015276c1461010057806329061de21461012b578063299ca47814610150578063461a447814610174575b600080fd5b6100e4600480360360408110156100cf57600080fd5b508035906020013564ffffffffff191661032e565b005b6100ee610423565b60408051918252519081900360200190f35b6100e46004803603604081101561011657600080fd5b508035906020013564ffffffffff191661043b565b6100e46004803603602081101561014157600080fd5b503564ffffffffff19166104f7565b6101586105b5565b604080516001600160a01b039092168252519081900360200190f35b6101586004803603602081101561018a57600080fd5b8101906020810181356401000000008111156101a557600080fd5b8201836020820111156101b757600080fd5b803590602001918460018302840111640100000000831117156101d957600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506105c4945050505050565b6100e46004803603602081101561023057600080fd5b50356106a0565b61023f61075b565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610279578181015183820152602001610261565b50505050905090810190601f1680156102a65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6100ee600480360360208110156102ca57600080fd5b50356107e8565b6100e4600480360360208110156102e757600080fd5b5035610802565b6102f66108bd565b6040805164ffffffffff199092168252519081900360200190f35b6100e46004803603602081101561032757600080fd5b50356108ce565b60018054604080516020601f6002600019610100878916150201909516949094049384018190048102820181019092528281526103c493909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b820191906000526020600020905b81548152906001019060200180831161039d57829003601f168201915b50505050506105c4565b6001600160a01b0316336001600160a01b0316146104135760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b61041f60028383610983565b5050565b600061042f6002610a75565b64ffffffffff16905090565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261049c93909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146104eb5760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b61041f60028383610a89565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261055893909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146105a75760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b6105b2600282610b90565b50565b6000546001600160a01b031681565b6000805460405163bf40fac160e01b81526020600482018181528551602484015285516001600160a01b039094169363bf40fac19387938392604490920191908501908083838b5b8381101561062457818101518382015260200161060c565b50505050905090810190601f1680156106515780820380516001836020036101000a031916815260200191505b509250505060206040518083038186803b15801561066e57600080fd5b505afa158015610682573d6000803e3d6000fd5b505050506040513d602081101561069857600080fd5b505192915050565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261070193909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146107505760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b6105b2600282610bba565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156107e05780601f106107b5576101008083540402835291602001916107e0565b820191906000526020600020905b8154815290600101906020018083116107c357829003601f168201915b505050505081565b60006107fc600264ffffffffff8416610be0565b92915050565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261086393909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146108b25760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b6105b2600282610de9565b60006108c96002610e0f565b905090565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261092f93909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b03161461097e5760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b600855565b600061098e84610e26565b9050806000015164ffffffffff168364ffffffffff161080156109c35750806060015164ffffffffff168364ffffffffff1610155b610a0b576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b806080015164ffffffffff168364ffffffffff161015610a4d576040810180516000190167ffffffffffffffff169052606081015164ffffffffff1660808201525b64ffffffffff8316815264ffffffffff1982166020820152610a6f8482610e86565b50505050565b600080610a8183610e26565b519392505050565b6000610a9484610e26565b90506000610ab9826040015167ffffffffffffffff1686610edc90919063ffffffff16565b8054909150610ac757601081555b8054608083015183510364ffffffffff1610610b3e578460060154826080015164ffffffffff161015610b365760408201805160010167ffffffffffffffff169081905260808301805164ffffffffff90811660608601528451169052610b2f908690610edc565b9050610b3e565b805460020281555b608082015182510364ffffffffff9081166000818152600184810160209081526040909220889055855101909216845264ffffffffff19851691840191909152610b888684610e86565b505050505050565b6000610b9b83610e26565b64ffffffffff19831660208201529050610bb58382610e86565b505050565b6000610bc583610e26565b9050610bb5828260200151856109839092919063ffffffff16565b600080610bec84610e26565b805190915064ffffffffff168310610c42576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b6000610c65826040015167ffffffffffffffff1686610edc90919063ffffffff16565b90506000610c8d836040015160010167ffffffffffffffff1687610edc90919063ffffffff16565b9050826080015164ffffffffff168510610d1a576080830151825464ffffffffff9091168603908110610cfe576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b6000908152600190920160205250604090205491506107fc9050565b6080830151606084015164ffffffffff9182168781039290911610610d7d576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b8154811115610dca576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b81540360009081526001909101602052604090205492506107fc915050565b6000610df483610e26565b9050610bb582826020015185610a899092919063ffffffff16565b600080610e1b83610e26565b602001519392505050565b610e2e610efc565b5080546001909101546040805160a08101825264ffffffffff808516825264ffffffffff19909416602082015267ffffffffffffffff8316818301529082901c8316606082015260689190911c909116608082015290565b80516020820151604080840151606085015160808601518754858717969483901b8417606883901b1795939291908714610ebe578689555b85896001015414610ed157600189018690555b505050505050505050565b60006002820615610ef05782600401610ef5565b826002015b9392505050565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101919091529056fe4f564d5f436861696e53746f72616765436f6e7461696e65723a2046756e6374696f6e2063616e206f6e6c792062652063616c6c656420627920746865206f776e65722ea2646970667358221220376cbc00341dd082d644157f6511fcd1ac26a6a924d04ae6532cfcab93d9191864736f6c63430007060033",
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100b45760003560e01c80634651d91e116100715780634651d91e1461021a5780638da5cb5b146102375780639507d39a146102b4578063b298e36b146102d1578063ccf8f969146102ee578063fa9e936c14610311576100b4565b8063167fd681146100b95780631f7b6d32146100e65780632015276c1461010057806329061de21461012b578063299ca47814610150578063461a447814610174575b600080fd5b6100e4600480360360408110156100cf57600080fd5b508035906020013564ffffffffff191661032e565b005b6100ee610423565b60408051918252519081900360200190f35b6100e46004803603604081101561011657600080fd5b508035906020013564ffffffffff191661043b565b6100e46004803603602081101561014157600080fd5b503564ffffffffff19166104f7565b6101586105b5565b604080516001600160a01b039092168252519081900360200190f35b6101586004803603602081101561018a57600080fd5b8101906020810181356401000000008111156101a557600080fd5b8201836020820111156101b757600080fd5b803590602001918460018302840111640100000000831117156101d957600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506105c4945050505050565b6100e46004803603602081101561023057600080fd5b50356106a0565b61023f61075b565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610279578181015183820152602001610261565b50505050905090810190601f1680156102a65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6100ee600480360360208110156102ca57600080fd5b50356107e8565b6100e4600480360360208110156102e757600080fd5b5035610802565b6102f66108bd565b6040805164ffffffffff199092168252519081900360200190f35b6100e46004803603602081101561032757600080fd5b50356108ce565b60018054604080516020601f6002600019610100878916150201909516949094049384018190048102820181019092528281526103c493909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b820191906000526020600020905b81548152906001019060200180831161039d57829003601f168201915b50505050506105c4565b6001600160a01b0316336001600160a01b0316146104135760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b61041f60028383610983565b5050565b600061042f6002610a75565b64ffffffffff16905090565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261049c93909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146104eb5760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b61041f60028383610a89565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261055893909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146105a75760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b6105b2600282610b90565b50565b6000546001600160a01b031681565b6000805460405163bf40fac160e01b81526020600482018181528551602484015285516001600160a01b039094169363bf40fac19387938392604490920191908501908083838b5b8381101561062457818101518382015260200161060c565b50505050905090810190601f1680156106515780820380516001836020036101000a031916815260200191505b509250505060206040518083038186803b15801561066e57600080fd5b505afa158015610682573d6000803e3d6000fd5b505050506040513d602081101561069857600080fd5b505192915050565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261070193909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146107505760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b6105b2600282610bba565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156107e05780601f106107b5576101008083540402835291602001916107e0565b820191906000526020600020905b8154815290600101906020018083116107c357829003601f168201915b505050505081565b60006107fc600264ffffffffff8416610be0565b92915050565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261086393909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146108b25760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b6105b2600282610de9565b60006108c96002610e0f565b905090565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261092f93909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b03161461097e5760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b600855565b600061098e84610e26565b9050806000015164ffffffffff168364ffffffffff161080156109c35750806060015164ffffffffff168364ffffffffff1610155b610a0b576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b806080015164ffffffffff168364ffffffffff161015610a4d576040810180516000190167ffffffffffffffff169052606081015164ffffffffff1660808201525b64ffffffffff8316815264ffffffffff1982166020820152610a6f8482610e86565b50505050565b600080610a8183610e26565b519392505050565b6000610a9484610e26565b90506000610ab9826040015167ffffffffffffffff1686610edc90919063ffffffff16565b8054909150610ac757601081555b8054608083015183510364ffffffffff1610610b3e578460060154826080015164ffffffffff161015610b365760408201805160010167ffffffffffffffff169081905260808301805164ffffffffff90811660608601528451169052610b2f908690610edc565b9050610b3e565b805460020281555b608082015182510364ffffffffff9081166000818152600184810160209081526040909220889055855101909216845264ffffffffff19851691840191909152610b888684610e86565b505050505050565b6000610b9b83610e26565b64ffffffffff19831660208201529050610bb58382610e86565b505050565b6000610bc583610e26565b9050610bb5828260200151856109839092919063ffffffff16565b600080610bec84610e26565b805190915064ffffffffff168310610c42576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b6000610c65826040015167ffffffffffffffff1686610edc90919063ffffffff16565b90506000610c8d836040015160010167ffffffffffffffff1687610edc90919063ffffffff16565b9050826080015164ffffffffff168510610d1a576080830151825464ffffffffff9091168603908110610cfe576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b6000908152600190920160205250604090205491506107fc9050565b6080830151606084015164ffffffffff9182168781039290911610610d7d576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b8154811115610dca576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b81540360009081526001909101602052604090205492506107fc915050565b6000610df483610e26565b9050610bb582826020015185610a899092919063ffffffff16565b600080610e1b83610e26565b602001519392505050565b610e2e610efc565b5080546001909101546040805160a08101825264ffffffffff808516825264ffffffffff19909416602082015267ffffffffffffffff8316818301529082901c8316606082015260689190911c909116608082015290565b80516020820151604080840151606085015160808601518754858717969483901b8417606883901b1795939291908714610ebe578689555b85896001015414610ed157600189018690555b505050505050505050565b60006002820615610ef05782600401610ef5565b826002015b9392505050565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101919091529056fe4f564d5f436861696e53746f72616765436f6e7461696e65723a2046756e6374696f6e2063616e206f6e6c792062652063616c6c656420627920746865206f776e65722ea2646970667358221220376cbc00341dd082d644157f6511fcd1ac26a6a924d04ae6532cfcab93d9191864736f6c63430007060033",
"devdoc": {
"details": "The Chain Storage Container provides its owner contract with read, write and delete functionality. This provides gas efficiency gains by enabling it to overwrite storage slots which can no longer be used in a fraud proof due to the fraud window having passed, and the associated chain state or transactions being finalized. Three distinct Chain Storage Containers will be deployed on Layer 1: 1. Stores transaction batches for the Canonical Transaction Chain 2. Stores queued transactions for the Canonical Transaction Chain 3. Stores chain state batches for the State Commitment Chain Compiler used: solc Runtime target: EVM",
"kind": "dev",
"methods": {
"constructor": {
"params": {
"_libAddressManager": "Address of the Address Manager.",
"_owner": "Name of the contract that owns this container (will be resolved later)."
}
},
"deleteElementsAfterInclusive(uint256)": {
"params": {
"_index": "Object index to delete from."
}
},
"deleteElementsAfterInclusive(uint256,bytes27)": {
"params": {
"_globalMetadata": "New global metadata for the container.",
"_index": "Object index to delete from."
}
},
"get(uint256)": {
"params": {
"_index": "Index of the particular object to access."
},
"returns": {
"_0": "32 byte object value."
}
},
"getGlobalMetadata()": {
"returns": {
"_0": "Container global metadata field."
}
},
"length()": {
"returns": {
"_0": "Number of objects in the container."
}
},
"push(bytes32)": {
"params": {
"_object": "A 32 byte value to insert into the container."
}
},
"push(bytes32,bytes27)": {
"params": {
"_globalMetadata": "New global metadata for the container.",
"_object": "A 32 byte value to insert into the container."
}
},
"resolve(string)": {
"params": {
"_name": "Name to resolve an address for."
},
"returns": {
"_0": "Address associated with the given name."
}
},
"setGlobalMetadata(bytes27)": {
"params": {
"_globalMetadata": "New global metadata to set."
}
}
},
"title": "OVM_ChainStorageContainer",
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {
"deleteElementsAfterInclusive(uint256)": {
"notice": "Removes all objects after and including a given index."
},
"deleteElementsAfterInclusive(uint256,bytes27)": {
"notice": "Removes all objects after and including a given index. Also allows setting the global metadata field."
},
"get(uint256)": {
"notice": "Retrieves an object from the container."
},
"getGlobalMetadata()": {
"notice": "Retrieves the container's global metadata field."
},
"length()": {
"notice": "Retrieves the number of objects stored in the container."
},
"push(bytes32)": {
"notice": "Pushes an object into the container."
},
"push(bytes32,bytes27)": {
"notice": "Pushes an object into the container. Function allows setting the global metadata since we'll need to touch the \"length\" storage slot anyway, which also contains the global metadata (it's an optimization)."
},
"resolve(string)": {
"notice": "Resolves the address associated with a given name."
},
"setGlobalMetadata(bytes27)": {
"notice": "Sets the container's global metadata field. We're using `bytes27` here because we use five bytes to maintain the length of the underlying data structure, meaning we have an extra 27 bytes to store arbitrary data."
},
"setNextOverwritableIndex(uint256)": {
"notice": "Marks an index as overwritable, meaing the underlying buffer can start to write values over any objects before and including the given index."
}
},
"version": 1
},
"storageLayout": {
"storage": [
{
"astId": 12055,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "libAddressManager",
"offset": 0,
"slot": "0",
"type": "t_contract(Lib_AddressManager)12048"
},
{
"astId": 3712,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "owner",
"offset": 0,
"slot": "1",
"type": "t_string_storage"
},
{
"astId": 3714,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "buffer",
"offset": 0,
"slot": "2",
"type": "t_struct(RingBuffer)17101_storage"
}
],
"types": {
"t_bytes32": {
"encoding": "inplace",
"label": "bytes32",
"numberOfBytes": "32"
},
"t_contract(Lib_AddressManager)12048": {
"encoding": "inplace",
"label": "contract Lib_AddressManager",
"numberOfBytes": "20"
},
"t_mapping(t_uint256,t_bytes32)": {
"encoding": "mapping",
"key": "t_uint256",
"label": "mapping(uint256 => bytes32)",
"numberOfBytes": "32",
"value": "t_bytes32"
},
"t_string_storage": {
"encoding": "bytes",
"label": "string",
"numberOfBytes": "32"
},
"t_struct(Buffer)17090_storage": {
"encoding": "inplace",
"label": "struct Lib_RingBuffer.Buffer",
"members": [
{
"astId": 17085,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "length",
"offset": 0,
"slot": "0",
"type": "t_uint256"
},
{
"astId": 17089,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "buf",
"offset": 0,
"slot": "1",
"type": "t_mapping(t_uint256,t_bytes32)"
}
],
"numberOfBytes": "64"
},
"t_struct(RingBuffer)17101_storage": {
"encoding": "inplace",
"label": "struct Lib_RingBuffer.RingBuffer",
"members": [
{
"astId": 17092,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "contextA",
"offset": 0,
"slot": "0",
"type": "t_bytes32"
},
{
"astId": 17094,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "contextB",
"offset": 0,
"slot": "1",
"type": "t_bytes32"
},
{
"astId": 17096,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "bufferA",
"offset": 0,
"slot": "2",
"type": "t_struct(Buffer)17090_storage"
},
{
"astId": 17098,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "bufferB",
"offset": 0,
"slot": "4",
"type": "t_struct(Buffer)17090_storage"
},
{
"astId": 17100,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "nextOverwritableIndex",
"offset": 0,
"slot": "6",
"type": "t_uint256"
}
],
"numberOfBytes": "224"
},
"t_uint256": {
"encoding": "inplace",
"label": "uint256",
"numberOfBytes": "32"
}
}
}
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"address": "0x746E840b94cC75921D1cb620b83CFd0C658B2852",
"abi": [
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "_from",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "_to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
}
],
"name": "DepositInitiated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "_to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
}
],
"name": "WithdrawalFinalized",
"type": "event"
},
{
"inputs": [],
"name": "deposit",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_to",
"type": "address"
}
],
"name": "depositTo",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_to",
"type": "address"
},
{
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
}
],
"name": "finalizeWithdrawal",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "getFinalizeDepositL2Gas",
"outputs": [
{
"internalType": "uint32",
"name": "",
"type": "uint32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_libAddressManager",
"type": "address"
},
{
"internalType": "address",
"name": "_ovmEth",
"type": "address"
}
],
"name": "initialize",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "libAddressManager",
"outputs": [
{
"internalType": "contract Lib_AddressManager",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "messenger",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "ovmEth",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "_name",
"type": "string"
}
],
"name": "resolve",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"stateMutability": "payable",
"type": "receive"
}
],
"transactionHash": "0x3880c009c976f21e54efda94e4cea27d6ac934b7e2cccae7f84187b2654eea57",
"receipt": {
"to": null,
"from": "0x4107438C1b1579f258AF9d1AC06194C4a0F55040",
"contractAddress": "0x746E840b94cC75921D1cb620b83CFd0C658B2852",
"transactionIndex": 6,
"gasUsed": "609964",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blockHash": "0xce3b66ca48656384c99d18e47e91b59ba8c45887e83a7326236dc21acef3b142",
"transactionHash": "0x3880c009c976f21e54efda94e4cea27d6ac934b7e2cccae7f84187b2654eea57",
"logs": [],
"blockNumber": 4694128,
"cumulativeGasUsed": "1124104",
"status": 1,
"byzantium": true
},
"args": [],
"solcInputHash": "dde656dd41f49cad9eac9bc7065fd6a7",
"metadata": "{\"compiler\":{\"version\":\"0.7.6+commit.7338295f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"DepositInitiated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"WithdrawalFinalized\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"}],\"name\":\"depositTo\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"finalizeWithdrawal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getFinalizeDepositL2Gas\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_libAddressManager\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_ovmEth\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"libAddressManager\",\"outputs\":[{\"internalType\":\"contract Lib_AddressManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"messenger\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ovmEth\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"The L1 ETH Gateway is a contract which stores deposited ETH that is in use on L2. Compiler used: solc Runtime target: EVM\",\"kind\":\"dev\",\"methods\":{\"deposit()\":{\"details\":\"deposit an amount of the ETH to the caller's balance on L2\"},\"depositTo(address)\":{\"details\":\"deposit an amount of ETH to a recipients's balance on L2\",\"params\":{\"_to\":\"L2 address to credit the withdrawal to\"}},\"finalizeWithdrawal(address,uint256)\":{\"details\":\"Complete a withdrawal from L2 to L1, and credit funds to the recipient's balance of the L1 ETH token. Since only the xDomainMessenger can call this function, it will never be called before the withdrawal is finalized.\",\"params\":{\"_amount\":\"Amount of the ETH to withdraw\",\"_to\":\"L1 address to credit the withdrawal to\"}},\"initialize(address,address)\":{\"params\":{\"_libAddressManager\":\"Address manager for this OE deployment\",\"_ovmEth\":\"L2 OVM_ETH implementation of iOVM_DepositedToken\"}},\"resolve(string)\":{\"params\":{\"_name\":\"Name to resolve an address for.\"},\"returns\":{\"_0\":\"Address associated with the given name.\"}}},\"title\":\"OVM_L1ETHGateway\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"resolve(string)\":{\"notice\":\"Resolves the address associated with a given name.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol\":\"OVM_L1ETHGateway\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor () internal {\\n address msgSender = _msgSender();\\n _owner = msgSender;\\n emit OwnershipTransferred(address(0), msgSender);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x15e2d5bd4c28a88548074c54d220e8086f638a71ed07e6b3ba5a70066fcf458d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with GSN meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address payable) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes memory) {\\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x8d3cb350f04ff49cfb10aef08d87f19dcbaecc8027b0bed12f3275cd12f38cf0\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// @unsupported: ovm\\npragma solidity >0.5.0 <0.8.0;\\npragma experimental ABIEncoderV2;\\n\\n/* Interface Imports */\\nimport { iOVM_L1ETHGateway } from \\\"../../../iOVM/bridge/tokens/iOVM_L1ETHGateway.sol\\\";\\nimport { iOVM_L2DepositedToken } from \\\"../../../iOVM/bridge/tokens/iOVM_L2DepositedToken.sol\\\";\\n\\n/* Library Imports */\\nimport { OVM_CrossDomainEnabled } from \\\"../../../libraries/bridge/OVM_CrossDomainEnabled.sol\\\";\\nimport { Lib_AddressResolver } from \\\"../../../libraries/resolver/Lib_AddressResolver.sol\\\";\\nimport { Lib_AddressManager } from \\\"../../../libraries/resolver/Lib_AddressManager.sol\\\";\\n\\n/**\\n * @title OVM_L1ETHGateway\\n * @dev The L1 ETH Gateway is a contract which stores deposited ETH that is in use on L2.\\n *\\n * Compiler used: solc\\n * Runtime target: EVM\\n */\\ncontract OVM_L1ETHGateway is iOVM_L1ETHGateway, OVM_CrossDomainEnabled, Lib_AddressResolver {\\n\\n /********************\\n * Public Constants *\\n ********************/\\n\\n uint32 public constant override getFinalizeDepositL2Gas = 1200000;\\n\\n /********************************\\n * External Contract References *\\n ********************************/\\n\\n address public ovmEth;\\n\\n /***************\\n * Constructor *\\n ***************/\\n\\n // This contract lives behind a proxy, so the constructor parameters will go unused.\\n constructor()\\n OVM_CrossDomainEnabled(address(0))\\n Lib_AddressResolver(address(0))\\n public\\n {}\\n\\n /******************\\n * Initialization *\\n ******************/\\n\\n /**\\n * @param _libAddressManager Address manager for this OE deployment\\n * @param _ovmEth L2 OVM_ETH implementation of iOVM_DepositedToken\\n */\\n function initialize(\\n address _libAddressManager,\\n address _ovmEth\\n )\\n public\\n {\\n require(libAddressManager == Lib_AddressManager(0), \\\"Contract has already been initialized.\\\");\\n libAddressManager = Lib_AddressManager(_libAddressManager);\\n ovmEth = _ovmEth;\\n messenger = resolve(\\\"Proxy__OVM_L1CrossDomainMessenger\\\");\\n }\\n\\n /**************\\n * Depositing *\\n **************/\\n\\n receive()\\n external\\n payable\\n {\\n _initiateDeposit(msg.sender, msg.sender);\\n }\\n\\n /**\\n * @dev deposit an amount of the ETH to the caller's balance on L2\\n */\\n function deposit()\\n external\\n override\\n payable\\n {\\n _initiateDeposit(msg.sender, msg.sender);\\n }\\n\\n /**\\n * @dev deposit an amount of ETH to a recipients's balance on L2\\n * @param _to L2 address to credit the withdrawal to\\n */\\n function depositTo(\\n address _to\\n )\\n external\\n override\\n payable\\n {\\n _initiateDeposit(msg.sender, _to);\\n }\\n\\n /**\\n * @dev Performs the logic for deposits by storing the ETH and informing the L2 ETH Gateway of the deposit.\\n *\\n * @param _from Account to pull the deposit from on L1\\n * @param _to Account to give the deposit to on L2\\n */\\n function _initiateDeposit(\\n address _from,\\n address _to\\n )\\n internal\\n {\\n // Construct calldata for l2ETHGateway.finalizeDeposit(_to, _amount)\\n bytes memory data =\\n abi.encodeWithSelector(\\n iOVM_L2DepositedToken.finalizeDeposit.selector,\\n _to,\\n msg.value\\n );\\n\\n // Send calldata into L2\\n sendCrossDomainMessage(\\n ovmEth,\\n data,\\n getFinalizeDepositL2Gas\\n );\\n\\n emit DepositInitiated(_from, _to, msg.value);\\n }\\n\\n /*************************\\n * Cross-chain Functions *\\n *************************/\\n\\n /**\\n * @dev Complete a withdrawal from L2 to L1, and credit funds to the recipient's balance of the\\n * L1 ETH token.\\n * Since only the xDomainMessenger can call this function, it will never be called before the withdrawal is finalized.\\n *\\n * @param _to L1 address to credit the withdrawal to\\n * @param _amount Amount of the ETH to withdraw\\n */\\n function finalizeWithdrawal(\\n address _to,\\n uint256 _amount\\n )\\n external\\n override\\n onlyFromCrossDomainAccount(ovmEth)\\n {\\n _safeTransferETH(_to, _amount);\\n\\n emit WithdrawalFinalized(_to, _amount);\\n }\\n\\n /**********************************\\n * Internal Functions: Accounting *\\n **********************************/\\n\\n /**\\n * @dev Internal accounting function for moving around L1 ETH.\\n *\\n * @param _to L1 address to transfer ETH to\\n * @param _value Amount of ETH to send to\\n */\\n function _safeTransferETH(\\n address _to,\\n uint256 _value\\n )\\n internal\\n {\\n (bool success, ) = _to.call{value: _value}(new bytes(0));\\n require(success, 'TransferHelper::safeTransferETH: ETH transfer failed');\\n }\\n}\\n\",\"keccak256\":\"0xee7c0d4bea0e01b0de4def829c9c8aa313ad6a788a7150adcc62c1e4190831db\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\npragma experimental ABIEncoderV2;\\n\\n/**\\n * @title iAbs_BaseCrossDomainMessenger\\n */\\ninterface iAbs_BaseCrossDomainMessenger {\\n\\n /**********\\n * Events *\\n **********/\\n\\n event SentMessage(bytes message);\\n event RelayedMessage(bytes32 msgHash);\\n event FailedRelayedMessage(bytes32 msgHash);\\n\\n\\n /*************\\n * Variables *\\n *************/\\n\\n function xDomainMessageSender() external view returns (address);\\n\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Sends a cross domain message to the target messenger.\\n * @param _target Target contract address.\\n * @param _message Message to send to the target.\\n * @param _gasLimit Gas limit for the provided message.\\n */\\n function sendMessage(\\n address _target,\\n bytes calldata _message,\\n uint32 _gasLimit\\n ) external;\\n}\\n\",\"keccak256\":\"0x89981ed48e99d6939cc6cdef827d484fa3e2292d66c0ba5056c7050cb6282d7e\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0;\\npragma experimental ABIEncoderV2;\\n\\n/**\\n * @title iOVM_L1ETHGateway\\n */\\ninterface iOVM_L1ETHGateway {\\n\\n /**********\\n * Events *\\n **********/\\n\\n event DepositInitiated(\\n address indexed _from,\\n address _to,\\n uint256 _amount\\n );\\n\\n event WithdrawalFinalized(\\n address indexed _to,\\n uint256 _amount\\n );\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n function deposit()\\n external\\n payable;\\n\\n function depositTo(\\n address _to\\n )\\n external\\n payable;\\n\\n /*************************\\n * Cross-chain Functions *\\n *************************/\\n\\n function finalizeWithdrawal(\\n address _to,\\n uint _amount\\n )\\n external;\\n\\n function getFinalizeDepositL2Gas()\\n external\\n view\\n returns(\\n uint32\\n );\\n}\\n\",\"keccak256\":\"0x7e6805c5cacfd159410c7cd57a3d586e0fc5810bc46600bbd840a252e243e5ba\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0;\\npragma experimental ABIEncoderV2;\\n\\n/**\\n * @title iOVM_L2DepositedToken\\n */\\ninterface iOVM_L2DepositedToken {\\n\\n /**********\\n * Events *\\n **********/\\n\\n event WithdrawalInitiated(\\n address indexed _from,\\n address _to,\\n uint256 _amount\\n );\\n\\n event DepositFinalized(\\n address indexed _to,\\n uint256 _amount\\n );\\n\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n function withdraw(\\n uint _amount\\n )\\n external;\\n\\n function withdrawTo(\\n address _to,\\n uint _amount\\n )\\n external;\\n\\n\\n /*************************\\n * Cross-chain Functions *\\n *************************/\\n\\n function finalizeDeposit(\\n address _to,\\n uint _amount\\n )\\n external;\\n}\\n\",\"keccak256\":\"0x59c807dfb01dbc00409431820457c350681af30d2f972a065231483a8ec926c4\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/bridge/OVM_CrossDomainEnabled.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* Interface Imports */\\nimport { iAbs_BaseCrossDomainMessenger } from \\\"../../iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol\\\";\\n\\n/**\\n * @title OVM_CrossDomainEnabled\\n * @dev Helper contract for contracts performing cross-domain communications\\n *\\n * Compiler used: defined by inheriting contract\\n * Runtime target: defined by inheriting contract\\n */\\ncontract OVM_CrossDomainEnabled {\\n\\n /*************\\n * Variables *\\n *************/\\n\\n // Messenger contract used to send and recieve messages from the other domain.\\n address public messenger;\\n\\n\\n /***************\\n * Constructor *\\n ***************/ \\n\\n /**\\n * @param _messenger Address of the CrossDomainMessenger on the current layer.\\n */\\n constructor(\\n address _messenger\\n ) {\\n messenger = _messenger;\\n }\\n\\n\\n /**********************\\n * Function Modifiers *\\n **********************/\\n\\n /**\\n * Enforces that the modified function is only callable by a specific cross-domain account.\\n * @param _sourceDomainAccount The only account on the originating domain which is\\n * authenticated to call this function.\\n */\\n modifier onlyFromCrossDomainAccount(\\n address _sourceDomainAccount\\n ) {\\n require(\\n msg.sender == address(getCrossDomainMessenger()),\\n \\\"OVM_XCHAIN: messenger contract unauthenticated\\\"\\n );\\n\\n require(\\n getCrossDomainMessenger().xDomainMessageSender() == _sourceDomainAccount,\\n \\\"OVM_XCHAIN: wrong sender of cross-domain message\\\"\\n );\\n\\n _;\\n }\\n\\n\\n /**********************\\n * Internal Functions *\\n **********************/\\n\\n /**\\n * Gets the messenger, usually from storage. This function is exposed in case a child contract\\n * needs to override.\\n * @return The address of the cross-domain messenger contract which should be used. \\n */\\n function getCrossDomainMessenger()\\n internal\\n virtual\\n returns (\\n iAbs_BaseCrossDomainMessenger\\n )\\n {\\n return iAbs_BaseCrossDomainMessenger(messenger);\\n }\\n\\n /**\\n * Sends a message to an account on another domain\\n * @param _crossDomainTarget The intended recipient on the destination domain\\n * @param _data The data to send to the target (usually calldata to a function with\\n * `onlyFromCrossDomainAccount()`)\\n * @param _gasLimit The gasLimit for the receipt of the message on the target domain.\\n */\\n function sendCrossDomainMessage(\\n address _crossDomainTarget,\\n bytes memory _data,\\n uint32 _gasLimit\\n )\\n internal\\n {\\n getCrossDomainMessenger().sendMessage(_crossDomainTarget, _data, _gasLimit);\\n }\\n}\\n\",\"keccak256\":\"0x054c802a5c1318566b7727ff5327a1ad4dc0f18038a4586b7ada467cc6b08761\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* External Imports */\\nimport { Ownable } from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\n/**\\n * @title Lib_AddressManager\\n */\\ncontract Lib_AddressManager is Ownable {\\n\\n /**********\\n * Events *\\n **********/\\n\\n event AddressSet(\\n string _name,\\n address _newAddress\\n );\\n\\n\\n /*************\\n * Variables *\\n *************/\\n\\n mapping (bytes32 => address) private addresses;\\n\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Changes the address associated with a particular name.\\n * @param _name String name to associate an address with.\\n * @param _address Address to associate with the name.\\n */\\n function setAddress(\\n string memory _name,\\n address _address\\n )\\n public\\n onlyOwner\\n {\\n addresses[_getNameHash(_name)] = _address;\\n\\n emit AddressSet(\\n _name,\\n _address\\n );\\n }\\n\\n /**\\n * Retrieves the address associated with a given name.\\n * @param _name Name to retrieve an address for.\\n * @return Address associated with the given name.\\n */\\n function getAddress(\\n string memory _name\\n )\\n public\\n view\\n returns (\\n address\\n )\\n {\\n return addresses[_getNameHash(_name)];\\n }\\n\\n\\n /**********************\\n * Internal Functions *\\n **********************/\\n\\n /**\\n * Computes the hash of a name.\\n * @param _name Name to compute a hash for.\\n * @return Hash of the given name.\\n */\\n function _getNameHash(\\n string memory _name\\n )\\n internal\\n pure\\n returns (\\n bytes32\\n )\\n {\\n return keccak256(abi.encodePacked(_name));\\n }\\n}\\n\",\"keccak256\":\"0x2ce671a0e004df88b136bea5a3c59d0732cea8887c8496da1d509e0200b03d7d\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/resolver/Lib_AddressResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* Library Imports */\\nimport { Lib_AddressManager } from \\\"./Lib_AddressManager.sol\\\";\\n\\n/**\\n * @title Lib_AddressResolver\\n */\\nabstract contract Lib_AddressResolver {\\n\\n /*************\\n * Variables *\\n *************/\\n\\n Lib_AddressManager public libAddressManager;\\n\\n\\n /***************\\n * Constructor *\\n ***************/\\n\\n /**\\n * @param _libAddressManager Address of the Lib_AddressManager.\\n */\\n constructor(\\n address _libAddressManager\\n ) {\\n libAddressManager = Lib_AddressManager(_libAddressManager);\\n }\\n\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Resolves the address associated with a given name.\\n * @param _name Name to resolve an address for.\\n * @return Address associated with the given name.\\n */\\n function resolve(\\n string memory _name\\n )\\n public\\n view\\n returns (\\n address\\n )\\n {\\n return libAddressManager.getAddress(_name);\\n }\\n}\\n\",\"keccak256\":\"0x65981feeabff6a81783ea97d44baf988a18a86c8cb374c46fdb71819cbacc7c0\",\"license\":\"MIT\"}},\"version\":1}",
"bytecode": "0x608060405234801561001057600080fd5b50600080546001600160a01b03199081169091556001805490911690556109fb8061003c6000396000f3fe60806040526004361061008a5760003560e01c8063485cc95511610059578063485cc95514610122578063490b5b7814610142578063b760faf914610157578063d0e30db01461016a578063f4f7b41a146101725761009b565b80631273a090146100a0578063299ca478146100cb5780633cb747bf146100ed578063461a4478146101025761009b565b3661009b576100993333610192565b005b600080fd5b3480156100ac57600080fd5b506100b5610246565b6040516100c29190610935565b60405180910390f35b3480156100d757600080fd5b506100e061024d565b6040516100c29190610865565b3480156100f957600080fd5b506100e061025c565b34801561010e57600080fd5b506100e061011d366004610797565b61026b565b34801561012e57600080fd5b5061009961013d36600461073c565b610347565b34801561014e57600080fd5b506100e06103ef565b61009961016536600461071b565b6103fe565b61009961040b565b34801561017e57600080fd5b5061009961018d36600461076e565b610417565b6000638d6e9a5b60e01b82346040516024016101af929190610879565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526002549091506101fe906001600160a01b03168262124f80610578565b826001600160a01b03167ff531653a5819e21265de50358610d55dbe6594c61605b209dfa4280d277938c18334604051610239929190610879565b60405180910390a2505050565b62124f8081565b6001546001600160a01b031681565b6000546001600160a01b031681565b60015460405163bf40fac160e01b81526020600482018181528451602484015284516000946001600160a01b03169363bf40fac1938793928392604401918501908083838b5b838110156102c95781810151838201526020016102b1565b50505050905090810190601f1680156102f65780820380516001836020036101000a031916815260200191505b509250505060206040518083038186803b15801561031357600080fd5b505afa158015610327573d6000803e3d6000fd5b505050506040513d602081101561033d57600080fd5b505190505b919050565b6001546001600160a01b0316156103795760405162461bcd60e51b8152600401610370906108e6565b60405180910390fd5b600180546001600160a01b038085166001600160a01b0319928316179092556002805492841692909116919091179055604080516060810190915260218082526103cb91906109a5602083013961026b565b600080546001600160a01b0319166001600160a01b03929092169190911790555050565b6002546001600160a01b031681565b6104083382610192565b50565b6104153333610192565b565b6002546001600160a01b031661042b610663565b6001600160a01b0316336001600160a01b03161461047a5760405162461bcd60e51b815260040180806020018281038252602e815260200180610947602e913960400191505060405180910390fd5b806001600160a01b031661048c610663565b6001600160a01b0316636e296e456040518163ffffffff1660e01b815260040160206040518083038186803b1580156104c457600080fd5b505afa1580156104d8573d6000803e3d6000fd5b505050506040513d60208110156104ee57600080fd5b50516001600160a01b0316146105355760405162461bcd60e51b81526004018080602001828103825260308152602001806109756030913960400191505060405180910390fd5b61053f8383610672565b826001600160a01b03167f9e5c4f9f4e46b8629d3dda85f43a69194f50254404a72dc62b9e932d9c94eda883604051610239919061092c565b610580610663565b6001600160a01b0316633dbb202b8484846040518463ffffffff1660e01b815260040180846001600160a01b03168152602001806020018363ffffffff168152602001828103825284818151815260200191508051906020019080838360005b838110156105f85781810151838201526020016105e0565b50505050905090810190601f1680156106255780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b15801561064657600080fd5b505af115801561065a573d6000803e3d6000fd5b50505050505050565b6000546001600160a01b031690565b604080516000808252602082019092526001600160a01b03841690839060405161069c919061082c565b60006040518083038185875af1925050503d80600081146106d9576040519150601f19603f3d011682016040523d82523d6000602084013e6106de565b606091505b50509050806106ff5760405162461bcd60e51b815260040161037090610892565b505050565b80356001600160a01b038116811461034257600080fd5b60006020828403121561072c578081fd5b61073582610704565b9392505050565b6000806040838503121561074e578081fd5b61075783610704565b915061076560208401610704565b90509250929050565b60008060408385031215610780578182fd5b61078983610704565b946020939093013593505050565b600060208083850312156107a9578182fd5b823567ffffffffffffffff808211156107c0578384fd5b818501915085601f8301126107d3578384fd5b8135818111156107df57fe5b604051601f8201601f19168101850183811182821017156107fc57fe5b6040528181528382018501881015610812578586fd5b818585018683013790810190930193909352509392505050565b60008251815b8181101561084c5760208186018101518583015201610832565b8181111561085a5782828501525b509190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b60208082526034908201527f5472616e7366657248656c7065723a3a736166655472616e736665724554483a60408201527308115512081d1c985b9cd9995c8819985a5b195960621b606082015260800190565b60208082526026908201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616040820152653634bd32b21760d11b606082015260800190565b90815260200190565b63ffffffff9190911681526020019056fe4f564d5f58434841494e3a206d657373656e67657220636f6e747261637420756e61757468656e746963617465644f564d5f58434841494e3a2077726f6e672073656e646572206f662063726f73732d646f6d61696e206d65737361676550726f78795f5f4f564d5f4c3143726f7373446f6d61696e4d657373656e676572a2646970667358221220d8a6002280930d6eb8035b95d663889b1a8e3dbd1b07997ca03239bd5372e85b64736f6c63430007060033",
"deployedBytecode": "0x60806040526004361061008a5760003560e01c8063485cc95511610059578063485cc95514610122578063490b5b7814610142578063b760faf914610157578063d0e30db01461016a578063f4f7b41a146101725761009b565b80631273a090146100a0578063299ca478146100cb5780633cb747bf146100ed578063461a4478146101025761009b565b3661009b576100993333610192565b005b600080fd5b3480156100ac57600080fd5b506100b5610246565b6040516100c29190610935565b60405180910390f35b3480156100d757600080fd5b506100e061024d565b6040516100c29190610865565b3480156100f957600080fd5b506100e061025c565b34801561010e57600080fd5b506100e061011d366004610797565b61026b565b34801561012e57600080fd5b5061009961013d36600461073c565b610347565b34801561014e57600080fd5b506100e06103ef565b61009961016536600461071b565b6103fe565b61009961040b565b34801561017e57600080fd5b5061009961018d36600461076e565b610417565b6000638d6e9a5b60e01b82346040516024016101af929190610879565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526002549091506101fe906001600160a01b03168262124f80610578565b826001600160a01b03167ff531653a5819e21265de50358610d55dbe6594c61605b209dfa4280d277938c18334604051610239929190610879565b60405180910390a2505050565b62124f8081565b6001546001600160a01b031681565b6000546001600160a01b031681565b60015460405163bf40fac160e01b81526020600482018181528451602484015284516000946001600160a01b03169363bf40fac1938793928392604401918501908083838b5b838110156102c95781810151838201526020016102b1565b50505050905090810190601f1680156102f65780820380516001836020036101000a031916815260200191505b509250505060206040518083038186803b15801561031357600080fd5b505afa158015610327573d6000803e3d6000fd5b505050506040513d602081101561033d57600080fd5b505190505b919050565b6001546001600160a01b0316156103795760405162461bcd60e51b8152600401610370906108e6565b60405180910390fd5b600180546001600160a01b038085166001600160a01b0319928316179092556002805492841692909116919091179055604080516060810190915260218082526103cb91906109a5602083013961026b565b600080546001600160a01b0319166001600160a01b03929092169190911790555050565b6002546001600160a01b031681565b6104083382610192565b50565b6104153333610192565b565b6002546001600160a01b031661042b610663565b6001600160a01b0316336001600160a01b03161461047a5760405162461bcd60e51b815260040180806020018281038252602e815260200180610947602e913960400191505060405180910390fd5b806001600160a01b031661048c610663565b6001600160a01b0316636e296e456040518163ffffffff1660e01b815260040160206040518083038186803b1580156104c457600080fd5b505afa1580156104d8573d6000803e3d6000fd5b505050506040513d60208110156104ee57600080fd5b50516001600160a01b0316146105355760405162461bcd60e51b81526004018080602001828103825260308152602001806109756030913960400191505060405180910390fd5b61053f8383610672565b826001600160a01b03167f9e5c4f9f4e46b8629d3dda85f43a69194f50254404a72dc62b9e932d9c94eda883604051610239919061092c565b610580610663565b6001600160a01b0316633dbb202b8484846040518463ffffffff1660e01b815260040180846001600160a01b03168152602001806020018363ffffffff168152602001828103825284818151815260200191508051906020019080838360005b838110156105f85781810151838201526020016105e0565b50505050905090810190601f1680156106255780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b15801561064657600080fd5b505af115801561065a573d6000803e3d6000fd5b50505050505050565b6000546001600160a01b031690565b604080516000808252602082019092526001600160a01b03841690839060405161069c919061082c565b60006040518083038185875af1925050503d80600081146106d9576040519150601f19603f3d011682016040523d82523d6000602084013e6106de565b606091505b50509050806106ff5760405162461bcd60e51b815260040161037090610892565b505050565b80356001600160a01b038116811461034257600080fd5b60006020828403121561072c578081fd5b61073582610704565b9392505050565b6000806040838503121561074e578081fd5b61075783610704565b915061076560208401610704565b90509250929050565b60008060408385031215610780578182fd5b61078983610704565b946020939093013593505050565b600060208083850312156107a9578182fd5b823567ffffffffffffffff808211156107c0578384fd5b818501915085601f8301126107d3578384fd5b8135818111156107df57fe5b604051601f8201601f19168101850183811182821017156107fc57fe5b6040528181528382018501881015610812578586fd5b818585018683013790810190930193909352509392505050565b60008251815b8181101561084c5760208186018101518583015201610832565b8181111561085a5782828501525b509190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b60208082526034908201527f5472616e7366657248656c7065723a3a736166655472616e736665724554483a60408201527308115512081d1c985b9cd9995c8819985a5b195960621b606082015260800190565b60208082526026908201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616040820152653634bd32b21760d11b606082015260800190565b90815260200190565b63ffffffff9190911681526020019056fe4f564d5f58434841494e3a206d657373656e67657220636f6e747261637420756e61757468656e746963617465644f564d5f58434841494e3a2077726f6e672073656e646572206f662063726f73732d646f6d61696e206d65737361676550726f78795f5f4f564d5f4c3143726f7373446f6d61696e4d657373656e676572a2646970667358221220d8a6002280930d6eb8035b95d663889b1a8e3dbd1b07997ca03239bd5372e85b64736f6c63430007060033",
"devdoc": {
"details": "The L1 ETH Gateway is a contract which stores deposited ETH that is in use on L2. Compiler used: solc Runtime target: EVM",
"kind": "dev",
"methods": {
"deposit()": {
"details": "deposit an amount of the ETH to the caller's balance on L2"
},
"depositTo(address)": {
"details": "deposit an amount of ETH to a recipients's balance on L2",
"params": {
"_to": "L2 address to credit the withdrawal to"
}
},
"finalizeWithdrawal(address,uint256)": {
"details": "Complete a withdrawal from L2 to L1, and credit funds to the recipient's balance of the L1 ETH token. Since only the xDomainMessenger can call this function, it will never be called before the withdrawal is finalized.",
"params": {
"_amount": "Amount of the ETH to withdraw",
"_to": "L1 address to credit the withdrawal to"
}
},
"initialize(address,address)": {
"params": {
"_libAddressManager": "Address manager for this OE deployment",
"_ovmEth": "L2 OVM_ETH implementation of iOVM_DepositedToken"
}
},
"resolve(string)": {
"params": {
"_name": "Name to resolve an address for."
},
"returns": {
"_0": "Address associated with the given name."
}
}
},
"title": "OVM_L1ETHGateway",
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {
"resolve(string)": {
"notice": "Resolves the address associated with a given name."
}
},
"version": 1
},
"storageLayout": {
"storage": [
{
"astId": 11243,
"contract": "contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol:OVM_L1ETHGateway",
"label": "messenger",
"offset": 0,
"slot": "0",
"type": "t_address"
},
{
"astId": 12055,
"contract": "contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol:OVM_L1ETHGateway",
"label": "libAddressManager",
"offset": 0,
"slot": "1",
"type": "t_contract(Lib_AddressManager)12048"
},
{
"astId": 1907,
"contract": "contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol:OVM_L1ETHGateway",
"label": "ovmEth",
"offset": 0,
"slot": "2",
"type": "t_address"
}
],
"types": {
"t_address": {
"encoding": "inplace",
"label": "address",
"numberOfBytes": "20"
},
"t_contract(Lib_AddressManager)12048": {
"encoding": "inplace",
"label": "contract Lib_AddressManager",
"numberOfBytes": "20"
}
}
}
}
\ No newline at end of file
{
"address": "0x737557d97f7f2ccb0263C4b55f0D735D52c2D385",
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "_libAddressManager",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [
{
"components": [
{
"internalType": "address",
"name": "target",
"type": "address"
},
{
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"internalType": "bytes",
"name": "message",
"type": "bytes"
},
{
"internalType": "uint256",
"name": "messageNonce",
"type": "uint256"
},
{
"components": [
{
"internalType": "bytes32",
"name": "stateRoot",
"type": "bytes32"
},
{
"components": [
{
"internalType": "uint256",
"name": "batchIndex",
"type": "uint256"
},
{
"internalType": "bytes32",
"name": "batchRoot",
"type": "bytes32"
},
{
"internalType": "uint256",
"name": "batchSize",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "prevTotalElements",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "extraData",
"type": "bytes"
}
],
"internalType": "struct Lib_OVMCodec.ChainBatchHeader",
"name": "stateRootBatchHeader",
"type": "tuple"
},
{
"components": [
{
"internalType": "uint256",
"name": "index",
"type": "uint256"
},
{
"internalType": "bytes32[]",
"name": "siblings",
"type": "bytes32[]"
}
],
"internalType": "struct Lib_OVMCodec.ChainInclusionProof",
"name": "stateRootProof",
"type": "tuple"
},
{
"internalType": "bytes",
"name": "stateTrieWitness",
"type": "bytes"
},
{
"internalType": "bytes",
"name": "storageTrieWitness",
"type": "bytes"
}
],
"internalType": "struct iOVM_L1CrossDomainMessenger.L2MessageInclusionProof",
"name": "proof",
"type": "tuple"
}
],
"internalType": "struct iOVM_L1MultiMessageRelayer.L2ToL1Message[]",
"name": "_messages",
"type": "tuple[]"
}
],
"name": "batchRelayMessages",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "libAddressManager",
"outputs": [
{
"internalType": "contract Lib_AddressManager",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "_name",
"type": "string"
}
],
"name": "resolve",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
}
],
"transactionHash": "0x4980c4690dc98b1cf4e24b20fc822b96a70e062195daeb603abaca93e5344003",
"receipt": {
"to": null,
"from": "0x4107438C1b1579f258AF9d1AC06194C4a0F55040",
"contractAddress": "0x737557d97f7f2ccb0263C4b55f0D735D52c2D385",
"transactionIndex": 2,
"gasUsed": "606489",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blockHash": "0x0df30adfabcfa2a632c8bc3fbd23be38c9ae56ca684651653924bac5734e5bd4",
"transactionHash": "0x4980c4690dc98b1cf4e24b20fc822b96a70e062195daeb603abaca93e5344003",
"logs": [],
"blockNumber": 4694125,
"cumulativeGasUsed": "1039312",
"status": 1,
"byzantium": true
},
"args": [
"0xE3d08F0D900A2D53cB794cf82d7127764BcC3092"
],
"solcInputHash": "dde656dd41f49cad9eac9bc7065fd6a7",
"metadata": "{\"compiler\":{\"version\":\"0.7.6+commit.7338295f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_libAddressManager\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"messageNonce\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"stateRoot\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"batchIndex\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"batchRoot\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"batchSize\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"prevTotalElements\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Lib_OVMCodec.ChainBatchHeader\",\"name\":\"stateRootBatchHeader\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"},{\"internalType\":\"bytes32[]\",\"name\":\"siblings\",\"type\":\"bytes32[]\"}],\"internalType\":\"struct Lib_OVMCodec.ChainInclusionProof\",\"name\":\"stateRootProof\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"stateTrieWitness\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"storageTrieWitness\",\"type\":\"bytes\"}],\"internalType\":\"struct iOVM_L1CrossDomainMessenger.L2MessageInclusionProof\",\"name\":\"proof\",\"type\":\"tuple\"}],\"internalType\":\"struct iOVM_L1MultiMessageRelayer.L2ToL1Message[]\",\"name\":\"_messages\",\"type\":\"tuple[]\"}],\"name\":\"batchRelayMessages\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"libAddressManager\",\"outputs\":[{\"internalType\":\"contract Lib_AddressManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"The L1 Multi-Message Relayer contract is a gas efficiency optimization which enables the relayer to submit multiple messages in a single transaction to be relayed by the L1 Cross Domain Message Sender. Compiler used: solc Runtime target: EVM\",\"kind\":\"dev\",\"methods\":{\"batchRelayMessages((address,address,bytes,uint256,(bytes32,(uint256,bytes32,uint256,uint256,bytes),(uint256,bytes32[]),bytes,bytes))[])\":{\"params\":{\"_messages\":\"An array of L2 to L1 messages\"}},\"constructor\":{\"params\":{\"_libAddressManager\":\"Address of the Address Manager.\"}},\"resolve(string)\":{\"params\":{\"_name\":\"Name to resolve an address for.\"},\"returns\":{\"_0\":\"Address associated with the given name.\"}}},\"title\":\"OVM_L1MultiMessageRelayer\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"batchRelayMessages((address,address,bytes,uint256,(bytes32,(uint256,bytes32,uint256,uint256,bytes),(uint256,bytes32[]),bytes,bytes))[])\":{\"notice\":\"Forwards multiple cross domain messages to the L1 Cross Domain Messenger for relaying\"},\"resolve(string)\":{\"notice\":\"Resolves the address associated with a given name.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/optimistic-ethereum/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol\":\"OVM_L1MultiMessageRelayer\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor () internal {\\n address msgSender = _msgSender();\\n _owner = msgSender;\\n emit OwnershipTransferred(address(0), msgSender);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x15e2d5bd4c28a88548074c54d220e8086f638a71ed07e6b3ba5a70066fcf458d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with GSN meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address payable) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes memory) {\\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x8d3cb350f04ff49cfb10aef08d87f19dcbaecc8027b0bed12f3275cd12f38cf0\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// @unsupported: ovm\\npragma solidity >0.5.0 <0.8.0;\\npragma experimental ABIEncoderV2;\\n\\n/* Interface Imports */\\nimport { iOVM_L1CrossDomainMessenger } from \\\"../../../iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol\\\";\\nimport { iOVM_L1MultiMessageRelayer } from \\\"../../../iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol\\\";\\n\\n/* Library Imports */\\nimport { Lib_AddressResolver } from \\\"../../../libraries/resolver/Lib_AddressResolver.sol\\\";\\n\\n/**\\n * @title OVM_L1MultiMessageRelayer\\n * @dev The L1 Multi-Message Relayer contract is a gas efficiency optimization which enables the\\n * relayer to submit multiple messages in a single transaction to be relayed by the L1 Cross Domain\\n * Message Sender.\\n *\\n * Compiler used: solc\\n * Runtime target: EVM\\n */\\ncontract OVM_L1MultiMessageRelayer is iOVM_L1MultiMessageRelayer, Lib_AddressResolver {\\n\\n /***************\\n * Constructor *\\n ***************/\\n\\n /**\\n * @param _libAddressManager Address of the Address Manager.\\n */\\n constructor(\\n address _libAddressManager\\n )\\n Lib_AddressResolver(_libAddressManager)\\n {}\\n\\n\\n /**********************\\n * Function Modifiers *\\n **********************/\\n\\n modifier onlyBatchRelayer() {\\n require(\\n msg.sender == resolve(\\\"OVM_L2BatchMessageRelayer\\\"),\\n \\\"OVM_L1MultiMessageRelayer: Function can only be called by the OVM_L2BatchMessageRelayer\\\"\\n );\\n _;\\n }\\n\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * @notice Forwards multiple cross domain messages to the L1 Cross Domain Messenger for relaying\\n * @param _messages An array of L2 to L1 messages\\n */\\n function batchRelayMessages(\\n L2ToL1Message[] calldata _messages\\n ) \\n override\\n external\\n onlyBatchRelayer\\n {\\n iOVM_L1CrossDomainMessenger messenger = iOVM_L1CrossDomainMessenger(\\n resolve(\\\"Proxy__OVM_L1CrossDomainMessenger\\\")\\n );\\n\\n for (uint256 i = 0; i < _messages.length; i++) {\\n L2ToL1Message memory message = _messages[i];\\n messenger.relayMessage(\\n message.target,\\n message.sender,\\n message.message,\\n message.messageNonce,\\n message.proof\\n );\\n }\\n }\\n}\\n\",\"keccak256\":\"0xe698b8dbdcecd055ee77cc553963f966faebcdefbed1e586f7fd603fa816d9c6\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\npragma experimental ABIEncoderV2;\\n\\n/**\\n * @title iAbs_BaseCrossDomainMessenger\\n */\\ninterface iAbs_BaseCrossDomainMessenger {\\n\\n /**********\\n * Events *\\n **********/\\n\\n event SentMessage(bytes message);\\n event RelayedMessage(bytes32 msgHash);\\n event FailedRelayedMessage(bytes32 msgHash);\\n\\n\\n /*************\\n * Variables *\\n *************/\\n\\n function xDomainMessageSender() external view returns (address);\\n\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Sends a cross domain message to the target messenger.\\n * @param _target Target contract address.\\n * @param _message Message to send to the target.\\n * @param _gasLimit Gas limit for the provided message.\\n */\\n function sendMessage(\\n address _target,\\n bytes calldata _message,\\n uint32 _gasLimit\\n ) external;\\n}\\n\",\"keccak256\":\"0x89981ed48e99d6939cc6cdef827d484fa3e2292d66c0ba5056c7050cb6282d7e\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.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 { iAbs_BaseCrossDomainMessenger } from \\\"./iAbs_BaseCrossDomainMessenger.sol\\\";\\n\\n/**\\n * @title iOVM_L1CrossDomainMessenger\\n */\\ninterface iOVM_L1CrossDomainMessenger is iAbs_BaseCrossDomainMessenger {\\n\\n /*******************\\n * Data Structures *\\n *******************/\\n\\n struct L2MessageInclusionProof {\\n bytes32 stateRoot;\\n Lib_OVMCodec.ChainBatchHeader stateRootBatchHeader;\\n Lib_OVMCodec.ChainInclusionProof stateRootProof;\\n bytes stateTrieWitness;\\n bytes storageTrieWitness;\\n }\\n\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Relays a cross domain message to a contract.\\n * @param _target Target contract address.\\n * @param _sender Message sender address.\\n * @param _message Message to send to the target.\\n * @param _messageNonce Nonce for the provided message.\\n * @param _proof Inclusion proof for the given message.\\n */\\n function relayMessage(\\n address _target,\\n address _sender,\\n bytes memory _message,\\n uint256 _messageNonce,\\n L2MessageInclusionProof memory _proof\\n ) external;\\n\\n /**\\n * Replays a cross domain message to the target messenger.\\n * @param _target Target contract address.\\n * @param _sender Original sender address.\\n * @param _message Message to send to the target.\\n * @param _messageNonce Nonce for the provided message.\\n * @param _gasLimit Gas limit for the provided message.\\n */\\n function replayMessage(\\n address _target,\\n address _sender,\\n bytes memory _message,\\n uint256 _messageNonce,\\n uint32 _gasLimit\\n ) external;\\n}\\n\",\"keccak256\":\"0xdcd239d0b215e400674d78e8db4ac12ba18efc34fa78e24c2ff867f61062dba2\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\npragma experimental ABIEncoderV2;\\n\\n/* Interface Imports */\\nimport { iOVM_L1CrossDomainMessenger } from \\\"../../../iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol\\\";\\ninterface iOVM_L1MultiMessageRelayer {\\n\\n struct L2ToL1Message {\\n address target;\\n address sender;\\n bytes message;\\n uint256 messageNonce;\\n iOVM_L1CrossDomainMessenger.L2MessageInclusionProof proof;\\n }\\n\\n function batchRelayMessages(L2ToL1Message[] calldata _messages) external;\\n}\\n\",\"keccak256\":\"0x8bc1fb2a33dcac59ec307195f8b8358d1ae2ab021c70a1589038b366d1b949d7\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/codec/Lib_OVMCodec.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\npragma experimental ABIEncoderV2;\\n\\n/* Library Imports */\\nimport { Lib_RLPReader } from \\\"../rlp/Lib_RLPReader.sol\\\";\\nimport { Lib_RLPWriter } from \\\"../rlp/Lib_RLPWriter.sol\\\";\\nimport { Lib_BytesUtils } from \\\"../utils/Lib_BytesUtils.sol\\\";\\nimport { Lib_Bytes32Utils } from \\\"../utils/Lib_Bytes32Utils.sol\\\";\\n\\n/**\\n * @title Lib_OVMCodec\\n */\\nlibrary Lib_OVMCodec {\\n\\n /*********\\n * Enums *\\n *********/\\n\\n enum QueueOrigin {\\n SEQUENCER_QUEUE,\\n L1TOL2_QUEUE\\n }\\n\\n\\n /***********\\n * Structs *\\n ***********/\\n\\n struct Account {\\n uint256 nonce;\\n uint256 balance;\\n bytes32 storageRoot;\\n bytes32 codeHash;\\n address ethAddress;\\n bool isFresh;\\n }\\n\\n struct EVMAccount {\\n uint256 nonce;\\n uint256 balance;\\n bytes32 storageRoot;\\n bytes32 codeHash;\\n }\\n\\n struct ChainBatchHeader {\\n uint256 batchIndex;\\n bytes32 batchRoot;\\n uint256 batchSize;\\n uint256 prevTotalElements;\\n bytes extraData;\\n }\\n\\n struct ChainInclusionProof {\\n uint256 index;\\n bytes32[] siblings;\\n }\\n\\n struct Transaction {\\n uint256 timestamp;\\n uint256 blockNumber;\\n QueueOrigin l1QueueOrigin;\\n address l1TxOrigin;\\n address entrypoint;\\n uint256 gasLimit;\\n bytes data;\\n }\\n\\n struct TransactionChainElement {\\n bool isSequenced;\\n uint256 queueIndex; // QUEUED TX ONLY\\n uint256 timestamp; // SEQUENCER TX ONLY\\n uint256 blockNumber; // SEQUENCER TX ONLY\\n bytes txData; // SEQUENCER TX ONLY\\n }\\n\\n struct QueueElement {\\n bytes32 transactionHash;\\n uint40 timestamp;\\n uint40 blockNumber;\\n }\\n\\n\\n /**********************\\n * Internal Functions *\\n **********************/\\n\\n /**\\n * Encodes a standard OVM transaction.\\n * @param _transaction OVM transaction to encode.\\n * @return Encoded transaction bytes.\\n */\\n function encodeTransaction(\\n Transaction memory _transaction\\n )\\n internal\\n pure\\n returns (\\n bytes memory\\n )\\n {\\n return abi.encodePacked(\\n _transaction.timestamp,\\n _transaction.blockNumber,\\n _transaction.l1QueueOrigin,\\n _transaction.l1TxOrigin,\\n _transaction.entrypoint,\\n _transaction.gasLimit,\\n _transaction.data\\n );\\n }\\n\\n /**\\n * Hashes a standard OVM transaction.\\n * @param _transaction OVM transaction to encode.\\n * @return Hashed transaction\\n */\\n function hashTransaction(\\n Transaction memory _transaction\\n )\\n internal\\n pure\\n returns (\\n bytes32\\n )\\n {\\n return keccak256(encodeTransaction(_transaction));\\n }\\n\\n /**\\n * Converts an OVM account to an EVM account.\\n * @param _in OVM account to convert.\\n * @return Converted EVM account.\\n */\\n function toEVMAccount(\\n Account memory _in\\n )\\n internal\\n pure\\n returns (\\n EVMAccount memory\\n )\\n {\\n return EVMAccount({\\n nonce: _in.nonce,\\n balance: _in.balance,\\n storageRoot: _in.storageRoot,\\n codeHash: _in.codeHash\\n });\\n }\\n\\n /**\\n * @notice RLP-encodes an account state struct.\\n * @param _account Account state struct.\\n * @return RLP-encoded account state.\\n */\\n function encodeEVMAccount(\\n EVMAccount memory _account\\n )\\n internal\\n pure\\n returns (\\n bytes memory\\n )\\n {\\n bytes[] memory raw = new bytes[](4);\\n\\n // Unfortunately we can't create this array outright because\\n // Lib_RLPWriter.writeList will reject fixed-size arrays. Assigning\\n // index-by-index circumvents this issue.\\n raw[0] = Lib_RLPWriter.writeBytes(\\n Lib_Bytes32Utils.removeLeadingZeros(\\n bytes32(_account.nonce)\\n )\\n );\\n raw[1] = Lib_RLPWriter.writeBytes(\\n Lib_Bytes32Utils.removeLeadingZeros(\\n bytes32(_account.balance)\\n )\\n );\\n raw[2] = Lib_RLPWriter.writeBytes(abi.encodePacked(_account.storageRoot));\\n raw[3] = Lib_RLPWriter.writeBytes(abi.encodePacked(_account.codeHash));\\n\\n return Lib_RLPWriter.writeList(raw);\\n }\\n\\n /**\\n * @notice Decodes an RLP-encoded account state into a useful struct.\\n * @param _encoded RLP-encoded account state.\\n * @return Account state struct.\\n */\\n function decodeEVMAccount(\\n bytes memory _encoded\\n )\\n internal\\n pure\\n returns (\\n EVMAccount memory\\n )\\n {\\n Lib_RLPReader.RLPItem[] memory accountState = Lib_RLPReader.readList(_encoded);\\n\\n return EVMAccount({\\n nonce: Lib_RLPReader.readUint256(accountState[0]),\\n balance: Lib_RLPReader.readUint256(accountState[1]),\\n storageRoot: Lib_RLPReader.readBytes32(accountState[2]),\\n codeHash: Lib_RLPReader.readBytes32(accountState[3])\\n });\\n }\\n\\n /**\\n * Calculates a hash for a given batch header.\\n * @param _batchHeader Header to hash.\\n * @return Hash of the header.\\n */\\n function hashBatchHeader(\\n Lib_OVMCodec.ChainBatchHeader memory _batchHeader\\n )\\n internal\\n pure\\n returns (\\n bytes32\\n )\\n {\\n return keccak256(\\n abi.encode(\\n _batchHeader.batchRoot,\\n _batchHeader.batchSize,\\n _batchHeader.prevTotalElements,\\n _batchHeader.extraData\\n )\\n );\\n }\\n}\\n\",\"keccak256\":\"0xd85ba2066057a2677926f484b938c7c2ef33ff3853f3b71cda252f4a54f30e05\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* External Imports */\\nimport { Ownable } from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\n/**\\n * @title Lib_AddressManager\\n */\\ncontract Lib_AddressManager is Ownable {\\n\\n /**********\\n * Events *\\n **********/\\n\\n event AddressSet(\\n string _name,\\n address _newAddress\\n );\\n\\n\\n /*************\\n * Variables *\\n *************/\\n\\n mapping (bytes32 => address) private addresses;\\n\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Changes the address associated with a particular name.\\n * @param _name String name to associate an address with.\\n * @param _address Address to associate with the name.\\n */\\n function setAddress(\\n string memory _name,\\n address _address\\n )\\n public\\n onlyOwner\\n {\\n addresses[_getNameHash(_name)] = _address;\\n\\n emit AddressSet(\\n _name,\\n _address\\n );\\n }\\n\\n /**\\n * Retrieves the address associated with a given name.\\n * @param _name Name to retrieve an address for.\\n * @return Address associated with the given name.\\n */\\n function getAddress(\\n string memory _name\\n )\\n public\\n view\\n returns (\\n address\\n )\\n {\\n return addresses[_getNameHash(_name)];\\n }\\n\\n\\n /**********************\\n * Internal Functions *\\n **********************/\\n\\n /**\\n * Computes the hash of a name.\\n * @param _name Name to compute a hash for.\\n * @return Hash of the given name.\\n */\\n function _getNameHash(\\n string memory _name\\n )\\n internal\\n pure\\n returns (\\n bytes32\\n )\\n {\\n return keccak256(abi.encodePacked(_name));\\n }\\n}\\n\",\"keccak256\":\"0x2ce671a0e004df88b136bea5a3c59d0732cea8887c8496da1d509e0200b03d7d\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/resolver/Lib_AddressResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* Library Imports */\\nimport { Lib_AddressManager } from \\\"./Lib_AddressManager.sol\\\";\\n\\n/**\\n * @title Lib_AddressResolver\\n */\\nabstract contract Lib_AddressResolver {\\n\\n /*************\\n * Variables *\\n *************/\\n\\n Lib_AddressManager public libAddressManager;\\n\\n\\n /***************\\n * Constructor *\\n ***************/\\n\\n /**\\n * @param _libAddressManager Address of the Lib_AddressManager.\\n */\\n constructor(\\n address _libAddressManager\\n ) {\\n libAddressManager = Lib_AddressManager(_libAddressManager);\\n }\\n\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Resolves the address associated with a given name.\\n * @param _name Name to resolve an address for.\\n * @return Address associated with the given name.\\n */\\n function resolve(\\n string memory _name\\n )\\n public\\n view\\n returns (\\n address\\n )\\n {\\n return libAddressManager.getAddress(_name);\\n }\\n}\\n\",\"keccak256\":\"0x65981feeabff6a81783ea97d44baf988a18a86c8cb374c46fdb71819cbacc7c0\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/rlp/Lib_RLPReader.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/**\\n * @title Lib_RLPReader\\n * @dev Adapted from \\\"RLPReader\\\" by Hamdi Allam (hamdi.allam97@gmail.com).\\n */\\nlibrary Lib_RLPReader {\\n\\n /*************\\n * Constants *\\n *************/\\n\\n uint256 constant internal MAX_LIST_LENGTH = 32;\\n\\n\\n /*********\\n * Enums *\\n *********/\\n\\n enum RLPItemType {\\n DATA_ITEM,\\n LIST_ITEM\\n }\\n\\n\\n /***********\\n * Structs *\\n ***********/\\n\\n struct RLPItem {\\n uint256 length;\\n uint256 ptr;\\n }\\n\\n\\n /**********************\\n * Internal Functions *\\n **********************/\\n\\n /**\\n * Converts bytes to a reference to memory position and length.\\n * @param _in Input bytes to convert.\\n * @return Output memory reference.\\n */\\n function toRLPItem(\\n bytes memory _in\\n )\\n internal\\n pure\\n returns (\\n RLPItem memory\\n )\\n {\\n uint256 ptr;\\n assembly {\\n ptr := add(_in, 32)\\n }\\n\\n return RLPItem({\\n length: _in.length,\\n ptr: ptr\\n });\\n }\\n\\n /**\\n * Reads an RLP list value into a list of RLP items.\\n * @param _in RLP list value.\\n * @return Decoded RLP list items.\\n */\\n function readList(\\n RLPItem memory _in\\n )\\n internal\\n pure\\n returns (\\n RLPItem[] memory\\n )\\n {\\n (\\n uint256 listOffset,\\n ,\\n RLPItemType itemType\\n ) = _decodeLength(_in);\\n\\n require(\\n itemType == RLPItemType.LIST_ITEM,\\n \\\"Invalid RLP list value.\\\"\\n );\\n\\n // Solidity in-memory arrays can't be increased in size, but *can* be decreased in size by\\n // writing to the length. Since we can't know the number of RLP items without looping over\\n // the entire input, we'd have to loop twice to accurately size this array. It's easier to\\n // simply set a reasonable maximum list length and decrease the size before we finish.\\n RLPItem[] memory out = new RLPItem[](MAX_LIST_LENGTH);\\n\\n uint256 itemCount = 0;\\n uint256 offset = listOffset;\\n while (offset < _in.length) {\\n require(\\n itemCount < MAX_LIST_LENGTH,\\n \\\"Provided RLP list exceeds max list length.\\\"\\n );\\n\\n (\\n uint256 itemOffset,\\n uint256 itemLength,\\n ) = _decodeLength(RLPItem({\\n length: _in.length - offset,\\n ptr: _in.ptr + offset\\n }));\\n\\n out[itemCount] = RLPItem({\\n length: itemLength + itemOffset,\\n ptr: _in.ptr + offset\\n });\\n\\n itemCount += 1;\\n offset += itemOffset + itemLength;\\n }\\n\\n // Decrease the array size to match the actual item count.\\n assembly {\\n mstore(out, itemCount)\\n }\\n\\n return out;\\n }\\n\\n /**\\n * Reads an RLP list value into a list of RLP items.\\n * @param _in RLP list value.\\n * @return Decoded RLP list items.\\n */\\n function readList(\\n bytes memory _in\\n )\\n internal\\n pure\\n returns (\\n RLPItem[] memory\\n )\\n {\\n return readList(\\n toRLPItem(_in)\\n );\\n }\\n\\n /**\\n * Reads an RLP bytes value into bytes.\\n * @param _in RLP bytes value.\\n * @return Decoded bytes.\\n */\\n function readBytes(\\n RLPItem memory _in\\n )\\n internal\\n pure\\n returns (\\n bytes memory\\n )\\n {\\n (\\n uint256 itemOffset,\\n uint256 itemLength,\\n RLPItemType itemType\\n ) = _decodeLength(_in);\\n\\n require(\\n itemType == RLPItemType.DATA_ITEM,\\n \\\"Invalid RLP bytes value.\\\"\\n );\\n\\n return _copy(_in.ptr, itemOffset, itemLength);\\n }\\n\\n /**\\n * Reads an RLP bytes value into bytes.\\n * @param _in RLP bytes value.\\n * @return Decoded bytes.\\n */\\n function readBytes(\\n bytes memory _in\\n )\\n internal\\n pure\\n returns (\\n bytes memory\\n )\\n {\\n return readBytes(\\n toRLPItem(_in)\\n );\\n }\\n\\n /**\\n * Reads an RLP string value into a string.\\n * @param _in RLP string value.\\n * @return Decoded string.\\n */\\n function readString(\\n RLPItem memory _in\\n )\\n internal\\n pure\\n returns (\\n string memory\\n )\\n {\\n return string(readBytes(_in));\\n }\\n\\n /**\\n * Reads an RLP string value into a string.\\n * @param _in RLP string value.\\n * @return Decoded string.\\n */\\n function readString(\\n bytes memory _in\\n )\\n internal\\n pure\\n returns (\\n string memory\\n )\\n {\\n return readString(\\n toRLPItem(_in)\\n );\\n }\\n\\n /**\\n * Reads an RLP bytes32 value into a bytes32.\\n * @param _in RLP bytes32 value.\\n * @return Decoded bytes32.\\n */\\n function readBytes32(\\n RLPItem memory _in\\n )\\n internal\\n pure\\n returns (\\n bytes32\\n )\\n {\\n require(\\n _in.length <= 33,\\n \\\"Invalid RLP bytes32 value.\\\"\\n );\\n\\n (\\n uint256 itemOffset,\\n uint256 itemLength,\\n RLPItemType itemType\\n ) = _decodeLength(_in);\\n\\n require(\\n itemType == RLPItemType.DATA_ITEM,\\n \\\"Invalid RLP bytes32 value.\\\"\\n );\\n\\n uint256 ptr = _in.ptr + itemOffset;\\n bytes32 out;\\n assembly {\\n out := mload(ptr)\\n\\n // Shift the bytes over to match the item size.\\n if lt(itemLength, 32) {\\n out := div(out, exp(256, sub(32, itemLength)))\\n }\\n }\\n\\n return out;\\n }\\n\\n /**\\n * Reads an RLP bytes32 value into a bytes32.\\n * @param _in RLP bytes32 value.\\n * @return Decoded bytes32.\\n */\\n function readBytes32(\\n bytes memory _in\\n )\\n internal\\n pure\\n returns (\\n bytes32\\n )\\n {\\n return readBytes32(\\n toRLPItem(_in)\\n );\\n }\\n\\n /**\\n * Reads an RLP uint256 value into a uint256.\\n * @param _in RLP uint256 value.\\n * @return Decoded uint256.\\n */\\n function readUint256(\\n RLPItem memory _in\\n )\\n internal\\n pure\\n returns (\\n uint256\\n )\\n {\\n return uint256(readBytes32(_in));\\n }\\n\\n /**\\n * Reads an RLP uint256 value into a uint256.\\n * @param _in RLP uint256 value.\\n * @return Decoded uint256.\\n */\\n function readUint256(\\n bytes memory _in\\n )\\n internal\\n pure\\n returns (\\n uint256\\n )\\n {\\n return readUint256(\\n toRLPItem(_in)\\n );\\n }\\n\\n /**\\n * Reads an RLP bool value into a bool.\\n * @param _in RLP bool value.\\n * @return Decoded bool.\\n */\\n function readBool(\\n RLPItem memory _in\\n )\\n internal\\n pure\\n returns (\\n bool\\n )\\n {\\n require(\\n _in.length == 1,\\n \\\"Invalid RLP boolean value.\\\"\\n );\\n\\n uint256 ptr = _in.ptr;\\n uint256 out;\\n assembly {\\n out := byte(0, mload(ptr))\\n }\\n\\n require(\\n out == 0 || out == 1,\\n \\\"Lib_RLPReader: Invalid RLP boolean value, must be 0 or 1\\\"\\n );\\n\\n return out != 0;\\n }\\n\\n /**\\n * Reads an RLP bool value into a bool.\\n * @param _in RLP bool value.\\n * @return Decoded bool.\\n */\\n function readBool(\\n bytes memory _in\\n )\\n internal\\n pure\\n returns (\\n bool\\n )\\n {\\n return readBool(\\n toRLPItem(_in)\\n );\\n }\\n\\n /**\\n * Reads an RLP address value into a address.\\n * @param _in RLP address value.\\n * @return Decoded address.\\n */\\n function readAddress(\\n RLPItem memory _in\\n )\\n internal\\n pure\\n returns (\\n address\\n )\\n {\\n if (_in.length == 1) {\\n return address(0);\\n }\\n\\n require(\\n _in.length == 21,\\n \\\"Invalid RLP address value.\\\"\\n );\\n\\n return address(readUint256(_in));\\n }\\n\\n /**\\n * Reads an RLP address value into a address.\\n * @param _in RLP address value.\\n * @return Decoded address.\\n */\\n function readAddress(\\n bytes memory _in\\n )\\n internal\\n pure\\n returns (\\n address\\n )\\n {\\n return readAddress(\\n toRLPItem(_in)\\n );\\n }\\n\\n /**\\n * Reads the raw bytes of an RLP item.\\n * @param _in RLP item to read.\\n * @return Raw RLP bytes.\\n */\\n function readRawBytes(\\n RLPItem memory _in\\n )\\n internal\\n pure\\n returns (\\n bytes memory\\n )\\n {\\n return _copy(_in);\\n }\\n\\n\\n /*********************\\n * Private Functions *\\n *********************/\\n\\n /**\\n * Decodes the length of an RLP item.\\n * @param _in RLP item to decode.\\n * @return Offset of the encoded data.\\n * @return Length of the encoded data.\\n * @return RLP item type (LIST_ITEM or DATA_ITEM).\\n */\\n function _decodeLength(\\n RLPItem memory _in\\n )\\n private\\n pure\\n returns (\\n uint256,\\n uint256,\\n RLPItemType\\n )\\n {\\n require(\\n _in.length > 0,\\n \\\"RLP item cannot be null.\\\"\\n );\\n\\n uint256 ptr = _in.ptr;\\n uint256 prefix;\\n assembly {\\n prefix := byte(0, mload(ptr))\\n }\\n\\n if (prefix <= 0x7f) {\\n // Single byte.\\n\\n return (0, 1, RLPItemType.DATA_ITEM);\\n } else if (prefix <= 0xb7) {\\n // Short string.\\n\\n uint256 strLen = prefix - 0x80;\\n\\n require(\\n _in.length > strLen,\\n \\\"Invalid RLP short string.\\\"\\n );\\n\\n return (1, strLen, RLPItemType.DATA_ITEM);\\n } else if (prefix <= 0xbf) {\\n // Long string.\\n uint256 lenOfStrLen = prefix - 0xb7;\\n\\n require(\\n _in.length > lenOfStrLen,\\n \\\"Invalid RLP long string length.\\\"\\n );\\n\\n uint256 strLen;\\n assembly {\\n // Pick out the string length.\\n strLen := div(\\n mload(add(ptr, 1)),\\n exp(256, sub(32, lenOfStrLen))\\n )\\n }\\n\\n require(\\n _in.length > lenOfStrLen + strLen,\\n \\\"Invalid RLP long string.\\\"\\n );\\n\\n return (1 + lenOfStrLen, strLen, RLPItemType.DATA_ITEM);\\n } else if (prefix <= 0xf7) {\\n // Short list.\\n uint256 listLen = prefix - 0xc0;\\n\\n require(\\n _in.length > listLen,\\n \\\"Invalid RLP short list.\\\"\\n );\\n\\n return (1, listLen, RLPItemType.LIST_ITEM);\\n } else {\\n // Long list.\\n uint256 lenOfListLen = prefix - 0xf7;\\n\\n require(\\n _in.length > lenOfListLen,\\n \\\"Invalid RLP long list length.\\\"\\n );\\n\\n uint256 listLen;\\n assembly {\\n // Pick out the list length.\\n listLen := div(\\n mload(add(ptr, 1)),\\n exp(256, sub(32, lenOfListLen))\\n )\\n }\\n\\n require(\\n _in.length > lenOfListLen + listLen,\\n \\\"Invalid RLP long list.\\\"\\n );\\n\\n return (1 + lenOfListLen, listLen, RLPItemType.LIST_ITEM);\\n }\\n }\\n\\n /**\\n * Copies the bytes from a memory location.\\n * @param _src Pointer to the location to read from.\\n * @param _offset Offset to start reading from.\\n * @param _length Number of bytes to read.\\n * @return Copied bytes.\\n */\\n function _copy(\\n uint256 _src,\\n uint256 _offset,\\n uint256 _length\\n )\\n private\\n pure\\n returns (\\n bytes memory\\n )\\n {\\n bytes memory out = new bytes(_length);\\n if (out.length == 0) {\\n return out;\\n }\\n\\n uint256 src = _src + _offset;\\n uint256 dest;\\n assembly {\\n dest := add(out, 32)\\n }\\n\\n // Copy over as many complete words as we can.\\n for (uint256 i = 0; i < _length / 32; i++) {\\n assembly {\\n mstore(dest, mload(src))\\n }\\n\\n src += 32;\\n dest += 32;\\n }\\n\\n // Pick out the remaining bytes.\\n uint256 mask = 256 ** (32 - (_length % 32)) - 1;\\n assembly {\\n mstore(\\n dest,\\n or(\\n and(mload(src), not(mask)),\\n and(mload(dest), mask)\\n )\\n )\\n }\\n\\n return out;\\n }\\n\\n /**\\n * Copies an RLP item into bytes.\\n * @param _in RLP item to copy.\\n * @return Copied bytes.\\n */\\n function _copy(\\n RLPItem memory _in\\n )\\n private\\n pure\\n returns (\\n bytes memory\\n )\\n {\\n return _copy(_in.ptr, 0, _in.length);\\n }\\n}\\n\",\"keccak256\":\"0x829174c61216dce35fdb888383b6022e0365eb7fbdc71ad79d98b108091969fe\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/rlp/Lib_RLPWriter.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\npragma experimental ABIEncoderV2;\\n\\n/**\\n * @title Lib_RLPWriter\\n * @author Bakaoh (with modifications)\\n */\\nlibrary Lib_RLPWriter {\\n\\n /**********************\\n * Internal Functions *\\n **********************/\\n\\n /**\\n * RLP encodes a byte string.\\n * @param _in The byte string to encode.\\n * @return The RLP encoded string in bytes.\\n */\\n function writeBytes(\\n bytes memory _in\\n )\\n internal\\n pure\\n returns (\\n bytes memory\\n )\\n {\\n bytes memory encoded;\\n\\n if (_in.length == 1 && uint8(_in[0]) < 128) {\\n encoded = _in;\\n } else {\\n encoded = abi.encodePacked(_writeLength(_in.length, 128), _in);\\n }\\n\\n return encoded;\\n }\\n\\n /**\\n * RLP encodes a list of RLP encoded byte byte strings.\\n * @param _in The list of RLP encoded byte strings.\\n * @return The RLP encoded list of items in bytes.\\n */\\n function writeList(\\n bytes[] memory _in\\n )\\n internal\\n pure\\n returns (\\n bytes memory\\n )\\n {\\n bytes memory list = _flatten(_in);\\n return abi.encodePacked(_writeLength(list.length, 192), list);\\n }\\n\\n /**\\n * RLP encodes a string.\\n * @param _in The string to encode.\\n * @return The RLP encoded string in bytes.\\n */\\n function writeString(\\n string memory _in\\n )\\n internal\\n pure\\n returns (\\n bytes memory\\n )\\n {\\n return writeBytes(bytes(_in));\\n }\\n\\n /**\\n * RLP encodes an address.\\n * @param _in The address to encode.\\n * @return The RLP encoded address in bytes.\\n */\\n function writeAddress(\\n address _in\\n )\\n internal\\n pure\\n returns (\\n bytes memory\\n )\\n {\\n return writeBytes(abi.encodePacked(_in));\\n }\\n\\n /**\\n * RLP encodes a bytes32 value.\\n * @param _in The bytes32 to encode.\\n * @return _out The RLP encoded bytes32 in bytes.\\n */\\n function writeBytes32(\\n bytes32 _in\\n )\\n internal\\n pure\\n returns (\\n bytes memory _out\\n )\\n {\\n return writeBytes(abi.encodePacked(_in));\\n }\\n\\n /**\\n * RLP encodes a uint.\\n * @param _in The uint256 to encode.\\n * @return The RLP encoded uint256 in bytes.\\n */\\n function writeUint(\\n uint256 _in\\n )\\n internal\\n pure\\n returns (\\n bytes memory\\n )\\n {\\n return writeBytes(_toBinary(_in));\\n }\\n\\n /**\\n * RLP encodes a bool.\\n * @param _in The bool to encode.\\n * @return The RLP encoded bool in bytes.\\n */\\n function writeBool(\\n bool _in\\n )\\n internal\\n pure\\n returns (\\n bytes memory\\n )\\n {\\n bytes memory encoded = new bytes(1);\\n encoded[0] = (_in ? bytes1(0x01) : bytes1(0x80));\\n return encoded;\\n }\\n\\n\\n /*********************\\n * Private Functions *\\n *********************/\\n\\n /**\\n * Encode the first byte, followed by the `len` in binary form if `length` is more than 55.\\n * @param _len The length of the string or the payload.\\n * @param _offset 128 if item is string, 192 if item is list.\\n * @return RLP encoded bytes.\\n */\\n function _writeLength(\\n uint256 _len,\\n uint256 _offset\\n )\\n private\\n pure\\n returns (\\n bytes memory\\n )\\n {\\n bytes memory encoded;\\n\\n if (_len < 56) {\\n encoded = new bytes(1);\\n encoded[0] = byte(uint8(_len) + uint8(_offset));\\n } else {\\n uint256 lenLen;\\n uint256 i = 1;\\n while (_len / i != 0) {\\n lenLen++;\\n i *= 256;\\n }\\n\\n encoded = new bytes(lenLen + 1);\\n encoded[0] = byte(uint8(lenLen) + uint8(_offset) + 55);\\n for(i = 1; i <= lenLen; i++) {\\n encoded[i] = byte(uint8((_len / (256**(lenLen-i))) % 256));\\n }\\n }\\n\\n return encoded;\\n }\\n\\n /**\\n * Encode integer in big endian binary form with no leading zeroes.\\n * @notice TODO: This should be optimized with assembly to save gas costs.\\n * @param _x The integer to encode.\\n * @return RLP encoded bytes.\\n */\\n function _toBinary(\\n uint256 _x\\n )\\n private\\n pure\\n returns (\\n bytes memory\\n )\\n {\\n bytes memory b = abi.encodePacked(_x);\\n\\n uint256 i = 0;\\n for (; i < 32; i++) {\\n if (b[i] != 0) {\\n break;\\n }\\n }\\n\\n bytes memory res = new bytes(32 - i);\\n for (uint256 j = 0; j < res.length; j++) {\\n res[j] = b[i++];\\n }\\n\\n return res;\\n }\\n\\n /**\\n * Copies a piece of memory to another location.\\n * @notice From: https://github.com/Arachnid/solidity-stringutils/blob/master/src/strings.sol.\\n * @param _dest Destination location.\\n * @param _src Source location.\\n * @param _len Length of memory to copy.\\n */\\n function _memcpy(\\n uint256 _dest,\\n uint256 _src,\\n uint256 _len\\n )\\n private\\n pure\\n {\\n uint256 dest = _dest;\\n uint256 src = _src;\\n uint256 len = _len;\\n\\n for(; len >= 32; len -= 32) {\\n assembly {\\n mstore(dest, mload(src))\\n }\\n dest += 32;\\n src += 32;\\n }\\n\\n uint256 mask = 256 ** (32 - len) - 1;\\n assembly {\\n let srcpart := and(mload(src), not(mask))\\n let destpart := and(mload(dest), mask)\\n mstore(dest, or(destpart, srcpart))\\n }\\n }\\n\\n /**\\n * Flattens a list of byte strings into one byte string.\\n * @notice From: https://github.com/sammayo/solidity-rlp-encoder/blob/master/RLPEncode.sol.\\n * @param _list List of byte strings to flatten.\\n * @return The flattened byte string.\\n */\\n function _flatten(\\n bytes[] memory _list\\n )\\n private\\n pure\\n returns (\\n bytes memory\\n )\\n {\\n if (_list.length == 0) {\\n return new bytes(0);\\n }\\n\\n uint256 len;\\n uint256 i = 0;\\n for (; i < _list.length; i++) {\\n len += _list[i].length;\\n }\\n\\n bytes memory flattened = new bytes(len);\\n uint256 flattenedPtr;\\n assembly { flattenedPtr := add(flattened, 0x20) }\\n\\n for(i = 0; i < _list.length; i++) {\\n bytes memory item = _list[i];\\n\\n uint256 listPtr;\\n assembly { listPtr := add(item, 0x20)}\\n\\n _memcpy(flattenedPtr, listPtr, item.length);\\n flattenedPtr += _list[i].length;\\n }\\n\\n return flattened;\\n }\\n}\\n\",\"keccak256\":\"0xb60ee4b03ad372c3deff21d454ab714dd0c18ee3e6f9d45532e209fc59d5a54d\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/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 (_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 (\\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\":\"0xa5195afe32fb2cf104d156e8f4bd39df1ec79bf6ba232097b9e8e0ee14fbc298\",\"license\":\"MIT\"}},\"version\":1}",
"bytecode": "0x608060405234801561001057600080fd5b50604051610a22380380610a2283398101604081905261002f91610054565b600080546001600160a01b0319166001600160a01b0392909216919091179055610082565b600060208284031215610065578081fd5b81516001600160a01b038116811461007b578182fd5b9392505050565b610991806100916000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c806316e9cd9b14610046578063299ca4781461005b578063461a447814610079575b600080fd5b61005961005436600461057d565b61008c565b005b6100636101ea565b60405161007091906106db565b60405180910390f35b6100636100873660046105ec565b6101f9565b6100ca6040518060400160405280601981526020017f4f564d5f4c3242617463684d65737361676552656c61796572000000000000008152506101f9565b6001600160a01b0316336001600160a01b0316146101035760405162461bcd60e51b81526004016100fa906107d7565b60405180910390fd5b600061012660405180606001604052806021815260200161093b602191396101f9565b905060005b828110156101e457600084848381811061014157fe5b9050602002810190610153919061085a565b61015c9061089d565b8051602082015160408084015160608501516080860151925163d7fd19dd60e01b81529596506001600160a01b0389169563d7fd19dd956101a5959094909392916004016106ef565b600060405180830381600087803b1580156101bf57600080fd5b505af11580156101d3573d6000803e3d6000fd5b50506001909301925061012b915050565b50505050565b6000546001600160a01b031681565b6000805460405163bf40fac160e01b81526020600482018181528551602484015285516001600160a01b039094169363bf40fac19387938392604490920191908501908083838b5b83811015610259578181015183820152602001610241565b50505050905090810190601f1680156102865780820380516001836020036101000a031916815260200191505b509250505060206040518083038186803b1580156102a357600080fd5b505afa1580156102b7573d6000803e3d6000fd5b505050506040513d60208110156102cd57600080fd5b505190505b919050565b600067ffffffffffffffff8311156102eb57fe5b6102fe601f8401601f1916602001610879565b905082815283838301111561031257600080fd5b828260208301376000602084830101529392505050565b80356001600160a01b03811681146102d257600080fd5b600082601f830112610350578081fd5b61035f838335602085016102d7565b9392505050565b600060a08284031215610377578081fd5b60405160a0810167ffffffffffffffff828210818311171561039557fe5b816040528293508435835260208501356020840152604085013560408401526060850135606084015260808501359150808211156103d257600080fd5b506103df85828601610340565b6080830152505092915050565b6000604082840312156103fd578081fd5b6040516040810167ffffffffffffffff828210818311171561041b57fe5b816040528293508435835260209150818501358181111561043b57600080fd5b8501601f8101871361044c57600080fd5b80358281111561045857fe5b8381029250610468848401610879565b8181528481019083860185850187018b101561048357600080fd5b600095505b838610156104a6578035835260019590950194918601918601610488565b5080868801525050505050505092915050565b600060a082840312156104ca578081fd5b6104d460a0610879565b905081358152602082013567ffffffffffffffff808211156104f557600080fd5b61050185838601610366565b6020840152604084013591508082111561051a57600080fd5b610526858386016103ec565b6040840152606084013591508082111561053f57600080fd5b61054b85838601610340565b6060840152608084013591508082111561056457600080fd5b5061057184828501610340565b60808301525092915050565b6000806020838503121561058f578182fd5b823567ffffffffffffffff808211156105a6578384fd5b818501915085601f8301126105b9578384fd5b8135818111156105c7578485fd5b86602080830285010111156105da578485fd5b60209290920196919550909350505050565b6000602082840312156105fd578081fd5b813567ffffffffffffffff811115610613578182fd5b8201601f81018413610623578182fd5b610632848235602084016102d7565b949350505050565b60008151808452815b8181101561065f57602081850181015186830182015201610643565b818111156106705782602083870101525b50601f01601f19169290920160200192915050565b6000604083018251845260208084015160408287015282815180855260608801915083830194508592505b808310156106d057845182529383019360019290920191908301906106b0565b509695505050505050565b6001600160a01b0391909116815260200190565b6001600160a01b0386811682528516602082015260a06040820181905260009061071b9083018661063a565b846060840152828103608084015283518152602084015160a06020830152805160a0830152602081015160c0830152604081015160e083015260608101516101008301526080810151905060a061012083015261077c61014083018261063a565b9050604085015182820360408401526107958282610685565b915050606085015182820360608401526107af828261063a565b915050608085015182820360808401526107c9828261063a565b9a9950505050505050505050565b60208082526057908201527f4f564d5f4c314d756c74694d65737361676552656c617965723a2046756e637460408201527f696f6e2063616e206f6e6c792062652063616c6c656420627920746865204f5660608201527f4d5f4c3242617463684d65737361676552656c61796572000000000000000000608082015260a00190565b60008235609e1983360301811261086f578182fd5b9190910192915050565b60405181810167ffffffffffffffff8111828210171561089557fe5b604052919050565b600060a082360312156108ae578081fd5b60405160a0810167ffffffffffffffff82821081831117156108cc57fe5b816040526108d985610329565b83526108e760208601610329565b602084015260408501359150808211156108ff578384fd5b61090b36838701610340565b604084015260608501356060840152608085013591508082111561092d578384fd5b50610571368286016104b956fe50726f78795f5f4f564d5f4c3143726f7373446f6d61696e4d657373656e676572a264697066735822122054e57719bdaae865a83549e03668e0558acc8a0d1d5ba65034f61a02d9a35c6264736f6c63430007060033",
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100415760003560e01c806316e9cd9b14610046578063299ca4781461005b578063461a447814610079575b600080fd5b61005961005436600461057d565b61008c565b005b6100636101ea565b60405161007091906106db565b60405180910390f35b6100636100873660046105ec565b6101f9565b6100ca6040518060400160405280601981526020017f4f564d5f4c3242617463684d65737361676552656c61796572000000000000008152506101f9565b6001600160a01b0316336001600160a01b0316146101035760405162461bcd60e51b81526004016100fa906107d7565b60405180910390fd5b600061012660405180606001604052806021815260200161093b602191396101f9565b905060005b828110156101e457600084848381811061014157fe5b9050602002810190610153919061085a565b61015c9061089d565b8051602082015160408084015160608501516080860151925163d7fd19dd60e01b81529596506001600160a01b0389169563d7fd19dd956101a5959094909392916004016106ef565b600060405180830381600087803b1580156101bf57600080fd5b505af11580156101d3573d6000803e3d6000fd5b50506001909301925061012b915050565b50505050565b6000546001600160a01b031681565b6000805460405163bf40fac160e01b81526020600482018181528551602484015285516001600160a01b039094169363bf40fac19387938392604490920191908501908083838b5b83811015610259578181015183820152602001610241565b50505050905090810190601f1680156102865780820380516001836020036101000a031916815260200191505b509250505060206040518083038186803b1580156102a357600080fd5b505afa1580156102b7573d6000803e3d6000fd5b505050506040513d60208110156102cd57600080fd5b505190505b919050565b600067ffffffffffffffff8311156102eb57fe5b6102fe601f8401601f1916602001610879565b905082815283838301111561031257600080fd5b828260208301376000602084830101529392505050565b80356001600160a01b03811681146102d257600080fd5b600082601f830112610350578081fd5b61035f838335602085016102d7565b9392505050565b600060a08284031215610377578081fd5b60405160a0810167ffffffffffffffff828210818311171561039557fe5b816040528293508435835260208501356020840152604085013560408401526060850135606084015260808501359150808211156103d257600080fd5b506103df85828601610340565b6080830152505092915050565b6000604082840312156103fd578081fd5b6040516040810167ffffffffffffffff828210818311171561041b57fe5b816040528293508435835260209150818501358181111561043b57600080fd5b8501601f8101871361044c57600080fd5b80358281111561045857fe5b8381029250610468848401610879565b8181528481019083860185850187018b101561048357600080fd5b600095505b838610156104a6578035835260019590950194918601918601610488565b5080868801525050505050505092915050565b600060a082840312156104ca578081fd5b6104d460a0610879565b905081358152602082013567ffffffffffffffff808211156104f557600080fd5b61050185838601610366565b6020840152604084013591508082111561051a57600080fd5b610526858386016103ec565b6040840152606084013591508082111561053f57600080fd5b61054b85838601610340565b6060840152608084013591508082111561056457600080fd5b5061057184828501610340565b60808301525092915050565b6000806020838503121561058f578182fd5b823567ffffffffffffffff808211156105a6578384fd5b818501915085601f8301126105b9578384fd5b8135818111156105c7578485fd5b86602080830285010111156105da578485fd5b60209290920196919550909350505050565b6000602082840312156105fd578081fd5b813567ffffffffffffffff811115610613578182fd5b8201601f81018413610623578182fd5b610632848235602084016102d7565b949350505050565b60008151808452815b8181101561065f57602081850181015186830182015201610643565b818111156106705782602083870101525b50601f01601f19169290920160200192915050565b6000604083018251845260208084015160408287015282815180855260608801915083830194508592505b808310156106d057845182529383019360019290920191908301906106b0565b509695505050505050565b6001600160a01b0391909116815260200190565b6001600160a01b0386811682528516602082015260a06040820181905260009061071b9083018661063a565b846060840152828103608084015283518152602084015160a06020830152805160a0830152602081015160c0830152604081015160e083015260608101516101008301526080810151905060a061012083015261077c61014083018261063a565b9050604085015182820360408401526107958282610685565b915050606085015182820360608401526107af828261063a565b915050608085015182820360808401526107c9828261063a565b9a9950505050505050505050565b60208082526057908201527f4f564d5f4c314d756c74694d65737361676552656c617965723a2046756e637460408201527f696f6e2063616e206f6e6c792062652063616c6c656420627920746865204f5660608201527f4d5f4c3242617463684d65737361676552656c61796572000000000000000000608082015260a00190565b60008235609e1983360301811261086f578182fd5b9190910192915050565b60405181810167ffffffffffffffff8111828210171561089557fe5b604052919050565b600060a082360312156108ae578081fd5b60405160a0810167ffffffffffffffff82821081831117156108cc57fe5b816040526108d985610329565b83526108e760208601610329565b602084015260408501359150808211156108ff578384fd5b61090b36838701610340565b604084015260608501356060840152608085013591508082111561092d578384fd5b50610571368286016104b956fe50726f78795f5f4f564d5f4c3143726f7373446f6d61696e4d657373656e676572a264697066735822122054e57719bdaae865a83549e03668e0558acc8a0d1d5ba65034f61a02d9a35c6264736f6c63430007060033",
"devdoc": {
"details": "The L1 Multi-Message Relayer contract is a gas efficiency optimization which enables the relayer to submit multiple messages in a single transaction to be relayed by the L1 Cross Domain Message Sender. Compiler used: solc Runtime target: EVM",
"kind": "dev",
"methods": {
"batchRelayMessages((address,address,bytes,uint256,(bytes32,(uint256,bytes32,uint256,uint256,bytes),(uint256,bytes32[]),bytes,bytes))[])": {
"params": {
"_messages": "An array of L2 to L1 messages"
}
},
"constructor": {
"params": {
"_libAddressManager": "Address of the Address Manager."
}
},
"resolve(string)": {
"params": {
"_name": "Name to resolve an address for."
},
"returns": {
"_0": "Address associated with the given name."
}
}
},
"title": "OVM_L1MultiMessageRelayer",
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {
"batchRelayMessages((address,address,bytes,uint256,(bytes32,(uint256,bytes32,uint256,uint256,bytes),(uint256,bytes32[]),bytes,bytes))[])": {
"notice": "Forwards multiple cross domain messages to the L1 Cross Domain Messenger for relaying"
},
"resolve(string)": {
"notice": "Resolves the address associated with a given name."
}
},
"version": 1
},
"storageLayout": {
"storage": [
{
"astId": 12055,
"contract": "contracts/optimistic-ethereum/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol:OVM_L1MultiMessageRelayer",
"label": "libAddressManager",
"offset": 0,
"slot": "0",
"type": "t_contract(Lib_AddressManager)12048"
}
],
"types": {
"t_contract(Lib_AddressManager)12048": {
"encoding": "inplace",
"label": "contract Lib_AddressManager",
"numberOfBytes": "20"
}
}
}
}
\ No newline at end of file
{
"address": "0x71D4ea896C9a2D4a973CC5c7E347B6707691ECa0",
"abi": [
{
"inputs": [
{
"internalType": "bytes",
"name": "_bytecode",
"type": "bytes"
}
],
"name": "isBytecodeSafe",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "pure",
"type": "function"
}
],
"transactionHash": "0x71b7c1e6832ad929f7d8f28c89efcd535b888c667cc23b7afb74b7f3cb9989be",
"receipt": {
"to": null,
"from": "0x4107438C1b1579f258AF9d1AC06194C4a0F55040",
"contractAddress": "0x71D4ea896C9a2D4a973CC5c7E347B6707691ECa0",
"transactionIndex": 10,
"gasUsed": "243548",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blockHash": "0xc547b5d6b5db90aa7a21312706d22b72125e2883d5ff3ad54698673644e3a14c",
"transactionHash": "0x71b7c1e6832ad929f7d8f28c89efcd535b888c667cc23b7afb74b7f3cb9989be",
"logs": [],
"blockNumber": 4694122,
"cumulativeGasUsed": "839321",
"status": 1,
"byzantium": true
},
"args": [],
"solcInputHash": "dde656dd41f49cad9eac9bc7065fd6a7",
"metadata": "{\"compiler\":{\"version\":\"0.7.6+commit.7338295f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_bytecode\",\"type\":\"bytes\"}],\"name\":\"isBytecodeSafe\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"The Safety Checker verifies that contracts deployed on L2 do not contain any \\\"unsafe\\\" operations. An operation is considered unsafe if it would access state variables which are specific to the environment (ie. L1 or L2) in which it is executed, as this could be used to \\\"escape the sandbox\\\" of the OVM, resulting in non-deterministic fraud proofs. That is, an attacker would be able to \\\"prove fraud\\\" on an honestly applied transaction. Note that a \\\"safe\\\" contract requires opcodes to appear in a particular pattern; omission of \\\"unsafe\\\" opcodes is necessary, but not sufficient. Compiler used: solc Runtime target: EVM\",\"kind\":\"dev\",\"methods\":{\"isBytecodeSafe(bytes)\":{\"params\":{\"_bytecode\":\"The bytecode to safety check.\"},\"returns\":{\"_0\":\"`true` if the bytecode is safe, `false` otherwise.\"}}},\"title\":\"OVM_SafetyChecker\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"isBytecodeSafe(bytes)\":{\"notice\":\"Returns whether or not all of the provided bytecode is safe.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/optimistic-ethereum/OVM/execution/OVM_SafetyChecker.sol\":\"OVM_SafetyChecker\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/optimistic-ethereum/OVM/execution/OVM_SafetyChecker.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* Interface Imports */\\nimport { iOVM_SafetyChecker } from \\\"../../iOVM/execution/iOVM_SafetyChecker.sol\\\";\\n\\n/**\\n * @title OVM_SafetyChecker\\n * @dev The Safety Checker verifies that contracts deployed on L2 do not contain any\\n * \\\"unsafe\\\" operations. An operation is considered unsafe if it would access state variables which\\n * are specific to the environment (ie. L1 or L2) in which it is executed, as this could be used\\n * to \\\"escape the sandbox\\\" of the OVM, resulting in non-deterministic fraud proofs.\\n * That is, an attacker would be able to \\\"prove fraud\\\" on an honestly applied transaction.\\n * Note that a \\\"safe\\\" contract requires opcodes to appear in a particular pattern;\\n * omission of \\\"unsafe\\\" opcodes is necessary, but not sufficient.\\n *\\n * Compiler used: solc\\n * Runtime target: EVM\\n */\\ncontract OVM_SafetyChecker is iOVM_SafetyChecker {\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Returns whether or not all of the provided bytecode is safe.\\n * @param _bytecode The bytecode to safety check.\\n * @return `true` if the bytecode is safe, `false` otherwise.\\n */\\n function isBytecodeSafe(\\n bytes memory _bytecode\\n )\\n override\\n external\\n pure\\n returns (\\n bool\\n )\\n {\\n // autogenerated by gen_safety_checker_constants.py\\n // number of bytes to skip for each opcode\\n uint256[8] memory opcodeSkippableBytes = [\\n uint256(0x0001010101010101010101010000000001010101010101010101010101010000),\\n uint256(0x0100000000000000000000000000000000000000010101010101000000010100),\\n uint256(0x0000000000000000000000000000000001010101000000010101010100000000),\\n uint256(0x0203040500000000000000000000000000000000000000000000000000000000),\\n uint256(0x0101010101010101010101010101010101010101010101010101010101010101),\\n uint256(0x0101010101000000000000000000000000000000000000000000000000000000),\\n uint256(0x0000000000000000000000000000000000000000000000000000000000000000),\\n uint256(0x0000000000000000000000000000000000000000000000000000000000000000)\\n ];\\n // Mask to gate opcode specific cases\\n uint256 opcodeGateMask = ~uint256(0xffffffffffffffffffffffe000000000fffffffff070ffff9c0ffffec000f001);\\n // Halting opcodes\\n uint256 opcodeHaltingMask = ~uint256(0x4008000000000000000000000000000000000000004000000000000000000001);\\n // PUSH opcodes\\n uint256 opcodePushMask = ~uint256(0xffffffff000000000000000000000000);\\n\\n uint256 codeLength;\\n uint256 _pc;\\n assembly {\\n _pc := add(_bytecode, 0x20)\\n }\\n codeLength = _pc + _bytecode.length;\\n do {\\n // current opcode: 0x00...0xff\\n uint256 opNum;\\n\\n // inline assembly removes the extra add + bounds check\\n assembly {\\n let word := mload(_pc) //load the next 32 bytes at pc into word\\n\\n // Look up number of bytes to skip from opcodeSkippableBytes and then update indexInWord\\n // E.g. the 02030405 in opcodeSkippableBytes is the number of bytes to skip for PUSH1->4\\n // We repeat this 6 times, thus we can only skip bytes for up to PUSH4 ((1+4) * 6 = 30 < 32).\\n // If we see an opcode that is listed as 0 skippable bytes e.g. PUSH5,\\n // then we will get stuck on that indexInWord and then opNum will be set to the PUSH5 opcode.\\n let indexInWord := byte(0, mload(add(opcodeSkippableBytes, byte(0, word))))\\n indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))\\n indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))\\n indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))\\n indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))\\n indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))\\n _pc := add(_pc, indexInWord)\\n\\n opNum := byte(indexInWord, word)\\n }\\n\\n // + push opcodes\\n // + stop opcodes [STOP(0x00),JUMP(0x56),RETURN(0xf3),INVALID(0xfe)]\\n // + caller opcode CALLER(0x33)\\n // + blacklisted opcodes\\n uint256 opBit = 1 << opNum;\\n if (opBit & opcodeGateMask == 0) {\\n if (opBit & opcodePushMask == 0) {\\n // all pushes are valid opcodes\\n // subsequent bytes are not opcodes. Skip them.\\n _pc += (opNum - 0x5e); // PUSH1 is 0x60, so opNum-0x5f = PUSHed bytes and we +1 to\\n // skip the _pc++; line below in order to save gas ((-0x5f + 1) = -0x5e)\\n continue;\\n } else if (opBit & opcodeHaltingMask == 0) {\\n // STOP or JUMP or RETURN or INVALID (Note: REVERT is blacklisted, so not included here)\\n // We are now inside unreachable code until we hit a JUMPDEST!\\n do {\\n _pc++;\\n assembly {\\n opNum := byte(0, mload(_pc))\\n }\\n // encountered a JUMPDEST\\n if (opNum == 0x5b) break;\\n // skip PUSHed bytes\\n if ((1 << opNum) & opcodePushMask == 0) _pc += (opNum - 0x5f); // opNum-0x5f = PUSHed bytes (PUSH1 is 0x60)\\n } while (_pc < codeLength);\\n // opNum is 0x5b, so we don't continue here since the pc++ is fine\\n } else if (opNum == 0x33) { // Caller opcode\\n uint256 firstOps; // next 32 bytes of bytecode\\n uint256 secondOps; // following 32 bytes of bytecode\\n\\n assembly {\\n firstOps := mload(_pc)\\n // 37 bytes total, 5 left over --> 32 - 5 bytes = 27 bytes = 216 bits\\n secondOps := shr(216, mload(add(_pc, 0x20)))\\n }\\n\\n // Call identity precompile\\n // CALLER POP PUSH1 0x00 PUSH1 0x04 GAS CALL\\n // 32 - 8 bytes = 24 bytes = 192\\n if ((firstOps >> 192) == 0x3350600060045af1) {\\n _pc += 8;\\n // Call EM and abort execution if instructed\\n // CALLER PUSH1 0x00 SWAP1 GAS CALL PC PUSH1 0x0E ADD JUMPI RETURNDATASIZE PUSH1 0x00 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x00 REVERT JUMPDEST RETURNDATASIZE PUSH1 0x01 EQ ISZERO PC PUSH1 0x0a ADD JUMPI PUSH1 0x01 PUSH1 0x00 RETURN JUMPDEST\\n } else if (firstOps == 0x336000905af158600e01573d6000803e3d6000fd5b3d6001141558600a015760 && secondOps == 0x016000f35b) {\\n _pc += 37;\\n } else {\\n return false;\\n }\\n continue;\\n } else {\\n // encountered a non-whitelisted opcode!\\n return false;\\n }\\n }\\n _pc++;\\n } while (_pc < codeLength);\\n return true;\\n }\\n}\\n\",\"keccak256\":\"0x44cd4fcdcb25a233fa98da5ba66706ce2f9fbf13359cf7f2891793739687a86f\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/iOVM/execution/iOVM_SafetyChecker.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/**\\n * @title iOVM_SafetyChecker\\n */\\ninterface iOVM_SafetyChecker {\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n function isBytecodeSafe(bytes calldata _bytecode) external pure returns (bool);\\n}\\n\",\"keccak256\":\"0xde6639676d4ec4f77297652d5ede2429bc93e74e11fefd9e9de4bc92dd784878\",\"license\":\"MIT\"}},\"version\":1}",
"bytecode": "0x608060405234801561001057600080fd5b50610373806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063a44eb59a14610030575b600080fd5b6100d66004803603602081101561004657600080fd5b81019060208101813564010000000081111561006157600080fd5b82018360208201111561007357600080fd5b8035906020019184600183028401116401000000008311171561009557600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506100ea945050505050565b604080519115158252519081900360200190f35b60408051610100810182527e0101010101010101010101000000000101010101010101010101010101000081526b010101010101000000010100600160f81b016020808301919091526f0101010100000001010101010000000092820192909252630203040560e01b60608201527f0101010101010101010101010101010101010101010101010101010101010101608082015264010101010160d81b60a0820152600060c0820181905260e0820181905283519092741fffffffff000000000f8f000063f000013fff0ffe916a40000000000000000000026117ff60f31b039163ffffffff60601b1991870181019087015b8051600081811a880151811a82811a890151821a0182811a890151821a0182811a890151821a0182811a890151821a0182811a89015190911a01918201911a6001811b86811661032057808516610239575001605d1901610326565b80861661027e575b8280600101935050825160001a915081605b141561025e57610279565b6001821b851661027157918101605e1901915b838310610241575b610320565b816033141561030f578251602084015160d81c673350600060045af160c083901c14156102b057600885019450610306565b817f336000905af158600e01573d6000803e3d6000fd5b3d6001141558600a0157601480156102e357508064016000f35b145b156102f357602585019450610306565b60009a5050505050505050505050610338565b50505050610326565b600098505050505050505050610338565b50506001015b8181106101dd57600196505050505050505b91905056fea26469706673582212209a836b268dcf58167a9f65bb872e3ddb5bd93b231f6b456f1c5e6d75b92a746364736f6c63430007060033",
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063a44eb59a14610030575b600080fd5b6100d66004803603602081101561004657600080fd5b81019060208101813564010000000081111561006157600080fd5b82018360208201111561007357600080fd5b8035906020019184600183028401116401000000008311171561009557600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506100ea945050505050565b604080519115158252519081900360200190f35b60408051610100810182527e0101010101010101010101000000000101010101010101010101010101000081526b010101010101000000010100600160f81b016020808301919091526f0101010100000001010101010000000092820192909252630203040560e01b60608201527f0101010101010101010101010101010101010101010101010101010101010101608082015264010101010160d81b60a0820152600060c0820181905260e0820181905283519092741fffffffff000000000f8f000063f000013fff0ffe916a40000000000000000000026117ff60f31b039163ffffffff60601b1991870181019087015b8051600081811a880151811a82811a890151821a0182811a890151821a0182811a890151821a0182811a890151821a0182811a89015190911a01918201911a6001811b86811661032057808516610239575001605d1901610326565b80861661027e575b8280600101935050825160001a915081605b141561025e57610279565b6001821b851661027157918101605e1901915b838310610241575b610320565b816033141561030f578251602084015160d81c673350600060045af160c083901c14156102b057600885019450610306565b817f336000905af158600e01573d6000803e3d6000fd5b3d6001141558600a0157601480156102e357508064016000f35b145b156102f357602585019450610306565b60009a5050505050505050505050610338565b50505050610326565b600098505050505050505050610338565b50506001015b8181106101dd57600196505050505050505b91905056fea26469706673582212209a836b268dcf58167a9f65bb872e3ddb5bd93b231f6b456f1c5e6d75b92a746364736f6c63430007060033",
"devdoc": {
"details": "The Safety Checker verifies that contracts deployed on L2 do not contain any \"unsafe\" operations. An operation is considered unsafe if it would access state variables which are specific to the environment (ie. L1 or L2) in which it is executed, as this could be used to \"escape the sandbox\" of the OVM, resulting in non-deterministic fraud proofs. That is, an attacker would be able to \"prove fraud\" on an honestly applied transaction. Note that a \"safe\" contract requires opcodes to appear in a particular pattern; omission of \"unsafe\" opcodes is necessary, but not sufficient. Compiler used: solc Runtime target: EVM",
"kind": "dev",
"methods": {
"isBytecodeSafe(bytes)": {
"params": {
"_bytecode": "The bytecode to safety check."
},
"returns": {
"_0": "`true` if the bytecode is safe, `false` otherwise."
}
}
},
"title": "OVM_SafetyChecker",
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {
"isBytecodeSafe(bytes)": {
"notice": "Returns whether or not all of the provided bytecode is safe."
}
},
"version": 1
},
"storageLayout": {
"storage": [],
"types": null
}
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"address": "0x8E63CD1CfDBe5d34a7a91B97E0A2AeA23D0e585D",
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "_owner",
"type": "address"
}
],
"name": "create",
"outputs": [
{
"internalType": "contract iOVM_StateManager",
"name": "",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
}
],
"transactionHash": "0xd689eba5b8fd84816f3fbe9c3be710705e27741e22403240dace3f0a68a50f55",
"receipt": {
"to": null,
"from": "0x4107438C1b1579f258AF9d1AC06194C4a0F55040",
"contractAddress": "0x8E63CD1CfDBe5d34a7a91B97E0A2AeA23D0e585D",
"transactionIndex": 2,
"gasUsed": "1170970",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blockHash": "0xb974189ddc2d16744bedca25c14ff6d9963b3ca5eb813d432444cc1211b17c57",
"transactionHash": "0xd689eba5b8fd84816f3fbe9c3be710705e27741e22403240dace3f0a68a50f55",
"logs": [],
"blockNumber": 4694117,
"cumulativeGasUsed": "1355204",
"status": 1,
"byzantium": true
},
"args": [],
"solcInputHash": "dde656dd41f49cad9eac9bc7065fd6a7",
"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 (_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 (\\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\":\"0xa5195afe32fb2cf104d156e8f4bd39df1ec79bf6ba232097b9e8e0ee14fbc298\",\"license\":\"MIT\"}},\"version\":1}",
"bytecode": "0x608060405234801561001057600080fd5b50611437806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80639ed9331814610030575b600080fd5b6100566004803603602081101561004657600080fd5b50356001600160a01b0316610072565b604080516001600160a01b039092168252519081900360200190f35b600081604051610081906100b5565b6001600160a01b03909116815260405190819003602001906000f0801580156100ae573d6000803e3d6000fd5b5092915050565b61133f806100c38339019056fe608060405234801561001057600080fd5b5060405161133f38038061133f83398101604081905261002f91610054565b600080546001600160a01b0319166001600160a01b0392909216919091179055610082565b600060208284031215610065578081fd5b81516001600160a01b038116811461007b578182fd5b9392505050565b6112ae806100916000396000f3fe608060405234801561001057600080fd5b50600436106101f05760003560e01c80638f3b96471161010f578063d126199f116100a2578063e90abb8611610071578063e90abb86146103f9578063fb37b31c1461040c578063fbcbc0f11461041f578063fcf149a21461043f576101f0565b8063d126199f146103b8578063d15d4150146103cb578063d54414c8146103de578063d7bd4a2a146103f1576101f0565b8063c3fd9b25116100de578063c3fd9b2514610377578063c7650bf21461037f578063c8e40fbf14610392578063d0a215f2146103a5576101f0565b80638f3b96471461033657806399056ba914610349578063af37b86414610351578063af3dc01114610364576101f0565b806333f94305116101875780636f3c75af116101565780636f3c75af146102f55780637c8ee703146103085780637e86faa81461031b5780638da5cb5b1461032e576101f0565b806333f94305146102b25780635c17d629146102ba5780636b18e4e8146102cd5780636c87ad20146102e0576101f0565b8063167020d2116101c3578063167020d2146102595780631aaf392f1461026c5780631b208a5a1461028c57806326dc5b121461029f576101f0565b806307a12945146101f55780630ad226791461021e57806311b1f790146102315780631381ba4d14610244575b600080fd5b61020861020336600461101d565b610452565b60405161021591906111c4565b60405180910390f35b61020861022c366004611072565b6104ba565b61020861023f36600461101d565b610517565b61025761025236600461101d565b610573565b005b61020861026736600461101d565b6105d4565b61027f61027a366004611072565b610679565b60405161021591906111cf565b61020861029a36600461101d565b610727565b61027f6102ad36600461101d565b61075e565b61025761077d565b6102576102c836600461109b565b6107c7565b6102576102db36600461101d565b61089a565b6102e8610944565b60405161021591906111b0565b610208610303366004611072565b610953565b6102e861031636600461101d565b61098c565b610208610329366004611072565b6109ad565b6102e86109c3565b6102576103443660046110cd565b6109d2565b61027f610a88565b61020861035f366004611072565b610a8e565b610208610372366004611072565b610ae2565b610257610b2f565b61020861038d366004611072565b610b79565b6102086103a036600461101d565b610c20565b6102576103b3366004611037565b610c40565b61027f6103c636600461101d565b610cb9565b6102086103d936600461101d565b610cd4565b6102086103ec36600461101d565b610d01565b61027f610d16565b610257610407366004611072565b610d1c565b61020861041a36600461101d565b610d77565b61043261042d36600461101d565b610dc3565b604051610215919061122e565b61025761044d36600461101d565b610e37565b6001600160a01b0381166000908152600260205260408120600301547fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4701480156104b257506001600160a01b038216600090815260026020526040902054155b90505b919050565b6001600160a01b038216600090815260046020908152604080832084845290915281205460ff168061050e57506001600160a01b038316600090815260026020526040902060040154600160a01b900460ff165b90505b92915050565b600080546001600160a01b031633148061053b57506001546001600160a01b031633145b6105605760405162461bcd60e51b8152600401610557906111d8565b60405180910390fd5b6104b261056c83610ef8565b6002610f28565b6000546001600160a01b031633148061059657506001546001600160a01b031633145b6105b25760405162461bcd60e51b8152600401610557906111d8565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600080546001600160a01b03163314806105f857506001546001600160a01b031633145b6106145760405162461bcd60e51b8152600401610557906111d8565b600061061f83610ef8565b9050600260008281526005602052604090205460ff16600381111561064057fe5b1461064f5760009150506104b5565b6000908152600560205260409020805460ff19166003179055505060068054600019019055600190565b6001600160a01b038216600090815260046020908152604080832084845290915281205460ff161580156106cf57506001600160a01b038316600090815260026020526040902060040154600160a01b900460ff165b156106dc57506000610511565b506001600160a01b0391909116600090815260036020908152604080832093835292905220547ffeedfacecafebeeffeedfacecafebeeffeedfacecafebeeffeedfacecafebeef1890565b60008061073383610ef8565b905060025b60008281526005602052604090205460ff16600381111561075557fe5b10159392505050565b6001600160a01b03166000908152600260208190526040909120015490565b6000546001600160a01b03163314806107a057506001546001600160a01b031633145b6107bc5760405162461bcd60e51b8152600401610557906111d8565b600680546001019055565b6000546001600160a01b03163314806107ea57506001546001600160a01b031633145b6108065760405162461bcd60e51b8152600401610557906111d8565b6001600160a01b038316600081815260036020908152604080832086845282528083207ffeedfacecafebeeffeedfacecafebeeffeedfacecafebeeffeedfacecafebeef86189055928252600481528282208583529052205460ff16610895576001600160a01b03831660009081526004602090815260408083208584529091529020805460ff191660011790555b505050565b6000546001600160a01b03163314806108bd57506001546001600160a01b031633145b6108d95760405162461bcd60e51b8152600401610557906111d8565b6001600160a01b031660009081526002602081905260409091207f56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421918101919091557fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470600390910155565b6001546001600160a01b031681565b6000806109608484610f8e565b905060025b60008281526005602052604090205460ff16600381111561098257fe5b1015949350505050565b6001600160a01b039081166000908152600260205260409020600401541690565b6000806109ba8484610f8e565b90506003610965565b6000546001600160a01b031681565b6000546001600160a01b03163314806109f557506001546001600160a01b031633145b610a115760405162461bcd60e51b8152600401610557906111d8565b6001600160a01b039182166000908152600260208181526040928390208451815590840151600182015591830151908201556060820151600382015560808201516004909101805460a0909301516001600160a01b0319909316919093161760ff60a01b1916600160a01b91151591909102179055565b60075490565b600080546001600160a01b0316331480610ab257506001546001600160a01b031633145b610ace5760405162461bcd60e51b8152600401610557906111d8565b61050e610adb8484610f8e565b6001610f28565b600080546001600160a01b0316331480610b0657506001546001600160a01b031633145b610b225760405162461bcd60e51b8152600401610557906111d8565b61050e61056c8484610f8e565b6000546001600160a01b0316331480610b5257506001546001600160a01b031633145b610b6e5760405162461bcd60e51b8152600401610557906111d8565b600780546001019055565b600080546001600160a01b0316331480610b9d57506001546001600160a01b031633145b610bb95760405162461bcd60e51b8152600401610557906111d8565b6000610bc58484610f8e565b9050600260008281526005602052604090205460ff166003811115610be657fe5b14610bf5576000915050610511565b6000908152600560205260409020805460ff1916600317905550506007805460001901905550600190565b6001600160a01b0316600090815260026020526040902060030154151590565b6000546001600160a01b0316331480610c6357506001546001600160a01b031633145b610c7f5760405162461bcd60e51b8152600401610557906111d8565b6001600160a01b0392831660009081526002602052604090206004810180546001600160a01b031916939094169290921790925560030155565b6001600160a01b031660009081526002602052604090205490565b600080546001600160a01b03838116911614806104b25750506001546001600160a01b0390811691161490565b600080610d0d83610ef8565b90506003610738565b60065490565b6000546001600160a01b0316331480610d3f57506001546001600160a01b031633145b610d5b5760405162461bcd60e51b8152600401610557906111d8565b6001600160a01b03909116600090815260026020526040902055565b600080546001600160a01b0316331480610d9b57506001546001600160a01b031633145b610db75760405162461bcd60e51b8152600401610557906111d8565b6104b2610adb83610ef8565b610dcb610fc1565b506001600160a01b03908116600090815260026020818152604092839020835160c08101855281548152600182015492810192909252918201549281019290925260038101546060830152600401549182166080820152600160a01b90910460ff16151560a082015290565b6000546001600160a01b0316331480610e5a57506001546001600160a01b031633145b610e765760405162461bcd60e51b8152600401610557906111d8565b6001600160a01b03166000908152600260208190526040909120600181557f56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421918101919091557fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4706003820155600401805460ff60a01b1916600160a01b179055565b600081604051602001610f0b9190611171565b604051602081830303815290604052805190602001209050919050565b600080826003811115610f3757fe5b60008581526005602052604090205460ff166003811115610f5457fe5b101590508061050e576000848152600560205260409020805484919060ff19166001836003811115610f8257fe5b02179055509392505050565b60008282604051602001610fa392919061118e565b60405160208183030381529060405280519060200120905092915050565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a081019190915290565b80356001600160a01b03811681146104b557600080fd5b803580151581146104b557600080fd5b60006020828403121561102e578081fd5b61050e82610ff6565b60008060006060848603121561104b578182fd5b61105484610ff6565b925061106260208501610ff6565b9150604084013590509250925092565b60008060408385031215611084578182fd5b61108d83610ff6565b946020939093013593505050565b6000806000606084860312156110af578283fd5b6110b884610ff6565b95602085013595506040909401359392505050565b60008082840360e08112156110e0578283fd5b6110e984610ff6565b925060c0601f19820112156110fc578182fd5b5060405160c0810181811067ffffffffffffffff8211171561111a57fe5b80604052506020840135815260408401356020820152606084013560408201526080840135606082015261115060a08501610ff6565b608082015261116160c0850161100d565b60a0820152809150509250929050565b60609190911b6bffffffffffffffffffffffff1916815260140190565b60609290921b6bffffffffffffffffffffffff19168252601482015260340190565b6001600160a01b0391909116815260200190565b901515815260200190565b90815260200190565b60208082526036908201527f46756e6374696f6e2063616e206f6e6c792062652063616c6c65642062792061604082015275757468656e746963617465642061646472657373657360501b606082015260800190565b815181526020808301519082015260408083015190820152606080830151908201526080808301516001600160a01b03169082015260a09182015115159181019190915260c0019056fea26469706673582212205bac84845119d44a384d804ab40cf5b8661877b394d879fd05cdd049485222d964736f6c63430007060033a264697066735822122049d6bdb64f1e5e1bffb7aba87ce3a0db62412188b801b3e899b8b558b75755a364736f6c63430007060033",
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c80639ed9331814610030575b600080fd5b6100566004803603602081101561004657600080fd5b50356001600160a01b0316610072565b604080516001600160a01b039092168252519081900360200190f35b600081604051610081906100b5565b6001600160a01b03909116815260405190819003602001906000f0801580156100ae573d6000803e3d6000fd5b5092915050565b61133f806100c38339019056fe608060405234801561001057600080fd5b5060405161133f38038061133f83398101604081905261002f91610054565b600080546001600160a01b0319166001600160a01b0392909216919091179055610082565b600060208284031215610065578081fd5b81516001600160a01b038116811461007b578182fd5b9392505050565b6112ae806100916000396000f3fe608060405234801561001057600080fd5b50600436106101f05760003560e01c80638f3b96471161010f578063d126199f116100a2578063e90abb8611610071578063e90abb86146103f9578063fb37b31c1461040c578063fbcbc0f11461041f578063fcf149a21461043f576101f0565b8063d126199f146103b8578063d15d4150146103cb578063d54414c8146103de578063d7bd4a2a146103f1576101f0565b8063c3fd9b25116100de578063c3fd9b2514610377578063c7650bf21461037f578063c8e40fbf14610392578063d0a215f2146103a5576101f0565b80638f3b96471461033657806399056ba914610349578063af37b86414610351578063af3dc01114610364576101f0565b806333f94305116101875780636f3c75af116101565780636f3c75af146102f55780637c8ee703146103085780637e86faa81461031b5780638da5cb5b1461032e576101f0565b806333f94305146102b25780635c17d629146102ba5780636b18e4e8146102cd5780636c87ad20146102e0576101f0565b8063167020d2116101c3578063167020d2146102595780631aaf392f1461026c5780631b208a5a1461028c57806326dc5b121461029f576101f0565b806307a12945146101f55780630ad226791461021e57806311b1f790146102315780631381ba4d14610244575b600080fd5b61020861020336600461101d565b610452565b60405161021591906111c4565b60405180910390f35b61020861022c366004611072565b6104ba565b61020861023f36600461101d565b610517565b61025761025236600461101d565b610573565b005b61020861026736600461101d565b6105d4565b61027f61027a366004611072565b610679565b60405161021591906111cf565b61020861029a36600461101d565b610727565b61027f6102ad36600461101d565b61075e565b61025761077d565b6102576102c836600461109b565b6107c7565b6102576102db36600461101d565b61089a565b6102e8610944565b60405161021591906111b0565b610208610303366004611072565b610953565b6102e861031636600461101d565b61098c565b610208610329366004611072565b6109ad565b6102e86109c3565b6102576103443660046110cd565b6109d2565b61027f610a88565b61020861035f366004611072565b610a8e565b610208610372366004611072565b610ae2565b610257610b2f565b61020861038d366004611072565b610b79565b6102086103a036600461101d565b610c20565b6102576103b3366004611037565b610c40565b61027f6103c636600461101d565b610cb9565b6102086103d936600461101d565b610cd4565b6102086103ec36600461101d565b610d01565b61027f610d16565b610257610407366004611072565b610d1c565b61020861041a36600461101d565b610d77565b61043261042d36600461101d565b610dc3565b604051610215919061122e565b61025761044d36600461101d565b610e37565b6001600160a01b0381166000908152600260205260408120600301547fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4701480156104b257506001600160a01b038216600090815260026020526040902054155b90505b919050565b6001600160a01b038216600090815260046020908152604080832084845290915281205460ff168061050e57506001600160a01b038316600090815260026020526040902060040154600160a01b900460ff165b90505b92915050565b600080546001600160a01b031633148061053b57506001546001600160a01b031633145b6105605760405162461bcd60e51b8152600401610557906111d8565b60405180910390fd5b6104b261056c83610ef8565b6002610f28565b6000546001600160a01b031633148061059657506001546001600160a01b031633145b6105b25760405162461bcd60e51b8152600401610557906111d8565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600080546001600160a01b03163314806105f857506001546001600160a01b031633145b6106145760405162461bcd60e51b8152600401610557906111d8565b600061061f83610ef8565b9050600260008281526005602052604090205460ff16600381111561064057fe5b1461064f5760009150506104b5565b6000908152600560205260409020805460ff19166003179055505060068054600019019055600190565b6001600160a01b038216600090815260046020908152604080832084845290915281205460ff161580156106cf57506001600160a01b038316600090815260026020526040902060040154600160a01b900460ff165b156106dc57506000610511565b506001600160a01b0391909116600090815260036020908152604080832093835292905220547ffeedfacecafebeeffeedfacecafebeeffeedfacecafebeeffeedfacecafebeef1890565b60008061073383610ef8565b905060025b60008281526005602052604090205460ff16600381111561075557fe5b10159392505050565b6001600160a01b03166000908152600260208190526040909120015490565b6000546001600160a01b03163314806107a057506001546001600160a01b031633145b6107bc5760405162461bcd60e51b8152600401610557906111d8565b600680546001019055565b6000546001600160a01b03163314806107ea57506001546001600160a01b031633145b6108065760405162461bcd60e51b8152600401610557906111d8565b6001600160a01b038316600081815260036020908152604080832086845282528083207ffeedfacecafebeeffeedfacecafebeeffeedfacecafebeeffeedfacecafebeef86189055928252600481528282208583529052205460ff16610895576001600160a01b03831660009081526004602090815260408083208584529091529020805460ff191660011790555b505050565b6000546001600160a01b03163314806108bd57506001546001600160a01b031633145b6108d95760405162461bcd60e51b8152600401610557906111d8565b6001600160a01b031660009081526002602081905260409091207f56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421918101919091557fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470600390910155565b6001546001600160a01b031681565b6000806109608484610f8e565b905060025b60008281526005602052604090205460ff16600381111561098257fe5b1015949350505050565b6001600160a01b039081166000908152600260205260409020600401541690565b6000806109ba8484610f8e565b90506003610965565b6000546001600160a01b031681565b6000546001600160a01b03163314806109f557506001546001600160a01b031633145b610a115760405162461bcd60e51b8152600401610557906111d8565b6001600160a01b039182166000908152600260208181526040928390208451815590840151600182015591830151908201556060820151600382015560808201516004909101805460a0909301516001600160a01b0319909316919093161760ff60a01b1916600160a01b91151591909102179055565b60075490565b600080546001600160a01b0316331480610ab257506001546001600160a01b031633145b610ace5760405162461bcd60e51b8152600401610557906111d8565b61050e610adb8484610f8e565b6001610f28565b600080546001600160a01b0316331480610b0657506001546001600160a01b031633145b610b225760405162461bcd60e51b8152600401610557906111d8565b61050e61056c8484610f8e565b6000546001600160a01b0316331480610b5257506001546001600160a01b031633145b610b6e5760405162461bcd60e51b8152600401610557906111d8565b600780546001019055565b600080546001600160a01b0316331480610b9d57506001546001600160a01b031633145b610bb95760405162461bcd60e51b8152600401610557906111d8565b6000610bc58484610f8e565b9050600260008281526005602052604090205460ff166003811115610be657fe5b14610bf5576000915050610511565b6000908152600560205260409020805460ff1916600317905550506007805460001901905550600190565b6001600160a01b0316600090815260026020526040902060030154151590565b6000546001600160a01b0316331480610c6357506001546001600160a01b031633145b610c7f5760405162461bcd60e51b8152600401610557906111d8565b6001600160a01b0392831660009081526002602052604090206004810180546001600160a01b031916939094169290921790925560030155565b6001600160a01b031660009081526002602052604090205490565b600080546001600160a01b03838116911614806104b25750506001546001600160a01b0390811691161490565b600080610d0d83610ef8565b90506003610738565b60065490565b6000546001600160a01b0316331480610d3f57506001546001600160a01b031633145b610d5b5760405162461bcd60e51b8152600401610557906111d8565b6001600160a01b03909116600090815260026020526040902055565b600080546001600160a01b0316331480610d9b57506001546001600160a01b031633145b610db75760405162461bcd60e51b8152600401610557906111d8565b6104b2610adb83610ef8565b610dcb610fc1565b506001600160a01b03908116600090815260026020818152604092839020835160c08101855281548152600182015492810192909252918201549281019290925260038101546060830152600401549182166080820152600160a01b90910460ff16151560a082015290565b6000546001600160a01b0316331480610e5a57506001546001600160a01b031633145b610e765760405162461bcd60e51b8152600401610557906111d8565b6001600160a01b03166000908152600260208190526040909120600181557f56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421918101919091557fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4706003820155600401805460ff60a01b1916600160a01b179055565b600081604051602001610f0b9190611171565b604051602081830303815290604052805190602001209050919050565b600080826003811115610f3757fe5b60008581526005602052604090205460ff166003811115610f5457fe5b101590508061050e576000848152600560205260409020805484919060ff19166001836003811115610f8257fe5b02179055509392505050565b60008282604051602001610fa392919061118e565b60405160208183030381529060405280519060200120905092915050565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a081019190915290565b80356001600160a01b03811681146104b557600080fd5b803580151581146104b557600080fd5b60006020828403121561102e578081fd5b61050e82610ff6565b60008060006060848603121561104b578182fd5b61105484610ff6565b925061106260208501610ff6565b9150604084013590509250925092565b60008060408385031215611084578182fd5b61108d83610ff6565b946020939093013593505050565b6000806000606084860312156110af578283fd5b6110b884610ff6565b95602085013595506040909401359392505050565b60008082840360e08112156110e0578283fd5b6110e984610ff6565b925060c0601f19820112156110fc578182fd5b5060405160c0810181811067ffffffffffffffff8211171561111a57fe5b80604052506020840135815260408401356020820152606084013560408201526080840135606082015261115060a08501610ff6565b608082015261116160c0850161100d565b60a0820152809150509250929050565b60609190911b6bffffffffffffffffffffffff1916815260140190565b60609290921b6bffffffffffffffffffffffff19168252601482015260340190565b6001600160a01b0391909116815260200190565b901515815260200190565b90815260200190565b60208082526036908201527f46756e6374696f6e2063616e206f6e6c792062652063616c6c65642062792061604082015275757468656e746963617465642061646472657373657360501b606082015260800190565b815181526020808301519082015260408083015190820152606080830151908201526080808301516001600160a01b03169082015260a09182015115159181019190915260c0019056fea26469706673582212205bac84845119d44a384d804ab40cf5b8661877b394d879fd05cdd049485222d964736f6c63430007060033a264697066735822122049d6bdb64f1e5e1bffb7aba87ce3a0db62412188b801b3e899b8b558b75755a364736f6c63430007060033",
"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
}
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"address": "0xFec83764acDeEc2ac338d4cc1f12bBE3cCDf551E",
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "_libAddressManager",
"type": "address"
},
{
"internalType": "string",
"name": "_implementationName",
"type": "string"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"stateMutability": "payable",
"type": "fallback"
}
],
"transactionHash": "0xc796492651cfcf9c1e77eabc558db2473ee567fe03e3dbb6c8c7bccdd0a6cea9",
"receipt": {
"to": null,
"from": "0x4107438C1b1579f258AF9d1AC06194C4a0F55040",
"contractAddress": "0xFec83764acDeEc2ac338d4cc1f12bBE3cCDf551E",
"transactionIndex": 6,
"gasUsed": "225024",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blockHash": "0xb3e0b0bffed18d30c6a9891532f9ac5f2c4b018603682fc6547b0a166c00e935",
"transactionHash": "0xc796492651cfcf9c1e77eabc558db2473ee567fe03e3dbb6c8c7bccdd0a6cea9",
"logs": [],
"blockNumber": 4694109,
"cumulativeGasUsed": "4216864",
"status": 1,
"byzantium": true
},
"args": [
"0xE3d08F0D900A2D53cB794cf82d7127764BcC3092",
"OVM_L1CrossDomainMessenger"
],
"solcInputHash": "dde656dd41f49cad9eac9bc7065fd6a7",
"metadata": "{\"compiler\":{\"version\":\"0.7.6+commit.7338295f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_libAddressManager\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_implementationName\",\"type\":\"string\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"constructor\":{\"params\":{\"_implementationName\":\"implementationName of the contract to proxy to.\",\"_libAddressManager\":\"Address of the Lib_AddressManager.\"}}},\"title\":\"Lib_ResolvedDelegateProxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/optimistic-ethereum/libraries/resolver/Lib_ResolvedDelegateProxy.sol\":\"Lib_ResolvedDelegateProxy\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor () internal {\\n address msgSender = _msgSender();\\n _owner = msgSender;\\n emit OwnershipTransferred(address(0), msgSender);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x15e2d5bd4c28a88548074c54d220e8086f638a71ed07e6b3ba5a70066fcf458d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with GSN meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address payable) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes memory) {\\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x8d3cb350f04ff49cfb10aef08d87f19dcbaecc8027b0bed12f3275cd12f38cf0\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* External Imports */\\nimport { Ownable } from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\n/**\\n * @title Lib_AddressManager\\n */\\ncontract Lib_AddressManager is Ownable {\\n\\n /**********\\n * Events *\\n **********/\\n\\n event AddressSet(\\n string _name,\\n address _newAddress\\n );\\n\\n\\n /*************\\n * Variables *\\n *************/\\n\\n mapping (bytes32 => address) private addresses;\\n\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Changes the address associated with a particular name.\\n * @param _name String name to associate an address with.\\n * @param _address Address to associate with the name.\\n */\\n function setAddress(\\n string memory _name,\\n address _address\\n )\\n public\\n onlyOwner\\n {\\n addresses[_getNameHash(_name)] = _address;\\n\\n emit AddressSet(\\n _name,\\n _address\\n );\\n }\\n\\n /**\\n * Retrieves the address associated with a given name.\\n * @param _name Name to retrieve an address for.\\n * @return Address associated with the given name.\\n */\\n function getAddress(\\n string memory _name\\n )\\n public\\n view\\n returns (\\n address\\n )\\n {\\n return addresses[_getNameHash(_name)];\\n }\\n\\n\\n /**********************\\n * Internal Functions *\\n **********************/\\n\\n /**\\n * Computes the hash of a name.\\n * @param _name Name to compute a hash for.\\n * @return Hash of the given name.\\n */\\n function _getNameHash(\\n string memory _name\\n )\\n internal\\n pure\\n returns (\\n bytes32\\n )\\n {\\n return keccak256(abi.encodePacked(_name));\\n }\\n}\\n\",\"keccak256\":\"0x2ce671a0e004df88b136bea5a3c59d0732cea8887c8496da1d509e0200b03d7d\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/resolver/Lib_ResolvedDelegateProxy.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_ResolvedDelegateProxy\\n */\\ncontract Lib_ResolvedDelegateProxy {\\n\\n /*************\\n * Variables *\\n *************/\\n\\n // Using mappings to store fields to avoid overwriting storage slots in the\\n // implementation contract. For example, instead of storing these fields at\\n // storage slot `0` & `1`, they are stored at `keccak256(key + slot)`.\\n // See: https://solidity.readthedocs.io/en/v0.7.0/internals/layout_in_storage.html\\n // NOTE: Do not use this code in your own contract system.\\n // There is a known flaw in this contract, and we will remove it from the repository\\n // in the near future. Due to the very limited way that we are using it, this flaw is\\n // not an issue in our system.\\n mapping (address => string) private implementationName;\\n mapping (address => Lib_AddressManager) private addressManager;\\n\\n\\n /***************\\n * Constructor *\\n ***************/\\n\\n /**\\n * @param _libAddressManager Address of the Lib_AddressManager.\\n * @param _implementationName implementationName of the contract to proxy to.\\n */\\n constructor(\\n address _libAddressManager,\\n string memory _implementationName\\n ) {\\n addressManager[address(this)] = Lib_AddressManager(_libAddressManager);\\n implementationName[address(this)] = _implementationName;\\n }\\n\\n\\n /*********************\\n * Fallback Function *\\n *********************/\\n\\n fallback()\\n external\\n payable\\n {\\n address target = addressManager[address(this)].getAddress(\\n (implementationName[address(this)])\\n );\\n\\n require(\\n target != address(0),\\n \\\"Target address must be initialized.\\\"\\n );\\n\\n (bool success, bytes memory returndata) = target.delegatecall(msg.data);\\n\\n if (success == true) {\\n assembly {\\n return(add(returndata, 0x20), mload(returndata))\\n }\\n } else {\\n assembly {\\n revert(add(returndata, 0x20), mload(returndata))\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfaecb051b37f1d87d588cafb17a575723cbdf7c3c2079772110f33e747e05027\",\"license\":\"MIT\"}},\"version\":1}",
"bytecode": "0x608060405234801561001057600080fd5b506040516104083803806104088339818101604052604081101561003357600080fd5b81516020830180516040519294929383019291908464010000000082111561005a57600080fd5b90830190602082018581111561006f57600080fd5b825164010000000081118282018810171561008957600080fd5b82525081516020918201929091019080838360005b838110156100b657818101518382015260200161009e565b50505050905090810190601f1680156100e35780820380516001836020036101000a031916815260200191505b5060409081523060009081526001602090815282822080546001600160a01b0319166001600160a01b038a16179055818152919020855161012c95509093509085019150610134565b5050506101d5565b828054600181600116156101000203166002900490600052602060002090601f01602090048101928261016a57600085556101b0565b82601f1061018357805160ff19168380011785556101b0565b828001600101855582156101b0579182015b828111156101b0578251825591602001919060010190610195565b506101bc9291506101c0565b5090565b5b808211156101bc57600081556001016101c1565b610224806101e46000396000f3fe60806040818152306000908152600160208181528383205483825293832063bf40fac160e01b909552608490815284546002610100938216159390930260001901169190910460a481905291936001600160a01b039093169263bf40fac192909190819060c490849080156100b55780601f1061008a576101008083540402835291602001916100b5565b820191906000526020600020905b81548152906001019060200180831161009857829003601f168201915b50509250505060206040518083038186803b1580156100d357600080fd5b505afa1580156100e7573d6000803e3d6000fd5b505050506040513d60208110156100fd57600080fd5b505190506001600160a01b0381166101465760405162461bcd60e51b81526004018080602001828103825260238152602001806101cc6023913960400191505060405180910390fd5b600080826001600160a01b03166000366040518083838082843760405192019450600093509091505080830381855af49150503d80600081146101a5576040519150601f19603f3d011682016040523d82523d6000602084013e6101aa565b606091505b509092509050600182151514156101c357805160208201f35b805160208201fdfe5461726765742061646472657373206d75737420626520696e697469616c697a65642ea264697066735822122026d4992ed7562b49b7d3e306977cab94c29f8fb64a137b48d18960cc5ef1341d64736f6c63430007060033",
"deployedBytecode": "0x60806040818152306000908152600160208181528383205483825293832063bf40fac160e01b909552608490815284546002610100938216159390930260001901169190910460a481905291936001600160a01b039093169263bf40fac192909190819060c490849080156100b55780601f1061008a576101008083540402835291602001916100b5565b820191906000526020600020905b81548152906001019060200180831161009857829003601f168201915b50509250505060206040518083038186803b1580156100d357600080fd5b505afa1580156100e7573d6000803e3d6000fd5b505050506040513d60208110156100fd57600080fd5b505190506001600160a01b0381166101465760405162461bcd60e51b81526004018080602001828103825260238152602001806101cc6023913960400191505060405180910390fd5b600080826001600160a01b03166000366040518083838082843760405192019450600093509091505080830381855af49150503d80600081146101a5576040519150601f19603f3d011682016040523d82523d6000602084013e6101aa565b606091505b509092509050600182151514156101c357805160208201f35b805160208201fdfe5461726765742061646472657373206d75737420626520696e697469616c697a65642ea264697066735822122026d4992ed7562b49b7d3e306977cab94c29f8fb64a137b48d18960cc5ef1341d64736f6c63430007060033",
"devdoc": {
"kind": "dev",
"methods": {
"constructor": {
"params": {
"_implementationName": "implementationName of the contract to proxy to.",
"_libAddressManager": "Address of the Lib_AddressManager."
}
}
},
"title": "Lib_ResolvedDelegateProxy",
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
},
"storageLayout": {
"storage": [
{
"astId": 12092,
"contract": "contracts/optimistic-ethereum/libraries/resolver/Lib_ResolvedDelegateProxy.sol:Lib_ResolvedDelegateProxy",
"label": "implementationName",
"offset": 0,
"slot": "0",
"type": "t_mapping(t_address,t_string_storage)"
},
{
"astId": 12096,
"contract": "contracts/optimistic-ethereum/libraries/resolver/Lib_ResolvedDelegateProxy.sol:Lib_ResolvedDelegateProxy",
"label": "addressManager",
"offset": 0,
"slot": "1",
"type": "t_mapping(t_address,t_contract(Lib_AddressManager)12048)"
}
],
"types": {
"t_address": {
"encoding": "inplace",
"label": "address",
"numberOfBytes": "20"
},
"t_contract(Lib_AddressManager)12048": {
"encoding": "inplace",
"label": "contract Lib_AddressManager",
"numberOfBytes": "20"
},
"t_mapping(t_address,t_contract(Lib_AddressManager)12048)": {
"encoding": "mapping",
"key": "t_address",
"label": "mapping(address => contract Lib_AddressManager)",
"numberOfBytes": "32",
"value": "t_contract(Lib_AddressManager)12048"
},
"t_mapping(t_address,t_string_storage)": {
"encoding": "mapping",
"key": "t_address",
"label": "mapping(address => string)",
"numberOfBytes": "32",
"value": "t_string_storage"
},
"t_string_storage": {
"encoding": "bytes",
"label": "string",
"numberOfBytes": "32"
}
}
}
}
\ No newline at end of file
{
"address": "0xA721CF3e39E5cB4CfEEc0e32EE05B3D05AA9aE39",
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "_libAddressManager",
"type": "address"
},
{
"internalType": "string",
"name": "_implementationName",
"type": "string"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"stateMutability": "payable",
"type": "fallback"
}
],
"transactionHash": "0x3d4a30fba0bff5ac4443bc0060601b94df8c87840eb11dc8e586adc03e4e804e",
"receipt": {
"to": null,
"from": "0x4107438C1b1579f258AF9d1AC06194C4a0F55040",
"contractAddress": "0xA721CF3e39E5cB4CfEEc0e32EE05B3D05AA9aE39",
"transactionIndex": 1,
"gasUsed": "224904",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blockHash": "0xcffaf68b69cbb4498ca1c7d9727b3f74c6221de283657cc7ca5e7abb62b7fedc",
"transactionHash": "0x3d4a30fba0bff5ac4443bc0060601b94df8c87840eb11dc8e586adc03e4e804e",
"logs": [],
"blockNumber": 4694131,
"cumulativeGasUsed": "323310",
"status": 1,
"byzantium": true
},
"args": [
"0xE3d08F0D900A2D53cB794cf82d7127764BcC3092",
"OVM_L1ETHGateway"
],
"solcInputHash": "dde656dd41f49cad9eac9bc7065fd6a7",
"metadata": "{\"compiler\":{\"version\":\"0.7.6+commit.7338295f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_libAddressManager\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_implementationName\",\"type\":\"string\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"constructor\":{\"params\":{\"_implementationName\":\"implementationName of the contract to proxy to.\",\"_libAddressManager\":\"Address of the Lib_AddressManager.\"}}},\"title\":\"Lib_ResolvedDelegateProxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/optimistic-ethereum/libraries/resolver/Lib_ResolvedDelegateProxy.sol\":\"Lib_ResolvedDelegateProxy\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor () internal {\\n address msgSender = _msgSender();\\n _owner = msgSender;\\n emit OwnershipTransferred(address(0), msgSender);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x15e2d5bd4c28a88548074c54d220e8086f638a71ed07e6b3ba5a70066fcf458d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with GSN meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address payable) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes memory) {\\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x8d3cb350f04ff49cfb10aef08d87f19dcbaecc8027b0bed12f3275cd12f38cf0\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* External Imports */\\nimport { Ownable } from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\n/**\\n * @title Lib_AddressManager\\n */\\ncontract Lib_AddressManager is Ownable {\\n\\n /**********\\n * Events *\\n **********/\\n\\n event AddressSet(\\n string _name,\\n address _newAddress\\n );\\n\\n\\n /*************\\n * Variables *\\n *************/\\n\\n mapping (bytes32 => address) private addresses;\\n\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Changes the address associated with a particular name.\\n * @param _name String name to associate an address with.\\n * @param _address Address to associate with the name.\\n */\\n function setAddress(\\n string memory _name,\\n address _address\\n )\\n public\\n onlyOwner\\n {\\n addresses[_getNameHash(_name)] = _address;\\n\\n emit AddressSet(\\n _name,\\n _address\\n );\\n }\\n\\n /**\\n * Retrieves the address associated with a given name.\\n * @param _name Name to retrieve an address for.\\n * @return Address associated with the given name.\\n */\\n function getAddress(\\n string memory _name\\n )\\n public\\n view\\n returns (\\n address\\n )\\n {\\n return addresses[_getNameHash(_name)];\\n }\\n\\n\\n /**********************\\n * Internal Functions *\\n **********************/\\n\\n /**\\n * Computes the hash of a name.\\n * @param _name Name to compute a hash for.\\n * @return Hash of the given name.\\n */\\n function _getNameHash(\\n string memory _name\\n )\\n internal\\n pure\\n returns (\\n bytes32\\n )\\n {\\n return keccak256(abi.encodePacked(_name));\\n }\\n}\\n\",\"keccak256\":\"0x2ce671a0e004df88b136bea5a3c59d0732cea8887c8496da1d509e0200b03d7d\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/resolver/Lib_ResolvedDelegateProxy.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_ResolvedDelegateProxy\\n */\\ncontract Lib_ResolvedDelegateProxy {\\n\\n /*************\\n * Variables *\\n *************/\\n\\n // Using mappings to store fields to avoid overwriting storage slots in the\\n // implementation contract. For example, instead of storing these fields at\\n // storage slot `0` & `1`, they are stored at `keccak256(key + slot)`.\\n // See: https://solidity.readthedocs.io/en/v0.7.0/internals/layout_in_storage.html\\n // NOTE: Do not use this code in your own contract system.\\n // There is a known flaw in this contract, and we will remove it from the repository\\n // in the near future. Due to the very limited way that we are using it, this flaw is\\n // not an issue in our system.\\n mapping (address => string) private implementationName;\\n mapping (address => Lib_AddressManager) private addressManager;\\n\\n\\n /***************\\n * Constructor *\\n ***************/\\n\\n /**\\n * @param _libAddressManager Address of the Lib_AddressManager.\\n * @param _implementationName implementationName of the contract to proxy to.\\n */\\n constructor(\\n address _libAddressManager,\\n string memory _implementationName\\n ) {\\n addressManager[address(this)] = Lib_AddressManager(_libAddressManager);\\n implementationName[address(this)] = _implementationName;\\n }\\n\\n\\n /*********************\\n * Fallback Function *\\n *********************/\\n\\n fallback()\\n external\\n payable\\n {\\n address target = addressManager[address(this)].getAddress(\\n (implementationName[address(this)])\\n );\\n\\n require(\\n target != address(0),\\n \\\"Target address must be initialized.\\\"\\n );\\n\\n (bool success, bytes memory returndata) = target.delegatecall(msg.data);\\n\\n if (success == true) {\\n assembly {\\n return(add(returndata, 0x20), mload(returndata))\\n }\\n } else {\\n assembly {\\n revert(add(returndata, 0x20), mload(returndata))\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfaecb051b37f1d87d588cafb17a575723cbdf7c3c2079772110f33e747e05027\",\"license\":\"MIT\"}},\"version\":1}",
"bytecode": "0x608060405234801561001057600080fd5b506040516104083803806104088339818101604052604081101561003357600080fd5b81516020830180516040519294929383019291908464010000000082111561005a57600080fd5b90830190602082018581111561006f57600080fd5b825164010000000081118282018810171561008957600080fd5b82525081516020918201929091019080838360005b838110156100b657818101518382015260200161009e565b50505050905090810190601f1680156100e35780820380516001836020036101000a031916815260200191505b5060409081523060009081526001602090815282822080546001600160a01b0319166001600160a01b038a16179055818152919020855161012c95509093509085019150610134565b5050506101d5565b828054600181600116156101000203166002900490600052602060002090601f01602090048101928261016a57600085556101b0565b82601f1061018357805160ff19168380011785556101b0565b828001600101855582156101b0579182015b828111156101b0578251825591602001919060010190610195565b506101bc9291506101c0565b5090565b5b808211156101bc57600081556001016101c1565b610224806101e46000396000f3fe60806040818152306000908152600160208181528383205483825293832063bf40fac160e01b909552608490815284546002610100938216159390930260001901169190910460a481905291936001600160a01b039093169263bf40fac192909190819060c490849080156100b55780601f1061008a576101008083540402835291602001916100b5565b820191906000526020600020905b81548152906001019060200180831161009857829003601f168201915b50509250505060206040518083038186803b1580156100d357600080fd5b505afa1580156100e7573d6000803e3d6000fd5b505050506040513d60208110156100fd57600080fd5b505190506001600160a01b0381166101465760405162461bcd60e51b81526004018080602001828103825260238152602001806101cc6023913960400191505060405180910390fd5b600080826001600160a01b03166000366040518083838082843760405192019450600093509091505080830381855af49150503d80600081146101a5576040519150601f19603f3d011682016040523d82523d6000602084013e6101aa565b606091505b509092509050600182151514156101c357805160208201f35b805160208201fdfe5461726765742061646472657373206d75737420626520696e697469616c697a65642ea264697066735822122026d4992ed7562b49b7d3e306977cab94c29f8fb64a137b48d18960cc5ef1341d64736f6c63430007060033",
"deployedBytecode": "0x60806040818152306000908152600160208181528383205483825293832063bf40fac160e01b909552608490815284546002610100938216159390930260001901169190910460a481905291936001600160a01b039093169263bf40fac192909190819060c490849080156100b55780601f1061008a576101008083540402835291602001916100b5565b820191906000526020600020905b81548152906001019060200180831161009857829003601f168201915b50509250505060206040518083038186803b1580156100d357600080fd5b505afa1580156100e7573d6000803e3d6000fd5b505050506040513d60208110156100fd57600080fd5b505190506001600160a01b0381166101465760405162461bcd60e51b81526004018080602001828103825260238152602001806101cc6023913960400191505060405180910390fd5b600080826001600160a01b03166000366040518083838082843760405192019450600093509091505080830381855af49150503d80600081146101a5576040519150601f19603f3d011682016040523d82523d6000602084013e6101aa565b606091505b509092509050600182151514156101c357805160208201f35b805160208201fdfe5461726765742061646472657373206d75737420626520696e697469616c697a65642ea264697066735822122026d4992ed7562b49b7d3e306977cab94c29f8fb64a137b48d18960cc5ef1341d64736f6c63430007060033",
"devdoc": {
"kind": "dev",
"methods": {
"constructor": {
"params": {
"_implementationName": "implementationName of the contract to proxy to.",
"_libAddressManager": "Address of the Lib_AddressManager."
}
}
},
"title": "Lib_ResolvedDelegateProxy",
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
},
"storageLayout": {
"storage": [
{
"astId": 12092,
"contract": "contracts/optimistic-ethereum/libraries/resolver/Lib_ResolvedDelegateProxy.sol:Lib_ResolvedDelegateProxy",
"label": "implementationName",
"offset": 0,
"slot": "0",
"type": "t_mapping(t_address,t_string_storage)"
},
{
"astId": 12096,
"contract": "contracts/optimistic-ethereum/libraries/resolver/Lib_ResolvedDelegateProxy.sol:Lib_ResolvedDelegateProxy",
"label": "addressManager",
"offset": 0,
"slot": "1",
"type": "t_mapping(t_address,t_contract(Lib_AddressManager)12048)"
}
],
"types": {
"t_address": {
"encoding": "inplace",
"label": "address",
"numberOfBytes": "20"
},
"t_contract(Lib_AddressManager)12048": {
"encoding": "inplace",
"label": "contract Lib_AddressManager",
"numberOfBytes": "20"
},
"t_mapping(t_address,t_contract(Lib_AddressManager)12048)": {
"encoding": "mapping",
"key": "t_address",
"label": "mapping(address => contract Lib_AddressManager)",
"numberOfBytes": "32",
"value": "t_contract(Lib_AddressManager)12048"
},
"t_mapping(t_address,t_string_storage)": {
"encoding": "mapping",
"key": "t_address",
"label": "mapping(address => string)",
"numberOfBytes": "32",
"value": "t_string_storage"
},
"t_string_storage": {
"encoding": "bytes",
"label": "string",
"numberOfBytes": "32"
}
}
}
}
\ No newline at end of file
{
"address": "0x35a7735F9f517d071d5cFf89D11Ab4488bc5Df8C",
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "_libAddressManager",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [
{
"internalType": "address",
"name": "_who",
"type": "address"
}
],
"name": "claim",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "deposit",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "_preStateRoot",
"type": "bytes32"
},
{
"internalType": "address",
"name": "_publisher",
"type": "address"
},
{
"internalType": "uint256",
"name": "_timestamp",
"type": "uint256"
}
],
"name": "finalize",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "finalizeWithdrawal",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
},
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "getGasSpent",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_who",
"type": "address"
}
],
"name": "isCollateralized",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "libAddressManager",
"outputs": [
{
"internalType": "contract Lib_AddressManager",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "_preStateRoot",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "_txHash",
"type": "bytes32"
},
{
"internalType": "address",
"name": "_who",
"type": "address"
},
{
"internalType": "uint256",
"name": "_gasSpent",
"type": "uint256"
}
],
"name": "recordGasSpent",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "_name",
"type": "string"
}
],
"name": "resolve",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "startWithdrawal",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"transactionHash": "0xd3ec4ca65af45c592fff0d78013702b253b1b3c8e1d1c76ccf17180dfa1f32ab",
"receipt": {
"to": null,
"from": "0x4107438C1b1579f258AF9d1AC06194C4a0F55040",
"contractAddress": "0x35a7735F9f517d071d5cFf89D11Ab4488bc5Df8C",
"transactionIndex": 3,
"gasUsed": "298498",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blockHash": "0x07330e15f5aa83781291ad50e573aa2edc5cb158477fcb8df5e1d0ddbd38415d",
"transactionHash": "0xd3ec4ca65af45c592fff0d78013702b253b1b3c8e1d1c76ccf17180dfa1f32ab",
"logs": [],
"blockNumber": 4694104,
"cumulativeGasUsed": "1677808",
"status": 1,
"byzantium": true
},
"args": [
"0xE3d08F0D900A2D53cB794cf82d7127764BcC3092"
],
"solcInputHash": "dde656dd41f49cad9eac9bc7065fd6a7",
"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\":\"_who\",\"type\":\"address\"}],\"name\":\"claim\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_preStateRoot\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"_publisher\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"finalize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeWithdrawal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"getGasSpent\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_who\",\"type\":\"address\"}],\"name\":\"isCollateralized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"libAddressManager\",\"outputs\":[{\"internalType\":\"contract Lib_AddressManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_preStateRoot\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"_txHash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"_who\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_gasSpent\",\"type\":\"uint256\"}],\"name\":\"recordGasSpent\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"startWithdrawal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"resolve(string)\":{\"params\":{\"_name\":\"Name to resolve an address for.\"},\"returns\":{\"_0\":\"Address associated with the given name.\"}}},\"title\":\"mockOVM_BondManager\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"resolve(string)\":{\"notice\":\"Resolves the address associated with a given name.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/optimistic-ethereum/mockOVM/verification/mockOVM_BondManager.sol\":\"mockOVM_BondManager\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor () internal {\\n address msgSender = _msgSender();\\n _owner = msgSender;\\n emit OwnershipTransferred(address(0), msgSender);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x15e2d5bd4c28a88548074c54d220e8086f638a71ed07e6b3ba5a70066fcf458d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with GSN meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address payable) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes memory) {\\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x8d3cb350f04ff49cfb10aef08d87f19dcbaecc8027b0bed12f3275cd12f38cf0\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/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/libraries/resolver/Lib_AddressManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* External Imports */\\nimport { Ownable } from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\n/**\\n * @title Lib_AddressManager\\n */\\ncontract Lib_AddressManager is Ownable {\\n\\n /**********\\n * Events *\\n **********/\\n\\n event AddressSet(\\n string _name,\\n address _newAddress\\n );\\n\\n\\n /*************\\n * Variables *\\n *************/\\n\\n mapping (bytes32 => address) private addresses;\\n\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Changes the address associated with a particular name.\\n * @param _name String name to associate an address with.\\n * @param _address Address to associate with the name.\\n */\\n function setAddress(\\n string memory _name,\\n address _address\\n )\\n public\\n onlyOwner\\n {\\n addresses[_getNameHash(_name)] = _address;\\n\\n emit AddressSet(\\n _name,\\n _address\\n );\\n }\\n\\n /**\\n * Retrieves the address associated with a given name.\\n * @param _name Name to retrieve an address for.\\n * @return Address associated with the given name.\\n */\\n function getAddress(\\n string memory _name\\n )\\n public\\n view\\n returns (\\n address\\n )\\n {\\n return addresses[_getNameHash(_name)];\\n }\\n\\n\\n /**********************\\n * Internal Functions *\\n **********************/\\n\\n /**\\n * Computes the hash of a name.\\n * @param _name Name to compute a hash for.\\n * @return Hash of the given name.\\n */\\n function _getNameHash(\\n string memory _name\\n )\\n internal\\n pure\\n returns (\\n bytes32\\n )\\n {\\n return keccak256(abi.encodePacked(_name));\\n }\\n}\\n\",\"keccak256\":\"0x2ce671a0e004df88b136bea5a3c59d0732cea8887c8496da1d509e0200b03d7d\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/resolver/Lib_AddressResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* Library Imports */\\nimport { Lib_AddressManager } from \\\"./Lib_AddressManager.sol\\\";\\n\\n/**\\n * @title Lib_AddressResolver\\n */\\nabstract contract Lib_AddressResolver {\\n\\n /*************\\n * Variables *\\n *************/\\n\\n Lib_AddressManager public libAddressManager;\\n\\n\\n /***************\\n * Constructor *\\n ***************/\\n\\n /**\\n * @param _libAddressManager Address of the Lib_AddressManager.\\n */\\n constructor(\\n address _libAddressManager\\n ) {\\n libAddressManager = Lib_AddressManager(_libAddressManager);\\n }\\n\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Resolves the address associated with a given name.\\n * @param _name Name to resolve an address for.\\n * @return Address associated with the given name.\\n */\\n function resolve(\\n string memory _name\\n )\\n public\\n view\\n returns (\\n address\\n )\\n {\\n return libAddressManager.getAddress(_name);\\n }\\n}\\n\",\"keccak256\":\"0x65981feeabff6a81783ea97d44baf988a18a86c8cb374c46fdb71819cbacc7c0\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/mockOVM/verification/mockOVM_BondManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* Interface Imports */\\nimport { iOVM_BondManager } from \\\"../../iOVM/verification/iOVM_BondManager.sol\\\";\\n\\n/* Contract Imports */\\nimport { Lib_AddressResolver } from \\\"../../libraries/resolver/Lib_AddressResolver.sol\\\";\\n\\n/**\\n * @title mockOVM_BondManager\\n */\\ncontract mockOVM_BondManager is iOVM_BondManager, Lib_AddressResolver {\\n constructor(\\n address _libAddressManager\\n )\\n Lib_AddressResolver(_libAddressManager)\\n {}\\n\\n function recordGasSpent(\\n bytes32 _preStateRoot,\\n bytes32 _txHash,\\n address _who,\\n uint256 _gasSpent\\n )\\n override\\n public\\n {}\\n\\n function finalize(\\n bytes32 _preStateRoot,\\n address _publisher,\\n uint256 _timestamp\\n )\\n override\\n public\\n {}\\n\\n function deposit()\\n override\\n public\\n {}\\n\\n function startWithdrawal()\\n override\\n public\\n {}\\n\\n function finalizeWithdrawal()\\n override\\n public\\n {}\\n\\n function claim(\\n address _who\\n )\\n override\\n public\\n {}\\n\\n function isCollateralized(\\n address _who\\n )\\n override\\n public\\n view\\n returns (\\n bool\\n )\\n {\\n // Only authenticate sequencer to submit state root batches.\\n return _who == resolve(\\\"OVM_Proposer\\\");\\n }\\n\\n function getGasSpent(\\n bytes32, // _preStateRoot,\\n address // _who\\n )\\n override\\n public\\n pure\\n returns (\\n uint256\\n )\\n {\\n return 0;\\n }\\n}\\n\",\"keccak256\":\"0xe649b49573ba5babca407f116e97dc13f24bf677cbcd03824a2eb98a7750c4e8\",\"license\":\"MIT\"}},\"version\":1}",
"bytecode": "0x608060405234801561001057600080fd5b506040516104673803806104678339818101604052602081101561003357600080fd5b5051600080546001600160a01b039092166001600160a01b0319909216919091179055610402806100656000396000f3fe608060405234801561001057600080fd5b506004361061009e5760003560e01c8063abfbbe1311610066578063abfbbe1314610207578063bc2f8dd814610239578063c5b6aa2f14610239578063d0e30db014610239578063dc6453dc146102415761009e565b806302ad4d2a146100a35780631e16e92f146100dd5780631e83409a14610117578063299ca4781461013d578063461a447814610161575b600080fd5b6100c9600480360360208110156100b957600080fd5b50356001600160a01b031661027f565b604080519115158252519081900360200190f35b610115600480360360808110156100f357600080fd5b508035906020810135906001600160a01b0360408201351690606001356102c9565b005b6101156004803603602081101561012d57600080fd5b50356001600160a01b03166102cf565b6101456102d2565b604080516001600160a01b039092168252519081900360200190f35b6101456004803603602081101561017757600080fd5b81019060208101813564010000000081111561019257600080fd5b8201836020820111156101a457600080fd5b803590602001918460018302840111640100000000831117156101c657600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506102e1945050505050565b6101156004803603606081101561021d57600080fd5b508035906001600160a01b0360208201351690604001356103bd565b6101156103c2565b61026d6004803603604081101561025757600080fd5b50803590602001356001600160a01b03166103c4565b60408051918252519081900360200190f35b60006102ae6040518060400160405280600c81526020016b27ab26afa83937b837b9b2b960a11b8152506102e1565b6001600160a01b0316826001600160a01b0316149050919050565b50505050565b50565b6000546001600160a01b031681565b6000805460405163bf40fac160e01b81526020600482018181528551602484015285516001600160a01b039094169363bf40fac19387938392604490920191908501908083838b5b83811015610341578181015183820152602001610329565b50505050905090810190601f16801561036e5780820380516001836020036101000a031916815260200191505b509250505060206040518083038186803b15801561038b57600080fd5b505afa15801561039f573d6000803e3d6000fd5b505050506040513d60208110156103b557600080fd5b505192915050565b505050565b565b60009291505056fea264697066735822122023ce16ce6de3f7672940d40a33de4b777fbb7eaa3ec117bcace31640220db75d64736f6c63430007060033",
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061009e5760003560e01c8063abfbbe1311610066578063abfbbe1314610207578063bc2f8dd814610239578063c5b6aa2f14610239578063d0e30db014610239578063dc6453dc146102415761009e565b806302ad4d2a146100a35780631e16e92f146100dd5780631e83409a14610117578063299ca4781461013d578063461a447814610161575b600080fd5b6100c9600480360360208110156100b957600080fd5b50356001600160a01b031661027f565b604080519115158252519081900360200190f35b610115600480360360808110156100f357600080fd5b508035906020810135906001600160a01b0360408201351690606001356102c9565b005b6101156004803603602081101561012d57600080fd5b50356001600160a01b03166102cf565b6101456102d2565b604080516001600160a01b039092168252519081900360200190f35b6101456004803603602081101561017757600080fd5b81019060208101813564010000000081111561019257600080fd5b8201836020820111156101a457600080fd5b803590602001918460018302840111640100000000831117156101c657600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506102e1945050505050565b6101156004803603606081101561021d57600080fd5b508035906001600160a01b0360208201351690604001356103bd565b6101156103c2565b61026d6004803603604081101561025757600080fd5b50803590602001356001600160a01b03166103c4565b60408051918252519081900360200190f35b60006102ae6040518060400160405280600c81526020016b27ab26afa83937b837b9b2b960a11b8152506102e1565b6001600160a01b0316826001600160a01b0316149050919050565b50505050565b50565b6000546001600160a01b031681565b6000805460405163bf40fac160e01b81526020600482018181528551602484015285516001600160a01b039094169363bf40fac19387938392604490920191908501908083838b5b83811015610341578181015183820152602001610329565b50505050905090810190601f16801561036e5780820380516001836020036101000a031916815260200191505b509250505060206040518083038186803b15801561038b57600080fd5b505afa15801561039f573d6000803e3d6000fd5b505050506040513d60208110156103b557600080fd5b505192915050565b505050565b565b60009291505056fea264697066735822122023ce16ce6de3f7672940d40a33de4b777fbb7eaa3ec117bcace31640220db75d64736f6c63430007060033",
"devdoc": {
"kind": "dev",
"methods": {
"resolve(string)": {
"params": {
"_name": "Name to resolve an address for."
},
"returns": {
"_0": "Address associated with the given name."
}
}
},
"title": "mockOVM_BondManager",
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {
"resolve(string)": {
"notice": "Resolves the address associated with a given name."
}
},
"version": 1
},
"storageLayout": {
"storage": [
{
"astId": 12055,
"contract": "contracts/optimistic-ethereum/mockOVM/verification/mockOVM_BondManager.sol:mockOVM_BondManager",
"label": "libAddressManager",
"offset": 0,
"slot": "0",
"type": "t_contract(Lib_AddressManager)12048"
}
],
"types": {
"t_contract(Lib_AddressManager)12048": {
"encoding": "inplace",
"label": "contract Lib_AddressManager",
"numberOfBytes": "20"
}
}
}
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"address": "0xd56F695e73286ac252A37593DD4E7c14270eC1Df",
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "string",
"name": "_name",
"type": "string"
},
{
"indexed": false,
"internalType": "address",
"name": "_newAddress",
"type": "address"
}
],
"name": "AddressSet",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"inputs": [
{
"internalType": "string",
"name": "_name",
"type": "string"
}
],
"name": "getAddress",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "_name",
"type": "string"
},
{
"internalType": "address",
"name": "_address",
"type": "address"
}
],
"name": "setAddress",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"transactionHash": "0x3f80c75882bf9b2b74d3153cdc8d205e473891a8056604c361c32822f88a1a04",
"receipt": {
"to": null,
"from": "0x18394B52d3Cb931dfA76F63251919D051953413d",
"contractAddress": "0xd56F695e73286ac252A37593DD4E7c14270eC1Df",
"transactionIndex": 5,
"gasUsed": "425977",
"logsBloom": "0x00000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000001000000000000000000000000020000000000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000000000000080000000000000000000000000000000000000010000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000020000080000000000000000000000000000000000000000000000000000000000000",
"blockHash": "0x570e3192ef23218091f6ad7d48a122cd3d4dc06792cb1c4f6523bdbbe3d88b0c",
"transactionHash": "0x3f80c75882bf9b2b74d3153cdc8d205e473891a8056604c361c32822f88a1a04",
"logs": [
{
"transactionIndex": 5,
"blockNumber": 24572757,
"transactionHash": "0x3f80c75882bf9b2b74d3153cdc8d205e473891a8056604c361c32822f88a1a04",
"address": "0xd56F695e73286ac252A37593DD4E7c14270eC1Df",
"topics": [
"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x00000000000000000000000018394b52d3cb931dfa76f63251919d051953413d"
],
"data": "0x",
"logIndex": 10,
"blockHash": "0x570e3192ef23218091f6ad7d48a122cd3d4dc06792cb1c4f6523bdbbe3d88b0c"
}
],
"blockNumber": 24572757,
"cumulativeGasUsed": "863778",
"status": 1,
"byzantium": true
},
"args": [],
"solcInputHash": "5ee8e508e2c54cb5ac6783b4855b1558",
"metadata": "{\"compiler\":{\"version\":\"0.7.6+commit.7338295f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_newAddress\",\"type\":\"address\"}],\"name\":\"AddressSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"}],\"name\":\"getAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"setAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"getAddress(string)\":{\"params\":{\"_name\":\"Name to retrieve an address for.\"},\"returns\":{\"_0\":\"Address associated with the given name.\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setAddress(string,address)\":{\"params\":{\"_address\":\"Address to associate with the name.\",\"_name\":\"String name to associate an address with.\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"title\":\"Lib_AddressManager\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"getAddress(string)\":{\"notice\":\"Retrieves the address associated with a given name.\"},\"setAddress(string,address)\":{\"notice\":\"Changes the address associated with a particular name.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol\":\"Lib_AddressManager\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor () internal {\\n address msgSender = _msgSender();\\n _owner = msgSender;\\n emit OwnershipTransferred(address(0), msgSender);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x15e2d5bd4c28a88548074c54d220e8086f638a71ed07e6b3ba5a70066fcf458d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with GSN meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address payable) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes memory) {\\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x8d3cb350f04ff49cfb10aef08d87f19dcbaecc8027b0bed12f3275cd12f38cf0\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* External Imports */\\nimport { Ownable } from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\n/**\\n * @title Lib_AddressManager\\n */\\ncontract Lib_AddressManager is Ownable {\\n\\n /**********\\n * Events *\\n **********/\\n\\n event AddressSet(\\n string _name,\\n address _newAddress\\n );\\n\\n\\n /*************\\n * Variables *\\n *************/\\n\\n mapping (bytes32 => address) private addresses;\\n\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Changes the address associated with a particular name.\\n * @param _name String name to associate an address with.\\n * @param _address Address to associate with the name.\\n */\\n function setAddress(\\n string memory _name,\\n address _address\\n )\\n public\\n onlyOwner\\n {\\n addresses[_getNameHash(_name)] = _address;\\n\\n emit AddressSet(\\n _name,\\n _address\\n );\\n }\\n\\n /**\\n * Retrieves the address associated with a given name.\\n * @param _name Name to retrieve an address for.\\n * @return Address associated with the given name.\\n */\\n function getAddress(\\n string memory _name\\n )\\n public\\n view\\n returns (\\n address\\n )\\n {\\n return addresses[_getNameHash(_name)];\\n }\\n\\n\\n /**********************\\n * Internal Functions *\\n **********************/\\n\\n /**\\n * Computes the hash of a name.\\n * @param _name Name to compute a hash for.\\n * @return Hash of the given name.\\n */\\n function _getNameHash(\\n string memory _name\\n )\\n internal\\n pure\\n returns (\\n bytes32\\n )\\n {\\n return keccak256(abi.encodePacked(_name));\\n }\\n}\\n\",\"keccak256\":\"0x2ce671a0e004df88b136bea5a3c59d0732cea8887c8496da1d509e0200b03d7d\",\"license\":\"MIT\"}},\"version\":1}",
"bytecode": "0x608060405234801561001057600080fd5b50600061001b61006a565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35061006e565b3390565b6106508061007d6000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c8063715018a61461005c5780638da5cb5b146100665780639b2ea4bd1461008a578063bf40fac11461013b578063f2fde38b146101e1575b600080fd5b610064610207565b005b61006e6102c5565b604080516001600160a01b039092168252519081900360200190f35b610064600480360360408110156100a057600080fd5b8101906020810181356401000000008111156100bb57600080fd5b8201836020820111156100cd57600080fd5b803590602001918460018302840111640100000000831117156100ef57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550505090356001600160a01b031691506102d49050565b61006e6004803603602081101561015157600080fd5b81019060208101813564010000000081111561016c57600080fd5b82018360208201111561017e57600080fd5b803590602001918460018302840111640100000000831117156101a057600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610436945050505050565b610064600480360360208110156101f757600080fd5b50356001600160a01b0316610465565b61020f610579565b6001600160a01b03166102206102c5565b6001600160a01b03161461027b576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b6102dc610579565b6001600160a01b03166102ed6102c5565b6001600160a01b031614610348576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b80600160006103568561057d565b815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b031602179055507f188466739ff00cc68bfb2367d23ae4b855264264fe1624caa8884399af23454c82826040518080602001836001600160a01b03168152602001828103825284818151815260200191508051906020019080838360005b838110156103f75781810151838201526020016103df565b50505050905090810190601f1680156104245780820380516001836020036101000a031916815260200191505b50935050505060405180910390a15050565b6000600160006104458461057d565b81526020810191909152604001600020546001600160a01b031692915050565b61046d610579565b6001600160a01b031661047e6102c5565b6001600160a01b0316146104d9576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b03811661051e5760405162461bcd60e51b81526004018080602001828103825260268152602001806105f56026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b3390565b6000816040516020018082805190602001908083835b602083106105b25780518252601f199092019160209182019101610593565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405160208183030381529060405280519060200120905091905056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a26469706673582212209107a301dfba06b8649cc1baf4f5d6df1fb45110fdd8dc25d143490e81f3587e64736f6c63430007060033",
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100575760003560e01c8063715018a61461005c5780638da5cb5b146100665780639b2ea4bd1461008a578063bf40fac11461013b578063f2fde38b146101e1575b600080fd5b610064610207565b005b61006e6102c5565b604080516001600160a01b039092168252519081900360200190f35b610064600480360360408110156100a057600080fd5b8101906020810181356401000000008111156100bb57600080fd5b8201836020820111156100cd57600080fd5b803590602001918460018302840111640100000000831117156100ef57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550505090356001600160a01b031691506102d49050565b61006e6004803603602081101561015157600080fd5b81019060208101813564010000000081111561016c57600080fd5b82018360208201111561017e57600080fd5b803590602001918460018302840111640100000000831117156101a057600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610436945050505050565b610064600480360360208110156101f757600080fd5b50356001600160a01b0316610465565b61020f610579565b6001600160a01b03166102206102c5565b6001600160a01b03161461027b576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b6102dc610579565b6001600160a01b03166102ed6102c5565b6001600160a01b031614610348576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b80600160006103568561057d565b815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b031602179055507f188466739ff00cc68bfb2367d23ae4b855264264fe1624caa8884399af23454c82826040518080602001836001600160a01b03168152602001828103825284818151815260200191508051906020019080838360005b838110156103f75781810151838201526020016103df565b50505050905090810190601f1680156104245780820380516001836020036101000a031916815260200191505b50935050505060405180910390a15050565b6000600160006104458461057d565b81526020810191909152604001600020546001600160a01b031692915050565b61046d610579565b6001600160a01b031661047e6102c5565b6001600160a01b0316146104d9576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b03811661051e5760405162461bcd60e51b81526004018080602001828103825260268152602001806105f56026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b3390565b6000816040516020018082805190602001908083835b602083106105b25780518252601f199092019160209182019101610593565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405160208183030381529060405280519060200120905091905056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a26469706673582212209107a301dfba06b8649cc1baf4f5d6df1fb45110fdd8dc25d143490e81f3587e64736f6c63430007060033",
"devdoc": {
"kind": "dev",
"methods": {
"getAddress(string)": {
"params": {
"_name": "Name to retrieve an address for."
},
"returns": {
"_0": "Address associated with the given name."
}
},
"owner()": {
"details": "Returns the address of the current owner."
},
"renounceOwnership()": {
"details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner."
},
"setAddress(string,address)": {
"params": {
"_address": "Address to associate with the name.",
"_name": "String name to associate an address with."
}
},
"transferOwnership(address)": {
"details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner."
}
},
"title": "Lib_AddressManager",
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {
"getAddress(string)": {
"notice": "Retrieves the address associated with a given name."
},
"setAddress(string,address)": {
"notice": "Changes the address associated with a particular name."
}
},
"version": 1
},
"storageLayout": {
"storage": [
{
"astId": 664,
"contract": "contracts/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol:Lib_AddressManager",
"label": "_owner",
"offset": 0,
"slot": "0",
"type": "t_address"
},
{
"astId": 12737,
"contract": "contracts/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol:Lib_AddressManager",
"label": "addresses",
"offset": 0,
"slot": "1",
"type": "t_mapping(t_bytes32,t_address)"
}
],
"types": {
"t_address": {
"encoding": "inplace",
"label": "address",
"numberOfBytes": "20"
},
"t_bytes32": {
"encoding": "inplace",
"label": "bytes32",
"numberOfBytes": "32"
},
"t_mapping(t_bytes32,t_address)": {
"encoding": "mapping",
"key": "t_bytes32",
"label": "mapping(bytes32 => address)",
"numberOfBytes": "32",
"value": "t_address"
}
}
}
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"address": "0xeb335a8A5e8bA008cF7Cb02D5C3432f4fDB576da",
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "_libAddressManager",
"type": "address"
},
{
"internalType": "string",
"name": "_owner",
"type": "string"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_index",
"type": "uint256"
},
{
"internalType": "bytes27",
"name": "_globalMetadata",
"type": "bytes27"
}
],
"name": "deleteElementsAfterInclusive",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_index",
"type": "uint256"
}
],
"name": "deleteElementsAfterInclusive",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_index",
"type": "uint256"
}
],
"name": "get",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getGlobalMetadata",
"outputs": [
{
"internalType": "bytes27",
"name": "",
"type": "bytes27"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "length",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "libAddressManager",
"outputs": [
{
"internalType": "contract Lib_AddressManager",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "_object",
"type": "bytes32"
},
{
"internalType": "bytes27",
"name": "_globalMetadata",
"type": "bytes27"
}
],
"name": "push",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "_object",
"type": "bytes32"
}
],
"name": "push",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "_name",
"type": "string"
}
],
"name": "resolve",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes27",
"name": "_globalMetadata",
"type": "bytes27"
}
],
"name": "setGlobalMetadata",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_index",
"type": "uint256"
}
],
"name": "setNextOverwritableIndex",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"transactionHash": "0x787b44347630217940635c7c654bb383c4f85dba4727578dff104e50dbea79dc",
"receipt": {
"to": null,
"from": "0x18394B52d3Cb931dfA76F63251919D051953413d",
"contractAddress": "0xeb335a8A5e8bA008cF7Cb02D5C3432f4fDB576da",
"transactionIndex": 0,
"gasUsed": "968390",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blockHash": "0x8ea3e9319a68cca7fb784f92017ee846c2eb68c34308a6f8970dfd2dd7999eb1",
"transactionHash": "0x787b44347630217940635c7c654bb383c4f85dba4727578dff104e50dbea79dc",
"logs": [],
"blockNumber": 24572785,
"cumulativeGasUsed": "968390",
"status": 1,
"byzantium": true
},
"args": [
"0xd56F695e73286ac252A37593DD4E7c14270eC1Df",
"OVM_CanonicalTransactionChain"
],
"solcInputHash": "5ee8e508e2c54cb5ac6783b4855b1558",
"metadata": "{\"compiler\":{\"version\":\"0.7.6+commit.7338295f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_libAddressManager\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_owner\",\"type\":\"string\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_index\",\"type\":\"uint256\"},{\"internalType\":\"bytes27\",\"name\":\"_globalMetadata\",\"type\":\"bytes27\"}],\"name\":\"deleteElementsAfterInclusive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_index\",\"type\":\"uint256\"}],\"name\":\"deleteElementsAfterInclusive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_index\",\"type\":\"uint256\"}],\"name\":\"get\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getGlobalMetadata\",\"outputs\":[{\"internalType\":\"bytes27\",\"name\":\"\",\"type\":\"bytes27\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"length\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"libAddressManager\",\"outputs\":[{\"internalType\":\"contract Lib_AddressManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_object\",\"type\":\"bytes32\"},{\"internalType\":\"bytes27\",\"name\":\"_globalMetadata\",\"type\":\"bytes27\"}],\"name\":\"push\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_object\",\"type\":\"bytes32\"}],\"name\":\"push\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes27\",\"name\":\"_globalMetadata\",\"type\":\"bytes27\"}],\"name\":\"setGlobalMetadata\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_index\",\"type\":\"uint256\"}],\"name\":\"setNextOverwritableIndex\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"The Chain Storage Container provides its owner contract with read, write and delete functionality. This provides gas efficiency gains by enabling it to overwrite storage slots which can no longer be used in a fraud proof due to the fraud window having passed, and the associated chain state or transactions being finalized. Three distinct Chain Storage Containers will be deployed on Layer 1: 1. Stores transaction batches for the Canonical Transaction Chain 2. Stores queued transactions for the Canonical Transaction Chain 3. Stores chain state batches for the State Commitment Chain Compiler used: solc Runtime target: EVM\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"params\":{\"_libAddressManager\":\"Address of the Address Manager.\",\"_owner\":\"Name of the contract that owns this container (will be resolved later).\"}},\"deleteElementsAfterInclusive(uint256)\":{\"params\":{\"_index\":\"Object index to delete from.\"}},\"deleteElementsAfterInclusive(uint256,bytes27)\":{\"params\":{\"_globalMetadata\":\"New global metadata for the container.\",\"_index\":\"Object index to delete from.\"}},\"get(uint256)\":{\"params\":{\"_index\":\"Index of the particular object to access.\"},\"returns\":{\"_0\":\"32 byte object value.\"}},\"getGlobalMetadata()\":{\"returns\":{\"_0\":\"Container global metadata field.\"}},\"length()\":{\"returns\":{\"_0\":\"Number of objects in the container.\"}},\"push(bytes32)\":{\"params\":{\"_object\":\"A 32 byte value to insert into the container.\"}},\"push(bytes32,bytes27)\":{\"params\":{\"_globalMetadata\":\"New global metadata for the container.\",\"_object\":\"A 32 byte value to insert into the container.\"}},\"resolve(string)\":{\"params\":{\"_name\":\"Name to resolve an address for.\"},\"returns\":{\"_0\":\"Address associated with the given name.\"}},\"setGlobalMetadata(bytes27)\":{\"params\":{\"_globalMetadata\":\"New global metadata to set.\"}}},\"title\":\"OVM_ChainStorageContainer\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"deleteElementsAfterInclusive(uint256)\":{\"notice\":\"Removes all objects after and including a given index.\"},\"deleteElementsAfterInclusive(uint256,bytes27)\":{\"notice\":\"Removes all objects after and including a given index. Also allows setting the global metadata field.\"},\"get(uint256)\":{\"notice\":\"Retrieves an object from the container.\"},\"getGlobalMetadata()\":{\"notice\":\"Retrieves the container's global metadata field.\"},\"length()\":{\"notice\":\"Retrieves the number of objects stored in the container.\"},\"push(bytes32)\":{\"notice\":\"Pushes an object into the container.\"},\"push(bytes32,bytes27)\":{\"notice\":\"Pushes an object into the container. Function allows setting the global metadata since we'll need to touch the \\\"length\\\" storage slot anyway, which also contains the global metadata (it's an optimization).\"},\"resolve(string)\":{\"notice\":\"Resolves the address associated with a given name.\"},\"setGlobalMetadata(bytes27)\":{\"notice\":\"Sets the container's global metadata field. We're using `bytes27` here because we use five bytes to maintain the length of the underlying data structure, meaning we have an extra 27 bytes to store arbitrary data.\"},\"setNextOverwritableIndex(uint256)\":{\"notice\":\"Marks an index as overwritable, meaing the underlying buffer can start to write values over any objects before and including the given index.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol\":\"OVM_ChainStorageContainer\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor () internal {\\n address msgSender = _msgSender();\\n _owner = msgSender;\\n emit OwnershipTransferred(address(0), msgSender);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x15e2d5bd4c28a88548074c54d220e8086f638a71ed07e6b3ba5a70066fcf458d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with GSN meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address payable) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes memory) {\\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x8d3cb350f04ff49cfb10aef08d87f19dcbaecc8027b0bed12f3275cd12f38cf0\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* Library Imports */\\nimport { Lib_RingBuffer } from \\\"../../libraries/utils/Lib_RingBuffer.sol\\\";\\nimport { Lib_AddressResolver } from \\\"../../libraries/resolver/Lib_AddressResolver.sol\\\";\\n\\n/* Interface Imports */\\nimport { iOVM_ChainStorageContainer } from \\\"../../iOVM/chain/iOVM_ChainStorageContainer.sol\\\";\\n\\n/**\\n * @title OVM_ChainStorageContainer\\n * @dev The Chain Storage Container provides its owner contract with read, write and delete functionality.\\n * This provides gas efficiency gains by enabling it to overwrite storage slots which can no longer be used\\n * in a fraud proof due to the fraud window having passed, and the associated chain state or\\n * transactions being finalized.\\n * Three distinct Chain Storage Containers will be deployed on Layer 1:\\n * 1. Stores transaction batches for the Canonical Transaction Chain\\n * 2. Stores queued transactions for the Canonical Transaction Chain\\n * 3. Stores chain state batches for the State Commitment Chain\\n *\\n * Compiler used: solc\\n * Runtime target: EVM\\n */\\ncontract OVM_ChainStorageContainer is iOVM_ChainStorageContainer, Lib_AddressResolver {\\n\\n /*************\\n * Libraries *\\n *************/\\n\\n using Lib_RingBuffer for Lib_RingBuffer.RingBuffer;\\n\\n\\n /*************\\n * Variables *\\n *************/\\n\\n string public owner;\\n Lib_RingBuffer.RingBuffer internal buffer;\\n\\n\\n /***************\\n * Constructor *\\n ***************/\\n\\n /**\\n * @param _libAddressManager Address of the Address Manager.\\n * @param _owner Name of the contract that owns this container (will be resolved later).\\n */\\n constructor(\\n address _libAddressManager,\\n string memory _owner\\n )\\n Lib_AddressResolver(_libAddressManager)\\n {\\n owner = _owner;\\n }\\n\\n\\n /**********************\\n * Function Modifiers *\\n **********************/\\n\\n modifier onlyOwner() {\\n require(\\n msg.sender == resolve(owner),\\n \\\"OVM_ChainStorageContainer: Function can only be called by the owner.\\\"\\n );\\n _;\\n }\\n\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function setGlobalMetadata(\\n bytes27 _globalMetadata\\n )\\n override\\n public\\n onlyOwner\\n {\\n return buffer.setExtraData(_globalMetadata);\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function getGlobalMetadata()\\n override\\n public\\n view\\n returns (\\n bytes27\\n )\\n {\\n return buffer.getExtraData();\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function length()\\n override\\n public\\n view\\n returns (\\n uint256\\n )\\n {\\n return uint256(buffer.getLength());\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function push(\\n bytes32 _object\\n )\\n override\\n public\\n onlyOwner\\n {\\n buffer.push(_object);\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function push(\\n bytes32 _object,\\n bytes27 _globalMetadata\\n )\\n override\\n public\\n onlyOwner\\n {\\n buffer.push(_object, _globalMetadata);\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function get(\\n uint256 _index\\n )\\n override\\n public\\n view\\n returns (\\n bytes32\\n )\\n {\\n return buffer.get(uint40(_index));\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function deleteElementsAfterInclusive(\\n uint256 _index\\n )\\n override\\n public\\n onlyOwner\\n {\\n buffer.deleteElementsAfterInclusive(\\n uint40(_index)\\n );\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function deleteElementsAfterInclusive(\\n uint256 _index,\\n bytes27 _globalMetadata\\n )\\n override\\n public\\n onlyOwner\\n {\\n buffer.deleteElementsAfterInclusive(\\n uint40(_index),\\n _globalMetadata\\n );\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function setNextOverwritableIndex(\\n uint256 _index\\n )\\n override\\n public\\n onlyOwner\\n {\\n buffer.nextOverwritableIndex = _index;\\n }\\n}\\n\",\"keccak256\":\"0x93325c961516aa2a22bf1aacf4029353d5e3b693e04b485753170337b50224e6\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/iOVM/chain/iOVM_ChainStorageContainer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/**\\n * @title iOVM_ChainStorageContainer\\n */\\ninterface iOVM_ChainStorageContainer {\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Sets the container's global metadata field. We're using `bytes27` here because we use five\\n * bytes to maintain the length of the underlying data structure, meaning we have an extra\\n * 27 bytes to store arbitrary data.\\n * @param _globalMetadata New global metadata to set.\\n */\\n function setGlobalMetadata(\\n bytes27 _globalMetadata\\n )\\n external;\\n\\n /**\\n * Retrieves the container's global metadata field.\\n * @return Container global metadata field.\\n */\\n function getGlobalMetadata()\\n external\\n view\\n returns (\\n bytes27\\n );\\n\\n /**\\n * Retrieves the number of objects stored in the container.\\n * @return Number of objects in the container.\\n */\\n function length()\\n external\\n view\\n returns (\\n uint256\\n );\\n\\n /**\\n * Pushes an object into the container.\\n * @param _object A 32 byte value to insert into the container.\\n */\\n function push(\\n bytes32 _object\\n )\\n external;\\n\\n /**\\n * Pushes an object into the container. Function allows setting the global metadata since\\n * we'll need to touch the \\\"length\\\" storage slot anyway, which also contains the global\\n * metadata (it's an optimization).\\n * @param _object A 32 byte value to insert into the container.\\n * @param _globalMetadata New global metadata for the container.\\n */\\n function push(\\n bytes32 _object,\\n bytes27 _globalMetadata\\n )\\n external;\\n\\n /**\\n * Retrieves an object from the container.\\n * @param _index Index of the particular object to access.\\n * @return 32 byte object value.\\n */\\n function get(\\n uint256 _index\\n )\\n external\\n view\\n returns (\\n bytes32\\n );\\n\\n /**\\n * Removes all objects after and including a given index.\\n * @param _index Object index to delete from.\\n */\\n function deleteElementsAfterInclusive(\\n uint256 _index\\n )\\n external;\\n\\n /**\\n * Removes all objects after and including a given index. Also allows setting the global\\n * metadata field.\\n * @param _index Object index to delete from.\\n * @param _globalMetadata New global metadata for the container.\\n */\\n function deleteElementsAfterInclusive(\\n uint256 _index,\\n bytes27 _globalMetadata\\n )\\n external;\\n\\n /**\\n * Marks an index as overwritable, meaing the underlying buffer can start to write values over\\n * any objects before and including the given index.\\n */\\n function setNextOverwritableIndex(\\n uint256 _index\\n )\\n external;\\n}\\n\",\"keccak256\":\"0x2d7973a0ad84c23ec62624d3f1e3aeb198cc72686ff1e6cfa17155556b320c94\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* External Imports */\\nimport { Ownable } from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\n/**\\n * @title Lib_AddressManager\\n */\\ncontract Lib_AddressManager is Ownable {\\n\\n /**********\\n * Events *\\n **********/\\n\\n event AddressSet(\\n string _name,\\n address _newAddress\\n );\\n\\n\\n /*************\\n * Variables *\\n *************/\\n\\n mapping (bytes32 => address) private addresses;\\n\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Changes the address associated with a particular name.\\n * @param _name String name to associate an address with.\\n * @param _address Address to associate with the name.\\n */\\n function setAddress(\\n string memory _name,\\n address _address\\n )\\n public\\n onlyOwner\\n {\\n addresses[_getNameHash(_name)] = _address;\\n\\n emit AddressSet(\\n _name,\\n _address\\n );\\n }\\n\\n /**\\n * Retrieves the address associated with a given name.\\n * @param _name Name to retrieve an address for.\\n * @return Address associated with the given name.\\n */\\n function getAddress(\\n string memory _name\\n )\\n public\\n view\\n returns (\\n address\\n )\\n {\\n return addresses[_getNameHash(_name)];\\n }\\n\\n\\n /**********************\\n * Internal Functions *\\n **********************/\\n\\n /**\\n * Computes the hash of a name.\\n * @param _name Name to compute a hash for.\\n * @return Hash of the given name.\\n */\\n function _getNameHash(\\n string memory _name\\n )\\n internal\\n pure\\n returns (\\n bytes32\\n )\\n {\\n return keccak256(abi.encodePacked(_name));\\n }\\n}\\n\",\"keccak256\":\"0x2ce671a0e004df88b136bea5a3c59d0732cea8887c8496da1d509e0200b03d7d\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/resolver/Lib_AddressResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* Library Imports */\\nimport { Lib_AddressManager } from \\\"./Lib_AddressManager.sol\\\";\\n\\n/**\\n * @title Lib_AddressResolver\\n */\\nabstract contract Lib_AddressResolver {\\n\\n /*************\\n * Variables *\\n *************/\\n\\n Lib_AddressManager public libAddressManager;\\n\\n\\n /***************\\n * Constructor *\\n ***************/\\n\\n /**\\n * @param _libAddressManager Address of the Lib_AddressManager.\\n */\\n constructor(\\n address _libAddressManager\\n ) {\\n libAddressManager = Lib_AddressManager(_libAddressManager);\\n }\\n\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Resolves the address associated with a given name.\\n * @param _name Name to resolve an address for.\\n * @return Address associated with the given name.\\n */\\n function resolve(\\n string memory _name\\n )\\n public\\n view\\n returns (\\n address\\n )\\n {\\n return libAddressManager.getAddress(_name);\\n }\\n}\\n\",\"keccak256\":\"0x65981feeabff6a81783ea97d44baf988a18a86c8cb374c46fdb71819cbacc7c0\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/utils/Lib_RingBuffer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\nlibrary Lib_RingBuffer {\\n using Lib_RingBuffer for RingBuffer;\\n\\n /***********\\n * Structs *\\n ***********/\\n\\n struct Buffer {\\n uint256 length;\\n mapping (uint256 => bytes32) buf;\\n }\\n\\n struct RingBuffer {\\n bytes32 contextA;\\n bytes32 contextB;\\n Buffer bufferA;\\n Buffer bufferB;\\n uint256 nextOverwritableIndex;\\n }\\n\\n struct RingBufferContext {\\n // contextA\\n uint40 globalIndex;\\n bytes27 extraData;\\n\\n // contextB\\n uint64 currBufferIndex;\\n uint40 prevResetIndex;\\n uint40 currResetIndex;\\n }\\n\\n\\n /*************\\n * Constants *\\n *************/\\n\\n uint256 constant MIN_CAPACITY = 16;\\n\\n\\n /**********************\\n * Internal Functions *\\n **********************/\\n\\n /**\\n * Pushes a single element to the buffer.\\n * @param _self Buffer to access.\\n * @param _value Value to push to the buffer.\\n * @param _extraData Optional global extra data.\\n */\\n function push(\\n RingBuffer storage _self,\\n bytes32 _value,\\n bytes27 _extraData\\n )\\n internal\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n Buffer storage currBuffer = _self.getBuffer(ctx.currBufferIndex);\\n\\n // Set a minimum capacity.\\n if (currBuffer.length == 0) {\\n currBuffer.length = MIN_CAPACITY;\\n }\\n\\n // Check if we need to expand the buffer.\\n if (ctx.globalIndex - ctx.currResetIndex >= currBuffer.length) {\\n if (ctx.currResetIndex < _self.nextOverwritableIndex) {\\n // We're going to overwrite the inactive buffer.\\n // Bump the buffer index, reset the delete offset, and set our reset indices.\\n ctx.currBufferIndex++;\\n ctx.prevResetIndex = ctx.currResetIndex;\\n ctx.currResetIndex = ctx.globalIndex;\\n\\n // Swap over to the next buffer.\\n currBuffer = _self.getBuffer(ctx.currBufferIndex);\\n } else {\\n // We're not overwriting yet, double the length of the current buffer.\\n currBuffer.length *= 2;\\n }\\n }\\n\\n // Index to write to is the difference of the global and reset indices.\\n uint256 writeHead = ctx.globalIndex - ctx.currResetIndex;\\n currBuffer.buf[writeHead] = _value;\\n\\n // Bump the global index and insert our extra data, then save the context.\\n ctx.globalIndex++;\\n ctx.extraData = _extraData;\\n _self.setContext(ctx);\\n }\\n\\n /**\\n * Pushes a single element to the buffer.\\n * @param _self Buffer to access.\\n * @param _value Value to push to the buffer.\\n */\\n function push(\\n RingBuffer storage _self,\\n bytes32 _value\\n )\\n internal\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n\\n _self.push(\\n _value,\\n ctx.extraData\\n );\\n }\\n\\n /**\\n * Retrieves an element from the buffer.\\n * @param _self Buffer to access.\\n * @param _index Element index to retrieve.\\n * @return Value of the element at the given index.\\n */\\n function get(\\n RingBuffer storage _self,\\n uint256 _index\\n )\\n internal\\n view\\n returns (\\n bytes32\\n )\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n\\n require(\\n _index < ctx.globalIndex,\\n \\\"Index out of bounds.\\\"\\n );\\n\\n Buffer storage currBuffer = _self.getBuffer(ctx.currBufferIndex);\\n Buffer storage prevBuffer = _self.getBuffer(ctx.currBufferIndex + 1);\\n\\n if (_index >= ctx.currResetIndex) {\\n // We're trying to load an element from the current buffer.\\n // Relative index is just the difference from the reset index.\\n uint256 relativeIndex = _index - ctx.currResetIndex;\\n\\n // Shouldn't happen but why not check.\\n require(\\n relativeIndex < currBuffer.length,\\n \\\"Index out of bounds.\\\"\\n );\\n\\n return currBuffer.buf[relativeIndex];\\n } else {\\n // We're trying to load an element from the previous buffer.\\n // Relative index is the difference from the reset index in the other direction.\\n uint256 relativeIndex = ctx.currResetIndex - _index;\\n\\n // Condition only fails in the case that we deleted and flipped buffers.\\n require(\\n ctx.currResetIndex > ctx.prevResetIndex,\\n \\\"Index out of bounds.\\\"\\n );\\n\\n // Make sure we're not trying to read beyond the array.\\n require(\\n relativeIndex <= prevBuffer.length,\\n \\\"Index out of bounds.\\\"\\n );\\n\\n return prevBuffer.buf[prevBuffer.length - relativeIndex];\\n }\\n }\\n\\n /**\\n * Deletes all elements after (and including) a given index.\\n * @param _self Buffer to access.\\n * @param _index Index of the element to delete from (inclusive).\\n * @param _extraData Optional global extra data.\\n */\\n function deleteElementsAfterInclusive(\\n RingBuffer storage _self,\\n uint40 _index,\\n bytes27 _extraData\\n )\\n internal\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n\\n require(\\n _index < ctx.globalIndex && _index >= ctx.prevResetIndex,\\n \\\"Index out of bounds.\\\"\\n );\\n\\n if (_index < ctx.currResetIndex) {\\n // We're switching back to the previous buffer.\\n // Reduce the buffer index, set the current reset index back to match the previous one.\\n // We use the equality of these two values to prevent reading beyond this buffer.\\n ctx.currBufferIndex--;\\n ctx.currResetIndex = ctx.prevResetIndex;\\n }\\n\\n // Set our global index and extra data, save the context.\\n ctx.globalIndex = _index;\\n ctx.extraData = _extraData;\\n _self.setContext(ctx);\\n }\\n\\n /**\\n * Deletes all elements after (and including) a given index.\\n * @param _self Buffer to access.\\n * @param _index Index of the element to delete from (inclusive).\\n */\\n function deleteElementsAfterInclusive(\\n RingBuffer storage _self,\\n uint40 _index\\n )\\n internal\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n _self.deleteElementsAfterInclusive(\\n _index,\\n ctx.extraData\\n );\\n }\\n\\n /**\\n * Retrieves the current global index.\\n * @param _self Buffer to access.\\n * @return Current global index.\\n */\\n function getLength(\\n RingBuffer storage _self\\n )\\n internal\\n view\\n returns (\\n uint40\\n )\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n return ctx.globalIndex;\\n }\\n\\n /**\\n * Changes current global extra data.\\n * @param _self Buffer to access.\\n * @param _extraData New global extra data.\\n */\\n function setExtraData(\\n RingBuffer storage _self,\\n bytes27 _extraData\\n )\\n internal\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n ctx.extraData = _extraData;\\n _self.setContext(ctx);\\n }\\n\\n /**\\n * Retrieves the current global extra data.\\n * @param _self Buffer to access.\\n * @return Current global extra data.\\n */\\n function getExtraData(\\n RingBuffer storage _self\\n )\\n internal\\n view\\n returns (\\n bytes27\\n )\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n return ctx.extraData;\\n }\\n\\n /**\\n * Sets the current ring buffer context.\\n * @param _self Buffer to access.\\n * @param _ctx Current ring buffer context.\\n */\\n function setContext(\\n RingBuffer storage _self,\\n RingBufferContext memory _ctx\\n )\\n internal\\n {\\n bytes32 contextA;\\n bytes32 contextB;\\n\\n uint40 globalIndex = _ctx.globalIndex;\\n bytes27 extraData = _ctx.extraData;\\n assembly {\\n contextA := globalIndex\\n contextA := or(contextA, extraData)\\n }\\n\\n uint64 currBufferIndex = _ctx.currBufferIndex;\\n uint40 prevResetIndex = _ctx.prevResetIndex;\\n uint40 currResetIndex = _ctx.currResetIndex;\\n assembly {\\n contextB := currBufferIndex\\n contextB := or(contextB, shl(64, prevResetIndex))\\n contextB := or(contextB, shl(104, currResetIndex))\\n }\\n\\n if (_self.contextA != contextA) {\\n _self.contextA = contextA;\\n }\\n\\n if (_self.contextB != contextB) {\\n _self.contextB = contextB;\\n }\\n }\\n\\n /**\\n * Retrieves the current ring buffer context.\\n * @param _self Buffer to access.\\n * @return Current ring buffer context.\\n */\\n function getContext(\\n RingBuffer storage _self\\n )\\n internal\\n view\\n returns (\\n RingBufferContext memory\\n )\\n {\\n bytes32 contextA = _self.contextA;\\n bytes32 contextB = _self.contextB;\\n\\n uint40 globalIndex;\\n bytes27 extraData;\\n assembly {\\n globalIndex := and(contextA, 0x000000000000000000000000000000000000000000000000000000FFFFFFFFFF)\\n extraData := and(contextA, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000)\\n }\\n\\n uint64 currBufferIndex;\\n uint40 prevResetIndex;\\n uint40 currResetIndex;\\n assembly {\\n currBufferIndex := and(contextB, 0x000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFF)\\n prevResetIndex := shr(64, and(contextB, 0x00000000000000000000000000000000000000FFFFFFFFFF0000000000000000))\\n currResetIndex := shr(104, and(contextB, 0x0000000000000000000000000000FFFFFFFFFF00000000000000000000000000))\\n }\\n\\n return RingBufferContext({\\n globalIndex: globalIndex,\\n extraData: extraData,\\n currBufferIndex: currBufferIndex,\\n prevResetIndex: prevResetIndex,\\n currResetIndex: currResetIndex\\n });\\n }\\n\\n /**\\n * Retrieves the a buffer from the ring buffer by index.\\n * @param _self Buffer to access.\\n * @param _which Index of the sub buffer to access.\\n * @return Sub buffer for the index.\\n */\\n function getBuffer(\\n RingBuffer storage _self,\\n uint256 _which\\n )\\n internal\\n view\\n returns (\\n Buffer storage\\n )\\n {\\n return _which % 2 == 0 ? _self.bufferA : _self.bufferB;\\n }\\n}\\n\",\"keccak256\":\"0xe30fc56d4499f98582e1f800dfa3b343f171163a557266c31a56449d5fd3ffae\",\"license\":\"MIT\"}},\"version\":1}",
"bytecode": "0x60806040523480156200001157600080fd5b506040516200118d3803806200118d833981810160405260408110156200003757600080fd5b8151602083018051604051929492938301929190846401000000008211156200005f57600080fd5b9083019060208201858111156200007557600080fd5b82516401000000008111828201881017156200009057600080fd5b82525081516020918201929091019080838360005b83811015620000bf578181015183820152602001620000a5565b50505050905090810190601f168015620000ed5780820380516001836020036101000a031916815260200191505b506040525050600080546001600160a01b0319166001600160a01b038516179055508051620001249060019060208401906200012d565b505050620001d9565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282620001655760008555620001b0565b82601f106200018057805160ff1916838001178555620001b0565b82800160010185558215620001b0579182015b82811115620001b057825182559160200191906001019062000193565b50620001be929150620001c2565b5090565b5b80821115620001be5760008155600101620001c3565b610fa480620001e96000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c80634651d91e116100715780634651d91e1461021a5780638da5cb5b146102375780639507d39a146102b4578063b298e36b146102d1578063ccf8f969146102ee578063fa9e936c14610311576100b4565b8063167fd681146100b95780631f7b6d32146100e65780632015276c1461010057806329061de21461012b578063299ca47814610150578063461a447814610174575b600080fd5b6100e4600480360360408110156100cf57600080fd5b508035906020013564ffffffffff191661032e565b005b6100ee610423565b60408051918252519081900360200190f35b6100e46004803603604081101561011657600080fd5b508035906020013564ffffffffff191661043b565b6100e46004803603602081101561014157600080fd5b503564ffffffffff19166104f7565b6101586105b5565b604080516001600160a01b039092168252519081900360200190f35b6101586004803603602081101561018a57600080fd5b8101906020810181356401000000008111156101a557600080fd5b8201836020820111156101b757600080fd5b803590602001918460018302840111640100000000831117156101d957600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506105c4945050505050565b6100e46004803603602081101561023057600080fd5b50356106a0565b61023f61075b565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610279578181015183820152602001610261565b50505050905090810190601f1680156102a65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6100ee600480360360208110156102ca57600080fd5b50356107e8565b6100e4600480360360208110156102e757600080fd5b5035610802565b6102f66108bd565b6040805164ffffffffff199092168252519081900360200190f35b6100e46004803603602081101561032757600080fd5b50356108ce565b60018054604080516020601f6002600019610100878916150201909516949094049384018190048102820181019092528281526103c493909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b820191906000526020600020905b81548152906001019060200180831161039d57829003601f168201915b50505050506105c4565b6001600160a01b0316336001600160a01b0316146104135760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b61041f60028383610983565b5050565b600061042f6002610a75565b64ffffffffff16905090565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261049c93909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146104eb5760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b61041f60028383610a89565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261055893909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146105a75760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b6105b2600282610b90565b50565b6000546001600160a01b031681565b6000805460405163bf40fac160e01b81526020600482018181528551602484015285516001600160a01b039094169363bf40fac19387938392604490920191908501908083838b5b8381101561062457818101518382015260200161060c565b50505050905090810190601f1680156106515780820380516001836020036101000a031916815260200191505b509250505060206040518083038186803b15801561066e57600080fd5b505afa158015610682573d6000803e3d6000fd5b505050506040513d602081101561069857600080fd5b505192915050565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261070193909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146107505760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b6105b2600282610bba565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156107e05780601f106107b5576101008083540402835291602001916107e0565b820191906000526020600020905b8154815290600101906020018083116107c357829003601f168201915b505050505081565b60006107fc600264ffffffffff8416610be0565b92915050565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261086393909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146108b25760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b6105b2600282610de9565b60006108c96002610e0f565b905090565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261092f93909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b03161461097e5760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b600855565b600061098e84610e26565b9050806000015164ffffffffff168364ffffffffff161080156109c35750806060015164ffffffffff168364ffffffffff1610155b610a0b576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b806080015164ffffffffff168364ffffffffff161015610a4d576040810180516000190167ffffffffffffffff169052606081015164ffffffffff1660808201525b64ffffffffff8316815264ffffffffff1982166020820152610a6f8482610e86565b50505050565b600080610a8183610e26565b519392505050565b6000610a9484610e26565b90506000610ab9826040015167ffffffffffffffff1686610edc90919063ffffffff16565b8054909150610ac757601081555b8054608083015183510364ffffffffff1610610b3e578460060154826080015164ffffffffff161015610b365760408201805160010167ffffffffffffffff169081905260808301805164ffffffffff90811660608601528451169052610b2f908690610edc565b9050610b3e565b805460020281555b608082015182510364ffffffffff9081166000818152600184810160209081526040909220889055855101909216845264ffffffffff19851691840191909152610b888684610e86565b505050505050565b6000610b9b83610e26565b64ffffffffff19831660208201529050610bb58382610e86565b505050565b6000610bc583610e26565b9050610bb5828260200151856109839092919063ffffffff16565b600080610bec84610e26565b805190915064ffffffffff168310610c42576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b6000610c65826040015167ffffffffffffffff1686610edc90919063ffffffff16565b90506000610c8d836040015160010167ffffffffffffffff1687610edc90919063ffffffff16565b9050826080015164ffffffffff168510610d1a576080830151825464ffffffffff9091168603908110610cfe576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b6000908152600190920160205250604090205491506107fc9050565b6080830151606084015164ffffffffff9182168781039290911610610d7d576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b8154811115610dca576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b81540360009081526001909101602052604090205492506107fc915050565b6000610df483610e26565b9050610bb582826020015185610a899092919063ffffffff16565b600080610e1b83610e26565b602001519392505050565b610e2e610efc565b5080546001909101546040805160a08101825264ffffffffff808516825264ffffffffff19909416602082015267ffffffffffffffff8316818301529082901c8316606082015260689190911c909116608082015290565b80516020820151604080840151606085015160808601518754858717969483901b8417606883901b1795939291908714610ebe578689555b85896001015414610ed157600189018690555b505050505050505050565b60006002820615610ef05782600401610ef5565b826002015b9392505050565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101919091529056fe4f564d5f436861696e53746f72616765436f6e7461696e65723a2046756e6374696f6e2063616e206f6e6c792062652063616c6c656420627920746865206f776e65722ea2646970667358221220376cbc00341dd082d644157f6511fcd1ac26a6a924d04ae6532cfcab93d9191864736f6c63430007060033",
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100b45760003560e01c80634651d91e116100715780634651d91e1461021a5780638da5cb5b146102375780639507d39a146102b4578063b298e36b146102d1578063ccf8f969146102ee578063fa9e936c14610311576100b4565b8063167fd681146100b95780631f7b6d32146100e65780632015276c1461010057806329061de21461012b578063299ca47814610150578063461a447814610174575b600080fd5b6100e4600480360360408110156100cf57600080fd5b508035906020013564ffffffffff191661032e565b005b6100ee610423565b60408051918252519081900360200190f35b6100e46004803603604081101561011657600080fd5b508035906020013564ffffffffff191661043b565b6100e46004803603602081101561014157600080fd5b503564ffffffffff19166104f7565b6101586105b5565b604080516001600160a01b039092168252519081900360200190f35b6101586004803603602081101561018a57600080fd5b8101906020810181356401000000008111156101a557600080fd5b8201836020820111156101b757600080fd5b803590602001918460018302840111640100000000831117156101d957600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506105c4945050505050565b6100e46004803603602081101561023057600080fd5b50356106a0565b61023f61075b565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610279578181015183820152602001610261565b50505050905090810190601f1680156102a65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6100ee600480360360208110156102ca57600080fd5b50356107e8565b6100e4600480360360208110156102e757600080fd5b5035610802565b6102f66108bd565b6040805164ffffffffff199092168252519081900360200190f35b6100e46004803603602081101561032757600080fd5b50356108ce565b60018054604080516020601f6002600019610100878916150201909516949094049384018190048102820181019092528281526103c493909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b820191906000526020600020905b81548152906001019060200180831161039d57829003601f168201915b50505050506105c4565b6001600160a01b0316336001600160a01b0316146104135760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b61041f60028383610983565b5050565b600061042f6002610a75565b64ffffffffff16905090565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261049c93909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146104eb5760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b61041f60028383610a89565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261055893909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146105a75760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b6105b2600282610b90565b50565b6000546001600160a01b031681565b6000805460405163bf40fac160e01b81526020600482018181528551602484015285516001600160a01b039094169363bf40fac19387938392604490920191908501908083838b5b8381101561062457818101518382015260200161060c565b50505050905090810190601f1680156106515780820380516001836020036101000a031916815260200191505b509250505060206040518083038186803b15801561066e57600080fd5b505afa158015610682573d6000803e3d6000fd5b505050506040513d602081101561069857600080fd5b505192915050565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261070193909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146107505760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b6105b2600282610bba565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156107e05780601f106107b5576101008083540402835291602001916107e0565b820191906000526020600020905b8154815290600101906020018083116107c357829003601f168201915b505050505081565b60006107fc600264ffffffffff8416610be0565b92915050565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261086393909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146108b25760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b6105b2600282610de9565b60006108c96002610e0f565b905090565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261092f93909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b03161461097e5760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b600855565b600061098e84610e26565b9050806000015164ffffffffff168364ffffffffff161080156109c35750806060015164ffffffffff168364ffffffffff1610155b610a0b576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b806080015164ffffffffff168364ffffffffff161015610a4d576040810180516000190167ffffffffffffffff169052606081015164ffffffffff1660808201525b64ffffffffff8316815264ffffffffff1982166020820152610a6f8482610e86565b50505050565b600080610a8183610e26565b519392505050565b6000610a9484610e26565b90506000610ab9826040015167ffffffffffffffff1686610edc90919063ffffffff16565b8054909150610ac757601081555b8054608083015183510364ffffffffff1610610b3e578460060154826080015164ffffffffff161015610b365760408201805160010167ffffffffffffffff169081905260808301805164ffffffffff90811660608601528451169052610b2f908690610edc565b9050610b3e565b805460020281555b608082015182510364ffffffffff9081166000818152600184810160209081526040909220889055855101909216845264ffffffffff19851691840191909152610b888684610e86565b505050505050565b6000610b9b83610e26565b64ffffffffff19831660208201529050610bb58382610e86565b505050565b6000610bc583610e26565b9050610bb5828260200151856109839092919063ffffffff16565b600080610bec84610e26565b805190915064ffffffffff168310610c42576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b6000610c65826040015167ffffffffffffffff1686610edc90919063ffffffff16565b90506000610c8d836040015160010167ffffffffffffffff1687610edc90919063ffffffff16565b9050826080015164ffffffffff168510610d1a576080830151825464ffffffffff9091168603908110610cfe576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b6000908152600190920160205250604090205491506107fc9050565b6080830151606084015164ffffffffff9182168781039290911610610d7d576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b8154811115610dca576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b81540360009081526001909101602052604090205492506107fc915050565b6000610df483610e26565b9050610bb582826020015185610a899092919063ffffffff16565b600080610e1b83610e26565b602001519392505050565b610e2e610efc565b5080546001909101546040805160a08101825264ffffffffff808516825264ffffffffff19909416602082015267ffffffffffffffff8316818301529082901c8316606082015260689190911c909116608082015290565b80516020820151604080840151606085015160808601518754858717969483901b8417606883901b1795939291908714610ebe578689555b85896001015414610ed157600189018690555b505050505050505050565b60006002820615610ef05782600401610ef5565b826002015b9392505050565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101919091529056fe4f564d5f436861696e53746f72616765436f6e7461696e65723a2046756e6374696f6e2063616e206f6e6c792062652063616c6c656420627920746865206f776e65722ea2646970667358221220376cbc00341dd082d644157f6511fcd1ac26a6a924d04ae6532cfcab93d9191864736f6c63430007060033",
"devdoc": {
"details": "The Chain Storage Container provides its owner contract with read, write and delete functionality. This provides gas efficiency gains by enabling it to overwrite storage slots which can no longer be used in a fraud proof due to the fraud window having passed, and the associated chain state or transactions being finalized. Three distinct Chain Storage Containers will be deployed on Layer 1: 1. Stores transaction batches for the Canonical Transaction Chain 2. Stores queued transactions for the Canonical Transaction Chain 3. Stores chain state batches for the State Commitment Chain Compiler used: solc Runtime target: EVM",
"kind": "dev",
"methods": {
"constructor": {
"params": {
"_libAddressManager": "Address of the Address Manager.",
"_owner": "Name of the contract that owns this container (will be resolved later)."
}
},
"deleteElementsAfterInclusive(uint256)": {
"params": {
"_index": "Object index to delete from."
}
},
"deleteElementsAfterInclusive(uint256,bytes27)": {
"params": {
"_globalMetadata": "New global metadata for the container.",
"_index": "Object index to delete from."
}
},
"get(uint256)": {
"params": {
"_index": "Index of the particular object to access."
},
"returns": {
"_0": "32 byte object value."
}
},
"getGlobalMetadata()": {
"returns": {
"_0": "Container global metadata field."
}
},
"length()": {
"returns": {
"_0": "Number of objects in the container."
}
},
"push(bytes32)": {
"params": {
"_object": "A 32 byte value to insert into the container."
}
},
"push(bytes32,bytes27)": {
"params": {
"_globalMetadata": "New global metadata for the container.",
"_object": "A 32 byte value to insert into the container."
}
},
"resolve(string)": {
"params": {
"_name": "Name to resolve an address for."
},
"returns": {
"_0": "Address associated with the given name."
}
},
"setGlobalMetadata(bytes27)": {
"params": {
"_globalMetadata": "New global metadata to set."
}
}
},
"title": "OVM_ChainStorageContainer",
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {
"deleteElementsAfterInclusive(uint256)": {
"notice": "Removes all objects after and including a given index."
},
"deleteElementsAfterInclusive(uint256,bytes27)": {
"notice": "Removes all objects after and including a given index. Also allows setting the global metadata field."
},
"get(uint256)": {
"notice": "Retrieves an object from the container."
},
"getGlobalMetadata()": {
"notice": "Retrieves the container's global metadata field."
},
"length()": {
"notice": "Retrieves the number of objects stored in the container."
},
"push(bytes32)": {
"notice": "Pushes an object into the container."
},
"push(bytes32,bytes27)": {
"notice": "Pushes an object into the container. Function allows setting the global metadata since we'll need to touch the \"length\" storage slot anyway, which also contains the global metadata (it's an optimization)."
},
"resolve(string)": {
"notice": "Resolves the address associated with a given name."
},
"setGlobalMetadata(bytes27)": {
"notice": "Sets the container's global metadata field. We're using `bytes27` here because we use five bytes to maintain the length of the underlying data structure, meaning we have an extra 27 bytes to store arbitrary data."
},
"setNextOverwritableIndex(uint256)": {
"notice": "Marks an index as overwritable, meaing the underlying buffer can start to write values over any objects before and including the given index."
}
},
"version": 1
},
"storageLayout": {
"storage": [
{
"astId": 12800,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "libAddressManager",
"offset": 0,
"slot": "0",
"type": "t_contract(Lib_AddressManager)12793"
},
{
"astId": 4466,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "owner",
"offset": 0,
"slot": "1",
"type": "t_string_storage"
},
{
"astId": 4468,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "buffer",
"offset": 0,
"slot": "2",
"type": "t_struct(RingBuffer)17846_storage"
}
],
"types": {
"t_bytes32": {
"encoding": "inplace",
"label": "bytes32",
"numberOfBytes": "32"
},
"t_contract(Lib_AddressManager)12793": {
"encoding": "inplace",
"label": "contract Lib_AddressManager",
"numberOfBytes": "20"
},
"t_mapping(t_uint256,t_bytes32)": {
"encoding": "mapping",
"key": "t_uint256",
"label": "mapping(uint256 => bytes32)",
"numberOfBytes": "32",
"value": "t_bytes32"
},
"t_string_storage": {
"encoding": "bytes",
"label": "string",
"numberOfBytes": "32"
},
"t_struct(Buffer)17835_storage": {
"encoding": "inplace",
"label": "struct Lib_RingBuffer.Buffer",
"members": [
{
"astId": 17830,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "length",
"offset": 0,
"slot": "0",
"type": "t_uint256"
},
{
"astId": 17834,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "buf",
"offset": 0,
"slot": "1",
"type": "t_mapping(t_uint256,t_bytes32)"
}
],
"numberOfBytes": "64"
},
"t_struct(RingBuffer)17846_storage": {
"encoding": "inplace",
"label": "struct Lib_RingBuffer.RingBuffer",
"members": [
{
"astId": 17837,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "contextA",
"offset": 0,
"slot": "0",
"type": "t_bytes32"
},
{
"astId": 17839,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "contextB",
"offset": 0,
"slot": "1",
"type": "t_bytes32"
},
{
"astId": 17841,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "bufferA",
"offset": 0,
"slot": "2",
"type": "t_struct(Buffer)17835_storage"
},
{
"astId": 17843,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "bufferB",
"offset": 0,
"slot": "4",
"type": "t_struct(Buffer)17835_storage"
},
{
"astId": 17845,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "nextOverwritableIndex",
"offset": 0,
"slot": "6",
"type": "t_uint256"
}
],
"numberOfBytes": "224"
},
"t_uint256": {
"encoding": "inplace",
"label": "uint256",
"numberOfBytes": "32"
}
}
}
}
\ No newline at end of file
{
"address": "0x207fa9Aa7Dee9AA790A8DF64778D3E3B6273BC90",
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "_libAddressManager",
"type": "address"
},
{
"internalType": "string",
"name": "_owner",
"type": "string"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_index",
"type": "uint256"
},
{
"internalType": "bytes27",
"name": "_globalMetadata",
"type": "bytes27"
}
],
"name": "deleteElementsAfterInclusive",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_index",
"type": "uint256"
}
],
"name": "deleteElementsAfterInclusive",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_index",
"type": "uint256"
}
],
"name": "get",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getGlobalMetadata",
"outputs": [
{
"internalType": "bytes27",
"name": "",
"type": "bytes27"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "length",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "libAddressManager",
"outputs": [
{
"internalType": "contract Lib_AddressManager",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "_object",
"type": "bytes32"
},
{
"internalType": "bytes27",
"name": "_globalMetadata",
"type": "bytes27"
}
],
"name": "push",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "_object",
"type": "bytes32"
}
],
"name": "push",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "_name",
"type": "string"
}
],
"name": "resolve",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes27",
"name": "_globalMetadata",
"type": "bytes27"
}
],
"name": "setGlobalMetadata",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_index",
"type": "uint256"
}
],
"name": "setNextOverwritableIndex",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"transactionHash": "0x131733524a44e43d5ae59ec1eba4fe60c893da9cc9f38e501d35a5b3c8cf1310",
"receipt": {
"to": null,
"from": "0x18394B52d3Cb931dfA76F63251919D051953413d",
"contractAddress": "0x207fa9Aa7Dee9AA790A8DF64778D3E3B6273BC90",
"transactionIndex": 1,
"gasUsed": "968390",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blockHash": "0x3f742457c998e215c0a89528d46d770ba3f2c9d49f791673bc07501ede825f8d",
"transactionHash": "0x131733524a44e43d5ae59ec1eba4fe60c893da9cc9f38e501d35a5b3c8cf1310",
"logs": [],
"blockNumber": 24572792,
"cumulativeGasUsed": "1010846",
"status": 1,
"byzantium": true
},
"args": [
"0xd56F695e73286ac252A37593DD4E7c14270eC1Df",
"OVM_CanonicalTransactionChain"
],
"solcInputHash": "5ee8e508e2c54cb5ac6783b4855b1558",
"metadata": "{\"compiler\":{\"version\":\"0.7.6+commit.7338295f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_libAddressManager\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_owner\",\"type\":\"string\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_index\",\"type\":\"uint256\"},{\"internalType\":\"bytes27\",\"name\":\"_globalMetadata\",\"type\":\"bytes27\"}],\"name\":\"deleteElementsAfterInclusive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_index\",\"type\":\"uint256\"}],\"name\":\"deleteElementsAfterInclusive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_index\",\"type\":\"uint256\"}],\"name\":\"get\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getGlobalMetadata\",\"outputs\":[{\"internalType\":\"bytes27\",\"name\":\"\",\"type\":\"bytes27\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"length\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"libAddressManager\",\"outputs\":[{\"internalType\":\"contract Lib_AddressManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_object\",\"type\":\"bytes32\"},{\"internalType\":\"bytes27\",\"name\":\"_globalMetadata\",\"type\":\"bytes27\"}],\"name\":\"push\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_object\",\"type\":\"bytes32\"}],\"name\":\"push\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes27\",\"name\":\"_globalMetadata\",\"type\":\"bytes27\"}],\"name\":\"setGlobalMetadata\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_index\",\"type\":\"uint256\"}],\"name\":\"setNextOverwritableIndex\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"The Chain Storage Container provides its owner contract with read, write and delete functionality. This provides gas efficiency gains by enabling it to overwrite storage slots which can no longer be used in a fraud proof due to the fraud window having passed, and the associated chain state or transactions being finalized. Three distinct Chain Storage Containers will be deployed on Layer 1: 1. Stores transaction batches for the Canonical Transaction Chain 2. Stores queued transactions for the Canonical Transaction Chain 3. Stores chain state batches for the State Commitment Chain Compiler used: solc Runtime target: EVM\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"params\":{\"_libAddressManager\":\"Address of the Address Manager.\",\"_owner\":\"Name of the contract that owns this container (will be resolved later).\"}},\"deleteElementsAfterInclusive(uint256)\":{\"params\":{\"_index\":\"Object index to delete from.\"}},\"deleteElementsAfterInclusive(uint256,bytes27)\":{\"params\":{\"_globalMetadata\":\"New global metadata for the container.\",\"_index\":\"Object index to delete from.\"}},\"get(uint256)\":{\"params\":{\"_index\":\"Index of the particular object to access.\"},\"returns\":{\"_0\":\"32 byte object value.\"}},\"getGlobalMetadata()\":{\"returns\":{\"_0\":\"Container global metadata field.\"}},\"length()\":{\"returns\":{\"_0\":\"Number of objects in the container.\"}},\"push(bytes32)\":{\"params\":{\"_object\":\"A 32 byte value to insert into the container.\"}},\"push(bytes32,bytes27)\":{\"params\":{\"_globalMetadata\":\"New global metadata for the container.\",\"_object\":\"A 32 byte value to insert into the container.\"}},\"resolve(string)\":{\"params\":{\"_name\":\"Name to resolve an address for.\"},\"returns\":{\"_0\":\"Address associated with the given name.\"}},\"setGlobalMetadata(bytes27)\":{\"params\":{\"_globalMetadata\":\"New global metadata to set.\"}}},\"title\":\"OVM_ChainStorageContainer\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"deleteElementsAfterInclusive(uint256)\":{\"notice\":\"Removes all objects after and including a given index.\"},\"deleteElementsAfterInclusive(uint256,bytes27)\":{\"notice\":\"Removes all objects after and including a given index. Also allows setting the global metadata field.\"},\"get(uint256)\":{\"notice\":\"Retrieves an object from the container.\"},\"getGlobalMetadata()\":{\"notice\":\"Retrieves the container's global metadata field.\"},\"length()\":{\"notice\":\"Retrieves the number of objects stored in the container.\"},\"push(bytes32)\":{\"notice\":\"Pushes an object into the container.\"},\"push(bytes32,bytes27)\":{\"notice\":\"Pushes an object into the container. Function allows setting the global metadata since we'll need to touch the \\\"length\\\" storage slot anyway, which also contains the global metadata (it's an optimization).\"},\"resolve(string)\":{\"notice\":\"Resolves the address associated with a given name.\"},\"setGlobalMetadata(bytes27)\":{\"notice\":\"Sets the container's global metadata field. We're using `bytes27` here because we use five bytes to maintain the length of the underlying data structure, meaning we have an extra 27 bytes to store arbitrary data.\"},\"setNextOverwritableIndex(uint256)\":{\"notice\":\"Marks an index as overwritable, meaing the underlying buffer can start to write values over any objects before and including the given index.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol\":\"OVM_ChainStorageContainer\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor () internal {\\n address msgSender = _msgSender();\\n _owner = msgSender;\\n emit OwnershipTransferred(address(0), msgSender);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x15e2d5bd4c28a88548074c54d220e8086f638a71ed07e6b3ba5a70066fcf458d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with GSN meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address payable) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes memory) {\\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x8d3cb350f04ff49cfb10aef08d87f19dcbaecc8027b0bed12f3275cd12f38cf0\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* Library Imports */\\nimport { Lib_RingBuffer } from \\\"../../libraries/utils/Lib_RingBuffer.sol\\\";\\nimport { Lib_AddressResolver } from \\\"../../libraries/resolver/Lib_AddressResolver.sol\\\";\\n\\n/* Interface Imports */\\nimport { iOVM_ChainStorageContainer } from \\\"../../iOVM/chain/iOVM_ChainStorageContainer.sol\\\";\\n\\n/**\\n * @title OVM_ChainStorageContainer\\n * @dev The Chain Storage Container provides its owner contract with read, write and delete functionality.\\n * This provides gas efficiency gains by enabling it to overwrite storage slots which can no longer be used\\n * in a fraud proof due to the fraud window having passed, and the associated chain state or\\n * transactions being finalized.\\n * Three distinct Chain Storage Containers will be deployed on Layer 1:\\n * 1. Stores transaction batches for the Canonical Transaction Chain\\n * 2. Stores queued transactions for the Canonical Transaction Chain\\n * 3. Stores chain state batches for the State Commitment Chain\\n *\\n * Compiler used: solc\\n * Runtime target: EVM\\n */\\ncontract OVM_ChainStorageContainer is iOVM_ChainStorageContainer, Lib_AddressResolver {\\n\\n /*************\\n * Libraries *\\n *************/\\n\\n using Lib_RingBuffer for Lib_RingBuffer.RingBuffer;\\n\\n\\n /*************\\n * Variables *\\n *************/\\n\\n string public owner;\\n Lib_RingBuffer.RingBuffer internal buffer;\\n\\n\\n /***************\\n * Constructor *\\n ***************/\\n\\n /**\\n * @param _libAddressManager Address of the Address Manager.\\n * @param _owner Name of the contract that owns this container (will be resolved later).\\n */\\n constructor(\\n address _libAddressManager,\\n string memory _owner\\n )\\n Lib_AddressResolver(_libAddressManager)\\n {\\n owner = _owner;\\n }\\n\\n\\n /**********************\\n * Function Modifiers *\\n **********************/\\n\\n modifier onlyOwner() {\\n require(\\n msg.sender == resolve(owner),\\n \\\"OVM_ChainStorageContainer: Function can only be called by the owner.\\\"\\n );\\n _;\\n }\\n\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function setGlobalMetadata(\\n bytes27 _globalMetadata\\n )\\n override\\n public\\n onlyOwner\\n {\\n return buffer.setExtraData(_globalMetadata);\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function getGlobalMetadata()\\n override\\n public\\n view\\n returns (\\n bytes27\\n )\\n {\\n return buffer.getExtraData();\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function length()\\n override\\n public\\n view\\n returns (\\n uint256\\n )\\n {\\n return uint256(buffer.getLength());\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function push(\\n bytes32 _object\\n )\\n override\\n public\\n onlyOwner\\n {\\n buffer.push(_object);\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function push(\\n bytes32 _object,\\n bytes27 _globalMetadata\\n )\\n override\\n public\\n onlyOwner\\n {\\n buffer.push(_object, _globalMetadata);\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function get(\\n uint256 _index\\n )\\n override\\n public\\n view\\n returns (\\n bytes32\\n )\\n {\\n return buffer.get(uint40(_index));\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function deleteElementsAfterInclusive(\\n uint256 _index\\n )\\n override\\n public\\n onlyOwner\\n {\\n buffer.deleteElementsAfterInclusive(\\n uint40(_index)\\n );\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function deleteElementsAfterInclusive(\\n uint256 _index,\\n bytes27 _globalMetadata\\n )\\n override\\n public\\n onlyOwner\\n {\\n buffer.deleteElementsAfterInclusive(\\n uint40(_index),\\n _globalMetadata\\n );\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function setNextOverwritableIndex(\\n uint256 _index\\n )\\n override\\n public\\n onlyOwner\\n {\\n buffer.nextOverwritableIndex = _index;\\n }\\n}\\n\",\"keccak256\":\"0x93325c961516aa2a22bf1aacf4029353d5e3b693e04b485753170337b50224e6\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/iOVM/chain/iOVM_ChainStorageContainer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/**\\n * @title iOVM_ChainStorageContainer\\n */\\ninterface iOVM_ChainStorageContainer {\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Sets the container's global metadata field. We're using `bytes27` here because we use five\\n * bytes to maintain the length of the underlying data structure, meaning we have an extra\\n * 27 bytes to store arbitrary data.\\n * @param _globalMetadata New global metadata to set.\\n */\\n function setGlobalMetadata(\\n bytes27 _globalMetadata\\n )\\n external;\\n\\n /**\\n * Retrieves the container's global metadata field.\\n * @return Container global metadata field.\\n */\\n function getGlobalMetadata()\\n external\\n view\\n returns (\\n bytes27\\n );\\n\\n /**\\n * Retrieves the number of objects stored in the container.\\n * @return Number of objects in the container.\\n */\\n function length()\\n external\\n view\\n returns (\\n uint256\\n );\\n\\n /**\\n * Pushes an object into the container.\\n * @param _object A 32 byte value to insert into the container.\\n */\\n function push(\\n bytes32 _object\\n )\\n external;\\n\\n /**\\n * Pushes an object into the container. Function allows setting the global metadata since\\n * we'll need to touch the \\\"length\\\" storage slot anyway, which also contains the global\\n * metadata (it's an optimization).\\n * @param _object A 32 byte value to insert into the container.\\n * @param _globalMetadata New global metadata for the container.\\n */\\n function push(\\n bytes32 _object,\\n bytes27 _globalMetadata\\n )\\n external;\\n\\n /**\\n * Retrieves an object from the container.\\n * @param _index Index of the particular object to access.\\n * @return 32 byte object value.\\n */\\n function get(\\n uint256 _index\\n )\\n external\\n view\\n returns (\\n bytes32\\n );\\n\\n /**\\n * Removes all objects after and including a given index.\\n * @param _index Object index to delete from.\\n */\\n function deleteElementsAfterInclusive(\\n uint256 _index\\n )\\n external;\\n\\n /**\\n * Removes all objects after and including a given index. Also allows setting the global\\n * metadata field.\\n * @param _index Object index to delete from.\\n * @param _globalMetadata New global metadata for the container.\\n */\\n function deleteElementsAfterInclusive(\\n uint256 _index,\\n bytes27 _globalMetadata\\n )\\n external;\\n\\n /**\\n * Marks an index as overwritable, meaing the underlying buffer can start to write values over\\n * any objects before and including the given index.\\n */\\n function setNextOverwritableIndex(\\n uint256 _index\\n )\\n external;\\n}\\n\",\"keccak256\":\"0x2d7973a0ad84c23ec62624d3f1e3aeb198cc72686ff1e6cfa17155556b320c94\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* External Imports */\\nimport { Ownable } from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\n/**\\n * @title Lib_AddressManager\\n */\\ncontract Lib_AddressManager is Ownable {\\n\\n /**********\\n * Events *\\n **********/\\n\\n event AddressSet(\\n string _name,\\n address _newAddress\\n );\\n\\n\\n /*************\\n * Variables *\\n *************/\\n\\n mapping (bytes32 => address) private addresses;\\n\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Changes the address associated with a particular name.\\n * @param _name String name to associate an address with.\\n * @param _address Address to associate with the name.\\n */\\n function setAddress(\\n string memory _name,\\n address _address\\n )\\n public\\n onlyOwner\\n {\\n addresses[_getNameHash(_name)] = _address;\\n\\n emit AddressSet(\\n _name,\\n _address\\n );\\n }\\n\\n /**\\n * Retrieves the address associated with a given name.\\n * @param _name Name to retrieve an address for.\\n * @return Address associated with the given name.\\n */\\n function getAddress(\\n string memory _name\\n )\\n public\\n view\\n returns (\\n address\\n )\\n {\\n return addresses[_getNameHash(_name)];\\n }\\n\\n\\n /**********************\\n * Internal Functions *\\n **********************/\\n\\n /**\\n * Computes the hash of a name.\\n * @param _name Name to compute a hash for.\\n * @return Hash of the given name.\\n */\\n function _getNameHash(\\n string memory _name\\n )\\n internal\\n pure\\n returns (\\n bytes32\\n )\\n {\\n return keccak256(abi.encodePacked(_name));\\n }\\n}\\n\",\"keccak256\":\"0x2ce671a0e004df88b136bea5a3c59d0732cea8887c8496da1d509e0200b03d7d\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/resolver/Lib_AddressResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* Library Imports */\\nimport { Lib_AddressManager } from \\\"./Lib_AddressManager.sol\\\";\\n\\n/**\\n * @title Lib_AddressResolver\\n */\\nabstract contract Lib_AddressResolver {\\n\\n /*************\\n * Variables *\\n *************/\\n\\n Lib_AddressManager public libAddressManager;\\n\\n\\n /***************\\n * Constructor *\\n ***************/\\n\\n /**\\n * @param _libAddressManager Address of the Lib_AddressManager.\\n */\\n constructor(\\n address _libAddressManager\\n ) {\\n libAddressManager = Lib_AddressManager(_libAddressManager);\\n }\\n\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Resolves the address associated with a given name.\\n * @param _name Name to resolve an address for.\\n * @return Address associated with the given name.\\n */\\n function resolve(\\n string memory _name\\n )\\n public\\n view\\n returns (\\n address\\n )\\n {\\n return libAddressManager.getAddress(_name);\\n }\\n}\\n\",\"keccak256\":\"0x65981feeabff6a81783ea97d44baf988a18a86c8cb374c46fdb71819cbacc7c0\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/utils/Lib_RingBuffer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\nlibrary Lib_RingBuffer {\\n using Lib_RingBuffer for RingBuffer;\\n\\n /***********\\n * Structs *\\n ***********/\\n\\n struct Buffer {\\n uint256 length;\\n mapping (uint256 => bytes32) buf;\\n }\\n\\n struct RingBuffer {\\n bytes32 contextA;\\n bytes32 contextB;\\n Buffer bufferA;\\n Buffer bufferB;\\n uint256 nextOverwritableIndex;\\n }\\n\\n struct RingBufferContext {\\n // contextA\\n uint40 globalIndex;\\n bytes27 extraData;\\n\\n // contextB\\n uint64 currBufferIndex;\\n uint40 prevResetIndex;\\n uint40 currResetIndex;\\n }\\n\\n\\n /*************\\n * Constants *\\n *************/\\n\\n uint256 constant MIN_CAPACITY = 16;\\n\\n\\n /**********************\\n * Internal Functions *\\n **********************/\\n\\n /**\\n * Pushes a single element to the buffer.\\n * @param _self Buffer to access.\\n * @param _value Value to push to the buffer.\\n * @param _extraData Optional global extra data.\\n */\\n function push(\\n RingBuffer storage _self,\\n bytes32 _value,\\n bytes27 _extraData\\n )\\n internal\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n Buffer storage currBuffer = _self.getBuffer(ctx.currBufferIndex);\\n\\n // Set a minimum capacity.\\n if (currBuffer.length == 0) {\\n currBuffer.length = MIN_CAPACITY;\\n }\\n\\n // Check if we need to expand the buffer.\\n if (ctx.globalIndex - ctx.currResetIndex >= currBuffer.length) {\\n if (ctx.currResetIndex < _self.nextOverwritableIndex) {\\n // We're going to overwrite the inactive buffer.\\n // Bump the buffer index, reset the delete offset, and set our reset indices.\\n ctx.currBufferIndex++;\\n ctx.prevResetIndex = ctx.currResetIndex;\\n ctx.currResetIndex = ctx.globalIndex;\\n\\n // Swap over to the next buffer.\\n currBuffer = _self.getBuffer(ctx.currBufferIndex);\\n } else {\\n // We're not overwriting yet, double the length of the current buffer.\\n currBuffer.length *= 2;\\n }\\n }\\n\\n // Index to write to is the difference of the global and reset indices.\\n uint256 writeHead = ctx.globalIndex - ctx.currResetIndex;\\n currBuffer.buf[writeHead] = _value;\\n\\n // Bump the global index and insert our extra data, then save the context.\\n ctx.globalIndex++;\\n ctx.extraData = _extraData;\\n _self.setContext(ctx);\\n }\\n\\n /**\\n * Pushes a single element to the buffer.\\n * @param _self Buffer to access.\\n * @param _value Value to push to the buffer.\\n */\\n function push(\\n RingBuffer storage _self,\\n bytes32 _value\\n )\\n internal\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n\\n _self.push(\\n _value,\\n ctx.extraData\\n );\\n }\\n\\n /**\\n * Retrieves an element from the buffer.\\n * @param _self Buffer to access.\\n * @param _index Element index to retrieve.\\n * @return Value of the element at the given index.\\n */\\n function get(\\n RingBuffer storage _self,\\n uint256 _index\\n )\\n internal\\n view\\n returns (\\n bytes32\\n )\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n\\n require(\\n _index < ctx.globalIndex,\\n \\\"Index out of bounds.\\\"\\n );\\n\\n Buffer storage currBuffer = _self.getBuffer(ctx.currBufferIndex);\\n Buffer storage prevBuffer = _self.getBuffer(ctx.currBufferIndex + 1);\\n\\n if (_index >= ctx.currResetIndex) {\\n // We're trying to load an element from the current buffer.\\n // Relative index is just the difference from the reset index.\\n uint256 relativeIndex = _index - ctx.currResetIndex;\\n\\n // Shouldn't happen but why not check.\\n require(\\n relativeIndex < currBuffer.length,\\n \\\"Index out of bounds.\\\"\\n );\\n\\n return currBuffer.buf[relativeIndex];\\n } else {\\n // We're trying to load an element from the previous buffer.\\n // Relative index is the difference from the reset index in the other direction.\\n uint256 relativeIndex = ctx.currResetIndex - _index;\\n\\n // Condition only fails in the case that we deleted and flipped buffers.\\n require(\\n ctx.currResetIndex > ctx.prevResetIndex,\\n \\\"Index out of bounds.\\\"\\n );\\n\\n // Make sure we're not trying to read beyond the array.\\n require(\\n relativeIndex <= prevBuffer.length,\\n \\\"Index out of bounds.\\\"\\n );\\n\\n return prevBuffer.buf[prevBuffer.length - relativeIndex];\\n }\\n }\\n\\n /**\\n * Deletes all elements after (and including) a given index.\\n * @param _self Buffer to access.\\n * @param _index Index of the element to delete from (inclusive).\\n * @param _extraData Optional global extra data.\\n */\\n function deleteElementsAfterInclusive(\\n RingBuffer storage _self,\\n uint40 _index,\\n bytes27 _extraData\\n )\\n internal\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n\\n require(\\n _index < ctx.globalIndex && _index >= ctx.prevResetIndex,\\n \\\"Index out of bounds.\\\"\\n );\\n\\n if (_index < ctx.currResetIndex) {\\n // We're switching back to the previous buffer.\\n // Reduce the buffer index, set the current reset index back to match the previous one.\\n // We use the equality of these two values to prevent reading beyond this buffer.\\n ctx.currBufferIndex--;\\n ctx.currResetIndex = ctx.prevResetIndex;\\n }\\n\\n // Set our global index and extra data, save the context.\\n ctx.globalIndex = _index;\\n ctx.extraData = _extraData;\\n _self.setContext(ctx);\\n }\\n\\n /**\\n * Deletes all elements after (and including) a given index.\\n * @param _self Buffer to access.\\n * @param _index Index of the element to delete from (inclusive).\\n */\\n function deleteElementsAfterInclusive(\\n RingBuffer storage _self,\\n uint40 _index\\n )\\n internal\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n _self.deleteElementsAfterInclusive(\\n _index,\\n ctx.extraData\\n );\\n }\\n\\n /**\\n * Retrieves the current global index.\\n * @param _self Buffer to access.\\n * @return Current global index.\\n */\\n function getLength(\\n RingBuffer storage _self\\n )\\n internal\\n view\\n returns (\\n uint40\\n )\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n return ctx.globalIndex;\\n }\\n\\n /**\\n * Changes current global extra data.\\n * @param _self Buffer to access.\\n * @param _extraData New global extra data.\\n */\\n function setExtraData(\\n RingBuffer storage _self,\\n bytes27 _extraData\\n )\\n internal\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n ctx.extraData = _extraData;\\n _self.setContext(ctx);\\n }\\n\\n /**\\n * Retrieves the current global extra data.\\n * @param _self Buffer to access.\\n * @return Current global extra data.\\n */\\n function getExtraData(\\n RingBuffer storage _self\\n )\\n internal\\n view\\n returns (\\n bytes27\\n )\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n return ctx.extraData;\\n }\\n\\n /**\\n * Sets the current ring buffer context.\\n * @param _self Buffer to access.\\n * @param _ctx Current ring buffer context.\\n */\\n function setContext(\\n RingBuffer storage _self,\\n RingBufferContext memory _ctx\\n )\\n internal\\n {\\n bytes32 contextA;\\n bytes32 contextB;\\n\\n uint40 globalIndex = _ctx.globalIndex;\\n bytes27 extraData = _ctx.extraData;\\n assembly {\\n contextA := globalIndex\\n contextA := or(contextA, extraData)\\n }\\n\\n uint64 currBufferIndex = _ctx.currBufferIndex;\\n uint40 prevResetIndex = _ctx.prevResetIndex;\\n uint40 currResetIndex = _ctx.currResetIndex;\\n assembly {\\n contextB := currBufferIndex\\n contextB := or(contextB, shl(64, prevResetIndex))\\n contextB := or(contextB, shl(104, currResetIndex))\\n }\\n\\n if (_self.contextA != contextA) {\\n _self.contextA = contextA;\\n }\\n\\n if (_self.contextB != contextB) {\\n _self.contextB = contextB;\\n }\\n }\\n\\n /**\\n * Retrieves the current ring buffer context.\\n * @param _self Buffer to access.\\n * @return Current ring buffer context.\\n */\\n function getContext(\\n RingBuffer storage _self\\n )\\n internal\\n view\\n returns (\\n RingBufferContext memory\\n )\\n {\\n bytes32 contextA = _self.contextA;\\n bytes32 contextB = _self.contextB;\\n\\n uint40 globalIndex;\\n bytes27 extraData;\\n assembly {\\n globalIndex := and(contextA, 0x000000000000000000000000000000000000000000000000000000FFFFFFFFFF)\\n extraData := and(contextA, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000)\\n }\\n\\n uint64 currBufferIndex;\\n uint40 prevResetIndex;\\n uint40 currResetIndex;\\n assembly {\\n currBufferIndex := and(contextB, 0x000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFF)\\n prevResetIndex := shr(64, and(contextB, 0x00000000000000000000000000000000000000FFFFFFFFFF0000000000000000))\\n currResetIndex := shr(104, and(contextB, 0x0000000000000000000000000000FFFFFFFFFF00000000000000000000000000))\\n }\\n\\n return RingBufferContext({\\n globalIndex: globalIndex,\\n extraData: extraData,\\n currBufferIndex: currBufferIndex,\\n prevResetIndex: prevResetIndex,\\n currResetIndex: currResetIndex\\n });\\n }\\n\\n /**\\n * Retrieves the a buffer from the ring buffer by index.\\n * @param _self Buffer to access.\\n * @param _which Index of the sub buffer to access.\\n * @return Sub buffer for the index.\\n */\\n function getBuffer(\\n RingBuffer storage _self,\\n uint256 _which\\n )\\n internal\\n view\\n returns (\\n Buffer storage\\n )\\n {\\n return _which % 2 == 0 ? _self.bufferA : _self.bufferB;\\n }\\n}\\n\",\"keccak256\":\"0xe30fc56d4499f98582e1f800dfa3b343f171163a557266c31a56449d5fd3ffae\",\"license\":\"MIT\"}},\"version\":1}",
"bytecode": "0x60806040523480156200001157600080fd5b506040516200118d3803806200118d833981810160405260408110156200003757600080fd5b8151602083018051604051929492938301929190846401000000008211156200005f57600080fd5b9083019060208201858111156200007557600080fd5b82516401000000008111828201881017156200009057600080fd5b82525081516020918201929091019080838360005b83811015620000bf578181015183820152602001620000a5565b50505050905090810190601f168015620000ed5780820380516001836020036101000a031916815260200191505b506040525050600080546001600160a01b0319166001600160a01b038516179055508051620001249060019060208401906200012d565b505050620001d9565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282620001655760008555620001b0565b82601f106200018057805160ff1916838001178555620001b0565b82800160010185558215620001b0579182015b82811115620001b057825182559160200191906001019062000193565b50620001be929150620001c2565b5090565b5b80821115620001be5760008155600101620001c3565b610fa480620001e96000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c80634651d91e116100715780634651d91e1461021a5780638da5cb5b146102375780639507d39a146102b4578063b298e36b146102d1578063ccf8f969146102ee578063fa9e936c14610311576100b4565b8063167fd681146100b95780631f7b6d32146100e65780632015276c1461010057806329061de21461012b578063299ca47814610150578063461a447814610174575b600080fd5b6100e4600480360360408110156100cf57600080fd5b508035906020013564ffffffffff191661032e565b005b6100ee610423565b60408051918252519081900360200190f35b6100e46004803603604081101561011657600080fd5b508035906020013564ffffffffff191661043b565b6100e46004803603602081101561014157600080fd5b503564ffffffffff19166104f7565b6101586105b5565b604080516001600160a01b039092168252519081900360200190f35b6101586004803603602081101561018a57600080fd5b8101906020810181356401000000008111156101a557600080fd5b8201836020820111156101b757600080fd5b803590602001918460018302840111640100000000831117156101d957600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506105c4945050505050565b6100e46004803603602081101561023057600080fd5b50356106a0565b61023f61075b565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610279578181015183820152602001610261565b50505050905090810190601f1680156102a65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6100ee600480360360208110156102ca57600080fd5b50356107e8565b6100e4600480360360208110156102e757600080fd5b5035610802565b6102f66108bd565b6040805164ffffffffff199092168252519081900360200190f35b6100e46004803603602081101561032757600080fd5b50356108ce565b60018054604080516020601f6002600019610100878916150201909516949094049384018190048102820181019092528281526103c493909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b820191906000526020600020905b81548152906001019060200180831161039d57829003601f168201915b50505050506105c4565b6001600160a01b0316336001600160a01b0316146104135760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b61041f60028383610983565b5050565b600061042f6002610a75565b64ffffffffff16905090565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261049c93909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146104eb5760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b61041f60028383610a89565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261055893909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146105a75760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b6105b2600282610b90565b50565b6000546001600160a01b031681565b6000805460405163bf40fac160e01b81526020600482018181528551602484015285516001600160a01b039094169363bf40fac19387938392604490920191908501908083838b5b8381101561062457818101518382015260200161060c565b50505050905090810190601f1680156106515780820380516001836020036101000a031916815260200191505b509250505060206040518083038186803b15801561066e57600080fd5b505afa158015610682573d6000803e3d6000fd5b505050506040513d602081101561069857600080fd5b505192915050565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261070193909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146107505760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b6105b2600282610bba565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156107e05780601f106107b5576101008083540402835291602001916107e0565b820191906000526020600020905b8154815290600101906020018083116107c357829003601f168201915b505050505081565b60006107fc600264ffffffffff8416610be0565b92915050565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261086393909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146108b25760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b6105b2600282610de9565b60006108c96002610e0f565b905090565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261092f93909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b03161461097e5760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b600855565b600061098e84610e26565b9050806000015164ffffffffff168364ffffffffff161080156109c35750806060015164ffffffffff168364ffffffffff1610155b610a0b576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b806080015164ffffffffff168364ffffffffff161015610a4d576040810180516000190167ffffffffffffffff169052606081015164ffffffffff1660808201525b64ffffffffff8316815264ffffffffff1982166020820152610a6f8482610e86565b50505050565b600080610a8183610e26565b519392505050565b6000610a9484610e26565b90506000610ab9826040015167ffffffffffffffff1686610edc90919063ffffffff16565b8054909150610ac757601081555b8054608083015183510364ffffffffff1610610b3e578460060154826080015164ffffffffff161015610b365760408201805160010167ffffffffffffffff169081905260808301805164ffffffffff90811660608601528451169052610b2f908690610edc565b9050610b3e565b805460020281555b608082015182510364ffffffffff9081166000818152600184810160209081526040909220889055855101909216845264ffffffffff19851691840191909152610b888684610e86565b505050505050565b6000610b9b83610e26565b64ffffffffff19831660208201529050610bb58382610e86565b505050565b6000610bc583610e26565b9050610bb5828260200151856109839092919063ffffffff16565b600080610bec84610e26565b805190915064ffffffffff168310610c42576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b6000610c65826040015167ffffffffffffffff1686610edc90919063ffffffff16565b90506000610c8d836040015160010167ffffffffffffffff1687610edc90919063ffffffff16565b9050826080015164ffffffffff168510610d1a576080830151825464ffffffffff9091168603908110610cfe576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b6000908152600190920160205250604090205491506107fc9050565b6080830151606084015164ffffffffff9182168781039290911610610d7d576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b8154811115610dca576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b81540360009081526001909101602052604090205492506107fc915050565b6000610df483610e26565b9050610bb582826020015185610a899092919063ffffffff16565b600080610e1b83610e26565b602001519392505050565b610e2e610efc565b5080546001909101546040805160a08101825264ffffffffff808516825264ffffffffff19909416602082015267ffffffffffffffff8316818301529082901c8316606082015260689190911c909116608082015290565b80516020820151604080840151606085015160808601518754858717969483901b8417606883901b1795939291908714610ebe578689555b85896001015414610ed157600189018690555b505050505050505050565b60006002820615610ef05782600401610ef5565b826002015b9392505050565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101919091529056fe4f564d5f436861696e53746f72616765436f6e7461696e65723a2046756e6374696f6e2063616e206f6e6c792062652063616c6c656420627920746865206f776e65722ea2646970667358221220376cbc00341dd082d644157f6511fcd1ac26a6a924d04ae6532cfcab93d9191864736f6c63430007060033",
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100b45760003560e01c80634651d91e116100715780634651d91e1461021a5780638da5cb5b146102375780639507d39a146102b4578063b298e36b146102d1578063ccf8f969146102ee578063fa9e936c14610311576100b4565b8063167fd681146100b95780631f7b6d32146100e65780632015276c1461010057806329061de21461012b578063299ca47814610150578063461a447814610174575b600080fd5b6100e4600480360360408110156100cf57600080fd5b508035906020013564ffffffffff191661032e565b005b6100ee610423565b60408051918252519081900360200190f35b6100e46004803603604081101561011657600080fd5b508035906020013564ffffffffff191661043b565b6100e46004803603602081101561014157600080fd5b503564ffffffffff19166104f7565b6101586105b5565b604080516001600160a01b039092168252519081900360200190f35b6101586004803603602081101561018a57600080fd5b8101906020810181356401000000008111156101a557600080fd5b8201836020820111156101b757600080fd5b803590602001918460018302840111640100000000831117156101d957600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506105c4945050505050565b6100e46004803603602081101561023057600080fd5b50356106a0565b61023f61075b565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610279578181015183820152602001610261565b50505050905090810190601f1680156102a65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6100ee600480360360208110156102ca57600080fd5b50356107e8565b6100e4600480360360208110156102e757600080fd5b5035610802565b6102f66108bd565b6040805164ffffffffff199092168252519081900360200190f35b6100e46004803603602081101561032757600080fd5b50356108ce565b60018054604080516020601f6002600019610100878916150201909516949094049384018190048102820181019092528281526103c493909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b820191906000526020600020905b81548152906001019060200180831161039d57829003601f168201915b50505050506105c4565b6001600160a01b0316336001600160a01b0316146104135760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b61041f60028383610983565b5050565b600061042f6002610a75565b64ffffffffff16905090565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261049c93909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146104eb5760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b61041f60028383610a89565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261055893909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146105a75760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b6105b2600282610b90565b50565b6000546001600160a01b031681565b6000805460405163bf40fac160e01b81526020600482018181528551602484015285516001600160a01b039094169363bf40fac19387938392604490920191908501908083838b5b8381101561062457818101518382015260200161060c565b50505050905090810190601f1680156106515780820380516001836020036101000a031916815260200191505b509250505060206040518083038186803b15801561066e57600080fd5b505afa158015610682573d6000803e3d6000fd5b505050506040513d602081101561069857600080fd5b505192915050565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261070193909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146107505760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b6105b2600282610bba565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156107e05780601f106107b5576101008083540402835291602001916107e0565b820191906000526020600020905b8154815290600101906020018083116107c357829003601f168201915b505050505081565b60006107fc600264ffffffffff8416610be0565b92915050565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261086393909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146108b25760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b6105b2600282610de9565b60006108c96002610e0f565b905090565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261092f93909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b03161461097e5760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b600855565b600061098e84610e26565b9050806000015164ffffffffff168364ffffffffff161080156109c35750806060015164ffffffffff168364ffffffffff1610155b610a0b576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b806080015164ffffffffff168364ffffffffff161015610a4d576040810180516000190167ffffffffffffffff169052606081015164ffffffffff1660808201525b64ffffffffff8316815264ffffffffff1982166020820152610a6f8482610e86565b50505050565b600080610a8183610e26565b519392505050565b6000610a9484610e26565b90506000610ab9826040015167ffffffffffffffff1686610edc90919063ffffffff16565b8054909150610ac757601081555b8054608083015183510364ffffffffff1610610b3e578460060154826080015164ffffffffff161015610b365760408201805160010167ffffffffffffffff169081905260808301805164ffffffffff90811660608601528451169052610b2f908690610edc565b9050610b3e565b805460020281555b608082015182510364ffffffffff9081166000818152600184810160209081526040909220889055855101909216845264ffffffffff19851691840191909152610b888684610e86565b505050505050565b6000610b9b83610e26565b64ffffffffff19831660208201529050610bb58382610e86565b505050565b6000610bc583610e26565b9050610bb5828260200151856109839092919063ffffffff16565b600080610bec84610e26565b805190915064ffffffffff168310610c42576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b6000610c65826040015167ffffffffffffffff1686610edc90919063ffffffff16565b90506000610c8d836040015160010167ffffffffffffffff1687610edc90919063ffffffff16565b9050826080015164ffffffffff168510610d1a576080830151825464ffffffffff9091168603908110610cfe576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b6000908152600190920160205250604090205491506107fc9050565b6080830151606084015164ffffffffff9182168781039290911610610d7d576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b8154811115610dca576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b81540360009081526001909101602052604090205492506107fc915050565b6000610df483610e26565b9050610bb582826020015185610a899092919063ffffffff16565b600080610e1b83610e26565b602001519392505050565b610e2e610efc565b5080546001909101546040805160a08101825264ffffffffff808516825264ffffffffff19909416602082015267ffffffffffffffff8316818301529082901c8316606082015260689190911c909116608082015290565b80516020820151604080840151606085015160808601518754858717969483901b8417606883901b1795939291908714610ebe578689555b85896001015414610ed157600189018690555b505050505050505050565b60006002820615610ef05782600401610ef5565b826002015b9392505050565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101919091529056fe4f564d5f436861696e53746f72616765436f6e7461696e65723a2046756e6374696f6e2063616e206f6e6c792062652063616c6c656420627920746865206f776e65722ea2646970667358221220376cbc00341dd082d644157f6511fcd1ac26a6a924d04ae6532cfcab93d9191864736f6c63430007060033",
"devdoc": {
"details": "The Chain Storage Container provides its owner contract with read, write and delete functionality. This provides gas efficiency gains by enabling it to overwrite storage slots which can no longer be used in a fraud proof due to the fraud window having passed, and the associated chain state or transactions being finalized. Three distinct Chain Storage Containers will be deployed on Layer 1: 1. Stores transaction batches for the Canonical Transaction Chain 2. Stores queued transactions for the Canonical Transaction Chain 3. Stores chain state batches for the State Commitment Chain Compiler used: solc Runtime target: EVM",
"kind": "dev",
"methods": {
"constructor": {
"params": {
"_libAddressManager": "Address of the Address Manager.",
"_owner": "Name of the contract that owns this container (will be resolved later)."
}
},
"deleteElementsAfterInclusive(uint256)": {
"params": {
"_index": "Object index to delete from."
}
},
"deleteElementsAfterInclusive(uint256,bytes27)": {
"params": {
"_globalMetadata": "New global metadata for the container.",
"_index": "Object index to delete from."
}
},
"get(uint256)": {
"params": {
"_index": "Index of the particular object to access."
},
"returns": {
"_0": "32 byte object value."
}
},
"getGlobalMetadata()": {
"returns": {
"_0": "Container global metadata field."
}
},
"length()": {
"returns": {
"_0": "Number of objects in the container."
}
},
"push(bytes32)": {
"params": {
"_object": "A 32 byte value to insert into the container."
}
},
"push(bytes32,bytes27)": {
"params": {
"_globalMetadata": "New global metadata for the container.",
"_object": "A 32 byte value to insert into the container."
}
},
"resolve(string)": {
"params": {
"_name": "Name to resolve an address for."
},
"returns": {
"_0": "Address associated with the given name."
}
},
"setGlobalMetadata(bytes27)": {
"params": {
"_globalMetadata": "New global metadata to set."
}
}
},
"title": "OVM_ChainStorageContainer",
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {
"deleteElementsAfterInclusive(uint256)": {
"notice": "Removes all objects after and including a given index."
},
"deleteElementsAfterInclusive(uint256,bytes27)": {
"notice": "Removes all objects after and including a given index. Also allows setting the global metadata field."
},
"get(uint256)": {
"notice": "Retrieves an object from the container."
},
"getGlobalMetadata()": {
"notice": "Retrieves the container's global metadata field."
},
"length()": {
"notice": "Retrieves the number of objects stored in the container."
},
"push(bytes32)": {
"notice": "Pushes an object into the container."
},
"push(bytes32,bytes27)": {
"notice": "Pushes an object into the container. Function allows setting the global metadata since we'll need to touch the \"length\" storage slot anyway, which also contains the global metadata (it's an optimization)."
},
"resolve(string)": {
"notice": "Resolves the address associated with a given name."
},
"setGlobalMetadata(bytes27)": {
"notice": "Sets the container's global metadata field. We're using `bytes27` here because we use five bytes to maintain the length of the underlying data structure, meaning we have an extra 27 bytes to store arbitrary data."
},
"setNextOverwritableIndex(uint256)": {
"notice": "Marks an index as overwritable, meaing the underlying buffer can start to write values over any objects before and including the given index."
}
},
"version": 1
},
"storageLayout": {
"storage": [
{
"astId": 12800,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "libAddressManager",
"offset": 0,
"slot": "0",
"type": "t_contract(Lib_AddressManager)12793"
},
{
"astId": 4466,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "owner",
"offset": 0,
"slot": "1",
"type": "t_string_storage"
},
{
"astId": 4468,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "buffer",
"offset": 0,
"slot": "2",
"type": "t_struct(RingBuffer)17846_storage"
}
],
"types": {
"t_bytes32": {
"encoding": "inplace",
"label": "bytes32",
"numberOfBytes": "32"
},
"t_contract(Lib_AddressManager)12793": {
"encoding": "inplace",
"label": "contract Lib_AddressManager",
"numberOfBytes": "20"
},
"t_mapping(t_uint256,t_bytes32)": {
"encoding": "mapping",
"key": "t_uint256",
"label": "mapping(uint256 => bytes32)",
"numberOfBytes": "32",
"value": "t_bytes32"
},
"t_string_storage": {
"encoding": "bytes",
"label": "string",
"numberOfBytes": "32"
},
"t_struct(Buffer)17835_storage": {
"encoding": "inplace",
"label": "struct Lib_RingBuffer.Buffer",
"members": [
{
"astId": 17830,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "length",
"offset": 0,
"slot": "0",
"type": "t_uint256"
},
{
"astId": 17834,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "buf",
"offset": 0,
"slot": "1",
"type": "t_mapping(t_uint256,t_bytes32)"
}
],
"numberOfBytes": "64"
},
"t_struct(RingBuffer)17846_storage": {
"encoding": "inplace",
"label": "struct Lib_RingBuffer.RingBuffer",
"members": [
{
"astId": 17837,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "contextA",
"offset": 0,
"slot": "0",
"type": "t_bytes32"
},
{
"astId": 17839,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "contextB",
"offset": 0,
"slot": "1",
"type": "t_bytes32"
},
{
"astId": 17841,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "bufferA",
"offset": 0,
"slot": "2",
"type": "t_struct(Buffer)17835_storage"
},
{
"astId": 17843,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "bufferB",
"offset": 0,
"slot": "4",
"type": "t_struct(Buffer)17835_storage"
},
{
"astId": 17845,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "nextOverwritableIndex",
"offset": 0,
"slot": "6",
"type": "t_uint256"
}
],
"numberOfBytes": "224"
},
"t_uint256": {
"encoding": "inplace",
"label": "uint256",
"numberOfBytes": "32"
}
}
}
}
\ No newline at end of file
{
"address": "0xFE1CE27173676A6850ECF4e0536D7C468A4dAfa0",
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "_libAddressManager",
"type": "address"
},
{
"internalType": "string",
"name": "_owner",
"type": "string"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_index",
"type": "uint256"
},
{
"internalType": "bytes27",
"name": "_globalMetadata",
"type": "bytes27"
}
],
"name": "deleteElementsAfterInclusive",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_index",
"type": "uint256"
}
],
"name": "deleteElementsAfterInclusive",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_index",
"type": "uint256"
}
],
"name": "get",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getGlobalMetadata",
"outputs": [
{
"internalType": "bytes27",
"name": "",
"type": "bytes27"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "length",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "libAddressManager",
"outputs": [
{
"internalType": "contract Lib_AddressManager",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "_object",
"type": "bytes32"
},
{
"internalType": "bytes27",
"name": "_globalMetadata",
"type": "bytes27"
}
],
"name": "push",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "_object",
"type": "bytes32"
}
],
"name": "push",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "_name",
"type": "string"
}
],
"name": "resolve",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes27",
"name": "_globalMetadata",
"type": "bytes27"
}
],
"name": "setGlobalMetadata",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_index",
"type": "uint256"
}
],
"name": "setNextOverwritableIndex",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"transactionHash": "0x9a6bad52721e26c2993afcc88ee94280ebde659d16dde1800520e2f23d8a993e",
"receipt": {
"to": null,
"from": "0x18394B52d3Cb931dfA76F63251919D051953413d",
"contractAddress": "0xFE1CE27173676A6850ECF4e0536D7C468A4dAfa0",
"transactionIndex": 2,
"gasUsed": "968330",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blockHash": "0x7f062788bcd72681fe2d1681ec3b1a30f6c5093d76e50ef210302436ee01a5d9",
"transactionHash": "0x9a6bad52721e26c2993afcc88ee94280ebde659d16dde1800520e2f23d8a993e",
"logs": [],
"blockNumber": 24572799,
"cumulativeGasUsed": "1044174",
"status": 1,
"byzantium": true
},
"args": [
"0xd56F695e73286ac252A37593DD4E7c14270eC1Df",
"OVM_StateCommitmentChain"
],
"solcInputHash": "5ee8e508e2c54cb5ac6783b4855b1558",
"metadata": "{\"compiler\":{\"version\":\"0.7.6+commit.7338295f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_libAddressManager\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_owner\",\"type\":\"string\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_index\",\"type\":\"uint256\"},{\"internalType\":\"bytes27\",\"name\":\"_globalMetadata\",\"type\":\"bytes27\"}],\"name\":\"deleteElementsAfterInclusive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_index\",\"type\":\"uint256\"}],\"name\":\"deleteElementsAfterInclusive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_index\",\"type\":\"uint256\"}],\"name\":\"get\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getGlobalMetadata\",\"outputs\":[{\"internalType\":\"bytes27\",\"name\":\"\",\"type\":\"bytes27\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"length\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"libAddressManager\",\"outputs\":[{\"internalType\":\"contract Lib_AddressManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_object\",\"type\":\"bytes32\"},{\"internalType\":\"bytes27\",\"name\":\"_globalMetadata\",\"type\":\"bytes27\"}],\"name\":\"push\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_object\",\"type\":\"bytes32\"}],\"name\":\"push\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes27\",\"name\":\"_globalMetadata\",\"type\":\"bytes27\"}],\"name\":\"setGlobalMetadata\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_index\",\"type\":\"uint256\"}],\"name\":\"setNextOverwritableIndex\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"The Chain Storage Container provides its owner contract with read, write and delete functionality. This provides gas efficiency gains by enabling it to overwrite storage slots which can no longer be used in a fraud proof due to the fraud window having passed, and the associated chain state or transactions being finalized. Three distinct Chain Storage Containers will be deployed on Layer 1: 1. Stores transaction batches for the Canonical Transaction Chain 2. Stores queued transactions for the Canonical Transaction Chain 3. Stores chain state batches for the State Commitment Chain Compiler used: solc Runtime target: EVM\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"params\":{\"_libAddressManager\":\"Address of the Address Manager.\",\"_owner\":\"Name of the contract that owns this container (will be resolved later).\"}},\"deleteElementsAfterInclusive(uint256)\":{\"params\":{\"_index\":\"Object index to delete from.\"}},\"deleteElementsAfterInclusive(uint256,bytes27)\":{\"params\":{\"_globalMetadata\":\"New global metadata for the container.\",\"_index\":\"Object index to delete from.\"}},\"get(uint256)\":{\"params\":{\"_index\":\"Index of the particular object to access.\"},\"returns\":{\"_0\":\"32 byte object value.\"}},\"getGlobalMetadata()\":{\"returns\":{\"_0\":\"Container global metadata field.\"}},\"length()\":{\"returns\":{\"_0\":\"Number of objects in the container.\"}},\"push(bytes32)\":{\"params\":{\"_object\":\"A 32 byte value to insert into the container.\"}},\"push(bytes32,bytes27)\":{\"params\":{\"_globalMetadata\":\"New global metadata for the container.\",\"_object\":\"A 32 byte value to insert into the container.\"}},\"resolve(string)\":{\"params\":{\"_name\":\"Name to resolve an address for.\"},\"returns\":{\"_0\":\"Address associated with the given name.\"}},\"setGlobalMetadata(bytes27)\":{\"params\":{\"_globalMetadata\":\"New global metadata to set.\"}}},\"title\":\"OVM_ChainStorageContainer\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"deleteElementsAfterInclusive(uint256)\":{\"notice\":\"Removes all objects after and including a given index.\"},\"deleteElementsAfterInclusive(uint256,bytes27)\":{\"notice\":\"Removes all objects after and including a given index. Also allows setting the global metadata field.\"},\"get(uint256)\":{\"notice\":\"Retrieves an object from the container.\"},\"getGlobalMetadata()\":{\"notice\":\"Retrieves the container's global metadata field.\"},\"length()\":{\"notice\":\"Retrieves the number of objects stored in the container.\"},\"push(bytes32)\":{\"notice\":\"Pushes an object into the container.\"},\"push(bytes32,bytes27)\":{\"notice\":\"Pushes an object into the container. Function allows setting the global metadata since we'll need to touch the \\\"length\\\" storage slot anyway, which also contains the global metadata (it's an optimization).\"},\"resolve(string)\":{\"notice\":\"Resolves the address associated with a given name.\"},\"setGlobalMetadata(bytes27)\":{\"notice\":\"Sets the container's global metadata field. We're using `bytes27` here because we use five bytes to maintain the length of the underlying data structure, meaning we have an extra 27 bytes to store arbitrary data.\"},\"setNextOverwritableIndex(uint256)\":{\"notice\":\"Marks an index as overwritable, meaing the underlying buffer can start to write values over any objects before and including the given index.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol\":\"OVM_ChainStorageContainer\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor () internal {\\n address msgSender = _msgSender();\\n _owner = msgSender;\\n emit OwnershipTransferred(address(0), msgSender);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x15e2d5bd4c28a88548074c54d220e8086f638a71ed07e6b3ba5a70066fcf458d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with GSN meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address payable) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes memory) {\\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x8d3cb350f04ff49cfb10aef08d87f19dcbaecc8027b0bed12f3275cd12f38cf0\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* Library Imports */\\nimport { Lib_RingBuffer } from \\\"../../libraries/utils/Lib_RingBuffer.sol\\\";\\nimport { Lib_AddressResolver } from \\\"../../libraries/resolver/Lib_AddressResolver.sol\\\";\\n\\n/* Interface Imports */\\nimport { iOVM_ChainStorageContainer } from \\\"../../iOVM/chain/iOVM_ChainStorageContainer.sol\\\";\\n\\n/**\\n * @title OVM_ChainStorageContainer\\n * @dev The Chain Storage Container provides its owner contract with read, write and delete functionality.\\n * This provides gas efficiency gains by enabling it to overwrite storage slots which can no longer be used\\n * in a fraud proof due to the fraud window having passed, and the associated chain state or\\n * transactions being finalized.\\n * Three distinct Chain Storage Containers will be deployed on Layer 1:\\n * 1. Stores transaction batches for the Canonical Transaction Chain\\n * 2. Stores queued transactions for the Canonical Transaction Chain\\n * 3. Stores chain state batches for the State Commitment Chain\\n *\\n * Compiler used: solc\\n * Runtime target: EVM\\n */\\ncontract OVM_ChainStorageContainer is iOVM_ChainStorageContainer, Lib_AddressResolver {\\n\\n /*************\\n * Libraries *\\n *************/\\n\\n using Lib_RingBuffer for Lib_RingBuffer.RingBuffer;\\n\\n\\n /*************\\n * Variables *\\n *************/\\n\\n string public owner;\\n Lib_RingBuffer.RingBuffer internal buffer;\\n\\n\\n /***************\\n * Constructor *\\n ***************/\\n\\n /**\\n * @param _libAddressManager Address of the Address Manager.\\n * @param _owner Name of the contract that owns this container (will be resolved later).\\n */\\n constructor(\\n address _libAddressManager,\\n string memory _owner\\n )\\n Lib_AddressResolver(_libAddressManager)\\n {\\n owner = _owner;\\n }\\n\\n\\n /**********************\\n * Function Modifiers *\\n **********************/\\n\\n modifier onlyOwner() {\\n require(\\n msg.sender == resolve(owner),\\n \\\"OVM_ChainStorageContainer: Function can only be called by the owner.\\\"\\n );\\n _;\\n }\\n\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function setGlobalMetadata(\\n bytes27 _globalMetadata\\n )\\n override\\n public\\n onlyOwner\\n {\\n return buffer.setExtraData(_globalMetadata);\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function getGlobalMetadata()\\n override\\n public\\n view\\n returns (\\n bytes27\\n )\\n {\\n return buffer.getExtraData();\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function length()\\n override\\n public\\n view\\n returns (\\n uint256\\n )\\n {\\n return uint256(buffer.getLength());\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function push(\\n bytes32 _object\\n )\\n override\\n public\\n onlyOwner\\n {\\n buffer.push(_object);\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function push(\\n bytes32 _object,\\n bytes27 _globalMetadata\\n )\\n override\\n public\\n onlyOwner\\n {\\n buffer.push(_object, _globalMetadata);\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function get(\\n uint256 _index\\n )\\n override\\n public\\n view\\n returns (\\n bytes32\\n )\\n {\\n return buffer.get(uint40(_index));\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function deleteElementsAfterInclusive(\\n uint256 _index\\n )\\n override\\n public\\n onlyOwner\\n {\\n buffer.deleteElementsAfterInclusive(\\n uint40(_index)\\n );\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function deleteElementsAfterInclusive(\\n uint256 _index,\\n bytes27 _globalMetadata\\n )\\n override\\n public\\n onlyOwner\\n {\\n buffer.deleteElementsAfterInclusive(\\n uint40(_index),\\n _globalMetadata\\n );\\n }\\n\\n /**\\n * @inheritdoc iOVM_ChainStorageContainer\\n */\\n function setNextOverwritableIndex(\\n uint256 _index\\n )\\n override\\n public\\n onlyOwner\\n {\\n buffer.nextOverwritableIndex = _index;\\n }\\n}\\n\",\"keccak256\":\"0x93325c961516aa2a22bf1aacf4029353d5e3b693e04b485753170337b50224e6\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/iOVM/chain/iOVM_ChainStorageContainer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/**\\n * @title iOVM_ChainStorageContainer\\n */\\ninterface iOVM_ChainStorageContainer {\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Sets the container's global metadata field. We're using `bytes27` here because we use five\\n * bytes to maintain the length of the underlying data structure, meaning we have an extra\\n * 27 bytes to store arbitrary data.\\n * @param _globalMetadata New global metadata to set.\\n */\\n function setGlobalMetadata(\\n bytes27 _globalMetadata\\n )\\n external;\\n\\n /**\\n * Retrieves the container's global metadata field.\\n * @return Container global metadata field.\\n */\\n function getGlobalMetadata()\\n external\\n view\\n returns (\\n bytes27\\n );\\n\\n /**\\n * Retrieves the number of objects stored in the container.\\n * @return Number of objects in the container.\\n */\\n function length()\\n external\\n view\\n returns (\\n uint256\\n );\\n\\n /**\\n * Pushes an object into the container.\\n * @param _object A 32 byte value to insert into the container.\\n */\\n function push(\\n bytes32 _object\\n )\\n external;\\n\\n /**\\n * Pushes an object into the container. Function allows setting the global metadata since\\n * we'll need to touch the \\\"length\\\" storage slot anyway, which also contains the global\\n * metadata (it's an optimization).\\n * @param _object A 32 byte value to insert into the container.\\n * @param _globalMetadata New global metadata for the container.\\n */\\n function push(\\n bytes32 _object,\\n bytes27 _globalMetadata\\n )\\n external;\\n\\n /**\\n * Retrieves an object from the container.\\n * @param _index Index of the particular object to access.\\n * @return 32 byte object value.\\n */\\n function get(\\n uint256 _index\\n )\\n external\\n view\\n returns (\\n bytes32\\n );\\n\\n /**\\n * Removes all objects after and including a given index.\\n * @param _index Object index to delete from.\\n */\\n function deleteElementsAfterInclusive(\\n uint256 _index\\n )\\n external;\\n\\n /**\\n * Removes all objects after and including a given index. Also allows setting the global\\n * metadata field.\\n * @param _index Object index to delete from.\\n * @param _globalMetadata New global metadata for the container.\\n */\\n function deleteElementsAfterInclusive(\\n uint256 _index,\\n bytes27 _globalMetadata\\n )\\n external;\\n\\n /**\\n * Marks an index as overwritable, meaing the underlying buffer can start to write values over\\n * any objects before and including the given index.\\n */\\n function setNextOverwritableIndex(\\n uint256 _index\\n )\\n external;\\n}\\n\",\"keccak256\":\"0x2d7973a0ad84c23ec62624d3f1e3aeb198cc72686ff1e6cfa17155556b320c94\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* External Imports */\\nimport { Ownable } from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\n/**\\n * @title Lib_AddressManager\\n */\\ncontract Lib_AddressManager is Ownable {\\n\\n /**********\\n * Events *\\n **********/\\n\\n event AddressSet(\\n string _name,\\n address _newAddress\\n );\\n\\n\\n /*************\\n * Variables *\\n *************/\\n\\n mapping (bytes32 => address) private addresses;\\n\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Changes the address associated with a particular name.\\n * @param _name String name to associate an address with.\\n * @param _address Address to associate with the name.\\n */\\n function setAddress(\\n string memory _name,\\n address _address\\n )\\n public\\n onlyOwner\\n {\\n addresses[_getNameHash(_name)] = _address;\\n\\n emit AddressSet(\\n _name,\\n _address\\n );\\n }\\n\\n /**\\n * Retrieves the address associated with a given name.\\n * @param _name Name to retrieve an address for.\\n * @return Address associated with the given name.\\n */\\n function getAddress(\\n string memory _name\\n )\\n public\\n view\\n returns (\\n address\\n )\\n {\\n return addresses[_getNameHash(_name)];\\n }\\n\\n\\n /**********************\\n * Internal Functions *\\n **********************/\\n\\n /**\\n * Computes the hash of a name.\\n * @param _name Name to compute a hash for.\\n * @return Hash of the given name.\\n */\\n function _getNameHash(\\n string memory _name\\n )\\n internal\\n pure\\n returns (\\n bytes32\\n )\\n {\\n return keccak256(abi.encodePacked(_name));\\n }\\n}\\n\",\"keccak256\":\"0x2ce671a0e004df88b136bea5a3c59d0732cea8887c8496da1d509e0200b03d7d\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/resolver/Lib_AddressResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* Library Imports */\\nimport { Lib_AddressManager } from \\\"./Lib_AddressManager.sol\\\";\\n\\n/**\\n * @title Lib_AddressResolver\\n */\\nabstract contract Lib_AddressResolver {\\n\\n /*************\\n * Variables *\\n *************/\\n\\n Lib_AddressManager public libAddressManager;\\n\\n\\n /***************\\n * Constructor *\\n ***************/\\n\\n /**\\n * @param _libAddressManager Address of the Lib_AddressManager.\\n */\\n constructor(\\n address _libAddressManager\\n ) {\\n libAddressManager = Lib_AddressManager(_libAddressManager);\\n }\\n\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Resolves the address associated with a given name.\\n * @param _name Name to resolve an address for.\\n * @return Address associated with the given name.\\n */\\n function resolve(\\n string memory _name\\n )\\n public\\n view\\n returns (\\n address\\n )\\n {\\n return libAddressManager.getAddress(_name);\\n }\\n}\\n\",\"keccak256\":\"0x65981feeabff6a81783ea97d44baf988a18a86c8cb374c46fdb71819cbacc7c0\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/utils/Lib_RingBuffer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\nlibrary Lib_RingBuffer {\\n using Lib_RingBuffer for RingBuffer;\\n\\n /***********\\n * Structs *\\n ***********/\\n\\n struct Buffer {\\n uint256 length;\\n mapping (uint256 => bytes32) buf;\\n }\\n\\n struct RingBuffer {\\n bytes32 contextA;\\n bytes32 contextB;\\n Buffer bufferA;\\n Buffer bufferB;\\n uint256 nextOverwritableIndex;\\n }\\n\\n struct RingBufferContext {\\n // contextA\\n uint40 globalIndex;\\n bytes27 extraData;\\n\\n // contextB\\n uint64 currBufferIndex;\\n uint40 prevResetIndex;\\n uint40 currResetIndex;\\n }\\n\\n\\n /*************\\n * Constants *\\n *************/\\n\\n uint256 constant MIN_CAPACITY = 16;\\n\\n\\n /**********************\\n * Internal Functions *\\n **********************/\\n\\n /**\\n * Pushes a single element to the buffer.\\n * @param _self Buffer to access.\\n * @param _value Value to push to the buffer.\\n * @param _extraData Optional global extra data.\\n */\\n function push(\\n RingBuffer storage _self,\\n bytes32 _value,\\n bytes27 _extraData\\n )\\n internal\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n Buffer storage currBuffer = _self.getBuffer(ctx.currBufferIndex);\\n\\n // Set a minimum capacity.\\n if (currBuffer.length == 0) {\\n currBuffer.length = MIN_CAPACITY;\\n }\\n\\n // Check if we need to expand the buffer.\\n if (ctx.globalIndex - ctx.currResetIndex >= currBuffer.length) {\\n if (ctx.currResetIndex < _self.nextOverwritableIndex) {\\n // We're going to overwrite the inactive buffer.\\n // Bump the buffer index, reset the delete offset, and set our reset indices.\\n ctx.currBufferIndex++;\\n ctx.prevResetIndex = ctx.currResetIndex;\\n ctx.currResetIndex = ctx.globalIndex;\\n\\n // Swap over to the next buffer.\\n currBuffer = _self.getBuffer(ctx.currBufferIndex);\\n } else {\\n // We're not overwriting yet, double the length of the current buffer.\\n currBuffer.length *= 2;\\n }\\n }\\n\\n // Index to write to is the difference of the global and reset indices.\\n uint256 writeHead = ctx.globalIndex - ctx.currResetIndex;\\n currBuffer.buf[writeHead] = _value;\\n\\n // Bump the global index and insert our extra data, then save the context.\\n ctx.globalIndex++;\\n ctx.extraData = _extraData;\\n _self.setContext(ctx);\\n }\\n\\n /**\\n * Pushes a single element to the buffer.\\n * @param _self Buffer to access.\\n * @param _value Value to push to the buffer.\\n */\\n function push(\\n RingBuffer storage _self,\\n bytes32 _value\\n )\\n internal\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n\\n _self.push(\\n _value,\\n ctx.extraData\\n );\\n }\\n\\n /**\\n * Retrieves an element from the buffer.\\n * @param _self Buffer to access.\\n * @param _index Element index to retrieve.\\n * @return Value of the element at the given index.\\n */\\n function get(\\n RingBuffer storage _self,\\n uint256 _index\\n )\\n internal\\n view\\n returns (\\n bytes32\\n )\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n\\n require(\\n _index < ctx.globalIndex,\\n \\\"Index out of bounds.\\\"\\n );\\n\\n Buffer storage currBuffer = _self.getBuffer(ctx.currBufferIndex);\\n Buffer storage prevBuffer = _self.getBuffer(ctx.currBufferIndex + 1);\\n\\n if (_index >= ctx.currResetIndex) {\\n // We're trying to load an element from the current buffer.\\n // Relative index is just the difference from the reset index.\\n uint256 relativeIndex = _index - ctx.currResetIndex;\\n\\n // Shouldn't happen but why not check.\\n require(\\n relativeIndex < currBuffer.length,\\n \\\"Index out of bounds.\\\"\\n );\\n\\n return currBuffer.buf[relativeIndex];\\n } else {\\n // We're trying to load an element from the previous buffer.\\n // Relative index is the difference from the reset index in the other direction.\\n uint256 relativeIndex = ctx.currResetIndex - _index;\\n\\n // Condition only fails in the case that we deleted and flipped buffers.\\n require(\\n ctx.currResetIndex > ctx.prevResetIndex,\\n \\\"Index out of bounds.\\\"\\n );\\n\\n // Make sure we're not trying to read beyond the array.\\n require(\\n relativeIndex <= prevBuffer.length,\\n \\\"Index out of bounds.\\\"\\n );\\n\\n return prevBuffer.buf[prevBuffer.length - relativeIndex];\\n }\\n }\\n\\n /**\\n * Deletes all elements after (and including) a given index.\\n * @param _self Buffer to access.\\n * @param _index Index of the element to delete from (inclusive).\\n * @param _extraData Optional global extra data.\\n */\\n function deleteElementsAfterInclusive(\\n RingBuffer storage _self,\\n uint40 _index,\\n bytes27 _extraData\\n )\\n internal\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n\\n require(\\n _index < ctx.globalIndex && _index >= ctx.prevResetIndex,\\n \\\"Index out of bounds.\\\"\\n );\\n\\n if (_index < ctx.currResetIndex) {\\n // We're switching back to the previous buffer.\\n // Reduce the buffer index, set the current reset index back to match the previous one.\\n // We use the equality of these two values to prevent reading beyond this buffer.\\n ctx.currBufferIndex--;\\n ctx.currResetIndex = ctx.prevResetIndex;\\n }\\n\\n // Set our global index and extra data, save the context.\\n ctx.globalIndex = _index;\\n ctx.extraData = _extraData;\\n _self.setContext(ctx);\\n }\\n\\n /**\\n * Deletes all elements after (and including) a given index.\\n * @param _self Buffer to access.\\n * @param _index Index of the element to delete from (inclusive).\\n */\\n function deleteElementsAfterInclusive(\\n RingBuffer storage _self,\\n uint40 _index\\n )\\n internal\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n _self.deleteElementsAfterInclusive(\\n _index,\\n ctx.extraData\\n );\\n }\\n\\n /**\\n * Retrieves the current global index.\\n * @param _self Buffer to access.\\n * @return Current global index.\\n */\\n function getLength(\\n RingBuffer storage _self\\n )\\n internal\\n view\\n returns (\\n uint40\\n )\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n return ctx.globalIndex;\\n }\\n\\n /**\\n * Changes current global extra data.\\n * @param _self Buffer to access.\\n * @param _extraData New global extra data.\\n */\\n function setExtraData(\\n RingBuffer storage _self,\\n bytes27 _extraData\\n )\\n internal\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n ctx.extraData = _extraData;\\n _self.setContext(ctx);\\n }\\n\\n /**\\n * Retrieves the current global extra data.\\n * @param _self Buffer to access.\\n * @return Current global extra data.\\n */\\n function getExtraData(\\n RingBuffer storage _self\\n )\\n internal\\n view\\n returns (\\n bytes27\\n )\\n {\\n RingBufferContext memory ctx = _self.getContext();\\n return ctx.extraData;\\n }\\n\\n /**\\n * Sets the current ring buffer context.\\n * @param _self Buffer to access.\\n * @param _ctx Current ring buffer context.\\n */\\n function setContext(\\n RingBuffer storage _self,\\n RingBufferContext memory _ctx\\n )\\n internal\\n {\\n bytes32 contextA;\\n bytes32 contextB;\\n\\n uint40 globalIndex = _ctx.globalIndex;\\n bytes27 extraData = _ctx.extraData;\\n assembly {\\n contextA := globalIndex\\n contextA := or(contextA, extraData)\\n }\\n\\n uint64 currBufferIndex = _ctx.currBufferIndex;\\n uint40 prevResetIndex = _ctx.prevResetIndex;\\n uint40 currResetIndex = _ctx.currResetIndex;\\n assembly {\\n contextB := currBufferIndex\\n contextB := or(contextB, shl(64, prevResetIndex))\\n contextB := or(contextB, shl(104, currResetIndex))\\n }\\n\\n if (_self.contextA != contextA) {\\n _self.contextA = contextA;\\n }\\n\\n if (_self.contextB != contextB) {\\n _self.contextB = contextB;\\n }\\n }\\n\\n /**\\n * Retrieves the current ring buffer context.\\n * @param _self Buffer to access.\\n * @return Current ring buffer context.\\n */\\n function getContext(\\n RingBuffer storage _self\\n )\\n internal\\n view\\n returns (\\n RingBufferContext memory\\n )\\n {\\n bytes32 contextA = _self.contextA;\\n bytes32 contextB = _self.contextB;\\n\\n uint40 globalIndex;\\n bytes27 extraData;\\n assembly {\\n globalIndex := and(contextA, 0x000000000000000000000000000000000000000000000000000000FFFFFFFFFF)\\n extraData := and(contextA, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000)\\n }\\n\\n uint64 currBufferIndex;\\n uint40 prevResetIndex;\\n uint40 currResetIndex;\\n assembly {\\n currBufferIndex := and(contextB, 0x000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFF)\\n prevResetIndex := shr(64, and(contextB, 0x00000000000000000000000000000000000000FFFFFFFFFF0000000000000000))\\n currResetIndex := shr(104, and(contextB, 0x0000000000000000000000000000FFFFFFFFFF00000000000000000000000000))\\n }\\n\\n return RingBufferContext({\\n globalIndex: globalIndex,\\n extraData: extraData,\\n currBufferIndex: currBufferIndex,\\n prevResetIndex: prevResetIndex,\\n currResetIndex: currResetIndex\\n });\\n }\\n\\n /**\\n * Retrieves the a buffer from the ring buffer by index.\\n * @param _self Buffer to access.\\n * @param _which Index of the sub buffer to access.\\n * @return Sub buffer for the index.\\n */\\n function getBuffer(\\n RingBuffer storage _self,\\n uint256 _which\\n )\\n internal\\n view\\n returns (\\n Buffer storage\\n )\\n {\\n return _which % 2 == 0 ? _self.bufferA : _self.bufferB;\\n }\\n}\\n\",\"keccak256\":\"0xe30fc56d4499f98582e1f800dfa3b343f171163a557266c31a56449d5fd3ffae\",\"license\":\"MIT\"}},\"version\":1}",
"bytecode": "0x60806040523480156200001157600080fd5b506040516200118d3803806200118d833981810160405260408110156200003757600080fd5b8151602083018051604051929492938301929190846401000000008211156200005f57600080fd5b9083019060208201858111156200007557600080fd5b82516401000000008111828201881017156200009057600080fd5b82525081516020918201929091019080838360005b83811015620000bf578181015183820152602001620000a5565b50505050905090810190601f168015620000ed5780820380516001836020036101000a031916815260200191505b506040525050600080546001600160a01b0319166001600160a01b038516179055508051620001249060019060208401906200012d565b505050620001d9565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282620001655760008555620001b0565b82601f106200018057805160ff1916838001178555620001b0565b82800160010185558215620001b0579182015b82811115620001b057825182559160200191906001019062000193565b50620001be929150620001c2565b5090565b5b80821115620001be5760008155600101620001c3565b610fa480620001e96000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c80634651d91e116100715780634651d91e1461021a5780638da5cb5b146102375780639507d39a146102b4578063b298e36b146102d1578063ccf8f969146102ee578063fa9e936c14610311576100b4565b8063167fd681146100b95780631f7b6d32146100e65780632015276c1461010057806329061de21461012b578063299ca47814610150578063461a447814610174575b600080fd5b6100e4600480360360408110156100cf57600080fd5b508035906020013564ffffffffff191661032e565b005b6100ee610423565b60408051918252519081900360200190f35b6100e46004803603604081101561011657600080fd5b508035906020013564ffffffffff191661043b565b6100e46004803603602081101561014157600080fd5b503564ffffffffff19166104f7565b6101586105b5565b604080516001600160a01b039092168252519081900360200190f35b6101586004803603602081101561018a57600080fd5b8101906020810181356401000000008111156101a557600080fd5b8201836020820111156101b757600080fd5b803590602001918460018302840111640100000000831117156101d957600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506105c4945050505050565b6100e46004803603602081101561023057600080fd5b50356106a0565b61023f61075b565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610279578181015183820152602001610261565b50505050905090810190601f1680156102a65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6100ee600480360360208110156102ca57600080fd5b50356107e8565b6100e4600480360360208110156102e757600080fd5b5035610802565b6102f66108bd565b6040805164ffffffffff199092168252519081900360200190f35b6100e46004803603602081101561032757600080fd5b50356108ce565b60018054604080516020601f6002600019610100878916150201909516949094049384018190048102820181019092528281526103c493909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b820191906000526020600020905b81548152906001019060200180831161039d57829003601f168201915b50505050506105c4565b6001600160a01b0316336001600160a01b0316146104135760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b61041f60028383610983565b5050565b600061042f6002610a75565b64ffffffffff16905090565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261049c93909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146104eb5760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b61041f60028383610a89565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261055893909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146105a75760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b6105b2600282610b90565b50565b6000546001600160a01b031681565b6000805460405163bf40fac160e01b81526020600482018181528551602484015285516001600160a01b039094169363bf40fac19387938392604490920191908501908083838b5b8381101561062457818101518382015260200161060c565b50505050905090810190601f1680156106515780820380516001836020036101000a031916815260200191505b509250505060206040518083038186803b15801561066e57600080fd5b505afa158015610682573d6000803e3d6000fd5b505050506040513d602081101561069857600080fd5b505192915050565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261070193909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146107505760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b6105b2600282610bba565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156107e05780601f106107b5576101008083540402835291602001916107e0565b820191906000526020600020905b8154815290600101906020018083116107c357829003601f168201915b505050505081565b60006107fc600264ffffffffff8416610be0565b92915050565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261086393909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146108b25760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b6105b2600282610de9565b60006108c96002610e0f565b905090565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261092f93909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b03161461097e5760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b600855565b600061098e84610e26565b9050806000015164ffffffffff168364ffffffffff161080156109c35750806060015164ffffffffff168364ffffffffff1610155b610a0b576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b806080015164ffffffffff168364ffffffffff161015610a4d576040810180516000190167ffffffffffffffff169052606081015164ffffffffff1660808201525b64ffffffffff8316815264ffffffffff1982166020820152610a6f8482610e86565b50505050565b600080610a8183610e26565b519392505050565b6000610a9484610e26565b90506000610ab9826040015167ffffffffffffffff1686610edc90919063ffffffff16565b8054909150610ac757601081555b8054608083015183510364ffffffffff1610610b3e578460060154826080015164ffffffffff161015610b365760408201805160010167ffffffffffffffff169081905260808301805164ffffffffff90811660608601528451169052610b2f908690610edc565b9050610b3e565b805460020281555b608082015182510364ffffffffff9081166000818152600184810160209081526040909220889055855101909216845264ffffffffff19851691840191909152610b888684610e86565b505050505050565b6000610b9b83610e26565b64ffffffffff19831660208201529050610bb58382610e86565b505050565b6000610bc583610e26565b9050610bb5828260200151856109839092919063ffffffff16565b600080610bec84610e26565b805190915064ffffffffff168310610c42576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b6000610c65826040015167ffffffffffffffff1686610edc90919063ffffffff16565b90506000610c8d836040015160010167ffffffffffffffff1687610edc90919063ffffffff16565b9050826080015164ffffffffff168510610d1a576080830151825464ffffffffff9091168603908110610cfe576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b6000908152600190920160205250604090205491506107fc9050565b6080830151606084015164ffffffffff9182168781039290911610610d7d576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b8154811115610dca576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b81540360009081526001909101602052604090205492506107fc915050565b6000610df483610e26565b9050610bb582826020015185610a899092919063ffffffff16565b600080610e1b83610e26565b602001519392505050565b610e2e610efc565b5080546001909101546040805160a08101825264ffffffffff808516825264ffffffffff19909416602082015267ffffffffffffffff8316818301529082901c8316606082015260689190911c909116608082015290565b80516020820151604080840151606085015160808601518754858717969483901b8417606883901b1795939291908714610ebe578689555b85896001015414610ed157600189018690555b505050505050505050565b60006002820615610ef05782600401610ef5565b826002015b9392505050565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101919091529056fe4f564d5f436861696e53746f72616765436f6e7461696e65723a2046756e6374696f6e2063616e206f6e6c792062652063616c6c656420627920746865206f776e65722ea2646970667358221220376cbc00341dd082d644157f6511fcd1ac26a6a924d04ae6532cfcab93d9191864736f6c63430007060033",
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100b45760003560e01c80634651d91e116100715780634651d91e1461021a5780638da5cb5b146102375780639507d39a146102b4578063b298e36b146102d1578063ccf8f969146102ee578063fa9e936c14610311576100b4565b8063167fd681146100b95780631f7b6d32146100e65780632015276c1461010057806329061de21461012b578063299ca47814610150578063461a447814610174575b600080fd5b6100e4600480360360408110156100cf57600080fd5b508035906020013564ffffffffff191661032e565b005b6100ee610423565b60408051918252519081900360200190f35b6100e46004803603604081101561011657600080fd5b508035906020013564ffffffffff191661043b565b6100e46004803603602081101561014157600080fd5b503564ffffffffff19166104f7565b6101586105b5565b604080516001600160a01b039092168252519081900360200190f35b6101586004803603602081101561018a57600080fd5b8101906020810181356401000000008111156101a557600080fd5b8201836020820111156101b757600080fd5b803590602001918460018302840111640100000000831117156101d957600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506105c4945050505050565b6100e46004803603602081101561023057600080fd5b50356106a0565b61023f61075b565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610279578181015183820152602001610261565b50505050905090810190601f1680156102a65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6100ee600480360360208110156102ca57600080fd5b50356107e8565b6100e4600480360360208110156102e757600080fd5b5035610802565b6102f66108bd565b6040805164ffffffffff199092168252519081900360200190f35b6100e46004803603602081101561032757600080fd5b50356108ce565b60018054604080516020601f6002600019610100878916150201909516949094049384018190048102820181019092528281526103c493909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b820191906000526020600020905b81548152906001019060200180831161039d57829003601f168201915b50505050506105c4565b6001600160a01b0316336001600160a01b0316146104135760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b61041f60028383610983565b5050565b600061042f6002610a75565b64ffffffffff16905090565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261049c93909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146104eb5760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b61041f60028383610a89565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261055893909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146105a75760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b6105b2600282610b90565b50565b6000546001600160a01b031681565b6000805460405163bf40fac160e01b81526020600482018181528551602484015285516001600160a01b039094169363bf40fac19387938392604490920191908501908083838b5b8381101561062457818101518382015260200161060c565b50505050905090810190601f1680156106515780820380516001836020036101000a031916815260200191505b509250505060206040518083038186803b15801561066e57600080fd5b505afa158015610682573d6000803e3d6000fd5b505050506040513d602081101561069857600080fd5b505192915050565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261070193909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146107505760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b6105b2600282610bba565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156107e05780601f106107b5576101008083540402835291602001916107e0565b820191906000526020600020905b8154815290600101906020018083116107c357829003601f168201915b505050505081565b60006107fc600264ffffffffff8416610be0565b92915050565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261086393909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b0316146108b25760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b6105b2600282610de9565b60006108c96002610e0f565b905090565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815261092f93909290918301828280156103ba5780601f1061038f576101008083540402835291602001916103ba565b6001600160a01b0316336001600160a01b03161461097e5760405162461bcd60e51b8152600401808060200182810382526044815260200180610f2b6044913960600191505060405180910390fd5b600855565b600061098e84610e26565b9050806000015164ffffffffff168364ffffffffff161080156109c35750806060015164ffffffffff168364ffffffffff1610155b610a0b576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b806080015164ffffffffff168364ffffffffff161015610a4d576040810180516000190167ffffffffffffffff169052606081015164ffffffffff1660808201525b64ffffffffff8316815264ffffffffff1982166020820152610a6f8482610e86565b50505050565b600080610a8183610e26565b519392505050565b6000610a9484610e26565b90506000610ab9826040015167ffffffffffffffff1686610edc90919063ffffffff16565b8054909150610ac757601081555b8054608083015183510364ffffffffff1610610b3e578460060154826080015164ffffffffff161015610b365760408201805160010167ffffffffffffffff169081905260808301805164ffffffffff90811660608601528451169052610b2f908690610edc565b9050610b3e565b805460020281555b608082015182510364ffffffffff9081166000818152600184810160209081526040909220889055855101909216845264ffffffffff19851691840191909152610b888684610e86565b505050505050565b6000610b9b83610e26565b64ffffffffff19831660208201529050610bb58382610e86565b505050565b6000610bc583610e26565b9050610bb5828260200151856109839092919063ffffffff16565b600080610bec84610e26565b805190915064ffffffffff168310610c42576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b6000610c65826040015167ffffffffffffffff1686610edc90919063ffffffff16565b90506000610c8d836040015160010167ffffffffffffffff1687610edc90919063ffffffff16565b9050826080015164ffffffffff168510610d1a576080830151825464ffffffffff9091168603908110610cfe576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b6000908152600190920160205250604090205491506107fc9050565b6080830151606084015164ffffffffff9182168781039290911610610d7d576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b8154811115610dca576040805162461bcd60e51b815260206004820152601460248201527324b73232bc1037baba1037b3103137bab732399760611b604482015290519081900360640190fd5b81540360009081526001909101602052604090205492506107fc915050565b6000610df483610e26565b9050610bb582826020015185610a899092919063ffffffff16565b600080610e1b83610e26565b602001519392505050565b610e2e610efc565b5080546001909101546040805160a08101825264ffffffffff808516825264ffffffffff19909416602082015267ffffffffffffffff8316818301529082901c8316606082015260689190911c909116608082015290565b80516020820151604080840151606085015160808601518754858717969483901b8417606883901b1795939291908714610ebe578689555b85896001015414610ed157600189018690555b505050505050505050565b60006002820615610ef05782600401610ef5565b826002015b9392505050565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101919091529056fe4f564d5f436861696e53746f72616765436f6e7461696e65723a2046756e6374696f6e2063616e206f6e6c792062652063616c6c656420627920746865206f776e65722ea2646970667358221220376cbc00341dd082d644157f6511fcd1ac26a6a924d04ae6532cfcab93d9191864736f6c63430007060033",
"devdoc": {
"details": "The Chain Storage Container provides its owner contract with read, write and delete functionality. This provides gas efficiency gains by enabling it to overwrite storage slots which can no longer be used in a fraud proof due to the fraud window having passed, and the associated chain state or transactions being finalized. Three distinct Chain Storage Containers will be deployed on Layer 1: 1. Stores transaction batches for the Canonical Transaction Chain 2. Stores queued transactions for the Canonical Transaction Chain 3. Stores chain state batches for the State Commitment Chain Compiler used: solc Runtime target: EVM",
"kind": "dev",
"methods": {
"constructor": {
"params": {
"_libAddressManager": "Address of the Address Manager.",
"_owner": "Name of the contract that owns this container (will be resolved later)."
}
},
"deleteElementsAfterInclusive(uint256)": {
"params": {
"_index": "Object index to delete from."
}
},
"deleteElementsAfterInclusive(uint256,bytes27)": {
"params": {
"_globalMetadata": "New global metadata for the container.",
"_index": "Object index to delete from."
}
},
"get(uint256)": {
"params": {
"_index": "Index of the particular object to access."
},
"returns": {
"_0": "32 byte object value."
}
},
"getGlobalMetadata()": {
"returns": {
"_0": "Container global metadata field."
}
},
"length()": {
"returns": {
"_0": "Number of objects in the container."
}
},
"push(bytes32)": {
"params": {
"_object": "A 32 byte value to insert into the container."
}
},
"push(bytes32,bytes27)": {
"params": {
"_globalMetadata": "New global metadata for the container.",
"_object": "A 32 byte value to insert into the container."
}
},
"resolve(string)": {
"params": {
"_name": "Name to resolve an address for."
},
"returns": {
"_0": "Address associated with the given name."
}
},
"setGlobalMetadata(bytes27)": {
"params": {
"_globalMetadata": "New global metadata to set."
}
}
},
"title": "OVM_ChainStorageContainer",
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {
"deleteElementsAfterInclusive(uint256)": {
"notice": "Removes all objects after and including a given index."
},
"deleteElementsAfterInclusive(uint256,bytes27)": {
"notice": "Removes all objects after and including a given index. Also allows setting the global metadata field."
},
"get(uint256)": {
"notice": "Retrieves an object from the container."
},
"getGlobalMetadata()": {
"notice": "Retrieves the container's global metadata field."
},
"length()": {
"notice": "Retrieves the number of objects stored in the container."
},
"push(bytes32)": {
"notice": "Pushes an object into the container."
},
"push(bytes32,bytes27)": {
"notice": "Pushes an object into the container. Function allows setting the global metadata since we'll need to touch the \"length\" storage slot anyway, which also contains the global metadata (it's an optimization)."
},
"resolve(string)": {
"notice": "Resolves the address associated with a given name."
},
"setGlobalMetadata(bytes27)": {
"notice": "Sets the container's global metadata field. We're using `bytes27` here because we use five bytes to maintain the length of the underlying data structure, meaning we have an extra 27 bytes to store arbitrary data."
},
"setNextOverwritableIndex(uint256)": {
"notice": "Marks an index as overwritable, meaing the underlying buffer can start to write values over any objects before and including the given index."
}
},
"version": 1
},
"storageLayout": {
"storage": [
{
"astId": 12800,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "libAddressManager",
"offset": 0,
"slot": "0",
"type": "t_contract(Lib_AddressManager)12793"
},
{
"astId": 4466,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "owner",
"offset": 0,
"slot": "1",
"type": "t_string_storage"
},
{
"astId": 4468,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "buffer",
"offset": 0,
"slot": "2",
"type": "t_struct(RingBuffer)17846_storage"
}
],
"types": {
"t_bytes32": {
"encoding": "inplace",
"label": "bytes32",
"numberOfBytes": "32"
},
"t_contract(Lib_AddressManager)12793": {
"encoding": "inplace",
"label": "contract Lib_AddressManager",
"numberOfBytes": "20"
},
"t_mapping(t_uint256,t_bytes32)": {
"encoding": "mapping",
"key": "t_uint256",
"label": "mapping(uint256 => bytes32)",
"numberOfBytes": "32",
"value": "t_bytes32"
},
"t_string_storage": {
"encoding": "bytes",
"label": "string",
"numberOfBytes": "32"
},
"t_struct(Buffer)17835_storage": {
"encoding": "inplace",
"label": "struct Lib_RingBuffer.Buffer",
"members": [
{
"astId": 17830,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "length",
"offset": 0,
"slot": "0",
"type": "t_uint256"
},
{
"astId": 17834,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "buf",
"offset": 0,
"slot": "1",
"type": "t_mapping(t_uint256,t_bytes32)"
}
],
"numberOfBytes": "64"
},
"t_struct(RingBuffer)17846_storage": {
"encoding": "inplace",
"label": "struct Lib_RingBuffer.RingBuffer",
"members": [
{
"astId": 17837,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "contextA",
"offset": 0,
"slot": "0",
"type": "t_bytes32"
},
{
"astId": 17839,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "contextB",
"offset": 0,
"slot": "1",
"type": "t_bytes32"
},
{
"astId": 17841,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "bufferA",
"offset": 0,
"slot": "2",
"type": "t_struct(Buffer)17835_storage"
},
{
"astId": 17843,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "bufferB",
"offset": 0,
"slot": "4",
"type": "t_struct(Buffer)17835_storage"
},
{
"astId": 17845,
"contract": "contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol:OVM_ChainStorageContainer",
"label": "nextOverwritableIndex",
"offset": 0,
"slot": "6",
"type": "t_uint256"
}
],
"numberOfBytes": "224"
},
"t_uint256": {
"encoding": "inplace",
"label": "uint256",
"numberOfBytes": "32"
}
}
}
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"address": "0x25bb69ee5665536Ce6aeb51094F0bed9e4DACc30",
"abi": [
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "_from",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "_to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
}
],
"name": "DepositInitiated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "_to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
}
],
"name": "WithdrawalFinalized",
"type": "event"
},
{
"inputs": [],
"name": "deposit",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_to",
"type": "address"
}
],
"name": "depositTo",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_to",
"type": "address"
},
{
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
}
],
"name": "finalizeWithdrawal",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "getFinalizeDepositL2Gas",
"outputs": [
{
"internalType": "uint32",
"name": "",
"type": "uint32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_libAddressManager",
"type": "address"
},
{
"internalType": "address",
"name": "_ovmEth",
"type": "address"
}
],
"name": "initialize",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "libAddressManager",
"outputs": [
{
"internalType": "contract Lib_AddressManager",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "messenger",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "ovmEth",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "_name",
"type": "string"
}
],
"name": "resolve",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"stateMutability": "payable",
"type": "receive"
}
],
"transactionHash": "0xdee55e4f063e0e623d64d84766a08cdff904d121126b845ebc3e565fad826f6b",
"receipt": {
"to": null,
"from": "0x18394B52d3Cb931dfA76F63251919D051953413d",
"contractAddress": "0x25bb69ee5665536Ce6aeb51094F0bed9e4DACc30",
"transactionIndex": 3,
"gasUsed": "608764",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blockHash": "0x7b251469ad62221d42e05992bb7fac0bb492bc2939a072d90039a585f58e524f",
"transactionHash": "0xdee55e4f063e0e623d64d84766a08cdff904d121126b845ebc3e565fad826f6b",
"logs": [],
"blockNumber": 24572892,
"cumulativeGasUsed": "752908",
"status": 1,
"byzantium": true
},
"args": [],
"solcInputHash": "5ee8e508e2c54cb5ac6783b4855b1558",
"metadata": "{\"compiler\":{\"version\":\"0.7.6+commit.7338295f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"DepositInitiated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"WithdrawalFinalized\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"}],\"name\":\"depositTo\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"finalizeWithdrawal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getFinalizeDepositL2Gas\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_libAddressManager\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_ovmEth\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"libAddressManager\",\"outputs\":[{\"internalType\":\"contract Lib_AddressManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"messenger\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ovmEth\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"The L1 ETH Gateway is a contract which stores deposited ETH that is in use on L2. Compiler used: solc Runtime target: EVM\",\"kind\":\"dev\",\"methods\":{\"deposit()\":{\"details\":\"deposit an amount of the ETH to the caller's balance on L2\"},\"depositTo(address)\":{\"details\":\"deposit an amount of ETH to a recipients's balance on L2\",\"params\":{\"_to\":\"L2 address to credit the withdrawal to\"}},\"finalizeWithdrawal(address,uint256)\":{\"details\":\"Complete a withdrawal from L2 to L1, and credit funds to the recipient's balance of the L1 ETH token. Since only the xDomainMessenger can call this function, it will never be called before the withdrawal is finalized.\",\"params\":{\"_amount\":\"Amount of the ETH to withdraw\",\"_to\":\"L1 address to credit the withdrawal to\"}},\"initialize(address,address)\":{\"params\":{\"_libAddressManager\":\"Address manager for this OE deployment\",\"_ovmEth\":\"L2 OVM_ETH implementation of iOVM_DepositedToken\"}},\"resolve(string)\":{\"params\":{\"_name\":\"Name to resolve an address for.\"},\"returns\":{\"_0\":\"Address associated with the given name.\"}}},\"title\":\"OVM_L1ETHGateway\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"resolve(string)\":{\"notice\":\"Resolves the address associated with a given name.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol\":\"OVM_L1ETHGateway\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor () internal {\\n address msgSender = _msgSender();\\n _owner = msgSender;\\n emit OwnershipTransferred(address(0), msgSender);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x15e2d5bd4c28a88548074c54d220e8086f638a71ed07e6b3ba5a70066fcf458d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with GSN meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address payable) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes memory) {\\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x8d3cb350f04ff49cfb10aef08d87f19dcbaecc8027b0bed12f3275cd12f38cf0\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// @unsupported: ovm\\npragma solidity >0.5.0 <0.8.0;\\npragma experimental ABIEncoderV2;\\n\\n/* Interface Imports */\\nimport { iOVM_L1ETHGateway } from \\\"../../../iOVM/bridge/tokens/iOVM_L1ETHGateway.sol\\\";\\nimport { iOVM_L2DepositedToken } from \\\"../../../iOVM/bridge/tokens/iOVM_L2DepositedToken.sol\\\";\\n\\n/* Library Imports */\\nimport { OVM_CrossDomainEnabled } from \\\"../../../libraries/bridge/OVM_CrossDomainEnabled.sol\\\";\\nimport { Lib_AddressResolver } from \\\"../../../libraries/resolver/Lib_AddressResolver.sol\\\";\\nimport { Lib_AddressManager } from \\\"../../../libraries/resolver/Lib_AddressManager.sol\\\";\\n\\n/**\\n * @title OVM_L1ETHGateway\\n * @dev The L1 ETH Gateway is a contract which stores deposited ETH that is in use on L2.\\n *\\n * Compiler used: solc\\n * Runtime target: EVM\\n */\\ncontract OVM_L1ETHGateway is iOVM_L1ETHGateway, OVM_CrossDomainEnabled, Lib_AddressResolver {\\n\\n /********************\\n * Public Constants *\\n ********************/\\n\\n uint32 public constant override getFinalizeDepositL2Gas = 1200000;\\n\\n /********************************\\n * External Contract References *\\n ********************************/\\n\\n address public ovmEth;\\n\\n /***************\\n * Constructor *\\n ***************/\\n\\n // This contract lives behind a proxy, so the constructor parameters will go unused.\\n constructor()\\n OVM_CrossDomainEnabled(address(0))\\n Lib_AddressResolver(address(0))\\n public\\n {}\\n\\n /******************\\n * Initialization *\\n ******************/\\n\\n /**\\n * @param _libAddressManager Address manager for this OE deployment\\n * @param _ovmEth L2 OVM_ETH implementation of iOVM_DepositedToken\\n */\\n function initialize(\\n address _libAddressManager,\\n address _ovmEth\\n )\\n public\\n {\\n require(libAddressManager == Lib_AddressManager(0), \\\"Contract has already been initialized.\\\");\\n libAddressManager = Lib_AddressManager(_libAddressManager);\\n ovmEth = _ovmEth;\\n messenger = resolve(\\\"Proxy__OVM_L1CrossDomainMessenger\\\");\\n }\\n\\n /**************\\n * Depositing *\\n **************/\\n\\n receive()\\n external\\n payable\\n {\\n _initiateDeposit(msg.sender, msg.sender);\\n }\\n\\n /**\\n * @dev deposit an amount of the ETH to the caller's balance on L2\\n */\\n function deposit()\\n external\\n override\\n payable\\n {\\n _initiateDeposit(msg.sender, msg.sender);\\n }\\n\\n /**\\n * @dev deposit an amount of ETH to a recipients's balance on L2\\n * @param _to L2 address to credit the withdrawal to\\n */\\n function depositTo(\\n address _to\\n )\\n external\\n override\\n payable\\n {\\n _initiateDeposit(msg.sender, _to);\\n }\\n\\n /**\\n * @dev Performs the logic for deposits by storing the ETH and informing the L2 ETH Gateway of the deposit.\\n *\\n * @param _from Account to pull the deposit from on L1\\n * @param _to Account to give the deposit to on L2\\n */\\n function _initiateDeposit(\\n address _from,\\n address _to\\n )\\n internal\\n {\\n // Construct calldata for l2ETHGateway.finalizeDeposit(_to, _amount)\\n bytes memory data =\\n abi.encodeWithSelector(\\n iOVM_L2DepositedToken.finalizeDeposit.selector,\\n _to,\\n msg.value\\n );\\n\\n // Send calldata into L2\\n sendCrossDomainMessage(\\n ovmEth,\\n data,\\n getFinalizeDepositL2Gas\\n );\\n\\n emit DepositInitiated(_from, _to, msg.value);\\n }\\n\\n /*************************\\n * Cross-chain Functions *\\n *************************/\\n\\n /**\\n * @dev Complete a withdrawal from L2 to L1, and credit funds to the recipient's balance of the\\n * L1 ETH token.\\n * Since only the xDomainMessenger can call this function, it will never be called before the withdrawal is finalized.\\n *\\n * @param _to L1 address to credit the withdrawal to\\n * @param _amount Amount of the ETH to withdraw\\n */\\n function finalizeWithdrawal(\\n address _to,\\n uint256 _amount\\n )\\n external\\n override\\n onlyFromCrossDomainAccount(ovmEth)\\n {\\n _safeTransferETH(_to, _amount);\\n\\n emit WithdrawalFinalized(_to, _amount);\\n }\\n\\n /**********************************\\n * Internal Functions: Accounting *\\n **********************************/\\n\\n /**\\n * @dev Internal accounting function for moving around L1 ETH.\\n *\\n * @param _to L1 address to transfer ETH to\\n * @param _value Amount of ETH to send to\\n */\\n function _safeTransferETH(\\n address _to,\\n uint256 _value\\n )\\n internal\\n {\\n (bool success, ) = _to.call{value: _value}(new bytes(0));\\n require(success, 'TransferHelper::safeTransferETH: ETH transfer failed');\\n }\\n}\\n\",\"keccak256\":\"0xee7c0d4bea0e01b0de4def829c9c8aa313ad6a788a7150adcc62c1e4190831db\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\npragma experimental ABIEncoderV2;\\n\\n/**\\n * @title iAbs_BaseCrossDomainMessenger\\n */\\ninterface iAbs_BaseCrossDomainMessenger {\\n\\n /**********\\n * Events *\\n **********/\\n\\n event SentMessage(bytes message);\\n event RelayedMessage(bytes32 msgHash);\\n event FailedRelayedMessage(bytes32 msgHash);\\n\\n\\n /*************\\n * Variables *\\n *************/\\n\\n function xDomainMessageSender() external view returns (address);\\n\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Sends a cross domain message to the target messenger.\\n * @param _target Target contract address.\\n * @param _message Message to send to the target.\\n * @param _gasLimit Gas limit for the provided message.\\n */\\n function sendMessage(\\n address _target,\\n bytes calldata _message,\\n uint32 _gasLimit\\n ) external;\\n}\\n\",\"keccak256\":\"0x89981ed48e99d6939cc6cdef827d484fa3e2292d66c0ba5056c7050cb6282d7e\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0;\\npragma experimental ABIEncoderV2;\\n\\n/**\\n * @title iOVM_L1ETHGateway\\n */\\ninterface iOVM_L1ETHGateway {\\n\\n /**********\\n * Events *\\n **********/\\n\\n event DepositInitiated(\\n address indexed _from,\\n address _to,\\n uint256 _amount\\n );\\n\\n event WithdrawalFinalized(\\n address indexed _to,\\n uint256 _amount\\n );\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n function deposit()\\n external\\n payable;\\n\\n function depositTo(\\n address _to\\n )\\n external\\n payable;\\n\\n /*************************\\n * Cross-chain Functions *\\n *************************/\\n\\n function finalizeWithdrawal(\\n address _to,\\n uint _amount\\n )\\n external;\\n\\n function getFinalizeDepositL2Gas()\\n external\\n view\\n returns(\\n uint32\\n );\\n}\\n\",\"keccak256\":\"0x7e6805c5cacfd159410c7cd57a3d586e0fc5810bc46600bbd840a252e243e5ba\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0;\\npragma experimental ABIEncoderV2;\\n\\n/**\\n * @title iOVM_L2DepositedToken\\n */\\ninterface iOVM_L2DepositedToken {\\n\\n /**********\\n * Events *\\n **********/\\n\\n event WithdrawalInitiated(\\n address indexed _from,\\n address _to,\\n uint256 _amount\\n );\\n\\n event DepositFinalized(\\n address indexed _to,\\n uint256 _amount\\n );\\n\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n function withdraw(\\n uint _amount\\n )\\n external;\\n\\n function withdrawTo(\\n address _to,\\n uint _amount\\n )\\n external;\\n\\n\\n /*************************\\n * Cross-chain Functions *\\n *************************/\\n\\n function finalizeDeposit(\\n address _to,\\n uint _amount\\n )\\n external;\\n}\\n\",\"keccak256\":\"0x59c807dfb01dbc00409431820457c350681af30d2f972a065231483a8ec926c4\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/bridge/OVM_CrossDomainEnabled.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* Interface Imports */\\nimport { iAbs_BaseCrossDomainMessenger } from \\\"../../iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol\\\";\\n\\n/**\\n * @title OVM_CrossDomainEnabled\\n * @dev Helper contract for contracts performing cross-domain communications\\n *\\n * Compiler used: defined by inheriting contract\\n * Runtime target: defined by inheriting contract\\n */\\ncontract OVM_CrossDomainEnabled {\\n\\n /*************\\n * Variables *\\n *************/\\n\\n // Messenger contract used to send and recieve messages from the other domain.\\n address public messenger;\\n\\n\\n /***************\\n * Constructor *\\n ***************/ \\n\\n /**\\n * @param _messenger Address of the CrossDomainMessenger on the current layer.\\n */\\n constructor(\\n address _messenger\\n ) {\\n messenger = _messenger;\\n }\\n\\n\\n /**********************\\n * Function Modifiers *\\n **********************/\\n\\n /**\\n * Enforces that the modified function is only callable by a specific cross-domain account.\\n * @param _sourceDomainAccount The only account on the originating domain which is\\n * authenticated to call this function.\\n */\\n modifier onlyFromCrossDomainAccount(\\n address _sourceDomainAccount\\n ) {\\n require(\\n msg.sender == address(getCrossDomainMessenger()),\\n \\\"OVM_XCHAIN: messenger contract unauthenticated\\\"\\n );\\n\\n require(\\n getCrossDomainMessenger().xDomainMessageSender() == _sourceDomainAccount,\\n \\\"OVM_XCHAIN: wrong sender of cross-domain message\\\"\\n );\\n\\n _;\\n }\\n\\n\\n /**********************\\n * Internal Functions *\\n **********************/\\n\\n /**\\n * Gets the messenger, usually from storage. This function is exposed in case a child contract\\n * needs to override.\\n * @return The address of the cross-domain messenger contract which should be used. \\n */\\n function getCrossDomainMessenger()\\n internal\\n virtual\\n returns (\\n iAbs_BaseCrossDomainMessenger\\n )\\n {\\n return iAbs_BaseCrossDomainMessenger(messenger);\\n }\\n\\n /**\\n * Sends a message to an account on another domain\\n * @param _crossDomainTarget The intended recipient on the destination domain\\n * @param _data The data to send to the target (usually calldata to a function with\\n * `onlyFromCrossDomainAccount()`)\\n * @param _gasLimit The gasLimit for the receipt of the message on the target domain.\\n */\\n function sendCrossDomainMessage(\\n address _crossDomainTarget,\\n bytes memory _data,\\n uint32 _gasLimit\\n )\\n internal\\n {\\n getCrossDomainMessenger().sendMessage(_crossDomainTarget, _data, _gasLimit);\\n }\\n}\\n\",\"keccak256\":\"0x054c802a5c1318566b7727ff5327a1ad4dc0f18038a4586b7ada467cc6b08761\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* External Imports */\\nimport { Ownable } from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\n/**\\n * @title Lib_AddressManager\\n */\\ncontract Lib_AddressManager is Ownable {\\n\\n /**********\\n * Events *\\n **********/\\n\\n event AddressSet(\\n string _name,\\n address _newAddress\\n );\\n\\n\\n /*************\\n * Variables *\\n *************/\\n\\n mapping (bytes32 => address) private addresses;\\n\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Changes the address associated with a particular name.\\n * @param _name String name to associate an address with.\\n * @param _address Address to associate with the name.\\n */\\n function setAddress(\\n string memory _name,\\n address _address\\n )\\n public\\n onlyOwner\\n {\\n addresses[_getNameHash(_name)] = _address;\\n\\n emit AddressSet(\\n _name,\\n _address\\n );\\n }\\n\\n /**\\n * Retrieves the address associated with a given name.\\n * @param _name Name to retrieve an address for.\\n * @return Address associated with the given name.\\n */\\n function getAddress(\\n string memory _name\\n )\\n public\\n view\\n returns (\\n address\\n )\\n {\\n return addresses[_getNameHash(_name)];\\n }\\n\\n\\n /**********************\\n * Internal Functions *\\n **********************/\\n\\n /**\\n * Computes the hash of a name.\\n * @param _name Name to compute a hash for.\\n * @return Hash of the given name.\\n */\\n function _getNameHash(\\n string memory _name\\n )\\n internal\\n pure\\n returns (\\n bytes32\\n )\\n {\\n return keccak256(abi.encodePacked(_name));\\n }\\n}\\n\",\"keccak256\":\"0x2ce671a0e004df88b136bea5a3c59d0732cea8887c8496da1d509e0200b03d7d\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/resolver/Lib_AddressResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* Library Imports */\\nimport { Lib_AddressManager } from \\\"./Lib_AddressManager.sol\\\";\\n\\n/**\\n * @title Lib_AddressResolver\\n */\\nabstract contract Lib_AddressResolver {\\n\\n /*************\\n * Variables *\\n *************/\\n\\n Lib_AddressManager public libAddressManager;\\n\\n\\n /***************\\n * Constructor *\\n ***************/\\n\\n /**\\n * @param _libAddressManager Address of the Lib_AddressManager.\\n */\\n constructor(\\n address _libAddressManager\\n ) {\\n libAddressManager = Lib_AddressManager(_libAddressManager);\\n }\\n\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Resolves the address associated with a given name.\\n * @param _name Name to resolve an address for.\\n * @return Address associated with the given name.\\n */\\n function resolve(\\n string memory _name\\n )\\n public\\n view\\n returns (\\n address\\n )\\n {\\n return libAddressManager.getAddress(_name);\\n }\\n}\\n\",\"keccak256\":\"0x65981feeabff6a81783ea97d44baf988a18a86c8cb374c46fdb71819cbacc7c0\",\"license\":\"MIT\"}},\"version\":1}",
"bytecode": "0x608060405234801561001057600080fd5b50600080546001600160a01b03199081169091556001805490911690556109fb8061003c6000396000f3fe60806040526004361061008a5760003560e01c8063485cc95511610059578063485cc95514610122578063490b5b7814610142578063b760faf914610157578063d0e30db01461016a578063f4f7b41a146101725761009b565b80631273a090146100a0578063299ca478146100cb5780633cb747bf146100ed578063461a4478146101025761009b565b3661009b576100993333610192565b005b600080fd5b3480156100ac57600080fd5b506100b5610246565b6040516100c29190610935565b60405180910390f35b3480156100d757600080fd5b506100e061024d565b6040516100c29190610865565b3480156100f957600080fd5b506100e061025c565b34801561010e57600080fd5b506100e061011d366004610797565b61026b565b34801561012e57600080fd5b5061009961013d36600461073c565b610347565b34801561014e57600080fd5b506100e06103ef565b61009961016536600461071b565b6103fe565b61009961040b565b34801561017e57600080fd5b5061009961018d36600461076e565b610417565b6000638d6e9a5b60e01b82346040516024016101af929190610879565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526002549091506101fe906001600160a01b03168262124f80610578565b826001600160a01b03167ff531653a5819e21265de50358610d55dbe6594c61605b209dfa4280d277938c18334604051610239929190610879565b60405180910390a2505050565b62124f8081565b6001546001600160a01b031681565b6000546001600160a01b031681565b60015460405163bf40fac160e01b81526020600482018181528451602484015284516000946001600160a01b03169363bf40fac1938793928392604401918501908083838b5b838110156102c95781810151838201526020016102b1565b50505050905090810190601f1680156102f65780820380516001836020036101000a031916815260200191505b509250505060206040518083038186803b15801561031357600080fd5b505afa158015610327573d6000803e3d6000fd5b505050506040513d602081101561033d57600080fd5b505190505b919050565b6001546001600160a01b0316156103795760405162461bcd60e51b8152600401610370906108e6565b60405180910390fd5b600180546001600160a01b038085166001600160a01b0319928316179092556002805492841692909116919091179055604080516060810190915260218082526103cb91906109a5602083013961026b565b600080546001600160a01b0319166001600160a01b03929092169190911790555050565b6002546001600160a01b031681565b6104083382610192565b50565b6104153333610192565b565b6002546001600160a01b031661042b610663565b6001600160a01b0316336001600160a01b03161461047a5760405162461bcd60e51b815260040180806020018281038252602e815260200180610947602e913960400191505060405180910390fd5b806001600160a01b031661048c610663565b6001600160a01b0316636e296e456040518163ffffffff1660e01b815260040160206040518083038186803b1580156104c457600080fd5b505afa1580156104d8573d6000803e3d6000fd5b505050506040513d60208110156104ee57600080fd5b50516001600160a01b0316146105355760405162461bcd60e51b81526004018080602001828103825260308152602001806109756030913960400191505060405180910390fd5b61053f8383610672565b826001600160a01b03167f9e5c4f9f4e46b8629d3dda85f43a69194f50254404a72dc62b9e932d9c94eda883604051610239919061092c565b610580610663565b6001600160a01b0316633dbb202b8484846040518463ffffffff1660e01b815260040180846001600160a01b03168152602001806020018363ffffffff168152602001828103825284818151815260200191508051906020019080838360005b838110156105f85781810151838201526020016105e0565b50505050905090810190601f1680156106255780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b15801561064657600080fd5b505af115801561065a573d6000803e3d6000fd5b50505050505050565b6000546001600160a01b031690565b604080516000808252602082019092526001600160a01b03841690839060405161069c919061082c565b60006040518083038185875af1925050503d80600081146106d9576040519150601f19603f3d011682016040523d82523d6000602084013e6106de565b606091505b50509050806106ff5760405162461bcd60e51b815260040161037090610892565b505050565b80356001600160a01b038116811461034257600080fd5b60006020828403121561072c578081fd5b61073582610704565b9392505050565b6000806040838503121561074e578081fd5b61075783610704565b915061076560208401610704565b90509250929050565b60008060408385031215610780578182fd5b61078983610704565b946020939093013593505050565b600060208083850312156107a9578182fd5b823567ffffffffffffffff808211156107c0578384fd5b818501915085601f8301126107d3578384fd5b8135818111156107df57fe5b604051601f8201601f19168101850183811182821017156107fc57fe5b6040528181528382018501881015610812578586fd5b818585018683013790810190930193909352509392505050565b60008251815b8181101561084c5760208186018101518583015201610832565b8181111561085a5782828501525b509190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b60208082526034908201527f5472616e7366657248656c7065723a3a736166655472616e736665724554483a60408201527308115512081d1c985b9cd9995c8819985a5b195960621b606082015260800190565b60208082526026908201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616040820152653634bd32b21760d11b606082015260800190565b90815260200190565b63ffffffff9190911681526020019056fe4f564d5f58434841494e3a206d657373656e67657220636f6e747261637420756e61757468656e746963617465644f564d5f58434841494e3a2077726f6e672073656e646572206f662063726f73732d646f6d61696e206d65737361676550726f78795f5f4f564d5f4c3143726f7373446f6d61696e4d657373656e676572a2646970667358221220d8a6002280930d6eb8035b95d663889b1a8e3dbd1b07997ca03239bd5372e85b64736f6c63430007060033",
"deployedBytecode": "0x60806040526004361061008a5760003560e01c8063485cc95511610059578063485cc95514610122578063490b5b7814610142578063b760faf914610157578063d0e30db01461016a578063f4f7b41a146101725761009b565b80631273a090146100a0578063299ca478146100cb5780633cb747bf146100ed578063461a4478146101025761009b565b3661009b576100993333610192565b005b600080fd5b3480156100ac57600080fd5b506100b5610246565b6040516100c29190610935565b60405180910390f35b3480156100d757600080fd5b506100e061024d565b6040516100c29190610865565b3480156100f957600080fd5b506100e061025c565b34801561010e57600080fd5b506100e061011d366004610797565b61026b565b34801561012e57600080fd5b5061009961013d36600461073c565b610347565b34801561014e57600080fd5b506100e06103ef565b61009961016536600461071b565b6103fe565b61009961040b565b34801561017e57600080fd5b5061009961018d36600461076e565b610417565b6000638d6e9a5b60e01b82346040516024016101af929190610879565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526002549091506101fe906001600160a01b03168262124f80610578565b826001600160a01b03167ff531653a5819e21265de50358610d55dbe6594c61605b209dfa4280d277938c18334604051610239929190610879565b60405180910390a2505050565b62124f8081565b6001546001600160a01b031681565b6000546001600160a01b031681565b60015460405163bf40fac160e01b81526020600482018181528451602484015284516000946001600160a01b03169363bf40fac1938793928392604401918501908083838b5b838110156102c95781810151838201526020016102b1565b50505050905090810190601f1680156102f65780820380516001836020036101000a031916815260200191505b509250505060206040518083038186803b15801561031357600080fd5b505afa158015610327573d6000803e3d6000fd5b505050506040513d602081101561033d57600080fd5b505190505b919050565b6001546001600160a01b0316156103795760405162461bcd60e51b8152600401610370906108e6565b60405180910390fd5b600180546001600160a01b038085166001600160a01b0319928316179092556002805492841692909116919091179055604080516060810190915260218082526103cb91906109a5602083013961026b565b600080546001600160a01b0319166001600160a01b03929092169190911790555050565b6002546001600160a01b031681565b6104083382610192565b50565b6104153333610192565b565b6002546001600160a01b031661042b610663565b6001600160a01b0316336001600160a01b03161461047a5760405162461bcd60e51b815260040180806020018281038252602e815260200180610947602e913960400191505060405180910390fd5b806001600160a01b031661048c610663565b6001600160a01b0316636e296e456040518163ffffffff1660e01b815260040160206040518083038186803b1580156104c457600080fd5b505afa1580156104d8573d6000803e3d6000fd5b505050506040513d60208110156104ee57600080fd5b50516001600160a01b0316146105355760405162461bcd60e51b81526004018080602001828103825260308152602001806109756030913960400191505060405180910390fd5b61053f8383610672565b826001600160a01b03167f9e5c4f9f4e46b8629d3dda85f43a69194f50254404a72dc62b9e932d9c94eda883604051610239919061092c565b610580610663565b6001600160a01b0316633dbb202b8484846040518463ffffffff1660e01b815260040180846001600160a01b03168152602001806020018363ffffffff168152602001828103825284818151815260200191508051906020019080838360005b838110156105f85781810151838201526020016105e0565b50505050905090810190601f1680156106255780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b15801561064657600080fd5b505af115801561065a573d6000803e3d6000fd5b50505050505050565b6000546001600160a01b031690565b604080516000808252602082019092526001600160a01b03841690839060405161069c919061082c565b60006040518083038185875af1925050503d80600081146106d9576040519150601f19603f3d011682016040523d82523d6000602084013e6106de565b606091505b50509050806106ff5760405162461bcd60e51b815260040161037090610892565b505050565b80356001600160a01b038116811461034257600080fd5b60006020828403121561072c578081fd5b61073582610704565b9392505050565b6000806040838503121561074e578081fd5b61075783610704565b915061076560208401610704565b90509250929050565b60008060408385031215610780578182fd5b61078983610704565b946020939093013593505050565b600060208083850312156107a9578182fd5b823567ffffffffffffffff808211156107c0578384fd5b818501915085601f8301126107d3578384fd5b8135818111156107df57fe5b604051601f8201601f19168101850183811182821017156107fc57fe5b6040528181528382018501881015610812578586fd5b818585018683013790810190930193909352509392505050565b60008251815b8181101561084c5760208186018101518583015201610832565b8181111561085a5782828501525b509190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b60208082526034908201527f5472616e7366657248656c7065723a3a736166655472616e736665724554483a60408201527308115512081d1c985b9cd9995c8819985a5b195960621b606082015260800190565b60208082526026908201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616040820152653634bd32b21760d11b606082015260800190565b90815260200190565b63ffffffff9190911681526020019056fe4f564d5f58434841494e3a206d657373656e67657220636f6e747261637420756e61757468656e746963617465644f564d5f58434841494e3a2077726f6e672073656e646572206f662063726f73732d646f6d61696e206d65737361676550726f78795f5f4f564d5f4c3143726f7373446f6d61696e4d657373656e676572a2646970667358221220d8a6002280930d6eb8035b95d663889b1a8e3dbd1b07997ca03239bd5372e85b64736f6c63430007060033",
"devdoc": {
"details": "The L1 ETH Gateway is a contract which stores deposited ETH that is in use on L2. Compiler used: solc Runtime target: EVM",
"kind": "dev",
"methods": {
"deposit()": {
"details": "deposit an amount of the ETH to the caller's balance on L2"
},
"depositTo(address)": {
"details": "deposit an amount of ETH to a recipients's balance on L2",
"params": {
"_to": "L2 address to credit the withdrawal to"
}
},
"finalizeWithdrawal(address,uint256)": {
"details": "Complete a withdrawal from L2 to L1, and credit funds to the recipient's balance of the L1 ETH token. Since only the xDomainMessenger can call this function, it will never be called before the withdrawal is finalized.",
"params": {
"_amount": "Amount of the ETH to withdraw",
"_to": "L1 address to credit the withdrawal to"
}
},
"initialize(address,address)": {
"params": {
"_libAddressManager": "Address manager for this OE deployment",
"_ovmEth": "L2 OVM_ETH implementation of iOVM_DepositedToken"
}
},
"resolve(string)": {
"params": {
"_name": "Name to resolve an address for."
},
"returns": {
"_0": "Address associated with the given name."
}
}
},
"title": "OVM_L1ETHGateway",
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {
"resolve(string)": {
"notice": "Resolves the address associated with a given name."
}
},
"version": 1
},
"storageLayout": {
"storage": [
{
"astId": 11988,
"contract": "contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol:OVM_L1ETHGateway",
"label": "messenger",
"offset": 0,
"slot": "0",
"type": "t_address"
},
{
"astId": 12800,
"contract": "contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol:OVM_L1ETHGateway",
"label": "libAddressManager",
"offset": 0,
"slot": "1",
"type": "t_contract(Lib_AddressManager)12793"
},
{
"astId": 2661,
"contract": "contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol:OVM_L1ETHGateway",
"label": "ovmEth",
"offset": 0,
"slot": "2",
"type": "t_address"
}
],
"types": {
"t_address": {
"encoding": "inplace",
"label": "address",
"numberOfBytes": "20"
},
"t_contract(Lib_AddressManager)12793": {
"encoding": "inplace",
"label": "contract Lib_AddressManager",
"numberOfBytes": "20"
}
}
}
}
\ No newline at end of file
{
"address": "0x942b1B1CaF9e7654318CbfCfD1bca6727C716638",
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "_libAddressManager",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [
{
"components": [
{
"internalType": "address",
"name": "target",
"type": "address"
},
{
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"internalType": "bytes",
"name": "message",
"type": "bytes"
},
{
"internalType": "uint256",
"name": "messageNonce",
"type": "uint256"
},
{
"components": [
{
"internalType": "bytes32",
"name": "stateRoot",
"type": "bytes32"
},
{
"components": [
{
"internalType": "uint256",
"name": "batchIndex",
"type": "uint256"
},
{
"internalType": "bytes32",
"name": "batchRoot",
"type": "bytes32"
},
{
"internalType": "uint256",
"name": "batchSize",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "prevTotalElements",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "extraData",
"type": "bytes"
}
],
"internalType": "struct Lib_OVMCodec.ChainBatchHeader",
"name": "stateRootBatchHeader",
"type": "tuple"
},
{
"components": [
{
"internalType": "uint256",
"name": "index",
"type": "uint256"
},
{
"internalType": "bytes32[]",
"name": "siblings",
"type": "bytes32[]"
}
],
"internalType": "struct Lib_OVMCodec.ChainInclusionProof",
"name": "stateRootProof",
"type": "tuple"
},
{
"internalType": "bytes",
"name": "stateTrieWitness",
"type": "bytes"
},
{
"internalType": "bytes",
"name": "storageTrieWitness",
"type": "bytes"
}
],
"internalType": "struct iOVM_L1CrossDomainMessenger.L2MessageInclusionProof",
"name": "proof",
"type": "tuple"
}
],
"internalType": "struct iOVM_L1MultiMessageRelayer.L2ToL1Message[]",
"name": "_messages",
"type": "tuple[]"
}
],
"name": "batchRelayMessages",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "libAddressManager",
"outputs": [
{
"internalType": "contract Lib_AddressManager",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "_name",
"type": "string"
}
],
"name": "resolve",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
}
],
"transactionHash": "0xd93f806d3c8503f36c537f09883e9165dd32239e00b881f705a3441e13a3d510",
"receipt": {
"to": null,
"from": "0x18394B52d3Cb931dfA76F63251919D051953413d",
"contractAddress": "0x942b1B1CaF9e7654318CbfCfD1bca6727C716638",
"transactionIndex": 1,
"gasUsed": "605189",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blockHash": "0xc85c83fe27b2839cc9aee380d27e1fab4612af37f0d80a87aea6047caec2a0e1",
"transactionHash": "0xd93f806d3c8503f36c537f09883e9165dd32239e00b881f705a3441e13a3d510",
"logs": [],
"blockNumber": 24572884,
"cumulativeGasUsed": "674512",
"status": 1,
"byzantium": true
},
"args": [
"0xd56F695e73286ac252A37593DD4E7c14270eC1Df"
],
"solcInputHash": "5ee8e508e2c54cb5ac6783b4855b1558",
"metadata": "{\"compiler\":{\"version\":\"0.7.6+commit.7338295f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_libAddressManager\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"messageNonce\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"stateRoot\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"batchIndex\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"batchRoot\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"batchSize\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"prevTotalElements\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Lib_OVMCodec.ChainBatchHeader\",\"name\":\"stateRootBatchHeader\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"},{\"internalType\":\"bytes32[]\",\"name\":\"siblings\",\"type\":\"bytes32[]\"}],\"internalType\":\"struct Lib_OVMCodec.ChainInclusionProof\",\"name\":\"stateRootProof\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"stateTrieWitness\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"storageTrieWitness\",\"type\":\"bytes\"}],\"internalType\":\"struct iOVM_L1CrossDomainMessenger.L2MessageInclusionProof\",\"name\":\"proof\",\"type\":\"tuple\"}],\"internalType\":\"struct iOVM_L1MultiMessageRelayer.L2ToL1Message[]\",\"name\":\"_messages\",\"type\":\"tuple[]\"}],\"name\":\"batchRelayMessages\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"libAddressManager\",\"outputs\":[{\"internalType\":\"contract Lib_AddressManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"The L1 Multi-Message Relayer contract is a gas efficiency optimization which enables the relayer to submit multiple messages in a single transaction to be relayed by the L1 Cross Domain Message Sender. Compiler used: solc Runtime target: EVM\",\"kind\":\"dev\",\"methods\":{\"batchRelayMessages((address,address,bytes,uint256,(bytes32,(uint256,bytes32,uint256,uint256,bytes),(uint256,bytes32[]),bytes,bytes))[])\":{\"params\":{\"_messages\":\"An array of L2 to L1 messages\"}},\"constructor\":{\"params\":{\"_libAddressManager\":\"Address of the Address Manager.\"}},\"resolve(string)\":{\"params\":{\"_name\":\"Name to resolve an address for.\"},\"returns\":{\"_0\":\"Address associated with the given name.\"}}},\"title\":\"OVM_L1MultiMessageRelayer\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"batchRelayMessages((address,address,bytes,uint256,(bytes32,(uint256,bytes32,uint256,uint256,bytes),(uint256,bytes32[]),bytes,bytes))[])\":{\"notice\":\"Forwards multiple cross domain messages to the L1 Cross Domain Messenger for relaying\"},\"resolve(string)\":{\"notice\":\"Resolves the address associated with a given name.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/optimistic-ethereum/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol\":\"OVM_L1MultiMessageRelayer\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor () internal {\\n address msgSender = _msgSender();\\n _owner = msgSender;\\n emit OwnershipTransferred(address(0), msgSender);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x15e2d5bd4c28a88548074c54d220e8086f638a71ed07e6b3ba5a70066fcf458d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with GSN meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address payable) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes memory) {\\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x8d3cb350f04ff49cfb10aef08d87f19dcbaecc8027b0bed12f3275cd12f38cf0\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// @unsupported: ovm\\npragma solidity >0.5.0 <0.8.0;\\npragma experimental ABIEncoderV2;\\n\\n/* Interface Imports */\\nimport { iOVM_L1CrossDomainMessenger } from \\\"../../../iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol\\\";\\nimport { iOVM_L1MultiMessageRelayer } from \\\"../../../iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol\\\";\\n\\n/* Library Imports */\\nimport { Lib_AddressResolver } from \\\"../../../libraries/resolver/Lib_AddressResolver.sol\\\";\\n\\n/**\\n * @title OVM_L1MultiMessageRelayer\\n * @dev The L1 Multi-Message Relayer contract is a gas efficiency optimization which enables the\\n * relayer to submit multiple messages in a single transaction to be relayed by the L1 Cross Domain\\n * Message Sender.\\n *\\n * Compiler used: solc\\n * Runtime target: EVM\\n */\\ncontract OVM_L1MultiMessageRelayer is iOVM_L1MultiMessageRelayer, Lib_AddressResolver {\\n\\n /***************\\n * Constructor *\\n ***************/\\n\\n /**\\n * @param _libAddressManager Address of the Address Manager.\\n */\\n constructor(\\n address _libAddressManager\\n )\\n Lib_AddressResolver(_libAddressManager)\\n {}\\n\\n\\n /**********************\\n * Function Modifiers *\\n **********************/\\n\\n modifier onlyBatchRelayer() {\\n require(\\n msg.sender == resolve(\\\"OVM_L2BatchMessageRelayer\\\"),\\n \\\"OVM_L1MultiMessageRelayer: Function can only be called by the OVM_L2BatchMessageRelayer\\\"\\n );\\n _;\\n }\\n\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * @notice Forwards multiple cross domain messages to the L1 Cross Domain Messenger for relaying\\n * @param _messages An array of L2 to L1 messages\\n */\\n function batchRelayMessages(\\n L2ToL1Message[] calldata _messages\\n ) \\n override\\n external\\n onlyBatchRelayer\\n {\\n iOVM_L1CrossDomainMessenger messenger = iOVM_L1CrossDomainMessenger(\\n resolve(\\\"Proxy__OVM_L1CrossDomainMessenger\\\")\\n );\\n\\n for (uint256 i = 0; i < _messages.length; i++) {\\n L2ToL1Message memory message = _messages[i];\\n messenger.relayMessage(\\n message.target,\\n message.sender,\\n message.message,\\n message.messageNonce,\\n message.proof\\n );\\n }\\n }\\n}\\n\",\"keccak256\":\"0xe698b8dbdcecd055ee77cc553963f966faebcdefbed1e586f7fd603fa816d9c6\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\npragma experimental ABIEncoderV2;\\n\\n/**\\n * @title iAbs_BaseCrossDomainMessenger\\n */\\ninterface iAbs_BaseCrossDomainMessenger {\\n\\n /**********\\n * Events *\\n **********/\\n\\n event SentMessage(bytes message);\\n event RelayedMessage(bytes32 msgHash);\\n event FailedRelayedMessage(bytes32 msgHash);\\n\\n\\n /*************\\n * Variables *\\n *************/\\n\\n function xDomainMessageSender() external view returns (address);\\n\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Sends a cross domain message to the target messenger.\\n * @param _target Target contract address.\\n * @param _message Message to send to the target.\\n * @param _gasLimit Gas limit for the provided message.\\n */\\n function sendMessage(\\n address _target,\\n bytes calldata _message,\\n uint32 _gasLimit\\n ) external;\\n}\\n\",\"keccak256\":\"0x89981ed48e99d6939cc6cdef827d484fa3e2292d66c0ba5056c7050cb6282d7e\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.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 { iAbs_BaseCrossDomainMessenger } from \\\"./iAbs_BaseCrossDomainMessenger.sol\\\";\\n\\n/**\\n * @title iOVM_L1CrossDomainMessenger\\n */\\ninterface iOVM_L1CrossDomainMessenger is iAbs_BaseCrossDomainMessenger {\\n\\n /*******************\\n * Data Structures *\\n *******************/\\n\\n struct L2MessageInclusionProof {\\n bytes32 stateRoot;\\n Lib_OVMCodec.ChainBatchHeader stateRootBatchHeader;\\n Lib_OVMCodec.ChainInclusionProof stateRootProof;\\n bytes stateTrieWitness;\\n bytes storageTrieWitness;\\n }\\n\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Relays a cross domain message to a contract.\\n * @param _target Target contract address.\\n * @param _sender Message sender address.\\n * @param _message Message to send to the target.\\n * @param _messageNonce Nonce for the provided message.\\n * @param _proof Inclusion proof for the given message.\\n */\\n function relayMessage(\\n address _target,\\n address _sender,\\n bytes memory _message,\\n uint256 _messageNonce,\\n L2MessageInclusionProof memory _proof\\n ) external;\\n\\n /**\\n * Replays a cross domain message to the target messenger.\\n * @param _target Target contract address.\\n * @param _sender Original sender address.\\n * @param _message Message to send to the target.\\n * @param _messageNonce Nonce for the provided message.\\n * @param _gasLimit Gas limit for the provided message.\\n */\\n function replayMessage(\\n address _target,\\n address _sender,\\n bytes memory _message,\\n uint256 _messageNonce,\\n uint32 _gasLimit\\n ) external;\\n}\\n\",\"keccak256\":\"0xdcd239d0b215e400674d78e8db4ac12ba18efc34fa78e24c2ff867f61062dba2\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\npragma experimental ABIEncoderV2;\\n\\n/* Interface Imports */\\nimport { iOVM_L1CrossDomainMessenger } from \\\"../../../iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol\\\";\\ninterface iOVM_L1MultiMessageRelayer {\\n\\n struct L2ToL1Message {\\n address target;\\n address sender;\\n bytes message;\\n uint256 messageNonce;\\n iOVM_L1CrossDomainMessenger.L2MessageInclusionProof proof;\\n }\\n\\n function batchRelayMessages(L2ToL1Message[] calldata _messages) external;\\n}\\n\",\"keccak256\":\"0x8bc1fb2a33dcac59ec307195f8b8358d1ae2ab021c70a1589038b366d1b949d7\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/codec/Lib_OVMCodec.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\npragma experimental ABIEncoderV2;\\n\\n/* Library Imports */\\nimport { Lib_RLPReader } from \\\"../rlp/Lib_RLPReader.sol\\\";\\nimport { Lib_RLPWriter } from \\\"../rlp/Lib_RLPWriter.sol\\\";\\nimport { Lib_BytesUtils } from \\\"../utils/Lib_BytesUtils.sol\\\";\\nimport { Lib_Bytes32Utils } from \\\"../utils/Lib_Bytes32Utils.sol\\\";\\n\\n/**\\n * @title Lib_OVMCodec\\n */\\nlibrary Lib_OVMCodec {\\n\\n /*********\\n * Enums *\\n *********/\\n\\n enum QueueOrigin {\\n SEQUENCER_QUEUE,\\n L1TOL2_QUEUE\\n }\\n\\n\\n /***********\\n * Structs *\\n ***********/\\n\\n struct Account {\\n uint256 nonce;\\n uint256 balance;\\n bytes32 storageRoot;\\n bytes32 codeHash;\\n address ethAddress;\\n bool isFresh;\\n }\\n\\n struct EVMAccount {\\n uint256 nonce;\\n uint256 balance;\\n bytes32 storageRoot;\\n bytes32 codeHash;\\n }\\n\\n struct ChainBatchHeader {\\n uint256 batchIndex;\\n bytes32 batchRoot;\\n uint256 batchSize;\\n uint256 prevTotalElements;\\n bytes extraData;\\n }\\n\\n struct ChainInclusionProof {\\n uint256 index;\\n bytes32[] siblings;\\n }\\n\\n struct Transaction {\\n uint256 timestamp;\\n uint256 blockNumber;\\n QueueOrigin l1QueueOrigin;\\n address l1TxOrigin;\\n address entrypoint;\\n uint256 gasLimit;\\n bytes data;\\n }\\n\\n struct TransactionChainElement {\\n bool isSequenced;\\n uint256 queueIndex; // QUEUED TX ONLY\\n uint256 timestamp; // SEQUENCER TX ONLY\\n uint256 blockNumber; // SEQUENCER TX ONLY\\n bytes txData; // SEQUENCER TX ONLY\\n }\\n\\n struct QueueElement {\\n bytes32 transactionHash;\\n uint40 timestamp;\\n uint40 blockNumber;\\n }\\n\\n\\n /**********************\\n * Internal Functions *\\n **********************/\\n\\n /**\\n * Encodes a standard OVM transaction.\\n * @param _transaction OVM transaction to encode.\\n * @return Encoded transaction bytes.\\n */\\n function encodeTransaction(\\n Transaction memory _transaction\\n )\\n internal\\n pure\\n returns (\\n bytes memory\\n )\\n {\\n return abi.encodePacked(\\n _transaction.timestamp,\\n _transaction.blockNumber,\\n _transaction.l1QueueOrigin,\\n _transaction.l1TxOrigin,\\n _transaction.entrypoint,\\n _transaction.gasLimit,\\n _transaction.data\\n );\\n }\\n\\n /**\\n * Hashes a standard OVM transaction.\\n * @param _transaction OVM transaction to encode.\\n * @return Hashed transaction\\n */\\n function hashTransaction(\\n Transaction memory _transaction\\n )\\n internal\\n pure\\n returns (\\n bytes32\\n )\\n {\\n return keccak256(encodeTransaction(_transaction));\\n }\\n\\n /**\\n * Converts an OVM account to an EVM account.\\n * @param _in OVM account to convert.\\n * @return Converted EVM account.\\n */\\n function toEVMAccount(\\n Account memory _in\\n )\\n internal\\n pure\\n returns (\\n EVMAccount memory\\n )\\n {\\n return EVMAccount({\\n nonce: _in.nonce,\\n balance: _in.balance,\\n storageRoot: _in.storageRoot,\\n codeHash: _in.codeHash\\n });\\n }\\n\\n /**\\n * @notice RLP-encodes an account state struct.\\n * @param _account Account state struct.\\n * @return RLP-encoded account state.\\n */\\n function encodeEVMAccount(\\n EVMAccount memory _account\\n )\\n internal\\n pure\\n returns (\\n bytes memory\\n )\\n {\\n bytes[] memory raw = new bytes[](4);\\n\\n // Unfortunately we can't create this array outright because\\n // Lib_RLPWriter.writeList will reject fixed-size arrays. Assigning\\n // index-by-index circumvents this issue.\\n raw[0] = Lib_RLPWriter.writeBytes(\\n Lib_Bytes32Utils.removeLeadingZeros(\\n bytes32(_account.nonce)\\n )\\n );\\n raw[1] = Lib_RLPWriter.writeBytes(\\n Lib_Bytes32Utils.removeLeadingZeros(\\n bytes32(_account.balance)\\n )\\n );\\n raw[2] = Lib_RLPWriter.writeBytes(abi.encodePacked(_account.storageRoot));\\n raw[3] = Lib_RLPWriter.writeBytes(abi.encodePacked(_account.codeHash));\\n\\n return Lib_RLPWriter.writeList(raw);\\n }\\n\\n /**\\n * @notice Decodes an RLP-encoded account state into a useful struct.\\n * @param _encoded RLP-encoded account state.\\n * @return Account state struct.\\n */\\n function decodeEVMAccount(\\n bytes memory _encoded\\n )\\n internal\\n pure\\n returns (\\n EVMAccount memory\\n )\\n {\\n Lib_RLPReader.RLPItem[] memory accountState = Lib_RLPReader.readList(_encoded);\\n\\n return EVMAccount({\\n nonce: Lib_RLPReader.readUint256(accountState[0]),\\n balance: Lib_RLPReader.readUint256(accountState[1]),\\n storageRoot: Lib_RLPReader.readBytes32(accountState[2]),\\n codeHash: Lib_RLPReader.readBytes32(accountState[3])\\n });\\n }\\n\\n /**\\n * Calculates a hash for a given batch header.\\n * @param _batchHeader Header to hash.\\n * @return Hash of the header.\\n */\\n function hashBatchHeader(\\n Lib_OVMCodec.ChainBatchHeader memory _batchHeader\\n )\\n internal\\n pure\\n returns (\\n bytes32\\n )\\n {\\n return keccak256(\\n abi.encode(\\n _batchHeader.batchRoot,\\n _batchHeader.batchSize,\\n _batchHeader.prevTotalElements,\\n _batchHeader.extraData\\n )\\n );\\n }\\n}\\n\",\"keccak256\":\"0xd85ba2066057a2677926f484b938c7c2ef33ff3853f3b71cda252f4a54f30e05\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* External Imports */\\nimport { Ownable } from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\n/**\\n * @title Lib_AddressManager\\n */\\ncontract Lib_AddressManager is Ownable {\\n\\n /**********\\n * Events *\\n **********/\\n\\n event AddressSet(\\n string _name,\\n address _newAddress\\n );\\n\\n\\n /*************\\n * Variables *\\n *************/\\n\\n mapping (bytes32 => address) private addresses;\\n\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Changes the address associated with a particular name.\\n * @param _name String name to associate an address with.\\n * @param _address Address to associate with the name.\\n */\\n function setAddress(\\n string memory _name,\\n address _address\\n )\\n public\\n onlyOwner\\n {\\n addresses[_getNameHash(_name)] = _address;\\n\\n emit AddressSet(\\n _name,\\n _address\\n );\\n }\\n\\n /**\\n * Retrieves the address associated with a given name.\\n * @param _name Name to retrieve an address for.\\n * @return Address associated with the given name.\\n */\\n function getAddress(\\n string memory _name\\n )\\n public\\n view\\n returns (\\n address\\n )\\n {\\n return addresses[_getNameHash(_name)];\\n }\\n\\n\\n /**********************\\n * Internal Functions *\\n **********************/\\n\\n /**\\n * Computes the hash of a name.\\n * @param _name Name to compute a hash for.\\n * @return Hash of the given name.\\n */\\n function _getNameHash(\\n string memory _name\\n )\\n internal\\n pure\\n returns (\\n bytes32\\n )\\n {\\n return keccak256(abi.encodePacked(_name));\\n }\\n}\\n\",\"keccak256\":\"0x2ce671a0e004df88b136bea5a3c59d0732cea8887c8496da1d509e0200b03d7d\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/resolver/Lib_AddressResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* Library Imports */\\nimport { Lib_AddressManager } from \\\"./Lib_AddressManager.sol\\\";\\n\\n/**\\n * @title Lib_AddressResolver\\n */\\nabstract contract Lib_AddressResolver {\\n\\n /*************\\n * Variables *\\n *************/\\n\\n Lib_AddressManager public libAddressManager;\\n\\n\\n /***************\\n * Constructor *\\n ***************/\\n\\n /**\\n * @param _libAddressManager Address of the Lib_AddressManager.\\n */\\n constructor(\\n address _libAddressManager\\n ) {\\n libAddressManager = Lib_AddressManager(_libAddressManager);\\n }\\n\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Resolves the address associated with a given name.\\n * @param _name Name to resolve an address for.\\n * @return Address associated with the given name.\\n */\\n function resolve(\\n string memory _name\\n )\\n public\\n view\\n returns (\\n address\\n )\\n {\\n return libAddressManager.getAddress(_name);\\n }\\n}\\n\",\"keccak256\":\"0x65981feeabff6a81783ea97d44baf988a18a86c8cb374c46fdb71819cbacc7c0\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/rlp/Lib_RLPReader.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/**\\n * @title Lib_RLPReader\\n * @dev Adapted from \\\"RLPReader\\\" by Hamdi Allam (hamdi.allam97@gmail.com).\\n */\\nlibrary Lib_RLPReader {\\n\\n /*************\\n * Constants *\\n *************/\\n\\n uint256 constant internal MAX_LIST_LENGTH = 32;\\n\\n\\n /*********\\n * Enums *\\n *********/\\n\\n enum RLPItemType {\\n DATA_ITEM,\\n LIST_ITEM\\n }\\n\\n\\n /***********\\n * Structs *\\n ***********/\\n\\n struct RLPItem {\\n uint256 length;\\n uint256 ptr;\\n }\\n\\n\\n /**********************\\n * Internal Functions *\\n **********************/\\n\\n /**\\n * Converts bytes to a reference to memory position and length.\\n * @param _in Input bytes to convert.\\n * @return Output memory reference.\\n */\\n function toRLPItem(\\n bytes memory _in\\n )\\n internal\\n pure\\n returns (\\n RLPItem memory\\n )\\n {\\n uint256 ptr;\\n assembly {\\n ptr := add(_in, 32)\\n }\\n\\n return RLPItem({\\n length: _in.length,\\n ptr: ptr\\n });\\n }\\n\\n /**\\n * Reads an RLP list value into a list of RLP items.\\n * @param _in RLP list value.\\n * @return Decoded RLP list items.\\n */\\n function readList(\\n RLPItem memory _in\\n )\\n internal\\n pure\\n returns (\\n RLPItem[] memory\\n )\\n {\\n (\\n uint256 listOffset,\\n ,\\n RLPItemType itemType\\n ) = _decodeLength(_in);\\n\\n require(\\n itemType == RLPItemType.LIST_ITEM,\\n \\\"Invalid RLP list value.\\\"\\n );\\n\\n // Solidity in-memory arrays can't be increased in size, but *can* be decreased in size by\\n // writing to the length. Since we can't know the number of RLP items without looping over\\n // the entire input, we'd have to loop twice to accurately size this array. It's easier to\\n // simply set a reasonable maximum list length and decrease the size before we finish.\\n RLPItem[] memory out = new RLPItem[](MAX_LIST_LENGTH);\\n\\n uint256 itemCount = 0;\\n uint256 offset = listOffset;\\n while (offset < _in.length) {\\n require(\\n itemCount < MAX_LIST_LENGTH,\\n \\\"Provided RLP list exceeds max list length.\\\"\\n );\\n\\n (\\n uint256 itemOffset,\\n uint256 itemLength,\\n ) = _decodeLength(RLPItem({\\n length: _in.length - offset,\\n ptr: _in.ptr + offset\\n }));\\n\\n out[itemCount] = RLPItem({\\n length: itemLength + itemOffset,\\n ptr: _in.ptr + offset\\n });\\n\\n itemCount += 1;\\n offset += itemOffset + itemLength;\\n }\\n\\n // Decrease the array size to match the actual item count.\\n assembly {\\n mstore(out, itemCount)\\n }\\n\\n return out;\\n }\\n\\n /**\\n * Reads an RLP list value into a list of RLP items.\\n * @param _in RLP list value.\\n * @return Decoded RLP list items.\\n */\\n function readList(\\n bytes memory _in\\n )\\n internal\\n pure\\n returns (\\n RLPItem[] memory\\n )\\n {\\n return readList(\\n toRLPItem(_in)\\n );\\n }\\n\\n /**\\n * Reads an RLP bytes value into bytes.\\n * @param _in RLP bytes value.\\n * @return Decoded bytes.\\n */\\n function readBytes(\\n RLPItem memory _in\\n )\\n internal\\n pure\\n returns (\\n bytes memory\\n )\\n {\\n (\\n uint256 itemOffset,\\n uint256 itemLength,\\n RLPItemType itemType\\n ) = _decodeLength(_in);\\n\\n require(\\n itemType == RLPItemType.DATA_ITEM,\\n \\\"Invalid RLP bytes value.\\\"\\n );\\n\\n return _copy(_in.ptr, itemOffset, itemLength);\\n }\\n\\n /**\\n * Reads an RLP bytes value into bytes.\\n * @param _in RLP bytes value.\\n * @return Decoded bytes.\\n */\\n function readBytes(\\n bytes memory _in\\n )\\n internal\\n pure\\n returns (\\n bytes memory\\n )\\n {\\n return readBytes(\\n toRLPItem(_in)\\n );\\n }\\n\\n /**\\n * Reads an RLP string value into a string.\\n * @param _in RLP string value.\\n * @return Decoded string.\\n */\\n function readString(\\n RLPItem memory _in\\n )\\n internal\\n pure\\n returns (\\n string memory\\n )\\n {\\n return string(readBytes(_in));\\n }\\n\\n /**\\n * Reads an RLP string value into a string.\\n * @param _in RLP string value.\\n * @return Decoded string.\\n */\\n function readString(\\n bytes memory _in\\n )\\n internal\\n pure\\n returns (\\n string memory\\n )\\n {\\n return readString(\\n toRLPItem(_in)\\n );\\n }\\n\\n /**\\n * Reads an RLP bytes32 value into a bytes32.\\n * @param _in RLP bytes32 value.\\n * @return Decoded bytes32.\\n */\\n function readBytes32(\\n RLPItem memory _in\\n )\\n internal\\n pure\\n returns (\\n bytes32\\n )\\n {\\n require(\\n _in.length <= 33,\\n \\\"Invalid RLP bytes32 value.\\\"\\n );\\n\\n (\\n uint256 itemOffset,\\n uint256 itemLength,\\n RLPItemType itemType\\n ) = _decodeLength(_in);\\n\\n require(\\n itemType == RLPItemType.DATA_ITEM,\\n \\\"Invalid RLP bytes32 value.\\\"\\n );\\n\\n uint256 ptr = _in.ptr + itemOffset;\\n bytes32 out;\\n assembly {\\n out := mload(ptr)\\n\\n // Shift the bytes over to match the item size.\\n if lt(itemLength, 32) {\\n out := div(out, exp(256, sub(32, itemLength)))\\n }\\n }\\n\\n return out;\\n }\\n\\n /**\\n * Reads an RLP bytes32 value into a bytes32.\\n * @param _in RLP bytes32 value.\\n * @return Decoded bytes32.\\n */\\n function readBytes32(\\n bytes memory _in\\n )\\n internal\\n pure\\n returns (\\n bytes32\\n )\\n {\\n return readBytes32(\\n toRLPItem(_in)\\n );\\n }\\n\\n /**\\n * Reads an RLP uint256 value into a uint256.\\n * @param _in RLP uint256 value.\\n * @return Decoded uint256.\\n */\\n function readUint256(\\n RLPItem memory _in\\n )\\n internal\\n pure\\n returns (\\n uint256\\n )\\n {\\n return uint256(readBytes32(_in));\\n }\\n\\n /**\\n * Reads an RLP uint256 value into a uint256.\\n * @param _in RLP uint256 value.\\n * @return Decoded uint256.\\n */\\n function readUint256(\\n bytes memory _in\\n )\\n internal\\n pure\\n returns (\\n uint256\\n )\\n {\\n return readUint256(\\n toRLPItem(_in)\\n );\\n }\\n\\n /**\\n * Reads an RLP bool value into a bool.\\n * @param _in RLP bool value.\\n * @return Decoded bool.\\n */\\n function readBool(\\n RLPItem memory _in\\n )\\n internal\\n pure\\n returns (\\n bool\\n )\\n {\\n require(\\n _in.length == 1,\\n \\\"Invalid RLP boolean value.\\\"\\n );\\n\\n uint256 ptr = _in.ptr;\\n uint256 out;\\n assembly {\\n out := byte(0, mload(ptr))\\n }\\n\\n require(\\n out == 0 || out == 1,\\n \\\"Lib_RLPReader: Invalid RLP boolean value, must be 0 or 1\\\"\\n );\\n\\n return out != 0;\\n }\\n\\n /**\\n * Reads an RLP bool value into a bool.\\n * @param _in RLP bool value.\\n * @return Decoded bool.\\n */\\n function readBool(\\n bytes memory _in\\n )\\n internal\\n pure\\n returns (\\n bool\\n )\\n {\\n return readBool(\\n toRLPItem(_in)\\n );\\n }\\n\\n /**\\n * Reads an RLP address value into a address.\\n * @param _in RLP address value.\\n * @return Decoded address.\\n */\\n function readAddress(\\n RLPItem memory _in\\n )\\n internal\\n pure\\n returns (\\n address\\n )\\n {\\n if (_in.length == 1) {\\n return address(0);\\n }\\n\\n require(\\n _in.length == 21,\\n \\\"Invalid RLP address value.\\\"\\n );\\n\\n return address(readUint256(_in));\\n }\\n\\n /**\\n * Reads an RLP address value into a address.\\n * @param _in RLP address value.\\n * @return Decoded address.\\n */\\n function readAddress(\\n bytes memory _in\\n )\\n internal\\n pure\\n returns (\\n address\\n )\\n {\\n return readAddress(\\n toRLPItem(_in)\\n );\\n }\\n\\n /**\\n * Reads the raw bytes of an RLP item.\\n * @param _in RLP item to read.\\n * @return Raw RLP bytes.\\n */\\n function readRawBytes(\\n RLPItem memory _in\\n )\\n internal\\n pure\\n returns (\\n bytes memory\\n )\\n {\\n return _copy(_in);\\n }\\n\\n\\n /*********************\\n * Private Functions *\\n *********************/\\n\\n /**\\n * Decodes the length of an RLP item.\\n * @param _in RLP item to decode.\\n * @return Offset of the encoded data.\\n * @return Length of the encoded data.\\n * @return RLP item type (LIST_ITEM or DATA_ITEM).\\n */\\n function _decodeLength(\\n RLPItem memory _in\\n )\\n private\\n pure\\n returns (\\n uint256,\\n uint256,\\n RLPItemType\\n )\\n {\\n require(\\n _in.length > 0,\\n \\\"RLP item cannot be null.\\\"\\n );\\n\\n uint256 ptr = _in.ptr;\\n uint256 prefix;\\n assembly {\\n prefix := byte(0, mload(ptr))\\n }\\n\\n if (prefix <= 0x7f) {\\n // Single byte.\\n\\n return (0, 1, RLPItemType.DATA_ITEM);\\n } else if (prefix <= 0xb7) {\\n // Short string.\\n\\n uint256 strLen = prefix - 0x80;\\n\\n require(\\n _in.length > strLen,\\n \\\"Invalid RLP short string.\\\"\\n );\\n\\n return (1, strLen, RLPItemType.DATA_ITEM);\\n } else if (prefix <= 0xbf) {\\n // Long string.\\n uint256 lenOfStrLen = prefix - 0xb7;\\n\\n require(\\n _in.length > lenOfStrLen,\\n \\\"Invalid RLP long string length.\\\"\\n );\\n\\n uint256 strLen;\\n assembly {\\n // Pick out the string length.\\n strLen := div(\\n mload(add(ptr, 1)),\\n exp(256, sub(32, lenOfStrLen))\\n )\\n }\\n\\n require(\\n _in.length > lenOfStrLen + strLen,\\n \\\"Invalid RLP long string.\\\"\\n );\\n\\n return (1 + lenOfStrLen, strLen, RLPItemType.DATA_ITEM);\\n } else if (prefix <= 0xf7) {\\n // Short list.\\n uint256 listLen = prefix - 0xc0;\\n\\n require(\\n _in.length > listLen,\\n \\\"Invalid RLP short list.\\\"\\n );\\n\\n return (1, listLen, RLPItemType.LIST_ITEM);\\n } else {\\n // Long list.\\n uint256 lenOfListLen = prefix - 0xf7;\\n\\n require(\\n _in.length > lenOfListLen,\\n \\\"Invalid RLP long list length.\\\"\\n );\\n\\n uint256 listLen;\\n assembly {\\n // Pick out the list length.\\n listLen := div(\\n mload(add(ptr, 1)),\\n exp(256, sub(32, lenOfListLen))\\n )\\n }\\n\\n require(\\n _in.length > lenOfListLen + listLen,\\n \\\"Invalid RLP long list.\\\"\\n );\\n\\n return (1 + lenOfListLen, listLen, RLPItemType.LIST_ITEM);\\n }\\n }\\n\\n /**\\n * Copies the bytes from a memory location.\\n * @param _src Pointer to the location to read from.\\n * @param _offset Offset to start reading from.\\n * @param _length Number of bytes to read.\\n * @return Copied bytes.\\n */\\n function _copy(\\n uint256 _src,\\n uint256 _offset,\\n uint256 _length\\n )\\n private\\n pure\\n returns (\\n bytes memory\\n )\\n {\\n bytes memory out = new bytes(_length);\\n if (out.length == 0) {\\n return out;\\n }\\n\\n uint256 src = _src + _offset;\\n uint256 dest;\\n assembly {\\n dest := add(out, 32)\\n }\\n\\n // Copy over as many complete words as we can.\\n for (uint256 i = 0; i < _length / 32; i++) {\\n assembly {\\n mstore(dest, mload(src))\\n }\\n\\n src += 32;\\n dest += 32;\\n }\\n\\n // Pick out the remaining bytes.\\n uint256 mask = 256 ** (32 - (_length % 32)) - 1;\\n assembly {\\n mstore(\\n dest,\\n or(\\n and(mload(src), not(mask)),\\n and(mload(dest), mask)\\n )\\n )\\n }\\n\\n return out;\\n }\\n\\n /**\\n * Copies an RLP item into bytes.\\n * @param _in RLP item to copy.\\n * @return Copied bytes.\\n */\\n function _copy(\\n RLPItem memory _in\\n )\\n private\\n pure\\n returns (\\n bytes memory\\n )\\n {\\n return _copy(_in.ptr, 0, _in.length);\\n }\\n}\\n\",\"keccak256\":\"0x829174c61216dce35fdb888383b6022e0365eb7fbdc71ad79d98b108091969fe\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/rlp/Lib_RLPWriter.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\npragma experimental ABIEncoderV2;\\n\\n/**\\n * @title Lib_RLPWriter\\n * @author Bakaoh (with modifications)\\n */\\nlibrary Lib_RLPWriter {\\n\\n /**********************\\n * Internal Functions *\\n **********************/\\n\\n /**\\n * RLP encodes a byte string.\\n * @param _in The byte string to encode.\\n * @return The RLP encoded string in bytes.\\n */\\n function writeBytes(\\n bytes memory _in\\n )\\n internal\\n pure\\n returns (\\n bytes memory\\n )\\n {\\n bytes memory encoded;\\n\\n if (_in.length == 1 && uint8(_in[0]) < 128) {\\n encoded = _in;\\n } else {\\n encoded = abi.encodePacked(_writeLength(_in.length, 128), _in);\\n }\\n\\n return encoded;\\n }\\n\\n /**\\n * RLP encodes a list of RLP encoded byte byte strings.\\n * @param _in The list of RLP encoded byte strings.\\n * @return The RLP encoded list of items in bytes.\\n */\\n function writeList(\\n bytes[] memory _in\\n )\\n internal\\n pure\\n returns (\\n bytes memory\\n )\\n {\\n bytes memory list = _flatten(_in);\\n return abi.encodePacked(_writeLength(list.length, 192), list);\\n }\\n\\n /**\\n * RLP encodes a string.\\n * @param _in The string to encode.\\n * @return The RLP encoded string in bytes.\\n */\\n function writeString(\\n string memory _in\\n )\\n internal\\n pure\\n returns (\\n bytes memory\\n )\\n {\\n return writeBytes(bytes(_in));\\n }\\n\\n /**\\n * RLP encodes an address.\\n * @param _in The address to encode.\\n * @return The RLP encoded address in bytes.\\n */\\n function writeAddress(\\n address _in\\n )\\n internal\\n pure\\n returns (\\n bytes memory\\n )\\n {\\n return writeBytes(abi.encodePacked(_in));\\n }\\n\\n /**\\n * RLP encodes a bytes32 value.\\n * @param _in The bytes32 to encode.\\n * @return _out The RLP encoded bytes32 in bytes.\\n */\\n function writeBytes32(\\n bytes32 _in\\n )\\n internal\\n pure\\n returns (\\n bytes memory _out\\n )\\n {\\n return writeBytes(abi.encodePacked(_in));\\n }\\n\\n /**\\n * RLP encodes a uint.\\n * @param _in The uint256 to encode.\\n * @return The RLP encoded uint256 in bytes.\\n */\\n function writeUint(\\n uint256 _in\\n )\\n internal\\n pure\\n returns (\\n bytes memory\\n )\\n {\\n return writeBytes(_toBinary(_in));\\n }\\n\\n /**\\n * RLP encodes a bool.\\n * @param _in The bool to encode.\\n * @return The RLP encoded bool in bytes.\\n */\\n function writeBool(\\n bool _in\\n )\\n internal\\n pure\\n returns (\\n bytes memory\\n )\\n {\\n bytes memory encoded = new bytes(1);\\n encoded[0] = (_in ? bytes1(0x01) : bytes1(0x80));\\n return encoded;\\n }\\n\\n\\n /*********************\\n * Private Functions *\\n *********************/\\n\\n /**\\n * Encode the first byte, followed by the `len` in binary form if `length` is more than 55.\\n * @param _len The length of the string or the payload.\\n * @param _offset 128 if item is string, 192 if item is list.\\n * @return RLP encoded bytes.\\n */\\n function _writeLength(\\n uint256 _len,\\n uint256 _offset\\n )\\n private\\n pure\\n returns (\\n bytes memory\\n )\\n {\\n bytes memory encoded;\\n\\n if (_len < 56) {\\n encoded = new bytes(1);\\n encoded[0] = byte(uint8(_len) + uint8(_offset));\\n } else {\\n uint256 lenLen;\\n uint256 i = 1;\\n while (_len / i != 0) {\\n lenLen++;\\n i *= 256;\\n }\\n\\n encoded = new bytes(lenLen + 1);\\n encoded[0] = byte(uint8(lenLen) + uint8(_offset) + 55);\\n for(i = 1; i <= lenLen; i++) {\\n encoded[i] = byte(uint8((_len / (256**(lenLen-i))) % 256));\\n }\\n }\\n\\n return encoded;\\n }\\n\\n /**\\n * Encode integer in big endian binary form with no leading zeroes.\\n * @notice TODO: This should be optimized with assembly to save gas costs.\\n * @param _x The integer to encode.\\n * @return RLP encoded bytes.\\n */\\n function _toBinary(\\n uint256 _x\\n )\\n private\\n pure\\n returns (\\n bytes memory\\n )\\n {\\n bytes memory b = abi.encodePacked(_x);\\n\\n uint256 i = 0;\\n for (; i < 32; i++) {\\n if (b[i] != 0) {\\n break;\\n }\\n }\\n\\n bytes memory res = new bytes(32 - i);\\n for (uint256 j = 0; j < res.length; j++) {\\n res[j] = b[i++];\\n }\\n\\n return res;\\n }\\n\\n /**\\n * Copies a piece of memory to another location.\\n * @notice From: https://github.com/Arachnid/solidity-stringutils/blob/master/src/strings.sol.\\n * @param _dest Destination location.\\n * @param _src Source location.\\n * @param _len Length of memory to copy.\\n */\\n function _memcpy(\\n uint256 _dest,\\n uint256 _src,\\n uint256 _len\\n )\\n private\\n pure\\n {\\n uint256 dest = _dest;\\n uint256 src = _src;\\n uint256 len = _len;\\n\\n for(; len >= 32; len -= 32) {\\n assembly {\\n mstore(dest, mload(src))\\n }\\n dest += 32;\\n src += 32;\\n }\\n\\n uint256 mask = 256 ** (32 - len) - 1;\\n assembly {\\n let srcpart := and(mload(src), not(mask))\\n let destpart := and(mload(dest), mask)\\n mstore(dest, or(destpart, srcpart))\\n }\\n }\\n\\n /**\\n * Flattens a list of byte strings into one byte string.\\n * @notice From: https://github.com/sammayo/solidity-rlp-encoder/blob/master/RLPEncode.sol.\\n * @param _list List of byte strings to flatten.\\n * @return The flattened byte string.\\n */\\n function _flatten(\\n bytes[] memory _list\\n )\\n private\\n pure\\n returns (\\n bytes memory\\n )\\n {\\n if (_list.length == 0) {\\n return new bytes(0);\\n }\\n\\n uint256 len;\\n uint256 i = 0;\\n for (; i < _list.length; i++) {\\n len += _list[i].length;\\n }\\n\\n bytes memory flattened = new bytes(len);\\n uint256 flattenedPtr;\\n assembly { flattenedPtr := add(flattened, 0x20) }\\n\\n for(i = 0; i < _list.length; i++) {\\n bytes memory item = _list[i];\\n\\n uint256 listPtr;\\n assembly { listPtr := add(item, 0x20)}\\n\\n _memcpy(flattenedPtr, listPtr, item.length);\\n flattenedPtr += _list[i].length;\\n }\\n\\n return flattened;\\n }\\n}\\n\",\"keccak256\":\"0xb60ee4b03ad372c3deff21d454ab714dd0c18ee3e6f9d45532e209fc59d5a54d\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/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 (_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 (\\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\":\"0xa5195afe32fb2cf104d156e8f4bd39df1ec79bf6ba232097b9e8e0ee14fbc298\",\"license\":\"MIT\"}},\"version\":1}",
"bytecode": "0x608060405234801561001057600080fd5b50604051610a22380380610a2283398101604081905261002f91610054565b600080546001600160a01b0319166001600160a01b0392909216919091179055610082565b600060208284031215610065578081fd5b81516001600160a01b038116811461007b578182fd5b9392505050565b610991806100916000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c806316e9cd9b14610046578063299ca4781461005b578063461a447814610079575b600080fd5b61005961005436600461057d565b61008c565b005b6100636101ea565b60405161007091906106db565b60405180910390f35b6100636100873660046105ec565b6101f9565b6100ca6040518060400160405280601981526020017f4f564d5f4c3242617463684d65737361676552656c61796572000000000000008152506101f9565b6001600160a01b0316336001600160a01b0316146101035760405162461bcd60e51b81526004016100fa906107d7565b60405180910390fd5b600061012660405180606001604052806021815260200161093b602191396101f9565b905060005b828110156101e457600084848381811061014157fe5b9050602002810190610153919061085a565b61015c9061089d565b8051602082015160408084015160608501516080860151925163d7fd19dd60e01b81529596506001600160a01b0389169563d7fd19dd956101a5959094909392916004016106ef565b600060405180830381600087803b1580156101bf57600080fd5b505af11580156101d3573d6000803e3d6000fd5b50506001909301925061012b915050565b50505050565b6000546001600160a01b031681565b6000805460405163bf40fac160e01b81526020600482018181528551602484015285516001600160a01b039094169363bf40fac19387938392604490920191908501908083838b5b83811015610259578181015183820152602001610241565b50505050905090810190601f1680156102865780820380516001836020036101000a031916815260200191505b509250505060206040518083038186803b1580156102a357600080fd5b505afa1580156102b7573d6000803e3d6000fd5b505050506040513d60208110156102cd57600080fd5b505190505b919050565b600067ffffffffffffffff8311156102eb57fe5b6102fe601f8401601f1916602001610879565b905082815283838301111561031257600080fd5b828260208301376000602084830101529392505050565b80356001600160a01b03811681146102d257600080fd5b600082601f830112610350578081fd5b61035f838335602085016102d7565b9392505050565b600060a08284031215610377578081fd5b60405160a0810167ffffffffffffffff828210818311171561039557fe5b816040528293508435835260208501356020840152604085013560408401526060850135606084015260808501359150808211156103d257600080fd5b506103df85828601610340565b6080830152505092915050565b6000604082840312156103fd578081fd5b6040516040810167ffffffffffffffff828210818311171561041b57fe5b816040528293508435835260209150818501358181111561043b57600080fd5b8501601f8101871361044c57600080fd5b80358281111561045857fe5b8381029250610468848401610879565b8181528481019083860185850187018b101561048357600080fd5b600095505b838610156104a6578035835260019590950194918601918601610488565b5080868801525050505050505092915050565b600060a082840312156104ca578081fd5b6104d460a0610879565b905081358152602082013567ffffffffffffffff808211156104f557600080fd5b61050185838601610366565b6020840152604084013591508082111561051a57600080fd5b610526858386016103ec565b6040840152606084013591508082111561053f57600080fd5b61054b85838601610340565b6060840152608084013591508082111561056457600080fd5b5061057184828501610340565b60808301525092915050565b6000806020838503121561058f578182fd5b823567ffffffffffffffff808211156105a6578384fd5b818501915085601f8301126105b9578384fd5b8135818111156105c7578485fd5b86602080830285010111156105da578485fd5b60209290920196919550909350505050565b6000602082840312156105fd578081fd5b813567ffffffffffffffff811115610613578182fd5b8201601f81018413610623578182fd5b610632848235602084016102d7565b949350505050565b60008151808452815b8181101561065f57602081850181015186830182015201610643565b818111156106705782602083870101525b50601f01601f19169290920160200192915050565b6000604083018251845260208084015160408287015282815180855260608801915083830194508592505b808310156106d057845182529383019360019290920191908301906106b0565b509695505050505050565b6001600160a01b0391909116815260200190565b6001600160a01b0386811682528516602082015260a06040820181905260009061071b9083018661063a565b846060840152828103608084015283518152602084015160a06020830152805160a0830152602081015160c0830152604081015160e083015260608101516101008301526080810151905060a061012083015261077c61014083018261063a565b9050604085015182820360408401526107958282610685565b915050606085015182820360608401526107af828261063a565b915050608085015182820360808401526107c9828261063a565b9a9950505050505050505050565b60208082526057908201527f4f564d5f4c314d756c74694d65737361676552656c617965723a2046756e637460408201527f696f6e2063616e206f6e6c792062652063616c6c656420627920746865204f5660608201527f4d5f4c3242617463684d65737361676552656c61796572000000000000000000608082015260a00190565b60008235609e1983360301811261086f578182fd5b9190910192915050565b60405181810167ffffffffffffffff8111828210171561089557fe5b604052919050565b600060a082360312156108ae578081fd5b60405160a0810167ffffffffffffffff82821081831117156108cc57fe5b816040526108d985610329565b83526108e760208601610329565b602084015260408501359150808211156108ff578384fd5b61090b36838701610340565b604084015260608501356060840152608085013591508082111561092d578384fd5b50610571368286016104b956fe50726f78795f5f4f564d5f4c3143726f7373446f6d61696e4d657373656e676572a264697066735822122054e57719bdaae865a83549e03668e0558acc8a0d1d5ba65034f61a02d9a35c6264736f6c63430007060033",
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100415760003560e01c806316e9cd9b14610046578063299ca4781461005b578063461a447814610079575b600080fd5b61005961005436600461057d565b61008c565b005b6100636101ea565b60405161007091906106db565b60405180910390f35b6100636100873660046105ec565b6101f9565b6100ca6040518060400160405280601981526020017f4f564d5f4c3242617463684d65737361676552656c61796572000000000000008152506101f9565b6001600160a01b0316336001600160a01b0316146101035760405162461bcd60e51b81526004016100fa906107d7565b60405180910390fd5b600061012660405180606001604052806021815260200161093b602191396101f9565b905060005b828110156101e457600084848381811061014157fe5b9050602002810190610153919061085a565b61015c9061089d565b8051602082015160408084015160608501516080860151925163d7fd19dd60e01b81529596506001600160a01b0389169563d7fd19dd956101a5959094909392916004016106ef565b600060405180830381600087803b1580156101bf57600080fd5b505af11580156101d3573d6000803e3d6000fd5b50506001909301925061012b915050565b50505050565b6000546001600160a01b031681565b6000805460405163bf40fac160e01b81526020600482018181528551602484015285516001600160a01b039094169363bf40fac19387938392604490920191908501908083838b5b83811015610259578181015183820152602001610241565b50505050905090810190601f1680156102865780820380516001836020036101000a031916815260200191505b509250505060206040518083038186803b1580156102a357600080fd5b505afa1580156102b7573d6000803e3d6000fd5b505050506040513d60208110156102cd57600080fd5b505190505b919050565b600067ffffffffffffffff8311156102eb57fe5b6102fe601f8401601f1916602001610879565b905082815283838301111561031257600080fd5b828260208301376000602084830101529392505050565b80356001600160a01b03811681146102d257600080fd5b600082601f830112610350578081fd5b61035f838335602085016102d7565b9392505050565b600060a08284031215610377578081fd5b60405160a0810167ffffffffffffffff828210818311171561039557fe5b816040528293508435835260208501356020840152604085013560408401526060850135606084015260808501359150808211156103d257600080fd5b506103df85828601610340565b6080830152505092915050565b6000604082840312156103fd578081fd5b6040516040810167ffffffffffffffff828210818311171561041b57fe5b816040528293508435835260209150818501358181111561043b57600080fd5b8501601f8101871361044c57600080fd5b80358281111561045857fe5b8381029250610468848401610879565b8181528481019083860185850187018b101561048357600080fd5b600095505b838610156104a6578035835260019590950194918601918601610488565b5080868801525050505050505092915050565b600060a082840312156104ca578081fd5b6104d460a0610879565b905081358152602082013567ffffffffffffffff808211156104f557600080fd5b61050185838601610366565b6020840152604084013591508082111561051a57600080fd5b610526858386016103ec565b6040840152606084013591508082111561053f57600080fd5b61054b85838601610340565b6060840152608084013591508082111561056457600080fd5b5061057184828501610340565b60808301525092915050565b6000806020838503121561058f578182fd5b823567ffffffffffffffff808211156105a6578384fd5b818501915085601f8301126105b9578384fd5b8135818111156105c7578485fd5b86602080830285010111156105da578485fd5b60209290920196919550909350505050565b6000602082840312156105fd578081fd5b813567ffffffffffffffff811115610613578182fd5b8201601f81018413610623578182fd5b610632848235602084016102d7565b949350505050565b60008151808452815b8181101561065f57602081850181015186830182015201610643565b818111156106705782602083870101525b50601f01601f19169290920160200192915050565b6000604083018251845260208084015160408287015282815180855260608801915083830194508592505b808310156106d057845182529383019360019290920191908301906106b0565b509695505050505050565b6001600160a01b0391909116815260200190565b6001600160a01b0386811682528516602082015260a06040820181905260009061071b9083018661063a565b846060840152828103608084015283518152602084015160a06020830152805160a0830152602081015160c0830152604081015160e083015260608101516101008301526080810151905060a061012083015261077c61014083018261063a565b9050604085015182820360408401526107958282610685565b915050606085015182820360608401526107af828261063a565b915050608085015182820360808401526107c9828261063a565b9a9950505050505050505050565b60208082526057908201527f4f564d5f4c314d756c74694d65737361676552656c617965723a2046756e637460408201527f696f6e2063616e206f6e6c792062652063616c6c656420627920746865204f5660608201527f4d5f4c3242617463684d65737361676552656c61796572000000000000000000608082015260a00190565b60008235609e1983360301811261086f578182fd5b9190910192915050565b60405181810167ffffffffffffffff8111828210171561089557fe5b604052919050565b600060a082360312156108ae578081fd5b60405160a0810167ffffffffffffffff82821081831117156108cc57fe5b816040526108d985610329565b83526108e760208601610329565b602084015260408501359150808211156108ff578384fd5b61090b36838701610340565b604084015260608501356060840152608085013591508082111561092d578384fd5b50610571368286016104b956fe50726f78795f5f4f564d5f4c3143726f7373446f6d61696e4d657373656e676572a264697066735822122054e57719bdaae865a83549e03668e0558acc8a0d1d5ba65034f61a02d9a35c6264736f6c63430007060033",
"devdoc": {
"details": "The L1 Multi-Message Relayer contract is a gas efficiency optimization which enables the relayer to submit multiple messages in a single transaction to be relayed by the L1 Cross Domain Message Sender. Compiler used: solc Runtime target: EVM",
"kind": "dev",
"methods": {
"batchRelayMessages((address,address,bytes,uint256,(bytes32,(uint256,bytes32,uint256,uint256,bytes),(uint256,bytes32[]),bytes,bytes))[])": {
"params": {
"_messages": "An array of L2 to L1 messages"
}
},
"constructor": {
"params": {
"_libAddressManager": "Address of the Address Manager."
}
},
"resolve(string)": {
"params": {
"_name": "Name to resolve an address for."
},
"returns": {
"_0": "Address associated with the given name."
}
}
},
"title": "OVM_L1MultiMessageRelayer",
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {
"batchRelayMessages((address,address,bytes,uint256,(bytes32,(uint256,bytes32,uint256,uint256,bytes),(uint256,bytes32[]),bytes,bytes))[])": {
"notice": "Forwards multiple cross domain messages to the L1 Cross Domain Messenger for relaying"
},
"resolve(string)": {
"notice": "Resolves the address associated with a given name."
}
},
"version": 1
},
"storageLayout": {
"storage": [
{
"astId": 12800,
"contract": "contracts/optimistic-ethereum/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol:OVM_L1MultiMessageRelayer",
"label": "libAddressManager",
"offset": 0,
"slot": "0",
"type": "t_contract(Lib_AddressManager)12793"
}
],
"types": {
"t_contract(Lib_AddressManager)12793": {
"encoding": "inplace",
"label": "contract Lib_AddressManager",
"numberOfBytes": "20"
}
}
}
}
\ No newline at end of file
{
"address": "0xf0FaB0ce35a6d3F82b0B42f09A2734065908dB6a",
"abi": [
{
"inputs": [
{
"internalType": "bytes",
"name": "_bytecode",
"type": "bytes"
}
],
"name": "isBytecodeSafe",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "pure",
"type": "function"
}
],
"transactionHash": "0x3db100815c1e0b4b185f3eca0541d88c95348ba8e6a7beba8d0a96f6437544c3",
"receipt": {
"to": null,
"from": "0x18394B52d3Cb931dfA76F63251919D051953413d",
"contractAddress": "0xf0FaB0ce35a6d3F82b0B42f09A2734065908dB6a",
"transactionIndex": 1,
"gasUsed": "243548",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blockHash": "0xb26ad9738f8cc5da3a4e95a3e73bb4b26ca317503fa696d4dc1acdf8d12c63db",
"transactionHash": "0x3db100815c1e0b4b185f3eca0541d88c95348ba8e6a7beba8d0a96f6437544c3",
"logs": [],
"blockNumber": 24572875,
"cumulativeGasUsed": "288408",
"status": 1,
"byzantium": true
},
"args": [],
"solcInputHash": "5ee8e508e2c54cb5ac6783b4855b1558",
"metadata": "{\"compiler\":{\"version\":\"0.7.6+commit.7338295f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_bytecode\",\"type\":\"bytes\"}],\"name\":\"isBytecodeSafe\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"The Safety Checker verifies that contracts deployed on L2 do not contain any \\\"unsafe\\\" operations. An operation is considered unsafe if it would access state variables which are specific to the environment (ie. L1 or L2) in which it is executed, as this could be used to \\\"escape the sandbox\\\" of the OVM, resulting in non-deterministic fraud proofs. That is, an attacker would be able to \\\"prove fraud\\\" on an honestly applied transaction. Note that a \\\"safe\\\" contract requires opcodes to appear in a particular pattern; omission of \\\"unsafe\\\" opcodes is necessary, but not sufficient. Compiler used: solc Runtime target: EVM\",\"kind\":\"dev\",\"methods\":{\"isBytecodeSafe(bytes)\":{\"params\":{\"_bytecode\":\"The bytecode to safety check.\"},\"returns\":{\"_0\":\"`true` if the bytecode is safe, `false` otherwise.\"}}},\"title\":\"OVM_SafetyChecker\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"isBytecodeSafe(bytes)\":{\"notice\":\"Returns whether or not all of the provided bytecode is safe.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/optimistic-ethereum/OVM/execution/OVM_SafetyChecker.sol\":\"OVM_SafetyChecker\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/optimistic-ethereum/OVM/execution/OVM_SafetyChecker.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* Interface Imports */\\nimport { iOVM_SafetyChecker } from \\\"../../iOVM/execution/iOVM_SafetyChecker.sol\\\";\\n\\n/**\\n * @title OVM_SafetyChecker\\n * @dev The Safety Checker verifies that contracts deployed on L2 do not contain any\\n * \\\"unsafe\\\" operations. An operation is considered unsafe if it would access state variables which\\n * are specific to the environment (ie. L1 or L2) in which it is executed, as this could be used\\n * to \\\"escape the sandbox\\\" of the OVM, resulting in non-deterministic fraud proofs.\\n * That is, an attacker would be able to \\\"prove fraud\\\" on an honestly applied transaction.\\n * Note that a \\\"safe\\\" contract requires opcodes to appear in a particular pattern;\\n * omission of \\\"unsafe\\\" opcodes is necessary, but not sufficient.\\n *\\n * Compiler used: solc\\n * Runtime target: EVM\\n */\\ncontract OVM_SafetyChecker is iOVM_SafetyChecker {\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Returns whether or not all of the provided bytecode is safe.\\n * @param _bytecode The bytecode to safety check.\\n * @return `true` if the bytecode is safe, `false` otherwise.\\n */\\n function isBytecodeSafe(\\n bytes memory _bytecode\\n )\\n override\\n external\\n pure\\n returns (\\n bool\\n )\\n {\\n // autogenerated by gen_safety_checker_constants.py\\n // number of bytes to skip for each opcode\\n uint256[8] memory opcodeSkippableBytes = [\\n uint256(0x0001010101010101010101010000000001010101010101010101010101010000),\\n uint256(0x0100000000000000000000000000000000000000010101010101000000010100),\\n uint256(0x0000000000000000000000000000000001010101000000010101010100000000),\\n uint256(0x0203040500000000000000000000000000000000000000000000000000000000),\\n uint256(0x0101010101010101010101010101010101010101010101010101010101010101),\\n uint256(0x0101010101000000000000000000000000000000000000000000000000000000),\\n uint256(0x0000000000000000000000000000000000000000000000000000000000000000),\\n uint256(0x0000000000000000000000000000000000000000000000000000000000000000)\\n ];\\n // Mask to gate opcode specific cases\\n uint256 opcodeGateMask = ~uint256(0xffffffffffffffffffffffe000000000fffffffff070ffff9c0ffffec000f001);\\n // Halting opcodes\\n uint256 opcodeHaltingMask = ~uint256(0x4008000000000000000000000000000000000000004000000000000000000001);\\n // PUSH opcodes\\n uint256 opcodePushMask = ~uint256(0xffffffff000000000000000000000000);\\n\\n uint256 codeLength;\\n uint256 _pc;\\n assembly {\\n _pc := add(_bytecode, 0x20)\\n }\\n codeLength = _pc + _bytecode.length;\\n do {\\n // current opcode: 0x00...0xff\\n uint256 opNum;\\n\\n // inline assembly removes the extra add + bounds check\\n assembly {\\n let word := mload(_pc) //load the next 32 bytes at pc into word\\n\\n // Look up number of bytes to skip from opcodeSkippableBytes and then update indexInWord\\n // E.g. the 02030405 in opcodeSkippableBytes is the number of bytes to skip for PUSH1->4\\n // We repeat this 6 times, thus we can only skip bytes for up to PUSH4 ((1+4) * 6 = 30 < 32).\\n // If we see an opcode that is listed as 0 skippable bytes e.g. PUSH5,\\n // then we will get stuck on that indexInWord and then opNum will be set to the PUSH5 opcode.\\n let indexInWord := byte(0, mload(add(opcodeSkippableBytes, byte(0, word))))\\n indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))\\n indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))\\n indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))\\n indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))\\n indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))\\n _pc := add(_pc, indexInWord)\\n\\n opNum := byte(indexInWord, word)\\n }\\n\\n // + push opcodes\\n // + stop opcodes [STOP(0x00),JUMP(0x56),RETURN(0xf3),INVALID(0xfe)]\\n // + caller opcode CALLER(0x33)\\n // + blacklisted opcodes\\n uint256 opBit = 1 << opNum;\\n if (opBit & opcodeGateMask == 0) {\\n if (opBit & opcodePushMask == 0) {\\n // all pushes are valid opcodes\\n // subsequent bytes are not opcodes. Skip them.\\n _pc += (opNum - 0x5e); // PUSH1 is 0x60, so opNum-0x5f = PUSHed bytes and we +1 to\\n // skip the _pc++; line below in order to save gas ((-0x5f + 1) = -0x5e)\\n continue;\\n } else if (opBit & opcodeHaltingMask == 0) {\\n // STOP or JUMP or RETURN or INVALID (Note: REVERT is blacklisted, so not included here)\\n // We are now inside unreachable code until we hit a JUMPDEST!\\n do {\\n _pc++;\\n assembly {\\n opNum := byte(0, mload(_pc))\\n }\\n // encountered a JUMPDEST\\n if (opNum == 0x5b) break;\\n // skip PUSHed bytes\\n if ((1 << opNum) & opcodePushMask == 0) _pc += (opNum - 0x5f); // opNum-0x5f = PUSHed bytes (PUSH1 is 0x60)\\n } while (_pc < codeLength);\\n // opNum is 0x5b, so we don't continue here since the pc++ is fine\\n } else if (opNum == 0x33) { // Caller opcode\\n uint256 firstOps; // next 32 bytes of bytecode\\n uint256 secondOps; // following 32 bytes of bytecode\\n\\n assembly {\\n firstOps := mload(_pc)\\n // 37 bytes total, 5 left over --> 32 - 5 bytes = 27 bytes = 216 bits\\n secondOps := shr(216, mload(add(_pc, 0x20)))\\n }\\n\\n // Call identity precompile\\n // CALLER POP PUSH1 0x00 PUSH1 0x04 GAS CALL\\n // 32 - 8 bytes = 24 bytes = 192\\n if ((firstOps >> 192) == 0x3350600060045af1) {\\n _pc += 8;\\n // Call EM and abort execution if instructed\\n // CALLER PUSH1 0x00 SWAP1 GAS CALL PC PUSH1 0x0E ADD JUMPI RETURNDATASIZE PUSH1 0x00 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x00 REVERT JUMPDEST RETURNDATASIZE PUSH1 0x01 EQ ISZERO PC PUSH1 0x0a ADD JUMPI PUSH1 0x01 PUSH1 0x00 RETURN JUMPDEST\\n } else if (firstOps == 0x336000905af158600e01573d6000803e3d6000fd5b3d6001141558600a015760 && secondOps == 0x016000f35b) {\\n _pc += 37;\\n } else {\\n return false;\\n }\\n continue;\\n } else {\\n // encountered a non-whitelisted opcode!\\n return false;\\n }\\n }\\n _pc++;\\n } while (_pc < codeLength);\\n return true;\\n }\\n}\\n\",\"keccak256\":\"0x44cd4fcdcb25a233fa98da5ba66706ce2f9fbf13359cf7f2891793739687a86f\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/iOVM/execution/iOVM_SafetyChecker.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/**\\n * @title iOVM_SafetyChecker\\n */\\ninterface iOVM_SafetyChecker {\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n function isBytecodeSafe(bytes calldata _bytecode) external pure returns (bool);\\n}\\n\",\"keccak256\":\"0xde6639676d4ec4f77297652d5ede2429bc93e74e11fefd9e9de4bc92dd784878\",\"license\":\"MIT\"}},\"version\":1}",
"bytecode": "0x608060405234801561001057600080fd5b50610373806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063a44eb59a14610030575b600080fd5b6100d66004803603602081101561004657600080fd5b81019060208101813564010000000081111561006157600080fd5b82018360208201111561007357600080fd5b8035906020019184600183028401116401000000008311171561009557600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506100ea945050505050565b604080519115158252519081900360200190f35b60408051610100810182527e0101010101010101010101000000000101010101010101010101010101000081526b010101010101000000010100600160f81b016020808301919091526f0101010100000001010101010000000092820192909252630203040560e01b60608201527f0101010101010101010101010101010101010101010101010101010101010101608082015264010101010160d81b60a0820152600060c0820181905260e0820181905283519092741fffffffff000000000f8f000063f000013fff0ffe916a40000000000000000000026117ff60f31b039163ffffffff60601b1991870181019087015b8051600081811a880151811a82811a890151821a0182811a890151821a0182811a890151821a0182811a890151821a0182811a89015190911a01918201911a6001811b86811661032057808516610239575001605d1901610326565b80861661027e575b8280600101935050825160001a915081605b141561025e57610279565b6001821b851661027157918101605e1901915b838310610241575b610320565b816033141561030f578251602084015160d81c673350600060045af160c083901c14156102b057600885019450610306565b817f336000905af158600e01573d6000803e3d6000fd5b3d6001141558600a0157601480156102e357508064016000f35b145b156102f357602585019450610306565b60009a5050505050505050505050610338565b50505050610326565b600098505050505050505050610338565b50506001015b8181106101dd57600196505050505050505b91905056fea26469706673582212209a836b268dcf58167a9f65bb872e3ddb5bd93b231f6b456f1c5e6d75b92a746364736f6c63430007060033",
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063a44eb59a14610030575b600080fd5b6100d66004803603602081101561004657600080fd5b81019060208101813564010000000081111561006157600080fd5b82018360208201111561007357600080fd5b8035906020019184600183028401116401000000008311171561009557600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506100ea945050505050565b604080519115158252519081900360200190f35b60408051610100810182527e0101010101010101010101000000000101010101010101010101010101000081526b010101010101000000010100600160f81b016020808301919091526f0101010100000001010101010000000092820192909252630203040560e01b60608201527f0101010101010101010101010101010101010101010101010101010101010101608082015264010101010160d81b60a0820152600060c0820181905260e0820181905283519092741fffffffff000000000f8f000063f000013fff0ffe916a40000000000000000000026117ff60f31b039163ffffffff60601b1991870181019087015b8051600081811a880151811a82811a890151821a0182811a890151821a0182811a890151821a0182811a890151821a0182811a89015190911a01918201911a6001811b86811661032057808516610239575001605d1901610326565b80861661027e575b8280600101935050825160001a915081605b141561025e57610279565b6001821b851661027157918101605e1901915b838310610241575b610320565b816033141561030f578251602084015160d81c673350600060045af160c083901c14156102b057600885019450610306565b817f336000905af158600e01573d6000803e3d6000fd5b3d6001141558600a0157601480156102e357508064016000f35b145b156102f357602585019450610306565b60009a5050505050505050505050610338565b50505050610326565b600098505050505050505050610338565b50506001015b8181106101dd57600196505050505050505b91905056fea26469706673582212209a836b268dcf58167a9f65bb872e3ddb5bd93b231f6b456f1c5e6d75b92a746364736f6c63430007060033",
"devdoc": {
"details": "The Safety Checker verifies that contracts deployed on L2 do not contain any \"unsafe\" operations. An operation is considered unsafe if it would access state variables which are specific to the environment (ie. L1 or L2) in which it is executed, as this could be used to \"escape the sandbox\" of the OVM, resulting in non-deterministic fraud proofs. That is, an attacker would be able to \"prove fraud\" on an honestly applied transaction. Note that a \"safe\" contract requires opcodes to appear in a particular pattern; omission of \"unsafe\" opcodes is necessary, but not sufficient. Compiler used: solc Runtime target: EVM",
"kind": "dev",
"methods": {
"isBytecodeSafe(bytes)": {
"params": {
"_bytecode": "The bytecode to safety check."
},
"returns": {
"_0": "`true` if the bytecode is safe, `false` otherwise."
}
}
},
"title": "OVM_SafetyChecker",
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {
"isBytecodeSafe(bytes)": {
"notice": "Returns whether or not all of the provided bytecode is safe."
}
},
"version": 1
},
"storageLayout": {
"storage": [],
"types": null
}
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"address": "0x3b96673C9e24D362501e87B239F60543e20beD50",
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "_owner",
"type": "address"
}
],
"name": "create",
"outputs": [
{
"internalType": "contract iOVM_StateManager",
"name": "",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
}
],
"transactionHash": "0x9926548d5337a7b624a7c7aa3d4ea80c4e9a2fc3afaef0bfc634b19145bb56c1",
"receipt": {
"to": null,
"from": "0x18394B52d3Cb931dfA76F63251919D051953413d",
"contractAddress": "0x3b96673C9e24D362501e87B239F60543e20beD50",
"transactionIndex": 1,
"gasUsed": "1170970",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blockHash": "0x20e3b8b73d8c3667eed92aa3bc04339f6a2c45f7d7bc3e7887163bed2bde2240",
"transactionHash": "0x9926548d5337a7b624a7c7aa3d4ea80c4e9a2fc3afaef0bfc634b19145bb56c1",
"logs": [],
"blockNumber": 24572858,
"cumulativeGasUsed": "1215716",
"status": 1,
"byzantium": true
},
"args": [],
"solcInputHash": "5ee8e508e2c54cb5ac6783b4855b1558",
"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 (_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 (\\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\":\"0xa5195afe32fb2cf104d156e8f4bd39df1ec79bf6ba232097b9e8e0ee14fbc298\",\"license\":\"MIT\"}},\"version\":1}",
"bytecode": "0x608060405234801561001057600080fd5b50611437806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80639ed9331814610030575b600080fd5b6100566004803603602081101561004657600080fd5b50356001600160a01b0316610072565b604080516001600160a01b039092168252519081900360200190f35b600081604051610081906100b5565b6001600160a01b03909116815260405190819003602001906000f0801580156100ae573d6000803e3d6000fd5b5092915050565b61133f806100c38339019056fe608060405234801561001057600080fd5b5060405161133f38038061133f83398101604081905261002f91610054565b600080546001600160a01b0319166001600160a01b0392909216919091179055610082565b600060208284031215610065578081fd5b81516001600160a01b038116811461007b578182fd5b9392505050565b6112ae806100916000396000f3fe608060405234801561001057600080fd5b50600436106101f05760003560e01c80638f3b96471161010f578063d126199f116100a2578063e90abb8611610071578063e90abb86146103f9578063fb37b31c1461040c578063fbcbc0f11461041f578063fcf149a21461043f576101f0565b8063d126199f146103b8578063d15d4150146103cb578063d54414c8146103de578063d7bd4a2a146103f1576101f0565b8063c3fd9b25116100de578063c3fd9b2514610377578063c7650bf21461037f578063c8e40fbf14610392578063d0a215f2146103a5576101f0565b80638f3b96471461033657806399056ba914610349578063af37b86414610351578063af3dc01114610364576101f0565b806333f94305116101875780636f3c75af116101565780636f3c75af146102f55780637c8ee703146103085780637e86faa81461031b5780638da5cb5b1461032e576101f0565b806333f94305146102b25780635c17d629146102ba5780636b18e4e8146102cd5780636c87ad20146102e0576101f0565b8063167020d2116101c3578063167020d2146102595780631aaf392f1461026c5780631b208a5a1461028c57806326dc5b121461029f576101f0565b806307a12945146101f55780630ad226791461021e57806311b1f790146102315780631381ba4d14610244575b600080fd5b61020861020336600461101d565b610452565b60405161021591906111c4565b60405180910390f35b61020861022c366004611072565b6104ba565b61020861023f36600461101d565b610517565b61025761025236600461101d565b610573565b005b61020861026736600461101d565b6105d4565b61027f61027a366004611072565b610679565b60405161021591906111cf565b61020861029a36600461101d565b610727565b61027f6102ad36600461101d565b61075e565b61025761077d565b6102576102c836600461109b565b6107c7565b6102576102db36600461101d565b61089a565b6102e8610944565b60405161021591906111b0565b610208610303366004611072565b610953565b6102e861031636600461101d565b61098c565b610208610329366004611072565b6109ad565b6102e86109c3565b6102576103443660046110cd565b6109d2565b61027f610a88565b61020861035f366004611072565b610a8e565b610208610372366004611072565b610ae2565b610257610b2f565b61020861038d366004611072565b610b79565b6102086103a036600461101d565b610c20565b6102576103b3366004611037565b610c40565b61027f6103c636600461101d565b610cb9565b6102086103d936600461101d565b610cd4565b6102086103ec36600461101d565b610d01565b61027f610d16565b610257610407366004611072565b610d1c565b61020861041a36600461101d565b610d77565b61043261042d36600461101d565b610dc3565b604051610215919061122e565b61025761044d36600461101d565b610e37565b6001600160a01b0381166000908152600260205260408120600301547fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4701480156104b257506001600160a01b038216600090815260026020526040902054155b90505b919050565b6001600160a01b038216600090815260046020908152604080832084845290915281205460ff168061050e57506001600160a01b038316600090815260026020526040902060040154600160a01b900460ff165b90505b92915050565b600080546001600160a01b031633148061053b57506001546001600160a01b031633145b6105605760405162461bcd60e51b8152600401610557906111d8565b60405180910390fd5b6104b261056c83610ef8565b6002610f28565b6000546001600160a01b031633148061059657506001546001600160a01b031633145b6105b25760405162461bcd60e51b8152600401610557906111d8565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600080546001600160a01b03163314806105f857506001546001600160a01b031633145b6106145760405162461bcd60e51b8152600401610557906111d8565b600061061f83610ef8565b9050600260008281526005602052604090205460ff16600381111561064057fe5b1461064f5760009150506104b5565b6000908152600560205260409020805460ff19166003179055505060068054600019019055600190565b6001600160a01b038216600090815260046020908152604080832084845290915281205460ff161580156106cf57506001600160a01b038316600090815260026020526040902060040154600160a01b900460ff165b156106dc57506000610511565b506001600160a01b0391909116600090815260036020908152604080832093835292905220547ffeedfacecafebeeffeedfacecafebeeffeedfacecafebeeffeedfacecafebeef1890565b60008061073383610ef8565b905060025b60008281526005602052604090205460ff16600381111561075557fe5b10159392505050565b6001600160a01b03166000908152600260208190526040909120015490565b6000546001600160a01b03163314806107a057506001546001600160a01b031633145b6107bc5760405162461bcd60e51b8152600401610557906111d8565b600680546001019055565b6000546001600160a01b03163314806107ea57506001546001600160a01b031633145b6108065760405162461bcd60e51b8152600401610557906111d8565b6001600160a01b038316600081815260036020908152604080832086845282528083207ffeedfacecafebeeffeedfacecafebeeffeedfacecafebeeffeedfacecafebeef86189055928252600481528282208583529052205460ff16610895576001600160a01b03831660009081526004602090815260408083208584529091529020805460ff191660011790555b505050565b6000546001600160a01b03163314806108bd57506001546001600160a01b031633145b6108d95760405162461bcd60e51b8152600401610557906111d8565b6001600160a01b031660009081526002602081905260409091207f56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421918101919091557fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470600390910155565b6001546001600160a01b031681565b6000806109608484610f8e565b905060025b60008281526005602052604090205460ff16600381111561098257fe5b1015949350505050565b6001600160a01b039081166000908152600260205260409020600401541690565b6000806109ba8484610f8e565b90506003610965565b6000546001600160a01b031681565b6000546001600160a01b03163314806109f557506001546001600160a01b031633145b610a115760405162461bcd60e51b8152600401610557906111d8565b6001600160a01b039182166000908152600260208181526040928390208451815590840151600182015591830151908201556060820151600382015560808201516004909101805460a0909301516001600160a01b0319909316919093161760ff60a01b1916600160a01b91151591909102179055565b60075490565b600080546001600160a01b0316331480610ab257506001546001600160a01b031633145b610ace5760405162461bcd60e51b8152600401610557906111d8565b61050e610adb8484610f8e565b6001610f28565b600080546001600160a01b0316331480610b0657506001546001600160a01b031633145b610b225760405162461bcd60e51b8152600401610557906111d8565b61050e61056c8484610f8e565b6000546001600160a01b0316331480610b5257506001546001600160a01b031633145b610b6e5760405162461bcd60e51b8152600401610557906111d8565b600780546001019055565b600080546001600160a01b0316331480610b9d57506001546001600160a01b031633145b610bb95760405162461bcd60e51b8152600401610557906111d8565b6000610bc58484610f8e565b9050600260008281526005602052604090205460ff166003811115610be657fe5b14610bf5576000915050610511565b6000908152600560205260409020805460ff1916600317905550506007805460001901905550600190565b6001600160a01b0316600090815260026020526040902060030154151590565b6000546001600160a01b0316331480610c6357506001546001600160a01b031633145b610c7f5760405162461bcd60e51b8152600401610557906111d8565b6001600160a01b0392831660009081526002602052604090206004810180546001600160a01b031916939094169290921790925560030155565b6001600160a01b031660009081526002602052604090205490565b600080546001600160a01b03838116911614806104b25750506001546001600160a01b0390811691161490565b600080610d0d83610ef8565b90506003610738565b60065490565b6000546001600160a01b0316331480610d3f57506001546001600160a01b031633145b610d5b5760405162461bcd60e51b8152600401610557906111d8565b6001600160a01b03909116600090815260026020526040902055565b600080546001600160a01b0316331480610d9b57506001546001600160a01b031633145b610db75760405162461bcd60e51b8152600401610557906111d8565b6104b2610adb83610ef8565b610dcb610fc1565b506001600160a01b03908116600090815260026020818152604092839020835160c08101855281548152600182015492810192909252918201549281019290925260038101546060830152600401549182166080820152600160a01b90910460ff16151560a082015290565b6000546001600160a01b0316331480610e5a57506001546001600160a01b031633145b610e765760405162461bcd60e51b8152600401610557906111d8565b6001600160a01b03166000908152600260208190526040909120600181557f56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421918101919091557fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4706003820155600401805460ff60a01b1916600160a01b179055565b600081604051602001610f0b9190611171565b604051602081830303815290604052805190602001209050919050565b600080826003811115610f3757fe5b60008581526005602052604090205460ff166003811115610f5457fe5b101590508061050e576000848152600560205260409020805484919060ff19166001836003811115610f8257fe5b02179055509392505050565b60008282604051602001610fa392919061118e565b60405160208183030381529060405280519060200120905092915050565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a081019190915290565b80356001600160a01b03811681146104b557600080fd5b803580151581146104b557600080fd5b60006020828403121561102e578081fd5b61050e82610ff6565b60008060006060848603121561104b578182fd5b61105484610ff6565b925061106260208501610ff6565b9150604084013590509250925092565b60008060408385031215611084578182fd5b61108d83610ff6565b946020939093013593505050565b6000806000606084860312156110af578283fd5b6110b884610ff6565b95602085013595506040909401359392505050565b60008082840360e08112156110e0578283fd5b6110e984610ff6565b925060c0601f19820112156110fc578182fd5b5060405160c0810181811067ffffffffffffffff8211171561111a57fe5b80604052506020840135815260408401356020820152606084013560408201526080840135606082015261115060a08501610ff6565b608082015261116160c0850161100d565b60a0820152809150509250929050565b60609190911b6bffffffffffffffffffffffff1916815260140190565b60609290921b6bffffffffffffffffffffffff19168252601482015260340190565b6001600160a01b0391909116815260200190565b901515815260200190565b90815260200190565b60208082526036908201527f46756e6374696f6e2063616e206f6e6c792062652063616c6c65642062792061604082015275757468656e746963617465642061646472657373657360501b606082015260800190565b815181526020808301519082015260408083015190820152606080830151908201526080808301516001600160a01b03169082015260a09182015115159181019190915260c0019056fea26469706673582212205bac84845119d44a384d804ab40cf5b8661877b394d879fd05cdd049485222d964736f6c63430007060033a264697066735822122049d6bdb64f1e5e1bffb7aba87ce3a0db62412188b801b3e899b8b558b75755a364736f6c63430007060033",
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c80639ed9331814610030575b600080fd5b6100566004803603602081101561004657600080fd5b50356001600160a01b0316610072565b604080516001600160a01b039092168252519081900360200190f35b600081604051610081906100b5565b6001600160a01b03909116815260405190819003602001906000f0801580156100ae573d6000803e3d6000fd5b5092915050565b61133f806100c38339019056fe608060405234801561001057600080fd5b5060405161133f38038061133f83398101604081905261002f91610054565b600080546001600160a01b0319166001600160a01b0392909216919091179055610082565b600060208284031215610065578081fd5b81516001600160a01b038116811461007b578182fd5b9392505050565b6112ae806100916000396000f3fe608060405234801561001057600080fd5b50600436106101f05760003560e01c80638f3b96471161010f578063d126199f116100a2578063e90abb8611610071578063e90abb86146103f9578063fb37b31c1461040c578063fbcbc0f11461041f578063fcf149a21461043f576101f0565b8063d126199f146103b8578063d15d4150146103cb578063d54414c8146103de578063d7bd4a2a146103f1576101f0565b8063c3fd9b25116100de578063c3fd9b2514610377578063c7650bf21461037f578063c8e40fbf14610392578063d0a215f2146103a5576101f0565b80638f3b96471461033657806399056ba914610349578063af37b86414610351578063af3dc01114610364576101f0565b806333f94305116101875780636f3c75af116101565780636f3c75af146102f55780637c8ee703146103085780637e86faa81461031b5780638da5cb5b1461032e576101f0565b806333f94305146102b25780635c17d629146102ba5780636b18e4e8146102cd5780636c87ad20146102e0576101f0565b8063167020d2116101c3578063167020d2146102595780631aaf392f1461026c5780631b208a5a1461028c57806326dc5b121461029f576101f0565b806307a12945146101f55780630ad226791461021e57806311b1f790146102315780631381ba4d14610244575b600080fd5b61020861020336600461101d565b610452565b60405161021591906111c4565b60405180910390f35b61020861022c366004611072565b6104ba565b61020861023f36600461101d565b610517565b61025761025236600461101d565b610573565b005b61020861026736600461101d565b6105d4565b61027f61027a366004611072565b610679565b60405161021591906111cf565b61020861029a36600461101d565b610727565b61027f6102ad36600461101d565b61075e565b61025761077d565b6102576102c836600461109b565b6107c7565b6102576102db36600461101d565b61089a565b6102e8610944565b60405161021591906111b0565b610208610303366004611072565b610953565b6102e861031636600461101d565b61098c565b610208610329366004611072565b6109ad565b6102e86109c3565b6102576103443660046110cd565b6109d2565b61027f610a88565b61020861035f366004611072565b610a8e565b610208610372366004611072565b610ae2565b610257610b2f565b61020861038d366004611072565b610b79565b6102086103a036600461101d565b610c20565b6102576103b3366004611037565b610c40565b61027f6103c636600461101d565b610cb9565b6102086103d936600461101d565b610cd4565b6102086103ec36600461101d565b610d01565b61027f610d16565b610257610407366004611072565b610d1c565b61020861041a36600461101d565b610d77565b61043261042d36600461101d565b610dc3565b604051610215919061122e565b61025761044d36600461101d565b610e37565b6001600160a01b0381166000908152600260205260408120600301547fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4701480156104b257506001600160a01b038216600090815260026020526040902054155b90505b919050565b6001600160a01b038216600090815260046020908152604080832084845290915281205460ff168061050e57506001600160a01b038316600090815260026020526040902060040154600160a01b900460ff165b90505b92915050565b600080546001600160a01b031633148061053b57506001546001600160a01b031633145b6105605760405162461bcd60e51b8152600401610557906111d8565b60405180910390fd5b6104b261056c83610ef8565b6002610f28565b6000546001600160a01b031633148061059657506001546001600160a01b031633145b6105b25760405162461bcd60e51b8152600401610557906111d8565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600080546001600160a01b03163314806105f857506001546001600160a01b031633145b6106145760405162461bcd60e51b8152600401610557906111d8565b600061061f83610ef8565b9050600260008281526005602052604090205460ff16600381111561064057fe5b1461064f5760009150506104b5565b6000908152600560205260409020805460ff19166003179055505060068054600019019055600190565b6001600160a01b038216600090815260046020908152604080832084845290915281205460ff161580156106cf57506001600160a01b038316600090815260026020526040902060040154600160a01b900460ff165b156106dc57506000610511565b506001600160a01b0391909116600090815260036020908152604080832093835292905220547ffeedfacecafebeeffeedfacecafebeeffeedfacecafebeeffeedfacecafebeef1890565b60008061073383610ef8565b905060025b60008281526005602052604090205460ff16600381111561075557fe5b10159392505050565b6001600160a01b03166000908152600260208190526040909120015490565b6000546001600160a01b03163314806107a057506001546001600160a01b031633145b6107bc5760405162461bcd60e51b8152600401610557906111d8565b600680546001019055565b6000546001600160a01b03163314806107ea57506001546001600160a01b031633145b6108065760405162461bcd60e51b8152600401610557906111d8565b6001600160a01b038316600081815260036020908152604080832086845282528083207ffeedfacecafebeeffeedfacecafebeeffeedfacecafebeeffeedfacecafebeef86189055928252600481528282208583529052205460ff16610895576001600160a01b03831660009081526004602090815260408083208584529091529020805460ff191660011790555b505050565b6000546001600160a01b03163314806108bd57506001546001600160a01b031633145b6108d95760405162461bcd60e51b8152600401610557906111d8565b6001600160a01b031660009081526002602081905260409091207f56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421918101919091557fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470600390910155565b6001546001600160a01b031681565b6000806109608484610f8e565b905060025b60008281526005602052604090205460ff16600381111561098257fe5b1015949350505050565b6001600160a01b039081166000908152600260205260409020600401541690565b6000806109ba8484610f8e565b90506003610965565b6000546001600160a01b031681565b6000546001600160a01b03163314806109f557506001546001600160a01b031633145b610a115760405162461bcd60e51b8152600401610557906111d8565b6001600160a01b039182166000908152600260208181526040928390208451815590840151600182015591830151908201556060820151600382015560808201516004909101805460a0909301516001600160a01b0319909316919093161760ff60a01b1916600160a01b91151591909102179055565b60075490565b600080546001600160a01b0316331480610ab257506001546001600160a01b031633145b610ace5760405162461bcd60e51b8152600401610557906111d8565b61050e610adb8484610f8e565b6001610f28565b600080546001600160a01b0316331480610b0657506001546001600160a01b031633145b610b225760405162461bcd60e51b8152600401610557906111d8565b61050e61056c8484610f8e565b6000546001600160a01b0316331480610b5257506001546001600160a01b031633145b610b6e5760405162461bcd60e51b8152600401610557906111d8565b600780546001019055565b600080546001600160a01b0316331480610b9d57506001546001600160a01b031633145b610bb95760405162461bcd60e51b8152600401610557906111d8565b6000610bc58484610f8e565b9050600260008281526005602052604090205460ff166003811115610be657fe5b14610bf5576000915050610511565b6000908152600560205260409020805460ff1916600317905550506007805460001901905550600190565b6001600160a01b0316600090815260026020526040902060030154151590565b6000546001600160a01b0316331480610c6357506001546001600160a01b031633145b610c7f5760405162461bcd60e51b8152600401610557906111d8565b6001600160a01b0392831660009081526002602052604090206004810180546001600160a01b031916939094169290921790925560030155565b6001600160a01b031660009081526002602052604090205490565b600080546001600160a01b03838116911614806104b25750506001546001600160a01b0390811691161490565b600080610d0d83610ef8565b90506003610738565b60065490565b6000546001600160a01b0316331480610d3f57506001546001600160a01b031633145b610d5b5760405162461bcd60e51b8152600401610557906111d8565b6001600160a01b03909116600090815260026020526040902055565b600080546001600160a01b0316331480610d9b57506001546001600160a01b031633145b610db75760405162461bcd60e51b8152600401610557906111d8565b6104b2610adb83610ef8565b610dcb610fc1565b506001600160a01b03908116600090815260026020818152604092839020835160c08101855281548152600182015492810192909252918201549281019290925260038101546060830152600401549182166080820152600160a01b90910460ff16151560a082015290565b6000546001600160a01b0316331480610e5a57506001546001600160a01b031633145b610e765760405162461bcd60e51b8152600401610557906111d8565b6001600160a01b03166000908152600260208190526040909120600181557f56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421918101919091557fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4706003820155600401805460ff60a01b1916600160a01b179055565b600081604051602001610f0b9190611171565b604051602081830303815290604052805190602001209050919050565b600080826003811115610f3757fe5b60008581526005602052604090205460ff166003811115610f5457fe5b101590508061050e576000848152600560205260409020805484919060ff19166001836003811115610f8257fe5b02179055509392505050565b60008282604051602001610fa392919061118e565b60405160208183030381529060405280519060200120905092915050565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a081019190915290565b80356001600160a01b03811681146104b557600080fd5b803580151581146104b557600080fd5b60006020828403121561102e578081fd5b61050e82610ff6565b60008060006060848603121561104b578182fd5b61105484610ff6565b925061106260208501610ff6565b9150604084013590509250925092565b60008060408385031215611084578182fd5b61108d83610ff6565b946020939093013593505050565b6000806000606084860312156110af578283fd5b6110b884610ff6565b95602085013595506040909401359392505050565b60008082840360e08112156110e0578283fd5b6110e984610ff6565b925060c0601f19820112156110fc578182fd5b5060405160c0810181811067ffffffffffffffff8211171561111a57fe5b80604052506020840135815260408401356020820152606084013560408201526080840135606082015261115060a08501610ff6565b608082015261116160c0850161100d565b60a0820152809150509250929050565b60609190911b6bffffffffffffffffffffffff1916815260140190565b60609290921b6bffffffffffffffffffffffff19168252601482015260340190565b6001600160a01b0391909116815260200190565b901515815260200190565b90815260200190565b60208082526036908201527f46756e6374696f6e2063616e206f6e6c792062652063616c6c65642062792061604082015275757468656e746963617465642061646472657373657360501b606082015260800190565b815181526020808301519082015260408083015190820152606080830151908201526080808301516001600160a01b03169082015260a09182015115159181019190915260c0019056fea26469706673582212205bac84845119d44a384d804ab40cf5b8661877b394d879fd05cdd049485222d964736f6c63430007060033a264697066735822122049d6bdb64f1e5e1bffb7aba87ce3a0db62412188b801b3e899b8b558b75755a364736f6c63430007060033",
"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
}
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"address": "0x78b88FD62FBdBf67b9C5C6528CF84E9d30BB28e0",
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "_libAddressManager",
"type": "address"
},
{
"internalType": "string",
"name": "_implementationName",
"type": "string"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"stateMutability": "payable",
"type": "fallback"
}
],
"transactionHash": "0xd175bdbcd00f66a7b3a247bf2d0c3719912b845f4898cfe6e09062cc7c33849f",
"receipt": {
"to": null,
"from": "0x18394B52d3Cb931dfA76F63251919D051953413d",
"contractAddress": "0x78b88FD62FBdBf67b9C5C6528CF84E9d30BB28e0",
"transactionIndex": 1,
"gasUsed": "222424",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blockHash": "0x1e1bc36b9553544c99025041f703c41760904c63ad443300a44e9ef0e2be7f56",
"transactionHash": "0xd175bdbcd00f66a7b3a247bf2d0c3719912b845f4898cfe6e09062cc7c33849f",
"logs": [],
"blockNumber": 24572837,
"cumulativeGasUsed": "252381",
"status": 1,
"byzantium": true
},
"args": [
"0xd56F695e73286ac252A37593DD4E7c14270eC1Df",
"OVM_L1CrossDomainMessenger"
],
"solcInputHash": "5ee8e508e2c54cb5ac6783b4855b1558",
"metadata": "{\"compiler\":{\"version\":\"0.7.6+commit.7338295f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_libAddressManager\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_implementationName\",\"type\":\"string\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"constructor\":{\"params\":{\"_implementationName\":\"implementationName of the contract to proxy to.\",\"_libAddressManager\":\"Address of the Lib_AddressManager.\"}}},\"title\":\"Lib_ResolvedDelegateProxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/optimistic-ethereum/libraries/resolver/Lib_ResolvedDelegateProxy.sol\":\"Lib_ResolvedDelegateProxy\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor () internal {\\n address msgSender = _msgSender();\\n _owner = msgSender;\\n emit OwnershipTransferred(address(0), msgSender);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x15e2d5bd4c28a88548074c54d220e8086f638a71ed07e6b3ba5a70066fcf458d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with GSN meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address payable) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes memory) {\\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x8d3cb350f04ff49cfb10aef08d87f19dcbaecc8027b0bed12f3275cd12f38cf0\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* External Imports */\\nimport { Ownable } from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\n/**\\n * @title Lib_AddressManager\\n */\\ncontract Lib_AddressManager is Ownable {\\n\\n /**********\\n * Events *\\n **********/\\n\\n event AddressSet(\\n string _name,\\n address _newAddress\\n );\\n\\n\\n /*************\\n * Variables *\\n *************/\\n\\n mapping (bytes32 => address) private addresses;\\n\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Changes the address associated with a particular name.\\n * @param _name String name to associate an address with.\\n * @param _address Address to associate with the name.\\n */\\n function setAddress(\\n string memory _name,\\n address _address\\n )\\n public\\n onlyOwner\\n {\\n addresses[_getNameHash(_name)] = _address;\\n\\n emit AddressSet(\\n _name,\\n _address\\n );\\n }\\n\\n /**\\n * Retrieves the address associated with a given name.\\n * @param _name Name to retrieve an address for.\\n * @return Address associated with the given name.\\n */\\n function getAddress(\\n string memory _name\\n )\\n public\\n view\\n returns (\\n address\\n )\\n {\\n return addresses[_getNameHash(_name)];\\n }\\n\\n\\n /**********************\\n * Internal Functions *\\n **********************/\\n\\n /**\\n * Computes the hash of a name.\\n * @param _name Name to compute a hash for.\\n * @return Hash of the given name.\\n */\\n function _getNameHash(\\n string memory _name\\n )\\n internal\\n pure\\n returns (\\n bytes32\\n )\\n {\\n return keccak256(abi.encodePacked(_name));\\n }\\n}\\n\",\"keccak256\":\"0x2ce671a0e004df88b136bea5a3c59d0732cea8887c8496da1d509e0200b03d7d\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/resolver/Lib_ResolvedDelegateProxy.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_ResolvedDelegateProxy\\n */\\ncontract Lib_ResolvedDelegateProxy {\\n\\n /*************\\n * Variables *\\n *************/\\n\\n // Using mappings to store fields to avoid overwriting storage slots in the\\n // implementation contract. For example, instead of storing these fields at\\n // storage slot `0` & `1`, they are stored at `keccak256(key + slot)`.\\n // See: https://solidity.readthedocs.io/en/v0.7.0/internals/layout_in_storage.html\\n // NOTE: Do not use this code in your own contract system.\\n // There is a known flaw in this contract, and we will remove it from the repository\\n // in the near future. Due to the very limited way that we are using it, this flaw is\\n // not an issue in our system.\\n mapping (address => string) private implementationName;\\n mapping (address => Lib_AddressManager) private addressManager;\\n\\n\\n /***************\\n * Constructor *\\n ***************/\\n\\n /**\\n * @param _libAddressManager Address of the Lib_AddressManager.\\n * @param _implementationName implementationName of the contract to proxy to.\\n */\\n constructor(\\n address _libAddressManager,\\n string memory _implementationName\\n ) {\\n addressManager[address(this)] = Lib_AddressManager(_libAddressManager);\\n implementationName[address(this)] = _implementationName;\\n }\\n\\n\\n /*********************\\n * Fallback Function *\\n *********************/\\n\\n fallback()\\n external\\n payable\\n {\\n address target = addressManager[address(this)].getAddress(\\n (implementationName[address(this)])\\n );\\n\\n require(\\n target != address(0),\\n \\\"Target address must be initialized.\\\"\\n );\\n\\n (bool success, bytes memory returndata) = target.delegatecall(msg.data);\\n\\n if (success == true) {\\n assembly {\\n return(add(returndata, 0x20), mload(returndata))\\n }\\n } else {\\n assembly {\\n revert(add(returndata, 0x20), mload(returndata))\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfaecb051b37f1d87d588cafb17a575723cbdf7c3c2079772110f33e747e05027\",\"license\":\"MIT\"}},\"version\":1}",
"bytecode": "0x608060405234801561001057600080fd5b506040516104083803806104088339818101604052604081101561003357600080fd5b81516020830180516040519294929383019291908464010000000082111561005a57600080fd5b90830190602082018581111561006f57600080fd5b825164010000000081118282018810171561008957600080fd5b82525081516020918201929091019080838360005b838110156100b657818101518382015260200161009e565b50505050905090810190601f1680156100e35780820380516001836020036101000a031916815260200191505b5060409081523060009081526001602090815282822080546001600160a01b0319166001600160a01b038a16179055818152919020855161012c95509093509085019150610134565b5050506101d5565b828054600181600116156101000203166002900490600052602060002090601f01602090048101928261016a57600085556101b0565b82601f1061018357805160ff19168380011785556101b0565b828001600101855582156101b0579182015b828111156101b0578251825591602001919060010190610195565b506101bc9291506101c0565b5090565b5b808211156101bc57600081556001016101c1565b610224806101e46000396000f3fe60806040818152306000908152600160208181528383205483825293832063bf40fac160e01b909552608490815284546002610100938216159390930260001901169190910460a481905291936001600160a01b039093169263bf40fac192909190819060c490849080156100b55780601f1061008a576101008083540402835291602001916100b5565b820191906000526020600020905b81548152906001019060200180831161009857829003601f168201915b50509250505060206040518083038186803b1580156100d357600080fd5b505afa1580156100e7573d6000803e3d6000fd5b505050506040513d60208110156100fd57600080fd5b505190506001600160a01b0381166101465760405162461bcd60e51b81526004018080602001828103825260238152602001806101cc6023913960400191505060405180910390fd5b600080826001600160a01b03166000366040518083838082843760405192019450600093509091505080830381855af49150503d80600081146101a5576040519150601f19603f3d011682016040523d82523d6000602084013e6101aa565b606091505b509092509050600182151514156101c357805160208201f35b805160208201fdfe5461726765742061646472657373206d75737420626520696e697469616c697a65642ea264697066735822122026d4992ed7562b49b7d3e306977cab94c29f8fb64a137b48d18960cc5ef1341d64736f6c63430007060033",
"deployedBytecode": "0x60806040818152306000908152600160208181528383205483825293832063bf40fac160e01b909552608490815284546002610100938216159390930260001901169190910460a481905291936001600160a01b039093169263bf40fac192909190819060c490849080156100b55780601f1061008a576101008083540402835291602001916100b5565b820191906000526020600020905b81548152906001019060200180831161009857829003601f168201915b50509250505060206040518083038186803b1580156100d357600080fd5b505afa1580156100e7573d6000803e3d6000fd5b505050506040513d60208110156100fd57600080fd5b505190506001600160a01b0381166101465760405162461bcd60e51b81526004018080602001828103825260238152602001806101cc6023913960400191505060405180910390fd5b600080826001600160a01b03166000366040518083838082843760405192019450600093509091505080830381855af49150503d80600081146101a5576040519150601f19603f3d011682016040523d82523d6000602084013e6101aa565b606091505b509092509050600182151514156101c357805160208201f35b805160208201fdfe5461726765742061646472657373206d75737420626520696e697469616c697a65642ea264697066735822122026d4992ed7562b49b7d3e306977cab94c29f8fb64a137b48d18960cc5ef1341d64736f6c63430007060033",
"devdoc": {
"kind": "dev",
"methods": {
"constructor": {
"params": {
"_implementationName": "implementationName of the contract to proxy to.",
"_libAddressManager": "Address of the Lib_AddressManager."
}
}
},
"title": "Lib_ResolvedDelegateProxy",
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
},
"storageLayout": {
"storage": [
{
"astId": 12837,
"contract": "contracts/optimistic-ethereum/libraries/resolver/Lib_ResolvedDelegateProxy.sol:Lib_ResolvedDelegateProxy",
"label": "implementationName",
"offset": 0,
"slot": "0",
"type": "t_mapping(t_address,t_string_storage)"
},
{
"astId": 12841,
"contract": "contracts/optimistic-ethereum/libraries/resolver/Lib_ResolvedDelegateProxy.sol:Lib_ResolvedDelegateProxy",
"label": "addressManager",
"offset": 0,
"slot": "1",
"type": "t_mapping(t_address,t_contract(Lib_AddressManager)12793)"
}
],
"types": {
"t_address": {
"encoding": "inplace",
"label": "address",
"numberOfBytes": "20"
},
"t_contract(Lib_AddressManager)12793": {
"encoding": "inplace",
"label": "contract Lib_AddressManager",
"numberOfBytes": "20"
},
"t_mapping(t_address,t_contract(Lib_AddressManager)12793)": {
"encoding": "mapping",
"key": "t_address",
"label": "mapping(address => contract Lib_AddressManager)",
"numberOfBytes": "32",
"value": "t_contract(Lib_AddressManager)12793"
},
"t_mapping(t_address,t_string_storage)": {
"encoding": "mapping",
"key": "t_address",
"label": "mapping(address => string)",
"numberOfBytes": "32",
"value": "t_string_storage"
},
"t_string_storage": {
"encoding": "bytes",
"label": "string",
"numberOfBytes": "32"
}
}
}
}
\ No newline at end of file
{
"address": "0xB191d67F69e823445cD59e5A88953a82be73b9C6",
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "_libAddressManager",
"type": "address"
},
{
"internalType": "string",
"name": "_implementationName",
"type": "string"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"stateMutability": "payable",
"type": "fallback"
}
],
"transactionHash": "0xbb58732ffd132b5fa62c010e3bdc4ee2a500adf82d3ced38f1175e2b00cd0afb",
"receipt": {
"to": null,
"from": "0x18394B52d3Cb931dfA76F63251919D051953413d",
"contractAddress": "0xB191d67F69e823445cD59e5A88953a82be73b9C6",
"transactionIndex": 1,
"gasUsed": "222304",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blockHash": "0x918daf79ddefb51f9a507188032a29c44ad2b8e42bd1d90fda2943895ad18806",
"transactionHash": "0xbb58732ffd132b5fa62c010e3bdc4ee2a500adf82d3ced38f1175e2b00cd0afb",
"logs": [],
"blockNumber": 24572909,
"cumulativeGasUsed": "267164",
"status": 1,
"byzantium": true
},
"args": [
"0xd56F695e73286ac252A37593DD4E7c14270eC1Df",
"OVM_L1ETHGateway"
],
"solcInputHash": "5ee8e508e2c54cb5ac6783b4855b1558",
"metadata": "{\"compiler\":{\"version\":\"0.7.6+commit.7338295f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_libAddressManager\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_implementationName\",\"type\":\"string\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"constructor\":{\"params\":{\"_implementationName\":\"implementationName of the contract to proxy to.\",\"_libAddressManager\":\"Address of the Lib_AddressManager.\"}}},\"title\":\"Lib_ResolvedDelegateProxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/optimistic-ethereum/libraries/resolver/Lib_ResolvedDelegateProxy.sol\":\"Lib_ResolvedDelegateProxy\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor () internal {\\n address msgSender = _msgSender();\\n _owner = msgSender;\\n emit OwnershipTransferred(address(0), msgSender);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x15e2d5bd4c28a88548074c54d220e8086f638a71ed07e6b3ba5a70066fcf458d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with GSN meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address payable) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes memory) {\\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x8d3cb350f04ff49cfb10aef08d87f19dcbaecc8027b0bed12f3275cd12f38cf0\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* External Imports */\\nimport { Ownable } from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\n/**\\n * @title Lib_AddressManager\\n */\\ncontract Lib_AddressManager is Ownable {\\n\\n /**********\\n * Events *\\n **********/\\n\\n event AddressSet(\\n string _name,\\n address _newAddress\\n );\\n\\n\\n /*************\\n * Variables *\\n *************/\\n\\n mapping (bytes32 => address) private addresses;\\n\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Changes the address associated with a particular name.\\n * @param _name String name to associate an address with.\\n * @param _address Address to associate with the name.\\n */\\n function setAddress(\\n string memory _name,\\n address _address\\n )\\n public\\n onlyOwner\\n {\\n addresses[_getNameHash(_name)] = _address;\\n\\n emit AddressSet(\\n _name,\\n _address\\n );\\n }\\n\\n /**\\n * Retrieves the address associated with a given name.\\n * @param _name Name to retrieve an address for.\\n * @return Address associated with the given name.\\n */\\n function getAddress(\\n string memory _name\\n )\\n public\\n view\\n returns (\\n address\\n )\\n {\\n return addresses[_getNameHash(_name)];\\n }\\n\\n\\n /**********************\\n * Internal Functions *\\n **********************/\\n\\n /**\\n * Computes the hash of a name.\\n * @param _name Name to compute a hash for.\\n * @return Hash of the given name.\\n */\\n function _getNameHash(\\n string memory _name\\n )\\n internal\\n pure\\n returns (\\n bytes32\\n )\\n {\\n return keccak256(abi.encodePacked(_name));\\n }\\n}\\n\",\"keccak256\":\"0x2ce671a0e004df88b136bea5a3c59d0732cea8887c8496da1d509e0200b03d7d\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/resolver/Lib_ResolvedDelegateProxy.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_ResolvedDelegateProxy\\n */\\ncontract Lib_ResolvedDelegateProxy {\\n\\n /*************\\n * Variables *\\n *************/\\n\\n // Using mappings to store fields to avoid overwriting storage slots in the\\n // implementation contract. For example, instead of storing these fields at\\n // storage slot `0` & `1`, they are stored at `keccak256(key + slot)`.\\n // See: https://solidity.readthedocs.io/en/v0.7.0/internals/layout_in_storage.html\\n // NOTE: Do not use this code in your own contract system.\\n // There is a known flaw in this contract, and we will remove it from the repository\\n // in the near future. Due to the very limited way that we are using it, this flaw is\\n // not an issue in our system.\\n mapping (address => string) private implementationName;\\n mapping (address => Lib_AddressManager) private addressManager;\\n\\n\\n /***************\\n * Constructor *\\n ***************/\\n\\n /**\\n * @param _libAddressManager Address of the Lib_AddressManager.\\n * @param _implementationName implementationName of the contract to proxy to.\\n */\\n constructor(\\n address _libAddressManager,\\n string memory _implementationName\\n ) {\\n addressManager[address(this)] = Lib_AddressManager(_libAddressManager);\\n implementationName[address(this)] = _implementationName;\\n }\\n\\n\\n /*********************\\n * Fallback Function *\\n *********************/\\n\\n fallback()\\n external\\n payable\\n {\\n address target = addressManager[address(this)].getAddress(\\n (implementationName[address(this)])\\n );\\n\\n require(\\n target != address(0),\\n \\\"Target address must be initialized.\\\"\\n );\\n\\n (bool success, bytes memory returndata) = target.delegatecall(msg.data);\\n\\n if (success == true) {\\n assembly {\\n return(add(returndata, 0x20), mload(returndata))\\n }\\n } else {\\n assembly {\\n revert(add(returndata, 0x20), mload(returndata))\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfaecb051b37f1d87d588cafb17a575723cbdf7c3c2079772110f33e747e05027\",\"license\":\"MIT\"}},\"version\":1}",
"bytecode": "0x608060405234801561001057600080fd5b506040516104083803806104088339818101604052604081101561003357600080fd5b81516020830180516040519294929383019291908464010000000082111561005a57600080fd5b90830190602082018581111561006f57600080fd5b825164010000000081118282018810171561008957600080fd5b82525081516020918201929091019080838360005b838110156100b657818101518382015260200161009e565b50505050905090810190601f1680156100e35780820380516001836020036101000a031916815260200191505b5060409081523060009081526001602090815282822080546001600160a01b0319166001600160a01b038a16179055818152919020855161012c95509093509085019150610134565b5050506101d5565b828054600181600116156101000203166002900490600052602060002090601f01602090048101928261016a57600085556101b0565b82601f1061018357805160ff19168380011785556101b0565b828001600101855582156101b0579182015b828111156101b0578251825591602001919060010190610195565b506101bc9291506101c0565b5090565b5b808211156101bc57600081556001016101c1565b610224806101e46000396000f3fe60806040818152306000908152600160208181528383205483825293832063bf40fac160e01b909552608490815284546002610100938216159390930260001901169190910460a481905291936001600160a01b039093169263bf40fac192909190819060c490849080156100b55780601f1061008a576101008083540402835291602001916100b5565b820191906000526020600020905b81548152906001019060200180831161009857829003601f168201915b50509250505060206040518083038186803b1580156100d357600080fd5b505afa1580156100e7573d6000803e3d6000fd5b505050506040513d60208110156100fd57600080fd5b505190506001600160a01b0381166101465760405162461bcd60e51b81526004018080602001828103825260238152602001806101cc6023913960400191505060405180910390fd5b600080826001600160a01b03166000366040518083838082843760405192019450600093509091505080830381855af49150503d80600081146101a5576040519150601f19603f3d011682016040523d82523d6000602084013e6101aa565b606091505b509092509050600182151514156101c357805160208201f35b805160208201fdfe5461726765742061646472657373206d75737420626520696e697469616c697a65642ea264697066735822122026d4992ed7562b49b7d3e306977cab94c29f8fb64a137b48d18960cc5ef1341d64736f6c63430007060033",
"deployedBytecode": "0x60806040818152306000908152600160208181528383205483825293832063bf40fac160e01b909552608490815284546002610100938216159390930260001901169190910460a481905291936001600160a01b039093169263bf40fac192909190819060c490849080156100b55780601f1061008a576101008083540402835291602001916100b5565b820191906000526020600020905b81548152906001019060200180831161009857829003601f168201915b50509250505060206040518083038186803b1580156100d357600080fd5b505afa1580156100e7573d6000803e3d6000fd5b505050506040513d60208110156100fd57600080fd5b505190506001600160a01b0381166101465760405162461bcd60e51b81526004018080602001828103825260238152602001806101cc6023913960400191505060405180910390fd5b600080826001600160a01b03166000366040518083838082843760405192019450600093509091505080830381855af49150503d80600081146101a5576040519150601f19603f3d011682016040523d82523d6000602084013e6101aa565b606091505b509092509050600182151514156101c357805160208201f35b805160208201fdfe5461726765742061646472657373206d75737420626520696e697469616c697a65642ea264697066735822122026d4992ed7562b49b7d3e306977cab94c29f8fb64a137b48d18960cc5ef1341d64736f6c63430007060033",
"devdoc": {
"kind": "dev",
"methods": {
"constructor": {
"params": {
"_implementationName": "implementationName of the contract to proxy to.",
"_libAddressManager": "Address of the Lib_AddressManager."
}
}
},
"title": "Lib_ResolvedDelegateProxy",
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
},
"storageLayout": {
"storage": [
{
"astId": 12837,
"contract": "contracts/optimistic-ethereum/libraries/resolver/Lib_ResolvedDelegateProxy.sol:Lib_ResolvedDelegateProxy",
"label": "implementationName",
"offset": 0,
"slot": "0",
"type": "t_mapping(t_address,t_string_storage)"
},
{
"astId": 12841,
"contract": "contracts/optimistic-ethereum/libraries/resolver/Lib_ResolvedDelegateProxy.sol:Lib_ResolvedDelegateProxy",
"label": "addressManager",
"offset": 0,
"slot": "1",
"type": "t_mapping(t_address,t_contract(Lib_AddressManager)12793)"
}
],
"types": {
"t_address": {
"encoding": "inplace",
"label": "address",
"numberOfBytes": "20"
},
"t_contract(Lib_AddressManager)12793": {
"encoding": "inplace",
"label": "contract Lib_AddressManager",
"numberOfBytes": "20"
},
"t_mapping(t_address,t_contract(Lib_AddressManager)12793)": {
"encoding": "mapping",
"key": "t_address",
"label": "mapping(address => contract Lib_AddressManager)",
"numberOfBytes": "32",
"value": "t_contract(Lib_AddressManager)12793"
},
"t_mapping(t_address,t_string_storage)": {
"encoding": "mapping",
"key": "t_address",
"label": "mapping(address => string)",
"numberOfBytes": "32",
"value": "t_string_storage"
},
"t_string_storage": {
"encoding": "bytes",
"label": "string",
"numberOfBytes": "32"
}
}
}
}
\ No newline at end of file
{
"address": "0x8ECe272C9f83041bcb1Cd57AC49Ca6494776bE01",
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "_libAddressManager",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [
{
"internalType": "address",
"name": "_who",
"type": "address"
}
],
"name": "claim",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "deposit",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "_preStateRoot",
"type": "bytes32"
},
{
"internalType": "address",
"name": "_publisher",
"type": "address"
},
{
"internalType": "uint256",
"name": "_timestamp",
"type": "uint256"
}
],
"name": "finalize",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "finalizeWithdrawal",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
},
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "getGasSpent",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_who",
"type": "address"
}
],
"name": "isCollateralized",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "libAddressManager",
"outputs": [
{
"internalType": "contract Lib_AddressManager",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "_preStateRoot",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "_txHash",
"type": "bytes32"
},
{
"internalType": "address",
"name": "_who",
"type": "address"
},
{
"internalType": "uint256",
"name": "_gasSpent",
"type": "uint256"
}
],
"name": "recordGasSpent",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "_name",
"type": "string"
}
],
"name": "resolve",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "startWithdrawal",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"transactionHash": "0x51934b4913fc6cb446cb9b81b11c91393e8a00eb70ba44ac7fa1361fb8119deb",
"receipt": {
"to": null,
"from": "0x18394B52d3Cb931dfA76F63251919D051953413d",
"contractAddress": "0x8ECe272C9f83041bcb1Cd57AC49Ca6494776bE01",
"transactionIndex": 1,
"gasUsed": "297198",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blockHash": "0xd12c9c8a22bc6d6e515104cc5c8473933eb037f559f8ab725149f9dee9d5f25f",
"transactionHash": "0x51934b4913fc6cb446cb9b81b11c91393e8a00eb70ba44ac7fa1361fb8119deb",
"logs": [],
"blockNumber": 24572822,
"cumulativeGasUsed": "595662",
"status": 1,
"byzantium": true
},
"args": [
"0xd56F695e73286ac252A37593DD4E7c14270eC1Df"
],
"solcInputHash": "5ee8e508e2c54cb5ac6783b4855b1558",
"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\":\"_who\",\"type\":\"address\"}],\"name\":\"claim\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_preStateRoot\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"_publisher\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"finalize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeWithdrawal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"getGasSpent\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_who\",\"type\":\"address\"}],\"name\":\"isCollateralized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"libAddressManager\",\"outputs\":[{\"internalType\":\"contract Lib_AddressManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_preStateRoot\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"_txHash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"_who\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_gasSpent\",\"type\":\"uint256\"}],\"name\":\"recordGasSpent\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"startWithdrawal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"resolve(string)\":{\"params\":{\"_name\":\"Name to resolve an address for.\"},\"returns\":{\"_0\":\"Address associated with the given name.\"}}},\"title\":\"mockOVM_BondManager\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"resolve(string)\":{\"notice\":\"Resolves the address associated with a given name.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/optimistic-ethereum/mockOVM/verification/mockOVM_BondManager.sol\":\"mockOVM_BondManager\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor () internal {\\n address msgSender = _msgSender();\\n _owner = msgSender;\\n emit OwnershipTransferred(address(0), msgSender);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x15e2d5bd4c28a88548074c54d220e8086f638a71ed07e6b3ba5a70066fcf458d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with GSN meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address payable) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes memory) {\\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x8d3cb350f04ff49cfb10aef08d87f19dcbaecc8027b0bed12f3275cd12f38cf0\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/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/libraries/resolver/Lib_AddressManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* External Imports */\\nimport { Ownable } from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\n/**\\n * @title Lib_AddressManager\\n */\\ncontract Lib_AddressManager is Ownable {\\n\\n /**********\\n * Events *\\n **********/\\n\\n event AddressSet(\\n string _name,\\n address _newAddress\\n );\\n\\n\\n /*************\\n * Variables *\\n *************/\\n\\n mapping (bytes32 => address) private addresses;\\n\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Changes the address associated with a particular name.\\n * @param _name String name to associate an address with.\\n * @param _address Address to associate with the name.\\n */\\n function setAddress(\\n string memory _name,\\n address _address\\n )\\n public\\n onlyOwner\\n {\\n addresses[_getNameHash(_name)] = _address;\\n\\n emit AddressSet(\\n _name,\\n _address\\n );\\n }\\n\\n /**\\n * Retrieves the address associated with a given name.\\n * @param _name Name to retrieve an address for.\\n * @return Address associated with the given name.\\n */\\n function getAddress(\\n string memory _name\\n )\\n public\\n view\\n returns (\\n address\\n )\\n {\\n return addresses[_getNameHash(_name)];\\n }\\n\\n\\n /**********************\\n * Internal Functions *\\n **********************/\\n\\n /**\\n * Computes the hash of a name.\\n * @param _name Name to compute a hash for.\\n * @return Hash of the given name.\\n */\\n function _getNameHash(\\n string memory _name\\n )\\n internal\\n pure\\n returns (\\n bytes32\\n )\\n {\\n return keccak256(abi.encodePacked(_name));\\n }\\n}\\n\",\"keccak256\":\"0x2ce671a0e004df88b136bea5a3c59d0732cea8887c8496da1d509e0200b03d7d\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/libraries/resolver/Lib_AddressResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* Library Imports */\\nimport { Lib_AddressManager } from \\\"./Lib_AddressManager.sol\\\";\\n\\n/**\\n * @title Lib_AddressResolver\\n */\\nabstract contract Lib_AddressResolver {\\n\\n /*************\\n * Variables *\\n *************/\\n\\n Lib_AddressManager public libAddressManager;\\n\\n\\n /***************\\n * Constructor *\\n ***************/\\n\\n /**\\n * @param _libAddressManager Address of the Lib_AddressManager.\\n */\\n constructor(\\n address _libAddressManager\\n ) {\\n libAddressManager = Lib_AddressManager(_libAddressManager);\\n }\\n\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Resolves the address associated with a given name.\\n * @param _name Name to resolve an address for.\\n * @return Address associated with the given name.\\n */\\n function resolve(\\n string memory _name\\n )\\n public\\n view\\n returns (\\n address\\n )\\n {\\n return libAddressManager.getAddress(_name);\\n }\\n}\\n\",\"keccak256\":\"0x65981feeabff6a81783ea97d44baf988a18a86c8cb374c46fdb71819cbacc7c0\",\"license\":\"MIT\"},\"contracts/optimistic-ethereum/mockOVM/verification/mockOVM_BondManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.8.0;\\n\\n/* Interface Imports */\\nimport { iOVM_BondManager } from \\\"../../iOVM/verification/iOVM_BondManager.sol\\\";\\n\\n/* Contract Imports */\\nimport { Lib_AddressResolver } from \\\"../../libraries/resolver/Lib_AddressResolver.sol\\\";\\n\\n/**\\n * @title mockOVM_BondManager\\n */\\ncontract mockOVM_BondManager is iOVM_BondManager, Lib_AddressResolver {\\n constructor(\\n address _libAddressManager\\n )\\n Lib_AddressResolver(_libAddressManager)\\n {}\\n\\n function recordGasSpent(\\n bytes32 _preStateRoot,\\n bytes32 _txHash,\\n address _who,\\n uint256 _gasSpent\\n )\\n override\\n public\\n {}\\n\\n function finalize(\\n bytes32 _preStateRoot,\\n address _publisher,\\n uint256 _timestamp\\n )\\n override\\n public\\n {}\\n\\n function deposit()\\n override\\n public\\n {}\\n\\n function startWithdrawal()\\n override\\n public\\n {}\\n\\n function finalizeWithdrawal()\\n override\\n public\\n {}\\n\\n function claim(\\n address _who\\n )\\n override\\n public\\n {}\\n\\n function isCollateralized(\\n address _who\\n )\\n override\\n public\\n view\\n returns (\\n bool\\n )\\n {\\n // Only authenticate sequencer to submit state root batches.\\n return _who == resolve(\\\"OVM_Proposer\\\");\\n }\\n\\n function getGasSpent(\\n bytes32, // _preStateRoot,\\n address // _who\\n )\\n override\\n public\\n pure\\n returns (\\n uint256\\n )\\n {\\n return 0;\\n }\\n}\\n\",\"keccak256\":\"0xe649b49573ba5babca407f116e97dc13f24bf677cbcd03824a2eb98a7750c4e8\",\"license\":\"MIT\"}},\"version\":1}",
"bytecode": "0x608060405234801561001057600080fd5b506040516104673803806104678339818101604052602081101561003357600080fd5b5051600080546001600160a01b039092166001600160a01b0319909216919091179055610402806100656000396000f3fe608060405234801561001057600080fd5b506004361061009e5760003560e01c8063abfbbe1311610066578063abfbbe1314610207578063bc2f8dd814610239578063c5b6aa2f14610239578063d0e30db014610239578063dc6453dc146102415761009e565b806302ad4d2a146100a35780631e16e92f146100dd5780631e83409a14610117578063299ca4781461013d578063461a447814610161575b600080fd5b6100c9600480360360208110156100b957600080fd5b50356001600160a01b031661027f565b604080519115158252519081900360200190f35b610115600480360360808110156100f357600080fd5b508035906020810135906001600160a01b0360408201351690606001356102c9565b005b6101156004803603602081101561012d57600080fd5b50356001600160a01b03166102cf565b6101456102d2565b604080516001600160a01b039092168252519081900360200190f35b6101456004803603602081101561017757600080fd5b81019060208101813564010000000081111561019257600080fd5b8201836020820111156101a457600080fd5b803590602001918460018302840111640100000000831117156101c657600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506102e1945050505050565b6101156004803603606081101561021d57600080fd5b508035906001600160a01b0360208201351690604001356103bd565b6101156103c2565b61026d6004803603604081101561025757600080fd5b50803590602001356001600160a01b03166103c4565b60408051918252519081900360200190f35b60006102ae6040518060400160405280600c81526020016b27ab26afa83937b837b9b2b960a11b8152506102e1565b6001600160a01b0316826001600160a01b0316149050919050565b50505050565b50565b6000546001600160a01b031681565b6000805460405163bf40fac160e01b81526020600482018181528551602484015285516001600160a01b039094169363bf40fac19387938392604490920191908501908083838b5b83811015610341578181015183820152602001610329565b50505050905090810190601f16801561036e5780820380516001836020036101000a031916815260200191505b509250505060206040518083038186803b15801561038b57600080fd5b505afa15801561039f573d6000803e3d6000fd5b505050506040513d60208110156103b557600080fd5b505192915050565b505050565b565b60009291505056fea264697066735822122023ce16ce6de3f7672940d40a33de4b777fbb7eaa3ec117bcace31640220db75d64736f6c63430007060033",
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061009e5760003560e01c8063abfbbe1311610066578063abfbbe1314610207578063bc2f8dd814610239578063c5b6aa2f14610239578063d0e30db014610239578063dc6453dc146102415761009e565b806302ad4d2a146100a35780631e16e92f146100dd5780631e83409a14610117578063299ca4781461013d578063461a447814610161575b600080fd5b6100c9600480360360208110156100b957600080fd5b50356001600160a01b031661027f565b604080519115158252519081900360200190f35b610115600480360360808110156100f357600080fd5b508035906020810135906001600160a01b0360408201351690606001356102c9565b005b6101156004803603602081101561012d57600080fd5b50356001600160a01b03166102cf565b6101456102d2565b604080516001600160a01b039092168252519081900360200190f35b6101456004803603602081101561017757600080fd5b81019060208101813564010000000081111561019257600080fd5b8201836020820111156101a457600080fd5b803590602001918460018302840111640100000000831117156101c657600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506102e1945050505050565b6101156004803603606081101561021d57600080fd5b508035906001600160a01b0360208201351690604001356103bd565b6101156103c2565b61026d6004803603604081101561025757600080fd5b50803590602001356001600160a01b03166103c4565b60408051918252519081900360200190f35b60006102ae6040518060400160405280600c81526020016b27ab26afa83937b837b9b2b960a11b8152506102e1565b6001600160a01b0316826001600160a01b0316149050919050565b50505050565b50565b6000546001600160a01b031681565b6000805460405163bf40fac160e01b81526020600482018181528551602484015285516001600160a01b039094169363bf40fac19387938392604490920191908501908083838b5b83811015610341578181015183820152602001610329565b50505050905090810190601f16801561036e5780820380516001836020036101000a031916815260200191505b509250505060206040518083038186803b15801561038b57600080fd5b505afa15801561039f573d6000803e3d6000fd5b505050506040513d60208110156103b557600080fd5b505192915050565b505050565b565b60009291505056fea264697066735822122023ce16ce6de3f7672940d40a33de4b777fbb7eaa3ec117bcace31640220db75d64736f6c63430007060033",
"devdoc": {
"kind": "dev",
"methods": {
"resolve(string)": {
"params": {
"_name": "Name to resolve an address for."
},
"returns": {
"_0": "Address associated with the given name."
}
}
},
"title": "mockOVM_BondManager",
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {
"resolve(string)": {
"notice": "Resolves the address associated with a given name."
}
},
"version": 1
},
"storageLayout": {
"storage": [
{
"astId": 12800,
"contract": "contracts/optimistic-ethereum/mockOVM/verification/mockOVM_BondManager.sol:mockOVM_BondManager",
"label": "libAddressManager",
"offset": 0,
"slot": "0",
"type": "t_contract(Lib_AddressManager)12793"
}
],
"types": {
"t_contract(Lib_AddressManager)12793": {
"encoding": "inplace",
"label": "contract Lib_AddressManager",
"numberOfBytes": "20"
}
}
}
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -8,15 +8,15 @@ import { fromHexString, toHexString } from '@eth-optimism/core-utils' ...@@ -8,15 +8,15 @@ import { fromHexString, toHexString } from '@eth-optimism/core-utils'
/* Internal Imports */ /* Internal Imports */
import { import {
serializeNativeTransaction, NON_ZERO_ADDRESS,
signNativeTransaction,
DEFAULT_EIP155_TX, DEFAULT_EIP155_TX,
serializeEthSignTransaction,
signEthSignMessage,
decodeSolidityError, decodeSolidityError,
NON_ZERO_ADDRESS,
} from '../../../helpers' } from '../../../helpers'
import { getContractFactory, predeploys } from '../../../../src' import {
getContractFactory,
getContractInterface,
predeploys,
} from '../../../../src'
const callPredeploy = async ( const callPredeploy = async (
Helper_PredeployCaller: Contract, Helper_PredeployCaller: Contract,
...@@ -41,6 +41,8 @@ const callPredeploy = async ( ...@@ -41,6 +41,8 @@ const callPredeploy = async (
) )
} }
const iOVM_ETH = getContractInterface('OVM_ETH')
describe('OVM_ECDSAContractAccount', () => { describe('OVM_ECDSAContractAccount', () => {
let wallet: Wallet let wallet: Wallet
let badWallet: Wallet let badWallet: Wallet
...@@ -99,11 +101,18 @@ describe('OVM_ECDSAContractAccount', () => { ...@@ -99,11 +101,18 @@ describe('OVM_ECDSAContractAccount', () => {
// Duplicating the behavior of the ecrecover precompile. // Duplicating the behavior of the ecrecover precompile.
if (target === '0x0000000000000000000000000000000000000001') { if (target === '0x0000000000000000000000000000000000000001') {
const databuf = fromHexString(data) const databuf = fromHexString(data)
const addr = ethers.utils.recoverAddress(databuf.slice(0, 32), {
v: BigNumber.from(databuf.slice(32, 64)).toNumber(), let addr: string
r: toHexString(databuf.slice(64, 96)), try {
s: toHexString(databuf.slice(96, 128)), addr = ethers.utils.recoverAddress(databuf.slice(0, 32), {
}) v: BigNumber.from(databuf.slice(32, 64)).toNumber(),
r: toHexString(databuf.slice(64, 96)),
s: toHexString(databuf.slice(96, 128)),
})
} catch (err) {
addr = ethers.constants.AddressZero
}
const ret = ethers.utils.defaultAbiCoder.encode(['address'], [addr]) const ret = ethers.utils.defaultAbiCoder.encode(['address'], [addr])
return [true, ret] return [true, ret]
} else { } else {
...@@ -122,43 +131,14 @@ describe('OVM_ECDSAContractAccount', () => { ...@@ -122,43 +131,14 @@ describe('OVM_ECDSAContractAccount', () => {
describe('fallback()', () => { describe('fallback()', () => {
it(`should successfully execute an EIP155Transaction`, async () => { it(`should successfully execute an EIP155Transaction`, async () => {
const message = serializeNativeTransaction(DEFAULT_EIP155_TX) const transaction = DEFAULT_EIP155_TX
const sig = await signNativeTransaction(wallet, DEFAULT_EIP155_TX) const encodedTransaction = await wallet.signTransaction(transaction)
await callPredeploy(
Helper_PredeployCaller,
OVM_ECDSAContractAccount,
'execute',
[
message,
0, // isEthSignedMessage
`0x${sig.v}`, //v
`0x${sig.r}`, //r
`0x${sig.s}`, //s
]
)
// The ovmCALL is the 2nd call because the first call transfers the fee.
const ovmCALL: any = Mock__OVM_ExecutionManager.smocked.ovmCALL.calls[1]
expect(ovmCALL._address).to.equal(DEFAULT_EIP155_TX.to)
expect(ovmCALL._calldata).to.equal(DEFAULT_EIP155_TX.data)
})
it(`should successfully execute an ETHSignedTransaction`, async () => {
const message = serializeEthSignTransaction(DEFAULT_EIP155_TX)
const sig = await signEthSignMessage(wallet, DEFAULT_EIP155_TX)
await callPredeploy( await callPredeploy(
Helper_PredeployCaller, Helper_PredeployCaller,
OVM_ECDSAContractAccount, OVM_ECDSAContractAccount,
'execute', 'execute',
[ [encodedTransaction]
message,
1, //isEthSignedMessage
`0x${sig.v}`, //v
`0x${sig.r}`, //r
`0x${sig.s}`, //s
]
) )
// The ovmCALL is the 2nd call because the first call transfers the fee. // The ovmCALL is the 2nd call because the first call transfers the fee.
...@@ -168,43 +148,33 @@ describe('OVM_ECDSAContractAccount', () => { ...@@ -168,43 +148,33 @@ describe('OVM_ECDSAContractAccount', () => {
}) })
it(`should ovmCREATE if EIP155Transaction.to is zero address`, async () => { it(`should ovmCREATE if EIP155Transaction.to is zero address`, async () => {
const createTx = { ...DEFAULT_EIP155_TX, to: '' } const transaction = { ...DEFAULT_EIP155_TX, to: '' }
const message = serializeNativeTransaction(createTx) const encodedTransaction = await wallet.signTransaction(transaction)
const sig = await signNativeTransaction(wallet, createTx)
await callPredeploy( await callPredeploy(
Helper_PredeployCaller, Helper_PredeployCaller,
OVM_ECDSAContractAccount, OVM_ECDSAContractAccount,
'execute', 'execute',
[ [encodedTransaction]
message,
0, //isEthSignedMessage
`0x${sig.v}`, //v
`0x${sig.r}`, //r
`0x${sig.s}`, //s
]
) )
const ovmCREATE: any = const ovmCREATE: any =
Mock__OVM_ExecutionManager.smocked.ovmCREATE.calls[0] Mock__OVM_ExecutionManager.smocked.ovmCREATE.calls[0]
expect(ovmCREATE._bytecode).to.equal(createTx.data) expect(ovmCREATE._bytecode).to.equal(transaction.data)
}) })
it(`should revert on invalid signature`, async () => { it(`should revert on invalid signature`, async () => {
const message = serializeNativeTransaction(DEFAULT_EIP155_TX) const transaction = DEFAULT_EIP155_TX
const sig = await signNativeTransaction(badWallet, DEFAULT_EIP155_TX) const encodedTransaction = ethers.utils.serializeTransaction(
transaction,
'0x' + '00'.repeat(65)
)
await callPredeploy( await callPredeploy(
Helper_PredeployCaller, Helper_PredeployCaller,
OVM_ECDSAContractAccount, OVM_ECDSAContractAccount,
'execute', 'execute',
[ [encodedTransaction]
message,
0, //isEthSignedMessage
`0x${sig.v}`, //v
`0x${sig.r}`, //r
`0x${sig.s}`, //s
]
) )
const ovmREVERT: any = const ovmREVERT: any =
Mock__OVM_ExecutionManager.smocked.ovmREVERT.calls[0] Mock__OVM_ExecutionManager.smocked.ovmREVERT.calls[0]
...@@ -214,24 +184,14 @@ describe('OVM_ECDSAContractAccount', () => { ...@@ -214,24 +184,14 @@ describe('OVM_ECDSAContractAccount', () => {
}) })
it(`should revert on incorrect nonce`, async () => { it(`should revert on incorrect nonce`, async () => {
const alteredNonceTx = { const transaction = { ...DEFAULT_EIP155_TX, nonce: 99 }
...DEFAULT_EIP155_TX, const encodedTransaction = await wallet.signTransaction(transaction)
nonce: 99,
}
const message = serializeNativeTransaction(alteredNonceTx)
const sig = await signNativeTransaction(wallet, alteredNonceTx)
await callPredeploy( await callPredeploy(
Helper_PredeployCaller, Helper_PredeployCaller,
OVM_ECDSAContractAccount, OVM_ECDSAContractAccount,
'execute', 'execute',
[ [encodedTransaction]
message,
0, //isEthSignedMessage
`0x${sig.v}`, //v
`0x${sig.r}`, //r
`0x${sig.s}`, //s
]
) )
const ovmREVERT: any = const ovmREVERT: any =
Mock__OVM_ExecutionManager.smocked.ovmREVERT.calls[0] Mock__OVM_ExecutionManager.smocked.ovmREVERT.calls[0]
...@@ -241,52 +201,32 @@ describe('OVM_ECDSAContractAccount', () => { ...@@ -241,52 +201,32 @@ describe('OVM_ECDSAContractAccount', () => {
}) })
it(`should revert on incorrect chainId`, async () => { it(`should revert on incorrect chainId`, async () => {
const alteredChainIdTx = { const transaction = { ...DEFAULT_EIP155_TX, chainId: 421 }
...DEFAULT_EIP155_TX, const encodedTransaction = await wallet.signTransaction(transaction)
chainId: 421,
}
const message = serializeNativeTransaction(alteredChainIdTx)
const sig = await signNativeTransaction(wallet, alteredChainIdTx)
await callPredeploy( await callPredeploy(
Helper_PredeployCaller, Helper_PredeployCaller,
OVM_ECDSAContractAccount, OVM_ECDSAContractAccount,
'execute', 'execute',
[ [encodedTransaction]
message,
0, //isEthSignedMessage
`0x${sig.v}`, //v
`0x${sig.r}`, //r
`0x${sig.s}`, //s
]
) )
const ovmREVERT: any = const ovmREVERT: any =
Mock__OVM_ExecutionManager.smocked.ovmREVERT.calls[0] Mock__OVM_ExecutionManager.smocked.ovmREVERT.calls[0]
expect(decodeSolidityError(ovmREVERT._data)).to.equal( expect(decodeSolidityError(ovmREVERT._data)).to.equal(
'Transaction chainId does not match expected OVM chainId.' 'Lib_EIP155Tx: Transaction signed with wrong chain ID'
) )
}) })
// TEMPORARY: Skip gas checks for minnet. // TEMPORARY: Skip gas checks for minnet.
it.skip(`should revert on insufficient gas`, async () => { it.skip(`should revert on insufficient gas`, async () => {
const alteredInsufficientGasTx = { const transaction = { ...DEFAULT_EIP155_TX, gasLimit: 200000000 }
...DEFAULT_EIP155_TX, const encodedTransaction = await wallet.signTransaction(transaction)
gasLimit: 200000000,
}
const message = serializeNativeTransaction(alteredInsufficientGasTx)
const sig = await signNativeTransaction(wallet, alteredInsufficientGasTx)
await callPredeploy( await callPredeploy(
Helper_PredeployCaller, Helper_PredeployCaller,
OVM_ECDSAContractAccount, OVM_ECDSAContractAccount,
'execute', 'execute',
[ [encodedTransaction],
message,
0, //isEthSignedMessage
`0x${sig.v}`, //v
`0x${sig.r}`, //r
`0x${sig.s}`, //s
],
40000000 40000000
) )
...@@ -298,11 +238,12 @@ describe('OVM_ECDSAContractAccount', () => { ...@@ -298,11 +238,12 @@ describe('OVM_ECDSAContractAccount', () => {
}) })
it(`should revert if fee is not transferred to the relayer`, async () => { it(`should revert if fee is not transferred to the relayer`, async () => {
const message = serializeNativeTransaction(DEFAULT_EIP155_TX) const transaction = DEFAULT_EIP155_TX
const sig = await signNativeTransaction(wallet, DEFAULT_EIP155_TX) const encodedTransaction = await wallet.signTransaction(transaction)
Mock__OVM_ExecutionManager.smocked.ovmCALL.will.return.with( Mock__OVM_ExecutionManager.smocked.ovmCALL.will.return.with(
(gasLimit, target, data) => { (gasLimit, target, data) => {
if (target === '0x4200000000000000000000000000000000000006') { if (target === predeploys.OVM_ETH) {
return [ return [
true, true,
'0x0000000000000000000000000000000000000000000000000000000000000000', '0x0000000000000000000000000000000000000000000000000000000000000000',
...@@ -317,13 +258,7 @@ describe('OVM_ECDSAContractAccount', () => { ...@@ -317,13 +258,7 @@ describe('OVM_ECDSAContractAccount', () => {
Helper_PredeployCaller, Helper_PredeployCaller,
OVM_ECDSAContractAccount, OVM_ECDSAContractAccount,
'execute', 'execute',
[ [encodedTransaction],
message,
0, //isEthSignedMessage
`0x${sig.v}`, //v
`0x${sig.r}`, //r
`0x${sig.s}`, //s
],
40000000 40000000
) )
...@@ -333,5 +268,109 @@ describe('OVM_ECDSAContractAccount', () => { ...@@ -333,5 +268,109 @@ describe('OVM_ECDSAContractAccount', () => {
'Fee was not transferred to relayer.' 'Fee was not transferred to relayer.'
) )
}) })
it(`should transfer value if value is greater than 0`, async () => {
const transaction = { ...DEFAULT_EIP155_TX, value: 1234, data: '0x' }
const encodedTransaction = await wallet.signTransaction(transaction)
await callPredeploy(
Helper_PredeployCaller,
OVM_ECDSAContractAccount,
'execute',
[encodedTransaction],
40000000
)
// First call transfers fee, second transfers value (since value > 0).
const ovmCALL: any = Mock__OVM_ExecutionManager.smocked.ovmCALL.calls[1]
expect(ovmCALL._address).to.equal(predeploys.OVM_ETH)
expect(ovmCALL._calldata).to.equal(
iOVM_ETH.encodeFunctionData('transfer', [
transaction.to,
transaction.value,
])
)
})
it(`should revert if the value is not transferred to the recipient`, async () => {
const transaction = { ...DEFAULT_EIP155_TX, value: 1234, data: '0x' }
const encodedTransaction = await wallet.signTransaction(transaction)
Mock__OVM_ExecutionManager.smocked.ovmCALL.will.return.with(
(gasLimit, target, data) => {
if (target === predeploys.OVM_ETH) {
const [recipient, amount] = iOVM_ETH.decodeFunctionData(
'transfer',
data
)
if (recipient === transaction.to) {
return [
true,
'0x0000000000000000000000000000000000000000000000000000000000000000',
]
} else {
return [
true,
'0x0000000000000000000000000000000000000000000000000000000000000001',
]
}
} else {
return [true, '0x']
}
}
)
await callPredeploy(
Helper_PredeployCaller,
OVM_ECDSAContractAccount,
'execute',
[encodedTransaction],
40000000
)
const ovmREVERT: any =
Mock__OVM_ExecutionManager.smocked.ovmREVERT.calls[0]
expect(decodeSolidityError(ovmREVERT._data)).to.equal(
'Value could not be transferred to recipient.'
)
})
it(`should revert if trying to send value with a contract creation`, async () => {
const transaction = { ...DEFAULT_EIP155_TX, value: 1234, to: '' }
const encodedTransaction = await wallet.signTransaction(transaction)
await callPredeploy(
Helper_PredeployCaller,
OVM_ECDSAContractAccount,
'execute',
[encodedTransaction],
40000000
)
const ovmREVERT: any =
Mock__OVM_ExecutionManager.smocked.ovmREVERT.calls[0]
expect(decodeSolidityError(ovmREVERT._data)).to.equal(
'Value transfer in contract creation not supported.'
)
})
it(`should revert if trying to send value with non-empty transaction data`, async () => {
const transaction = { ...DEFAULT_EIP155_TX, value: 1234, to: '' }
const encodedTransaction = await wallet.signTransaction(transaction)
await callPredeploy(
Helper_PredeployCaller,
OVM_ECDSAContractAccount,
'execute',
[encodedTransaction],
40000000
)
const ovmREVERT: any =
Mock__OVM_ExecutionManager.smocked.ovmREVERT.calls[0]
expect(decodeSolidityError(ovmREVERT._data)).to.equal(
'Value transfer in contract creation not supported.'
)
})
}) })
}) })
...@@ -94,7 +94,7 @@ describe('OVM_ProxyEOA', () => { ...@@ -94,7 +94,7 @@ describe('OVM_ProxyEOA', () => {
}) })
describe('upgrade()', () => { describe('upgrade()', () => {
const implSlotKey = const implSlotKey =
'0xdeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddead' '0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc' //bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)
it(`should upgrade the proxy implementation`, async () => { it(`should upgrade the proxy implementation`, async () => {
const newImpl = `0x${'81'.repeat(20)}` const newImpl = `0x${'81'.repeat(20)}`
const newImplBytes32 = addrToBytes32(newImpl) const newImplBytes32 = addrToBytes32(newImpl)
......
...@@ -8,7 +8,7 @@ import { smockit, MockContract } from '@eth-optimism/smock' ...@@ -8,7 +8,7 @@ import { smockit, MockContract } from '@eth-optimism/smock'
/* Internal Imports */ /* Internal Imports */
import { NON_ZERO_ADDRESS, makeAddressManager } from '../../../../helpers' import { NON_ZERO_ADDRESS, makeAddressManager } from '../../../../helpers'
const L1_ETH_GATEWAY_NAME = 'Proxy__OVM_L1CrossDomainMessenger' const L1_MESSENGER_NAME = 'Proxy__OVM_L1CrossDomainMessenger'
const ERR_INVALID_MESSENGER = 'OVM_XCHAIN: messenger contract unauthenticated' const ERR_INVALID_MESSENGER = 'OVM_XCHAIN: messenger contract unauthenticated'
const ERR_INVALID_X_DOMAIN_MSG_SENDER = const ERR_INVALID_X_DOMAIN_MSG_SENDER =
...@@ -82,7 +82,7 @@ describe('OVM_L1ETHGateway', () => { ...@@ -82,7 +82,7 @@ describe('OVM_L1ETHGateway', () => {
it('onlyFromCrossDomainAccount: should revert on calls from the right crossDomainMessenger, but wrong xDomainMessageSender (ie. not the L2ETHGateway)', async () => { it('onlyFromCrossDomainAccount: should revert on calls from the right crossDomainMessenger, but wrong xDomainMessageSender (ie. not the L2ETHGateway)', async () => {
await AddressManager.setAddress( await AddressManager.setAddress(
L1_ETH_GATEWAY_NAME, L1_MESSENGER_NAME,
Mock__OVM_L1CrossDomainMessenger.address Mock__OVM_L1CrossDomainMessenger.address
) )
...@@ -163,7 +163,7 @@ describe('OVM_L1ETHGateway', () => { ...@@ -163,7 +163,7 @@ describe('OVM_L1ETHGateway', () => {
await ethers.getContractFactory('OVM_L1CrossDomainMessenger') await ethers.getContractFactory('OVM_L1CrossDomainMessenger')
) )
await AddressManager.setAddress( await AddressManager.setAddress(
L1_ETH_GATEWAY_NAME, L1_MESSENGER_NAME,
Mock__OVM_L1CrossDomainMessenger.address Mock__OVM_L1CrossDomainMessenger.address
) )
...@@ -256,4 +256,41 @@ describe('OVM_L1ETHGateway', () => { ...@@ -256,4 +256,41 @@ describe('OVM_L1ETHGateway', () => {
expect(depositCallToMessenger._gasLimit).to.equal(finalizeDepositGasLimit) expect(depositCallToMessenger._gasLimit).to.equal(finalizeDepositGasLimit)
}) })
}) })
describe('migrating ETH', () => {
const migrateAmount = 1_000
beforeEach(async () => {
await OVM_L1ETHGateway.donateETH({ value: migrateAmount })
const gatewayBalance = await ethers.provider.getBalance(
OVM_L1ETHGateway.address
)
expect(gatewayBalance).to.equal(migrateAmount)
})
it('should successfully migrate ETH to new gateway', async () => {
const New_OVM_L1ETHGateway = await (
await ethers.getContractFactory('OVM_L1ETHGateway')
).deploy()
await New_OVM_L1ETHGateway.initialize(
AddressManager.address,
Mock__OVM_L2DepositedERC20.address
)
await OVM_L1ETHGateway.migrateEth(New_OVM_L1ETHGateway.address)
const newGatewayBalance = await ethers.provider.getBalance(
New_OVM_L1ETHGateway.address
)
expect(newGatewayBalance).to.equal(migrateAmount)
})
it('should not allow migrating ETH from non-owner', async () => {
const New_OVM_L1ETHGateway = await (
await ethers.getContractFactory('OVM_L1ETHGateway')
).deploy()
await New_OVM_L1ETHGateway.initialize(
AddressManager.address,
Mock__OVM_L2DepositedERC20.address
)
await expect(
OVM_L1ETHGateway.connect(bob).migrateEth(New_OVM_L1ETHGateway.address)
).to.be.revertedWith('Only the owner can migrate ETH')
})
})
}) })
...@@ -110,7 +110,7 @@ describe('OVM_ExecutionManager gas consumption', () => { ...@@ -110,7 +110,7 @@ describe('OVM_ExecutionManager gas consumption', () => {
) )
console.log(`calculated gas cost of ${gasCost}`) console.log(`calculated gas cost of ${gasCost}`)
const benchmark: number = 105_000 const benchmark: number = 106_000
expect(gasCost).to.be.lte(benchmark) expect(gasCost).to.be.lte(benchmark)
expect(gasCost).to.be.gte( expect(gasCost).to.be.gte(
benchmark - 1_000, benchmark - 1_000,
......
...@@ -7,15 +7,8 @@ import { smockit, MockContract } from '@eth-optimism/smock' ...@@ -7,15 +7,8 @@ import { smockit, MockContract } from '@eth-optimism/smock'
import { fromHexString, toHexString } from '@eth-optimism/core-utils' import { fromHexString, toHexString } from '@eth-optimism/core-utils'
/* Internal Imports */ /* Internal Imports */
import { DEFAULT_EIP155_TX } from '../../../helpers'
import { getContractInterface, getContractFactory } from '../../../../src' import { getContractInterface, getContractFactory } from '../../../../src'
import {
encodeSequencerCalldata,
signNativeTransaction,
signEthSignMessage,
DEFAULT_EIP155_TX,
serializeNativeTransaction,
serializeEthSignTransaction,
} from '../../../helpers'
describe('OVM_SequencerEntrypoint', () => { describe('OVM_SequencerEntrypoint', () => {
let wallet: Wallet let wallet: Wallet
...@@ -94,141 +87,69 @@ describe('OVM_SequencerEntrypoint', () => { ...@@ -94,141 +87,69 @@ describe('OVM_SequencerEntrypoint', () => {
}) })
describe('fallback()', async () => { describe('fallback()', async () => {
it('should call EIP155 if the transaction type is 0', async () => { it('should call EIP155', async () => {
const calldata = await encodeSequencerCalldata( const transaction = DEFAULT_EIP155_TX
wallet, const encodedTransaction = await wallet.signTransaction(transaction)
DEFAULT_EIP155_TX,
0
)
await Helper_PredeployCaller.callPredeploy( await Helper_PredeployCaller.callPredeploy(
OVM_SequencerEntrypoint.address, OVM_SequencerEntrypoint.address,
calldata encodedTransaction
) )
const encodedTx = serializeNativeTransaction(DEFAULT_EIP155_TX)
const sig = await signNativeTransaction(wallet, DEFAULT_EIP155_TX)
const expectedEOACalldata = iOVM_ECDSAContractAccount.encodeFunctionData( const expectedEOACalldata = iOVM_ECDSAContractAccount.encodeFunctionData(
'execute', 'execute',
[ [encodedTransaction]
encodedTx,
0, //isEthSignedMessage
`0x${sig.v}`, //v
`0x${sig.r}`, //r
`0x${sig.s}`, //s
]
) )
const ovmCALL: any = Mock__OVM_ExecutionManager.smocked.ovmCALL.calls[0] const ovmCALL: any = Mock__OVM_ExecutionManager.smocked.ovmCALL.calls[0]
expect(ovmCALL._address).to.equal(await wallet.getAddress()) expect(ovmCALL._address).to.equal(await wallet.getAddress())
expect(ovmCALL._calldata).to.equal(expectedEOACalldata) expect(ovmCALL._calldata).to.equal(expectedEOACalldata)
}) })
it('should send correct calldata if tx is a create and the transaction type is 0', async () => { it('should send correct calldata if tx is a create', async () => {
const createTx = { ...DEFAULT_EIP155_TX, to: '' } const transaction = { ...DEFAULT_EIP155_TX, to: '' }
const calldata = await encodeSequencerCalldata(wallet, createTx, 0) const encodedTransaction = await wallet.signTransaction(transaction)
await Helper_PredeployCaller.callPredeploy( await Helper_PredeployCaller.callPredeploy(
OVM_SequencerEntrypoint.address, OVM_SequencerEntrypoint.address,
calldata encodedTransaction
) )
const encodedTx = serializeNativeTransaction(createTx)
const sig = await signNativeTransaction(wallet, createTx)
const expectedEOACalldata = iOVM_ECDSAContractAccount.encodeFunctionData( const expectedEOACalldata = iOVM_ECDSAContractAccount.encodeFunctionData(
'execute', 'execute',
[ [encodedTransaction]
encodedTx,
0, //isEthSignedMessage
`0x${sig.v}`, //v
`0x${sig.r}`, //r
`0x${sig.s}`, //s
]
) )
const ovmCALL: any = Mock__OVM_ExecutionManager.smocked.ovmCALL.calls[0] const ovmCALL: any = Mock__OVM_ExecutionManager.smocked.ovmCALL.calls[0]
expect(ovmCALL._address).to.equal(await wallet.getAddress()) expect(ovmCALL._address).to.equal(await wallet.getAddress())
expect(ovmCALL._calldata).to.equal(expectedEOACalldata) expect(ovmCALL._calldata).to.equal(expectedEOACalldata)
}) })
for (let i = 0; i < 3; i += 2) { it(`should call ovmCreateEOA when ovmEXTCODESIZE returns 0`, async () => {
it(`should call ovmCreateEOA when tx type is ${i} and ovmEXTCODESIZE returns 0`, async () => { let isFirstCheck = true
let firstCheck = true Mock__OVM_ExecutionManager.smocked.ovmEXTCODESIZE.will.return.with(() => {
Mock__OVM_ExecutionManager.smocked.ovmEXTCODESIZE.will.return.with( if (isFirstCheck) {
() => { isFirstCheck = false
if (firstCheck) { return 0
firstCheck = false } else {
return 0 return 1
} else { }
return 1
}
}
)
const calldata = await encodeSequencerCalldata(
wallet,
DEFAULT_EIP155_TX,
i
)
await Helper_PredeployCaller.callPredeploy(
OVM_SequencerEntrypoint.address,
calldata
)
const call: any =
Mock__OVM_ExecutionManager.smocked.ovmCREATEEOA.calls[0]
const eoaAddress = ethers.utils.recoverAddress(call._messageHash, {
v: call._v + 27,
r: call._r,
s: call._s,
})
expect(eoaAddress).to.equal(await wallet.getAddress())
}) })
}
it('should submit ETHSignedTypedData if TransactionType is 2', async () => { const transaction = DEFAULT_EIP155_TX
const calldata = await encodeSequencerCalldata( const encodedTransaction = await wallet.signTransaction(transaction)
wallet,
DEFAULT_EIP155_TX,
2
)
await Helper_PredeployCaller.callPredeploy( await Helper_PredeployCaller.callPredeploy(
OVM_SequencerEntrypoint.address, OVM_SequencerEntrypoint.address,
calldata encodedTransaction
)
const encodedTx = serializeEthSignTransaction(DEFAULT_EIP155_TX)
const sig = await signEthSignMessage(wallet, DEFAULT_EIP155_TX)
const expectedEOACalldata = iOVM_ECDSAContractAccount.encodeFunctionData(
'execute',
[
encodedTx,
1, //isEthSignedMessage
`0x${sig.v}`, //v
`0x${sig.r}`, //r
`0x${sig.s}`, //s
]
) )
const ovmCALL: any = Mock__OVM_ExecutionManager.smocked.ovmCALL.calls[0]
expect(ovmCALL._address).to.equal(await wallet.getAddress())
expect(ovmCALL._calldata).to.equal(expectedEOACalldata)
})
it('should revert if TransactionType is >2', async () => { const call: any = Mock__OVM_ExecutionManager.smocked.ovmCREATEEOA.calls[0]
const calldata = '0x03' const eoaAddress = ethers.utils.recoverAddress(call._messageHash, {
await expect( v: call._v + 27,
Helper_PredeployCaller.callPredeploy( r: call._r,
OVM_SequencerEntrypoint.address, s: call._s,
calldata })
)
).to.be.reverted
})
it('should revert if TransactionType is 1', async () => { expect(eoaAddress).to.equal(await wallet.getAddress())
const calldata = '0x01'
await expect(
Helper_PredeployCaller.callPredeploy(
OVM_SequencerEntrypoint.address,
calldata
)
).to.be.reverted
}) })
}) })
}) })
/* tslint:disable:no-empty */
import '../../../setup'
/* Internal Imports */
import { Lib_EIP155Tx_TEST_JSON } from '../../../data'
import { runJsonTest } from '../../../helpers'
// Currently running tests from here:
// https://github.com/ethereumjs/ethereumjs-tx/blob/master/test/ttTransactionTestEip155VitaliksTests.json
describe('Lib_EIP155Tx', () => {
describe('JSON tests', () => {
runJsonTest('TestLib_EIP155Tx', Lib_EIP155Tx_TEST_JSON)
})
})
/* Internal Imports */
import { Lib_ECDSAUtils_TEST_JSON } from '../../../data'
import { runJsonTest } from '../../../helpers'
describe('Lib_ECDSAUtils', () => {
describe('JSON tests', () => {
runJsonTest('TestLib_ECDSAUtils', Lib_ECDSAUtils_TEST_JSON)
})
})
...@@ -2,8 +2,8 @@ export { tests as Lib_RLPWriter_TEST_JSON } from './json/libraries/rlp/Lib_RLPWr ...@@ -2,8 +2,8 @@ export { tests as Lib_RLPWriter_TEST_JSON } from './json/libraries/rlp/Lib_RLPWr
export { tests as Lib_RLPReader_TEST_JSON } from './json/libraries/rlp/Lib_RLPReader.test.json' export { tests as Lib_RLPReader_TEST_JSON } from './json/libraries/rlp/Lib_RLPReader.test.json'
export { tests as Lib_Bytes32Utils_TEST_JSON } from './json/libraries/utils/Lib_Bytes32Utils.test.json' export { tests as Lib_Bytes32Utils_TEST_JSON } from './json/libraries/utils/Lib_Bytes32Utils.test.json'
export { tests as Lib_BytesUtils_TEST_JSON } from './json/libraries/utils/Lib_BytesUtils.test.json' export { tests as Lib_BytesUtils_TEST_JSON } from './json/libraries/utils/Lib_BytesUtils.test.json'
export { tests as Lib_ECDSAUtils_TEST_JSON } from './json/libraries/utils/Lib_ECDSAUtils.test.json'
export { tests as Lib_MerkleTrie_TEST_JSON } from './json/libraries/trie/Lib_MerkleTrie.test.json' export { tests as Lib_MerkleTrie_TEST_JSON } from './json/libraries/trie/Lib_MerkleTrie.test.json'
export { tests as Lib_EIP155Tx_TEST_JSON } from './json/libraries/codec/Lib_EIP155Tx.test.json'
export { tests as Lib_OVMCodec_TEST_JSON } from './json/libraries/codec/Lib_OVMCodec.test.json' export { tests as Lib_OVMCodec_TEST_JSON } from './json/libraries/codec/Lib_OVMCodec.test.json'
export { tests as CREATE2_TEST_JSON } from './json/create2.test.json' export { tests as CREATE2_TEST_JSON } from './json/create2.test.json'
export { tests as SAFETY_CHECKER_TEST_JSON } from './json/safety-checker.test.json' export { tests as SAFETY_CHECKER_TEST_JSON } from './json/safety-checker.test.json'
{
"tests": {
"decode": {
"vitalik test 0": {
"in": [
"0xf864808504a817c800825208943535353535353535353535353535353535353535808025a0044852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116da0044852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d",
1
],
"out": [
[
"0x00",
"0x04a817c800",
"0x5208",
"0x3535353535353535353535353535353535353535",
"0x00",
"0x",
"0x25",
"0x044852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d",
"0x044852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d",
"0x01",
"0x00",
false
]
]
},
"vitalik test 1": {
"in": [
"0xf867088504a817c8088302e2489435353535353535353535353535353535353535358202008025a064b1702d9298fee62dfeccc57d322a463ad55ca201256d01f62b45b2e1c21c12a064b1702d9298fee62dfeccc57d322a463ad55ca201256d01f62b45b2e1c21c10",
1
],
"out": [
[
"0x08",
"0x04a817c808",
"0x02e248",
"0x3535353535353535353535353535353535353535",
"0x0200",
"0x",
"0x25",
"0x64b1702d9298fee62dfeccc57d322a463ad55ca201256d01f62b45b2e1c21c12",
"0x64b1702d9298fee62dfeccc57d322a463ad55ca201256d01f62b45b2e1c21c10",
"0x01",
"0x00",
false
]
]
},
"vitalik test 2": {
"in": [
"0xf867098504a817c809830334509435353535353535353535353535353535353535358202d98025a052f8f61201b2b11a78d6e866abc9c3db2ae8631fa656bfe5cb53668255367afba052f8f61201b2b11a78d6e866abc9c3db2ae8631fa656bfe5cb53668255367afb",
1
],
"out": [
[
"0x09",
"0x04a817c809",
"0x033450",
"0x3535353535353535353535353535353535353535",
"0x02d9",
"0x",
"0x25",
"0x52f8f61201b2b11a78d6e866abc9c3db2ae8631fa656bfe5cb53668255367afb",
"0x52f8f61201b2b11a78d6e866abc9c3db2ae8631fa656bfe5cb53668255367afb",
"0x01",
"0x00",
false
]
]
},
"vitalik test 3": {
"in": [
"0xf864018504a817c80182a410943535353535353535353535353535353535353535018025a0489efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bcaa0489efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6",
1
],
"out": [
[
"0x01",
"0x04a817c801",
"0xa410",
"0x3535353535353535353535353535353535353535",
"0x01",
"0x",
"0x25",
"0x489efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bca",
"0x489efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6",
"0x01",
"0x00",
false
]
]
},
"vitalik test 4": {
"in": [
"0xf864028504a817c80282f618943535353535353535353535353535353535353535088025a02d7c5bef027816a800da1736444fb58a807ef4c9603b7848673f7e3a68eb14a5a02d7c5bef027816a800da1736444fb58a807ef4c9603b7848673f7e3a68eb14a5",
1
],
"out": [
[
"0x02",
"0x04a817c802",
"0xf618",
"0x3535353535353535353535353535353535353535",
"0x08",
"0x",
"0x25",
"0x2d7c5bef027816a800da1736444fb58a807ef4c9603b7848673f7e3a68eb14a5",
"0x2d7c5bef027816a800da1736444fb58a807ef4c9603b7848673f7e3a68eb14a5",
"0x01",
"0x00",
false
]
]
},
"vitalik test 5": {
"in": [
"0xf865038504a817c803830148209435353535353535353535353535353535353535351b8025a02a80e1ef1d7842f27f2e6be0972bb708b9a135c38860dbe73c27c3486c34f4e0a02a80e1ef1d7842f27f2e6be0972bb708b9a135c38860dbe73c27c3486c34f4de",
1
],
"out": [
[
"0x03",
"0x04a817c803",
"0x014820",
"0x3535353535353535353535353535353535353535",
"0x1b",
"0x",
"0x25",
"0x2a80e1ef1d7842f27f2e6be0972bb708b9a135c38860dbe73c27c3486c34f4e0",
"0x2a80e1ef1d7842f27f2e6be0972bb708b9a135c38860dbe73c27c3486c34f4de",
"0x01",
"0x00",
false
]
]
},
"vitalik test 6": {
"in": [
"0xf865048504a817c80483019a28943535353535353535353535353535353535353535408025a013600b294191fc92924bb3ce4b969c1e7e2bab8f4c93c3fc6d0a51733df3c063a013600b294191fc92924bb3ce4b969c1e7e2bab8f4c93c3fc6d0a51733df3c060",
1
],
"out": [
[
"0x04",
"0x04a817c804",
"0x019a28",
"0x3535353535353535353535353535353535353535",
"0x40",
"0x",
"0x25",
"0x13600b294191fc92924bb3ce4b969c1e7e2bab8f4c93c3fc6d0a51733df3c063",
"0x13600b294191fc92924bb3ce4b969c1e7e2bab8f4c93c3fc6d0a51733df3c060",
"0x01",
"0x00",
false
]
]
},
"vitalik test 7": {
"in": [
"0xf865058504a817c8058301ec309435353535353535353535353535353535353535357d8025a04eebf77a833b30520287ddd9478ff51abbdffa30aa90a8d655dba0e8a79ce0c1a04eebf77a833b30520287ddd9478ff51abbdffa30aa90a8d655dba0e8a79ce0c1",
1
],
"out": [
[
"0x05",
"0x04a817c805",
"0x01ec30",
"0x3535353535353535353535353535353535353535",
"0x7d",
"0x",
"0x25",
"0x4eebf77a833b30520287ddd9478ff51abbdffa30aa90a8d655dba0e8a79ce0c1",
"0x4eebf77a833b30520287ddd9478ff51abbdffa30aa90a8d655dba0e8a79ce0c1",
"0x01",
"0x00",
false
]
]
},
"vitalik test 8": {
"in": [
"0xf865058504a817c8058301ec309435353535353535353535353535353535353535357d8025a04eebf77a833b30520287ddd9478ff51abbdffa30aa90a8d655dba0e8a79ce0c1a04eebf77a833b30520287ddd9478ff51abbdffa30aa90a8d655dba0e8a79ce0c1",
1
],
"out": [
[
"0x05",
"0x04a817c805",
"0x01ec30",
"0x3535353535353535353535353535353535353535",
"0x7d",
"0x",
"0x25",
"0x4eebf77a833b30520287ddd9478ff51abbdffa30aa90a8d655dba0e8a79ce0c1",
"0x4eebf77a833b30520287ddd9478ff51abbdffa30aa90a8d655dba0e8a79ce0c1",
"0x01",
"0x00",
false
]
]
},
"vitalik test 9": {
"in": [
"0xf866068504a817c80683023e3894353535353535353535353535353535353535353581d88025a06455bf8ea6e7463a1046a0b52804526e119b4bf5136279614e0b1e8e296a4e2fa06455bf8ea6e7463a1046a0b52804526e119b4bf5136279614e0b1e8e296a4e2d",
1
],
"out": [
[
"0x06",
"0x04a817c806",
"0x023e38",
"0x3535353535353535353535353535353535353535",
"0xd8",
"0x",
"0x25",
"0x6455bf8ea6e7463a1046a0b52804526e119b4bf5136279614e0b1e8e296a4e2f",
"0x6455bf8ea6e7463a1046a0b52804526e119b4bf5136279614e0b1e8e296a4e2d",
"0x01",
"0x00",
false
]
]
},
"vitalik test 10": {
"in": [
"0xf867078504a817c807830290409435353535353535353535353535353535353535358201578025a052f1a9b320cab38e5da8a8f97989383aab0a49165fc91c737310e4f7e9821021a052f1a9b320cab38e5da8a8f97989383aab0a49165fc91c737310e4f7e9821021",
1
],
"out": [
[
"0x07",
"0x04a817c807",
"0x029040",
"0x3535353535353535353535353535353535353535",
"0x0157",
"0x",
"0x25",
"0x52f1a9b320cab38e5da8a8f97989383aab0a49165fc91c737310e4f7e9821021",
"0x52f1a9b320cab38e5da8a8f97989383aab0a49165fc91c737310e4f7e9821021",
"0x01",
"0x00",
false
]
]
}
},
"encode": {
"vitalik test 0": {
"in": [
[
"0x00",
"0x04a817c800",
"0x5208",
"0x3535353535353535353535353535353535353535",
"0x00",
"0x",
"0x25",
"0x044852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d",
"0x044852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d",
"0x01",
"0x00",
false
],
true
],
"out": [
"0xf864808504a817c800825208943535353535353535353535353535353535353535808025a0044852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116da0044852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d"
]
},
"vitalik test 1": {
"in": [
[
"0x08",
"0x04a817c808",
"0x02e248",
"0x3535353535353535353535353535353535353535",
"0x0200",
"0x",
"0x25",
"0x64b1702d9298fee62dfeccc57d322a463ad55ca201256d01f62b45b2e1c21c12",
"0x64b1702d9298fee62dfeccc57d322a463ad55ca201256d01f62b45b2e1c21c10",
"0x01",
"0x00",
false
],
true
],
"out": [
"0xf867088504a817c8088302e2489435353535353535353535353535353535353535358202008025a064b1702d9298fee62dfeccc57d322a463ad55ca201256d01f62b45b2e1c21c12a064b1702d9298fee62dfeccc57d322a463ad55ca201256d01f62b45b2e1c21c10"
]
},
"vitalik test 2": {
"in": [
[
"0x09",
"0x04a817c809",
"0x033450",
"0x3535353535353535353535353535353535353535",
"0x02d9",
"0x",
"0x25",
"0x52f8f61201b2b11a78d6e866abc9c3db2ae8631fa656bfe5cb53668255367afb",
"0x52f8f61201b2b11a78d6e866abc9c3db2ae8631fa656bfe5cb53668255367afb",
"0x01",
"0x00",
false
],
true
],
"out": [
"0xf867098504a817c809830334509435353535353535353535353535353535353535358202d98025a052f8f61201b2b11a78d6e866abc9c3db2ae8631fa656bfe5cb53668255367afba052f8f61201b2b11a78d6e866abc9c3db2ae8631fa656bfe5cb53668255367afb"
]
},
"vitalik test 3": {
"in": [
[
"0x01",
"0x04a817c801",
"0xa410",
"0x3535353535353535353535353535353535353535",
"0x01",
"0x",
"0x25",
"0x489efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bca",
"0x489efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6",
"0x01",
"0x00",
false
],
true
],
"out": [
"0xf864018504a817c80182a410943535353535353535353535353535353535353535018025a0489efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bcaa0489efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6"
]
},
"vitalik test 4": {
"in": [
[
"0x02",
"0x04a817c802",
"0xf618",
"0x3535353535353535353535353535353535353535",
"0x08",
"0x",
"0x25",
"0x2d7c5bef027816a800da1736444fb58a807ef4c9603b7848673f7e3a68eb14a5",
"0x2d7c5bef027816a800da1736444fb58a807ef4c9603b7848673f7e3a68eb14a5",
"0x01",
"0x00",
false
],
true
],
"out": [
"0xf864028504a817c80282f618943535353535353535353535353535353535353535088025a02d7c5bef027816a800da1736444fb58a807ef4c9603b7848673f7e3a68eb14a5a02d7c5bef027816a800da1736444fb58a807ef4c9603b7848673f7e3a68eb14a5"
]
},
"vitalik test 5": {
"in": [
[
"0x03",
"0x04a817c803",
"0x014820",
"0x3535353535353535353535353535353535353535",
"0x1b",
"0x",
"0x25",
"0x2a80e1ef1d7842f27f2e6be0972bb708b9a135c38860dbe73c27c3486c34f4e0",
"0x2a80e1ef1d7842f27f2e6be0972bb708b9a135c38860dbe73c27c3486c34f4de",
"0x01",
"0x00",
false
],
true
],
"out": [
"0xf865038504a817c803830148209435353535353535353535353535353535353535351b8025a02a80e1ef1d7842f27f2e6be0972bb708b9a135c38860dbe73c27c3486c34f4e0a02a80e1ef1d7842f27f2e6be0972bb708b9a135c38860dbe73c27c3486c34f4de"
]
},
"vitalik test 6": {
"in": [
[
"0x04",
"0x04a817c804",
"0x019a28",
"0x3535353535353535353535353535353535353535",
"0x40",
"0x",
"0x25",
"0x13600b294191fc92924bb3ce4b969c1e7e2bab8f4c93c3fc6d0a51733df3c063",
"0x13600b294191fc92924bb3ce4b969c1e7e2bab8f4c93c3fc6d0a51733df3c060",
"0x01",
"0x00",
false
],
true
],
"out": [
"0xf865048504a817c80483019a28943535353535353535353535353535353535353535408025a013600b294191fc92924bb3ce4b969c1e7e2bab8f4c93c3fc6d0a51733df3c063a013600b294191fc92924bb3ce4b969c1e7e2bab8f4c93c3fc6d0a51733df3c060"
]
},
"vitalik test 7": {
"in": [
[
"0x05",
"0x04a817c805",
"0x01ec30",
"0x3535353535353535353535353535353535353535",
"0x7d",
"0x",
"0x25",
"0x4eebf77a833b30520287ddd9478ff51abbdffa30aa90a8d655dba0e8a79ce0c1",
"0x4eebf77a833b30520287ddd9478ff51abbdffa30aa90a8d655dba0e8a79ce0c1",
"0x01",
"0x00",
false
],
true
],
"out": [
"0xf865058504a817c8058301ec309435353535353535353535353535353535353535357d8025a04eebf77a833b30520287ddd9478ff51abbdffa30aa90a8d655dba0e8a79ce0c1a04eebf77a833b30520287ddd9478ff51abbdffa30aa90a8d655dba0e8a79ce0c1"
]
},
"vitalik test 8": {
"in": [
[
"0x05",
"0x04a817c805",
"0x01ec30",
"0x3535353535353535353535353535353535353535",
"0x7d",
"0x",
"0x25",
"0x4eebf77a833b30520287ddd9478ff51abbdffa30aa90a8d655dba0e8a79ce0c1",
"0x4eebf77a833b30520287ddd9478ff51abbdffa30aa90a8d655dba0e8a79ce0c1",
"0x01",
"0x00",
false
],
true
],
"out": [
"0xf865058504a817c8058301ec309435353535353535353535353535353535353535357d8025a04eebf77a833b30520287ddd9478ff51abbdffa30aa90a8d655dba0e8a79ce0c1a04eebf77a833b30520287ddd9478ff51abbdffa30aa90a8d655dba0e8a79ce0c1"
]
},
"vitalik test 9": {
"in": [
[
"0x06",
"0x04a817c806",
"0x023e38",
"0x3535353535353535353535353535353535353535",
"0xd8",
"0x",
"0x25",
"0x6455bf8ea6e7463a1046a0b52804526e119b4bf5136279614e0b1e8e296a4e2f",
"0x6455bf8ea6e7463a1046a0b52804526e119b4bf5136279614e0b1e8e296a4e2d",
"0x01",
"0x00",
false
],
true
],
"out": [
"0xf866068504a817c80683023e3894353535353535353535353535353535353535353581d88025a06455bf8ea6e7463a1046a0b52804526e119b4bf5136279614e0b1e8e296a4e2fa06455bf8ea6e7463a1046a0b52804526e119b4bf5136279614e0b1e8e296a4e2d"
]
},
"vitalik test 10": {
"in": [
[
"0x07",
"0x04a817c807",
"0x029040",
"0x3535353535353535353535353535353535353535",
"0x0157",
"0x",
"0x25",
"0x52f1a9b320cab38e5da8a8f97989383aab0a49165fc91c737310e4f7e9821021",
"0x52f1a9b320cab38e5da8a8f97989383aab0a49165fc91c737310e4f7e9821021",
"0x01",
"0x00",
false
],
true
],
"out": [
"0xf867078504a817c807830290409435353535353535353535353535353535353535358201578025a052f1a9b320cab38e5da8a8f97989383aab0a49165fc91c737310e4f7e9821021a052f1a9b320cab38e5da8a8f97989383aab0a49165fc91c737310e4f7e9821021"
]
}
},
"sender": {
"vitalik test 0": {
"in": [
[
"0x00",
"0x04a817c800",
"0x5208",
"0x3535353535353535353535353535353535353535",
"0x00",
"0x",
"0x25",
"0x044852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d",
"0x044852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d",
"0x01",
"0x00",
false
]
],
"out": [
"0xf0f6f18bca1b28cd68e4357452947e021241e9ce"
]
},
"vitalik test 1": {
"in": [
[
"0x08",
"0x04a817c808",
"0x02e248",
"0x3535353535353535353535353535353535353535",
"0x0200",
"0x",
"0x25",
"0x64b1702d9298fee62dfeccc57d322a463ad55ca201256d01f62b45b2e1c21c12",
"0x64b1702d9298fee62dfeccc57d322a463ad55ca201256d01f62b45b2e1c21c10",
"0x01",
"0x00",
false
]
],
"out": [
"0x9bddad43f934d313c2b79ca28a432dd2b7281029"
]
},
"vitalik test 2": {
"in": [
[
"0x09",
"0x04a817c809",
"0x033450",
"0x3535353535353535353535353535353535353535",
"0x02d9",
"0x",
"0x25",
"0x52f8f61201b2b11a78d6e866abc9c3db2ae8631fa656bfe5cb53668255367afb",
"0x52f8f61201b2b11a78d6e866abc9c3db2ae8631fa656bfe5cb53668255367afb",
"0x01",
"0x00",
false
]
],
"out": [
"0x3c24d7329e92f84f08556ceb6df1cdb0104ca49f"
]
},
"vitalik test 3": {
"in": [
[
"0x01",
"0x04a817c801",
"0xa410",
"0x3535353535353535353535353535353535353535",
"0x01",
"0x",
"0x25",
"0x489efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bca",
"0x489efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6",
"0x01",
"0x00",
false
]
],
"out": [
"0x23ef145a395ea3fa3deb533b8a9e1b4c6c25d112"
]
},
"vitalik test 4": {
"in": [
[
"0x02",
"0x04a817c802",
"0xf618",
"0x3535353535353535353535353535353535353535",
"0x08",
"0x",
"0x25",
"0x2d7c5bef027816a800da1736444fb58a807ef4c9603b7848673f7e3a68eb14a5",
"0x2d7c5bef027816a800da1736444fb58a807ef4c9603b7848673f7e3a68eb14a5",
"0x01",
"0x00",
false
]
],
"out": [
"0x2e485e0c23b4c3c542628a5f672eeab0ad4888be"
]
},
"vitalik test 5": {
"in": [
[
"0x03",
"0x04a817c803",
"0x014820",
"0x3535353535353535353535353535353535353535",
"0x1b",
"0x",
"0x25",
"0x2a80e1ef1d7842f27f2e6be0972bb708b9a135c38860dbe73c27c3486c34f4e0",
"0x2a80e1ef1d7842f27f2e6be0972bb708b9a135c38860dbe73c27c3486c34f4de",
"0x01",
"0x00",
false
]
],
"out": [
"0x82a88539669a3fd524d669e858935de5e5410cf0"
]
},
"vitalik test 6": {
"in": [
[
"0x04",
"0x04a817c804",
"0x019a28",
"0x3535353535353535353535353535353535353535",
"0x40",
"0x",
"0x25",
"0x13600b294191fc92924bb3ce4b969c1e7e2bab8f4c93c3fc6d0a51733df3c063",
"0x13600b294191fc92924bb3ce4b969c1e7e2bab8f4c93c3fc6d0a51733df3c060",
"0x01",
"0x00",
false
]
],
"out": [
"0xf9358f2538fd5ccfeb848b64a96b743fcc930554"
]
},
"vitalik test 7": {
"in": [
[
"0x05",
"0x04a817c805",
"0x01ec30",
"0x3535353535353535353535353535353535353535",
"0x7d",
"0x",
"0x25",
"0x4eebf77a833b30520287ddd9478ff51abbdffa30aa90a8d655dba0e8a79ce0c1",
"0x4eebf77a833b30520287ddd9478ff51abbdffa30aa90a8d655dba0e8a79ce0c1",
"0x01",
"0x00",
false
]
],
"out": [
"0xa8f7aba377317440bc5b26198a363ad22af1f3a4"
]
},
"vitalik test 8": {
"in": [
[
"0x05",
"0x04a817c805",
"0x01ec30",
"0x3535353535353535353535353535353535353535",
"0x7d",
"0x",
"0x25",
"0x4eebf77a833b30520287ddd9478ff51abbdffa30aa90a8d655dba0e8a79ce0c1",
"0x4eebf77a833b30520287ddd9478ff51abbdffa30aa90a8d655dba0e8a79ce0c1",
"0x01",
"0x00",
false
]
],
"out": [
"0xa8f7aba377317440bc5b26198a363ad22af1f3a4"
]
},
"vitalik test 9": {
"in": [
[
"0x06",
"0x04a817c806",
"0x023e38",
"0x3535353535353535353535353535353535353535",
"0xd8",
"0x",
"0x25",
"0x6455bf8ea6e7463a1046a0b52804526e119b4bf5136279614e0b1e8e296a4e2f",
"0x6455bf8ea6e7463a1046a0b52804526e119b4bf5136279614e0b1e8e296a4e2d",
"0x01",
"0x00",
false
]
],
"out": [
"0xf1f571dc362a0e5b2696b8e775f8491d3e50de35"
]
},
"vitalik test 10": {
"in": [
[
"0x07",
"0x04a817c807",
"0x029040",
"0x3535353535353535353535353535353535353535",
"0x0157",
"0x",
"0x25",
"0x52f1a9b320cab38e5da8a8f97989383aab0a49165fc91c737310e4f7e9821021",
"0x52f1a9b320cab38e5da8a8f97989383aab0a49165fc91c737310e4f7e9821021",
"0x01",
"0x00",
false
]
],
"out": [
"0xd37922162ab7cea97c97a87551ed02c9a38b7332"
]
}
}
}
}
{ {
"tests": { "tests": {
"decompressEIP155Transaction": {
"decompression": {
"in": [
"0x0001f4000064000064121212121212121212121212121212121212121299999999999999999999",
420
],
"out": [
[
100,
100000000,
500,
"0x1212121212121212121212121212121212121212",
0,
"0x99999999999999999999",
420
]
]
}
}
} }
} }
{
"tests": {
"recover": {
"standard hash, valid signature": {
"in": [
"0xf83d80808094121212121212121212121212121212121212121280a0bc36789e7a1e281436464229828f817d6612f7b477d66591ff96a9e064bcc98a6c8080",
false,
"0x01",
"0x057bf1c0edf0a9002a79f8c9b39683f6453a18e73e02364270a2b6ee8117f11a",
"0x5f8181365a222c7b05a84c29a29754e6a925952d3bf4bd65a6259ef37ee048e3"
],
"out": [
"0x17ec8597ff92C3F44523bDc65BF0f1bE632917ff"
]
},
"standard hash, invalid v parameter": {
"in": [
"0xf83d80808094121212121212121212121212121212121212121280a0bc36789e7a1e281436464229828f817d6612f7b477d66591ff96a9e064bcc98a6c8080",
false,
"0xfc",
"0x057bf1c0edf0a9002a79f8c9b39683f6453a18e73e02364270a2b6ee8117f11a",
"0x5f8181365a222c7b05a84c29a29754e6a925952d3bf4bd65a6259ef37ee048e3"
],
"out": [
"0x0000000000000000000000000000000000000000"
]
},
"standard hash, invalid r parameter": {
"in": [
"0xf83d80808094121212121212121212121212121212121212121280a0bc36789e7a1e281436464229828f817d6612f7b477d66591ff96a9e064bcc98a6c8080",
false,
"0x01",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x5f8181365a222c7b05a84c29a29754e6a925952d3bf4bd65a6259ef37ee048e3"
],
"out": [
"0x0000000000000000000000000000000000000000"
]
},
"standard hash, invalid s parameter": {
"in": [
"0xf83d80808094121212121212121212121212121212121212121280a0bc36789e7a1e281436464229828f817d6612f7b477d66591ff96a9e064bcc98a6c8080",
false,
"0x01",
"0x057bf1c0edf0a9002a79f8c9b39683f6453a18e73e02364270a2b6ee8117f11a",
"0x0000000000000000000000000000000000000000000000000000000000000000"
],
"out": [
"0x0000000000000000000000000000000000000000"
]
},
"standard hash, invalid message": {
"in": [
"0x0000000000000000000000000000000000000000000000000000000000000000",
false,
"0x01",
"0x057bf1c0edf0a9002a79f8c9b39683f6453a18e73e02364270a2b6ee8117f11a",
"0x5f8181365a222c7b05a84c29a29754e6a925952d3bf4bd65a6259ef37ee048e3"
],
"out": [
"0x1397890fcfC2D7563Aa01cE93A217b9809D3447B"
]
},
"eth signed message hash, valid signature": {
"in": [
"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006c000000000000000000000000121212121212121212121212121212121212121200000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000020bc36789e7a1e281436464229828f817d6612f7b477d66591ff96a9e064bcc98a",
true,
"0x01",
"0xe5a2edb71b6d76a8aacd59467d3063fd455ca13a4e9cb57da6f25849d40e4e2a",
"0x5465373d68d521845e3ffd2baf4c51f3d21c990914c09490b32ffc0b322dbf98"
],
"out": [
"0x17ec8597ff92C3F44523bDc65BF0f1bE632917ff"
]
},
"eth signed message hash, invalid v parameter": {
"in": [
"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006c000000000000000000000000121212121212121212121212121212121212121200000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000020bc36789e7a1e281436464229828f817d6612f7b477d66591ff96a9e064bcc98a",
true,
"0x1c",
"0xe5a2edb71b6d76a8aacd59467d3063fd455ca13a4e9cb57da6f25849d40e4e2a",
"0x5465373d68d521845e3ffd2baf4c51f3d21c990914c09490b32ffc0b322dbf98"
],
"out": [
"0x0000000000000000000000000000000000000000"
]
},
"eth signed message hash, invalid r parameter": {
"in": [
"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006c000000000000000000000000121212121212121212121212121212121212121200000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000020bc36789e7a1e281436464229828f817d6612f7b477d66591ff96a9e064bcc98a",
true,
"0x01",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x5465373d68d521845e3ffd2baf4c51f3d21c990914c09490b32ffc0b322dbf98"
],
"out": [
"0x0000000000000000000000000000000000000000"
]
},
"eth signed message hash, invalid s parameter": {
"in": [
"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006c000000000000000000000000121212121212121212121212121212121212121200000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000020bc36789e7a1e281436464229828f817d6612f7b477d66591ff96a9e064bcc98a",
true,
"0x01",
"0xe5a2edb71b6d76a8aacd59467d3063fd455ca13a4e9cb57da6f25849d40e4e2a",
"0x0000000000000000000000000000000000000000000000000000000000000000"
],
"out": [
"0x0000000000000000000000000000000000000000"
]
},
"eth signed message hash, invalid message": {
"in": [
"0x0000000000000000000000000000000000000000000000000000000000000000",
true,
"0x01",
"0xe5a2edb71b6d76a8aacd59467d3063fd455ca13a4e9cb57da6f25849d40e4e2a",
"0x5465373d68d521845e3ffd2baf4c51f3d21c990914c09490b32ffc0b322dbf98"
],
"out": [
"0xf8bd1421f9D28C8F58f33B25a6faB16F3f89b749"
]
}
}
}
}
...@@ -37,115 +37,3 @@ export const getRawSignedComponents = (signed: string): any[] => { ...@@ -37,115 +37,3 @@ export const getRawSignedComponents = (signed: string): any[] => {
export const getSignedComponents = (signed: string): any[] => { export const getSignedComponents = (signed: string): any[] => {
return ethers.utils.RLP.decode(signed).slice(-3) return ethers.utils.RLP.decode(signed).slice(-3)
} }
export const encodeCompactTransaction = (transaction: any): string => {
const nonce = ethers.utils.zeroPad(transaction.nonce, 3)
const gasLimit = ethers.utils.zeroPad(transaction.gasLimit, 3)
if (transaction.gasPrice % 1000000 !== 0)
throw Error('gas price must be a multiple of 1000000')
const compressedGasPrice: any = transaction.gasPrice / 1000000
const gasPrice = ethers.utils.zeroPad(compressedGasPrice, 3)
const to = !transaction.to.length
? fromHexString(constants.AddressZero)
: fromHexString(transaction.to)
const data = fromHexString(transaction.data)
return Buffer.concat([
Buffer.from(gasLimit),
Buffer.from(gasPrice),
Buffer.from(nonce),
Buffer.from(to),
data,
]).toString('hex')
}
export const serializeEthSignTransaction = (
transaction: EIP155Transaction
): string => {
return ethers.utils.defaultAbiCoder.encode(
['uint256', 'uint256', 'uint256', 'uint256', 'address', 'bytes'],
[
transaction.nonce,
transaction.gasLimit,
transaction.gasPrice,
transaction.chainId,
transaction.to,
transaction.data,
]
)
}
export const serializeNativeTransaction = (
transaction: EIP155Transaction
): string => {
return ethers.utils.serializeTransaction(transaction)
}
export const signEthSignMessage = async (
wallet: Wallet,
transaction: EIP155Transaction
): Promise<SignatureParameters> => {
const serializedTransaction = serializeEthSignTransaction(transaction)
const transactionHash = ethers.utils.keccak256(serializedTransaction)
const transactionHashBytes = ethers.utils.arrayify(transactionHash)
const transactionSignature = await wallet.signMessage(transactionHashBytes)
const messageHash = ethers.utils.hashMessage(transactionHashBytes)
const [v, r, s] = getRawSignedComponents(transactionSignature).map(
(component) => {
return remove0x(component)
}
)
return {
messageHash,
v: '0' + (parseInt(v, 16) - 27),
r,
s,
}
}
export const signNativeTransaction = async (
wallet: Wallet,
transaction: EIP155Transaction
): Promise<SignatureParameters> => {
const serializedTransaction = serializeNativeTransaction(transaction)
const transactionSignature = await wallet.signTransaction(transaction)
const messageHash = ethers.utils.keccak256(serializedTransaction)
const [v, r, s] = getSignedComponents(transactionSignature).map(
(component) => {
return remove0x(component)
}
)
return {
messageHash,
v: '0' + (parseInt(v, 16) - transaction.chainId * 2 - 8 - 27),
r,
s,
}
}
export const signTransaction = async (
wallet: Wallet,
transaction: EIP155Transaction,
transactionType: number
): Promise<SignatureParameters> => {
return transactionType === 2
? signEthSignMessage(wallet, transaction) //ETH Signed tx
: signNativeTransaction(wallet, transaction) //Create EOA tx or EIP155 tx
}
export const encodeSequencerCalldata = async (
wallet: Wallet,
transaction: EIP155Transaction,
transactionType: number
) => {
const sig = await signTransaction(wallet, transaction, transactionType)
const encodedTransaction = encodeCompactTransaction(transaction)
const dataPrefix = `0x0${transactionType}${sig.r}${sig.s}${sig.v}`
const calldata =
transactionType === 1
? `${dataPrefix}${remove0x(sig.messageHash)}` // Create EOA tx
: `${dataPrefix}${encodedTransaction}` // EIP155 tx or ETH Signed Tx
return calldata
}
...@@ -4,10 +4,14 @@ import { expect } from '../../setup' ...@@ -4,10 +4,14 @@ import { expect } from '../../setup'
import { ethers } from 'hardhat' import { ethers } from 'hardhat'
import { Contract, BigNumber } from 'ethers' import { Contract, BigNumber } from 'ethers'
const bigNumberify = (arr) => { const bigNumberify = (arr: any[]) => {
return arr.map((el: any) => { return arr.map((el: any) => {
if (typeof el === 'number') { if (typeof el === 'number') {
return BigNumber.from(el) return BigNumber.from(el)
} else if (typeof el === 'string' && /^\d+n$/gm.test(el)) {
return BigNumber.from(el.slice(0, el.length - 1))
} else if (typeof el === 'string' && el.length > 2 && el.startsWith('0x')) {
return BigNumber.from(el.toLowerCase())
} else if (Array.isArray(el)) { } else if (Array.isArray(el)) {
return bigNumberify(el) return bigNumberify(el)
} else { } else {
...@@ -31,7 +35,7 @@ export const runJsonTest = (contractName: string, json: any): void => { ...@@ -31,7 +35,7 @@ export const runJsonTest = (contractName: string, json: any): void => {
.reverted .reverted
} else { } else {
expect( expect(
await contract.functions[functionName](...test.in) bigNumberify(await contract.functions[functionName](...test.in))
).to.deep.equal(bigNumberify(test.out)) ).to.deep.equal(bigNumberify(test.out))
} }
}) })
......
...@@ -243,36 +243,31 @@ const maybeDecodeSequencerBatchTransaction = ( ...@@ -243,36 +243,31 @@ const maybeDecodeSequencerBatchTransaction = (
decoded: DecodedSequencerBatchTransaction | null decoded: DecodedSequencerBatchTransaction | null
type: 'EIP155' | 'ETH_SIGN' | null type: 'EIP155' | 'ETH_SIGN' | null
} => { } => {
let decoded = null
let type = null
try { try {
const txType = transaction.slice(0, 1).readUInt8() const decodedTx = ethers.utils.parseTransaction(transaction)
if (txType === TxType.EIP155) {
type = 'EIP155' return {
decoded = ctcCoder.eip155TxData.decode(transaction.toString('hex')) type: 'EIP155',
} else if (txType === TxType.EthSign) { decoded: {
type = 'ETH_SIGN' nonce: BigNumber.from(decodedTx.nonce).toNumber(),
decoded = ctcCoder.ethSignTxData.decode(transaction.toString('hex')) gasPrice: BigNumber.from(decodedTx.gasPrice).toNumber(),
} else if (txType === TxType.EthSign2) { gasLimit: BigNumber.from(decodedTx.gasLimit).toNumber(),
type = 'ETH_SIGN' value: toRpcHexString(decodedTx.value),
decoded = ctcCoder.ethSign2TxData.decode(transaction.toString('hex')) target: toHexString(decodedTx.to), // Maybe null this out for creations?
} else { data: toHexString(decodedTx.data),
throw new Error(`Unknown sequencer transaction type.`) sig: {
} v: BigNumber.from(decodedTx.v).toNumber(),
// Temporary fix to propagate the value r: toHexString(decodedTx.r),
decoded.value = '0x0' s: toHexString(decodedTx.s),
// Validate the transaction },
if (!validateBatchTransaction(type, decoded)) { type: 0, // EIP155 legacy holdover.
decoded = null },
} }
} catch (err) { } catch (err) {
// Do nothing return {
} decoded: null,
type: null,
return { }
decoded,
type,
} }
} }
......
...@@ -218,7 +218,8 @@ export class L1TransportServer extends BaseService<L1TransportServerOptions> { ...@@ -218,7 +218,8 @@ export class L1TransportServer extends BaseService<L1TransportServerOptions> {
break break
case 'l2': case 'l2':
currentL2Block = await this.state.db.getLatestUnconfirmedTransaction() currentL2Block = await this.state.db.getLatestUnconfirmedTransaction()
highestL2BlockNumber = await this.state.db.getHighestSyncedUnconfirmedBlock() highestL2BlockNumber =
(await this.state.db.getHighestSyncedUnconfirmedBlock()) - 1
break break
default: default:
throw new Error(`Unknown transaction backend ${backend}`) throw new Error(`Unknown transaction backend ${backend}`)
......
...@@ -136,65 +136,6 @@ describe('Event Handlers: OVM_CanonicalTransactionChain.SequencerBatchAppended', ...@@ -136,65 +136,6 @@ describe('Event Handlers: OVM_CanonicalTransactionChain.SequencerBatchAppended',
'10B99425FB53AD7D40A939205C0F7B35CBB89AB4D67E7AE64BDAC5F1073943B4', '10B99425FB53AD7D40A939205C0F7B35CBB89AB4D67E7AE64BDAC5F1073943B4',
batchExtraData: '', batchExtraData: '',
} }
it('should correctly parse a mainnet transaction', async () => {
const input1: [any, SequencerBatchAppendedExtraData] = [
{
args: {
_startingQueueIndex: ethers.constants.Zero,
_numQueueElements: ethers.constants.Zero,
_totalElements: ethers.constants.Zero,
},
},
{
l1TransactionData,
...exampleExtraData,
},
]
const output1 = await handleEventsSequencerBatchAppended.parseEvent(
...input1
)
const batchEntry = output1.transactionBatchEntry
expect(batchEntry.index).to.eq(exampleExtraData.batchIndex.toNumber())
expect(batchEntry.root).to.eq(exampleExtraData.batchRoot)
expect(batchEntry.size).to.eq(exampleExtraData.batchSize.toNumber())
expect(batchEntry.prevTotalElements).to.eq(
exampleExtraData.prevTotalElements.toNumber()
)
expect(batchEntry.extraData).to.eq(exampleExtraData.batchExtraData)
expect(batchEntry.blockNumber).to.eq(exampleExtraData.blockNumber)
expect(batchEntry.timestamp).to.eq(exampleExtraData.timestamp)
expect(batchEntry.submitter).to.eq(exampleExtraData.submitter)
expect(batchEntry.l1TransactionHash).to.eq(
exampleExtraData.l1TransactionHash
)
// Expected transaction entry results based on mainnet data
// Source: https://ethtx.info/mainnet/0x6effe006836b841205ace4d99d7ae1b74ee96aac499a3f358b97fccd32ee9af2
const txEntries = output1.transactionEntries
expect(txEntries).to.have.length(101)
expect(txEntries.every((t) => t.queueOrigin === 'sequencer' || 'l1')).to
.be.true
// Sequencer transactions are decoded, but l1 transactions are not
txEntries.forEach((tx, i) => {
if (tx.queueOrigin === 'l1') {
expect(tx.decoded).to.be.null
} else {
const l2Tx = blocksOnL2[i].transactions[0]
expect(tx.decoded.data).to.equal(l2Tx.data)
expect(tx.decoded.target).to.equal(l2Tx.to.toLowerCase())
expect(tx.decoded.nonce).to.equal(l2Tx.nonce)
expect(tx.decoded.gasLimit).to.equal(
BigNumber.from(l2Tx.gasLimit.hex).toNumber()
)
expect(tx.decoded.gasPrice).to.equal(
BigNumber.from(l2Tx.gasPrice.hex).toNumber()
)
}
})
})
it('should error on malformed transaction data', async () => { it('should error on malformed transaction data', async () => {
const input1: [any, SequencerBatchAppendedExtraData] = [ const input1: [any, SequencerBatchAppendedExtraData] = [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment