Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
707d8735
Unverified
Commit
707d8735
authored
Apr 19, 2023
by
mergify[bot]
Committed by
GitHub
Apr 19, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into jm/wd-mon-fix-metrics-label
parents
a26c484a
a09c7d01
Changes
50
Hide whitespace changes
Inline
Side-by-side
Showing
50 changed files
with
1604 additions
and
741 deletions
+1604
-741
config.yml
.circleci/config.yml
+59
-18
release.yml
.github/workflows/release.yml
+0
-27
getting-started.md
docs/op-stack/src/docs/build/getting-started.md
+1
-1
l1crossdomainmessenger.go
op-bindings/bindings/l1crossdomainmessenger.go
+1
-1
l1crossdomainmessenger_more.go
op-bindings/bindings/l1crossdomainmessenger_more.go
+2
-2
l2crossdomainmessenger.go
op-bindings/bindings/l2crossdomainmessenger.go
+1
-1
l2crossdomainmessenger_more.go
op-bindings/bindings/l2crossdomainmessenger_more.go
+2
-2
l2outputoracle.go
op-bindings/bindings/l2outputoracle.go
+1
-1
main.go
op-chain-ops/cmd/withdrawals/main.go
+80
-8
migrate.go
op-chain-ops/crossdomain/migrate.go
+5
-10
migrate_test.go
op-chain-ops/crossdomain/migrate_test.go
+3
-3
setup.go
op-e2e/setup.go
+11
-3
system_fpp_test.go
op-e2e/system_fpp_test.go
+106
-0
system_test.go
op-e2e/system_test.go
+20
-0
start.go
op-node/rollup/sync/start.go
+2
-2
debug_client.go
op-node/sources/debug_client.go
+49
-0
mock_debug_client.go
op-node/testutils/mock_debug_client.go
+30
-0
Makefile
op-program/Makefile
+1
-1
driver.go
op-program/client/driver/driver.go
+14
-7
driver_test.go
op-program/client/driver/driver_test.go
+37
-5
hints.go
op-program/client/l1/hints.go
+9
-3
hints.go
op-program/client/l2/hints.go
+11
-4
main.go
op-program/host/cmd/main.go
+4
-55
main_test.go
op-program/host/cmd/main_test.go
+89
-57
config.go
op-program/host/config/config.go
+73
-26
config_test.go
op-program/host/config/config_test.go
+31
-8
flags.go
op-program/host/flags/flags.go
+13
-1
host.go
op-program/host/host.go
+133
-0
l1.go
op-program/host/l1/l1.go
+9
-3
l2.go
op-program/host/l2/l2.go
+8
-25
prefetcher.go
op-program/host/prefetcher/prefetcher.go
+164
-0
prefetcher_test.go
op-program/host/prefetcher/prefetcher_test.go
+333
-0
hints.go
op-program/preimage/hints.go
+2
-0
hints_test.go
op-program/preimage/hints_test.go
+18
-0
package.json
ops/docker/ci-builder/package.json
+0
-7
package.json
package.json
+0
-1
.gas-snapshot
packages/contracts-bedrock/.gas-snapshot
+38
-41
.storage-layout
packages/contracts-bedrock/.storage-layout
+2
-4
L2OutputOracle.sol
packages/contracts-bedrock/contracts/L1/L2OutputOracle.sol
+4
-4
CrossDomainMessenger.t.sol
...ntracts-bedrock/contracts/test/CrossDomainMessenger.t.sol
+153
-1
L1CrossDomainMessenger.t.sol
...racts-bedrock/contracts/test/L1CrossDomainMessenger.t.sol
+0
-171
L2CrossDomainMessenger.t.sol
...racts-bedrock/contracts/test/L2CrossDomainMessenger.t.sol
+0
-164
L2OutputOracle.t.sol
...ges/contracts-bedrock/contracts/test/L2OutputOracle.t.sol
+4
-14
OptimismPortal.t.sol
...ges/contracts-bedrock/contracts/test/OptimismPortal.t.sol
+25
-14
SafeCall.t.sol
packages/contracts-bedrock/contracts/test/SafeCall.t.sol
+2
-0
CrossDomainMessenger.t.sol
...rock/contracts/test/invariants/CrossDomainMessenger.t.sol
+13
-9
CrossDomainMessenger.sol
...acts-bedrock/contracts/universal/CrossDomainMessenger.sol
+10
-16
message-utils.ts
packages/sdk/src/utils/message-utils.ts
+5
-3
message-utils.spec.ts
packages/sdk/test/utils/message-utils.spec.ts
+3
-3
withdrawals.md
specs/withdrawals.md
+23
-15
No files found.
.circleci/config.yml
View file @
707d8735
...
@@ -60,7 +60,7 @@ commands:
...
@@ -60,7 +60,7 @@ commands:
jobs
:
jobs
:
yarn-monorepo
:
yarn-monorepo
:
docker
:
docker
:
-
image
:
ethereumoptimism
/ci-builder:latest
-
image
:
us-docker.pkg.dev/oplabs-tools-artifacts/images
/ci-builder:latest
resource_class
:
large
resource_class
:
large
steps
:
steps
:
-
checkout
-
checkout
...
@@ -286,7 +286,7 @@ jobs:
...
@@ -286,7 +286,7 @@ jobs:
command
:
|
command
:
|
./ops/scripts/ci-docker-tag-op-stack-release.sh <<parameters.registry>>/<<parameters.repo>> $CIRCLE_TAG $CIRCLE_SHA1
./ops/scripts/ci-docker-tag-op-stack-release.sh <<parameters.registry>>/<<parameters.repo>> $CIRCLE_TAG $CIRCLE_SHA1
contracts-bedrock-
tests
:
contracts-bedrock-
coverage
:
docker
:
docker
:
-
image
:
ethereumoptimism/ci-builder:latest
-
image
:
ethereumoptimism/ci-builder:latest
resource_class
:
large
resource_class
:
large
...
@@ -304,9 +304,8 @@ jobs:
...
@@ -304,9 +304,8 @@ jobs:
command
:
forge --version
command
:
forge --version
working_directory
:
packages/contracts-bedrock
working_directory
:
packages/contracts-bedrock
-
run
:
-
run
:
name
:
test and generate coverage
name
:
generate coverage report
command
:
yarn coverage:lcov
command
:
yarn coverage:lcov
no_output_timeout
:
18m
environment
:
environment
:
FOUNDRY_PROFILE
:
ci
FOUNDRY_PROFILE
:
ci
working_directory
:
packages/contracts-bedrock
working_directory
:
packages/contracts-bedrock
...
@@ -316,9 +315,33 @@ jobs:
...
@@ -316,9 +315,33 @@ jobs:
environment
:
environment
:
FOUNDRY_PROFILE
:
ci
FOUNDRY_PROFILE
:
ci
contracts-bedrock-tests
:
docker
:
-
image
:
us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder:latest
resource_class
:
large
steps
:
-
checkout
-
attach_workspace
:
{
at
:
"
."
}
-
restore_cache
:
name
:
Restore Yarn Package Cache
keys
:
-
yarn-packages-v2-{{ checksum "yarn.lock" }}
-
check-changed
:
patterns
:
contracts-bedrock,hardhat-deploy-config
-
run
:
name
:
print forge version
command
:
forge --version
working_directory
:
packages/contracts-bedrock
-
run
:
name
:
run tests
command
:
yarn test
environment
:
FOUNDRY_PROFILE
:
ci
working_directory
:
packages/contracts-bedrock
contracts-bedrock-checks
:
contracts-bedrock-checks
:
docker
:
docker
:
-
image
:
ethereumoptimism
/ci-builder:latest
-
image
:
us-docker.pkg.dev/oplabs-tools-artifacts/images
/ci-builder:latest
steps
:
steps
:
-
checkout
-
checkout
-
attach_workspace
:
{
at
:
"
."
}
-
attach_workspace
:
{
at
:
"
."
}
...
@@ -378,7 +401,7 @@ jobs:
...
@@ -378,7 +401,7 @@ jobs:
contracts-bedrock-slither
:
contracts-bedrock-slither
:
docker
:
docker
:
-
image
:
ethereumoptimism
/ci-builder:latest
-
image
:
us-docker.pkg.dev/oplabs-tools-artifacts/images
/ci-builder:latest
resource_class
:
large
resource_class
:
large
steps
:
steps
:
-
checkout
-
checkout
...
@@ -398,7 +421,7 @@ jobs:
...
@@ -398,7 +421,7 @@ jobs:
contracts-bedrock-validate-spaces
:
contracts-bedrock-validate-spaces
:
docker
:
docker
:
-
image
:
ethereumoptimism
/ci-builder:latest
-
image
:
us-docker.pkg.dev/oplabs-tools-artifacts/images
/ci-builder:latest
steps
:
steps
:
-
checkout
-
checkout
-
attach_workspace
:
{
at
:
"
."
}
-
attach_workspace
:
{
at
:
"
."
}
...
@@ -415,7 +438,7 @@ jobs:
...
@@ -415,7 +438,7 @@ jobs:
bedrock-echidna-build
:
bedrock-echidna-build
:
docker
:
docker
:
-
image
:
ethereumoptimism
/ci-builder:latest
-
image
:
us-docker.pkg.dev/oplabs-tools-artifacts/images
/ci-builder:latest
steps
:
steps
:
-
checkout
-
checkout
-
attach_workspace
:
{
at
:
"
."
}
-
attach_workspace
:
{
at
:
"
."
}
...
@@ -433,7 +456,7 @@ jobs:
...
@@ -433,7 +456,7 @@ jobs:
bedrock-echidna-run
:
bedrock-echidna-run
:
docker
:
docker
:
-
image
:
ethereumoptimism
/ci-builder:latest
-
image
:
us-docker.pkg.dev/oplabs-tools-artifacts/images
/ci-builder:latest
parameters
:
parameters
:
echidna_target
:
echidna_target
:
description
:
Which echidna fuzz contract to run
description
:
Which echidna fuzz contract to run
...
@@ -460,7 +483,7 @@ jobs:
...
@@ -460,7 +483,7 @@ jobs:
op-bindings-build
:
op-bindings-build
:
docker
:
docker
:
-
image
:
ethereumoptimism
/ci-builder:latest
-
image
:
us-docker.pkg.dev/oplabs-tools-artifacts/images
/ci-builder:latest
resource_class
:
medium
resource_class
:
medium
steps
:
steps
:
-
checkout
-
checkout
...
@@ -489,7 +512,7 @@ jobs:
...
@@ -489,7 +512,7 @@ jobs:
description
:
Coverage flag name
description
:
Coverage flag name
type
:
string
type
:
string
docker
:
docker
:
-
image
:
ethereumoptimism
/ci-builder:latest
-
image
:
us-docker.pkg.dev/oplabs-tools-artifacts/images
/ci-builder:latest
resource_class
:
large
resource_class
:
large
steps
:
steps
:
-
checkout
-
checkout
...
@@ -535,7 +558,7 @@ jobs:
...
@@ -535,7 +558,7 @@ jobs:
fuzz-op-node
:
fuzz-op-node
:
docker
:
docker
:
-
image
:
ethereumoptimism
/ci-builder:latest
-
image
:
us-docker.pkg.dev/oplabs-tools-artifacts/images
/ci-builder:latest
steps
:
steps
:
-
checkout
-
checkout
-
check-changed
:
-
check-changed
:
...
@@ -547,7 +570,7 @@ jobs:
...
@@ -547,7 +570,7 @@ jobs:
depcheck
:
depcheck
:
docker
:
docker
:
-
image
:
ethereumoptimism
/ci-builder:latest
-
image
:
us-docker.pkg.dev/oplabs-tools-artifacts/images
/ci-builder:latest
steps
:
steps
:
-
checkout
-
checkout
-
attach_workspace
:
{
at
:
"
."
}
-
attach_workspace
:
{
at
:
"
."
}
...
@@ -609,7 +632,7 @@ jobs:
...
@@ -609,7 +632,7 @@ jobs:
description
:
Go Module Name
description
:
Go Module Name
type
:
string
type
:
string
docker
:
docker
:
-
image
:
ethereumoptimism
/ci-builder:latest
# only used to enable codecov.
-
image
:
us-docker.pkg.dev/oplabs-tools-artifacts/images
/ci-builder:latest
# only used to enable codecov.
resource_class
:
xlarge
resource_class
:
xlarge
steps
:
steps
:
-
checkout
-
checkout
...
@@ -637,7 +660,7 @@ jobs:
...
@@ -637,7 +660,7 @@ jobs:
description
:
If the op-e2e package should use HTTP clients
description
:
If the op-e2e package should use HTTP clients
type
:
string
type
:
string
docker
:
docker
:
-
image
:
ethereumoptimism
/ci-builder:latest
-
image
:
us-docker.pkg.dev/oplabs-tools-artifacts/images
/ci-builder:latest
resource_class
:
xlarge
resource_class
:
xlarge
steps
:
steps
:
-
checkout
-
checkout
...
@@ -676,7 +699,7 @@ jobs:
...
@@ -676,7 +699,7 @@ jobs:
type
:
string
type
:
string
default
:
this-package-does-not-exist
default
:
this-package-does-not-exist
docker
:
docker
:
-
image
:
ethereumoptimism
/ci-builder:latest
-
image
:
us-docker.pkg.dev/oplabs-tools-artifacts/images
/ci-builder:latest
-
image
:
cimg/postgres:14.1
-
image
:
cimg/postgres:14.1
steps
:
steps
:
-
checkout
-
checkout
...
@@ -705,7 +728,7 @@ jobs:
...
@@ -705,7 +728,7 @@ jobs:
geth-tests
:
geth-tests
:
docker
:
docker
:
-
image
:
ethereumoptimism
/ci-builder:latest
-
image
:
us-docker.pkg.dev/oplabs-tools-artifacts/images
/ci-builder:latest
steps
:
steps
:
-
checkout
-
checkout
-
check-changed
:
-
check-changed
:
...
@@ -925,7 +948,7 @@ jobs:
...
@@ -925,7 +948,7 @@ jobs:
go-mod-tidy
:
go-mod-tidy
:
docker
:
docker
:
-
image
:
ethereumoptimism
/ci-builder:latest
-
image
:
us-docker.pkg.dev/oplabs-tools-artifacts/images
/ci-builder:latest
steps
:
steps
:
-
checkout
-
checkout
-
run
:
-
run
:
...
@@ -1007,6 +1030,9 @@ workflows:
...
@@ -1007,6 +1030,9 @@ workflows:
-
contracts-bedrock-tests
:
-
contracts-bedrock-tests
:
requires
:
requires
:
-
yarn-monorepo
-
yarn-monorepo
-
contracts-bedrock-coverage
:
requires
:
-
yarn-monorepo
-
contracts-bedrock-checks
:
-
contracts-bedrock-checks
:
requires
:
requires
:
-
yarn-monorepo
-
yarn-monorepo
...
@@ -1371,3 +1397,18 @@ workflows:
...
@@ -1371,3 +1397,18 @@ workflows:
-
oplabs-gcr-release
-
oplabs-gcr-release
requires
:
requires
:
-
hold
-
hold
release-ci-builder
:
jobs
:
-
docker-publish
:
name
:
ci-builder-docker-publish
filters
:
tags
:
only
:
/^ci-builder\/v.*/
branches
:
ignore
:
/.*/
docker_file
:
./ops/docker/ci-builder/Dockerfile
docker_name
:
ci-builder
docker_tags
:
<<pipeline.git.revision>>,latest
docker_context
:
./ops/docker/ci-builder
context
:
-
oplabs-gcr
\ No newline at end of file
.github/workflows/release.yml
View file @
707d8735
...
@@ -27,7 +27,6 @@ jobs:
...
@@ -27,7 +27,6 @@ jobs:
op-exporter
:
${{ steps.packages.outputs.op-exporter }}
op-exporter
:
${{ steps.packages.outputs.op-exporter }}
l2geth-exporter
:
${{ steps.packages.outputs.l2geth-exporter }}
l2geth-exporter
:
${{ steps.packages.outputs.l2geth-exporter }}
batch-submitter-service
:
${{ steps.packages.outputs.batch-submitter-service }}
batch-submitter-service
:
${{ steps.packages.outputs.batch-submitter-service }}
ci-builder
:
${{ steps.packages.outputs.ci-builder }}
foundry
:
${{ steps.packages.outputs.foundry }}
foundry
:
${{ steps.packages.outputs.foundry }}
endpoint-monitor
:
${{ steps.packages.outputs.endpoint-monitor }}
endpoint-monitor
:
${{ steps.packages.outputs.endpoint-monitor }}
...
@@ -159,32 +158,6 @@ jobs:
...
@@ -159,32 +158,6 @@ jobs:
push
:
true
push
:
true
tags
:
ethereumoptimism/hardhat-node:${{ needs.release.outputs.hardhat-node }},ethereumoptimism/hardhat-node:latest
tags
:
ethereumoptimism/hardhat-node:${{ needs.release.outputs.hardhat-node }},ethereumoptimism/hardhat-node:latest
ci-builder
:
name
:
Publish ci-builder ${{ needs.release.outputs.ci-builder }}
needs
:
release
if
:
needs.release.outputs.ci-builder != ''
runs-on
:
ubuntu-latest
steps
:
-
name
:
Checkout
uses
:
actions/checkout@v2
-
name
:
Login to Docker Hub
uses
:
docker/login-action@v1
with
:
username
:
${{ secrets.DOCKERHUB_ACCESS_TOKEN_USERNAME }}
password
:
${{ secrets.DOCKERHUB_ACCESS_TOKEN_SECRET }}
-
name
:
Set up Docker Buildx
uses
:
docker/setup-buildx-action@v1
-
name
:
Publish ci-builder
uses
:
docker/build-push-action@v2
with
:
context
:
./ops/docker/ci-builder
file
:
./ops/docker/ci-builder/Dockerfile
push
:
true
tags
:
ethereumoptimism/ci-builder:${{ needs.release.outputs.ci-builder }},ethereumoptimism/ci-builder:latest
foundry
:
foundry
:
name
:
Publish foundry ${{ needs.release.outputs.foundry }}
name
:
Publish foundry ${{ needs.release.outputs.foundry }}
needs
:
release
needs
:
release
...
...
docs/op-stack/src/docs/build/getting-started.md
View file @
707d8735
...
@@ -221,7 +221,7 @@ Once you’ve configured your network, it’s time to deploy the L1 smart contra
...
@@ -221,7 +221,7 @@ Once you’ve configured your network, it’s time to deploy the L1 smart contra
1.
Once you’re ready, deploy the L1 smart contracts:
1.
Once you’re ready, deploy the L1 smart contracts:
```bash
```bash
npx hardhat deploy --network getting-started
npx hardhat deploy --network getting-started
--tags l1
```
```
Contract deployment can take up to 15 minutes. Please wait for all smart contracts to be fully deployed before continuing to the next step.
Contract deployment can take up to 15 minutes. Please wait for all smart contracts to be fully deployed before continuing to the next step.
...
...
op-bindings/bindings/l1crossdomainmessenger.go
View file @
707d8735
...
@@ -31,7 +31,7 @@ var (
...
@@ -31,7 +31,7 @@ var (
// L1CrossDomainMessengerMetaData contains all meta data concerning the L1CrossDomainMessenger contract.
// L1CrossDomainMessengerMetaData contains all meta data concerning the L1CrossDomainMessenger contract.
var
L1CrossDomainMessengerMetaData
=
&
bind
.
MetaData
{
var
L1CrossDomainMessengerMetaData
=
&
bind
.
MetaData
{
ABI
:
"[{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
contractOptimismPortal
\"
,
\"
name
\"
:
\"
_portal
\"
,
\"
type
\"
:
\"
address
\"
}],
\"
stateMutability
\"
:
\"
nonpayable
\"
,
\"
type
\"
:
\"
constructor
\"
},{
\"
anonymous
\"
:false,
\"
inputs
\"
:[{
\"
indexed
\"
:true,
\"
internalType
\"
:
\"
bytes32
\"
,
\"
name
\"
:
\"
msgHash
\"
,
\"
type
\"
:
\"
bytes32
\"
}],
\"
name
\"
:
\"
FailedRelayedMessage
\"
,
\"
type
\"
:
\"
event
\"
},{
\"
anonymous
\"
:false,
\"
inputs
\"
:[{
\"
indexed
\"
:false,
\"
internalType
\"
:
\"
uint8
\"
,
\"
name
\"
:
\"
version
\"
,
\"
type
\"
:
\"
uint8
\"
}],
\"
name
\"
:
\"
Initialized
\"
,
\"
type
\"
:
\"
event
\"
},{
\"
anonymous
\"
:false,
\"
inputs
\"
:[{
\"
indexed
\"
:true,
\"
internalType
\"
:
\"
bytes32
\"
,
\"
name
\"
:
\"
msgHash
\"
,
\"
type
\"
:
\"
bytes32
\"
}],
\"
name
\"
:
\"
RelayedMessage
\"
,
\"
type
\"
:
\"
event
\"
},{
\"
anonymous
\"
:false,
\"
inputs
\"
:[{
\"
indexed
\"
:true,
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"
target
\"
,
\"
type
\"
:
\"
address
\"
},{
\"
indexed
\"
:false,
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"
sender
\"
,
\"
type
\"
:
\"
address
\"
},{
\"
indexed
\"
:false,
\"
internalType
\"
:
\"
bytes
\"
,
\"
name
\"
:
\"
message
\"
,
\"
type
\"
:
\"
bytes
\"
},{
\"
indexed
\"
:false,
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
messageNonce
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
indexed
\"
:false,
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
gasLimit
\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
name
\"
:
\"
SentMessage
\"
,
\"
type
\"
:
\"
event
\"
},{
\"
anonymous
\"
:false,
\"
inputs
\"
:[{
\"
indexed
\"
:true,
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"
sender
\"
,
\"
type
\"
:
\"
address
\"
},{
\"
indexed
\"
:false,
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
value
\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
name
\"
:
\"
SentMessageExtension1
\"
,
\"
type
\"
:
\"
event
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
MESSAGE_VERSION
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint16
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint16
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
MIN_GAS_CALLDATA_OVERHEAD
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint64
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint64
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
MIN_GAS_CONSTANT_OVERHEAD
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint64
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint64
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
MIN_GAS_DYNAMIC_OVERHEAD_DENOMINATOR
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint64
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint64
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
MIN_GAS_DYNAMIC_OVERHEAD_NUMERATOR
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint64
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint64
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
OTHER_MESSENGER
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
address
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
PORTAL
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
contractOptimismPortal
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
address
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
bytes
\"
,
\"
name
\"
:
\"
_message
\"
,
\"
type
\"
:
\"
bytes
\"
},{
\"
internalType
\"
:
\"
uint32
\"
,
\"
name
\"
:
\"
_minGasLimit
\"
,
\"
type
\"
:
\"
uint32
\"
}],
\"
name
\"
:
\"
baseGas
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint64
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint64
\"
}],
\"
stateMutability
\"
:
\"
pure
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
bytes32
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
bytes32
\"
}],
\"
name
\"
:
\"
failedMessages
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
bool
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
bool
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
initialize
\"
,
\"
outputs
\"
:[],
\"
stateMutability
\"
:
\"
nonpayable
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
messageNonce
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_nonce
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"
_sender
\"
,
\"
type
\"
:
\"
address
\"
},{
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"
_target
\"
,
\"
type
\"
:
\"
address
\"
},{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_value
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_minGasLimit
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
internalType
\"
:
\"
bytes
\"
,
\"
name
\"
:
\"
_message
\"
,
\"
type
\"
:
\"
bytes
\"
}],
\"
name
\"
:
\"
relayMessage
\"
,
\"
outputs
\"
:[],
\"
stateMutability
\"
:
\"
payable
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"
_target
\"
,
\"
type
\"
:
\"
address
\"
},{
\"
internalType
\"
:
\"
bytes
\"
,
\"
name
\"
:
\"
_message
\"
,
\"
type
\"
:
\"
bytes
\"
},{
\"
internalType
\"
:
\"
uint32
\"
,
\"
name
\"
:
\"
_minGasLimit
\"
,
\"
type
\"
:
\"
uint32
\"
}],
\"
name
\"
:
\"
sendMessage
\"
,
\"
outputs
\"
:[],
\"
stateMutability
\"
:
\"
payable
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
bytes32
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
bytes32
\"
}],
\"
name
\"
:
\"
successfulMessages
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
bool
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
bool
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
version
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
string
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
string
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
xDomainMessageSender
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
address
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
}]"
,
ABI
:
"[{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
contractOptimismPortal
\"
,
\"
name
\"
:
\"
_portal
\"
,
\"
type
\"
:
\"
address
\"
}],
\"
stateMutability
\"
:
\"
nonpayable
\"
,
\"
type
\"
:
\"
constructor
\"
},{
\"
anonymous
\"
:false,
\"
inputs
\"
:[{
\"
indexed
\"
:true,
\"
internalType
\"
:
\"
bytes32
\"
,
\"
name
\"
:
\"
msgHash
\"
,
\"
type
\"
:
\"
bytes32
\"
}],
\"
name
\"
:
\"
FailedRelayedMessage
\"
,
\"
type
\"
:
\"
event
\"
},{
\"
anonymous
\"
:false,
\"
inputs
\"
:[{
\"
indexed
\"
:false,
\"
internalType
\"
:
\"
uint8
\"
,
\"
name
\"
:
\"
version
\"
,
\"
type
\"
:
\"
uint8
\"
}],
\"
name
\"
:
\"
Initialized
\"
,
\"
type
\"
:
\"
event
\"
},{
\"
anonymous
\"
:false,
\"
inputs
\"
:[{
\"
indexed
\"
:true,
\"
internalType
\"
:
\"
bytes32
\"
,
\"
name
\"
:
\"
msgHash
\"
,
\"
type
\"
:
\"
bytes32
\"
}],
\"
name
\"
:
\"
RelayedMessage
\"
,
\"
type
\"
:
\"
event
\"
},{
\"
anonymous
\"
:false,
\"
inputs
\"
:[{
\"
indexed
\"
:true,
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"
target
\"
,
\"
type
\"
:
\"
address
\"
},{
\"
indexed
\"
:false,
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"
sender
\"
,
\"
type
\"
:
\"
address
\"
},{
\"
indexed
\"
:false,
\"
internalType
\"
:
\"
bytes
\"
,
\"
name
\"
:
\"
message
\"
,
\"
type
\"
:
\"
bytes
\"
},{
\"
indexed
\"
:false,
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
messageNonce
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
indexed
\"
:false,
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
gasLimit
\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
name
\"
:
\"
SentMessage
\"
,
\"
type
\"
:
\"
event
\"
},{
\"
anonymous
\"
:false,
\"
inputs
\"
:[{
\"
indexed
\"
:true,
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"
sender
\"
,
\"
type
\"
:
\"
address
\"
},{
\"
indexed
\"
:false,
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
value
\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
name
\"
:
\"
SentMessageExtension1
\"
,
\"
type
\"
:
\"
event
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
MESSAGE_VERSION
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint16
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint16
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
MIN_GAS_CALLDATA_OVERHEAD
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint64
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint64
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
MIN_GAS_CONSTANT_OVERHEAD
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint64
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint64
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
MIN_GAS_DYNAMIC_OVERHEAD_DENOMINATOR
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint64
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint64
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
MIN_GAS_DYNAMIC_OVERHEAD_NUMERATOR
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint64
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint64
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
OTHER_MESSENGER
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
address
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
PORTAL
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
contractOptimismPortal
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
address
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
bytes
\"
,
\"
name
\"
:
\"
_message
\"
,
\"
type
\"
:
\"
bytes
\"
},{
\"
internalType
\"
:
\"
uint32
\"
,
\"
name
\"
:
\"
_minGasLimit
\"
,
\"
type
\"
:
\"
uint32
\"
}],
\"
name
\"
:
\"
baseGas
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint64
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint64
\"
}],
\"
stateMutability
\"
:
\"
pure
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
bytes32
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
bytes32
\"
}],
\"
name
\"
:
\"
failedMessages
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
bool
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
bool
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
initialize
\"
,
\"
outputs
\"
:[],
\"
stateMutability
\"
:
\"
nonpayable
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
messageNonce
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_nonce
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"
_sender
\"
,
\"
type
\"
:
\"
address
\"
},{
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"
_target
\"
,
\"
type
\"
:
\"
address
\"
},{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_value
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_minGasLimit
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
internalType
\"
:
\"
bytes
\"
,
\"
name
\"
:
\"
_message
\"
,
\"
type
\"
:
\"
bytes
\"
}],
\"
name
\"
:
\"
relayMessage
\"
,
\"
outputs
\"
:[],
\"
stateMutability
\"
:
\"
payable
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"
_target
\"
,
\"
type
\"
:
\"
address
\"
},{
\"
internalType
\"
:
\"
bytes
\"
,
\"
name
\"
:
\"
_message
\"
,
\"
type
\"
:
\"
bytes
\"
},{
\"
internalType
\"
:
\"
uint32
\"
,
\"
name
\"
:
\"
_minGasLimit
\"
,
\"
type
\"
:
\"
uint32
\"
}],
\"
name
\"
:
\"
sendMessage
\"
,
\"
outputs
\"
:[],
\"
stateMutability
\"
:
\"
payable
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
bytes32
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
bytes32
\"
}],
\"
name
\"
:
\"
successfulMessages
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
bool
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
bool
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
version
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
string
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
string
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
xDomainMessageSender
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
address
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
}]"
,
Bin
:
"0x6101206040523480156200001257600080fd5b5060405162002
2153803806200221583398101604081905262000035916200025c565b734200000000000000000000000000000000000007608052600160a081905260c052600060e0526001600160a01b03811661010052620000746200007b565b506200028e565b600054600160a81b900460ff1615808015620000a457506000546001600160a01b90910460ff16105b80620000db5750620000c130620001c860201b620011cc1760201c565b158015620000db5750600054600160a01b900460ff166001145b620001445760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff60a01b1916600160a01b179055801562000172576000805460ff60a81b1916600160a81b1790555b6200017c620001d7565b8015620001c5576000805460ff60a81b19169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b6001600160a01b03163b151590565b600054600160a81b900460ff16620002465760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016200013b565b60cc80546001600160a01b03191661dead179055565b6000602082840312156200026f57600080fd5b81516001600160a01b03811681146200028757600080fd5b9392505050565b60805160a05160c05160e05161010051611f18620002fd6000396000818161015301528181611225015281816115070152818161156801526116340152600061064901526000610620015260006105f70152600081816102620152818161039101526115310152611f186000f3fe6080604052600436106100f35760003560e01c80637dea7cc31161008a578063b1b1b20911610059578063b1b1b209146102c4578063b28ade25146102f4578063d764ad0b14610314578063ecc704281461032757600080fd5b80637dea7cc3146102245780638129fc1c1461023b5780639fce812c14610250578063a4e7f8bd1461028457600080fd5b80633dbb202b116100c65780633dbb202b146101b05780633f827a5a146101c557806354fd4d50146101ed5780636e296e451461020f57600080fd5b8063028f85f7146100f85780630c5684981461012b5780630ff754ea146101415780632828d7e81461019a575b600080fd5b34801561010457600080fd5b5061010d601081565b60405167ffffffffffffffff90911681526020015b60405180910390f35b34801561013757600080fd5b5061010d6103e881565b34801561014d57600080fd5b506101757f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610122565b3480156101a657600080fd5b5061010d6103f881565b6101c36101be36600461189e565b61038c565b005b3480156101d157600080fd5b506101da600181565b60405161ffff9091168152602001610122565b3480156101f957600080fd5b506102026105f0565b604051610122919061197f565b34801561021b57600080fd5b50610175610693565b34801561023057600080fd5b5061010d62030d4081565b34801561024757600080fd5b506101c361077f565b34801561025c57600080fd5b506101757f000000000000000000000000000000000000000000000000000000000000000081565b34801561029057600080fd5b506102b461029f366004611999565b60ce6020526000908152604090205460ff1681565b6040519015158152602001610122565b3480156102d057600080fd5b506102b46102df366004611999565b60cb6020526000908152604090205460ff1681565b34801561030057600080fd5b5061010d61030f3660046119b2565b61097c565b6101c3610322366004611a06565b6109c8565b34801561033357600080fd5b5061037e60cd547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e010000000000000000000000000000000000000000000000000000000000001790565b604051908152602001610122565b6104c57f00000000000000000000000000000000000000000000000000000000000000006103bb85858561097c565b347fd764ad0b0000000000000000000000000000000000000000000000000000000061042760cd547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e010000000000000000000000000000000000000000000000000000000000001790565b338a34898c8c6040516024016104439796959493929190611ad5565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526111e8565b8373ffffffffffffffffffffffffffffffffffffffff167fcb0f7ffd78f9aee47a248fae8db181db6eee833039123e026dcbff529522e52a33858561054a60cd547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e010000000000000000000000000000000000000000000000000000000000001790565b8660405161055c959493929190611b34565b60405180910390a260405134815233907f8ebb2ec2465bdb2a06a66fc37a0963af8a2a6a1479d81d56fdb8cbb98096d5469060200160405180910390a2505060cd80547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff808216600101167fffff0000000000000000000000000000000000000000000000000000000000009091161790555050565b606061061b7f000000000000000000000000000000000000000000000000000000000000000061129d565b6106447f000000000000000000000000000000000000000000000000000000000000000061129d565b61066d7f000000000000000000000000000000000000000000000000000000000000000061129d565b60405160200161067f93929190611b82565b604051602081830303815290604052905090565b60cc5460009073ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff215301610762576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603560248201527f43726f7373446f6d61696e4d657373656e6765723a2078446f6d61696e4d657360448201527f7361676553656e646572206973206e6f7420736574000000000000000000000060648201526084015b60405180910390fd5b5060cc5473ffffffffffffffffffffffffffffffffffffffff1690565b6000547501000000000000000000000000000000000000000000900460ff16158080156107ca575060005460017401000000000000000000000000000000000000000090910460ff16105b806107fc5750303b1580156107fc575060005474010000000000000000000000000000000000000000900460ff166001145b610888576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610759565b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055801561090e57600080547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff1675010000000000000000000000000000000000000000001790555b6109166113d2565b801561097957600080547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b600062030d4061098d601085611c27565b6103e86109a26103f863ffffffff8716611c27565b6109ac9190611c86565b6109b69190611cad565b6109c09190611cad565b949350505050565b60f087901c60028110610a83576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604d60248201527f43726f7373446f6d61696e4d657373656e6765723a206f6e6c7920766572736960448201527f6f6e2030206f722031206d657373616765732061726520737570706f7274656460648201527f20617420746869732074696d6500000000000000000000000000000000000000608482015260a401610759565b8061ffff16600003610b78576000610ad4878986868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508f92506114ab915050565b600081815260cb602052604090205490915060ff1615610b76576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f43726f7373446f6d61696e4d657373656e6765723a206c65676163792077697460448201527f6864726177616c20616c72656164792072656c617965640000000000000000006064820152608401610759565b505b6000610bbe898989898989898080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506114ca92505050565b600081815260cf602052604090205490915060ff1615610c3a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610759565b600081815260cf6020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055610c796114ed565b15610cb157853414610c8d57610c8d611cd9565b600081815260ce602052604090205460ff1615610cac57610cac611cd9565b610e03565b3415610d65576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152605060248201527f43726f7373446f6d61696e4d657373656e6765723a2076616c7565206d75737460448201527f206265207a65726f20756e6c657373206d6573736167652069732066726f6d2060648201527f612073797374656d206164647265737300000000000000000000000000000000608482015260a401610759565b600081815260ce602052604090205460ff16610e03576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f43726f7373446f6d61696e4d657373656e6765723a206d65737361676520636160448201527f6e6e6f74206265207265706c61796564000000000000000000000000000000006064820152608401610759565b610e0c87611611565b15610ebf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604360248201527f43726f7373446f6d61696e4d657373656e6765723a2063616e6e6f742073656e60448201527f64206d65737361676520746f20626c6f636b65642073797374656d206164647260648201527f6573730000000000000000000000000000000000000000000000000000000000608482015260a401610759565b600081815260cb602052604090205460ff1615610f5e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f43726f7373446f6d61696e4d657373656e6765723a206d65737361676520686160448201527f7320616c7265616479206265656e2072656c61796564000000000000000000006064820152608401610759565b60cc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8a16179055604080516020601f8601819004810282018101909252848152600091610fe4918a9189918b918a908a908190840183828082843760009201919091525061168892505050565b60cc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001661dead1790559050801561107b57600082815260cb602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555183917f4641df4a962071e12719d8c8c8e5ac7fc4d97b927346a3d7a335b1f7517e133c91a2611188565b600082815260ce602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555183917f99d0e048484baa1b1540b1367cb128acd7ab2946d1ed91ec10e3c85e4bf51b8f91a27fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff3201611188576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f43726f7373446f6d61696e4d657373656e6765723a206661696c656420746f2060448201527f72656c6179206d657373616765000000000000000000000000000000000000006064820152608401610759565b50600090815260cf6020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690555050505050505050565b905090565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b6040517fe9e05c4200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063e9e05c42908490611265908890839089906000908990600401611d08565b6000604051808303818588803b15801561127e57600080fd5b505af1158015611292573d6000803e3d6000fd5b505050505050505050565b6060816000036112e057505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b811561130a57806112f481611d60565b91506113039050600a83611d98565b91506112e4565b60008167ffffffffffffffff81111561132557611325611dac565b6040519080825280601f01601f19166020018201604052801561134f576020820181803683370190505b5090505b84156109c057611364600183611ddb565b9150611371600a86611df2565b61137c906030611e06565b60f81b81838151811061139157611391611e1e565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506113cb600a86611d98565b9450611353565b6000547501000000000000000000000000000000000000000000900460ff1661147d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610759565b60cc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001661dead179055565b60006114b9858585856116e2565b805190602001209050949350505050565b60006114da87878787878761177b565b8051906020012090509695505050505050565b60003373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000161480156111c757507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff167f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16639bf62d826040518163ffffffff1660e01b8152600401602060405180830381865afa1580156115d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115f59190611e4d565b73ffffffffffffffffffffffffffffffffffffffff1614905090565b600073ffffffffffffffffffffffffffffffffffffffff821630148061168257507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b92915050565b600080603f60c88601604002045a10156116cb576308c379a06000526020805278185361666543616c6c3a204e6f7420656e6f756768206761736058526064601cfd5b600080845160208601878a5af19695505050505050565b6060848484846040516024016116fb9493929190611e6a565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fcbd4ece9000000000000000000000000000000000000000000000000000000001790529050949350505050565b606086868686868660405160240161179896959493929190611eb4565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fd764ad0b0000000000000000000000000000000000000000000000000000000017905290509695505050505050565b73ffffffffffffffffffffffffffffffffffffffff8116811461097957600080fd5b60008083601f84011261184e57600080fd5b50813567ffffffffffffffff81111561186657600080fd5b60208301915083602082850101111561187e57600080fd5b9250929050565b803563ffffffff8116811461189957600080fd5b919050565b600080600080606085870312156118b457600080fd5b84356118bf8161181a565b9350602085013567ffffffffffffffff8111156118db57600080fd5b6118e78782880161183c565b90945092506118fa905060408601611885565b905092959194509250565b60005b83811015611920578181015183820152602001611908565b8381111561192f576000848401525b50505050565b6000815180845261194d816020860160208601611905565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006119926020830184611935565b9392505050565b6000602082840312156119ab57600080fd5b5035919050565b6000806000604084860312156119c757600080fd5b833567ffffffffffffffff8111156119de57600080fd5b6119ea8682870161183c565b90945092506119fd905060208501611885565b90509250925092565b600080600080600080600060c0888a031215611a2157600080fd5b873596506020880135611a338161181a565b95506040880135611a438161181a565b9450606088013593506080880135925060a088013567ffffffffffffffff811115611a6d57600080fd5b611a798a828b0161183c565b989b979a50959850939692959293505050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b878152600073ffffffffffffffffffffffffffffffffffffffff808916602084015280881660408401525085606083015263ffffffff8516608083015260c060a0830152611b2760c083018486611a8c565b9998505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff86168152608060208201526000611b64608083018688611a8c565b905083604083015263ffffffff831660608301529695505050505050565b60008451611b94818460208901611905565b80830190507f2e000000000000000000000000000000000000000000000000000000000000008082528551611bd0816001850160208a01611905565b60019201918201528351611beb816002840160208801611905565b0160020195945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600067ffffffffffffffff80831681851681830481118215151615611c4e57611c4e611bf8565b02949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600067ffffffffffffffff80841680611ca157611ca1611c57565b92169190910492915050565b600067ffffffffffffffff808316818516808303821115611cd057611cd0611bf8565b01949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff8616815284602082015267ffffffffffffffff84166040820152821515606082015260a060808201526000611d5560a0830184611935565b979650505050505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611d9157611d91611bf8565b5060010190565b600082611da757611da7611c57565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082821015611ded57611ded611bf8565b500390565b600082611e0157611e01611c57565b500690565b60008219821115611e1957611e19611bf8565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060208284031215611e5f57600080fd5b81516119928161181a565b600073ffffffffffffffffffffffffffffffffffffffff808716835280861660208401525060806040830152611ea36080830185611935565b905082606083015295945050505050565b868152600073ffffffffffffffffffffffffffffffffffffffff808816602084015280871660408401525084606083015283608083015260c060a0830152611eff60c0830184611935
565b9897505050505050505056fea164736f6c634300080f000a"
,
Bin
:
"0x6101206040523480156200001257600080fd5b5060405162002
1b8380380620021b883398101604081905262000035916200025c565b734200000000000000000000000000000000000007608052600160a081905260c052600060e0526001600160a01b03811661010052620000746200007b565b506200028e565b600054600160a81b900460ff1615808015620000a457506000546001600160a01b90910460ff16105b80620000db5750620000c130620001c860201b6200116f1760201c565b158015620000db5750600054600160a01b900460ff166001145b620001445760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff60a01b1916600160a01b179055801562000172576000805460ff60a81b1916600160a81b1790555b6200017c620001d7565b8015620001c5576000805460ff60a81b19169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b6001600160a01b03163b151590565b600054600160a81b900460ff16620002465760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016200013b565b60cc80546001600160a01b03191661dead179055565b6000602082840312156200026f57600080fd5b81516001600160a01b03811681146200028757600080fd5b9392505050565b60805160a05160c05160e05161010051611ebb620002fd60003960008181610153015281816111c8015281816114aa0152818161150b01526115d70152600061064901526000610620015260006105f70152600081816102620152818161039101526114d40152611ebb6000f3fe6080604052600436106100f35760003560e01c80637dea7cc31161008a578063b1b1b20911610059578063b1b1b209146102c4578063b28ade25146102f4578063d764ad0b14610314578063ecc704281461032757600080fd5b80637dea7cc3146102245780638129fc1c1461023b5780639fce812c14610250578063a4e7f8bd1461028457600080fd5b80633dbb202b116100c65780633dbb202b146101b05780633f827a5a146101c557806354fd4d50146101ed5780636e296e451461020f57600080fd5b8063028f85f7146100f85780630c5684981461012b5780630ff754ea146101415780632828d7e81461019a575b600080fd5b34801561010457600080fd5b5061010d601081565b60405167ffffffffffffffff90911681526020015b60405180910390f35b34801561013757600080fd5b5061010d6103e881565b34801561014d57600080fd5b506101757f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610122565b3480156101a657600080fd5b5061010d6103f881565b6101c36101be366004611841565b61038c565b005b3480156101d157600080fd5b506101da600181565b60405161ffff9091168152602001610122565b3480156101f957600080fd5b506102026105f0565b6040516101229190611922565b34801561021b57600080fd5b50610175610693565b34801561023057600080fd5b5061010d62030d4081565b34801561024757600080fd5b506101c361077f565b34801561025c57600080fd5b506101757f000000000000000000000000000000000000000000000000000000000000000081565b34801561029057600080fd5b506102b461029f36600461193c565b60ce6020526000908152604090205460ff1681565b6040519015158152602001610122565b3480156102d057600080fd5b506102b46102df36600461193c565b60cb6020526000908152604090205460ff1681565b34801561030057600080fd5b5061010d61030f366004611955565b61097c565b6101c36103223660046119a9565b6109c8565b34801561033357600080fd5b5061037e60cd547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e010000000000000000000000000000000000000000000000000000000000001790565b604051908152602001610122565b6104c57f00000000000000000000000000000000000000000000000000000000000000006103bb85858561097c565b347fd764ad0b0000000000000000000000000000000000000000000000000000000061042760cd547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e010000000000000000000000000000000000000000000000000000000000001790565b338a34898c8c6040516024016104439796959493929190611a78565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915261118b565b8373ffffffffffffffffffffffffffffffffffffffff167fcb0f7ffd78f9aee47a248fae8db181db6eee833039123e026dcbff529522e52a33858561054a60cd547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e010000000000000000000000000000000000000000000000000000000000001790565b8660405161055c959493929190611ad7565b60405180910390a260405134815233907f8ebb2ec2465bdb2a06a66fc37a0963af8a2a6a1479d81d56fdb8cbb98096d5469060200160405180910390a2505060cd80547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff808216600101167fffff0000000000000000000000000000000000000000000000000000000000009091161790555050565b606061061b7f0000000000000000000000000000000000000000000000000000000000000000611240565b6106447f0000000000000000000000000000000000000000000000000000000000000000611240565b61066d7f0000000000000000000000000000000000000000000000000000000000000000611240565b60405160200161067f93929190611b25565b604051602081830303815290604052905090565b60cc5460009073ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff215301610762576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603560248201527f43726f7373446f6d61696e4d657373656e6765723a2078446f6d61696e4d657360448201527f7361676553656e646572206973206e6f7420736574000000000000000000000060648201526084015b60405180910390fd5b5060cc5473ffffffffffffffffffffffffffffffffffffffff1690565b6000547501000000000000000000000000000000000000000000900460ff16158080156107ca575060005460017401000000000000000000000000000000000000000090910460ff16105b806107fc5750303b1580156107fc575060005474010000000000000000000000000000000000000000900460ff166001145b610888576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610759565b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055801561090e57600080547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff1675010000000000000000000000000000000000000000001790555b610916611375565b801561097957600080547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b600062030d4061098d601085611bca565b6103e86109a26103f863ffffffff8716611bca565b6109ac9190611c29565b6109b69190611c50565b6109c09190611c50565b949350505050565b60f087901c60028110610a83576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604d60248201527f43726f7373446f6d61696e4d657373656e6765723a206f6e6c7920766572736960448201527f6f6e2030206f722031206d657373616765732061726520737570706f7274656460648201527f20617420746869732074696d6500000000000000000000000000000000000000608482015260a401610759565b8061ffff16600003610b78576000610ad4878986868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508f925061144e915050565b600081815260cb602052604090205490915060ff1615610b76576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f43726f7373446f6d61696e4d657373656e6765723a206c65676163792077697460448201527f6864726177616c20616c72656164792072656c617965640000000000000000006064820152608401610759565b505b6000610bbe898989898989898080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061146d92505050565b9050610bc8611490565b15610c0057853414610bdc57610bdc611c7c565b600081815260ce602052604090205460ff1615610bfb57610bfb611c7c565b610d52565b3415610cb4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152605060248201527f43726f7373446f6d61696e4d657373656e6765723a2076616c7565206d75737460448201527f206265207a65726f20756e6c657373206d6573736167652069732066726f6d2060648201527f612073797374656d206164647265737300000000000000000000000000000000608482015260a401610759565b600081815260ce602052604090205460ff16610d52576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f43726f7373446f6d61696e4d657373656e6765723a206d65737361676520636160448201527f6e6e6f74206265207265706c61796564000000000000000000000000000000006064820152608401610759565b610d5b876115b4565b15610e0e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604360248201527f43726f7373446f6d61696e4d657373656e6765723a2063616e6e6f742073656e60448201527f64206d65737361676520746f20626c6f636b65642073797374656d206164647260648201527f6573730000000000000000000000000000000000000000000000000000000000608482015260a401610759565b600081815260cb602052604090205460ff1615610ead576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f43726f7373446f6d61696e4d657373656e6765723a206d65737361676520686160448201527f7320616c7265616479206265656e2072656c61796564000000000000000000006064820152608401610759565b60cc5473ffffffffffffffffffffffffffffffffffffffff1661dead14610f3357600081815260ce602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555182917f99d0e048484baa1b1540b1367cb128acd7ab2946d1ed91ec10e3c85e4bf51b8f91a25050611161565b60cc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8a16179055604080516020601f8601819004810282018101909252848152600091610fb9918a9189918b918a908a908190840183828082843760009201919091525061162b92505050565b60cc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001661dead1790559050801561105057600082815260cb602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555183917f4641df4a962071e12719d8c8c8e5ac7fc4d97b927346a3d7a335b1f7517e133c91a261115d565b600082815260ce602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555183917f99d0e048484baa1b1540b1367cb128acd7ab2946d1ed91ec10e3c85e4bf51b8f91a27fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff320161115d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f43726f7373446f6d61696e4d657373656e6765723a206661696c656420746f2060448201527f72656c6179206d657373616765000000000000000000000000000000000000006064820152608401610759565b5050505b50505050505050565b905090565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b6040517fe9e05c4200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063e9e05c42908490611208908890839089906000908990600401611cab565b6000604051808303818588803b15801561122157600080fd5b505af1158015611235573d6000803e3d6000fd5b505050505050505050565b60608160000361128357505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b81156112ad578061129781611d03565b91506112a69050600a83611d3b565b9150611287565b60008167ffffffffffffffff8111156112c8576112c8611d4f565b6040519080825280601f01601f1916602001820160405280156112f2576020820181803683370190505b5090505b84156109c057611307600183611d7e565b9150611314600a86611d95565b61131f906030611da9565b60f81b81838151811061133457611334611dc1565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535061136e600a86611d3b565b94506112f6565b6000547501000000000000000000000000000000000000000000900460ff16611420576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610759565b60cc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001661dead179055565b600061145c85858585611685565b805190602001209050949350505050565b600061147d87878787878761171e565b8051906020012090509695505050505050565b60003373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614801561116a57507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff167f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16639bf62d826040518163ffffffff1660e01b8152600401602060405180830381865afa158015611574573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115989190611df0565b73ffffffffffffffffffffffffffffffffffffffff1614905090565b600073ffffffffffffffffffffffffffffffffffffffff821630148061162557507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b92915050565b600080603f60c88601604002045a101561166e576308c379a06000526020805278185361666543616c6c3a204e6f7420656e6f756768206761736058526064601cfd5b600080845160208601878a5af19695505050505050565b60608484848460405160240161169e9493929190611e0d565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fcbd4ece9000000000000000000000000000000000000000000000000000000001790529050949350505050565b606086868686868660405160240161173b96959493929190611e57565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fd764ad0b0000000000000000000000000000000000000000000000000000000017905290509695505050505050565b73ffffffffffffffffffffffffffffffffffffffff8116811461097957600080fd5b60008083601f8401126117f157600080fd5b50813567ffffffffffffffff81111561180957600080fd5b60208301915083602082850101111561182157600080fd5b9250929050565b803563ffffffff8116811461183c57600080fd5b919050565b6000806000806060858703121561185757600080fd5b8435611862816117bd565b9350602085013567ffffffffffffffff81111561187e57600080fd5b61188a878288016117df565b909450925061189d905060408601611828565b905092959194509250565b60005b838110156118c35781810151838201526020016118ab565b838111156118d2576000848401525b50505050565b600081518084526118f08160208601602086016118a8565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60208152600061193560208301846118d8565b9392505050565b60006020828403121561194e57600080fd5b5035919050565b60008060006040848603121561196a57600080fd5b833567ffffffffffffffff81111561198157600080fd5b61198d868287016117df565b90945092506119a0905060208501611828565b90509250925092565b600080600080600080600060c0888a0312156119c457600080fd5b8735965060208801356119d6816117bd565b955060408801356119e6816117bd565b9450606088013593506080880135925060a088013567ffffffffffffffff811115611a1057600080fd5b611a1c8a828b016117df565b989b979a50959850939692959293505050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b878152600073ffffffffffffffffffffffffffffffffffffffff808916602084015280881660408401525085606083015263ffffffff8516608083015260c060a0830152611aca60c083018486611a2f565b9998505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff86168152608060208201526000611b07608083018688611a2f565b905083604083015263ffffffff831660608301529695505050505050565b60008451611b378184602089016118a8565b80830190507f2e000000000000000000000000000000000000000000000000000000000000008082528551611b73816001850160208a016118a8565b60019201918201528351611b8e8160028401602088016118a8565b0160020195945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600067ffffffffffffffff80831681851681830481118215151615611bf157611bf1611b9b565b02949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600067ffffffffffffffff80841680611c4457611c44611bfa565b92169190910492915050565b600067ffffffffffffffff808316818516808303821115611c7357611c73611b9b565b01949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff8616815284602082015267ffffffffffffffff84166040820152821515606082015260a060808201526000611cf860a08301846118d8565b979650505050505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611d3457611d34611b9b565b5060010190565b600082611d4a57611d4a611bfa565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082821015611d9057611d90611b9b565b500390565b600082611da457611da4611bfa565b500690565b60008219821115611dbc57611dbc611b9b565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060208284031215611e0257600080fd5b8151611935816117bd565b600073ffffffffffffffffffffffffffffffffffffffff808716835280861660208401525060806040830152611e4660808301856118d8565b905082606083015295945050505050565b868152600073ffffffffffffffffffffffffffffffffffffffff808816602084015280871660408401525084606083015283608083015260c060a0830152611ea260c08301846118d8
565b9897505050505050505056fea164736f6c634300080f000a"
,
}
}
// L1CrossDomainMessengerABI is the input ABI used to generate the binding from.
// L1CrossDomainMessengerABI is the input ABI used to generate the binding from.
...
...
op-bindings/bindings/l1crossdomainmessenger_more.go
View file @
707d8735
...
@@ -9,11 +9,11 @@ import (
...
@@ -9,11 +9,11 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/solc"
"github.com/ethereum-optimism/optimism/op-bindings/solc"
)
)
const
L1CrossDomainMessengerStorageLayoutJSON
=
"{
\"
storage
\"
:[{
\"
astId
\"
:1000,
\"
contract
\"
:
\"
contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger
\"
,
\"
label
\"
:
\"
spacer_0_0_20
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
0
\"
,
\"
type
\"
:
\"
t_address
\"
},{
\"
astId
\"
:1001,
\"
contract
\"
:
\"
contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger
\"
,
\"
label
\"
:
\"
_initialized
\"
,
\"
offset
\"
:20,
\"
slot
\"
:
\"
0
\"
,
\"
type
\"
:
\"
t_uint8
\"
},{
\"
astId
\"
:1002,
\"
contract
\"
:
\"
contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger
\"
,
\"
label
\"
:
\"
_initializing
\"
,
\"
offset
\"
:21,
\"
slot
\"
:
\"
0
\"
,
\"
type
\"
:
\"
t_bool
\"
},{
\"
astId
\"
:1003,
\"
contract
\"
:
\"
contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger
\"
,
\"
label
\"
:
\"
spacer_1_0_1600
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
1
\"
,
\"
type
\"
:
\"
t_array(t_uint256)10
20_storage
\"
},{
\"
astId
\"
:1004,
\"
contract
\"
:
\"
contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger
\"
,
\"
label
\"
:
\"
spacer_51_0_20
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
51
\"
,
\"
type
\"
:
\"
t_address
\"
},{
\"
astId
\"
:1005,
\"
contract
\"
:
\"
contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger
\"
,
\"
label
\"
:
\"
spacer_52_0_1568
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
52
\"
,
\"
type
\"
:
\"
t_array(t_uint256)1019_storage
\"
},{
\"
astId
\"
:1006,
\"
contract
\"
:
\"
contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger
\"
,
\"
label
\"
:
\"
spacer_101_0_1
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
101
\"
,
\"
type
\"
:
\"
t_bool
\"
},{
\"
astId
\"
:1007,
\"
contract
\"
:
\"
contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger
\"
,
\"
label
\"
:
\"
spacer_102_0_1568
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
102
\"
,
\"
type
\"
:
\"
t_array(t_uint256)1019_storage
\"
},{
\"
astId
\"
:1008,
\"
contract
\"
:
\"
contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger
\"
,
\"
label
\"
:
\"
spacer_151_0_32
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
151
\"
,
\"
type
\"
:
\"
t_uint256
\"
},{
\"
astId
\"
:1009,
\"
contract
\"
:
\"
contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger
\"
,
\"
label
\"
:
\"
__gap_reentrancy_guard
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
152
\"
,
\"
type
\"
:
\"
t_array(t_uint256)1019_storage
\"
},{
\"
astId
\"
:1010,
\"
contract
\"
:
\"
contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger
\"
,
\"
label
\"
:
\"
spacer_201_0_32
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
201
\"
,
\"
type
\"
:
\"
t_mapping(t_bytes32,t_bool)
\"
},{
\"
astId
\"
:1011,
\"
contract
\"
:
\"
contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger
\"
,
\"
label
\"
:
\"
spacer_202_0_32
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
202
\"
,
\"
type
\"
:
\"
t_mapping(t_bytes32,t_bool)
\"
},{
\"
astId
\"
:1012,
\"
contract
\"
:
\"
contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger
\"
,
\"
label
\"
:
\"
successfulMessages
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
203
\"
,
\"
type
\"
:
\"
t_mapping(t_bytes32,t_bool)
\"
},{
\"
astId
\"
:1013,
\"
contract
\"
:
\"
contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger
\"
,
\"
label
\"
:
\"
xDomainMsgSender
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
204
\"
,
\"
type
\"
:
\"
t_address
\"
},{
\"
astId
\"
:1014,
\"
contract
\"
:
\"
contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger
\"
,
\"
label
\"
:
\"
msgNonce
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
205
\"
,
\"
type
\"
:
\"
t_uint240
\"
},{
\"
astId
\"
:1015,
\"
contract
\"
:
\"
contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger
\"
,
\"
label
\"
:
\"
failedMessages
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
206
\"
,
\"
type
\"
:
\"
t_mapping(t_bytes32,t_bool)
\"
},{
\"
astId
\"
:1016,
\"
contract
\"
:
\"
contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger
\"
,
\"
label
\"
:
\"
reentrancyLocks
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
207
\"
,
\"
type
\"
:
\"
t_mapping(t_bytes32,t_bool)
\"
},{
\"
astId
\"
:1017,
\"
contract
\"
:
\"
contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger
\"
,
\"
label
\"
:
\"
__gap
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
208
\"
,
\"
type
\"
:
\"
t_array(t_uint256)1018_storage
\"
}],
\"
types
\"
:{
\"
t_address
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
address
\"
,
\"
numberOfBytes
\"
:
\"
20
\"
},
\"
t_array(t_uint256)1018_storage
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
uint256[41]
\"
,
\"
numberOfBytes
\"
:
\"
1312
\"
},
\"
t_array(t_uint256)1019_storage
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
uint256[49]
\"
,
\"
numberOfBytes
\"
:
\"
1568
\"
},
\"
t_array(t_uint256)1020
_storage
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
uint256[50]
\"
,
\"
numberOfBytes
\"
:
\"
1600
\"
},
\"
t_bool
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
bool
\"
,
\"
numberOfBytes
\"
:
\"
1
\"
},
\"
t_bytes32
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
bytes32
\"
,
\"
numberOfBytes
\"
:
\"
32
\"
},
\"
t_mapping(t_bytes32,t_bool)
\"
:{
\"
encoding
\"
:
\"
mapping
\"
,
\"
label
\"
:
\"
mapping(bytes32 =
\u003e
bool)
\"
,
\"
numberOfBytes
\"
:
\"
32
\"
,
\"
key
\"
:
\"
t_bytes32
\"
,
\"
value
\"
:
\"
t_bool
\"
},
\"
t_uint240
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
uint240
\"
,
\"
numberOfBytes
\"
:
\"
30
\"
},
\"
t_uint256
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
uint256
\"
,
\"
numberOfBytes
\"
:
\"
32
\"
},
\"
t_uint8
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
uint8
\"
,
\"
numberOfBytes
\"
:
\"
1
\"
}}}"
const
L1CrossDomainMessengerStorageLayoutJSON
=
"{
\"
storage
\"
:[{
\"
astId
\"
:1000,
\"
contract
\"
:
\"
contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger
\"
,
\"
label
\"
:
\"
spacer_0_0_20
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
0
\"
,
\"
type
\"
:
\"
t_address
\"
},{
\"
astId
\"
:1001,
\"
contract
\"
:
\"
contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger
\"
,
\"
label
\"
:
\"
_initialized
\"
,
\"
offset
\"
:20,
\"
slot
\"
:
\"
0
\"
,
\"
type
\"
:
\"
t_uint8
\"
},{
\"
astId
\"
:1002,
\"
contract
\"
:
\"
contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger
\"
,
\"
label
\"
:
\"
_initializing
\"
,
\"
offset
\"
:21,
\"
slot
\"
:
\"
0
\"
,
\"
type
\"
:
\"
t_bool
\"
},{
\"
astId
\"
:1003,
\"
contract
\"
:
\"
contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger
\"
,
\"
label
\"
:
\"
spacer_1_0_1600
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
1
\"
,
\"
type
\"
:
\"
t_array(t_uint256)10
19_storage
\"
},{
\"
astId
\"
:1004,
\"
contract
\"
:
\"
contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger
\"
,
\"
label
\"
:
\"
spacer_51_0_20
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
51
\"
,
\"
type
\"
:
\"
t_address
\"
},{
\"
astId
\"
:1005,
\"
contract
\"
:
\"
contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger
\"
,
\"
label
\"
:
\"
spacer_52_0_1568
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
52
\"
,
\"
type
\"
:
\"
t_array(t_uint256)1018_storage
\"
},{
\"
astId
\"
:1006,
\"
contract
\"
:
\"
contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger
\"
,
\"
label
\"
:
\"
spacer_101_0_1
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
101
\"
,
\"
type
\"
:
\"
t_bool
\"
},{
\"
astId
\"
:1007,
\"
contract
\"
:
\"
contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger
\"
,
\"
label
\"
:
\"
spacer_102_0_1568
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
102
\"
,
\"
type
\"
:
\"
t_array(t_uint256)1018_storage
\"
},{
\"
astId
\"
:1008,
\"
contract
\"
:
\"
contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger
\"
,
\"
label
\"
:
\"
spacer_151_0_32
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
151
\"
,
\"
type
\"
:
\"
t_uint256
\"
},{
\"
astId
\"
:1009,
\"
contract
\"
:
\"
contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger
\"
,
\"
label
\"
:
\"
__gap_reentrancy_guard
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
152
\"
,
\"
type
\"
:
\"
t_array(t_uint256)1018_storage
\"
},{
\"
astId
\"
:1010,
\"
contract
\"
:
\"
contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger
\"
,
\"
label
\"
:
\"
spacer_201_0_32
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
201
\"
,
\"
type
\"
:
\"
t_mapping(t_bytes32,t_bool)
\"
},{
\"
astId
\"
:1011,
\"
contract
\"
:
\"
contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger
\"
,
\"
label
\"
:
\"
spacer_202_0_32
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
202
\"
,
\"
type
\"
:
\"
t_mapping(t_bytes32,t_bool)
\"
},{
\"
astId
\"
:1012,
\"
contract
\"
:
\"
contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger
\"
,
\"
label
\"
:
\"
successfulMessages
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
203
\"
,
\"
type
\"
:
\"
t_mapping(t_bytes32,t_bool)
\"
},{
\"
astId
\"
:1013,
\"
contract
\"
:
\"
contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger
\"
,
\"
label
\"
:
\"
xDomainMsgSender
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
204
\"
,
\"
type
\"
:
\"
t_address
\"
},{
\"
astId
\"
:1014,
\"
contract
\"
:
\"
contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger
\"
,
\"
label
\"
:
\"
msgNonce
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
205
\"
,
\"
type
\"
:
\"
t_uint240
\"
},{
\"
astId
\"
:1015,
\"
contract
\"
:
\"
contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger
\"
,
\"
label
\"
:
\"
failedMessages
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
206
\"
,
\"
type
\"
:
\"
t_mapping(t_bytes32,t_bool)
\"
},{
\"
astId
\"
:1016,
\"
contract
\"
:
\"
contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger
\"
,
\"
label
\"
:
\"
__gap
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
207
\"
,
\"
type
\"
:
\"
t_array(t_uint256)1017_storage
\"
}],
\"
types
\"
:{
\"
t_address
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
address
\"
,
\"
numberOfBytes
\"
:
\"
20
\"
},
\"
t_array(t_uint256)1017_storage
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
uint256[42]
\"
,
\"
numberOfBytes
\"
:
\"
1344
\"
},
\"
t_array(t_uint256)1018_storage
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
uint256[49]
\"
,
\"
numberOfBytes
\"
:
\"
1568
\"
},
\"
t_array(t_uint256)1019
_storage
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
uint256[50]
\"
,
\"
numberOfBytes
\"
:
\"
1600
\"
},
\"
t_bool
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
bool
\"
,
\"
numberOfBytes
\"
:
\"
1
\"
},
\"
t_bytes32
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
bytes32
\"
,
\"
numberOfBytes
\"
:
\"
32
\"
},
\"
t_mapping(t_bytes32,t_bool)
\"
:{
\"
encoding
\"
:
\"
mapping
\"
,
\"
label
\"
:
\"
mapping(bytes32 =
\u003e
bool)
\"
,
\"
numberOfBytes
\"
:
\"
32
\"
,
\"
key
\"
:
\"
t_bytes32
\"
,
\"
value
\"
:
\"
t_bool
\"
},
\"
t_uint240
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
uint240
\"
,
\"
numberOfBytes
\"
:
\"
30
\"
},
\"
t_uint256
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
uint256
\"
,
\"
numberOfBytes
\"
:
\"
32
\"
},
\"
t_uint8
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
uint8
\"
,
\"
numberOfBytes
\"
:
\"
1
\"
}}}"
var
L1CrossDomainMessengerStorageLayout
=
new
(
solc
.
StorageLayout
)
var
L1CrossDomainMessengerStorageLayout
=
new
(
solc
.
StorageLayout
)
var
L1CrossDomainMessengerDeployedBin
=
"0x6080604052600436106100f35760003560e01c80637dea7cc31161008a578063b1b1b20911610059578063b1b1b209146102c4578063b28ade25146102f4578063d764ad0b14610314578063ecc704281461032757600080fd5b80637dea7cc3146102245780638129fc1c1461023b5780639fce812c14610250578063a4e7f8bd1461028457600080fd5b80633dbb202b116100c65780633dbb202b146101b05780633f827a5a146101c557806354fd4d50146101ed5780636e296e451461020f57600080fd5b8063028f85f7146100f85780630c5684981461012b5780630ff754ea146101415780632828d7e81461019a575b600080fd5b34801561010457600080fd5b5061010d601081565b60405167ffffffffffffffff90911681526020015b60405180910390f35b34801561013757600080fd5b5061010d6103e881565b34801561014d57600080fd5b506101757f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610122565b3480156101a657600080fd5b5061010d6103f881565b6101c36101be3660046118
9e565b61038c565b005b3480156101d157600080fd5b506101da600181565b60405161ffff9091168152602001610122565b3480156101f957600080fd5b506102026105f0565b604051610122919061197f565b34801561021b57600080fd5b50610175610693565b34801561023057600080fd5b5061010d62030d4081565b34801561024757600080fd5b506101c361077f565b34801561025c57600080fd5b506101757f000000000000000000000000000000000000000000000000000000000000000081565b34801561029057600080fd5b506102b461029f366004611999565b60ce6020526000908152604090205460ff1681565b6040519015158152602001610122565b3480156102d057600080fd5b506102b46102df366004611999565b60cb6020526000908152604090205460ff1681565b34801561030057600080fd5b5061010d61030f3660046119b2565b61097c565b6101c3610322366004611a06565b6109c8565b34801561033357600080fd5b5061037e60cd547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e010000000000000000000000000000000000000000000000000000000000001790565b604051908152602001610122565b6104c57f00000000000000000000000000000000000000000000000000000000000000006103bb85858561097c565b347fd764ad0b0000000000000000000000000000000000000000000000000000000061042760cd547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e010000000000000000000000000000000000000000000000000000000000001790565b338a34898c8c6040516024016104439796959493929190611ad5565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526111e8565b8373ffffffffffffffffffffffffffffffffffffffff167fcb0f7ffd78f9aee47a248fae8db181db6eee833039123e026dcbff529522e52a33858561054a60cd547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e010000000000000000000000000000000000000000000000000000000000001790565b8660405161055c959493929190611b34565b60405180910390a260405134815233907f8ebb2ec2465bdb2a06a66fc37a0963af8a2a6a1479d81d56fdb8cbb98096d5469060200160405180910390a2505060cd80547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff808216600101167fffff0000000000000000000000000000000000000000000000000000000000009091161790555050565b606061061b7f000000000000000000000000000000000000000000000000000000000000000061129d565b6106447f000000000000000000000000000000000000000000000000000000000000000061129d565b61066d7f000000000000000000000000000000000000000000000000000000000000000061129d565b60405160200161067f93929190611b82565b604051602081830303815290604052905090565b60cc5460009073ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff215301610762576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603560248201527f43726f7373446f6d61696e4d657373656e6765723a2078446f6d61696e4d657360448201527f7361676553656e646572206973206e6f7420736574000000000000000000000060648201526084015b60405180910390fd5b5060cc5473ffffffffffffffffffffffffffffffffffffffff1690565b6000547501000000000000000000000000000000000000000000900460ff16158080156107ca575060005460017401000000000000000000000000000000000000000090910460ff16105b806107fc5750303b1580156107fc575060005474010000000000000000000000000000000000000000900460ff166001145b610888576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610759565b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055801561090e57600080547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff1675010000000000000000000000000000000000000000001790555b6109166113d2565b801561097957600080547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b600062030d4061098d601085611c27565b6103e86109a26103f863ffffffff8716611c27565b6109ac9190611c86565b6109b69190611cad565b6109c09190611cad565b949350505050565b60f087901c60028110610a83576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604d60248201527f43726f7373446f6d61696e4d657373656e6765723a206f6e6c7920766572736960448201527f6f6e2030206f722031206d657373616765732061726520737570706f7274656460648201527f20617420746869732074696d6500000000000000000000000000000000000000608482015260a401610759565b8061ffff16600003610b78576000610ad4878986868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508f92506114ab915050565b600081815260cb602052604090205490915060ff1615610b76576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f43726f7373446f6d61696e4d657373656e6765723a206c65676163792077697460448201527f6864726177616c20616c72656164792072656c617965640000000000000000006064820152608401610759565b505b6000610bbe898989898989898080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506114ca92505050565b600081815260cf602052604090205490915060ff1615610c3a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610759565b600081815260cf6020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055610c796114ed565b15610cb157853414610c8d57610c8d611cd9565b600081815260ce602052604090205460ff1615610cac57610cac611cd9565b610e03565b3415610d65576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152605060248201527f43726f7373446f6d61696e4d657373656e6765723a2076616c7565206d75737460448201527f206265207a65726f20756e6c657373206d6573736167652069732066726f6d2060648201527f612073797374656d206164647265737300000000000000000000000000000000608482015260a401610759565b600081815260ce602052604090205460ff16610e03576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f43726f7373446f6d61696e4d657373656e6765723a206d65737361676520636160448201527f6e6e6f74206265207265706c61796564000000000000000000000000000000006064820152608401610759565b610e0c87611611565b15610ebf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604360248201527f43726f7373446f6d61696e4d657373656e6765723a2063616e6e6f742073656e60448201527f64206d65737361676520746f20626c6f636b65642073797374656d206164647260648201527f6573730000000000000000000000000000000000000000000000000000000000608482015260a401610759565b600081815260cb602052604090205460ff1615610f5e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f43726f7373446f6d61696e4d657373656e6765723a206d65737361676520686160448201527f7320616c7265616479206265656e2072656c61796564000000000000000000006064820152608401610759565b60cc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8a16179055604080516020601f8601819004810282018101909252848152600091610fe4918a9189918b918a908a908190840183828082843760009201919091525061168892505050565b60cc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001661dead1790559050801561107b57600082815260cb602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555183917f4641df4a962071e12719d8c8c8e5ac7fc4d97b927346a3d7a335b1f7517e133c91a2611188565b600082815260ce602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555183917f99d0e048484baa1b1540b1367cb128acd7ab2946d1ed91ec10e3c85e4bf51b8f91a27fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff3201611188576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f43726f7373446f6d61696e4d657373656e6765723a206661696c656420746f2060448201527f72656c6179206d657373616765000000000000000000000000000000000000006064820152608401610759565b50600090815260cf6020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690555050505050505050565b905090565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b6040517fe9e05c4200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063e9e05c42908490611265908890839089906000908990600401611d08565b6000604051808303818588803b15801561127e57600080fd5b505af1158015611292573d6000803e3d6000fd5b505050505050505050565b6060816000036112e057505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b811561130a57806112f481611d60565b91506113039050600a83611d98565b91506112e4565b60008167ffffffffffffffff81111561132557611325611dac565b6040519080825280601f01601f19166020018201604052801561134f576020820181803683370190505b5090505b84156109c057611364600183611ddb565b9150611371600a86611df2565b61137c906030611e06565b60f81b81838151811061139157611391611e1e565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506113cb600a86611d98565b9450611353565b6000547501000000000000000000000000000000000000000000900460ff1661147d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610759565b60cc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001661dead179055565b60006114b9858585856116e2565b805190602001209050949350505050565b60006114da87878787878761177b565b8051906020012090509695505050505050565b60003373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000161480156111c757507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff167f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16639bf62d826040518163ffffffff1660e01b8152600401602060405180830381865afa1580156115d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115f59190611e4d565b73ffffffffffffffffffffffffffffffffffffffff1614905090565b600073ffffffffffffffffffffffffffffffffffffffff821630148061168257507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b92915050565b600080603f60c88601604002045a10156116cb576308c379a06000526020805278185361666543616c6c3a204e6f7420656e6f756768206761736058526064601cfd5b600080845160208601878a5af19695505050505050565b6060848484846040516024016116fb9493929190611e6a565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fcbd4ece9000000000000000000000000000000000000000000000000000000001790529050949350505050565b606086868686868660405160240161179896959493929190611eb4565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fd764ad0b0000000000000000000000000000000000000000000000000000000017905290509695505050505050565b73ffffffffffffffffffffffffffffffffffffffff8116811461097957600080fd5b60008083601f84011261184e57600080fd5b50813567ffffffffffffffff81111561186657600080fd5b60208301915083602082850101111561187e57600080fd5b9250929050565b803563ffffffff8116811461189957600080fd5b919050565b600080600080606085870312156118b457600080fd5b84356118bf8161181a565b9350602085013567ffffffffffffffff8111156118db57600080fd5b6118e78782880161183c565b90945092506118fa905060408601611885565b905092959194509250565b60005b83811015611920578181015183820152602001611908565b8381111561192f576000848401525b50505050565b6000815180845261194d816020860160208601611905565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006119926020830184611935565b9392505050565b6000602082840312156119ab57600080fd5b5035919050565b6000806000604084860312156119c757600080fd5b833567ffffffffffffffff8111156119de57600080fd5b6119ea8682870161183c565b90945092506119fd905060208501611885565b90509250925092565b600080600080600080600060c0888a031215611a2157600080fd5b873596506020880135611a338161181a565b95506040880135611a438161181a565b9450606088013593506080880135925060a088013567ffffffffffffffff811115611a6d57600080fd5b611a798a828b0161183c565b989b979a50959850939692959293505050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b878152600073ffffffffffffffffffffffffffffffffffffffff808916602084015280881660408401525085606083015263ffffffff8516608083015260c060a0830152611b2760c083018486611a8c565b9998505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff86168152608060208201526000611b64608083018688611a8c565b905083604083015263ffffffff831660608301529695505050505050565b60008451611b94818460208901611905565b80830190507f2e000000000000000000000000000000000000000000000000000000000000008082528551611bd0816001850160208a01611905565b60019201918201528351611beb816002840160208801611905565b0160020195945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600067ffffffffffffffff80831681851681830481118215151615611c4e57611c4e611bf8565b02949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600067ffffffffffffffff80841680611ca157611ca1611c57565b92169190910492915050565b600067ffffffffffffffff808316818516808303821115611cd057611cd0611bf8565b01949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff8616815284602082015267ffffffffffffffff84166040820152821515606082015260a060808201526000611d5560a0830184611935565b979650505050505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611d9157611d91611bf8565b5060010190565b600082611da757611da7611c57565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082821015611ded57611ded611bf8565b500390565b600082611e0157611e01611c57565b500690565b60008219821115611e1957611e19611bf8565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060208284031215611e5f57600080fd5b81516119928161181a565b600073ffffffffffffffffffffffffffffffffffffffff808716835280861660208401525060806040830152611ea36080830185611935565b905082606083015295945050505050565b868152600073ffffffffffffffffffffffffffffffffffffffff808816602084015280871660408401525084606083015283608083015260c060a0830152611eff60c0830184611935
565b9897505050505050505056fea164736f6c634300080f000a"
var
L1CrossDomainMessengerDeployedBin
=
"0x6080604052600436106100f35760003560e01c80637dea7cc31161008a578063b1b1b20911610059578063b1b1b209146102c4578063b28ade25146102f4578063d764ad0b14610314578063ecc704281461032757600080fd5b80637dea7cc3146102245780638129fc1c1461023b5780639fce812c14610250578063a4e7f8bd1461028457600080fd5b80633dbb202b116100c65780633dbb202b146101b05780633f827a5a146101c557806354fd4d50146101ed5780636e296e451461020f57600080fd5b8063028f85f7146100f85780630c5684981461012b5780630ff754ea146101415780632828d7e81461019a575b600080fd5b34801561010457600080fd5b5061010d601081565b60405167ffffffffffffffff90911681526020015b60405180910390f35b34801561013757600080fd5b5061010d6103e881565b34801561014d57600080fd5b506101757f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610122565b3480156101a657600080fd5b5061010d6103f881565b6101c36101be3660046118
41565b61038c565b005b3480156101d157600080fd5b506101da600181565b60405161ffff9091168152602001610122565b3480156101f957600080fd5b506102026105f0565b6040516101229190611922565b34801561021b57600080fd5b50610175610693565b34801561023057600080fd5b5061010d62030d4081565b34801561024757600080fd5b506101c361077f565b34801561025c57600080fd5b506101757f000000000000000000000000000000000000000000000000000000000000000081565b34801561029057600080fd5b506102b461029f36600461193c565b60ce6020526000908152604090205460ff1681565b6040519015158152602001610122565b3480156102d057600080fd5b506102b46102df36600461193c565b60cb6020526000908152604090205460ff1681565b34801561030057600080fd5b5061010d61030f366004611955565b61097c565b6101c36103223660046119a9565b6109c8565b34801561033357600080fd5b5061037e60cd547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e010000000000000000000000000000000000000000000000000000000000001790565b604051908152602001610122565b6104c57f00000000000000000000000000000000000000000000000000000000000000006103bb85858561097c565b347fd764ad0b0000000000000000000000000000000000000000000000000000000061042760cd547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e010000000000000000000000000000000000000000000000000000000000001790565b338a34898c8c6040516024016104439796959493929190611a78565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915261118b565b8373ffffffffffffffffffffffffffffffffffffffff167fcb0f7ffd78f9aee47a248fae8db181db6eee833039123e026dcbff529522e52a33858561054a60cd547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e010000000000000000000000000000000000000000000000000000000000001790565b8660405161055c959493929190611ad7565b60405180910390a260405134815233907f8ebb2ec2465bdb2a06a66fc37a0963af8a2a6a1479d81d56fdb8cbb98096d5469060200160405180910390a2505060cd80547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff808216600101167fffff0000000000000000000000000000000000000000000000000000000000009091161790555050565b606061061b7f0000000000000000000000000000000000000000000000000000000000000000611240565b6106447f0000000000000000000000000000000000000000000000000000000000000000611240565b61066d7f0000000000000000000000000000000000000000000000000000000000000000611240565b60405160200161067f93929190611b25565b604051602081830303815290604052905090565b60cc5460009073ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff215301610762576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603560248201527f43726f7373446f6d61696e4d657373656e6765723a2078446f6d61696e4d657360448201527f7361676553656e646572206973206e6f7420736574000000000000000000000060648201526084015b60405180910390fd5b5060cc5473ffffffffffffffffffffffffffffffffffffffff1690565b6000547501000000000000000000000000000000000000000000900460ff16158080156107ca575060005460017401000000000000000000000000000000000000000090910460ff16105b806107fc5750303b1580156107fc575060005474010000000000000000000000000000000000000000900460ff166001145b610888576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610759565b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055801561090e57600080547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff1675010000000000000000000000000000000000000000001790555b610916611375565b801561097957600080547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b600062030d4061098d601085611bca565b6103e86109a26103f863ffffffff8716611bca565b6109ac9190611c29565b6109b69190611c50565b6109c09190611c50565b949350505050565b60f087901c60028110610a83576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604d60248201527f43726f7373446f6d61696e4d657373656e6765723a206f6e6c7920766572736960448201527f6f6e2030206f722031206d657373616765732061726520737570706f7274656460648201527f20617420746869732074696d6500000000000000000000000000000000000000608482015260a401610759565b8061ffff16600003610b78576000610ad4878986868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508f925061144e915050565b600081815260cb602052604090205490915060ff1615610b76576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f43726f7373446f6d61696e4d657373656e6765723a206c65676163792077697460448201527f6864726177616c20616c72656164792072656c617965640000000000000000006064820152608401610759565b505b6000610bbe898989898989898080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061146d92505050565b9050610bc8611490565b15610c0057853414610bdc57610bdc611c7c565b600081815260ce602052604090205460ff1615610bfb57610bfb611c7c565b610d52565b3415610cb4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152605060248201527f43726f7373446f6d61696e4d657373656e6765723a2076616c7565206d75737460448201527f206265207a65726f20756e6c657373206d6573736167652069732066726f6d2060648201527f612073797374656d206164647265737300000000000000000000000000000000608482015260a401610759565b600081815260ce602052604090205460ff16610d52576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f43726f7373446f6d61696e4d657373656e6765723a206d65737361676520636160448201527f6e6e6f74206265207265706c61796564000000000000000000000000000000006064820152608401610759565b610d5b876115b4565b15610e0e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604360248201527f43726f7373446f6d61696e4d657373656e6765723a2063616e6e6f742073656e60448201527f64206d65737361676520746f20626c6f636b65642073797374656d206164647260648201527f6573730000000000000000000000000000000000000000000000000000000000608482015260a401610759565b600081815260cb602052604090205460ff1615610ead576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f43726f7373446f6d61696e4d657373656e6765723a206d65737361676520686160448201527f7320616c7265616479206265656e2072656c61796564000000000000000000006064820152608401610759565b60cc5473ffffffffffffffffffffffffffffffffffffffff1661dead14610f3357600081815260ce602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555182917f99d0e048484baa1b1540b1367cb128acd7ab2946d1ed91ec10e3c85e4bf51b8f91a25050611161565b60cc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8a16179055604080516020601f8601819004810282018101909252848152600091610fb9918a9189918b918a908a908190840183828082843760009201919091525061162b92505050565b60cc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001661dead1790559050801561105057600082815260cb602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555183917f4641df4a962071e12719d8c8c8e5ac7fc4d97b927346a3d7a335b1f7517e133c91a261115d565b600082815260ce602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555183917f99d0e048484baa1b1540b1367cb128acd7ab2946d1ed91ec10e3c85e4bf51b8f91a27fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff320161115d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f43726f7373446f6d61696e4d657373656e6765723a206661696c656420746f2060448201527f72656c6179206d657373616765000000000000000000000000000000000000006064820152608401610759565b5050505b50505050505050565b905090565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b6040517fe9e05c4200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063e9e05c42908490611208908890839089906000908990600401611cab565b6000604051808303818588803b15801561122157600080fd5b505af1158015611235573d6000803e3d6000fd5b505050505050505050565b60608160000361128357505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b81156112ad578061129781611d03565b91506112a69050600a83611d3b565b9150611287565b60008167ffffffffffffffff8111156112c8576112c8611d4f565b6040519080825280601f01601f1916602001820160405280156112f2576020820181803683370190505b5090505b84156109c057611307600183611d7e565b9150611314600a86611d95565b61131f906030611da9565b60f81b81838151811061133457611334611dc1565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535061136e600a86611d3b565b94506112f6565b6000547501000000000000000000000000000000000000000000900460ff16611420576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610759565b60cc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001661dead179055565b600061145c85858585611685565b805190602001209050949350505050565b600061147d87878787878761171e565b8051906020012090509695505050505050565b60003373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614801561116a57507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff167f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16639bf62d826040518163ffffffff1660e01b8152600401602060405180830381865afa158015611574573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115989190611df0565b73ffffffffffffffffffffffffffffffffffffffff1614905090565b600073ffffffffffffffffffffffffffffffffffffffff821630148061162557507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b92915050565b600080603f60c88601604002045a101561166e576308c379a06000526020805278185361666543616c6c3a204e6f7420656e6f756768206761736058526064601cfd5b600080845160208601878a5af19695505050505050565b60608484848460405160240161169e9493929190611e0d565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fcbd4ece9000000000000000000000000000000000000000000000000000000001790529050949350505050565b606086868686868660405160240161173b96959493929190611e57565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fd764ad0b0000000000000000000000000000000000000000000000000000000017905290509695505050505050565b73ffffffffffffffffffffffffffffffffffffffff8116811461097957600080fd5b60008083601f8401126117f157600080fd5b50813567ffffffffffffffff81111561180957600080fd5b60208301915083602082850101111561182157600080fd5b9250929050565b803563ffffffff8116811461183c57600080fd5b919050565b6000806000806060858703121561185757600080fd5b8435611862816117bd565b9350602085013567ffffffffffffffff81111561187e57600080fd5b61188a878288016117df565b909450925061189d905060408601611828565b905092959194509250565b60005b838110156118c35781810151838201526020016118ab565b838111156118d2576000848401525b50505050565b600081518084526118f08160208601602086016118a8565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60208152600061193560208301846118d8565b9392505050565b60006020828403121561194e57600080fd5b5035919050565b60008060006040848603121561196a57600080fd5b833567ffffffffffffffff81111561198157600080fd5b61198d868287016117df565b90945092506119a0905060208501611828565b90509250925092565b600080600080600080600060c0888a0312156119c457600080fd5b8735965060208801356119d6816117bd565b955060408801356119e6816117bd565b9450606088013593506080880135925060a088013567ffffffffffffffff811115611a1057600080fd5b611a1c8a828b016117df565b989b979a50959850939692959293505050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b878152600073ffffffffffffffffffffffffffffffffffffffff808916602084015280881660408401525085606083015263ffffffff8516608083015260c060a0830152611aca60c083018486611a2f565b9998505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff86168152608060208201526000611b07608083018688611a2f565b905083604083015263ffffffff831660608301529695505050505050565b60008451611b378184602089016118a8565b80830190507f2e000000000000000000000000000000000000000000000000000000000000008082528551611b73816001850160208a016118a8565b60019201918201528351611b8e8160028401602088016118a8565b0160020195945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600067ffffffffffffffff80831681851681830481118215151615611bf157611bf1611b9b565b02949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600067ffffffffffffffff80841680611c4457611c44611bfa565b92169190910492915050565b600067ffffffffffffffff808316818516808303821115611c7357611c73611b9b565b01949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff8616815284602082015267ffffffffffffffff84166040820152821515606082015260a060808201526000611cf860a08301846118d8565b979650505050505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611d3457611d34611b9b565b5060010190565b600082611d4a57611d4a611bfa565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082821015611d9057611d90611b9b565b500390565b600082611da457611da4611bfa565b500690565b60008219821115611dbc57611dbc611b9b565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060208284031215611e0257600080fd5b8151611935816117bd565b600073ffffffffffffffffffffffffffffffffffffffff808716835280861660208401525060806040830152611e4660808301856118d8565b905082606083015295945050505050565b868152600073ffffffffffffffffffffffffffffffffffffffff808816602084015280871660408401525084606083015283608083015260c060a0830152611ea260c08301846118d8
565b9897505050505050505056fea164736f6c634300080f000a"
func
init
()
{
func
init
()
{
if
err
:=
json
.
Unmarshal
([]
byte
(
L1CrossDomainMessengerStorageLayoutJSON
),
L1CrossDomainMessengerStorageLayout
);
err
!=
nil
{
if
err
:=
json
.
Unmarshal
([]
byte
(
L1CrossDomainMessengerStorageLayoutJSON
),
L1CrossDomainMessengerStorageLayout
);
err
!=
nil
{
...
...
op-bindings/bindings/l2crossdomainmessenger.go
View file @
707d8735
...
@@ -31,7 +31,7 @@ var (
...
@@ -31,7 +31,7 @@ var (
// L2CrossDomainMessengerMetaData contains all meta data concerning the L2CrossDomainMessenger contract.
// L2CrossDomainMessengerMetaData contains all meta data concerning the L2CrossDomainMessenger contract.
var
L2CrossDomainMessengerMetaData
=
&
bind
.
MetaData
{
var
L2CrossDomainMessengerMetaData
=
&
bind
.
MetaData
{
ABI
:
"[{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"
_l1CrossDomainMessenger
\"
,
\"
type
\"
:
\"
address
\"
}],
\"
stateMutability
\"
:
\"
nonpayable
\"
,
\"
type
\"
:
\"
constructor
\"
},{
\"
anonymous
\"
:false,
\"
inputs
\"
:[{
\"
indexed
\"
:true,
\"
internalType
\"
:
\"
bytes32
\"
,
\"
name
\"
:
\"
msgHash
\"
,
\"
type
\"
:
\"
bytes32
\"
}],
\"
name
\"
:
\"
FailedRelayedMessage
\"
,
\"
type
\"
:
\"
event
\"
},{
\"
anonymous
\"
:false,
\"
inputs
\"
:[{
\"
indexed
\"
:false,
\"
internalType
\"
:
\"
uint8
\"
,
\"
name
\"
:
\"
version
\"
,
\"
type
\"
:
\"
uint8
\"
}],
\"
name
\"
:
\"
Initialized
\"
,
\"
type
\"
:
\"
event
\"
},{
\"
anonymous
\"
:false,
\"
inputs
\"
:[{
\"
indexed
\"
:true,
\"
internalType
\"
:
\"
bytes32
\"
,
\"
name
\"
:
\"
msgHash
\"
,
\"
type
\"
:
\"
bytes32
\"
}],
\"
name
\"
:
\"
RelayedMessage
\"
,
\"
type
\"
:
\"
event
\"
},{
\"
anonymous
\"
:false,
\"
inputs
\"
:[{
\"
indexed
\"
:true,
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"
target
\"
,
\"
type
\"
:
\"
address
\"
},{
\"
indexed
\"
:false,
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"
sender
\"
,
\"
type
\"
:
\"
address
\"
},{
\"
indexed
\"
:false,
\"
internalType
\"
:
\"
bytes
\"
,
\"
name
\"
:
\"
message
\"
,
\"
type
\"
:
\"
bytes
\"
},{
\"
indexed
\"
:false,
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
messageNonce
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
indexed
\"
:false,
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
gasLimit
\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
name
\"
:
\"
SentMessage
\"
,
\"
type
\"
:
\"
event
\"
},{
\"
anonymous
\"
:false,
\"
inputs
\"
:[{
\"
indexed
\"
:true,
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"
sender
\"
,
\"
type
\"
:
\"
address
\"
},{
\"
indexed
\"
:false,
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
value
\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
name
\"
:
\"
SentMessageExtension1
\"
,
\"
type
\"
:
\"
event
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
MESSAGE_VERSION
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint16
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint16
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
MIN_GAS_CALLDATA_OVERHEAD
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint64
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint64
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
MIN_GAS_CONSTANT_OVERHEAD
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint64
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint64
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
MIN_GAS_DYNAMIC_OVERHEAD_DENOMINATOR
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint64
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint64
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
MIN_GAS_DYNAMIC_OVERHEAD_NUMERATOR
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint64
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint64
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
OTHER_MESSENGER
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
address
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
bytes
\"
,
\"
name
\"
:
\"
_message
\"
,
\"
type
\"
:
\"
bytes
\"
},{
\"
internalType
\"
:
\"
uint32
\"
,
\"
name
\"
:
\"
_minGasLimit
\"
,
\"
type
\"
:
\"
uint32
\"
}],
\"
name
\"
:
\"
baseGas
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint64
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint64
\"
}],
\"
stateMutability
\"
:
\"
pure
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
bytes32
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
bytes32
\"
}],
\"
name
\"
:
\"
failedMessages
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
bool
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
bool
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
initialize
\"
,
\"
outputs
\"
:[],
\"
stateMutability
\"
:
\"
nonpayable
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
l1CrossDomainMessenger
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
address
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
messageNonce
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_nonce
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"
_sender
\"
,
\"
type
\"
:
\"
address
\"
},{
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"
_target
\"
,
\"
type
\"
:
\"
address
\"
},{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_value
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_minGasLimit
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
internalType
\"
:
\"
bytes
\"
,
\"
name
\"
:
\"
_message
\"
,
\"
type
\"
:
\"
bytes
\"
}],
\"
name
\"
:
\"
relayMessage
\"
,
\"
outputs
\"
:[],
\"
stateMutability
\"
:
\"
payable
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"
_target
\"
,
\"
type
\"
:
\"
address
\"
},{
\"
internalType
\"
:
\"
bytes
\"
,
\"
name
\"
:
\"
_message
\"
,
\"
type
\"
:
\"
bytes
\"
},{
\"
internalType
\"
:
\"
uint32
\"
,
\"
name
\"
:
\"
_minGasLimit
\"
,
\"
type
\"
:
\"
uint32
\"
}],
\"
name
\"
:
\"
sendMessage
\"
,
\"
outputs
\"
:[],
\"
stateMutability
\"
:
\"
payable
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
bytes32
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
bytes32
\"
}],
\"
name
\"
:
\"
successfulMessages
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
bool
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
bool
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
version
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
string
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
string
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
xDomainMessageSender
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
address
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
}]"
,
ABI
:
"[{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"
_l1CrossDomainMessenger
\"
,
\"
type
\"
:
\"
address
\"
}],
\"
stateMutability
\"
:
\"
nonpayable
\"
,
\"
type
\"
:
\"
constructor
\"
},{
\"
anonymous
\"
:false,
\"
inputs
\"
:[{
\"
indexed
\"
:true,
\"
internalType
\"
:
\"
bytes32
\"
,
\"
name
\"
:
\"
msgHash
\"
,
\"
type
\"
:
\"
bytes32
\"
}],
\"
name
\"
:
\"
FailedRelayedMessage
\"
,
\"
type
\"
:
\"
event
\"
},{
\"
anonymous
\"
:false,
\"
inputs
\"
:[{
\"
indexed
\"
:false,
\"
internalType
\"
:
\"
uint8
\"
,
\"
name
\"
:
\"
version
\"
,
\"
type
\"
:
\"
uint8
\"
}],
\"
name
\"
:
\"
Initialized
\"
,
\"
type
\"
:
\"
event
\"
},{
\"
anonymous
\"
:false,
\"
inputs
\"
:[{
\"
indexed
\"
:true,
\"
internalType
\"
:
\"
bytes32
\"
,
\"
name
\"
:
\"
msgHash
\"
,
\"
type
\"
:
\"
bytes32
\"
}],
\"
name
\"
:
\"
RelayedMessage
\"
,
\"
type
\"
:
\"
event
\"
},{
\"
anonymous
\"
:false,
\"
inputs
\"
:[{
\"
indexed
\"
:true,
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"
target
\"
,
\"
type
\"
:
\"
address
\"
},{
\"
indexed
\"
:false,
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"
sender
\"
,
\"
type
\"
:
\"
address
\"
},{
\"
indexed
\"
:false,
\"
internalType
\"
:
\"
bytes
\"
,
\"
name
\"
:
\"
message
\"
,
\"
type
\"
:
\"
bytes
\"
},{
\"
indexed
\"
:false,
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
messageNonce
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
indexed
\"
:false,
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
gasLimit
\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
name
\"
:
\"
SentMessage
\"
,
\"
type
\"
:
\"
event
\"
},{
\"
anonymous
\"
:false,
\"
inputs
\"
:[{
\"
indexed
\"
:true,
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"
sender
\"
,
\"
type
\"
:
\"
address
\"
},{
\"
indexed
\"
:false,
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
value
\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
name
\"
:
\"
SentMessageExtension1
\"
,
\"
type
\"
:
\"
event
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
MESSAGE_VERSION
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint16
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint16
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
MIN_GAS_CALLDATA_OVERHEAD
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint64
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint64
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
MIN_GAS_CONSTANT_OVERHEAD
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint64
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint64
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
MIN_GAS_DYNAMIC_OVERHEAD_DENOMINATOR
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint64
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint64
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
MIN_GAS_DYNAMIC_OVERHEAD_NUMERATOR
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint64
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint64
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
OTHER_MESSENGER
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
address
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
bytes
\"
,
\"
name
\"
:
\"
_message
\"
,
\"
type
\"
:
\"
bytes
\"
},{
\"
internalType
\"
:
\"
uint32
\"
,
\"
name
\"
:
\"
_minGasLimit
\"
,
\"
type
\"
:
\"
uint32
\"
}],
\"
name
\"
:
\"
baseGas
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint64
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint64
\"
}],
\"
stateMutability
\"
:
\"
pure
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
bytes32
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
bytes32
\"
}],
\"
name
\"
:
\"
failedMessages
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
bool
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
bool
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
initialize
\"
,
\"
outputs
\"
:[],
\"
stateMutability
\"
:
\"
nonpayable
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
l1CrossDomainMessenger
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
address
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
messageNonce
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_nonce
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"
_sender
\"
,
\"
type
\"
:
\"
address
\"
},{
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"
_target
\"
,
\"
type
\"
:
\"
address
\"
},{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_value
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_minGasLimit
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
internalType
\"
:
\"
bytes
\"
,
\"
name
\"
:
\"
_message
\"
,
\"
type
\"
:
\"
bytes
\"
}],
\"
name
\"
:
\"
relayMessage
\"
,
\"
outputs
\"
:[],
\"
stateMutability
\"
:
\"
payable
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"
_target
\"
,
\"
type
\"
:
\"
address
\"
},{
\"
internalType
\"
:
\"
bytes
\"
,
\"
name
\"
:
\"
_message
\"
,
\"
type
\"
:
\"
bytes
\"
},{
\"
internalType
\"
:
\"
uint32
\"
,
\"
name
\"
:
\"
_minGasLimit
\"
,
\"
type
\"
:
\"
uint32
\"
}],
\"
name
\"
:
\"
sendMessage
\"
,
\"
outputs
\"
:[],
\"
stateMutability
\"
:
\"
payable
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
bytes32
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
bytes32
\"
}],
\"
name
\"
:
\"
successfulMessages
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
bool
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
bool
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
version
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
string
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
string
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
xDomainMessageSender
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
address
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
}]"
,
Bin
:
"0x6101006040523480156200001257600080fd5b50604051620020
ab380380620020ab833981016040819052620000359162000243565b6001600160a01b038116608052600160a081905260c052600060e0526200005b62000062565b5062000275565b600054600160a81b900460ff16158080156200008b57506000546001600160a01b90910460ff16105b80620000c25750620000a830620001af60201b620012391760201c565b158015620000c25750600054600160a01b900460ff166001145b6200012b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff60a01b1916600160a01b179055801562000159576000805460ff60a81b1916600160a81b1790555b62000163620001be565b8015620001ac576000805460ff60a81b19169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b6001600160a01b03163b151590565b600054600160a81b900460ff166200022d5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840162000122565b60cc80546001600160a01b03191661dead179055565b6000602082840312156200025657600080fd5b81516001600160a01b03811681146200026e57600080fd5b9392505050565b60805160a05160c05160e051611de7620002c460003960006106480152600061061f015260006105f601526000818161022e0152818161029f015281816103900152610c8c0152611de76000f3fe6080604052600436106100f35760003560e01c80638129fc1c1161008a578063b1b1b20911610059578063b1b1b209146102c3578063b28ade25146102f3578063d764ad0b14610313578063ecc704281461032657600080fd5b80638129fc1c146102075780639fce812c1461021c578063a4e7f8bd14610250578063a71198691461029057600080fd5b80633f827a5a116100c65780633f827a5a1461016c57806354fd4d50146101945780636e296e45146101b65780637dea7cc3146101f057600080fd5b8063028f85f7146100f85780630c5684981461012b5780632828d7e8146101415780633dbb202b14610157575b600080fd5b34801561010457600080fd5b5061010d601081565b60405167ffffffffffffffff90911681526020015b60405180910390f35b34801561013757600080fd5b5061010d6103e881565b34801561014d57600080fd5b5061010d6103f881565b61016a6101653660046117a0565b61038b565b005b34801561017857600080fd5b50610181600181565b60405161ffff9091168152602001610122565b3480156101a057600080fd5b506101a96105ef565b604051610122919061187f565b3480156101c257600080fd5b506101cb610692565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610122565b3480156101fc57600080fd5b5061010d62030d4081565b34801561021357600080fd5b5061016a61077e565b34801561022857600080fd5b506101cb7f000000000000000000000000000000000000000000000000000000000000000081565b34801561025c57600080fd5b5061028061026b366004611899565b60ce6020526000908152604090205460ff1681565b6040519015158152602001610122565b34801561029c57600080fd5b507f00000000000000000000000000000000000000000000000000000000000000006101cb565b3480156102cf57600080fd5b506102806102de366004611899565b60cb6020526000908152604090205460ff1681565b3480156102ff57600080fd5b5061010d61030e3660046118b2565b61097b565b61016a610321366004611906565b6109c7565b34801561033257600080fd5b5061037d60cd547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e010000000000000000000000000000000000000000000000000000000000001790565b604051908152602001610122565b6104c47f00000000000000000000000000000000000000000000000000000000000000006103ba85858561097b565b347fd764ad0b0000000000000000000000000000000000000000000000000000000061042660cd547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e010000000000000000000000000000000000000000000000000000000000001790565b338a34898c8c60405160240161044297969594939291906119d1565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152611255565b8373ffffffffffffffffffffffffffffffffffffffff167fcb0f7ffd78f9aee47a248fae8db181db6eee833039123e026dcbff529522e52a33858561054960cd547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e010000000000000000000000000000000000000000000000000000000000001790565b8660405161055b959493929190611a30565b60405180910390a260405134815233907f8ebb2ec2465bdb2a06a66fc37a0963af8a2a6a1479d81d56fdb8cbb98096d5469060200160405180910390a2505060cd80547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff808216600101167fffff0000000000000000000000000000000000000000000000000000000000009091161790555050565b606061061a7f00000000000000000000000000000000000000000000000000000000000000006112e3565b6106437f00000000000000000000000000000000000000000000000000000000000000006112e3565b61066c7f00000000000000000000000000000000000000000000000000000000000000006112e3565b60405160200161067e93929190611a7e565b604051602081830303815290604052905090565b60cc5460009073ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff215301610761576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603560248201527f43726f7373446f6d61696e4d657373656e6765723a2078446f6d61696e4d657360448201527f7361676553656e646572206973206e6f7420736574000000000000000000000060648201526084015b60405180910390fd5b5060cc5473ffffffffffffffffffffffffffffffffffffffff1690565b6000547501000000000000000000000000000000000000000000900460ff16158080156107c9575060005460017401000000000000000000000000000000000000000090910460ff16105b806107fb5750303b1580156107fb575060005474010000000000000000000000000000000000000000900460ff166001145b610887576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610758565b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055801561090d57600080547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff1675010000000000000000000000000000000000000000001790555b610915611418565b801561097857600080547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b600062030d4061098c601085611b23565b6103e86109a16103f863ffffffff8716611b23565b6109ab9190611b82565b6109b59190611ba9565b6109bf9190611ba9565b949350505050565b60f087901c60028110610a82576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604d60248201527f43726f7373446f6d61696e4d657373656e6765723a206f6e6c7920766572736960448201527f6f6e2030206f722031206d657373616765732061726520737570706f7274656460648201527f20617420746869732074696d6500000000000000000000000000000000000000608482015260a401610758565b8061ffff16600003610b77576000610ad3878986868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508f92506114f1915050565b600081815260cb602052604090205490915060ff1615610b75576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f43726f7373446f6d61696e4d657373656e6765723a206c65676163792077697460448201527f6864726177616c20616c72656164792072656c617965640000000000000000006064820152608401610758565b505b6000610bbd898989898989898080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061151092505050565b600081815260cf602052604090205490915060ff1615610c39576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610758565b600081815260cf6020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055610ceb600073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000167fffffffffffffffffffffffffeeeeffffffffffffffffffffffffffffffffeeef330173ffffffffffffffffffffffffffffffffffffffff1614905090565b15610d2357853414610cff57610cff611bd5565b600081815260ce602052604090205460ff1615610d1e57610d1e611bd5565b610e75565b3415610dd7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152605060248201527f43726f7373446f6d61696e4d657373656e6765723a2076616c7565206d75737460448201527f206265207a65726f20756e6c657373206d6573736167652069732066726f6d2060648201527f612073797374656d206164647265737300000000000000000000000000000000608482015260a401610758565b600081815260ce602052604090205460ff16610e75576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f43726f7373446f6d61696e4d657373656e6765723a206d65737361676520636160448201527f6e6e6f74206265207265706c61796564000000000000000000000000000000006064820152608401610758565b610e7e87611533565b15610f31576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604360248201527f43726f7373446f6d61696e4d657373656e6765723a2063616e6e6f742073656e60448201527f64206d65737361676520746f20626c6f636b65642073797374656d206164647260648201527f6573730000000000000000000000000000000000000000000000000000000000608482015260a401610758565b600081815260cb602052604090205460ff1615610fd0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f43726f7373446f6d61696e4d657373656e6765723a206d65737361676520686160448201527f7320616c7265616479206265656e2072656c61796564000000000000000000006064820152608401610758565b60cc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8a16179055604080516020601f8601819004810282018101909252848152600091611056918a9189918b918a908a908190840183828082843760009201919091525061158892505050565b60cc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001661dead179055905080156110ed57600082815260cb602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555183917f4641df4a962071e12719d8c8c8e5ac7fc4d97b927346a3d7a335b1f7517e133c91a26111fa565b600082815260ce602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555183917f99d0e048484baa1b1540b1367cb128acd7ab2946d1ed91ec10e3c85e4bf51b8f91a27fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff32016111fa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f43726f7373446f6d61696e4d657373656e6765723a206661696c656420746f2060448201527f72656c6179206d657373616765000000000000000000000000000000000000006064820152608401610758565b50600090815260cf6020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690555050505050505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b6040517fc2b3e5ac0000000000000000000000000000000000000000000000000000000081527342000000000000000000000000000000000000169063c2b3e5ac9084906112ab90889088908790600401611c04565b6000604051808303818588803b1580156112c457600080fd5b505af11580156112d8573d6000803e3d6000fd5b505050505050505050565b60608160000361132657505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115611350578061133a81611c4c565b91506113499050600a83611c84565b915061132a565b60008167ffffffffffffffff81111561136b5761136b611c98565b6040519080825280601f01601f191660200182016040528015611395576020820181803683370190505b5090505b84156109bf576113aa600183611cc7565b91506113b7600a86611cde565b6113c2906030611cf2565b60f81b8183815181106113d7576113d7611d0a565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350611411600a86611c84565b9450611399565b6000547501000000000000000000000000000000000000000000900460ff166114c3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610758565b60cc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001661dead179055565b60006114ff858585856115e2565b805190602001209050949350505050565b600061152087878787878761167b565b8051906020012090509695505050505050565b600073ffffffffffffffffffffffffffffffffffffffff8216301480611582575073ffffffffffffffffffffffffffffffffffffffff8216734200000000000000000000000000000000000016145b92915050565b600080603f60c88601604002045a10156115cb576308c379a06000526020805278185361666543616c6c3a204e6f7420656e6f756768206761736058526064601cfd5b600080845160208601878a5af19695505050505050565b6060848484846040516024016115fb9493929190611d39565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fcbd4ece9000000000000000000000000000000000000000000000000000000001790529050949350505050565b606086868686868660405160240161169896959493929190611d83565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fd764ad0b0000000000000000000000000000000000000000000000000000000017905290509695505050505050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461173e57600080fd5b919050565b60008083601f84011261175557600080fd5b50813567ffffffffffffffff81111561176d57600080fd5b60208301915083602082850101111561178557600080fd5b9250929050565b803563ffffffff8116811461173e57600080fd5b600080600080606085870312156117b657600080fd5b6117bf8561171a565b9350602085013567ffffffffffffffff8111156117db57600080fd5b6117e787828801611743565b90945092506117fa90506040860161178c565b905092959194509250565b60005b83811015611820578181015183820152602001611808565b8381111561182f576000848401525b50505050565b6000815180845261184d816020860160208601611805565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006118926020830184611835565b9392505050565b6000602082840312156118ab57600080fd5b5035919050565b6000806000604084860312156118c757600080fd5b833567ffffffffffffffff8111156118de57600080fd5b6118ea86828701611743565b90945092506118fd90506020850161178c565b90509250925092565b600080600080600080600060c0888a03121561192157600080fd5b873596506119316020890161171a565b955061193f6040890161171a565b9450606088013593506080880135925060a088013567ffffffffffffffff81111561196957600080fd5b6119758a828b01611743565b989b979a50959850939692959293505050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b878152600073ffffffffffffffffffffffffffffffffffffffff808916602084015280881660408401525085606083015263ffffffff8516608083015260c060a0830152611a2360c083018486611988565b9998505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff86168152608060208201526000611a60608083018688611988565b905083604083015263ffffffff831660608301529695505050505050565b60008451611a90818460208901611805565b80830190507f2e000000000000000000000000000000000000000000000000000000000000008082528551611acc816001850160208a01611805565b60019201918201528351611ae7816002840160208801611805565b0160020195945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600067ffffffffffffffff80831681851681830481118215151615611b4a57611b4a611af4565b02949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600067ffffffffffffffff80841680611b9d57611b9d611b53565b92169190910492915050565b600067ffffffffffffffff808316818516808303821115611bcc57611bcc611af4565b01949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff8416815267ffffffffffffffff83166020820152606060408201526000611c436060830184611835565b95945050505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611c7d57611c7d611af4565b5060010190565b600082611c9357611c93611b53565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082821015611cd957611cd9611af4565b500390565b600082611ced57611ced611b53565b500690565b60008219821115611d0557611d05611af4565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600073ffffffffffffffffffffffffffffffffffffffff808716835280861660208401525060806040830152611d726080830185611835565b905082606083015295945050505050565b868152600073ffffffffffffffffffffffffffffffffffffffff808816602084015280871660408401525084606083015283608083015260c060a0830152611dce60c0830184611835
565b9897505050505050505056fea164736f6c634300080f000a"
,
Bin
:
"0x6101006040523480156200001257600080fd5b50604051620020
3138038062002031833981016040819052620000359162000243565b6001600160a01b038116608052600160a081905260c052600060e0526200005b62000062565b5062000275565b600054600160a81b900460ff16158080156200008b57506000546001600160a01b90910460ff16105b80620000c25750620000a830620001af60201b620011bf1760201c565b158015620000c25750600054600160a01b900460ff166001145b6200012b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff60a01b1916600160a01b179055801562000159576000805460ff60a81b1916600160a81b1790555b62000163620001be565b8015620001ac576000805460ff60a81b19169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b6001600160a01b03163b151590565b600054600160a81b900460ff166200022d5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840162000122565b60cc80546001600160a01b03191661dead179055565b6000602082840312156200025657600080fd5b81516001600160a01b03811681146200026e57600080fd5b9392505050565b60805160a05160c05160e051611d6d620002c460003960006106480152600061061f015260006105f601526000818161022e0152818161029f015281816103900152610bfb0152611d6d6000f3fe6080604052600436106100f35760003560e01c80638129fc1c1161008a578063b1b1b20911610059578063b1b1b209146102c3578063b28ade25146102f3578063d764ad0b14610313578063ecc704281461032657600080fd5b80638129fc1c146102075780639fce812c1461021c578063a4e7f8bd14610250578063a71198691461029057600080fd5b80633f827a5a116100c65780633f827a5a1461016c57806354fd4d50146101945780636e296e45146101b65780637dea7cc3146101f057600080fd5b8063028f85f7146100f85780630c5684981461012b5780632828d7e8146101415780633dbb202b14610157575b600080fd5b34801561010457600080fd5b5061010d601081565b60405167ffffffffffffffff90911681526020015b60405180910390f35b34801561013757600080fd5b5061010d6103e881565b34801561014d57600080fd5b5061010d6103f881565b61016a610165366004611726565b61038b565b005b34801561017857600080fd5b50610181600181565b60405161ffff9091168152602001610122565b3480156101a057600080fd5b506101a96105ef565b6040516101229190611805565b3480156101c257600080fd5b506101cb610692565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610122565b3480156101fc57600080fd5b5061010d62030d4081565b34801561021357600080fd5b5061016a61077e565b34801561022857600080fd5b506101cb7f000000000000000000000000000000000000000000000000000000000000000081565b34801561025c57600080fd5b5061028061026b36600461181f565b60ce6020526000908152604090205460ff1681565b6040519015158152602001610122565b34801561029c57600080fd5b507f00000000000000000000000000000000000000000000000000000000000000006101cb565b3480156102cf57600080fd5b506102806102de36600461181f565b60cb6020526000908152604090205460ff1681565b3480156102ff57600080fd5b5061010d61030e366004611838565b61097b565b61016a61032136600461188c565b6109c7565b34801561033257600080fd5b5061037d60cd547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e010000000000000000000000000000000000000000000000000000000000001790565b604051908152602001610122565b6104c47f00000000000000000000000000000000000000000000000000000000000000006103ba85858561097b565b347fd764ad0b0000000000000000000000000000000000000000000000000000000061042660cd547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e010000000000000000000000000000000000000000000000000000000000001790565b338a34898c8c6040516024016104429796959493929190611957565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526111db565b8373ffffffffffffffffffffffffffffffffffffffff167fcb0f7ffd78f9aee47a248fae8db181db6eee833039123e026dcbff529522e52a33858561054960cd547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e010000000000000000000000000000000000000000000000000000000000001790565b8660405161055b9594939291906119b6565b60405180910390a260405134815233907f8ebb2ec2465bdb2a06a66fc37a0963af8a2a6a1479d81d56fdb8cbb98096d5469060200160405180910390a2505060cd80547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff808216600101167fffff0000000000000000000000000000000000000000000000000000000000009091161790555050565b606061061a7f0000000000000000000000000000000000000000000000000000000000000000611269565b6106437f0000000000000000000000000000000000000000000000000000000000000000611269565b61066c7f0000000000000000000000000000000000000000000000000000000000000000611269565b60405160200161067e93929190611a04565b604051602081830303815290604052905090565b60cc5460009073ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff215301610761576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603560248201527f43726f7373446f6d61696e4d657373656e6765723a2078446f6d61696e4d657360448201527f7361676553656e646572206973206e6f7420736574000000000000000000000060648201526084015b60405180910390fd5b5060cc5473ffffffffffffffffffffffffffffffffffffffff1690565b6000547501000000000000000000000000000000000000000000900460ff16158080156107c9575060005460017401000000000000000000000000000000000000000090910460ff16105b806107fb5750303b1580156107fb575060005474010000000000000000000000000000000000000000900460ff166001145b610887576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610758565b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055801561090d57600080547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff1675010000000000000000000000000000000000000000001790555b61091561139e565b801561097857600080547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b600062030d4061098c601085611aa9565b6103e86109a16103f863ffffffff8716611aa9565b6109ab9190611b08565b6109b59190611b2f565b6109bf9190611b2f565b949350505050565b60f087901c60028110610a82576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604d60248201527f43726f7373446f6d61696e4d657373656e6765723a206f6e6c7920766572736960448201527f6f6e2030206f722031206d657373616765732061726520737570706f7274656460648201527f20617420746869732074696d6500000000000000000000000000000000000000608482015260a401610758565b8061ffff16600003610b77576000610ad3878986868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508f9250611477915050565b600081815260cb602052604090205490915060ff1615610b75576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f43726f7373446f6d61696e4d657373656e6765723a206c65676163792077697460448201527f6864726177616c20616c72656164792072656c617965640000000000000000006064820152608401610758565b505b6000610bbd898989898989898080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061149692505050565b905073ffffffffffffffffffffffffffffffffffffffff7fffffffffffffffffffffffffeeeeffffffffffffffffffffffffffffffffeeef330181167f000000000000000000000000000000000000000000000000000000000000000090911603610c5557853414610c3157610c31611b5b565b600081815260ce602052604090205460ff1615610c5057610c50611b5b565b610da7565b3415610d09576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152605060248201527f43726f7373446f6d61696e4d657373656e6765723a2076616c7565206d75737460448201527f206265207a65726f20756e6c657373206d6573736167652069732066726f6d2060648201527f612073797374656d206164647265737300000000000000000000000000000000608482015260a401610758565b600081815260ce602052604090205460ff16610da7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f43726f7373446f6d61696e4d657373656e6765723a206d65737361676520636160448201527f6e6e6f74206265207265706c61796564000000000000000000000000000000006064820152608401610758565b610db0876114b9565b15610e63576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604360248201527f43726f7373446f6d61696e4d657373656e6765723a2063616e6e6f742073656e60448201527f64206d65737361676520746f20626c6f636b65642073797374656d206164647260648201527f6573730000000000000000000000000000000000000000000000000000000000608482015260a401610758565b600081815260cb602052604090205460ff1615610f02576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f43726f7373446f6d61696e4d657373656e6765723a206d65737361676520686160448201527f7320616c7265616479206265656e2072656c61796564000000000000000000006064820152608401610758565b60cc5473ffffffffffffffffffffffffffffffffffffffff1661dead14610f8857600081815260ce602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555182917f99d0e048484baa1b1540b1367cb128acd7ab2946d1ed91ec10e3c85e4bf51b8f91a250506111b6565b60cc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8a16179055604080516020601f860181900481028201810190925284815260009161100e918a9189918b918a908a908190840183828082843760009201919091525061150e92505050565b60cc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001661dead179055905080156110a557600082815260cb602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555183917f4641df4a962071e12719d8c8c8e5ac7fc4d97b927346a3d7a335b1f7517e133c91a26111b2565b600082815260ce602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555183917f99d0e048484baa1b1540b1367cb128acd7ab2946d1ed91ec10e3c85e4bf51b8f91a27fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff32016111b2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f43726f7373446f6d61696e4d657373656e6765723a206661696c656420746f2060448201527f72656c6179206d657373616765000000000000000000000000000000000000006064820152608401610758565b5050505b50505050505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b6040517fc2b3e5ac0000000000000000000000000000000000000000000000000000000081527342000000000000000000000000000000000000169063c2b3e5ac90849061123190889088908790600401611b8a565b6000604051808303818588803b15801561124a57600080fd5b505af115801561125e573d6000803e3d6000fd5b505050505050505050565b6060816000036112ac57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b81156112d657806112c081611bd2565b91506112cf9050600a83611c0a565b91506112b0565b60008167ffffffffffffffff8111156112f1576112f1611c1e565b6040519080825280601f01601f19166020018201604052801561131b576020820181803683370190505b5090505b84156109bf57611330600183611c4d565b915061133d600a86611c64565b611348906030611c78565b60f81b81838151811061135d5761135d611c90565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350611397600a86611c0a565b945061131f565b6000547501000000000000000000000000000000000000000000900460ff16611449576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610758565b60cc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001661dead179055565b600061148585858585611568565b805190602001209050949350505050565b60006114a6878787878787611601565b8051906020012090509695505050505050565b600073ffffffffffffffffffffffffffffffffffffffff8216301480611508575073ffffffffffffffffffffffffffffffffffffffff8216734200000000000000000000000000000000000016145b92915050565b600080603f60c88601604002045a1015611551576308c379a06000526020805278185361666543616c6c3a204e6f7420656e6f756768206761736058526064601cfd5b600080845160208601878a5af19695505050505050565b6060848484846040516024016115819493929190611cbf565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fcbd4ece9000000000000000000000000000000000000000000000000000000001790529050949350505050565b606086868686868660405160240161161e96959493929190611d09565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fd764ad0b0000000000000000000000000000000000000000000000000000000017905290509695505050505050565b803573ffffffffffffffffffffffffffffffffffffffff811681146116c457600080fd5b919050565b60008083601f8401126116db57600080fd5b50813567ffffffffffffffff8111156116f357600080fd5b60208301915083602082850101111561170b57600080fd5b9250929050565b803563ffffffff811681146116c457600080fd5b6000806000806060858703121561173c57600080fd5b611745856116a0565b9350602085013567ffffffffffffffff81111561176157600080fd5b61176d878288016116c9565b9094509250611780905060408601611712565b905092959194509250565b60005b838110156117a657818101518382015260200161178e565b838111156117b5576000848401525b50505050565b600081518084526117d381602086016020860161178b565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60208152600061181860208301846117bb565b9392505050565b60006020828403121561183157600080fd5b5035919050565b60008060006040848603121561184d57600080fd5b833567ffffffffffffffff81111561186457600080fd5b611870868287016116c9565b9094509250611883905060208501611712565b90509250925092565b600080600080600080600060c0888a0312156118a757600080fd5b873596506118b7602089016116a0565b95506118c5604089016116a0565b9450606088013593506080880135925060a088013567ffffffffffffffff8111156118ef57600080fd5b6118fb8a828b016116c9565b989b979a50959850939692959293505050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b878152600073ffffffffffffffffffffffffffffffffffffffff808916602084015280881660408401525085606083015263ffffffff8516608083015260c060a08301526119a960c08301848661190e565b9998505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff861681526080602082015260006119e660808301868861190e565b905083604083015263ffffffff831660608301529695505050505050565b60008451611a1681846020890161178b565b80830190507f2e000000000000000000000000000000000000000000000000000000000000008082528551611a52816001850160208a0161178b565b60019201918201528351611a6d81600284016020880161178b565b0160020195945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600067ffffffffffffffff80831681851681830481118215151615611ad057611ad0611a7a565b02949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600067ffffffffffffffff80841680611b2357611b23611ad9565b92169190910492915050565b600067ffffffffffffffff808316818516808303821115611b5257611b52611a7a565b01949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff8416815267ffffffffffffffff83166020820152606060408201526000611bc960608301846117bb565b95945050505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611c0357611c03611a7a565b5060010190565b600082611c1957611c19611ad9565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082821015611c5f57611c5f611a7a565b500390565b600082611c7357611c73611ad9565b500690565b60008219821115611c8b57611c8b611a7a565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600073ffffffffffffffffffffffffffffffffffffffff808716835280861660208401525060806040830152611cf860808301856117bb565b905082606083015295945050505050565b868152600073ffffffffffffffffffffffffffffffffffffffff808816602084015280871660408401525084606083015283608083015260c060a0830152611d5460c08301846117bb
565b9897505050505050505056fea164736f6c634300080f000a"
,
}
}
// L2CrossDomainMessengerABI is the input ABI used to generate the binding from.
// L2CrossDomainMessengerABI is the input ABI used to generate the binding from.
...
...
op-bindings/bindings/l2crossdomainmessenger_more.go
View file @
707d8735
...
@@ -9,11 +9,11 @@ import (
...
@@ -9,11 +9,11 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/solc"
"github.com/ethereum-optimism/optimism/op-bindings/solc"
)
)
const
L2CrossDomainMessengerStorageLayoutJSON
=
"{
\"
storage
\"
:[{
\"
astId
\"
:1000,
\"
contract
\"
:
\"
contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger
\"
,
\"
label
\"
:
\"
spacer_0_0_20
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
0
\"
,
\"
type
\"
:
\"
t_address
\"
},{
\"
astId
\"
:1001,
\"
contract
\"
:
\"
contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger
\"
,
\"
label
\"
:
\"
_initialized
\"
,
\"
offset
\"
:20,
\"
slot
\"
:
\"
0
\"
,
\"
type
\"
:
\"
t_uint8
\"
},{
\"
astId
\"
:1002,
\"
contract
\"
:
\"
contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger
\"
,
\"
label
\"
:
\"
_initializing
\"
,
\"
offset
\"
:21,
\"
slot
\"
:
\"
0
\"
,
\"
type
\"
:
\"
t_bool
\"
},{
\"
astId
\"
:1003,
\"
contract
\"
:
\"
contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger
\"
,
\"
label
\"
:
\"
spacer_1_0_1600
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
1
\"
,
\"
type
\"
:
\"
t_array(t_uint256)10
20_storage
\"
},{
\"
astId
\"
:1004,
\"
contract
\"
:
\"
contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger
\"
,
\"
label
\"
:
\"
spacer_51_0_20
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
51
\"
,
\"
type
\"
:
\"
t_address
\"
},{
\"
astId
\"
:1005,
\"
contract
\"
:
\"
contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger
\"
,
\"
label
\"
:
\"
spacer_52_0_1568
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
52
\"
,
\"
type
\"
:
\"
t_array(t_uint256)1019_storage
\"
},{
\"
astId
\"
:1006,
\"
contract
\"
:
\"
contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger
\"
,
\"
label
\"
:
\"
spacer_101_0_1
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
101
\"
,
\"
type
\"
:
\"
t_bool
\"
},{
\"
astId
\"
:1007,
\"
contract
\"
:
\"
contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger
\"
,
\"
label
\"
:
\"
spacer_102_0_1568
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
102
\"
,
\"
type
\"
:
\"
t_array(t_uint256)1019_storage
\"
},{
\"
astId
\"
:1008,
\"
contract
\"
:
\"
contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger
\"
,
\"
label
\"
:
\"
spacer_151_0_32
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
151
\"
,
\"
type
\"
:
\"
t_uint256
\"
},{
\"
astId
\"
:1009,
\"
contract
\"
:
\"
contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger
\"
,
\"
label
\"
:
\"
__gap_reentrancy_guard
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
152
\"
,
\"
type
\"
:
\"
t_array(t_uint256)1019_storage
\"
},{
\"
astId
\"
:1010,
\"
contract
\"
:
\"
contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger
\"
,
\"
label
\"
:
\"
spacer_201_0_32
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
201
\"
,
\"
type
\"
:
\"
t_mapping(t_bytes32,t_bool)
\"
},{
\"
astId
\"
:1011,
\"
contract
\"
:
\"
contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger
\"
,
\"
label
\"
:
\"
spacer_202_0_32
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
202
\"
,
\"
type
\"
:
\"
t_mapping(t_bytes32,t_bool)
\"
},{
\"
astId
\"
:1012,
\"
contract
\"
:
\"
contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger
\"
,
\"
label
\"
:
\"
successfulMessages
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
203
\"
,
\"
type
\"
:
\"
t_mapping(t_bytes32,t_bool)
\"
},{
\"
astId
\"
:1013,
\"
contract
\"
:
\"
contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger
\"
,
\"
label
\"
:
\"
xDomainMsgSender
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
204
\"
,
\"
type
\"
:
\"
t_address
\"
},{
\"
astId
\"
:1014,
\"
contract
\"
:
\"
contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger
\"
,
\"
label
\"
:
\"
msgNonce
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
205
\"
,
\"
type
\"
:
\"
t_uint240
\"
},{
\"
astId
\"
:1015,
\"
contract
\"
:
\"
contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger
\"
,
\"
label
\"
:
\"
failedMessages
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
206
\"
,
\"
type
\"
:
\"
t_mapping(t_bytes32,t_bool)
\"
},{
\"
astId
\"
:1016,
\"
contract
\"
:
\"
contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger
\"
,
\"
label
\"
:
\"
reentrancyLocks
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
207
\"
,
\"
type
\"
:
\"
t_mapping(t_bytes32,t_bool)
\"
},{
\"
astId
\"
:1017,
\"
contract
\"
:
\"
contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger
\"
,
\"
label
\"
:
\"
__gap
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
208
\"
,
\"
type
\"
:
\"
t_array(t_uint256)1018_storage
\"
}],
\"
types
\"
:{
\"
t_address
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
address
\"
,
\"
numberOfBytes
\"
:
\"
20
\"
},
\"
t_array(t_uint256)1018_storage
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
uint256[41]
\"
,
\"
numberOfBytes
\"
:
\"
1312
\"
},
\"
t_array(t_uint256)1019_storage
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
uint256[49]
\"
,
\"
numberOfBytes
\"
:
\"
1568
\"
},
\"
t_array(t_uint256)1020
_storage
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
uint256[50]
\"
,
\"
numberOfBytes
\"
:
\"
1600
\"
},
\"
t_bool
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
bool
\"
,
\"
numberOfBytes
\"
:
\"
1
\"
},
\"
t_bytes32
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
bytes32
\"
,
\"
numberOfBytes
\"
:
\"
32
\"
},
\"
t_mapping(t_bytes32,t_bool)
\"
:{
\"
encoding
\"
:
\"
mapping
\"
,
\"
label
\"
:
\"
mapping(bytes32 =
\u003e
bool)
\"
,
\"
numberOfBytes
\"
:
\"
32
\"
,
\"
key
\"
:
\"
t_bytes32
\"
,
\"
value
\"
:
\"
t_bool
\"
},
\"
t_uint240
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
uint240
\"
,
\"
numberOfBytes
\"
:
\"
30
\"
},
\"
t_uint256
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
uint256
\"
,
\"
numberOfBytes
\"
:
\"
32
\"
},
\"
t_uint8
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
uint8
\"
,
\"
numberOfBytes
\"
:
\"
1
\"
}}}"
const
L2CrossDomainMessengerStorageLayoutJSON
=
"{
\"
storage
\"
:[{
\"
astId
\"
:1000,
\"
contract
\"
:
\"
contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger
\"
,
\"
label
\"
:
\"
spacer_0_0_20
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
0
\"
,
\"
type
\"
:
\"
t_address
\"
},{
\"
astId
\"
:1001,
\"
contract
\"
:
\"
contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger
\"
,
\"
label
\"
:
\"
_initialized
\"
,
\"
offset
\"
:20,
\"
slot
\"
:
\"
0
\"
,
\"
type
\"
:
\"
t_uint8
\"
},{
\"
astId
\"
:1002,
\"
contract
\"
:
\"
contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger
\"
,
\"
label
\"
:
\"
_initializing
\"
,
\"
offset
\"
:21,
\"
slot
\"
:
\"
0
\"
,
\"
type
\"
:
\"
t_bool
\"
},{
\"
astId
\"
:1003,
\"
contract
\"
:
\"
contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger
\"
,
\"
label
\"
:
\"
spacer_1_0_1600
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
1
\"
,
\"
type
\"
:
\"
t_array(t_uint256)10
19_storage
\"
},{
\"
astId
\"
:1004,
\"
contract
\"
:
\"
contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger
\"
,
\"
label
\"
:
\"
spacer_51_0_20
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
51
\"
,
\"
type
\"
:
\"
t_address
\"
},{
\"
astId
\"
:1005,
\"
contract
\"
:
\"
contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger
\"
,
\"
label
\"
:
\"
spacer_52_0_1568
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
52
\"
,
\"
type
\"
:
\"
t_array(t_uint256)1018_storage
\"
},{
\"
astId
\"
:1006,
\"
contract
\"
:
\"
contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger
\"
,
\"
label
\"
:
\"
spacer_101_0_1
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
101
\"
,
\"
type
\"
:
\"
t_bool
\"
},{
\"
astId
\"
:1007,
\"
contract
\"
:
\"
contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger
\"
,
\"
label
\"
:
\"
spacer_102_0_1568
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
102
\"
,
\"
type
\"
:
\"
t_array(t_uint256)1018_storage
\"
},{
\"
astId
\"
:1008,
\"
contract
\"
:
\"
contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger
\"
,
\"
label
\"
:
\"
spacer_151_0_32
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
151
\"
,
\"
type
\"
:
\"
t_uint256
\"
},{
\"
astId
\"
:1009,
\"
contract
\"
:
\"
contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger
\"
,
\"
label
\"
:
\"
__gap_reentrancy_guard
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
152
\"
,
\"
type
\"
:
\"
t_array(t_uint256)1018_storage
\"
},{
\"
astId
\"
:1010,
\"
contract
\"
:
\"
contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger
\"
,
\"
label
\"
:
\"
spacer_201_0_32
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
201
\"
,
\"
type
\"
:
\"
t_mapping(t_bytes32,t_bool)
\"
},{
\"
astId
\"
:1011,
\"
contract
\"
:
\"
contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger
\"
,
\"
label
\"
:
\"
spacer_202_0_32
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
202
\"
,
\"
type
\"
:
\"
t_mapping(t_bytes32,t_bool)
\"
},{
\"
astId
\"
:1012,
\"
contract
\"
:
\"
contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger
\"
,
\"
label
\"
:
\"
successfulMessages
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
203
\"
,
\"
type
\"
:
\"
t_mapping(t_bytes32,t_bool)
\"
},{
\"
astId
\"
:1013,
\"
contract
\"
:
\"
contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger
\"
,
\"
label
\"
:
\"
xDomainMsgSender
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
204
\"
,
\"
type
\"
:
\"
t_address
\"
},{
\"
astId
\"
:1014,
\"
contract
\"
:
\"
contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger
\"
,
\"
label
\"
:
\"
msgNonce
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
205
\"
,
\"
type
\"
:
\"
t_uint240
\"
},{
\"
astId
\"
:1015,
\"
contract
\"
:
\"
contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger
\"
,
\"
label
\"
:
\"
failedMessages
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
206
\"
,
\"
type
\"
:
\"
t_mapping(t_bytes32,t_bool)
\"
},{
\"
astId
\"
:1016,
\"
contract
\"
:
\"
contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger
\"
,
\"
label
\"
:
\"
__gap
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
207
\"
,
\"
type
\"
:
\"
t_array(t_uint256)1017_storage
\"
}],
\"
types
\"
:{
\"
t_address
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
address
\"
,
\"
numberOfBytes
\"
:
\"
20
\"
},
\"
t_array(t_uint256)1017_storage
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
uint256[42]
\"
,
\"
numberOfBytes
\"
:
\"
1344
\"
},
\"
t_array(t_uint256)1018_storage
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
uint256[49]
\"
,
\"
numberOfBytes
\"
:
\"
1568
\"
},
\"
t_array(t_uint256)1019
_storage
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
uint256[50]
\"
,
\"
numberOfBytes
\"
:
\"
1600
\"
},
\"
t_bool
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
bool
\"
,
\"
numberOfBytes
\"
:
\"
1
\"
},
\"
t_bytes32
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
bytes32
\"
,
\"
numberOfBytes
\"
:
\"
32
\"
},
\"
t_mapping(t_bytes32,t_bool)
\"
:{
\"
encoding
\"
:
\"
mapping
\"
,
\"
label
\"
:
\"
mapping(bytes32 =
\u003e
bool)
\"
,
\"
numberOfBytes
\"
:
\"
32
\"
,
\"
key
\"
:
\"
t_bytes32
\"
,
\"
value
\"
:
\"
t_bool
\"
},
\"
t_uint240
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
uint240
\"
,
\"
numberOfBytes
\"
:
\"
30
\"
},
\"
t_uint256
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
uint256
\"
,
\"
numberOfBytes
\"
:
\"
32
\"
},
\"
t_uint8
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
uint8
\"
,
\"
numberOfBytes
\"
:
\"
1
\"
}}}"
var
L2CrossDomainMessengerStorageLayout
=
new
(
solc
.
StorageLayout
)
var
L2CrossDomainMessengerStorageLayout
=
new
(
solc
.
StorageLayout
)
var
L2CrossDomainMessengerDeployedBin
=
"0x6080604052600436106100f35760003560e01c80638129fc1c1161008a578063b1b1b20911610059578063b1b1b209146102c3578063b28ade25146102f3578063d764ad0b14610313578063ecc704281461032657600080fd5b80638129fc1c146102075780639fce812c1461021c578063a4e7f8bd14610250578063a71198691461029057600080fd5b80633f827a5a116100c65780633f827a5a1461016c57806354fd4d50146101945780636e296e45146101b65780637dea7cc3146101f057600080fd5b8063028f85f7146100f85780630c5684981461012b5780632828d7e8146101415780633dbb202b14610157575b600080fd5b34801561010457600080fd5b5061010d601081565b60405167ffffffffffffffff90911681526020015b60405180910390f35b34801561013757600080fd5b5061010d6103e881565b34801561014d57600080fd5b5061010d6103f881565b61016a6101653660046117
a0565b61038b565b005b34801561017857600080fd5b50610181600181565b60405161ffff9091168152602001610122565b3480156101a057600080fd5b506101a96105ef565b604051610122919061187f565b3480156101c257600080fd5b506101cb610692565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610122565b3480156101fc57600080fd5b5061010d62030d4081565b34801561021357600080fd5b5061016a61077e565b34801561022857600080fd5b506101cb7f000000000000000000000000000000000000000000000000000000000000000081565b34801561025c57600080fd5b5061028061026b366004611899565b60ce6020526000908152604090205460ff1681565b6040519015158152602001610122565b34801561029c57600080fd5b507f00000000000000000000000000000000000000000000000000000000000000006101cb565b3480156102cf57600080fd5b506102806102de366004611899565b60cb6020526000908152604090205460ff1681565b3480156102ff57600080fd5b5061010d61030e3660046118b2565b61097b565b61016a610321366004611906565b6109c7565b34801561033257600080fd5b5061037d60cd547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e010000000000000000000000000000000000000000000000000000000000001790565b604051908152602001610122565b6104c47f00000000000000000000000000000000000000000000000000000000000000006103ba85858561097b565b347fd764ad0b0000000000000000000000000000000000000000000000000000000061042660cd547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e010000000000000000000000000000000000000000000000000000000000001790565b338a34898c8c60405160240161044297969594939291906119d1565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152611255565b8373ffffffffffffffffffffffffffffffffffffffff167fcb0f7ffd78f9aee47a248fae8db181db6eee833039123e026dcbff529522e52a33858561054960cd547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e010000000000000000000000000000000000000000000000000000000000001790565b8660405161055b959493929190611a30565b60405180910390a260405134815233907f8ebb2ec2465bdb2a06a66fc37a0963af8a2a6a1479d81d56fdb8cbb98096d5469060200160405180910390a2505060cd80547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff808216600101167fffff0000000000000000000000000000000000000000000000000000000000009091161790555050565b606061061a7f00000000000000000000000000000000000000000000000000000000000000006112e3565b6106437f00000000000000000000000000000000000000000000000000000000000000006112e3565b61066c7f00000000000000000000000000000000000000000000000000000000000000006112e3565b60405160200161067e93929190611a7e565b604051602081830303815290604052905090565b60cc5460009073ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff215301610761576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603560248201527f43726f7373446f6d61696e4d657373656e6765723a2078446f6d61696e4d657360448201527f7361676553656e646572206973206e6f7420736574000000000000000000000060648201526084015b60405180910390fd5b5060cc5473ffffffffffffffffffffffffffffffffffffffff1690565b6000547501000000000000000000000000000000000000000000900460ff16158080156107c9575060005460017401000000000000000000000000000000000000000090910460ff16105b806107fb5750303b1580156107fb575060005474010000000000000000000000000000000000000000900460ff166001145b610887576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610758565b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055801561090d57600080547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff1675010000000000000000000000000000000000000000001790555b610915611418565b801561097857600080547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b600062030d4061098c601085611b23565b6103e86109a16103f863ffffffff8716611b23565b6109ab9190611b82565b6109b59190611ba9565b6109bf9190611ba9565b949350505050565b60f087901c60028110610a82576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604d60248201527f43726f7373446f6d61696e4d657373656e6765723a206f6e6c7920766572736960448201527f6f6e2030206f722031206d657373616765732061726520737570706f7274656460648201527f20617420746869732074696d6500000000000000000000000000000000000000608482015260a401610758565b8061ffff16600003610b77576000610ad3878986868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508f92506114f1915050565b600081815260cb602052604090205490915060ff1615610b75576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f43726f7373446f6d61696e4d657373656e6765723a206c65676163792077697460448201527f6864726177616c20616c72656164792072656c617965640000000000000000006064820152608401610758565b505b6000610bbd898989898989898080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061151092505050565b600081815260cf602052604090205490915060ff1615610c39576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610758565b600081815260cf6020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055610ceb600073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000167fffffffffffffffffffffffffeeeeffffffffffffffffffffffffffffffffeeef330173ffffffffffffffffffffffffffffffffffffffff1614905090565b15610d2357853414610cff57610cff611bd5565b600081815260ce602052604090205460ff1615610d1e57610d1e611bd5565b610e75565b3415610dd7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152605060248201527f43726f7373446f6d61696e4d657373656e6765723a2076616c7565206d75737460448201527f206265207a65726f20756e6c657373206d6573736167652069732066726f6d2060648201527f612073797374656d206164647265737300000000000000000000000000000000608482015260a401610758565b600081815260ce602052604090205460ff16610e75576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f43726f7373446f6d61696e4d657373656e6765723a206d65737361676520636160448201527f6e6e6f74206265207265706c61796564000000000000000000000000000000006064820152608401610758565b610e7e87611533565b15610f31576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604360248201527f43726f7373446f6d61696e4d657373656e6765723a2063616e6e6f742073656e60448201527f64206d65737361676520746f20626c6f636b65642073797374656d206164647260648201527f6573730000000000000000000000000000000000000000000000000000000000608482015260a401610758565b600081815260cb602052604090205460ff1615610fd0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f43726f7373446f6d61696e4d657373656e6765723a206d65737361676520686160448201527f7320616c7265616479206265656e2072656c61796564000000000000000000006064820152608401610758565b60cc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8a16179055604080516020601f8601819004810282018101909252848152600091611056918a9189918b918a908a908190840183828082843760009201919091525061158892505050565b60cc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001661dead179055905080156110ed57600082815260cb602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555183917f4641df4a962071e12719d8c8c8e5ac7fc4d97b927346a3d7a335b1f7517e133c91a26111fa565b600082815260ce602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555183917f99d0e048484baa1b1540b1367cb128acd7ab2946d1ed91ec10e3c85e4bf51b8f91a27fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff32016111fa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f43726f7373446f6d61696e4d657373656e6765723a206661696c656420746f2060448201527f72656c6179206d657373616765000000000000000000000000000000000000006064820152608401610758565b50600090815260cf6020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690555050505050505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b6040517fc2b3e5ac0000000000000000000000000000000000000000000000000000000081527342000000000000000000000000000000000000169063c2b3e5ac9084906112ab90889088908790600401611c04565b6000604051808303818588803b1580156112c457600080fd5b505af11580156112d8573d6000803e3d6000fd5b505050505050505050565b60608160000361132657505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115611350578061133a81611c4c565b91506113499050600a83611c84565b915061132a565b60008167ffffffffffffffff81111561136b5761136b611c98565b6040519080825280601f01601f191660200182016040528015611395576020820181803683370190505b5090505b84156109bf576113aa600183611cc7565b91506113b7600a86611cde565b6113c2906030611cf2565b60f81b8183815181106113d7576113d7611d0a565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350611411600a86611c84565b9450611399565b6000547501000000000000000000000000000000000000000000900460ff166114c3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610758565b60cc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001661dead179055565b60006114ff858585856115e2565b805190602001209050949350505050565b600061152087878787878761167b565b8051906020012090509695505050505050565b600073ffffffffffffffffffffffffffffffffffffffff8216301480611582575073ffffffffffffffffffffffffffffffffffffffff8216734200000000000000000000000000000000000016145b92915050565b600080603f60c88601604002045a10156115cb576308c379a06000526020805278185361666543616c6c3a204e6f7420656e6f756768206761736058526064601cfd5b600080845160208601878a5af19695505050505050565b6060848484846040516024016115fb9493929190611d39565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fcbd4ece9000000000000000000000000000000000000000000000000000000001790529050949350505050565b606086868686868660405160240161169896959493929190611d83565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fd764ad0b0000000000000000000000000000000000000000000000000000000017905290509695505050505050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461173e57600080fd5b919050565b60008083601f84011261175557600080fd5b50813567ffffffffffffffff81111561176d57600080fd5b60208301915083602082850101111561178557600080fd5b9250929050565b803563ffffffff8116811461173e57600080fd5b600080600080606085870312156117b657600080fd5b6117bf8561171a565b9350602085013567ffffffffffffffff8111156117db57600080fd5b6117e787828801611743565b90945092506117fa90506040860161178c565b905092959194509250565b60005b83811015611820578181015183820152602001611808565b8381111561182f576000848401525b50505050565b6000815180845261184d816020860160208601611805565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006118926020830184611835565b9392505050565b6000602082840312156118ab57600080fd5b5035919050565b6000806000604084860312156118c757600080fd5b833567ffffffffffffffff8111156118de57600080fd5b6118ea86828701611743565b90945092506118fd90506020850161178c565b90509250925092565b600080600080600080600060c0888a03121561192157600080fd5b873596506119316020890161171a565b955061193f6040890161171a565b9450606088013593506080880135925060a088013567ffffffffffffffff81111561196957600080fd5b6119758a828b01611743565b989b979a50959850939692959293505050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b878152600073ffffffffffffffffffffffffffffffffffffffff808916602084015280881660408401525085606083015263ffffffff8516608083015260c060a0830152611a2360c083018486611988565b9998505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff86168152608060208201526000611a60608083018688611988565b905083604083015263ffffffff831660608301529695505050505050565b60008451611a90818460208901611805565b80830190507f2e000000000000000000000000000000000000000000000000000000000000008082528551611acc816001850160208a01611805565b60019201918201528351611ae7816002840160208801611805565b0160020195945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600067ffffffffffffffff80831681851681830481118215151615611b4a57611b4a611af4565b02949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600067ffffffffffffffff80841680611b9d57611b9d611b53565b92169190910492915050565b600067ffffffffffffffff808316818516808303821115611bcc57611bcc611af4565b01949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff8416815267ffffffffffffffff83166020820152606060408201526000611c436060830184611835565b95945050505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611c7d57611c7d611af4565b5060010190565b600082611c9357611c93611b53565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082821015611cd957611cd9611af4565b500390565b600082611ced57611ced611b53565b500690565b60008219821115611d0557611d05611af4565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600073ffffffffffffffffffffffffffffffffffffffff808716835280861660208401525060806040830152611d726080830185611835565b905082606083015295945050505050565b868152600073ffffffffffffffffffffffffffffffffffffffff808816602084015280871660408401525084606083015283608083015260c060a0830152611dce60c0830184611835
565b9897505050505050505056fea164736f6c634300080f000a"
var
L2CrossDomainMessengerDeployedBin
=
"0x6080604052600436106100f35760003560e01c80638129fc1c1161008a578063b1b1b20911610059578063b1b1b209146102c3578063b28ade25146102f3578063d764ad0b14610313578063ecc704281461032657600080fd5b80638129fc1c146102075780639fce812c1461021c578063a4e7f8bd14610250578063a71198691461029057600080fd5b80633f827a5a116100c65780633f827a5a1461016c57806354fd4d50146101945780636e296e45146101b65780637dea7cc3146101f057600080fd5b8063028f85f7146100f85780630c5684981461012b5780632828d7e8146101415780633dbb202b14610157575b600080fd5b34801561010457600080fd5b5061010d601081565b60405167ffffffffffffffff90911681526020015b60405180910390f35b34801561013757600080fd5b5061010d6103e881565b34801561014d57600080fd5b5061010d6103f881565b61016a6101653660046117
26565b61038b565b005b34801561017857600080fd5b50610181600181565b60405161ffff9091168152602001610122565b3480156101a057600080fd5b506101a96105ef565b6040516101229190611805565b3480156101c257600080fd5b506101cb610692565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610122565b3480156101fc57600080fd5b5061010d62030d4081565b34801561021357600080fd5b5061016a61077e565b34801561022857600080fd5b506101cb7f000000000000000000000000000000000000000000000000000000000000000081565b34801561025c57600080fd5b5061028061026b36600461181f565b60ce6020526000908152604090205460ff1681565b6040519015158152602001610122565b34801561029c57600080fd5b507f00000000000000000000000000000000000000000000000000000000000000006101cb565b3480156102cf57600080fd5b506102806102de36600461181f565b60cb6020526000908152604090205460ff1681565b3480156102ff57600080fd5b5061010d61030e366004611838565b61097b565b61016a61032136600461188c565b6109c7565b34801561033257600080fd5b5061037d60cd547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e010000000000000000000000000000000000000000000000000000000000001790565b604051908152602001610122565b6104c47f00000000000000000000000000000000000000000000000000000000000000006103ba85858561097b565b347fd764ad0b0000000000000000000000000000000000000000000000000000000061042660cd547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e010000000000000000000000000000000000000000000000000000000000001790565b338a34898c8c6040516024016104429796959493929190611957565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526111db565b8373ffffffffffffffffffffffffffffffffffffffff167fcb0f7ffd78f9aee47a248fae8db181db6eee833039123e026dcbff529522e52a33858561054960cd547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e010000000000000000000000000000000000000000000000000000000000001790565b8660405161055b9594939291906119b6565b60405180910390a260405134815233907f8ebb2ec2465bdb2a06a66fc37a0963af8a2a6a1479d81d56fdb8cbb98096d5469060200160405180910390a2505060cd80547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff808216600101167fffff0000000000000000000000000000000000000000000000000000000000009091161790555050565b606061061a7f0000000000000000000000000000000000000000000000000000000000000000611269565b6106437f0000000000000000000000000000000000000000000000000000000000000000611269565b61066c7f0000000000000000000000000000000000000000000000000000000000000000611269565b60405160200161067e93929190611a04565b604051602081830303815290604052905090565b60cc5460009073ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff215301610761576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603560248201527f43726f7373446f6d61696e4d657373656e6765723a2078446f6d61696e4d657360448201527f7361676553656e646572206973206e6f7420736574000000000000000000000060648201526084015b60405180910390fd5b5060cc5473ffffffffffffffffffffffffffffffffffffffff1690565b6000547501000000000000000000000000000000000000000000900460ff16158080156107c9575060005460017401000000000000000000000000000000000000000090910460ff16105b806107fb5750303b1580156107fb575060005474010000000000000000000000000000000000000000900460ff166001145b610887576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610758565b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055801561090d57600080547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff1675010000000000000000000000000000000000000000001790555b61091561139e565b801561097857600080547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b600062030d4061098c601085611aa9565b6103e86109a16103f863ffffffff8716611aa9565b6109ab9190611b08565b6109b59190611b2f565b6109bf9190611b2f565b949350505050565b60f087901c60028110610a82576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604d60248201527f43726f7373446f6d61696e4d657373656e6765723a206f6e6c7920766572736960448201527f6f6e2030206f722031206d657373616765732061726520737570706f7274656460648201527f20617420746869732074696d6500000000000000000000000000000000000000608482015260a401610758565b8061ffff16600003610b77576000610ad3878986868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508f9250611477915050565b600081815260cb602052604090205490915060ff1615610b75576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f43726f7373446f6d61696e4d657373656e6765723a206c65676163792077697460448201527f6864726177616c20616c72656164792072656c617965640000000000000000006064820152608401610758565b505b6000610bbd898989898989898080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061149692505050565b905073ffffffffffffffffffffffffffffffffffffffff7fffffffffffffffffffffffffeeeeffffffffffffffffffffffffffffffffeeef330181167f000000000000000000000000000000000000000000000000000000000000000090911603610c5557853414610c3157610c31611b5b565b600081815260ce602052604090205460ff1615610c5057610c50611b5b565b610da7565b3415610d09576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152605060248201527f43726f7373446f6d61696e4d657373656e6765723a2076616c7565206d75737460448201527f206265207a65726f20756e6c657373206d6573736167652069732066726f6d2060648201527f612073797374656d206164647265737300000000000000000000000000000000608482015260a401610758565b600081815260ce602052604090205460ff16610da7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f43726f7373446f6d61696e4d657373656e6765723a206d65737361676520636160448201527f6e6e6f74206265207265706c61796564000000000000000000000000000000006064820152608401610758565b610db0876114b9565b15610e63576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604360248201527f43726f7373446f6d61696e4d657373656e6765723a2063616e6e6f742073656e60448201527f64206d65737361676520746f20626c6f636b65642073797374656d206164647260648201527f6573730000000000000000000000000000000000000000000000000000000000608482015260a401610758565b600081815260cb602052604090205460ff1615610f02576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f43726f7373446f6d61696e4d657373656e6765723a206d65737361676520686160448201527f7320616c7265616479206265656e2072656c61796564000000000000000000006064820152608401610758565b60cc5473ffffffffffffffffffffffffffffffffffffffff1661dead14610f8857600081815260ce602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555182917f99d0e048484baa1b1540b1367cb128acd7ab2946d1ed91ec10e3c85e4bf51b8f91a250506111b6565b60cc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8a16179055604080516020601f860181900481028201810190925284815260009161100e918a9189918b918a908a908190840183828082843760009201919091525061150e92505050565b60cc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001661dead179055905080156110a557600082815260cb602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555183917f4641df4a962071e12719d8c8c8e5ac7fc4d97b927346a3d7a335b1f7517e133c91a26111b2565b600082815260ce602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555183917f99d0e048484baa1b1540b1367cb128acd7ab2946d1ed91ec10e3c85e4bf51b8f91a27fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff32016111b2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f43726f7373446f6d61696e4d657373656e6765723a206661696c656420746f2060448201527f72656c6179206d657373616765000000000000000000000000000000000000006064820152608401610758565b5050505b50505050505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b6040517fc2b3e5ac0000000000000000000000000000000000000000000000000000000081527342000000000000000000000000000000000000169063c2b3e5ac90849061123190889088908790600401611b8a565b6000604051808303818588803b15801561124a57600080fd5b505af115801561125e573d6000803e3d6000fd5b505050505050505050565b6060816000036112ac57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b81156112d657806112c081611bd2565b91506112cf9050600a83611c0a565b91506112b0565b60008167ffffffffffffffff8111156112f1576112f1611c1e565b6040519080825280601f01601f19166020018201604052801561131b576020820181803683370190505b5090505b84156109bf57611330600183611c4d565b915061133d600a86611c64565b611348906030611c78565b60f81b81838151811061135d5761135d611c90565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350611397600a86611c0a565b945061131f565b6000547501000000000000000000000000000000000000000000900460ff16611449576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610758565b60cc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001661dead179055565b600061148585858585611568565b805190602001209050949350505050565b60006114a6878787878787611601565b8051906020012090509695505050505050565b600073ffffffffffffffffffffffffffffffffffffffff8216301480611508575073ffffffffffffffffffffffffffffffffffffffff8216734200000000000000000000000000000000000016145b92915050565b600080603f60c88601604002045a1015611551576308c379a06000526020805278185361666543616c6c3a204e6f7420656e6f756768206761736058526064601cfd5b600080845160208601878a5af19695505050505050565b6060848484846040516024016115819493929190611cbf565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fcbd4ece9000000000000000000000000000000000000000000000000000000001790529050949350505050565b606086868686868660405160240161161e96959493929190611d09565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fd764ad0b0000000000000000000000000000000000000000000000000000000017905290509695505050505050565b803573ffffffffffffffffffffffffffffffffffffffff811681146116c457600080fd5b919050565b60008083601f8401126116db57600080fd5b50813567ffffffffffffffff8111156116f357600080fd5b60208301915083602082850101111561170b57600080fd5b9250929050565b803563ffffffff811681146116c457600080fd5b6000806000806060858703121561173c57600080fd5b611745856116a0565b9350602085013567ffffffffffffffff81111561176157600080fd5b61176d878288016116c9565b9094509250611780905060408601611712565b905092959194509250565b60005b838110156117a657818101518382015260200161178e565b838111156117b5576000848401525b50505050565b600081518084526117d381602086016020860161178b565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60208152600061181860208301846117bb565b9392505050565b60006020828403121561183157600080fd5b5035919050565b60008060006040848603121561184d57600080fd5b833567ffffffffffffffff81111561186457600080fd5b611870868287016116c9565b9094509250611883905060208501611712565b90509250925092565b600080600080600080600060c0888a0312156118a757600080fd5b873596506118b7602089016116a0565b95506118c5604089016116a0565b9450606088013593506080880135925060a088013567ffffffffffffffff8111156118ef57600080fd5b6118fb8a828b016116c9565b989b979a50959850939692959293505050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b878152600073ffffffffffffffffffffffffffffffffffffffff808916602084015280881660408401525085606083015263ffffffff8516608083015260c060a08301526119a960c08301848661190e565b9998505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff861681526080602082015260006119e660808301868861190e565b905083604083015263ffffffff831660608301529695505050505050565b60008451611a1681846020890161178b565b80830190507f2e000000000000000000000000000000000000000000000000000000000000008082528551611a52816001850160208a0161178b565b60019201918201528351611a6d81600284016020880161178b565b0160020195945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600067ffffffffffffffff80831681851681830481118215151615611ad057611ad0611a7a565b02949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600067ffffffffffffffff80841680611b2357611b23611ad9565b92169190910492915050565b600067ffffffffffffffff808316818516808303821115611b5257611b52611a7a565b01949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff8416815267ffffffffffffffff83166020820152606060408201526000611bc960608301846117bb565b95945050505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611c0357611c03611a7a565b5060010190565b600082611c1957611c19611ad9565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082821015611c5f57611c5f611a7a565b500390565b600082611c7357611c73611ad9565b500690565b60008219821115611c8b57611c8b611a7a565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600073ffffffffffffffffffffffffffffffffffffffff808716835280861660208401525060806040830152611cf860808301856117bb565b905082606083015295945050505050565b868152600073ffffffffffffffffffffffffffffffffffffffff808816602084015280871660408401525084606083015283608083015260c060a0830152611d5460c08301846117bb
565b9897505050505050505056fea164736f6c634300080f000a"
func
init
()
{
func
init
()
{
if
err
:=
json
.
Unmarshal
([]
byte
(
L2CrossDomainMessengerStorageLayoutJSON
),
L2CrossDomainMessengerStorageLayout
);
err
!=
nil
{
if
err
:=
json
.
Unmarshal
([]
byte
(
L2CrossDomainMessengerStorageLayoutJSON
),
L2CrossDomainMessengerStorageLayout
);
err
!=
nil
{
...
...
op-bindings/bindings/l2outputoracle.go
View file @
707d8735
...
@@ -38,7 +38,7 @@ type TypesOutputProposal struct {
...
@@ -38,7 +38,7 @@ type TypesOutputProposal struct {
// L2OutputOracleMetaData contains all meta data concerning the L2OutputOracle contract.
// L2OutputOracleMetaData contains all meta data concerning the L2OutputOracle contract.
var
L2OutputOracleMetaData
=
&
bind
.
MetaData
{
var
L2OutputOracleMetaData
=
&
bind
.
MetaData
{
ABI
:
"[{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_submissionInterval
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_l2BlockTime
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_startingBlockNumber
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_startingTimestamp
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"
_proposer
\"
,
\"
type
\"
:
\"
address
\"
},{
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"
_challenger
\"
,
\"
type
\"
:
\"
address
\"
},{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_finalizationPeriodSeconds
\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
nonpayable
\"
,
\"
type
\"
:
\"
constructor
\"
},{
\"
anonymous
\"
:false,
\"
inputs
\"
:[{
\"
indexed
\"
:false,
\"
internalType
\"
:
\"
uint8
\"
,
\"
name
\"
:
\"
version
\"
,
\"
type
\"
:
\"
uint8
\"
}],
\"
name
\"
:
\"
Initialized
\"
,
\"
type
\"
:
\"
event
\"
},{
\"
anonymous
\"
:false,
\"
inputs
\"
:[{
\"
indexed
\"
:true,
\"
internalType
\"
:
\"
bytes32
\"
,
\"
name
\"
:
\"
outputRoot
\"
,
\"
type
\"
:
\"
bytes32
\"
},{
\"
indexed
\"
:true,
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
l2OutputIndex
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
indexed
\"
:true,
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
l2BlockNumber
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
indexed
\"
:false,
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
l1Timestamp
\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
name
\"
:
\"
OutputProposed
\"
,
\"
type
\"
:
\"
event
\"
},{
\"
anonymous
\"
:false,
\"
inputs
\"
:[{
\"
indexed
\"
:true,
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
prevNextOutputIndex
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
indexed
\"
:true,
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
newNextOutputIndex
\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
name
\"
:
\"
OutputsDeleted
\"
,
\"
type
\"
:
\"
event
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
CHALLENGER
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
address
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
FINALIZATION_PERIOD_SECONDS
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
L2_BLOCK_TIME
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
PROPOSER
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
address
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
SUBMISSION_INTERVAL
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_l2BlockNumber
\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
name
\"
:
\"
computeL2Timestamp
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_l2OutputIndex
\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
name
\"
:
\"
deleteL2Outputs
\"
,
\"
outputs
\"
:[],
\"
stateMutability
\"
:
\"
nonpayable
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_l2OutputIndex
\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
name
\"
:
\"
getL2Output
\"
,
\"
outputs
\"
:[{
\"
components
\"
:[{
\"
internalType
\"
:
\"
bytes32
\"
,
\"
name
\"
:
\"
outputRoot
\"
,
\"
type
\"
:
\"
bytes32
\"
},{
\"
internalType
\"
:
\"
uint128
\"
,
\"
name
\"
:
\"
timestamp
\"
,
\"
type
\"
:
\"
uint128
\"
},{
\"
internalType
\"
:
\"
uint128
\"
,
\"
name
\"
:
\"
l2BlockNumber
\"
,
\"
type
\"
:
\"
uint128
\"
}],
\"
internalType
\"
:
\"
structTypes.OutputProposal
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
tuple
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_l2BlockNumber
\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
name
\"
:
\"
getL2OutputAfter
\"
,
\"
outputs
\"
:[{
\"
components
\"
:[{
\"
internalType
\"
:
\"
bytes32
\"
,
\"
name
\"
:
\"
outputRoot
\"
,
\"
type
\"
:
\"
bytes32
\"
},{
\"
internalType
\"
:
\"
uint128
\"
,
\"
name
\"
:
\"
timestamp
\"
,
\"
type
\"
:
\"
uint128
\"
},{
\"
internalType
\"
:
\"
uint128
\"
,
\"
name
\"
:
\"
l2BlockNumber
\"
,
\"
type
\"
:
\"
uint128
\"
}],
\"
internalType
\"
:
\"
structTypes.OutputProposal
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
tuple
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_l2BlockNumber
\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
name
\"
:
\"
getL2OutputIndexAfter
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_startingBlockNumber
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_startingTimestamp
\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
name
\"
:
\"
initialize
\"
,
\"
outputs
\"
:[],
\"
stateMutability
\"
:
\"
nonpayable
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
latestBlockNumber
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
latestOutputIndex
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
nextBlockNumber
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
nextOutputIndex
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
bytes32
\"
,
\"
name
\"
:
\"
_outputRoot
\"
,
\"
type
\"
:
\"
bytes32
\"
},{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_l2BlockNumber
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
internalType
\"
:
\"
bytes32
\"
,
\"
name
\"
:
\"
_l1BlockHash
\"
,
\"
type
\"
:
\"
bytes32
\"
},{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_l1BlockNumber
\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
name
\"
:
\"
proposeL2Output
\"
,
\"
outputs
\"
:[],
\"
stateMutability
\"
:
\"
payable
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
startingBlockNumber
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
startingTimestamp
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
version
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
string
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
string
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
}]"
,
ABI
:
"[{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_submissionInterval
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_l2BlockTime
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_startingBlockNumber
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_startingTimestamp
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"
_proposer
\"
,
\"
type
\"
:
\"
address
\"
},{
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"
_challenger
\"
,
\"
type
\"
:
\"
address
\"
},{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_finalizationPeriodSeconds
\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
nonpayable
\"
,
\"
type
\"
:
\"
constructor
\"
},{
\"
anonymous
\"
:false,
\"
inputs
\"
:[{
\"
indexed
\"
:false,
\"
internalType
\"
:
\"
uint8
\"
,
\"
name
\"
:
\"
version
\"
,
\"
type
\"
:
\"
uint8
\"
}],
\"
name
\"
:
\"
Initialized
\"
,
\"
type
\"
:
\"
event
\"
},{
\"
anonymous
\"
:false,
\"
inputs
\"
:[{
\"
indexed
\"
:true,
\"
internalType
\"
:
\"
bytes32
\"
,
\"
name
\"
:
\"
outputRoot
\"
,
\"
type
\"
:
\"
bytes32
\"
},{
\"
indexed
\"
:true,
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
l2OutputIndex
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
indexed
\"
:true,
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
l2BlockNumber
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
indexed
\"
:false,
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
l1Timestamp
\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
name
\"
:
\"
OutputProposed
\"
,
\"
type
\"
:
\"
event
\"
},{
\"
anonymous
\"
:false,
\"
inputs
\"
:[{
\"
indexed
\"
:true,
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
prevNextOutputIndex
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
indexed
\"
:true,
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
newNextOutputIndex
\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
name
\"
:
\"
OutputsDeleted
\"
,
\"
type
\"
:
\"
event
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
CHALLENGER
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
address
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
FINALIZATION_PERIOD_SECONDS
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
L2_BLOCK_TIME
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
PROPOSER
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
address
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
SUBMISSION_INTERVAL
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_l2BlockNumber
\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
name
\"
:
\"
computeL2Timestamp
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_l2OutputIndex
\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
name
\"
:
\"
deleteL2Outputs
\"
,
\"
outputs
\"
:[],
\"
stateMutability
\"
:
\"
nonpayable
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_l2OutputIndex
\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
name
\"
:
\"
getL2Output
\"
,
\"
outputs
\"
:[{
\"
components
\"
:[{
\"
internalType
\"
:
\"
bytes32
\"
,
\"
name
\"
:
\"
outputRoot
\"
,
\"
type
\"
:
\"
bytes32
\"
},{
\"
internalType
\"
:
\"
uint128
\"
,
\"
name
\"
:
\"
timestamp
\"
,
\"
type
\"
:
\"
uint128
\"
},{
\"
internalType
\"
:
\"
uint128
\"
,
\"
name
\"
:
\"
l2BlockNumber
\"
,
\"
type
\"
:
\"
uint128
\"
}],
\"
internalType
\"
:
\"
structTypes.OutputProposal
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
tuple
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_l2BlockNumber
\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
name
\"
:
\"
getL2OutputAfter
\"
,
\"
outputs
\"
:[{
\"
components
\"
:[{
\"
internalType
\"
:
\"
bytes32
\"
,
\"
name
\"
:
\"
outputRoot
\"
,
\"
type
\"
:
\"
bytes32
\"
},{
\"
internalType
\"
:
\"
uint128
\"
,
\"
name
\"
:
\"
timestamp
\"
,
\"
type
\"
:
\"
uint128
\"
},{
\"
internalType
\"
:
\"
uint128
\"
,
\"
name
\"
:
\"
l2BlockNumber
\"
,
\"
type
\"
:
\"
uint128
\"
}],
\"
internalType
\"
:
\"
structTypes.OutputProposal
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
tuple
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_l2BlockNumber
\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
name
\"
:
\"
getL2OutputIndexAfter
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_startingBlockNumber
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_startingTimestamp
\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
name
\"
:
\"
initialize
\"
,
\"
outputs
\"
:[],
\"
stateMutability
\"
:
\"
nonpayable
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
latestBlockNumber
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
latestOutputIndex
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
nextBlockNumber
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
nextOutputIndex
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
bytes32
\"
,
\"
name
\"
:
\"
_outputRoot
\"
,
\"
type
\"
:
\"
bytes32
\"
},{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_l2BlockNumber
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
internalType
\"
:
\"
bytes32
\"
,
\"
name
\"
:
\"
_l1BlockHash
\"
,
\"
type
\"
:
\"
bytes32
\"
},{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_l1BlockNumber
\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
name
\"
:
\"
proposeL2Output
\"
,
\"
outputs
\"
:[],
\"
stateMutability
\"
:
\"
payable
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
startingBlockNumber
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
startingTimestamp
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
version
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
string
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
string
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
}]"
,
Bin
:
"0x6101806040523480156200001257600080fd5b5060405162001b
1038038062001b10833981016040819052620000359162000364565b6001608052600260a052600060c05285620000bd5760405162461bcd60e51b815260206004820152603460248201527f4c324f75747075744f7261636c653a204c3220626c6f636b2074696d65206d7560448201527f73742062652067726561746572207468616e203000000000000000000000000060648201526084015b60405180910390fd5b858711620001435760405162461bcd60e51b815260206004820152604660248201527f4c324f75747075744f7261636c653a207375626d697373696f6e20696e74657260448201527f76616c206d7573742062652067726561746572207468616e204c3220626c6f636064820152656b2074696d6560d01b608482015260a401620000b4565b60e08790526101008690526001600160a01b038084166101405282166101205261016081905262000175858562000182565b50505050505050620003cc565b600054610100900460ff1615808015620001a35750600054600160ff909116105b80620001d35750620001c0306200033860201b620012691760201c565b158015620001d3575060005460ff166001145b620002385760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401620000b4565b6000805460ff1916600117905580156200025c576000805461ff0019166101001790555b42821115620002e25760405162461bcd60e51b8152602060048201526044602482018190527f4c324f75747075744f7261636c653a207374617274696e67204c322074696d65908201527f7374616d70206d757374206265206c657373207468616e2063757272656e742060648201526374696d6560e01b608482015260a401620000b4565b60028290556001839055801562000333576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b6001600160a01b03163b151590565b80516001600160a01b03811681146200035f57600080fd5b919050565b600080600080600080600060e0888a0312156200038057600080fd5b87519650602088015195506040880151945060608801519350620003a76080890162000347565b9250620003b760a0890162000347565b915060c0880151905092959891949750929550565b60805160a05160c05160e051610100516101205161014051610160516116bb62000455
6000396000818161041501526108f601526000818161036c0152610a66015260008181610236015261079001526000818161015a0152610f9d0152600081816101b60152610feb01526000610503015260006104da015260006104b101526116bb6000f3fe6080604052600436106101435760003560e01c806388786272116100c0578063cf8e5cf011610074578063dcec334811610059578063dcec3348146103ce578063e4a30116146103e3578063f4daa2911461040357600080fd5b8063cf8e5cf01461038e578063d1de856c146103ae57600080fd5b80639aaab648116100a55780639aaab648146102eb578063a25ae557146102fe578063bffa7f0f1461035a57600080fd5b806388786272146102b357806389c44cbb146102c957600080fd5b806369f16eec116101175780636b4d98dd116100fc5780636b4d98dd1461022457806370872aa51461027d5780637f0064201461029357600080fd5b806369f16eec146101fa5780636abcf5631461020f57600080fd5b80622134cc146101485780634599c7881461018f578063529933df146101a457806354fd4d50146101d8575b600080fd5b34801561015457600080fd5b5061017c7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561019b57600080fd5b5061017c610437565b3480156101b057600080fd5b5061017c7f000000000000000000000000000000000000000000000000000000000000000081565b3480156101e457600080fd5b506101ed6104aa565b60405161018691906113f2565b34801561020657600080fd5b5061017c61054d565b34801561021b57600080fd5b5060035461017c565b34801561023057600080fd5b506102587f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610186565b34801561028957600080fd5b5061017c60015481565b34801561029f57600080fd5b5061017c6102ae366004611443565b61055f565b3480156102bf57600080fd5b5061017c60025481565b3480156102d557600080fd5b506102e96102e4366004611443565b610778565b005b6102e96102f936600461145c565b610a4e565b34801561030a57600080fd5b5061031e610319366004611443565b610ecd565b60408051825181526020808401516fffffffffffffffffffffffffffffffff908116918301919091529282015190921690820152606001610186565b34801561036657600080fd5b506102587f000000000000000000000000000000000000000000000000000000000000000081565b34801561039a57600080fd5b5061031e6103a9366004611443565b610f61565b3480156103ba57600080fd5b5061017c6103c9366004611443565b610f99565b3480156103da57600080fd5b5061017c610fe7565b3480156103ef57600080fd5b506102e96103fe36600461148e565b61101c565b34801561040f57600080fd5b5061017c7f000000000000000000000000000000000000000000000000000000000000000081565b600354600090156104a15760038054610452906001906114df565b81548110610462576104626114f6565b600091825260209091206002909102016001015470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff16919050565b6001545b905090565b60606104d57f0000000000000000000000000000000000000000000000000000000000000000611285565b6104fe7f0000000000000000000000000000000000000000000000000000000000000000611285565b6105277f0000000000000000000000000000000000000000000000000000000000000000611285565b60405160200161053993929190611525565b604051602081830303815290604052905090565b6003546000906104a5906001906114df565b6000610569610437565b821115610623576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604860248201527f4c324f75747075744f7261636c653a2063616e6e6f7420676574206f7574707560448201527f7420666f72206120626c6f636b207468617420686173206e6f74206265656e2060648201527f70726f706f736564000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b6003546106d8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604660248201527f4c324f75747075744f7261636c653a2063616e6e6f7420676574206f7574707560448201527f74206173206e6f206f7574707574732068617665206265656e2070726f706f7360648201527f6564207965740000000000000000000000000000000000000000000000000000608482015260a40161061a565b6003546000905b8082101561077157600060026106f5838561159b565b6106ff91906115e2565b90508460038281548110610715576107156114f6565b600091825260209091206002909102016001015470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff1610156107675761076081600161159b565b925061076b565b8091505b506106df565b5092915050565b3373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000161461083d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603e60248201527f4c324f75747075744f7261636c653a206f6e6c7920746865206368616c6c656e60448201527f67657220616464726573732063616e2064656c657465206f7574707574730000606482015260840161061a565b60035481106108f4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604360248201527f4c324f75747075744f7261636c653a2063616e6e6f742064656c657465206f7560448201527f747075747320616674657220746865206c6174657374206f757470757420696e60648201527f6465780000000000000000000000000000000000000000000000000000000000608482015260a40161061a565b7f000000000000000000000000000000000000000000000000000000000000000060038281548110610928576109286114f6565b6000918252602090912060016002909202010154610958906fffffffffffffffffffffffffffffffff16426114df565b10610a0b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604660248201527f4c324f75747075744f7261636c653a2063616e6e6f742064656c657465206f7560448201527f74707574732074686174206861766520616c7265616479206265656e2066696e60648201527f616c697a65640000000000000000000000000000000000000000000000000000608482015260a40161061a565b6000610a1660035490565b90508160035581817f4ee37ac2c786ec85e87592d3c5c8a1dd66f8496dda3f125d9ea8ca5f657629b660405160405180910390a35050565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610b39576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604160248201527f4c324f75747075744f7261636c653a206f6e6c79207468652070726f706f736560448201527f7220616464726573732063616e2070726f706f7365206e6577206f757470757460648201527f7300000000000000000000000000000000000000000000000000000000000000608482015260a40161061a565b610b41610fe7565b8314610bf5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604860248201527f4c324f75747075744f7261636c653a20626c6f636b206e756d626572206d757360448201527f7420626520657175616c20746f206e65787420657870656374656420626c6f6360648201527f6b206e756d626572000000000000000000000000000000000000000000000000608482015260a40161061a565b42610bff84610f99565b10610c8c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f4c324f75747075744f7261636c653a2063616e6e6f742070726f706f7365204c60448201527f32206f757470757420696e207468652066757475726500000000000000000000606482015260840161061a565b83610d19576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f4c324f75747075744f7261636c653a204c32206f75747075742070726f706f7360448201527f616c2063616e6e6f7420626520746865207a65726f2068617368000000000000606482015260840161061a565b8115610dd55781814014610dd5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604960248201527f4c324f75747075744f7261636c653a20626c6f636b206861736820646f65732060448201527f6e6f74206d61746368207468652068617368206174207468652065787065637460648201527f6564206865696768740000000000000000000000000000000000000000000000608482015260a40161061a565b82610ddf60035490565b857fa7aaf2512769da4e444e3de247be2564225c2e7a8f74cfe528e46e17d24868e242604051610e1191815260200190565b60405180910390a45050604080516060810182529283526fffffffffffffffffffffffffffffffff4281166020850190815292811691840191825260038054600181018255600091909152935160029094027fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b810194909455915190518216700100000000000000000000000000000000029116177fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c90910155565b604080516060810182526000808252602082018190529181019190915260038281548110610efd57610efd6114f6565b600091825260209182902060408051606081018252600290930290910180548352600101546fffffffffffffffffffffffffffffffff8082169484019490945270010000000000000000000000000000000090049092169181019190915292915050565b60408051606081018252600080825260208201819052918101919091526003610f898361055f565b81548110610efd57610efd6114f6565b60007f000000000000000000000000000000000000000000000000000000000000000060015483610fca91906114df565b610fd491906115f6565b600254610fe1919061159b565b92915050565b60007f0000000000000000000000000000000000000000000000000000000000000000611012610437565b6104a5919061159b565b600054610100900460ff161580801561103c5750600054600160ff909116105b806110565750303b158015611056575060005460ff166001145b6110e2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a6564000000000000000000000000000000000000606482015260840161061a565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561114057600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b428211156111f7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526044602482018190527f4c324f75747075744f7261636c653a207374617274696e67204c322074696d65908201527f7374616d70206d757374206265206c657373207468616e2063757272656e742060648201527f74696d6500000000000000000000000000000000000000000000000000000000608482015260a40161061a565b60028290556001839055801561126457600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b6060816000036112c857505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b81156112f257806112dc81611633565b91506112eb9050600a836115e2565b91506112cc565b60008167ffffffffffffffff81111561130d5761130d61166b565b6040519080825280601f01601f191660200182016040528015611337576020820181803683370190505b5090505b84156113ba5761134c6001836114df565b9150611359600a8661169a565b61136490603061159b565b60f81b818381518110611379576113796114f6565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506113b3600a866115e2565b945061133b565b949350505050565b60005b838110156113dd5781810151838201526020016113c5565b838111156113ec576000848401525b50505050565b60208152600082518060208401526114118160408501602087016113c2565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b60006020828403121561145557600080fd5b5035919050565b6000806000806080858703121561147257600080fd5b5050823594602084013594506040840135936060013592509050565b600080604083850312156114a157600080fd5b50508035926020909101359150565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000828210156114f1576114f16114b0565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600084516115378184602089016113c2565b80830190507f2e000000000000000000000000000000000000000000000000000000000000008082528551611573816001850160208a016113c2565b6001920191820152835161158e8160028401602088016113c2565b0160020195945050505050565b600082198211156115ae576115ae6114b0565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000826115f1576115f16115b3565b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561162e5761162e6114b0565b500290565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611664576116646114b0565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000826116a9576116a96115b3565b50069056fea164736f6c634300080f000a"
,
Bin
:
"0x6101806040523480156200001257600080fd5b5060405162001b
0238038062001b02833981016040819052620000359162000356565b6001608052600360a052600060c05285620000bd5760405162461bcd60e51b815260206004820152603460248201527f4c324f75747075744f7261636c653a204c3220626c6f636b2074696d65206d7560448201527f73742062652067726561746572207468616e203000000000000000000000000060648201526084015b60405180910390fd5b60008711620001355760405162461bcd60e51b815260206004820152603a60248201527f4c324f75747075744f7261636c653a207375626d697373696f6e20696e74657260448201527f76616c206d7573742062652067726561746572207468616e20300000000000006064820152608401620000b4565b60e08790526101008690526001600160a01b038084166101405282166101205261016081905262000167858562000174565b50505050505050620003be565b600054610100900460ff1615808015620001955750600054600160ff909116105b80620001c55750620001b2306200032a60201b620012691760201c565b158015620001c5575060005460ff166001145b6200022a5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401620000b4565b6000805460ff1916600117905580156200024e576000805461ff0019166101001790555b42821115620002d45760405162461bcd60e51b8152602060048201526044602482018190527f4c324f75747075744f7261636c653a207374617274696e67204c322074696d65908201527f7374616d70206d757374206265206c657373207468616e2063757272656e742060648201526374696d6560e01b608482015260a401620000b4565b60028290556001839055801562000325576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b6001600160a01b03163b151590565b80516001600160a01b03811681146200035157600080fd5b919050565b600080600080600080600060e0888a0312156200037257600080fd5b87519650602088015195506040880151945060608801519350620003996080890162000339565b9250620003a960a0890162000339565b915060c0880151905092959891949750929550565b60805160a05160c05160e051610100516101205161014051610160516116bb62000447
6000396000818161041501526108f601526000818161036c0152610a66015260008181610236015261079001526000818161015a0152610f9d0152600081816101b60152610feb01526000610503015260006104da015260006104b101526116bb6000f3fe6080604052600436106101435760003560e01c806388786272116100c0578063cf8e5cf011610074578063dcec334811610059578063dcec3348146103ce578063e4a30116146103e3578063f4daa2911461040357600080fd5b8063cf8e5cf01461038e578063d1de856c146103ae57600080fd5b80639aaab648116100a55780639aaab648146102eb578063a25ae557146102fe578063bffa7f0f1461035a57600080fd5b806388786272146102b357806389c44cbb146102c957600080fd5b806369f16eec116101175780636b4d98dd116100fc5780636b4d98dd1461022457806370872aa51461027d5780637f0064201461029357600080fd5b806369f16eec146101fa5780636abcf5631461020f57600080fd5b80622134cc146101485780634599c7881461018f578063529933df146101a457806354fd4d50146101d8575b600080fd5b34801561015457600080fd5b5061017c7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561019b57600080fd5b5061017c610437565b3480156101b057600080fd5b5061017c7f000000000000000000000000000000000000000000000000000000000000000081565b3480156101e457600080fd5b506101ed6104aa565b60405161018691906113f2565b34801561020657600080fd5b5061017c61054d565b34801561021b57600080fd5b5060035461017c565b34801561023057600080fd5b506102587f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610186565b34801561028957600080fd5b5061017c60015481565b34801561029f57600080fd5b5061017c6102ae366004611443565b61055f565b3480156102bf57600080fd5b5061017c60025481565b3480156102d557600080fd5b506102e96102e4366004611443565b610778565b005b6102e96102f936600461145c565b610a4e565b34801561030a57600080fd5b5061031e610319366004611443565b610ecd565b60408051825181526020808401516fffffffffffffffffffffffffffffffff908116918301919091529282015190921690820152606001610186565b34801561036657600080fd5b506102587f000000000000000000000000000000000000000000000000000000000000000081565b34801561039a57600080fd5b5061031e6103a9366004611443565b610f61565b3480156103ba57600080fd5b5061017c6103c9366004611443565b610f99565b3480156103da57600080fd5b5061017c610fe7565b3480156103ef57600080fd5b506102e96103fe36600461148e565b61101c565b34801561040f57600080fd5b5061017c7f000000000000000000000000000000000000000000000000000000000000000081565b600354600090156104a15760038054610452906001906114df565b81548110610462576104626114f6565b600091825260209091206002909102016001015470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff16919050565b6001545b905090565b60606104d57f0000000000000000000000000000000000000000000000000000000000000000611285565b6104fe7f0000000000000000000000000000000000000000000000000000000000000000611285565b6105277f0000000000000000000000000000000000000000000000000000000000000000611285565b60405160200161053993929190611525565b604051602081830303815290604052905090565b6003546000906104a5906001906114df565b6000610569610437565b821115610623576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604860248201527f4c324f75747075744f7261636c653a2063616e6e6f7420676574206f7574707560448201527f7420666f72206120626c6f636b207468617420686173206e6f74206265656e2060648201527f70726f706f736564000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b6003546106d8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604660248201527f4c324f75747075744f7261636c653a2063616e6e6f7420676574206f7574707560448201527f74206173206e6f206f7574707574732068617665206265656e2070726f706f7360648201527f6564207965740000000000000000000000000000000000000000000000000000608482015260a40161061a565b6003546000905b8082101561077157600060026106f5838561159b565b6106ff91906115e2565b90508460038281548110610715576107156114f6565b600091825260209091206002909102016001015470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff1610156107675761076081600161159b565b925061076b565b8091505b506106df565b5092915050565b3373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000161461083d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603e60248201527f4c324f75747075744f7261636c653a206f6e6c7920746865206368616c6c656e60448201527f67657220616464726573732063616e2064656c657465206f7574707574730000606482015260840161061a565b60035481106108f4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604360248201527f4c324f75747075744f7261636c653a2063616e6e6f742064656c657465206f7560448201527f747075747320616674657220746865206c6174657374206f757470757420696e60648201527f6465780000000000000000000000000000000000000000000000000000000000608482015260a40161061a565b7f000000000000000000000000000000000000000000000000000000000000000060038281548110610928576109286114f6565b6000918252602090912060016002909202010154610958906fffffffffffffffffffffffffffffffff16426114df565b10610a0b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604660248201527f4c324f75747075744f7261636c653a2063616e6e6f742064656c657465206f7560448201527f74707574732074686174206861766520616c7265616479206265656e2066696e60648201527f616c697a65640000000000000000000000000000000000000000000000000000608482015260a40161061a565b6000610a1660035490565b90508160035581817f4ee37ac2c786ec85e87592d3c5c8a1dd66f8496dda3f125d9ea8ca5f657629b660405160405180910390a35050565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610b39576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604160248201527f4c324f75747075744f7261636c653a206f6e6c79207468652070726f706f736560448201527f7220616464726573732063616e2070726f706f7365206e6577206f757470757460648201527f7300000000000000000000000000000000000000000000000000000000000000608482015260a40161061a565b610b41610fe7565b8314610bf5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604860248201527f4c324f75747075744f7261636c653a20626c6f636b206e756d626572206d757360448201527f7420626520657175616c20746f206e65787420657870656374656420626c6f6360648201527f6b206e756d626572000000000000000000000000000000000000000000000000608482015260a40161061a565b42610bff84610f99565b10610c8c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f4c324f75747075744f7261636c653a2063616e6e6f742070726f706f7365204c60448201527f32206f757470757420696e207468652066757475726500000000000000000000606482015260840161061a565b83610d19576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f4c324f75747075744f7261636c653a204c32206f75747075742070726f706f7360448201527f616c2063616e6e6f7420626520746865207a65726f2068617368000000000000606482015260840161061a565b8115610dd55781814014610dd5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604960248201527f4c324f75747075744f7261636c653a20626c6f636b206861736820646f65732060448201527f6e6f74206d61746368207468652068617368206174207468652065787065637460648201527f6564206865696768740000000000000000000000000000000000000000000000608482015260a40161061a565b82610ddf60035490565b857fa7aaf2512769da4e444e3de247be2564225c2e7a8f74cfe528e46e17d24868e242604051610e1191815260200190565b60405180910390a45050604080516060810182529283526fffffffffffffffffffffffffffffffff4281166020850190815292811691840191825260038054600181018255600091909152935160029094027fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b810194909455915190518216700100000000000000000000000000000000029116177fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c90910155565b604080516060810182526000808252602082018190529181019190915260038281548110610efd57610efd6114f6565b600091825260209182902060408051606081018252600290930290910180548352600101546fffffffffffffffffffffffffffffffff8082169484019490945270010000000000000000000000000000000090049092169181019190915292915050565b60408051606081018252600080825260208201819052918101919091526003610f898361055f565b81548110610efd57610efd6114f6565b60007f000000000000000000000000000000000000000000000000000000000000000060015483610fca91906114df565b610fd491906115f6565b600254610fe1919061159b565b92915050565b60007f0000000000000000000000000000000000000000000000000000000000000000611012610437565b6104a5919061159b565b600054610100900460ff161580801561103c5750600054600160ff909116105b806110565750303b158015611056575060005460ff166001145b6110e2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a6564000000000000000000000000000000000000606482015260840161061a565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561114057600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b428211156111f7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526044602482018190527f4c324f75747075744f7261636c653a207374617274696e67204c322074696d65908201527f7374616d70206d757374206265206c657373207468616e2063757272656e742060648201527f74696d6500000000000000000000000000000000000000000000000000000000608482015260a40161061a565b60028290556001839055801561126457600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b6060816000036112c857505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b81156112f257806112dc81611633565b91506112eb9050600a836115e2565b91506112cc565b60008167ffffffffffffffff81111561130d5761130d61166b565b6040519080825280601f01601f191660200182016040528015611337576020820181803683370190505b5090505b84156113ba5761134c6001836114df565b9150611359600a8661169a565b61136490603061159b565b60f81b818381518110611379576113796114f6565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506113b3600a866115e2565b945061133b565b949350505050565b60005b838110156113dd5781810151838201526020016113c5565b838111156113ec576000848401525b50505050565b60208152600082518060208401526114118160408501602087016113c2565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b60006020828403121561145557600080fd5b5035919050565b6000806000806080858703121561147257600080fd5b5050823594602084013594506040840135936060013592509050565b600080604083850312156114a157600080fd5b50508035926020909101359150565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000828210156114f1576114f16114b0565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600084516115378184602089016113c2565b80830190507f2e000000000000000000000000000000000000000000000000000000000000008082528551611573816001850160208a016113c2565b6001920191820152835161158e8160028401602088016113c2565b0160020195945050505050565b600082198211156115ae576115ae6114b0565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000826115f1576115f16115b3565b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561162e5761162e6114b0565b500290565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611664576116646114b0565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000826116a9576116a96115b3565b50069056fea164736f6c634300080f000a"
,
}
}
// L2OutputOracleABI is the input ABI used to generate the binding from.
// L2OutputOracleABI is the input ABI used to generate the binding from.
...
...
op-chain-ops/cmd/withdrawals/main.go
View file @
707d8735
...
@@ -22,11 +22,14 @@ import (
...
@@ -22,11 +22,14 @@ import (
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"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/core/state"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/eth/tracers"
"github.com/ethereum/go-ethereum/eth/tracers"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/rpc"
)
)
// abiTrue represents the storage representation of the boolean
// abiTrue represents the storage representation of the boolean
...
@@ -116,6 +119,10 @@ func main() {
...
@@ -116,6 +119,10 @@ func main() {
Value
:
"bad-withdrawals.json"
,
Value
:
"bad-withdrawals.json"
,
Usage
:
"Path to write JSON file of bad withdrawals to manually inspect"
,
Usage
:
"Path to write JSON file of bad withdrawals to manually inspect"
,
},
},
&
cli
.
StringFlag
{
Name
:
"storage-out"
,
Usage
:
"Path to write text file of L2ToL1MessagePasser storage"
,
},
},
},
Action
:
func
(
ctx
*
cli
.
Context
)
error
{
Action
:
func
(
ctx
*
cli
.
Context
)
error
{
clients
,
err
:=
util
.
NewClients
(
ctx
)
clients
,
err
:=
util
.
NewClients
(
ctx
)
...
@@ -163,10 +170,11 @@ func main() {
...
@@ -163,10 +170,11 @@ func main() {
}
}
outfile
:=
ctx
.
String
(
"bad-withdrawals-out"
)
outfile
:=
ctx
.
String
(
"bad-withdrawals-out"
)
f
,
err
:=
os
.
OpenFile
(
outfile
,
os
.
O_WRONLY
|
os
.
O_CREATE
|
os
.
O_APPEND
,
0
o
755
)
f
,
err
:=
os
.
OpenFile
(
outfile
,
os
.
O_WRONLY
|
os
.
O_CREATE
|
os
.
O_APPEND
,
0
o
644
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
defer
f
.
Close
()
// create a transactor
// create a transactor
opts
,
err
:=
newTransactor
(
ctx
)
opts
,
err
:=
newTransactor
(
ctx
)
...
@@ -177,6 +185,28 @@ func main() {
...
@@ -177,6 +185,28 @@ func main() {
// Need this to compare in event parsing
// Need this to compare in event parsing
l1StandardBridgeAddress
:=
common
.
HexToAddress
(
ctx
.
String
(
"l1-standard-bridge-address"
))
l1StandardBridgeAddress
:=
common
.
HexToAddress
(
ctx
.
String
(
"l1-standard-bridge-address"
))
if
storageOutfile
:=
ctx
.
String
(
"storage-out"
);
storageOutfile
!=
""
{
ff
,
err
:=
os
.
OpenFile
(
storageOutfile
,
os
.
O_WRONLY
|
os
.
O_CREATE
|
os
.
O_APPEND
,
0
o644
)
if
err
!=
nil
{
return
err
}
defer
ff
.
Close
()
log
.
Info
(
"Fetching storage for L2ToL1MessagePasser"
)
if
storageRange
,
err
:=
callStorageRange
(
clients
,
predeploys
.
L2ToL1MessagePasserAddr
);
err
!=
nil
{
log
.
Info
(
"error getting storage range"
,
"err"
,
err
)
}
else
{
str
:=
""
for
key
,
value
:=
range
storageRange
{
str
+=
fmt
.
Sprintf
(
"%s: %s
\n
"
,
key
.
Hex
(),
value
.
Hex
())
}
_
,
err
=
ff
.
WriteString
(
str
)
if
err
!=
nil
{
return
err
}
}
}
// iterate over all of the withdrawals and submit them
// iterate over all of the withdrawals and submit them
for
i
,
wd
:=
range
wds
{
for
i
,
wd
:=
range
wds
{
log
.
Info
(
"Processing withdrawal"
,
"index"
,
i
)
log
.
Info
(
"Processing withdrawal"
,
"index"
,
i
)
...
@@ -234,7 +264,7 @@ func main() {
...
@@ -234,7 +264,7 @@ func main() {
// successful messages can be skipped, received messages failed
// successful messages can be skipped, received messages failed
// their execution and should be replayed
// their execution and should be replayed
if
isSuccessNew
{
if
isSuccessNew
{
log
.
Info
(
"Message already relayed"
,
"index"
,
i
,
"hash"
,
hash
,
"slot"
,
slot
)
log
.
Info
(
"Message already relayed"
,
"index"
,
i
,
"hash"
,
hash
.
Hex
(),
"slot"
,
slot
.
Hex
()
)
continue
continue
}
}
...
@@ -248,7 +278,7 @@ func main() {
...
@@ -248,7 +278,7 @@ func main() {
// the value should be set to a boolean in storage
// the value should be set to a boolean in storage
if
!
bytes
.
Equal
(
storageValue
,
abiTrue
.
Bytes
())
{
if
!
bytes
.
Equal
(
storageValue
,
abiTrue
.
Bytes
())
{
return
fmt
.
Errorf
(
"storage slot %x not found in state"
,
slot
)
return
fmt
.
Errorf
(
"storage slot %x not found in state"
,
slot
.
Hex
()
)
}
}
legacySlot
,
err
:=
wd
.
StorageSlot
()
legacySlot
,
err
:=
wd
.
StorageSlot
()
...
@@ -443,10 +473,48 @@ func callTrace(c *util.Clients, receipt *types.Receipt) (callFrame, error) {
...
@@ -443,10 +473,48 @@ func callTrace(c *util.Clients, receipt *types.Receipt) (callFrame, error) {
Tracer
:
&
tracer
,
Tracer
:
&
tracer
,
}
}
err
:=
c
.
L1RpcClient
.
Call
(
&
finalizationTrace
,
"debug_traceTransaction"
,
receipt
.
TxHash
,
traceConfig
)
err
:=
c
.
L1RpcClient
.
Call
(
&
finalizationTrace
,
"debug_traceTransaction"
,
receipt
.
TxHash
,
traceConfig
)
return
finalizationTrace
,
err
}
func
callStorageRangeAt
(
client
*
rpc
.
Client
,
blockHash
common
.
Hash
,
txIndex
int
,
addr
common
.
Address
,
keyStart
hexutil
.
Bytes
,
maxResult
int
,
)
(
*
eth
.
StorageRangeResult
,
error
)
{
var
storageRange
*
eth
.
StorageRangeResult
err
:=
client
.
Call
(
&
storageRange
,
"debug_storageRangeAt"
,
blockHash
,
txIndex
,
addr
,
keyStart
,
maxResult
)
return
storageRange
,
err
}
func
callStorageRange
(
c
*
util
.
Clients
,
addr
common
.
Address
)
(
state
.
Storage
,
error
)
{
header
,
err
:=
c
.
L2Client
.
HeaderByNumber
(
context
.
Background
(),
nil
)
if
err
!=
nil
{
if
err
!=
nil
{
return
finalizationTrace
,
err
return
nil
,
err
}
}
return
finalizationTrace
,
err
hash
:=
header
.
Hash
()
keyStart
:=
hexutil
.
Bytes
(
common
.
Hash
{}
.
Bytes
())
maxResult
:=
1000
ret
:=
make
(
state
.
Storage
)
for
{
result
,
err
:=
callStorageRangeAt
(
c
.
L2RpcClient
,
hash
,
0
,
addr
,
keyStart
,
maxResult
)
if
err
!=
nil
{
return
nil
,
err
}
for
key
,
value
:=
range
result
.
Storage
{
ret
[
key
]
=
value
.
Value
}
if
result
.
NextKey
==
nil
{
break
}
else
{
keyStart
=
hexutil
.
Bytes
(
result
.
NextKey
.
Bytes
())
}
}
return
ret
,
nil
}
}
// handleFinalizeETHWithdrawal will ensure that the calldata is correct
// handleFinalizeETHWithdrawal will ensure that the calldata is correct
...
@@ -709,9 +777,13 @@ func newWithdrawals(ctx *cli.Context, l1ChainID *big.Int) ([]*crossdomain.Legacy
...
@@ -709,9 +777,13 @@ func newWithdrawals(ctx *cli.Context, l1ChainID *big.Int) ([]*crossdomain.Legacy
witnessFile
:=
ctx
.
String
(
"witness-file"
)
witnessFile
:=
ctx
.
String
(
"witness-file"
)
log
.
Debug
(
"Migration data"
,
"ovm-path"
,
ovmMsgs
,
"evm-messages"
,
evmMsgs
,
"witness-file"
,
witnessFile
)
log
.
Debug
(
"Migration data"
,
"ovm-path"
,
ovmMsgs
,
"evm-messages"
,
evmMsgs
,
"witness-file"
,
witnessFile
)
ovmMessages
,
err
:=
crossdomain
.
NewSentMessageFromJSON
(
ovmMsgs
)
var
ovmMessages
[]
*
crossdomain
.
SentMessage
if
err
!=
nil
{
var
err
error
return
nil
,
err
if
ovmMsgs
!=
""
{
ovmMessages
,
err
=
crossdomain
.
NewSentMessageFromJSON
(
ovmMsgs
)
if
err
!=
nil
{
return
nil
,
err
}
}
}
// use empty ovmMessages if its not mainnet. The mainnet messages are
// use empty ovmMessages if its not mainnet. The mainnet messages are
...
...
op-chain-ops/crossdomain/migrate.go
View file @
707d8735
...
@@ -96,17 +96,12 @@ func MigrateWithdrawal(withdrawal *LegacyWithdrawal, l1CrossDomainMessenger *com
...
@@ -96,17 +96,12 @@ func MigrateWithdrawal(withdrawal *LegacyWithdrawal, l1CrossDomainMessenger *com
return
w
,
nil
return
w
,
nil
}
}
// MigrateWithdrawalGasLimit computes the gas limit for the migrated withdrawal.
func
MigrateWithdrawalGasLimit
(
data
[]
byte
)
uint64
{
func
MigrateWithdrawalGasLimit
(
data
[]
byte
)
uint64
{
// Compute the cost of the calldata
// Compute the upper bound on the gas limit. This could be more
dataCost
:=
uint64
(
0
)
// accurate if individual 0 bytes and non zero bytes were accounted
for
_
,
b
:=
range
data
{
// for.
if
b
==
0
{
dataCost
:=
uint64
(
len
(
data
))
*
params
.
TxDataNonZeroGasEIP2028
dataCost
+=
params
.
TxDataZeroGas
}
else
{
dataCost
+=
params
.
TxDataNonZeroGasEIP2028
}
}
// Set the outer gas limit. This cannot be zero
// Set the outer gas limit. This cannot be zero
gasLimit
:=
dataCost
+
200
_000
gasLimit
:=
dataCost
+
200
_000
// Cap the gas limit to be 25 million to prevent creating withdrawals
// Cap the gas limit to be 25 million to prevent creating withdrawals
...
...
op-chain-ops/crossdomain/migrate_test.go
View file @
707d8735
...
@@ -71,15 +71,15 @@ func TestMigrateWithdrawalGasLimit(t *testing.T) {
...
@@ -71,15 +71,15 @@ func TestMigrateWithdrawalGasLimit(t *testing.T) {
},
},
{
{
input
:
[]
byte
{
0xff
,
0x00
},
input
:
[]
byte
{
0xff
,
0x00
},
output
:
200
_000
+
16
+
4
,
output
:
200
_000
+
16
+
16
,
},
},
{
{
input
:
[]
byte
{
0x00
},
input
:
[]
byte
{
0x00
},
output
:
200
_000
+
4
,
output
:
200
_000
+
16
,
},
},
{
{
input
:
[]
byte
{
0x00
,
0x00
,
0x00
},
input
:
[]
byte
{
0x00
,
0x00
,
0x00
},
output
:
200
_000
+
4
+
4
+
4
,
output
:
200
_000
+
16
+
16
+
16
,
},
},
}
}
...
...
op-e2e/setup.go
View file @
707d8735
...
@@ -233,6 +233,10 @@ type System struct {
...
@@ -233,6 +233,10 @@ type System struct {
Mocknet
mocknet
.
Mocknet
Mocknet
mocknet
.
Mocknet
}
}
func
(
sys
*
System
)
NodeEndpoint
(
name
string
)
string
{
return
selectEndpoint
(
sys
.
Nodes
[
name
])
}
func
(
sys
*
System
)
Close
()
{
func
(
sys
*
System
)
Close
()
{
if
sys
.
L2OutputSubmitter
!=
nil
{
if
sys
.
L2OutputSubmitter
!=
nil
{
sys
.
L2OutputSubmitter
.
Stop
()
sys
.
L2OutputSubmitter
.
Stop
()
...
@@ -619,13 +623,17 @@ func (cfg SystemConfig) Start(_opts ...SystemConfigOption) (*System, error) {
...
@@ -619,13 +623,17 @@ func (cfg SystemConfig) Start(_opts ...SystemConfigOption) (*System, error) {
return
sys
,
nil
return
sys
,
nil
}
}
func
configureL1
(
rollupNodeCfg
*
rollupNode
.
Config
,
l1Node
*
node
.
Node
)
{
func
selectEndpoint
(
node
*
node
.
Node
)
string
{
l1EndpointConfig
:=
l1Node
.
WSEndpoint
()
useHTTP
:=
os
.
Getenv
(
"OP_E2E_USE_HTTP"
)
==
"true"
useHTTP
:=
os
.
Getenv
(
"OP_E2E_USE_HTTP"
)
==
"true"
if
useHTTP
{
if
useHTTP
{
log
.
Info
(
"using HTTP client"
)
log
.
Info
(
"using HTTP client"
)
l1EndpointConfig
=
l1N
ode
.
HTTPEndpoint
()
return
n
ode
.
HTTPEndpoint
()
}
}
return
node
.
WSEndpoint
()
}
func
configureL1
(
rollupNodeCfg
*
rollupNode
.
Config
,
l1Node
*
node
.
Node
)
{
l1EndpointConfig
:=
selectEndpoint
(
l1Node
)
rollupNodeCfg
.
L1
=
&
rollupNode
.
L1EndpointConfig
{
rollupNodeCfg
.
L1
=
&
rollupNode
.
L1EndpointConfig
{
L1NodeAddr
:
l1EndpointConfig
,
L1NodeAddr
:
l1EndpointConfig
,
L1TrustRPC
:
false
,
L1TrustRPC
:
false
,
...
...
op-e2e/system_fpp_test.go
0 → 100644
View file @
707d8735
package
op_e2e
import
(
"context"
"math/big"
"testing"
"time"
"github.com/ethereum-optimism/optimism/op-node/client"
"github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum-optimism/optimism/op-node/testlog"
opp
"github.com/ethereum-optimism/optimism/op-program/host"
oppconf
"github.com/ethereum-optimism/optimism/op-program/host/config"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/rpc"
"github.com/stretchr/testify/require"
)
func
TestVerifyL2OutputRoot
(
t
*
testing
.
T
)
{
parallel
(
t
)
ctx
:=
context
.
Background
()
cfg
:=
DefaultSystemConfig
(
t
)
// We don't need a verifier - just the sequencer is enough
delete
(
cfg
.
Nodes
,
"verifier"
)
sys
,
err
:=
cfg
.
Start
()
require
.
Nil
(
t
,
err
,
"Error starting up system"
)
defer
sys
.
Close
()
log
:=
testlog
.
Logger
(
t
,
log
.
LvlInfo
)
log
.
Info
(
"genesis"
,
"l2"
,
sys
.
RollupConfig
.
Genesis
.
L2
,
"l1"
,
sys
.
RollupConfig
.
Genesis
.
L1
,
"l2_time"
,
sys
.
RollupConfig
.
Genesis
.
L2Time
)
l1Client
:=
sys
.
Clients
[
"l1"
]
l2Seq
:=
sys
.
Clients
[
"sequencer"
]
rollupRPCClient
,
err
:=
rpc
.
DialContext
(
context
.
Background
(),
sys
.
RollupNodes
[
"sequencer"
]
.
HTTPEndpoint
())
require
.
Nil
(
t
,
err
)
rollupClient
:=
sources
.
NewRollupClient
(
client
.
NewBaseRPCClient
(
rollupRPCClient
))
// TODO (CLI-3855): Actually perform some tx to set up a more complex chain.
// Wait for the safe head to reach block 10
require
.
NoError
(
t
,
waitForSafeHead
(
ctx
,
10
,
rollupClient
))
// Use block 5 as the agreed starting block on L2
l2AgreedBlock
,
err
:=
l2Seq
.
BlockByNumber
(
ctx
,
big
.
NewInt
(
5
))
require
.
NoError
(
t
,
err
,
"could not retrieve l2 genesis"
)
l2Head
:=
l2AgreedBlock
.
Hash
()
// Agreed starting L2 block
// Get the expected output at block 10
l2ClaimBlockNumber
:=
uint64
(
10
)
l2Output
,
err
:=
rollupClient
.
OutputAtBlock
(
ctx
,
l2ClaimBlockNumber
)
require
.
NoError
(
t
,
err
,
"could not get expected output"
)
l2Claim
:=
l2Output
.
OutputRoot
// Find the current L1 head
l1BlockNumber
,
err
:=
l1Client
.
BlockNumber
(
ctx
)
require
.
NoError
(
t
,
err
,
"get l1 head block number"
)
l1HeadBlock
,
err
:=
l1Client
.
BlockByNumber
(
ctx
,
new
(
big
.
Int
)
.
SetUint64
(
l1BlockNumber
))
require
.
NoError
(
t
,
err
,
"get l1 head block"
)
l1Head
:=
l1HeadBlock
.
Hash
()
preimageDir
:=
t
.
TempDir
()
fppConfig
:=
oppconf
.
NewConfig
(
sys
.
RollupConfig
,
sys
.
L2GenesisCfg
.
Config
,
l1Head
,
l2Head
,
common
.
Hash
(
l2Claim
),
l2ClaimBlockNumber
)
fppConfig
.
L1URL
=
sys
.
NodeEndpoint
(
"l1"
)
fppConfig
.
L2URL
=
sys
.
NodeEndpoint
(
"sequencer"
)
fppConfig
.
DataDir
=
preimageDir
// Check the FPP confirms the expected output
t
.
Log
(
"Running fault proof in fetching mode"
)
err
=
opp
.
FaultProofProgram
(
log
,
fppConfig
)
require
.
NoError
(
t
,
err
)
// Shutdown the nodes from the actual chain. Should now be able to run using only the pre-fetched data.
for
_
,
node
:=
range
sys
.
Nodes
{
require
.
NoError
(
t
,
node
.
Close
())
}
t
.
Log
(
"Running fault proof in offline mode"
)
// Should be able to rerun in offline mode using the pre-fetched images
fppConfig
.
L1URL
=
""
fppConfig
.
L2URL
=
""
err
=
opp
.
FaultProofProgram
(
log
,
fppConfig
)
require
.
NoError
(
t
,
err
)
// Check that a fault is detected if we provide an incorrect claim
t
.
Log
(
"Running fault proof with invalid claim"
)
fppConfig
.
L2Claim
=
common
.
Hash
{
0xaa
}
err
=
opp
.
FaultProofProgram
(
log
,
fppConfig
)
require
.
ErrorIs
(
t
,
err
,
opp
.
ErrClaimNotValid
)
}
func
waitForSafeHead
(
ctx
context
.
Context
,
safeBlockNum
uint64
,
rollupClient
*
sources
.
RollupClient
)
error
{
ctx
,
cancel
:=
context
.
WithTimeout
(
ctx
,
30
*
time
.
Second
)
defer
cancel
()
for
{
seqStatus
,
err
:=
rollupClient
.
SyncStatus
(
ctx
)
if
err
!=
nil
{
return
err
}
if
seqStatus
.
SafeL2
.
Number
>=
safeBlockNum
{
return
nil
}
}
}
op-e2e/system_test.go
View file @
707d8735
...
@@ -23,6 +23,7 @@ import (
...
@@ -23,6 +23,7 @@ import (
"github.com/ethereum/go-ethereum/rpc"
"github.com/ethereum/go-ethereum/rpc"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
"golang.org/x/exp/slices"
"github.com/ethereum-optimism/optimism/op-bindings/bindings"
"github.com/ethereum-optimism/optimism/op-bindings/bindings"
"github.com/ethereum-optimism/optimism/op-bindings/predeploys"
"github.com/ethereum-optimism/optimism/op-bindings/predeploys"
...
@@ -36,6 +37,7 @@ import (
...
@@ -36,6 +37,7 @@ import (
"github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-node/withdrawals"
"github.com/ethereum-optimism/optimism/op-node/withdrawals"
"github.com/ethereum-optimism/optimism/op-service/backoff"
oppprof
"github.com/ethereum-optimism/optimism/op-service/pprof"
oppprof
"github.com/ethereum-optimism/optimism/op-service/pprof"
)
)
...
@@ -619,6 +621,24 @@ func TestSystemMockP2P(t *testing.T) {
...
@@ -619,6 +621,24 @@ func TestSystemMockP2P(t *testing.T) {
// Enable the sequencer now that everyone is ready to receive payloads.
// Enable the sequencer now that everyone is ready to receive payloads.
rollupRPCClient
,
err
:=
rpc
.
DialContext
(
context
.
Background
(),
sys
.
RollupNodes
[
"sequencer"
]
.
HTTPEndpoint
())
rollupRPCClient
,
err
:=
rpc
.
DialContext
(
context
.
Background
(),
sys
.
RollupNodes
[
"sequencer"
]
.
HTTPEndpoint
())
require
.
Nil
(
t
,
err
)
require
.
Nil
(
t
,
err
)
verifierPeerID
:=
sys
.
RollupNodes
[
"verifier"
]
.
P2P
()
.
Host
()
.
ID
()
check
:=
func
()
bool
{
sequencerBlocksTopicPeers
:=
sys
.
RollupNodes
[
"sequencer"
]
.
P2P
()
.
GossipOut
()
.
BlocksTopicPeers
()
return
slices
.
Contains
[
peer
.
ID
](
sequencerBlocksTopicPeers
,
verifierPeerID
)
}
// poll to see if the verifier node is connected & meshed on gossip.
// Without this verifier, we shouldn't start sending blocks around, or we'll miss them and fail the test.
backOffStrategy
:=
backoff
.
Exponential
()
for
i
:=
0
;
i
<
10
;
i
++
{
if
check
()
{
break
}
time
.
Sleep
(
backOffStrategy
.
Duration
(
i
))
}
require
.
True
(
t
,
check
(),
"verifier must be meshed with sequencer for gossip test to proceed"
)
require
.
NoError
(
t
,
rollupRPCClient
.
Call
(
nil
,
"admin_startSequencer"
,
sys
.
L2GenesisCfg
.
ToBlock
()
.
Hash
()))
require
.
NoError
(
t
,
rollupRPCClient
.
Call
(
nil
,
"admin_startSequencer"
,
sys
.
L2GenesisCfg
.
ToBlock
()
.
Hash
()))
l2Seq
:=
sys
.
Clients
[
"sequencer"
]
l2Seq
:=
sys
.
Clients
[
"sequencer"
]
...
...
op-node/rollup/sync/start.go
View file @
707d8735
...
@@ -110,7 +110,7 @@ func FindL2Heads(ctx context.Context, cfg *rollup.Config, l1 L1Chain, l2 L2Chain
...
@@ -110,7 +110,7 @@ func FindL2Heads(ctx context.Context, cfg *rollup.Config, l1 L1Chain, l2 L2Chain
}
}
lgr
.
Info
(
"Loaded current L2 heads"
,
"unsafe"
,
result
.
Unsafe
,
"safe"
,
result
.
Safe
,
"finalized"
,
result
.
Finalized
,
lgr
.
Info
(
"Loaded current L2 heads"
,
"unsafe"
,
result
.
Unsafe
,
"safe"
,
result
.
Safe
,
"finalized"
,
result
.
Finalized
,
"unsafe_origin"
,
result
.
Unsafe
.
L1Origin
,
"
un
safe_origin"
,
result
.
Safe
.
L1Origin
)
"unsafe_origin"
,
result
.
Unsafe
.
L1Origin
,
"safe_origin"
,
result
.
Safe
.
L1Origin
)
// Remember original unsafe block to determine reorg depth
// Remember original unsafe block to determine reorg depth
prevUnsafe
:=
result
.
Unsafe
prevUnsafe
:=
result
.
Unsafe
...
@@ -207,7 +207,7 @@ func FindL2Heads(ctx context.Context, cfg *rollup.Config, l1 L1Chain, l2 L2Chain
...
@@ -207,7 +207,7 @@ func FindL2Heads(ctx context.Context, cfg *rollup.Config, l1 L1Chain, l2 L2Chain
// Don't traverse further than the finalized head to find a safe head
// Don't traverse further than the finalized head to find a safe head
if
n
.
Number
==
result
.
Finalized
.
Number
{
if
n
.
Number
==
result
.
Finalized
.
Number
{
lgr
.
Info
(
"Hit finalized L2 head, returning immediately"
,
"unsafe"
,
result
.
Unsafe
,
"safe"
,
result
.
Safe
,
lgr
.
Info
(
"Hit finalized L2 head, returning immediately"
,
"unsafe"
,
result
.
Unsafe
,
"safe"
,
result
.
Safe
,
"finalized"
,
result
.
Finalized
,
"unsafe_origin"
,
result
.
Unsafe
.
L1Origin
,
"
un
safe_origin"
,
result
.
Safe
.
L1Origin
)
"finalized"
,
result
.
Finalized
,
"unsafe_origin"
,
result
.
Unsafe
.
L1Origin
,
"safe_origin"
,
result
.
Safe
.
L1Origin
)
result
.
Safe
=
n
result
.
Safe
=
n
return
result
,
nil
return
result
,
nil
}
}
...
...
op-node/sources/debug_client.go
0 → 100644
View file @
707d8735
package
sources
import
(
"context"
"fmt"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core/rawdb"
)
type
DebugClient
struct
{
callContext
CallContextFn
}
func
NewDebugClient
(
callContext
CallContextFn
)
*
DebugClient
{
return
&
DebugClient
{
callContext
}
}
func
(
o
*
DebugClient
)
NodeByHash
(
ctx
context
.
Context
,
hash
common
.
Hash
)
([]
byte
,
error
)
{
// MPT nodes are stored as the hash of the node (with no prefix)
node
,
err
:=
o
.
dbGet
(
ctx
,
hash
[
:
])
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"failed to retrieve state MPT node: %w"
,
err
)
}
return
node
,
nil
}
func
(
o
*
DebugClient
)
CodeByHash
(
ctx
context
.
Context
,
hash
common
.
Hash
)
([]
byte
,
error
)
{
// First try retrieving with the new code prefix
code
,
err
:=
o
.
dbGet
(
ctx
,
append
(
append
(
make
([]
byte
,
0
),
rawdb
.
CodePrefix
...
),
hash
[
:
]
...
))
if
err
!=
nil
{
// Fallback to the legacy un-prefixed version
code
,
err
=
o
.
dbGet
(
ctx
,
hash
[
:
])
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"failed to retrieve contract code, using new and legacy keys, with codehash %s: %w"
,
hash
,
err
)
}
}
return
code
,
nil
}
func
(
o
*
DebugClient
)
dbGet
(
ctx
context
.
Context
,
key
[]
byte
)
([]
byte
,
error
)
{
var
node
hexutil
.
Bytes
err
:=
o
.
callContext
(
ctx
,
&
node
,
"debug_dbGet"
,
hexutil
.
Encode
(
key
))
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"fetch error %x: %w"
,
key
,
err
)
}
return
node
,
nil
}
op-node/testutils/mock_debug_client.go
0 → 100644
View file @
707d8735
package
testutils
import
(
"context"
"github.com/ethereum/go-ethereum/common"
"github.com/stretchr/testify/mock"
)
type
MockDebugClient
struct
{
mock
.
Mock
}
func
(
m
*
MockDebugClient
)
ExpectNodeByHash
(
hash
common
.
Hash
,
res
[]
byte
,
err
error
)
{
m
.
Mock
.
On
(
"NodeByHash"
,
hash
)
.
Once
()
.
Return
(
res
,
&
err
)
}
func
(
m
*
MockDebugClient
)
NodeByHash
(
ctx
context
.
Context
,
hash
common
.
Hash
)
([]
byte
,
error
)
{
out
:=
m
.
Mock
.
MethodCalled
(
"NodeByHash"
,
hash
)
return
out
[
0
]
.
([]
byte
),
*
out
[
1
]
.
(
*
error
)
}
func
(
m
*
MockDebugClient
)
ExpectCodeByHash
(
hash
common
.
Hash
,
res
[]
byte
,
err
error
)
{
m
.
Mock
.
On
(
"CodeByHash"
,
hash
)
.
Once
()
.
Return
(
res
,
&
err
)
}
func
(
m
*
MockDebugClient
)
CodeByHash
(
ctx
context
.
Context
,
hash
common
.
Hash
)
([]
byte
,
error
)
{
out
:=
m
.
Mock
.
MethodCalled
(
"CodeByHash"
,
hash
)
return
out
[
0
]
.
([]
byte
),
*
out
[
1
]
.
(
*
error
)
}
op-program/Makefile
View file @
707d8735
...
@@ -9,7 +9,7 @@ LDFLAGSSTRING +=-X github.com/ethereum-optimism/optimism/op-program/version.Meta
...
@@ -9,7 +9,7 @@ LDFLAGSSTRING +=-X github.com/ethereum-optimism/optimism/op-program/version.Meta
LDFLAGS
:=
-ldflags
"
$(LDFLAGSSTRING)
"
LDFLAGS
:=
-ldflags
"
$(LDFLAGSSTRING)
"
op-program
:
op-program
:
env
GO111MODULE
=
on
GOOS
=
$(TARGETOS)
GOARCH
=
$(TARGETARCH)
go build
-v
$(LDFLAGS)
-o
./bin/op-program ./cmd/main.go
env
GO111MODULE
=
on
GOOS
=
$(TARGETOS)
GOARCH
=
$(TARGETARCH)
go build
-v
$(LDFLAGS)
-o
./bin/op-program ./
host/
cmd/main.go
clean
:
clean
:
rm
-rf
bin
rm
-rf
bin
...
...
op-program/client/driver/driver.go
View file @
707d8735
...
@@ -24,18 +24,20 @@ type L2Source interface {
...
@@ -24,18 +24,20 @@ type L2Source interface {
}
}
type
Driver
struct
{
type
Driver
struct
{
logger
log
.
Logger
logger
log
.
Logger
pipeline
Derivation
pipeline
Derivation
l2OutputRoot
func
()
(
eth
.
Bytes32
,
error
)
l2OutputRoot
func
()
(
eth
.
Bytes32
,
error
)
targetBlockNum
uint64
}
}
func
NewDriver
(
logger
log
.
Logger
,
cfg
*
rollup
.
Config
,
l1Source
derive
.
L1Fetcher
,
l2Source
L2Source
)
*
Driver
{
func
NewDriver
(
logger
log
.
Logger
,
cfg
*
rollup
.
Config
,
l1Source
derive
.
L1Fetcher
,
l2Source
L2Source
,
targetBlockNum
uint64
)
*
Driver
{
pipeline
:=
derive
.
NewDerivationPipeline
(
logger
,
cfg
,
l1Source
,
l2Source
,
metrics
.
NoopMetrics
)
pipeline
:=
derive
.
NewDerivationPipeline
(
logger
,
cfg
,
l1Source
,
l2Source
,
metrics
.
NoopMetrics
)
pipeline
.
Reset
()
pipeline
.
Reset
()
return
&
Driver
{
return
&
Driver
{
logger
:
logger
,
logger
:
logger
,
pipeline
:
pipeline
,
pipeline
:
pipeline
,
l2OutputRoot
:
l2Source
.
L2OutputRoot
,
l2OutputRoot
:
l2Source
.
L2OutputRoot
,
targetBlockNum
:
targetBlockNum
,
}
}
}
}
...
@@ -47,6 +49,11 @@ func (d *Driver) Step(ctx context.Context) error {
...
@@ -47,6 +49,11 @@ func (d *Driver) Step(ctx context.Context) error {
if
err
:=
d
.
pipeline
.
Step
(
ctx
);
errors
.
Is
(
err
,
io
.
EOF
)
{
if
err
:=
d
.
pipeline
.
Step
(
ctx
);
errors
.
Is
(
err
,
io
.
EOF
)
{
return
io
.
EOF
return
io
.
EOF
}
else
if
errors
.
Is
(
err
,
derive
.
NotEnoughData
)
{
}
else
if
errors
.
Is
(
err
,
derive
.
NotEnoughData
)
{
head
:=
d
.
pipeline
.
SafeL2Head
()
if
head
.
Number
>=
d
.
targetBlockNum
{
d
.
logger
.
Info
(
"Target L2 block reached"
,
"head"
,
head
)
return
io
.
EOF
}
d
.
logger
.
Debug
(
"Data is lacking"
)
d
.
logger
.
Debug
(
"Data is lacking"
)
return
nil
return
nil
}
else
if
err
!=
nil
{
}
else
if
err
!=
nil
{
...
...
op-program/client/driver/driver_test.go
View file @
707d8735
...
@@ -39,6 +39,30 @@ func TestGenericError(t *testing.T) {
...
@@ -39,6 +39,30 @@ func TestGenericError(t *testing.T) {
require
.
ErrorIs
(
t
,
err
,
expected
)
require
.
ErrorIs
(
t
,
err
,
expected
)
}
}
func
TestTargetBlock
(
t
*
testing
.
T
)
{
t
.
Run
(
"Reached"
,
func
(
t
*
testing
.
T
)
{
driver
:=
createDriverWithNextBlock
(
t
,
derive
.
NotEnoughData
,
1000
)
driver
.
targetBlockNum
=
1000
err
:=
driver
.
Step
(
context
.
Background
())
require
.
ErrorIs
(
t
,
err
,
io
.
EOF
)
})
t
.
Run
(
"Exceeded"
,
func
(
t
*
testing
.
T
)
{
driver
:=
createDriverWithNextBlock
(
t
,
derive
.
NotEnoughData
,
1000
)
driver
.
targetBlockNum
=
500
err
:=
driver
.
Step
(
context
.
Background
())
require
.
ErrorIs
(
t
,
err
,
io
.
EOF
)
})
t
.
Run
(
"NotYetReached"
,
func
(
t
*
testing
.
T
)
{
driver
:=
createDriverWithNextBlock
(
t
,
derive
.
NotEnoughData
,
1000
)
driver
.
targetBlockNum
=
1001
err
:=
driver
.
Step
(
context
.
Background
())
// No error to indicate derivation should continue
require
.
NoError
(
t
,
err
)
})
}
func
TestNoError
(
t
*
testing
.
T
)
{
func
TestNoError
(
t
*
testing
.
T
)
{
driver
:=
createDriver
(
t
,
nil
)
driver
:=
createDriver
(
t
,
nil
)
err
:=
driver
.
Step
(
context
.
Background
())
err
:=
driver
.
Step
(
context
.
Background
())
...
@@ -76,15 +100,21 @@ func TestValidateClaim(t *testing.T) {
...
@@ -76,15 +100,21 @@ func TestValidateClaim(t *testing.T) {
}
}
func
createDriver
(
t
*
testing
.
T
,
derivationResult
error
)
*
Driver
{
func
createDriver
(
t
*
testing
.
T
,
derivationResult
error
)
*
Driver
{
derivation
:=
&
stubDerivation
{
nextErr
:
derivationResult
}
return
createDriverWithNextBlock
(
t
,
derivationResult
,
0
)
}
func
createDriverWithNextBlock
(
t
*
testing
.
T
,
derivationResult
error
,
nextBlockNum
uint64
)
*
Driver
{
derivation
:=
&
stubDerivation
{
nextErr
:
derivationResult
,
nextBlockNum
:
nextBlockNum
}
return
&
Driver
{
return
&
Driver
{
logger
:
testlog
.
Logger
(
t
,
log
.
LvlDebug
),
logger
:
testlog
.
Logger
(
t
,
log
.
LvlDebug
),
pipeline
:
derivation
,
pipeline
:
derivation
,
targetBlockNum
:
1
_000_000
,
}
}
}
}
type
stubDerivation
struct
{
type
stubDerivation
struct
{
nextErr
error
nextErr
error
nextBlockNum
uint64
}
}
func
(
s
stubDerivation
)
Step
(
ctx
context
.
Context
)
error
{
func
(
s
stubDerivation
)
Step
(
ctx
context
.
Context
)
error
{
...
@@ -92,5 +122,7 @@ func (s stubDerivation) Step(ctx context.Context) error {
...
@@ -92,5 +122,7 @@ func (s stubDerivation) Step(ctx context.Context) error {
}
}
func
(
s
stubDerivation
)
SafeL2Head
()
eth
.
L2BlockRef
{
func
(
s
stubDerivation
)
SafeL2Head
()
eth
.
L2BlockRef
{
return
eth
.
L2BlockRef
{}
return
eth
.
L2BlockRef
{
Number
:
s
.
nextBlockNum
,
}
}
}
op-program/client/l1/hints.go
View file @
707d8735
...
@@ -6,12 +6,18 @@ import (
...
@@ -6,12 +6,18 @@ import (
"github.com/ethereum-optimism/optimism/op-program/preimage"
"github.com/ethereum-optimism/optimism/op-program/preimage"
)
)
const
(
HintL1BlockHeader
=
"l1-block-header"
HintL1Transactions
=
"l1-transactions"
HintL1Receipts
=
"l1-receipts"
)
type
BlockHeaderHint
common
.
Hash
type
BlockHeaderHint
common
.
Hash
var
_
preimage
.
Hint
=
BlockHeaderHint
{}
var
_
preimage
.
Hint
=
BlockHeaderHint
{}
func
(
l
BlockHeaderHint
)
Hint
()
string
{
func
(
l
BlockHeaderHint
)
Hint
()
string
{
return
"l1-block-header
"
+
(
common
.
Hash
)(
l
)
.
String
()
return
HintL1BlockHeader
+
"
"
+
(
common
.
Hash
)(
l
)
.
String
()
}
}
type
TransactionsHint
common
.
Hash
type
TransactionsHint
common
.
Hash
...
@@ -19,7 +25,7 @@ type TransactionsHint common.Hash
...
@@ -19,7 +25,7 @@ type TransactionsHint common.Hash
var
_
preimage
.
Hint
=
TransactionsHint
{}
var
_
preimage
.
Hint
=
TransactionsHint
{}
func
(
l
TransactionsHint
)
Hint
()
string
{
func
(
l
TransactionsHint
)
Hint
()
string
{
return
"l1-transactions
"
+
(
common
.
Hash
)(
l
)
.
String
()
return
HintL1Transactions
+
"
"
+
(
common
.
Hash
)(
l
)
.
String
()
}
}
type
ReceiptsHint
common
.
Hash
type
ReceiptsHint
common
.
Hash
...
@@ -27,5 +33,5 @@ type ReceiptsHint common.Hash
...
@@ -27,5 +33,5 @@ type ReceiptsHint common.Hash
var
_
preimage
.
Hint
=
ReceiptsHint
{}
var
_
preimage
.
Hint
=
ReceiptsHint
{}
func
(
l
ReceiptsHint
)
Hint
()
string
{
func
(
l
ReceiptsHint
)
Hint
()
string
{
return
"l1-receipts
"
+
(
common
.
Hash
)(
l
)
.
String
()
return
HintL1Receipts
+
"
"
+
(
common
.
Hash
)(
l
)
.
String
()
}
}
op-program/client/l2/hints.go
View file @
707d8735
...
@@ -6,12 +6,19 @@ import (
...
@@ -6,12 +6,19 @@ import (
"github.com/ethereum-optimism/optimism/op-program/preimage"
"github.com/ethereum-optimism/optimism/op-program/preimage"
)
)
const
(
HintL2BlockHeader
=
"l2-block-header"
HintL2Transactions
=
"l2-transactions"
HintL2Code
=
"l2-code"
HintL2StateNode
=
"l2-state-node"
)
type
BlockHeaderHint
common
.
Hash
type
BlockHeaderHint
common
.
Hash
var
_
preimage
.
Hint
=
BlockHeaderHint
{}
var
_
preimage
.
Hint
=
BlockHeaderHint
{}
func
(
l
BlockHeaderHint
)
Hint
()
string
{
func
(
l
BlockHeaderHint
)
Hint
()
string
{
return
"l2-block-header
"
+
(
common
.
Hash
)(
l
)
.
String
()
return
HintL2BlockHeader
+
"
"
+
(
common
.
Hash
)(
l
)
.
String
()
}
}
type
TransactionsHint
common
.
Hash
type
TransactionsHint
common
.
Hash
...
@@ -19,7 +26,7 @@ type TransactionsHint common.Hash
...
@@ -19,7 +26,7 @@ type TransactionsHint common.Hash
var
_
preimage
.
Hint
=
TransactionsHint
{}
var
_
preimage
.
Hint
=
TransactionsHint
{}
func
(
l
TransactionsHint
)
Hint
()
string
{
func
(
l
TransactionsHint
)
Hint
()
string
{
return
"l2-transactions
"
+
(
common
.
Hash
)(
l
)
.
String
()
return
HintL2Transactions
+
"
"
+
(
common
.
Hash
)(
l
)
.
String
()
}
}
type
CodeHint
common
.
Hash
type
CodeHint
common
.
Hash
...
@@ -27,7 +34,7 @@ type CodeHint common.Hash
...
@@ -27,7 +34,7 @@ type CodeHint common.Hash
var
_
preimage
.
Hint
=
CodeHint
{}
var
_
preimage
.
Hint
=
CodeHint
{}
func
(
l
CodeHint
)
Hint
()
string
{
func
(
l
CodeHint
)
Hint
()
string
{
return
"l2-code
"
+
(
common
.
Hash
)(
l
)
.
String
()
return
HintL2Code
+
"
"
+
(
common
.
Hash
)(
l
)
.
String
()
}
}
type
StateNodeHint
common
.
Hash
type
StateNodeHint
common
.
Hash
...
@@ -35,5 +42,5 @@ type StateNodeHint common.Hash
...
@@ -35,5 +42,5 @@ type StateNodeHint common.Hash
var
_
preimage
.
Hint
=
StateNodeHint
{}
var
_
preimage
.
Hint
=
StateNodeHint
{}
func
(
l
StateNodeHint
)
Hint
()
string
{
func
(
l
StateNodeHint
)
Hint
()
string
{
return
"l2-state-node
"
+
(
common
.
Hash
)(
l
)
.
String
()
return
HintL2StateNode
+
"
"
+
(
common
.
Hash
)(
l
)
.
String
()
}
}
op-program/host/cmd/main.go
View file @
707d8735
package
main
package
main
import
(
import
(
"context"
"errors"
"fmt"
"fmt"
"io"
"os"
"os"
"time"
"github.com/ethereum-optimism/optimism/op-node/chaincfg"
"github.com/ethereum-optimism/optimism/op-program/host"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
cldr
"github.com/ethereum-optimism/optimism/op-program/client/driver"
"github.com/ethereum-optimism/optimism/op-program/host/config"
"github.com/ethereum-optimism/optimism/op-program/host/config"
"github.com/ethereum-optimism/optimism/op-program/host/flags"
"github.com/ethereum-optimism/optimism/op-program/host/flags"
"github.com/ethereum-optimism/optimism/op-program/host/l1"
"github.com/ethereum-optimism/optimism/op-program/host/l2"
"github.com/ethereum-optimism/optimism/op-program/host/version"
"github.com/ethereum-optimism/optimism/op-program/host/version"
oplog
"github.com/ethereum-optimism/optimism/op-service/log"
oplog
"github.com/ethereum-optimism/optimism/op-service/log"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
...
@@ -42,15 +33,13 @@ var VersionWithMeta = func() string {
...
@@ -42,15 +33,13 @@ var VersionWithMeta = func() string {
return
v
return
v
}()
}()
var
(
ErrClaimNotValid
=
errors
.
New
(
"invalid claim"
)
)
func
main
()
{
func
main
()
{
args
:=
os
.
Args
args
:=
os
.
Args
err
:=
run
(
args
,
FaultProofProgram
)
err
:=
run
(
args
,
host
.
FaultProofProgram
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Crit
(
"Application failed"
,
"message"
,
err
)
log
.
Crit
(
"Application failed"
,
"message"
,
err
)
}
else
{
log
.
Info
(
"Claim successfully verified"
)
}
}
}
}
...
@@ -95,43 +84,3 @@ func setupLogging(ctx *cli.Context) (log.Logger, error) {
...
@@ -95,43 +84,3 @@ func setupLogging(ctx *cli.Context) (log.Logger, error) {
logger
:=
oplog
.
NewLogger
(
logCfg
)
logger
:=
oplog
.
NewLogger
(
logCfg
)
return
logger
,
nil
return
logger
,
nil
}
}
// FaultProofProgram is the programmatic entry-point for the fault proof program
func
FaultProofProgram
(
logger
log
.
Logger
,
cfg
*
config
.
Config
)
error
{
cfg
.
Rollup
.
LogDescription
(
logger
,
chaincfg
.
L2ChainIDToNetworkName
)
if
!
cfg
.
FetchingEnabled
()
{
return
errors
.
New
(
"offline mode not supported"
)
}
ctx
:=
context
.
Background
()
logger
.
Info
(
"Connecting to L1 node"
,
"l1"
,
cfg
.
L1URL
)
l1Source
,
err
:=
l1
.
NewFetchingL1
(
ctx
,
logger
,
cfg
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"connect l1 oracle: %w"
,
err
)
}
logger
.
Info
(
"Connecting to L2 node"
,
"l2"
,
cfg
.
L2URL
)
l2Source
,
err
:=
l2
.
NewFetchingEngine
(
ctx
,
logger
,
cfg
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"connect l2 oracle: %w"
,
err
)
}
d
:=
cldr
.
NewDriver
(
logger
,
cfg
.
Rollup
,
l1Source
,
l2Source
)
for
{
if
err
=
d
.
Step
(
ctx
);
errors
.
Is
(
err
,
io
.
EOF
)
{
break
}
else
if
cfg
.
FetchingEnabled
()
&&
errors
.
Is
(
err
,
derive
.
ErrTemporary
)
{
// When in fetching mode, recover from temporary errors to allow us to keep fetching data
// TODO(CLI-3780) Ideally the retry would happen in the fetcher so this is not needed
logger
.
Warn
(
"Temporary error in pipeline"
,
"err"
,
err
)
time
.
Sleep
(
5
*
time
.
Second
)
}
else
if
err
!=
nil
{
return
err
}
}
claim
:=
cfg
.
L2Claim
if
!
d
.
ValidateClaim
(
eth
.
Bytes32
(
claim
))
{
return
ErrClaimNotValid
}
return
nil
}
op-program/host/cmd/main_test.go
View file @
707d8735
...
@@ -3,30 +3,37 @@ package main
...
@@ -3,30 +3,37 @@ package main
import
(
import
(
"encoding/json"
"encoding/json"
"os"
"os"
"strconv"
"testing"
"testing"
"github.com/ethereum-optimism/optimism/op-node/chaincfg"
"github.com/ethereum-optimism/optimism/op-node/chaincfg"
"github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum-optimism/optimism/op-program/host/config"
"github.com/ethereum-optimism/optimism/op-program/host/config"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
)
)
// Use HexToHash(...).Hex() to ensure the strings are the correct length for a hash
var
(
var
l1HeadValue
=
common
.
HexToHash
(
"0x111111"
)
.
Hex
()
// Use HexToHash(...).Hex() to ensure the strings are the correct length for a hash
var
l2HeadValue
=
common
.
HexToHash
(
"0x222222"
)
.
Hex
()
l1HeadValue
=
common
.
HexToHash
(
"0x111111"
)
.
Hex
()
var
l2ClaimValue
=
common
.
HexToHash
(
"0x333333"
)
.
Hex
()
l2HeadValue
=
common
.
HexToHash
(
"0x222222"
)
.
Hex
()
l2ClaimValue
=
common
.
HexToHash
(
"0x333333"
)
.
Hex
()
l2ClaimBlockNumber
=
uint64
(
1203
)
l2Genesis
=
core
.
DefaultGoerliGenesisBlock
()
l2GenesisConfig
=
l2Genesis
.
Config
)
func
TestLogLevel
(
t
*
testing
.
T
)
{
func
TestLogLevel
(
t
*
testing
.
T
)
{
t
.
Run
(
"RejectInvalid"
,
func
(
t
*
testing
.
T
)
{
t
.
Run
(
"RejectInvalid"
,
func
(
t
*
testing
.
T
)
{
verifyArgsInvalid
(
t
,
"unknown level: foo"
,
addRequiredArgs
(
"--log.level=foo"
))
verifyArgsInvalid
(
t
,
"unknown level: foo"
,
addRequiredArgs
(
t
,
"--log.level=foo"
))
})
})
for
_
,
lvl
:=
range
[]
string
{
"trace"
,
"debug"
,
"info"
,
"error"
,
"crit"
}
{
for
_
,
lvl
:=
range
[]
string
{
"trace"
,
"debug"
,
"info"
,
"error"
,
"crit"
}
{
lvl
:=
lvl
lvl
:=
lvl
t
.
Run
(
"AcceptValid_"
+
lvl
,
func
(
t
*
testing
.
T
)
{
t
.
Run
(
"AcceptValid_"
+
lvl
,
func
(
t
*
testing
.
T
)
{
logger
,
_
,
err
:=
runWithArgs
(
addRequiredArgs
(
"--log.level"
,
lvl
))
logger
,
_
,
err
:=
runWithArgs
(
addRequiredArgs
(
t
,
"--log.level"
,
lvl
))
require
.
NoError
(
t
,
err
)
require
.
NoError
(
t
,
err
)
require
.
NotNil
(
t
,
logger
)
require
.
NotNil
(
t
,
logger
)
})
})
...
@@ -34,27 +41,28 @@ func TestLogLevel(t *testing.T) {
...
@@ -34,27 +41,28 @@ func TestLogLevel(t *testing.T) {
}
}
func
TestDefaultCLIOptionsMatchDefaultConfig
(
t
*
testing
.
T
)
{
func
TestDefaultCLIOptionsMatchDefaultConfig
(
t
*
testing
.
T
)
{
cfg
:=
configForArgs
(
t
,
addRequiredArgs
())
cfg
:=
configForArgs
(
t
,
addRequiredArgs
(
t
))
defaultCfg
:=
config
.
NewConfig
(
defaultCfg
:=
config
.
NewConfig
(
&
chaincfg
.
Goerli
,
&
chaincfg
.
Goerli
,
"genesis.json"
,
l2GenesisConfig
,
common
.
HexToHash
(
l1HeadValue
),
common
.
HexToHash
(
l1HeadValue
),
common
.
HexToHash
(
l2HeadValue
),
common
.
HexToHash
(
l2HeadValue
),
common
.
HexToHash
(
l2ClaimValue
))
common
.
HexToHash
(
l2ClaimValue
),
l2ClaimBlockNumber
)
require
.
Equal
(
t
,
defaultCfg
,
cfg
)
require
.
Equal
(
t
,
defaultCfg
,
cfg
)
}
}
func
TestNetwork
(
t
*
testing
.
T
)
{
func
TestNetwork
(
t
*
testing
.
T
)
{
t
.
Run
(
"Unknown"
,
func
(
t
*
testing
.
T
)
{
t
.
Run
(
"Unknown"
,
func
(
t
*
testing
.
T
)
{
verifyArgsInvalid
(
t
,
"invalid network bar"
,
replaceRequiredArg
(
"--network"
,
"bar"
))
verifyArgsInvalid
(
t
,
"invalid network bar"
,
replaceRequiredArg
(
t
,
"--network"
,
"bar"
))
})
})
t
.
Run
(
"Required"
,
func
(
t
*
testing
.
T
)
{
t
.
Run
(
"Required"
,
func
(
t
*
testing
.
T
)
{
verifyArgsInvalid
(
t
,
"flag rollup.config or network is required"
,
addRequiredArgsExcept
(
"--network"
))
verifyArgsInvalid
(
t
,
"flag rollup.config or network is required"
,
addRequiredArgsExcept
(
t
,
"--network"
))
})
})
t
.
Run
(
"DisallowNetworkAndRollupConfig"
,
func
(
t
*
testing
.
T
)
{
t
.
Run
(
"DisallowNetworkAndRollupConfig"
,
func
(
t
*
testing
.
T
)
{
verifyArgsInvalid
(
t
,
"cannot specify both rollup.config and network"
,
addRequiredArgs
(
"--rollup.config=foo"
))
verifyArgsInvalid
(
t
,
"cannot specify both rollup.config and network"
,
addRequiredArgs
(
t
,
"--rollup.config=foo"
))
})
})
t
.
Run
(
"RollupConfig"
,
func
(
t
*
testing
.
T
)
{
t
.
Run
(
"RollupConfig"
,
func
(
t
*
testing
.
T
)
{
...
@@ -65,7 +73,7 @@ func TestNetwork(t *testing.T) {
...
@@ -65,7 +73,7 @@ func TestNetwork(t *testing.T) {
err
=
os
.
WriteFile
(
configFile
,
configJson
,
os
.
ModePerm
)
err
=
os
.
WriteFile
(
configFile
,
configJson
,
os
.
ModePerm
)
require
.
NoError
(
t
,
err
)
require
.
NoError
(
t
,
err
)
cfg
:=
configForArgs
(
t
,
addRequiredArgsExcept
(
"--network"
,
"--rollup.config"
,
configFile
))
cfg
:=
configForArgs
(
t
,
addRequiredArgsExcept
(
t
,
"--network"
,
"--rollup.config"
,
configFile
))
require
.
Equal
(
t
,
chaincfg
.
Goerli
,
*
cfg
.
Rollup
)
require
.
Equal
(
t
,
chaincfg
.
Goerli
,
*
cfg
.
Rollup
)
})
})
...
@@ -73,123 +81,136 @@ func TestNetwork(t *testing.T) {
...
@@ -73,123 +81,136 @@ func TestNetwork(t *testing.T) {
name
:=
name
name
:=
name
expected
:=
cfg
expected
:=
cfg
t
.
Run
(
"Network_"
+
name
,
func
(
t
*
testing
.
T
)
{
t
.
Run
(
"Network_"
+
name
,
func
(
t
*
testing
.
T
)
{
cfg
:=
configForArgs
(
t
,
replaceRequiredArg
(
"--network"
,
name
))
cfg
:=
configForArgs
(
t
,
replaceRequiredArg
(
t
,
"--network"
,
name
))
require
.
Equal
(
t
,
expected
,
*
cfg
.
Rollup
)
require
.
Equal
(
t
,
expected
,
*
cfg
.
Rollup
)
})
})
}
}
}
}
func
TestDataDir
(
t
*
testing
.
T
)
{
expected
:=
"/tmp/mainTestDataDir"
cfg
:=
configForArgs
(
t
,
addRequiredArgs
(
t
,
"--datadir"
,
expected
))
require
.
Equal
(
t
,
expected
,
cfg
.
DataDir
)
}
func
TestL2
(
t
*
testing
.
T
)
{
func
TestL2
(
t
*
testing
.
T
)
{
expected
:=
"https://example.com:8545"
expected
:=
"https://example.com:8545"
cfg
:=
configForArgs
(
t
,
addRequiredArgs
(
"--l2"
,
expected
))
cfg
:=
configForArgs
(
t
,
addRequiredArgs
(
t
,
"--l2"
,
expected
))
require
.
Equal
(
t
,
expected
,
cfg
.
L2URL
)
require
.
Equal
(
t
,
expected
,
cfg
.
L2URL
)
}
}
func
TestL2Genesis
(
t
*
testing
.
T
)
{
func
TestL2Genesis
(
t
*
testing
.
T
)
{
t
.
Run
(
"Required"
,
func
(
t
*
testing
.
T
)
{
t
.
Run
(
"Required"
,
func
(
t
*
testing
.
T
)
{
verifyArgsInvalid
(
t
,
"flag l2.genesis is required"
,
addRequiredArgsExcept
(
"--l2.genesis"
))
verifyArgsInvalid
(
t
,
"flag l2.genesis is required"
,
addRequiredArgsExcept
(
t
,
"--l2.genesis"
))
})
})
t
.
Run
(
"Valid"
,
func
(
t
*
testing
.
T
)
{
t
.
Run
(
"Valid"
,
func
(
t
*
testing
.
T
)
{
cfg
:=
configForArgs
(
t
,
replaceRequiredArg
(
"--l2.genesis"
,
"/tmp/genesis.json"
))
cfg
:=
configForArgs
(
t
,
replaceRequiredArg
(
t
,
"--l2.genesis"
,
writeValidGenesis
(
t
)
))
require
.
Equal
(
t
,
"/tmp/genesis.json"
,
cfg
.
L2GenesisPath
)
require
.
Equal
(
t
,
l2GenesisConfig
,
cfg
.
L2ChainConfig
)
})
})
}
}
func
TestL2Head
(
t
*
testing
.
T
)
{
func
TestL2Head
(
t
*
testing
.
T
)
{
t
.
Run
(
"Required"
,
func
(
t
*
testing
.
T
)
{
t
.
Run
(
"Required"
,
func
(
t
*
testing
.
T
)
{
verifyArgsInvalid
(
t
,
"flag l2.head is required"
,
addRequiredArgsExcept
(
"--l2.head"
))
verifyArgsInvalid
(
t
,
"flag l2.head is required"
,
addRequiredArgsExcept
(
t
,
"--l2.head"
))
})
})
t
.
Run
(
"Valid"
,
func
(
t
*
testing
.
T
)
{
t
.
Run
(
"Valid"
,
func
(
t
*
testing
.
T
)
{
cfg
:=
configForArgs
(
t
,
replaceRequiredArg
(
"--l2.head"
,
l2HeadValue
))
cfg
:=
configForArgs
(
t
,
replaceRequiredArg
(
t
,
"--l2.head"
,
l2HeadValue
))
require
.
Equal
(
t
,
common
.
HexToHash
(
l2HeadValue
),
cfg
.
L2Head
)
require
.
Equal
(
t
,
common
.
HexToHash
(
l2HeadValue
),
cfg
.
L2Head
)
})
})
t
.
Run
(
"Invalid"
,
func
(
t
*
testing
.
T
)
{
t
.
Run
(
"Invalid"
,
func
(
t
*
testing
.
T
)
{
verifyArgsInvalid
(
t
,
config
.
ErrInvalidL2Head
.
Error
(),
replaceRequiredArg
(
"--l2.head"
,
"something"
))
verifyArgsInvalid
(
t
,
config
.
ErrInvalidL2Head
.
Error
(),
replaceRequiredArg
(
t
,
"--l2.head"
,
"something"
))
})
})
}
}
func
TestL1Head
(
t
*
testing
.
T
)
{
func
TestL1Head
(
t
*
testing
.
T
)
{
t
.
Run
(
"Required"
,
func
(
t
*
testing
.
T
)
{
t
.
Run
(
"Required"
,
func
(
t
*
testing
.
T
)
{
verifyArgsInvalid
(
t
,
"flag l1.head is required"
,
addRequiredArgsExcept
(
"--l1.head"
))
verifyArgsInvalid
(
t
,
"flag l1.head is required"
,
addRequiredArgsExcept
(
t
,
"--l1.head"
))
})
})
t
.
Run
(
"Valid"
,
func
(
t
*
testing
.
T
)
{
t
.
Run
(
"Valid"
,
func
(
t
*
testing
.
T
)
{
cfg
:=
configForArgs
(
t
,
replaceRequiredArg
(
"--l1.head"
,
l1HeadValue
))
cfg
:=
configForArgs
(
t
,
replaceRequiredArg
(
t
,
"--l1.head"
,
l1HeadValue
))
require
.
Equal
(
t
,
common
.
HexToHash
(
l1HeadValue
),
cfg
.
L1Head
)
require
.
Equal
(
t
,
common
.
HexToHash
(
l1HeadValue
),
cfg
.
L1Head
)
})
})
t
.
Run
(
"Invalid"
,
func
(
t
*
testing
.
T
)
{
t
.
Run
(
"Invalid"
,
func
(
t
*
testing
.
T
)
{
verifyArgsInvalid
(
t
,
config
.
ErrInvalidL1Head
.
Error
(),
replaceRequiredArg
(
"--l1.head"
,
"something"
))
verifyArgsInvalid
(
t
,
config
.
ErrInvalidL1Head
.
Error
(),
replaceRequiredArg
(
t
,
"--l1.head"
,
"something"
))
})
})
}
}
func
TestL1
(
t
*
testing
.
T
)
{
func
TestL1
(
t
*
testing
.
T
)
{
expected
:=
"https://example.com:8545"
expected
:=
"https://example.com:8545"
cfg
:=
configForArgs
(
t
,
addRequiredArgs
(
"--l1"
,
expected
))
cfg
:=
configForArgs
(
t
,
addRequiredArgs
(
t
,
"--l1"
,
expected
))
require
.
Equal
(
t
,
expected
,
cfg
.
L1URL
)
require
.
Equal
(
t
,
expected
,
cfg
.
L1URL
)
}
}
func
TestL1TrustRPC
(
t
*
testing
.
T
)
{
func
TestL1TrustRPC
(
t
*
testing
.
T
)
{
t
.
Run
(
"DefaultFalse"
,
func
(
t
*
testing
.
T
)
{
t
.
Run
(
"DefaultFalse"
,
func
(
t
*
testing
.
T
)
{
cfg
:=
configForArgs
(
t
,
addRequiredArgs
())
cfg
:=
configForArgs
(
t
,
addRequiredArgs
(
t
))
require
.
False
(
t
,
cfg
.
L1TrustRPC
)
require
.
False
(
t
,
cfg
.
L1TrustRPC
)
})
})
t
.
Run
(
"Enabled"
,
func
(
t
*
testing
.
T
)
{
t
.
Run
(
"Enabled"
,
func
(
t
*
testing
.
T
)
{
cfg
:=
configForArgs
(
t
,
addRequiredArgs
(
"--l1.trustrpc"
))
cfg
:=
configForArgs
(
t
,
addRequiredArgs
(
t
,
"--l1.trustrpc"
))
require
.
True
(
t
,
cfg
.
L1TrustRPC
)
require
.
True
(
t
,
cfg
.
L1TrustRPC
)
})
})
t
.
Run
(
"EnabledWithArg"
,
func
(
t
*
testing
.
T
)
{
t
.
Run
(
"EnabledWithArg"
,
func
(
t
*
testing
.
T
)
{
cfg
:=
configForArgs
(
t
,
addRequiredArgs
(
"--l1.trustrpc=true"
))
cfg
:=
configForArgs
(
t
,
addRequiredArgs
(
t
,
"--l1.trustrpc=true"
))
require
.
True
(
t
,
cfg
.
L1TrustRPC
)
require
.
True
(
t
,
cfg
.
L1TrustRPC
)
})
})
t
.
Run
(
"Disabled"
,
func
(
t
*
testing
.
T
)
{
t
.
Run
(
"Disabled"
,
func
(
t
*
testing
.
T
)
{
cfg
:=
configForArgs
(
t
,
addRequiredArgs
(
"--l1.trustrpc=false"
))
cfg
:=
configForArgs
(
t
,
addRequiredArgs
(
t
,
"--l1.trustrpc=false"
))
require
.
False
(
t
,
cfg
.
L1TrustRPC
)
require
.
False
(
t
,
cfg
.
L1TrustRPC
)
})
})
}
}
func
TestL1RPCKind
(
t
*
testing
.
T
)
{
func
TestL1RPCKind
(
t
*
testing
.
T
)
{
t
.
Run
(
"DefaultBasic"
,
func
(
t
*
testing
.
T
)
{
t
.
Run
(
"DefaultBasic"
,
func
(
t
*
testing
.
T
)
{
cfg
:=
configForArgs
(
t
,
addRequiredArgs
())
cfg
:=
configForArgs
(
t
,
addRequiredArgs
(
t
))
require
.
Equal
(
t
,
sources
.
RPCKindBasic
,
cfg
.
L1RPCKind
)
require
.
Equal
(
t
,
sources
.
RPCKindBasic
,
cfg
.
L1RPCKind
)
})
})
for
_
,
kind
:=
range
sources
.
RPCProviderKinds
{
for
_
,
kind
:=
range
sources
.
RPCProviderKinds
{
t
.
Run
(
kind
.
String
(),
func
(
t
*
testing
.
T
)
{
t
.
Run
(
kind
.
String
(),
func
(
t
*
testing
.
T
)
{
cfg
:=
configForArgs
(
t
,
addRequiredArgs
(
"--l1.rpckind"
,
kind
.
String
()))
cfg
:=
configForArgs
(
t
,
addRequiredArgs
(
t
,
"--l1.rpckind"
,
kind
.
String
()))
require
.
Equal
(
t
,
kind
,
cfg
.
L1RPCKind
)
require
.
Equal
(
t
,
kind
,
cfg
.
L1RPCKind
)
})
})
}
}
t
.
Run
(
"RequireLowercase"
,
func
(
t
*
testing
.
T
)
{
t
.
Run
(
"RequireLowercase"
,
func
(
t
*
testing
.
T
)
{
verifyArgsInvalid
(
t
,
"rpc kind"
,
addRequiredArgs
(
"--l1.rpckind"
,
"AlChemY"
))
verifyArgsInvalid
(
t
,
"rpc kind"
,
addRequiredArgs
(
t
,
"--l1.rpckind"
,
"AlChemY"
))
})
})
t
.
Run
(
"UnknownKind"
,
func
(
t
*
testing
.
T
)
{
t
.
Run
(
"UnknownKind"
,
func
(
t
*
testing
.
T
)
{
verifyArgsInvalid
(
t
,
"
\"
foo
\"
"
,
addRequiredArgs
(
"--l1.rpckind"
,
"foo"
))
verifyArgsInvalid
(
t
,
"
\"
foo
\"
"
,
addRequiredArgs
(
t
,
"--l1.rpckind"
,
"foo"
))
})
})
}
}
// Offline support will be added later, but for now it just bails out with an error
func
TestOfflineModeNotSupported
(
t
*
testing
.
T
)
{
logger
:=
log
.
New
()
cfg
:=
config
.
NewConfig
(
&
chaincfg
.
Goerli
,
"genesis.json"
,
common
.
HexToHash
(
l1HeadValue
),
common
.
HexToHash
(
l2HeadValue
),
common
.
HexToHash
(
l2ClaimValue
))
err
:=
FaultProofProgram
(
logger
,
cfg
)
require
.
ErrorContains
(
t
,
err
,
"offline mode not supported"
)
}
func
TestL2Claim
(
t
*
testing
.
T
)
{
func
TestL2Claim
(
t
*
testing
.
T
)
{
t
.
Run
(
"Required"
,
func
(
t
*
testing
.
T
)
{
t
.
Run
(
"Required"
,
func
(
t
*
testing
.
T
)
{
verifyArgsInvalid
(
t
,
"flag l2.claim is required"
,
addRequiredArgsExcept
(
"--l2.claim"
))
verifyArgsInvalid
(
t
,
"flag l2.claim is required"
,
addRequiredArgsExcept
(
t
,
"--l2.claim"
))
})
})
t
.
Run
(
"Valid"
,
func
(
t
*
testing
.
T
)
{
t
.
Run
(
"Valid"
,
func
(
t
*
testing
.
T
)
{
cfg
:=
configForArgs
(
t
,
replaceRequiredArg
(
"--l2.claim"
,
l2ClaimValue
))
cfg
:=
configForArgs
(
t
,
replaceRequiredArg
(
t
,
"--l2.claim"
,
l2ClaimValue
))
require
.
EqualValues
(
t
,
common
.
HexToHash
(
l2ClaimValue
),
cfg
.
L2Claim
)
require
.
EqualValues
(
t
,
common
.
HexToHash
(
l2ClaimValue
),
cfg
.
L2Claim
)
})
})
t
.
Run
(
"Invalid"
,
func
(
t
*
testing
.
T
)
{
t
.
Run
(
"Invalid"
,
func
(
t
*
testing
.
T
)
{
verifyArgsInvalid
(
t
,
config
.
ErrInvalidL2Claim
.
Error
(),
replaceRequiredArg
(
"--l2.claim"
,
"something"
))
verifyArgsInvalid
(
t
,
config
.
ErrInvalidL2Claim
.
Error
(),
replaceRequiredArg
(
t
,
"--l2.claim"
,
"something"
))
})
}
func
TestL2BlockNumber
(
t
*
testing
.
T
)
{
t
.
Run
(
"Required"
,
func
(
t
*
testing
.
T
)
{
verifyArgsInvalid
(
t
,
"flag l2.blocknumber is required"
,
addRequiredArgsExcept
(
t
,
"--l2.blocknumber"
))
})
t
.
Run
(
"Valid"
,
func
(
t
*
testing
.
T
)
{
cfg
:=
configForArgs
(
t
,
replaceRequiredArg
(
t
,
"--l2.blocknumber"
,
strconv
.
FormatUint
(
l2ClaimBlockNumber
,
10
)))
require
.
EqualValues
(
t
,
l2ClaimBlockNumber
,
cfg
.
L2ClaimBlockNumber
)
})
t
.
Run
(
"Invalid"
,
func
(
t
*
testing
.
T
)
{
verifyArgsInvalid
(
t
,
"invalid value
\"
something
\"
for flag -l2.blocknumber"
,
replaceRequiredArg
(
t
,
"--l2.blocknumber"
,
"something"
))
})
})
}
}
...
@@ -205,7 +226,7 @@ func configForArgs(t *testing.T, cliArgs []string) *config.Config {
...
@@ -205,7 +226,7 @@ func configForArgs(t *testing.T, cliArgs []string) *config.Config {
}
}
func
runWithArgs
(
cliArgs
[]
string
)
(
log
.
Logger
,
*
config
.
Config
,
error
)
{
func
runWithArgs
(
cliArgs
[]
string
)
(
log
.
Logger
,
*
config
.
Config
,
error
)
{
var
cfg
*
config
.
Config
cfg
:=
new
(
config
.
Config
)
var
logger
log
.
Logger
var
logger
log
.
Logger
fullArgs
:=
append
([]
string
{
"op-program"
},
cliArgs
...
)
fullArgs
:=
append
([]
string
{
"op-program"
},
cliArgs
...
)
err
:=
run
(
fullArgs
,
func
(
log
log
.
Logger
,
config
*
config
.
Config
)
error
{
err
:=
run
(
fullArgs
,
func
(
log
log
.
Logger
,
config
*
config
.
Config
)
error
{
...
@@ -216,36 +237,47 @@ func runWithArgs(cliArgs []string) (log.Logger, *config.Config, error) {
...
@@ -216,36 +237,47 @@ func runWithArgs(cliArgs []string) (log.Logger, *config.Config, error) {
return
logger
,
cfg
,
err
return
logger
,
cfg
,
err
}
}
func
addRequiredArgs
(
args
...
string
)
[]
string
{
func
addRequiredArgs
(
t
*
testing
.
T
,
args
...
string
)
[]
string
{
req
:=
requiredArgs
()
req
:=
requiredArgs
(
t
)
combined
:=
toArgList
(
req
)
combined
:=
toArgList
(
req
)
return
append
(
combined
,
args
...
)
return
append
(
combined
,
args
...
)
}
}
func
addRequiredArgsExcept
(
name
string
,
optionalArgs
...
string
)
[]
string
{
func
addRequiredArgsExcept
(
t
*
testing
.
T
,
name
string
,
optionalArgs
...
string
)
[]
string
{
req
:=
requiredArgs
()
req
:=
requiredArgs
(
t
)
delete
(
req
,
name
)
delete
(
req
,
name
)
return
append
(
toArgList
(
req
),
optionalArgs
...
)
return
append
(
toArgList
(
req
),
optionalArgs
...
)
}
}
func
replaceRequiredArg
(
name
string
,
value
string
)
[]
string
{
func
replaceRequiredArg
(
t
*
testing
.
T
,
name
string
,
value
string
)
[]
string
{
req
:=
requiredArgs
()
req
:=
requiredArgs
(
t
)
req
[
name
]
=
value
req
[
name
]
=
value
return
toArgList
(
req
)
return
toArgList
(
req
)
}
}
// requiredArgs returns map of argument names to values which are the minimal arguments required
// requiredArgs returns map of argument names to values which are the minimal arguments required
// to create a valid Config
// to create a valid Config
func
requiredArgs
()
map
[
string
]
string
{
func
requiredArgs
(
t
*
testing
.
T
)
map
[
string
]
string
{
genesisFile
:=
writeValidGenesis
(
t
)
return
map
[
string
]
string
{
return
map
[
string
]
string
{
"--network"
:
"goerli"
,
"--network"
:
"goerli"
,
"--l1.head"
:
l1HeadValue
,
"--l1.head"
:
l1HeadValue
,
"--l2.head"
:
l2HeadValue
,
"--l2.head"
:
l2HeadValue
,
"--l2.claim"
:
l2ClaimValue
,
"--l2.claim"
:
l2ClaimValue
,
"--l2.genesis"
:
"genesis.json"
,
"--l2.blocknumber"
:
strconv
.
FormatUint
(
l2ClaimBlockNumber
,
10
),
"--l2.genesis"
:
genesisFile
,
}
}
}
}
func
writeValidGenesis
(
t
*
testing
.
T
)
string
{
dir
:=
t
.
TempDir
()
j
,
err
:=
json
.
Marshal
(
l2Genesis
)
require
.
NoError
(
t
,
err
)
genesisFile
:=
dir
+
"/genesis.json"
require
.
NoError
(
t
,
os
.
WriteFile
(
genesisFile
,
j
,
0666
))
return
genesisFile
}
func
toArgList
(
req
map
[
string
]
string
)
[]
string
{
func
toArgList
(
req
map
[
string
]
string
)
[]
string
{
var
combined
[]
string
var
combined
[]
string
for
name
,
value
:=
range
req
{
for
name
,
value
:=
range
req
{
...
...
op-program/host/config/config.go
View file @
707d8735
package
config
package
config
import
(
import
(
"encoding/json"
"errors"
"errors"
"fmt"
"os"
opnode
"github.com/ethereum-optimism/optimism/op-node"
opnode
"github.com/ethereum-optimism/optimism/op-node"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum-optimism/optimism/op-program/host/flags"
"github.com/ethereum-optimism/optimism/op-program/host/flags"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/params"
"github.com/urfave/cli"
"github.com/urfave/cli"
)
)
...
@@ -18,18 +23,32 @@ var (
...
@@ -18,18 +23,32 @@ var (
ErrInvalidL2Head
=
errors
.
New
(
"invalid l2 head"
)
ErrInvalidL2Head
=
errors
.
New
(
"invalid l2 head"
)
ErrL1AndL2Inconsistent
=
errors
.
New
(
"l1 and l2 options must be specified together or both omitted"
)
ErrL1AndL2Inconsistent
=
errors
.
New
(
"l1 and l2 options must be specified together or both omitted"
)
ErrInvalidL2Claim
=
errors
.
New
(
"invalid l2 claim"
)
ErrInvalidL2Claim
=
errors
.
New
(
"invalid l2 claim"
)
ErrInvalidL2ClaimBlock
=
errors
.
New
(
"invalid l2 claim block number"
)
ErrDataDirRequired
=
errors
.
New
(
"datadir must be specified when in non-fetching mode"
)
)
)
type
Config
struct
{
type
Config
struct
{
Rollup
*
rollup
.
Config
Rollup
*
rollup
.
Config
L2URL
string
// DataDir is the directory to read/write pre-image data from/to.
L2GenesisPath
string
//If not set, an in-memory key-value store is used and fetching data must be enabled
L1Head
common
.
Hash
DataDir
string
L2Head
common
.
Hash
L2Claim
common
.
Hash
// L1Head is the block has of the L1 chain head block
L1URL
string
L1Head
common
.
Hash
L1TrustRPC
bool
L1URL
string
L1RPCKind
sources
.
RPCProviderKind
L1TrustRPC
bool
L1RPCKind
sources
.
RPCProviderKind
// L2Head is the agreed L2 block to start derivation from
L2Head
common
.
Hash
L2URL
string
// L2Claim is the claimed L2 output root to verify
L2Claim
common
.
Hash
// L2ClaimBlockNumber is the block number the claimed L2 output root is from
// Must be above 0 and to be a valid claim needs to be above the L2Head block.
L2ClaimBlockNumber
uint64
// L2ChainConfig is the op-geth chain config for the L2 execution engine
L2ChainConfig
*
params
.
ChainConfig
}
}
func
(
c
*
Config
)
Check
()
error
{
func
(
c
*
Config
)
Check
()
error
{
...
@@ -48,12 +67,18 @@ func (c *Config) Check() error {
...
@@ -48,12 +67,18 @@ func (c *Config) Check() error {
if
c
.
L2Claim
==
(
common
.
Hash
{})
{
if
c
.
L2Claim
==
(
common
.
Hash
{})
{
return
ErrInvalidL2Claim
return
ErrInvalidL2Claim
}
}
if
c
.
L2GenesisPath
==
""
{
if
c
.
L2ClaimBlockNumber
==
0
{
return
ErrInvalidL2ClaimBlock
}
if
c
.
L2ChainConfig
==
nil
{
return
ErrMissingL2Genesis
return
ErrMissingL2Genesis
}
}
if
(
c
.
L1URL
!=
""
)
!=
(
c
.
L2URL
!=
""
)
{
if
(
c
.
L1URL
!=
""
)
!=
(
c
.
L2URL
!=
""
)
{
return
ErrL1AndL2Inconsistent
return
ErrL1AndL2Inconsistent
}
}
if
!
c
.
FetchingEnabled
()
&&
c
.
DataDir
==
""
{
return
ErrDataDirRequired
}
return
nil
return
nil
}
}
...
@@ -62,14 +87,15 @@ func (c *Config) FetchingEnabled() bool {
...
@@ -62,14 +87,15 @@ func (c *Config) FetchingEnabled() bool {
}
}
// NewConfig creates a Config with all optional values set to the CLI default value
// NewConfig creates a Config with all optional values set to the CLI default value
func
NewConfig
(
rollupCfg
*
rollup
.
Config
,
l2Genesis
Path
string
,
l1Head
common
.
Hash
,
l2Head
common
.
Hash
,
l2Claim
common
.
Hash
)
*
Config
{
func
NewConfig
(
rollupCfg
*
rollup
.
Config
,
l2Genesis
*
params
.
ChainConfig
,
l1Head
common
.
Hash
,
l2Head
common
.
Hash
,
l2Claim
common
.
Hash
,
l2ClaimBlockNum
uint64
)
*
Config
{
return
&
Config
{
return
&
Config
{
Rollup
:
rollupCfg
,
Rollup
:
rollupCfg
,
L2GenesisPath
:
l2GenesisPath
,
L2ChainConfig
:
l2Genesis
,
L1Head
:
l1Head
,
L1Head
:
l1Head
,
L2Head
:
l2Head
,
L2Head
:
l2Head
,
L2Claim
:
l2Claim
,
L2Claim
:
l2Claim
,
L1RPCKind
:
sources
.
RPCKindBasic
,
L2ClaimBlockNumber
:
l2ClaimBlockNum
,
L1RPCKind
:
sources
.
RPCKindBasic
,
}
}
}
}
...
@@ -89,19 +115,40 @@ func NewConfigFromCLI(ctx *cli.Context) (*Config, error) {
...
@@ -89,19 +115,40 @@ func NewConfigFromCLI(ctx *cli.Context) (*Config, error) {
if
l2Claim
==
(
common
.
Hash
{})
{
if
l2Claim
==
(
common
.
Hash
{})
{
return
nil
,
ErrInvalidL2Claim
return
nil
,
ErrInvalidL2Claim
}
}
l2ClaimBlockNum
:=
ctx
.
GlobalUint64
(
flags
.
L2BlockNumber
.
Name
)
l1Head
:=
common
.
HexToHash
(
ctx
.
GlobalString
(
flags
.
L1Head
.
Name
))
l1Head
:=
common
.
HexToHash
(
ctx
.
GlobalString
(
flags
.
L1Head
.
Name
))
if
l1Head
==
(
common
.
Hash
{})
{
if
l1Head
==
(
common
.
Hash
{})
{
return
nil
,
ErrInvalidL1Head
return
nil
,
ErrInvalidL1Head
}
}
l2GenesisPath
:=
ctx
.
GlobalString
(
flags
.
L2GenesisPath
.
Name
)
l2ChainConfig
,
err
:=
loadChainConfigFromGenesis
(
l2GenesisPath
)
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"invalid genesis: %w"
,
err
)
}
return
&
Config
{
return
&
Config
{
Rollup
:
rollupCfg
,
Rollup
:
rollupCfg
,
L2URL
:
ctx
.
GlobalString
(
flags
.
L2NodeAddr
.
Name
),
DataDir
:
ctx
.
GlobalString
(
flags
.
DataDir
.
Name
),
L2GenesisPath
:
ctx
.
GlobalString
(
flags
.
L2GenesisPath
.
Name
),
L2URL
:
ctx
.
GlobalString
(
flags
.
L2NodeAddr
.
Name
),
L2Head
:
l2Head
,
L2ChainConfig
:
l2ChainConfig
,
L2Claim
:
l2Claim
,
L2Head
:
l2Head
,
L1Head
:
l1Head
,
L2Claim
:
l2Claim
,
L1URL
:
ctx
.
GlobalString
(
flags
.
L1NodeAddr
.
Name
),
L2ClaimBlockNumber
:
l2ClaimBlockNum
,
L1TrustRPC
:
ctx
.
GlobalBool
(
flags
.
L1TrustRPC
.
Name
),
L1Head
:
l1Head
,
L1RPCKind
:
sources
.
RPCProviderKind
(
ctx
.
GlobalString
(
flags
.
L1RPCProviderKind
.
Name
)),
L1URL
:
ctx
.
GlobalString
(
flags
.
L1NodeAddr
.
Name
),
L1TrustRPC
:
ctx
.
GlobalBool
(
flags
.
L1TrustRPC
.
Name
),
L1RPCKind
:
sources
.
RPCProviderKind
(
ctx
.
GlobalString
(
flags
.
L1RPCProviderKind
.
Name
)),
},
nil
},
nil
}
}
func
loadChainConfigFromGenesis
(
path
string
)
(
*
params
.
ChainConfig
,
error
)
{
data
,
err
:=
os
.
ReadFile
(
path
)
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"read l2 genesis file: %w"
,
err
)
}
var
genesis
core
.
Genesis
err
=
json
.
Unmarshal
(
data
,
&
genesis
)
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"parse l2 genesis file: %w"
,
err
)
}
return
genesis
.
Config
,
nil
}
op-program/host/config/config_test.go
View file @
707d8735
...
@@ -6,16 +6,21 @@ import (
...
@@ -6,16 +6,21 @@ import (
"github.com/ethereum-optimism/optimism/op-node/chaincfg"
"github.com/ethereum-optimism/optimism/op-node/chaincfg"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/params"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
)
)
var
validRollupConfig
=
&
chaincfg
.
Goerli
var
(
var
validL2GenesisPath
=
"genesis.json"
validRollupConfig
=
&
chaincfg
.
Goerli
var
validL1Head
=
common
.
Hash
{
0xaa
}
validL2Genesis
=
params
.
GoerliChainConfig
var
validL2Head
=
common
.
Hash
{
0xbb
}
validL1Head
=
common
.
Hash
{
0xaa
}
var
validL2Claim
=
common
.
Hash
{
0xcc
}
validL2Head
=
common
.
Hash
{
0xbb
}
validL2Claim
=
common
.
Hash
{
0xcc
}
validL2ClaimBlockNum
=
uint64
(
15
)
)
func
TestDefaultConfigIsValid
(
t
*
testing
.
T
)
{
// TestValidConfigIsValid checks that the config provided by validConfig is actually valid
func
TestValidConfigIsValid
(
t
*
testing
.
T
)
{
err
:=
validConfig
()
.
Check
()
err
:=
validConfig
()
.
Check
()
require
.
NoError
(
t
,
err
)
require
.
NoError
(
t
,
err
)
}
}
...
@@ -57,9 +62,16 @@ func TestL2ClaimRequired(t *testing.T) {
...
@@ -57,9 +62,16 @@ func TestL2ClaimRequired(t *testing.T) {
require
.
ErrorIs
(
t
,
err
,
ErrInvalidL2Claim
)
require
.
ErrorIs
(
t
,
err
,
ErrInvalidL2Claim
)
}
}
func
TestL2ClaimBlockNumberRequired
(
t
*
testing
.
T
)
{
config
:=
validConfig
()
config
.
L2ClaimBlockNumber
=
0
err
:=
config
.
Check
()
require
.
ErrorIs
(
t
,
err
,
ErrInvalidL2ClaimBlock
)
}
func
TestL2GenesisRequired
(
t
*
testing
.
T
)
{
func
TestL2GenesisRequired
(
t
*
testing
.
T
)
{
config
:=
validConfig
()
config
:=
validConfig
()
config
.
L2
GenesisPath
=
""
config
.
L2
ChainConfig
=
nil
err
:=
config
.
Check
()
err
:=
config
.
Check
()
require
.
ErrorIs
(
t
,
err
,
ErrMissingL2Genesis
)
require
.
ErrorIs
(
t
,
err
,
ErrMissingL2Genesis
)
}
}
...
@@ -121,6 +133,17 @@ func TestFetchingEnabled(t *testing.T) {
...
@@ -121,6 +133,17 @@ func TestFetchingEnabled(t *testing.T) {
})
})
}
}
func
TestRequireDataDirInNonFetchingMode
(
t
*
testing
.
T
)
{
cfg
:=
validConfig
()
cfg
.
DataDir
=
""
cfg
.
L1URL
=
""
cfg
.
L2URL
=
""
err
:=
cfg
.
Check
()
require
.
ErrorIs
(
t
,
err
,
ErrDataDirRequired
)
}
func
validConfig
()
*
Config
{
func
validConfig
()
*
Config
{
return
NewConfig
(
validRollupConfig
,
validL2GenesisPath
,
validL1Head
,
validL2Head
,
validL2Claim
)
cfg
:=
NewConfig
(
validRollupConfig
,
validL2Genesis
,
validL1Head
,
validL2Head
,
validL2Claim
,
validL2ClaimBlockNum
)
cfg
.
DataDir
=
"/tmp/configTest"
return
cfg
}
}
op-program/host/flags/flags.go
View file @
707d8735
...
@@ -26,6 +26,11 @@ var (
...
@@ -26,6 +26,11 @@ var (
Usage
:
fmt
.
Sprintf
(
"Predefined network selection. Available networks: %s"
,
strings
.
Join
(
chaincfg
.
AvailableNetworks
(),
", "
)),
Usage
:
fmt
.
Sprintf
(
"Predefined network selection. Available networks: %s"
,
strings
.
Join
(
chaincfg
.
AvailableNetworks
(),
", "
)),
EnvVar
:
service
.
PrefixEnvVar
(
envVarPrefix
,
"NETWORK"
),
EnvVar
:
service
.
PrefixEnvVar
(
envVarPrefix
,
"NETWORK"
),
}
}
DataDir
=
cli
.
StringFlag
{
Name
:
"datadir"
,
Usage
:
"Directory to use for preimage data storage. Default uses in-memory storage"
,
EnvVar
:
service
.
PrefixEnvVar
(
envVarPrefix
,
"DATADIR"
),
}
L2NodeAddr
=
cli
.
StringFlag
{
L2NodeAddr
=
cli
.
StringFlag
{
Name
:
"l2"
,
Name
:
"l2"
,
Usage
:
"Address of L2 JSON-RPC endpoint to use (eth and debug namespace required)"
,
Usage
:
"Address of L2 JSON-RPC endpoint to use (eth and debug namespace required)"
,
...
@@ -46,6 +51,11 @@ var (
...
@@ -46,6 +51,11 @@ var (
Usage
:
"Claimed L2 output root to validate"
,
Usage
:
"Claimed L2 output root to validate"
,
EnvVar
:
service
.
PrefixEnvVar
(
envVarPrefix
,
"L2_CLAIM"
),
EnvVar
:
service
.
PrefixEnvVar
(
envVarPrefix
,
"L2_CLAIM"
),
}
}
L2BlockNumber
=
cli
.
Uint64Flag
{
Name
:
"l2.blocknumber"
,
Usage
:
"Number of the L2 block that the claim is from"
,
EnvVar
:
service
.
PrefixEnvVar
(
envVarPrefix
,
"L2_BLOCK_NUM"
),
}
L2GenesisPath
=
cli
.
StringFlag
{
L2GenesisPath
=
cli
.
StringFlag
{
Name
:
"l2.genesis"
,
Name
:
"l2.genesis"
,
Usage
:
"Path to the op-geth genesis file"
,
Usage
:
"Path to the op-geth genesis file"
,
...
@@ -80,11 +90,13 @@ var requiredFlags = []cli.Flag{
...
@@ -80,11 +90,13 @@ var requiredFlags = []cli.Flag{
L1Head
,
L1Head
,
L2Head
,
L2Head
,
L2Claim
,
L2Claim
,
L2BlockNumber
,
L2GenesisPath
,
L2GenesisPath
,
}
}
var
programFlags
=
[]
cli
.
Flag
{
var
programFlags
=
[]
cli
.
Flag
{
RollupConfig
,
RollupConfig
,
Network
,
Network
,
DataDir
,
L2NodeAddr
,
L2NodeAddr
,
L1NodeAddr
,
L1NodeAddr
,
L1TrustRPC
,
L1TrustRPC
,
...
@@ -107,7 +119,7 @@ func CheckRequired(ctx *cli.Context) error {
...
@@ -107,7 +119,7 @@ func CheckRequired(ctx *cli.Context) error {
return
fmt
.
Errorf
(
"cannot specify both %s and %s"
,
RollupConfig
.
Name
,
Network
.
Name
)
return
fmt
.
Errorf
(
"cannot specify both %s and %s"
,
RollupConfig
.
Name
,
Network
.
Name
)
}
}
for
_
,
flag
:=
range
requiredFlags
{
for
_
,
flag
:=
range
requiredFlags
{
if
ctx
.
GlobalString
(
flag
.
GetName
())
==
""
{
if
!
ctx
.
IsSet
(
flag
.
GetName
())
{
return
fmt
.
Errorf
(
"flag %s is required"
,
flag
.
GetName
())
return
fmt
.
Errorf
(
"flag %s is required"
,
flag
.
GetName
())
}
}
}
}
...
...
op-program/host/host.go
0 → 100644
View file @
707d8735
package
host
import
(
"context"
"errors"
"fmt"
"io"
"os"
"github.com/ethereum-optimism/optimism/op-node/chaincfg"
"github.com/ethereum-optimism/optimism/op-node/client"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/sources"
cldr
"github.com/ethereum-optimism/optimism/op-program/client/driver"
"github.com/ethereum-optimism/optimism/op-program/host/config"
"github.com/ethereum-optimism/optimism/op-program/host/kvstore"
"github.com/ethereum-optimism/optimism/op-program/host/l1"
"github.com/ethereum-optimism/optimism/op-program/host/l2"
"github.com/ethereum-optimism/optimism/op-program/host/prefetcher"
"github.com/ethereum-optimism/optimism/op-program/preimage"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
)
var
(
ErrClaimNotValid
=
errors
.
New
(
"invalid claim"
)
)
type
L2Source
struct
{
*
sources
.
L2Client
*
sources
.
DebugClient
}
// FaultProofProgram is the programmatic entry-point for the fault proof program
func
FaultProofProgram
(
logger
log
.
Logger
,
cfg
*
config
.
Config
)
error
{
if
err
:=
cfg
.
Check
();
err
!=
nil
{
return
fmt
.
Errorf
(
"invalid config: %w"
,
err
)
}
cfg
.
Rollup
.
LogDescription
(
logger
,
chaincfg
.
L2ChainIDToNetworkName
)
ctx
:=
context
.
Background
()
var
kv
kvstore
.
KV
if
cfg
.
DataDir
==
""
{
logger
.
Info
(
"Using in-memory storage"
)
kv
=
kvstore
.
NewMemKV
()
}
else
{
logger
.
Info
(
"Creating disk storage"
,
"datadir"
,
cfg
.
DataDir
)
if
err
:=
os
.
MkdirAll
(
cfg
.
DataDir
,
0755
);
err
!=
nil
{
return
fmt
.
Errorf
(
"creating datadir: %w"
,
err
)
}
kv
=
kvstore
.
NewDiskKV
(
cfg
.
DataDir
)
}
var
preimageOracle
preimage
.
OracleFn
var
hinter
preimage
.
HinterFn
if
cfg
.
FetchingEnabled
()
{
logger
.
Info
(
"Connecting to L1 node"
,
"l1"
,
cfg
.
L1URL
)
l1RPC
,
err
:=
client
.
NewRPC
(
ctx
,
logger
,
cfg
.
L1URL
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to setup L1 RPC: %w"
,
err
)
}
logger
.
Info
(
"Connecting to L2 node"
,
"l2"
,
cfg
.
L2URL
)
l2RPC
,
err
:=
client
.
NewRPC
(
ctx
,
logger
,
cfg
.
L2URL
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to setup L2 RPC: %w"
,
err
)
}
l1ClCfg
:=
sources
.
L1ClientDefaultConfig
(
cfg
.
Rollup
,
cfg
.
L1TrustRPC
,
cfg
.
L1RPCKind
)
l2ClCfg
:=
sources
.
L2ClientDefaultConfig
(
cfg
.
Rollup
,
true
)
l1Cl
,
err
:=
sources
.
NewL1Client
(
l1RPC
,
logger
,
nil
,
l1ClCfg
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to create L1 client: %w"
,
err
)
}
l2Cl
,
err
:=
sources
.
NewL2Client
(
l2RPC
,
logger
,
nil
,
l2ClCfg
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to create L2 client: %w"
,
err
)
}
l2DebugCl
:=
&
L2Source
{
L2Client
:
l2Cl
,
DebugClient
:
sources
.
NewDebugClient
(
l2RPC
.
CallContext
)}
logger
.
Info
(
"Setting up pre-fetcher"
)
prefetch
:=
prefetcher
.
NewPrefetcher
(
l1Cl
,
l2DebugCl
,
kv
)
preimageOracle
=
asOracleFn
(
func
(
key
common
.
Hash
)
([]
byte
,
error
)
{
return
prefetch
.
GetPreimage
(
ctx
,
key
)
})
hinter
=
asHinter
(
prefetch
.
Hint
)
}
else
{
logger
.
Info
(
"Using offline mode. All required pre-images must be pre-populated."
)
preimageOracle
=
asOracleFn
(
kv
.
Get
)
hinter
=
func
(
v
preimage
.
Hint
)
{
logger
.
Debug
(
"ignoring prefetch hint"
,
"hint"
,
v
)
}
}
l1Source
:=
l1
.
NewSource
(
logger
,
preimageOracle
,
hinter
,
cfg
.
L1Head
)
l2Source
,
err
:=
l2
.
NewEngine
(
logger
,
preimageOracle
,
hinter
,
cfg
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"connect l2 oracle: %w"
,
err
)
}
logger
.
Info
(
"Starting derivation"
)
d
:=
cldr
.
NewDriver
(
logger
,
cfg
.
Rollup
,
l1Source
,
l2Source
,
cfg
.
L2ClaimBlockNumber
)
for
{
if
err
=
d
.
Step
(
ctx
);
errors
.
Is
(
err
,
io
.
EOF
)
{
break
}
else
if
err
!=
nil
{
return
err
}
}
if
!
d
.
ValidateClaim
(
eth
.
Bytes32
(
cfg
.
L2Claim
))
{
return
ErrClaimNotValid
}
return
nil
}
func
asOracleFn
(
getter
func
(
key
common
.
Hash
)
([]
byte
,
error
))
preimage
.
OracleFn
{
return
func
(
key
preimage
.
Key
)
[]
byte
{
pre
,
err
:=
getter
(
key
.
PreimageKey
())
if
err
!=
nil
{
panic
(
fmt
.
Errorf
(
"preimage unavailable for key %v: %w"
,
key
,
err
))
}
return
pre
}
}
func
asHinter
(
hint
func
(
hint
string
)
error
)
preimage
.
HinterFn
{
return
func
(
v
preimage
.
Hint
)
{
err
:=
hint
(
v
.
Hint
())
if
err
!=
nil
{
panic
(
fmt
.
Errorf
(
"hint rejected %v: %w"
,
v
,
err
))
}
}
}
op-program/host/l1/l1.go
View file @
707d8735
...
@@ -8,10 +8,12 @@ import (
...
@@ -8,10 +8,12 @@ import (
"github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum-optimism/optimism/op-node/sources"
cll1
"github.com/ethereum-optimism/optimism/op-program/client/l1"
cll1
"github.com/ethereum-optimism/optimism/op-program/client/l1"
"github.com/ethereum-optimism/optimism/op-program/host/config"
"github.com/ethereum-optimism/optimism/op-program/host/config"
"github.com/ethereum-optimism/optimism/op-program/preimage"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
)
)
func
NewFetching
L1
(
ctx
context
.
Context
,
logger
log
.
Logger
,
cfg
*
config
.
Config
)
(
derive
.
L1Fetcher
,
error
)
{
func
NewFetching
Oracle
(
ctx
context
.
Context
,
logger
log
.
Logger
,
cfg
*
config
.
Config
)
(
cll1
.
Oracle
,
error
)
{
rpc
,
err
:=
client
.
NewRPC
(
ctx
,
logger
,
cfg
.
L1URL
)
rpc
,
err
:=
client
.
NewRPC
(
ctx
,
logger
,
cfg
.
L1URL
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
...
@@ -21,6 +23,10 @@ func NewFetchingL1(ctx context.Context, logger log.Logger, cfg *config.Config) (
...
@@ -21,6 +23,10 @@ func NewFetchingL1(ctx context.Context, logger log.Logger, cfg *config.Config) (
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
oracle
:=
cll1
.
NewCachingOracle
(
NewFetchingL1Oracle
(
ctx
,
logger
,
source
))
return
NewFetchingL1Oracle
(
ctx
,
logger
,
source
),
nil
return
cll1
.
NewOracleL1Client
(
logger
,
oracle
,
cfg
.
L1Head
),
err
}
func
NewSource
(
logger
log
.
Logger
,
oracle
preimage
.
Oracle
,
hint
preimage
.
Hinter
,
l1Head
common
.
Hash
)
derive
.
L1Fetcher
{
l1Oracle
:=
cll1
.
NewCachingOracle
(
cll1
.
NewPreimageOracle
(
oracle
,
hint
))
return
cll1
.
NewOracleL1Client
(
logger
,
l1Oracle
,
l1Head
)
}
}
op-program/host/l2/l2.go
View file @
707d8735
...
@@ -2,44 +2,27 @@ package l2
...
@@ -2,44 +2,27 @@ package l2
import
(
import
(
"context"
"context"
"encoding/json"
"fmt"
"fmt"
"os"
cll2
"github.com/ethereum-optimism/optimism/op-program/client/l2"
cll2
"github.com/ethereum-optimism/optimism/op-program/client/l2"
"github.com/ethereum-optimism/optimism/op-program/host/config"
"github.com/ethereum-optimism/optimism/op-program/host/config"
"github.com/ethereum
/go-ethereum/cor
e"
"github.com/ethereum
-optimism/optimism/op-program/preimag
e"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/params"
)
)
func
NewFetchingEngine
(
ctx
context
.
Context
,
logger
log
.
Logger
,
cfg
*
config
.
Config
)
(
*
cll2
.
OracleEngine
,
error
)
{
func
NewEngine
(
logger
log
.
Logger
,
pre
preimage
.
Oracle
,
hint
preimage
.
Hinter
,
cfg
*
config
.
Config
)
(
*
cll2
.
OracleEngine
,
error
)
{
genesis
,
err
:=
loadL2Genesis
(
cfg
)
oracle
:=
cll2
.
NewCachingOracle
(
cll2
.
NewPreimageOracle
(
pre
,
hint
))
if
err
!=
nil
{
engineBackend
,
err
:=
cll2
.
NewOracleBackedL2Chain
(
logger
,
oracle
,
cfg
.
L2ChainConfig
,
cfg
.
L2Head
)
return
nil
,
err
}
fetcher
,
err
:=
NewFetchingL2Oracle
(
ctx
,
logger
,
cfg
.
L2URL
,
cfg
.
L2Head
)
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"connect l2 oracle: %w"
,
err
)
}
oracle
:=
cll2
.
NewCachingOracle
(
fetcher
)
engineBackend
,
err
:=
cll2
.
NewOracleBackedL2Chain
(
logger
,
oracle
,
genesis
,
cfg
.
L2Head
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"create l2 chain: %w"
,
err
)
return
nil
,
fmt
.
Errorf
(
"create l2 chain: %w"
,
err
)
}
}
return
cll2
.
NewOracleEngine
(
cfg
.
Rollup
,
logger
,
engineBackend
),
nil
return
cll2
.
NewOracleEngine
(
cfg
.
Rollup
,
logger
,
engineBackend
),
nil
}
}
func
loadL2Genesis
(
cfg
*
config
.
Config
)
(
*
params
.
ChainConfig
,
error
)
{
func
NewFetchingOracle
(
ctx
context
.
Context
,
logger
log
.
Logger
,
cfg
*
config
.
Config
)
(
cll2
.
Oracle
,
error
)
{
data
,
err
:=
os
.
ReadFile
(
cfg
.
L2GenesisPath
)
oracle
,
err
:=
NewFetchingL2Oracle
(
ctx
,
logger
,
cfg
.
L2URL
,
cfg
.
L2Head
)
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"read l2 genesis file: %w"
,
err
)
}
var
genesis
core
.
Genesis
err
=
json
.
Unmarshal
(
data
,
&
genesis
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"
parse l2 genesis fi
le: %w"
,
err
)
return
nil
,
fmt
.
Errorf
(
"
connect l2 orac
le: %w"
,
err
)
}
}
return
genesis
.
Config
,
nil
return
oracle
,
nil
}
}
op-program/host/prefetcher/prefetcher.go
0 → 100644
View file @
707d8735
package
prefetcher
import
(
"context"
"errors"
"fmt"
"strings"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-program/client/l1"
"github.com/ethereum-optimism/optimism/op-program/client/l2"
"github.com/ethereum-optimism/optimism/op-program/client/mpt"
"github.com/ethereum-optimism/optimism/op-program/host/kvstore"
"github.com/ethereum-optimism/optimism/op-program/preimage"
)
type
L1Source
interface
{
InfoByHash
(
ctx
context
.
Context
,
blockHash
common
.
Hash
)
(
eth
.
BlockInfo
,
error
)
InfoAndTxsByHash
(
ctx
context
.
Context
,
blockHash
common
.
Hash
)
(
eth
.
BlockInfo
,
types
.
Transactions
,
error
)
FetchReceipts
(
ctx
context
.
Context
,
blockHash
common
.
Hash
)
(
eth
.
BlockInfo
,
types
.
Receipts
,
error
)
}
type
L2Source
interface
{
InfoAndTxsByHash
(
ctx
context
.
Context
,
blockHash
common
.
Hash
)
(
eth
.
BlockInfo
,
types
.
Transactions
,
error
)
NodeByHash
(
ctx
context
.
Context
,
hash
common
.
Hash
)
([]
byte
,
error
)
CodeByHash
(
ctx
context
.
Context
,
hash
common
.
Hash
)
([]
byte
,
error
)
}
type
Prefetcher
struct
{
l1Fetcher
L1Source
l2Fetcher
L2Source
lastHint
string
kvStore
kvstore
.
KV
}
func
NewPrefetcher
(
l1Fetcher
L1Source
,
l2Fetcher
L2Source
,
kvStore
kvstore
.
KV
)
*
Prefetcher
{
return
&
Prefetcher
{
l1Fetcher
:
l1Fetcher
,
l2Fetcher
:
l2Fetcher
,
kvStore
:
kvStore
,
}
}
func
(
p
*
Prefetcher
)
Hint
(
hint
string
)
error
{
p
.
lastHint
=
hint
return
nil
}
func
(
p
*
Prefetcher
)
GetPreimage
(
ctx
context
.
Context
,
key
common
.
Hash
)
([]
byte
,
error
)
{
pre
,
err
:=
p
.
kvStore
.
Get
(
key
)
if
errors
.
Is
(
err
,
kvstore
.
ErrNotFound
)
&&
p
.
lastHint
!=
""
{
hint
:=
p
.
lastHint
p
.
lastHint
=
""
if
err
:=
p
.
prefetch
(
ctx
,
hint
);
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"prefetch failed: %w"
,
err
)
}
// Should now be available
return
p
.
kvStore
.
Get
(
key
)
}
return
pre
,
err
}
func
(
p
*
Prefetcher
)
prefetch
(
ctx
context
.
Context
,
hint
string
)
error
{
hintType
,
hash
,
err
:=
parseHint
(
hint
)
if
err
!=
nil
{
return
err
}
switch
hintType
{
case
l1
.
HintL1BlockHeader
:
header
,
err
:=
p
.
l1Fetcher
.
InfoByHash
(
ctx
,
hash
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to fetch L1 block %s header: %w"
,
hash
,
err
)
}
data
,
err
:=
header
.
HeaderRLP
()
if
err
!=
nil
{
return
fmt
.
Errorf
(
"marshall header: %w"
,
err
)
}
return
p
.
kvStore
.
Put
(
preimage
.
Keccak256Key
(
hash
)
.
PreimageKey
(),
data
)
case
l1
.
HintL1Transactions
:
_
,
txs
,
err
:=
p
.
l1Fetcher
.
InfoAndTxsByHash
(
ctx
,
hash
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to fetch L1 block %s txs: %w"
,
hash
,
err
)
}
return
p
.
storeTransactions
(
txs
)
case
l1
.
HintL1Receipts
:
_
,
receipts
,
err
:=
p
.
l1Fetcher
.
FetchReceipts
(
ctx
,
hash
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to fetch L1 block %s receipts: %w"
,
hash
,
err
)
}
return
p
.
storeReceipts
(
receipts
)
case
l2
.
HintL2BlockHeader
:
header
,
txs
,
err
:=
p
.
l2Fetcher
.
InfoAndTxsByHash
(
ctx
,
hash
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to fetch L2 block %s: %w"
,
hash
,
err
)
}
data
,
err
:=
header
.
HeaderRLP
()
if
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to encode header to RLP: %w"
,
err
)
}
err
=
p
.
kvStore
.
Put
(
preimage
.
Keccak256Key
(
hash
)
.
PreimageKey
(),
data
)
if
err
!=
nil
{
return
err
}
return
p
.
storeTransactions
(
txs
)
case
l2
.
HintL2StateNode
:
node
,
err
:=
p
.
l2Fetcher
.
NodeByHash
(
ctx
,
hash
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to fetch L2 state node %s: %w"
,
hash
,
err
)
}
return
p
.
kvStore
.
Put
(
preimage
.
Keccak256Key
(
hash
)
.
PreimageKey
(),
node
)
case
l2
.
HintL2Code
:
code
,
err
:=
p
.
l2Fetcher
.
CodeByHash
(
ctx
,
hash
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to fetch L2 contract code %s: %w"
,
hash
,
err
)
}
return
p
.
kvStore
.
Put
(
preimage
.
Keccak256Key
(
hash
)
.
PreimageKey
(),
code
)
}
return
fmt
.
Errorf
(
"unknown hint type: %v"
,
hintType
)
}
func
(
p
*
Prefetcher
)
storeReceipts
(
receipts
types
.
Receipts
)
error
{
opaqueReceipts
,
err
:=
eth
.
EncodeReceipts
(
receipts
)
if
err
!=
nil
{
return
err
}
return
p
.
storeTrieNodes
(
opaqueReceipts
)
}
func
(
p
*
Prefetcher
)
storeTransactions
(
txs
types
.
Transactions
)
error
{
opaqueTxs
,
err
:=
eth
.
EncodeTransactions
(
txs
)
if
err
!=
nil
{
return
err
}
return
p
.
storeTrieNodes
(
opaqueTxs
)
}
func
(
p
*
Prefetcher
)
storeTrieNodes
(
values
[]
hexutil
.
Bytes
)
error
{
_
,
nodes
:=
mpt
.
WriteTrie
(
values
)
for
_
,
node
:=
range
nodes
{
err
:=
p
.
kvStore
.
Put
(
preimage
.
Keccak256Key
(
crypto
.
Keccak256Hash
(
node
))
.
PreimageKey
(),
node
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to store node: %w"
,
err
)
}
}
return
nil
}
// parseHint parses a hint string in wire protocol. Returns the hint type, requested hash and error (if any).
func
parseHint
(
hint
string
)
(
string
,
common
.
Hash
,
error
)
{
hintType
,
hashStr
,
found
:=
strings
.
Cut
(
hint
,
" "
)
if
!
found
{
return
""
,
common
.
Hash
{},
fmt
.
Errorf
(
"unsupported hint: %s"
,
hint
)
}
hash
:=
common
.
HexToHash
(
hashStr
)
if
hash
==
(
common
.
Hash
{})
{
return
""
,
common
.
Hash
{},
fmt
.
Errorf
(
"invalid hash: %s"
,
hashStr
)
}
return
hintType
,
hash
,
nil
}
op-program/host/prefetcher/prefetcher_test.go
0 → 100644
View file @
707d8735
package
prefetcher
import
(
"context"
"math/rand"
"testing"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/rlp"
"github.com/stretchr/testify/require"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum-optimism/optimism/op-program/client/l1"
"github.com/ethereum-optimism/optimism/op-program/client/l2"
"github.com/ethereum-optimism/optimism/op-program/client/mpt"
"github.com/ethereum-optimism/optimism/op-program/host/kvstore"
"github.com/ethereum-optimism/optimism/op-program/preimage"
)
func
TestNoHint
(
t
*
testing
.
T
)
{
t
.
Run
(
"NotFound"
,
func
(
t
*
testing
.
T
)
{
prefetcher
,
_
,
_
,
_
:=
createPrefetcher
(
t
)
res
,
err
:=
prefetcher
.
GetPreimage
(
context
.
Background
(),
common
.
Hash
{
0xab
})
require
.
ErrorIs
(
t
,
err
,
kvstore
.
ErrNotFound
)
require
.
Nil
(
t
,
res
)
})
t
.
Run
(
"Exists"
,
func
(
t
*
testing
.
T
)
{
prefetcher
,
_
,
_
,
kv
:=
createPrefetcher
(
t
)
data
:=
[]
byte
{
1
,
2
,
3
}
hash
:=
crypto
.
Keccak256Hash
(
data
)
require
.
NoError
(
t
,
kv
.
Put
(
hash
,
data
))
res
,
err
:=
prefetcher
.
GetPreimage
(
context
.
Background
(),
hash
)
require
.
NoError
(
t
,
err
)
require
.
Equal
(
t
,
res
,
data
)
})
}
func
TestFetchL1BlockHeader
(
t
*
testing
.
T
)
{
rng
:=
rand
.
New
(
rand
.
NewSource
(
123
))
block
,
rcpts
:=
testutils
.
RandomBlock
(
rng
,
2
)
hash
:=
block
.
Hash
()
key
:=
preimage
.
Keccak256Key
(
hash
)
.
PreimageKey
()
pre
,
err
:=
rlp
.
EncodeToBytes
(
block
.
Header
())
require
.
NoError
(
t
,
err
)
t
.
Run
(
"AlreadyKnown"
,
func
(
t
*
testing
.
T
)
{
prefetcher
,
_
,
_
,
kv
:=
createPrefetcher
(
t
)
storeBlock
(
t
,
kv
,
block
,
rcpts
)
oracle
:=
l1
.
NewPreimageOracle
(
asOracleFn
(
t
,
prefetcher
),
asHinter
(
t
,
prefetcher
))
result
:=
oracle
.
HeaderByBlockHash
(
hash
)
require
.
Equal
(
t
,
eth
.
HeaderBlockInfo
(
block
.
Header
()),
result
)
})
t
.
Run
(
"Unknown"
,
func
(
t
*
testing
.
T
)
{
prefetcher
,
l1Cl
,
_
,
_
:=
createPrefetcher
(
t
)
l1Cl
.
ExpectInfoByHash
(
hash
,
eth
.
HeaderBlockInfo
(
block
.
Header
()),
nil
)
defer
l1Cl
.
AssertExpectations
(
t
)
require
.
NoError
(
t
,
prefetcher
.
Hint
(
l1
.
BlockHeaderHint
(
hash
)
.
Hint
()))
result
,
err
:=
prefetcher
.
GetPreimage
(
context
.
Background
(),
key
)
require
.
NoError
(
t
,
err
)
require
.
Equal
(
t
,
pre
,
result
)
})
}
func
TestFetchL1Transactions
(
t
*
testing
.
T
)
{
rng
:=
rand
.
New
(
rand
.
NewSource
(
123
))
block
,
rcpts
:=
testutils
.
RandomBlock
(
rng
,
10
)
hash
:=
block
.
Hash
()
t
.
Run
(
"AlreadyKnown"
,
func
(
t
*
testing
.
T
)
{
prefetcher
,
_
,
_
,
kv
:=
createPrefetcher
(
t
)
storeBlock
(
t
,
kv
,
block
,
rcpts
)
// Check the data is available (note the oracle does not know about the block, only the kvstore does)
oracle
:=
l1
.
NewPreimageOracle
(
asOracleFn
(
t
,
prefetcher
),
asHinter
(
t
,
prefetcher
))
header
,
txs
:=
oracle
.
TransactionsByBlockHash
(
hash
)
require
.
EqualValues
(
t
,
hash
,
header
.
Hash
())
assertTransactionsEqual
(
t
,
block
.
Transactions
(),
txs
)
})
t
.
Run
(
"Unknown"
,
func
(
t
*
testing
.
T
)
{
prefetcher
,
l1Cl
,
_
,
_
:=
createPrefetcher
(
t
)
l1Cl
.
ExpectInfoByHash
(
hash
,
eth
.
BlockToInfo
(
block
),
nil
)
l1Cl
.
ExpectInfoAndTxsByHash
(
hash
,
eth
.
BlockToInfo
(
block
),
block
.
Transactions
(),
nil
)
defer
l1Cl
.
AssertExpectations
(
t
)
oracle
:=
l1
.
NewPreimageOracle
(
asOracleFn
(
t
,
prefetcher
),
asHinter
(
t
,
prefetcher
))
header
,
txs
:=
oracle
.
TransactionsByBlockHash
(
hash
)
require
.
EqualValues
(
t
,
hash
,
header
.
Hash
())
assertTransactionsEqual
(
t
,
block
.
Transactions
(),
txs
)
})
}
func
TestFetchL1Receipts
(
t
*
testing
.
T
)
{
rng
:=
rand
.
New
(
rand
.
NewSource
(
123
))
block
,
receipts
:=
testutils
.
RandomBlock
(
rng
,
10
)
hash
:=
block
.
Hash
()
t
.
Run
(
"AlreadyKnown"
,
func
(
t
*
testing
.
T
)
{
prefetcher
,
_
,
_
,
kv
:=
createPrefetcher
(
t
)
storeBlock
(
t
,
kv
,
block
,
receipts
)
// Check the data is available (note the oracle does not know about the block, only the kvstore does)
oracle
:=
l1
.
NewPreimageOracle
(
asOracleFn
(
t
,
prefetcher
),
asHinter
(
t
,
prefetcher
))
header
,
actualReceipts
:=
oracle
.
ReceiptsByBlockHash
(
hash
)
require
.
EqualValues
(
t
,
hash
,
header
.
Hash
())
assertReceiptsEqual
(
t
,
receipts
,
actualReceipts
)
})
t
.
Run
(
"Unknown"
,
func
(
t
*
testing
.
T
)
{
prefetcher
,
l1Cl
,
_
,
_
:=
createPrefetcher
(
t
)
l1Cl
.
ExpectInfoByHash
(
hash
,
eth
.
BlockToInfo
(
block
),
nil
)
l1Cl
.
ExpectInfoAndTxsByHash
(
hash
,
eth
.
BlockToInfo
(
block
),
block
.
Transactions
(),
nil
)
l1Cl
.
ExpectFetchReceipts
(
hash
,
eth
.
BlockToInfo
(
block
),
receipts
,
nil
)
defer
l1Cl
.
AssertExpectations
(
t
)
oracle
:=
l1
.
NewPreimageOracle
(
asOracleFn
(
t
,
prefetcher
),
asHinter
(
t
,
prefetcher
))
header
,
actualReceipts
:=
oracle
.
ReceiptsByBlockHash
(
hash
)
require
.
EqualValues
(
t
,
hash
,
header
.
Hash
())
assertReceiptsEqual
(
t
,
receipts
,
actualReceipts
)
})
}
func
TestFetchL2Block
(
t
*
testing
.
T
)
{
rng
:=
rand
.
New
(
rand
.
NewSource
(
123
))
block
,
rcpts
:=
testutils
.
RandomBlock
(
rng
,
10
)
hash
:=
block
.
Hash
()
t
.
Run
(
"AlreadyKnown"
,
func
(
t
*
testing
.
T
)
{
prefetcher
,
_
,
_
,
kv
:=
createPrefetcher
(
t
)
storeBlock
(
t
,
kv
,
block
,
rcpts
)
oracle
:=
l2
.
NewPreimageOracle
(
asOracleFn
(
t
,
prefetcher
),
asHinter
(
t
,
prefetcher
))
result
:=
oracle
.
BlockByHash
(
hash
)
require
.
EqualValues
(
t
,
block
.
Header
(),
result
.
Header
())
assertTransactionsEqual
(
t
,
block
.
Transactions
(),
result
.
Transactions
())
})
t
.
Run
(
"Unknown"
,
func
(
t
*
testing
.
T
)
{
prefetcher
,
_
,
l2Cl
,
_
:=
createPrefetcher
(
t
)
l2Cl
.
ExpectInfoAndTxsByHash
(
hash
,
eth
.
BlockToInfo
(
block
),
block
.
Transactions
(),
nil
)
defer
l2Cl
.
MockL2Client
.
AssertExpectations
(
t
)
oracle
:=
l2
.
NewPreimageOracle
(
asOracleFn
(
t
,
prefetcher
),
asHinter
(
t
,
prefetcher
))
result
:=
oracle
.
BlockByHash
(
hash
)
require
.
EqualValues
(
t
,
block
.
Header
(),
result
.
Header
())
assertTransactionsEqual
(
t
,
block
.
Transactions
(),
result
.
Transactions
())
})
}
func
TestFetchL2Node
(
t
*
testing
.
T
)
{
rng
:=
rand
.
New
(
rand
.
NewSource
(
123
))
node
:=
testutils
.
RandomData
(
rng
,
30
)
hash
:=
crypto
.
Keccak256Hash
(
node
)
key
:=
preimage
.
Keccak256Key
(
hash
)
.
PreimageKey
()
t
.
Run
(
"AlreadyKnown"
,
func
(
t
*
testing
.
T
)
{
prefetcher
,
_
,
_
,
kv
:=
createPrefetcher
(
t
)
require
.
NoError
(
t
,
kv
.
Put
(
key
,
node
))
oracle
:=
l2
.
NewPreimageOracle
(
asOracleFn
(
t
,
prefetcher
),
asHinter
(
t
,
prefetcher
))
result
:=
oracle
.
NodeByHash
(
hash
)
require
.
EqualValues
(
t
,
node
,
result
)
})
t
.
Run
(
"Unknown"
,
func
(
t
*
testing
.
T
)
{
prefetcher
,
_
,
l2Cl
,
_
:=
createPrefetcher
(
t
)
l2Cl
.
ExpectNodeByHash
(
hash
,
node
,
nil
)
defer
l2Cl
.
MockDebugClient
.
AssertExpectations
(
t
)
oracle
:=
l2
.
NewPreimageOracle
(
asOracleFn
(
t
,
prefetcher
),
asHinter
(
t
,
prefetcher
))
result
:=
oracle
.
NodeByHash
(
hash
)
require
.
EqualValues
(
t
,
node
,
result
)
})
}
func
TestFetchL2Code
(
t
*
testing
.
T
)
{
rng
:=
rand
.
New
(
rand
.
NewSource
(
123
))
code
:=
testutils
.
RandomData
(
rng
,
30
)
hash
:=
crypto
.
Keccak256Hash
(
code
)
key
:=
preimage
.
Keccak256Key
(
hash
)
.
PreimageKey
()
t
.
Run
(
"AlreadyKnown"
,
func
(
t
*
testing
.
T
)
{
prefetcher
,
_
,
_
,
kv
:=
createPrefetcher
(
t
)
require
.
NoError
(
t
,
kv
.
Put
(
key
,
code
))
oracle
:=
l2
.
NewPreimageOracle
(
asOracleFn
(
t
,
prefetcher
),
asHinter
(
t
,
prefetcher
))
result
:=
oracle
.
CodeByHash
(
hash
)
require
.
EqualValues
(
t
,
code
,
result
)
})
t
.
Run
(
"Unknown"
,
func
(
t
*
testing
.
T
)
{
prefetcher
,
_
,
l2Cl
,
_
:=
createPrefetcher
(
t
)
l2Cl
.
ExpectCodeByHash
(
hash
,
code
,
nil
)
defer
l2Cl
.
MockDebugClient
.
AssertExpectations
(
t
)
oracle
:=
l2
.
NewPreimageOracle
(
asOracleFn
(
t
,
prefetcher
),
asHinter
(
t
,
prefetcher
))
result
:=
oracle
.
CodeByHash
(
hash
)
require
.
EqualValues
(
t
,
code
,
result
)
})
}
func
TestBadHints
(
t
*
testing
.
T
)
{
prefetcher
,
_
,
_
,
kv
:=
createPrefetcher
(
t
)
hash
:=
common
.
Hash
{
0xad
}
t
.
Run
(
"NoSpace"
,
func
(
t
*
testing
.
T
)
{
// Accept the hint
require
.
NoError
(
t
,
prefetcher
.
Hint
(
l1
.
HintL1BlockHeader
))
// But it will fail to prefetch when the pre-image isn't available
pre
,
err
:=
prefetcher
.
GetPreimage
(
context
.
Background
(),
hash
)
require
.
ErrorContains
(
t
,
err
,
"unsupported hint"
)
require
.
Nil
(
t
,
pre
)
})
t
.
Run
(
"InvalidHash"
,
func
(
t
*
testing
.
T
)
{
// Accept the hint
require
.
NoError
(
t
,
prefetcher
.
Hint
(
l1
.
HintL1BlockHeader
+
" asdfsadf"
))
// But it will fail to prefetch when the pre-image isn't available
pre
,
err
:=
prefetcher
.
GetPreimage
(
context
.
Background
(),
hash
)
require
.
ErrorContains
(
t
,
err
,
"invalid hash"
)
require
.
Nil
(
t
,
pre
)
})
t
.
Run
(
"UnknownType"
,
func
(
t
*
testing
.
T
)
{
// Accept the hint
require
.
NoError
(
t
,
prefetcher
.
Hint
(
"unknown "
+
hash
.
Hex
()))
// But it will fail to prefetch when the pre-image isn't available
pre
,
err
:=
prefetcher
.
GetPreimage
(
context
.
Background
(),
hash
)
require
.
ErrorContains
(
t
,
err
,
"unknown hint type"
)
require
.
Nil
(
t
,
pre
)
})
// Should not return hint errors if the preimage is already available
t
.
Run
(
"KeyExists"
,
func
(
t
*
testing
.
T
)
{
// Prepopulate the requested preimage
value
:=
[]
byte
{
1
,
2
,
3
,
4
}
require
.
NoError
(
t
,
kv
.
Put
(
hash
,
value
))
// Hint is invalid
require
.
NoError
(
t
,
prefetcher
.
Hint
(
"asdfsadf"
))
// But fetching the key fails because prefetching isn't required
pre
,
err
:=
prefetcher
.
GetPreimage
(
context
.
Background
(),
hash
)
require
.
NoError
(
t
,
err
)
require
.
Equal
(
t
,
value
,
pre
)
})
}
type
l2Client
struct
{
*
testutils
.
MockL2Client
*
testutils
.
MockDebugClient
}
func
createPrefetcher
(
t
*
testing
.
T
)
(
*
Prefetcher
,
*
testutils
.
MockL1Source
,
*
l2Client
,
kvstore
.
KV
)
{
kv
:=
kvstore
.
NewMemKV
()
l1Source
:=
new
(
testutils
.
MockL1Source
)
l2Source
:=
&
l2Client
{
MockL2Client
:
new
(
testutils
.
MockL2Client
),
MockDebugClient
:
new
(
testutils
.
MockDebugClient
),
}
prefetcher
:=
NewPrefetcher
(
l1Source
,
l2Source
,
kv
)
return
prefetcher
,
l1Source
,
l2Source
,
kv
}
func
storeBlock
(
t
*
testing
.
T
,
kv
kvstore
.
KV
,
block
*
types
.
Block
,
receipts
types
.
Receipts
)
{
// Pre-store receipts
opaqueRcpts
,
err
:=
eth
.
EncodeReceipts
(
receipts
)
require
.
NoError
(
t
,
err
)
_
,
nodes
:=
mpt
.
WriteTrie
(
opaqueRcpts
)
for
_
,
p
:=
range
nodes
{
require
.
NoError
(
t
,
kv
.
Put
(
preimage
.
Keccak256Key
(
crypto
.
Keccak256Hash
(
p
))
.
PreimageKey
(),
p
))
}
// Pre-store transactions
opaqueTxs
,
err
:=
eth
.
EncodeTransactions
(
block
.
Transactions
())
require
.
NoError
(
t
,
err
)
_
,
txsNodes
:=
mpt
.
WriteTrie
(
opaqueTxs
)
for
_
,
p
:=
range
txsNodes
{
require
.
NoError
(
t
,
kv
.
Put
(
preimage
.
Keccak256Key
(
crypto
.
Keccak256Hash
(
p
))
.
PreimageKey
(),
p
))
}
// Pre-store block
headerRlp
,
err
:=
rlp
.
EncodeToBytes
(
block
.
Header
())
require
.
NoError
(
t
,
err
)
require
.
NoError
(
t
,
kv
.
Put
(
preimage
.
Keccak256Key
(
block
.
Hash
())
.
PreimageKey
(),
headerRlp
))
}
func
asOracleFn
(
t
*
testing
.
T
,
prefetcher
*
Prefetcher
)
preimage
.
OracleFn
{
return
func
(
key
preimage
.
Key
)
[]
byte
{
pre
,
err
:=
prefetcher
.
GetPreimage
(
context
.
Background
(),
key
.
PreimageKey
())
require
.
NoError
(
t
,
err
)
return
pre
}
}
func
asHinter
(
t
*
testing
.
T
,
prefetcher
*
Prefetcher
)
preimage
.
HinterFn
{
return
func
(
v
preimage
.
Hint
)
{
err
:=
prefetcher
.
Hint
(
v
.
Hint
())
require
.
NoError
(
t
,
err
)
}
}
func
assertTransactionsEqual
(
t
*
testing
.
T
,
blockTx
types
.
Transactions
,
txs
types
.
Transactions
)
{
require
.
Equal
(
t
,
len
(
blockTx
),
len
(
txs
))
for
i
,
tx
:=
range
txs
{
require
.
Equal
(
t
,
blockTx
[
i
]
.
Hash
(),
tx
.
Hash
())
}
}
func
assertReceiptsEqual
(
t
*
testing
.
T
,
expectedRcpt
types
.
Receipts
,
actualRcpt
types
.
Receipts
)
{
require
.
Equal
(
t
,
len
(
expectedRcpt
),
len
(
actualRcpt
))
for
i
,
rcpt
:=
range
actualRcpt
{
// Make a copy of each to zero out fields we expect to be different
expected
:=
*
expectedRcpt
[
i
]
actual
:=
*
rcpt
expected
.
ContractAddress
=
common
.
Address
{}
actual
.
ContractAddress
=
common
.
Address
{}
require
.
Equal
(
t
,
expected
,
actual
)
}
}
op-program/preimage/hints.go
View file @
707d8735
...
@@ -55,6 +55,8 @@ func (hr *HintReader) NextHint(router func(hint string) error) error {
...
@@ -55,6 +55,8 @@ func (hr *HintReader) NextHint(router func(hint string) error) error {
}
}
}
}
if
err
:=
router
(
string
(
payload
));
err
!=
nil
{
if
err
:=
router
(
string
(
payload
));
err
!=
nil
{
// stream recovery
_
,
_
=
hr
.
r
.
Read
([]
byte
{
0
})
return
fmt
.
Errorf
(
"failed to handle hint: %w"
,
err
)
return
fmt
.
Errorf
(
"failed to handle hint: %w"
,
err
)
}
}
if
_
,
err
:=
hr
.
r
.
Read
([]
byte
{
0
});
err
!=
nil
{
if
_
,
err
:=
hr
.
r
.
Read
([]
byte
{
0
});
err
!=
nil
{
...
...
op-program/preimage/hints_test.go
View file @
707d8735
...
@@ -3,6 +3,7 @@ package preimage
...
@@ -3,6 +3,7 @@ package preimage
import
(
import
(
"bytes"
"bytes"
"crypto/rand"
"crypto/rand"
"errors"
"io"
"io"
"testing"
"testing"
...
@@ -71,4 +72,21 @@ func TestHints(t *testing.T) {
...
@@ -71,4 +72,21 @@ func TestHints(t *testing.T) {
err
:=
hr
.
NextHint
(
func
(
hint
string
)
error
{
return
nil
})
err
:=
hr
.
NextHint
(
func
(
hint
string
)
error
{
return
nil
})
require
.
ErrorIs
(
t
,
err
,
io
.
ErrUnexpectedEOF
)
require
.
ErrorIs
(
t
,
err
,
io
.
ErrUnexpectedEOF
)
})
})
t
.
Run
(
"cb error"
,
func
(
t
*
testing
.
T
)
{
var
buf
bytes
.
Buffer
hw
:=
NewHintWriter
(
&
buf
)
hw
.
Hint
(
rawHint
(
"one"
))
hw
.
Hint
(
rawHint
(
"two"
))
hr
:=
NewHintReader
(
&
buf
)
cbErr
:=
errors
.
New
(
"fail"
)
err
:=
hr
.
NextHint
(
func
(
hint
string
)
error
{
return
cbErr
})
require
.
ErrorIs
(
t
,
err
,
cbErr
)
var
readHint
string
err
=
hr
.
NextHint
(
func
(
hint
string
)
error
{
readHint
=
hint
return
nil
})
require
.
NoError
(
t
,
err
)
require
.
Equal
(
t
,
readHint
,
"two"
)
})
}
}
ops/docker/ci-builder/package.json
deleted
100644 → 0
View file @
a26c484a
{
"name"
:
"@eth-optimism/ci-builder"
,
"version"
:
"0.5.0"
,
"scripts"
:
{},
"license"
:
"MIT"
,
"dependencies"
:
{}
}
package.json
View file @
707d8735
...
@@ -16,7 +16,6 @@
...
@@ -16,7 +16,6 @@
"ops/docker/hardhat"
,
"ops/docker/hardhat"
,
"ops/docker/go-builder"
,
"ops/docker/go-builder"
,
"ops/docker/js-builder"
,
"ops/docker/js-builder"
,
"ops/docker/ci-builder"
,
"ops/docker/foundry"
,
"ops/docker/foundry"
,
"endpoint-monitor"
"endpoint-monitor"
],
],
...
...
packages/contracts-bedrock/.gas-snapshot
View file @
707d8735
...
@@ -7,14 +7,14 @@ Bytes_toNibbles_Test:test_toNibbles_expectedResult5Bytes_works() (gas: 6132)
...
@@ -7,14 +7,14 @@ Bytes_toNibbles_Test:test_toNibbles_expectedResult5Bytes_works() (gas: 6132)
Bytes_toNibbles_Test:test_toNibbles_zeroLengthInput_works() (gas: 944)
Bytes_toNibbles_Test:test_toNibbles_zeroLengthInput_works() (gas: 944)
CrossDomainMessenger_BaseGas_Test:test_baseGas_succeeds() (gas: 20097)
CrossDomainMessenger_BaseGas_Test:test_baseGas_succeeds() (gas: 20097)
CrossDomainOwnable2_Test:test_onlyOwner_notMessenger_reverts() (gas: 8416)
CrossDomainOwnable2_Test:test_onlyOwner_notMessenger_reverts() (gas: 8416)
CrossDomainOwnable2_Test:test_onlyOwner_notOwner2_reverts() (gas:
61872
)
CrossDomainOwnable2_Test:test_onlyOwner_notOwner2_reverts() (gas:
57254
)
CrossDomainOwnable2_Test:test_onlyOwner_notOwner_reverts() (gas: 16566)
CrossDomainOwnable2_Test:test_onlyOwner_notOwner_reverts() (gas: 16566)
CrossDomainOwnable2_Test:test_onlyOwner_succeeds() (gas: 7
5933
)
CrossDomainOwnable2_Test:test_onlyOwner_succeeds() (gas: 7
3282
)
CrossDomainOwnable3_Test:test_constructor_succeeds() (gas: 10554)
CrossDomainOwnable3_Test:test_constructor_succeeds() (gas: 10554)
CrossDomainOwnable3_Test:test_crossDomainOnlyOwner_notMessenger_reverts() (gas: 28334)
CrossDomainOwnable3_Test:test_crossDomainOnlyOwner_notMessenger_reverts() (gas: 28334)
CrossDomainOwnable3_Test:test_crossDomainOnlyOwner_notOwner2_reverts() (gas: 7
6381
)
CrossDomainOwnable3_Test:test_crossDomainOnlyOwner_notOwner2_reverts() (gas: 7
3730
)
CrossDomainOwnable3_Test:test_crossDomainOnlyOwner_notOwner_reverts() (gas: 31978)
CrossDomainOwnable3_Test:test_crossDomainOnlyOwner_notOwner_reverts() (gas: 31978)
CrossDomainOwnable3_Test:test_crossDomainTransferOwnership_succeeds() (gas: 9
3938
)
CrossDomainOwnable3_Test:test_crossDomainTransferOwnership_succeeds() (gas: 9
1287
)
CrossDomainOwnable3_Test:test_localOnlyOwner_notOwner_reverts() (gas: 13193)
CrossDomainOwnable3_Test:test_localOnlyOwner_notOwner_reverts() (gas: 13193)
CrossDomainOwnable3_Test:test_localOnlyOwner_succeeds() (gas: 35220)
CrossDomainOwnable3_Test:test_localOnlyOwner_succeeds() (gas: 35220)
CrossDomainOwnable3_Test:test_localTransferOwnership_succeeds() (gas: 52128)
CrossDomainOwnable3_Test:test_localTransferOwnership_succeeds() (gas: 52128)
...
@@ -70,20 +70,18 @@ L1BlockTest:test_timestamp_succeeds() (gas: 7640)
...
@@ -70,20 +70,18 @@ L1BlockTest:test_timestamp_succeeds() (gas: 7640)
L1BlockTest:test_updateValues_succeeds() (gas: 60482)
L1BlockTest:test_updateValues_succeeds() (gas: 60482)
L1CrossDomainMessenger_Test:test_messageVersion_succeeds() (gas: 24715)
L1CrossDomainMessenger_Test:test_messageVersion_succeeds() (gas: 24715)
L1CrossDomainMessenger_Test:test_relayMessage_legacyOldReplay_reverts() (gas: 49394)
L1CrossDomainMessenger_Test:test_relayMessage_legacyOldReplay_reverts() (gas: 49394)
L1CrossDomainMessenger_Test:test_relayMessage_legacyRetryAfterFailureThenSuccess_reverts() (gas: 232952)
L1CrossDomainMessenger_Test:test_relayMessage_legacyRetryAfterFailureThenSuccess_reverts() (gas: 209286)
L1CrossDomainMessenger_Test:test_relayMessage_legacyRetryAfterFailure_succeeds() (gas: 206446)
L1CrossDomainMessenger_Test:test_relayMessage_legacyRetryAfterFailure_succeeds() (gas: 203184)
L1CrossDomainMessenger_Test:test_relayMessage_legacyRetryAfterSuccess_reverts() (gas: 146819)
L1CrossDomainMessenger_Test:test_relayMessage_legacyRetryAfterSuccess_reverts() (gas: 123784)
L1CrossDomainMessenger_Test:test_relayMessage_legacy_succeeds() (gas: 79729)
L1CrossDomainMessenger_Test:test_relayMessage_legacy_succeeds() (gas: 77098)
L1CrossDomainMessenger_Test:test_relayMessage_reentrancyDiffMessage_succeeds() (gas: 725335)
L1CrossDomainMessenger_Test:test_relayMessage_retryAfterFailure_succeeds() (gas: 197091)
L1CrossDomainMessenger_Test:test_relayMessage_reentrancySameMessage_reverts() (gas: 662298)
L1CrossDomainMessenger_Test:test_relayMessage_succeeds() (gas: 74034)
L1CrossDomainMessenger_Test:test_relayMessage_retryAfterFailure_succeeds() (gas: 200353)
L1CrossDomainMessenger_Test:test_relayMessage_toSystemContract_reverts() (gas: 56540)
L1CrossDomainMessenger_Test:test_relayMessage_succeeds() (gas: 76665)
L1CrossDomainMessenger_Test:test_relayMessage_toSystemContract_reverts() (gas: 101282)
L1CrossDomainMessenger_Test:test_relayMessage_v2_reverts() (gas: 12365)
L1CrossDomainMessenger_Test:test_relayMessage_v2_reverts() (gas: 12365)
L1CrossDomainMessenger_Test:test_replayMessage_withValue_reverts() (gas:
53445
)
L1CrossDomainMessenger_Test:test_replayMessage_withValue_reverts() (gas:
31063
)
L1CrossDomainMessenger_Test:test_sendMessage_succeeds() (gas: 304740)
L1CrossDomainMessenger_Test:test_sendMessage_succeeds() (gas: 304740)
L1CrossDomainMessenger_Test:test_sendMessage_twice_succeeds() (gas: 1496124)
L1CrossDomainMessenger_Test:test_sendMessage_twice_succeeds() (gas: 1496124)
L1CrossDomainMessenger_Test:test_xDomainMessageSender_reset_succeeds() (gas: 8
7194
)
L1CrossDomainMessenger_Test:test_xDomainMessageSender_reset_succeeds() (gas: 8
4563
)
L1CrossDomainMessenger_Test:test_xDomainSender_notSet_reverts() (gas: 24296)
L1CrossDomainMessenger_Test:test_xDomainSender_notSet_reverts() (gas: 24296)
L1ERC721Bridge_Test:test_bridgeERC721To_localTokenZeroAddress_reverts() (gas: 52707)
L1ERC721Bridge_Test:test_bridgeERC721To_localTokenZeroAddress_reverts() (gas: 52707)
L1ERC721Bridge_Test:test_bridgeERC721To_remoteTokenZeroAddress_reverts() (gas: 27310)
L1ERC721Bridge_Test:test_bridgeERC721To_remoteTokenZeroAddress_reverts() (gas: 27310)
...
@@ -120,15 +118,13 @@ L1StandardBridge_Getter_Test:test_getters_succeeds() (gas: 32173)
...
@@ -120,15 +118,13 @@ L1StandardBridge_Getter_Test:test_getters_succeeds() (gas: 32173)
L1StandardBridge_Initialize_Test:test_initialize_succeeds() (gas: 22050)
L1StandardBridge_Initialize_Test:test_initialize_succeeds() (gas: 22050)
L1StandardBridge_Receive_Test:test_receive_succeeds() (gas: 525438)
L1StandardBridge_Receive_Test:test_receive_succeeds() (gas: 525438)
L2CrossDomainMessenger_Test:test_messageVersion_succeeds() (gas: 8411)
L2CrossDomainMessenger_Test:test_messageVersion_succeeds() (gas: 8411)
L2CrossDomainMessenger_Test:test_relayMessage_reentrancyDiffMessage_succeeds() (gas: 680395)
L2CrossDomainMessenger_Test:test_relayMessage_retry_succeeds() (gas: 163159)
L2CrossDomainMessenger_Test:test_relayMessage_reentrancySameMessage_reverts() (gas: 626456)
L2CrossDomainMessenger_Test:test_relayMessage_succeeds() (gas: 48640)
L2CrossDomainMessenger_Test:test_relayMessage_retry_succeeds() (gas: 166461)
L2CrossDomainMessenger_Test:test_relayMessage_toSystemContract_reverts() (gas: 29021)
L2CrossDomainMessenger_Test:test_relayMessage_succeeds() (gas: 54980)
L2CrossDomainMessenger_Test:test_relayMessage_toSystemContract_reverts() (gas: 51448)
L2CrossDomainMessenger_Test:test_relayMessage_v2_reverts() (gas: 11711)
L2CrossDomainMessenger_Test:test_relayMessage_v2_reverts() (gas: 11711)
L2CrossDomainMessenger_Test:test_sendMessage_succeeds() (gas: 122508)
L2CrossDomainMessenger_Test:test_sendMessage_succeeds() (gas: 122508)
L2CrossDomainMessenger_Test:test_sendMessage_twice_succeeds() (gas: 134826)
L2CrossDomainMessenger_Test:test_sendMessage_twice_succeeds() (gas: 134826)
L2CrossDomainMessenger_Test:test_xDomainMessageSender_reset_succeeds() (gas:
54580
)
L2CrossDomainMessenger_Test:test_xDomainMessageSender_reset_succeeds() (gas:
48139
)
L2CrossDomainMessenger_Test:test_xDomainSender_senderNotSet_reverts() (gas: 10590)
L2CrossDomainMessenger_Test:test_xDomainSender_senderNotSet_reverts() (gas: 10590)
L2ERC721Bridge_Test:test_bridgeERC721To_localTokenZeroAddress_reverts() (gas: 26431)
L2ERC721Bridge_Test:test_bridgeERC721To_localTokenZeroAddress_reverts() (gas: 26431)
L2ERC721Bridge_Test:test_bridgeERC721To_remoteTokenZeroAddress_reverts() (gas: 21814)
L2ERC721Bridge_Test:test_bridgeERC721To_remoteTokenZeroAddress_reverts() (gas: 21814)
...
@@ -147,28 +143,29 @@ L2ERC721Bridge_Test:test_finalizeBridgeERC721_notViaLocalMessenger_reverts() (ga
...
@@ -147,28 +143,29 @@ L2ERC721Bridge_Test:test_finalizeBridgeERC721_notViaLocalMessenger_reverts() (ga
L2ERC721Bridge_Test:test_finalizeBridgeERC721_selfToken_reverts() (gas: 17659)
L2ERC721Bridge_Test:test_finalizeBridgeERC721_selfToken_reverts() (gas: 17659)
L2ERC721Bridge_Test:test_finalizeBridgeERC721_succeeds() (gas: 168970)
L2ERC721Bridge_Test:test_finalizeBridgeERC721_succeeds() (gas: 168970)
L2OutputOracleTest:test_computeL2Timestamp_succeeds() (gas: 37298)
L2OutputOracleTest:test_computeL2Timestamp_succeeds() (gas: 37298)
L2OutputOracleTest:test_constructor_badTimestamp_reverts() (gas: 709
47
)
L2OutputOracleTest:test_constructor_badTimestamp_reverts() (gas: 709
91
)
L2OutputOracleTest:test_constructor_l2BlockTimeZero_reverts() (gas: 45954)
L2OutputOracleTest:test_constructor_l2BlockTimeZero_reverts() (gas: 45954)
L2OutputOracleTest:test_constructor_succeeds() (gas: 33827)
L2OutputOracleTest:test_constructor_submissionInterval_reverts() (gas: 45942)
L2OutputOracleTest:test_deleteL2Outputs_afterLatest_reverts() (gas: 212262)
L2OutputOracleTest:test_constructor_succeeds() (gas: 33805)
L2OutputOracleTest:test_deleteL2Outputs_finalized_reverts() (gas: 108967)
L2OutputOracleTest:test_deleteL2Outputs_afterLatest_reverts() (gas: 212306)
L2OutputOracleTest:test_deleteL2Outputs_finalized_reverts() (gas: 108990)
L2OutputOracleTest:test_deleteL2Outputs_ifNotChallenger_reverts() (gas: 18918)
L2OutputOracleTest:test_deleteL2Outputs_ifNotChallenger_reverts() (gas: 18918)
L2OutputOracleTest:test_deleteL2Outputs_nonExistent_reverts() (gas: 107339)
L2OutputOracleTest:test_deleteL2Outputs_nonExistent_reverts() (gas: 107339)
L2OutputOracleTest:test_deleteOutputs_multipleOutputs_succeeds() (gas: 3024
39
)
L2OutputOracleTest:test_deleteOutputs_multipleOutputs_succeeds() (gas: 3024
62
)
L2OutputOracleTest:test_deleteOutputs_singleOutput_succeeds() (gas: 1810
38
)
L2OutputOracleTest:test_deleteOutputs_singleOutput_succeeds() (gas: 1810
16
)
L2OutputOracleTest:test_getL2OutputIndexAfter_multipleOutputsExist_succeeds() (gas: 267
120
)
L2OutputOracleTest:test_getL2OutputIndexAfter_multipleOutputsExist_succeeds() (gas: 267
098
)
L2OutputOracleTest:test_getL2OutputIndexAfter_noOutputsExis_reverts() (gas: 179
59
)
L2OutputOracleTest:test_getL2OutputIndexAfter_noOutputsExis_reverts() (gas: 179
37
)
L2OutputOracleTest:test_getL2OutputIndexAfter_previousBlock_succeeds() (gas: 960
66
)
L2OutputOracleTest:test_getL2OutputIndexAfter_previousBlock_succeeds() (gas: 960
44
)
L2OutputOracleTest:test_getL2OutputIndexAfter_sameBlock_succeeds() (gas: 959
95
)
L2OutputOracleTest:test_getL2OutputIndexAfter_sameBlock_succeeds() (gas: 959
73
)
L2OutputOracleTest:test_getL2Output_succeeds() (gas: 1016
34
)
L2OutputOracleTest:test_getL2Output_succeeds() (gas: 1016
12
)
L2OutputOracleTest:test_latestBlockNumber_succeeds() (gas: 969
62
)
L2OutputOracleTest:test_latestBlockNumber_succeeds() (gas: 969
40
)
L2OutputOracleTest:test_nextBlockNumber_succeeds() (gas: 174
90
)
L2OutputOracleTest:test_nextBlockNumber_succeeds() (gas: 174
68
)
L2OutputOracleTest:test_proposeL2Output_emptyOutput_reverts() (gas: 266
90
)
L2OutputOracleTest:test_proposeL2Output_emptyOutput_reverts() (gas: 266
68
)
L2OutputOracleTest:test_proposeL2Output_futureTimetamp_reverts() (gas: 286
69
)
L2OutputOracleTest:test_proposeL2Output_futureTimetamp_reverts() (gas: 286
47
)
L2OutputOracleTest:test_proposeL2Output_notProposer_reverts() (gas: 25
783
)
L2OutputOracleTest:test_proposeL2Output_notProposer_reverts() (gas: 25
806
)
L2OutputOracleTest:test_proposeL2Output_proposeAnotherOutput_succeeds() (gas: 1010
28
)
L2OutputOracleTest:test_proposeL2Output_proposeAnotherOutput_succeeds() (gas: 1010
06
)
L2OutputOracleTest:test_proposeL2Output_unexpectedBlockNumber_reverts() (gas: 28381)
L2OutputOracleTest:test_proposeL2Output_unexpectedBlockNumber_reverts() (gas: 28381)
L2OutputOracleTest:test_proposeL2Output_unmatchedBlockhash_reverts() (gas: 29
381
)
L2OutputOracleTest:test_proposeL2Output_unmatchedBlockhash_reverts() (gas: 29
404
)
L2OutputOracleTest:test_proposeL2Output_wrongFork_reverts() (gas: 28984)
L2OutputOracleTest:test_proposeL2Output_wrongFork_reverts() (gas: 28984)
L2OutputOracleTest:test_proposeWithBlockhashAndHeight_succeeds() (gas: 95253)
L2OutputOracleTest:test_proposeWithBlockhashAndHeight_succeeds() (gas: 95253)
L2OutputOracleUpgradeable_Test:test_initValuesOnProxy_succeeds() (gas: 26208)
L2OutputOracleUpgradeable_Test:test_initValuesOnProxy_succeeds() (gas: 26208)
...
@@ -267,9 +264,9 @@ OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_ifOutp
...
@@ -267,9 +264,9 @@ OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_ifOutp
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_ifOutputTimestampIsNotFinalized_reverts() (gas: 207497)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_ifOutputTimestampIsNotFinalized_reverts() (gas: 207497)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_ifWithdrawalNotProven_reverts() (gas: 41753)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_ifWithdrawalNotProven_reverts() (gas: 41753)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_ifWithdrawalProofNotOldEnough_reverts() (gas: 199441)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_ifWithdrawalProofNotOldEnough_reverts() (gas: 199441)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_onInsufficientGas_reverts() (gas: 2057
87
)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_onInsufficientGas_reverts() (gas: 2057
95
)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_onRecentWithdrawal_reverts() (gas: 180206)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_onRecentWithdrawal_reverts() (gas: 180206)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_onReentrancy_reverts() (gas: 2438
04
)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_onReentrancy_reverts() (gas: 2438
12
)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_onReplay_reverts() (gas: 245528)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_onReplay_reverts() (gas: 245528)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_paused_reverts() (gas: 53576)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_paused_reverts() (gas: 53576)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_provenWithdrawalHash_succeeds() (gas: 234941)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_provenWithdrawalHash_succeeds() (gas: 234941)
...
...
packages/contracts-bedrock/.storage-layout
View file @
707d8735
...
@@ -24,8 +24,7 @@
...
@@ -24,8 +24,7 @@
| xDomainMsgSender | address | 204 | 0 | 20 | contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger |
| xDomainMsgSender | address | 204 | 0 | 20 | contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger |
| msgNonce | uint240 | 205 | 0 | 30 | contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger |
| msgNonce | uint240 | 205 | 0 | 30 | contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger |
| failedMessages | mapping(bytes32 => bool) | 206 | 0 | 32 | contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger |
| failedMessages | mapping(bytes32 => bool) | 206 | 0 | 32 | contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger |
| reentrancyLocks | mapping(bytes32 => bool) | 207 | 0 | 32 | contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger |
| __gap | uint256[42] | 207 | 0 | 1344 | contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger |
| __gap | uint256[41] | 208 | 0 | 1312 | contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger |
=======================
=======================
➡ contracts/L1/L1StandardBridge.sol:L1StandardBridge
➡ contracts/L1/L1StandardBridge.sol:L1StandardBridge
...
@@ -135,8 +134,7 @@
...
@@ -135,8 +134,7 @@
| xDomainMsgSender | address | 204 | 0 | 20 | contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger |
| xDomainMsgSender | address | 204 | 0 | 20 | contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger |
| msgNonce | uint240 | 205 | 0 | 30 | contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger |
| msgNonce | uint240 | 205 | 0 | 30 | contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger |
| failedMessages | mapping(bytes32 => bool) | 206 | 0 | 32 | contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger |
| failedMessages | mapping(bytes32 => bool) | 206 | 0 | 32 | contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger |
| reentrancyLocks | mapping(bytes32 => bool) | 207 | 0 | 32 | contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger |
| __gap | uint256[42] | 207 | 0 | 1344 | contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger |
| __gap | uint256[41] | 208 | 0 | 1312 | contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger |
=======================
=======================
➡ contracts/L2/L2StandardBridge.sol:L2StandardBridge
➡ contracts/L2/L2StandardBridge.sol:L2StandardBridge
...
...
packages/contracts-bedrock/contracts/L1/L2OutputOracle.sol
View file @
707d8735
...
@@ -78,7 +78,7 @@ contract L2OutputOracle is Initializable, Semver {
...
@@ -78,7 +78,7 @@ contract L2OutputOracle is Initializable, Semver {
event OutputsDeleted(uint256 indexed prevNextOutputIndex, uint256 indexed newNextOutputIndex);
event OutputsDeleted(uint256 indexed prevNextOutputIndex, uint256 indexed newNextOutputIndex);
/**
/**
* @custom:semver 1.
2
.0
* @custom:semver 1.
3
.0
*
*
* @param _submissionInterval Interval in blocks at which checkpoints must be submitted.
* @param _submissionInterval Interval in blocks at which checkpoints must be submitted.
* @param _l2BlockTime The time per L2 block, in seconds.
* @param _l2BlockTime The time per L2 block, in seconds.
...
@@ -95,11 +95,11 @@ contract L2OutputOracle is Initializable, Semver {
...
@@ -95,11 +95,11 @@ contract L2OutputOracle is Initializable, Semver {
address _proposer,
address _proposer,
address _challenger,
address _challenger,
uint256 _finalizationPeriodSeconds
uint256 _finalizationPeriodSeconds
) Semver(1,
2
, 0) {
) Semver(1,
3
, 0) {
require(_l2BlockTime > 0, "L2OutputOracle: L2 block time must be greater than 0");
require(_l2BlockTime > 0, "L2OutputOracle: L2 block time must be greater than 0");
require(
require(
_submissionInterval >
_l2BlockTime
,
_submissionInterval >
0
,
"L2OutputOracle: submission interval must be greater than
L2 block time
"
"L2OutputOracle: submission interval must be greater than
0
"
);
);
SUBMISSION_INTERVAL = _submissionInterval;
SUBMISSION_INTERVAL = _submissionInterval;
...
...
packages/contracts-bedrock/contracts/test/CrossDomainMessenger.t.sol
View file @
707d8735
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
pragma solidity 0.8.15;
pragma solidity 0.8.15;
import { Messenger_Initializer, Reverter, CallerCaller } from "./CommonTest.t.sol";
import { Messenger_Initializer, Reverter, CallerCaller, CommonTest } from "./CommonTest.t.sol";
import { L1CrossDomainMessenger } from "../L1/L1CrossDomainMessenger.sol";
// Libraries
import { Predeploys } from "../libraries/Predeploys.sol";
import { Hashing } from "../libraries/Hashing.sol";
import { Encoding } from "../libraries/Encoding.sol";
// CrossDomainMessenger_Test is for testing functionality which is common to both the L1 and L2
// CrossDomainMessenger_Test is for testing functionality which is common to both the L1 and L2
// CrossDomainMessenger contracts. For simplicity, we use the L1 Messenger as the test contract.
// CrossDomainMessenger contracts. For simplicity, we use the L1 Messenger as the test contract.
...
@@ -17,3 +23,149 @@ contract CrossDomainMessenger_BaseGas_Test is Messenger_Initializer {
...
@@ -17,3 +23,149 @@ contract CrossDomainMessenger_BaseGas_Test is Messenger_Initializer {
L1Messenger.baseGas(hex"ff", _minGasLimit);
L1Messenger.baseGas(hex"ff", _minGasLimit);
}
}
}
}
/**
* @title ExternalRelay
* @notice A mock external contract called via the SafeCall inside
* the CrossDomainMessenger's `relayMessage` function.
*/
contract ExternalRelay is CommonTest {
address internal op;
address internal fuzzedSender;
L1CrossDomainMessenger internal L1Messenger;
event FailedRelayedMessage(bytes32 indexed msgHash);
constructor(L1CrossDomainMessenger _l1Messenger, address _op) {
L1Messenger = _l1Messenger;
op = _op;
}
/**
* @notice Internal helper function to relay a message and perform assertions.
*/
function _internalRelay(address _innerSender) internal {
address initialSender = L1Messenger.xDomainMessageSender();
bytes memory callMessage = getCallData();
bytes32 hash = Hashing.hashCrossDomainMessage({
_nonce: Encoding.encodeVersionedNonce({ _nonce: 0, _version: 1 }),
_sender: _innerSender,
_target: address(this),
_value: 0,
_gasLimit: 0,
_data: callMessage
});
vm.expectEmit(true, true, true, true);
emit FailedRelayedMessage(hash);
vm.prank(address(op));
L1Messenger.relayMessage({
_nonce: Encoding.encodeVersionedNonce({ _nonce: 0, _version: 1 }),
_sender: _innerSender,
_target: address(this),
_value: 0,
_minGasLimit: 0,
_message: callMessage
});
assertTrue(L1Messenger.failedMessages(hash));
assertFalse(L1Messenger.successfulMessages(hash));
assertEq(initialSender, L1Messenger.xDomainMessageSender());
}
/**
* @notice externalCallWithMinGas is called by the CrossDomainMessenger.
*/
function externalCallWithMinGas() external payable {
for (uint256 i = 0; i < 10; i++) {
address _innerSender;
unchecked {
_innerSender = address(uint160(uint256(uint160(fuzzedSender)) + i));
}
_internalRelay(_innerSender);
}
}
/**
* @notice Helper function to get the callData for an `externalCallWithMinGas
*/
function getCallData() public returns (bytes memory) {
return abi.encodeWithSelector(ExternalRelay.externalCallWithMinGas.selector);
}
/**
* @notice Helper function to set the fuzzed sender
*/
function setFuzzedSender(address _fuzzedSender) public {
fuzzedSender = _fuzzedSender;
}
}
/**
* @title CrossDomainMessenger_RelayMessage_Test
* @notice Fuzz tests re-entrancy into the CrossDomainMessenger relayMessage function.
*/
contract CrossDomainMessenger_RelayMessage_Test is Messenger_Initializer {
// Storage slot of the l2Sender
uint256 constant senderSlotIndex = 50;
ExternalRelay public er;
function setUp() public override {
super.setUp();
er = new ExternalRelay(L1Messenger, address(op));
}
/**
* @dev This test mocks an OptimismPortal call to the L1CrossDomainMessenger via
* the relayMessage function. The relayMessage function will then use SafeCall's
* callWithMinGas to call the target with call data packed in the callMessage.
* For this test, the callWithMinGas will call the mock ExternalRelay test contract
* defined above, executing the externalCallWithMinGas function which will try to
* re-enter the CrossDomainMessenger's relayMessage function, resulting in that message
* being recorded as failed.
*/
function testFuzz_relayMessageReenter_succeeds(address _sender, uint256 _gasLimit) external {
vm.assume(_sender != Predeploys.L2_CROSS_DOMAIN_MESSENGER);
address sender = Predeploys.L2_CROSS_DOMAIN_MESSENGER;
er.setFuzzedSender(_sender);
address target = address(er);
bytes memory callMessage = er.getCallData();
vm.expectCall(target, callMessage);
uint64 gasLimit = uint64(bound(_gasLimit, 0, 30_000_000));
bytes32 hash = Hashing.hashCrossDomainMessage({
_nonce: Encoding.encodeVersionedNonce({ _nonce: 0, _version: 1 }),
_sender: sender,
_target: target,
_value: 0,
_gasLimit: gasLimit,
_data: callMessage
});
// set the value of op.l2Sender() to be the L2 Cross Domain Messenger.
vm.store(address(op), bytes32(senderSlotIndex), bytes32(abi.encode(sender)));
vm.prank(address(op));
L1Messenger.relayMessage({
_nonce: Encoding.encodeVersionedNonce({ _nonce: 0, _version: 1 }),
_sender: sender,
_target: target,
_value: 0,
_minGasLimit: gasLimit,
_message: callMessage
});
assertTrue(L1Messenger.successfulMessages(hash));
assertEq(L1Messenger.failedMessages(hash), false);
// Ensures that the `xDomainMsgSender` is set back to `Predeploys.L2_CROSS_DOMAIN_MESSENGER`
vm.expectRevert("CrossDomainMessenger: xDomainMessageSender is not set");
L1Messenger.xDomainMessageSender();
}
}
packages/contracts-bedrock/contracts/test/L1CrossDomainMessenger.t.sol
View file @
707d8735
...
@@ -100,10 +100,6 @@ contract L1CrossDomainMessenger_Test is Messenger_Initializer {
...
@@ -100,10 +100,6 @@ contract L1CrossDomainMessenger_Test is Messenger_Initializer {
L1Messenger.xDomainMessageSender();
L1Messenger.xDomainMessageSender();
}
}
// xDomainMessageSender: should return the xDomainMsgSender address
// TODO: might need a test contract
// function test_xDomainSenderSetCorrectly() external {}
function test_relayMessage_v2_reverts() external {
function test_relayMessage_v2_reverts() external {
address target = address(0xabcd);
address target = address(0xabcd);
address sender = Predeploys.L2_CROSS_DOMAIN_MESSENGER;
address sender = Predeploys.L2_CROSS_DOMAIN_MESSENGER;
...
@@ -295,173 +291,6 @@ contract L1CrossDomainMessenger_Test is Messenger_Initializer {
...
@@ -295,173 +291,6 @@ contract L1CrossDomainMessenger_Test is Messenger_Initializer {
assertEq(L1Messenger.failedMessages(hash), true);
assertEq(L1Messenger.failedMessages(hash), true);
}
}
// relayMessage: Should revert if the recipient is trying to reenter with the
// same message.
function test_relayMessage_reentrancySameMessage_reverts() external {
ConfigurableCaller caller = new ConfigurableCaller();
address target = address(caller);
address sender = Predeploys.L2_CROSS_DOMAIN_MESSENGER;
bytes memory callMessage = abi.encodeWithSelector(caller.call.selector);
bytes32 hash = Hashing.hashCrossDomainMessage(
Encoding.encodeVersionedNonce({ _nonce: 0, _version: 1 }),
sender,
target,
0,
0,
callMessage
);
// Set the portal's `l2Sender` to the `sender`.
vm.store(address(op), bytes32(senderSlotIndex), bytes32(uint256(uint160(sender))));
// Act as the portal and call the `relayMessage` function with the `innerMessage`.
vm.prank(address(op));
vm.expectCall(target, callMessage);
L1Messenger.relayMessage(
Encoding.encodeVersionedNonce({ _nonce: 0, _version: 1 }),
sender,
target,
0,
0,
callMessage
);
// Assert that the message failed to be relayed
assertFalse(L1Messenger.successfulMessages(hash));
assertTrue(L1Messenger.failedMessages(hash));
// Set the configurable caller's target to `L1Messenger` and set the payload to `relayMessage(...)`.
caller.setDoRevert(false);
caller.setTarget(address(L1Messenger));
caller.setPayload(
abi.encodeWithSelector(
L1Messenger.relayMessage.selector,
Encoding.encodeVersionedNonce({ _nonce: 0, _version: 1 }),
sender,
target,
0,
0,
callMessage
)
);
// Attempt to replay the failed message, which will *not* immediately revert this time around,
// but attempt to reenter `relayMessage` with the same message hash. The reentrancy attempt should
// revert.
vm.expectEmit(true, true, true, true, target);
emit WhatHappened(
false,
abi.encodeWithSignature("Error(string)", "ReentrancyGuard: reentrant call")
);
L1Messenger.relayMessage(
Encoding.encodeVersionedNonce({ _nonce: 0, _version: 1 }), // nonce
sender,
target,
0,
0,
callMessage
);
// Assert that the message still failed to be relayed.
assertFalse(L1Messenger.successfulMessages(hash));
assertTrue(L1Messenger.failedMessages(hash));
}
// relayMessage: should not revert if the recipient reenters `relayMessage` with a different
// message hash.
function test_relayMessage_reentrancyDiffMessage_succeeds() external {
ConfigurableCaller caller = new ConfigurableCaller();
address target = address(caller);
address sender = Predeploys.L2_CROSS_DOMAIN_MESSENGER;
bytes memory messageA = abi.encodeWithSelector(caller.call.selector);
bytes memory messageB = hex"";
bytes32 hashA = Hashing.hashCrossDomainMessage(
Encoding.encodeVersionedNonce({ _nonce: 0, _version: 1 }),
sender,
target,
0,
0,
messageA
);
bytes32 hashB = Hashing.hashCrossDomainMessage(
Encoding.encodeVersionedNonce({ _nonce: 0, _version: 1 }),
sender,
target,
0,
0,
messageB
);
// Set the portal's `l2Sender` to the `sender`.
vm.store(address(op), bytes32(senderSlotIndex), bytes32(uint256(uint160(sender))));
// Act as the portal and call the `relayMessage` function with both `messageA` and `messageB`.
vm.startPrank(address(op));
vm.expectCall(target, messageA);
L1Messenger.relayMessage(
Encoding.encodeVersionedNonce({ _nonce: 0, _version: 1 }),
sender,
target,
0,
0,
messageA
);
vm.expectCall(target, messageB);
L1Messenger.relayMessage(
Encoding.encodeVersionedNonce({ _nonce: 0, _version: 1 }),
sender,
target,
0,
0,
messageB
);
// Stop acting as the portal
vm.stopPrank();
// Assert that both messages failed to be relayed
assertFalse(L1Messenger.successfulMessages(hashA));
assertFalse(L1Messenger.successfulMessages(hashB));
assertTrue(L1Messenger.failedMessages(hashA));
assertTrue(L1Messenger.failedMessages(hashB));
// Set the configurable caller's target to `L1Messenger` and set the payload to `relayMessage(...)`.
caller.setDoRevert(false);
caller.setTarget(address(L1Messenger));
caller.setPayload(
abi.encodeWithSelector(
L1Messenger.relayMessage.selector,
Encoding.encodeVersionedNonce({ _nonce: 0, _version: 1 }),
sender,
target,
0,
0,
messageB
)
);
// Attempt to replay the failed message, which will *not* immediately revert this time around,
// but attempt to reenter `relayMessage` with messageB. The reentrancy attempt should succeed
// because the message hashes are different.
vm.expectEmit(true, true, true, true, target);
emit WhatHappened(true, hex"");
L1Messenger.relayMessage(
Encoding.encodeVersionedNonce({ _nonce: 0, _version: 1 }),
sender,
target,
0,
0,
messageA
);
// Assert that both messages are now in the `successfulMessages` mapping.
assertTrue(L1Messenger.successfulMessages(hashA));
assertTrue(L1Messenger.successfulMessages(hashB));
}
function test_relayMessage_legacy_succeeds() external {
function test_relayMessage_legacy_succeeds() external {
address target = address(0xabcd);
address target = address(0xabcd);
address sender = Predeploys.L2_CROSS_DOMAIN_MESSENGER;
address sender = Predeploys.L2_CROSS_DOMAIN_MESSENGER;
...
...
packages/contracts-bedrock/contracts/test/L2CrossDomainMessenger.t.sol
View file @
707d8735
...
@@ -230,168 +230,4 @@ contract L2CrossDomainMessenger_Test is Messenger_Initializer {
...
@@ -230,168 +230,4 @@ contract L2CrossDomainMessenger_Test is Messenger_Initializer {
assertEq(L2Messenger.successfulMessages(hash), true);
assertEq(L2Messenger.successfulMessages(hash), true);
assertEq(L2Messenger.failedMessages(hash), true);
assertEq(L2Messenger.failedMessages(hash), true);
}
}
// relayMessage: Should revert if the recipient is trying to reenter with the
// same message.
function test_relayMessage_reentrancySameMessage_reverts() external {
ConfigurableCaller caller = new ConfigurableCaller();
address target = address(caller);
address sender = address(L1Messenger);
address l1XDMAlias = AddressAliasHelper.applyL1ToL2Alias(address(L1Messenger));
bytes memory callMessage = abi.encodeWithSelector(caller.call.selector);
bytes32 hash = Hashing.hashCrossDomainMessage(
Encoding.encodeVersionedNonce(0, 1),
sender,
target,
0,
0,
callMessage
);
// Act as the L1XDM and call the `relayMessage` function with the `innerMessage`.
vm.prank(l1XDMAlias);
vm.expectCall(target, callMessage);
L2Messenger.relayMessage(
Encoding.encodeVersionedNonce(0, 1),
sender,
target,
0,
0,
callMessage
);
// Assert that the message failed to be relayed
assertFalse(L2Messenger.successfulMessages(hash));
assertTrue(L2Messenger.failedMessages(hash));
// Set the configurable caller's target to `L2Messenger` and set the payload to `relayMessage(...)`.
caller.setDoRevert(false);
caller.setTarget(address(L2Messenger));
caller.setPayload(
abi.encodeWithSelector(
L2Messenger.relayMessage.selector,
Encoding.encodeVersionedNonce(0, 1),
sender,
target,
0,
0,
callMessage
)
);
// Attempt to replay the failed message, which will *not* immediately revert this time around,
// but attempt to reenter `relayMessage` with the same message hash. The reentrancy attempt should
// revert.
vm.expectEmit(true, true, true, true, target);
emit WhatHappened(
false,
abi.encodeWithSignature("Error(string)", "ReentrancyGuard: reentrant call")
);
L2Messenger.relayMessage(
Encoding.encodeVersionedNonce(0, 1),
sender,
target,
0,
0,
callMessage
);
// Assert that the message still failed to be relayed.
assertFalse(L2Messenger.successfulMessages(hash));
assertTrue(L2Messenger.failedMessages(hash));
}
// relayMessage: should not revert if the recipient reenters `relayMessage` with a different
// message hash.
function test_relayMessage_reentrancyDiffMessage_succeeds() external {
ConfigurableCaller caller = new ConfigurableCaller();
address target = address(caller);
address sender = address(L1Messenger);
address l1XDMAlias = AddressAliasHelper.applyL1ToL2Alias(address(L1Messenger));
bytes memory messageA = abi.encodeWithSelector(caller.call.selector);
bytes memory messageB = hex"";
bytes32 hashA = Hashing.hashCrossDomainMessage(
Encoding.encodeVersionedNonce(0, 1),
sender,
target,
0,
0,
messageA
);
bytes32 hashB = Hashing.hashCrossDomainMessage(
Encoding.encodeVersionedNonce(0, 1),
sender,
target,
0,
0,
messageB
);
// Act as the L1XDM and call the `relayMessage` function with both `messageA` and `messageB`.
vm.startPrank(l1XDMAlias);
vm.expectCall(target, messageA);
L2Messenger.relayMessage(
Encoding.encodeVersionedNonce(0, 1),
sender,
target,
0,
0,
messageA
);
vm.expectCall(target, messageB);
L2Messenger.relayMessage(
Encoding.encodeVersionedNonce(0, 1),
sender,
target,
0,
0,
messageB
);
// Stop acting as the L1XDM
vm.stopPrank();
// Assert that both messages failed to be relayed
assertFalse(L2Messenger.successfulMessages(hashA));
assertFalse(L2Messenger.successfulMessages(hashB));
assertTrue(L2Messenger.failedMessages(hashA));
assertTrue(L2Messenger.failedMessages(hashB));
// Set the configurable caller's target to `L2Messenger` and set the payload to `relayMessage(...)`.
caller.setDoRevert(false);
caller.setTarget(address(L2Messenger));
caller.setPayload(
abi.encodeWithSelector(
L2Messenger.relayMessage.selector,
Encoding.encodeVersionedNonce(0, 1),
sender,
target,
0,
0,
messageB
)
);
// Attempt to replay the failed message, which will *not* immediately revert this time around,
// but attempt to reenter `relayMessage` with messageB. The reentrancy attempt should succeed
// because the message hashes are different.
vm.expectEmit(true, true, true, true, target);
emit WhatHappened(true, hex"");
L2Messenger.relayMessage(
Encoding.encodeVersionedNonce(0, 1),
sender,
target,
0,
0,
messageA
);
// Assert that both messages are now in the `successfulMessages` mapping.
assertTrue(L2Messenger.successfulMessages(hashA));
assertTrue(L2Messenger.successfulMessages(hashB));
}
}
}
packages/contracts-bedrock/contracts/test/L2OutputOracle.t.sol
View file @
707d8735
...
@@ -47,21 +47,11 @@ contract L2OutputOracleTest is L2OutputOracle_Initializer {
...
@@ -47,21 +47,11 @@ contract L2OutputOracleTest is L2OutputOracle_Initializer {
});
});
}
}
function testFuzz_constructor_submissionIntervalLteL2BlockTime_reverts(
function test_constructor_submissionInterval_reverts() external {
uint256 _submissionInterval,
vm.expectRevert("L2OutputOracle: submission interval must be greater than 0");
uint256 _l2BlockTime
) external {
// Bound the _l2blockTime to be in the range of [1, type(uint256).max]
_l2BlockTime = bound(_l2BlockTime, 1, type(uint256).max);
// Roll the block number to _l2blockTime (the starting L2 timestamp must be less than or equal to the current time)
vm.roll(_l2BlockTime);
// Bound _submissionInterval to be less than or equal to _l2BlockTime
_submissionInterval = bound(_submissionInterval, 0, _l2BlockTime);
vm.expectRevert("L2OutputOracle: submission interval must be greater than L2 block time");
new L2OutputOracle({
new L2OutputOracle({
_submissionInterval:
_submissionInterval
,
_submissionInterval:
0
,
_l2BlockTime:
_
l2BlockTime,
_l2BlockTime: l2BlockTime,
_startingBlockNumber: startingBlockNumber,
_startingBlockNumber: startingBlockNumber,
_startingTimestamp: block.timestamp,
_startingTimestamp: block.timestamp,
_proposer: proposer,
_proposer: proposer,
...
...
packages/contracts-bedrock/contracts/test/OptimismPortal.t.sol
View file @
707d8735
...
@@ -976,12 +976,21 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
...
@@ -976,12 +976,21 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
uint256 _gasLimit,
uint256 _gasLimit,
bytes memory _data
bytes memory _data
) external {
) external {
// Cannot call the optimism portal
vm.assume(
vm.assume(_target != address(op));
_target != address(op) && // Cannot call the optimism portal or a contract
_target.code.length == 0 && // No accounts with code
_target != CONSOLE && // The console has no code but behaves like a contract
uint160(_target) > 9 // No precompiles (or zero address)
);
// Total ETH supply is currently about 120M ETH.
// Total ETH supply is currently about 120M ETH.
uint256 value = bound(_value, 0, 200_000_000 ether);
uint256 value = bound(_value, 0, 200_000_000 ether);
vm.deal(address(op), value);
uint256 gasLimit = bound(_gasLimit, 0, 50_000_000);
uint256 gasLimit = bound(_gasLimit, 0, 50_000_000);
uint256 nonce = messagePasser.messageNonce();
uint256 nonce = messagePasser.messageNonce();
// Get a withdrawal transaction and mock proof from the differential testing script.
Types.WithdrawalTransaction memory _tx = Types.WithdrawalTransaction({
Types.WithdrawalTransaction memory _tx = Types.WithdrawalTransaction({
nonce: nonce,
nonce: nonce,
sender: _sender,
sender: _sender,
...
@@ -998,6 +1007,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
...
@@ -998,6 +1007,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
bytes[] memory withdrawalProof
bytes[] memory withdrawalProof
) = ffi.getProveWithdrawalTransactionInputs(_tx);
) = ffi.getProveWithdrawalTransactionInputs(_tx);
// Create the output root proof
Types.OutputRootProof memory proof = Types.OutputRootProof({
Types.OutputRootProof memory proof = Types.OutputRootProof({
version: bytes32(uint256(0)),
version: bytes32(uint256(0)),
stateRoot: stateRoot,
stateRoot: stateRoot,
...
@@ -1009,29 +1019,30 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
...
@@ -1009,29 +1019,30 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
assertEq(outputRoot, Hashing.hashOutputRootProof(proof));
assertEq(outputRoot, Hashing.hashOutputRootProof(proof));
assertEq(withdrawalHash, Hashing.hashWithdrawal(_tx));
assertEq(withdrawalHash, Hashing.hashWithdrawal(_tx));
//
Mock the call to the oracle
//
Setup the Oracle to return the outputRoot
vm.mockCall(
vm.mockCall(
address(oracle),
address(oracle),
abi.encodeWithSelector(oracle.getL2Output.selector),
abi.encodeWithSelector(oracle.getL2Output.selector),
abi.encode(outputRoot, 0)
abi.encode(outputRoot,
block.timestamp, 10
0)
);
);
// Start the withdrawal, it must be initiated by the _sender and the
// Prove the withdrawal transaction
// correct value must be passed along
vm.deal(_tx.sender, _tx.value);
vm.prank(_tx.sender);
messagePasser.initiateWithdrawal{ value: _tx.value }(_tx.target, _tx.gasLimit, _tx.data);
// Ensure that the sentMessages is correct
assertEq(messagePasser.sentMessages(withdrawalHash), true);
vm.warp(block.timestamp + oracle.FINALIZATION_PERIOD_SECONDS() + 1);
op.proveWithdrawalTransaction(
op.proveWithdrawalTransaction(
_tx,
_tx,
100, // l2BlockNumber
100, // l2BlockNumber
proof,
proof,
withdrawalProof
withdrawalProof
);
);
(bytes32 _root, , ) = op.provenWithdrawals(withdrawalHash);
assertTrue(_root != bytes32(0));
// Warp past the finalization period
vm.warp(block.timestamp + oracle.FINALIZATION_PERIOD_SECONDS() + 1);
// Finalize the withdrawal transaction
vm.expectCallMinGas(_tx.target, _tx.value, uint64(_tx.gasLimit), _tx.data);
op.finalizeWithdrawalTransaction(_tx);
assertTrue(op.finalizedWithdrawals(withdrawalHash));
}
}
}
}
...
...
packages/contracts-bedrock/contracts/test/SafeCall.t.sol
View file @
707d8735
...
@@ -23,6 +23,8 @@ contract SafeCall_call_Test is CommonTest {
...
@@ -23,6 +23,8 @@ contract SafeCall_call_Test is CommonTest {
vm.assume(to != address(0x000000000000000000636F6e736F6c652e6c6f67));
vm.assume(to != address(0x000000000000000000636F6e736F6c652e6c6f67));
// don't call the create2 deployer
// don't call the create2 deployer
vm.assume(to != address(0x4e59b44847b379578588920cA78FbF26c0B4956C));
vm.assume(to != address(0x4e59b44847b379578588920cA78FbF26c0B4956C));
// don't call the ffi interface
vm.assume(to != address(0x5615dEB798BB3E4dFa0139dFa1b3D433Cc23b72f));
assertEq(from.balance, 0, "from balance is 0");
assertEq(from.balance, 0, "from balance is 0");
vm.deal(from, value);
vm.deal(from, value);
...
...
packages/contracts-bedrock/contracts/test/invariants/CrossDomainMessenger.t.sol
View file @
707d8735
...
@@ -124,14 +124,18 @@ contract XDM_MinGasLimits is Messenger_Initializer {
...
@@ -124,14 +124,18 @@ contract XDM_MinGasLimits is Messenger_Initializer {
* contract.
* contract.
*/
*/
function invariant_minGasLimits() public {
function invariant_minGasLimits() public {
uint256 length = actor.numHashes();
///////////////////////////////////////////////////////////////////
for (uint256 i = 0; i < length; ++i) {
// ~ DEV ~ //
bytes32 hash = actor.hashes(i);
// This test is temporarily disabled, it is being fixed in #5470 //
// the message hash is in the successfulMessages mapping
///////////////////////////////////////////////////////////////////
assertTrue(L1Messenger.successfulMessages(hash));
// uint256 length = actor.numHashes();
// it is not in the received messages mapping
// for (uint256 i = 0; i < length; ++i) {
assertFalse(L1Messenger.failedMessages(hash));
// bytes32 hash = actor.hashes(i);
}
// // the message hash is in the successfulMessages mapping
assertFalse(actor.reverted());
// assertTrue(L1Messenger.successfulMessages(hash));
// // it is not in the received messages mapping
// assertFalse(L1Messenger.failedMessages(hash));
// }
// assertFalse(actor.reverted());
}
}
}
}
packages/contracts-bedrock/contracts/universal/CrossDomainMessenger.sol
View file @
707d8735
...
@@ -175,17 +175,12 @@ abstract contract CrossDomainMessenger is
...
@@ -175,17 +175,12 @@ abstract contract CrossDomainMessenger is
*/
*/
mapping(bytes32 => bool) public failedMessages;
mapping(bytes32 => bool) public failedMessages;
/**
* @notice A mapping of hashes to reentrancy locks.
*/
mapping(bytes32 => bool) internal reentrancyLocks;
/**
/**
* @notice Reserve extra slots in the storage layout for future upgrades.
* @notice Reserve extra slots in the storage layout for future upgrades.
* A gap size of 41 was chosen here, so that the first slot used in a child contract
* A gap size of 41 was chosen here, so that the first slot used in a child contract
* would be a multiple of 50.
* would be a multiple of 50.
*/
*/
uint256[4
1
] private __gap;
uint256[4
2
] private __gap;
/**
/**
* @notice Emitted whenever a message is sent to the other chain.
* @notice Emitted whenever a message is sent to the other chain.
...
@@ -323,13 +318,6 @@ abstract contract CrossDomainMessenger is
...
@@ -323,13 +318,6 @@ abstract contract CrossDomainMessenger is
_message
_message
);
);
// Check if the reentrancy lock for the `versionedHash` is already set.
if (reentrancyLocks[versionedHash]) {
revert("ReentrancyGuard: reentrant call");
}
// Trigger the reentrancy lock for `versionedHash`
reentrancyLocks[versionedHash] = true;
if (_isOtherMessenger()) {
if (_isOtherMessenger()) {
// These properties should always hold when the message is first submitted (as
// These properties should always hold when the message is first submitted (as
// opposed to being replayed).
// opposed to being replayed).
...
@@ -357,6 +345,15 @@ abstract contract CrossDomainMessenger is
...
@@ -357,6 +345,15 @@ abstract contract CrossDomainMessenger is
"CrossDomainMessenger: message has already been relayed"
"CrossDomainMessenger: message has already been relayed"
);
);
// If `xDomainMsgSender` is not the default L2 sender, this function
// is being re-entered. This marks the message as failed to allow it
// to be replayed.
if (xDomainMsgSender != Constants.DEFAULT_L2_SENDER) {
failedMessages[versionedHash] = true;
emit FailedRelayedMessage(versionedHash);
return;
}
xDomainMsgSender = _sender;
xDomainMsgSender = _sender;
bool success = SafeCall.callWithMinGas(_target, _minGasLimit, _value, _message);
bool success = SafeCall.callWithMinGas(_target, _minGasLimit, _value, _message);
xDomainMsgSender = Constants.DEFAULT_L2_SENDER;
xDomainMsgSender = Constants.DEFAULT_L2_SENDER;
...
@@ -377,9 +374,6 @@ abstract contract CrossDomainMessenger is
...
@@ -377,9 +374,6 @@ abstract contract CrossDomainMessenger is
revert("CrossDomainMessenger: failed to relay message");
revert("CrossDomainMessenger: failed to relay message");
}
}
}
}
// Clear the reentrancy lock for `versionedHash`
reentrancyLocks[versionedHash] = false;
}
}
/**
/**
...
...
packages/sdk/src/utils/message-utils.ts
View file @
707d8735
import
{
hashWithdrawal
,
calldataCost
}
from
'
@eth-optimism/core-utils
'
import
{
hashWithdrawal
}
from
'
@eth-optimism/core-utils
'
import
{
BigNumber
}
from
'
ethers
'
import
{
BigNumber
,
utils
}
from
'
ethers
'
import
{
LowLevelMessage
}
from
'
../interfaces
'
import
{
LowLevelMessage
}
from
'
../interfaces
'
const
{
hexDataLength
}
=
utils
/**
/**
* Utility for hashing a LowLevelMessage object.
* Utility for hashing a LowLevelMessage object.
*
*
...
@@ -25,7 +27,7 @@ export const hashLowLevelMessage = (message: LowLevelMessage): string => {
...
@@ -25,7 +27,7 @@ export const hashLowLevelMessage = (message: LowLevelMessage): string => {
*/
*/
export
const
migratedWithdrawalGasLimit
=
(
data
:
string
):
BigNumber
=>
{
export
const
migratedWithdrawalGasLimit
=
(
data
:
string
):
BigNumber
=>
{
// Compute the gas limit and cap at 25 million
// Compute the gas limit and cap at 25 million
const
dataCost
=
calldataCost
(
data
)
const
dataCost
=
BigNumber
.
from
(
hexDataLength
(
data
)).
mul
(
16
)
let
minGasLimit
=
dataCost
.
add
(
200
_000
)
let
minGasLimit
=
dataCost
.
add
(
200
_000
)
if
(
minGasLimit
.
gt
(
25
_000_000
))
{
if
(
minGasLimit
.
gt
(
25
_000_000
))
{
minGasLimit
=
BigNumber
.
from
(
25
_000_000
)
minGasLimit
=
BigNumber
.
from
(
25
_000_000
)
...
...
packages/sdk/test/utils/message-utils.spec.ts
View file @
707d8735
...
@@ -15,9 +15,9 @@ describe('Message Utils', () => {
...
@@ -15,9 +15,9 @@ describe('Message Utils', () => {
const
tests
=
[
const
tests
=
[
{
input
:
'
0x
'
,
result
:
BigNumber
.
from
(
200
_000
)
},
{
input
:
'
0x
'
,
result
:
BigNumber
.
from
(
200
_000
)
},
{
input
:
'
0xff
'
,
result
:
BigNumber
.
from
(
200
_000
+
16
)
},
{
input
:
'
0xff
'
,
result
:
BigNumber
.
from
(
200
_000
+
16
)
},
{
input
:
'
0xff00
'
,
result
:
BigNumber
.
from
(
200
_000
+
16
+
4
)
},
{
input
:
'
0xff00
'
,
result
:
BigNumber
.
from
(
200
_000
+
16
+
16
)
},
{
input
:
'
0x00
'
,
result
:
BigNumber
.
from
(
200
_000
+
4
)
},
{
input
:
'
0x00
'
,
result
:
BigNumber
.
from
(
200
_000
+
16
)
},
{
input
:
'
0x000000
'
,
result
:
BigNumber
.
from
(
200
_000
+
4
+
4
+
4
)
},
{
input
:
'
0x000000
'
,
result
:
BigNumber
.
from
(
200
_000
+
16
+
16
+
16
)
},
]
]
for
(
const
test
of
tests
)
{
for
(
const
test
of
tests
)
{
...
...
specs/withdrawals.md
View file @
707d8735
...
@@ -18,12 +18,17 @@ an L2 account to an L1 account.
...
@@ -18,12 +18,17 @@ an L2 account to an L1 account.
more specific terms to differentiate:
more specific terms to differentiate:
-
A _withdrawal initiating transaction_ refers specifically to a transaction on L2 sent to the Withdrawals predeploy.
-
A _withdrawal initiating transaction_ refers specifically to a transaction on L2 sent to the Withdrawals predeploy.
-
A _withdrawal proving transaction_ refers specifically to an L1 transaction
which proves the withdrawal is correct (that it has been included in a merkle
tree whose root is available on L1).
-
A _withdrawal finalizing transaction_ refers specifically to an L1 transaction which finalizes and relays the
-
A _withdrawal finalizing transaction_ refers specifically to an L1 transaction which finalizes and relays the
withdrawal.
withdrawal.
Withdrawals are initiated on L2 via a call to the Message Passer predeploy contract, which records the important
Withdrawals are initiated on L2 via a call to the Message Passer predeploy contract, which records the important
properties of the message in its storage. Withdrawals are finalized on L1 via a call to the
`OptimismPortal`
properties of the message in its storage.
contract, which proves the inclusion of this withdrawal message.
Withdrawals are proven on L1 via a call to the
`OptimismPortal`
, which proves the inclusion of this withdrawal message.
Withdrawals are finalized on L1 via a call to the
`OptimismPortal`
contract,
which verifies that the fault challenge period has passed since the withdrawal message has been proved.
In this way, withdrawals are different from
[
deposits
][
g-deposits
]
which make use of a special transaction type in the
In this way, withdrawals are different from
[
deposits
][
g-deposits
]
which make use of a special transaction type in the
[
execution engine
][
g-execution-engine
]
client. Rather, withdrawals transaction must use smart contracts on L1 for
[
execution engine
][
g-execution-engine
]
client. Rather, withdrawals transaction must use smart contracts on L1 for
...
@@ -59,18 +64,20 @@ This is a very simple contract that stores the hash of the withdrawal data.
...
@@ -59,18 +64,20 @@ This is a very simple contract that stores the hash of the withdrawal data.
### On L1
### On L1
1.
A
[
relayer
][
g-relayer
]
submits the required inputs to the
`OptimismPortal`
contract. The relayer need
1.
A
[
relayer
][
g-relayer
]
submits a withdrawal proving transaction with the required inputs
not be the same entity which initiated the withdrawal on L2.
to the
`OptimismPortal`
contract.
The relayer is not necessarily the same entity which initiated the withdrawal on L2.
These inputs include the withdrawal transaction data, inclusion proofs, and a block number. The block number
These inputs include the withdrawal transaction data, inclusion proofs, and a block number. The block number
must be one for which an L2 output root exists, which commits to the withdrawal as registered on L2.
must be one for which an L2 output root exists, which commits to the withdrawal as registered on L2.
1.
The
`OptimismPortal`
contract retrieves the output root for the given block number from the
`L2OutputOracle`
's
1.
The
`OptimismPortal`
contract retrieves the output root for the given block number from the
`L2OutputOracle`
's
`getL2Output
After
()`
function, and performs the remainder of the verification process internally.
`getL2Output()`
function, and performs the remainder of the verification process internally.
1.
If proof verification fails, the call reverts. Otherwise the hash is recorded to prevent it from being re-proven.
1.
If proof verification fails, the call reverts. Otherwise the hash is recorded to prevent it from being re-proven.
Note that the withdrawal can be proven more than once if the corresponding output root changes.
Note that the withdrawal can be proven more than once if the corresponding output root changes.
1.
After the withdrawal is proven, it enters a 7 day challenge period, allowing time for other network participants
1.
After the withdrawal is proven, it enters a 7 day challenge period, allowing time for other network participants
to challenge the integrity of the corresponding output root.
to challenge the integrity of the corresponding output root.
1.
Once the challenge period has passed, a relayer submits the withdrawal transaction once again to the
1.
Once the challenge period has passed, a relayer submits a withdrawal finalizing transaction to the
`OptimismPortal`
contract. Again, the relayer need not be the same entity which initiated the withdrawal on L2.
`OptimismPortal`
contract.
The relayer doesn't need to be the same entity that initiated the withdrawal on L2.
1.
The
`OptimismPortal`
contract receives the withdrawal transaction data and verifies that the withdrawal has
1.
The
`OptimismPortal`
contract receives the withdrawal transaction data and verifies that the withdrawal has
both been proven and passed the challenge period.
both been proven and passed the challenge period.
1.
If the requirements are not met, the call reverts. Otherwise the call is forwarded, and the hash is recorded to
1.
If the requirements are not met, the call reverts. Otherwise the call is forwarded, and the hash is recorded to
...
@@ -102,7 +109,7 @@ interface L2ToL1MessagePasser {
...
@@ -102,7 +109,7 @@ interface L2ToL1MessagePasser {
function
initiateWithdrawal
(
address
_target
,
uint256
_gasLimit
,
bytes
memory
_data
)
payable
external
;
function
initiateWithdrawal
(
address
_target
,
uint256
_gasLimit
,
bytes
memory
_data
)
payable
external
;
function
nonce
()
view
external
returns
(
uint256
);
function
messageNonce
()
public
view
returns
(
uint256
);
function
sentMessages
(
bytes32
)
view
external
returns
(
bool
);
function
sentMessages
(
bytes32
)
view
external
returns
(
bool
);
}
}
...
@@ -139,13 +146,14 @@ withdrawals:
...
@@ -139,13 +146,14 @@ withdrawals:
```
js
```
js
interface
OptimismPortal
{
interface
OptimismPortal
{
event
WithdrawalFinalized
(
bytes32
indexed
);
event
WithdrawalFinalized
(
bytes32
indexed
withdrawalHash
,
bool
success
);
function
l2Sender
()
returns
(
address
)
external
;
function
l2Sender
()
returns
(
address
)
external
;
function
proveWithdrawalTransaction
(
function
proveWithdrawalTransaction
(
Types
.
WithdrawalTransaction
memory
_tx
,
Types
.
WithdrawalTransaction
memory
_tx
,
uint256
_l2
BlockNumber
,
uint256
_l2
OutputIndex
,
Types
.
OutputRootProof
calldata
_outputRootProof
,
Types
.
OutputRootProof
calldata
_outputRootProof
,
bytes
[]
calldata
_withdrawalProof
bytes
[]
calldata
_withdrawalProof
)
external
;
)
external
;
...
@@ -168,14 +176,14 @@ The following inputs are required to prove and finalize a withdrawal:
...
@@ -168,14 +176,14 @@ The following inputs are required to prove and finalize a withdrawal:
-
`data`
: Data to send to the target.
-
`data`
: Data to send to the target.
-
`gasLimit`
: Gas to be forwarded to the target.
-
`gasLimit`
: Gas to be forwarded to the target.
-
Proof and verification data:
-
Proof and verification data:
-
`l2
BlockNumber`
: The L2 block number that corresponds to the output root
.
-
`l2
OutputIndex`
: The index in the L2 outputs where the applicable output root may be found
.
-
`outputRootProof`
: Four
`bytes32`
values which are used to derive the output root.
-
`outputRootProof`
: Four
`bytes32`
values which are used to derive the output root.
-
`withdrawalProof`
: An inclusion proof for the given withdrawal in the L2ToL1MessagePasser contract.
-
`withdrawalProof`
: An inclusion proof for the given withdrawal in the L2ToL1MessagePasser contract.
These inputs must satisfy the following conditions:
These inputs must satisfy the following conditions:
1.
The
`l2
BlockNumber`
must be the block number that corresponds to the
`OutputProposal`
being proven
.
1.
The
`l2
OutputIndex`
must be the index in the L2 outputs that contains the applicable output root
.
1.
`L2OutputOracle.getL2Output
After(l2BlockNumber
)`
returns a non-zero
`OutputProposal`
.
1.
`L2OutputOracle.getL2Output
(l2OutputIndex
)`
returns a non-zero
`OutputProposal`
.
1.
The keccak256 hash of the
`outputRootProof`
values is equal to the
`outputRoot`
.
1.
The keccak256 hash of the
`outputRootProof`
values is equal to the
`outputRoot`
.
1.
The
`withdrawalProof`
is a valid inclusion proof demonstrating that a hash of the Withdrawal transaction data
1.
The
`withdrawalProof`
is a valid inclusion proof demonstrating that a hash of the Withdrawal transaction data
is contained in the storage of the L2ToL1MessagePasser contract on L2.
is contained in the storage of the L2ToL1MessagePasser contract on L2.
...
@@ -190,13 +198,13 @@ These inputs must satisfy the following conditions:
...
@@ -190,13 +198,13 @@ These inputs must satisfy the following conditions:
[
polygon-dbl-spend
]:
https://gerhard-wagner.medium.com/double-spending-bug-in-polygons-plasma-bridge-2e0954ccadf1
[
polygon-dbl-spend
]:
https://gerhard-wagner.medium.com/double-spending-bug-in-polygons-plasma-bridge-2e0954ccadf1
1.
For each withdrawal initiated on L2 (i
e. with a unique
`nonce
`
), the following properties must hold:
1.
For each withdrawal initiated on L2 (i
.e. with a unique
`messageNonce()
`
), the following properties must hold:
1.
It should only be possible to prove the withdrawal once, unless the outputRoot for the withdrawal
1.
It should only be possible to prove the withdrawal once, unless the outputRoot for the withdrawal
has changed.
has changed.
1.
It should only be possible to finalize the withdrawal once.
1.
It should only be possible to finalize the withdrawal once.
1.
It should not be possible to relay the message with any of its fields modified, ie.
1.
It should not be possible to relay the message with any of its fields modified, ie.
1.
Modifying the
`sender`
field would enable a 'spoofing' attack.
1.
Modifying the
`sender`
field would enable a 'spoofing' attack.
1.
Modifying the
`target`
,
`
message
`
, or
`value`
fields would enable an attacker to dangerously change the
1.
Modifying the
`target`
,
`
data
`
, or
`value`
fields would enable an attacker to dangerously change the
intended outcome of the withdrawal.
intended outcome of the withdrawal.
1.
Modifying the
`gasLimit`
could make the cost of relaying too high, or allow the relayer to cause execution
1.
Modifying the
`gasLimit`
could make the cost of relaying too high, or allow the relayer to cause execution
to fail (out of gas) in the
`target`
.
to fail (out of gas) in the
`target`
.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment