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
c16d9ab7
Unverified
Commit
c16d9ab7
authored
Sep 29, 2022
by
Maurelian
Committed by
GitHub
Sep 29, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into ci/no-test-nag
parents
d72c9075
07c6d07d
Changes
22
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
457 additions
and
145 deletions
+457
-145
lazy-drinks-drop.md
.changeset/lazy-drinks-drop.md
+6
-0
nft-bridge.spec.ts
integration-tests/test/nft-bridge.spec.ts
+5
-6
go.mod
op-batcher/go.mod
+4
-4
go.sum
op-batcher/go.sum
+8
-8
go.mod
op-chain-ops/go.mod
+1
-1
go.sum
op-chain-ops/go.sum
+2
-2
go.mod
op-e2e/go.mod
+6
-6
go.sum
op-e2e/go.sum
+12
-12
go.mod
op-node/go.mod
+2
-2
go.sum
op-node/go.sum
+4
-4
engine_queue_test.go
op-node/rollup/derive/engine_queue_test.go
+4
-3
fuzz_parsers_test.go
op-node/rollup/derive/fuzz_parsers_test.go
+5
-12
pipeline_test.go
op-node/rollup/derive/pipeline_test.go
+1
-28
assertions.go
op-node/testutils/assertions.go
+20
-0
metrics.go
op-node/testutils/metrics.go
+29
-0
bridge-withdrawal.json
op-node/withdrawals/testdata/bridge-withdrawal.json
+134
-0
utils.go
op-node/withdrawals/utils.go
+23
-28
utils_test.go
op-node/withdrawals/utils_test.go
+160
-0
go.mod
op-proposer/go.mod
+3
-3
go.sum
op-proposer/go.sum
+6
-6
OptimismMintableERC721Factory.sol
...cts/universal/op-erc721/OptimismMintableERC721Factory.sol
+15
-12
OptimismMintableERC721Factory.spec.ts
...contracts/universal/OptimismMintableERC721Factory.spec.ts
+7
-8
No files found.
.changeset/lazy-drinks-drop.md
0 → 100644
View file @
c16d9ab7
---
'
@eth-optimism/integration-tests'
:
patch
'
@eth-optimism/contracts-periphery'
:
patch
---
Fix erc721 factory to match erc21 factory
integration-tests/test/nft-bridge.spec.ts
View file @
c16d9ab7
...
@@ -113,12 +113,11 @@ describe('ERC721 Bridge', () => {
...
@@ -113,12 +113,11 @@ describe('ERC721 Bridge', () => {
)
)
// Create a L2 Standard ERC721 with the Standard ERC721 Factory
// Create a L2 Standard ERC721 with the Standard ERC721 Factory
const
tx
=
const
tx
=
await
OptimismMintableERC721Factory
.
createOptimismMintableERC721
(
await
OptimismMintableERC721Factory
.
createStandardOptimismMintableERC721
(
L1ERC721
.
address
,
L1ERC721
.
address
,
'
L2ERC721
'
,
'
L2ERC721
'
,
'
L2
'
'
L2
'
)
)
const
receipt
=
await
tx
.
wait
()
const
receipt
=
await
tx
.
wait
()
// Get the OptimismMintableERC721Created event
// Get the OptimismMintableERC721Created event
...
...
op-batcher/go.mod
View file @
c16d9ab7
...
@@ -3,9 +3,9 @@ module github.com/ethereum-optimism/optimism/op-batcher
...
@@ -3,9 +3,9 @@ module github.com/ethereum-optimism/optimism/op-batcher
go 1.18
go 1.18
require (
require (
github.com/ethereum-optimism/optimism/op-node v0.8.
8
github.com/ethereum-optimism/optimism/op-node v0.8.
9
github.com/ethereum-optimism/optimism/op-proposer v0.8.
8
github.com/ethereum-optimism/optimism/op-proposer v0.8.
9
github.com/ethereum-optimism/optimism/op-service v0.8.
8
github.com/ethereum-optimism/optimism/op-service v0.8.
9
github.com/ethereum/go-ethereum v1.10.23
github.com/ethereum/go-ethereum v1.10.23
github.com/miguelmota/go-ethereum-hdwallet v0.1.1
github.com/miguelmota/go-ethereum-hdwallet v0.1.1
github.com/urfave/cli v1.22.9
github.com/urfave/cli v1.22.9
...
@@ -22,7 +22,7 @@ require (
...
@@ -22,7 +22,7 @@ require (
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/deckarep/golang-set v1.8.0 // indirect
github.com/deckarep/golang-set v1.8.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
github.com/ethereum-optimism/optimism/op-bindings v0.8.
8
// indirect
github.com/ethereum-optimism/optimism/op-bindings v0.8.
9
// indirect
github.com/fjl/memsize v0.0.1 // indirect
github.com/fjl/memsize v0.0.1 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-stack/stack v1.8.1 // indirect
github.com/go-stack/stack v1.8.1 // indirect
...
...
op-batcher/go.sum
View file @
c16d9ab7
...
@@ -149,14 +149,14 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m
...
@@ -149,14 +149,14 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/ethereum-optimism/op-geth v0.0.0-20220926184707-53d23c240afd h1:NchOnosWOkH9wlix8QevGHE+6vuRa+OMGvDNsczv2kQ=
github.com/ethereum-optimism/op-geth v0.0.0-20220926184707-53d23c240afd h1:NchOnosWOkH9wlix8QevGHE+6vuRa+OMGvDNsczv2kQ=
github.com/ethereum-optimism/op-geth v0.0.0-20220926184707-53d23c240afd/go.mod h1:/6CsT5Ceen2WPLI/oCA3xMcZ5sWMF/D46SjM/ayY0Oo=
github.com/ethereum-optimism/op-geth v0.0.0-20220926184707-53d23c240afd/go.mod h1:/6CsT5Ceen2WPLI/oCA3xMcZ5sWMF/D46SjM/ayY0Oo=
github.com/ethereum-optimism/optimism/op-bindings v0.8.
8 h1:HN625JI2VsRsli+U6GAXipg7lAKx8EOmGIovN79Az+I
=
github.com/ethereum-optimism/optimism/op-bindings v0.8.
9 h1:QeYLhgZP0QkDLxyXhkWLj/iHDFkMNI18abgrHL4I9TE
=
github.com/ethereum-optimism/optimism/op-bindings v0.8.
8
/go.mod h1:pyTCbh2o/SY+5/AL2Qo5GgAao3Gtt9Ff6tfK9Pa9emM=
github.com/ethereum-optimism/optimism/op-bindings v0.8.
9
/go.mod h1:pyTCbh2o/SY+5/AL2Qo5GgAao3Gtt9Ff6tfK9Pa9emM=
github.com/ethereum-optimism/optimism/op-node v0.8.
8 h1:WuZF1RsZnB+u/wwWToVaC1lZWfGfgncLusUssA3Hm+o
=
github.com/ethereum-optimism/optimism/op-node v0.8.
9 h1:wUxvjeHB1nQtnsxbNxqHthSS+Uune7Xb17NWXDBdSXI
=
github.com/ethereum-optimism/optimism/op-node v0.8.
8/go.mod h1:O5nXPCx8vn9c/CHgBC7vP5utcanIQ4uhWKkJ3pAaaSQ
=
github.com/ethereum-optimism/optimism/op-node v0.8.
9/go.mod h1:ETNw9UP6sy/pWf6aoNHEgQKrXN2ca0Fm0OqIbCEghYk
=
github.com/ethereum-optimism/optimism/op-proposer v0.8.
8 h1:IV0P64q7RJ52yvLMBLAKyqeDOxdQPGHbhmIXGkMKG/8
=
github.com/ethereum-optimism/optimism/op-proposer v0.8.
9 h1:affd05NB0zxYJA/aCXEwDtaH1kcZfu3b3mnJTn94v74
=
github.com/ethereum-optimism/optimism/op-proposer v0.8.
8/go.mod h1:PSNjVKZQxjlkDTcXnoCt3Aeo6N6nY0Ma+R+ZHOTsXU8
=
github.com/ethereum-optimism/optimism/op-proposer v0.8.
9/go.mod h1:00UGw9VkWSv/0TyltXqU2NGsp4QaWVPzLZ4zvpUGbhU
=
github.com/ethereum-optimism/optimism/op-service v0.8.
8 h1:k5E78Zr2cGU0SwjoHpFXuC1eyfXhu3oKEOnDDaFi57I
=
github.com/ethereum-optimism/optimism/op-service v0.8.
9 h1:YdMBcgXi+NHqX3pKR6UhjGHtBeF8AQK6kLmwpv7LzJM
=
github.com/ethereum-optimism/optimism/op-service v0.8.
8
/go.mod h1:K0uybOhICTc2yfhrRj0cD1m7aPkOf5C9e6bUmvf4rGA=
github.com/ethereum-optimism/optimism/op-service v0.8.
9
/go.mod h1:K0uybOhICTc2yfhrRj0cD1m7aPkOf5C9e6bUmvf4rGA=
github.com/ethereum/go-ethereum v1.10.4/go.mod h1:nEE0TP5MtxGzOMd7egIrbPJMQBnhVU3ELNxhBglIzhg=
github.com/ethereum/go-ethereum v1.10.4/go.mod h1:nEE0TP5MtxGzOMd7egIrbPJMQBnhVU3ELNxhBglIzhg=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0=
github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0=
...
...
op-chain-ops/go.mod
View file @
c16d9ab7
...
@@ -4,7 +4,7 @@ go 1.18
...
@@ -4,7 +4,7 @@ go 1.18
require (
require (
github.com/ethereum-optimism/optimism/l2geth v0.0.0-20220820030939-de38b6f6f77e
github.com/ethereum-optimism/optimism/l2geth v0.0.0-20220820030939-de38b6f6f77e
github.com/ethereum-optimism/optimism/op-bindings v0.8.
8
github.com/ethereum-optimism/optimism/op-bindings v0.8.
9
github.com/ethereum/go-ethereum v1.10.23
github.com/ethereum/go-ethereum v1.10.23
github.com/holiman/uint256 v1.2.0
github.com/holiman/uint256 v1.2.0
github.com/mattn/go-isatty v0.0.14
github.com/mattn/go-isatty v0.0.14
...
...
op-chain-ops/go.sum
View file @
c16d9ab7
...
@@ -176,8 +176,8 @@ github.com/ethereum-optimism/op-geth v0.0.0-20220926184707-53d23c240afd h1:NchOn
...
@@ -176,8 +176,8 @@ github.com/ethereum-optimism/op-geth v0.0.0-20220926184707-53d23c240afd h1:NchOn
github.com/ethereum-optimism/op-geth v0.0.0-20220926184707-53d23c240afd/go.mod h1:/6CsT5Ceen2WPLI/oCA3xMcZ5sWMF/D46SjM/ayY0Oo=
github.com/ethereum-optimism/op-geth v0.0.0-20220926184707-53d23c240afd/go.mod h1:/6CsT5Ceen2WPLI/oCA3xMcZ5sWMF/D46SjM/ayY0Oo=
github.com/ethereum-optimism/optimism/l2geth v0.0.0-20220820030939-de38b6f6f77e h1:LUfy9ofKcen9Cm1T9JyGNnrPLR2AmyelFbohS6bs4X8=
github.com/ethereum-optimism/optimism/l2geth v0.0.0-20220820030939-de38b6f6f77e h1:LUfy9ofKcen9Cm1T9JyGNnrPLR2AmyelFbohS6bs4X8=
github.com/ethereum-optimism/optimism/l2geth v0.0.0-20220820030939-de38b6f6f77e/go.mod h1:Oj5A6Qs/Ao1SP17i3uKroyhz49q/ehagSXRAlvwaI5Y=
github.com/ethereum-optimism/optimism/l2geth v0.0.0-20220820030939-de38b6f6f77e/go.mod h1:Oj5A6Qs/Ao1SP17i3uKroyhz49q/ehagSXRAlvwaI5Y=
github.com/ethereum-optimism/optimism/op-bindings v0.8.
8 h1:HN625JI2VsRsli+U6GAXipg7lAKx8EOmGIovN79Az+I
=
github.com/ethereum-optimism/optimism/op-bindings v0.8.
9 h1:QeYLhgZP0QkDLxyXhkWLj/iHDFkMNI18abgrHL4I9TE
=
github.com/ethereum-optimism/optimism/op-bindings v0.8.
8
/go.mod h1:pyTCbh2o/SY+5/AL2Qo5GgAao3Gtt9Ff6tfK9Pa9emM=
github.com/ethereum-optimism/optimism/op-bindings v0.8.
9
/go.mod h1:pyTCbh2o/SY+5/AL2Qo5GgAao3Gtt9Ff6tfK9Pa9emM=
github.com/ethereum/go-ethereum v1.10.4/go.mod h1:nEE0TP5MtxGzOMd7egIrbPJMQBnhVU3ELNxhBglIzhg=
github.com/ethereum/go-ethereum v1.10.4/go.mod h1:nEE0TP5MtxGzOMd7egIrbPJMQBnhVU3ELNxhBglIzhg=
github.com/ethereum/go-ethereum v1.10.16/go.mod h1:Anj6cxczl+AHy63o4X9O8yWNHuN5wMpfb8MAnHkWn7Y=
github.com/ethereum/go-ethereum v1.10.16/go.mod h1:Anj6cxczl+AHy63o4X9O8yWNHuN5wMpfb8MAnHkWn7Y=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
...
...
op-e2e/go.mod
View file @
c16d9ab7
...
@@ -3,12 +3,12 @@ module github.com/ethereum-optimism/optimism/op-e2e
...
@@ -3,12 +3,12 @@ module github.com/ethereum-optimism/optimism/op-e2e
go 1.18
go 1.18
require (
require (
github.com/ethereum-optimism/optimism/op-batcher v0.8.
8
github.com/ethereum-optimism/optimism/op-batcher v0.8.
9
github.com/ethereum-optimism/optimism/op-bindings v0.8.
8
github.com/ethereum-optimism/optimism/op-bindings v0.8.
9
github.com/ethereum-optimism/optimism/op-chain-ops v0.8.
8
github.com/ethereum-optimism/optimism/op-chain-ops v0.8.
9
github.com/ethereum-optimism/optimism/op-node v0.8.
8
github.com/ethereum-optimism/optimism/op-node v0.8.
9
github.com/ethereum-optimism/optimism/op-proposer v0.8.
8
github.com/ethereum-optimism/optimism/op-proposer v0.8.
9
github.com/ethereum-optimism/optimism/op-service v0.8.
8
github.com/ethereum-optimism/optimism/op-service v0.8.
9
github.com/ethereum/go-ethereum v1.10.23
github.com/ethereum/go-ethereum v1.10.23
github.com/libp2p/go-libp2p v0.21.0
github.com/libp2p/go-libp2p v0.21.0
github.com/libp2p/go-libp2p-core v0.19.1
github.com/libp2p/go-libp2p-core v0.19.1
...
...
op-e2e/go.sum
View file @
c16d9ab7
...
@@ -241,18 +241,18 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.m
...
@@ -241,18 +241,18 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.m
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/ethereum-optimism/op-geth v0.0.0-20220926184707-53d23c240afd h1:NchOnosWOkH9wlix8QevGHE+6vuRa+OMGvDNsczv2kQ=
github.com/ethereum-optimism/op-geth v0.0.0-20220926184707-53d23c240afd h1:NchOnosWOkH9wlix8QevGHE+6vuRa+OMGvDNsczv2kQ=
github.com/ethereum-optimism/op-geth v0.0.0-20220926184707-53d23c240afd/go.mod h1:/6CsT5Ceen2WPLI/oCA3xMcZ5sWMF/D46SjM/ayY0Oo=
github.com/ethereum-optimism/op-geth v0.0.0-20220926184707-53d23c240afd/go.mod h1:/6CsT5Ceen2WPLI/oCA3xMcZ5sWMF/D46SjM/ayY0Oo=
github.com/ethereum-optimism/optimism/op-batcher v0.8.
8 h1:raKQUL3eQtWyJ+BNYPz7IN8aWIO5Dk+XPfNXjaTUFvM
=
github.com/ethereum-optimism/optimism/op-batcher v0.8.
9 h1:toKo/4yjwLX7J/C/Fi9hH3jd2TYAWwxUc9VPpR/Dv+A
=
github.com/ethereum-optimism/optimism/op-batcher v0.8.
8/go.mod h1:RnDJ6ilMHfvNhKwlTt4uhxABH8dbQ8arXdZjCvUI+8A
=
github.com/ethereum-optimism/optimism/op-batcher v0.8.
9/go.mod h1:iRw9zIuH0mV+zg7gpUeMHGuGsAWcFdIqzQdRMkW1fvQ
=
github.com/ethereum-optimism/optimism/op-bindings v0.8.
8 h1:HN625JI2VsRsli+U6GAXipg7lAKx8EOmGIovN79Az+I
=
github.com/ethereum-optimism/optimism/op-bindings v0.8.
9 h1:QeYLhgZP0QkDLxyXhkWLj/iHDFkMNI18abgrHL4I9TE
=
github.com/ethereum-optimism/optimism/op-bindings v0.8.
8
/go.mod h1:pyTCbh2o/SY+5/AL2Qo5GgAao3Gtt9Ff6tfK9Pa9emM=
github.com/ethereum-optimism/optimism/op-bindings v0.8.
9
/go.mod h1:pyTCbh2o/SY+5/AL2Qo5GgAao3Gtt9Ff6tfK9Pa9emM=
github.com/ethereum-optimism/optimism/op-chain-ops v0.8.
8 h1:wNn80nhMW4srM/TvA785mikElpPJhEtTLBBuYFxjUCM
=
github.com/ethereum-optimism/optimism/op-chain-ops v0.8.
9 h1:Z8174lRVnvw1r8w0OS0vOrFXcAg6635WuqHObZSJzKs
=
github.com/ethereum-optimism/optimism/op-chain-ops v0.8.
8/go.mod h1:l9YB+bMCfYZV6rjcC6XL0VHa+6hkgdVPioHwBL9u6r8
=
github.com/ethereum-optimism/optimism/op-chain-ops v0.8.
9/go.mod h1:Y+on77cEP5Kn6Jc2aX24d3zk2lvT76KaUlTQSn7zesU
=
github.com/ethereum-optimism/optimism/op-node v0.8.
8 h1:WuZF1RsZnB+u/wwWToVaC1lZWfGfgncLusUssA3Hm+o
=
github.com/ethereum-optimism/optimism/op-node v0.8.
9 h1:wUxvjeHB1nQtnsxbNxqHthSS+Uune7Xb17NWXDBdSXI
=
github.com/ethereum-optimism/optimism/op-node v0.8.
8/go.mod h1:O5nXPCx8vn9c/CHgBC7vP5utcanIQ4uhWKkJ3pAaaSQ
=
github.com/ethereum-optimism/optimism/op-node v0.8.
9/go.mod h1:ETNw9UP6sy/pWf6aoNHEgQKrXN2ca0Fm0OqIbCEghYk
=
github.com/ethereum-optimism/optimism/op-proposer v0.8.
8 h1:IV0P64q7RJ52yvLMBLAKyqeDOxdQPGHbhmIXGkMKG/8
=
github.com/ethereum-optimism/optimism/op-proposer v0.8.
9 h1:affd05NB0zxYJA/aCXEwDtaH1kcZfu3b3mnJTn94v74
=
github.com/ethereum-optimism/optimism/op-proposer v0.8.
8/go.mod h1:PSNjVKZQxjlkDTcXnoCt3Aeo6N6nY0Ma+R+ZHOTsXU8
=
github.com/ethereum-optimism/optimism/op-proposer v0.8.
9/go.mod h1:00UGw9VkWSv/0TyltXqU2NGsp4QaWVPzLZ4zvpUGbhU
=
github.com/ethereum-optimism/optimism/op-service v0.8.
8 h1:k5E78Zr2cGU0SwjoHpFXuC1eyfXhu3oKEOnDDaFi57I
=
github.com/ethereum-optimism/optimism/op-service v0.8.
9 h1:YdMBcgXi+NHqX3pKR6UhjGHtBeF8AQK6kLmwpv7LzJM
=
github.com/ethereum-optimism/optimism/op-service v0.8.
8
/go.mod h1:K0uybOhICTc2yfhrRj0cD1m7aPkOf5C9e6bUmvf4rGA=
github.com/ethereum-optimism/optimism/op-service v0.8.
9
/go.mod h1:K0uybOhICTc2yfhrRj0cD1m7aPkOf5C9e6bUmvf4rGA=
github.com/ethereum/go-ethereum v1.10.4/go.mod h1:nEE0TP5MtxGzOMd7egIrbPJMQBnhVU3ELNxhBglIzhg=
github.com/ethereum/go-ethereum v1.10.4/go.mod h1:nEE0TP5MtxGzOMd7egIrbPJMQBnhVU3ELNxhBglIzhg=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0=
github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0=
...
...
op-node/go.mod
View file @
c16d9ab7
...
@@ -5,8 +5,8 @@ go 1.18
...
@@ -5,8 +5,8 @@ go 1.18
require (
require (
github.com/btcsuite/btcd/btcec/v2 v2.2.0
github.com/btcsuite/btcd/btcec/v2 v2.2.0
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1
github.com/ethereum-optimism/optimism/op-bindings v0.8.
8
github.com/ethereum-optimism/optimism/op-bindings v0.8.
9
github.com/ethereum-optimism/optimism/op-chain-ops v0.8.
8
github.com/ethereum-optimism/optimism/op-chain-ops v0.8.
9
github.com/ethereum/go-ethereum v1.10.23
github.com/ethereum/go-ethereum v1.10.23
github.com/golang/snappy v0.0.4
github.com/golang/snappy v0.0.4
github.com/google/go-cmp v0.5.8
github.com/google/go-cmp v0.5.8
...
...
op-node/go.sum
View file @
c16d9ab7
...
@@ -190,10 +190,10 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.m
...
@@ -190,10 +190,10 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.m
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/ethereum-optimism/op-geth v0.0.0-20220926184707-53d23c240afd h1:NchOnosWOkH9wlix8QevGHE+6vuRa+OMGvDNsczv2kQ=
github.com/ethereum-optimism/op-geth v0.0.0-20220926184707-53d23c240afd h1:NchOnosWOkH9wlix8QevGHE+6vuRa+OMGvDNsczv2kQ=
github.com/ethereum-optimism/op-geth v0.0.0-20220926184707-53d23c240afd/go.mod h1:/6CsT5Ceen2WPLI/oCA3xMcZ5sWMF/D46SjM/ayY0Oo=
github.com/ethereum-optimism/op-geth v0.0.0-20220926184707-53d23c240afd/go.mod h1:/6CsT5Ceen2WPLI/oCA3xMcZ5sWMF/D46SjM/ayY0Oo=
github.com/ethereum-optimism/optimism/op-bindings v0.8.
8 h1:HN625JI2VsRsli+U6GAXipg7lAKx8EOmGIovN79Az+I
=
github.com/ethereum-optimism/optimism/op-bindings v0.8.
9 h1:QeYLhgZP0QkDLxyXhkWLj/iHDFkMNI18abgrHL4I9TE
=
github.com/ethereum-optimism/optimism/op-bindings v0.8.
8
/go.mod h1:pyTCbh2o/SY+5/AL2Qo5GgAao3Gtt9Ff6tfK9Pa9emM=
github.com/ethereum-optimism/optimism/op-bindings v0.8.
9
/go.mod h1:pyTCbh2o/SY+5/AL2Qo5GgAao3Gtt9Ff6tfK9Pa9emM=
github.com/ethereum-optimism/optimism/op-chain-ops v0.8.
8 h1:wNn80nhMW4srM/TvA785mikElpPJhEtTLBBuYFxjUCM
=
github.com/ethereum-optimism/optimism/op-chain-ops v0.8.
9 h1:Z8174lRVnvw1r8w0OS0vOrFXcAg6635WuqHObZSJzKs
=
github.com/ethereum-optimism/optimism/op-chain-ops v0.8.
8/go.mod h1:l9YB+bMCfYZV6rjcC6XL0VHa+6hkgdVPioHwBL9u6r8
=
github.com/ethereum-optimism/optimism/op-chain-ops v0.8.
9/go.mod h1:Y+on77cEP5Kn6Jc2aX24d3zk2lvT76KaUlTQSn7zesU
=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fjl/memsize v0.0.1 h1:+zhkb+dhUgx0/e+M8sF0QqiouvMQUiKR+QYvdxIOKcQ=
github.com/fjl/memsize v0.0.1 h1:+zhkb+dhUgx0/e+M8sF0QqiouvMQUiKR+QYvdxIOKcQ=
github.com/fjl/memsize v0.0.1/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0=
github.com/fjl/memsize v0.0.1/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0=
...
...
op-node/rollup/derive/engine_queue_test.go
View file @
c16d9ab7
...
@@ -8,12 +8,13 @@ import (
...
@@ -8,12 +8,13 @@ import (
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
)
)
type
fakeAttributesQueue
struct
{
type
fakeAttributesQueue
struct
{
...
@@ -193,7 +194,7 @@ func TestEngineQueue_Finalize(t *testing.T) {
...
@@ -193,7 +194,7 @@ func TestEngineQueue_Finalize(t *testing.T) {
t
.
Log
(
"refF0"
,
refF0
.
Hash
)
t
.
Log
(
"refF0"
,
refF0
.
Hash
)
t
.
Log
(
"refF1"
,
refF1
.
Hash
)
t
.
Log
(
"refF1"
,
refF1
.
Hash
)
metrics
:=
&
Test
Metrics
{}
metrics
:=
&
testutils
.
TestDerivation
Metrics
{}
eng
:=
&
testutils
.
MockEngine
{}
eng
:=
&
testutils
.
MockEngine
{}
// we find the common point to initialize to by comparing the L1 origins in the L2 chain with the L1 chain
// we find the common point to initialize to by comparing the L1 origins in the L2 chain with the L1 chain
l1F
:=
&
testutils
.
MockL1Source
{}
l1F
:=
&
testutils
.
MockL1Source
{}
...
...
op-node/rollup/derive/fuzz_parsers_test.go
View file @
c16d9ab7
...
@@ -9,6 +9,7 @@ import (
...
@@ -9,6 +9,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
"github.com/ethereum-optimism/optimism/op-bindings/bindings"
"github.com/ethereum-optimism/optimism/op-bindings/bindings"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/accounts/abi"
"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"
...
@@ -40,14 +41,6 @@ func BytesToBigInt(b []byte) *big.Int {
...
@@ -40,14 +41,6 @@ func BytesToBigInt(b []byte) *big.Int {
return
new
(
big
.
Int
)
.
SetBytes
(
cap_byte_slice
(
b
,
32
))
return
new
(
big
.
Int
)
.
SetBytes
(
cap_byte_slice
(
b
,
32
))
}
}
func
BigEqual
(
a
,
b
*
big
.
Int
)
bool
{
if
a
==
nil
||
b
==
nil
{
return
a
==
b
}
else
{
return
a
.
Cmp
(
b
)
==
0
}
}
// FuzzL1InfoRoundTrip checks that our encoder round trips properly
// FuzzL1InfoRoundTrip checks that our encoder round trips properly
func
FuzzL1InfoRoundTrip
(
f
*
testing
.
F
)
{
func
FuzzL1InfoRoundTrip
(
f
*
testing
.
F
)
{
f
.
Fuzz
(
func
(
t
*
testing
.
T
,
number
,
time
uint64
,
baseFee
,
hash
[]
byte
,
seqNumber
uint64
)
{
f
.
Fuzz
(
func
(
t
*
testing
.
T
,
number
,
time
uint64
,
baseFee
,
hash
[]
byte
,
seqNumber
uint64
)
{
...
@@ -67,7 +60,7 @@ func FuzzL1InfoRoundTrip(f *testing.F) {
...
@@ -67,7 +60,7 @@ func FuzzL1InfoRoundTrip(f *testing.F) {
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatalf
(
"Failed to unmarshal binary: %v"
,
err
)
t
.
Fatalf
(
"Failed to unmarshal binary: %v"
,
err
)
}
}
if
!
cmp
.
Equal
(
in
,
out
,
cmp
.
Comparer
(
BigEqual
))
{
if
!
cmp
.
Equal
(
in
,
out
,
cmp
.
Comparer
(
testutils
.
BigEqual
))
{
t
.
Fatalf
(
"The data did not round trip correctly. in: %v. out: %v"
,
in
,
out
)
t
.
Fatalf
(
"The data did not round trip correctly. in: %v. out: %v"
,
in
,
out
)
}
}
...
@@ -120,7 +113,7 @@ func FuzzL1InfoAgainstContract(f *testing.F) {
...
@@ -120,7 +113,7 @@ func FuzzL1InfoAgainstContract(f *testing.F) {
t
.
Fatalf
(
"Failed to unmarshal binary: %v"
,
err
)
t
.
Fatalf
(
"Failed to unmarshal binary: %v"
,
err
)
}
}
if
!
cmp
.
Equal
(
expected
,
actual
,
cmp
.
Comparer
(
BigEqual
))
{
if
!
cmp
.
Equal
(
expected
,
actual
,
cmp
.
Comparer
(
testutils
.
BigEqual
))
{
t
.
Fatalf
(
"The data did not round trip correctly. expected: %v. actual: %v"
,
expected
,
actual
)
t
.
Fatalf
(
"The data did not round trip correctly. expected: %v. actual: %v"
,
expected
,
actual
)
}
}
...
@@ -266,7 +259,7 @@ func FuzzUnmarshallLogEvent(f *testing.F) {
...
@@ -266,7 +259,7 @@ func FuzzUnmarshallLogEvent(f *testing.F) {
reconstructed
.
To
=
*
dep
.
To
reconstructed
.
To
=
*
dep
.
To
}
}
if
!
cmp
.
Equal
(
depositEvent
,
reconstructed
,
cmp
.
Comparer
(
BigEqual
))
{
if
!
cmp
.
Equal
(
depositEvent
,
reconstructed
,
cmp
.
Comparer
(
testutils
.
BigEqual
))
{
t
.
Fatalf
(
"The deposit tx did not match. tx: %v. actual: %v"
,
reconstructed
,
depositEvent
)
t
.
Fatalf
(
"The deposit tx did not match. tx: %v. actual: %v"
,
reconstructed
,
depositEvent
)
}
}
...
@@ -279,7 +272,7 @@ func FuzzUnmarshallLogEvent(f *testing.F) {
...
@@ -279,7 +272,7 @@ func FuzzUnmarshallLogEvent(f *testing.F) {
OpaqueData
:
opaqueData
,
OpaqueData
:
opaqueData
,
Raw
:
types
.
Log
{},
Raw
:
types
.
Log
{},
}
}
if
!
cmp
.
Equal
(
depositEvent
,
inputArgs
,
cmp
.
Comparer
(
BigEqual
))
{
if
!
cmp
.
Equal
(
depositEvent
,
inputArgs
,
cmp
.
Comparer
(
testutils
.
BigEqual
))
{
t
.
Fatalf
(
"The input args did not match. input: %v. actual: %v"
,
inputArgs
,
depositEvent
)
t
.
Fatalf
(
"The input args did not match. input: %v. actual: %v"
,
inputArgs
,
depositEvent
)
}
}
})
})
...
...
op-node/rollup/derive/pipeline_test.go
View file @
c16d9ab7
...
@@ -7,7 +7,6 @@ import (
...
@@ -7,7 +7,6 @@ import (
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/mock"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum-optimism/optimism/op-node/testutils"
)
)
...
@@ -60,30 +59,4 @@ func RepeatStep(t *testing.T, step func(ctx context.Context, outer Progress) err
...
@@ -60,30 +59,4 @@ func RepeatStep(t *testing.T, step func(ctx context.Context, outer Progress) err
return
nil
return
nil
}
}
// TestMetrics implements the metrics used in the derivation pipeline as no-op operations.
var
_
Metrics
=
(
*
testutils
.
TestDerivationMetrics
)(
nil
)
// Optionally a test may hook into the metrics
type
TestMetrics
struct
{
recordL1Ref
func
(
name
string
,
ref
eth
.
L1BlockRef
)
recordL2Ref
func
(
name
string
,
ref
eth
.
L2BlockRef
)
recordUnsafePayloads
func
(
length
uint64
,
memSize
uint64
,
next
eth
.
BlockID
)
}
func
(
t
*
TestMetrics
)
RecordL1Ref
(
name
string
,
ref
eth
.
L1BlockRef
)
{
if
t
.
recordL1Ref
!=
nil
{
t
.
recordL1Ref
(
name
,
ref
)
}
}
func
(
t
*
TestMetrics
)
RecordL2Ref
(
name
string
,
ref
eth
.
L2BlockRef
)
{
if
t
.
recordL2Ref
!=
nil
{
t
.
recordL2Ref
(
name
,
ref
)
}
}
func
(
t
*
TestMetrics
)
RecordUnsafePayloadsBuffer
(
length
uint64
,
memSize
uint64
,
next
eth
.
BlockID
)
{
if
t
.
recordUnsafePayloads
!=
nil
{
t
.
recordUnsafePayloads
(
length
,
memSize
,
next
)
}
}
var
_
Metrics
=
(
*
TestMetrics
)(
nil
)
op-node/testutils/assertions.go
0 → 100644
View file @
c16d9ab7
package
testutils
import
(
"math/big"
"testing"
)
func
BigEqual
(
a
,
b
*
big
.
Int
)
bool
{
if
a
==
nil
||
b
==
nil
{
return
a
==
b
}
else
{
return
a
.
Cmp
(
b
)
==
0
}
}
func
RequireBigEqual
(
t
*
testing
.
T
,
exp
,
actual
*
big
.
Int
)
{
if
!
BigEqual
(
exp
,
actual
)
{
t
.
Fatalf
(
"expected %s to be equal to %s"
,
exp
.
String
(),
actual
.
String
())
}
}
op-node/testutils/metrics.go
0 → 100644
View file @
c16d9ab7
package
testutils
import
"github.com/ethereum-optimism/optimism/op-node/eth"
// TestDerivationMetrics implements the metrics used in the derivation pipeline as no-op operations.
// Optionally a test may hook into the metrics
type
TestDerivationMetrics
struct
{
FnRecordL1Ref
func
(
name
string
,
ref
eth
.
L1BlockRef
)
FnRecordL2Ref
func
(
name
string
,
ref
eth
.
L2BlockRef
)
FnRecordUnsafePayloads
func
(
length
uint64
,
memSize
uint64
,
next
eth
.
BlockID
)
}
func
(
t
*
TestDerivationMetrics
)
RecordL1Ref
(
name
string
,
ref
eth
.
L1BlockRef
)
{
if
t
.
FnRecordL1Ref
!=
nil
{
t
.
FnRecordL1Ref
(
name
,
ref
)
}
}
func
(
t
*
TestDerivationMetrics
)
RecordL2Ref
(
name
string
,
ref
eth
.
L2BlockRef
)
{
if
t
.
FnRecordL2Ref
!=
nil
{
t
.
FnRecordL2Ref
(
name
,
ref
)
}
}
func
(
t
*
TestDerivationMetrics
)
RecordUnsafePayloadsBuffer
(
length
uint64
,
memSize
uint64
,
next
eth
.
BlockID
)
{
if
t
.
FnRecordUnsafePayloads
!=
nil
{
t
.
FnRecordUnsafePayloads
(
length
,
memSize
,
next
)
}
}
op-node/withdrawals/testdata/bridge-withdrawal.json
0 → 100644
View file @
c16d9ab7
{
"type"
:
"0x2"
,
"root"
:
"0x"
,
"status"
:
"0x1"
,
"cumulativeGasUsed"
:
"0x28786"
,
"logsBloom"
:
"0x0000000000004000001000000000000000000000000000100010000000100000000000000000808000000000020400800000000000000004000010000000000000002000000004004000000800000010040000000000000000000000000000000000000012000000000000000000080088080000000200000000001c000000000200000000000000000040000100000000800000000000000001000000201000000000000002004201008000000001000000200000400000000000000000100000000052000200000100000408020010000002100000000000040000200020000000000000000200000100400000000000000000000000000001100000000000"
,
"logs"
:
[
{
"address"
:
"0x7c6b91d9be155a6db01f749217d76ff02a7227f2"
,
"topics"
:
[
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"
,
"0x000000000000000000000000c20c5ec92fda6e611a08485123cdc0d5b84bd3a2"
,
"0x0000000000000000000000000000000000000000000000000000000000000000"
],
"data"
:
"0x00000000000000000000000000000000000000000000000000000000000001f4"
,
"blockNumber"
:
"0x36"
,
"transactionHash"
:
"0x9346381068b59d2098495baa72ed2f773c1e09458610a7a208984859dff73add"
,
"transactionIndex"
:
"0x1"
,
"blockHash"
:
"0xfdd4ad8a984b45687aca0463db491cbd0e85273d970019a3f8bf618b614938df"
,
"logIndex"
:
"0x0"
,
"removed"
:
false
},
{
"address"
:
"0x7c6b91d9be155a6db01f749217d76ff02a7227f2"
,
"topics"
:
[
"0xcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5"
,
"0x000000000000000000000000c20c5ec92fda6e611a08485123cdc0d5b84bd3a2"
],
"data"
:
"0x00000000000000000000000000000000000000000000000000000000000001f4"
,
"blockNumber"
:
"0x36"
,
"transactionHash"
:
"0x9346381068b59d2098495baa72ed2f773c1e09458610a7a208984859dff73add"
,
"transactionIndex"
:
"0x1"
,
"blockHash"
:
"0xfdd4ad8a984b45687aca0463db491cbd0e85273d970019a3f8bf618b614938df"
,
"logIndex"
:
"0x1"
,
"removed"
:
false
},
{
"address"
:
"0x4200000000000000000000000000000000000016"
,
"topics"
:
[
"0x87bf7b546c8de873abb0db5b579ec131f8d0cf5b14f39933551cf9ced23a6136"
,
"0x0000000000000000000000000000000000000000000000000000000000000000"
,
"0x0000000000000000000000004200000000000000000000000000000000000007"
,
"0x0000000000000000000000006900000000000000000000000000000000000002"
],
"data"
:
"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000031b80000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001e4d764ad0b0001000000000000000000000000000000000000000000000000000000000000000000000000000000000000420000000000000000000000000000000000001000000000000000000000000069000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000e40166a07a00000000000000000000000089d51be807d98fc974a0f41b2e67a8228d7846ef0000000000000000000000007c6b91d9be155a6db01f749217d76ff02a7227f2000000000000000000000000c20c5ec92fda6e611a08485123cdc0d5b84bd3a2000000000000000000000000c20c5ec92fda6e611a08485123cdc0d5b84bd3a200000000000000000000000000000000000000000000000000000000000001f400000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
,
"blockNumber"
:
"0x36"
,
"transactionHash"
:
"0x9346381068b59d2098495baa72ed2f773c1e09458610a7a208984859dff73add"
,
"transactionIndex"
:
"0x1"
,
"blockHash"
:
"0xfdd4ad8a984b45687aca0463db491cbd0e85273d970019a3f8bf618b614938df"
,
"logIndex"
:
"0x2"
,
"removed"
:
false
},
{
"address"
:
"0x4200000000000000000000000000000000000016"
,
"topics"
:
[
"0x2ef6ceb1668fdd882b1f89ddd53a666b0c1113d14cf90c0fbf97c7b1ad880fbb"
,
"0x0d827f8148288e3a2466018f71b968ece4ea9f9e2a81c30da9bd46cce2868285"
],
"data"
:
"0x"
,
"blockNumber"
:
"0x36"
,
"transactionHash"
:
"0x9346381068b59d2098495baa72ed2f773c1e09458610a7a208984859dff73add"
,
"transactionIndex"
:
"0x1"
,
"blockHash"
:
"0xfdd4ad8a984b45687aca0463db491cbd0e85273d970019a3f8bf618b614938df"
,
"logIndex"
:
"0x3"
,
"removed"
:
false
},
{
"address"
:
"0x4200000000000000000000000000000000000007"
,
"topics"
:
[
"0xcb0f7ffd78f9aee47a248fae8db181db6eee833039123e026dcbff529522e52a"
,
"0x0000000000000000000000006900000000000000000000000000000000000003"
],
"data"
:
"0x000000000000000000000000420000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000800001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e40166a07a00000000000000000000000089d51be807d98fc974a0f41b2e67a8228d7846ef0000000000000000000000007c6b91d9be155a6db01f749217d76ff02a7227f2000000000000000000000000c20c5ec92fda6e611a08485123cdc0d5b84bd3a2000000000000000000000000c20c5ec92fda6e611a08485123cdc0d5b84bd3a200000000000000000000000000000000000000000000000000000000000001f400000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
,
"blockNumber"
:
"0x36"
,
"transactionHash"
:
"0x9346381068b59d2098495baa72ed2f773c1e09458610a7a208984859dff73add"
,
"transactionIndex"
:
"0x1"
,
"blockHash"
:
"0xfdd4ad8a984b45687aca0463db491cbd0e85273d970019a3f8bf618b614938df"
,
"logIndex"
:
"0x4"
,
"removed"
:
false
},
{
"address"
:
"0x4200000000000000000000000000000000000007"
,
"topics"
:
[
"0x8ebb2ec2465bdb2a06a66fc37a0963af8a2a6a1479d81d56fdb8cbb98096d546"
,
"0x0000000000000000000000004200000000000000000000000000000000000010"
],
"data"
:
"0x0000000000000000000000000000000000000000000000000000000000000000"
,
"blockNumber"
:
"0x36"
,
"transactionHash"
:
"0x9346381068b59d2098495baa72ed2f773c1e09458610a7a208984859dff73add"
,
"transactionIndex"
:
"0x1"
,
"blockHash"
:
"0xfdd4ad8a984b45687aca0463db491cbd0e85273d970019a3f8bf618b614938df"
,
"logIndex"
:
"0x5"
,
"removed"
:
false
},
{
"address"
:
"0x4200000000000000000000000000000000000010"
,
"topics"
:
[
"0x7ff126db8024424bbfd9826e8ab82ff59136289ea440b04b39a0df1b03b9cabf"
,
"0x0000000000000000000000007c6b91d9be155a6db01f749217d76ff02a7227f2"
,
"0x00000000000000000000000089d51be807d98fc974a0f41b2e67a8228d7846ef"
,
"0x000000000000000000000000c20c5ec92fda6e611a08485123cdc0d5b84bd3a2"
],
"data"
:
"0x000000000000000000000000c20c5ec92fda6e611a08485123cdc0d5b84bd3a200000000000000000000000000000000000000000000000000000000000001f400000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000"
,
"blockNumber"
:
"0x36"
,
"transactionHash"
:
"0x9346381068b59d2098495baa72ed2f773c1e09458610a7a208984859dff73add"
,
"transactionIndex"
:
"0x1"
,
"blockHash"
:
"0xfdd4ad8a984b45687aca0463db491cbd0e85273d970019a3f8bf618b614938df"
,
"logIndex"
:
"0x6"
,
"removed"
:
false
},
{
"address"
:
"0x4200000000000000000000000000000000000010"
,
"topics"
:
[
"0x73d170910aba9e6d50b102db522b1dbcd796216f5128b445aa2135272886497e"
,
"0x00000000000000000000000089d51be807d98fc974a0f41b2e67a8228d7846ef"
,
"0x0000000000000000000000007c6b91d9be155a6db01f749217d76ff02a7227f2"
,
"0x000000000000000000000000c20c5ec92fda6e611a08485123cdc0d5b84bd3a2"
],
"data"
:
"0x000000000000000000000000c20c5ec92fda6e611a08485123cdc0d5b84bd3a200000000000000000000000000000000000000000000000000000000000001f400000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000"
,
"blockNumber"
:
"0x36"
,
"transactionHash"
:
"0x9346381068b59d2098495baa72ed2f773c1e09458610a7a208984859dff73add"
,
"transactionIndex"
:
"0x1"
,
"blockHash"
:
"0xfdd4ad8a984b45687aca0463db491cbd0e85273d970019a3f8bf618b614938df"
,
"logIndex"
:
"0x7"
,
"removed"
:
false
}
],
"transactionHash"
:
"0x9346381068b59d2098495baa72ed2f773c1e09458610a7a208984859dff73add"
,
"contractAddress"
:
"0x0000000000000000000000000000000000000000"
,
"gasUsed"
:
"0x28786"
,
"blockHash"
:
"0xfdd4ad8a984b45687aca0463db491cbd0e85273d970019a3f8bf618b614938df"
,
"blockNumber"
:
"0x36"
,
"transactionIndex"
:
"0x1"
}
\ No newline at end of file
op-node/withdrawals/utils.go
View file @
c16d9ab7
...
@@ -21,6 +21,9 @@ import (
...
@@ -21,6 +21,9 @@ import (
"github.com/ethereum/go-ethereum/rpc"
"github.com/ethereum/go-ethereum/rpc"
)
)
var
WithdrawalInitiatedTopic
=
crypto
.
Keccak256Hash
([]
byte
(
"WithdrawalInitiated(uint256,address,address,uint256,uint256,bytes)"
))
var
WithdrawalInitiatedExtension1Topic
=
crypto
.
Keccak256Hash
([]
byte
(
"WithdrawalInitiatedExtension1(bytes32)"
))
// WaitForFinalizationPeriod waits until there is OutputProof for an L2 block number larger than the supplied l2BlockNumber
// WaitForFinalizationPeriod waits until there is OutputProof for an L2 block number larger than the supplied l2BlockNumber
// and that the output is finalized.
// and that the output is finalized.
// This functions polls and can block for a very long time if used on mainnet.
// This functions polls and can block for a very long time if used on mainnet.
...
@@ -258,56 +261,48 @@ func WithdrawalHash(ev *bindings.L2ToL1MessagePasserWithdrawalInitiated) (common
...
@@ -258,56 +261,48 @@ func WithdrawalHash(ev *bindings.L2ToL1MessagePasserWithdrawalInitiated) (common
return
crypto
.
Keccak256Hash
(
enc
),
nil
return
crypto
.
Keccak256Hash
(
enc
),
nil
}
}
// ParseWithdrawalInitiated parses
// ParseWithdrawalInitiated parses WithdrawalInitiated events from
// a transaction receipt. It does not support multiple withdrawals
// per receipt.
func
ParseWithdrawalInitiated
(
receipt
*
types
.
Receipt
)
(
*
bindings
.
L2ToL1MessagePasserWithdrawalInitiated
,
error
)
{
func
ParseWithdrawalInitiated
(
receipt
*
types
.
Receipt
)
(
*
bindings
.
L2ToL1MessagePasserWithdrawalInitiated
,
error
)
{
contract
,
err
:=
bindings
.
NewL2ToL1MessagePasser
(
common
.
Address
{},
nil
)
contract
,
err
:=
bindings
.
NewL2ToL1MessagePasser
(
common
.
Address
{},
nil
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
abi
,
err
:=
bindings
.
L2ToL1MessagePasserMetaData
.
GetAbi
()
if
err
!=
nil
{
return
nil
,
err
}
for
_
,
log
:=
range
receipt
.
Logs
{
for
_
,
log
:=
range
receipt
.
Logs
{
event
,
err
:=
abi
.
EventByID
(
log
.
Topics
[
0
])
if
len
(
log
.
Topics
)
==
0
||
log
.
Topics
[
0
]
!=
WithdrawalInitiatedTopic
{
if
err
!=
nil
{
continue
return
nil
,
err
}
}
if
event
.
Name
==
"WithdrawalInitiated"
{
ev
,
err
:=
contract
.
ParseWithdrawalInitiated
(
*
log
)
ev
,
err
:=
contract
.
ParseWithdrawalInitiated
(
*
log
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"failed to parse log: %w"
,
err
)
return
nil
,
fmt
.
Errorf
(
"failed to parse log: %w"
,
err
)
}
return
ev
,
nil
}
}
return
ev
,
nil
}
}
return
nil
,
errors
.
New
(
"Unable to find WithdrawalInitiated event"
)
return
nil
,
errors
.
New
(
"Unable to find WithdrawalInitiated event"
)
}
}
// ParseWithdrawalInitiatedExtension1 parses
// ParseWithdrawalInitiatedExtension1 parses WithdrawalInitiatedExtension1 events
// from a transaction receipt. It does not support multiple withdrawals per
// receipt.
func
ParseWithdrawalInitiatedExtension1
(
receipt
*
types
.
Receipt
)
(
*
bindings
.
L2ToL1MessagePasserWithdrawalInitiatedExtension1
,
error
)
{
func
ParseWithdrawalInitiatedExtension1
(
receipt
*
types
.
Receipt
)
(
*
bindings
.
L2ToL1MessagePasserWithdrawalInitiatedExtension1
,
error
)
{
contract
,
err
:=
bindings
.
NewL2ToL1MessagePasser
(
common
.
Address
{},
nil
)
contract
,
err
:=
bindings
.
NewL2ToL1MessagePasser
(
common
.
Address
{},
nil
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
abi
,
err
:=
bindings
.
L2ToL1MessagePasserMetaData
.
GetAbi
()
if
err
!=
nil
{
return
nil
,
err
}
for
_
,
log
:=
range
receipt
.
Logs
{
for
_
,
log
:=
range
receipt
.
Logs
{
event
,
err
:=
abi
.
EventByID
(
log
.
Topics
[
0
])
if
len
(
log
.
Topics
)
==
0
||
log
.
Topics
[
0
]
!=
WithdrawalInitiatedExtension1Topic
{
if
err
!=
nil
{
continue
return
nil
,
err
}
}
if
event
.
Name
==
"WithdrawalInitiatedExtension1"
{
ev
,
err
:=
contract
.
ParseWithdrawalInitiatedExtension1
(
*
log
)
ev
,
err
:=
contract
.
ParseWithdrawalInitiatedExtension1
(
*
log
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"failed to parse log: %w"
,
err
)
return
nil
,
fmt
.
Errorf
(
"failed to parse log: %w"
,
err
)
}
return
ev
,
nil
}
}
return
ev
,
nil
}
}
return
nil
,
errors
.
New
(
"Unable to find WithdrawalInitiatedExtension1 event"
)
return
nil
,
errors
.
New
(
"Unable to find WithdrawalInitiatedExtension1 event"
)
}
}
...
...
op-node/withdrawals/utils_test.go
0 → 100644
View file @
c16d9ab7
package
withdrawals
import
(
"encoding/json"
"math/big"
"os"
"path"
"testing"
"github.com/ethereum-optimism/optimism/op-bindings/bindings"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core/types"
"github.com/stretchr/testify/require"
)
func
TestParseWithdrawalInitiated
(
t
*
testing
.
T
)
{
tests
:=
[]
struct
{
name
string
file
string
expected
*
bindings
.
L2ToL1MessagePasserWithdrawalInitiated
}{
{
"withdrawal through bridge"
,
"bridge-withdrawal.json"
,
&
bindings
.
L2ToL1MessagePasserWithdrawalInitiated
{
Nonce
:
new
(
big
.
Int
),
Sender
:
common
.
HexToAddress
(
"0x4200000000000000000000000000000000000007"
),
Target
:
common
.
HexToAddress
(
"0x6900000000000000000000000000000000000002"
),
Value
:
new
(
big
.
Int
),
GasLimit
:
big
.
NewInt
(
203648
),
Data
:
hexutil
.
MustDecode
(
"0xd764ad0b00010000000000000000000000000000000000000000000000000000"
+
"0000000000000000000000000000000042000000000000000000000000000000"
+
"0000001000000000000000000000000069000000000000000000000000000000"
+
"0000000300000000000000000000000000000000000000000000000000000000"
+
"0000000000000000000000000000000000000000000000000000000000000000"
+
"0000000000000000000000000000000000000000000000000000000000000000"
+
"000000c000000000000000000000000000000000000000000000000000000000"
+
"000000e40166a07a00000000000000000000000089d51be807d98fc974a0f41b"
+
"2e67a8228d7846ef0000000000000000000000007c6b91d9be155a6db01f7492"
+
"17d76ff02a7227f2000000000000000000000000c20c5ec92fda6e611a084851"
+
"23cdc0d5b84bd3a2000000000000000000000000c20c5ec92fda6e611a084851"
+
"23cdc0d5b84bd3a2000000000000000000000000000000000000000000000000"
+
"00000000000001f4000000000000000000000000000000000000000000000000"
+
"00000000000000c0000000000000000000000000000000000000000000000000"
+
"0000000000000000000000000000000000000000000000000000000000000000"
+
"00000000"
,
),
Raw
:
types
.
Log
{
Address
:
common
.
HexToAddress
(
"0x4200000000000000000000000000000000000016"
),
Topics
:
[]
common
.
Hash
{
common
.
HexToHash
(
"0x87bf7b546c8de873abb0db5b579ec131f8d0cf5b14f39933551cf9ced23a6136"
),
common
.
HexToHash
(
"0x0000000000000000000000000000000000000000000000000000000000000000"
),
common
.
HexToHash
(
"0x0000000000000000000000004200000000000000000000000000000000000007"
),
common
.
HexToHash
(
"0x0000000000000000000000006900000000000000000000000000000000000002"
),
},
Data
:
hexutil
.
MustDecode
(
"0x00000000000000000000000000000000000000000000000000000000000000"
+
"000000000000000000000000000000000000000000000000000000000000031b80"
+
"000000000000000000000000000000000000000000000000000000000000006000"
+
"000000000000000000000000000000000000000000000000000000000001e4d764"
+
"ad0b00010000000000000000000000000000000000000000000000000000000000"
+
"000000000000000000000000004200000000000000000000000000000000000010"
+
"000000000000000000000000690000000000000000000000000000000000000300"
+
"000000000000000000000000000000000000000000000000000000000000000000"
+
"000000000000000000000000000000000000000000000000000000000000000000"
+
"00000000000000000000000000000000000000000000000000000000c000000000"
+
"000000000000000000000000000000000000000000000000000000e40166a07a00"
+
"000000000000000000000089d51be807d98fc974a0f41b2e67a8228d7846ef0000"
+
"000000000000000000007c6b91d9be155a6db01f749217d76ff02a7227f2000000"
+
"000000000000000000c20c5ec92fda6e611a08485123cdc0d5b84bd3a200000000"
+
"0000000000000000c20c5ec92fda6e611a08485123cdc0d5b84bd3a20000000000"
+
"0000000000000000000000000000000000000000000000000001f4000000000000"
+
"00000000000000000000000000000000000000000000000000c000000000000000"
+
"000000000000000000000000000000000000000000000000000000000000000000"
+
"000000000000000000000000000000000000000000000000000000000000000000"
+
"000000000000000000000000000000"
,
),
BlockNumber
:
0x36
,
TxHash
:
common
.
HexToHash
(
"0x9346381068b59d2098495baa72ed2f773c1e09458610a7a208984859dff73add"
),
TxIndex
:
1
,
BlockHash
:
common
.
HexToHash
(
"0xfdd4ad8a984b45687aca0463db491cbd0e85273d970019a3f8bf618b614938df"
),
Index
:
2
,
Removed
:
false
,
},
},
},
}
for
_
,
test
:=
range
tests
{
t
.
Run
(
test
.
name
,
func
(
t
*
testing
.
T
)
{
f
,
err
:=
os
.
Open
(
path
.
Join
(
"testdata"
,
test
.
file
))
require
.
NoError
(
t
,
err
)
dec
:=
json
.
NewDecoder
(
f
)
receipt
:=
new
(
types
.
Receipt
)
require
.
NoError
(
t
,
dec
.
Decode
(
receipt
))
parsed
,
err
:=
ParseWithdrawalInitiated
(
receipt
)
require
.
NoError
(
t
,
err
)
// Have to do this weird thing to compare zero bigints.
// When they're deserialized from JSON, the internal byte
// array is an empty array whereas it is nil in the expectation.
parsedNonce
:=
parsed
.
Nonce
parsedValue
:=
parsed
.
Value
expNonce
:=
test
.
expected
.
Nonce
expValue
:=
test
.
expected
.
Value
testutils
.
RequireBigEqual
(
t
,
expNonce
,
parsedNonce
)
testutils
.
RequireBigEqual
(
t
,
expValue
,
parsedValue
)
parsed
.
Nonce
=
nil
parsed
.
Value
=
nil
test
.
expected
.
Nonce
=
nil
test
.
expected
.
Value
=
nil
require
.
EqualValues
(
t
,
test
.
expected
,
parsed
)
})
}
}
func
TestParseWithdrawalInitiatedExtension1
(
t
*
testing
.
T
)
{
tests
:=
[]
struct
{
name
string
file
string
expected
*
bindings
.
L2ToL1MessagePasserWithdrawalInitiatedExtension1
}{
{
"withdrawal through bridge"
,
"bridge-withdrawal.json"
,
&
bindings
.
L2ToL1MessagePasserWithdrawalInitiatedExtension1
{
Hash
:
common
.
HexToHash
(
"0x0d827f8148288e3a2466018f71b968ece4ea9f9e2a81c30da9bd46cce2868285"
),
Raw
:
types
.
Log
{
Address
:
common
.
HexToAddress
(
"0x4200000000000000000000000000000000000016"
),
Topics
:
[]
common
.
Hash
{
common
.
HexToHash
(
"0x2ef6ceb1668fdd882b1f89ddd53a666b0c1113d14cf90c0fbf97c7b1ad880fbb"
),
common
.
HexToHash
(
"0x0d827f8148288e3a2466018f71b968ece4ea9f9e2a81c30da9bd46cce2868285"
),
},
Data
:
[]
byte
{},
BlockNumber
:
0x36
,
TxHash
:
common
.
HexToHash
(
"0x9346381068b59d2098495baa72ed2f773c1e09458610a7a208984859dff73add"
),
TxIndex
:
0x1
,
BlockHash
:
common
.
HexToHash
(
"0xfdd4ad8a984b45687aca0463db491cbd0e85273d970019a3f8bf618b614938df"
),
Index
:
0x3
,
Removed
:
false
,
},
},
},
}
for
_
,
test
:=
range
tests
{
t
.
Run
(
test
.
name
,
func
(
t
*
testing
.
T
)
{
f
,
err
:=
os
.
Open
(
path
.
Join
(
"testdata"
,
test
.
file
))
require
.
NoError
(
t
,
err
)
dec
:=
json
.
NewDecoder
(
f
)
receipt
:=
new
(
types
.
Receipt
)
require
.
NoError
(
t
,
dec
.
Decode
(
receipt
))
parsed
,
err
:=
ParseWithdrawalInitiatedExtension1
(
receipt
)
require
.
NoError
(
t
,
err
)
require
.
EqualValues
(
t
,
test
.
expected
,
parsed
)
})
}
}
op-proposer/go.mod
View file @
c16d9ab7
...
@@ -3,9 +3,9 @@ module github.com/ethereum-optimism/optimism/op-proposer
...
@@ -3,9 +3,9 @@ module github.com/ethereum-optimism/optimism/op-proposer
go 1.18
go 1.18
require (
require (
github.com/ethereum-optimism/optimism/op-bindings v0.8.
8
github.com/ethereum-optimism/optimism/op-bindings v0.8.
9
github.com/ethereum-optimism/optimism/op-node v0.8.
8
github.com/ethereum-optimism/optimism/op-node v0.8.
9
github.com/ethereum-optimism/optimism/op-service v0.8.
8
github.com/ethereum-optimism/optimism/op-service v0.8.
9
github.com/ethereum/go-ethereum v1.10.23
github.com/ethereum/go-ethereum v1.10.23
github.com/miguelmota/go-ethereum-hdwallet v0.1.1
github.com/miguelmota/go-ethereum-hdwallet v0.1.1
github.com/stretchr/testify v1.8.0
github.com/stretchr/testify v1.8.0
...
...
op-proposer/go.sum
View file @
c16d9ab7
...
@@ -150,12 +150,12 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m
...
@@ -150,12 +150,12 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/ethereum-optimism/op-geth v0.0.0-20220926184707-53d23c240afd h1:NchOnosWOkH9wlix8QevGHE+6vuRa+OMGvDNsczv2kQ=
github.com/ethereum-optimism/op-geth v0.0.0-20220926184707-53d23c240afd h1:NchOnosWOkH9wlix8QevGHE+6vuRa+OMGvDNsczv2kQ=
github.com/ethereum-optimism/op-geth v0.0.0-20220926184707-53d23c240afd/go.mod h1:/6CsT5Ceen2WPLI/oCA3xMcZ5sWMF/D46SjM/ayY0Oo=
github.com/ethereum-optimism/op-geth v0.0.0-20220926184707-53d23c240afd/go.mod h1:/6CsT5Ceen2WPLI/oCA3xMcZ5sWMF/D46SjM/ayY0Oo=
github.com/ethereum-optimism/optimism/op-bindings v0.8.
8 h1:HN625JI2VsRsli+U6GAXipg7lAKx8EOmGIovN79Az+I
=
github.com/ethereum-optimism/optimism/op-bindings v0.8.
9 h1:QeYLhgZP0QkDLxyXhkWLj/iHDFkMNI18abgrHL4I9TE
=
github.com/ethereum-optimism/optimism/op-bindings v0.8.
8
/go.mod h1:pyTCbh2o/SY+5/AL2Qo5GgAao3Gtt9Ff6tfK9Pa9emM=
github.com/ethereum-optimism/optimism/op-bindings v0.8.
9
/go.mod h1:pyTCbh2o/SY+5/AL2Qo5GgAao3Gtt9Ff6tfK9Pa9emM=
github.com/ethereum-optimism/optimism/op-node v0.8.
8 h1:WuZF1RsZnB+u/wwWToVaC1lZWfGfgncLusUssA3Hm+o
=
github.com/ethereum-optimism/optimism/op-node v0.8.
9 h1:wUxvjeHB1nQtnsxbNxqHthSS+Uune7Xb17NWXDBdSXI
=
github.com/ethereum-optimism/optimism/op-node v0.8.
8/go.mod h1:O5nXPCx8vn9c/CHgBC7vP5utcanIQ4uhWKkJ3pAaaSQ
=
github.com/ethereum-optimism/optimism/op-node v0.8.
9/go.mod h1:ETNw9UP6sy/pWf6aoNHEgQKrXN2ca0Fm0OqIbCEghYk
=
github.com/ethereum-optimism/optimism/op-service v0.8.
8 h1:k5E78Zr2cGU0SwjoHpFXuC1eyfXhu3oKEOnDDaFi57I
=
github.com/ethereum-optimism/optimism/op-service v0.8.
9 h1:YdMBcgXi+NHqX3pKR6UhjGHtBeF8AQK6kLmwpv7LzJM
=
github.com/ethereum-optimism/optimism/op-service v0.8.
8
/go.mod h1:K0uybOhICTc2yfhrRj0cD1m7aPkOf5C9e6bUmvf4rGA=
github.com/ethereum-optimism/optimism/op-service v0.8.
9
/go.mod h1:K0uybOhICTc2yfhrRj0cD1m7aPkOf5C9e6bUmvf4rGA=
github.com/ethereum/go-ethereum v1.10.4/go.mod h1:nEE0TP5MtxGzOMd7egIrbPJMQBnhVU3ELNxhBglIzhg=
github.com/ethereum/go-ethereum v1.10.4/go.mod h1:nEE0TP5MtxGzOMd7egIrbPJMQBnhVU3ELNxhBglIzhg=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0=
github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0=
...
...
packages/contracts-periphery/contracts/universal/op-erc721/OptimismMintableERC721Factory.sol
View file @
c16d9ab7
...
@@ -14,8 +14,13 @@ contract OptimismMintableERC721Factory is Semver {
...
@@ -14,8 +14,13 @@ contract OptimismMintableERC721Factory is Semver {
*
*
* @param localToken Address of the token on the this domain.
* @param localToken Address of the token on the this domain.
* @param remoteToken Address of the token on the remote domain.
* @param remoteToken Address of the token on the remote domain.
* @param deployer Address of the initiator of the deployment
*/
*/
event OptimismMintableERC721Created(address indexed localToken, address indexed remoteToken);
event OptimismMintableERC721Created(
address indexed localToken,
address indexed remoteToken,
address deployer
);
/**
/**
* @notice Address of the ERC721 bridge on this network.
* @notice Address of the ERC721 bridge on this network.
...
@@ -30,7 +35,7 @@ contract OptimismMintableERC721Factory is Semver {
...
@@ -30,7 +35,7 @@ contract OptimismMintableERC721Factory is Semver {
/**
/**
* @notice Tracks addresses created by this factory.
* @notice Tracks addresses created by this factory.
*/
*/
mapping(address => bool) public is
Standard
OptimismMintableERC721;
mapping(address => bool) public isOptimismMintableERC721;
/**
/**
* @custom:semver 1.0.0
* @custom:semver 1.0.0
...
@@ -58,25 +63,23 @@ contract OptimismMintableERC721Factory is Semver {
...
@@ -58,25 +63,23 @@ contract OptimismMintableERC721Factory is Semver {
* @param _name ERC721 name.
* @param _name ERC721 name.
* @param _symbol ERC721 symbol.
* @param _symbol ERC721 symbol.
*/
*/
function create
Standard
OptimismMintableERC721(
function createOptimismMintableERC721(
address _remoteToken,
address _remoteToken,
string memory _name,
string memory _name,
string memory _symbol
string memory _symbol
) external {
) external
returns (address)
{
require(
require(
_remoteToken != address(0),
_remoteToken != address(0),
"OptimismMintableERC721Factory: L1 token address cannot be address(0)"
"OptimismMintableERC721Factory: L1 token address cannot be address(0)"
);
);
OptimismMintableERC721 localToken = new OptimismMintableERC721(
address localToken = address(
bridge,
new OptimismMintableERC721(bridge, remoteChainId, _remoteToken, _name, _symbol)
remoteChainId,
_remoteToken,
_name,
_symbol
);
);
isStandardOptimismMintableERC721[address(localToken)] = true;
isOptimismMintableERC721[localToken] = true;
emit OptimismMintableERC721Created(address(localToken), _remoteToken);
emit OptimismMintableERC721Created(localToken, _remoteToken, msg.sender);
return localToken;
}
}
}
}
packages/contracts-periphery/test/contracts/universal/OptimismMintableERC721Factory.spec.ts
View file @
c16d9ab7
...
@@ -76,12 +76,11 @@ describe('OptimismMintableERC721Factory', () => {
...
@@ -76,12 +76,11 @@ describe('OptimismMintableERC721Factory', () => {
})
})
it
(
'
should be able to create a standard ERC721 contract
'
,
async
()
=>
{
it
(
'
should be able to create a standard ERC721 contract
'
,
async
()
=>
{
const
tx
=
const
tx
=
await
OptimismMintableERC721Factory
.
createOptimismMintableERC721
(
await
OptimismMintableERC721Factory
.
createStandardOptimismMintableERC721
(
L1ERC721
.
address
,
L1ERC721
.
address
,
'
L2ERC721
'
,
'
L2ERC721
'
,
'
ERC
'
'
ERC
'
)
)
const
receipt
=
await
tx
.
wait
()
const
receipt
=
await
tx
.
wait
()
// Get the OptimismMintableERC721Created event
// Get the OptimismMintableERC721Created event
...
@@ -109,7 +108,7 @@ describe('OptimismMintableERC721Factory', () => {
...
@@ -109,7 +108,7 @@ describe('OptimismMintableERC721Factory', () => {
expect
(
await
OptimismMintableERC721
.
baseTokenURI
()).
to
.
equal
(
baseURI
)
expect
(
await
OptimismMintableERC721
.
baseTokenURI
()).
to
.
equal
(
baseURI
)
expect
(
expect
(
await
OptimismMintableERC721Factory
.
is
Standard
OptimismMintableERC721
(
await
OptimismMintableERC721Factory
.
isOptimismMintableERC721
(
OptimismMintableERC721
.
address
OptimismMintableERC721
.
address
)
)
).
to
.
equal
(
true
)
).
to
.
equal
(
true
)
...
@@ -117,7 +116,7 @@ describe('OptimismMintableERC721Factory', () => {
...
@@ -117,7 +116,7 @@ describe('OptimismMintableERC721Factory', () => {
it
(
'
should not be able to create a standard token with a 0 address for l1 token
'
,
async
()
=>
{
it
(
'
should not be able to create a standard token with a 0 address for l1 token
'
,
async
()
=>
{
await
expect
(
await
expect
(
OptimismMintableERC721Factory
.
create
Standard
OptimismMintableERC721
(
OptimismMintableERC721Factory
.
createOptimismMintableERC721
(
ethers
.
constants
.
AddressZero
,
ethers
.
constants
.
AddressZero
,
'
L2ERC721
'
,
'
L2ERC721
'
,
'
ERC
'
'
ERC
'
...
...
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