diff --git a/.changeset/big-tables-bake.md b/.changeset/big-tables-bake.md new file mode 100644 index 0000000000000..e495a0b3a84f7 --- /dev/null +++ b/.changeset/big-tables-bake.md @@ -0,0 +1,5 @@ +--- +'@eth-optimism/core-utils': patch +--- + +Add encoding and hashing functions for bedrock diff --git a/.changeset/brown-islands-listen.md b/.changeset/brown-islands-listen.md new file mode 100644 index 0000000000000..8714a69084caf --- /dev/null +++ b/.changeset/brown-islands-listen.md @@ -0,0 +1,5 @@ +--- +'@eth-optimism/contracts-bedrock': patch +--- + +Standardizes revert strings globally diff --git a/.changeset/clever-news-smile.md b/.changeset/clever-news-smile.md new file mode 100644 index 0000000000000..3b87429e89903 --- /dev/null +++ b/.changeset/clever-news-smile.md @@ -0,0 +1,5 @@ +--- +'@eth-optimism/contracts-bedrock': patch +--- + +Fixes a bug in the L2 Bedrock genesis script diff --git a/.changeset/dirty-bananas-shop.md b/.changeset/dirty-bananas-shop.md new file mode 100644 index 0000000000000..9ffade1561c98 --- /dev/null +++ b/.changeset/dirty-bananas-shop.md @@ -0,0 +1,5 @@ +--- +'@eth-optimism/contracts-bedrock': patch +--- + +Cleans linting errors in MerkleTrie.sol diff --git a/.changeset/dull-coats-tap.md b/.changeset/dull-coats-tap.md new file mode 100644 index 0000000000000..9b61fd7e0b118 --- /dev/null +++ b/.changeset/dull-coats-tap.md @@ -0,0 +1,5 @@ +--- +'@eth-optimism/contracts-bedrock': patch +--- + +Adds a new event SentMessageExtension1 to the CrossDomainMessenger contract. Includes additional data that's being attached to messages sent after the Bedrock upgrade. diff --git a/.changeset/empty-wolves-sit.md b/.changeset/empty-wolves-sit.md new file mode 100644 index 0000000000000..605555da5baa5 --- /dev/null +++ b/.changeset/empty-wolves-sit.md @@ -0,0 +1,5 @@ +--- +'@eth-optimism/contracts-bedrock': patch +--- + +Properly generates and exports ABI and artifact files that can be imported by client libraries diff --git a/.changeset/fresh-peaches-remain.md b/.changeset/fresh-peaches-remain.md new file mode 100644 index 0000000000000..9916e8f420597 --- /dev/null +++ b/.changeset/fresh-peaches-remain.md @@ -0,0 +1,5 @@ +--- +'@eth-optimism/contracts-periphery': patch +--- + +Update compiler version to 0.8.15 diff --git a/.changeset/hot-panthers-think.md b/.changeset/hot-panthers-think.md new file mode 100644 index 0000000000000..bae25d2ecd85e --- /dev/null +++ b/.changeset/hot-panthers-think.md @@ -0,0 +1,5 @@ +--- +'@eth-optimism/contracts-bedrock': patch +--- + +Moves various legacy contracts into the legacy folder diff --git a/.changeset/hot-queens-accept.md b/.changeset/hot-queens-accept.md new file mode 100644 index 0000000000000..f4742a99cde85 --- /dev/null +++ b/.changeset/hot-queens-accept.md @@ -0,0 +1,5 @@ +--- +'@eth-optimism/contracts-bedrock': patch +--- + +The output oracle's getL2Output function now reverts when no output is returned diff --git a/.changeset/lovely-mails-cry.md b/.changeset/lovely-mails-cry.md new file mode 100644 index 0000000000000..1b6383525e852 --- /dev/null +++ b/.changeset/lovely-mails-cry.md @@ -0,0 +1,5 @@ +--- +'@eth-optimism/sdk': patch +--- + +Updates the CCM to throw a better error for missing or invalid chain IDs diff --git a/.changeset/nasty-apricots-divide.md b/.changeset/nasty-apricots-divide.md new file mode 100644 index 0000000000000..b502aa2524ff7 --- /dev/null +++ b/.changeset/nasty-apricots-divide.md @@ -0,0 +1,5 @@ +--- +'@eth-optimism/contracts-bedrock': patch +--- + +Bump to use solidity 0.8.15 diff --git a/.changeset/pink-dancers-explain.md b/.changeset/pink-dancers-explain.md new file mode 100644 index 0000000000000..fea6961836d7f --- /dev/null +++ b/.changeset/pink-dancers-explain.md @@ -0,0 +1,6 @@ +--- +'@eth-optimism/contracts-bedrock': patch +'@eth-optimism/core-utils': patch +--- + +Remove subversion byte from deposit tx diff --git a/.changeset/pretty-olives-wink.md b/.changeset/pretty-olives-wink.md new file mode 100644 index 0000000000000..8eb8a7debaba5 --- /dev/null +++ b/.changeset/pretty-olives-wink.md @@ -0,0 +1,5 @@ +--- +'@eth-optimism/ci-builder': patch +--- + +Trigger release to update foundry version diff --git a/.changeset/red-cows-divide.md b/.changeset/red-cows-divide.md new file mode 100644 index 0000000000000..4cceaa6474936 --- /dev/null +++ b/.changeset/red-cows-divide.md @@ -0,0 +1,5 @@ +--- +'@eth-optimism/core-utils': patch +--- + +Update deposit transaction serialization diff --git a/.changeset/rude-rice-hammer.md b/.changeset/rude-rice-hammer.md new file mode 100644 index 0000000000000..71a81bfd12090 --- /dev/null +++ b/.changeset/rude-rice-hammer.md @@ -0,0 +1,5 @@ +--- +'@eth-optimism/contracts': patch +--- + +Deploy goerli SCC to fix sccFaultProofWindowSeconds diff --git a/.changeset/smart-kings-learn.md b/.changeset/smart-kings-learn.md new file mode 100644 index 0000000000000..c363741b65ca9 --- /dev/null +++ b/.changeset/smart-kings-learn.md @@ -0,0 +1,5 @@ +--- +'@eth-optimism/contracts-bedrock': patch +--- + +Naming improvements for functions and variables in the L2OutputOracle diff --git a/.changeset/spotty-lobsters-juggle.md b/.changeset/spotty-lobsters-juggle.md new file mode 100644 index 0000000000000..6be7972d8553e --- /dev/null +++ b/.changeset/spotty-lobsters-juggle.md @@ -0,0 +1,5 @@ +--- +'@eth-optimism/sdk': patch +--- + +Update the Goerli SCC's address diff --git a/.changeset/stale-eyes-sell.md b/.changeset/stale-eyes-sell.md new file mode 100644 index 0000000000000..83ca307a1ee60 --- /dev/null +++ b/.changeset/stale-eyes-sell.md @@ -0,0 +1,5 @@ +--- +'@eth-optimism/contracts-periphery': patch +--- + +Add compiler 0.8.15 diff --git a/.changeset/strange-pillows-walk.md b/.changeset/strange-pillows-walk.md new file mode 100644 index 0000000000000..cbb42b82fa9da --- /dev/null +++ b/.changeset/strange-pillows-walk.md @@ -0,0 +1,6 @@ +--- +'@eth-optimism/contracts-bedrock': patch +'@eth-optimism/contracts-periphery': patch +--- + +Update forge-std diff --git a/.changeset/tender-bags-melt.md b/.changeset/tender-bags-melt.md new file mode 100644 index 0000000000000..760b8803fc6b8 --- /dev/null +++ b/.changeset/tender-bags-melt.md @@ -0,0 +1,5 @@ +--- +'@eth-optimism/contracts-bedrock': patch +--- + +Shortens library names diff --git a/.changeset/tricky-pugs-arrive.md b/.changeset/tricky-pugs-arrive.md new file mode 100644 index 0000000000000..373a8a36da4ef --- /dev/null +++ b/.changeset/tricky-pugs-arrive.md @@ -0,0 +1,5 @@ +--- +'@eth-optimism/contracts-bedrock': patch +--- + +Introduces Types.sol diff --git a/.changeset/young-walls-fetch.md b/.changeset/young-walls-fetch.md new file mode 100644 index 0000000000000..6c7ceb337e70b --- /dev/null +++ b/.changeset/young-walls-fetch.md @@ -0,0 +1,5 @@ +--- +'@eth-optimism/contracts-bedrock': patch +--- + +Semver contract updated to include a getter for the full version string diff --git a/.circleci/config.yml b/.circleci/config.yml index 7c0db8a783cbd..646e21711fe1f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -107,7 +107,7 @@ jobs: contracts-bedrock-tests: docker: - image: ethereumoptimism/ci-builder:latest - resource_class: medium + resource_class: large steps: - restore_cache: keys: @@ -135,11 +135,15 @@ jobs: name: test command: yarn test working_directory: packages/contracts-bedrock + environment: + FOUNDRY_PROFILE: ci - run: name: gas snapshot command: | forge --version forge snapshot --check || exit 0 + environment: + FOUNDRY_PROFILE: ci working_directory: packages/contracts-bedrock - run: name: storage snapshot diff --git a/go.work b/go.work index 8a9c1277e0ed5..78f6d67bbe717 100644 --- a/go.work +++ b/go.work @@ -18,7 +18,7 @@ use ( ./state-surgery ) -replace github.com/ethereum/go-ethereum v1.10.17 => github.com/ethereum-optimism/reference-optimistic-geth v0.0.0-20220711171946-f579014dc46d +replace github.com/ethereum/go-ethereum v1.10.20 => github.com/ethereum-optimism/reference-optimistic-geth v0.0.0-20220715235548-70b02481016d // For local debugging: -//replace github.com/ethereum/go-ethereum v1.10.17 => ../go-ethereum +//replace github.com/ethereum/go-ethereum v1.10.20 => ../go-ethereum diff --git a/go.work.sum b/go.work.sum index c1574b133e9ea..427fc6ffe9913 100644 --- a/go.work.sum +++ b/go.work.sum @@ -15,11 +15,16 @@ cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJW cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s= cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= +github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/btcsuite/btcd/btcec/v2 v2.1.3/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE= github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d h1:t5Wuyh53qYyg9eqn4BbnlIT+vmhyww0TatL+zT3uWgI= +github.com/docker/docker v1.6.2/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/dop251/goja v0.0.0-20220405120441-9037c2b61cbf/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= +github.com/fjl/gencodec v0.0.0-20220412091415-8bb9e558978c/go.mod h1:AzA8Lj6YtixmJWL+wkKoBGsLWy9gFrAzi4g+5bCKwpY= +github.com/garslo/gogen v0.0.0-20170306192744-1d203ffc1f61/go.mod h1:Q0X6pkwTILDlzrGEckF6HKjXe48EgsY/l7K7vhY4MW8= github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= @@ -27,7 +32,6 @@ github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8 github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= @@ -36,14 +40,12 @@ github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0 github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM= github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= -github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5 h1:2U0HzY8BJ8hVwDKIzp7y4voR9CX/nvcfymLmg2UiOio= github.com/klauspost/cpuid v1.2.1 h1:vJi+O/nMdFt0vqm8NZBI6wzALWdA2X+egi0ogNyrC/w= github.com/libp2p/go-yamux v1.4.1 h1:P1Fe9vF4th5JOxxgQvfbOHkrGqIZniTLf+ddhZp8YTI= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= -github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= -github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/supranational/blst v0.3.8-0.20220526154634-513d2456b344/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= @@ -73,11 +75,9 @@ golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= diff --git a/op-batcher/batch_submitter.go b/op-batcher/batch_submitter.go index b0fe53d1e66b0..9d3d7086c93c8 100644 --- a/op-batcher/batch_submitter.go +++ b/op-batcher/batch_submitter.go @@ -233,7 +233,7 @@ mainLoop: syncStatus, err := l.cfg.RollupNode.SyncStatus(ctx) cancel() if err != nil { - l.log.Error("issue fetching L2 head", "err", err) + l.log.Warn("issue fetching L2 head", "err", err) continue } l.log.Info("Got new L2 sync status", "safe_head", syncStatus.SafeL2, "unsafe_head", syncStatus.UnsafeL2, "last_submitted", l.lastSubmittedBlock) @@ -241,7 +241,12 @@ mainLoop: l.log.Trace("No unsubmitted blocks from sequencer") continue } - // the lastSubmittedBlock may be zeroed, or just lag behind. If it's lagging behind, catch it up. + // If we just started, start at safe-head + if l.lastSubmittedBlock == (eth.BlockID{}) { + l.log.Info("Starting batch-submitter work at safe-head", "safe", syncStatus.SafeL2) + l.lastSubmittedBlock = syncStatus.SafeL2.ID() + } + // If it's lagging behind, catch it up. if l.lastSubmittedBlock.Number < syncStatus.SafeL2.Number { l.log.Warn("last submitted block lagged behind L2 safe head: batch submission will continue from the safe head now", "last", l.lastSubmittedBlock, "safe", syncStatus.SafeL2) l.lastSubmittedBlock = syncStatus.SafeL2.ID() @@ -324,7 +329,7 @@ mainLoop: receipt, err := l.txMgr.Send(ctx, updateGasPrice, l.cfg.L1Client.SendTransaction) cancel() if err != nil { - l.log.Error("unable to publish tx", "err", err) + l.log.Warn("unable to publish tx", "err", err) continue mainLoop } diff --git a/op-batcher/go.mod b/op-batcher/go.mod index 306384fec8f18..c981f7b169508 100644 --- a/op-batcher/go.mod +++ b/op-batcher/go.mod @@ -5,7 +5,7 @@ go 1.18 require ( github.com/ethereum-optimism/optimism/op-node v0.3.0 github.com/ethereum-optimism/optimism/op-proposer v0.3.0 - github.com/ethereum/go-ethereum v1.10.17 + github.com/ethereum/go-ethereum v1.10.20 github.com/miguelmota/go-ethereum-hdwallet v0.1.1 github.com/urfave/cli v1.22.5 ) @@ -43,7 +43,7 @@ require ( github.com/rivo/uniseg v0.2.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/shirou/gopsutil v3.21.11+incompatible // indirect - github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect + github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a // indirect github.com/tklauser/go-sysconf v0.3.10 // indirect github.com/tklauser/numcpus v0.4.0 // indirect github.com/tyler-smith/go-bip39 v1.1.0 // indirect @@ -54,4 +54,4 @@ require ( gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect ) -replace github.com/ethereum/go-ethereum v1.10.17 => github.com/ethereum-optimism/reference-optimistic-geth v0.0.0-20220711171946-f579014dc46d +replace github.com/ethereum/go-ethereum v1.10.20 => github.com/ethereum-optimism/reference-optimistic-geth v0.0.0-20220715235548-70b02481016d diff --git a/op-batcher/go.sum b/op-batcher/go.sum index 6be9294ed9c44..1f18a8b449970 100644 --- a/op-batcher/go.sum +++ b/op-batcher/go.sum @@ -37,9 +37,6 @@ collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4= github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc= -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= -github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0/go.mod h1:tPaiy8S5bQ+S5sOiDlINkp7+Ef339+Nz5L5XO+cnOHo= github.com/Azure/azure-storage-blob-go v0.7.0/go.mod h1:f9YQKtsG1nMisotuTPpO0tjNuEjKRYAcJU8/ydDI++4= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= @@ -124,8 +121,6 @@ github.com/consensys/gnark-crypto v0.4.1-0.20210426202927-39ac3d4b3f1f/go.mod h1 github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -139,53 +134,40 @@ github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1m5sE92cU+pd5Mcc= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= -github.com/deepmap/oapi-codegen v1.6.0/go.mod h1:ryDa9AgbELGeB+YEXE1dR53yAjHwFvE9iAUlWl9Al3M= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8/go.mod h1:VMaSuZ+SZcx/wljOQKvp5srsbCiKDEb6K2wC4+PiBmQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dlclark/regexp2 v1.2.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= -github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= -github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= -github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v1.6.2/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/dop251/goja v0.0.0-20200721192441-a695b0cdd498/go.mod h1:Mw6PkjjMXWbTj+nnj4s3QPXq1jaT0s5pC0iFD4+BOAA= -github.com/dop251/goja v0.0.0-20220405120441-9037c2b61cbf/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= -github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y= github.com/eclipse/paho.mqtt.golang v1.2.0/go.mod h1:H9keYFcgq3Qr5OUJm/JZI/i6U7joQ8SYLhZwfeOo6Ts= +github.com/edsrzf/mmap-go v1.0.0 h1:CEBF7HpRnUCSJgGUb5h1Gm7e3VkmVDrR8lvWVLtrOFw= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/edsrzf/mmap-go v1.1.0 h1:6EUwBLQ/Mcr1EYLE4Tn1VdW1A4ckqCQWZBw8Hr0kjpQ= -github.com/edsrzf/mmap-go v1.1.0/go.mod h1:19H/e8pUPLicwkyNgOykDXkJ9F0MHE+Z52B8EIth78Q= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/ethereum-optimism/optimism/op-bindings v0.0.0-20220614233543-0d8fa52afca2/go.mod h1:e9mMYiVsdJf9BI//FdaA77BwNNgNMR043JtB7CPXNxY= github.com/ethereum-optimism/optimism/op-bindings v0.3.0 h1:d2Mwb8FzR2zuhW0sS5xFKWz/6VFPTEIE+XINqZj0Rv4= github.com/ethereum-optimism/optimism/op-bindings v0.3.0/go.mod h1:CrvUVIISKcyJ7o27ub/HY4Kq9wEJQxrGmWthTqxPSGo= github.com/ethereum-optimism/optimism/op-node v0.3.0 h1:jep/cbIbP7fjBSAR48yk5NJVEoGYvoNlYI00KpBI6Mw= github.com/ethereum-optimism/optimism/op-node v0.3.0/go.mod h1:iF9AhYjr8jNeoCDNP/Vs/ywQ2USZU5L66AxZbSAUi0E= github.com/ethereum-optimism/optimism/op-proposer v0.3.0 h1:K1ipZt3TLD0BJi7tKOmx8tCLXj9i4f4baBIhbPmUxk4= github.com/ethereum-optimism/optimism/op-proposer v0.3.0/go.mod h1:GcQ9VCWz2zEVexecq5IYo/2eadK/y7IBOEfx4YV1QJk= -github.com/ethereum-optimism/reference-optimistic-geth v0.0.0-20220711171946-f579014dc46d h1:AYFFbxrz7kLyFbvNHGhUPZQT8KnN1PPjCj4oAcgaVCk= -github.com/ethereum-optimism/reference-optimistic-geth v0.0.0-20220711171946-f579014dc46d/go.mod h1:8AfU1epKggKxDt9wr7rH5KmCeiT3yT0sEvroru1mO6Q= +github.com/ethereum-optimism/reference-optimistic-geth v0.0.0-20220715235548-70b02481016d h1:w0DBXhp0sv0bWRDOCA/Y6yHOALU7qLLLf5/kE3YfFr4= +github.com/ethereum-optimism/reference-optimistic-geth v0.0.0-20220715235548-70b02481016d/go.mod h1:m2m08SAQ8XB0VcVBoDg9n74Dw5PUMl3hzv1NXVBFPfg= 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/fjl/gencodec v0.0.0-20220412091415-8bb9e558978c/go.mod h1:AzA8Lj6YtixmJWL+wkKoBGsLWy9gFrAzi4g+5bCKwpY= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/fjl/memsize v0.0.1 h1:+zhkb+dhUgx0/e+M8sF0QqiouvMQUiKR+QYvdxIOKcQ= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= -github.com/garslo/gogen v0.0.0-20170306192744-1d203ffc1f61/go.mod h1:Q0X6pkwTILDlzrGEckF6HKjXe48EgsY/l7K7vhY4MW8= +github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 h1:f6D9Hr8xV8uYKlyuj8XIruxlh9WjVjdh1gIicAS7ays= -github.com/getkin/kin-openapi v0.53.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= -github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -202,14 +184,12 @@ github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KE github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-sourcemap/sourcemap v2.1.2+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= -github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= @@ -250,7 +230,6 @@ github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEW github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golangci/lint-1 v0.0.0-20181222135242-d2cdd8c08219/go.mod h1:/X8TswGSh1pIozq4ZwCfxS0WA5JGXguxk94ar/4c87Y= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/flatbuffers v1.11.0/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= @@ -275,20 +254,17 @@ github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.5/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/graph-gophers/graphql-go v0.0.0-20201113091052-beb923fada29/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= -github.com/graph-gophers/graphql-go v1.3.0/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= -github.com/hashicorp/go-bexpr v0.1.10/go.mod h1:oxlubA2vC/gFVfX1A6JGp7ls7uCDlfJn732ehYYg+g0= github.com/hashicorp/go-bexpr v0.1.11 h1:6DqdA/KBjurGby9yTY0bmkathya0lfwF2SeuubCI7dY= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= @@ -301,23 +277,20 @@ github.com/holiman/uint256 v1.2.0/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25 github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huin/goupnp v1.0.1-0.20210310174557-0ca763054c88/go.mod h1:nNs7wvRfN1eKaMknBydLNQU6146XQim8t4h+q90biWo= github.com/huin/goupnp v1.0.3 h1:N8No57ls+MnjlB+JPiCVSOyy/ot7MJTqlo7rn+NYSqQ= -github.com/huin/goupnp v1.0.3/go.mod h1:ZxNlw5WqJj6wSsRK5+YfflQGXYfccj5VgQsMNixHM7Y= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/influxdata/flux v0.65.1/go.mod h1:J754/zds0vvpfwuq7Gc2wRdVwEodfpCFM7mYlOw2LqY= github.com/influxdata/influxdb v1.8.3/go.mod h1:JugdFhsvvI8gadxOI6noqNeeBHvWNTbfYGtiAn+2jhI= -github.com/influxdata/influxdb-client-go/v2 v2.4.0/go.mod h1:vLNHdxTJkIf2mSLvGrpj8TCcISApPoXkaxP8g9uRlW8= github.com/influxdata/influxql v1.1.1-0.20200828144457-65d3ef77d385/go.mod h1:gHp9y86a/pxhjJ+zMjNXiQAA197Xk9wLxaz+fGG+kWk= github.com/influxdata/line-protocol v0.0.0-20180522152040-32c6aa80de5e/go.mod h1:4kt73NQhadE3daL3WhR5EJ/J2ocX0PZzwxQ0gXJ7oFE= -github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo= github.com/influxdata/promql/v2 v2.12.0/go.mod h1:fxOPu+DY0bqCTCECchSRtWfc+0X19ybifQhZoQNF5D8= github.com/influxdata/roaring v0.4.13-0.20180809181101-fc520f41fab6/go.mod h1:bSgUQ7q5ZLSO+bKBGqJiCBGAl+9DxyW63zLTujjUlOE= github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9/go.mod h1:Js0mqiSBE6Ffsg94weZZ2c+v/ciT8QRHFOap7EKDrR0= github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368/go.mod h1:Wbbw6tYNvwa5dlB6304Sd+82Z3f7PmVZHVKU637d4po= github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= -github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= @@ -338,7 +311,6 @@ github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8 github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef/go.mod h1:Ct9fl0F6iIOGgxJ5npU/IUOhOhqlVrGjyIZc8/MagT0= github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= -github.com/karalabe/usb v0.0.2/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= @@ -350,32 +322,18 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxv github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v0.0.0-20170224010052-a616ab194758/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/labstack/echo/v4 v4.2.1/go.mod h1:AA49e0DZ8kk5jTOOCKNuPR6oTnBS0dYiM4FW1e6jwpg= -github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/matryer/moq v0.0.0-20190312154309-6cfb0558e1bd/go.mod h1:9ELz6aaclSIGnZBoaSLZ3NAl1VTufbOrXBPvtcy6WiQ= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.0/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= github.com/mattn/go-ieproxy v0.0.0-20190610004146-91bb50d98149/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.5-0.20180830101745-3fb116b82035/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= @@ -387,16 +345,13 @@ github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0j github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/miguelmota/go-ethereum-hdwallet v0.1.1 h1:zdXGlHao7idpCBjEGTXThVAtMKs+IxAgivZ75xqkWK0= github.com/miguelmota/go-ethereum-hdwallet v0.1.1/go.mod h1:f9m9uXokAHA6WNoYOPjj4AqjJS5pquQRiYYj/XSyPYc= -github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= -github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4= github.com/mitchellh/pointerstructure v1.2.1 h1:ZhBBeX8tSlRpu/FFhXH4RC4OJzFlqsQhoHZAz4x7TIw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -404,20 +359,25 @@ github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw= +github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.0.3-0.20180606204148-bd9c31933947/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= @@ -467,7 +427,6 @@ github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho= github.com/rjeczalik/notify v0.9.2 h1:MiTWrPj55mNDHEiIX5YUSKefw/+lCQVoAFmD6oQm5w8= -github.com/rjeczalik/notify v0.9.2/go.mod h1:aErll2f0sUX9PXZnVNyeiObbmTlk5jnMoCa4QEjJeqM= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.2 h1:KCooALfAYGs415Cwu5ABvv9n9509fSiG5SQJn/AQo4U= @@ -501,10 +460,11 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/syndtr/goleveldb v1.0.1-0.20210305035536-64b5b1c73954/go.mod h1:u2MKkTVTVJWe5D1rCvame8WqhBd88EuIwODJZ1VHCPM= -github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= -github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= +github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a h1:1ur3QoCqvE5fl+nylMaIr9PVV1w343YRDtsy+Rwu7XI= +github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= github.com/tinylib/msgp v1.0.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= github.com/tklauser/go-sysconf v0.3.5/go.mod h1:MkWzOF4RMCshBAMXuhXJs64Rte09mITnppBXY/rYEFI= github.com/tklauser/go-sysconf v0.3.10 h1:IJ1AZGZRWbY8T5Vfk04D9WOA5WSejdflXxP03OUqALw= @@ -518,16 +478,14 @@ github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3C github.com/urfave/cli v1.22.5 h1:lNq9sAHXK2qfdI8W+GRItjCEkI+2oR4d+MEHy1CKXoU= github.com/urfave/cli v1.22.5/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= +github.com/urfave/cli/v2 v2.10.2 h1:x3p8awjp/2arX+Nl/G2040AZpOCHS/eMJJ1/a+mye4Y= github.com/willf/bitset v1.1.3/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= +github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg= github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= @@ -548,11 +506,7 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220307211146-efcb8507fb70/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e h1:T8NU3HyQ8ClP4SEE+KbFlg6n0NhuTsN4MyznaarGsZM= golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -568,7 +522,6 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20220426173459-3bcf042a4bf5/go.mod h1:lgLbSvA5ygNOMpwM/9anMpWVlVJ7Z+cHWq/eFuinpGE= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -591,8 +544,6 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= -golang.org/x/mod v0.6.0-dev.0.20211013180041-c96bc1413d57/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -626,19 +577,15 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210220033124-5f55cee0dc0d/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 h1:NWy5+hlRbC7HK+PmcXVUmW1IMyFce7to56IUvhUFm7Y= +golang.org/x/net v0.0.0-20220607020251-c690dde0001d h1:4SFsTMi4UahlKoloni7L4eYzhFRifURQLw+yv0QDCx8= +golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -661,11 +608,9 @@ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f h1:Ax0t5p6N38Ga0dThY21weqDE golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180926160741-c2ed4eda69e7/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -674,19 +619,16 @@ golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200107162124-548cf772de50/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -703,9 +645,9 @@ golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -714,15 +656,14 @@ golang.org/x/sys v0.0.0-20210420205809-ac73e9fd8988/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220701225701-179beb0bd1a1 h1:+Lm8wRwJpsVpTHuM4tHTwgxjPzv/bjxsHt2cW5EY7XU= golang.org/x/sys v0.0.0-20220701225701-179beb0bd1a1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -731,7 +672,6 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= @@ -739,7 +679,6 @@ golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20220224211638-0e9765cccd65 h1:M73Iuj3xbbb9Uk1DYhzydthsj6oOd6l9bpuFcNoUvTs= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -764,7 +703,6 @@ golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191126055441-b0650ceb63d9/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -787,12 +725,13 @@ golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.8-0.20211029000441-d6a9af8af023/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.0.0-20181121035319-3f7ecaa7e8ca/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.6.0/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= @@ -882,7 +821,6 @@ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLks gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU= @@ -890,7 +828,6 @@ gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHN gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/urfave/cli.v1 v1.20.0 h1:NdAVW6RYxDif9DhDHaAortIu956m2c0v+09AZBPTbE0= gopkg.in/urfave/cli.v1 v1.20.0/go.mod h1:vuBzUtMdQeixQj8LVd+/98pzhxNGQoyuPBlsXHOQNO0= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -902,8 +839,8 @@ gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/op-bindings/bindings/addressmanager.go b/op-bindings/bindings/addressmanager.go index 1ae9c0b1696dd..f26f73dbe4aad 100644 --- a/op-bindings/bindings/addressmanager.go +++ b/op-bindings/bindings/addressmanager.go @@ -31,7 +31,7 @@ var ( // AddressManagerMetaData contains all meta data concerning the AddressManager contract. var AddressManagerMetaData = &bind.MetaData{ ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldAddress\",\"type\":\"address\"}],\"name\":\"AddressSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"}],\"name\":\"getAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"setAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x608060405234801561001057600080fd5b5061001a3361001f565b61006f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6106d98061007e6000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c80639b2ea4bd116100505780639b2ea4bd146100b9578063bf40fac1146100cc578063f2fde38b146100df57600080fd5b8063715018a61461006c5780638da5cb5b14610076575b600080fd5b6100746100f2565b005b60005473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b6100746100c73660046105e4565b610184565b6100906100da366004610632565b6102d0565b6100746100ed36600461066f565b61030c565b60005473ffffffffffffffffffffffffffffffffffffffff163314610178576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b610182600061043c565b565b60005473ffffffffffffffffffffffffffffffffffffffff163314610205576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161016f565b6000610210836104b1565b60008181526001602052604090819020805473ffffffffffffffffffffffffffffffffffffffff8681167fffffffffffffffffffffffff000000000000000000000000000000000000000083161790925591519293501690610273908590610691565b6040805191829003822073ffffffffffffffffffffffffffffffffffffffff808716845284166020840152917f9416a153a346f93d95f94b064ae3f148b6460473c6e82b3f9fc2521b873fcd6c910160405180910390a250505050565b6000600160006102df846104b1565b815260208101919091526040016000205473ffffffffffffffffffffffffffffffffffffffff1692915050565b60005473ffffffffffffffffffffffffffffffffffffffff16331461038d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161016f565b73ffffffffffffffffffffffffffffffffffffffff8116610430576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161016f565b6104398161043c565b50565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000816040516020016104c49190610691565b604051602081830303815290604052805190602001209050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f83011261052157600080fd5b813567ffffffffffffffff8082111561053c5761053c6104e1565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715610582576105826104e1565b8160405283815286602085880101111561059b57600080fd5b836020870160208301376000602085830101528094505050505092915050565b803573ffffffffffffffffffffffffffffffffffffffff811681146105df57600080fd5b919050565b600080604083850312156105f757600080fd5b823567ffffffffffffffff81111561060e57600080fd5b61061a85828601610510565b925050610629602084016105bb565b90509250929050565b60006020828403121561064457600080fd5b813567ffffffffffffffff81111561065b57600080fd5b61066784828501610510565b949350505050565b60006020828403121561068157600080fd5b61068a826105bb565b9392505050565b6000825160005b818110156106b25760208186018101518583015201610698565b818111156106c1576000828501525b50919091019291505056fea164736f6c634300080a000a", + Bin: "0x608060405234801561001057600080fd5b5061001a3361001f565b61006f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6106d98061007e6000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c80639b2ea4bd116100505780639b2ea4bd146100b9578063bf40fac1146100cc578063f2fde38b146100df57600080fd5b8063715018a61461006c5780638da5cb5b14610076575b600080fd5b6100746100f2565b005b60005473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b6100746100c73660046105e4565b610184565b6100906100da366004610632565b6102d0565b6100746100ed36600461066f565b61030c565b60005473ffffffffffffffffffffffffffffffffffffffff163314610178576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b610182600061043c565b565b60005473ffffffffffffffffffffffffffffffffffffffff163314610205576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161016f565b6000610210836104b1565b60008181526001602052604090819020805473ffffffffffffffffffffffffffffffffffffffff8681167fffffffffffffffffffffffff000000000000000000000000000000000000000083161790925591519293501690610273908590610691565b6040805191829003822073ffffffffffffffffffffffffffffffffffffffff808716845284166020840152917f9416a153a346f93d95f94b064ae3f148b6460473c6e82b3f9fc2521b873fcd6c910160405180910390a250505050565b6000600160006102df846104b1565b815260208101919091526040016000205473ffffffffffffffffffffffffffffffffffffffff1692915050565b60005473ffffffffffffffffffffffffffffffffffffffff16331461038d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161016f565b73ffffffffffffffffffffffffffffffffffffffff8116610430576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161016f565b6104398161043c565b50565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000816040516020016104c49190610691565b604051602081830303815290604052805190602001209050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f83011261052157600080fd5b813567ffffffffffffffff8082111561053c5761053c6104e1565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715610582576105826104e1565b8160405283815286602085880101111561059b57600080fd5b836020870160208301376000602085830101528094505050505092915050565b803573ffffffffffffffffffffffffffffffffffffffff811681146105df57600080fd5b919050565b600080604083850312156105f757600080fd5b823567ffffffffffffffff81111561060e57600080fd5b61061a85828601610510565b925050610629602084016105bb565b90509250929050565b60006020828403121561064457600080fd5b813567ffffffffffffffff81111561065b57600080fd5b61066784828501610510565b949350505050565b60006020828403121561068157600080fd5b61068a826105bb565b9392505050565b6000825160005b818110156106b25760208186018101518583015201610698565b818111156106c1576000828501525b50919091019291505056fea164736f6c634300080f000a", } // AddressManagerABI is the input ABI used to generate the binding from. diff --git a/op-bindings/bindings/gaspriceoracle.go b/op-bindings/bindings/gaspriceoracle.go index d5da629b5b813..7c4c4b3be0221 100644 --- a/op-bindings/bindings/gaspriceoracle.go +++ b/op-bindings/bindings/gaspriceoracle.go @@ -30,8 +30,8 @@ var ( // GasPriceOracleMetaData contains all meta data concerning the GasPriceOracle contract. var GasPriceOracleMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"decimals\",\"type\":\"uint256\"}],\"name\":\"DecimalsUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"overhead\",\"type\":\"uint256\"}],\"name\":\"OverheadUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"scalar\",\"type\":\"uint256\"}],\"name\":\"ScalarUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"MAJOR_VERSION\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MINOR_VERSION\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"PATCH_VERSION\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"baseFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gasPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"getL1Fee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"getL1GasUsed\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l1BaseFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"overhead\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"scalar\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_decimals\",\"type\":\"uint256\"}],\"name\":\"setDecimals\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_overhead\",\"type\":\"uint256\"}],\"name\":\"setOverhead\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_scalar\",\"type\":\"uint256\"}],\"name\":\"setScalar\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x60e060405234801561001057600080fd5b50604051610e0d380380610e0d83398101604081905261002f91610178565b600080600161003d33610058565b60809290925260a05260c052610052816100a8565b506101a8565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000546001600160a01b031633146101075760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6001600160a01b03811661016c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016100fe565b61017581610058565b50565b60006020828403121561018a57600080fd5b81516001600160a01b03811681146101a157600080fd5b9392505050565b60805160a05160c051610c366101d7600039600061017a015260006101fd015260006102530152610c366000f3fe608060405234801561001057600080fd5b506004361061011b5760003560e01c8063715018a6116100b2578063de26c4a111610081578063f45e65d811610066578063f45e65d814610245578063f786becd1461024e578063fe173b971461019c57600080fd5b8063de26c4a11461021f578063f2fde38b1461023257600080fd5b8063715018a6146101b55780638c8885c8146101bd5780638da5cb5b146101d0578063c8b91531146101f857600080fd5b8063519b4bd3116100ee578063519b4bd31461016d5780636bf2606a146101755780636ef25c3a1461019c57806370465597146101a257600080fd5b80630c18c16214610120578063313ce5671461013c5780633577afc51461014557806349948e0e1461015a575b600080fd5b61012960035481565b6040519081526020015b60405180910390f35b61012960055481565b610158610153366004610867565b610275565b005b6101296101683660046108af565b610337565b610129610397565b6101297f000000000000000000000000000000000000000000000000000000000000000081565b48610129565b6101586101b0366004610867565b610421565b6101586104d7565b6101586101cb366004610867565b610564565b60005460405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610133565b6101297f000000000000000000000000000000000000000000000000000000000000000081565b61012961022d3660046108af565b61061a565b61015861024036600461097e565b6106c2565b61012960045481565b6101297f000000000000000000000000000000000000000000000000000000000000000081565b60005473ffffffffffffffffffffffffffffffffffffffff1633146102fb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b60038190556040518181527f32740b35c0ea213650f60d44366b4fb211c9033b50714e4a1d34e65d5beb9bb4906020015b60405180910390a150565b6000806103438361061a565b9050600061034f610397565b61035990836109ea565b90506000600554600a61036c9190610b49565b905060006004548361037e91906109ea565b9050600061038c8383610b55565b979650505050505050565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16635cf249696040518163ffffffff1660e01b8152600401602060405180830381865afa1580156103f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061041c9190610b90565b905090565b60005473ffffffffffffffffffffffffffffffffffffffff1633146104a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102f2565b60048190556040518181527f3336cd9708eaf2769a0f0dc0679f30e80f15dcd88d1921b5a16858e8b85c591a9060200161032c565b60005473ffffffffffffffffffffffffffffffffffffffff163314610558576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102f2565b61056260006107f2565b565b60005473ffffffffffffffffffffffffffffffffffffffff1633146105e5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102f2565b60058190556040518181527fd68112a8707e326d08be3656b528c1bcc5bbbfc47f4177e2179b14d8640838c19060200161032c565b80516000908190815b8181101561069a5784818151811061063d5761063d610ba9565b01602001517fff000000000000000000000000000000000000000000000000000000000000001661067a57610673600484610bd8565b9250610688565b610685601084610bd8565b92505b8061069281610bf0565b915050610623565b506000600354836106ab9190610bd8565b90506106b981610440610bd8565b95945050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610743576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102f2565b73ffffffffffffffffffffffffffffffffffffffff81166107e6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016102f2565b6107ef816107f2565b50565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020828403121561087957600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000602082840312156108c157600080fd5b813567ffffffffffffffff808211156108d957600080fd5b818401915084601f8301126108ed57600080fd5b8135818111156108ff576108ff610880565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561094557610945610880565b8160405282815287602084870101111561095e57600080fd5b826020860160208301376000928101602001929092525095945050505050565b60006020828403121561099057600080fd5b813573ffffffffffffffffffffffffffffffffffffffff811681146109b457600080fd5b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615610a2257610a226109bb565b500290565b600181815b80851115610a8057817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115610a6657610a666109bb565b80851615610a7357918102915b93841c9390800290610a2c565b509250929050565b600082610a9757506001610b43565b81610aa457506000610b43565b8160018114610aba5760028114610ac457610ae0565b6001915050610b43565b60ff841115610ad557610ad56109bb565b50506001821b610b43565b5060208310610133831016604e8410600b8410161715610b03575081810a610b43565b610b0d8383610a27565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115610b3f57610b3f6109bb565b0290505b92915050565b60006109b48383610a88565b600082610b8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b600060208284031215610ba257600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008219821115610beb57610beb6109bb565b500190565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415610c2257610c226109bb565b506001019056fea164736f6c634300080a000a", + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"decimals\",\"type\":\"uint256\"}],\"name\":\"DecimalsUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"overhead\",\"type\":\"uint256\"}],\"name\":\"OverheadUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"scalar\",\"type\":\"uint256\"}],\"name\":\"ScalarUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"baseFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gasPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"getL1Fee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"getL1GasUsed\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l1BaseFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"overhead\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"scalar\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_decimals\",\"type\":\"uint256\"}],\"name\":\"setDecimals\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_overhead\",\"type\":\"uint256\"}],\"name\":\"setOverhead\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_scalar\",\"type\":\"uint256\"}],\"name\":\"setScalar\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x60e060405234801561001057600080fd5b5060405161109338038061109383398101604081905261002f91610178565b600080600161003d33610058565b60809290925260a05260c052610052816100a8565b506101a8565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000546001600160a01b031633146101075760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6001600160a01b03811661016c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016100fe565b61017581610058565b50565b60006020828403121561018a57600080fd5b81516001600160a01b03811681146101a157600080fd5b9392505050565b60805160a05160c051610ebc6101d760003960006103f4015260006103cb015260006103a20152610ebc6000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c80637046559711610097578063de26c4a111610066578063de26c4a1146101c0578063f2fde38b146101d3578063f45e65d8146101e6578063fe173b971461016457600080fd5b8063704655971461016a578063715018a61461017d5780638c8885c8146101855780638da5cb5b1461019857600080fd5b806349948e0e116100d357806349948e0e14610134578063519b4bd31461014757806354fd4d501461014f5780636ef25c3a1461016457600080fd5b80630c18c162146100fa578063313ce567146101165780633577afc51461011f575b600080fd5b61010360035481565b6040519081526020015b60405180910390f35b61010360055481565b61013261012d3660046109c4565b6101ef565b005b610103610142366004610a0c565b6102b1565b610103610311565b61015761039b565b60405161010d9190610b0b565b48610103565b6101326101783660046109c4565b61043e565b6101326104f4565b6101326101933660046109c4565b610581565b60005460405173ffffffffffffffffffffffffffffffffffffffff909116815260200161010d565b6101036101ce366004610a0c565b610637565b6101326101e1366004610b5c565b6106e2565b61010360045481565b60005473ffffffffffffffffffffffffffffffffffffffff163314610275576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b60038190556040518181527f32740b35c0ea213650f60d44366b4fb211c9033b50714e4a1d34e65d5beb9bb4906020015b60405180910390a150565b6000806102bd83610637565b905060006102c9610311565b6102d39083610bc8565b90506000600554600a6102e69190610d27565b90506000600454836102f89190610bc8565b905060006103068383610d62565b979650505050505050565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16635cf249696040518163ffffffff1660e01b8152600401602060405180830381865afa158015610372573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103969190610d76565b905090565b60606103c67f0000000000000000000000000000000000000000000000000000000000000000610812565b6103ef7f0000000000000000000000000000000000000000000000000000000000000000610812565b6104187f0000000000000000000000000000000000000000000000000000000000000000610812565b60405160200161042a93929190610d8f565b604051602081830303815290604052905090565b60005473ffffffffffffffffffffffffffffffffffffffff1633146104bf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161026c565b60048190556040518181527f3336cd9708eaf2769a0f0dc0679f30e80f15dcd88d1921b5a16858e8b85c591a906020016102a6565b60005473ffffffffffffffffffffffffffffffffffffffff163314610575576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161026c565b61057f600061094f565b565b60005473ffffffffffffffffffffffffffffffffffffffff163314610602576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161026c565b60058190556040518181527fd68112a8707e326d08be3656b528c1bcc5bbbfc47f4177e2179b14d8640838c1906020016102a6565b80516000908190815b818110156106ba5784818151811061065a5761065a610e05565b01602001517fff000000000000000000000000000000000000000000000000000000000000001660000361069a57610693600484610e34565b92506106a8565b6106a5601084610e34565b92505b806106b281610e4c565b915050610640565b506000600354836106cb9190610e34565b90506106d981610440610e34565b95945050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610763576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161026c565b73ffffffffffffffffffffffffffffffffffffffff8116610806576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161026c565b61080f8161094f565b50565b60608160000361085557505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b811561087f578061086981610e4c565b91506108789050600a83610d62565b9150610859565b60008167ffffffffffffffff81111561089a5761089a6109dd565b6040519080825280601f01601f1916602001820160405280156108c4576020820181803683370190505b5090505b8415610947576108d9600183610e84565b91506108e6600a86610e9b565b6108f1906030610e34565b60f81b81838151811061090657610906610e05565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350610940600a86610d62565b94506108c8565b949350505050565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156109d657600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600060208284031215610a1e57600080fd5b813567ffffffffffffffff80821115610a3657600080fd5b818401915084601f830112610a4a57600080fd5b813581811115610a5c57610a5c6109dd565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908382118183101715610aa257610aa26109dd565b81604052828152876020848701011115610abb57600080fd5b826020860160208301376000928101602001929092525095945050505050565b60005b83811015610af6578181015183820152602001610ade565b83811115610b05576000848401525b50505050565b6020815260008251806020840152610b2a816040850160208701610adb565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b600060208284031215610b6e57600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610b9257600080fd5b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615610c0057610c00610b99565b500290565b600181815b80851115610c5e57817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115610c4457610c44610b99565b80851615610c5157918102915b93841c9390800290610c0a565b509250929050565b600082610c7557506001610d21565b81610c8257506000610d21565b8160018114610c985760028114610ca257610cbe565b6001915050610d21565b60ff841115610cb357610cb3610b99565b50506001821b610d21565b5060208310610133831016604e8410600b8410161715610ce1575081810a610d21565b610ceb8383610c05565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115610d1d57610d1d610b99565b0290505b92915050565b6000610b928383610c66565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082610d7157610d71610d33565b500490565b600060208284031215610d8857600080fd5b5051919050565b60008451610da1818460208901610adb565b80830190507f2e000000000000000000000000000000000000000000000000000000000000008082528551610ddd816001850160208a01610adb565b60019201918201528351610df8816002840160208801610adb565b0160020195945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008219821115610e4757610e47610b99565b500190565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610e7d57610e7d610b99565b5060010190565b600082821015610e9657610e96610b99565b500390565b600082610eaa57610eaa610d33565b50069056fea164736f6c634300080f000a", } // GasPriceOracleABI is the input ABI used to generate the binding from. @@ -201,99 +201,6 @@ func (_GasPriceOracle *GasPriceOracleTransactorRaw) Transact(opts *bind.Transact return _GasPriceOracle.Contract.contract.Transact(opts, method, params...) } -// MAJORVERSION is a free data retrieval call binding the contract method 0xf786becd. -// -// Solidity: function MAJOR_VERSION() view returns(uint256) -func (_GasPriceOracle *GasPriceOracleCaller) MAJORVERSION(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _GasPriceOracle.contract.Call(opts, &out, "MAJOR_VERSION") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// MAJORVERSION is a free data retrieval call binding the contract method 0xf786becd. -// -// Solidity: function MAJOR_VERSION() view returns(uint256) -func (_GasPriceOracle *GasPriceOracleSession) MAJORVERSION() (*big.Int, error) { - return _GasPriceOracle.Contract.MAJORVERSION(&_GasPriceOracle.CallOpts) -} - -// MAJORVERSION is a free data retrieval call binding the contract method 0xf786becd. -// -// Solidity: function MAJOR_VERSION() view returns(uint256) -func (_GasPriceOracle *GasPriceOracleCallerSession) MAJORVERSION() (*big.Int, error) { - return _GasPriceOracle.Contract.MAJORVERSION(&_GasPriceOracle.CallOpts) -} - -// MINORVERSION is a free data retrieval call binding the contract method 0xc8b91531. -// -// Solidity: function MINOR_VERSION() view returns(uint256) -func (_GasPriceOracle *GasPriceOracleCaller) MINORVERSION(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _GasPriceOracle.contract.Call(opts, &out, "MINOR_VERSION") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// MINORVERSION is a free data retrieval call binding the contract method 0xc8b91531. -// -// Solidity: function MINOR_VERSION() view returns(uint256) -func (_GasPriceOracle *GasPriceOracleSession) MINORVERSION() (*big.Int, error) { - return _GasPriceOracle.Contract.MINORVERSION(&_GasPriceOracle.CallOpts) -} - -// MINORVERSION is a free data retrieval call binding the contract method 0xc8b91531. -// -// Solidity: function MINOR_VERSION() view returns(uint256) -func (_GasPriceOracle *GasPriceOracleCallerSession) MINORVERSION() (*big.Int, error) { - return _GasPriceOracle.Contract.MINORVERSION(&_GasPriceOracle.CallOpts) -} - -// PATCHVERSION is a free data retrieval call binding the contract method 0x6bf2606a. -// -// Solidity: function PATCH_VERSION() view returns(uint256) -func (_GasPriceOracle *GasPriceOracleCaller) PATCHVERSION(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _GasPriceOracle.contract.Call(opts, &out, "PATCH_VERSION") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// PATCHVERSION is a free data retrieval call binding the contract method 0x6bf2606a. -// -// Solidity: function PATCH_VERSION() view returns(uint256) -func (_GasPriceOracle *GasPriceOracleSession) PATCHVERSION() (*big.Int, error) { - return _GasPriceOracle.Contract.PATCHVERSION(&_GasPriceOracle.CallOpts) -} - -// PATCHVERSION is a free data retrieval call binding the contract method 0x6bf2606a. -// -// Solidity: function PATCH_VERSION() view returns(uint256) -func (_GasPriceOracle *GasPriceOracleCallerSession) PATCHVERSION() (*big.Int, error) { - return _GasPriceOracle.Contract.PATCHVERSION(&_GasPriceOracle.CallOpts) -} - // BaseFee is a free data retrieval call binding the contract method 0x6ef25c3a. // // Solidity: function baseFee() view returns(uint256) @@ -573,6 +480,37 @@ func (_GasPriceOracle *GasPriceOracleCallerSession) Scalar() (*big.Int, error) { return _GasPriceOracle.Contract.Scalar(&_GasPriceOracle.CallOpts) } +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_GasPriceOracle *GasPriceOracleCaller) Version(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _GasPriceOracle.contract.Call(opts, &out, "version") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_GasPriceOracle *GasPriceOracleSession) Version() (string, error) { + return _GasPriceOracle.Contract.Version(&_GasPriceOracle.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_GasPriceOracle *GasPriceOracleCallerSession) Version() (string, error) { + return _GasPriceOracle.Contract.Version(&_GasPriceOracle.CallOpts) +} + // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() diff --git a/op-bindings/bindings/gaspriceoracle_deployed.go b/op-bindings/bindings/gaspriceoracle_deployed.go index 3d5830b070c85..7c13ca272dc9f 100644 --- a/op-bindings/bindings/gaspriceoracle_deployed.go +++ b/op-bindings/bindings/gaspriceoracle_deployed.go @@ -2,4 +2,4 @@ // This file is a generated binding and any manual changes will be lost. package bindings -var GasPriceOracleDeployedBin = "0x608060405234801561001057600080fd5b506004361061011b5760003560e01c8063715018a6116100b2578063de26c4a111610081578063f45e65d811610066578063f45e65d814610245578063f786becd1461024e578063fe173b971461019c57600080fd5b8063de26c4a11461021f578063f2fde38b1461023257600080fd5b8063715018a6146101b55780638c8885c8146101bd5780638da5cb5b146101d0578063c8b91531146101f857600080fd5b8063519b4bd3116100ee578063519b4bd31461016d5780636bf2606a146101755780636ef25c3a1461019c57806370465597146101a257600080fd5b80630c18c16214610120578063313ce5671461013c5780633577afc51461014557806349948e0e1461015a575b600080fd5b61012960035481565b6040519081526020015b60405180910390f35b61012960055481565b610158610153366004610867565b610275565b005b6101296101683660046108af565b610337565b610129610397565b6101297f000000000000000000000000000000000000000000000000000000000000000081565b48610129565b6101586101b0366004610867565b610421565b6101586104d7565b6101586101cb366004610867565b610564565b60005460405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610133565b6101297f000000000000000000000000000000000000000000000000000000000000000081565b61012961022d3660046108af565b61061a565b61015861024036600461097e565b6106c2565b61012960045481565b6101297f000000000000000000000000000000000000000000000000000000000000000081565b60005473ffffffffffffffffffffffffffffffffffffffff1633146102fb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b60038190556040518181527f32740b35c0ea213650f60d44366b4fb211c9033b50714e4a1d34e65d5beb9bb4906020015b60405180910390a150565b6000806103438361061a565b9050600061034f610397565b61035990836109ea565b90506000600554600a61036c9190610b49565b905060006004548361037e91906109ea565b9050600061038c8383610b55565b979650505050505050565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16635cf249696040518163ffffffff1660e01b8152600401602060405180830381865afa1580156103f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061041c9190610b90565b905090565b60005473ffffffffffffffffffffffffffffffffffffffff1633146104a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102f2565b60048190556040518181527f3336cd9708eaf2769a0f0dc0679f30e80f15dcd88d1921b5a16858e8b85c591a9060200161032c565b60005473ffffffffffffffffffffffffffffffffffffffff163314610558576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102f2565b61056260006107f2565b565b60005473ffffffffffffffffffffffffffffffffffffffff1633146105e5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102f2565b60058190556040518181527fd68112a8707e326d08be3656b528c1bcc5bbbfc47f4177e2179b14d8640838c19060200161032c565b80516000908190815b8181101561069a5784818151811061063d5761063d610ba9565b01602001517fff000000000000000000000000000000000000000000000000000000000000001661067a57610673600484610bd8565b9250610688565b610685601084610bd8565b92505b8061069281610bf0565b915050610623565b506000600354836106ab9190610bd8565b90506106b981610440610bd8565b95945050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610743576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102f2565b73ffffffffffffffffffffffffffffffffffffffff81166107e6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016102f2565b6107ef816107f2565b50565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020828403121561087957600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000602082840312156108c157600080fd5b813567ffffffffffffffff808211156108d957600080fd5b818401915084601f8301126108ed57600080fd5b8135818111156108ff576108ff610880565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561094557610945610880565b8160405282815287602084870101111561095e57600080fd5b826020860160208301376000928101602001929092525095945050505050565b60006020828403121561099057600080fd5b813573ffffffffffffffffffffffffffffffffffffffff811681146109b457600080fd5b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615610a2257610a226109bb565b500290565b600181815b80851115610a8057817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115610a6657610a666109bb565b80851615610a7357918102915b93841c9390800290610a2c565b509250929050565b600082610a9757506001610b43565b81610aa457506000610b43565b8160018114610aba5760028114610ac457610ae0565b6001915050610b43565b60ff841115610ad557610ad56109bb565b50506001821b610b43565b5060208310610133831016604e8410600b8410161715610b03575081810a610b43565b610b0d8383610a27565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115610b3f57610b3f6109bb565b0290505b92915050565b60006109b48383610a88565b600082610b8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b600060208284031215610ba257600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008219821115610beb57610beb6109bb565b500190565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415610c2257610c226109bb565b506001019056fea164736f6c634300080a000a" +var GasPriceOracleDeployedBin = "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80637046559711610097578063de26c4a111610066578063de26c4a1146101c0578063f2fde38b146101d3578063f45e65d8146101e6578063fe173b971461016457600080fd5b8063704655971461016a578063715018a61461017d5780638c8885c8146101855780638da5cb5b1461019857600080fd5b806349948e0e116100d357806349948e0e14610134578063519b4bd31461014757806354fd4d501461014f5780636ef25c3a1461016457600080fd5b80630c18c162146100fa578063313ce567146101165780633577afc51461011f575b600080fd5b61010360035481565b6040519081526020015b60405180910390f35b61010360055481565b61013261012d3660046109c4565b6101ef565b005b610103610142366004610a0c565b6102b1565b610103610311565b61015761039b565b60405161010d9190610b0b565b48610103565b6101326101783660046109c4565b61043e565b6101326104f4565b6101326101933660046109c4565b610581565b60005460405173ffffffffffffffffffffffffffffffffffffffff909116815260200161010d565b6101036101ce366004610a0c565b610637565b6101326101e1366004610b5c565b6106e2565b61010360045481565b60005473ffffffffffffffffffffffffffffffffffffffff163314610275576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b60038190556040518181527f32740b35c0ea213650f60d44366b4fb211c9033b50714e4a1d34e65d5beb9bb4906020015b60405180910390a150565b6000806102bd83610637565b905060006102c9610311565b6102d39083610bc8565b90506000600554600a6102e69190610d27565b90506000600454836102f89190610bc8565b905060006103068383610d62565b979650505050505050565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16635cf249696040518163ffffffff1660e01b8152600401602060405180830381865afa158015610372573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103969190610d76565b905090565b60606103c67f0000000000000000000000000000000000000000000000000000000000000000610812565b6103ef7f0000000000000000000000000000000000000000000000000000000000000000610812565b6104187f0000000000000000000000000000000000000000000000000000000000000000610812565b60405160200161042a93929190610d8f565b604051602081830303815290604052905090565b60005473ffffffffffffffffffffffffffffffffffffffff1633146104bf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161026c565b60048190556040518181527f3336cd9708eaf2769a0f0dc0679f30e80f15dcd88d1921b5a16858e8b85c591a906020016102a6565b60005473ffffffffffffffffffffffffffffffffffffffff163314610575576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161026c565b61057f600061094f565b565b60005473ffffffffffffffffffffffffffffffffffffffff163314610602576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161026c565b60058190556040518181527fd68112a8707e326d08be3656b528c1bcc5bbbfc47f4177e2179b14d8640838c1906020016102a6565b80516000908190815b818110156106ba5784818151811061065a5761065a610e05565b01602001517fff000000000000000000000000000000000000000000000000000000000000001660000361069a57610693600484610e34565b92506106a8565b6106a5601084610e34565b92505b806106b281610e4c565b915050610640565b506000600354836106cb9190610e34565b90506106d981610440610e34565b95945050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610763576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161026c565b73ffffffffffffffffffffffffffffffffffffffff8116610806576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161026c565b61080f8161094f565b50565b60608160000361085557505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b811561087f578061086981610e4c565b91506108789050600a83610d62565b9150610859565b60008167ffffffffffffffff81111561089a5761089a6109dd565b6040519080825280601f01601f1916602001820160405280156108c4576020820181803683370190505b5090505b8415610947576108d9600183610e84565b91506108e6600a86610e9b565b6108f1906030610e34565b60f81b81838151811061090657610906610e05565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350610940600a86610d62565b94506108c8565b949350505050565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156109d657600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600060208284031215610a1e57600080fd5b813567ffffffffffffffff80821115610a3657600080fd5b818401915084601f830112610a4a57600080fd5b813581811115610a5c57610a5c6109dd565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908382118183101715610aa257610aa26109dd565b81604052828152876020848701011115610abb57600080fd5b826020860160208301376000928101602001929092525095945050505050565b60005b83811015610af6578181015183820152602001610ade565b83811115610b05576000848401525b50505050565b6020815260008251806020840152610b2a816040850160208701610adb565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b600060208284031215610b6e57600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610b9257600080fd5b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615610c0057610c00610b99565b500290565b600181815b80851115610c5e57817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115610c4457610c44610b99565b80851615610c5157918102915b93841c9390800290610c0a565b509250929050565b600082610c7557506001610d21565b81610c8257506000610d21565b8160018114610c985760028114610ca257610cbe565b6001915050610d21565b60ff841115610cb357610cb3610b99565b50506001821b610d21565b5060208310610133831016604e8410600b8410161715610ce1575081810a610d21565b610ceb8383610c05565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115610d1d57610d1d610b99565b0290505b92915050565b6000610b928383610c66565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082610d7157610d71610d33565b500490565b600060208284031215610d8857600080fd5b5051919050565b60008451610da1818460208901610adb565b80830190507f2e000000000000000000000000000000000000000000000000000000000000008082528551610ddd816001850160208a01610adb565b60019201918201528351610df8816002840160208801610adb565b0160020195945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008219821115610e4757610e47610b99565b500190565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610e7d57610e7d610b99565b5060010190565b600082821015610e9657610e96610b99565b500390565b600082610eaa57610eaa610d33565b50069056fea164736f6c634300080f000a" diff --git a/op-bindings/bindings/l1block.go b/op-bindings/bindings/l1block.go index ce292e2f43214..1aa1944aa2204 100644 --- a/op-bindings/bindings/l1block.go +++ b/op-bindings/bindings/l1block.go @@ -30,8 +30,8 @@ var ( // L1BlockMetaData contains all meta data concerning the L1Block contract. var L1BlockMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"DEPOSITOR_ACCOUNT\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAJOR_VERSION\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MINOR_VERSION\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"PATCH_VERSION\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"basefee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"hash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"number\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sequenceNumber\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"_number\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"_timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"_basefee\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_hash\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"_sequenceNumber\",\"type\":\"uint64\"}],\"name\":\"setL1BlockValues\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"timestamp\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", - Bin: "0x60e060405234801561001057600080fd5b506000608081905260a052600160c05260805160a05160c0516103c061004f600039600061012f0152600061018a015260006101f101526103c06000f3fe608060405234801561001057600080fd5b50600436106100be5760003560e01c80638381f58a11610076578063c8b915311161005b578063c8b9153114610185578063e591b282146101ac578063f786becd146101ec57600080fd5b80638381f58a14610151578063b80777ea1461016557600080fd5b80635cf24969116100a75780635cf24969146100f457806364ca23ef146100fd5780636bf2606a1461012a57600080fd5b8063042c2f57146100c357806309bd5a60146100d8575b600080fd5b6100d66100d136600461035c565b610213565b005b6100e160025481565b6040519081526020015b60405180910390f35b6100e160015481565b6003546101119067ffffffffffffffff1681565b60405167ffffffffffffffff90911681526020016100eb565b6100e17f000000000000000000000000000000000000000000000000000000000000000081565b6000546101119067ffffffffffffffff1681565b6000546101119068010000000000000000900467ffffffffffffffff1681565b6100e17f000000000000000000000000000000000000000000000000000000000000000081565b6101c773deaddeaddeaddeaddeaddeaddeaddeaddead000181565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100eb565b6100e17f000000000000000000000000000000000000000000000000000000000000000081565b3373deaddeaddeaddeaddeaddeaddeaddeaddead0001146102ba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603b60248201527f4c31426c6f636b3a206f6e6c7920746865206465706f7369746f72206163636f60448201527f756e742063616e20736574204c3120626c6f636b2076616c7565730000000000606482015260840160405180910390fd5b6000805467ffffffffffffffff9687167fffffffffffffffffffffffffffffffff0000000000000000000000000000000090911617680100000000000000009587169590950294909417909355600191909155600255600380547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001691909216179055565b803567ffffffffffffffff8116811461035757600080fd5b919050565b600080600080600060a0868803121561037457600080fd5b61037d8661033f565b945061038b6020870161033f565b935060408601359250606086013591506103a76080870161033f565b9050929550929590935056fea164736f6c634300080a000a", + ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"DEPOSITOR_ACCOUNT\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"basefee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"hash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"number\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sequenceNumber\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"_number\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"_timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"_basefee\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_hash\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"_sequenceNumber\",\"type\":\"uint64\"}],\"name\":\"setL1BlockValues\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"timestamp\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x60e060405234801561001057600080fd5b506000608081905260a052600160c05260805160a05160c05161074c61004f6000396000610302015260006102d9015260006102b0015261074c6000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c806364ca23ef1161005b57806364ca23ef146100dc5780638381f58a14610109578063b80777ea1461011d578063e591b2821461013d57600080fd5b8063042c2f571461008d57806309bd5a60146100a257806354fd4d50146100be5780635cf24969146100d3575b600080fd5b6100a061009b3660046104a6565b61017d565b005b6100ab60025481565b6040519081526020015b60405180910390f35b6100c66102a9565b6040516100b5919061052d565b6100ab60015481565b6003546100f09067ffffffffffffffff1681565b60405167ffffffffffffffff90911681526020016100b5565b6000546100f09067ffffffffffffffff1681565b6000546100f09068010000000000000000900467ffffffffffffffff1681565b61015873deaddeaddeaddeaddeaddeaddeaddeaddead000181565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100b5565b3373deaddeaddeaddeaddeaddeaddeaddeaddead000114610224576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603b60248201527f4c31426c6f636b3a206f6e6c7920746865206465706f7369746f72206163636f60448201527f756e742063616e20736574204c3120626c6f636b2076616c7565730000000000606482015260840160405180910390fd5b6000805467ffffffffffffffff9687167fffffffffffffffffffffffffffffffff0000000000000000000000000000000090911617680100000000000000009587169590950294909417909355600191909155600255600380547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001691909216179055565b60606102d47f000000000000000000000000000000000000000000000000000000000000000061034c565b6102fd7f000000000000000000000000000000000000000000000000000000000000000061034c565b6103267f000000000000000000000000000000000000000000000000000000000000000061034c565b6040516020016103389392919061057e565b604051602081830303815290604052905090565b60608160000361038f57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b81156103b957806103a381610623565b91506103b29050600a8361068a565b9150610393565b60008167ffffffffffffffff8111156103d4576103d461069e565b6040519080825280601f01601f1916602001820160405280156103fe576020820181803683370190505b5090505b8415610481576104136001836106cd565b9150610420600a866106e4565b61042b9060306106f8565b60f81b81838151811061044057610440610710565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535061047a600a8661068a565b9450610402565b949350505050565b803567ffffffffffffffff811681146104a157600080fd5b919050565b600080600080600060a086880312156104be57600080fd5b6104c786610489565b94506104d560208701610489565b935060408601359250606086013591506104f160808701610489565b90509295509295909350565b60005b83811015610518578181015183820152602001610500565b83811115610527576000848401525b50505050565b602081526000825180602084015261054c8160408501602087016104fd565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b600084516105908184602089016104fd565b80830190507f2e0000000000000000000000000000000000000000000000000000000000000080825285516105cc816001850160208a016104fd565b600192019182015283516105e78160028401602088016104fd565b0160020195945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610654576106546105f4565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000826106995761069961065b565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000828210156106df576106df6105f4565b500390565b6000826106f3576106f361065b565b500690565b6000821982111561070b5761070b6105f4565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fdfea164736f6c634300080f000a", } // L1BlockABI is the input ABI used to generate the binding from. @@ -232,99 +232,6 @@ func (_L1Block *L1BlockCallerSession) DEPOSITORACCOUNT() (common.Address, error) return _L1Block.Contract.DEPOSITORACCOUNT(&_L1Block.CallOpts) } -// MAJORVERSION is a free data retrieval call binding the contract method 0xf786becd. -// -// Solidity: function MAJOR_VERSION() view returns(uint256) -func (_L1Block *L1BlockCaller) MAJORVERSION(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _L1Block.contract.Call(opts, &out, "MAJOR_VERSION") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// MAJORVERSION is a free data retrieval call binding the contract method 0xf786becd. -// -// Solidity: function MAJOR_VERSION() view returns(uint256) -func (_L1Block *L1BlockSession) MAJORVERSION() (*big.Int, error) { - return _L1Block.Contract.MAJORVERSION(&_L1Block.CallOpts) -} - -// MAJORVERSION is a free data retrieval call binding the contract method 0xf786becd. -// -// Solidity: function MAJOR_VERSION() view returns(uint256) -func (_L1Block *L1BlockCallerSession) MAJORVERSION() (*big.Int, error) { - return _L1Block.Contract.MAJORVERSION(&_L1Block.CallOpts) -} - -// MINORVERSION is a free data retrieval call binding the contract method 0xc8b91531. -// -// Solidity: function MINOR_VERSION() view returns(uint256) -func (_L1Block *L1BlockCaller) MINORVERSION(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _L1Block.contract.Call(opts, &out, "MINOR_VERSION") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// MINORVERSION is a free data retrieval call binding the contract method 0xc8b91531. -// -// Solidity: function MINOR_VERSION() view returns(uint256) -func (_L1Block *L1BlockSession) MINORVERSION() (*big.Int, error) { - return _L1Block.Contract.MINORVERSION(&_L1Block.CallOpts) -} - -// MINORVERSION is a free data retrieval call binding the contract method 0xc8b91531. -// -// Solidity: function MINOR_VERSION() view returns(uint256) -func (_L1Block *L1BlockCallerSession) MINORVERSION() (*big.Int, error) { - return _L1Block.Contract.MINORVERSION(&_L1Block.CallOpts) -} - -// PATCHVERSION is a free data retrieval call binding the contract method 0x6bf2606a. -// -// Solidity: function PATCH_VERSION() view returns(uint256) -func (_L1Block *L1BlockCaller) PATCHVERSION(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _L1Block.contract.Call(opts, &out, "PATCH_VERSION") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// PATCHVERSION is a free data retrieval call binding the contract method 0x6bf2606a. -// -// Solidity: function PATCH_VERSION() view returns(uint256) -func (_L1Block *L1BlockSession) PATCHVERSION() (*big.Int, error) { - return _L1Block.Contract.PATCHVERSION(&_L1Block.CallOpts) -} - -// PATCHVERSION is a free data retrieval call binding the contract method 0x6bf2606a. -// -// Solidity: function PATCH_VERSION() view returns(uint256) -func (_L1Block *L1BlockCallerSession) PATCHVERSION() (*big.Int, error) { - return _L1Block.Contract.PATCHVERSION(&_L1Block.CallOpts) -} - // Basefee is a free data retrieval call binding the contract method 0x5cf24969. // // Solidity: function basefee() view returns(uint256) @@ -480,6 +387,37 @@ func (_L1Block *L1BlockCallerSession) Timestamp() (uint64, error) { return _L1Block.Contract.Timestamp(&_L1Block.CallOpts) } +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_L1Block *L1BlockCaller) Version(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _L1Block.contract.Call(opts, &out, "version") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_L1Block *L1BlockSession) Version() (string, error) { + return _L1Block.Contract.Version(&_L1Block.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_L1Block *L1BlockCallerSession) Version() (string, error) { + return _L1Block.Contract.Version(&_L1Block.CallOpts) +} + // SetL1BlockValues is a paid mutator transaction binding the contract method 0x042c2f57. // // Solidity: function setL1BlockValues(uint64 _number, uint64 _timestamp, uint256 _basefee, bytes32 _hash, uint64 _sequenceNumber) returns() diff --git a/op-bindings/bindings/l1block_deployed.go b/op-bindings/bindings/l1block_deployed.go index 6088d5c2e7b79..ac4240e5fc601 100644 --- a/op-bindings/bindings/l1block_deployed.go +++ b/op-bindings/bindings/l1block_deployed.go @@ -2,4 +2,4 @@ // This file is a generated binding and any manual changes will be lost. package bindings -var L1BlockDeployedBin = "0x608060405234801561001057600080fd5b50600436106100be5760003560e01c80638381f58a11610076578063c8b915311161005b578063c8b9153114610185578063e591b282146101ac578063f786becd146101ec57600080fd5b80638381f58a14610151578063b80777ea1461016557600080fd5b80635cf24969116100a75780635cf24969146100f457806364ca23ef146100fd5780636bf2606a1461012a57600080fd5b8063042c2f57146100c357806309bd5a60146100d8575b600080fd5b6100d66100d136600461035c565b610213565b005b6100e160025481565b6040519081526020015b60405180910390f35b6100e160015481565b6003546101119067ffffffffffffffff1681565b60405167ffffffffffffffff90911681526020016100eb565b6100e17f000000000000000000000000000000000000000000000000000000000000000081565b6000546101119067ffffffffffffffff1681565b6000546101119068010000000000000000900467ffffffffffffffff1681565b6100e17f000000000000000000000000000000000000000000000000000000000000000081565b6101c773deaddeaddeaddeaddeaddeaddeaddeaddead000181565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100eb565b6100e17f000000000000000000000000000000000000000000000000000000000000000081565b3373deaddeaddeaddeaddeaddeaddeaddeaddead0001146102ba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603b60248201527f4c31426c6f636b3a206f6e6c7920746865206465706f7369746f72206163636f60448201527f756e742063616e20736574204c3120626c6f636b2076616c7565730000000000606482015260840160405180910390fd5b6000805467ffffffffffffffff9687167fffffffffffffffffffffffffffffffff0000000000000000000000000000000090911617680100000000000000009587169590950294909417909355600191909155600255600380547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001691909216179055565b803567ffffffffffffffff8116811461035757600080fd5b919050565b600080600080600060a0868803121561037457600080fd5b61037d8661033f565b945061038b6020870161033f565b935060408601359250606086013591506103a76080870161033f565b9050929550929590935056fea164736f6c634300080a000a" +var L1BlockDeployedBin = "0x608060405234801561001057600080fd5b50600436106100885760003560e01c806364ca23ef1161005b57806364ca23ef146100dc5780638381f58a14610109578063b80777ea1461011d578063e591b2821461013d57600080fd5b8063042c2f571461008d57806309bd5a60146100a257806354fd4d50146100be5780635cf24969146100d3575b600080fd5b6100a061009b3660046104a6565b61017d565b005b6100ab60025481565b6040519081526020015b60405180910390f35b6100c66102a9565b6040516100b5919061052d565b6100ab60015481565b6003546100f09067ffffffffffffffff1681565b60405167ffffffffffffffff90911681526020016100b5565b6000546100f09067ffffffffffffffff1681565b6000546100f09068010000000000000000900467ffffffffffffffff1681565b61015873deaddeaddeaddeaddeaddeaddeaddeaddead000181565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100b5565b3373deaddeaddeaddeaddeaddeaddeaddeaddead000114610224576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603b60248201527f4c31426c6f636b3a206f6e6c7920746865206465706f7369746f72206163636f60448201527f756e742063616e20736574204c3120626c6f636b2076616c7565730000000000606482015260840160405180910390fd5b6000805467ffffffffffffffff9687167fffffffffffffffffffffffffffffffff0000000000000000000000000000000090911617680100000000000000009587169590950294909417909355600191909155600255600380547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001691909216179055565b60606102d47f000000000000000000000000000000000000000000000000000000000000000061034c565b6102fd7f000000000000000000000000000000000000000000000000000000000000000061034c565b6103267f000000000000000000000000000000000000000000000000000000000000000061034c565b6040516020016103389392919061057e565b604051602081830303815290604052905090565b60608160000361038f57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b81156103b957806103a381610623565b91506103b29050600a8361068a565b9150610393565b60008167ffffffffffffffff8111156103d4576103d461069e565b6040519080825280601f01601f1916602001820160405280156103fe576020820181803683370190505b5090505b8415610481576104136001836106cd565b9150610420600a866106e4565b61042b9060306106f8565b60f81b81838151811061044057610440610710565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535061047a600a8661068a565b9450610402565b949350505050565b803567ffffffffffffffff811681146104a157600080fd5b919050565b600080600080600060a086880312156104be57600080fd5b6104c786610489565b94506104d560208701610489565b935060408601359250606086013591506104f160808701610489565b90509295509295909350565b60005b83811015610518578181015183820152602001610500565b83811115610527576000848401525b50505050565b602081526000825180602084015261054c8160408501602087016104fd565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b600084516105908184602089016104fd565b80830190507f2e0000000000000000000000000000000000000000000000000000000000000080825285516105cc816001850160208a016104fd565b600192019182015283516105e78160028401602088016104fd565b0160020195945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610654576106546105f4565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000826106995761069961065b565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000828210156106df576106df6105f4565b500390565b6000826106f3576106f361065b565b500690565b6000821982111561070b5761070b6105f4565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fdfea164736f6c634300080f000a" diff --git a/op-bindings/bindings/l2outputoracle.go b/op-bindings/bindings/l2outputoracle.go index 6590fcb1c9524..74868f695b6ea 100644 --- a/op-bindings/bindings/l2outputoracle.go +++ b/op-bindings/bindings/l2outputoracle.go @@ -28,16 +28,16 @@ var ( _ = event.NewSubscription ) -// L2OutputOracleOutputProposal is an auto generated low-level Go binding around an user-defined struct. -type L2OutputOracleOutputProposal struct { +// TypesOutputProposal is an auto generated low-level Go binding around an user-defined struct. +type TypesOutputProposal struct { OutputRoot [32]byte Timestamp *big.Int } // L2OutputOracleMetaData contains all meta data concerning the L2OutputOracle contract. var L2OutputOracleMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_submissionInterval\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_genesisL2Output\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_historicalTotalBlocks\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_startingBlockNumber\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_startingTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_l2BlockTime\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_sequencer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"}],\"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\":\"l2Output\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"l1Timestamp\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"l2BlockNumber\",\"type\":\"uint256\"}],\"name\":\"L2OutputAppended\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"l2Output\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"l1Timestamp\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"l2BlockNumber\",\"type\":\"uint256\"}],\"name\":\"L2OutputDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousSequencer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newSequencer\",\"type\":\"address\"}],\"name\":\"SequencerChanged\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"HISTORICAL_TOTAL_BLOCKS\",\"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\":\"MAJOR_VERSION\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MINOR_VERSION\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"PATCH_VERSION\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"STARTING_BLOCK_NUMBER\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"STARTING_TIMESTAMP\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SUBMISSION_INTERVAL\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_l2Output\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_l2BlockNumber\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_l1Blockhash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_l1BlockNumber\",\"type\":\"uint256\"}],\"name\":\"appendL2Output\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newSequencer\",\"type\":\"address\"}],\"name\":\"changeSequencer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_l2BlockNumber\",\"type\":\"uint256\"}],\"name\":\"computeL2Timestamp\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"outputRoot\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"internalType\":\"structL2OutputOracle.OutputProposal\",\"name\":\"_proposal\",\"type\":\"tuple\"}],\"name\":\"deleteL2Output\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_l2BlockNumber\",\"type\":\"uint256\"}],\"name\":\"getL2Output\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"outputRoot\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"internalType\":\"structL2OutputOracle.OutputProposal\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_genesisL2Output\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_startingBlockNumber\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_sequencer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestBlockNumber\",\"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\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sequencer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x6101806040523480156200001257600080fd5b5060405162001e5538038062001e558339810160408190526200003591620005d6565b6000608081905260a052600160c052428310620000cb5760405162461bcd60e51b815260206004820152604360248201527f4f7574707574204f7261636c653a20496e697469616c204c3220626c6f636b2060448201527f74696d65206d757374206265206c657373207468616e2063757272656e742074606482015262696d6560e81b608482015260a4015b60405180910390fd5b60e0889052610100869052610120859052610140849052610160839052620000f68786848462000104565b505050505050505062000648565b6000620001126001620001cd565b905080156200012b576000805461ff0019166101001790555b6040805180820182528681524260208083019182526000888152606790915292909220905181559051600190910155606684905562000169620002e0565b620001748362000348565b6200017f82620004f6565b8015620001c6576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b60008054610100900460ff161562000262578160ff16600114801562000206575062000204306200054860201b620011f01760201c565b155b6200025a5760405162461bcd60e51b815260206004820152602e602482015260008051602062001e1583398151915260448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401620000c2565b506000919050565b60005460ff808416911610620002c15760405162461bcd60e51b815260206004820152602e602482015260008051602062001e1583398151915260448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401620000c2565b506000805460ff191660ff92909216919091179055600190565b919050565b600054610100900460ff166200033c5760405162461bcd60e51b815260206004820152602b602482015260008051602062001e3583398151915260448201526a6e697469616c697a696e6760a81b6064820152608401620000c2565b6200034662000557565b565b6033546001600160a01b03163314620003a45760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401620000c2565b6001600160a01b038116620004145760405162461bcd60e51b815260206004820152602f60248201527f4f75747075744f7261636c653a206e65772073657175656e636572206973207460448201526e6865207a65726f206164647265737360881b6064820152608401620000c2565b6033546001600160a01b03828116911614156200049a5760405162461bcd60e51b815260206004820152603360248201527f4f75747075744f7261636c653a2073657175656e6365722063616e6e6f74206260448201527f652073616d6520617320746865206f776e6572000000000000000000000000006064820152608401620000c2565b6065546040516001600160a01b038084169216907f6ec88bae255aa7e73521c3beb17e9bc7940169e669440c5531733c0d2e91110d90600090a3606580546001600160a01b0319166001600160a01b0392909216919091179055565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b03163b151590565b600054610100900460ff16620005b35760405162461bcd60e51b815260206004820152602b602482015260008051602062001e3583398151915260448201526a6e697469616c697a696e6760a81b6064820152608401620000c2565b6200034633620004f6565b80516001600160a01b0381168114620002db57600080fd5b600080600080600080600080610100898b031215620005f457600080fd5b885197506020890151965060408901519550606089015194506080890151935060a089015192506200062960c08a01620005be565b91506200063960e08a01620005be565b90509295985092959890939650565b60805160a05160c05160e0516101005161012051610140516101605161173d620006d8600039600081816101750152610f0f0152600081816101de0152610f6801526000818161025b01528181610e390152610f33015260006103fd01526000818161028f01528181610776015261108f0152600061031501526000610431015260006104da015261173d6000f3fe60806040526004361061015e5760003560e01c8063715018a6116100c0578063d1de856c11610074578063dcec334811610059578063dcec334814610493578063f2fde38b146104a8578063f786becd146104c857600080fd5b8063d1de856c14610453578063d20b1a511461047357600080fd5b8063a25ae557116100a5578063a25ae55714610377578063a4771aad146103eb578063c8b915311461041f57600080fd5b8063715018a6146103375780638da5cb5b1461034c57600080fd5b80634599c78811610117578063529933df116100fc578063529933df1461027d5780635c1bba38146102b15780636bf2606a1461030357600080fd5b80634599c788146102335780634ab65d731461024957600080fd5b806320e9fcd41161014857806320e9fcd4146101cc57806325188104146102005780632af8ded81461021357600080fd5b80622134cc14610163578063093b3d90146101aa575b600080fd5b34801561016f57600080fd5b506101977f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b3480156101b657600080fd5b506101ca6101c5366004611548565b6104fc565b005b3480156101d857600080fd5b506101977f000000000000000000000000000000000000000000000000000000000000000081565b6101ca61020e3660046115be565b6107a2565b34801561021f57600080fd5b506101ca61022e366004611614565b610b4b565b34801561023f57600080fd5b5061019760665481565b34801561025557600080fd5b506101977f000000000000000000000000000000000000000000000000000000000000000081565b34801561028957600080fd5b506101977f000000000000000000000000000000000000000000000000000000000000000081565b3480156102bd57600080fd5b506065546102de9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101a1565b34801561030f57600080fd5b506101977f000000000000000000000000000000000000000000000000000000000000000081565b34801561034357600080fd5b506101ca610da8565b34801561035857600080fd5b5060335473ffffffffffffffffffffffffffffffffffffffff166102de565b34801561038357600080fd5b506103d0610392366004611636565b604080518082019091526000808252602082015250600090815260676020908152604091829020825180840190935280548352600101549082015290565b604080518251815260209283015192810192909252016101a1565b3480156103f757600080fd5b506101977f000000000000000000000000000000000000000000000000000000000000000081565b34801561042b57600080fd5b506101977f000000000000000000000000000000000000000000000000000000000000000081565b34801561045f57600080fd5b5061019761046e366004611636565b610e35565b34801561047f57600080fd5b506101ca61048e36600461164f565b610f92565b34801561049f57600080fd5b5061019761108b565b3480156104b457600080fd5b506101ca6104c3366004611614565b6110c0565b3480156104d457600080fd5b506101977f000000000000000000000000000000000000000000000000000000000000000081565b60335473ffffffffffffffffffffffffffffffffffffffff163314610582576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6066546000908152606760209081526040918290208251808401909352805480845260019091015491830191909152825114610666576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152605260248201527f4f75747075744f7261636c653a20546865206f757470757420726f6f7420746f60448201527f2064656c65746520646f6573206e6f74206d6174636820746865206c6174657360648201527f74206f75747075742070726f706f73616c2e0000000000000000000000000000608482015260a401610579565b8060200151826020015114610723576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152605060248201527f4f75747075744f7261636c653a205468652074696d657374616d7020746f206460448201527f656c65746520646f6573206e6f74206d6174636820746865206c61746573742060648201527f6f75747075742070726f706f73616c2e00000000000000000000000000000000608482015260a401610579565b606654602082015182516040517f7320566fd5256cf8923648a5d9f560f1e92f1435a1bb32ddd1fe107f224ad35990600090a4606680546000908152606760205260408120818155600101555461079b907f0000000000000000000000000000000000000000000000000000000000000000906116c4565b6066555050565b60655473ffffffffffffffffffffffffffffffffffffffff163314610849576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4f75747075744f7261636c653a2063616c6c6572206973206e6f74207468652060448201527f73657175656e63657200000000000000000000000000000000000000000000006064820152608401610579565b61085161108b565b8314610905576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604760248201527f4f75747075744f7261636c653a20426c6f636b206e756d626572206d7573742060448201527f626520657175616c20746f206e65787420657870656374656420626c6f636b2060648201527f6e756d6265722e00000000000000000000000000000000000000000000000000608482015260a401610579565b4261090f84610e35565b1061099c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f4f75747075744f7261636c653a2043616e6e6f7420617070656e64204c32206f60448201527f757470757420696e206675747572652e000000000000000000000000000000006064820152608401610579565b83610a29576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f4f75747075744f7261636c653a2043616e6e6f74207375626d697420656d707460448201527f79204c32206f75747075742e00000000000000000000000000000000000000006064820152608401610579565b8115610ae55781814014610ae5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604760248201527f4f75747075744f7261636c653a20426c6f636b6861736820646f6573206e6f7460448201527f206d61746368207468652068617368206174207468652065787065637465642060648201527f6865696768742e00000000000000000000000000000000000000000000000000608482015260a401610579565b6040805180820182528581524260208083018281526000888152606790925284822093518455516001909301929092556066869055915185929187917fd6703ded1701060d9ae1793db76d594790a4e775781225f79b5aa8a77987c0809190a450505050565b60335473ffffffffffffffffffffffffffffffffffffffff163314610bcc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610579565b73ffffffffffffffffffffffffffffffffffffffff8116610c6f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f4f75747075744f7261636c653a206e65772073657175656e636572206973207460448201527f6865207a65726f206164647265737300000000000000000000000000000000006064820152608401610579565b60335473ffffffffffffffffffffffffffffffffffffffff82811691161415610d1a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603360248201527f4f75747075744f7261636c653a2073657175656e6365722063616e6e6f74206260448201527f652073616d6520617320746865206f776e6572000000000000000000000000006064820152608401610579565b60655460405173ffffffffffffffffffffffffffffffffffffffff8084169216907f6ec88bae255aa7e73521c3beb17e9bc7940169e669440c5531733c0d2e91110d90600090a3606580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60335473ffffffffffffffffffffffffffffffffffffffff163314610e29576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610579565b610e33600061120c565b565b60007f0000000000000000000000000000000000000000000000000000000000000000821015610f0d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152605660248201527f4f75747075744f7261636c653a20426c6f636b206e756d626572206d7573742060448201527f62652067726561746572207468616e206f7220657175616c20746f207468652060648201527f7374617274696e6720626c6f636b206e756d6265722e00000000000000000000608482015260a401610579565b7f0000000000000000000000000000000000000000000000000000000000000000610f587f0000000000000000000000000000000000000000000000000000000000000000846116c4565b610f6291906116db565b610f8c907f0000000000000000000000000000000000000000000000000000000000000000611718565b92915050565b6000610f9e6001611283565b90508015610fd357600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b6040805180820182528681524260208083019182526000888152606790915292909220905181559051600190910155606684905561100f61140e565b61101883610b4b565b6110218261120c565b801561108457600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b60007f00000000000000000000000000000000000000000000000000000000000000006066546110bb9190611718565b905090565b60335473ffffffffffffffffffffffffffffffffffffffff163314611141576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610579565b73ffffffffffffffffffffffffffffffffffffffff81166111e4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610579565b6111ed8161120c565b50565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008054610100900460ff161561133a578160ff1660011480156112a65750303b155b611332576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610579565b506000919050565b60005460ff8084169116106113d1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610579565b50600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff92909216919091179055600190565b919050565b600054610100900460ff166114a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610579565b610e33600054610100900460ff1661153f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610579565b610e333361120c565b60006040828403121561155a57600080fd5b6040516040810181811067ffffffffffffffff821117156115a4577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604052823581526020928301359281019290925250919050565b600080600080608085870312156115d457600080fd5b5050823594602084013594506040840135936060013592509050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461140957600080fd5b60006020828403121561162657600080fd5b61162f826115f0565b9392505050565b60006020828403121561164857600080fd5b5035919050565b6000806000806080858703121561166557600080fd5b843593506020850135925061167c604086016115f0565b915061168a606086016115f0565b905092959194509250565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000828210156116d6576116d6611695565b500390565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561171357611713611695565b500290565b6000821982111561172b5761172b611695565b50019056fea164736f6c634300080a000a496e697469616c697a61626c653a20636f6e747261637420697320616c726561496e697469616c697a61626c653a20636f6e7472616374206973206e6f742069", + ABI: "[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_submissionInterval\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_genesisL2Output\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_historicalTotalBlocks\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_startingBlockNumber\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_startingTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_l2BlockTime\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_proposer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"}],\"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\":\"l1Timestamp\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"l2BlockNumber\",\"type\":\"uint256\"}],\"name\":\"OutputDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"outputRoot\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"l1Timestamp\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"l2BlockNumber\",\"type\":\"uint256\"}],\"name\":\"OutputProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousProposer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newProposer\",\"type\":\"address\"}],\"name\":\"ProposerChanged\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"HISTORICAL_TOTAL_BLOCKS\",\"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\":\"STARTING_BLOCK_NUMBER\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"STARTING_TIMESTAMP\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SUBMISSION_INTERVAL\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newProposer\",\"type\":\"address\"}],\"name\":\"changeProposer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_l2BlockNumber\",\"type\":\"uint256\"}],\"name\":\"computeL2Timestamp\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"outputRoot\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"internalType\":\"structTypes.OutputProposal\",\"name\":\"_proposal\",\"type\":\"tuple\"}],\"name\":\"deleteL2Output\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_l2BlockNumber\",\"type\":\"uint256\"}],\"name\":\"getL2Output\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"outputRoot\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"internalType\":\"structTypes.OutputProposal\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_genesisL2Output\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_startingBlockNumber\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_proposer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestBlockNumber\",\"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\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"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\":\"proposer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x6101806040523480156200001257600080fd5b50604051620023d0380380620023d08339810160408190526200003591620005f4565b6000608081905260a052600160c052428310620000cd5760405162461bcd60e51b8152602060048201526044602482018190527f4c324f75747075744f7261636c653a20696e697469616c204c3220626c6f636b908201527f2074696d65206d757374206265206c657373207468616e2063757272656e742060648201526374696d6560e01b608482015260a4015b60405180910390fd5b60e0889052610100869052610120859052610140849052610160839052620000f88786848462000106565b505050505050505062000666565b6000620001146001620001cf565b905080156200012d576000805461ff0019166101001790555b604080518082018252868152426020808301918252600088815260679091529290922090518155905160019091015560668490556200016b620002e2565b62000176836200034a565b620001818262000514565b8015620001c8576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b60008054610100900460ff161562000264578160ff16600114801562000208575062000206306200056660201b620014181760201c565b155b6200025c5760405162461bcd60e51b815260206004820152602e60248201526000805160206200239083398151915260448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401620000c4565b506000919050565b60005460ff808416911610620002c35760405162461bcd60e51b815260206004820152602e60248201526000805160206200239083398151915260448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401620000c4565b506000805460ff191660ff92909216919091179055600190565b919050565b600054610100900460ff166200033e5760405162461bcd60e51b815260206004820152602b6024820152600080516020620023b083398151915260448201526a6e697469616c697a696e6760a81b6064820152608401620000c4565b6200034862000575565b565b6033546001600160a01b03163314620003a65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401620000c4565b6001600160a01b038116620004245760405162461bcd60e51b815260206004820152603760248201527f4c324f75747075744f7261636c653a206e65772070726f706f7365722063616e60448201527f6e6f7420626520746865207a65726f20616464726573730000000000000000006064820152608401620000c4565b6033546001600160a01b03166001600160a01b0316816001600160a01b031603620004b85760405162461bcd60e51b815260206004820152603860248201527f4c324f75747075744f7261636c653a2070726f706f7365722063616e6e6f742060448201527f6265207468652073616d6520617320746865206f776e657200000000000000006064820152608401620000c4565b6065546040516001600160a01b038084169216907f3d7728dc2838bb794606bd89f5a37930830b32060f69ee929bbfc59b669024dd90600090a3606580546001600160a01b0319166001600160a01b0392909216919091179055565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b03163b151590565b600054610100900460ff16620005d15760405162461bcd60e51b815260206004820152602b6024820152600080516020620023b083398151915260448201526a6e697469616c697a696e6760a81b6064820152608401620000c4565b620003483362000514565b80516001600160a01b0381168114620002dd57600080fd5b600080600080600080600080610100898b0312156200061257600080fd5b885197506020890151965060408901519550606089015194506080890151935060a089015192506200064760c08a01620005dc565b91506200065760e08a01620005dc565b90509295985092959890939650565b60805160a05160c05160e05161010051610120516101405161016051611c7e620007126000396000818161013f01526111370152600081816101a801526111900152600081816101f201528181610e2901528181610f2501528181611061015261115b0152600061034b0152600081816102260152818161068901528181610f0101528181610f6401526112b70152600061070e015260006106e5015260006106bc0152611c7e6000f3fe6080604052600436106101285760003560e01c80638da5cb5b116100a5578063a8e4fb9011610074578063d20b1a5111610059578063d20b1a51146103ba578063dcec3348146103da578063f2fde38b146103ef57600080fd5b8063a8e4fb901461036d578063d1de856c1461039a57600080fd5b80638da5cb5b1461029f5780639aaab648146102eb578063a25ae557146102fe578063a4771aad1461033957600080fd5b80634ab65d73116100fc57806354fd4d50116100e157806354fd4d5014610248578063715018a61461026a57806372d5fe211461027f57600080fd5b80634ab65d73146101e0578063529933df1461021457600080fd5b80622134cc1461012d578063093b3d901461017457806320e9fcd4146101965780634599c788146101ca575b600080fd5b34801561013957600080fd5b506101617f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561018057600080fd5b5061019461018f3660046118d4565b61040f565b005b3480156101a257600080fd5b506101617f000000000000000000000000000000000000000000000000000000000000000081565b3480156101d657600080fd5b5061016160665481565b3480156101ec57600080fd5b506101617f000000000000000000000000000000000000000000000000000000000000000081565b34801561022057600080fd5b506101617f000000000000000000000000000000000000000000000000000000000000000081565b34801561025457600080fd5b5061025d6106b5565b60405161016b919061197a565b34801561027657600080fd5b50610194610758565b34801561028b57600080fd5b5061019461029a3660046119ef565b6107e5565b3480156102ab57600080fd5b5060335473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161016b565b6101946102f9366004611a11565b610a6a565b34801561030a57600080fd5b5061031e610319366004611a43565b610e13565b6040805182518152602092830151928101929092520161016b565b34801561034557600080fd5b506101617f000000000000000000000000000000000000000000000000000000000000000081565b34801561037957600080fd5b506065546102c69073ffffffffffffffffffffffffffffffffffffffff1681565b3480156103a657600080fd5b506101616103b5366004611a43565b61105d565b3480156103c657600080fd5b506101946103d5366004611a5c565b6111ba565b3480156103e657600080fd5b506101616112b3565b3480156103fb57600080fd5b5061019461040a3660046119ef565b6112e8565b60335473ffffffffffffffffffffffffffffffffffffffff163314610495576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6066546000908152606760209081526040918290208251808401909352805480845260019091015491830191909152825114610579576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604f60248201527f4c324f75747075744f7261636c653a206f757470757420726f6f7420746f206460448201527f656c65746520646f6573206e6f74206d6174636820746865206c61746573742060648201527f6f75747075742070726f706f73616c0000000000000000000000000000000000608482015260a40161048c565b8060200151826020015114610636576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604d60248201527f4c324f75747075744f7261636c653a2074696d657374616d7020746f2064656c60448201527f65746520646f6573206e6f74206d6174636820746865206c6174657374206f7560648201527f747075742070726f706f73616c00000000000000000000000000000000000000608482015260a40161048c565b606654602082015182516040517f11e942315215fbc11bf574b22ca610d001e704d870a2307833c188d31600b5c690600090a460668054600090815260676020526040812081815560010155546106ae907f000000000000000000000000000000000000000000000000000000000000000090611ad1565b6066555050565b60606106e07f0000000000000000000000000000000000000000000000000000000000000000611434565b6107097f0000000000000000000000000000000000000000000000000000000000000000611434565b6107327f0000000000000000000000000000000000000000000000000000000000000000611434565b60405160200161074493929190611ae8565b604051602081830303815290604052905090565b60335473ffffffffffffffffffffffffffffffffffffffff1633146107d9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161048c565b6107e36000611569565b565b60335473ffffffffffffffffffffffffffffffffffffffff163314610866576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161048c565b73ffffffffffffffffffffffffffffffffffffffff8116610909576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f4c324f75747075744f7261636c653a206e65772070726f706f7365722063616e60448201527f6e6f7420626520746865207a65726f2061646472657373000000000000000000606482015260840161048c565b60335473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036109dc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603860248201527f4c324f75747075744f7261636c653a2070726f706f7365722063616e6e6f742060448201527f6265207468652073616d6520617320746865206f776e65720000000000000000606482015260840161048c565b60655460405173ffffffffffffffffffffffffffffffffffffffff8084169216907f3d7728dc2838bb794606bd89f5a37930830b32060f69ee929bbfc59b669024dd90600090a3606580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60655473ffffffffffffffffffffffffffffffffffffffff163314610b11576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f4c324f75747075744f7261636c653a2066756e6374696f6e2063616e206f6e6c60448201527f792062652063616c6c65642062792070726f706f736572000000000000000000606482015260840161048c565b610b196112b3565b8314610bcd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604860248201527f4c324f75747075744f7261636c653a20626c6f636b206e756d626572206d757360448201527f7420626520657175616c20746f206e65787420657870656374656420626c6f6360648201527f6b206e756d626572000000000000000000000000000000000000000000000000608482015260a40161048c565b42610bd78461105d565b10610c64576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f4c324f75747075744f7261636c653a2063616e6e6f742070726f706f7365204c60448201527f32206f757470757420696e207468652066757475726500000000000000000000606482015260840161048c565b83610cf1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f4c324f75747075744f7261636c653a204c32206f75747075742070726f706f7360448201527f616c2063616e6e6f7420626520746865207a65726f2068617368000000000000606482015260840161048c565b8115610dad5781814014610dad576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604860248201527f4c324f75747075744f7261636c653a20626c6f636b6861736820646f6573206e60448201527f6f74206d6174636820746865206861736820617420746865206578706563746560648201527f6420686569676874000000000000000000000000000000000000000000000000608482015260a40161048c565b6040805180820182528581524260208083018281526000888152606790925284822093518455516001909301929092556066869055915185929187917fc120f5e881491e6e212befa39e36b8f57d5eca31915f2e5d60a420f418caa6df9190a450505050565b60408051808201909152600080825260208201527f0000000000000000000000000000000000000000000000000000000000000000821015610efd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604b60248201527f4c324f75747075744f7261636c653a20626c6f636b206e756d6265722063616e60448201527f6e6f74206265206c657373207468616e20746865207374617274696e6720626c60648201527f6f636b206e756d6265722e000000000000000000000000000000000000000000608482015260a40161048c565b60007f0000000000000000000000000000000000000000000000000000000000000000610f4a7f000000000000000000000000000000000000000000000000000000000000000085611ad1565b610f549190611b8d565b905060008115610f9757610f88827f0000000000000000000000000000000000000000000000000000000000000000611ad1565b610f929085611ba1565b610f99565b835b600081815260676020908152604091829020825180840190935280548084526001909101549183019190915291925090611055576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f4c324f75747075744f7261636c653a204e6f206f757470757420666f756e642060448201527f666f72207468617420626c6f636b206e756d6265722e00000000000000000000606482015260840161048c565b949350505050565b60007f0000000000000000000000000000000000000000000000000000000000000000821015611135576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152605360248201527f4c324f75747075744f7261636c653a20626c6f636b206e756d626572206d757360448201527f742062652067726561746572207468616e206f7220657175616c20746f20737460648201527f617274696e6720626c6f636b206e756d62657200000000000000000000000000608482015260a40161048c565b7f00000000000000000000000000000000000000000000000000000000000000006111807f000000000000000000000000000000000000000000000000000000000000000084611ad1565b61118a9190611bb9565b6111b4907f0000000000000000000000000000000000000000000000000000000000000000611ba1565b92915050565b60006111c660016115e0565b905080156111fb57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b6040805180820182528681524260208083019182526000888152606790915292909220905181559051600190910155606684905561123761176b565b611240836107e5565b61124982611569565b80156112ac57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b60007f00000000000000000000000000000000000000000000000000000000000000006066546112e39190611ba1565b905090565b60335473ffffffffffffffffffffffffffffffffffffffff163314611369576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161048c565b73ffffffffffffffffffffffffffffffffffffffff811661140c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161048c565b61141581611569565b50565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b60608160000361147757505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b81156114a1578061148b81611bf6565b915061149a9050600a83611c2e565b915061147b565b60008167ffffffffffffffff8111156114bc576114bc6118a5565b6040519080825280601f01601f1916602001820160405280156114e6576020820181803683370190505b5090505b8415611055576114fb600183611ad1565b9150611508600a86611b8d565b611513906030611ba1565b60f81b81838151811061152857611528611c42565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350611562600a86611c2e565b94506114ea565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008054610100900460ff1615611697578160ff1660011480156116035750303b155b61168f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a6564000000000000000000000000000000000000606482015260840161048c565b506000919050565b60005460ff80841691161061172e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a6564000000000000000000000000000000000000606482015260840161048c565b50600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff92909216919091179055600190565b919050565b600054610100900460ff16611802576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e67000000000000000000000000000000000000000000606482015260840161048c565b6107e3600054610100900460ff1661189c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e67000000000000000000000000000000000000000000606482015260840161048c565b6107e333611569565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000604082840312156118e657600080fd5b6040516040810181811067ffffffffffffffff82111715611930577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604052823581526020928301359281019290925250919050565b60005b8381101561196557818101518382015260200161194d565b83811115611974576000848401525b50505050565b602081526000825180602084015261199981604085016020870161194a565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461176657600080fd5b600060208284031215611a0157600080fd5b611a0a826119cb565b9392505050565b60008060008060808587031215611a2757600080fd5b5050823594602084013594506040840135936060013592509050565b600060208284031215611a5557600080fd5b5035919050565b60008060008060808587031215611a7257600080fd5b8435935060208501359250611a89604086016119cb565b9150611a97606086016119cb565b905092959194509250565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082821015611ae357611ae3611aa2565b500390565b60008451611afa81846020890161194a565b80830190507f2e000000000000000000000000000000000000000000000000000000000000008082528551611b36816001850160208a0161194a565b60019201918201528351611b5181600284016020880161194a565b0160020195945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082611b9c57611b9c611b5e565b500690565b60008219821115611bb457611bb4611aa2565b500190565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615611bf157611bf1611aa2565b500290565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611c2757611c27611aa2565b5060010190565b600082611c3d57611c3d611b5e565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fdfea164736f6c634300080f000a496e697469616c697a61626c653a20636f6e747261637420697320616c726561496e697469616c697a61626c653a20636f6e7472616374206973206e6f742069", } // L2OutputOracleABI is the input ABI used to generate the binding from. @@ -49,7 +49,7 @@ var L2OutputOracleABI = L2OutputOracleMetaData.ABI var L2OutputOracleBin = L2OutputOracleMetaData.Bin // DeployL2OutputOracle deploys a new Ethereum contract, binding an instance of L2OutputOracle to it. -func DeployL2OutputOracle(auth *bind.TransactOpts, backend bind.ContractBackend, _submissionInterval *big.Int, _genesisL2Output [32]byte, _historicalTotalBlocks *big.Int, _startingBlockNumber *big.Int, _startingTimestamp *big.Int, _l2BlockTime *big.Int, _sequencer common.Address, _owner common.Address) (common.Address, *types.Transaction, *L2OutputOracle, error) { +func DeployL2OutputOracle(auth *bind.TransactOpts, backend bind.ContractBackend, _submissionInterval *big.Int, _genesisL2Output [32]byte, _historicalTotalBlocks *big.Int, _startingBlockNumber *big.Int, _startingTimestamp *big.Int, _l2BlockTime *big.Int, _proposer common.Address, _owner common.Address) (common.Address, *types.Transaction, *L2OutputOracle, error) { parsed, err := L2OutputOracleMetaData.GetAbi() if err != nil { return common.Address{}, nil, nil, err @@ -58,7 +58,7 @@ func DeployL2OutputOracle(auth *bind.TransactOpts, backend bind.ContractBackend, return common.Address{}, nil, nil, errors.New("GetABI returned nil") } - address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(L2OutputOracleBin), backend, _submissionInterval, _genesisL2Output, _historicalTotalBlocks, _startingBlockNumber, _startingTimestamp, _l2BlockTime, _sequencer, _owner) + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(L2OutputOracleBin), backend, _submissionInterval, _genesisL2Output, _historicalTotalBlocks, _startingBlockNumber, _startingTimestamp, _l2BlockTime, _proposer, _owner) if err != nil { return common.Address{}, nil, nil, err } @@ -269,99 +269,6 @@ func (_L2OutputOracle *L2OutputOracleCallerSession) L2BLOCKTIME() (*big.Int, err return _L2OutputOracle.Contract.L2BLOCKTIME(&_L2OutputOracle.CallOpts) } -// MAJORVERSION is a free data retrieval call binding the contract method 0xf786becd. -// -// Solidity: function MAJOR_VERSION() view returns(uint256) -func (_L2OutputOracle *L2OutputOracleCaller) MAJORVERSION(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _L2OutputOracle.contract.Call(opts, &out, "MAJOR_VERSION") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// MAJORVERSION is a free data retrieval call binding the contract method 0xf786becd. -// -// Solidity: function MAJOR_VERSION() view returns(uint256) -func (_L2OutputOracle *L2OutputOracleSession) MAJORVERSION() (*big.Int, error) { - return _L2OutputOracle.Contract.MAJORVERSION(&_L2OutputOracle.CallOpts) -} - -// MAJORVERSION is a free data retrieval call binding the contract method 0xf786becd. -// -// Solidity: function MAJOR_VERSION() view returns(uint256) -func (_L2OutputOracle *L2OutputOracleCallerSession) MAJORVERSION() (*big.Int, error) { - return _L2OutputOracle.Contract.MAJORVERSION(&_L2OutputOracle.CallOpts) -} - -// MINORVERSION is a free data retrieval call binding the contract method 0xc8b91531. -// -// Solidity: function MINOR_VERSION() view returns(uint256) -func (_L2OutputOracle *L2OutputOracleCaller) MINORVERSION(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _L2OutputOracle.contract.Call(opts, &out, "MINOR_VERSION") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// MINORVERSION is a free data retrieval call binding the contract method 0xc8b91531. -// -// Solidity: function MINOR_VERSION() view returns(uint256) -func (_L2OutputOracle *L2OutputOracleSession) MINORVERSION() (*big.Int, error) { - return _L2OutputOracle.Contract.MINORVERSION(&_L2OutputOracle.CallOpts) -} - -// MINORVERSION is a free data retrieval call binding the contract method 0xc8b91531. -// -// Solidity: function MINOR_VERSION() view returns(uint256) -func (_L2OutputOracle *L2OutputOracleCallerSession) MINORVERSION() (*big.Int, error) { - return _L2OutputOracle.Contract.MINORVERSION(&_L2OutputOracle.CallOpts) -} - -// PATCHVERSION is a free data retrieval call binding the contract method 0x6bf2606a. -// -// Solidity: function PATCH_VERSION() view returns(uint256) -func (_L2OutputOracle *L2OutputOracleCaller) PATCHVERSION(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _L2OutputOracle.contract.Call(opts, &out, "PATCH_VERSION") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// PATCHVERSION is a free data retrieval call binding the contract method 0x6bf2606a. -// -// Solidity: function PATCH_VERSION() view returns(uint256) -func (_L2OutputOracle *L2OutputOracleSession) PATCHVERSION() (*big.Int, error) { - return _L2OutputOracle.Contract.PATCHVERSION(&_L2OutputOracle.CallOpts) -} - -// PATCHVERSION is a free data retrieval call binding the contract method 0x6bf2606a. -// -// Solidity: function PATCH_VERSION() view returns(uint256) -func (_L2OutputOracle *L2OutputOracleCallerSession) PATCHVERSION() (*big.Int, error) { - return _L2OutputOracle.Contract.PATCHVERSION(&_L2OutputOracle.CallOpts) -} - // STARTINGBLOCKNUMBER is a free data retrieval call binding the contract method 0x4ab65d73. // // Solidity: function STARTING_BLOCK_NUMBER() view returns(uint256) @@ -489,15 +396,15 @@ func (_L2OutputOracle *L2OutputOracleCallerSession) ComputeL2Timestamp(_l2BlockN // GetL2Output is a free data retrieval call binding the contract method 0xa25ae557. // // Solidity: function getL2Output(uint256 _l2BlockNumber) view returns((bytes32,uint256)) -func (_L2OutputOracle *L2OutputOracleCaller) GetL2Output(opts *bind.CallOpts, _l2BlockNumber *big.Int) (L2OutputOracleOutputProposal, error) { +func (_L2OutputOracle *L2OutputOracleCaller) GetL2Output(opts *bind.CallOpts, _l2BlockNumber *big.Int) (TypesOutputProposal, error) { var out []interface{} err := _L2OutputOracle.contract.Call(opts, &out, "getL2Output", _l2BlockNumber) if err != nil { - return *new(L2OutputOracleOutputProposal), err + return *new(TypesOutputProposal), err } - out0 := *abi.ConvertType(out[0], new(L2OutputOracleOutputProposal)).(*L2OutputOracleOutputProposal) + out0 := *abi.ConvertType(out[0], new(TypesOutputProposal)).(*TypesOutputProposal) return out0, err @@ -506,14 +413,14 @@ func (_L2OutputOracle *L2OutputOracleCaller) GetL2Output(opts *bind.CallOpts, _l // GetL2Output is a free data retrieval call binding the contract method 0xa25ae557. // // Solidity: function getL2Output(uint256 _l2BlockNumber) view returns((bytes32,uint256)) -func (_L2OutputOracle *L2OutputOracleSession) GetL2Output(_l2BlockNumber *big.Int) (L2OutputOracleOutputProposal, error) { +func (_L2OutputOracle *L2OutputOracleSession) GetL2Output(_l2BlockNumber *big.Int) (TypesOutputProposal, error) { return _L2OutputOracle.Contract.GetL2Output(&_L2OutputOracle.CallOpts, _l2BlockNumber) } // GetL2Output is a free data retrieval call binding the contract method 0xa25ae557. // // Solidity: function getL2Output(uint256 _l2BlockNumber) view returns((bytes32,uint256)) -func (_L2OutputOracle *L2OutputOracleCallerSession) GetL2Output(_l2BlockNumber *big.Int) (L2OutputOracleOutputProposal, error) { +func (_L2OutputOracle *L2OutputOracleCallerSession) GetL2Output(_l2BlockNumber *big.Int) (TypesOutputProposal, error) { return _L2OutputOracle.Contract.GetL2Output(&_L2OutputOracle.CallOpts, _l2BlockNumber) } @@ -610,12 +517,12 @@ func (_L2OutputOracle *L2OutputOracleCallerSession) Owner() (common.Address, err return _L2OutputOracle.Contract.Owner(&_L2OutputOracle.CallOpts) } -// Sequencer is a free data retrieval call binding the contract method 0x5c1bba38. +// Proposer is a free data retrieval call binding the contract method 0xa8e4fb90. // -// Solidity: function sequencer() view returns(address) -func (_L2OutputOracle *L2OutputOracleCaller) Sequencer(opts *bind.CallOpts) (common.Address, error) { +// Solidity: function proposer() view returns(address) +func (_L2OutputOracle *L2OutputOracleCaller) Proposer(opts *bind.CallOpts) (common.Address, error) { var out []interface{} - err := _L2OutputOracle.contract.Call(opts, &out, "sequencer") + err := _L2OutputOracle.contract.Call(opts, &out, "proposer") if err != nil { return *new(common.Address), err @@ -627,102 +534,133 @@ func (_L2OutputOracle *L2OutputOracleCaller) Sequencer(opts *bind.CallOpts) (com } -// Sequencer is a free data retrieval call binding the contract method 0x5c1bba38. +// Proposer is a free data retrieval call binding the contract method 0xa8e4fb90. // -// Solidity: function sequencer() view returns(address) -func (_L2OutputOracle *L2OutputOracleSession) Sequencer() (common.Address, error) { - return _L2OutputOracle.Contract.Sequencer(&_L2OutputOracle.CallOpts) +// Solidity: function proposer() view returns(address) +func (_L2OutputOracle *L2OutputOracleSession) Proposer() (common.Address, error) { + return _L2OutputOracle.Contract.Proposer(&_L2OutputOracle.CallOpts) } -// Sequencer is a free data retrieval call binding the contract method 0x5c1bba38. +// Proposer is a free data retrieval call binding the contract method 0xa8e4fb90. // -// Solidity: function sequencer() view returns(address) -func (_L2OutputOracle *L2OutputOracleCallerSession) Sequencer() (common.Address, error) { - return _L2OutputOracle.Contract.Sequencer(&_L2OutputOracle.CallOpts) +// Solidity: function proposer() view returns(address) +func (_L2OutputOracle *L2OutputOracleCallerSession) Proposer() (common.Address, error) { + return _L2OutputOracle.Contract.Proposer(&_L2OutputOracle.CallOpts) } -// AppendL2Output is a paid mutator transaction binding the contract method 0x25188104. +// Version is a free data retrieval call binding the contract method 0x54fd4d50. // -// Solidity: function appendL2Output(bytes32 _l2Output, uint256 _l2BlockNumber, bytes32 _l1Blockhash, uint256 _l1BlockNumber) payable returns() -func (_L2OutputOracle *L2OutputOracleTransactor) AppendL2Output(opts *bind.TransactOpts, _l2Output [32]byte, _l2BlockNumber *big.Int, _l1Blockhash [32]byte, _l1BlockNumber *big.Int) (*types.Transaction, error) { - return _L2OutputOracle.contract.Transact(opts, "appendL2Output", _l2Output, _l2BlockNumber, _l1Blockhash, _l1BlockNumber) +// Solidity: function version() view returns(string) +func (_L2OutputOracle *L2OutputOracleCaller) Version(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _L2OutputOracle.contract.Call(opts, &out, "version") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + } -// AppendL2Output is a paid mutator transaction binding the contract method 0x25188104. +// Version is a free data retrieval call binding the contract method 0x54fd4d50. // -// Solidity: function appendL2Output(bytes32 _l2Output, uint256 _l2BlockNumber, bytes32 _l1Blockhash, uint256 _l1BlockNumber) payable returns() -func (_L2OutputOracle *L2OutputOracleSession) AppendL2Output(_l2Output [32]byte, _l2BlockNumber *big.Int, _l1Blockhash [32]byte, _l1BlockNumber *big.Int) (*types.Transaction, error) { - return _L2OutputOracle.Contract.AppendL2Output(&_L2OutputOracle.TransactOpts, _l2Output, _l2BlockNumber, _l1Blockhash, _l1BlockNumber) +// Solidity: function version() view returns(string) +func (_L2OutputOracle *L2OutputOracleSession) Version() (string, error) { + return _L2OutputOracle.Contract.Version(&_L2OutputOracle.CallOpts) } -// AppendL2Output is a paid mutator transaction binding the contract method 0x25188104. +// Version is a free data retrieval call binding the contract method 0x54fd4d50. // -// Solidity: function appendL2Output(bytes32 _l2Output, uint256 _l2BlockNumber, bytes32 _l1Blockhash, uint256 _l1BlockNumber) payable returns() -func (_L2OutputOracle *L2OutputOracleTransactorSession) AppendL2Output(_l2Output [32]byte, _l2BlockNumber *big.Int, _l1Blockhash [32]byte, _l1BlockNumber *big.Int) (*types.Transaction, error) { - return _L2OutputOracle.Contract.AppendL2Output(&_L2OutputOracle.TransactOpts, _l2Output, _l2BlockNumber, _l1Blockhash, _l1BlockNumber) +// Solidity: function version() view returns(string) +func (_L2OutputOracle *L2OutputOracleCallerSession) Version() (string, error) { + return _L2OutputOracle.Contract.Version(&_L2OutputOracle.CallOpts) } -// ChangeSequencer is a paid mutator transaction binding the contract method 0x2af8ded8. +// ChangeProposer is a paid mutator transaction binding the contract method 0x72d5fe21. // -// Solidity: function changeSequencer(address _newSequencer) returns() -func (_L2OutputOracle *L2OutputOracleTransactor) ChangeSequencer(opts *bind.TransactOpts, _newSequencer common.Address) (*types.Transaction, error) { - return _L2OutputOracle.contract.Transact(opts, "changeSequencer", _newSequencer) +// Solidity: function changeProposer(address _newProposer) returns() +func (_L2OutputOracle *L2OutputOracleTransactor) ChangeProposer(opts *bind.TransactOpts, _newProposer common.Address) (*types.Transaction, error) { + return _L2OutputOracle.contract.Transact(opts, "changeProposer", _newProposer) } -// ChangeSequencer is a paid mutator transaction binding the contract method 0x2af8ded8. +// ChangeProposer is a paid mutator transaction binding the contract method 0x72d5fe21. // -// Solidity: function changeSequencer(address _newSequencer) returns() -func (_L2OutputOracle *L2OutputOracleSession) ChangeSequencer(_newSequencer common.Address) (*types.Transaction, error) { - return _L2OutputOracle.Contract.ChangeSequencer(&_L2OutputOracle.TransactOpts, _newSequencer) +// Solidity: function changeProposer(address _newProposer) returns() +func (_L2OutputOracle *L2OutputOracleSession) ChangeProposer(_newProposer common.Address) (*types.Transaction, error) { + return _L2OutputOracle.Contract.ChangeProposer(&_L2OutputOracle.TransactOpts, _newProposer) } -// ChangeSequencer is a paid mutator transaction binding the contract method 0x2af8ded8. +// ChangeProposer is a paid mutator transaction binding the contract method 0x72d5fe21. // -// Solidity: function changeSequencer(address _newSequencer) returns() -func (_L2OutputOracle *L2OutputOracleTransactorSession) ChangeSequencer(_newSequencer common.Address) (*types.Transaction, error) { - return _L2OutputOracle.Contract.ChangeSequencer(&_L2OutputOracle.TransactOpts, _newSequencer) +// Solidity: function changeProposer(address _newProposer) returns() +func (_L2OutputOracle *L2OutputOracleTransactorSession) ChangeProposer(_newProposer common.Address) (*types.Transaction, error) { + return _L2OutputOracle.Contract.ChangeProposer(&_L2OutputOracle.TransactOpts, _newProposer) } // DeleteL2Output is a paid mutator transaction binding the contract method 0x093b3d90. // // Solidity: function deleteL2Output((bytes32,uint256) _proposal) returns() -func (_L2OutputOracle *L2OutputOracleTransactor) DeleteL2Output(opts *bind.TransactOpts, _proposal L2OutputOracleOutputProposal) (*types.Transaction, error) { +func (_L2OutputOracle *L2OutputOracleTransactor) DeleteL2Output(opts *bind.TransactOpts, _proposal TypesOutputProposal) (*types.Transaction, error) { return _L2OutputOracle.contract.Transact(opts, "deleteL2Output", _proposal) } // DeleteL2Output is a paid mutator transaction binding the contract method 0x093b3d90. // // Solidity: function deleteL2Output((bytes32,uint256) _proposal) returns() -func (_L2OutputOracle *L2OutputOracleSession) DeleteL2Output(_proposal L2OutputOracleOutputProposal) (*types.Transaction, error) { +func (_L2OutputOracle *L2OutputOracleSession) DeleteL2Output(_proposal TypesOutputProposal) (*types.Transaction, error) { return _L2OutputOracle.Contract.DeleteL2Output(&_L2OutputOracle.TransactOpts, _proposal) } // DeleteL2Output is a paid mutator transaction binding the contract method 0x093b3d90. // // Solidity: function deleteL2Output((bytes32,uint256) _proposal) returns() -func (_L2OutputOracle *L2OutputOracleTransactorSession) DeleteL2Output(_proposal L2OutputOracleOutputProposal) (*types.Transaction, error) { +func (_L2OutputOracle *L2OutputOracleTransactorSession) DeleteL2Output(_proposal TypesOutputProposal) (*types.Transaction, error) { return _L2OutputOracle.Contract.DeleteL2Output(&_L2OutputOracle.TransactOpts, _proposal) } // Initialize is a paid mutator transaction binding the contract method 0xd20b1a51. // -// Solidity: function initialize(bytes32 _genesisL2Output, uint256 _startingBlockNumber, address _sequencer, address _owner) returns() -func (_L2OutputOracle *L2OutputOracleTransactor) Initialize(opts *bind.TransactOpts, _genesisL2Output [32]byte, _startingBlockNumber *big.Int, _sequencer common.Address, _owner common.Address) (*types.Transaction, error) { - return _L2OutputOracle.contract.Transact(opts, "initialize", _genesisL2Output, _startingBlockNumber, _sequencer, _owner) +// Solidity: function initialize(bytes32 _genesisL2Output, uint256 _startingBlockNumber, address _proposer, address _owner) returns() +func (_L2OutputOracle *L2OutputOracleTransactor) Initialize(opts *bind.TransactOpts, _genesisL2Output [32]byte, _startingBlockNumber *big.Int, _proposer common.Address, _owner common.Address) (*types.Transaction, error) { + return _L2OutputOracle.contract.Transact(opts, "initialize", _genesisL2Output, _startingBlockNumber, _proposer, _owner) } // Initialize is a paid mutator transaction binding the contract method 0xd20b1a51. // -// Solidity: function initialize(bytes32 _genesisL2Output, uint256 _startingBlockNumber, address _sequencer, address _owner) returns() -func (_L2OutputOracle *L2OutputOracleSession) Initialize(_genesisL2Output [32]byte, _startingBlockNumber *big.Int, _sequencer common.Address, _owner common.Address) (*types.Transaction, error) { - return _L2OutputOracle.Contract.Initialize(&_L2OutputOracle.TransactOpts, _genesisL2Output, _startingBlockNumber, _sequencer, _owner) +// Solidity: function initialize(bytes32 _genesisL2Output, uint256 _startingBlockNumber, address _proposer, address _owner) returns() +func (_L2OutputOracle *L2OutputOracleSession) Initialize(_genesisL2Output [32]byte, _startingBlockNumber *big.Int, _proposer common.Address, _owner common.Address) (*types.Transaction, error) { + return _L2OutputOracle.Contract.Initialize(&_L2OutputOracle.TransactOpts, _genesisL2Output, _startingBlockNumber, _proposer, _owner) } // Initialize is a paid mutator transaction binding the contract method 0xd20b1a51. // -// Solidity: function initialize(bytes32 _genesisL2Output, uint256 _startingBlockNumber, address _sequencer, address _owner) returns() -func (_L2OutputOracle *L2OutputOracleTransactorSession) Initialize(_genesisL2Output [32]byte, _startingBlockNumber *big.Int, _sequencer common.Address, _owner common.Address) (*types.Transaction, error) { - return _L2OutputOracle.Contract.Initialize(&_L2OutputOracle.TransactOpts, _genesisL2Output, _startingBlockNumber, _sequencer, _owner) +// Solidity: function initialize(bytes32 _genesisL2Output, uint256 _startingBlockNumber, address _proposer, address _owner) returns() +func (_L2OutputOracle *L2OutputOracleTransactorSession) Initialize(_genesisL2Output [32]byte, _startingBlockNumber *big.Int, _proposer common.Address, _owner common.Address) (*types.Transaction, error) { + return _L2OutputOracle.Contract.Initialize(&_L2OutputOracle.TransactOpts, _genesisL2Output, _startingBlockNumber, _proposer, _owner) +} + +// ProposeL2Output is a paid mutator transaction binding the contract method 0x9aaab648. +// +// Solidity: function proposeL2Output(bytes32 _outputRoot, uint256 _l2BlockNumber, bytes32 _l1Blockhash, uint256 _l1BlockNumber) payable returns() +func (_L2OutputOracle *L2OutputOracleTransactor) ProposeL2Output(opts *bind.TransactOpts, _outputRoot [32]byte, _l2BlockNumber *big.Int, _l1Blockhash [32]byte, _l1BlockNumber *big.Int) (*types.Transaction, error) { + return _L2OutputOracle.contract.Transact(opts, "proposeL2Output", _outputRoot, _l2BlockNumber, _l1Blockhash, _l1BlockNumber) +} + +// ProposeL2Output is a paid mutator transaction binding the contract method 0x9aaab648. +// +// Solidity: function proposeL2Output(bytes32 _outputRoot, uint256 _l2BlockNumber, bytes32 _l1Blockhash, uint256 _l1BlockNumber) payable returns() +func (_L2OutputOracle *L2OutputOracleSession) ProposeL2Output(_outputRoot [32]byte, _l2BlockNumber *big.Int, _l1Blockhash [32]byte, _l1BlockNumber *big.Int) (*types.Transaction, error) { + return _L2OutputOracle.Contract.ProposeL2Output(&_L2OutputOracle.TransactOpts, _outputRoot, _l2BlockNumber, _l1Blockhash, _l1BlockNumber) +} + +// ProposeL2Output is a paid mutator transaction binding the contract method 0x9aaab648. +// +// Solidity: function proposeL2Output(bytes32 _outputRoot, uint256 _l2BlockNumber, bytes32 _l1Blockhash, uint256 _l1BlockNumber) payable returns() +func (_L2OutputOracle *L2OutputOracleTransactorSession) ProposeL2Output(_outputRoot [32]byte, _l2BlockNumber *big.Int, _l1Blockhash [32]byte, _l1BlockNumber *big.Int) (*types.Transaction, error) { + return _L2OutputOracle.Contract.ProposeL2Output(&_L2OutputOracle.TransactOpts, _outputRoot, _l2BlockNumber, _l1Blockhash, _l1BlockNumber) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. @@ -901,9 +839,9 @@ func (_L2OutputOracle *L2OutputOracleFilterer) ParseInitialized(log types.Log) ( return event, nil } -// L2OutputOracleL2OutputAppendedIterator is returned from FilterL2OutputAppended and is used to iterate over the raw logs and unpacked data for L2OutputAppended events raised by the L2OutputOracle contract. -type L2OutputOracleL2OutputAppendedIterator struct { - Event *L2OutputOracleL2OutputAppended // Event containing the contract specifics and raw log +// L2OutputOracleOutputDeletedIterator is returned from FilterOutputDeleted and is used to iterate over the raw logs and unpacked data for OutputDeleted events raised by the L2OutputOracle contract. +type L2OutputOracleOutputDeletedIterator struct { + Event *L2OutputOracleOutputDeleted // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data @@ -917,7 +855,7 @@ type L2OutputOracleL2OutputAppendedIterator struct { // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. -func (it *L2OutputOracleL2OutputAppendedIterator) Next() bool { +func (it *L2OutputOracleOutputDeletedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -926,7 +864,7 @@ func (it *L2OutputOracleL2OutputAppendedIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(L2OutputOracleL2OutputAppended) + it.Event = new(L2OutputOracleOutputDeleted) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -941,7 +879,7 @@ func (it *L2OutputOracleL2OutputAppendedIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(L2OutputOracleL2OutputAppended) + it.Event = new(L2OutputOracleOutputDeleted) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -957,33 +895,33 @@ func (it *L2OutputOracleL2OutputAppendedIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *L2OutputOracleL2OutputAppendedIterator) Error() error { +func (it *L2OutputOracleOutputDeletedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *L2OutputOracleL2OutputAppendedIterator) Close() error { +func (it *L2OutputOracleOutputDeletedIterator) Close() error { it.sub.Unsubscribe() return nil } -// L2OutputOracleL2OutputAppended represents a L2OutputAppended event raised by the L2OutputOracle contract. -type L2OutputOracleL2OutputAppended struct { - L2Output [32]byte +// L2OutputOracleOutputDeleted represents a OutputDeleted event raised by the L2OutputOracle contract. +type L2OutputOracleOutputDeleted struct { + OutputRoot [32]byte L1Timestamp *big.Int L2BlockNumber *big.Int Raw types.Log // Blockchain specific contextual infos } -// FilterL2OutputAppended is a free log retrieval operation binding the contract event 0xd6703ded1701060d9ae1793db76d594790a4e775781225f79b5aa8a77987c080. +// FilterOutputDeleted is a free log retrieval operation binding the contract event 0x11e942315215fbc11bf574b22ca610d001e704d870a2307833c188d31600b5c6. // -// Solidity: event L2OutputAppended(bytes32 indexed l2Output, uint256 indexed l1Timestamp, uint256 indexed l2BlockNumber) -func (_L2OutputOracle *L2OutputOracleFilterer) FilterL2OutputAppended(opts *bind.FilterOpts, l2Output [][32]byte, l1Timestamp []*big.Int, l2BlockNumber []*big.Int) (*L2OutputOracleL2OutputAppendedIterator, error) { +// Solidity: event OutputDeleted(bytes32 indexed outputRoot, uint256 indexed l1Timestamp, uint256 indexed l2BlockNumber) +func (_L2OutputOracle *L2OutputOracleFilterer) FilterOutputDeleted(opts *bind.FilterOpts, outputRoot [][32]byte, l1Timestamp []*big.Int, l2BlockNumber []*big.Int) (*L2OutputOracleOutputDeletedIterator, error) { - var l2OutputRule []interface{} - for _, l2OutputItem := range l2Output { - l2OutputRule = append(l2OutputRule, l2OutputItem) + var outputRootRule []interface{} + for _, outputRootItem := range outputRoot { + outputRootRule = append(outputRootRule, outputRootItem) } var l1TimestampRule []interface{} for _, l1TimestampItem := range l1Timestamp { @@ -994,21 +932,21 @@ func (_L2OutputOracle *L2OutputOracleFilterer) FilterL2OutputAppended(opts *bind l2BlockNumberRule = append(l2BlockNumberRule, l2BlockNumberItem) } - logs, sub, err := _L2OutputOracle.contract.FilterLogs(opts, "L2OutputAppended", l2OutputRule, l1TimestampRule, l2BlockNumberRule) + logs, sub, err := _L2OutputOracle.contract.FilterLogs(opts, "OutputDeleted", outputRootRule, l1TimestampRule, l2BlockNumberRule) if err != nil { return nil, err } - return &L2OutputOracleL2OutputAppendedIterator{contract: _L2OutputOracle.contract, event: "L2OutputAppended", logs: logs, sub: sub}, nil + return &L2OutputOracleOutputDeletedIterator{contract: _L2OutputOracle.contract, event: "OutputDeleted", logs: logs, sub: sub}, nil } -// WatchL2OutputAppended is a free log subscription operation binding the contract event 0xd6703ded1701060d9ae1793db76d594790a4e775781225f79b5aa8a77987c080. +// WatchOutputDeleted is a free log subscription operation binding the contract event 0x11e942315215fbc11bf574b22ca610d001e704d870a2307833c188d31600b5c6. // -// Solidity: event L2OutputAppended(bytes32 indexed l2Output, uint256 indexed l1Timestamp, uint256 indexed l2BlockNumber) -func (_L2OutputOracle *L2OutputOracleFilterer) WatchL2OutputAppended(opts *bind.WatchOpts, sink chan<- *L2OutputOracleL2OutputAppended, l2Output [][32]byte, l1Timestamp []*big.Int, l2BlockNumber []*big.Int) (event.Subscription, error) { +// Solidity: event OutputDeleted(bytes32 indexed outputRoot, uint256 indexed l1Timestamp, uint256 indexed l2BlockNumber) +func (_L2OutputOracle *L2OutputOracleFilterer) WatchOutputDeleted(opts *bind.WatchOpts, sink chan<- *L2OutputOracleOutputDeleted, outputRoot [][32]byte, l1Timestamp []*big.Int, l2BlockNumber []*big.Int) (event.Subscription, error) { - var l2OutputRule []interface{} - for _, l2OutputItem := range l2Output { - l2OutputRule = append(l2OutputRule, l2OutputItem) + var outputRootRule []interface{} + for _, outputRootItem := range outputRoot { + outputRootRule = append(outputRootRule, outputRootItem) } var l1TimestampRule []interface{} for _, l1TimestampItem := range l1Timestamp { @@ -1019,7 +957,7 @@ func (_L2OutputOracle *L2OutputOracleFilterer) WatchL2OutputAppended(opts *bind. l2BlockNumberRule = append(l2BlockNumberRule, l2BlockNumberItem) } - logs, sub, err := _L2OutputOracle.contract.WatchLogs(opts, "L2OutputAppended", l2OutputRule, l1TimestampRule, l2BlockNumberRule) + logs, sub, err := _L2OutputOracle.contract.WatchLogs(opts, "OutputDeleted", outputRootRule, l1TimestampRule, l2BlockNumberRule) if err != nil { return nil, err } @@ -1029,8 +967,8 @@ func (_L2OutputOracle *L2OutputOracleFilterer) WatchL2OutputAppended(opts *bind. select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(L2OutputOracleL2OutputAppended) - if err := _L2OutputOracle.contract.UnpackLog(event, "L2OutputAppended", log); err != nil { + event := new(L2OutputOracleOutputDeleted) + if err := _L2OutputOracle.contract.UnpackLog(event, "OutputDeleted", log); err != nil { return err } event.Raw = log @@ -1051,21 +989,21 @@ func (_L2OutputOracle *L2OutputOracleFilterer) WatchL2OutputAppended(opts *bind. }), nil } -// ParseL2OutputAppended is a log parse operation binding the contract event 0xd6703ded1701060d9ae1793db76d594790a4e775781225f79b5aa8a77987c080. +// ParseOutputDeleted is a log parse operation binding the contract event 0x11e942315215fbc11bf574b22ca610d001e704d870a2307833c188d31600b5c6. // -// Solidity: event L2OutputAppended(bytes32 indexed l2Output, uint256 indexed l1Timestamp, uint256 indexed l2BlockNumber) -func (_L2OutputOracle *L2OutputOracleFilterer) ParseL2OutputAppended(log types.Log) (*L2OutputOracleL2OutputAppended, error) { - event := new(L2OutputOracleL2OutputAppended) - if err := _L2OutputOracle.contract.UnpackLog(event, "L2OutputAppended", log); err != nil { +// Solidity: event OutputDeleted(bytes32 indexed outputRoot, uint256 indexed l1Timestamp, uint256 indexed l2BlockNumber) +func (_L2OutputOracle *L2OutputOracleFilterer) ParseOutputDeleted(log types.Log) (*L2OutputOracleOutputDeleted, error) { + event := new(L2OutputOracleOutputDeleted) + if err := _L2OutputOracle.contract.UnpackLog(event, "OutputDeleted", log); err != nil { return nil, err } event.Raw = log return event, nil } -// L2OutputOracleL2OutputDeletedIterator is returned from FilterL2OutputDeleted and is used to iterate over the raw logs and unpacked data for L2OutputDeleted events raised by the L2OutputOracle contract. -type L2OutputOracleL2OutputDeletedIterator struct { - Event *L2OutputOracleL2OutputDeleted // Event containing the contract specifics and raw log +// L2OutputOracleOutputProposedIterator is returned from FilterOutputProposed and is used to iterate over the raw logs and unpacked data for OutputProposed events raised by the L2OutputOracle contract. +type L2OutputOracleOutputProposedIterator struct { + Event *L2OutputOracleOutputProposed // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data @@ -1079,7 +1017,7 @@ type L2OutputOracleL2OutputDeletedIterator struct { // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. -func (it *L2OutputOracleL2OutputDeletedIterator) Next() bool { +func (it *L2OutputOracleOutputProposedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -1088,7 +1026,7 @@ func (it *L2OutputOracleL2OutputDeletedIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(L2OutputOracleL2OutputDeleted) + it.Event = new(L2OutputOracleOutputProposed) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1103,7 +1041,7 @@ func (it *L2OutputOracleL2OutputDeletedIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(L2OutputOracleL2OutputDeleted) + it.Event = new(L2OutputOracleOutputProposed) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1119,33 +1057,33 @@ func (it *L2OutputOracleL2OutputDeletedIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *L2OutputOracleL2OutputDeletedIterator) Error() error { +func (it *L2OutputOracleOutputProposedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *L2OutputOracleL2OutputDeletedIterator) Close() error { +func (it *L2OutputOracleOutputProposedIterator) Close() error { it.sub.Unsubscribe() return nil } -// L2OutputOracleL2OutputDeleted represents a L2OutputDeleted event raised by the L2OutputOracle contract. -type L2OutputOracleL2OutputDeleted struct { - L2Output [32]byte +// L2OutputOracleOutputProposed represents a OutputProposed event raised by the L2OutputOracle contract. +type L2OutputOracleOutputProposed struct { + OutputRoot [32]byte L1Timestamp *big.Int L2BlockNumber *big.Int Raw types.Log // Blockchain specific contextual infos } -// FilterL2OutputDeleted is a free log retrieval operation binding the contract event 0x7320566fd5256cf8923648a5d9f560f1e92f1435a1bb32ddd1fe107f224ad359. +// FilterOutputProposed is a free log retrieval operation binding the contract event 0xc120f5e881491e6e212befa39e36b8f57d5eca31915f2e5d60a420f418caa6df. // -// Solidity: event L2OutputDeleted(bytes32 indexed l2Output, uint256 indexed l1Timestamp, uint256 indexed l2BlockNumber) -func (_L2OutputOracle *L2OutputOracleFilterer) FilterL2OutputDeleted(opts *bind.FilterOpts, l2Output [][32]byte, l1Timestamp []*big.Int, l2BlockNumber []*big.Int) (*L2OutputOracleL2OutputDeletedIterator, error) { +// Solidity: event OutputProposed(bytes32 indexed outputRoot, uint256 indexed l1Timestamp, uint256 indexed l2BlockNumber) +func (_L2OutputOracle *L2OutputOracleFilterer) FilterOutputProposed(opts *bind.FilterOpts, outputRoot [][32]byte, l1Timestamp []*big.Int, l2BlockNumber []*big.Int) (*L2OutputOracleOutputProposedIterator, error) { - var l2OutputRule []interface{} - for _, l2OutputItem := range l2Output { - l2OutputRule = append(l2OutputRule, l2OutputItem) + var outputRootRule []interface{} + for _, outputRootItem := range outputRoot { + outputRootRule = append(outputRootRule, outputRootItem) } var l1TimestampRule []interface{} for _, l1TimestampItem := range l1Timestamp { @@ -1156,21 +1094,21 @@ func (_L2OutputOracle *L2OutputOracleFilterer) FilterL2OutputDeleted(opts *bind. l2BlockNumberRule = append(l2BlockNumberRule, l2BlockNumberItem) } - logs, sub, err := _L2OutputOracle.contract.FilterLogs(opts, "L2OutputDeleted", l2OutputRule, l1TimestampRule, l2BlockNumberRule) + logs, sub, err := _L2OutputOracle.contract.FilterLogs(opts, "OutputProposed", outputRootRule, l1TimestampRule, l2BlockNumberRule) if err != nil { return nil, err } - return &L2OutputOracleL2OutputDeletedIterator{contract: _L2OutputOracle.contract, event: "L2OutputDeleted", logs: logs, sub: sub}, nil + return &L2OutputOracleOutputProposedIterator{contract: _L2OutputOracle.contract, event: "OutputProposed", logs: logs, sub: sub}, nil } -// WatchL2OutputDeleted is a free log subscription operation binding the contract event 0x7320566fd5256cf8923648a5d9f560f1e92f1435a1bb32ddd1fe107f224ad359. +// WatchOutputProposed is a free log subscription operation binding the contract event 0xc120f5e881491e6e212befa39e36b8f57d5eca31915f2e5d60a420f418caa6df. // -// Solidity: event L2OutputDeleted(bytes32 indexed l2Output, uint256 indexed l1Timestamp, uint256 indexed l2BlockNumber) -func (_L2OutputOracle *L2OutputOracleFilterer) WatchL2OutputDeleted(opts *bind.WatchOpts, sink chan<- *L2OutputOracleL2OutputDeleted, l2Output [][32]byte, l1Timestamp []*big.Int, l2BlockNumber []*big.Int) (event.Subscription, error) { +// Solidity: event OutputProposed(bytes32 indexed outputRoot, uint256 indexed l1Timestamp, uint256 indexed l2BlockNumber) +func (_L2OutputOracle *L2OutputOracleFilterer) WatchOutputProposed(opts *bind.WatchOpts, sink chan<- *L2OutputOracleOutputProposed, outputRoot [][32]byte, l1Timestamp []*big.Int, l2BlockNumber []*big.Int) (event.Subscription, error) { - var l2OutputRule []interface{} - for _, l2OutputItem := range l2Output { - l2OutputRule = append(l2OutputRule, l2OutputItem) + var outputRootRule []interface{} + for _, outputRootItem := range outputRoot { + outputRootRule = append(outputRootRule, outputRootItem) } var l1TimestampRule []interface{} for _, l1TimestampItem := range l1Timestamp { @@ -1181,7 +1119,7 @@ func (_L2OutputOracle *L2OutputOracleFilterer) WatchL2OutputDeleted(opts *bind.W l2BlockNumberRule = append(l2BlockNumberRule, l2BlockNumberItem) } - logs, sub, err := _L2OutputOracle.contract.WatchLogs(opts, "L2OutputDeleted", l2OutputRule, l1TimestampRule, l2BlockNumberRule) + logs, sub, err := _L2OutputOracle.contract.WatchLogs(opts, "OutputProposed", outputRootRule, l1TimestampRule, l2BlockNumberRule) if err != nil { return nil, err } @@ -1191,8 +1129,8 @@ func (_L2OutputOracle *L2OutputOracleFilterer) WatchL2OutputDeleted(opts *bind.W select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(L2OutputOracleL2OutputDeleted) - if err := _L2OutputOracle.contract.UnpackLog(event, "L2OutputDeleted", log); err != nil { + event := new(L2OutputOracleOutputProposed) + if err := _L2OutputOracle.contract.UnpackLog(event, "OutputProposed", log); err != nil { return err } event.Raw = log @@ -1213,12 +1151,12 @@ func (_L2OutputOracle *L2OutputOracleFilterer) WatchL2OutputDeleted(opts *bind.W }), nil } -// ParseL2OutputDeleted is a log parse operation binding the contract event 0x7320566fd5256cf8923648a5d9f560f1e92f1435a1bb32ddd1fe107f224ad359. +// ParseOutputProposed is a log parse operation binding the contract event 0xc120f5e881491e6e212befa39e36b8f57d5eca31915f2e5d60a420f418caa6df. // -// Solidity: event L2OutputDeleted(bytes32 indexed l2Output, uint256 indexed l1Timestamp, uint256 indexed l2BlockNumber) -func (_L2OutputOracle *L2OutputOracleFilterer) ParseL2OutputDeleted(log types.Log) (*L2OutputOracleL2OutputDeleted, error) { - event := new(L2OutputOracleL2OutputDeleted) - if err := _L2OutputOracle.contract.UnpackLog(event, "L2OutputDeleted", log); err != nil { +// Solidity: event OutputProposed(bytes32 indexed outputRoot, uint256 indexed l1Timestamp, uint256 indexed l2BlockNumber) +func (_L2OutputOracle *L2OutputOracleFilterer) ParseOutputProposed(log types.Log) (*L2OutputOracleOutputProposed, error) { + event := new(L2OutputOracleOutputProposed) + if err := _L2OutputOracle.contract.UnpackLog(event, "OutputProposed", log); err != nil { return nil, err } event.Raw = log @@ -1378,9 +1316,9 @@ func (_L2OutputOracle *L2OutputOracleFilterer) ParseOwnershipTransferred(log typ return event, nil } -// L2OutputOracleSequencerChangedIterator is returned from FilterSequencerChanged and is used to iterate over the raw logs and unpacked data for SequencerChanged events raised by the L2OutputOracle contract. -type L2OutputOracleSequencerChangedIterator struct { - Event *L2OutputOracleSequencerChanged // Event containing the contract specifics and raw log +// L2OutputOracleProposerChangedIterator is returned from FilterProposerChanged and is used to iterate over the raw logs and unpacked data for ProposerChanged events raised by the L2OutputOracle contract. +type L2OutputOracleProposerChangedIterator struct { + Event *L2OutputOracleProposerChanged // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data @@ -1394,7 +1332,7 @@ type L2OutputOracleSequencerChangedIterator struct { // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. -func (it *L2OutputOracleSequencerChangedIterator) Next() bool { +func (it *L2OutputOracleProposerChangedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -1403,7 +1341,7 @@ func (it *L2OutputOracleSequencerChangedIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(L2OutputOracleSequencerChanged) + it.Event = new(L2OutputOracleProposerChanged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1418,7 +1356,7 @@ func (it *L2OutputOracleSequencerChangedIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(L2OutputOracleSequencerChanged) + it.Event = new(L2OutputOracleProposerChanged) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1434,60 +1372,60 @@ func (it *L2OutputOracleSequencerChangedIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *L2OutputOracleSequencerChangedIterator) Error() error { +func (it *L2OutputOracleProposerChangedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *L2OutputOracleSequencerChangedIterator) Close() error { +func (it *L2OutputOracleProposerChangedIterator) Close() error { it.sub.Unsubscribe() return nil } -// L2OutputOracleSequencerChanged represents a SequencerChanged event raised by the L2OutputOracle contract. -type L2OutputOracleSequencerChanged struct { - PreviousSequencer common.Address - NewSequencer common.Address - Raw types.Log // Blockchain specific contextual infos +// L2OutputOracleProposerChanged represents a ProposerChanged event raised by the L2OutputOracle contract. +type L2OutputOracleProposerChanged struct { + PreviousProposer common.Address + NewProposer common.Address + Raw types.Log // Blockchain specific contextual infos } -// FilterSequencerChanged is a free log retrieval operation binding the contract event 0x6ec88bae255aa7e73521c3beb17e9bc7940169e669440c5531733c0d2e91110d. +// FilterProposerChanged is a free log retrieval operation binding the contract event 0x3d7728dc2838bb794606bd89f5a37930830b32060f69ee929bbfc59b669024dd. // -// Solidity: event SequencerChanged(address indexed previousSequencer, address indexed newSequencer) -func (_L2OutputOracle *L2OutputOracleFilterer) FilterSequencerChanged(opts *bind.FilterOpts, previousSequencer []common.Address, newSequencer []common.Address) (*L2OutputOracleSequencerChangedIterator, error) { +// Solidity: event ProposerChanged(address indexed previousProposer, address indexed newProposer) +func (_L2OutputOracle *L2OutputOracleFilterer) FilterProposerChanged(opts *bind.FilterOpts, previousProposer []common.Address, newProposer []common.Address) (*L2OutputOracleProposerChangedIterator, error) { - var previousSequencerRule []interface{} - for _, previousSequencerItem := range previousSequencer { - previousSequencerRule = append(previousSequencerRule, previousSequencerItem) + var previousProposerRule []interface{} + for _, previousProposerItem := range previousProposer { + previousProposerRule = append(previousProposerRule, previousProposerItem) } - var newSequencerRule []interface{} - for _, newSequencerItem := range newSequencer { - newSequencerRule = append(newSequencerRule, newSequencerItem) + var newProposerRule []interface{} + for _, newProposerItem := range newProposer { + newProposerRule = append(newProposerRule, newProposerItem) } - logs, sub, err := _L2OutputOracle.contract.FilterLogs(opts, "SequencerChanged", previousSequencerRule, newSequencerRule) + logs, sub, err := _L2OutputOracle.contract.FilterLogs(opts, "ProposerChanged", previousProposerRule, newProposerRule) if err != nil { return nil, err } - return &L2OutputOracleSequencerChangedIterator{contract: _L2OutputOracle.contract, event: "SequencerChanged", logs: logs, sub: sub}, nil + return &L2OutputOracleProposerChangedIterator{contract: _L2OutputOracle.contract, event: "ProposerChanged", logs: logs, sub: sub}, nil } -// WatchSequencerChanged is a free log subscription operation binding the contract event 0x6ec88bae255aa7e73521c3beb17e9bc7940169e669440c5531733c0d2e91110d. +// WatchProposerChanged is a free log subscription operation binding the contract event 0x3d7728dc2838bb794606bd89f5a37930830b32060f69ee929bbfc59b669024dd. // -// Solidity: event SequencerChanged(address indexed previousSequencer, address indexed newSequencer) -func (_L2OutputOracle *L2OutputOracleFilterer) WatchSequencerChanged(opts *bind.WatchOpts, sink chan<- *L2OutputOracleSequencerChanged, previousSequencer []common.Address, newSequencer []common.Address) (event.Subscription, error) { +// Solidity: event ProposerChanged(address indexed previousProposer, address indexed newProposer) +func (_L2OutputOracle *L2OutputOracleFilterer) WatchProposerChanged(opts *bind.WatchOpts, sink chan<- *L2OutputOracleProposerChanged, previousProposer []common.Address, newProposer []common.Address) (event.Subscription, error) { - var previousSequencerRule []interface{} - for _, previousSequencerItem := range previousSequencer { - previousSequencerRule = append(previousSequencerRule, previousSequencerItem) + var previousProposerRule []interface{} + for _, previousProposerItem := range previousProposer { + previousProposerRule = append(previousProposerRule, previousProposerItem) } - var newSequencerRule []interface{} - for _, newSequencerItem := range newSequencer { - newSequencerRule = append(newSequencerRule, newSequencerItem) + var newProposerRule []interface{} + for _, newProposerItem := range newProposer { + newProposerRule = append(newProposerRule, newProposerItem) } - logs, sub, err := _L2OutputOracle.contract.WatchLogs(opts, "SequencerChanged", previousSequencerRule, newSequencerRule) + logs, sub, err := _L2OutputOracle.contract.WatchLogs(opts, "ProposerChanged", previousProposerRule, newProposerRule) if err != nil { return nil, err } @@ -1497,8 +1435,8 @@ func (_L2OutputOracle *L2OutputOracleFilterer) WatchSequencerChanged(opts *bind. select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(L2OutputOracleSequencerChanged) - if err := _L2OutputOracle.contract.UnpackLog(event, "SequencerChanged", log); err != nil { + event := new(L2OutputOracleProposerChanged) + if err := _L2OutputOracle.contract.UnpackLog(event, "ProposerChanged", log); err != nil { return err } event.Raw = log @@ -1519,12 +1457,12 @@ func (_L2OutputOracle *L2OutputOracleFilterer) WatchSequencerChanged(opts *bind. }), nil } -// ParseSequencerChanged is a log parse operation binding the contract event 0x6ec88bae255aa7e73521c3beb17e9bc7940169e669440c5531733c0d2e91110d. +// ParseProposerChanged is a log parse operation binding the contract event 0x3d7728dc2838bb794606bd89f5a37930830b32060f69ee929bbfc59b669024dd. // -// Solidity: event SequencerChanged(address indexed previousSequencer, address indexed newSequencer) -func (_L2OutputOracle *L2OutputOracleFilterer) ParseSequencerChanged(log types.Log) (*L2OutputOracleSequencerChanged, error) { - event := new(L2OutputOracleSequencerChanged) - if err := _L2OutputOracle.contract.UnpackLog(event, "SequencerChanged", log); err != nil { +// Solidity: event ProposerChanged(address indexed previousProposer, address indexed newProposer) +func (_L2OutputOracle *L2OutputOracleFilterer) ParseProposerChanged(log types.Log) (*L2OutputOracleProposerChanged, error) { + event := new(L2OutputOracleProposerChanged) + if err := _L2OutputOracle.contract.UnpackLog(event, "ProposerChanged", log); err != nil { return nil, err } event.Raw = log diff --git a/op-bindings/bindings/l2tol1messagepasser.go b/op-bindings/bindings/l2tol1messagepasser.go index 5f977506846c6..190ebd1f12736 100644 --- a/op-bindings/bindings/l2tol1messagepasser.go +++ b/op-bindings/bindings/l2tol1messagepasser.go @@ -30,8 +30,8 @@ var ( // L2ToL1MessagePasserMetaData contains all meta data concerning the L2ToL1MessagePasser contract. var L2ToL1MessagePasserMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"WithdrawalInitiated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"WithdrawerBalanceBurnt\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"MAJOR_VERSION\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MINOR_VERSION\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"PATCH_VERSION\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_target\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"initiateWithdrawal\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nonce\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"sentMessages\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", - Bin: "0x60e060405234801561001057600080fd5b506000608081905260a052600160c05260805160a05160c05161057d61004e600039600060c401526000610174015260006101a8015261057d6000f3fe6080604052600436106100745760003560e01c8063affed0e01161004e578063affed0e014610139578063c2b3e5ac1461014f578063c8b9153114610162578063f786becd1461019657600080fd5b806344df8e701461009d5780636bf2606a146100b257806382e3702d146100f957600080fd5b366100985761009633620186a0604051806020016040528060008152506101ca565b005b600080fd5b3480156100a957600080fd5b50610096610280565b3480156100be57600080fd5b506100e67f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561010557600080fd5b50610129610114366004610332565b60006020819052908152604090205460ff1681565b60405190151581526020016100f0565b34801561014557600080fd5b506100e660015481565b61009661015d36600461037a565b6101ca565b34801561016e57600080fd5b506100e67f000000000000000000000000000000000000000000000000000000000000000081565b3480156101a257600080fd5b506100e67f000000000000000000000000000000000000000000000000000000000000000081565b60006101dc60015433863487876102b8565b6000818152602081905260409081902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600190811790915554905191925073ffffffffffffffffffffffffffffffffffffffff8616913391907f87bf7b546c8de873abb0db5b579ec131f8d0cf5b14f39933551cf9ced23a61369061026a903490899089906104e9565b60405180910390a4505060018054810190555050565b4761028a816102f7565b60405181907f7967de617a5ac1cc7eba2d6f37570a0135afa950d8bb77cdd35f0d0b4e85a16f90600090a250565b60008686868686866040516020016102d596959493929190610511565b6040516020818303038152906040528051906020012090509695505050505050565b8060405161030490610326565b6040518091039082f0905080158015610321573d6000803e3d6000fd5b505050565b60088061056983390190565b60006020828403121561034457600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60008060006060848603121561038f57600080fd5b833573ffffffffffffffffffffffffffffffffffffffff811681146103b357600080fd5b925060208401359150604084013567ffffffffffffffff808211156103d757600080fd5b818601915086601f8301126103eb57600080fd5b8135818111156103fd576103fd61034b565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156104435761044361034b565b8160405282815289602084870101111561045c57600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b6000815180845260005b818110156104a457602081850181015186830182015201610488565b818111156104b6576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b838152826020820152606060408201526000610508606083018461047e565b95945050505050565b868152600073ffffffffffffffffffffffffffffffffffffffff808816602084015280871660408401525084606083015283608083015260c060a083015261055c60c083018461047e565b9897505050505050505056fe608060405230fffea164736f6c634300080a000a", + ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"WithdrawalInitiated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"WithdrawerBalanceBurnt\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_target\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"initiateWithdrawal\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nonce\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"sentMessages\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", + Bin: "0x60e060405234801561001057600080fd5b506000608081905260a052600160c05260805160a05160c0516108e861004f60003960006102d3015260006102aa0152600061028101526108e86000f3fe60806040526004361061005e5760003560e01c806382e3702d1161004357806382e3702d146100c7578063affed0e014610107578063c2b3e5ac1461012b57600080fd5b806344df8e701461008757806354fd4d501461009c57600080fd5b366100825761008033620186a060405180602001604052806000815250610139565b005b600080fd5b34801561009357600080fd5b50610080610242565b3480156100a857600080fd5b506100b161027a565b6040516100be919061055c565b60405180910390f35b3480156100d357600080fd5b506100f76100e2366004610576565b60006020819052908152604090205460ff1681565b60405190151581526020016100be565b34801561011357600080fd5b5061011d60015481565b6040519081526020016100be565b6100806101393660046105be565b600061019e6040518060c0016040528060015481526020013373ffffffffffffffffffffffffffffffffffffffff1681526020018673ffffffffffffffffffffffffffffffffffffffff1681526020013481526020018581526020018481525061031d565b6000818152602081905260409081902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600190811790915554905191925073ffffffffffffffffffffffffffffffffffffffff8616913391907f87bf7b546c8de873abb0db5b579ec131f8d0cf5b14f39933551cf9ced23a61369061022c903490899089906106c2565b60405180910390a4505060018054810190555050565b4761024c8161036a565b60405181907f7967de617a5ac1cc7eba2d6f37570a0135afa950d8bb77cdd35f0d0b4e85a16f90600090a250565b60606102a57f0000000000000000000000000000000000000000000000000000000000000000610399565b6102ce7f0000000000000000000000000000000000000000000000000000000000000000610399565b6102f77f0000000000000000000000000000000000000000000000000000000000000000610399565b604051602001610309939291906106ea565b604051602081830303815290604052905090565b80516020808301516040808501516060860151608087015160a0880151935160009761034d979096959101610760565b604051602081830303815290604052805190602001209050919050565b80604051610377906104d6565b6040518091039082f0905080158015610394573d6000803e3d6000fd5b505050565b6060816000036103dc57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b811561040657806103f0816107e6565b91506103ff9050600a8361084d565b91506103e0565b60008167ffffffffffffffff8111156104215761042161058f565b6040519080825280601f01601f19166020018201604052801561044b576020820181803683370190505b5090505b84156104ce57610460600183610861565b915061046d600a86610878565b61047890603061088c565b60f81b81838151811061048d5761048d6108a4565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506104c7600a8661084d565b945061044f565b949350505050565b6008806108d483390190565b60005b838110156104fd5781810151838201526020016104e5565b8381111561050c576000848401525b50505050565b6000815180845261052a8160208601602086016104e2565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60208152600061056f6020830184610512565b9392505050565b60006020828403121561058857600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000806000606084860312156105d357600080fd5b833573ffffffffffffffffffffffffffffffffffffffff811681146105f757600080fd5b925060208401359150604084013567ffffffffffffffff8082111561061b57600080fd5b818601915086601f83011261062f57600080fd5b8135818111156106415761064161058f565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156106875761068761058f565b816040528281528960208487010111156106a057600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b8381528260208201526060604082015260006106e16060830184610512565b95945050505050565b600084516106fc8184602089016104e2565b80830190507f2e000000000000000000000000000000000000000000000000000000000000008082528551610738816001850160208a016104e2565b600192019182015283516107538160028401602088016104e2565b0160020195945050505050565b868152600073ffffffffffffffffffffffffffffffffffffffff808816602084015280871660408401525084606083015283608083015260c060a08301526107ab60c0830184610512565b98975050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610817576108176107b7565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60008261085c5761085c61081e565b500490565b600082821015610873576108736107b7565b500390565b6000826108875761088761081e565b500690565b6000821982111561089f5761089f6107b7565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fdfe608060405230fffea164736f6c634300080f000a", } // L2ToL1MessagePasserABI is the input ABI used to generate the binding from. @@ -201,99 +201,6 @@ func (_L2ToL1MessagePasser *L2ToL1MessagePasserTransactorRaw) Transact(opts *bin return _L2ToL1MessagePasser.Contract.contract.Transact(opts, method, params...) } -// MAJORVERSION is a free data retrieval call binding the contract method 0xf786becd. -// -// Solidity: function MAJOR_VERSION() view returns(uint256) -func (_L2ToL1MessagePasser *L2ToL1MessagePasserCaller) MAJORVERSION(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _L2ToL1MessagePasser.contract.Call(opts, &out, "MAJOR_VERSION") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// MAJORVERSION is a free data retrieval call binding the contract method 0xf786becd. -// -// Solidity: function MAJOR_VERSION() view returns(uint256) -func (_L2ToL1MessagePasser *L2ToL1MessagePasserSession) MAJORVERSION() (*big.Int, error) { - return _L2ToL1MessagePasser.Contract.MAJORVERSION(&_L2ToL1MessagePasser.CallOpts) -} - -// MAJORVERSION is a free data retrieval call binding the contract method 0xf786becd. -// -// Solidity: function MAJOR_VERSION() view returns(uint256) -func (_L2ToL1MessagePasser *L2ToL1MessagePasserCallerSession) MAJORVERSION() (*big.Int, error) { - return _L2ToL1MessagePasser.Contract.MAJORVERSION(&_L2ToL1MessagePasser.CallOpts) -} - -// MINORVERSION is a free data retrieval call binding the contract method 0xc8b91531. -// -// Solidity: function MINOR_VERSION() view returns(uint256) -func (_L2ToL1MessagePasser *L2ToL1MessagePasserCaller) MINORVERSION(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _L2ToL1MessagePasser.contract.Call(opts, &out, "MINOR_VERSION") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// MINORVERSION is a free data retrieval call binding the contract method 0xc8b91531. -// -// Solidity: function MINOR_VERSION() view returns(uint256) -func (_L2ToL1MessagePasser *L2ToL1MessagePasserSession) MINORVERSION() (*big.Int, error) { - return _L2ToL1MessagePasser.Contract.MINORVERSION(&_L2ToL1MessagePasser.CallOpts) -} - -// MINORVERSION is a free data retrieval call binding the contract method 0xc8b91531. -// -// Solidity: function MINOR_VERSION() view returns(uint256) -func (_L2ToL1MessagePasser *L2ToL1MessagePasserCallerSession) MINORVERSION() (*big.Int, error) { - return _L2ToL1MessagePasser.Contract.MINORVERSION(&_L2ToL1MessagePasser.CallOpts) -} - -// PATCHVERSION is a free data retrieval call binding the contract method 0x6bf2606a. -// -// Solidity: function PATCH_VERSION() view returns(uint256) -func (_L2ToL1MessagePasser *L2ToL1MessagePasserCaller) PATCHVERSION(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _L2ToL1MessagePasser.contract.Call(opts, &out, "PATCH_VERSION") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// PATCHVERSION is a free data retrieval call binding the contract method 0x6bf2606a. -// -// Solidity: function PATCH_VERSION() view returns(uint256) -func (_L2ToL1MessagePasser *L2ToL1MessagePasserSession) PATCHVERSION() (*big.Int, error) { - return _L2ToL1MessagePasser.Contract.PATCHVERSION(&_L2ToL1MessagePasser.CallOpts) -} - -// PATCHVERSION is a free data retrieval call binding the contract method 0x6bf2606a. -// -// Solidity: function PATCH_VERSION() view returns(uint256) -func (_L2ToL1MessagePasser *L2ToL1MessagePasserCallerSession) PATCHVERSION() (*big.Int, error) { - return _L2ToL1MessagePasser.Contract.PATCHVERSION(&_L2ToL1MessagePasser.CallOpts) -} - // Nonce is a free data retrieval call binding the contract method 0xaffed0e0. // // Solidity: function nonce() view returns(uint256) @@ -356,6 +263,37 @@ func (_L2ToL1MessagePasser *L2ToL1MessagePasserCallerSession) SentMessages(arg0 return _L2ToL1MessagePasser.Contract.SentMessages(&_L2ToL1MessagePasser.CallOpts, arg0) } +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_L2ToL1MessagePasser *L2ToL1MessagePasserCaller) Version(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _L2ToL1MessagePasser.contract.Call(opts, &out, "version") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_L2ToL1MessagePasser *L2ToL1MessagePasserSession) Version() (string, error) { + return _L2ToL1MessagePasser.Contract.Version(&_L2ToL1MessagePasser.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_L2ToL1MessagePasser *L2ToL1MessagePasserCallerSession) Version() (string, error) { + return _L2ToL1MessagePasser.Contract.Version(&_L2ToL1MessagePasser.CallOpts) +} + // Burn is a paid mutator transaction binding the contract method 0x44df8e70. // // Solidity: function burn() returns() diff --git a/op-bindings/bindings/l2tol1messagepasser_deployed.go b/op-bindings/bindings/l2tol1messagepasser_deployed.go index dbbda9890930b..b3b953211f140 100644 --- a/op-bindings/bindings/l2tol1messagepasser_deployed.go +++ b/op-bindings/bindings/l2tol1messagepasser_deployed.go @@ -2,4 +2,4 @@ // This file is a generated binding and any manual changes will be lost. package bindings -var L2ToL1MessagePasserDeployedBin = "0x6080604052600436106100745760003560e01c8063affed0e01161004e578063affed0e014610139578063c2b3e5ac1461014f578063c8b9153114610162578063f786becd1461019657600080fd5b806344df8e701461009d5780636bf2606a146100b257806382e3702d146100f957600080fd5b366100985761009633620186a0604051806020016040528060008152506101ca565b005b600080fd5b3480156100a957600080fd5b50610096610280565b3480156100be57600080fd5b506100e67f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561010557600080fd5b50610129610114366004610332565b60006020819052908152604090205460ff1681565b60405190151581526020016100f0565b34801561014557600080fd5b506100e660015481565b61009661015d36600461037a565b6101ca565b34801561016e57600080fd5b506100e67f000000000000000000000000000000000000000000000000000000000000000081565b3480156101a257600080fd5b506100e67f000000000000000000000000000000000000000000000000000000000000000081565b60006101dc60015433863487876102b8565b6000818152602081905260409081902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600190811790915554905191925073ffffffffffffffffffffffffffffffffffffffff8616913391907f87bf7b546c8de873abb0db5b579ec131f8d0cf5b14f39933551cf9ced23a61369061026a903490899089906104e9565b60405180910390a4505060018054810190555050565b4761028a816102f7565b60405181907f7967de617a5ac1cc7eba2d6f37570a0135afa950d8bb77cdd35f0d0b4e85a16f90600090a250565b60008686868686866040516020016102d596959493929190610511565b6040516020818303038152906040528051906020012090509695505050505050565b8060405161030490610326565b6040518091039082f0905080158015610321573d6000803e3d6000fd5b505050565b60088061056983390190565b60006020828403121561034457600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60008060006060848603121561038f57600080fd5b833573ffffffffffffffffffffffffffffffffffffffff811681146103b357600080fd5b925060208401359150604084013567ffffffffffffffff808211156103d757600080fd5b818601915086601f8301126103eb57600080fd5b8135818111156103fd576103fd61034b565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156104435761044361034b565b8160405282815289602084870101111561045c57600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b6000815180845260005b818110156104a457602081850181015186830182015201610488565b818111156104b6576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b838152826020820152606060408201526000610508606083018461047e565b95945050505050565b868152600073ffffffffffffffffffffffffffffffffffffffff808816602084015280871660408401525084606083015283608083015260c060a083015261055c60c083018461047e565b9897505050505050505056fe608060405230fffea164736f6c634300080a000a" +var L2ToL1MessagePasserDeployedBin = "0x60806040526004361061005e5760003560e01c806382e3702d1161004357806382e3702d146100c7578063affed0e014610107578063c2b3e5ac1461012b57600080fd5b806344df8e701461008757806354fd4d501461009c57600080fd5b366100825761008033620186a060405180602001604052806000815250610139565b005b600080fd5b34801561009357600080fd5b50610080610242565b3480156100a857600080fd5b506100b161027a565b6040516100be919061055c565b60405180910390f35b3480156100d357600080fd5b506100f76100e2366004610576565b60006020819052908152604090205460ff1681565b60405190151581526020016100be565b34801561011357600080fd5b5061011d60015481565b6040519081526020016100be565b6100806101393660046105be565b600061019e6040518060c0016040528060015481526020013373ffffffffffffffffffffffffffffffffffffffff1681526020018673ffffffffffffffffffffffffffffffffffffffff1681526020013481526020018581526020018481525061031d565b6000818152602081905260409081902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600190811790915554905191925073ffffffffffffffffffffffffffffffffffffffff8616913391907f87bf7b546c8de873abb0db5b579ec131f8d0cf5b14f39933551cf9ced23a61369061022c903490899089906106c2565b60405180910390a4505060018054810190555050565b4761024c8161036a565b60405181907f7967de617a5ac1cc7eba2d6f37570a0135afa950d8bb77cdd35f0d0b4e85a16f90600090a250565b60606102a57f0000000000000000000000000000000000000000000000000000000000000000610399565b6102ce7f0000000000000000000000000000000000000000000000000000000000000000610399565b6102f77f0000000000000000000000000000000000000000000000000000000000000000610399565b604051602001610309939291906106ea565b604051602081830303815290604052905090565b80516020808301516040808501516060860151608087015160a0880151935160009761034d979096959101610760565b604051602081830303815290604052805190602001209050919050565b80604051610377906104d6565b6040518091039082f0905080158015610394573d6000803e3d6000fd5b505050565b6060816000036103dc57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b811561040657806103f0816107e6565b91506103ff9050600a8361084d565b91506103e0565b60008167ffffffffffffffff8111156104215761042161058f565b6040519080825280601f01601f19166020018201604052801561044b576020820181803683370190505b5090505b84156104ce57610460600183610861565b915061046d600a86610878565b61047890603061088c565b60f81b81838151811061048d5761048d6108a4565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506104c7600a8661084d565b945061044f565b949350505050565b6008806108d483390190565b60005b838110156104fd5781810151838201526020016104e5565b8381111561050c576000848401525b50505050565b6000815180845261052a8160208601602086016104e2565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60208152600061056f6020830184610512565b9392505050565b60006020828403121561058857600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000806000606084860312156105d357600080fd5b833573ffffffffffffffffffffffffffffffffffffffff811681146105f757600080fd5b925060208401359150604084013567ffffffffffffffff8082111561061b57600080fd5b818601915086601f83011261062f57600080fd5b8135818111156106415761064161058f565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156106875761068761058f565b816040528281528960208487010111156106a057600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b8381528260208201526060604082015260006106e16060830184610512565b95945050505050565b600084516106fc8184602089016104e2565b80830190507f2e000000000000000000000000000000000000000000000000000000000000008082528551610738816001850160208a016104e2565b600192019182015283516107538160028401602088016104e2565b0160020195945050505050565b868152600073ffffffffffffffffffffffffffffffffffffffff808816602084015280871660408401525084606083015283608083015260c060a08301526107ab60c0830184610512565b98975050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610817576108176107b7565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60008261085c5761085c61081e565b500490565b600082821015610873576108736107b7565b500390565b6000826108875761088761081e565b500690565b6000821982111561089f5761089f6107b7565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fdfe608060405230fffea164736f6c634300080f000a" diff --git a/op-bindings/bindings/optimismportal.go b/op-bindings/bindings/optimismportal.go index 194d75dc484c1..f3ed8223e4186 100644 --- a/op-bindings/bindings/optimismportal.go +++ b/op-bindings/bindings/optimismportal.go @@ -28,18 +28,28 @@ var ( _ = event.NewSubscription ) -// HashingOutputRootProof is an auto generated low-level Go binding around an user-defined struct. -type HashingOutputRootProof struct { +// TypesOutputRootProof is an auto generated low-level Go binding around an user-defined struct. +type TypesOutputRootProof struct { Version [32]byte StateRoot [32]byte WithdrawerStorageRoot [32]byte LatestBlockhash [32]byte } +// TypesWithdrawalTransaction is an auto generated low-level Go binding around an user-defined struct. +type TypesWithdrawalTransaction struct { + Nonce *big.Int + Sender common.Address + Target common.Address + Value *big.Int + GasLimit *big.Int + Data []byte +} + // OptimismPortalMetaData contains all meta data concerning the OptimismPortal contract. var OptimismPortalMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"contractL2OutputOracle\",\"name\":\"_l2Oracle\",\"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\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"mint\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"gasLimit\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"isCreation\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"TransactionDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"withdrawalHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"name\":\"WithdrawalFinalized\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"BASE_FEE_MAX_CHANGE_DENOMINATOR\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ELASTICITY_MULTIPLIER\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"FINALIZATION_PERIOD_SECONDS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"INITIAL_BASE_FEE\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"L2_ORACLE\",\"outputs\":[{\"internalType\":\"contractL2OutputOracle\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAJOR_VERSION\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_RESOURCE_LIMIT\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MINIMUM_BASE_FEE\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MINOR_VERSION\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"PATCH_VERSION\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"TARGET_RESOURCE_LIMIT\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_value\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"_gasLimit\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"_isCreation\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"depositTransaction\",\"outputs\":[],\"stateMutability\":\"payable\",\"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\":\"_gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_l2BlockNumber\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"version\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"stateRoot\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"withdrawerStorageRoot\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"latestBlockhash\",\"type\":\"bytes32\"}],\"internalType\":\"structHashing.OutputRootProof\",\"name\":\"_outputRootProof\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"_withdrawalProof\",\"type\":\"bytes\"}],\"name\":\"finalizeWithdrawalTransaction\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"finalizedWithdrawals\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_l2BlockNumber\",\"type\":\"uint256\"}],\"name\":\"isOutputFinalized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l2Sender\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"params\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"prevBaseFee\",\"type\":\"uint128\"},{\"internalType\":\"uint64\",\"name\":\"prevBoughtGas\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"prevBlockNum\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", - Bin: "0x6101206040523480156200001257600080fd5b5060405162004005380380620040058339810160408190526200003591620002bc565b6000608081905260a052600160c0526001600160a01b0382166101005260e08190526200006162000069565b5050620002f8565b6000620000776001620000f8565b9050801562000090576000805461ff0019166101001790555b603380546001600160a01b03191661dead179055620000ae6200020a565b8015620000f5576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b60008054610100900460ff161562000191578160ff1660011480156200013157506200012f30620002ad60201b620014391760201c565b155b620001895760405162461bcd60e51b815260206004820152602e602482015260008051602062003fe583398151915260448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b506000919050565b60005460ff808416911610620001f05760405162461bcd60e51b815260206004820152602e602482015260008051602062003fe583398151915260448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840162000180565b506000805460ff191660ff92909216919091179055600190565b600054610100900460ff16620002775760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840162000180565b60408051606081018252633b9aca0080825260006020830152436001600160401b031691909201819052600160c01b0217600155565b6001600160a01b03163b151590565b60008060408385031215620002d057600080fd5b82516001600160a01b0381168114620002e857600080fd5b6020939093015192949293505050565b60805160a05160c05160e05161010051613c776200036e6000396000818161016a0152818161099101528181610a0801528181610a9b01528181610b6d0152610ec301526000818161044c01528181610c1f0152610f460152600061023b01526000610327015260006104800152613c776000f3fe60806040526004361061012c5760003560e01c8063a14238e7116100a5578063cff0ab9611610074578063eecf1c3611610059578063eecf1c3614610427578063f4daa2911461043a578063f786becd1461046e57600080fd5b8063cff0ab9614610373578063e9e05c421461041457600080fd5b8063a14238e7146102e5578063c8b9153114610315578063ca3e99ba14610349578063cd7c97891461035e57600080fd5b80636bf2606a116100fc5780638129fc1c116100e15780638129fc1c1461028d578063867ead13146102a25780639bf62d82146102b857600080fd5b80636bf2606a146102295780636dbffb781461025d57600080fd5b80621c2ff61461015857806313620abd146101b657806364b79208146101ef5780636bb0291e1461021457600080fd5b36610153576101513334620186a06000604051806020016040528060008152506104a2565b005b600080fd5b34801561016457600080fd5b5061018c7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b3480156101c257600080fd5b506101ce633b9aca0081565b6040516fffffffffffffffffffffffffffffffff90911681526020016101ad565b3480156101fb57600080fd5b50610206627a120081565b6040519081526020016101ad565b34801561022057600080fd5b50610206600481565b34801561023557600080fd5b506102067f000000000000000000000000000000000000000000000000000000000000000081565b34801561026957600080fd5b5061027d61027836600461331b565b610948565b60405190151581526020016101ad565b34801561029957600080fd5b50610151610c56565b3480156102ae57600080fd5b5061020661271081565b3480156102c457600080fd5b5060335461018c9073ffffffffffffffffffffffffffffffffffffffff1681565b3480156102f157600080fd5b5061027d61030036600461331b565b60346020526000908152604090205460ff1681565b34801561032157600080fd5b506102067f000000000000000000000000000000000000000000000000000000000000000081565b34801561035557600080fd5b50610206610d31565b34801561036a57600080fd5b50610206600881565b34801561037f57600080fd5b506001546103db906fffffffffffffffffffffffffffffffff81169067ffffffffffffffff7001000000000000000000000000000000008204811691780100000000000000000000000000000000000000000000000090041683565b604080516fffffffffffffffffffffffffffffffff909416845267ffffffffffffffff92831660208501529116908201526060016101ad565b6101516104223660046133d6565b6104a2565b610151610435366004613520565b610d42565b34801561044657600080fd5b506102067f000000000000000000000000000000000000000000000000000000000000000081565b34801561047a57600080fd5b506102067f000000000000000000000000000000000000000000000000000000000000000081565b8260005a905083156105595773ffffffffffffffffffffffffffffffffffffffff87161561055957604080517f08c379a00000000000000000000000000000000000000000000000000000000081526020600482015260248101919091527f4f7074696d69736d506f7274616c3a206d7573742073656e6420746f2061646460448201527f72657373283029207768656e206372656174696e67206120636f6e747261637460648201526084015b60405180910390fd5b3332811461057a575033731111000000000000000000000000000000001111015b8773ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f78231ae6eb73366f912bb1d64351601fb76344c537bbab635ce14d0f376f0195348a8a8a8a6040516105df95949392919061368b565b60405180910390a35060015460009061061e907801000000000000000000000000000000000000000000000000900467ffffffffffffffff16436136f1565b905080156107a75760006106366004627a1200613737565b6001546106619190700100000000000000000000000000000000900467ffffffffffffffff1661379f565b9050600060086106756004627a1200613737565b6001546106959085906fffffffffffffffffffffffffffffffff16613813565b61069f9190613737565b6106a99190613737565b6001549091506000906106f5906106df906106d79085906fffffffffffffffffffffffffffffffff166138cf565b612710611455565b6fffffffffffffffffffffffffffffffff611470565b90506001841115610768576107656106df670de0b6b3a764000061075161071d600883613737565b61072f90670de0b6b3a764000061379f565b61073a60018a6136f1565b61074c90670de0b6b3a7640000613943565b61147f565b61075b9085613813565b6106d79190613737565b90505b6fffffffffffffffffffffffffffffffff16780100000000000000000000000000000000000000000000000067ffffffffffffffff4316021760015550505b600180548491906010906107da908490700100000000000000000000000000000000900467ffffffffffffffff16613980565b92506101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550627a1200600160000160109054906101000a900467ffffffffffffffff1667ffffffffffffffff1613156108b6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603c60248201527f4f7074696d69736d506f7274616c3a2063616e6e6f7420627579206d6f72652060448201527f676173207468616e20617661696c61626c6520676173206c696d6974000000006064820152608401610550565b6001546000906108e2906fffffffffffffffffffffffffffffffff1667ffffffffffffffff86166139ac565b6fffffffffffffffffffffffffffffffff169050600061090648633b9aca006114b0565b61091090836139e4565b905060005a61091f90866136f1565b90508082111561093b5761093b61093682846136f1565b6114c0565b5050505050505050505050565b6040517fa25ae55700000000000000000000000000000000000000000000000000000000815260048101829052600090819073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063a25ae557906024016040805180830381865afa1580156109d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109fb91906139f8565b8051909150610c1d5760007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663529933df6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a71573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a959190613a47565b905060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16634ab65d736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b289190613a47565b905084811115610b3d57506000949350505050565b600082610b4a83886136f1565b610b549190613a60565b905073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001663a25ae557610b9c83866136f1565b610ba69089613a74565b6040518263ffffffff1660e01b8152600401610bc491815260200190565b6040805180830381865afa158015610be0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0491906139f8565b8051909450610c195750600095945050505050565b5050505b7f00000000000000000000000000000000000000000000000000000000000000008160200151610c4d9190613a74565b42119392505050565b6000610c6260016114ee565b90508015610c9757600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b603380547fffffffffffffffffffffffff00000000000000000000000000000000000000001661dead179055610ccb611679565b8015610d2e57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b610d3f6004627a1200613737565b81565b60335473ffffffffffffffffffffffffffffffffffffffff1661dead14610deb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f4f7074696d69736d506f7274616c3a2063616e206f6e6c79207472696767657260448201527f206f6e65207769746864726177616c20706572207472616e73616374696f6e006064820152608401610550565b73ffffffffffffffffffffffffffffffffffffffff8916301415610e91576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f4f7074696d69736d506f7274616c3a20796f752063616e6e6f742073656e642060448201527f6d6573736167657320746f2074686520706f7274616c20636f6e7472616374006064820152608401610550565b6040517fa25ae557000000000000000000000000000000000000000000000000000000008152600481018590526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063a25ae557906024016040805180830381865afa158015610f1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f4291906139f8565b90507f00000000000000000000000000000000000000000000000000000000000000008160200151610f749190613a74565b4211611002576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f4f7074696d69736d506f7274616c3a2070726f706f73616c206973206e6f742060448201527f7965742066696e616c697a6564000000000000000000000000000000000000006064820152608401610550565b61101961101436869003860186613a8c565b61175c565b8151146110a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4f7074696d69736d506f7274616c3a20696e76616c6964206f7574707574207260448201527f6f6f742070726f6f6600000000000000000000000000000000000000000000006064820152608401610550565b60006110ee8d8d8d8d8d8d8d8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506117b892505050565b905061113581866040013586868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506117f792505050565b6111c1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4f7074696d69736d506f7274616c3a20696e76616c696420776974686472617760448201527f616c20696e636c7573696f6e2070726f6f6600000000000000000000000000006064820152608401610550565b60008181526034602052604090205460ff1615611260576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603560248201527f4f7074696d69736d506f7274616c3a207769746864726177616c20686173206160448201527f6c7265616479206265656e2066696e616c697a656400000000000000000000006064820152608401610550565b600081815260346020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790556112a3614e208a613a74565b5a1015611332576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f4f7074696d69736d506f7274616c3a20696e73756666696369656e742067617360448201527f20746f2066696e616c697a65207769746864726177616c0000000000000000006064820152608401610550565b603380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8e16179055604080516020601f8a018190048102820181019092528881526000916113bb918e918d918f918691908f908f90819084018382808284376000920191909152506118c092505050565b50603380547fffffffffffffffffffffffff00000000000000000000000000000000000000001661dead17905560405190915082907fdb5c7652857aa163daadd670e116628fb42e869d8ac4251ef8971d9e5727df1b9061142190841515815260200190565b60405180910390a25050505050505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b6000818312156114655781611467565b825b90505b92915050565b60008183126114655781611467565b6000611467670de0b6b3a7640000836114978661194b565b6114a19190613813565b6114ab9190613737565b611b8f565b6000818310156114655781611467565b6000805a90505b825a6114d390836136f1565b10156114e9576114e282613af2565b91506114c7565b505050565b60008054610100900460ff16156115a5578160ff1660011480156115115750303b155b61159d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610550565b506000919050565b60005460ff80841691161061163c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610550565b50600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff92909216919091179055600190565b919050565b600054610100900460ff16611710576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610550565b60408051606081018252633b9aca00808252600060208301524367ffffffffffffffff169190920181905278010000000000000000000000000000000000000000000000000217600155565b6000816000015182602001518360400151846060015160405160200161179b949392919093845260208401929092526040830152606082015260800190565b604051602081830303815290604052805190602001209050919050565b60008686868686866040516020016117d596959493929190613b2b565b6040516020818303038152906040528051906020012090509695505050505050565b604080516020810185905260009181018290528190606001604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152828252805160209182012090830181905292506118b59101604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152828201909152600182527f01000000000000000000000000000000000000000000000000000000000000006020830152908587611dce565b9150505b9392505050565b6000606060008060008661ffff1667ffffffffffffffff8111156118e6576118e6613358565b6040519080825280601f01601f191660200182016040528015611910576020820181803683370190505b5090506000808751602089018b8e8ef191503d925086831115611931578692505b828152826000602083013e90999098509650505050505050565b60008082136119b6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f554e444546494e454400000000000000000000000000000000000000000000006044820152606401610550565b600060606119c384611df2565b03609f8181039490941b90931c6c465772b2bbbb5f824b15207a3081018102606090811d6d0388eaa27412d5aca026815d636e018202811d6d0df99ac502031bf953eff472fdcc018202811d6d13cdffb29d51d99322bdff5f2211018202811d6d0a0f742023def783a307a986912e018202811d6d01920d8043ca89b5239253284e42018202811d6c0b7a86d7375468fac667a0a527016c29508e458543d8aa4df2abee7883018302821d6d0139601a2efabe717e604cbb4894018302821d6d02247f7a7b6594320649aa03aba1018302821d7fffffffffffffffffffffffffffffffffffffff73c0c716a594e00d54e3c4cbc9018302821d7ffffffffffffffffffffffffffffffffffffffdc7b88c420e53a9890533129f6f01830290911d7fffffffffffffffffffffffffffffffffffffff465fda27eb4d63ded474e5f832019091027ffffffffffffffff5f6af8f7b3396644f18e157960000000000000000000000000105711340daa0d5f769dba1915cef59f0815a5506027d0267a36c0c95b3975ab3ee5b203a7614a3f75373f047d803ae7b6687f2b393909302929092017d57115e47018c7177eebf7cd370a3356a1b7863008a5ae8028c72b88642840160ae1d92915050565b60007ffffffffffffffffffffffffffffffffffffffffffffffffdb731c958f34d94c18213611bc057506000919050565b680755bf798b4a1bf1e58212611c32576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f4558505f4f564552464c4f5700000000000000000000000000000000000000006044820152606401610550565b6503782dace9d9604e83901b059150600060606bb17217f7d1cf79abc9e3b39884821b056b80000000000000000000000001901d6bb17217f7d1cf79abc9e3b39881029093037fffffffffffffffffffffffffffffffffffffffdbf3ccf1604d263450f02a550481018102606090811d6d0277594991cfc85f6e2461837cd9018202811d7fffffffffffffffffffffffffffffffffffffe5adedaa1cb095af9e4da10e363c018202811d6db1bbb201f443cf962f1a1d3db4a5018202811d7ffffffffffffffffffffffffffffffffffffd38dc772608b0ae56cce01296c0eb018202811d6e05180bb14799ab47a8a8cb2a527d57016d02d16720577bd19bf614176fe9ea6c10fe68e7fd37d0007b713f765084018402831d9081019084017ffffffffffffffffffffffffffffffffffffffe2c69812cf03b0763fd454a8f7e010290911d6e0587f503bb6ea29d25fcb7401964500190910279d835ebba824c98fb31b83b2ca45c000000000000000000000000010574029d9dc38563c32e5c2f6dc192ee70ef65f9978af30260c3939093039290921c92915050565b600080611dda86611ec8565b9050611de881868686611efa565b9695505050505050565b6000808211611e5d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f554e444546494e454400000000000000000000000000000000000000000000006044820152606401610550565b5060016fffffffffffffffffffffffffffffffff821160071b82811c67ffffffffffffffff1060061b1782811c63ffffffff1060051b1782811c61ffff1060041b1782811c60ff10600390811b90911783811c600f1060021b1783811c909110821b1791821c111790565b60608180519060200120604051602001611ee491815260200190565b6040516020818303038152906040529050919050565b6000806000611f0a878686611f37565b91509150818015611f2c57508051602080830191909120875191880191909120145b979650505050505050565b600060606000611f468561202c565b90506000806000611f58848a89612127565b81519295509093509150158080611f6c5750815b611fd2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f50726f76696465642070726f6f6620697320696e76616c69642e0000000000006044820152606401610550565b600081611fee576040518060200160405280600081525061201a565b61201a86611ffd6001886136f1565b8151811061200d5761200d613b82565b6020026020010151612643565b919b919a509098505050505050505050565b606060006120398361266d565b90506000815167ffffffffffffffff81111561205757612057613358565b60405190808252806020026020018201604052801561209c57816020015b60408051808201909152606080825260208201528152602001906001900390816120755790505b50905060005b825181101561211f5760006120cf8483815181106120c2576120c2613b82565b60200260200101516126a0565b905060405180604001604052808281526020016120eb8361266d565b81525083838151811061210057612100613b82565b602002602001018190525050808061211790613af2565b9150506120a2565b509392505050565b600060608180806121378761274a565b9050600086905060008061215e604051806040016040528060608152602001606081525090565b60005b8c518110156125ff578c818151811061217c5761217c613b82565b6020026020010151915082846121929190613a74565b935061219f600188613a74565b96508361221d57815180516020909101208514612218576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f496e76616c696420726f6f7420686173680000000000000000000000000000006044820152606401610550565b61230d565b81515160201161229957815180516020909101208514612218576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f496e76616c6964206c6172676520696e7465726e616c206861736800000000006044820152606401610550565b815185906122a690613bb1565b1461230d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f496e76616c696420696e7465726e616c206e6f646520686173680000000000006044820152606401610550565b61231960106001613a74565b8260200151511415612392578551841415612333576125ff565b600086858151811061234757612347613b82565b602001015160f81c60f81b60f81c9050600083602001518260ff168151811061237257612372613b82565b60200260200101519050612385816128cd565b96506001945050506125ed565b6002826020015151141561258b5760006123ab83612903565b90506000816000815181106123c2576123c2613b82565b016020015160f81c905060006123d9600283613bf6565b6123e4906002613c18565b905060006123f5848360ff16612927565b905060006124038b8a612927565b90506000612411838361295d565b905060ff851660021480612428575060ff85166003145b1561247e5780835114801561243d5750808251145b1561244f5761244c818b613a74565b99505b507f800000000000000000000000000000000000000000000000000000000000000099506125ff945050505050565b60ff85161580612491575060ff85166001145b1561250357825181146124cd57507f800000000000000000000000000000000000000000000000000000000000000099506125ff945050505050565b6124f488602001516001815181106124e7576124e7613b82565b60200260200101516128cd565b9a5097506125ed945050505050565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f52656365697665642061206e6f6465207769746820616e20756e6b6e6f776e2060448201527f70726566697800000000000000000000000000000000000000000000000000006064820152608401610550565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f526563656976656420616e20756e706172736561626c65206e6f64652e0000006044820152606401610550565b806125f781613af2565b915050612161565b507f800000000000000000000000000000000000000000000000000000000000000084148661262e8786612927565b909e909d50909b509950505050505050505050565b6020810151805160609161146a9161265d906001906136f1565b815181106120c2576120c2613b82565b60408051808201825260008082526020918201528151808301909252825182528083019082015260609061146a90612a09565b606060008060006126b085612c3c565b9194509250905060008160018111156126cb576126cb613c3b565b14612732576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f496e76616c696420524c502062797465732076616c75652e00000000000000006044820152606401610550565b61274185602001518484613043565b95945050505050565b606060008251600261275c9190613943565b67ffffffffffffffff81111561277457612774613358565b6040519080825280601f01601f19166020018201604052801561279e576020820181803683370190505b50905060005b83518110156128c65760048482815181106127c1576127c1613b82565b01602001517fff0000000000000000000000000000000000000000000000000000000000000016901c826127f6836002613943565b8151811061280657612806613b82565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350601084828151811061284957612849613b82565b016020015161285b919060f81c613bf6565b60f81b8261286a836002613943565b612875906001613a74565b8151811061288557612885613b82565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350806128be81613af2565b9150506127a4565b5092915050565b600060606020836000015110156128ee576128e783613122565b90506128fa565b6128f7836126a0565b90505b6118b981613bb1565b606061146a61292283602001516000815181106120c2576120c2613b82565b61274a565b606082518210612946575060408051602081019091526000815261146a565b611467838384865161295891906136f1565b61312d565b6000805b8084511180156129715750808351115b80156129f2575082818151811061298a5761298a613b82565b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168482815181106129c9576129c9613b82565b01602001517fff0000000000000000000000000000000000000000000000000000000000000016145b156114675780612a0181613af2565b915050612961565b6060600080612a1784612c3c565b91935090915060019050816001811115612a3357612a33613c3b565b14612a9a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f496e76616c696420524c50206c6973742076616c75652e0000000000000000006044820152606401610550565b6040805160208082526104208201909252600091816020015b6040805180820190915260008082526020820152815260200190600190039081612ab35790505090506000835b8651811015612c315760208210612b79576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f50726f766964656420524c50206c6973742065786365656473206d6178206c6960448201527f7374206c656e6774682e000000000000000000000000000000000000000000006064820152608401610550565b600080612bb66040518060400160405280858c60000151612b9a91906136f1565b8152602001858c60200151612baf9190613a74565b9052612c3c565b509150915060405180604001604052808383612bd29190613a74565b8152602001848b60200151612be79190613a74565b815250858581518110612bfc57612bfc613b82565b6020908102919091010152612c12600185613a74565b9350612c1e8183613a74565b612c289084613a74565b92505050612ae0565b508152949350505050565b600080600080846000015111612cae576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f524c50206974656d2063616e6e6f74206265206e756c6c2e00000000000000006044820152606401610550565b6020840151805160001a607f8111612cd357600060016000945094509450505061303c565b60b78111612d69576000612ce86080836136f1565b905080876000015111612d57576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f496e76616c696420524c502073686f727420737472696e672e000000000000006044820152606401610550565b6001955093506000925061303c915050565b60bf8111612e8c576000612d7e60b7836136f1565b905080876000015111612ded576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f496e76616c696420524c50206c6f6e6720737472696e67206c656e6774682e006044820152606401610550565b600183015160208290036101000a9004612e078183613a74565b885111612e70576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f496e76616c696420524c50206c6f6e6720737472696e672e00000000000000006044820152606401610550565b612e7b826001613a74565b965094506000935061303c92505050565b60f78111612f21576000612ea160c0836136f1565b905080876000015111612f10576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f496e76616c696420524c502073686f7274206c6973742e0000000000000000006044820152606401610550565b60019550935084925061303c915050565b6000612f2e60f7836136f1565b905080876000015111612f9d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f496e76616c696420524c50206c6f6e67206c697374206c656e6774682e0000006044820152606401610550565b600183015160208290036101000a9004612fb78183613a74565b885111613020576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f496e76616c696420524c50206c6f6e67206c6973742e000000000000000000006044820152606401610550565b61302b826001613a74565b965094506001935061303c92505050565b9193909250565b606060008267ffffffffffffffff81111561306057613060613358565b6040519080825280601f01601f19166020018201604052801561308a576020820181803683370190505b50905080516000141561309e5790506118b9565b60006130aa8587613a74565b90506020820160005b6130be6020876139e4565b8110156130f557825182526130d4602084613a74565b92506130e1602083613a74565b9150806130ed81613af2565b9150506130b3565b5060006001602087066020036101000a039050808251168119845116178252839450505050509392505050565b606061146a82613305565b60608182601f01101561319c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f736c6963655f6f766572666c6f770000000000000000000000000000000000006044820152606401610550565b828284011015613208576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f736c6963655f6f766572666c6f770000000000000000000000000000000000006044820152606401610550565b81830184511015613275576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f736c6963655f6f75744f66426f756e64730000000000000000000000000000006044820152606401610550565b60608215801561329457604051915060008252602082016040526132fc565b6040519150601f8416801560200281840101858101878315602002848b0101015b818310156132cd5780518352602092830192016132b5565b5050858452601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016604052505b50949350505050565b606061146a826020015160008460000151613043565b60006020828403121561332d57600080fd5b5035919050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461167457600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156133ce576133ce613358565b604052919050565b600080600080600060a086880312156133ee57600080fd5b6133f786613334565b94506020808701359450604087013567ffffffffffffffff808216821461341d57600080fd5b909450606088013590811515821461343457600080fd5b9093506080880135908082111561344a57600080fd5b818901915089601f83011261345e57600080fd5b81358181111561347057613470613358565b6134a0847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601613387565b91508082528a848285010111156134b657600080fd5b80848401858401376000848284010152508093505050509295509295909350565b60008083601f8401126134e957600080fd5b50813567ffffffffffffffff81111561350157600080fd5b60208301915083602082850101111561351957600080fd5b9250929050565b60008060008060008060008060008060006101808c8e03121561354257600080fd5b8b359a5061355260208d01613334565b995061356060408d01613334565b985060608c0135975060808c0135965067ffffffffffffffff60a08d0135111561358957600080fd5b6135998d60a08e01358e016134d7565b909650945060c08c0135935060808c8e037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff200112156135d757600080fd5b60e08c01925067ffffffffffffffff6101608d013511156135f757600080fd5b6136088d6101608e01358e016134d7565b81935080925050509295989b509295989b9093969950565b6000815180845260005b818110156136465760208185018101518683018201520161362a565b81811115613658576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b85815284602082015267ffffffffffffffff84166040820152821515606082015260a060808201526000611f2c60a0830184613620565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082821015613703576137036136c2565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60008261374657613746613708565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83147f80000000000000000000000000000000000000000000000000000000000000008314161561379a5761379a6136c2565b500590565b6000808312837f8000000000000000000000000000000000000000000000000000000000000000018312811516156137d9576137d96136c2565b837f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01831381161561380d5761380d6136c2565b50500390565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600084136000841385830485118282161615613854576138546136c2565b7f8000000000000000000000000000000000000000000000000000000000000000600087128682058812818416161561388f5761388f6136c2565b600087129250878205871284841616156138ab576138ab6136c2565b878505871281841616156138c1576138c16136c2565b505050929093029392505050565b6000808212827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03841381151615613909576139096136c2565b827f800000000000000000000000000000000000000000000000000000000000000003841281161561393d5761393d6136c2565b50500190565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561397b5761397b6136c2565b500290565b600067ffffffffffffffff8083168185168083038211156139a3576139a36136c2565b01949350505050565b60006fffffffffffffffffffffffffffffffff808316818516818304811182151516156139db576139db6136c2565b02949350505050565b6000826139f3576139f3613708565b500490565b600060408284031215613a0a57600080fd5b6040516040810181811067ffffffffffffffff82111715613a2d57613a2d613358565b604052825181526020928301519281019290925250919050565b600060208284031215613a5957600080fd5b5051919050565b600082613a6f57613a6f613708565b500690565b60008219821115613a8757613a876136c2565b500190565b600060808284031215613a9e57600080fd5b6040516080810181811067ffffffffffffffff82111715613ac157613ac1613358565b8060405250823581526020830135602082015260408301356040820152606083013560608201528091505092915050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613b2457613b246136c2565b5060010190565b868152600073ffffffffffffffffffffffffffffffffffffffff808816602084015280871660408401525084606083015283608083015260c060a0830152613b7660c0830184613620565b98975050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b80516020808301519190811015613bf0577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8160200360031b1b821691505b50919050565b600060ff831680613c0957613c09613708565b8060ff84160691505092915050565b600060ff821660ff841680821015613c3257613c326136c2565b90039392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fdfea164736f6c634300080a000a496e697469616c697a61626c653a20636f6e747261637420697320616c726561", + ABI: "[{\"inputs\":[{\"internalType\":\"contractL2OutputOracle\",\"name\":\"_l2Oracle\",\"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\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"version\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"opaqueData\",\"type\":\"bytes\"}],\"name\":\"TransactionDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"withdrawalHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"name\":\"WithdrawalFinalized\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"BASE_FEE_MAX_CHANGE_DENOMINATOR\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ELASTICITY_MULTIPLIER\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"FINALIZATION_PERIOD_SECONDS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"INITIAL_BASE_FEE\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"L2_ORACLE\",\"outputs\":[{\"internalType\":\"contractL2OutputOracle\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_RESOURCE_LIMIT\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MINIMUM_BASE_FEE\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"TARGET_RESOURCE_LIMIT\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_value\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"_gasLimit\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"_isCreation\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"depositTransaction\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"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\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"internalType\":\"structTypes.WithdrawalTransaction\",\"name\":\"_tx\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"_l2BlockNumber\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"version\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"stateRoot\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"withdrawerStorageRoot\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"latestBlockhash\",\"type\":\"bytes32\"}],\"internalType\":\"structTypes.OutputRootProof\",\"name\":\"_outputRootProof\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"_withdrawalProof\",\"type\":\"bytes\"}],\"name\":\"finalizeWithdrawalTransaction\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"finalizedWithdrawals\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_l2BlockNumber\",\"type\":\"uint256\"}],\"name\":\"isBlockFinalized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l2Sender\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"params\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"prevBaseFee\",\"type\":\"uint128\"},{\"internalType\":\"uint64\",\"name\":\"prevBoughtGas\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"prevBlockNum\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", + Bin: "0x6101206040523480156200001257600080fd5b5060405162004130380380620041308339810160408190526200003591620002bc565b6000608081905260a052600160c0526001600160a01b0382166101005260e08190526200006162000069565b5050620002f8565b6000620000776001620000f8565b9050801562000090576000805461ff0019166101001790555b603380546001600160a01b03191661dead179055620000ae6200020a565b8015620000f5576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b60008054610100900460ff161562000191578160ff1660011480156200013157506200012f30620002ad60201b6200119b1760201c565b155b620001895760405162461bcd60e51b815260206004820152602e60248201526000805160206200411083398151915260448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b506000919050565b60005460ff808416911610620001f05760405162461bcd60e51b815260206004820152602e60248201526000805160206200411083398151915260448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840162000180565b506000805460ff191660ff92909216919091179055600190565b600054610100900460ff16620002775760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840162000180565b60408051606081018252633b9aca0080825260006020830152436001600160401b031691909201819052600160c01b0217600155565b6001600160a01b03163b151590565b60008060408385031215620002d057600080fd5b82516001600160a01b0381168114620002e857600080fd5b6020939093015192949293505050565b60805160a05160c05160e05161010051613dbe620003526000396000818161013401528181610a860152610cad0152600081816103bd01526115ff01526000610918015260006108ef015260006108c60152613dbe6000f3fe6080604052600436106100f65760003560e01c8063a14238e71161008a578063cff0ab9611610059578063cff0ab96146102f7578063e9e05c4214610398578063f4daa291146103ab578063fdc9fe1d146103df57600080fd5b8063a14238e71461026d578063c4fc4798146102ad578063ca3e99ba146102cd578063cd7c9789146102e257600080fd5b80636bb0291e116100c65780636bb0291e146102005780638129fc1c14610215578063867ead131461022a5780639bf62d821461024057600080fd5b80621c2ff61461012257806313620abd1461018057806354fd4d50146101b957806364b79208146101db57600080fd5b3661011d5761011b3334620186a06000604051806020016040528060008152506103f2565b005b600080fd5b34801561012e57600080fd5b506101567f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b34801561018c57600080fd5b50610198633b9aca0081565b6040516fffffffffffffffffffffffffffffffff9091168152602001610177565b3480156101c557600080fd5b506101ce6108bf565b6040516101779190613416565b3480156101e757600080fd5b506101f2627a120081565b604051908152602001610177565b34801561020c57600080fd5b506101f2600481565b34801561022157600080fd5b5061011b610962565b34801561023657600080fd5b506101f261271081565b34801561024c57600080fd5b506033546101569073ffffffffffffffffffffffffffffffffffffffff1681565b34801561027957600080fd5b5061029d610288366004613429565b60346020526000908152604090205460ff1681565b6040519015158152602001610177565b3480156102b957600080fd5b5061029d6102c8366004613429565b610a3d565b3480156102d957600080fd5b506101f2610b02565b3480156102ee57600080fd5b506101f2600881565b34801561030357600080fd5b5060015461035f906fffffffffffffffffffffffffffffffff81169067ffffffffffffffff7001000000000000000000000000000000008204811691780100000000000000000000000000000000000000000000000090041683565b604080516fffffffffffffffffffffffffffffffff909416845267ffffffffffffffff9283166020850152911690820152606001610177565b61011b6103a6366004613569565b6103f2565b3480156103b757600080fd5b506101f27f000000000000000000000000000000000000000000000000000000000000000081565b61011b6103ed366004613657565b610b13565b8260005a905083156104a95773ffffffffffffffffffffffffffffffffffffffff8716156104a957604080517f08c379a00000000000000000000000000000000000000000000000000000000081526020600482015260248101919091527f4f7074696d69736d506f7274616c3a206d7573742073656e6420746f2061646460448201527f72657373283029207768656e206372656174696e67206120636f6e747261637460648201526084015b60405180910390fd5b333281146104ca575033731111000000000000000000000000000000001111015b600034888888886040516020016104e595949392919061374b565b604051602081830303815290604052905060008973ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fb3813568d9991fc951961fcb4c784893574240a28925604d09fc577c55bb7c32846040516105559190613416565b60405180910390a45050600154600090610595907801000000000000000000000000000000000000000000000000900467ffffffffffffffff16436137df565b9050801561071e5760006105ad6004627a1200613825565b6001546105d89190700100000000000000000000000000000000900467ffffffffffffffff1661388d565b9050600060086105ec6004627a1200613825565b60015461060c9085906fffffffffffffffffffffffffffffffff16613901565b6106169190613825565b6106209190613825565b60015490915060009061066c906106569061064e9085906fffffffffffffffffffffffffffffffff166139bd565b6127106111b7565b6fffffffffffffffffffffffffffffffff6111d2565b905060018411156106df576106dc610656670de0b6b3a76400006106c8610694600883613825565b6106a690670de0b6b3a764000061388d565b6106b160018a6137df565b6106c390670de0b6b3a7640000613a31565b6111e1565b6106d29085613901565b61064e9190613825565b90505b6fffffffffffffffffffffffffffffffff16780100000000000000000000000000000000000000000000000067ffffffffffffffff4316021760015550505b60018054849190601090610751908490700100000000000000000000000000000000900467ffffffffffffffff16613a6e565b92506101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550627a1200600160000160109054906101000a900467ffffffffffffffff1667ffffffffffffffff16131561082d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603e60248201527f5265736f757263654d65746572696e673a2063616e6e6f7420627579206d6f7260448201527f6520676173207468616e20617661696c61626c6520676173206c696d6974000060648201526084016104a0565b600154600090610859906fffffffffffffffffffffffffffffffff1667ffffffffffffffff8616613a9a565b6fffffffffffffffffffffffffffffffff169050600061087d48633b9aca00611212565b6108879083613ad2565b905060005a61089690866137df565b9050808211156108b2576108b26108ad82846137df565b611222565b5050505050505050505050565b60606108ea7f0000000000000000000000000000000000000000000000000000000000000000611250565b6109137f0000000000000000000000000000000000000000000000000000000000000000611250565b61093c7f0000000000000000000000000000000000000000000000000000000000000000611250565b60405160200161094e93929190613ae6565b604051602081830303815290604052905090565b600061096e600161138d565b905080156109a357600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b603380547fffffffffffffffffffffffff00000000000000000000000000000000000000001661dead1790556109d7611518565b8015610a3a57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b6040517fa25ae55700000000000000000000000000000000000000000000000000000000815260048101829052600090819073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063a25ae557906024016040805180830381865afa158015610acc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610af09190613b5c565b9050610afb816115fb565b9392505050565b610b106004627a1200613825565b81565b60335473ffffffffffffffffffffffffffffffffffffffff1661dead14610bbc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f4f7074696d69736d506f7274616c3a2063616e206f6e6c79207472696767657260448201527f206f6e65207769746864726177616c20706572207472616e73616374696f6e0060648201526084016104a0565b3073ffffffffffffffffffffffffffffffffffffffff16856040015173ffffffffffffffffffffffffffffffffffffffff1603610c7b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f4f7074696d69736d506f7274616c3a20796f752063616e6e6f742073656e642060448201527f6d6573736167657320746f2074686520706f7274616c20636f6e74726163740060648201526084016104a0565b6040517fa25ae557000000000000000000000000000000000000000000000000000000008152600481018590526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063a25ae557906024016040805180830381865afa158015610d08573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2c9190613b5c565b9050610d37816115fb565b610dc3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f4f7074696d69736d506f7274616c3a2070726f706f73616c206973206e6f742060448201527f7965742066696e616c697a65640000000000000000000000000000000000000060648201526084016104a0565b610dda610dd536869003860186613bab565b611635565b815114610e69576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4f7074696d69736d506f7274616c3a20696e76616c6964206f7574707574207260448201527f6f6f742070726f6f66000000000000000000000000000000000000000000000060648201526084016104a0565b6000610e7487611691565b9050610ebb81866040013586868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506116c192505050565b610f47576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4f7074696d69736d506f7274616c3a20696e76616c696420776974686472617760448201527f616c20696e636c7573696f6e2070726f6f66000000000000000000000000000060648201526084016104a0565b60008181526034602052604090205460ff1615610fe6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603560248201527f4f7074696d69736d506f7274616c3a207769746864726177616c20686173206160448201527f6c7265616479206265656e2066696e616c697a6564000000000000000000000060648201526084016104a0565b600081815260346020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055608087015161102f90614e2090613c11565b5a10156110be576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f4f7074696d69736d506f7274616c3a20696e73756666696369656e742067617360448201527f20746f2066696e616c697a65207769746864726177616c00000000000000000060648201526084016104a0565b8660200151603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000611123886040015189608001518a6060015160008c60a00151611788565b50603380547fffffffffffffffffffffffff00000000000000000000000000000000000000001661dead17905560405190915082907fdb5c7652857aa163daadd670e116628fb42e869d8ac4251ef8971d9e5727df1b9061118990841515815260200190565b60405180910390a25050505050505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b6000818312156111c757816111c9565b825b90505b92915050565b60008183126111c757816111c9565b60006111c9670de0b6b3a7640000836111f986611813565b6112039190613901565b61120d9190613825565b611a57565b6000818310156111c757816111c9565b6000805a90505b825a61123590836137df565b101561124b5761124482613c29565b9150611229565b505050565b60608160000361129357505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b81156112bd57806112a781613c29565b91506112b69050600a83613ad2565b9150611297565b60008167ffffffffffffffff8111156112d8576112d8613466565b6040519080825280601f01601f191660200182016040528015611302576020820181803683370190505b5090505b8415611385576113176001836137df565b9150611324600a86613c61565b61132f906030613c11565b60f81b81838151811061134457611344613c75565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535061137e600a86613ad2565b9450611306565b949350505050565b60008054610100900460ff1615611444578160ff1660011480156113b05750303b155b61143c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016104a0565b506000919050565b60005460ff8084169116106114db576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016104a0565b50600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff92909216919091179055600190565b919050565b600054610100900460ff166115af576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016104a0565b60408051606081018252633b9aca00808252600060208301524367ffffffffffffffff169190920181905278010000000000000000000000000000000000000000000000000217600155565b60007f0000000000000000000000000000000000000000000000000000000000000000826020015161162d9190613c11565b421192915050565b60008160000151826020015183604001518460600151604051602001611674949392919093845260208401929092526040830152606082015260800190565b604051602081830303815290604052805190602001209050919050565b80516020808301516040808501516060860151608087015160a08801519351600097611674979096959101613ca4565b604080516020810185905260009181018290528190606001604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181528282528051602091820120908301819052925061177f9101604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152828201909152600182527f01000000000000000000000000000000000000000000000000000000000000006020830152908587611c96565b95945050505050565b6000606060008060008661ffff1667ffffffffffffffff8111156117ae576117ae613466565b6040519080825280601f01601f1916602001820160405280156117d8576020820181803683370190505b5090506000808751602089018b8e8ef191503d9250868311156117f9578692505b828152826000602083013e90999098509650505050505050565b600080821361187e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f554e444546494e4544000000000000000000000000000000000000000000000060448201526064016104a0565b6000606061188b84611cba565b03609f8181039490941b90931c6c465772b2bbbb5f824b15207a3081018102606090811d6d0388eaa27412d5aca026815d636e018202811d6d0df99ac502031bf953eff472fdcc018202811d6d13cdffb29d51d99322bdff5f2211018202811d6d0a0f742023def783a307a986912e018202811d6d01920d8043ca89b5239253284e42018202811d6c0b7a86d7375468fac667a0a527016c29508e458543d8aa4df2abee7883018302821d6d0139601a2efabe717e604cbb4894018302821d6d02247f7a7b6594320649aa03aba1018302821d7fffffffffffffffffffffffffffffffffffffff73c0c716a594e00d54e3c4cbc9018302821d7ffffffffffffffffffffffffffffffffffffffdc7b88c420e53a9890533129f6f01830290911d7fffffffffffffffffffffffffffffffffffffff465fda27eb4d63ded474e5f832019091027ffffffffffffffff5f6af8f7b3396644f18e157960000000000000000000000000105711340daa0d5f769dba1915cef59f0815a5506027d0267a36c0c95b3975ab3ee5b203a7614a3f75373f047d803ae7b6687f2b393909302929092017d57115e47018c7177eebf7cd370a3356a1b7863008a5ae8028c72b88642840160ae1d92915050565b60007ffffffffffffffffffffffffffffffffffffffffffffffffdb731c958f34d94c18213611a8857506000919050565b680755bf798b4a1bf1e58212611afa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f4558505f4f564552464c4f57000000000000000000000000000000000000000060448201526064016104a0565b6503782dace9d9604e83901b059150600060606bb17217f7d1cf79abc9e3b39884821b056b80000000000000000000000001901d6bb17217f7d1cf79abc9e3b39881029093037fffffffffffffffffffffffffffffffffffffffdbf3ccf1604d263450f02a550481018102606090811d6d0277594991cfc85f6e2461837cd9018202811d7fffffffffffffffffffffffffffffffffffffe5adedaa1cb095af9e4da10e363c018202811d6db1bbb201f443cf962f1a1d3db4a5018202811d7ffffffffffffffffffffffffffffffffffffd38dc772608b0ae56cce01296c0eb018202811d6e05180bb14799ab47a8a8cb2a527d57016d02d16720577bd19bf614176fe9ea6c10fe68e7fd37d0007b713f765084018402831d9081019084017ffffffffffffffffffffffffffffffffffffffe2c69812cf03b0763fd454a8f7e010290911d6e0587f503bb6ea29d25fcb7401964500190910279d835ebba824c98fb31b83b2ca45c000000000000000000000000010574029d9dc38563c32e5c2f6dc192ee70ef65f9978af30260c3939093039290921c92915050565b600080611ca286611d90565b9050611cb081868686611dc2565b9695505050505050565b6000808211611d25576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f554e444546494e4544000000000000000000000000000000000000000000000060448201526064016104a0565b5060016fffffffffffffffffffffffffffffffff821160071b82811c67ffffffffffffffff1060061b1782811c63ffffffff1060051b1782811c61ffff1060041b1782811c60ff10600390811b90911783811c600f1060021b1783811c909110821b1791821c111790565b60608180519060200120604051602001611dac91815260200190565b6040516020818303038152906040529050919050565b6000806000611dd2878686611dff565b91509150818015611df457508051602080830191909120875191880191909120145b979650505050505050565b600060606000611e0e85611f1a565b90506000806000611e20848a89612015565b81519295509093509150158080611e345750815b611ec0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f4d65726b6c65547269653a2070726f76696465642070726f6f6620697320696e60448201527f76616c696400000000000000000000000000000000000000000000000000000060648201526084016104a0565b600081611edc5760405180602001604052806000815250611f08565b611f0886611eeb6001886137df565b81518110611efb57611efb613c75565b602002602001015161259e565b919b919a509098505050505050505050565b60606000611f27836125c8565b90506000815167ffffffffffffffff811115611f4557611f45613466565b604051908082528060200260200182016040528015611f8a57816020015b6040805180820190915260608082526020820152815260200190600190039081611f635790505b50905060005b825181101561200d576000611fbd848381518110611fb057611fb0613c75565b60200260200101516125fb565b90506040518060400160405280828152602001611fd9836125c8565b815250838381518110611fee57611fee613c75565b602002602001018190525050808061200590613c29565b915050611f90565b509392505050565b60006060818080612025876126c2565b9050600086905060008061204c604051806040016040528060608152602001606081525090565b60005b8c5181101561255a578c818151811061206a5761206a613c75565b6020026020010151915082846120809190613c11565b935061208d600188613c11565b96508360000361210e57815180516020909101208514612109576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f4d65726b6c65547269653a20696e76616c696420726f6f74206861736800000060448201526064016104a0565b61224a565b8151516020116121b057815180516020909101208514612109576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f4d65726b6c65547269653a20696e76616c6964206c6172676520696e7465726e60448201527f616c20686173680000000000000000000000000000000000000000000000000060648201526084016104a0565b815185906121bd90613cfb565b1461224a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4d65726b6c65547269653a20696e76616c696420696e7465726e616c206e6f6460448201527f652068617368000000000000000000000000000000000000000000000000000060648201526084016104a0565b61225660106001613c11565b826020015151036122c8578551841461255a57600086858151811061227d5761227d613c75565b602001015160f81c60f81b60f81c9050600083602001518260ff16815181106122a8576122a8613c75565b602002602001015190506122bb81612845565b9650600194505050612548565b6002826020015151036124c05760006122e08361287b565b90506000816000815181106122f7576122f7613c75565b016020015160f81c9050600061230e600283613d3d565b612319906002613d5f565b9050600061232a848360ff1661289f565b905060006123388b8a61289f565b9050600061234683836128d5565b905060ff85166002148061235d575060ff85166003145b156123b3578083511480156123725750808251145b1561238457612381818b613c11565b99505b507f8000000000000000000000000000000000000000000000000000000000000000995061255a945050505050565b60ff851615806123c6575060ff85166001145b15612438578251811461240257507f8000000000000000000000000000000000000000000000000000000000000000995061255a945050505050565b612429886020015160018151811061241c5761241c613c75565b6020026020010151612845565b9a509750612548945050505050565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4d65726b6c65547269653a2072656365697665642061206e6f6465207769746860448201527f20616e20756e6b6e6f776e20707265666978000000000000000000000000000060648201526084016104a0565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f4d65726b6c65547269653a20726563656976656420616e20756e70617273656160448201527f626c65206e6f646500000000000000000000000000000000000000000000000060648201526084016104a0565b8061255281613c29565b91505061204f565b507f8000000000000000000000000000000000000000000000000000000000000000841486612589878661289f565b909e909d50909b509950505050505050505050565b602081015180516060916111cc916125b8906001906137df565b81518110611fb057611fb0613c75565b6040805180820182526000808252602091820152815180830190925282518252808301908201526060906111cc90612981565b6060600080600061260b85612bda565b91945092509050600081600181111561262657612626613d82565b146126b3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f524c505265616465723a20696e76616c696420524c502062797465732076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016104a0565b61177f856020015184846130c5565b60606000825160026126d49190613a31565b67ffffffffffffffff8111156126ec576126ec613466565b6040519080825280601f01601f191660200182016040528015612716576020820181803683370190505b50905060005b835181101561283e57600484828151811061273957612739613c75565b01602001517fff0000000000000000000000000000000000000000000000000000000000000016901c8261276e836002613a31565b8151811061277e5761277e613c75565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060108482815181106127c1576127c1613c75565b01602001516127d3919060f81c613d3d565b60f81b826127e2836002613a31565b6127ed906001613c11565b815181106127fd576127fd613c75565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508061283681613c29565b91505061271c565b5092915050565b600060606020836000015110156128665761285f836131a3565b9050612872565b61286f836125fb565b90505b610afb81613cfb565b60606111cc61289a8360200151600081518110611fb057611fb0613c75565b6126c2565b6060825182106128be57506040805160208101909152600081526111cc565b6111c983838486516128d091906137df565b6131ae565b6000805b8084511180156128e95750808351115b801561296a575082818151811061290257612902613c75565b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191684828151811061294157612941613c75565b01602001517fff0000000000000000000000000000000000000000000000000000000000000016145b156111c9578061297981613c29565b9150506128d9565b606060008061298f84612bda565b919350909150600190508160018111156129ab576129ab613d82565b14612a38576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f524c505265616465723a20696e76616c696420524c50206c6973742076616c7560448201527f650000000000000000000000000000000000000000000000000000000000000060648201526084016104a0565b6040805160208082526104208201909252600091816020015b6040805180820190915260008082526020820152815260200190600190039081612a515790505090506000835b8651811015612bcf5760208210612b17576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603460248201527f524c505265616465723a2070726f766964656420524c50206c6973742065786360448201527f65656473206d6178206c697374206c656e67746800000000000000000000000060648201526084016104a0565b600080612b546040518060400160405280858c60000151612b3891906137df565b8152602001858c60200151612b4d9190613c11565b9052612bda565b509150915060405180604001604052808383612b709190613c11565b8152602001848b60200151612b859190613c11565b815250858581518110612b9a57612b9a613c75565b6020908102919091010152612bb0600185613c11565b9350612bbc8183613c11565b612bc69084613c11565b92505050612a7e565b508152949350505050565b600080600080846000015111612c72576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f524c505265616465723a20524c50206974656d2063616e6e6f74206265206e7560448201527f6c6c00000000000000000000000000000000000000000000000000000000000060648201526084016104a0565b6020840151805160001a607f8111612c975760006001600094509450945050506130be565b60b78111612d53576000612cac6080836137df565b905080876000015111612d41576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f524c505265616465723a20696e76616c696420524c502073686f72742073747260448201527f696e67000000000000000000000000000000000000000000000000000000000060648201526084016104a0565b600195509350600092506130be915050565b60bf8111612ec2576000612d6860b7836137df565b905080876000015111612dfd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f524c505265616465723a20696e76616c696420524c50206c6f6e67207374726960448201527f6e67206c656e677468000000000000000000000000000000000000000000000060648201526084016104a0565b600183015160208290036101000a9004612e178183613c11565b885111612ea6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f524c505265616465723a20696e76616c696420524c50206c6f6e67207374726960448201527f6e6700000000000000000000000000000000000000000000000000000000000060648201526084016104a0565b612eb1826001613c11565b96509450600093506130be92505050565b60f78111612f7d576000612ed760c0836137df565b905080876000015111612f6c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f524c505265616465723a20696e76616c696420524c502073686f7274206c697360448201527f740000000000000000000000000000000000000000000000000000000000000060648201526084016104a0565b6001955093508492506130be915050565b6000612f8a60f7836137df565b90508087600001511161301f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f524c505265616465723a20696e76616c696420524c50206c6f6e67206c69737460448201527f206c656e6774680000000000000000000000000000000000000000000000000060648201526084016104a0565b600183015160208290036101000a90046130398183613c11565b8851116130a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f524c505265616465723a20696e76616c696420524c50206c6f6e67206c69737460448201526064016104a0565b6130ad826001613c11565b96509450600193506130be92505050565b9193909250565b606060008267ffffffffffffffff8111156130e2576130e2613466565b6040519080825280601f01601f19166020018201604052801561310c576020820181803683370190505b509050805160000361311f579050610afb565b600061312b8587613c11565b90506020820160005b61313f602087613ad2565b8110156131765782518252613155602084613c11565b9250613162602083613c11565b91508061316e81613c29565b915050613134565b5060006001602087066020036101000a039050808251168119845116178252839450505050509392505050565b60606111cc82613386565b60608182601f01101561321d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f736c6963655f6f766572666c6f7700000000000000000000000000000000000060448201526064016104a0565b828284011015613289576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f736c6963655f6f766572666c6f7700000000000000000000000000000000000060448201526064016104a0565b818301845110156132f6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f736c6963655f6f75744f66426f756e647300000000000000000000000000000060448201526064016104a0565b606082158015613315576040519150600082526020820160405261337d565b6040519150601f8416801560200281840101858101878315602002848b0101015b8183101561334e578051835260209283019201613336565b5050858452601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016604052505b50949350505050565b60606111cc8260200151600084600001516130c5565b60005b838110156133b757818101518382015260200161339f565b838111156133c6576000848401525b50505050565b600081518084526133e481602086016020860161339c565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006111c960208301846133cc565b60006020828403121561343b57600080fd5b5035919050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461151357600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405160c0810167ffffffffffffffff811182821017156134b8576134b8613466565b60405290565b600082601f8301126134cf57600080fd5b813567ffffffffffffffff808211156134ea576134ea613466565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190828211818310171561353057613530613466565b8160405283815286602085880101111561354957600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080600080600060a0868803121561358157600080fd5b61358a86613442565b945060208601359350604086013567ffffffffffffffff80821682146135af57600080fd5b90935060608701359081151582146135c657600080fd5b909250608087013590808211156135dc57600080fd5b506135e9888289016134be565b9150509295509295909350565b60006080828403121561360857600080fd5b50919050565b60008083601f84011261362057600080fd5b50813567ffffffffffffffff81111561363857600080fd5b60208301915083602082850101111561365057600080fd5b9250929050565b600080600080600060e0868803121561366f57600080fd5b853567ffffffffffffffff8082111561368757600080fd5b9087019060c0828a03121561369b57600080fd5b6136a3613495565b823581526136b360208401613442565b60208201526136c460408401613442565b6040820152606083013560608201526080830135608082015260a0830135828111156136ef57600080fd5b6136fb8b8286016134be565b60a0830152509650602088013595506137178960408a016135f6565b945060c088013591508082111561372d57600080fd5b5061373a8882890161360e565b969995985093965092949392505050565b8581528460208201527fffffffffffffffff0000000000000000000000000000000000000000000000008460c01b16604082015282151560f81b60488201526000825161379f81604985016020870161339c565b919091016049019695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000828210156137f1576137f16137b0565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082613834576138346137f6565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83147f800000000000000000000000000000000000000000000000000000000000000083141615613888576138886137b0565b500590565b6000808312837f8000000000000000000000000000000000000000000000000000000000000000018312811516156138c7576138c76137b0565b837f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0183138116156138fb576138fb6137b0565b50500390565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600084136000841385830485118282161615613942576139426137b0565b7f8000000000000000000000000000000000000000000000000000000000000000600087128682058812818416161561397d5761397d6137b0565b60008712925087820587128484161615613999576139996137b0565b878505871281841616156139af576139af6137b0565b505050929093029392505050565b6000808212827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038413811516156139f7576139f76137b0565b827f8000000000000000000000000000000000000000000000000000000000000000038412811615613a2b57613a2b6137b0565b50500190565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613a6957613a696137b0565b500290565b600067ffffffffffffffff808316818516808303821115613a9157613a916137b0565b01949350505050565b60006fffffffffffffffffffffffffffffffff80831681851681830481118215151615613ac957613ac96137b0565b02949350505050565b600082613ae157613ae16137f6565b500490565b60008451613af881846020890161339c565b80830190507f2e000000000000000000000000000000000000000000000000000000000000008082528551613b34816001850160208a0161339c565b60019201918201528351613b4f81600284016020880161339c565b0160020195945050505050565b600060408284031215613b6e57600080fd5b6040516040810181811067ffffffffffffffff82111715613b9157613b91613466565b604052825181526020928301519281019290925250919050565b600060808284031215613bbd57600080fd5b6040516080810181811067ffffffffffffffff82111715613be057613be0613466565b8060405250823581526020830135602082015260408301356040820152606083013560608201528091505092915050565b60008219821115613c2457613c246137b0565b500190565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203613c5a57613c5a6137b0565b5060010190565b600082613c7057613c706137f6565b500690565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b868152600073ffffffffffffffffffffffffffffffffffffffff808816602084015280871660408401525084606083015283608083015260c060a0830152613cef60c08301846133cc565b98975050505050505050565b80516020808301519190811015613608577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60209190910360031b1b16919050565b600060ff831680613d5057613d506137f6565b8060ff84160691505092915050565b600060ff821660ff841680821015613d7957613d796137b0565b90039392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fdfea164736f6c634300080f000a496e697469616c697a61626c653a20636f6e747261637420697320616c726561", } // OptimismPortalABI is the input ABI used to generate the binding from. @@ -364,37 +374,6 @@ func (_OptimismPortal *OptimismPortalCallerSession) L2ORACLE() (common.Address, return _OptimismPortal.Contract.L2ORACLE(&_OptimismPortal.CallOpts) } -// MAJORVERSION is a free data retrieval call binding the contract method 0xf786becd. -// -// Solidity: function MAJOR_VERSION() view returns(uint256) -func (_OptimismPortal *OptimismPortalCaller) MAJORVERSION(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _OptimismPortal.contract.Call(opts, &out, "MAJOR_VERSION") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// MAJORVERSION is a free data retrieval call binding the contract method 0xf786becd. -// -// Solidity: function MAJOR_VERSION() view returns(uint256) -func (_OptimismPortal *OptimismPortalSession) MAJORVERSION() (*big.Int, error) { - return _OptimismPortal.Contract.MAJORVERSION(&_OptimismPortal.CallOpts) -} - -// MAJORVERSION is a free data retrieval call binding the contract method 0xf786becd. -// -// Solidity: function MAJOR_VERSION() view returns(uint256) -func (_OptimismPortal *OptimismPortalCallerSession) MAJORVERSION() (*big.Int, error) { - return _OptimismPortal.Contract.MAJORVERSION(&_OptimismPortal.CallOpts) -} - // MAXRESOURCELIMIT is a free data retrieval call binding the contract method 0x64b79208. // // Solidity: function MAX_RESOURCE_LIMIT() view returns(int256) @@ -457,68 +436,6 @@ func (_OptimismPortal *OptimismPortalCallerSession) MINIMUMBASEFEE() (*big.Int, return _OptimismPortal.Contract.MINIMUMBASEFEE(&_OptimismPortal.CallOpts) } -// MINORVERSION is a free data retrieval call binding the contract method 0xc8b91531. -// -// Solidity: function MINOR_VERSION() view returns(uint256) -func (_OptimismPortal *OptimismPortalCaller) MINORVERSION(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _OptimismPortal.contract.Call(opts, &out, "MINOR_VERSION") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// MINORVERSION is a free data retrieval call binding the contract method 0xc8b91531. -// -// Solidity: function MINOR_VERSION() view returns(uint256) -func (_OptimismPortal *OptimismPortalSession) MINORVERSION() (*big.Int, error) { - return _OptimismPortal.Contract.MINORVERSION(&_OptimismPortal.CallOpts) -} - -// MINORVERSION is a free data retrieval call binding the contract method 0xc8b91531. -// -// Solidity: function MINOR_VERSION() view returns(uint256) -func (_OptimismPortal *OptimismPortalCallerSession) MINORVERSION() (*big.Int, error) { - return _OptimismPortal.Contract.MINORVERSION(&_OptimismPortal.CallOpts) -} - -// PATCHVERSION is a free data retrieval call binding the contract method 0x6bf2606a. -// -// Solidity: function PATCH_VERSION() view returns(uint256) -func (_OptimismPortal *OptimismPortalCaller) PATCHVERSION(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _OptimismPortal.contract.Call(opts, &out, "PATCH_VERSION") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// PATCHVERSION is a free data retrieval call binding the contract method 0x6bf2606a. -// -// Solidity: function PATCH_VERSION() view returns(uint256) -func (_OptimismPortal *OptimismPortalSession) PATCHVERSION() (*big.Int, error) { - return _OptimismPortal.Contract.PATCHVERSION(&_OptimismPortal.CallOpts) -} - -// PATCHVERSION is a free data retrieval call binding the contract method 0x6bf2606a. -// -// Solidity: function PATCH_VERSION() view returns(uint256) -func (_OptimismPortal *OptimismPortalCallerSession) PATCHVERSION() (*big.Int, error) { - return _OptimismPortal.Contract.PATCHVERSION(&_OptimismPortal.CallOpts) -} - // TARGETRESOURCELIMIT is a free data retrieval call binding the contract method 0xca3e99ba. // // Solidity: function TARGET_RESOURCE_LIMIT() view returns(int256) @@ -581,12 +498,12 @@ func (_OptimismPortal *OptimismPortalCallerSession) FinalizedWithdrawals(arg0 [3 return _OptimismPortal.Contract.FinalizedWithdrawals(&_OptimismPortal.CallOpts, arg0) } -// IsOutputFinalized is a free data retrieval call binding the contract method 0x6dbffb78. +// IsBlockFinalized is a free data retrieval call binding the contract method 0xc4fc4798. // -// Solidity: function isOutputFinalized(uint256 _l2BlockNumber) view returns(bool) -func (_OptimismPortal *OptimismPortalCaller) IsOutputFinalized(opts *bind.CallOpts, _l2BlockNumber *big.Int) (bool, error) { +// Solidity: function isBlockFinalized(uint256 _l2BlockNumber) view returns(bool) +func (_OptimismPortal *OptimismPortalCaller) IsBlockFinalized(opts *bind.CallOpts, _l2BlockNumber *big.Int) (bool, error) { var out []interface{} - err := _OptimismPortal.contract.Call(opts, &out, "isOutputFinalized", _l2BlockNumber) + err := _OptimismPortal.contract.Call(opts, &out, "isBlockFinalized", _l2BlockNumber) if err != nil { return *new(bool), err @@ -598,18 +515,18 @@ func (_OptimismPortal *OptimismPortalCaller) IsOutputFinalized(opts *bind.CallOp } -// IsOutputFinalized is a free data retrieval call binding the contract method 0x6dbffb78. +// IsBlockFinalized is a free data retrieval call binding the contract method 0xc4fc4798. // -// Solidity: function isOutputFinalized(uint256 _l2BlockNumber) view returns(bool) -func (_OptimismPortal *OptimismPortalSession) IsOutputFinalized(_l2BlockNumber *big.Int) (bool, error) { - return _OptimismPortal.Contract.IsOutputFinalized(&_OptimismPortal.CallOpts, _l2BlockNumber) +// Solidity: function isBlockFinalized(uint256 _l2BlockNumber) view returns(bool) +func (_OptimismPortal *OptimismPortalSession) IsBlockFinalized(_l2BlockNumber *big.Int) (bool, error) { + return _OptimismPortal.Contract.IsBlockFinalized(&_OptimismPortal.CallOpts, _l2BlockNumber) } -// IsOutputFinalized is a free data retrieval call binding the contract method 0x6dbffb78. +// IsBlockFinalized is a free data retrieval call binding the contract method 0xc4fc4798. // -// Solidity: function isOutputFinalized(uint256 _l2BlockNumber) view returns(bool) -func (_OptimismPortal *OptimismPortalCallerSession) IsOutputFinalized(_l2BlockNumber *big.Int) (bool, error) { - return _OptimismPortal.Contract.IsOutputFinalized(&_OptimismPortal.CallOpts, _l2BlockNumber) +// Solidity: function isBlockFinalized(uint256 _l2BlockNumber) view returns(bool) +func (_OptimismPortal *OptimismPortalCallerSession) IsBlockFinalized(_l2BlockNumber *big.Int) (bool, error) { + return _OptimismPortal.Contract.IsBlockFinalized(&_OptimismPortal.CallOpts, _l2BlockNumber) } // L2Sender is a free data retrieval call binding the contract method 0x9bf62d82. @@ -693,6 +610,37 @@ func (_OptimismPortal *OptimismPortalCallerSession) Params() (struct { return _OptimismPortal.Contract.Params(&_OptimismPortal.CallOpts) } +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_OptimismPortal *OptimismPortalCaller) Version(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _OptimismPortal.contract.Call(opts, &out, "version") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_OptimismPortal *OptimismPortalSession) Version() (string, error) { + return _OptimismPortal.Contract.Version(&_OptimismPortal.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_OptimismPortal *OptimismPortalCallerSession) Version() (string, error) { + return _OptimismPortal.Contract.Version(&_OptimismPortal.CallOpts) +} + // DepositTransaction is a paid mutator transaction binding the contract method 0xe9e05c42. // // Solidity: function depositTransaction(address _to, uint256 _value, uint64 _gasLimit, bool _isCreation, bytes _data) payable returns() @@ -714,25 +662,25 @@ func (_OptimismPortal *OptimismPortalTransactorSession) DepositTransaction(_to c return _OptimismPortal.Contract.DepositTransaction(&_OptimismPortal.TransactOpts, _to, _value, _gasLimit, _isCreation, _data) } -// FinalizeWithdrawalTransaction is a paid mutator transaction binding the contract method 0xeecf1c36. +// FinalizeWithdrawalTransaction is a paid mutator transaction binding the contract method 0xfdc9fe1d. // -// Solidity: function finalizeWithdrawalTransaction(uint256 _nonce, address _sender, address _target, uint256 _value, uint256 _gasLimit, bytes _data, uint256 _l2BlockNumber, (bytes32,bytes32,bytes32,bytes32) _outputRootProof, bytes _withdrawalProof) payable returns() -func (_OptimismPortal *OptimismPortalTransactor) FinalizeWithdrawalTransaction(opts *bind.TransactOpts, _nonce *big.Int, _sender common.Address, _target common.Address, _value *big.Int, _gasLimit *big.Int, _data []byte, _l2BlockNumber *big.Int, _outputRootProof HashingOutputRootProof, _withdrawalProof []byte) (*types.Transaction, error) { - return _OptimismPortal.contract.Transact(opts, "finalizeWithdrawalTransaction", _nonce, _sender, _target, _value, _gasLimit, _data, _l2BlockNumber, _outputRootProof, _withdrawalProof) +// Solidity: function finalizeWithdrawalTransaction((uint256,address,address,uint256,uint256,bytes) _tx, uint256 _l2BlockNumber, (bytes32,bytes32,bytes32,bytes32) _outputRootProof, bytes _withdrawalProof) payable returns() +func (_OptimismPortal *OptimismPortalTransactor) FinalizeWithdrawalTransaction(opts *bind.TransactOpts, _tx TypesWithdrawalTransaction, _l2BlockNumber *big.Int, _outputRootProof TypesOutputRootProof, _withdrawalProof []byte) (*types.Transaction, error) { + return _OptimismPortal.contract.Transact(opts, "finalizeWithdrawalTransaction", _tx, _l2BlockNumber, _outputRootProof, _withdrawalProof) } -// FinalizeWithdrawalTransaction is a paid mutator transaction binding the contract method 0xeecf1c36. +// FinalizeWithdrawalTransaction is a paid mutator transaction binding the contract method 0xfdc9fe1d. // -// Solidity: function finalizeWithdrawalTransaction(uint256 _nonce, address _sender, address _target, uint256 _value, uint256 _gasLimit, bytes _data, uint256 _l2BlockNumber, (bytes32,bytes32,bytes32,bytes32) _outputRootProof, bytes _withdrawalProof) payable returns() -func (_OptimismPortal *OptimismPortalSession) FinalizeWithdrawalTransaction(_nonce *big.Int, _sender common.Address, _target common.Address, _value *big.Int, _gasLimit *big.Int, _data []byte, _l2BlockNumber *big.Int, _outputRootProof HashingOutputRootProof, _withdrawalProof []byte) (*types.Transaction, error) { - return _OptimismPortal.Contract.FinalizeWithdrawalTransaction(&_OptimismPortal.TransactOpts, _nonce, _sender, _target, _value, _gasLimit, _data, _l2BlockNumber, _outputRootProof, _withdrawalProof) +// Solidity: function finalizeWithdrawalTransaction((uint256,address,address,uint256,uint256,bytes) _tx, uint256 _l2BlockNumber, (bytes32,bytes32,bytes32,bytes32) _outputRootProof, bytes _withdrawalProof) payable returns() +func (_OptimismPortal *OptimismPortalSession) FinalizeWithdrawalTransaction(_tx TypesWithdrawalTransaction, _l2BlockNumber *big.Int, _outputRootProof TypesOutputRootProof, _withdrawalProof []byte) (*types.Transaction, error) { + return _OptimismPortal.Contract.FinalizeWithdrawalTransaction(&_OptimismPortal.TransactOpts, _tx, _l2BlockNumber, _outputRootProof, _withdrawalProof) } -// FinalizeWithdrawalTransaction is a paid mutator transaction binding the contract method 0xeecf1c36. +// FinalizeWithdrawalTransaction is a paid mutator transaction binding the contract method 0xfdc9fe1d. // -// Solidity: function finalizeWithdrawalTransaction(uint256 _nonce, address _sender, address _target, uint256 _value, uint256 _gasLimit, bytes _data, uint256 _l2BlockNumber, (bytes32,bytes32,bytes32,bytes32) _outputRootProof, bytes _withdrawalProof) payable returns() -func (_OptimismPortal *OptimismPortalTransactorSession) FinalizeWithdrawalTransaction(_nonce *big.Int, _sender common.Address, _target common.Address, _value *big.Int, _gasLimit *big.Int, _data []byte, _l2BlockNumber *big.Int, _outputRootProof HashingOutputRootProof, _withdrawalProof []byte) (*types.Transaction, error) { - return _OptimismPortal.Contract.FinalizeWithdrawalTransaction(&_OptimismPortal.TransactOpts, _nonce, _sender, _target, _value, _gasLimit, _data, _l2BlockNumber, _outputRootProof, _withdrawalProof) +// Solidity: function finalizeWithdrawalTransaction((uint256,address,address,uint256,uint256,bytes) _tx, uint256 _l2BlockNumber, (bytes32,bytes32,bytes32,bytes32) _outputRootProof, bytes _withdrawalProof) payable returns() +func (_OptimismPortal *OptimismPortalTransactorSession) FinalizeWithdrawalTransaction(_tx TypesWithdrawalTransaction, _l2BlockNumber *big.Int, _outputRootProof TypesOutputRootProof, _withdrawalProof []byte) (*types.Transaction, error) { + return _OptimismPortal.Contract.FinalizeWithdrawalTransaction(&_OptimismPortal.TransactOpts, _tx, _l2BlockNumber, _outputRootProof, _withdrawalProof) } // Initialize is a paid mutator transaction binding the contract method 0x8129fc1c. @@ -982,18 +930,15 @@ func (it *OptimismPortalTransactionDepositedIterator) Close() error { type OptimismPortalTransactionDeposited struct { From common.Address To common.Address - Mint *big.Int - Value *big.Int - GasLimit uint64 - IsCreation bool - Data []byte + Version *big.Int + OpaqueData []byte Raw types.Log // Blockchain specific contextual infos } -// FilterTransactionDeposited is a free log retrieval operation binding the contract event 0x78231ae6eb73366f912bb1d64351601fb76344c537bbab635ce14d0f376f0195. +// FilterTransactionDeposited is a free log retrieval operation binding the contract event 0xb3813568d9991fc951961fcb4c784893574240a28925604d09fc577c55bb7c32. // -// Solidity: event TransactionDeposited(address indexed from, address indexed to, uint256 mint, uint256 value, uint64 gasLimit, bool isCreation, bytes data) -func (_OptimismPortal *OptimismPortalFilterer) FilterTransactionDeposited(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*OptimismPortalTransactionDepositedIterator, error) { +// Solidity: event TransactionDeposited(address indexed from, address indexed to, uint256 indexed version, bytes opaqueData) +func (_OptimismPortal *OptimismPortalFilterer) FilterTransactionDeposited(opts *bind.FilterOpts, from []common.Address, to []common.Address, version []*big.Int) (*OptimismPortalTransactionDepositedIterator, error) { var fromRule []interface{} for _, fromItem := range from { @@ -1003,18 +948,22 @@ func (_OptimismPortal *OptimismPortalFilterer) FilterTransactionDeposited(opts * for _, toItem := range to { toRule = append(toRule, toItem) } + var versionRule []interface{} + for _, versionItem := range version { + versionRule = append(versionRule, versionItem) + } - logs, sub, err := _OptimismPortal.contract.FilterLogs(opts, "TransactionDeposited", fromRule, toRule) + logs, sub, err := _OptimismPortal.contract.FilterLogs(opts, "TransactionDeposited", fromRule, toRule, versionRule) if err != nil { return nil, err } return &OptimismPortalTransactionDepositedIterator{contract: _OptimismPortal.contract, event: "TransactionDeposited", logs: logs, sub: sub}, nil } -// WatchTransactionDeposited is a free log subscription operation binding the contract event 0x78231ae6eb73366f912bb1d64351601fb76344c537bbab635ce14d0f376f0195. +// WatchTransactionDeposited is a free log subscription operation binding the contract event 0xb3813568d9991fc951961fcb4c784893574240a28925604d09fc577c55bb7c32. // -// Solidity: event TransactionDeposited(address indexed from, address indexed to, uint256 mint, uint256 value, uint64 gasLimit, bool isCreation, bytes data) -func (_OptimismPortal *OptimismPortalFilterer) WatchTransactionDeposited(opts *bind.WatchOpts, sink chan<- *OptimismPortalTransactionDeposited, from []common.Address, to []common.Address) (event.Subscription, error) { +// Solidity: event TransactionDeposited(address indexed from, address indexed to, uint256 indexed version, bytes opaqueData) +func (_OptimismPortal *OptimismPortalFilterer) WatchTransactionDeposited(opts *bind.WatchOpts, sink chan<- *OptimismPortalTransactionDeposited, from []common.Address, to []common.Address, version []*big.Int) (event.Subscription, error) { var fromRule []interface{} for _, fromItem := range from { @@ -1024,8 +973,12 @@ func (_OptimismPortal *OptimismPortalFilterer) WatchTransactionDeposited(opts *b for _, toItem := range to { toRule = append(toRule, toItem) } + var versionRule []interface{} + for _, versionItem := range version { + versionRule = append(versionRule, versionItem) + } - logs, sub, err := _OptimismPortal.contract.WatchLogs(opts, "TransactionDeposited", fromRule, toRule) + logs, sub, err := _OptimismPortal.contract.WatchLogs(opts, "TransactionDeposited", fromRule, toRule, versionRule) if err != nil { return nil, err } @@ -1057,9 +1010,9 @@ func (_OptimismPortal *OptimismPortalFilterer) WatchTransactionDeposited(opts *b }), nil } -// ParseTransactionDeposited is a log parse operation binding the contract event 0x78231ae6eb73366f912bb1d64351601fb76344c537bbab635ce14d0f376f0195. +// ParseTransactionDeposited is a log parse operation binding the contract event 0xb3813568d9991fc951961fcb4c784893574240a28925604d09fc577c55bb7c32. // -// Solidity: event TransactionDeposited(address indexed from, address indexed to, uint256 mint, uint256 value, uint64 gasLimit, bool isCreation, bytes data) +// Solidity: event TransactionDeposited(address indexed from, address indexed to, uint256 indexed version, bytes opaqueData) func (_OptimismPortal *OptimismPortalFilterer) ParseTransactionDeposited(log types.Log) (*OptimismPortalTransactionDeposited, error) { event := new(OptimismPortalTransactionDeposited) if err := _OptimismPortal.contract.UnpackLog(event, "TransactionDeposited", log); err != nil { diff --git a/op-bindings/bindings/optimismportal_deployed.go b/op-bindings/bindings/optimismportal_deployed.go index c89b2128ac25c..39217a7582994 100644 --- a/op-bindings/bindings/optimismportal_deployed.go +++ b/op-bindings/bindings/optimismportal_deployed.go @@ -2,4 +2,4 @@ // This file is a generated binding and any manual changes will be lost. package bindings -var OptimismPortalDeployedBin = "0x60806040526004361061012c5760003560e01c8063a14238e7116100a5578063cff0ab9611610074578063eecf1c3611610059578063eecf1c3614610427578063f4daa2911461043a578063f786becd1461046e57600080fd5b8063cff0ab9614610373578063e9e05c421461041457600080fd5b8063a14238e7146102e5578063c8b9153114610315578063ca3e99ba14610349578063cd7c97891461035e57600080fd5b80636bf2606a116100fc5780638129fc1c116100e15780638129fc1c1461028d578063867ead13146102a25780639bf62d82146102b857600080fd5b80636bf2606a146102295780636dbffb781461025d57600080fd5b80621c2ff61461015857806313620abd146101b657806364b79208146101ef5780636bb0291e1461021457600080fd5b36610153576101513334620186a06000604051806020016040528060008152506104a2565b005b600080fd5b34801561016457600080fd5b5061018c7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b3480156101c257600080fd5b506101ce633b9aca0081565b6040516fffffffffffffffffffffffffffffffff90911681526020016101ad565b3480156101fb57600080fd5b50610206627a120081565b6040519081526020016101ad565b34801561022057600080fd5b50610206600481565b34801561023557600080fd5b506102067f000000000000000000000000000000000000000000000000000000000000000081565b34801561026957600080fd5b5061027d61027836600461331b565b610948565b60405190151581526020016101ad565b34801561029957600080fd5b50610151610c56565b3480156102ae57600080fd5b5061020661271081565b3480156102c457600080fd5b5060335461018c9073ffffffffffffffffffffffffffffffffffffffff1681565b3480156102f157600080fd5b5061027d61030036600461331b565b60346020526000908152604090205460ff1681565b34801561032157600080fd5b506102067f000000000000000000000000000000000000000000000000000000000000000081565b34801561035557600080fd5b50610206610d31565b34801561036a57600080fd5b50610206600881565b34801561037f57600080fd5b506001546103db906fffffffffffffffffffffffffffffffff81169067ffffffffffffffff7001000000000000000000000000000000008204811691780100000000000000000000000000000000000000000000000090041683565b604080516fffffffffffffffffffffffffffffffff909416845267ffffffffffffffff92831660208501529116908201526060016101ad565b6101516104223660046133d6565b6104a2565b610151610435366004613520565b610d42565b34801561044657600080fd5b506102067f000000000000000000000000000000000000000000000000000000000000000081565b34801561047a57600080fd5b506102067f000000000000000000000000000000000000000000000000000000000000000081565b8260005a905083156105595773ffffffffffffffffffffffffffffffffffffffff87161561055957604080517f08c379a00000000000000000000000000000000000000000000000000000000081526020600482015260248101919091527f4f7074696d69736d506f7274616c3a206d7573742073656e6420746f2061646460448201527f72657373283029207768656e206372656174696e67206120636f6e747261637460648201526084015b60405180910390fd5b3332811461057a575033731111000000000000000000000000000000001111015b8773ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f78231ae6eb73366f912bb1d64351601fb76344c537bbab635ce14d0f376f0195348a8a8a8a6040516105df95949392919061368b565b60405180910390a35060015460009061061e907801000000000000000000000000000000000000000000000000900467ffffffffffffffff16436136f1565b905080156107a75760006106366004627a1200613737565b6001546106619190700100000000000000000000000000000000900467ffffffffffffffff1661379f565b9050600060086106756004627a1200613737565b6001546106959085906fffffffffffffffffffffffffffffffff16613813565b61069f9190613737565b6106a99190613737565b6001549091506000906106f5906106df906106d79085906fffffffffffffffffffffffffffffffff166138cf565b612710611455565b6fffffffffffffffffffffffffffffffff611470565b90506001841115610768576107656106df670de0b6b3a764000061075161071d600883613737565b61072f90670de0b6b3a764000061379f565b61073a60018a6136f1565b61074c90670de0b6b3a7640000613943565b61147f565b61075b9085613813565b6106d79190613737565b90505b6fffffffffffffffffffffffffffffffff16780100000000000000000000000000000000000000000000000067ffffffffffffffff4316021760015550505b600180548491906010906107da908490700100000000000000000000000000000000900467ffffffffffffffff16613980565b92506101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550627a1200600160000160109054906101000a900467ffffffffffffffff1667ffffffffffffffff1613156108b6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603c60248201527f4f7074696d69736d506f7274616c3a2063616e6e6f7420627579206d6f72652060448201527f676173207468616e20617661696c61626c6520676173206c696d6974000000006064820152608401610550565b6001546000906108e2906fffffffffffffffffffffffffffffffff1667ffffffffffffffff86166139ac565b6fffffffffffffffffffffffffffffffff169050600061090648633b9aca006114b0565b61091090836139e4565b905060005a61091f90866136f1565b90508082111561093b5761093b61093682846136f1565b6114c0565b5050505050505050505050565b6040517fa25ae55700000000000000000000000000000000000000000000000000000000815260048101829052600090819073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063a25ae557906024016040805180830381865afa1580156109d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109fb91906139f8565b8051909150610c1d5760007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663529933df6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a71573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a959190613a47565b905060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16634ab65d736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b289190613a47565b905084811115610b3d57506000949350505050565b600082610b4a83886136f1565b610b549190613a60565b905073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001663a25ae557610b9c83866136f1565b610ba69089613a74565b6040518263ffffffff1660e01b8152600401610bc491815260200190565b6040805180830381865afa158015610be0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0491906139f8565b8051909450610c195750600095945050505050565b5050505b7f00000000000000000000000000000000000000000000000000000000000000008160200151610c4d9190613a74565b42119392505050565b6000610c6260016114ee565b90508015610c9757600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b603380547fffffffffffffffffffffffff00000000000000000000000000000000000000001661dead179055610ccb611679565b8015610d2e57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b610d3f6004627a1200613737565b81565b60335473ffffffffffffffffffffffffffffffffffffffff1661dead14610deb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f4f7074696d69736d506f7274616c3a2063616e206f6e6c79207472696767657260448201527f206f6e65207769746864726177616c20706572207472616e73616374696f6e006064820152608401610550565b73ffffffffffffffffffffffffffffffffffffffff8916301415610e91576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f4f7074696d69736d506f7274616c3a20796f752063616e6e6f742073656e642060448201527f6d6573736167657320746f2074686520706f7274616c20636f6e7472616374006064820152608401610550565b6040517fa25ae557000000000000000000000000000000000000000000000000000000008152600481018590526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063a25ae557906024016040805180830381865afa158015610f1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f4291906139f8565b90507f00000000000000000000000000000000000000000000000000000000000000008160200151610f749190613a74565b4211611002576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f4f7074696d69736d506f7274616c3a2070726f706f73616c206973206e6f742060448201527f7965742066696e616c697a6564000000000000000000000000000000000000006064820152608401610550565b61101961101436869003860186613a8c565b61175c565b8151146110a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4f7074696d69736d506f7274616c3a20696e76616c6964206f7574707574207260448201527f6f6f742070726f6f6600000000000000000000000000000000000000000000006064820152608401610550565b60006110ee8d8d8d8d8d8d8d8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506117b892505050565b905061113581866040013586868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506117f792505050565b6111c1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4f7074696d69736d506f7274616c3a20696e76616c696420776974686472617760448201527f616c20696e636c7573696f6e2070726f6f6600000000000000000000000000006064820152608401610550565b60008181526034602052604090205460ff1615611260576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603560248201527f4f7074696d69736d506f7274616c3a207769746864726177616c20686173206160448201527f6c7265616479206265656e2066696e616c697a656400000000000000000000006064820152608401610550565b600081815260346020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790556112a3614e208a613a74565b5a1015611332576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f4f7074696d69736d506f7274616c3a20696e73756666696369656e742067617360448201527f20746f2066696e616c697a65207769746864726177616c0000000000000000006064820152608401610550565b603380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8e16179055604080516020601f8a018190048102820181019092528881526000916113bb918e918d918f918691908f908f90819084018382808284376000920191909152506118c092505050565b50603380547fffffffffffffffffffffffff00000000000000000000000000000000000000001661dead17905560405190915082907fdb5c7652857aa163daadd670e116628fb42e869d8ac4251ef8971d9e5727df1b9061142190841515815260200190565b60405180910390a25050505050505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b6000818312156114655781611467565b825b90505b92915050565b60008183126114655781611467565b6000611467670de0b6b3a7640000836114978661194b565b6114a19190613813565b6114ab9190613737565b611b8f565b6000818310156114655781611467565b6000805a90505b825a6114d390836136f1565b10156114e9576114e282613af2565b91506114c7565b505050565b60008054610100900460ff16156115a5578160ff1660011480156115115750303b155b61159d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610550565b506000919050565b60005460ff80841691161061163c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610550565b50600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff92909216919091179055600190565b919050565b600054610100900460ff16611710576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610550565b60408051606081018252633b9aca00808252600060208301524367ffffffffffffffff169190920181905278010000000000000000000000000000000000000000000000000217600155565b6000816000015182602001518360400151846060015160405160200161179b949392919093845260208401929092526040830152606082015260800190565b604051602081830303815290604052805190602001209050919050565b60008686868686866040516020016117d596959493929190613b2b565b6040516020818303038152906040528051906020012090509695505050505050565b604080516020810185905260009181018290528190606001604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152828252805160209182012090830181905292506118b59101604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152828201909152600182527f01000000000000000000000000000000000000000000000000000000000000006020830152908587611dce565b9150505b9392505050565b6000606060008060008661ffff1667ffffffffffffffff8111156118e6576118e6613358565b6040519080825280601f01601f191660200182016040528015611910576020820181803683370190505b5090506000808751602089018b8e8ef191503d925086831115611931578692505b828152826000602083013e90999098509650505050505050565b60008082136119b6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f554e444546494e454400000000000000000000000000000000000000000000006044820152606401610550565b600060606119c384611df2565b03609f8181039490941b90931c6c465772b2bbbb5f824b15207a3081018102606090811d6d0388eaa27412d5aca026815d636e018202811d6d0df99ac502031bf953eff472fdcc018202811d6d13cdffb29d51d99322bdff5f2211018202811d6d0a0f742023def783a307a986912e018202811d6d01920d8043ca89b5239253284e42018202811d6c0b7a86d7375468fac667a0a527016c29508e458543d8aa4df2abee7883018302821d6d0139601a2efabe717e604cbb4894018302821d6d02247f7a7b6594320649aa03aba1018302821d7fffffffffffffffffffffffffffffffffffffff73c0c716a594e00d54e3c4cbc9018302821d7ffffffffffffffffffffffffffffffffffffffdc7b88c420e53a9890533129f6f01830290911d7fffffffffffffffffffffffffffffffffffffff465fda27eb4d63ded474e5f832019091027ffffffffffffffff5f6af8f7b3396644f18e157960000000000000000000000000105711340daa0d5f769dba1915cef59f0815a5506027d0267a36c0c95b3975ab3ee5b203a7614a3f75373f047d803ae7b6687f2b393909302929092017d57115e47018c7177eebf7cd370a3356a1b7863008a5ae8028c72b88642840160ae1d92915050565b60007ffffffffffffffffffffffffffffffffffffffffffffffffdb731c958f34d94c18213611bc057506000919050565b680755bf798b4a1bf1e58212611c32576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f4558505f4f564552464c4f5700000000000000000000000000000000000000006044820152606401610550565b6503782dace9d9604e83901b059150600060606bb17217f7d1cf79abc9e3b39884821b056b80000000000000000000000001901d6bb17217f7d1cf79abc9e3b39881029093037fffffffffffffffffffffffffffffffffffffffdbf3ccf1604d263450f02a550481018102606090811d6d0277594991cfc85f6e2461837cd9018202811d7fffffffffffffffffffffffffffffffffffffe5adedaa1cb095af9e4da10e363c018202811d6db1bbb201f443cf962f1a1d3db4a5018202811d7ffffffffffffffffffffffffffffffffffffd38dc772608b0ae56cce01296c0eb018202811d6e05180bb14799ab47a8a8cb2a527d57016d02d16720577bd19bf614176fe9ea6c10fe68e7fd37d0007b713f765084018402831d9081019084017ffffffffffffffffffffffffffffffffffffffe2c69812cf03b0763fd454a8f7e010290911d6e0587f503bb6ea29d25fcb7401964500190910279d835ebba824c98fb31b83b2ca45c000000000000000000000000010574029d9dc38563c32e5c2f6dc192ee70ef65f9978af30260c3939093039290921c92915050565b600080611dda86611ec8565b9050611de881868686611efa565b9695505050505050565b6000808211611e5d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f554e444546494e454400000000000000000000000000000000000000000000006044820152606401610550565b5060016fffffffffffffffffffffffffffffffff821160071b82811c67ffffffffffffffff1060061b1782811c63ffffffff1060051b1782811c61ffff1060041b1782811c60ff10600390811b90911783811c600f1060021b1783811c909110821b1791821c111790565b60608180519060200120604051602001611ee491815260200190565b6040516020818303038152906040529050919050565b6000806000611f0a878686611f37565b91509150818015611f2c57508051602080830191909120875191880191909120145b979650505050505050565b600060606000611f468561202c565b90506000806000611f58848a89612127565b81519295509093509150158080611f6c5750815b611fd2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f50726f76696465642070726f6f6620697320696e76616c69642e0000000000006044820152606401610550565b600081611fee576040518060200160405280600081525061201a565b61201a86611ffd6001886136f1565b8151811061200d5761200d613b82565b6020026020010151612643565b919b919a509098505050505050505050565b606060006120398361266d565b90506000815167ffffffffffffffff81111561205757612057613358565b60405190808252806020026020018201604052801561209c57816020015b60408051808201909152606080825260208201528152602001906001900390816120755790505b50905060005b825181101561211f5760006120cf8483815181106120c2576120c2613b82565b60200260200101516126a0565b905060405180604001604052808281526020016120eb8361266d565b81525083838151811061210057612100613b82565b602002602001018190525050808061211790613af2565b9150506120a2565b509392505050565b600060608180806121378761274a565b9050600086905060008061215e604051806040016040528060608152602001606081525090565b60005b8c518110156125ff578c818151811061217c5761217c613b82565b6020026020010151915082846121929190613a74565b935061219f600188613a74565b96508361221d57815180516020909101208514612218576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f496e76616c696420726f6f7420686173680000000000000000000000000000006044820152606401610550565b61230d565b81515160201161229957815180516020909101208514612218576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f496e76616c6964206c6172676520696e7465726e616c206861736800000000006044820152606401610550565b815185906122a690613bb1565b1461230d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f496e76616c696420696e7465726e616c206e6f646520686173680000000000006044820152606401610550565b61231960106001613a74565b8260200151511415612392578551841415612333576125ff565b600086858151811061234757612347613b82565b602001015160f81c60f81b60f81c9050600083602001518260ff168151811061237257612372613b82565b60200260200101519050612385816128cd565b96506001945050506125ed565b6002826020015151141561258b5760006123ab83612903565b90506000816000815181106123c2576123c2613b82565b016020015160f81c905060006123d9600283613bf6565b6123e4906002613c18565b905060006123f5848360ff16612927565b905060006124038b8a612927565b90506000612411838361295d565b905060ff851660021480612428575060ff85166003145b1561247e5780835114801561243d5750808251145b1561244f5761244c818b613a74565b99505b507f800000000000000000000000000000000000000000000000000000000000000099506125ff945050505050565b60ff85161580612491575060ff85166001145b1561250357825181146124cd57507f800000000000000000000000000000000000000000000000000000000000000099506125ff945050505050565b6124f488602001516001815181106124e7576124e7613b82565b60200260200101516128cd565b9a5097506125ed945050505050565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f52656365697665642061206e6f6465207769746820616e20756e6b6e6f776e2060448201527f70726566697800000000000000000000000000000000000000000000000000006064820152608401610550565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f526563656976656420616e20756e706172736561626c65206e6f64652e0000006044820152606401610550565b806125f781613af2565b915050612161565b507f800000000000000000000000000000000000000000000000000000000000000084148661262e8786612927565b909e909d50909b509950505050505050505050565b6020810151805160609161146a9161265d906001906136f1565b815181106120c2576120c2613b82565b60408051808201825260008082526020918201528151808301909252825182528083019082015260609061146a90612a09565b606060008060006126b085612c3c565b9194509250905060008160018111156126cb576126cb613c3b565b14612732576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f496e76616c696420524c502062797465732076616c75652e00000000000000006044820152606401610550565b61274185602001518484613043565b95945050505050565b606060008251600261275c9190613943565b67ffffffffffffffff81111561277457612774613358565b6040519080825280601f01601f19166020018201604052801561279e576020820181803683370190505b50905060005b83518110156128c65760048482815181106127c1576127c1613b82565b01602001517fff0000000000000000000000000000000000000000000000000000000000000016901c826127f6836002613943565b8151811061280657612806613b82565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350601084828151811061284957612849613b82565b016020015161285b919060f81c613bf6565b60f81b8261286a836002613943565b612875906001613a74565b8151811061288557612885613b82565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350806128be81613af2565b9150506127a4565b5092915050565b600060606020836000015110156128ee576128e783613122565b90506128fa565b6128f7836126a0565b90505b6118b981613bb1565b606061146a61292283602001516000815181106120c2576120c2613b82565b61274a565b606082518210612946575060408051602081019091526000815261146a565b611467838384865161295891906136f1565b61312d565b6000805b8084511180156129715750808351115b80156129f2575082818151811061298a5761298a613b82565b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168482815181106129c9576129c9613b82565b01602001517fff0000000000000000000000000000000000000000000000000000000000000016145b156114675780612a0181613af2565b915050612961565b6060600080612a1784612c3c565b91935090915060019050816001811115612a3357612a33613c3b565b14612a9a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f496e76616c696420524c50206c6973742076616c75652e0000000000000000006044820152606401610550565b6040805160208082526104208201909252600091816020015b6040805180820190915260008082526020820152815260200190600190039081612ab35790505090506000835b8651811015612c315760208210612b79576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f50726f766964656420524c50206c6973742065786365656473206d6178206c6960448201527f7374206c656e6774682e000000000000000000000000000000000000000000006064820152608401610550565b600080612bb66040518060400160405280858c60000151612b9a91906136f1565b8152602001858c60200151612baf9190613a74565b9052612c3c565b509150915060405180604001604052808383612bd29190613a74565b8152602001848b60200151612be79190613a74565b815250858581518110612bfc57612bfc613b82565b6020908102919091010152612c12600185613a74565b9350612c1e8183613a74565b612c289084613a74565b92505050612ae0565b508152949350505050565b600080600080846000015111612cae576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f524c50206974656d2063616e6e6f74206265206e756c6c2e00000000000000006044820152606401610550565b6020840151805160001a607f8111612cd357600060016000945094509450505061303c565b60b78111612d69576000612ce86080836136f1565b905080876000015111612d57576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f496e76616c696420524c502073686f727420737472696e672e000000000000006044820152606401610550565b6001955093506000925061303c915050565b60bf8111612e8c576000612d7e60b7836136f1565b905080876000015111612ded576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f496e76616c696420524c50206c6f6e6720737472696e67206c656e6774682e006044820152606401610550565b600183015160208290036101000a9004612e078183613a74565b885111612e70576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f496e76616c696420524c50206c6f6e6720737472696e672e00000000000000006044820152606401610550565b612e7b826001613a74565b965094506000935061303c92505050565b60f78111612f21576000612ea160c0836136f1565b905080876000015111612f10576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f496e76616c696420524c502073686f7274206c6973742e0000000000000000006044820152606401610550565b60019550935084925061303c915050565b6000612f2e60f7836136f1565b905080876000015111612f9d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f496e76616c696420524c50206c6f6e67206c697374206c656e6774682e0000006044820152606401610550565b600183015160208290036101000a9004612fb78183613a74565b885111613020576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f496e76616c696420524c50206c6f6e67206c6973742e000000000000000000006044820152606401610550565b61302b826001613a74565b965094506001935061303c92505050565b9193909250565b606060008267ffffffffffffffff81111561306057613060613358565b6040519080825280601f01601f19166020018201604052801561308a576020820181803683370190505b50905080516000141561309e5790506118b9565b60006130aa8587613a74565b90506020820160005b6130be6020876139e4565b8110156130f557825182526130d4602084613a74565b92506130e1602083613a74565b9150806130ed81613af2565b9150506130b3565b5060006001602087066020036101000a039050808251168119845116178252839450505050509392505050565b606061146a82613305565b60608182601f01101561319c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f736c6963655f6f766572666c6f770000000000000000000000000000000000006044820152606401610550565b828284011015613208576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f736c6963655f6f766572666c6f770000000000000000000000000000000000006044820152606401610550565b81830184511015613275576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f736c6963655f6f75744f66426f756e64730000000000000000000000000000006044820152606401610550565b60608215801561329457604051915060008252602082016040526132fc565b6040519150601f8416801560200281840101858101878315602002848b0101015b818310156132cd5780518352602092830192016132b5565b5050858452601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016604052505b50949350505050565b606061146a826020015160008460000151613043565b60006020828403121561332d57600080fd5b5035919050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461167457600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156133ce576133ce613358565b604052919050565b600080600080600060a086880312156133ee57600080fd5b6133f786613334565b94506020808701359450604087013567ffffffffffffffff808216821461341d57600080fd5b909450606088013590811515821461343457600080fd5b9093506080880135908082111561344a57600080fd5b818901915089601f83011261345e57600080fd5b81358181111561347057613470613358565b6134a0847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601613387565b91508082528a848285010111156134b657600080fd5b80848401858401376000848284010152508093505050509295509295909350565b60008083601f8401126134e957600080fd5b50813567ffffffffffffffff81111561350157600080fd5b60208301915083602082850101111561351957600080fd5b9250929050565b60008060008060008060008060008060006101808c8e03121561354257600080fd5b8b359a5061355260208d01613334565b995061356060408d01613334565b985060608c0135975060808c0135965067ffffffffffffffff60a08d0135111561358957600080fd5b6135998d60a08e01358e016134d7565b909650945060c08c0135935060808c8e037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff200112156135d757600080fd5b60e08c01925067ffffffffffffffff6101608d013511156135f757600080fd5b6136088d6101608e01358e016134d7565b81935080925050509295989b509295989b9093969950565b6000815180845260005b818110156136465760208185018101518683018201520161362a565b81811115613658576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b85815284602082015267ffffffffffffffff84166040820152821515606082015260a060808201526000611f2c60a0830184613620565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082821015613703576137036136c2565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60008261374657613746613708565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83147f80000000000000000000000000000000000000000000000000000000000000008314161561379a5761379a6136c2565b500590565b6000808312837f8000000000000000000000000000000000000000000000000000000000000000018312811516156137d9576137d96136c2565b837f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01831381161561380d5761380d6136c2565b50500390565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600084136000841385830485118282161615613854576138546136c2565b7f8000000000000000000000000000000000000000000000000000000000000000600087128682058812818416161561388f5761388f6136c2565b600087129250878205871284841616156138ab576138ab6136c2565b878505871281841616156138c1576138c16136c2565b505050929093029392505050565b6000808212827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03841381151615613909576139096136c2565b827f800000000000000000000000000000000000000000000000000000000000000003841281161561393d5761393d6136c2565b50500190565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561397b5761397b6136c2565b500290565b600067ffffffffffffffff8083168185168083038211156139a3576139a36136c2565b01949350505050565b60006fffffffffffffffffffffffffffffffff808316818516818304811182151516156139db576139db6136c2565b02949350505050565b6000826139f3576139f3613708565b500490565b600060408284031215613a0a57600080fd5b6040516040810181811067ffffffffffffffff82111715613a2d57613a2d613358565b604052825181526020928301519281019290925250919050565b600060208284031215613a5957600080fd5b5051919050565b600082613a6f57613a6f613708565b500690565b60008219821115613a8757613a876136c2565b500190565b600060808284031215613a9e57600080fd5b6040516080810181811067ffffffffffffffff82111715613ac157613ac1613358565b8060405250823581526020830135602082015260408301356040820152606083013560608201528091505092915050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613b2457613b246136c2565b5060010190565b868152600073ffffffffffffffffffffffffffffffffffffffff808816602084015280871660408401525084606083015283608083015260c060a0830152613b7660c0830184613620565b98975050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b80516020808301519190811015613bf0577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8160200360031b1b821691505b50919050565b600060ff831680613c0957613c09613708565b8060ff84160691505092915050565b600060ff821660ff841680821015613c3257613c326136c2565b90039392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fdfea164736f6c634300080a000a" +var OptimismPortalDeployedBin = "0x6080604052600436106100f65760003560e01c8063a14238e71161008a578063cff0ab9611610059578063cff0ab96146102f7578063e9e05c4214610398578063f4daa291146103ab578063fdc9fe1d146103df57600080fd5b8063a14238e71461026d578063c4fc4798146102ad578063ca3e99ba146102cd578063cd7c9789146102e257600080fd5b80636bb0291e116100c65780636bb0291e146102005780638129fc1c14610215578063867ead131461022a5780639bf62d821461024057600080fd5b80621c2ff61461012257806313620abd1461018057806354fd4d50146101b957806364b79208146101db57600080fd5b3661011d5761011b3334620186a06000604051806020016040528060008152506103f2565b005b600080fd5b34801561012e57600080fd5b506101567f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b34801561018c57600080fd5b50610198633b9aca0081565b6040516fffffffffffffffffffffffffffffffff9091168152602001610177565b3480156101c557600080fd5b506101ce6108bf565b6040516101779190613416565b3480156101e757600080fd5b506101f2627a120081565b604051908152602001610177565b34801561020c57600080fd5b506101f2600481565b34801561022157600080fd5b5061011b610962565b34801561023657600080fd5b506101f261271081565b34801561024c57600080fd5b506033546101569073ffffffffffffffffffffffffffffffffffffffff1681565b34801561027957600080fd5b5061029d610288366004613429565b60346020526000908152604090205460ff1681565b6040519015158152602001610177565b3480156102b957600080fd5b5061029d6102c8366004613429565b610a3d565b3480156102d957600080fd5b506101f2610b02565b3480156102ee57600080fd5b506101f2600881565b34801561030357600080fd5b5060015461035f906fffffffffffffffffffffffffffffffff81169067ffffffffffffffff7001000000000000000000000000000000008204811691780100000000000000000000000000000000000000000000000090041683565b604080516fffffffffffffffffffffffffffffffff909416845267ffffffffffffffff9283166020850152911690820152606001610177565b61011b6103a6366004613569565b6103f2565b3480156103b757600080fd5b506101f27f000000000000000000000000000000000000000000000000000000000000000081565b61011b6103ed366004613657565b610b13565b8260005a905083156104a95773ffffffffffffffffffffffffffffffffffffffff8716156104a957604080517f08c379a00000000000000000000000000000000000000000000000000000000081526020600482015260248101919091527f4f7074696d69736d506f7274616c3a206d7573742073656e6420746f2061646460448201527f72657373283029207768656e206372656174696e67206120636f6e747261637460648201526084015b60405180910390fd5b333281146104ca575033731111000000000000000000000000000000001111015b600034888888886040516020016104e595949392919061374b565b604051602081830303815290604052905060008973ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fb3813568d9991fc951961fcb4c784893574240a28925604d09fc577c55bb7c32846040516105559190613416565b60405180910390a45050600154600090610595907801000000000000000000000000000000000000000000000000900467ffffffffffffffff16436137df565b9050801561071e5760006105ad6004627a1200613825565b6001546105d89190700100000000000000000000000000000000900467ffffffffffffffff1661388d565b9050600060086105ec6004627a1200613825565b60015461060c9085906fffffffffffffffffffffffffffffffff16613901565b6106169190613825565b6106209190613825565b60015490915060009061066c906106569061064e9085906fffffffffffffffffffffffffffffffff166139bd565b6127106111b7565b6fffffffffffffffffffffffffffffffff6111d2565b905060018411156106df576106dc610656670de0b6b3a76400006106c8610694600883613825565b6106a690670de0b6b3a764000061388d565b6106b160018a6137df565b6106c390670de0b6b3a7640000613a31565b6111e1565b6106d29085613901565b61064e9190613825565b90505b6fffffffffffffffffffffffffffffffff16780100000000000000000000000000000000000000000000000067ffffffffffffffff4316021760015550505b60018054849190601090610751908490700100000000000000000000000000000000900467ffffffffffffffff16613a6e565b92506101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550627a1200600160000160109054906101000a900467ffffffffffffffff1667ffffffffffffffff16131561082d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603e60248201527f5265736f757263654d65746572696e673a2063616e6e6f7420627579206d6f7260448201527f6520676173207468616e20617661696c61626c6520676173206c696d6974000060648201526084016104a0565b600154600090610859906fffffffffffffffffffffffffffffffff1667ffffffffffffffff8616613a9a565b6fffffffffffffffffffffffffffffffff169050600061087d48633b9aca00611212565b6108879083613ad2565b905060005a61089690866137df565b9050808211156108b2576108b26108ad82846137df565b611222565b5050505050505050505050565b60606108ea7f0000000000000000000000000000000000000000000000000000000000000000611250565b6109137f0000000000000000000000000000000000000000000000000000000000000000611250565b61093c7f0000000000000000000000000000000000000000000000000000000000000000611250565b60405160200161094e93929190613ae6565b604051602081830303815290604052905090565b600061096e600161138d565b905080156109a357600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b603380547fffffffffffffffffffffffff00000000000000000000000000000000000000001661dead1790556109d7611518565b8015610a3a57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b6040517fa25ae55700000000000000000000000000000000000000000000000000000000815260048101829052600090819073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063a25ae557906024016040805180830381865afa158015610acc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610af09190613b5c565b9050610afb816115fb565b9392505050565b610b106004627a1200613825565b81565b60335473ffffffffffffffffffffffffffffffffffffffff1661dead14610bbc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f4f7074696d69736d506f7274616c3a2063616e206f6e6c79207472696767657260448201527f206f6e65207769746864726177616c20706572207472616e73616374696f6e0060648201526084016104a0565b3073ffffffffffffffffffffffffffffffffffffffff16856040015173ffffffffffffffffffffffffffffffffffffffff1603610c7b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f4f7074696d69736d506f7274616c3a20796f752063616e6e6f742073656e642060448201527f6d6573736167657320746f2074686520706f7274616c20636f6e74726163740060648201526084016104a0565b6040517fa25ae557000000000000000000000000000000000000000000000000000000008152600481018590526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063a25ae557906024016040805180830381865afa158015610d08573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2c9190613b5c565b9050610d37816115fb565b610dc3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f4f7074696d69736d506f7274616c3a2070726f706f73616c206973206e6f742060448201527f7965742066696e616c697a65640000000000000000000000000000000000000060648201526084016104a0565b610dda610dd536869003860186613bab565b611635565b815114610e69576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4f7074696d69736d506f7274616c3a20696e76616c6964206f7574707574207260448201527f6f6f742070726f6f66000000000000000000000000000000000000000000000060648201526084016104a0565b6000610e7487611691565b9050610ebb81866040013586868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506116c192505050565b610f47576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4f7074696d69736d506f7274616c3a20696e76616c696420776974686472617760448201527f616c20696e636c7573696f6e2070726f6f66000000000000000000000000000060648201526084016104a0565b60008181526034602052604090205460ff1615610fe6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603560248201527f4f7074696d69736d506f7274616c3a207769746864726177616c20686173206160448201527f6c7265616479206265656e2066696e616c697a6564000000000000000000000060648201526084016104a0565b600081815260346020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055608087015161102f90614e2090613c11565b5a10156110be576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f4f7074696d69736d506f7274616c3a20696e73756666696369656e742067617360448201527f20746f2066696e616c697a65207769746864726177616c00000000000000000060648201526084016104a0565b8660200151603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000611123886040015189608001518a6060015160008c60a00151611788565b50603380547fffffffffffffffffffffffff00000000000000000000000000000000000000001661dead17905560405190915082907fdb5c7652857aa163daadd670e116628fb42e869d8ac4251ef8971d9e5727df1b9061118990841515815260200190565b60405180910390a25050505050505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b6000818312156111c757816111c9565b825b90505b92915050565b60008183126111c757816111c9565b60006111c9670de0b6b3a7640000836111f986611813565b6112039190613901565b61120d9190613825565b611a57565b6000818310156111c757816111c9565b6000805a90505b825a61123590836137df565b101561124b5761124482613c29565b9150611229565b505050565b60608160000361129357505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b81156112bd57806112a781613c29565b91506112b69050600a83613ad2565b9150611297565b60008167ffffffffffffffff8111156112d8576112d8613466565b6040519080825280601f01601f191660200182016040528015611302576020820181803683370190505b5090505b8415611385576113176001836137df565b9150611324600a86613c61565b61132f906030613c11565b60f81b81838151811061134457611344613c75565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535061137e600a86613ad2565b9450611306565b949350505050565b60008054610100900460ff1615611444578160ff1660011480156113b05750303b155b61143c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016104a0565b506000919050565b60005460ff8084169116106114db576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016104a0565b50600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff92909216919091179055600190565b919050565b600054610100900460ff166115af576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016104a0565b60408051606081018252633b9aca00808252600060208301524367ffffffffffffffff169190920181905278010000000000000000000000000000000000000000000000000217600155565b60007f0000000000000000000000000000000000000000000000000000000000000000826020015161162d9190613c11565b421192915050565b60008160000151826020015183604001518460600151604051602001611674949392919093845260208401929092526040830152606082015260800190565b604051602081830303815290604052805190602001209050919050565b80516020808301516040808501516060860151608087015160a08801519351600097611674979096959101613ca4565b604080516020810185905260009181018290528190606001604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181528282528051602091820120908301819052925061177f9101604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152828201909152600182527f01000000000000000000000000000000000000000000000000000000000000006020830152908587611c96565b95945050505050565b6000606060008060008661ffff1667ffffffffffffffff8111156117ae576117ae613466565b6040519080825280601f01601f1916602001820160405280156117d8576020820181803683370190505b5090506000808751602089018b8e8ef191503d9250868311156117f9578692505b828152826000602083013e90999098509650505050505050565b600080821361187e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f554e444546494e4544000000000000000000000000000000000000000000000060448201526064016104a0565b6000606061188b84611cba565b03609f8181039490941b90931c6c465772b2bbbb5f824b15207a3081018102606090811d6d0388eaa27412d5aca026815d636e018202811d6d0df99ac502031bf953eff472fdcc018202811d6d13cdffb29d51d99322bdff5f2211018202811d6d0a0f742023def783a307a986912e018202811d6d01920d8043ca89b5239253284e42018202811d6c0b7a86d7375468fac667a0a527016c29508e458543d8aa4df2abee7883018302821d6d0139601a2efabe717e604cbb4894018302821d6d02247f7a7b6594320649aa03aba1018302821d7fffffffffffffffffffffffffffffffffffffff73c0c716a594e00d54e3c4cbc9018302821d7ffffffffffffffffffffffffffffffffffffffdc7b88c420e53a9890533129f6f01830290911d7fffffffffffffffffffffffffffffffffffffff465fda27eb4d63ded474e5f832019091027ffffffffffffffff5f6af8f7b3396644f18e157960000000000000000000000000105711340daa0d5f769dba1915cef59f0815a5506027d0267a36c0c95b3975ab3ee5b203a7614a3f75373f047d803ae7b6687f2b393909302929092017d57115e47018c7177eebf7cd370a3356a1b7863008a5ae8028c72b88642840160ae1d92915050565b60007ffffffffffffffffffffffffffffffffffffffffffffffffdb731c958f34d94c18213611a8857506000919050565b680755bf798b4a1bf1e58212611afa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f4558505f4f564552464c4f57000000000000000000000000000000000000000060448201526064016104a0565b6503782dace9d9604e83901b059150600060606bb17217f7d1cf79abc9e3b39884821b056b80000000000000000000000001901d6bb17217f7d1cf79abc9e3b39881029093037fffffffffffffffffffffffffffffffffffffffdbf3ccf1604d263450f02a550481018102606090811d6d0277594991cfc85f6e2461837cd9018202811d7fffffffffffffffffffffffffffffffffffffe5adedaa1cb095af9e4da10e363c018202811d6db1bbb201f443cf962f1a1d3db4a5018202811d7ffffffffffffffffffffffffffffffffffffd38dc772608b0ae56cce01296c0eb018202811d6e05180bb14799ab47a8a8cb2a527d57016d02d16720577bd19bf614176fe9ea6c10fe68e7fd37d0007b713f765084018402831d9081019084017ffffffffffffffffffffffffffffffffffffffe2c69812cf03b0763fd454a8f7e010290911d6e0587f503bb6ea29d25fcb7401964500190910279d835ebba824c98fb31b83b2ca45c000000000000000000000000010574029d9dc38563c32e5c2f6dc192ee70ef65f9978af30260c3939093039290921c92915050565b600080611ca286611d90565b9050611cb081868686611dc2565b9695505050505050565b6000808211611d25576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f554e444546494e4544000000000000000000000000000000000000000000000060448201526064016104a0565b5060016fffffffffffffffffffffffffffffffff821160071b82811c67ffffffffffffffff1060061b1782811c63ffffffff1060051b1782811c61ffff1060041b1782811c60ff10600390811b90911783811c600f1060021b1783811c909110821b1791821c111790565b60608180519060200120604051602001611dac91815260200190565b6040516020818303038152906040529050919050565b6000806000611dd2878686611dff565b91509150818015611df457508051602080830191909120875191880191909120145b979650505050505050565b600060606000611e0e85611f1a565b90506000806000611e20848a89612015565b81519295509093509150158080611e345750815b611ec0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f4d65726b6c65547269653a2070726f76696465642070726f6f6620697320696e60448201527f76616c696400000000000000000000000000000000000000000000000000000060648201526084016104a0565b600081611edc5760405180602001604052806000815250611f08565b611f0886611eeb6001886137df565b81518110611efb57611efb613c75565b602002602001015161259e565b919b919a509098505050505050505050565b60606000611f27836125c8565b90506000815167ffffffffffffffff811115611f4557611f45613466565b604051908082528060200260200182016040528015611f8a57816020015b6040805180820190915260608082526020820152815260200190600190039081611f635790505b50905060005b825181101561200d576000611fbd848381518110611fb057611fb0613c75565b60200260200101516125fb565b90506040518060400160405280828152602001611fd9836125c8565b815250838381518110611fee57611fee613c75565b602002602001018190525050808061200590613c29565b915050611f90565b509392505050565b60006060818080612025876126c2565b9050600086905060008061204c604051806040016040528060608152602001606081525090565b60005b8c5181101561255a578c818151811061206a5761206a613c75565b6020026020010151915082846120809190613c11565b935061208d600188613c11565b96508360000361210e57815180516020909101208514612109576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f4d65726b6c65547269653a20696e76616c696420726f6f74206861736800000060448201526064016104a0565b61224a565b8151516020116121b057815180516020909101208514612109576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f4d65726b6c65547269653a20696e76616c6964206c6172676520696e7465726e60448201527f616c20686173680000000000000000000000000000000000000000000000000060648201526084016104a0565b815185906121bd90613cfb565b1461224a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4d65726b6c65547269653a20696e76616c696420696e7465726e616c206e6f6460448201527f652068617368000000000000000000000000000000000000000000000000000060648201526084016104a0565b61225660106001613c11565b826020015151036122c8578551841461255a57600086858151811061227d5761227d613c75565b602001015160f81c60f81b60f81c9050600083602001518260ff16815181106122a8576122a8613c75565b602002602001015190506122bb81612845565b9650600194505050612548565b6002826020015151036124c05760006122e08361287b565b90506000816000815181106122f7576122f7613c75565b016020015160f81c9050600061230e600283613d3d565b612319906002613d5f565b9050600061232a848360ff1661289f565b905060006123388b8a61289f565b9050600061234683836128d5565b905060ff85166002148061235d575060ff85166003145b156123b3578083511480156123725750808251145b1561238457612381818b613c11565b99505b507f8000000000000000000000000000000000000000000000000000000000000000995061255a945050505050565b60ff851615806123c6575060ff85166001145b15612438578251811461240257507f8000000000000000000000000000000000000000000000000000000000000000995061255a945050505050565b612429886020015160018151811061241c5761241c613c75565b6020026020010151612845565b9a509750612548945050505050565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4d65726b6c65547269653a2072656365697665642061206e6f6465207769746860448201527f20616e20756e6b6e6f776e20707265666978000000000000000000000000000060648201526084016104a0565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f4d65726b6c65547269653a20726563656976656420616e20756e70617273656160448201527f626c65206e6f646500000000000000000000000000000000000000000000000060648201526084016104a0565b8061255281613c29565b91505061204f565b507f8000000000000000000000000000000000000000000000000000000000000000841486612589878661289f565b909e909d50909b509950505050505050505050565b602081015180516060916111cc916125b8906001906137df565b81518110611fb057611fb0613c75565b6040805180820182526000808252602091820152815180830190925282518252808301908201526060906111cc90612981565b6060600080600061260b85612bda565b91945092509050600081600181111561262657612626613d82565b146126b3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f524c505265616465723a20696e76616c696420524c502062797465732076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016104a0565b61177f856020015184846130c5565b60606000825160026126d49190613a31565b67ffffffffffffffff8111156126ec576126ec613466565b6040519080825280601f01601f191660200182016040528015612716576020820181803683370190505b50905060005b835181101561283e57600484828151811061273957612739613c75565b01602001517fff0000000000000000000000000000000000000000000000000000000000000016901c8261276e836002613a31565b8151811061277e5761277e613c75565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060108482815181106127c1576127c1613c75565b01602001516127d3919060f81c613d3d565b60f81b826127e2836002613a31565b6127ed906001613c11565b815181106127fd576127fd613c75565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508061283681613c29565b91505061271c565b5092915050565b600060606020836000015110156128665761285f836131a3565b9050612872565b61286f836125fb565b90505b610afb81613cfb565b60606111cc61289a8360200151600081518110611fb057611fb0613c75565b6126c2565b6060825182106128be57506040805160208101909152600081526111cc565b6111c983838486516128d091906137df565b6131ae565b6000805b8084511180156128e95750808351115b801561296a575082818151811061290257612902613c75565b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191684828151811061294157612941613c75565b01602001517fff0000000000000000000000000000000000000000000000000000000000000016145b156111c9578061297981613c29565b9150506128d9565b606060008061298f84612bda565b919350909150600190508160018111156129ab576129ab613d82565b14612a38576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f524c505265616465723a20696e76616c696420524c50206c6973742076616c7560448201527f650000000000000000000000000000000000000000000000000000000000000060648201526084016104a0565b6040805160208082526104208201909252600091816020015b6040805180820190915260008082526020820152815260200190600190039081612a515790505090506000835b8651811015612bcf5760208210612b17576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603460248201527f524c505265616465723a2070726f766964656420524c50206c6973742065786360448201527f65656473206d6178206c697374206c656e67746800000000000000000000000060648201526084016104a0565b600080612b546040518060400160405280858c60000151612b3891906137df565b8152602001858c60200151612b4d9190613c11565b9052612bda565b509150915060405180604001604052808383612b709190613c11565b8152602001848b60200151612b859190613c11565b815250858581518110612b9a57612b9a613c75565b6020908102919091010152612bb0600185613c11565b9350612bbc8183613c11565b612bc69084613c11565b92505050612a7e565b508152949350505050565b600080600080846000015111612c72576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f524c505265616465723a20524c50206974656d2063616e6e6f74206265206e7560448201527f6c6c00000000000000000000000000000000000000000000000000000000000060648201526084016104a0565b6020840151805160001a607f8111612c975760006001600094509450945050506130be565b60b78111612d53576000612cac6080836137df565b905080876000015111612d41576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f524c505265616465723a20696e76616c696420524c502073686f72742073747260448201527f696e67000000000000000000000000000000000000000000000000000000000060648201526084016104a0565b600195509350600092506130be915050565b60bf8111612ec2576000612d6860b7836137df565b905080876000015111612dfd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f524c505265616465723a20696e76616c696420524c50206c6f6e67207374726960448201527f6e67206c656e677468000000000000000000000000000000000000000000000060648201526084016104a0565b600183015160208290036101000a9004612e178183613c11565b885111612ea6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f524c505265616465723a20696e76616c696420524c50206c6f6e67207374726960448201527f6e6700000000000000000000000000000000000000000000000000000000000060648201526084016104a0565b612eb1826001613c11565b96509450600093506130be92505050565b60f78111612f7d576000612ed760c0836137df565b905080876000015111612f6c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f524c505265616465723a20696e76616c696420524c502073686f7274206c697360448201527f740000000000000000000000000000000000000000000000000000000000000060648201526084016104a0565b6001955093508492506130be915050565b6000612f8a60f7836137df565b90508087600001511161301f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f524c505265616465723a20696e76616c696420524c50206c6f6e67206c69737460448201527f206c656e6774680000000000000000000000000000000000000000000000000060648201526084016104a0565b600183015160208290036101000a90046130398183613c11565b8851116130a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f524c505265616465723a20696e76616c696420524c50206c6f6e67206c69737460448201526064016104a0565b6130ad826001613c11565b96509450600193506130be92505050565b9193909250565b606060008267ffffffffffffffff8111156130e2576130e2613466565b6040519080825280601f01601f19166020018201604052801561310c576020820181803683370190505b509050805160000361311f579050610afb565b600061312b8587613c11565b90506020820160005b61313f602087613ad2565b8110156131765782518252613155602084613c11565b9250613162602083613c11565b91508061316e81613c29565b915050613134565b5060006001602087066020036101000a039050808251168119845116178252839450505050509392505050565b60606111cc82613386565b60608182601f01101561321d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f736c6963655f6f766572666c6f7700000000000000000000000000000000000060448201526064016104a0565b828284011015613289576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f736c6963655f6f766572666c6f7700000000000000000000000000000000000060448201526064016104a0565b818301845110156132f6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f736c6963655f6f75744f66426f756e647300000000000000000000000000000060448201526064016104a0565b606082158015613315576040519150600082526020820160405261337d565b6040519150601f8416801560200281840101858101878315602002848b0101015b8183101561334e578051835260209283019201613336565b5050858452601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016604052505b50949350505050565b60606111cc8260200151600084600001516130c5565b60005b838110156133b757818101518382015260200161339f565b838111156133c6576000848401525b50505050565b600081518084526133e481602086016020860161339c565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006111c960208301846133cc565b60006020828403121561343b57600080fd5b5035919050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461151357600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405160c0810167ffffffffffffffff811182821017156134b8576134b8613466565b60405290565b600082601f8301126134cf57600080fd5b813567ffffffffffffffff808211156134ea576134ea613466565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190828211818310171561353057613530613466565b8160405283815286602085880101111561354957600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080600080600060a0868803121561358157600080fd5b61358a86613442565b945060208601359350604086013567ffffffffffffffff80821682146135af57600080fd5b90935060608701359081151582146135c657600080fd5b909250608087013590808211156135dc57600080fd5b506135e9888289016134be565b9150509295509295909350565b60006080828403121561360857600080fd5b50919050565b60008083601f84011261362057600080fd5b50813567ffffffffffffffff81111561363857600080fd5b60208301915083602082850101111561365057600080fd5b9250929050565b600080600080600060e0868803121561366f57600080fd5b853567ffffffffffffffff8082111561368757600080fd5b9087019060c0828a03121561369b57600080fd5b6136a3613495565b823581526136b360208401613442565b60208201526136c460408401613442565b6040820152606083013560608201526080830135608082015260a0830135828111156136ef57600080fd5b6136fb8b8286016134be565b60a0830152509650602088013595506137178960408a016135f6565b945060c088013591508082111561372d57600080fd5b5061373a8882890161360e565b969995985093965092949392505050565b8581528460208201527fffffffffffffffff0000000000000000000000000000000000000000000000008460c01b16604082015282151560f81b60488201526000825161379f81604985016020870161339c565b919091016049019695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000828210156137f1576137f16137b0565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082613834576138346137f6565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83147f800000000000000000000000000000000000000000000000000000000000000083141615613888576138886137b0565b500590565b6000808312837f8000000000000000000000000000000000000000000000000000000000000000018312811516156138c7576138c76137b0565b837f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0183138116156138fb576138fb6137b0565b50500390565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600084136000841385830485118282161615613942576139426137b0565b7f8000000000000000000000000000000000000000000000000000000000000000600087128682058812818416161561397d5761397d6137b0565b60008712925087820587128484161615613999576139996137b0565b878505871281841616156139af576139af6137b0565b505050929093029392505050565b6000808212827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038413811516156139f7576139f76137b0565b827f8000000000000000000000000000000000000000000000000000000000000000038412811615613a2b57613a2b6137b0565b50500190565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613a6957613a696137b0565b500290565b600067ffffffffffffffff808316818516808303821115613a9157613a916137b0565b01949350505050565b60006fffffffffffffffffffffffffffffffff80831681851681830481118215151615613ac957613ac96137b0565b02949350505050565b600082613ae157613ae16137f6565b500490565b60008451613af881846020890161339c565b80830190507f2e000000000000000000000000000000000000000000000000000000000000008082528551613b34816001850160208a0161339c565b60019201918201528351613b4f81600284016020880161339c565b0160020195945050505050565b600060408284031215613b6e57600080fd5b6040516040810181811067ffffffffffffffff82111715613b9157613b91613466565b604052825181526020928301519281019290925250919050565b600060808284031215613bbd57600080fd5b6040516080810181811067ffffffffffffffff82111715613be057613be0613466565b8060405250823581526020830135602082015260408301356040820152606083013560608201528091505092915050565b60008219821115613c2457613c246137b0565b500190565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203613c5a57613c5a6137b0565b5060010190565b600082613c7057613c706137f6565b500690565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b868152600073ffffffffffffffffffffffffffffffffffffffff808816602084015280871660408401525084606083015283608083015260c060a0830152613cef60c08301846133cc565b98975050505050505050565b80516020808301519190811015613608577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60209190910360031b1b16919050565b600060ff831680613d5057613d506137f6565b8060ff84160691505092915050565b600060ff821660ff841680821015613d7957613d796137b0565b90039392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fdfea164736f6c634300080f000a" diff --git a/op-bindings/go.mod b/op-bindings/go.mod index e919ffadbd61e..16e2bfc8ddabf 100644 --- a/op-bindings/go.mod +++ b/op-bindings/go.mod @@ -3,8 +3,8 @@ module github.com/ethereum-optimism/optimism/op-bindings go 1.18 require ( - github.com/ethereum/go-ethereum v1.10.17 - github.com/stretchr/testify v1.7.0 + github.com/ethereum/go-ethereum v1.10.20 + github.com/stretchr/testify v1.7.2 ) require ( @@ -31,14 +31,14 @@ require ( github.com/rivo/uniseg v0.2.0 // indirect github.com/rjeczalik/notify v0.9.2 // indirect github.com/shirou/gopsutil v3.21.11+incompatible // indirect - github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect + github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a // indirect github.com/tklauser/go-sysconf v0.3.10 // indirect github.com/tklauser/numcpus v0.4.0 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect golang.org/x/crypto v0.0.0-20220307211146-efcb8507fb70 // indirect - golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5 // indirect + golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect - gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) -replace github.com/ethereum/go-ethereum v1.10.17 => github.com/ethereum-optimism/reference-optimistic-geth v0.0.0-20220711171946-f579014dc46d +replace github.com/ethereum/go-ethereum v1.10.20 => github.com/ethereum-optimism/reference-optimistic-geth v0.0.0-20220715235548-70b02481016d diff --git a/op-bindings/go.sum b/op-bindings/go.sum index 5ab6a010c9a9a..08ba986bbfdf7 100644 --- a/op-bindings/go.sum +++ b/op-bindings/go.sum @@ -1,74 +1,22 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.43.0/go.mod h1:BOSR3VbTLkk6FDC/TcffxP4NF/FFBGA5ku+jvKOP7pg= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.51.0/go.mod h1:hWtGJ6gnXH+KgDv+V0zFGDvpi07n3z8ZNj3T1RW0Gcw= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigtable v1.2.0/go.mod h1:JcVAOl45lrTmQfLj7T6TxyMzIN/3FGGcFm+2xVAli2o= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= -github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0/go.mod h1:tPaiy8S5bQ+S5sOiDlINkp7+Ef339+Nz5L5XO+cnOHo= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/VictoriaMetrics/fastcache v1.9.0 h1:oMwsS6c8abz98B7ytAewQ7M1ZN/Im/iwKoE1euaFvhs= github.com/VictoriaMetrics/fastcache v1.9.0/go.mod h1:otoTS3xu+6IzF/qByjqzjp3rTuzM3Qf0ScU1UTj97iU= -github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah4HI848JfFxHt+iPb26b4zyfspmqY0/8= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= -github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= -github.com/apache/arrow/go/arrow v0.0.0-20191024131854-af6fa24be0db/go.mod h1:VTxUBvSJ3s3eHAg65PNgrsn5BtqCRPdmyXh6rAfdxN0= -github.com/aws/aws-sdk-go-v2 v1.2.0/go.mod h1:zEQs02YRBw1DjK0PoJv3ygDYOFTre1ejlJWl8FwAuQo= -github.com/aws/aws-sdk-go-v2/config v1.1.1/go.mod h1:0XsVy9lBI/BCXm+2Tuvt39YmdHwS5unDQmxZOYe8F5Y= -github.com/aws/aws-sdk-go-v2/credentials v1.1.1/go.mod h1:mM2iIjwl7LULWtS6JCACyInboHirisUUdkBPoTHMOUo= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.2/go.mod h1:3hGg3PpiEjHnrkrlasTfxFqUsZ2GCk/fMUn4CbKgSkM= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.2/go.mod h1:45MfaXZ0cNbeuT0KQ1XJylq8A6+OpVV2E5kvY/Kq+u8= -github.com/aws/aws-sdk-go-v2/service/route53 v1.1.1/go.mod h1:rLiOUrPLW/Er5kRcQ7NkwbjlijluLsrIbu/iyl35RO4= -github.com/aws/aws-sdk-go-v2/service/sso v1.1.1/go.mod h1:SuZJxklHxLAXgLTc1iFXbEWkXs7QRTQpCLGaKIprQW0= -github.com/aws/aws-sdk-go-v2/service/sts v1.1.1/go.mod h1:Wi0EBZwiz/K44YliU0EKxqTCJGUfYTWXrrBwkq736bM= -github.com/aws/smithy-go v1.1.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= -github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= -github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= github.com/btcsuite/btcd/btcec/v2 v2.2.0 h1:fzn1qaOt32TuLjFlkzYSsBC35Q3KUjT1SwPxiMSCF5k= github.com/btcsuite/btcd/btcec/v2 v2.2.0/go.mod h1:U7MHm051Al6XmscBQ0BoNydpOTsFAn707034b5nY8zU= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= -github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= -github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/cp v0.1.0 h1:SE+dxFebS7Iik5LK0tsi1k9ZCxEaFX4AjQmoyA+1dJk= -github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudflare/cloudflare-go v0.14.0/go.mod h1:EnwdgGMaFOruiPZRFSgn+TsQ3hQ7C/YWzIGLeu5c304= -github.com/consensys/bavard v0.1.8-0.20210406032232-f3452dc9b572/go.mod h1:Bpd0/3mZuaj6Sj+PqrmIquiOKy397AKGThQPaGzNXAQ= -github.com/consensys/gnark-crypto v0.4.1-0.20210426202927-39ac3d4b3f1f/go.mod h1:815PAHg3wvysy0SyIqanF8gZ0Y1wjk/hrDHD/iT88+Q= -github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= -github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -78,109 +26,49 @@ github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1m5sE92cU+pd5Mcc= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= -github.com/deepmap/oapi-codegen v1.6.0/go.mod h1:ryDa9AgbELGeB+YEXE1dR53yAjHwFvE9iAUlWl9Al3M= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8/go.mod h1:VMaSuZ+SZcx/wljOQKvp5srsbCiKDEb6K2wC4+PiBmQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= -github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= -github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= -github.com/docker/docker v1.6.2/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/dop251/goja v0.0.0-20220405120441-9037c2b61cbf/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= -github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y= -github.com/eclipse/paho.mqtt.golang v1.2.0/go.mod h1:H9keYFcgq3Qr5OUJm/JZI/i6U7joQ8SYLhZwfeOo6Ts= -github.com/edsrzf/mmap-go v1.1.0 h1:6EUwBLQ/Mcr1EYLE4Tn1VdW1A4ckqCQWZBw8Hr0kjpQ= -github.com/edsrzf/mmap-go v1.1.0/go.mod h1:19H/e8pUPLicwkyNgOykDXkJ9F0MHE+Z52B8EIth78Q= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/ethereum-optimism/optimism/op-bindings v0.0.0-20220614233543-0d8fa52afca2/go.mod h1:e9mMYiVsdJf9BI//FdaA77BwNNgNMR043JtB7CPXNxY= -github.com/ethereum-optimism/reference-optimistic-geth v0.0.0-20220711171946-f579014dc46d h1:AYFFbxrz7kLyFbvNHGhUPZQT8KnN1PPjCj4oAcgaVCk= -github.com/ethereum-optimism/reference-optimistic-geth v0.0.0-20220711171946-f579014dc46d/go.mod h1:8AfU1epKggKxDt9wr7rH5KmCeiT3yT0sEvroru1mO6Q= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fjl/gencodec v0.0.0-20220412091415-8bb9e558978c/go.mod h1:AzA8Lj6YtixmJWL+wkKoBGsLWy9gFrAzi4g+5bCKwpY= -github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= -github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= +github.com/edsrzf/mmap-go v1.0.0 h1:CEBF7HpRnUCSJgGUb5h1Gm7e3VkmVDrR8lvWVLtrOFw= +github.com/ethereum-optimism/reference-optimistic-geth v0.0.0-20220715235548-70b02481016d h1:w0DBXhp0sv0bWRDOCA/Y6yHOALU7qLLLf5/kE3YfFr4= +github.com/ethereum-optimism/reference-optimistic-geth v0.0.0-20220715235548-70b02481016d/go.mod h1:m2m08SAQ8XB0VcVBoDg9n74Dw5PUMl3hzv1NXVBFPfg= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/garslo/gogen v0.0.0-20170306192744-1d203ffc1f61/go.mod h1:Q0X6pkwTILDlzrGEckF6HKjXe48EgsY/l7K7vhY4MW8= -github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= -github.com/getkin/kin-openapi v0.53.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= -github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= -github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= +github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/go-kit/kit v0.8.0 h1:Wz+5lgoB0kkuqLEc6NVmwRknTKP6dTGbSqvhZtBI/j0= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0 h1:MP4Eh7ZCb31lleYCFuwm0oe4/YGak+5l1vA2NOE80nA= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= -github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= -github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/golang-jwt/jwt/v4 v4.3.0 h1:kHL1vqdqWNfATmA0FNMdmZNMyZI1U6O31X4rlIPoBog= github.com/golang-jwt/jwt/v4 v4.3.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= -github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golangci/lint-1 v0.0.0-20181222135242-d2cdd8c08219/go.mod h1:/X8TswGSh1pIozq4ZwCfxS0WA5JGXguxk94ar/4c87Y= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/flatbuffers v1.11.0/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/graph-gophers/graphql-go v1.3.0/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= -github.com/hashicorp/go-bexpr v0.1.10/go.mod h1:oxlubA2vC/gFVfX1A6JGp7ls7uCDlfJn732ehYYg+g0= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= @@ -188,421 +76,155 @@ github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iU github.com/holiman/uint256 v1.2.0 h1:gpSYcPLWGv4sG43I2mVLiDZCNDh/EpGjSk8tmtxitHM= github.com/holiman/uint256 v1.2.0/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/huin/goupnp v1.0.3/go.mod h1:ZxNlw5WqJj6wSsRK5+YfflQGXYfccj5VgQsMNixHM7Y= -github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/influxdata/flux v0.65.1/go.mod h1:J754/zds0vvpfwuq7Gc2wRdVwEodfpCFM7mYlOw2LqY= -github.com/influxdata/influxdb v1.8.3/go.mod h1:JugdFhsvvI8gadxOI6noqNeeBHvWNTbfYGtiAn+2jhI= -github.com/influxdata/influxdb-client-go/v2 v2.4.0/go.mod h1:vLNHdxTJkIf2mSLvGrpj8TCcISApPoXkaxP8g9uRlW8= -github.com/influxdata/influxql v1.1.1-0.20200828144457-65d3ef77d385/go.mod h1:gHp9y86a/pxhjJ+zMjNXiQAA197Xk9wLxaz+fGG+kWk= -github.com/influxdata/line-protocol v0.0.0-20180522152040-32c6aa80de5e/go.mod h1:4kt73NQhadE3daL3WhR5EJ/J2ocX0PZzwxQ0gXJ7oFE= -github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo= -github.com/influxdata/promql/v2 v2.12.0/go.mod h1:fxOPu+DY0bqCTCECchSRtWfc+0X19ybifQhZoQNF5D8= -github.com/influxdata/roaring v0.4.13-0.20180809181101-fc520f41fab6/go.mod h1:bSgUQ7q5ZLSO+bKBGqJiCBGAl+9DxyW63zLTujjUlOE= -github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9/go.mod h1:Js0mqiSBE6Ffsg94weZZ2c+v/ciT8QRHFOap7EKDrR0= -github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368/go.mod h1:Wbbw6tYNvwa5dlB6304Sd+82Z3f7PmVZHVKU637d4po= -github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= -github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU= -github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= -github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jsternberg/zap-logfmt v1.0.0/go.mod h1:uvPs/4X51zdkcm5jXl5SYoN+4RK21K8mysFmDaM/h+o= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= -github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef/go.mod h1:Ct9fl0F6iIOGgxJ5npU/IUOhOhqlVrGjyIZc8/MagT0= -github.com/karalabe/usb v0.0.2/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= -github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6/go.mod h1:+ZoRqAPRLkC4NPOvfYeR5KNOrY6TD+/sAC3HXPZgDYg= -github.com/klauspost/pgzip v1.0.2-0.20170402124221-0bf5dcad4ada/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v0.0.0-20170224010052-a616ab194758/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= -github.com/labstack/echo/v4 v4.2.1/go.mod h1:AA49e0DZ8kk5jTOOCKNuPR6oTnBS0dYiM4FW1e6jwpg= -github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= -github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= -github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/matryer/moq v0.0.0-20190312154309-6cfb0558e1bd/go.mod h1:9ELz6aaclSIGnZBoaSLZ3NAl1VTufbOrXBPvtcy6WiQ= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= -github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= -github.com/mattn/go-tty v0.0.0-20180907095812-13ff1204f104/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= -github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= -github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= -github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/opentracing/opentracing-go v1.0.3-0.20180606204148-bd9c31933947/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/paulbellamy/ratecounter v0.2.0/go.mod h1:Hfx1hDpSGoqxkVVpBi/IlYD7kChlfo5C6hzIHwPqfFE= -github.com/peterh/liner v1.0.1-0.20180619022028-8c1271fcf47f/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc= -github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= -github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= -github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw= +github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/term v0.0.0-20180730021639-bffc007b7fd5/go.mod h1:eCbImbZ95eXtAUIbLAuAVnBnwf83mjf6QIVH8SHYwqQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/tsdb v0.10.0 h1:If5rVCMTp6W2SiRAQFlbpJNgVlgMEd+U2GZckwK38ic= github.com/prometheus/tsdb v0.10.0/go.mod h1:oi49uRhEe9dPUTlS3JRZOwJuVi6tmh10QSgwXEyGCt4= -github.com/retailnext/hllpp v1.0.1-0.20180308014038-101a6d2f8b52/go.mod h1:RDpi1RftBQPUCDRw6SmxeaREsAaRKnOclghuzp/WRzc= github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rjeczalik/notify v0.9.2 h1:MiTWrPj55mNDHEiIX5YUSKefw/+lCQVoAFmD6oQm5w8= github.com/rjeczalik/notify v0.9.2/go.mod h1:aErll2f0sUX9PXZnVNyeiObbmTlk5jnMoCa4QEjJeqM= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/segmentio/kafka-go v0.1.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= -github.com/segmentio/kafka-go v0.2.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.0/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= -github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= -github.com/tinylib/msgp v1.0.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= +github.com/stretchr/testify v1.7.2 h1:4jaiDzPyXQvSd7D0EjG45355tLlV3VOECpq10pLC+8s= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= +github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a h1:1ur3QoCqvE5fl+nylMaIr9PVV1w343YRDtsy+Rwu7XI= +github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= github.com/tklauser/go-sysconf v0.3.10 h1:IJ1AZGZRWbY8T5Vfk04D9WOA5WSejdflXxP03OUqALw= github.com/tklauser/go-sysconf v0.3.10/go.mod h1:C8XykCvCb+Gn0oNCWPIlcb0RuglQTYaQ2hGm7jmxEFk= github.com/tklauser/numcpus v0.4.0 h1:E53Dm1HjH1/R2/aoCtXtPgzmElmn51aOkhCFSuZq//o= github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hMwiKKqXCQ= -github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= -github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/willf/bitset v1.1.3/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= -github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg= github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190909091759-094676da4a83/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220307211146-efcb8507fb70 h1:syTAU9FwmvzEoIYMqcPHOcVm4H3U5u90WsvuYgwpETU= golang.org/x/crypto v0.0.0-20220307211146-efcb8507fb70/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20220426173459-3bcf042a4bf5/go.mod h1:lgLbSvA5ygNOMpwM/9anMpWVlVJ7Z+cHWq/eFuinpGE= -golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= -golang.org/x/mod v0.6.0-dev.0.20211013180041-c96bc1413d57/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210220033124-5f55cee0dc0d/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 h1:CIJ76btIcR3eFI5EgSo6k1qKw9KJexJuRLI9G7Hp5wE= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220607020251-c690dde0001d h1:4SFsTMi4UahlKoloni7L4eYzhFRifURQLw+yv0QDCx8= +golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180926160741-c2ed4eda69e7/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200107162124-548cf772de50/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210420205809-ac73e9fd8988/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5 h1:y/woIyUBFbpQGKS0u1aHF/40WUDnek3fPOyD08H5Vng= -golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191126055441-b0650ceb63d9/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200108203644-89082a384178/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.8-0.20211029000441-d6a9af8af023/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= -gonum.org/v1/gonum v0.0.0-20181121035319-3f7ecaa7e8ca/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= -gonum.org/v1/gonum v0.6.0/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= -gonum.org/v1/netlib v0.0.0-20181029234149-ec6d1f5cefe6/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= -gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= -gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190716160619-c506a9f90610/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200108215221-bd8f9a0ef82f/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/urfave/cli.v1 v1.20.0/go.mod h1:vuBzUtMdQeixQj8LVd+/98pzhxNGQoyuPBlsXHOQNO0= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/op-e2e/go.mod b/op-e2e/go.mod index be52b9e797e33..4154356d8f615 100644 --- a/op-e2e/go.mod +++ b/op-e2e/go.mod @@ -7,7 +7,7 @@ require ( github.com/ethereum-optimism/optimism/op-bindings v0.3.0 github.com/ethereum-optimism/optimism/op-node v0.3.0 github.com/ethereum-optimism/optimism/op-proposer v0.3.0 - github.com/ethereum/go-ethereum v1.10.17 + github.com/ethereum/go-ethereum v1.10.20 github.com/libp2p/go-libp2p v0.18.1 github.com/libp2p/go-libp2p-core v0.15.0 github.com/miguelmota/go-ethereum-hdwallet v0.1.1 @@ -135,19 +135,21 @@ require ( github.com/shirou/gopsutil v3.21.11+incompatible // indirect github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572 // indirect github.com/status-im/keycard-go v0.0.0-20211109104530-b0e0482ba91d // indirect - github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect + github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a // indirect github.com/tklauser/go-sysconf v0.3.10 // indirect github.com/tklauser/numcpus v0.4.0 // indirect github.com/tyler-smith/go-bip39 v1.1.0 // indirect github.com/urfave/cli v1.22.5 // indirect + github.com/urfave/cli/v2 v2.10.2 // indirect github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7 // indirect github.com/whyrusleeping/timecache v0.0.0-20160911033111-cfcb2f1abfee // indirect + github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect go.uber.org/atomic v1.9.0 // indirect go.uber.org/multierr v1.8.0 // indirect go.uber.org/zap v1.21.0 // indirect golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect - golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 // indirect + golang.org/x/net v0.0.0-20220607020251-c690dde0001d // indirect golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f // indirect golang.org/x/sys v0.0.0-20220701225701-179beb0bd1a1 // indirect golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect @@ -156,8 +158,7 @@ require ( google.golang.org/grpc v1.46.2 // indirect google.golang.org/protobuf v1.28.0 // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect - gopkg.in/urfave/cli.v1 v1.20.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) -replace github.com/ethereum/go-ethereum v1.10.17 => github.com/ethereum-optimism/reference-optimistic-geth v0.0.0-20220711171946-f579014dc46d +replace github.com/ethereum/go-ethereum v1.10.20 => github.com/ethereum-optimism/reference-optimistic-geth v0.0.0-20220715235548-70b02481016d diff --git a/op-e2e/go.sum b/op-e2e/go.sum index ff5913fd17a5a..6fc24d02ec4b4 100644 --- a/op-e2e/go.sum +++ b/op-e2e/go.sum @@ -46,9 +46,6 @@ github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96 h1:cTp8I5+VIo github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4= github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc= -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= -github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0/go.mod h1:tPaiy8S5bQ+S5sOiDlINkp7+Ef339+Nz5L5XO+cnOHo= github.com/Azure/azure-storage-blob-go v0.7.0/go.mod h1:f9YQKtsG1nMisotuTPpO0tjNuEjKRYAcJU8/ydDI++4= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= @@ -191,8 +188,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsr github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -209,7 +204,6 @@ github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1m5sE92cU+pd5Mcc= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= -github.com/deepmap/oapi-codegen v1.6.0/go.mod h1:ryDa9AgbELGeB+YEXE1dR53yAjHwFvE9iAUlWl9Al3M= github.com/dgraph-io/badger v1.6.2 h1:mNw0qs90GVgGGWylh0umH5iag1j6n/PeJtNvL6KY/x8= github.com/dgraph-io/badger v1.6.2/go.mod h1:JW2yswe3V058sS0kZ2h/AXeDSqFjxnZcRrVH//y2UQE= github.com/dgraph-io/ristretto v0.0.2 h1:a5WaUrDa0qm0YrAAS1tUykT5El3kt62KNZZeMxQn3po= @@ -219,16 +213,10 @@ github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8/go.mod h1:VMa github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dlclark/regexp2 v1.2.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= -github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= -github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= -github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v1.6.2/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dop251/goja v0.0.0-20200721192441-a695b0cdd498/go.mod h1:Mw6PkjjMXWbTj+nnj4s3QPXq1jaT0s5pC0iFD4+BOAA= -github.com/dop251/goja v0.0.0-20220405120441-9037c2b61cbf/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= -github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= @@ -251,18 +239,16 @@ github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go. github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/ethereum-optimism/optimism/op-batcher v0.3.0 h1:rNEUyu7ZTUZc1W1lM9lO71w/HZ9pjQtnNwR/e1I0XyQ= github.com/ethereum-optimism/optimism/op-batcher v0.3.0/go.mod h1:1imFCpIIA70WVZX7gp4dH/ZSnfqcG/WNvVp8Xm2s2VU= -github.com/ethereum-optimism/optimism/op-bindings v0.0.0-20220614233543-0d8fa52afca2/go.mod h1:e9mMYiVsdJf9BI//FdaA77BwNNgNMR043JtB7CPXNxY= github.com/ethereum-optimism/optimism/op-bindings v0.3.0 h1:d2Mwb8FzR2zuhW0sS5xFKWz/6VFPTEIE+XINqZj0Rv4= github.com/ethereum-optimism/optimism/op-bindings v0.3.0/go.mod h1:CrvUVIISKcyJ7o27ub/HY4Kq9wEJQxrGmWthTqxPSGo= github.com/ethereum-optimism/optimism/op-node v0.3.0 h1:jep/cbIbP7fjBSAR48yk5NJVEoGYvoNlYI00KpBI6Mw= github.com/ethereum-optimism/optimism/op-node v0.3.0/go.mod h1:iF9AhYjr8jNeoCDNP/Vs/ywQ2USZU5L66AxZbSAUi0E= github.com/ethereum-optimism/optimism/op-proposer v0.3.0 h1:K1ipZt3TLD0BJi7tKOmx8tCLXj9i4f4baBIhbPmUxk4= github.com/ethereum-optimism/optimism/op-proposer v0.3.0/go.mod h1:GcQ9VCWz2zEVexecq5IYo/2eadK/y7IBOEfx4YV1QJk= -github.com/ethereum-optimism/reference-optimistic-geth v0.0.0-20220711171946-f579014dc46d h1:AYFFbxrz7kLyFbvNHGhUPZQT8KnN1PPjCj4oAcgaVCk= -github.com/ethereum-optimism/reference-optimistic-geth v0.0.0-20220711171946-f579014dc46d/go.mod h1:8AfU1epKggKxDt9wr7rH5KmCeiT3yT0sEvroru1mO6Q= +github.com/ethereum-optimism/reference-optimistic-geth v0.0.0-20220715235548-70b02481016d h1:w0DBXhp0sv0bWRDOCA/Y6yHOALU7qLLLf5/kE3YfFr4= +github.com/ethereum-optimism/reference-optimistic-geth v0.0.0-20220715235548-70b02481016d/go.mod h1:m2m08SAQ8XB0VcVBoDg9n74Dw5PUMl3hzv1NXVBFPfg= 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/fjl/gencodec v0.0.0-20220412091415-8bb9e558978c/go.mod h1:AzA8Lj6YtixmJWL+wkKoBGsLWy9gFrAzi4g+5bCKwpY= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= 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= @@ -277,16 +263,14 @@ github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2 github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= -github.com/garslo/gogen v0.0.0-20170306192744-1d203ffc1f61/go.mod h1:Q0X6pkwTILDlzrGEckF6HKjXe48EgsY/l7K7vhY4MW8= +github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 h1:f6D9Hr8xV8uYKlyuj8XIruxlh9WjVjdh1gIicAS7ays= github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= -github.com/getkin/kin-openapi v0.53.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= -github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs= github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -305,10 +289,7 @@ github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KE github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-sourcemap/sourcemap v2.1.2+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= -github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= @@ -368,7 +349,6 @@ github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEW github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golangci/lint-1 v0.0.0-20181222135242-d2cdd8c08219/go.mod h1:/X8TswGSh1pIozq4ZwCfxS0WA5JGXguxk94ar/4c87Y= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/flatbuffers v1.11.0/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= @@ -400,6 +380,7 @@ github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -415,13 +396,11 @@ github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORR github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/graph-gophers/graphql-go v0.0.0-20201113091052-beb923fada29/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= -github.com/graph-gophers/graphql-go v1.3.0/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= @@ -435,7 +414,6 @@ github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyN github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-bexpr v0.1.10/go.mod h1:oxlubA2vC/gFVfX1A6JGp7ls7uCDlfJn732ehYYg+g0= github.com/hashicorp/go-bexpr v0.1.11 h1:6DqdA/KBjurGby9yTY0bmkathya0lfwF2SeuubCI7dY= github.com/hashicorp/go-bexpr v0.1.11/go.mod h1:f03lAo0duBlDIUMGCuad8oLcgejw4m7U+N8T+6Kz1AE= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= @@ -474,14 +452,13 @@ github.com/huin/goupnp v1.0.3 h1:N8No57ls+MnjlB+JPiCVSOyy/ot7MJTqlo7rn+NYSqQ= github.com/huin/goupnp v1.0.3/go.mod h1:ZxNlw5WqJj6wSsRK5+YfflQGXYfccj5VgQsMNixHM7Y= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/influxdata/flux v0.65.1/go.mod h1:J754/zds0vvpfwuq7Gc2wRdVwEodfpCFM7mYlOw2LqY= github.com/influxdata/influxdb v1.8.3/go.mod h1:JugdFhsvvI8gadxOI6noqNeeBHvWNTbfYGtiAn+2jhI= -github.com/influxdata/influxdb-client-go/v2 v2.4.0/go.mod h1:vLNHdxTJkIf2mSLvGrpj8TCcISApPoXkaxP8g9uRlW8= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/influxdata/influxql v1.1.1-0.20200828144457-65d3ef77d385/go.mod h1:gHp9y86a/pxhjJ+zMjNXiQAA197Xk9wLxaz+fGG+kWk= github.com/influxdata/line-protocol v0.0.0-20180522152040-32c6aa80de5e/go.mod h1:4kt73NQhadE3daL3WhR5EJ/J2ocX0PZzwxQ0gXJ7oFE= -github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo= github.com/influxdata/promql/v2 v2.12.0/go.mod h1:fxOPu+DY0bqCTCECchSRtWfc+0X19ybifQhZoQNF5D8= github.com/influxdata/roaring v0.4.13-0.20180809181101-fc520f41fab6/go.mod h1:bSgUQ7q5ZLSO+bKBGqJiCBGAl+9DxyW63zLTujjUlOE= github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9/go.mod h1:Js0mqiSBE6Ffsg94weZZ2c+v/ciT8QRHFOap7EKDrR0= @@ -548,7 +525,6 @@ github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef/go.mod h1:Ct9fl0F6iIOGgxJ5npU/IUOhOhqlVrGjyIZc8/MagT0= github.com/kami-zh/go-capturer v0.0.0-20171211120116-e492ea43421d/go.mod h1:P2viExyCEfeWGU259JnaQ34Inuec4R38JCyBx2edgD0= github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= -github.com/karalabe/usb v0.0.2/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= @@ -576,13 +552,9 @@ github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfn github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v0.0.0-20170224010052-a616ab194758/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/labstack/echo/v4 v4.2.1/go.mod h1:AA49e0DZ8kk5jTOOCKNuPR6oTnBS0dYiM4FW1e6jwpg= -github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/libp2p/go-addr-util v0.1.0/go.mod h1:6I3ZYuFr2O/9D+SoyM0zEw0EF3YkldtTX406BpdQMqw= @@ -721,8 +693,6 @@ github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0Q github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/marten-seemann/qpack v0.2.1/go.mod h1:F7Gl5L1jIgN1D11ucXefiuJS9UMVP2opoCp2jDKb7wc= github.com/marten-seemann/qtls-go1-15 v0.1.4/go.mod h1:GyFwywLKkRt+6mfU99csTEY1joMZz5vmB1WNZH3P81I= github.com/marten-seemann/qtls-go1-16 v0.1.4 h1:xbHbOGGhrenVtII6Co8akhLEdrawwB2iHl5yhJRpnco= @@ -733,13 +703,9 @@ github.com/marten-seemann/qtls-go1-18 v0.1.0-beta.1 h1:EnzzN9fPUkUck/1CuY1FlzBaI github.com/marten-seemann/qtls-go1-18 v0.1.0-beta.1/go.mod h1:PUhIQk19LoFt2174H4+an8TYvWOGjb/hHwphBeaDHwI= github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd h1:br0buuQ854V8u83wA0rVZ8ttrq5CpaPZdvrK0LP2lOk= github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd/go.mod h1:QuCEs1Nt24+FYQEqAAncTDPJIuGs+LxK1MCiFL25pMU= -github.com/matryer/moq v0.0.0-20190312154309-6cfb0558e1bd/go.mod h1:9ELz6aaclSIGnZBoaSLZ3NAl1VTufbOrXBPvtcy6WiQ= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.0/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-ieproxy v0.0.0-20190610004146-91bb50d98149/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= @@ -748,9 +714,6 @@ github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNx github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.5-0.20180830101745-3fb116b82035/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.13/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= @@ -797,7 +760,6 @@ github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4= github.com/mitchellh/pointerstructure v1.2.1 h1:ZhBBeX8tSlRpu/FFhXH4RC4OJzFlqsQhoHZAz4x7TIw= github.com/mitchellh/pointerstructure v1.2.1/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -805,7 +767,6 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= github.com/mr-tron/base58 v1.1.0/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= github.com/mr-tron/base58 v1.1.2/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/mr-tron/base58 v1.1.3/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= @@ -879,20 +840,23 @@ github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.2/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvwxz1E= -github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= +github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw= +github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/runtime-spec v1.0.2 h1:UfAcuLBJB9Coz72x1hgl8O5RVzTdNiaglX6v2DM6FI0= github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= @@ -1072,12 +1036,13 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ= github.com/syndtr/goleveldb v1.0.1-0.20210305035536-64b5b1c73954/go.mod h1:u2MKkTVTVJWe5D1rCvame8WqhBd88EuIwODJZ1VHCPM= -github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= -github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= +github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a h1:1ur3QoCqvE5fl+nylMaIr9PVV1w343YRDtsy+Rwu7XI= +github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA= github.com/tinylib/msgp v1.0.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= github.com/tklauser/go-sysconf v0.3.5/go.mod h1:MkWzOF4RMCshBAMXuhXJs64Rte09mITnppBXY/rYEFI= @@ -1097,9 +1062,8 @@ github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtX github.com/urfave/cli v1.22.5 h1:lNq9sAHXK2qfdI8W+GRItjCEkI+2oR4d+MEHy1CKXoU= github.com/urfave/cli v1.22.5/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= +github.com/urfave/cli/v2 v2.10.2 h1:x3p8awjp/2arX+Nl/G2040AZpOCHS/eMJJ1/a+mye4Y= +github.com/urfave/cli/v2 v2.10.2/go.mod h1:f8iq5LtQ/bLxafbdBSLPPNsgaW0l/2fYYEHhAyPlwvo= github.com/viant/assertly v0.4.8/go.mod h1:aGifi++jvCrUaklKEKT0BU95igDNaqkvz+49uaYMPRU= github.com/viant/toolbox v0.24.0/go.mod h1:OxMCG57V0PXuIP2HNQrtJf2CjqdmbrOx5EkMILuUhzM= github.com/whyrusleeping/go-logging v0.0.0-20170515211332-0457bb6b88fc/go.mod h1:bopw91TMyo8J3tvftk8xmU2kPmlrt4nScJQZU2hE5EM= @@ -1113,12 +1077,13 @@ github.com/x-cray/logrus-prefixed-formatter v0.5.2/go.mod h1:2duySbKsL6M18s5GU7V github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= +github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg= github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= @@ -1183,14 +1148,10 @@ golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200602180216-279210d13fed/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210506145944-38f3c27a63bf/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= golang.org/x/crypto v0.0.0-20210813211128-0a44fdfbc16e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220307211146-efcb8507fb70/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e h1:T8NU3HyQ8ClP4SEE+KbFlg6n0NhuTsN4MyznaarGsZM= golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1206,7 +1167,6 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20220426173459-3bcf042a4bf5/go.mod h1:lgLbSvA5ygNOMpwM/9anMpWVlVJ7Z+cHWq/eFuinpGE= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -1230,8 +1190,6 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= -golang.org/x/mod v0.6.0-dev.0.20211013180041-c96bc1413d57/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1276,7 +1234,6 @@ golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210220033124-5f55cee0dc0d/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= @@ -1286,15 +1243,11 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20210423184538-5f58ad60dda6/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 h1:NWy5+hlRbC7HK+PmcXVUmW1IMyFce7to56IUvhUFm7Y= -golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220607020251-c690dde0001d h1:4SFsTMi4UahlKoloni7L4eYzhFRifURQLw+yv0QDCx8= +golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1345,7 +1298,6 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1379,7 +1331,6 @@ golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1403,12 +1354,12 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220701225701-179beb0bd1a1 h1:+Lm8wRwJpsVpTHuM4tHTwgxjPzv/bjxsHt2cW5EY7XU= golang.org/x/sys v0.0.0-20220701225701-179beb0bd1a1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= @@ -1421,7 +1372,6 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= @@ -1430,7 +1380,6 @@ golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20220224211638-0e9765cccd65 h1:M73Iuj3xbbb9Uk1DYhzydthsj6oOd6l9bpuFcNoUvTs= golang.org/x/time v0.0.0-20220224211638-0e9765cccd65/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1463,7 +1412,6 @@ golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191126055441-b0650ceb63d9/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -1493,12 +1441,12 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.8-0.20211029000441-d6a9af8af023/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.11 h1:loJ25fNOEhSXfHrpoGj91eCUThwdNX6u24rO1xnNteY= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.0.0-20181121035319-3f7ecaa7e8ca/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.6.0/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= @@ -1630,7 +1578,6 @@ gopkg.in/src-d/go-cli.v0 v0.0.0-20181105080154-d492247bbc0d/go.mod h1:z+K8VcOYVY gopkg.in/src-d/go-log.v1 v1.0.1/go.mod h1:GN34hKP0g305ysm2/hctJ0Y8nWP3zxXXJ8GFabTyABE= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/urfave/cli.v1 v1.20.0 h1:NdAVW6RYxDif9DhDHaAortIu956m2c0v+09AZBPTbE0= gopkg.in/urfave/cli.v1 v1.20.0/go.mod h1:vuBzUtMdQeixQj8LVd+/98pzhxNGQoyuPBlsXHOQNO0= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= diff --git a/op-e2e/setup.go b/op-e2e/setup.go index dd17f2924a943..fb30e98214d1f 100644 --- a/op-e2e/setup.go +++ b/op-e2e/setup.go @@ -50,11 +50,7 @@ func deriveAccount(w accounts.Wallet, path string) accounts.Account { type L2OOContractConfig struct { SubmissionFrequency *big.Int - L2StartingBlock *big.Int - GenesisL2Output [32]byte HistoricalTotalBlocks *big.Int - L2StartingTimeStamp *big.Int - L2BlockTime *big.Int } type DepositContractConfig struct { @@ -281,7 +277,7 @@ func (cfg SystemConfig) start() (*System, error) { IstanbulBlock: common.Big0, BerlinBlock: common.Big0, LondonBlock: common.Big0, - MergeForkBlock: common.Big0, + MergeNetsplitBlock: common.Big0, TerminalTotalDifficulty: common.Big0, Optimism: ¶ms.OptimismConfig{ BaseFeeRecipient: cfg.BaseFeeRecipient, @@ -388,9 +384,6 @@ func (cfg SystemConfig) start() (*System, error) { sys.cfg.RollupConfig.Genesis = sys.RolupGenesis sys.cfg.RollupConfig.BatchSenderAddress = batchSubmitterAddr sys.cfg.RollupConfig.P2PSequencerAddress = p2pSignerAddr - sys.cfg.L2OOCfg.L2StartingBlock = new(big.Int).SetUint64(l2GenesisID.Number) - sys.cfg.L2OOCfg.L2StartingTimeStamp = new(big.Int).SetUint64(l2Genesis.Timestamp) - sys.cfg.L2OOCfg.L2BlockTime = new(big.Int).SetUint64(2) // Deploy Deposit Contract deployerPrivKey, err := sys.wallet.PrivateKey(accounts.Account{ @@ -407,16 +400,21 @@ func (cfg SystemConfig) start() (*System, error) { return nil, err } + // empty genesis L2 output. + // Technically this may need to be computed with l2.ComputeL2OutputRoot(...), + // but there are no fraud proofs active in the test. + genesisL2Output := [32]byte{} + // Deploy contracts sys.L2OOContractAddr, _, _, err = bindings.DeployL2OutputOracle( opts, l1Client, sys.cfg.L2OOCfg.SubmissionFrequency, - sys.cfg.L2OOCfg.GenesisL2Output, + genesisL2Output, sys.cfg.L2OOCfg.HistoricalTotalBlocks, - sys.cfg.L2OOCfg.L2StartingBlock, - sys.cfg.L2OOCfg.L2StartingTimeStamp, - sys.cfg.L2OOCfg.L2BlockTime, + new(big.Int).SetUint64(l2GenesisID.Number), + new(big.Int).SetUint64(l2Genesis.Timestamp), + new(big.Int).SetUint64(sys.cfg.RollupConfig.BlockTime), l2OutputSubmitterAddr, crypto.PubkeyToAddress(deployerPrivKey.PublicKey), ) @@ -435,7 +433,8 @@ func (cfg SystemConfig) start() (*System, error) { return nil, err } - _, err = waitForTransaction(tx.Hash(), l1Client, time.Duration(cfg.L1BlockTime)*time.Second*2) + // Wait up to 6 blocks to deploy the Optimism portal + _, err = waitForTransaction(tx.Hash(), l1Client, 6*time.Second*time.Duration(cfg.L1BlockTime)) if err != nil { return nil, fmt.Errorf("waiting for OptimismPortal: %w", err) } diff --git a/op-e2e/system_test.go b/op-e2e/system_test.go index 783c5421b8445..dcc6b113dabd5 100644 --- a/op-e2e/system_test.go +++ b/op-e2e/system_test.go @@ -89,9 +89,7 @@ func defaultSystemConfig(t *testing.T) SystemConfig { FinalizationPeriod: big.NewInt(60 * 60 * 24), }, L2OOCfg: L2OOContractConfig{ - // L2 Start time is set based off of the L2 Genesis time SubmissionFrequency: big.NewInt(4), - L2BlockTime: big.NewInt(2), HistoricalTotalBlocks: big.NewInt(0), }, L2OutputHDPath: l2OutputHDPath, @@ -135,7 +133,7 @@ func defaultSystemConfig(t *testing.T) SystemConfig { RollupConfig: rollup.Config{ BlockTime: 1, MaxSequencerDrift: 10, - SeqWindowSize: 2, + SeqWindowSize: 30, ChannelTimeout: 20, L1ChainID: big.NewInt(900), L2ChainID: big.NewInt(901), @@ -464,7 +462,14 @@ func TestMissingBatchE2E(t *testing.T) { if !verboseGethNodes { log.Root().SetHandler(log.DiscardHandler()) } + // Note this test zeroes the balance of the batch-submitter to make the batches unable to go into L1. + // The test logs may look scary, but this is expected: + // 'batcher unable to publish transaction role=batcher err="insufficient funds for gas * price + value"' + cfg := defaultSystemConfig(t) + // small sequence window size so the test does not take as long + cfg.RollupConfig.SeqWindowSize = 4 + // Specifically set batch submitter balance to stop batches from being included cfg.Premine[bssHDPath] = 0 @@ -502,7 +507,7 @@ func TestMissingBatchE2E(t *testing.T) { require.Nil(t, err, "Waiting for L2 tx on sequencer") // Wait until the block it was first included in shows up in the safe chain on the verifier - _, err = waitForBlock(receipt.BlockNumber, l2Verif, 4*time.Second) + _, err = waitForBlock(receipt.BlockNumber, l2Verif, time.Duration(cfg.RollupConfig.SeqWindowSize*cfg.L1BlockTime)*time.Second) require.Nil(t, err, "Waiting for block on verifier") // Assert that the transaction is not found on the verifier @@ -894,12 +899,14 @@ func TestWithdrawals(t *testing.T) { opts.Value = nil tx, err = portal.FinalizeWithdrawalTransaction( opts, - params.Nonce, - params.Sender, - params.Target, - params.Value, - params.GasLimit, - params.Data, + bindings.TypesWithdrawalTransaction{ + Nonce: params.Nonce, + Sender: params.Sender, + Target: params.Target, + Value: params.Value, + GasLimit: params.GasLimit, + Data: params.Data, + }, params.BlockNumber, params.OutputRootProof, params.WithdrawalProof, diff --git a/op-node/flags/p2p_flags.go b/op-node/flags/p2p_flags.go index 6d1a006af7257..8d3da2502a517 100644 --- a/op-node/flags/p2p_flags.go +++ b/op-node/flags/p2p_flags.go @@ -97,7 +97,7 @@ var ( Usage: "Comma-separated multiaddr-format peer list. Static connections to make and maintain, these peers will be regarded as trusted.", Required: false, Value: "", - EnvVar: p2pEnv("BOOTNODES"), + EnvVar: p2pEnv("STATIC"), } HostMux = cli.StringFlag{ Name: "p2p.mux", diff --git a/op-node/go.mod b/op-node/go.mod index 669b8badd7506..6fe0ce156867b 100644 --- a/op-node/go.mod +++ b/op-node/go.mod @@ -4,7 +4,7 @@ go 1.18 require ( github.com/ethereum-optimism/optimism/op-bindings v0.3.0 - github.com/ethereum/go-ethereum v1.10.17 + github.com/ethereum/go-ethereum v1.10.20 github.com/golang/snappy v0.0.4 github.com/google/go-cmp v0.5.8 github.com/hashicorp/go-multierror v1.1.1 @@ -127,8 +127,7 @@ require ( github.com/multiformats/go-varint v0.0.6 // indirect github.com/nxadm/tail v1.4.8 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect - github.com/onsi/ginkgo v1.16.4 // indirect - github.com/onsi/gomega v1.19.0 // indirect + github.com/onsi/ginkgo v1.16.5 // indirect github.com/opencontainers/runtime-spec v1.0.2 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect github.com/pkg/errors v0.9.1 // indirect @@ -148,19 +147,21 @@ require ( github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572 // indirect github.com/status-im/keycard-go v0.0.0-20211109104530-b0e0482ba91d // indirect github.com/stretchr/objx v0.4.0 // indirect - github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect + github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a // indirect github.com/tklauser/go-sysconf v0.3.10 // indirect github.com/tklauser/numcpus v0.4.0 // indirect github.com/tyler-smith/go-bip39 v1.1.0 // indirect + github.com/urfave/cli/v2 v2.10.2 // indirect github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7 // indirect github.com/whyrusleeping/timecache v0.0.0-20160911033111-cfcb2f1abfee // indirect + github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect go.uber.org/atomic v1.9.0 // indirect go.uber.org/multierr v1.8.0 // indirect go.uber.org/zap v1.21.0 // indirect golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect - golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 // indirect + golang.org/x/net v0.0.0-20220607020251-c690dde0001d // indirect golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f // indirect golang.org/x/sys v0.0.0-20220701225701-179beb0bd1a1 // indirect golang.org/x/time v0.0.0-20220224211638-0e9765cccd65 // indirect @@ -169,11 +170,10 @@ require ( google.golang.org/protobuf v1.28.0 // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect - gopkg.in/urfave/cli.v1 v1.20.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) -replace github.com/ethereum/go-ethereum v1.10.17 => github.com/ethereum-optimism/reference-optimistic-geth v0.0.0-20220711171946-f579014dc46d +replace github.com/ethereum/go-ethereum v1.10.20 => github.com/ethereum-optimism/reference-optimistic-geth v0.0.0-20220715235548-70b02481016d // For local debugging: // replace github.com/ethereum/go-ethereum v1.10.17 => ../go-ethereum diff --git a/op-node/go.sum b/op-node/go.sum index afef16cdf9d17..c0e0644c32d63 100644 --- a/op-node/go.sum +++ b/op-node/go.sum @@ -3,13 +3,11 @@ cloud.google.com/go v0.31.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.37.0/go.mod h1:TS1dMSSfndXH133OKGwekG838Om/cQT0BUHV3HcBgoo= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.43.0/go.mod h1:BOSR3VbTLkk6FDC/TcffxP4NF/FFBGA5ku+jvKOP7pg= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.51.0/go.mod h1:hWtGJ6gnXH+KgDv+V0zFGDvpi07n3z8ZNj3T1RW0Gcw= cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= @@ -23,7 +21,6 @@ cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvf cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/bigtable v1.2.0/go.mod h1:JcVAOl45lrTmQfLj7T6TxyMzIN/3FGGcFm+2xVAli2o= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= @@ -35,7 +32,6 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE= dmitri.shuralyov.com/app/changes v0.0.0-20180602232624-0a106ad413e3/go.mod h1:Yl+fi1br7+Rr3LqpNJf1/uxUdtRUV+Tnj0o93V2B9MU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= dmitri.shuralyov.com/html/belt v0.0.0-20180602232347-f7d459c86be0/go.mod h1:JLBrvjyP0v+ecvNYvCpyZgu5/xkfAUhi6wJj28eUfSU= @@ -44,12 +40,8 @@ dmitri.shuralyov.com/state v0.0.0-20180228185332-28bcc343414c/go.mod h1:0PRwlb0D git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96 h1:cTp8I5+VIoKjsnZuH8vjyaysT/ses3EvZeaV/1UkF2M= github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= -github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0/go.mod h1:tPaiy8S5bQ+S5sOiDlINkp7+Ef339+Nz5L5XO+cnOHo= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= @@ -59,7 +51,6 @@ github.com/VictoriaMetrics/fastcache v1.9.0/go.mod h1:otoTS3xu+6IzF/qByjqzjp3rTu github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= -github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -68,10 +59,8 @@ github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk5 github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/allegro/bigcache v1.2.1 h1:hg1sY1raCwic3Vnsvje6TT7/pnZba83LeFck5NrFKSc= github.com/allegro/bigcache v1.2.1/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= -github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/apache/arrow/go/arrow v0.0.0-20191024131854-af6fa24be0db/go.mod h1:VTxUBvSJ3s3eHAg65PNgrsn5BtqCRPdmyXh6rAfdxN0= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= @@ -82,15 +71,6 @@ github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6l github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= -github.com/aws/aws-sdk-go-v2 v1.2.0/go.mod h1:zEQs02YRBw1DjK0PoJv3ygDYOFTre1ejlJWl8FwAuQo= -github.com/aws/aws-sdk-go-v2/config v1.1.1/go.mod h1:0XsVy9lBI/BCXm+2Tuvt39YmdHwS5unDQmxZOYe8F5Y= -github.com/aws/aws-sdk-go-v2/credentials v1.1.1/go.mod h1:mM2iIjwl7LULWtS6JCACyInboHirisUUdkBPoTHMOUo= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.2/go.mod h1:3hGg3PpiEjHnrkrlasTfxFqUsZ2GCk/fMUn4CbKgSkM= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.2/go.mod h1:45MfaXZ0cNbeuT0KQ1XJylq8A6+OpVV2E5kvY/Kq+u8= -github.com/aws/aws-sdk-go-v2/service/route53 v1.1.1/go.mod h1:rLiOUrPLW/Er5kRcQ7NkwbjlijluLsrIbu/iyl35RO4= -github.com/aws/aws-sdk-go-v2/service/sso v1.1.1/go.mod h1:SuZJxklHxLAXgLTc1iFXbEWkXs7QRTQpCLGaKIprQW0= -github.com/aws/aws-sdk-go-v2/service/sts v1.1.1/go.mod h1:Wi0EBZwiz/K44YliU0EKxqTCJGUfYTWXrrBwkq736bM= -github.com/aws/smithy-go v1.1.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= github.com/benbjohnson/clock v1.0.2/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= @@ -100,8 +80,6 @@ github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+Ce github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= -github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= github.com/btcsuite/btcd v0.0.0-20190523000118-16327141da8c/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= @@ -112,7 +90,6 @@ github.com/btcsuite/btcd v0.22.1/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/i github.com/btcsuite/btcd/btcec/v2 v2.2.0 h1:fzn1qaOt32TuLjFlkzYSsBC35Q3KUjT1SwPxiMSCF5k= github.com/btcsuite/btcd/btcec/v2 v2.2.0/go.mod h1:U7MHm051Al6XmscBQ0BoNydpOTsFAn707034b5nY8zU= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= -github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/btcutil v1.0.2/go.mod h1:j9HUFwoQRsZL3V4n+qG+CUnEGHOarIxfC3Le2Yhbcts= @@ -125,12 +102,10 @@ github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= -github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/cp v0.1.0 h1:SE+dxFebS7Iik5LK0tsi1k9ZCxEaFX4AjQmoyA+1dJk= -github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= @@ -144,7 +119,6 @@ github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMn github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudflare/cloudflare-go v0.14.0/go.mod h1:EnwdgGMaFOruiPZRFSgn+TsQ3hQ7C/YWzIGLeu5c304= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= @@ -154,8 +128,6 @@ github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/consensys/bavard v0.1.8-0.20210406032232-f3452dc9b572/go.mod h1:Bpd0/3mZuaj6Sj+PqrmIquiOKy397AKGThQPaGzNXAQ= -github.com/consensys/gnark-crypto v0.4.1-0.20210426202927-39ac3d4b3f1f/go.mod h1:815PAHg3wvysy0SyIqanF8gZ0Y1wjk/hrDHD/iT88+Q= github.com/containerd/cgroups v0.0.0-20201119153540-4cbc285b3327 h1:7grrpcfCtbZLsjtB0DgMuzs1umsJmpzaHMZ6cO6iAWw= github.com/containerd/cgroups v0.0.0-20201119153540-4cbc285b3327/go.mod h1:ZJeTFisyysqgcCdecO57Dj79RfL0LNeGiFUqLYQRYLE= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -176,8 +148,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHH github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= -github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -192,35 +162,25 @@ github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1m5sE92cU+pd5Mcc= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= -github.com/deepmap/oapi-codegen v1.6.0/go.mod h1:ryDa9AgbELGeB+YEXE1dR53yAjHwFvE9iAUlWl9Al3M= github.com/dgraph-io/badger v1.6.2 h1:mNw0qs90GVgGGWylh0umH5iag1j6n/PeJtNvL6KY/x8= github.com/dgraph-io/badger v1.6.2/go.mod h1:JW2yswe3V058sS0kZ2h/AXeDSqFjxnZcRrVH//y2UQE= github.com/dgraph-io/ristretto v0.0.2 h1:a5WaUrDa0qm0YrAAS1tUykT5El3kt62KNZZeMxQn3po= github.com/dgraph-io/ristretto v0.0.2/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8/go.mod h1:VMaSuZ+SZcx/wljOQKvp5srsbCiKDEb6K2wC4+PiBmQ= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91 h1:Izz0+t1Z5nI16/II7vuEo/nHjodOg0p7+OiDpjX5t1E= -github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= -github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= -github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= -github.com/docker/docker v1.6.2/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dop251/goja v0.0.0-20220405120441-9037c2b61cbf h1:Yt+4K30SdjOkRoRRm3vYNQgR+/ZIy0RmeUDZo7Y8zeQ= -github.com/dop251/goja v0.0.0-20220405120441-9037c2b61cbf/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= -github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= -github.com/eclipse/paho.mqtt.golang v1.2.0/go.mod h1:H9keYFcgq3Qr5OUJm/JZI/i6U7joQ8SYLhZwfeOo6Ts= +github.com/edsrzf/mmap-go v1.0.0 h1:CEBF7HpRnUCSJgGUb5h1Gm7e3VkmVDrR8lvWVLtrOFw= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/edsrzf/mmap-go v1.1.0 h1:6EUwBLQ/Mcr1EYLE4Tn1VdW1A4ckqCQWZBw8Hr0kjpQ= -github.com/edsrzf/mmap-go v1.1.0/go.mod h1:19H/e8pUPLicwkyNgOykDXkJ9F0MHE+Z52B8EIth78Q= github.com/elastic/gosigar v0.12.0 h1:AsdhYCJlTudhfOYQyFNgx+fIVTfrDO0V1ST0vHgiapU= github.com/elastic/gosigar v0.12.0/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= @@ -231,20 +191,16 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.m github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/ethereum-optimism/optimism/op-bindings v0.0.0-20220614233543-0d8fa52afca2/go.mod h1:e9mMYiVsdJf9BI//FdaA77BwNNgNMR043JtB7CPXNxY= github.com/ethereum-optimism/optimism/op-bindings v0.3.0 h1:d2Mwb8FzR2zuhW0sS5xFKWz/6VFPTEIE+XINqZj0Rv4= github.com/ethereum-optimism/optimism/op-bindings v0.3.0/go.mod h1:CrvUVIISKcyJ7o27ub/HY4Kq9wEJQxrGmWthTqxPSGo= -github.com/ethereum-optimism/reference-optimistic-geth v0.0.0-20220711171946-f579014dc46d h1:AYFFbxrz7kLyFbvNHGhUPZQT8KnN1PPjCj4oAcgaVCk= -github.com/ethereum-optimism/reference-optimistic-geth v0.0.0-20220711171946-f579014dc46d/go.mod h1:8AfU1epKggKxDt9wr7rH5KmCeiT3yT0sEvroru1mO6Q= +github.com/ethereum-optimism/reference-optimistic-geth v0.0.0-20220715235548-70b02481016d h1:w0DBXhp0sv0bWRDOCA/Y6yHOALU7qLLLf5/kE3YfFr4= +github.com/ethereum-optimism/reference-optimistic-geth v0.0.0-20220715235548-70b02481016d/go.mod h1:m2m08SAQ8XB0VcVBoDg9n74Dw5PUMl3hzv1NXVBFPfg= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fjl/gencodec v0.0.0-20220412091415-8bb9e558978c/go.mod h1:AzA8Lj6YtixmJWL+wkKoBGsLWy9gFrAzi4g+5bCKwpY= -github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= 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/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/flynn/noise v1.0.0 h1:DlTHqmzmvcEiKj+4RYo/imoswx/4r6iBlCMfVtrMXpQ= github.com/flynn/noise v1.0.0/go.mod h1:xbMo+0i6+IGbYdJhF31t2eR1BIU0CYc12+BNAKwUTag= -github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/francoispqt/gojay v1.2.13 h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJnXKk= github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= @@ -253,16 +209,10 @@ github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMo github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/garslo/gogen v0.0.0-20170306192744-1d203ffc1f61/go.mod h1:Q0X6pkwTILDlzrGEckF6HKjXe48EgsY/l7K7vhY4MW8= -github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 h1:f6D9Hr8xV8uYKlyuj8XIruxlh9WjVjdh1gIicAS7ays= github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= -github.com/getkin/kin-openapi v0.53.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= -github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= -github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= -github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs= github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -280,12 +230,8 @@ github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNV github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-sourcemap/sourcemap v2.1.3+incompatible h1:W1iEw64niKVGogNgBN3ePyLFfuisuzeidWPMPWmECqU= -github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= -github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= @@ -294,7 +240,6 @@ github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg78 github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/godbus/dbus/v5 v5.0.4 h1:9349emZab16e7zQvpmsbtjc18ykshndd8y2PG3sgJbA= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -304,8 +249,6 @@ github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v4 v4.3.0 h1:kHL1vqdqWNfATmA0FNMdmZNMyZI1U6O31X4rlIPoBog= github.com/golang-jwt/jwt/v4 v4.3.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= -github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -342,10 +285,8 @@ github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8l github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golangci/lint-1 v0.0.0-20181222135242-d2cdd8c08219/go.mod h1:/X8TswGSh1pIozq4ZwCfxS0WA5JGXguxk94ar/4c87Y= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/flatbuffers v1.11.0/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -362,7 +303,6 @@ github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gopacket v1.1.17/go.mod h1:UdDNZ1OO62aGYVnPhxT1U6aI7ukYtA/kB8vaU0diBUM= github.com/google/gopacket v1.1.19 h1:ves8RnFZPGiFnTS0uPQStjwru6uO6h+nlr9j6fL7kF8= github.com/google/gopacket v1.1.19/go.mod h1:iJ8V8n6KS+z2U1A8pUwu8bW5SyEMkXJB8Yo/Vo+TKTo= @@ -375,6 +315,7 @@ github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -389,12 +330,10 @@ github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORR github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/graph-gophers/graphql-go v1.3.0/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= @@ -408,7 +347,6 @@ github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyN github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-bexpr v0.1.10/go.mod h1:oxlubA2vC/gFVfX1A6JGp7ls7uCDlfJn732ehYYg+g0= github.com/hashicorp/go-bexpr v0.1.11 h1:6DqdA/KBjurGby9yTY0bmkathya0lfwF2SeuubCI7dY= github.com/hashicorp/go-bexpr v0.1.11/go.mod h1:f03lAo0duBlDIUMGCuad8oLcgejw4m7U+N8T+6Kz1AE= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= @@ -446,18 +384,9 @@ github.com/huin/goupnp v1.0.3 h1:N8No57ls+MnjlB+JPiCVSOyy/ot7MJTqlo7rn+NYSqQ= github.com/huin/goupnp v1.0.3/go.mod h1:ZxNlw5WqJj6wSsRK5+YfflQGXYfccj5VgQsMNixHM7Y= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/influxdata/flux v0.65.1/go.mod h1:J754/zds0vvpfwuq7Gc2wRdVwEodfpCFM7mYlOw2LqY= -github.com/influxdata/influxdb v1.8.3/go.mod h1:JugdFhsvvI8gadxOI6noqNeeBHvWNTbfYGtiAn+2jhI= -github.com/influxdata/influxdb-client-go/v2 v2.4.0/go.mod h1:vLNHdxTJkIf2mSLvGrpj8TCcISApPoXkaxP8g9uRlW8= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/influxdata/influxql v1.1.1-0.20200828144457-65d3ef77d385/go.mod h1:gHp9y86a/pxhjJ+zMjNXiQAA197Xk9wLxaz+fGG+kWk= -github.com/influxdata/line-protocol v0.0.0-20180522152040-32c6aa80de5e/go.mod h1:4kt73NQhadE3daL3WhR5EJ/J2ocX0PZzwxQ0gXJ7oFE= -github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo= -github.com/influxdata/promql/v2 v2.12.0/go.mod h1:fxOPu+DY0bqCTCECchSRtWfc+0X19ybifQhZoQNF5D8= -github.com/influxdata/roaring v0.4.13-0.20180809181101-fc520f41fab6/go.mod h1:bSgUQ7q5ZLSO+bKBGqJiCBGAl+9DxyW63zLTujjUlOE= -github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9/go.mod h1:Js0mqiSBE6Ffsg94weZZ2c+v/ciT8QRHFOap7EKDrR0= -github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368/go.mod h1:Wbbw6tYNvwa5dlB6304Sd+82Z3f7PmVZHVKU637d4po= github.com/ipfs/go-cid v0.0.2/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= github.com/ipfs/go-cid v0.0.3/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= github.com/ipfs/go-cid v0.0.5/go.mod h1:plgt+Y5MnOey4vO4UlUazGqdbEXuFYitED67FexhXog= @@ -493,13 +422,10 @@ github.com/jbenet/go-temp-err-catcher v0.1.0/go.mod h1:0kJRvmDZXNMIiJirNPEYfhpPw github.com/jbenet/goprocess v0.1.3/go.mod h1:5yspPrukOVuOLORacaBi858NqyClJPQxYZlqdZVfqY4= github.com/jbenet/goprocess v0.1.4 h1:DRGOFReOMqqDNXwW70QkacFW0YN9QnwLV0Vqk+3oU0o= github.com/jbenet/goprocess v0.1.4/go.mod h1:5yspPrukOVuOLORacaBi858NqyClJPQxYZlqdZVfqY4= -github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU= github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= -github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= @@ -511,29 +437,21 @@ github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/ github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jsternberg/zap-logfmt v1.0.0/go.mod h1:uvPs/4X51zdkcm5jXl5SYoN+4RK21K8mysFmDaM/h+o= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= -github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef/go.mod h1:Ct9fl0F6iIOGgxJ5npU/IUOhOhqlVrGjyIZc8/MagT0= github.com/kami-zh/go-capturer v0.0.0-20171211120116-e492ea43421d/go.mod h1:P2viExyCEfeWGU259JnaQ34Inuec4R38JCyBx2edgD0= -github.com/karalabe/usb v0.0.2/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= -github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.13.6 h1:P76CopJELS0TiO2mebmnzgWaajssP/EszplttgQxcgc= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6/go.mod h1:+ZoRqAPRLkC4NPOvfYeR5KNOrY6TD+/sAC3HXPZgDYg= -github.com/klauspost/pgzip v1.0.2-0.20170402124221-0bf5dcad4ada/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/koron/go-ssdp v0.0.0-20191105050749-2e1c40ed0b5d/go.mod h1:5Ky9EC2xfoUKUor0Hjgi2BJhCSXJfMOFlmyYrVKGQMk= @@ -550,11 +468,6 @@ github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v0.0.0-20170224010052-a616ab194758/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= -github.com/labstack/echo/v4 v4.2.1/go.mod h1:AA49e0DZ8kk5jTOOCKNuPR6oTnBS0dYiM4FW1e6jwpg= -github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= -github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= -github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/libp2p/go-addr-util v0.1.0/go.mod h1:6I3ZYuFr2O/9D+SoyM0zEw0EF3YkldtTX406BpdQMqw= github.com/libp2p/go-buffer-pool v0.0.1/go.mod h1:xtyIz9PMobb13WaxR6Zo1Pd1zXJKYg0a8KiIvDp3TzQ= github.com/libp2p/go-buffer-pool v0.0.2 h1:QNK2iAFa8gjAe1SPz6mHSMuCcjs+X1wlHzeOSqcmlfs= @@ -691,8 +604,6 @@ github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0Q github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/marten-seemann/qpack v0.2.1/go.mod h1:F7Gl5L1jIgN1D11ucXefiuJS9UMVP2opoCp2jDKb7wc= github.com/marten-seemann/qtls-go1-15 v0.1.4/go.mod h1:GyFwywLKkRt+6mfU99csTEY1joMZz5vmB1WNZH3P81I= github.com/marten-seemann/qtls-go1-16 v0.1.4 h1:xbHbOGGhrenVtII6Co8akhLEdrawwB2iHl5yhJRpnco= @@ -703,30 +614,20 @@ github.com/marten-seemann/qtls-go1-18 v0.1.0-beta.1 h1:EnzzN9fPUkUck/1CuY1FlzBaI github.com/marten-seemann/qtls-go1-18 v0.1.0-beta.1/go.mod h1:PUhIQk19LoFt2174H4+an8TYvWOGjb/hHwphBeaDHwI= github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd h1:br0buuQ854V8u83wA0rVZ8ttrq5CpaPZdvrK0LP2lOk= github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd/go.mod h1:QuCEs1Nt24+FYQEqAAncTDPJIuGs+LxK1MCiFL25pMU= -github.com/matryer/moq v0.0.0-20190312154309-6cfb0558e1bd/go.mod h1:9ELz6aaclSIGnZBoaSLZ3NAl1VTufbOrXBPvtcy6WiQ= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.13/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= -github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= -github.com/mattn/go-tty v0.0.0-20180907095812-13ff1204f104/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= @@ -761,7 +662,6 @@ github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4= github.com/mitchellh/pointerstructure v1.2.1 h1:ZhBBeX8tSlRpu/FFhXH4RC4OJzFlqsQhoHZAz4x7TIw= github.com/mitchellh/pointerstructure v1.2.1/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -769,13 +669,11 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= github.com/mr-tron/base58 v1.1.0/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= github.com/mr-tron/base58 v1.1.2/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/mr-tron/base58 v1.1.3/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= -github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg= github.com/multiformats/go-base32 v0.0.3 h1:tw5+NhuwaOjJCC5Pp82QuXbrmLzWg7uxlMFp8Nq/kkI= github.com/multiformats/go-base32 v0.0.3/go.mod h1:pLiuGC8y0QR3Ue4Zug5UzK9LjgbkL8NSQj0zQ5Nz/AA= github.com/multiformats/go-base36 v0.1.0 h1:JR6TyF7JjGd3m6FbLU2cOxhC0Li8z8dLNGQ89tUg4F4= @@ -821,7 +719,6 @@ github.com/multiformats/go-varint v0.0.6 h1:gk85QWKxh3TazbLxED/NlDVv8+q+ReFJk7Y2 github.com/multiformats/go-varint v0.0.6/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= @@ -842,19 +739,21 @@ github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.2/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvwxz1E= -github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= +github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= @@ -863,7 +762,6 @@ github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/ github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/opentracing/opentracing-go v1.0.3-0.20180606204148-bd9c31933947/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= @@ -874,15 +772,11 @@ github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnh github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/paulbellamy/ratecounter v0.2.0/go.mod h1:Hfx1hDpSGoqxkVVpBi/IlYD7kChlfo5C6hzIHwPqfFE= github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 h1:onHthvaw9LFnH4t2DcNVpwGmV9E1BkGknEliJkfwQj0= github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58/go.mod h1:DXv8WO4yhMYhSNPKjeNKa5WY9YCIEBRbNzFFPJbWO6Y= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= -github.com/peterh/liner v1.0.1-0.20180619022028-8c1271fcf47f/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc= -github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= -github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= @@ -891,7 +785,6 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= -github.com/pkg/term v0.0.0-20180730021639-bffc007b7fd5/go.mod h1:eCbImbZ95eXtAUIbLAuAVnBnwf83mjf6QIVH8SHYwqQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= @@ -917,7 +810,6 @@ github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6T github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= @@ -944,7 +836,6 @@ github.com/raulk/clock v1.1.0/go.mod h1:3MpVxdZ/ODBQDxbN+kzshf5OSZwPjtMDx6BBXBmO github.com/raulk/go-watchdog v1.2.0 h1:konN75pw2BMmZ+AfuAm5rtFsWcJpKF3m02rKituuXNo= github.com/raulk/go-watchdog v1.2.0/go.mod h1:lzSbAl5sh4rtI8tYHU01BWIDzgzqaQLj6RcA1i4mlqI= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/retailnext/hllpp v1.0.1-0.20180308014038-101a6d2f8b52/go.mod h1:RDpi1RftBQPUCDRw6SmxeaREsAaRKnOclghuzp/WRzc= github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rjeczalik/notify v0.9.2 h1:MiTWrPj55mNDHEiIX5YUSKefw/+lCQVoAFmD6oQm5w8= @@ -955,7 +846,6 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg= github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= -github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.2 h1:KCooALfAYGs415Cwu5ABvv9n9509fSiG5SQJn/AQo4U= github.com/rs/cors v1.8.2/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= @@ -965,8 +855,6 @@ github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/segmentio/kafka-go v0.1.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= -github.com/segmentio/kafka-go v0.2.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= @@ -1018,7 +906,6 @@ github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/src-d/envconfig v1.0.0/go.mod h1:Q9YQZ7BKITldTBnoxsE5gOeB5y66RyPXeue/R4aaNBc= -github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= github.com/status-im/keycard-go v0.0.0-20211109104530-b0e0482ba91d h1:vmirMegf1vqPJ+lDBxLQ0MAt3tz+JL57UPxu44JBOjA= github.com/status-im/keycard-go v0.0.0-20211109104530-b0e0482ba91d/go.mod h1:97vT0Rym0wCnK4B++hNA3nCetr0Mh1KXaVxzSt1arjg= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= @@ -1028,26 +915,24 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0 h1:M2gUjqZET1qApGOWNSnZ49BAIMX4F/1plDv3+l31EJ4= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/testify v1.2.0/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ= -github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= -github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= +github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a h1:1ur3QoCqvE5fl+nylMaIr9PVV1w343YRDtsy+Rwu7XI= +github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA= -github.com/tinylib/msgp v1.0.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= github.com/tklauser/go-sysconf v0.3.10 h1:IJ1AZGZRWbY8T5Vfk04D9WOA5WSejdflXxP03OUqALw= github.com/tklauser/go-sysconf v0.3.10/go.mod h1:C8XykCvCb+Gn0oNCWPIlcb0RuglQTYaQ2hGm7jmxEFk= github.com/tklauser/numcpus v0.4.0 h1:E53Dm1HjH1/R2/aoCtXtPgzmElmn51aOkhCFSuZq//o= github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hMwiKKqXCQ= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= @@ -1056,10 +941,8 @@ github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtX github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli v1.22.5 h1:lNq9sAHXK2qfdI8W+GRItjCEkI+2oR4d+MEHy1CKXoU= github.com/urfave/cli v1.22.5/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= +github.com/urfave/cli/v2 v2.10.2 h1:x3p8awjp/2arX+Nl/G2040AZpOCHS/eMJJ1/a+mye4Y= +github.com/urfave/cli/v2 v2.10.2/go.mod h1:f8iq5LtQ/bLxafbdBSLPPNsgaW0l/2fYYEHhAyPlwvo= github.com/viant/assertly v0.4.8/go.mod h1:aGifi++jvCrUaklKEKT0BU95igDNaqkvz+49uaYMPRU= github.com/viant/toolbox v0.24.0/go.mod h1:OxMCG57V0PXuIP2HNQrtJf2CjqdmbrOx5EkMILuUhzM= github.com/whyrusleeping/go-logging v0.0.0-20170515211332-0457bb6b88fc/go.mod h1:bopw91TMyo8J3tvftk8xmU2kPmlrt4nScJQZU2hE5EM= @@ -1068,17 +951,16 @@ github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7 h1: github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7/go.mod h1:X2c0RVCI1eSUFI8eLcY3c0423ykwiUdxLJtkDvruhjI= github.com/whyrusleeping/timecache v0.0.0-20160911033111-cfcb2f1abfee h1:lYbXeSvJi5zk5GLKVuid9TVjS9a0OmLIDKTfoZBL6Ow= github.com/whyrusleeping/timecache v0.0.0-20160911033111-cfcb2f1abfee/go.mod h1:m2aV4LZI4Aez7dP5PMyVKEHhUyEJ/RjmPEDOpDvudHg= -github.com/willf/bitset v1.1.3/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= github.com/x-cray/logrus-prefixed-formatter v0.5.2/go.mod h1:2duySbKsL6M18s5GU7VPsoEPHyzalCE06qoARUCeBBE= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= +github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg= github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= @@ -1111,7 +993,6 @@ go.uber.org/multierr v1.7.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95a go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= -go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.14.1/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= @@ -1136,27 +1017,19 @@ golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190618222545-ea8f1a30c443/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190909091759-094676da4a83/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200602180216-279210d13fed/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210506145944-38f3c27a63bf/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= golang.org/x/crypto v0.0.0-20210813211128-0a44fdfbc16e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220307211146-efcb8507fb70/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e h1:T8NU3HyQ8ClP4SEE+KbFlg6n0NhuTsN4MyznaarGsZM= golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= @@ -1166,8 +1039,6 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20220426173459-3bcf042a4bf5/go.mod h1:lgLbSvA5ygNOMpwM/9anMpWVlVJ7Z+cHWq/eFuinpGE= -golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1190,8 +1061,6 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= -golang.org/x/mod v0.6.0-dev.0.20211013180041-c96bc1413d57/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1234,28 +1103,21 @@ golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210220033124-5f55cee0dc0d/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210423184538-5f58ad60dda6/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 h1:NWy5+hlRbC7HK+PmcXVUmW1IMyFce7to56IUvhUFm7Y= -golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220607020251-c690dde0001d h1:4SFsTMi4UahlKoloni7L4eYzhFRifURQLw+yv0QDCx8= +golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1306,7 +1168,6 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1319,7 +1180,6 @@ golang.org/x/sys v0.0.0-20191206220618-eeba5f6aabab/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200107162124-548cf772de50/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1339,8 +1199,6 @@ golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1352,7 +1210,6 @@ golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210317225723-c4fcb01b228e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210420205809-ac73e9fd8988/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210426080607-c94f62235c83/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1362,13 +1219,12 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220701225701-179beb0bd1a1 h1:+Lm8wRwJpsVpTHuM4tHTwgxjPzv/bjxsHt2cW5EY7XU= golang.org/x/sys v0.0.0-20220701225701-179beb0bd1a1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= @@ -1380,8 +1236,6 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= @@ -1389,19 +1243,15 @@ golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20220224211638-0e9765cccd65 h1:M73Iuj3xbbb9Uk1DYhzydthsj6oOd6l9bpuFcNoUvTs= golang.org/x/time v0.0.0-20220224211638-0e9765cccd65/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030000716-a0a13e073c7b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181130052023-1c3d964395ce/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= @@ -1423,12 +1273,10 @@ golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191126055441-b0650ceb63d9/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200108203644-89082a384178/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -1450,22 +1298,15 @@ golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.8-0.20211029000441-d6a9af8af023/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.11 h1:loJ25fNOEhSXfHrpoGj91eCUThwdNX6u24rO1xnNteY= golang.org/x/tools v0.1.11/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= -gonum.org/v1/gonum v0.0.0-20181121035319-3f7ecaa7e8ca/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= -gonum.org/v1/gonum v0.6.0/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= -gonum.org/v1/netlib v0.0.0-20181029234149-ec6d1f5cefe6/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= -gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= -gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= +golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.1.0/go.mod h1:UGEZY7KEX120AnNLIHFMKIo4obdJhkp2tPbaPlQx13Y= @@ -1504,7 +1345,6 @@ google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRn google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= -google.golang.org/genproto v0.0.0-20190716160619-c506a9f90610/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= @@ -1512,7 +1352,6 @@ google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvx google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200108215221-bd8f9a0ef82f/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= @@ -1590,8 +1429,6 @@ gopkg.in/src-d/go-cli.v0 v0.0.0-20181105080154-d492247bbc0d/go.mod h1:z+K8VcOYVY gopkg.in/src-d/go-log.v1 v1.0.1/go.mod h1:GN34hKP0g305ysm2/hctJ0Y8nWP3zxXXJ8GFabTyABE= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/urfave/cli.v1 v1.20.0 h1:NdAVW6RYxDif9DhDHaAortIu956m2c0v+09AZBPTbE0= -gopkg.in/urfave/cli.v1 v1.20.0/go.mod h1:vuBzUtMdQeixQj8LVd+/98pzhxNGQoyuPBlsXHOQNO0= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -1616,9 +1453,7 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= diff --git a/op-node/l2/util.go b/op-node/l2/util.go index 1dd159a87db37..34186adc07463 100644 --- a/op-node/l2/util.go +++ b/op-node/l2/util.go @@ -64,7 +64,7 @@ func (res *AccountResult) Verify(stateRoot common.Hash) error { trieDB := trie.NewDatabase(db) // wrap our DB of trie nodes with a Trie interface, and anchor it at the trusted state root - proofTrie, err := trie.New(stateRoot, trieDB) + proofTrie, err := trie.New(stateRoot, stateRoot, trieDB) if err != nil { return fmt.Errorf("failed to load db wrapper around kv store") } diff --git a/op-node/node/server.go b/op-node/node/server.go index 64dac1b6f1a41..71333ea28c9f3 100644 --- a/op-node/node/server.go +++ b/op-node/node/server.go @@ -61,7 +61,7 @@ func (s *rpcServer) EnableP2P(backend *p2p.APIBackend) { func (s *rpcServer) Start() error { srv := rpc.NewServer() - if err := node.RegisterApis(s.apis, nil, srv, true); err != nil { + if err := node.RegisterApis(s.apis, nil, srv); err != nil { return err } diff --git a/op-node/rollup/derive/batch_queue.go b/op-node/rollup/derive/batch_queue.go index 799a73fe4a03d..2b00a6fa49569 100644 --- a/op-node/rollup/derive/batch_queue.go +++ b/op-node/rollup/derive/batch_queue.go @@ -89,29 +89,14 @@ func (bq *BatchQueue) Step(ctx context.Context, outer Progress) error { } func (bq *BatchQueue) ResetStep(ctx context.Context, l1Fetcher L1Fetcher) error { - // Reset such that the highestL1InclusionBlock is the same as the l2SafeHeadOrigin - the sequence window size + // Copy over the Origin the from the next stage + // It is set in the engine queue (two stages away) such that the L2 Safe Head origin is the progress + bq.progress = bq.next.Progress() bq.batchesByTimestamp = make(map[uint64][]*BatchWithL1InclusionBlock) + // Include the new origin as an origin to build off of. bq.l1Blocks = bq.l1Blocks[:0] + bq.l1Blocks = append(bq.l1Blocks, bq.progress.Origin) - startNumber := bq.next.Progress().Origin.Number - if startNumber < bq.config.SeqWindowSize { - startNumber = 0 - } else { - startNumber -= bq.config.SeqWindowSize - } - // clip to genesis - if startNumber < bq.config.Genesis.L1.Number { - startNumber = bq.config.Genesis.L1.Number - } - l1BlockStart, err := l1Fetcher.L1BlockRefByNumber(ctx, startNumber) - if err != nil { - return err - } - - bq.log.Info("found reset origin for batch queue", "origin", l1BlockStart) - bq.l1Blocks = append(bq.l1Blocks, l1BlockStart) - bq.progress.Origin = l1BlockStart - bq.progress.Closed = false return io.EOF } @@ -119,7 +104,7 @@ func (bq *BatchQueue) AddBatch(batch *BatchData) error { if bq.progress.Closed { panic("write batch while closed") } - bq.log.Info("queued batch", "origin", bq.progress.Origin, "tx_count", len(batch.Transactions), "timestamp", batch.Timestamp) + bq.log.Trace("queued batch", "origin", bq.progress.Origin, "tx_count", len(batch.Transactions), "timestamp", batch.Timestamp) if len(bq.l1Blocks) == 0 { return fmt.Errorf("cannot add batch with timestamp %d, no origin was prepared", batch.Timestamp) } diff --git a/op-node/rollup/derive/deposit_log.go b/op-node/rollup/derive/deposit_log.go index 40703fe83dd65..c3bcca2b6a7da 100644 --- a/op-node/rollup/derive/deposit_log.go +++ b/op-node/rollup/derive/deposit_log.go @@ -12,35 +12,63 @@ import ( ) var ( - DepositEventABI = "TransactionDeposited(address,address,uint256,uint256,uint64,bool,bytes)" - DepositEventABIHash = crypto.Keccak256Hash([]byte(DepositEventABI)) + DepositEventABI = "TransactionDeposited(address,address,uint256,bytes)" + DepositEventABIHash = crypto.Keccak256Hash([]byte(DepositEventABI)) + DepositEventVersion0 = common.Hash{} ) // UnmarshalDepositLogEvent decodes an EVM log entry emitted by the deposit contract into typed deposit data. // // parse log data for: // event TransactionDeposited( -// address indexed from, -// address indexed to, -// uint256 mint, -// uint256 value, -// uint64 gasLimit, -// bool isCreation, -// data data +// address indexed from, +// address indexed to, +// uint256 indexed version, +// bytes opaqueData // ); // // Additionally, the event log-index and func UnmarshalDepositLogEvent(ev *types.Log) (*types.DepositTx, error) { - if len(ev.Topics) != 3 { - return nil, fmt.Errorf("expected 3 event topics (event identity, indexed from, indexed to)") + if len(ev.Topics) != 4 { + return nil, fmt.Errorf("expected 4 event topics (event identity, indexed from, indexed to, indexed version), got %d", len(ev.Topics)) } if ev.Topics[0] != DepositEventABIHash { return nil, fmt.Errorf("invalid deposit event selector: %s, expected %s", ev.Topics[0], DepositEventABIHash) } - if len(ev.Data) < 6*32 { - return nil, fmt.Errorf("deposit event data too small (%d bytes): %x", len(ev.Data), ev.Data) + if len(ev.Data) < 64 { + return nil, fmt.Errorf("incomplate opaqueData slice header (%d bytes): %x", len(ev.Data), ev.Data) + } + if len(ev.Data)%32 != 0 { + return nil, fmt.Errorf("expected log data to be multiple of 32 bytes: got %d bytes", len(ev.Data)) } + // indexed 0 + from := common.BytesToAddress(ev.Topics[1][12:]) + // indexed 1 + to := common.BytesToAddress(ev.Topics[2][12:]) + // indexed 2 + version := ev.Topics[3] + // unindexed data + // Solidity serializes the event's Data field as follows: + // abi.encode(abi.encodPacked(uint256 mint, uint256 value, uint64 gasLimit, uint8 isCreation, bytes data)) + // Thus the first 32 bytes of the Data will give us the offset of the opaqueData, + // which should always be 0x20. + var opaqueContentOffset uint256.Int + opaqueContentOffset.SetBytes(ev.Data[0:32]) + if !opaqueContentOffset.IsUint64() || opaqueContentOffset.Uint64() != 32 { + return nil, fmt.Errorf("invalid opaqueData slice header offset: %d", opaqueContentOffset.Uint64()) + } + // The next 32 bytes indicate the length of the opaqueData content. + var opaqueContentLength uint256.Int + opaqueContentLength.SetBytes(ev.Data[32:64]) + // Make sure the length is an uint64, it's not larger than the remaining data, and the log is using minimal padding (i.e. can't add 32 bytes without exceeding data) + if !opaqueContentLength.IsUint64() || opaqueContentLength.Uint64() > uint64(len(ev.Data)-64) || opaqueContentLength.Uint64()+32 <= uint64(len(ev.Data)-64) { + return nil, fmt.Errorf("invalid opaqueData slice header length: %d", opaqueContentLength.Uint64()) + } + // The remaining data is the opaqueData which is tightly packed + // and then padded to 32 bytes by the EVM. + opaqueData := ev.Data[64 : 64+opaqueContentLength.Uint64()] + var dep types.DepositTx source := UserDepositSource{ @@ -48,65 +76,63 @@ func UnmarshalDepositLogEvent(ev *types.Log) (*types.DepositTx, error) { LogIndex: uint64(ev.Index), } dep.SourceHash = source.SourceHash() + dep.From = from - // indexed 0 - dep.From = common.BytesToAddress(ev.Topics[1][12:]) - // indexed 1 - to := common.BytesToAddress(ev.Topics[2][12:]) + var err error + switch version { + case DepositEventVersion0: + err = unmarshalDepositVersion0(&dep, to, opaqueData) + default: + return nil, fmt.Errorf("invalid deposit version, got %s", version) + } + if err != nil { + return nil, fmt.Errorf("failed to decode deposit (version %s): %w", version, err) + } + return &dep, nil +} - // unindexed data +func unmarshalDepositVersion0(dep *types.DepositTx, to common.Address, opaqueData []byte) error { + if len(opaqueData) < 32+32+8+1 { + return fmt.Errorf("unexpected opaqueData length: %d", len(opaqueData)) + } offset := uint64(0) - dep.Mint = new(big.Int).SetBytes(ev.Data[offset : offset+32]) + // uint256 mint + dep.Mint = new(big.Int).SetBytes(opaqueData[offset : offset+32]) // 0 mint is represented as nil to skip minting code if dep.Mint.Cmp(new(big.Int)) == 0 { dep.Mint = nil } offset += 32 - dep.Value = new(big.Int).SetBytes(ev.Data[offset : offset+32]) + // uint256 value + dep.Value = new(big.Int).SetBytes(opaqueData[offset : offset+32]) offset += 32 - gas := new(big.Int).SetBytes(ev.Data[offset : offset+32]) + // uint64 gas + gas := new(big.Int).SetBytes(opaqueData[offset : offset+8]) if !gas.IsUint64() { - return nil, fmt.Errorf("bad gas value: %x", ev.Data[offset:offset+32]) + return fmt.Errorf("bad gas value: %x", opaqueData[offset:offset+8]) } - offset += 32 dep.Gas = gas.Uint64() + offset += 8 + + // uint8 isCreation // isCreation: If the boolean byte is 1 then dep.To will stay nil, // and it will create a contract using L2 account nonce to determine the created address. - if ev.Data[offset+31] == 0 { + if opaqueData[offset] == 0 { dep.To = &to } - offset += 32 - // dynamic fields are encoded in three parts. The fixed size portion is the offset of the start of the - // data. The first 32 bytes of a `bytes` object is the length of the bytes. Then are the actual bytes - // padded out to 32 byte increments. - var dataOffset uint256.Int - dataOffset.SetBytes(ev.Data[offset : offset+32]) - offset += 32 - if !dataOffset.Eq(uint256.NewInt(offset)) { - return nil, fmt.Errorf("incorrect data offset: %v", dataOffset[0]) - } + offset += 1 - var dataLen uint256.Int - dataLen.SetBytes(ev.Data[offset : offset+32]) - offset += 32 - - if !dataLen.IsUint64() { - return nil, fmt.Errorf("data too large: %s", dataLen.String()) - } + // The remainder of the opaqueData is the transaction data (without length prefix). // The data may be padded to a multiple of 32 bytes - maxExpectedLen := uint64(len(ev.Data)) - offset - dataLenU64 := dataLen.Uint64() - if dataLenU64 > maxExpectedLen { - return nil, fmt.Errorf("data length too long: %d, expected max %d", dataLenU64, maxExpectedLen) - } + txDataLen := uint64(len(opaqueData)) - offset // remaining bytes fill the data - dep.Data = ev.Data[offset : offset+dataLenU64] + dep.Data = opaqueData[offset : offset+txDataLen] - return &dep, nil + return nil } // MarshalDepositLogEvent returns an EVM log entry that encodes a TransactionDeposited event from the deposit contract. @@ -120,29 +146,24 @@ func MarshalDepositLogEvent(depositContractAddr common.Address, deposit *types.D DepositEventABIHash, deposit.From.Hash(), toBytes, + DepositEventVersion0, } - data := make([]byte, 6*32) - offset := 0 - if deposit.Mint != nil { - deposit.Mint.FillBytes(data[offset : offset+32]) - } - offset += 32 + data := make([]byte, 64, 64+3*32) - deposit.Value.FillBytes(data[offset : offset+32]) - offset += 32 + // opaqueData slice content offset: value will always be 0x20. + binary.BigEndian.PutUint64(data[32-8:32], 32) - binary.BigEndian.PutUint64(data[offset+24:offset+32], deposit.Gas) - offset += 32 - if deposit.To == nil { // isCreation - data[offset+31] = 1 - } - offset += 32 - binary.BigEndian.PutUint64(data[offset+24:offset+32], 5*32) - offset += 32 - binary.BigEndian.PutUint64(data[offset+24:offset+32], uint64(len(deposit.Data))) - data = append(data, deposit.Data...) - if len(data)%32 != 0 { // pad to multiple of 32 + opaqueData := marshalDepositVersion0(deposit) + + // opaqueData slice length + binary.BigEndian.PutUint64(data[64-8:64], uint64(len(opaqueData))) + + // opaqueData slice content + data = append(data, opaqueData...) + + // pad to multiple of 32 + if len(data)%32 != 0 { data = append(data, make([]byte, 32-(len(data)%32))...) } @@ -160,3 +181,32 @@ func MarshalDepositLogEvent(depositContractAddr common.Address, deposit *types.D Index: 0, } } + +func marshalDepositVersion0(deposit *types.DepositTx) (opaqueData []byte) { + opaqueData = make([]byte, 32+32+8+1, 32+32+8+1+len(deposit.Data)) + offset := 0 + + // uint256 mint + if deposit.Mint != nil { + deposit.Mint.FillBytes(opaqueData[offset : offset+32]) + } + offset += 32 + + // uint256 value + deposit.Value.FillBytes(opaqueData[offset : offset+32]) + offset += 32 + + // uint64 gas + binary.BigEndian.PutUint64(opaqueData[offset:offset+8], deposit.Gas) + offset += 8 + + // uint8 isCreation + if deposit.To == nil { // isCreation + opaqueData[offset] = 1 + } + + // Deposit data then fills the remaining event data + opaqueData = append(opaqueData, deposit.Data...) + + return opaqueData +} diff --git a/op-node/rollup/derive/deposit_log_test.go b/op-node/rollup/derive/deposit_log_test.go index 7f2f7b00a32d2..0d43e7488dba1 100644 --- a/op-node/rollup/derive/deposit_log_test.go +++ b/op-node/rollup/derive/deposit_log_test.go @@ -13,6 +13,7 @@ import ( ) func TestUnmarshalLogEvent(t *testing.T) { + // t.Skip("not working because deposit_log_create not working properly") for i := int64(0); i < 100; i++ { t.Run(fmt.Sprintf("random_deposit_%d", i), func(t *testing.T) { rng := rand.New(rand.NewSource(1234 + i)) @@ -90,6 +91,7 @@ type DeriveUserDepositsTestCase struct { } func TestDeriveUserDeposits(t *testing.T) { + // t.Skip("not working because deposit_log_create not working properly") testCases := []DeriveUserDepositsTestCase{ {"no deposits", []receiptData{}}, {"other log", []receiptData{{true, []bool{false}}}}, diff --git a/op-node/rollup/derive/engine_queue.go b/op-node/rollup/derive/engine_queue.go index 8c0809398d35f..3bcd2b6c35906 100644 --- a/op-node/rollup/derive/engine_queue.go +++ b/op-node/rollup/derive/engine_queue.go @@ -2,15 +2,13 @@ package derive import ( "context" - "errors" "fmt" "io" "time" - "github.com/ethereum/go-ethereum" - "github.com/ethereum-optimism/optimism/op-node/eth" "github.com/ethereum-optimism/optimism/op-node/rollup" + "github.com/ethereum-optimism/optimism/op-node/rollup/sync" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/log" ) @@ -37,8 +35,6 @@ type EngineQueue struct { safeHead eth.L2BlockRef unsafeHead eth.L2BlockRef - resetting bool - toFinalize eth.BlockID progress Progress @@ -66,13 +62,15 @@ func (eq *EngineQueue) SetUnsafeHead(head eth.L2BlockRef) { func (eq *EngineQueue) AddUnsafePayload(payload *eth.ExecutionPayload) { if len(eq.unsafePayloads) > maxUnsafePayloads { + eq.log.Debug("Refusing to add unsafe payload", "hash", payload.BlockHash, "number", uint64(payload.BlockNumber)) return // don't DoS ourselves by buffering too many unsafe payloads } + eq.log.Trace("Adding unsafe payload", "hash", payload.BlockHash, "number", uint64(payload.BlockNumber), "timestamp", uint64(payload.Timestamp)) eq.unsafePayloads = append(eq.unsafePayloads, payload) } func (eq *EngineQueue) AddSafeAttributes(attributes *eth.PayloadAttributes) { - eq.log.Trace("received next safe attributes") + eq.log.Trace("Adding next safe attributes", "timestamp", attributes.Timestamp) eq.safeAttributes = append(eq.safeAttributes, attributes) } @@ -182,6 +180,8 @@ func (eq *EngineQueue) tryNextUnsafePayload(ctx context.Context) error { } eq.unsafeHead = ref eq.unsafePayloads = eq.unsafePayloads[1:] + eq.log.Trace("Executed unsafe payload", "hash", ref.Hash, "number", ref.Number, "timestamp", ref.Time, "l1Origin", ref.L1Origin) + return nil } @@ -223,6 +223,8 @@ func (eq *EngineQueue) consolidateNextSafeAttributes(ctx context.Context) error eq.safeHead = ref // unsafe head stays the same, we did not reorg the chain. eq.safeAttributes = eq.safeAttributes[1:] + eq.log.Trace("Reconciled safe payload", "hash", ref.Hash, "number", ref.Number, "timestamp", ref.Time, "l1Origin", ref.L1Origin) + return nil } @@ -256,70 +258,40 @@ func (eq *EngineQueue) forceNextSafeAttributes(ctx context.Context) error { eq.safeHead = ref eq.unsafeHead = ref eq.safeAttributes = eq.safeAttributes[1:] + eq.log.Trace("Inserted safe block", "hash", ref.Hash, "number", ref.Number, "timestamp", ref.Time, "l1Origin", ref.L1Origin) + return nil } // ResetStep Walks the L2 chain backwards until it finds an L2 block whose L1 origin is canonical. // The unsafe head is set to the head of the L2 chain, unless the existing safe head is not canonical. func (eq *EngineQueue) ResetStep(ctx context.Context, l1Fetcher L1Fetcher) error { - if !eq.resetting { - eq.resetting = true - - head, err := eq.engine.L2BlockRefHead(ctx) - if err != nil { - eq.log.Error("failed to get L2 engine head to start finding reset point from", "err", err) - return nil - } - eq.unsafeHead = head - - // TODO: this should be different for safe head. - // We can't trust the origin data of the unsafe chain. - // We should query the engine for its current safe-head. - eq.safeHead = head - return nil - } - // check if the block origin is canonical - if canonicalRef, err := l1Fetcher.L1BlockRefByNumber(ctx, eq.safeHead.L1Origin.Number); errors.Is(err, ethereum.NotFound) { - // if our view of the l1 chain is lagging behind, we may get this error - eq.log.Warn("engine safe head is ahead of L1 view", "block", eq.safeHead, "origin", eq.safeHead.L1Origin) - } else if err != nil { - eq.log.Warn("failed to get L1 block ref to check if origin of l2 block is canonical", "err", err, "num", eq.safeHead.L1Origin.Number) - } else { - // if we find the safe head, then we found the canon chain - if canonicalRef.Hash == eq.safeHead.L1Origin.Hash { - eq.resetting = false - // if the unsafe head was broken, then restore it to start from the safe head - if eq.unsafeHead == (eth.L2BlockRef{}) { - eq.unsafeHead = eq.safeHead - } - eq.progress = Progress{ - Origin: canonicalRef, - Closed: false, - } - if eq.safeHead.Time < canonicalRef.Time { - return fmt.Errorf("cannot reset block derivation to start at L2 block %s with time %d older than its L1 origin %s with time %d, time invariant is broken", - eq.safeHead, eq.safeHead.Time, canonicalRef, canonicalRef.Time) - } - return io.EOF - } else { - // if the safe head is not canonical, then the unsafe head will not be either - eq.unsafeHead = eth.L2BlockRef{} - } + l2Head, err := eq.engine.L2BlockRefHead(ctx) + if err != nil { + eq.log.Error("failed to find the L2 Head block", "err", err) + return nil } - - // Don't walk past genesis. If we were at the L2 genesis, but could not find its L1 origin, - // the L2 chain is building on the wrong L1 branch. - if eq.safeHead.Hash == eq.cfg.Genesis.L2.Hash || eq.safeHead.Number == eq.cfg.Genesis.L2.Number { - return fmt.Errorf("the L2 engine is coupled to unrecognized L1 chain: %v", eq.cfg.Genesis) + unsafe, safe, err := sync.FindL2Heads(ctx, l2Head, eq.cfg.SeqWindowSize, l1Fetcher, eq.engine, &eq.cfg.Genesis) + if err != nil { + eq.log.Error("failed to find the L2 Heads to start from", "err", err) + return nil } - - // Pull L2 parent for next iteration - block, err := eq.engine.L2BlockRefByHash(ctx, eq.safeHead.ParentHash) + l1Origin, err := l1Fetcher.L1BlockRefByHash(ctx, safe.L1Origin.Hash) if err != nil { - eq.log.Error("failed to fetch L2 block by hash during reset", "parent", eq.safeHead.ParentHash, "err", err) + eq.log.Error("failed to fetch the new L1 progress", "err", err, "origin", safe.L1Origin) return nil } - eq.safeHead = block - return nil + if safe.Time < l1Origin.Time { + return fmt.Errorf("cannot reset block derivation to start at L2 block %s with time %d older than its L1 origin %s with time %d, time invariant is broken", + safe, safe.Time, l1Origin, l1Origin.Time) + } + eq.unsafeHead = unsafe + eq.safeHead = safe + eq.progress = Progress{ + Origin: l1Origin, + Closed: false, + } + return io.EOF + } diff --git a/op-node/rollup/derive/fuzz_parsers_test.go b/op-node/rollup/derive/fuzz_parsers_test.go index b3c075fa50d16..2f47fce679328 100644 --- a/op-node/rollup/derive/fuzz_parsers_test.go +++ b/op-node/rollup/derive/fuzz_parsers_test.go @@ -6,6 +6,7 @@ import ( "testing" "github.com/ethereum-optimism/optimism/op-bindings/bindings" + "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/rawdb" @@ -14,6 +15,7 @@ import ( "github.com/ethereum/go-ethereum/core/vm/runtime" "github.com/ethereum/go-ethereum/crypto" "github.com/google/go-cmp/cmp" + "github.com/stretchr/testify/require" ) var ( @@ -124,6 +126,47 @@ func FuzzL1InfoAgainstContract(f *testing.F) { }) } +// Standard ABI types copied from golang ABI tests +var ( + Uint256Type, _ = abi.NewType("uint256", "", nil) + Uint64Type, _ = abi.NewType("uint64", "", nil) + BytesType, _ = abi.NewType("bytes", "", nil) + BoolType, _ = abi.NewType("bool", "", nil) + AddressType, _ = abi.NewType("address", "", nil) +) + +// EncodeDepositOpaqueDataV0 performs ABI encoding to create the opaque data field of the deposit event. +func EncodeDepositOpaqueDataV0(t *testing.T, mint *big.Int, value *big.Int, gasLimit uint64, isCreation bool, data []byte) []byte { + // in OptimismPortal.sol: + // bytes memory opaqueData = abi.encodePacked(msg.value, _value, _gasLimit, _isCreation, _data); + // Geth does not support abi.encodePacked, so we emulate it here by slicing of the padding from the individual elements + // See https://github.com/ethereum/go-ethereum/issues/22257 + // And https://docs.soliditylang.org/en/v0.8.13/abi-spec.html#non-standard-packed-mode + + var out []byte + + v, err := abi.Arguments{{Name: "msg.value", Type: Uint256Type}}.Pack(mint) + require.NoError(t, err) + out = append(out, v...) + + v, err = abi.Arguments{{Name: "_value", Type: Uint256Type}}.Pack(value) + require.NoError(t, err) + out = append(out, v...) + + v, err = abi.Arguments{{Name: "_gasLimit", Type: Uint64Type}}.Pack(gasLimit) + require.NoError(t, err) + out = append(out, v[32-8:]...) // 8 bytes only with abi.encodePacked + + v, err = abi.Arguments{{Name: "_isCreation", Type: BoolType}}.Pack(isCreation) + require.NoError(t, err) + out = append(out, v[32-1:]...) // 1 byte only with abi.encodePacked + + // no slice header, just the raw data with abi.encodePacked + out = append(out, data...) + + return out +} + // FuzzUnmarshallLogEvent runs a deposit event through the EVM and checks that output of the abigen parsing matches // what was inputted and what we parsed during the UnmarshalDepositLogEvent function (which turns it into a deposit tx) // The purpose is to check that we can never create a transaction that emits a log that we cannot parse as well @@ -206,36 +249,33 @@ func FuzzUnmarshallLogEvent(f *testing.F) { if err != nil { t.Fatalf("Could not unmarshal log that was emitted by the deposit contract: %v", err) } + depMint := common.Big0 + if dep.Mint != nil { + depMint = dep.Mint + } + opaqueData := EncodeDepositOpaqueDataV0(t, depMint, dep.Value, dep.Gas, dep.To == nil, dep.Data) reconstructed := &bindings.OptimismPortalTransactionDeposited{ From: dep.From, - Value: dep.Value, - GasLimit: dep.Gas, - IsCreation: dep.To == nil, - Data: dep.Data, + Version: common.Big0, + OpaqueData: opaqueData, Raw: types.Log{}, } if dep.To != nil { reconstructed.To = *dep.To } - if dep.Mint != nil { - reconstructed.Mint = dep.Mint - } else { - reconstructed.Mint = common.Big0 - } if !cmp.Equal(depositEvent, reconstructed, cmp.Comparer(BigEqual)) { t.Fatalf("The deposit tx did not match. tx: %v. actual: %v", reconstructed, depositEvent) } + opaqueData = EncodeDepositOpaqueDataV0(t, mint, value, l2GasLimit, isCreation, data) + inputArgs := &bindings.OptimismPortalTransactionDeposited{ From: from, To: to, - Mint: mint, - Value: value, - GasLimit: l2GasLimit, - IsCreation: isCreation, - Data: data, + Version: common.Big0, + OpaqueData: opaqueData, Raw: types.Log{}, } if !cmp.Equal(depositEvent, inputArgs, cmp.Comparer(BigEqual)) { diff --git a/op-node/rollup/derive/pipeline.go b/op-node/rollup/derive/pipeline.go index 3873917a4eeb0..9acdd7e994d88 100644 --- a/op-node/rollup/derive/pipeline.go +++ b/op-node/rollup/derive/pipeline.go @@ -11,6 +11,7 @@ import ( ) type L1Fetcher interface { + L1HeadBlockRef(ctx context.Context) (eth.L1BlockRef, error) L1BlockRefByNumberFetcher L1BlockRefByHashFetcher L1ReceiptsFetcher diff --git a/op-node/rollup/driver/conf_depth.go b/op-node/rollup/driver/conf_depth.go index 984681f51de8c..365ef861b46aa 100644 --- a/op-node/rollup/driver/conf_depth.go +++ b/op-node/rollup/driver/conf_depth.go @@ -30,7 +30,7 @@ func (c *confDepth) L1BlockRefByNumber(ctx context.Context, num uint64) (eth.L1B // TODO: performance optimization: buffer the l1Head, invalidate any reorged previous buffer content, // and instantly return the origin by number from the buffer if we can. - if c.depth == 0 || num+c.depth <= c.l1Head().Number { + if num == 0 || c.depth == 0 || num+c.depth <= c.l1Head().Number { return c.L1Fetcher.L1BlockRefByNumber(ctx, num) } return eth.L1BlockRef{}, ethereum.NotFound diff --git a/op-node/rollup/driver/conf_depth_test.go b/op-node/rollup/driver/conf_depth_test.go index 91183e0a63079..291da4f9b71c8 100644 --- a/op-node/rollup/driver/conf_depth_test.go +++ b/op-node/rollup/driver/conf_depth_test.go @@ -53,6 +53,7 @@ func TestConfDepth(t *testing.T) { {name: "two conf not like 1", head: 4, req: 3, depth: 2, pass: false}, {name: "two conf pass", head: 4, req: 2, depth: 2, pass: true}, {name: "easy pass", head: 100, req: 20, depth: 5, pass: true}, + {name: "genesis case", head: 0, req: 0, depth: 4, pass: true}, } for _, tc := range testCases { t.Run(tc.name, tc.Run) diff --git a/op-node/rollup/sync/start.go b/op-node/rollup/sync/start.go new file mode 100644 index 0000000000000..23f694b1b9fb8 --- /dev/null +++ b/op-node/rollup/sync/start.go @@ -0,0 +1,201 @@ +// The sync package is responsible for reconciling L1 and L2. +// +// The Ethereum chain is a DAG of blocks with the root block being the genesis block. At any given +// time, the head (or tip) of the chain can change if an offshoot/branch of the chain has a higher +// total difficulty. This is known as a re-organization of the canonical chain. Each block points to +// a parent block and the node is responsible for deciding which block is the head and thus the +// mapping from block number to canonical block. +// +// The Optimism (L2) chain has similar properties, but also retains references to the Ethereum (L1) +// chain. Each L2 block retains a reference to an L1 block (its "L1 origin", i.e. L1 block +// associated with the epoch that the L2 block belongs to) and to its parent L2 block. The L2 chain +// node must satisfy the following validity rules: +// +// 1. l2block.number == l2block.l2parent.block.number + 1 +// 2. l2block.l1Origin.number >= l2block.l2parent.l1Origin.number +// 3. l2block.l1Origin is in the canonical chain on L1 +// 4. l1_rollup_genesis is an ancestor of l2block.l1Origin +// +// During normal operation, both the L1 and L2 canonical chains can change, due to a re-organisation +// or due to an extension (new L1 or L2 block). +// +// When one of these changes occurs, the rollup node needs to determine what the new L2 head blocks +// should be. We track two L2 head blocks: +// +// - The *unsafe L2 block*: This is the highest L2 block whose L1 origin is a plausible (1) +// extension of the canonical L1 chain (as known to the op-node). +// - The *safe L2 block*: This is the highest L2 block whose epoch's sequencing window is +// complete within the canonical L1 chain (as known to the op-node). +// +// (1) Plausible meaning that the blockhash of the L2 block's L1 origin (as reported in the L1 +// Attributes deposit within the L2 block) is not canonical at another height in the L1 chain, +// and the same holds for all its ancestors. +// +// In particular, in the case of L1 extension, the L2 unsafe head will generally remain the same, +// but in the case of an L1 re-org, we need to search for the new safe and unsafe L2 block. +package sync + +import ( + "context" + "errors" + "fmt" + + "github.com/ethereum/go-ethereum/common" + + "github.com/ethereum-optimism/optimism/op-node/eth" + "github.com/ethereum-optimism/optimism/op-node/rollup" +) + +type L1Chain interface { + L1HeadBlockRef(ctx context.Context) (eth.L1BlockRef, error) + L1BlockRefByNumber(ctx context.Context, number uint64) (eth.L1BlockRef, error) +} + +type L2Chain interface { + L2BlockRefByHash(ctx context.Context, l2Hash common.Hash) (eth.L2BlockRef, error) +} + +var WrongChainErr = errors.New("wrong chain") +var TooDeepReorgErr = errors.New("reorg is too deep") + +const MaxReorgDepth = 500 + +// isCanonical returns the following values: +// - `aheadOrCanonical: true if the supplied block is ahead of the known head of the L1 chain, +// or canonical in the L1 chain. +// - `canonical`: true if the block is canonical in the L1 chain. +func isAheadOrCanonical(ctx context.Context, l1 L1Chain, block eth.BlockID) (aheadOrCanonical bool, canonical bool, err error) { + if l1Head, err := l1.L1HeadBlockRef(ctx); err != nil { + return false, false, err + } else if block.Number > l1Head.Number { + return true, false, nil + } else if canonical, err := l1.L1BlockRefByNumber(ctx, block.Number); err != nil { + return false, false, err + } else { + canonical := canonical.Hash == block.Hash + return canonical, canonical, nil + } +} + +// FindL2Heads walks back from `start` (the previous unsafe L2 block) and finds the unsafe and safe +// L2 blocks. +// +// - The *unsafe L2 block*: This is the highest L2 block whose L1 origin is a plausible (1) +// extension of the canonical L1 chain (as known to the op-node). +// - The *safe L2 block*: This is the highest L2 block whose epoch's sequencing window is +// complete within the canonical L1 chain (as known to the op-node). +// +// (1) Plausible meaning that the blockhash of the L2 block's L1 origin (as reported in the L1 +// Attributes deposit within the L2 block) is not canonical at another height in the L1 chain, +// and the same holds for all its ancestors. +func FindL2Heads(ctx context.Context, start eth.L2BlockRef, seqWindowSize uint64, + l1 L1Chain, l2 L2Chain, genesis *rollup.Genesis) (unsafe eth.L2BlockRef, safe eth.L2BlockRef, err error) { + + // Loop 1. Walk the L2 chain backwards until we find an L2 block whose L1 origin is canonical. + + // Current L2 block. + n := start + + // Number of blocks between n and start. + reorgDepth := 0 + + // Blockhash of L1 origin hash for the L2 block during the previous iteration, 0 for first + // iteration. When this changes as we walk the L2 chain backwards, it means we're seeing a different + // (earlier) epoch. + var prevL1OriginHash common.Hash + + // The highest L2 ancestor of `start` (or `start` itself) whose ancestors are not (yet) known + // to have a non-canonical L1 origin. Empty if no such candidate is known yet. Guaranteed to be + // set after exiting from Loop 1. + var highestPlausibleCanonicalOrigin eth.L2BlockRef + + for { + // Check if l1Origin is canonical when we get to a new epoch. + if prevL1OriginHash != n.L1Origin.Hash { + prevL1OriginHash = n.L1Origin.Hash + + if plausible, canonical, err := isAheadOrCanonical(ctx, l1, n.L1Origin); err != nil { + return eth.L2BlockRef{}, eth.L2BlockRef{}, err + } else if !plausible { + // L1 origin nor ahead of L1 head nor canonical, discard previous candidate and + // keep looking. + highestPlausibleCanonicalOrigin = eth.L2BlockRef{} + } else { + if highestPlausibleCanonicalOrigin == (eth.L2BlockRef{}) { + // No highest plausible candidate, make L2 block new candidate. + highestPlausibleCanonicalOrigin = n + } + if canonical { + break + } + } + } + + // Don't walk past genesis. If we were at the L2 genesis, but could not find its L1 origin, + // the L2 chain is building on the wrong L1 branch. + if n.Hash == genesis.L2.Hash || n.Number == genesis.L2.Number { + return eth.L2BlockRef{}, eth.L2BlockRef{}, WrongChainErr + } + + // Pull L2 parent for next iteration + n, err = l2.L2BlockRefByHash(ctx, n.ParentHash) + if err != nil { + return eth.L2BlockRef{}, eth.L2BlockRef{}, + fmt.Errorf("failed to fetch L2 block by hash %v: %w", n.ParentHash, err) + } + + reorgDepth++ + if reorgDepth >= MaxReorgDepth { + // If the reorg depth is too large, something is fishy. + // This can legitimately happen if L1 goes down for a while. But in that case, + // restarting the L2 node with a bigger configured MaxReorgDepth is an acceptable + // stopgap solution. + // Currently this can also happen if the L2 node is down for a while, but in the future + // state sync should prevent this issue. + return eth.L2BlockRef{}, eth.L2BlockRef{}, TooDeepReorgErr + } + } + + // Loop 2. Walk from the L1 origin of the `n` block (*) back to the L1 block that starts the + // sequencing window ending at that block. Instead of iterating on L1 blocks, we actually + // iterate on L2 blocks, because we want to find the safe L2 head, i.e. the highest L2 block + // whose L1 origin is the start of the sequencing window. + + // (*) `n` being at this stage the highest L2 block whose L1 origin is canonical. + + // Depth counter: we need to walk back `seqWindowSize` L1 blocks in order to find the start + // of the sequencing window. + depth := uint64(1) + + // Before entering the loop: `prevL1OriginHash == n.L1Origin.Hash` + // The original definitions of `n` and `prevL1OriginHash` still hold. + for { + // Advance depth if we change to a different (earlier) epoch. + if n.L1Origin.Hash != prevL1OriginHash { + depth++ + prevL1OriginHash = n.L1Origin.Hash + } + + // Found an L2 block whose L1 origin is the start of the sequencing window. + // Note: We also ensure that we are on the block number with the 0 seq number. + // This is a little hacky, but kinda works. The issue is about where the + // batch queue should start building. + if depth == seqWindowSize && n.SequenceNumber == 0 { + return highestPlausibleCanonicalOrigin, n, nil + } + + // Genesis is always safe. + if n.Hash == genesis.L2.Hash || n.Number == genesis.L2.Number { + safe = eth.L2BlockRef{Hash: genesis.L2.Hash, Number: genesis.L2.Number, + Time: genesis.L2Time, L1Origin: genesis.L1, SequenceNumber: 0} + return highestPlausibleCanonicalOrigin, safe, nil + } + + // Pull L2 parent for next iteration. + n, err = l2.L2BlockRefByHash(ctx, n.ParentHash) + if err != nil { + return eth.L2BlockRef{}, eth.L2BlockRef{}, + fmt.Errorf("failed to fetch L2 block by hash %v: %w", n.ParentHash, err) + } + } +} diff --git a/op-node/rollup/sync/start_test.go b/op-node/rollup/sync/start_test.go new file mode 100644 index 0000000000000..3946ccec2724c --- /dev/null +++ b/op-node/rollup/sync/start_test.go @@ -0,0 +1,248 @@ +package sync + +import ( + "context" + "testing" + + "github.com/ethereum-optimism/optimism/op-node/testlog" + "github.com/ethereum-optimism/optimism/op-node/testutils" + + "github.com/ethereum-optimism/optimism/op-node/eth" + "github.com/ethereum-optimism/optimism/op-node/rollup" + "github.com/ethereum/go-ethereum/log" + "github.com/stretchr/testify/require" +) + +var _ L1Chain = (*testutils.FakeChainSource)(nil) +var _ L2Chain = (*testutils.FakeChainSource)(nil) + +// generateFakeL2 creates a fake L2 chain with the following conditions: +// - The L2 chain is based off of the L1 chain +// - The actual L1 chain is the New L1 chain +// - Both heads are at the tip of their respective chains +func (c *syncStartTestCase) generateFakeL2(t *testing.T) (*testutils.FakeChainSource, eth.L2BlockRef, rollup.Genesis) { + log := testlog.Logger(t, log.LvlError) + chain := testutils.NewFakeChainSource([]string{c.L1, c.NewL1}, []string{c.L2}, int(c.GenesisL1Num), log) + chain.SetL2Head(len(c.L2) - 1) + genesis := testutils.FakeGenesis(c.GenesisL1, c.GenesisL2, int(c.GenesisL1Num)) + head, err := chain.L2BlockRefByNumber(context.Background(), nil) + require.Nil(t, err) + chain.ReorgL1() + for i := 0; i < len(c.NewL1)-1; i++ { + chain.AdvanceL1() + } + return chain, head, genesis + +} + +type syncStartTestCase struct { + Name string + + L1 string // L1 Chain prior to a re-org or other change + L2 string // L2 Chain that follows from L1Chain + NewL1 string // New L1 chain + + GenesisL1 rune + GenesisL1Num uint64 + GenesisL2 rune + + SeqWindowSize uint64 + SafeL2Head rune + UnsafeL2Head rune + ExpectedErr error +} + +func refToRune(r eth.BlockID) rune { + return rune(r.Hash.Bytes()[0]) +} + +func (c *syncStartTestCase) Run(t *testing.T) { + chain, l2Head, genesis := c.generateFakeL2(t) + + unsafeL2Head, safeHead, err := FindL2Heads(context.Background(), l2Head, c.SeqWindowSize, chain, chain, &genesis) + + if c.ExpectedErr != nil { + require.Error(t, err, "Expecting an error in this test case") + require.ErrorIs(t, c.ExpectedErr, err, "Unexpected error") + } else { + + require.NoError(t, err) + expectedUnsafeHead := refToRune(unsafeL2Head.ID()) + require.Equal(t, string(c.UnsafeL2Head), string(expectedUnsafeHead), "Unsafe L2 Head not equal") + + expectedSafeHead := refToRune(safeHead.ID()) + require.Equal(t, string(c.SafeL2Head), string(expectedSafeHead), "Safe L2 Head not equal") + } +} + +func TestFindSyncStart(t *testing.T) { + testCases := []syncStartTestCase{ + { + Name: "already synced", + GenesisL1Num: 0, + L1: "ab", + L2: "AB", + NewL1: "ab", + GenesisL1: 'a', + GenesisL2: 'A', + UnsafeL2Head: 'B', + SeqWindowSize: 2, + SafeL2Head: 'A', + ExpectedErr: nil, + }, + { + Name: "small reorg long chain", + GenesisL1Num: 0, + L1: "abcdefgh", + L2: "ABCDEFGH", + NewL1: "abcdefgx", + GenesisL1: 'a', + GenesisL2: 'A', + UnsafeL2Head: 'G', + SeqWindowSize: 2, + SafeL2Head: 'F', + ExpectedErr: nil, + }, + { + Name: "L1 Chain ahead", + GenesisL1Num: 0, + L1: "abcde", + L2: "ABCD", + NewL1: "abcde", + GenesisL1: 'a', + GenesisL2: 'A', + UnsafeL2Head: 'D', + SeqWindowSize: 3, + SafeL2Head: 'B', + ExpectedErr: nil, + }, + { + Name: "L2 Chain ahead after reorg", + GenesisL1Num: 0, + L1: "abxyz", + L2: "ABXYZ", + NewL1: "abx", + GenesisL1: 'a', + GenesisL2: 'A', + UnsafeL2Head: 'Z', + SeqWindowSize: 2, + SafeL2Head: 'B', + ExpectedErr: nil, + }, + { + Name: "genesis", + GenesisL1Num: 0, + L1: "a", + L2: "A", + NewL1: "a", + GenesisL1: 'a', + GenesisL2: 'A', + UnsafeL2Head: 'A', + SeqWindowSize: 2, + SafeL2Head: 'A', + ExpectedErr: nil, + }, + { + Name: "reorg one step back", + GenesisL1Num: 0, + L1: "abcd", + L2: "ABCD", + NewL1: "abcx", + GenesisL1: 'a', + GenesisL2: 'A', + UnsafeL2Head: 'C', + SeqWindowSize: 3, + SafeL2Head: 'A', + ExpectedErr: nil, + }, + { + Name: "reorg two steps back", + GenesisL1Num: 0, + L1: "abc", + L2: "ABC", + NewL1: "axy", + GenesisL1: 'a', + GenesisL2: 'A', + UnsafeL2Head: 'A', + SeqWindowSize: 2, + SafeL2Head: 'A', + ExpectedErr: nil, + }, + { + Name: "reorg three steps back", + GenesisL1Num: 0, + L1: "abcdef", + L2: "ABCDEF", + NewL1: "abcxyz", + GenesisL1: 'a', + GenesisL2: 'A', + UnsafeL2Head: 'C', + SeqWindowSize: 2, + SafeL2Head: 'B', + ExpectedErr: nil, + }, + { + Name: "unexpected L1 chain", + GenesisL1Num: 0, + L1: "abcdef", + L2: "ABCDEF", + NewL1: "xyzwio", + GenesisL1: 'a', + GenesisL2: 'A', + UnsafeL2Head: 0, + ExpectedErr: WrongChainErr, + }, + { + Name: "unexpected L2 chain", + GenesisL1Num: 0, + L1: "abcdef", + L2: "ABCDEF", + NewL1: "xyzwio", + GenesisL1: 'a', + GenesisL2: 'X', + UnsafeL2Head: 0, + ExpectedErr: WrongChainErr, + }, + { + Name: "offset L2 genesis", + GenesisL1Num: 3, + L1: "abcdef", + L2: "DEF", + NewL1: "abcdef", + GenesisL1: 'd', + GenesisL2: 'D', + UnsafeL2Head: 'F', + SeqWindowSize: 2, + SafeL2Head: 'E', + ExpectedErr: nil, + }, + { + Name: "offset L2 genesis reorg", + GenesisL1Num: 3, + L1: "abcdefgh", + L2: "DEFGH", + NewL1: "abcdxyzw", + GenesisL1: 'd', + GenesisL2: 'D', + UnsafeL2Head: 'D', + SeqWindowSize: 2, + SafeL2Head: 'D', + ExpectedErr: nil, + }, + { + Name: "reorg past offset genesis", + GenesisL1Num: 3, + L1: "abcdefgh", + L2: "DEFGH", + NewL1: "abxyzwio", + GenesisL1: 'd', + GenesisL2: 'D', + UnsafeL2Head: 0, + ExpectedErr: WrongChainErr, + }, + } + + for _, testCase := range testCases { + t.Run(testCase.Name, testCase.Run) + } +} diff --git a/op-node/testutils/mock_l1.go b/op-node/testutils/mock_l1.go index 3b90bc2687514..689f9f857a98d 100644 --- a/op-node/testutils/mock_l1.go +++ b/op-node/testutils/mock_l1.go @@ -22,6 +22,11 @@ func (m *MockL1Source) ExpectInfoByHash(hash common.Hash, info eth.L1Info, err e m.Mock.On("InfoByHash", hash).Once().Return(&info, &err) } +func (m *MockL1Source) L1HeadBlockRef(ctx context.Context) (eth.L1BlockRef, error) { + out := m.Mock.MethodCalled("L1HeadBlockRef") + return out[0].(eth.L1BlockRef), *out[1].(*error) +} + func (m *MockL1Source) L1BlockRefByNumber(ctx context.Context, u uint64) (eth.L1BlockRef, error) { out := m.Mock.MethodCalled("L1BlockRefByNumber", u) return out[0].(eth.L1BlockRef), *out[1].(*error) diff --git a/op-node/withdrawals/utils.go b/op-node/withdrawals/utils.go index 9ddac6c5fac5a..8cdcedc1c5aa6 100644 --- a/op-node/withdrawals/utils.go +++ b/op-node/withdrawals/utils.go @@ -154,7 +154,7 @@ type FinalizedWithdrawalParameters struct { GasLimit *big.Int BlockNumber *big.Int Data []byte - OutputRootProof bindings.HashingOutputRootProof + OutputRootProof bindings.TypesOutputRootProof WithdrawalProof []byte // RLP Encoded list of trie nodes to prove L2 storage } @@ -210,7 +210,7 @@ func FinalizeWithdrawalParameters(ctx context.Context, l2client ProofClient, txH GasLimit: ev.GasLimit, BlockNumber: new(big.Int).Set(header.Number), Data: ev.Data, - OutputRootProof: bindings.HashingOutputRootProof{ + OutputRootProof: bindings.TypesOutputRootProof{ Version: [32]byte{}, // Empty for version 1 StateRoot: header.Root, WithdrawerStorageRoot: p.StorageHash, diff --git a/op-proposer/drivers/l2output/driver.go b/op-proposer/drivers/l2output/driver.go index 17c79dc455981..10f8fed6b8a9a 100644 --- a/op-proposer/drivers/l2output/driver.go +++ b/op-proposer/drivers/l2output/driver.go @@ -109,7 +109,12 @@ func (d *Driver) GetBlockRange( d.l.Error(name+" unable to get next block number", "err", err) return nil, nil, err } - latestHeader, err := d.cfg.L2Client.HeaderByNumber(ctx, nil) + status, err := d.cfg.RollupClient.SyncStatus(ctx) + if err != nil { + d.l.Error(name+" unable to get sync status", "err", err) + return nil, nil, err + } + latestHeader, err := d.cfg.L2Client.HeaderByNumber(ctx, new(big.Int).SetUint64(status.SafeL2.Number)) if err != nil { d.l.Error(name+" unable to retrieve latest header", "err", err) return nil, nil, err @@ -185,7 +190,7 @@ func (d *Driver) CraftTx( opts.Nonce = nonce opts.NoSend = true - return d.l2ooContract.AppendL2Output(opts, l2OutputRoot, nextCheckpointBlock, l1Header.Hash(), l1Header.Number) + return d.l2ooContract.ProposeL2Output(opts, l2OutputRoot, nextCheckpointBlock, l1Header.Hash(), l1Header.Number) } // UpdateGasPrice signs an otherwise identical txn to the one provided but with diff --git a/op-proposer/go.mod b/op-proposer/go.mod index 94b0fa7481f20..66b69adad403d 100644 --- a/op-proposer/go.mod +++ b/op-proposer/go.mod @@ -5,7 +5,7 @@ go 1.18 require ( github.com/ethereum-optimism/optimism/op-bindings v0.3.0 github.com/ethereum-optimism/optimism/op-node v0.3.0 - github.com/ethereum/go-ethereum v1.10.17 + github.com/ethereum/go-ethereum v1.10.20 github.com/miguelmota/go-ethereum-hdwallet v0.1.1 github.com/stretchr/testify v1.8.0 github.com/urfave/cli v1.22.5 @@ -48,7 +48,7 @@ require ( github.com/rjeczalik/notify v0.9.2 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/shirou/gopsutil v3.21.11+incompatible // indirect - github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect + github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a // indirect github.com/tklauser/go-sysconf v0.3.10 // indirect github.com/tklauser/numcpus v0.4.0 // indirect github.com/tyler-smith/go-bip39 v1.1.0 // indirect @@ -60,4 +60,4 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect ) -replace github.com/ethereum/go-ethereum v1.10.17 => github.com/ethereum-optimism/reference-optimistic-geth v0.0.0-20220711171946-f579014dc46d +replace github.com/ethereum/go-ethereum v1.10.20 => github.com/ethereum-optimism/reference-optimistic-geth v0.0.0-20220715235548-70b02481016d diff --git a/op-proposer/go.sum b/op-proposer/go.sum index 345fa8096d948..4a1776a762f4c 100644 --- a/op-proposer/go.sum +++ b/op-proposer/go.sum @@ -37,9 +37,6 @@ collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4= github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc= -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= -github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0/go.mod h1:tPaiy8S5bQ+S5sOiDlINkp7+Ef339+Nz5L5XO+cnOHo= github.com/Azure/azure-storage-blob-go v0.7.0/go.mod h1:f9YQKtsG1nMisotuTPpO0tjNuEjKRYAcJU8/ydDI++4= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= @@ -149,8 +146,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -164,42 +159,32 @@ github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1m5sE92cU+pd5Mcc= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= -github.com/deepmap/oapi-codegen v1.6.0/go.mod h1:ryDa9AgbELGeB+YEXE1dR53yAjHwFvE9iAUlWl9Al3M= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8/go.mod h1:VMaSuZ+SZcx/wljOQKvp5srsbCiKDEb6K2wC4+PiBmQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dlclark/regexp2 v1.2.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= -github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= -github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= -github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v1.6.2/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/dop251/goja v0.0.0-20200721192441-a695b0cdd498/go.mod h1:Mw6PkjjMXWbTj+nnj4s3QPXq1jaT0s5pC0iFD4+BOAA= -github.com/dop251/goja v0.0.0-20220405120441-9037c2b61cbf/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= -github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/eclipse/paho.mqtt.golang v1.2.0/go.mod h1:H9keYFcgq3Qr5OUJm/JZI/i6U7joQ8SYLhZwfeOo6Ts= +github.com/edsrzf/mmap-go v1.0.0 h1:CEBF7HpRnUCSJgGUb5h1Gm7e3VkmVDrR8lvWVLtrOFw= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/edsrzf/mmap-go v1.1.0 h1:6EUwBLQ/Mcr1EYLE4Tn1VdW1A4ckqCQWZBw8Hr0kjpQ= -github.com/edsrzf/mmap-go v1.1.0/go.mod h1:19H/e8pUPLicwkyNgOykDXkJ9F0MHE+Z52B8EIth78Q= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/ethereum-optimism/optimism/op-bindings v0.0.0-20220614233543-0d8fa52afca2/go.mod h1:e9mMYiVsdJf9BI//FdaA77BwNNgNMR043JtB7CPXNxY= github.com/ethereum-optimism/optimism/op-bindings v0.3.0 h1:d2Mwb8FzR2zuhW0sS5xFKWz/6VFPTEIE+XINqZj0Rv4= github.com/ethereum-optimism/optimism/op-bindings v0.3.0/go.mod h1:CrvUVIISKcyJ7o27ub/HY4Kq9wEJQxrGmWthTqxPSGo= github.com/ethereum-optimism/optimism/op-node v0.3.0 h1:jep/cbIbP7fjBSAR48yk5NJVEoGYvoNlYI00KpBI6Mw= github.com/ethereum-optimism/optimism/op-node v0.3.0/go.mod h1:iF9AhYjr8jNeoCDNP/Vs/ywQ2USZU5L66AxZbSAUi0E= -github.com/ethereum-optimism/reference-optimistic-geth v0.0.0-20220711171946-f579014dc46d h1:AYFFbxrz7kLyFbvNHGhUPZQT8KnN1PPjCj4oAcgaVCk= -github.com/ethereum-optimism/reference-optimistic-geth v0.0.0-20220711171946-f579014dc46d/go.mod h1:8AfU1epKggKxDt9wr7rH5KmCeiT3yT0sEvroru1mO6Q= +github.com/ethereum-optimism/reference-optimistic-geth v0.0.0-20220715235548-70b02481016d h1:w0DBXhp0sv0bWRDOCA/Y6yHOALU7qLLLf5/kE3YfFr4= +github.com/ethereum-optimism/reference-optimistic-geth v0.0.0-20220715235548-70b02481016d/go.mod h1:m2m08SAQ8XB0VcVBoDg9n74Dw5PUMl3hzv1NXVBFPfg= 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/fjl/gencodec v0.0.0-20220412091415-8bb9e558978c/go.mod h1:AzA8Lj6YtixmJWL+wkKoBGsLWy9gFrAzi4g+5bCKwpY= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/fjl/memsize v0.0.1 h1:+zhkb+dhUgx0/e+M8sF0QqiouvMQUiKR+QYvdxIOKcQ= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= @@ -208,14 +193,12 @@ github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2 github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= -github.com/garslo/gogen v0.0.0-20170306192744-1d203ffc1f61/go.mod h1:Q0X6pkwTILDlzrGEckF6HKjXe48EgsY/l7K7vhY4MW8= +github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 h1:f6D9Hr8xV8uYKlyuj8XIruxlh9WjVjdh1gIicAS7ays= -github.com/getkin/kin-openapi v0.53.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= -github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -233,15 +216,13 @@ github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KE github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-sourcemap/sourcemap v2.1.2+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= -github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -286,7 +267,6 @@ github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEW github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golangci/lint-1 v0.0.0-20181222135242-d2cdd8c08219/go.mod h1:/X8TswGSh1pIozq4ZwCfxS0WA5JGXguxk94ar/4c87Y= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/flatbuffers v1.11.0/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= @@ -311,6 +291,7 @@ github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.5/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -322,20 +303,17 @@ github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORR github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/graph-gophers/graphql-go v0.0.0-20201113091052-beb923fada29/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= -github.com/graph-gophers/graphql-go v1.3.0/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-bexpr v0.1.10/go.mod h1:oxlubA2vC/gFVfX1A6JGp7ls7uCDlfJn732ehYYg+g0= github.com/hashicorp/go-bexpr v0.1.11 h1:6DqdA/KBjurGby9yTY0bmkathya0lfwF2SeuubCI7dY= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= @@ -364,24 +342,21 @@ github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpO github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/huin/goupnp v1.0.1-0.20210310174557-0ca763054c88/go.mod h1:nNs7wvRfN1eKaMknBydLNQU6146XQim8t4h+q90biWo= github.com/huin/goupnp v1.0.3 h1:N8No57ls+MnjlB+JPiCVSOyy/ot7MJTqlo7rn+NYSqQ= -github.com/huin/goupnp v1.0.3/go.mod h1:ZxNlw5WqJj6wSsRK5+YfflQGXYfccj5VgQsMNixHM7Y= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/influxdata/flux v0.65.1/go.mod h1:J754/zds0vvpfwuq7Gc2wRdVwEodfpCFM7mYlOw2LqY= github.com/influxdata/influxdb v1.8.3/go.mod h1:JugdFhsvvI8gadxOI6noqNeeBHvWNTbfYGtiAn+2jhI= -github.com/influxdata/influxdb-client-go/v2 v2.4.0/go.mod h1:vLNHdxTJkIf2mSLvGrpj8TCcISApPoXkaxP8g9uRlW8= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/influxdata/influxql v1.1.1-0.20200828144457-65d3ef77d385/go.mod h1:gHp9y86a/pxhjJ+zMjNXiQAA197Xk9wLxaz+fGG+kWk= github.com/influxdata/line-protocol v0.0.0-20180522152040-32c6aa80de5e/go.mod h1:4kt73NQhadE3daL3WhR5EJ/J2ocX0PZzwxQ0gXJ7oFE= -github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo= github.com/influxdata/promql/v2 v2.12.0/go.mod h1:fxOPu+DY0bqCTCECchSRtWfc+0X19ybifQhZoQNF5D8= github.com/influxdata/roaring v0.4.13-0.20180809181101-fc520f41fab6/go.mod h1:bSgUQ7q5ZLSO+bKBGqJiCBGAl+9DxyW63zLTujjUlOE= github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9/go.mod h1:Js0mqiSBE6Ffsg94weZZ2c+v/ciT8QRHFOap7EKDrR0= github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368/go.mod h1:Wbbw6tYNvwa5dlB6304Sd+82Z3f7PmVZHVKU637d4po= github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= -github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= @@ -406,7 +381,6 @@ github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8 github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef/go.mod h1:Ct9fl0F6iIOGgxJ5npU/IUOhOhqlVrGjyIZc8/MagT0= github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= -github.com/karalabe/usb v0.0.2/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= @@ -419,38 +393,24 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxv github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v0.0.0-20170224010052-a616ab194758/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/labstack/echo/v4 v4.2.1/go.mod h1:AA49e0DZ8kk5jTOOCKNuPR6oTnBS0dYiM4FW1e6jwpg= -github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/matryer/moq v0.0.0-20190312154309-6cfb0558e1bd/go.mod h1:9ELz6aaclSIGnZBoaSLZ3NAl1VTufbOrXBPvtcy6WiQ= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.0/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= github.com/mattn/go-ieproxy v0.0.0-20190610004146-91bb50d98149/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.5-0.20180830101745-3fb116b82035/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= @@ -471,16 +431,13 @@ github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS4 github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= -github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4= github.com/mitchellh/pointerstructure v1.2.1 h1:ZhBBeX8tSlRpu/FFhXH4RC4OJzFlqsQhoHZAz4x7TIw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -495,6 +452,7 @@ github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxzi github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= @@ -503,15 +461,19 @@ github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw= +github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= @@ -631,11 +593,12 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/syndtr/goleveldb v1.0.1-0.20210305035536-64b5b1c73954/go.mod h1:u2MKkTVTVJWe5D1rCvame8WqhBd88EuIwODJZ1VHCPM= -github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= -github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= +github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a h1:1ur3QoCqvE5fl+nylMaIr9PVV1w343YRDtsy+Rwu7XI= +github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= github.com/tinylib/msgp v1.0.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= github.com/tklauser/go-sysconf v0.3.5/go.mod h1:MkWzOF4RMCshBAMXuhXJs64Rte09mITnppBXY/rYEFI= github.com/tklauser/go-sysconf v0.3.10 h1:IJ1AZGZRWbY8T5Vfk04D9WOA5WSejdflXxP03OUqALw= @@ -652,17 +615,15 @@ github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtX github.com/urfave/cli v1.22.5 h1:lNq9sAHXK2qfdI8W+GRItjCEkI+2oR4d+MEHy1CKXoU= github.com/urfave/cli v1.22.5/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= +github.com/urfave/cli/v2 v2.10.2 h1:x3p8awjp/2arX+Nl/G2040AZpOCHS/eMJJ1/a+mye4Y= github.com/willf/bitset v1.1.3/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= +github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg= github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= @@ -694,11 +655,7 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220307211146-efcb8507fb70/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e h1:T8NU3HyQ8ClP4SEE+KbFlg6n0NhuTsN4MyznaarGsZM= golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -714,7 +671,6 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20220426173459-3bcf042a4bf5/go.mod h1:lgLbSvA5ygNOMpwM/9anMpWVlVJ7Z+cHWq/eFuinpGE= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -737,8 +693,6 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= -golang.org/x/mod v0.6.0-dev.0.20211013180041-c96bc1413d57/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -777,19 +731,15 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210220033124-5f55cee0dc0d/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 h1:NWy5+hlRbC7HK+PmcXVUmW1IMyFce7to56IUvhUFm7Y= +golang.org/x/net v0.0.0-20220607020251-c690dde0001d h1:4SFsTMi4UahlKoloni7L4eYzhFRifURQLw+yv0QDCx8= +golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -819,7 +769,6 @@ golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -828,13 +777,11 @@ golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -842,7 +789,6 @@ golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200107162124-548cf772de50/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -859,9 +805,9 @@ golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -870,15 +816,14 @@ golang.org/x/sys v0.0.0-20210420205809-ac73e9fd8988/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220701225701-179beb0bd1a1 h1:+Lm8wRwJpsVpTHuM4tHTwgxjPzv/bjxsHt2cW5EY7XU= golang.org/x/sys v0.0.0-20220701225701-179beb0bd1a1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -887,7 +832,6 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= @@ -896,7 +840,6 @@ golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20220224211638-0e9765cccd65 h1:M73Iuj3xbbb9Uk1DYhzydthsj6oOd6l9bpuFcNoUvTs= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -925,7 +868,6 @@ golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191126055441-b0650ceb63d9/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -949,12 +891,13 @@ golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.8-0.20211029000441-d6a9af8af023/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.0.0-20181121035319-3f7ecaa7e8ca/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.6.0/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= @@ -1051,9 +994,8 @@ google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= @@ -1064,7 +1006,6 @@ gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6/go.mod h1:uAJ gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/urfave/cli.v1 v1.20.0 h1:NdAVW6RYxDif9DhDHaAortIu956m2c0v+09AZBPTbE0= gopkg.in/urfave/cli.v1 v1.20.0/go.mod h1:vuBzUtMdQeixQj8LVd+/98pzhxNGQoyuPBlsXHOQNO0= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= @@ -1078,7 +1019,6 @@ gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= diff --git a/packages/contracts-bedrock/.eslintrc.js b/packages/contracts-bedrock/.eslintrc.js index bfd2057be80bd..048ff5ebd5b65 100644 --- a/packages/contracts-bedrock/.eslintrc.js +++ b/packages/contracts-bedrock/.eslintrc.js @@ -1,3 +1,4 @@ module.exports = { extends: '../../.eslintrc.js', + ignorePatterns: ['src/contract-artifacts.ts'], } diff --git a/packages/contracts-bedrock/.gas-snapshot b/packages/contracts-bedrock/.gas-snapshot index ee99a827e756e..21763758c72b8 100644 --- a/packages/contracts-bedrock/.gas-snapshot +++ b/packages/contracts-bedrock/.gas-snapshot @@ -1,155 +1,159 @@ -GasBenchMark_L1CrossDomainMessenger:test_L1MessengerSendMessage_benchmark_0() (gas: 262334) -GasBenchMark_L1CrossDomainMessenger:test_L1MessengerSendMessage_benchmark_1() (gas: 75318) -GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_0() (gas: 353380) -GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_1() (gas: 116384) -GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_0() (gas: 353402) -GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_1() (gas: 116359) -GasBenchMark_L1StandardBridge_Finalize:test_finalizeETHWithdrawal_benchmark() (gas: 45413) -GasBenchMark_L2OutputOracle:test_appendL2Output_benchmark() (gas: 68673) -GasBenchMark_OptimismPortal:test_depositTransaction_benchmark() (gas: 75069) -GasBenchMark_OptimismPortal:test_depositTransaction_benchmark_1() (gas: 35373) -DeployerWhitelist_Test:test_owner() (gas: 7658) -DeployerWhitelist_Test:test_storageSlots() (gas: 33494) -Encoding_Test:test_encodeDepositTransaction() (gas: 64610) -GasPriceOracle_Test:test_baseFee() (gas: 8370) +GasBenchMark_L1CrossDomainMessenger:test_L1MessengerSendMessage_benchmark_0() (gas: 263435) +GasBenchMark_L1CrossDomainMessenger:test_L1MessengerSendMessage_benchmark_1() (gas: 77595) +GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_0() (gas: 354407) +GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_1() (gas: 118585) +GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_0() (gas: 354429) +GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_1() (gas: 118560) +GasBenchMark_L1StandardBridge_Finalize:test_finalizeETHWithdrawal_benchmark() (gas: 45432) +GasBenchMark_L2OutputOracle:test_proposeL2Output_benchmark() (gas: 68671) +GasBenchMark_OptimismPortal:test_depositTransaction_benchmark() (gas: 74964) +GasBenchMark_OptimismPortal:test_depositTransaction_benchmark_1() (gas: 35777) +DeployerWhitelist_Test:test_owner() (gas: 7591) +DeployerWhitelist_Test:test_storageSlots() (gas: 33427) +GasPriceOracle_Test:test_baseFee() (gas: 8392) GasPriceOracle_Test:test_gasPrice() (gas: 8381) -GasPriceOracle_Test:test_l1BaseFee() (gas: 10582) -GasPriceOracle_Test:test_onlyOwnerSetDecimals() (gas: 10553) +GasPriceOracle_Test:test_l1BaseFee() (gas: 10648) +GasPriceOracle_Test:test_onlyOwnerSetDecimals() (gas: 10575) GasPriceOracle_Test:test_onlyOwnerSetOverhead() (gas: 10599) -GasPriceOracle_Test:test_onlyOwnerSetScalar() (gas: 10640) -GasPriceOracle_Test:test_owner() (gas: 9806) -GasPriceOracle_Test:test_setDecimals() (gas: 36798) -GasPriceOracle_Test:test_setGasPriceReverts() (gas: 11740) -GasPriceOracle_Test:test_setL1BaseFeeReverts() (gas: 11717) -GasPriceOracle_Test:test_setOverhead() (gas: 36767) -GasPriceOracle_Test:test_setScalar() (gas: 36818) -GasPriceOracle_Test:test_storageLayout() (gas: 86683) -Hashing_Test:test_hashDepositSource() (gas: 673) -Hashing_Test:test_hashDepositTransaction() (gas: 39129) -L1BlockTest:test_basefee() (gas: 7531) -L1BlockTest:test_hash() (gas: 7575) -L1BlockTest:test_number() (gas: 7630) -L1BlockTest:test_sequenceNumber() (gas: 7695) -L1BlockTest:test_timestamp() (gas: 7662) -L1BlockTest:test_updateValues() (gas: 28216) -L1BlockNumberTest:test_fallback() (gas: 18774) -L1BlockNumberTest:test_getL1BlockNumber() (gas: 10657) -L1BlockNumberTest:test_receive() (gas: 25437) -L1CrossDomainMessenger_Test:testCannot_L1MessengerPause() (gas: 24561) -L1CrossDomainMessenger_Test:testCannot_L1MessengerUnpause() (gas: 24508) -L1CrossDomainMessenger_Test:test_L1MessengerMessageVersion() (gas: 24748) -L1CrossDomainMessenger_Test:test_L1MessengerPause() (gas: 48017) -L1CrossDomainMessenger_Test:test_L1MessengerRelayMessageSucceeds() (gas: 77750) -L1CrossDomainMessenger_Test:test_L1MessengerRelayMessageToSystemContract() (gas: 67778) -L1CrossDomainMessenger_Test:test_L1MessengerRelayShouldRevertIfPaused() (gas: 60471) -L1CrossDomainMessenger_Test:test_L1MessengerReplayMessageWithValue() (gas: 38127) -L1CrossDomainMessenger_Test:test_L1MessengerSendMessage() (gas: 297745) -L1CrossDomainMessenger_Test:test_L1MessengerTwiceSendMessage() (gas: 1490048) -L1CrossDomainMessenger_Test:test_L1MessengerUnpause() (gas: 40889) -L1CrossDomainMessenger_Test:test_L1MessengerXDomainSenderReverts() (gas: 24249) -L1CrossDomainMessenger_Test:test_L1MessengerxDomainMessageSenderResets() (gas: 86146) -L1StandardBridge_Test:test_depositERC20() (gas: 578867) -L1StandardBridge_Test:test_depositERC20To() (gas: 581048) -L1StandardBridge_Test:test_depositETH() (gas: 372975) -L1StandardBridge_Test:test_depositETHTo() (gas: 330097) -L1StandardBridge_Test:test_finalizeERC20Withdrawal() (gas: 490759) -L1StandardBridge_Test:test_finalizeETHWithdrawal() (gas: 64409) -L1StandardBridge_Test:test_initialize() (gas: 26336) -L1StandardBridge_Test:test_onlyEOADepositERC20() (gas: 22363) -L1StandardBridge_Test:test_onlyEOADepositETH() (gas: 40882) -L1StandardBridge_Test:test_onlyL2BridgeFinalizeERC20Withdrawal() (gas: 36271) -L1StandardBridge_Test:test_onlyPortalFinalizeERC20Withdrawal() (gas: 35600) -L1StandardBridge_Test:test_receive() (gas: 519560) -L2CrossDomainMessenger_Test:testCannot_L2MessengerPause() (gas: 10800) -L2CrossDomainMessenger_Test:test_L2MessengerMessageVersion() (gas: 8477) -L2CrossDomainMessenger_Test:test_L2MessengerPause() (gas: 31772) -L2CrossDomainMessenger_Test:test_L2MessengerRelayMessageSucceeds() (gas: 57309) -L2CrossDomainMessenger_Test:test_L2MessengerRelayMessageToSystemContract() (gas: 36137) -L2CrossDomainMessenger_Test:test_L2MessengerRelayShouldRevertIfPaused() (gas: 41600) -L2CrossDomainMessenger_Test:test_L2MessengerSendMessage() (gas: 120536) -L2CrossDomainMessenger_Test:test_L2MessengerTwiceSendMessage() (gas: 133720) -L2CrossDomainMessenger_Test:test_L2MessengerXDomainSenderReverts() (gas: 10576) -L2CrossDomainMessenger_Test:test_L2MessengerxDomainMessageSenderResets() (gas: 54776) -L2OutputOracleTest:testCannot_AppendWithUnmatchedBlockhash() (gas: 26811) -L2OutputOracleTest:testCannot_appendEmptyOutput() (gas: 24086) -L2OutputOracleTest:testCannot_appendFutureTimetamp() (gas: 26075) -L2OutputOracleTest:testCannot_appendOnWrongFork() (gas: 26360) -L2OutputOracleTest:testCannot_appendOutputIfNotSequencer() (gas: 23477) -L2OutputOracleTest:testCannot_appendUnexpectedBlockNumber() (gas: 25984) -L2OutputOracleTest:testCannot_deleteL2Output_ifNotOwner() (gas: 24778) -L2OutputOracleTest:testCannot_deleteL2Output_withWrongRoot() (gas: 91048) -L2OutputOracleTest:testCannot_deleteL2Output_withWrongTime() (gas: 87063) -L2OutputOracleTest:test_appendWithBlockhashAndHeight() (gas: 75048) -L2OutputOracleTest:test_appendingAnotherOutput() (gas: 76839) -L2OutputOracleTest:test_changeSequencer() (gas: 55963) -L2OutputOracleTest:test_computeL2Timestamp() (gas: 30200) -L2OutputOracleTest:test_constructor() (gas: 48793) -L2OutputOracleTest:test_deleteL2Output() (gas: 76438) -L2OutputOracleTest:test_getL2Output() (gas: 82869) -L2OutputOracleTest:test_latestBlockNumber() (gas: 76176) -L2OutputOracleTest:test_nextBlockNumber() (gas: 15122) -L2OutputOracleTest:test_updateOwner() (gas: 34603) -L2OutputOracleUpgradeable_Test:test_cannotInitImpl() (gas: 19451) -L2OutputOracleUpgradeable_Test:test_cannotInitProxy() (gas: 24516) -L2OutputOracleUpgradeable_Test:test_initValuesOnProxy() (gas: 38865) +GasPriceOracle_Test:test_onlyOwnerSetScalar() (gas: 10574) +GasPriceOracle_Test:test_owner() (gas: 9828) +GasPriceOracle_Test:test_setDecimals() (gas: 36842) +GasPriceOracle_Test:test_setGasPriceReverts() (gas: 11762) +GasPriceOracle_Test:test_setL1BaseFeeReverts() (gas: 11739) +GasPriceOracle_Test:test_setOverhead() (gas: 36789) +GasPriceOracle_Test:test_setScalar() (gas: 36796) +GasPriceOracle_Test:test_storageLayout() (gas: 86705) +Hashing_Test:test_hashDepositSource() (gas: 628) +L1BlockTest:test_basefee() (gas: 7575) +L1BlockTest:test_hash() (gas: 7552) +L1BlockTest:test_number() (gas: 7629) +L1BlockTest:test_sequenceNumber() (gas: 7650) +L1BlockTest:test_timestamp() (gas: 7661) +L1BlockTest:test_updateValues() (gas: 28193) +L1BlockNumberTest:test_fallback() (gas: 18677) +L1BlockNumberTest:test_getL1BlockNumber() (gas: 10668) +L1BlockNumberTest:test_receive() (gas: 25340) +L1CrossDomainMessenger_Test:testCannot_L1MessengerPause() (gas: 24500) +L1CrossDomainMessenger_Test:testCannot_L1MessengerUnpause() (gas: 24536) +L1CrossDomainMessenger_Test:test_L1MessengerMessageVersion() (gas: 24716) +L1CrossDomainMessenger_Test:test_L1MessengerPause() (gas: 48005) +L1CrossDomainMessenger_Test:test_L1MessengerRelayMessageFirstStuckSecondSucceeds() (gas: 201779) +L1CrossDomainMessenger_Test:test_L1MessengerRelayMessageRevertsOnReentrancy() (gas: 195102) +L1CrossDomainMessenger_Test:test_L1MessengerRelayMessageSucceeds() (gas: 77841) +L1CrossDomainMessenger_Test:test_L1MessengerRelayMessageToSystemContract() (gas: 67957) +L1CrossDomainMessenger_Test:test_L1MessengerRelayShouldRevertIfPaused() (gas: 60463) +L1CrossDomainMessenger_Test:test_L1MessengerReplayMessageWithValue() (gas: 38169) +L1CrossDomainMessenger_Test:test_L1MessengerSendMessage() (gas: 301583) +L1CrossDomainMessenger_Test:test_L1MessengerTwiceSendMessage() (gas: 1492570) +L1CrossDomainMessenger_Test:test_L1MessengerUnpause() (gas: 40872) +L1CrossDomainMessenger_Test:test_L1MessengerXDomainSenderReverts() (gas: 24316) +L1CrossDomainMessenger_Test:test_L1MessengerxDomainMessageSenderResets() (gas: 86376) +L1StandardBridge_Test:test_depositERC20() (gas: 579490) +L1StandardBridge_Test:test_depositERC20To() (gas: 581697) +L1StandardBridge_Test:test_depositETH() (gas: 373948) +L1StandardBridge_Test:test_depositETHTo() (gas: 331084) +L1StandardBridge_Test:test_finalizeBridgeERC20FailSendBack() (gas: 681445) +L1StandardBridge_Test:test_finalizeERC20Withdrawal() (gas: 490132) +L1StandardBridge_Test:test_finalizeETHWithdrawal() (gas: 64273) +L1StandardBridge_Test:test_initialize() (gas: 26334) +L1StandardBridge_Test:test_onlyEOADepositERC20() (gas: 22376) +L1StandardBridge_Test:test_onlyEOADepositETH() (gas: 40859) +L1StandardBridge_Test:test_onlyL2BridgeFinalizeERC20Withdrawal() (gas: 36268) +L1StandardBridge_Test:test_onlyPortalFinalizeERC20Withdrawal() (gas: 35573) +L1StandardBridge_Test:test_receive() (gas: 520566) +L2CrossDomainMessenger_Test:testCannot_L2MessengerPause() (gas: 10845) +L2CrossDomainMessenger_Test:test_L1MessengerRelayMessageRevertsOnReentrancy() (gas: 171930) +L2CrossDomainMessenger_Test:test_L2MessengerMessageVersion() (gas: 8411) +L2CrossDomainMessenger_Test:test_L2MessengerPause() (gas: 31749) +L2CrossDomainMessenger_Test:test_L2MessengerRelayMessageFirstStuckSecondSucceeds() (gas: 172920) +L2CrossDomainMessenger_Test:test_L2MessengerRelayMessageSucceeds() (gas: 57372) +L2CrossDomainMessenger_Test:test_L2MessengerRelayMessageToSystemContract() (gas: 36193) +L2CrossDomainMessenger_Test:test_L2MessengerRelayShouldRevertIfPaused() (gas: 41619) +L2CrossDomainMessenger_Test:test_L2MessengerSendMessage() (gas: 121522) +L2CrossDomainMessenger_Test:test_L2MessengerTwiceSendMessage() (gas: 135934) +L2CrossDomainMessenger_Test:test_L2MessengerXDomainSenderReverts() (gas: 10609) +L2CrossDomainMessenger_Test:test_L2MessengerxDomainMessageSenderResets() (gas: 54887) +L2OutputOracleTest:testCannot_ProposeWithUnmatchedBlockhash() (gas: 26829) +L2OutputOracleTest:testCannot_deleteL2Output_ifNotOwner() (gas: 25097) +L2OutputOracleTest:testCannot_deleteL2Output_withWrongRoot() (gas: 91432) +L2OutputOracleTest:testCannot_deleteL2Output_withWrongTime() (gas: 87426) +L2OutputOracleTest:testCannot_proposeEmptyOutput() (gas: 24128) +L2OutputOracleTest:testCannot_proposeFutureTimetamp() (gas: 26097) +L2OutputOracleTest:testCannot_proposeL2OutputIfNotProposer() (gas: 23564) +L2OutputOracleTest:testCannot_proposeOnWrongFork() (gas: 26424) +L2OutputOracleTest:testCannot_proposeUnexpectedBlockNumber() (gas: 25983) +L2OutputOracleTest:test_changeProposer() (gas: 56052) +L2OutputOracleTest:test_computeL2Timestamp() (gas: 30288) +L2OutputOracleTest:test_constructor() (gas: 49046) +L2OutputOracleTest:test_deleteOutput() (gas: 77223) +L2OutputOracleTest:test_getL2Output() (gas: 88508) +L2OutputOracleTest:test_latestBlockNumber() (gas: 76284) +L2OutputOracleTest:test_nextBlockNumber() (gas: 15232) +L2OutputOracleTest:test_proposeWithBlockhashAndHeight() (gas: 75046) +L2OutputOracleTest:test_proposingAnotherOutput() (gas: 76881) +L2OutputOracleTest:test_updateOwner() (gas: 34580) +L2OutputOracleUpgradeable_Test:test_cannotInitImpl() (gas: 19428) +L2OutputOracleUpgradeable_Test:test_cannotInitProxy() (gas: 24427) +L2OutputOracleUpgradeable_Test:test_initValuesOnProxy() (gas: 39086) L2OutputOracleUpgradeable_Test:test_upgrading() (gas: 230843) -L2StandardBridge_Test:test_ERC20BridgeFailed_whenLocalTokenIsBridge() (gas: 133459) -L2StandardBridge_Test:test_cannotWithdrawEthWithoutSendingIt() (gas: 21656) -L2StandardBridge_Test:test_finalizeDeposit() (gas: 93203) -L2StandardBridge_Test:test_finalizeDeposit_failsToCompleteOutboundTransfer() (gas: 140469) -L2StandardBridge_Test:test_initialize() (gas: 14802) -L2StandardBridge_Test:test_receive() (gas: 136864) -L2StandardBridge_Test:test_withdraw() (gas: 353020) -L2StandardBridge_Test:test_withdrawTo() (gas: 353705) -L2StandardBridge_Test:test_withdraw_onlyEOA() (gas: 252006) -L2ToL1MessagePasserTest:test_burn() (gas: 112037) -L2ToL1MessagePasserTest:test_initiateWithdrawal_fromContract() (gas: 67892) -L2ToL1MessagePasserTest:test_initiateWithdrawal_fromEOA() (gas: 74831) +L2StandardBridge_Test:test_ERC20BridgeFailed_whenLocalTokenIsBridge() (gas: 134196) +L2StandardBridge_Test:test_cannotWithdrawEthWithoutSendingIt() (gas: 21619) +L2StandardBridge_Test:test_finalizeBridgeERC20FailSendBack() (gas: 499320) +L2StandardBridge_Test:test_finalizeDeposit() (gas: 93125) +L2StandardBridge_Test:test_finalizeDeposit_failsToCompleteOutboundTransfer() (gas: 141211) +L2StandardBridge_Test:test_initialize() (gas: 14823) +L2StandardBridge_Test:test_receive() (gas: 137760) +L2StandardBridge_Test:test_withdraw() (gas: 353308) +L2StandardBridge_Test:test_withdrawTo() (gas: 354064) +L2StandardBridge_Test:test_withdraw_onlyEOA() (gas: 251674) +L2ToL1MessagePasserTest:test_burn() (gas: 112246) +L2ToL1MessagePasserTest:test_initiateWithdrawal_fromContract() (gas: 68198) +L2ToL1MessagePasserTest:test_initiateWithdrawal_fromEOA() (gas: 75284) LegacyERC20ETH_Test:test_approve() (gas: 10796) LegacyERC20ETH_Test:test_burn() (gas: 10681) LegacyERC20ETH_Test:test_crossDomain() (gas: 10577) LegacyERC20ETH_Test:test_decreaseAllowance() (gas: 10731) LegacyERC20ETH_Test:test_increaseAllowance() (gas: 10741) -LegacyERC20ETH_Test:test_metadata() (gas: 15586) +LegacyERC20ETH_Test:test_metadata() (gas: 15574) LegacyERC20ETH_Test:test_mint() (gas: 10627) LegacyERC20ETH_Test:test_transfer() (gas: 10829) LegacyERC20ETH_Test:test_transferFrom() (gas: 13008) OptimismMintableERC20_Test:test_bridge() (gas: 9828) -OptimismMintableERC20_Test:test_burn() (gas: 52826) -OptimismMintableERC20_Test:test_burnRevertsFromNotBridge() (gas: 13219) +OptimismMintableERC20_Test:test_burn() (gas: 52788) +OptimismMintableERC20_Test:test_burnRevertsFromNotBridge() (gas: 13228) OptimismMintableERC20_Test:test_erc165_supportsInterface() (gas: 7828) OptimismMintableERC20_Test:test_l1Token() (gas: 9824) OptimismMintableERC20_Test:test_l2Bridge() (gas: 9746) -OptimismMintableERC20_Test:test_mint() (gas: 65754) -OptimismMintableERC20_Test:test_mintRevertsFromNotBridge() (gas: 13243) +OptimismMintableERC20_Test:test_mint() (gas: 65763) +OptimismMintableERC20_Test:test_mintRevertsFromNotBridge() (gas: 13252) OptimismMintableERC20_Test:test_remoteToken() (gas: 9740) OptimismMintableTokenFactory_Test:test_bridge() (gas: 7663) -OptimismMintableTokenFactory_Test:test_createStandardL2Token() (gas: 1113150) -OptimismMintableTokenFactory_Test:test_createStandardL2TokenSameTwice() (gas: 2209211) -OptimismMintableTokenFactory_Test:test_createStandardL2TokenShouldRevertIfRemoteIsZero() (gas: 9399) +OptimismMintableTokenFactory_Test:test_createStandardL2Token() (gas: 1112929) +OptimismMintableTokenFactory_Test:test_createStandardL2TokenSameTwice() (gas: 2208763) +OptimismMintableTokenFactory_Test:test_createStandardL2TokenShouldRevertIfRemoteIsZero() (gas: 9398) OptimismPortalUpgradeable_Test:test_cannotInitImpl() (gas: 10686) -OptimismPortalUpgradeable_Test:test_cannotInitProxy() (gas: 15728) -OptimismPortalUpgradeable_Test:test_initValuesOnProxy() (gas: 15990) +OptimismPortalUpgradeable_Test:test_cannotInitProxy() (gas: 15662) +OptimismPortalUpgradeable_Test:test_initValuesOnProxy() (gas: 15967) OptimismPortalUpgradeable_Test:test_upgrading() (gas: 230843) OptimismPortal_Test:test_OptimismPortalConstructor() (gas: 17319) -OptimismPortal_Test:test_OptimismPortalContractCreationReverts() (gas: 14238) -OptimismPortal_Test:test_OptimismPortalReceiveEth() (gas: 126614) -OptimismPortal_Test:test_cannotVerifyRecentWithdrawal() (gas: 31902) -OptimismPortal_Test:test_depositTransaction_NoValueContract() (gas: 75820) -OptimismPortal_Test:test_depositTransaction_NoValueEOA() (gas: 76099) -OptimismPortal_Test:test_depositTransaction_createWithZeroValueForContract() (gas: 75825) -OptimismPortal_Test:test_depositTransaction_createWithZeroValueForEOA() (gas: 76146) -OptimismPortal_Test:test_depositTransaction_withEthValueAndContractContractCreation() (gas: 82846) -OptimismPortal_Test:test_depositTransaction_withEthValueAndEOAContractCreation() (gas: 75007) -OptimismPortal_Test:test_depositTransaction_withEthValueFromContract() (gas: 82550) -OptimismPortal_Test:test_depositTransaction_withEthValueFromEOA() (gas: 83145) -OptimismPortal_Test:test_invalidWithdrawalProof() (gas: 45086) -OptimismPortal_Test:test_isOutputFinalized() (gas: 131886) -OptimismPortal_Test:test_simple_isOutputFinalized() (gas: 23999) +OptimismPortal_Test:test_OptimismPortalContractCreationReverts() (gas: 14199) +OptimismPortal_Test:test_OptimismPortalReceiveEth() (gas: 127534) +OptimismPortal_Test:test_cannotVerifyRecentWithdrawal() (gas: 25613) +OptimismPortal_Test:test_depositTransaction_NoValueContract() (gas: 76668) +OptimismPortal_Test:test_depositTransaction_NoValueEOA() (gas: 76992) +OptimismPortal_Test:test_depositTransaction_createWithZeroValueForContract() (gas: 76673) +OptimismPortal_Test:test_depositTransaction_createWithZeroValueForEOA() (gas: 76994) +OptimismPortal_Test:test_depositTransaction_withEthValueAndContractContractCreation() (gas: 83694) +OptimismPortal_Test:test_depositTransaction_withEthValueAndEOAContractCreation() (gas: 75881) +OptimismPortal_Test:test_depositTransaction_withEthValueFromContract() (gas: 83356) +OptimismPortal_Test:test_depositTransaction_withEthValueFromEOA() (gas: 83993) +OptimismPortal_Test:test_invalidWithdrawalProof() (gas: 38103) +OptimismPortal_Test:test_isBlockFinalized() (gas: 113703) +OptimismPortal_Test:test_simple_isBlockFinalized() (gas: 26630) Proxy_Test:test_clashingFunctionSignatures() (gas: 101427) Proxy_Test:test_implementationKey() (gas: 20942) Proxy_Test:test_implementationProxyCallIfNotAdmin() (gas: 30021) -Proxy_Test:test_implementationZeroAddress() (gas: 48000) +Proxy_Test:test_implementationZeroAddress() (gas: 47604) Proxy_Test:test_itDelegatesToTheImplementation() (gas: 45251) Proxy_Test:test_ownerKey() (gas: 19091) Proxy_Test:test_ownerProxyCallIfNotAdmin() (gas: 34711) @@ -157,21 +161,21 @@ Proxy_Test:test_payableUpgradeToAndCall() (gas: 53865) Proxy_Test:test_revertUpgradeToAndCall() (gas: 104654) Proxy_Test:test_upgradeToAndCall() (gas: 125305) Proxy_Test:test_zeroAddressCaller() (gas: 14825) -ProxyAdmin_Test:test_chugsplashChangeProxyAdmin() (gas: 35647) -ProxyAdmin_Test:test_chugsplashGetProxyAdmin() (gas: 15689) -ProxyAdmin_Test:test_chugsplashGetProxyImplementation() (gas: 51167) -ProxyAdmin_Test:test_chugsplashUpgrade() (gas: 48972) -ProxyAdmin_Test:test_chugsplashUpgradeAndCall() (gas: 82345) -ProxyAdmin_Test:test_delegateResolvedChangeProxyAdmin() (gas: 34020) -ProxyAdmin_Test:test_delegateResolvedGetProxyAdmin() (gas: 17708) -ProxyAdmin_Test:test_delegateResolvedGetProxyImplementation() (gas: 62016) -ProxyAdmin_Test:test_delegateResolvedUpgrade() (gas: 58466) -ProxyAdmin_Test:test_delegateResolvedUpgradeAndCall() (gas: 97926) -ProxyAdmin_Test:test_erc1967ChangeProxyAdmin() (gas: 33863) -ProxyAdmin_Test:test_erc1967GetProxyAdmin() (gas: 15672) -ProxyAdmin_Test:test_erc1967GetProxyImplementation() (gas: 52102) -ProxyAdmin_Test:test_erc1967Upgrade() (gas: 50036) -ProxyAdmin_Test:test_erc1967UpgradeAndCall() (gas: 79019) +ProxyAdmin_Test:test_chugsplashChangeProxyAdmin() (gas: 35623) +ProxyAdmin_Test:test_chugsplashGetProxyAdmin() (gas: 15683) +ProxyAdmin_Test:test_chugsplashGetProxyImplementation() (gas: 51149) +ProxyAdmin_Test:test_chugsplashUpgrade() (gas: 48960) +ProxyAdmin_Test:test_chugsplashUpgradeAndCall() (gas: 82330) +ProxyAdmin_Test:test_delegateResolvedChangeProxyAdmin() (gas: 33982) +ProxyAdmin_Test:test_delegateResolvedGetProxyAdmin() (gas: 17699) +ProxyAdmin_Test:test_delegateResolvedGetProxyImplementation() (gas: 62091) +ProxyAdmin_Test:test_delegateResolvedUpgrade() (gas: 58496) +ProxyAdmin_Test:test_delegateResolvedUpgradeAndCall() (gas: 97965) +ProxyAdmin_Test:test_erc1967ChangeProxyAdmin() (gas: 33851) +ProxyAdmin_Test:test_erc1967GetProxyAdmin() (gas: 15669) +ProxyAdmin_Test:test_erc1967GetProxyImplementation() (gas: 52093) +ProxyAdmin_Test:test_erc1967Upgrade() (gas: 50030) +ProxyAdmin_Test:test_erc1967UpgradeAndCall() (gas: 79013) ProxyAdmin_Test:test_isUpgrading() (gas: 19575) ProxyAdmin_Test:test_onlyOwner() (gas: 22715) ProxyAdmin_Test:test_onlyOwnerSetAddressManager() (gas: 10600) @@ -179,48 +183,48 @@ ProxyAdmin_Test:test_onlyOwnerSetImplementationName() (gas: 11113) ProxyAdmin_Test:test_onlyOwnerSetProxyType() (gas: 10751) ProxyAdmin_Test:test_owner() (gas: 9818) ProxyAdmin_Test:test_proxyType() (gas: 20622) -ProxyAdmin_Test:test_setImplementationName() (gas: 39002) +ProxyAdmin_Test:test_setImplementationName() (gas: 38968) RLPReader_Test:testReadBool() (gas: 1109) -RLPReader_Test:test_readAddress() (gas: 1347) -RLPReader_Test:test_readAddressSmall() (gas: 614) -RLPReader_Test:test_readAddressTooLarge() (gas: 3646) -RLPReader_Test:test_readAddressTooShort() (gas: 3603) +RLPReader_Test:test_readAddress() (gas: 1344) +RLPReader_Test:test_readAddressSmall() (gas: 611) +RLPReader_Test:test_readAddressTooLarge() (gas: 3676) +RLPReader_Test:test_readAddressTooShort() (gas: 3633) RLPReader_Test:test_readBoolInvalidValue() (gas: 3677) -RLPReader_Test:test_readBoolLargeInput() (gas: 3550) -RLPReader_Test:test_readBytes32_revertOnList() (gas: 3998) -RLPReader_Test:test_readBytes32_revertOnTooLong() (gas: 3588) -RLPReader_Test:test_readBytes_bytestring00() (gas: 1823) -RLPReader_Test:test_readBytes_bytestring01() (gas: 1846) -RLPReader_Test:test_readBytes_bytestring7f() (gas: 1844) -RLPReader_Test:test_readBytes_invalidListLength() (gas: 3812) -RLPReader_Test:test_readBytes_invalidStringLength() (gas: 3768) -RLPReader_Test:test_readBytes_revertListItem() (gas: 3922) -RLPReader_Test:test_readList_dictTest1() (gas: 23791) +RLPReader_Test:test_readBoolLargeInput() (gas: 3583) +RLPReader_Test:test_readBytes32_revertOnList() (gas: 4031) +RLPReader_Test:test_readBytes32_revertOnTooLong() (gas: 3621) +RLPReader_Test:test_readBytes_bytestring00() (gas: 1817) +RLPReader_Test:test_readBytes_bytestring01() (gas: 1840) +RLPReader_Test:test_readBytes_bytestring7f() (gas: 1838) +RLPReader_Test:test_readBytes_invalidListLength() (gas: 3845) +RLPReader_Test:test_readBytes_invalidStringLength() (gas: 3801) +RLPReader_Test:test_readBytes_revertListItem() (gas: 3955) +RLPReader_Test:test_readList_dictTest1() (gas: 23647) RLPReader_Test:test_readList_empty() (gas: 4472) -RLPReader_Test:test_readList_incorrectLengthInArray() (gas: 4210) -RLPReader_Test:test_readList_int32Overflow() (gas: 3955) -RLPReader_Test:test_readList_int32Overflow2() (gas: 4021) -RLPReader_Test:test_readList_invalidShortList() (gas: 3855) -RLPReader_Test:test_readList_invalidValue() (gas: 3787) -RLPReader_Test:test_readList_leadingZerosInLongLengthArray1() (gas: 4193) -RLPReader_Test:test_readList_leadingZerosInLongLengthArray2() (gas: 4177) +RLPReader_Test:test_readList_incorrectLengthInArray() (gas: 4243) +RLPReader_Test:test_readList_int32Overflow() (gas: 3988) +RLPReader_Test:test_readList_int32Overflow2() (gas: 4015) +RLPReader_Test:test_readList_invalidShortList() (gas: 3888) +RLPReader_Test:test_readList_invalidValue() (gas: 3820) +RLPReader_Test:test_readList_leadingZerosInLongLengthArray1() (gas: 4226) +RLPReader_Test:test_readList_leadingZerosInLongLengthArray2() (gas: 4210) RLPReader_Test:test_readList_leadingZerosInLongLengthList1() (gas: 38560) -RLPReader_Test:test_readList_listOfLists() (gas: 9619) -RLPReader_Test:test_readList_listOfLists2() (gas: 12479) -RLPReader_Test:test_readList_longList1() (gas: 29013) -RLPReader_Test:test_readList_longList2() (gas: 202895) -RLPReader_Test:test_readList_longStringLength() (gas: 3853) -RLPReader_Test:test_readList_multiList() (gas: 12025) -RLPReader_Test:test_readList_nonOptimalLongLengthArray1() (gas: 4200) -RLPReader_Test:test_readList_nonOptimalLongLengthArray2() (gas: 4223) -RLPReader_Test:test_readList_notLongEnough() (gas: 3841) -RLPReader_Test:test_readList_shortListMax1() (gas: 40662) -RLPReader_Test:test_readList_stringList() (gas: 16796) -RLPReader_Test:test_readString_emptyString() (gas: 1719) -RLPReader_Test:test_readString_longString() (gas: 3076) -RLPReader_Test:test_readString_longString2() (gas: 18524) -RLPReader_Test:test_readString_shortString() (gas: 2280) -RLPReader_Test:test_readString_shortString2() (gas: 2775) +RLPReader_Test:test_readList_listOfLists() (gas: 9601) +RLPReader_Test:test_readList_listOfLists2() (gas: 12449) +RLPReader_Test:test_readList_longList1() (gas: 28809) +RLPReader_Test:test_readList_longList2() (gas: 201167) +RLPReader_Test:test_readList_longStringLength() (gas: 3886) +RLPReader_Test:test_readList_multiList() (gas: 11998) +RLPReader_Test:test_readList_nonOptimalLongLengthArray1() (gas: 4233) +RLPReader_Test:test_readList_nonOptimalLongLengthArray2() (gas: 4256) +RLPReader_Test:test_readList_notLongEnough() (gas: 3874) +RLPReader_Test:test_readList_shortListMax1() (gas: 40464) +RLPReader_Test:test_readList_stringList() (gas: 16826) +RLPReader_Test:test_readString_emptyString() (gas: 1716) +RLPReader_Test:test_readString_longString() (gas: 3086) +RLPReader_Test:test_readString_longString2() (gas: 18425) +RLPReader_Test:test_readString_shortString() (gas: 2293) +RLPReader_Test:test_readString_shortString2() (gas: 2785) RLPReader_Test:test_readUint256_mediumInt1() (gas: 1235) RLPReader_Test:test_readUint256_mediumInt2() (gas: 1237) RLPReader_Test:test_readUint256_mediumInt3() (gas: 1238) @@ -229,45 +233,43 @@ RLPReader_Test:test_readUint256_smallInt2() (gas: 1151) RLPReader_Test:test_readUint256_smallInt3() (gas: 1127) RLPReader_Test:test_readUint256_smallInt4() (gas: 1128) RLPReader_Test:test_readUint256_zero() (gas: 1258) -RLPWriter_Test:test_writeList_dictTest1() (gas: 37148) -RLPWriter_Test:test_writeList_empty() (gas: 1751) -RLPWriter_Test:test_writeList_listoflists() (gas: 10969) -RLPWriter_Test:test_writeList_listoflists2() (gas: 16779) -RLPWriter_Test:test_writeList_longlist1() (gas: 40730) -RLPWriter_Test:test_writeList_longlist2() (gas: 283278) -RLPWriter_Test:test_writeList_multiList() (gas: 22660) -RLPWriter_Test:test_writeList_shortListMax1() (gas: 36985) -RLPWriter_Test:test_writeList_stringList() (gas: 10786) -RLPWriter_Test:test_writeString_bytestring00() (gas: 1022) -RLPWriter_Test:test_writeString_bytestring01() (gas: 978) -RLPWriter_Test:test_writeString_bytestring7f() (gas: 1002) -RLPWriter_Test:test_writeString_empty() (gas: 1704) -RLPWriter_Test:test_writeString_longstring() (gas: 17180) -RLPWriter_Test:test_writeString_longstring2() (gas: 261864) -RLPWriter_Test:test_writeString_shortstring() (gas: 2544) -RLPWriter_Test:test_writeString_shortstring2() (gas: 15563) -RLPWriter_Test:test_writeUint_mediumint() (gas: 8430) -RLPWriter_Test:test_writeUint_mediumint2() (gas: 8780) -RLPWriter_Test:test_writeUint_mediumint3() (gas: 9189) -RLPWriter_Test:test_writeUint_smallint() (gas: 7350) -RLPWriter_Test:test_writeUint_smallint2() (gas: 7352) -RLPWriter_Test:test_writeUint_smallint3() (gas: 7372) -RLPWriter_Test:test_writeUint_smallint4() (gas: 7351) -RLPWriter_Test:test_writeUint_zero() (gas: 7798) +RLPWriter_Test:test_writeList_dictTest1() (gas: 37134) +RLPWriter_Test:test_writeList_empty() (gas: 1753) +RLPWriter_Test:test_writeList_listoflists() (gas: 10971) +RLPWriter_Test:test_writeList_listoflists2() (gas: 16780) +RLPWriter_Test:test_writeList_longlist1() (gas: 40535) +RLPWriter_Test:test_writeList_longlist2() (gas: 281326) +RLPWriter_Test:test_writeList_multiList() (gas: 22567) +RLPWriter_Test:test_writeList_shortListMax1() (gas: 36940) +RLPWriter_Test:test_writeList_stringList() (gas: 10790) +RLPWriter_Test:test_writeString_bytestring00() (gas: 1019) +RLPWriter_Test:test_writeString_bytestring01() (gas: 975) +RLPWriter_Test:test_writeString_bytestring7f() (gas: 999) +RLPWriter_Test:test_writeString_empty() (gas: 1709) +RLPWriter_Test:test_writeString_longstring() (gas: 17016) +RLPWriter_Test:test_writeString_longstring2() (gas: 258779) +RLPWriter_Test:test_writeString_shortstring() (gas: 2548) +RLPWriter_Test:test_writeString_shortstring2() (gas: 15411) +RLPWriter_Test:test_writeUint_mediumint() (gas: 8395) +RLPWriter_Test:test_writeUint_mediumint2() (gas: 8737) +RLPWriter_Test:test_writeUint_mediumint3() (gas: 9138) +RLPWriter_Test:test_writeUint_smallint() (gas: 7302) +RLPWriter_Test:test_writeUint_smallint2() (gas: 7304) +RLPWriter_Test:test_writeUint_smallint3() (gas: 7324) +RLPWriter_Test:test_writeUint_smallint4() (gas: 7303) +RLPWriter_Test:test_writeUint_zero() (gas: 7771) ResourceMetering_Test:test_initialResourceParams() (gas: 8964) -ResourceMetering_Test:test_updateNoGasDelta() (gas: 2008317) +ResourceMetering_Test:test_updateNoGasDelta() (gas: 2008191) ResourceMetering_Test:test_updateOneEmptyBlock() (gas: 18171) ResourceMetering_Test:test_updateParamsNoChange() (gas: 13956) ResourceMetering_Test:test_updateTenEmptyBlocks() (gas: 20571) ResourceMetering_Test:test_updateTwoEmptyBlocks() (gas: 20594) -ResourceMetering_Test:test_useMaxSucceeds() (gas: 8017087) +ResourceMetering_Test:test_useMaxSucceeds() (gas: 8017134) ResourceMetering_Test:test_useMoreThanMaxReverts() (gas: 16047) -Semver_Test:test_behindProxy() (gas: 504908) -Semver_Test:test_major() (gas: 5406) -Semver_Test:test_minor() (gas: 5430) -Semver_Test:test_patch() (gas: 5364) -SequencerFeeVault_Test:test_constructor() (gas: 7656) -SequencerFeeVault_Test:test_minWithdrawalAmount() (gas: 5407) +Semver_Test:test_behindProxy() (gas: 506906) +Semver_Test:test_version() (gas: 9487) +SequencerFeeVault_Test:test_constructor() (gas: 7678) +SequencerFeeVault_Test:test_minWithdrawalAmount() (gas: 5440) SequencerFeeVault_Test:test_receive() (gas: 17338) -SequencerFeeVault_Test:test_revertWithdraw() (gas: 9332) -SequencerFeeVault_Test:test_withdraw() (gas: 147582) +SequencerFeeVault_Test:test_revertWithdraw() (gas: 9342) +SequencerFeeVault_Test:test_withdraw() (gas: 148623) diff --git a/packages/contracts-bedrock/.gitignore b/packages/contracts-bedrock/.gitignore index 6ddf84217a0f3..f137310b8b7af 100644 --- a/packages/contracts-bedrock/.gitignore +++ b/packages/contracts-bedrock/.gitignore @@ -7,3 +7,4 @@ coverage.out deployments broadcast genesis.json +src/contract-artifacts.ts diff --git a/packages/contracts-bedrock/.storage-layout b/packages/contracts-bedrock/.storage-layout index 1fbb5bc5f08c9..5afe9c2c436a5 100644 --- a/packages/contracts-bedrock/.storage-layout +++ b/packages/contracts-bedrock/.storage-layout @@ -62,25 +62,25 @@ ➡ L2OutputOracle ======================= -+-------------------+----------------------------------------------------------+------+--------+-------+------------------------------------------------+ -| Name | Type | Slot | Offset | Bytes | Contract | -+=======================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | contracts/L1/L2OutputOracle.sol:L2OutputOracle | -|-------------------+----------------------------------------------------------+------+--------+-------+------------------------------------------------| -| _initializing | bool | 0 | 1 | 1 | contracts/L1/L2OutputOracle.sol:L2OutputOracle | -|-------------------+----------------------------------------------------------+------+--------+-------+------------------------------------------------| -| __gap | uint256[50] | 1 | 0 | 1600 | contracts/L1/L2OutputOracle.sol:L2OutputOracle | -|-------------------+----------------------------------------------------------+------+--------+-------+------------------------------------------------| -| _owner | address | 51 | 0 | 20 | contracts/L1/L2OutputOracle.sol:L2OutputOracle | -|-------------------+----------------------------------------------------------+------+--------+-------+------------------------------------------------| -| __gap | uint256[49] | 52 | 0 | 1568 | contracts/L1/L2OutputOracle.sol:L2OutputOracle | -|-------------------+----------------------------------------------------------+------+--------+-------+------------------------------------------------| -| sequencer | address | 101 | 0 | 20 | contracts/L1/L2OutputOracle.sol:L2OutputOracle | -|-------------------+----------------------------------------------------------+------+--------+-------+------------------------------------------------| -| latestBlockNumber | uint256 | 102 | 0 | 32 | contracts/L1/L2OutputOracle.sol:L2OutputOracle | -|-------------------+----------------------------------------------------------+------+--------+-------+------------------------------------------------| -| l2Outputs | mapping(uint256 => struct L2OutputOracle.OutputProposal) | 103 | 0 | 32 | contracts/L1/L2OutputOracle.sol:L2OutputOracle | -+-------------------+----------------------------------------------------------+------+--------+-------+------------------------------------------------+ ++-------------------+-------------------------------------------------+------+--------+-------+------------------------------------------------+ +| Name | Type | Slot | Offset | Bytes | Contract | ++==============================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | contracts/L1/L2OutputOracle.sol:L2OutputOracle | +|-------------------+-------------------------------------------------+------+--------+-------+------------------------------------------------| +| _initializing | bool | 0 | 1 | 1 | contracts/L1/L2OutputOracle.sol:L2OutputOracle | +|-------------------+-------------------------------------------------+------+--------+-------+------------------------------------------------| +| __gap | uint256[50] | 1 | 0 | 1600 | contracts/L1/L2OutputOracle.sol:L2OutputOracle | +|-------------------+-------------------------------------------------+------+--------+-------+------------------------------------------------| +| _owner | address | 51 | 0 | 20 | contracts/L1/L2OutputOracle.sol:L2OutputOracle | +|-------------------+-------------------------------------------------+------+--------+-------+------------------------------------------------| +| __gap | uint256[49] | 52 | 0 | 1568 | contracts/L1/L2OutputOracle.sol:L2OutputOracle | +|-------------------+-------------------------------------------------+------+--------+-------+------------------------------------------------| +| proposer | address | 101 | 0 | 20 | contracts/L1/L2OutputOracle.sol:L2OutputOracle | +|-------------------+-------------------------------------------------+------+--------+-------+------------------------------------------------| +| latestBlockNumber | uint256 | 102 | 0 | 32 | contracts/L1/L2OutputOracle.sol:L2OutputOracle | +|-------------------+-------------------------------------------------+------+--------+-------+------------------------------------------------| +| l2Outputs | mapping(uint256 => struct Types.OutputProposal) | 103 | 0 | 32 | contracts/L1/L2OutputOracle.sol:L2OutputOracle | ++-------------------+-------------------------------------------------+------+--------+-------+------------------------------------------------+ ======================= ➡ OptimismPortal @@ -108,13 +108,13 @@ ➡ DeployerWhitelist ======================= -+-----------+--------------------------+------+--------+-------+------------------------------------------------------+ -| Name | Type | Slot | Offset | Bytes | Contract | -+=====================================================================================================================+ -| owner | address | 0 | 0 | 20 | contracts/L2/DeployerWhitelist.sol:DeployerWhitelist | -|-----------+--------------------------+------+--------+-------+------------------------------------------------------| -| whitelist | mapping(address => bool) | 1 | 0 | 32 | contracts/L2/DeployerWhitelist.sol:DeployerWhitelist | -+-----------+--------------------------+------+--------+-------+------------------------------------------------------+ ++-----------+--------------------------+------+--------+-------+----------------------------------------------------------+ +| Name | Type | Slot | Offset | Bytes | Contract | ++=========================================================================================================================+ +| owner | address | 0 | 0 | 20 | contracts/legacy/DeployerWhitelist.sol:DeployerWhitelist | +|-----------+--------------------------+------+--------+-------+----------------------------------------------------------| +| whitelist | mapping(address => bool) | 1 | 0 | 32 | contracts/legacy/DeployerWhitelist.sol:DeployerWhitelist | ++-----------+--------------------------+------+--------+-------+----------------------------------------------------------+ ======================= ➡ GasPriceOracle diff --git a/packages/contracts-bedrock/README.md b/packages/contracts-bedrock/README.md index a2ee0066d907e..200a0fd1dc3df 100644 --- a/packages/contracts-bedrock/README.md +++ b/packages/contracts-bedrock/README.md @@ -5,7 +5,7 @@ The repo currently uses solidity tests (run with Forge). The project uses the default hardhat directory structure, and all build/test steps should be run using the yarn scripts to ensure the correct options are set. -Install node modules with yarn (v1), and Node.js (14+). +Install node modules with yarn (v1), and Node.js (16+). ```shell yarn @@ -27,6 +27,8 @@ Then the full test suite can be executed via `yarn`: yarn test ``` +The differential tests require typescript to be compiled to javascript. + ## Deployment Create a file that corresponds to the network name in the `deploy-config` diff --git a/packages/contracts-bedrock/contracts/L1/L1CrossDomainMessenger.sol b/packages/contracts-bedrock/contracts/L1/L1CrossDomainMessenger.sol index df963707434ec..8bf28caf15fcb 100644 --- a/packages/contracts-bedrock/contracts/L1/L1CrossDomainMessenger.sol +++ b/packages/contracts-bedrock/contracts/L1/L1CrossDomainMessenger.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity 0.8.15; -import { PredeployAddresses } from "../libraries/PredeployAddresses.sol"; +import { Predeploys } from "../libraries/Predeploys.sol"; import { OptimismPortal } from "./OptimismPortal.sol"; import { CrossDomainMessenger } from "../universal/CrossDomainMessenger.sol"; import { Semver } from "../universal/Semver.sol"; @@ -35,19 +35,7 @@ contract L1CrossDomainMessenger is CrossDomainMessenger, Semver { function initialize() public initializer { address[] memory blockedSystemAddresses = new address[](1); blockedSystemAddresses[0] = address(this); - __CrossDomainMessenger_init( - PredeployAddresses.L2_CROSS_DOMAIN_MESSENGER, - blockedSystemAddresses - ); - } - - /** - * @notice Checks whether the message being sent from the other messenger. - * - * @return True if the message was sent from the messenger, false otherwise. - */ - function _isOtherMessenger() internal view override returns (bool) { - return msg.sender == address(portal) && portal.l2Sender() == otherMessenger; + __CrossDomainMessenger_init(Predeploys.L2_CROSS_DOMAIN_MESSENGER, blockedSystemAddresses); } /** @@ -66,4 +54,13 @@ contract L1CrossDomainMessenger is CrossDomainMessenger, Semver { ) internal override { portal.depositTransaction{ value: _value }(_to, _value, _gasLimit, false, _data); } + + /** + * @notice Checks whether the message being sent from the other messenger. + * + * @return True if the message was sent from the messenger, false otherwise. + */ + function _isOtherMessenger() internal view override returns (bool) { + return msg.sender == address(portal) && portal.l2Sender() == otherMessenger; + } } diff --git a/packages/contracts-bedrock/contracts/L1/L1StandardBridge.sol b/packages/contracts-bedrock/contracts/L1/L1StandardBridge.sol index b15992e0b6207..52023a87a9311 100644 --- a/packages/contracts-bedrock/contracts/L1/L1StandardBridge.sol +++ b/packages/contracts-bedrock/contracts/L1/L1StandardBridge.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity 0.8.15; -import { PredeployAddresses } from "../libraries/PredeployAddresses.sol"; +import { Predeploys } from "../libraries/Predeploys.sol"; import { StandardBridge } from "../universal/StandardBridge.sol"; import { Semver } from "../universal/Semver.sol"; @@ -94,23 +94,27 @@ contract L1StandardBridge is StandardBridge, Semver { initialize(_messenger); } - /** - * @notice Initializer. - * - * @param _messenger Address of the L1CrossDomainMessenger. - */ - function initialize(address payable _messenger) public initializer { - __StandardBridge_init(_messenger, payable(PredeployAddresses.L2_STANDARD_BRIDGE)); - } - /** * @custom:legacy - * @notice Retrieves the access of the corresponding L2 bridge contract. + * @notice Finalizes a withdrawal of ERC20 tokens from L2. * - * @return Address of the corresponding L2 bridge contract. + * @param _l1Token Address of the token on L1. + * @param _l2Token Address of the corresponding token on L2. + * @param _from Address of the withdrawer on L2. + * @param _to Address of the recipient on L1. + * @param _amount Amount of ETH to withdraw. + * @param _extraData Optional data forwarded from L2. */ - function l2TokenBridge() external view returns (address) { - return address(otherBridge); + function finalizeERC20Withdrawal( + address _l1Token, + address _l2Token, + address _from, + address _to, + uint256 _amount, + bytes calldata _extraData + ) external onlyOtherBridge { + emit ERC20WithdrawalFinalized(_l1Token, _l2Token, _from, _to, _amount, _extraData); + finalizeBridgeERC20(_l1Token, _l2Token, _from, _to, _amount, _extraData); } /** @@ -231,25 +235,21 @@ contract L1StandardBridge is StandardBridge, Semver { /** * @custom:legacy - * @notice Finalizes a withdrawal of ERC20 tokens from L2. + * @notice Retrieves the access of the corresponding L2 bridge contract. * - * @param _l1Token Address of the token on L1. - * @param _l2Token Address of the corresponding token on L2. - * @param _from Address of the withdrawer on L2. - * @param _to Address of the recipient on L1. - * @param _amount Amount of ETH to withdraw. - * @param _extraData Optional data forwarded from L2. + * @return Address of the corresponding L2 bridge contract. */ - function finalizeERC20Withdrawal( - address _l1Token, - address _l2Token, - address _from, - address _to, - uint256 _amount, - bytes calldata _extraData - ) external onlyOtherBridge { - emit ERC20WithdrawalFinalized(_l1Token, _l2Token, _from, _to, _amount, _extraData); - finalizeBridgeERC20(_l1Token, _l2Token, _from, _to, _amount, _extraData); + function l2TokenBridge() external view returns (address) { + return address(otherBridge); + } + + /** + * @notice Initializer. + * + * @param _messenger Address of the L1CrossDomainMessenger. + */ + function initialize(address payable _messenger) public initializer { + __StandardBridge_init(_messenger, payable(Predeploys.L2_STANDARD_BRIDGE)); } /** @@ -264,7 +264,7 @@ contract L1StandardBridge is StandardBridge, Semver { address _from, address _to, uint32 _minGasLimit, - bytes memory _extraData + bytes calldata _extraData ) internal { emit ETHDepositInitiated(_from, _to, msg.value, _extraData); _initiateBridgeETH(_from, _to, msg.value, _minGasLimit, _extraData); diff --git a/packages/contracts-bedrock/contracts/L1/L2OutputOracle.sol b/packages/contracts-bedrock/contracts/L1/L2OutputOracle.sol index 68e6bf42ee53f..a308f156f03b8 100644 --- a/packages/contracts-bedrock/contracts/L1/L2OutputOracle.sol +++ b/packages/contracts-bedrock/contracts/L1/L2OutputOracle.sol @@ -1,65 +1,21 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.10; +pragma solidity 0.8.15; import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import { Semver } from "../universal/Semver.sol"; +import { Types } from "../libraries/Types.sol"; /** * @custom:proxied * @title L2OutputOracle * @notice The L2 state is committed to in this contract - * The payable keyword is used on appendL2Output to save gas on the msg.value check. + * The payable keyword is used on proposeL2Output to save gas on the msg.value check. * This contract should be deployed behind an upgradable proxy */ // slither-disable-next-line locked-ether contract L2OutputOracle is OwnableUpgradeable, Semver { - /** - * @notice OutputProposal represents a commitment to the L2 state. - * The timestamp is the L1 timestamp that the output root is posted. - * This timestamp is used to verify that the finalization period - * has passed since the output root was submitted. - */ - struct OutputProposal { - bytes32 outputRoot; - uint256 timestamp; - } - - /** - * @notice Emitted when an output is appended. - * - * @param l2Output The output root. - * @param l1Timestamp The L1 timestamp when appended. - * @param l2BlockNumber The L2 block number of the output root. - */ - event L2OutputAppended( - bytes32 indexed l2Output, - uint256 indexed l1Timestamp, - uint256 indexed l2BlockNumber - ); - - /** - * @notice Emitted when an output is deleted. - * - * @param l2Output The output root. - * @param l1Timestamp The L1 timestamp when appended. - * @param l2BlockNumber The L2 block number of the output root. - */ - event L2OutputDeleted( - bytes32 indexed l2Output, - uint256 indexed l1Timestamp, - uint256 indexed l2BlockNumber - ); - - /** - * @notice Emitted when the sequencer address is changed. - * - * @param previousSequencer The previous sequencer address. - * @param newSequencer The new sequencer address. - */ - event SequencerChanged(address indexed previousSequencer, address indexed newSequencer); - /** * @notice The interval in L2 blocks at which checkpoints must be submitted. */ @@ -91,9 +47,9 @@ contract L2OutputOracle is OwnableUpgradeable, Semver { uint256 public immutable L2_BLOCK_TIME; /** - * @notice The address of the sequencer; + * @notice The address of the proposer; */ - address public sequencer; + address public proposer; /** * @notice The number of the most recent L2 block recorded in this contract. @@ -105,13 +61,47 @@ contract L2OutputOracle is OwnableUpgradeable, Semver { * outputs should not be considered finalized until the finalization period (as defined * in the Optimism Portal) has passed. */ - mapping(uint256 => OutputProposal) internal l2Outputs; + mapping(uint256 => Types.OutputProposal) internal l2Outputs; /** - * @notice Reverts if called by any account other than the sequencer. + * @notice Emitted when an output is proposed. + * + * @param outputRoot The output root. + * @param l1Timestamp The L1 timestamp when proposed. + * @param l2BlockNumber The L2 block number of the output root. */ - modifier onlySequencer() { - require(sequencer == msg.sender, "OutputOracle: caller is not the sequencer"); + event OutputProposed( + bytes32 indexed outputRoot, + uint256 indexed l1Timestamp, + uint256 indexed l2BlockNumber + ); + + /** + * @notice Emitted when an output is deleted. + * + * @param outputRoot The output root. + * @param l1Timestamp The L1 timestamp when proposed. + * @param l2BlockNumber The L2 block number of the output root. + */ + event OutputDeleted( + bytes32 indexed outputRoot, + uint256 indexed l1Timestamp, + uint256 indexed l2BlockNumber + ); + + /** + * @notice Emitted when the proposer address is changed. + * + * @param previousProposer The previous proposer address. + * @param newProposer The new proposer address. + */ + event ProposerChanged(address indexed previousProposer, address indexed newProposer); + + /** + * @notice Reverts if called by any account other than the proposer. + */ + modifier onlyProposer() { + require(proposer == msg.sender, "L2OutputOracle: function can only be called by proposer"); _; } @@ -124,7 +114,7 @@ contract L2OutputOracle is OwnableUpgradeable, Semver { * @param _startingBlockNumber The number of the first L2 block. * @param _startingTimestamp The timestamp of the first L2 block. * @param _l2BlockTime The timestamp of the first L2 block. - * @param _sequencer The address of the sequencer. + * @param _proposer The address of the proposer. * @param _owner The address of the owner. */ constructor( @@ -134,12 +124,12 @@ contract L2OutputOracle is OwnableUpgradeable, Semver { uint256 _startingBlockNumber, uint256 _startingTimestamp, uint256 _l2BlockTime, - address _sequencer, + address _proposer, address _owner ) Semver(0, 0, 1) { require( _l2BlockTime < block.timestamp, - "Output Oracle: Initial L2 block time must be less than current time" + "L2OutputOracle: initial L2 block time must be less than current time" ); SUBMISSION_INTERVAL = _submissionInterval; @@ -148,106 +138,163 @@ contract L2OutputOracle is OwnableUpgradeable, Semver { STARTING_TIMESTAMP = _startingTimestamp; L2_BLOCK_TIME = _l2BlockTime; - initialize(_genesisL2Output, _startingBlockNumber, _sequencer, _owner); + initialize(_genesisL2Output, _startingBlockNumber, _proposer, _owner); } /** - * @notice Initializer. + * @notice Deletes the most recent output. This is used to remove the most recent output in the + * event that an erreneous output is submitted. It can only be called by the contract's + * owner, not the proposer. Longer term, this should be replaced with a more robust + * mechanism which will allow deletion of proposals shown to be invalid by a fault + * proof. * - * @param _genesisL2Output The initial L2 output of the L2 chain. - * @param _startingBlockNumber The timestamp to start L2 block at. - * @param _sequencer The address of the sequencer. - * @param _owner The address of the owner. + * @param _proposal Represents the output proposal to delete */ - function initialize( - bytes32 _genesisL2Output, - uint256 _startingBlockNumber, - address _sequencer, - address _owner - ) public initializer { - l2Outputs[_startingBlockNumber] = OutputProposal(_genesisL2Output, block.timestamp); - latestBlockNumber = _startingBlockNumber; - __Ownable_init(); - changeSequencer(_sequencer); - _transferOwnership(_owner); + function deleteL2Output(Types.OutputProposal memory _proposal) external onlyOwner { + Types.OutputProposal memory outputToDelete = l2Outputs[latestBlockNumber]; + + require( + _proposal.outputRoot == outputToDelete.outputRoot, + "L2OutputOracle: output root to delete does not match the latest output proposal" + ); + + require( + _proposal.timestamp == outputToDelete.timestamp, + "L2OutputOracle: timestamp to delete does not match the latest output proposal" + ); + + emit OutputDeleted(outputToDelete.outputRoot, outputToDelete.timestamp, latestBlockNumber); + + delete l2Outputs[latestBlockNumber]; + latestBlockNumber = latestBlockNumber - SUBMISSION_INTERVAL; } /** - * @notice Accepts an L2 outputRoot and the timestamp of the corresponding L2 block. The + * @notice Accepts an outputRoot and the timestamp of the corresponding L2 block. The * timestamp must be equal to the current value returned by `nextTimestamp()` in order - * to be accepted. This function may only be called by the Sequencer. + * to be accepted. This function may only be called by the Proposer. * - * @param _l2Output The L2 output of the checkpoint block. - * @param _l2BlockNumber The L2 block number that resulted in _l2Output. + * @param _outputRoot The L2 output of the checkpoint block. + * @param _l2BlockNumber The L2 block number that resulted in _outputRoot. * @param _l1Blockhash A block hash which must be included in the current chain. * @param _l1BlockNumber The block number with the specified block hash. */ - function appendL2Output( - bytes32 _l2Output, + function proposeL2Output( + bytes32 _outputRoot, uint256 _l2BlockNumber, bytes32 _l1Blockhash, uint256 _l1BlockNumber - ) external payable onlySequencer { + ) external payable onlyProposer { require( _l2BlockNumber == nextBlockNumber(), - "OutputOracle: Block number must be equal to next expected block number." + "L2OutputOracle: block number must be equal to next expected block number" ); + require( computeL2Timestamp(_l2BlockNumber) < block.timestamp, - "OutputOracle: Cannot append L2 output in future." + "L2OutputOracle: cannot propose L2 output in the future" + ); + + require( + _outputRoot != bytes32(0), + "L2OutputOracle: L2 output proposal cannot be the zero hash" ); - require(_l2Output != bytes32(0), "OutputOracle: Cannot submit empty L2 output."); if (_l1Blockhash != bytes32(0)) { - // This check allows the sequencer to append an output based on a given L1 block, + // This check allows the proposer to propose an output based on a given L1 block, // without fear that it will be reorged out. // It will also revert if the blockheight provided is more than 256 blocks behind the // chain tip (as the hash will return as zero). This does open the door to a griefing - // attack in which the sequencer's submission is censored until the block is no longer - // retrievable, if the sequencer is experiencing this attack it can simply leave out the + // attack in which the proposer's submission is censored until the block is no longer + // retrievable, if the proposer is experiencing this attack it can simply leave out the // blockhash value, and delay submission until it is confident that the L1 block is // finalized. require( blockhash(_l1BlockNumber) == _l1Blockhash, - "OutputOracle: Blockhash does not match the hash at the expected height." + "L2OutputOracle: blockhash does not match the hash at the expected height" ); } - l2Outputs[_l2BlockNumber] = OutputProposal(_l2Output, block.timestamp); + l2Outputs[_l2BlockNumber] = Types.OutputProposal(_outputRoot, block.timestamp); latestBlockNumber = _l2BlockNumber; - emit L2OutputAppended(_l2Output, block.timestamp, _l2BlockNumber); + emit OutputProposed(_outputRoot, block.timestamp, _l2BlockNumber); } /** - * @notice Deletes the most recent output. This is used to remove the most recent output in the - * event that an erreneous output is submitted. It can only be called by the contract's - * owner, not the sequencer. Longer term, this should be replaced with a more robust - * mechanism which will allow deletion of proposals shown to be invalid by a fault - * proof. + * @notice Returns the L2 output proposal associated with a target L2 block number. If the + * L2 block number provided is between checkpoints, this function will rerutn the next + * proposal for the next checkpoint. + * Reverts if the output proposal is either not found, or predates + * the STARTING_BLOCK_NUMBER. * - * @param _proposal Represents the output proposal to delete + * @param _l2BlockNumber The L2 block number of the target block. */ - function deleteL2Output(OutputProposal memory _proposal) external onlyOwner { - OutputProposal memory outputToDelete = l2Outputs[latestBlockNumber]; + function getL2Output(uint256 _l2BlockNumber) + external + view + returns (Types.OutputProposal memory) + { + require( + _l2BlockNumber >= STARTING_BLOCK_NUMBER, + "L2OutputOracle: block number cannot be less than the starting block number." + ); + + // Find the distance between _l2BlockNumber, and the checkpoint block before it. + uint256 offset = (_l2BlockNumber - STARTING_BLOCK_NUMBER) % SUBMISSION_INTERVAL; + // If the offset is zero, then the _l2BlockNumber should be checkpointed. + // Otherwise, we'll look up the next block that will be checkpointed. + uint256 lookupBlockNumber = offset == 0 + ? _l2BlockNumber + : _l2BlockNumber + (SUBMISSION_INTERVAL - offset); + + Types.OutputProposal memory output = l2Outputs[lookupBlockNumber]; require( - _proposal.outputRoot == outputToDelete.outputRoot, - "OutputOracle: The output root to delete does not match the latest output proposal." + output.outputRoot != bytes32(0), + "L2OutputOracle: No output found for that block number." ); + return output; + } + + /** + * @notice Initializer. + * + * @param _genesisL2Output The initial L2 output of the L2 chain. + * @param _startingBlockNumber The timestamp to start L2 block at. + * @param _proposer The address of the proposer. + * @param _owner The address of the owner. + */ + function initialize( + bytes32 _genesisL2Output, + uint256 _startingBlockNumber, + address _proposer, + address _owner + ) public initializer { + l2Outputs[_startingBlockNumber] = Types.OutputProposal(_genesisL2Output, block.timestamp); + latestBlockNumber = _startingBlockNumber; + __Ownable_init(); + changeProposer(_proposer); + _transferOwnership(_owner); + } + + /** + * @notice Transfers the proposer role to a new account (`newProposer`). + * Can only be called by the current owner. + */ + function changeProposer(address _newProposer) public onlyOwner { require( - _proposal.timestamp == outputToDelete.timestamp, - "OutputOracle: The timestamp to delete does not match the latest output proposal." + _newProposer != address(0), + "L2OutputOracle: new proposer cannot be the zero address" ); - emit L2OutputDeleted( - outputToDelete.outputRoot, - outputToDelete.timestamp, - latestBlockNumber + require( + _newProposer != owner(), + "L2OutputOracle: proposer cannot be the same as the owner" ); - delete l2Outputs[latestBlockNumber]; - latestBlockNumber = latestBlockNumber - SUBMISSION_INTERVAL; + emit ProposerChanged(proposer, _newProposer); + proposer = _newProposer; } /** @@ -257,16 +304,6 @@ contract L2OutputOracle is OwnableUpgradeable, Semver { return latestBlockNumber + SUBMISSION_INTERVAL; } - /** - * @notice Returns the L2 output proposal given a target L2 block number. - * Returns a null output proposal if none is found. - * - * @param _l2BlockNumber The L2 block number of the target block. - */ - function getL2Output(uint256 _l2BlockNumber) external view returns (OutputProposal memory) { - return l2Outputs[_l2BlockNumber]; - } - /** * @notice Returns the L2 timestamp corresponding to a given L2 block number. * Returns a null output proposal if none is found. @@ -276,20 +313,9 @@ contract L2OutputOracle is OwnableUpgradeable, Semver { function computeL2Timestamp(uint256 _l2BlockNumber) public view returns (uint256) { require( _l2BlockNumber >= STARTING_BLOCK_NUMBER, - "OutputOracle: Block number must be greater than or equal to the starting block number." + "L2OutputOracle: block number must be greater than or equal to starting block number" ); return STARTING_TIMESTAMP + ((_l2BlockNumber - STARTING_BLOCK_NUMBER) * L2_BLOCK_TIME); } - - /** - * @notice Transfers the sequencer role to a new account (`newSequencer`). - * Can only be called by the current owner. - */ - function changeSequencer(address _newSequencer) public onlyOwner { - require(_newSequencer != address(0), "OutputOracle: new sequencer is the zero address"); - require(_newSequencer != owner(), "OutputOracle: sequencer cannot be same as the owner"); - emit SequencerChanged(sequencer, _newSequencer); - sequencer = _newSequencer; - } } diff --git a/packages/contracts-bedrock/contracts/L1/OptimismPortal.sol b/packages/contracts-bedrock/contracts/L1/OptimismPortal.sol index d765ab14e08d0..af34c0b782174 100644 --- a/packages/contracts-bedrock/contracts/L1/OptimismPortal.sol +++ b/packages/contracts-bedrock/contracts/L1/OptimismPortal.sol @@ -1,9 +1,10 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.10; +pragma solidity 0.8.15; import { Initializable } from "@openzeppelin/contracts/proxy/utils/Initializable.sol"; import { ExcessivelySafeCall } from "excessively-safe-call/src/ExcessivelySafeCall.sol"; import { L2OutputOracle } from "./L2OutputOracle.sol"; +import { Types } from "../libraries/Types.sol"; import { Hashing } from "../libraries/Hashing.sol"; import { SecureMerkleTrie } from "../libraries/trie/SecureMerkleTrie.sol"; import { AddressAliasHelper } from "../vendor/AddressAliasHelper.sol"; @@ -19,34 +20,9 @@ import { Semver } from "../universal/Semver.sol"; */ contract OptimismPortal is Initializable, ResourceMetering, Semver { /** - * @notice Emitted when a transaction is deposited from L1 to L2. The parameters of this event - * are read by the rollup node and used to derive deposit transactions on L2. - * - * @param from Address that triggered the deposit transaction. - * @param to Address that the deposit transaction is directed to. - * @param mint Amount of ETH to mint to the sender on L2. - * @param value Amount of ETH to send to the recipient. - * @param gasLimit Minimum gas limit that the message can be executed with. - * @param isCreation Whether the message is a contract creation. - * @param data Data to attach to the message and call the recipient with. + * @notice Version of the deposit event. */ - event TransactionDeposited( - address indexed from, - address indexed to, - uint256 mint, - uint256 value, - uint64 gasLimit, - bool isCreation, - bytes data - ); - - /** - * @notice Emitted when a withdrawal transaction is finalized. - * - * @param withdrawalHash Hash of the withdrawal transaction. - * @param success Whether the withdrawal transaction was successful. - */ - event WithdrawalFinalized(bytes32 indexed withdrawalHash, bool success); + uint256 internal constant DEPOSIT_VERSION = 0; /** * @notice Value used to reset the l2Sender, this is more efficient than setting it to zero. @@ -92,6 +68,30 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver { */ uint256[48] private __gap; + /** + * @notice Emitted when a transaction is deposited from L1 to L2. The parameters of this event + * are read by the rollup node and used to derive deposit transactions on L2. + * + * @param from Address that triggered the deposit transaction. + * @param to Address that the deposit transaction is directed to. + * @param version Version of this deposit transaction event. + * @param opaqueData ABI encoded deposit data to be parsed off-chain. + */ + event TransactionDeposited( + address indexed from, + address indexed to, + uint256 indexed version, + bytes opaqueData + ); + + /** + * @notice Emitted when a withdrawal transaction is finalized. + * + * @param withdrawalHash Hash of the withdrawal transaction. + * @param success Whether the withdrawal transaction was successful. + */ + event WithdrawalFinalized(bytes32 indexed withdrawalHash, bool success); + /** * @custom:semver 0.0.1 * @@ -104,14 +104,6 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver { initialize(); } - /** - * @notice Initializer; - */ - function initialize() public initializer { - l2Sender = DEFAULT_L2_SENDER; - __ResourceMetering_init(); - } - /** * @notice Accepts value so that users can send ETH directly to this contract and have the * funds be deposited to their address on L2. This is intended as a convenience @@ -122,97 +114,18 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver { depositTransaction(msg.sender, msg.value, RECEIVE_DEFAULT_GAS_LIMIT, false, bytes("")); } - /** - * @notice Accepts deposits of ETH and data, and emits a TransactionDeposited event for use in - * deriving deposit transactions. Note that if a deposit is made by a contract, its - * address will be aliased when retrieved using `tx.origin` or `msg.sender`. Consider - * using the CrossDomainMessenger contracts for a simpler developer experience. - * - * @param _to Target address on L2. - * @param _value ETH value to send to the recipient. - * @param _gasLimit Minimum L2 gas limit (can be greater than or equal to this value). - * @param _isCreation Whether or not the transaction is a contract creation. - * @param _data Data to trigger the recipient with. - */ - function depositTransaction( - address _to, - uint256 _value, - uint64 _gasLimit, - bool _isCreation, - bytes memory _data - ) public payable metered(_gasLimit) { - // Just to be safe, make sure that people specify address(0) as the target when doing - // contract creations. - if (_isCreation) { - require( - _to == address(0), - "OptimismPortal: must send to address(0) when creating a contract" - ); - } - - // Transform the from-address to its alias if the caller is a contract. - address from = msg.sender; - if (msg.sender != tx.origin) { - from = AddressAliasHelper.applyL1ToL2Alias(msg.sender); - } - - // Emit a TransactionDeposited event so that the rollup node can derive a deposit - // transaction for this deposit. - emit TransactionDeposited(from, _to, msg.value, _value, _gasLimit, _isCreation, _data); - } - - /** - * @notice Determine if an L2 Output is finalized. - * - * @param _l2BlockNumber The number of the L2 block. - */ - - function isOutputFinalized(uint256 _l2BlockNumber) external view returns (bool) { - L2OutputOracle.OutputProposal memory proposal = L2_ORACLE.getL2Output(_l2BlockNumber); - - if (proposal.outputRoot == bytes32(uint256(0))) { - uint256 interval = L2_ORACLE.SUBMISSION_INTERVAL(); - uint256 startingBlockNumber = L2_ORACLE.STARTING_BLOCK_NUMBER(); - - // Prevent underflow - if (startingBlockNumber > _l2BlockNumber) { - return false; - } - - // Find the distance between the _l2BlockNumber, and the checkpoint block before it. - uint256 offset = (_l2BlockNumber - startingBlockNumber) % interval; - // Look up the checkpoint block after it. - proposal = L2_ORACLE.getL2Output(_l2BlockNumber + (interval - offset)); - // False if that block is not yet appended. - if (proposal.outputRoot == bytes32(uint256(0))) { - return false; - } - } - return block.timestamp > proposal.timestamp + FINALIZATION_PERIOD_SECONDS; - } - /** * @notice Finalizes a withdrawal transaction. * - * @param _nonce Nonce for the provided message. - * @param _sender Message sender address on L2. - * @param _target Target address on L1. - * @param _value ETH to send to the target. - * @param _gasLimit Minumum gas to be forwarded to the target. - * @param _data Data to send to the target. + * @param _tx Withdrawal transaction to finalize. * @param _l2BlockNumber L2 block number of the outputRoot. * @param _outputRootProof Inclusion proof of the withdrawer contracts storage root. * @param _withdrawalProof Inclusion proof for the given withdrawal in the withdrawer contract. */ function finalizeWithdrawalTransaction( - uint256 _nonce, - address _sender, - address _target, - uint256 _value, - uint256 _gasLimit, - bytes calldata _data, + Types.WithdrawalTransaction memory _tx, uint256 _l2BlockNumber, - Hashing.OutputRootProof calldata _outputRootProof, + Types.OutputRootProof calldata _outputRootProof, bytes calldata _withdrawalProof ) external payable { // Prevent nested withdrawals within withdrawals. @@ -224,21 +137,19 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver { // Prevent users from creating a deposit transaction where this address is the message // sender on L2. require( - _target != address(this), + _tx.target != address(this), "OptimismPortal: you cannot send messages to the portal contract" ); - // Get the output root. - L2OutputOracle.OutputProposal memory proposal = L2_ORACLE.getL2Output(_l2BlockNumber); + // Get the output root. This will fail if there is no + // output root for the given block number. + Types.OutputProposal memory proposal = L2_ORACLE.getL2Output(_l2BlockNumber); // Ensure that enough time has passed since the proposal was submitted before allowing a // withdrawal. Under the assumption that the fault proof mechanism is operating correctly, // we can infer that any withdrawal that has passed the finalization period must be valid // and can therefore be operated on. - require( - block.timestamp > proposal.timestamp + FINALIZATION_PERIOD_SECONDS, - "OptimismPortal: proposal is not yet finalized" - ); + require(_isOutputFinalized(proposal), "OptimismPortal: proposal is not yet finalized"); // Verify that the output root can be generated with the elements in the proof. require( @@ -248,14 +159,7 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver { // All withdrawals have a unique hash, we'll use this as the identifier for the withdrawal // and to prevent replay attacks. - bytes32 withdrawalHash = Hashing.hashWithdrawal( - _nonce, - _sender, - _target, - _value, - _gasLimit, - _data - ); + bytes32 withdrawalHash = Hashing.hashWithdrawal(_tx); // Verify that the hash of this withdrawal was stored in the withdrawal contract on L2. If // this is true, then we know that this withdrawal was actually triggered on L2 can can @@ -282,22 +186,22 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver { // target contract is at least the gas limit specified by the user. We can do this by // enforcing that, at this point in time, we still have gaslimit + buffer gas available. require( - gasleft() >= _gasLimit + FINALIZE_GAS_BUFFER, + gasleft() >= _tx.gasLimit + FINALIZE_GAS_BUFFER, "OptimismPortal: insufficient gas to finalize withdrawal" ); // Set the l2Sender so contracts know who triggered this withdrawal on L2. - l2Sender = _sender; + l2Sender = _tx.sender; // Trigger the call to the target contract. We use excessivelySafeCall because we don't // care about the returndata and we don't want target contracts to be able to force this // call to run out of gas. (bool success, ) = ExcessivelySafeCall.excessivelySafeCall( - _target, - _gasLimit, - _value, + _tx.target, + _tx.gasLimit, + _tx.value, 0, - _data + _tx.data ); // Reset the l2Sender back to the default value. @@ -308,6 +212,85 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver { emit WithdrawalFinalized(withdrawalHash, success); } + /** + * @notice Determine if a given block number is finalized. Reverts if the call to + * L2_ORACLE.getL2Output reverts. Returns a boolean otherwise. + * + * @param _l2BlockNumber The number of the L2 block. + */ + function isBlockFinalized(uint256 _l2BlockNumber) external view returns (bool) { + Types.OutputProposal memory proposal = L2_ORACLE.getL2Output(_l2BlockNumber); + return _isOutputFinalized(proposal); + } + + /** + * @notice Initializer; + */ + function initialize() public initializer { + l2Sender = DEFAULT_L2_SENDER; + __ResourceMetering_init(); + } + + /** + * @notice Accepts deposits of ETH and data, and emits a TransactionDeposited event for use in + * deriving deposit transactions. Note that if a deposit is made by a contract, its + * address will be aliased when retrieved using `tx.origin` or `msg.sender`. Consider + * using the CrossDomainMessenger contracts for a simpler developer experience. + * + * @param _to Target address on L2. + * @param _value ETH value to send to the recipient. + * @param _gasLimit Minimum L2 gas limit (can be greater than or equal to this value). + * @param _isCreation Whether or not the transaction is a contract creation. + * @param _data Data to trigger the recipient with. + */ + function depositTransaction( + address _to, + uint256 _value, + uint64 _gasLimit, + bool _isCreation, + bytes memory _data + ) public payable metered(_gasLimit) { + // Just to be safe, make sure that people specify address(0) as the target when doing + // contract creations. + if (_isCreation) { + require( + _to == address(0), + "OptimismPortal: must send to address(0) when creating a contract" + ); + } + + // Transform the from-address to its alias if the caller is a contract. + address from = msg.sender; + if (msg.sender != tx.origin) { + from = AddressAliasHelper.applyL1ToL2Alias(msg.sender); + } + + bytes memory opaqueData = abi.encodePacked( + msg.value, + _value, + _gasLimit, + _isCreation, + _data + ); + + // Emit a TransactionDeposited event so that the rollup node can derive a deposit + // transaction for this deposit. + emit TransactionDeposited(from, _to, DEPOSIT_VERSION, opaqueData); + } + + /** + * @notice Determine if an L2 Output is finalized. + * + * @param _proposal The output proposal to check. + */ + function _isOutputFinalized(Types.OutputProposal memory _proposal) + internal + view + returns (bool) + { + return block.timestamp > _proposal.timestamp + FINALIZATION_PERIOD_SECONDS; + } + /** * @notice Verifies a Merkle Trie inclusion proof that a given withdrawal hash is present in * the storage of the L2ToL1MessagePasser contract. diff --git a/packages/contracts-bedrock/contracts/L1/ResourceMetering.sol b/packages/contracts-bedrock/contracts/L1/ResourceMetering.sol index 82007c383cd71..50ac1724277ac 100644 --- a/packages/contracts-bedrock/contracts/L1/ResourceMetering.sol +++ b/packages/contracts-bedrock/contracts/L1/ResourceMetering.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.10; +pragma solidity 0.8.15; import { Initializable } from "@openzeppelin/contracts/proxy/utils/Initializable.sol"; import { Math } from "@openzeppelin/contracts/utils/math/Math.sol"; @@ -63,19 +63,6 @@ abstract contract ResourceMetering is Initializable { */ uint256[49] private __gap; - /** - * @notice Sets initial resource parameter values. This function must either be called by the - * initializer function of an upgradeable child contract. - */ - // solhint-disable-next-line func-name-mixedcase - function __ResourceMetering_init() internal onlyInitializing { - params = ResourceParams({ - prevBaseFee: INITIAL_BASE_FEE, - prevBoughtGas: 0, - prevBlockNum: uint64(block.number) - }); - } - /** * @notice Meters access to a function based an amount of a requested resource. * @@ -143,7 +130,7 @@ abstract contract ResourceMetering is Initializable { params.prevBoughtGas += _amount; require( int256(uint256(params.prevBoughtGas)) <= MAX_RESOURCE_LIMIT, - "OptimismPortal: cannot buy more gas than available gas limit" + "ResourceMetering: cannot buy more gas than available gas limit" ); // Determine the amount of ETH to be paid. @@ -164,4 +151,17 @@ abstract contract ResourceMetering is Initializable { Burn.gas(gasCost - usedGas); } } + + /** + * @notice Sets initial resource parameter values. This function must either be called by the + * initializer function of an upgradeable child contract. + */ + // solhint-disable-next-line func-name-mixedcase + function __ResourceMetering_init() internal onlyInitializing { + params = ResourceParams({ + prevBaseFee: INITIAL_BASE_FEE, + prevBoughtGas: 0, + prevBlockNum: uint64(block.number) + }); + } } diff --git a/packages/contracts-bedrock/contracts/L2/GasPriceOracle.sol b/packages/contracts-bedrock/contracts/L2/GasPriceOracle.sol index 34cb82ad7e88c..6c782dbb8cdab 100644 --- a/packages/contracts-bedrock/contracts/L2/GasPriceOracle.sol +++ b/packages/contracts-bedrock/contracts/L2/GasPriceOracle.sol @@ -1,9 +1,9 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.10; +pragma solidity 0.8.15; import { Semver } from "../universal/Semver.sol"; import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; -import { PredeployAddresses } from "../libraries/PredeployAddresses.sol"; +import { Predeploys } from "../libraries/Predeploys.sol"; import { L1Block } from "../L2/L1Block.sol"; /** @@ -44,15 +44,6 @@ contract GasPriceOracle is Ownable, Semver { */ uint256 public decimals; - /** - * @custom:semver 0.0.1 - * - * @param _owner Address that will initially own this contract. - */ - constructor(address _owner) Ownable() Semver(0, 0, 1) { - transferOwnership(_owner); - } - /** * @notice Emitted when the overhead value is updated. */ @@ -69,30 +60,12 @@ contract GasPriceOracle is Ownable, Semver { event DecimalsUpdated(uint256 decimals); /** - * @notice Retrieves the current gas price (base fee). - * - * @return Current L2 gas price (base fee). - */ - function gasPrice() public view returns (uint256) { - return block.basefee; - } - - /** - * @notice Retrieves the current base fee. - * - * @return Current L2 base fee. - */ - function baseFee() public view returns (uint256) { - return block.basefee; - } - - /** - * @notice Retrieves the latest known L1 base fee. + * @custom:semver 0.0.1 * - * @return Latest known L1 base fee. + * @param _owner Address that will initially own this contract. */ - function l1BaseFee() public view returns (uint256) { - return L1Block(PredeployAddresses.L1_BLOCK_ATTRIBUTES).basefee(); + constructor(address _owner) Ownable() Semver(0, 0, 1) { + transferOwnership(_owner); } /** @@ -142,6 +115,33 @@ contract GasPriceOracle is Ownable, Semver { return scaled; } + /** + * @notice Retrieves the current gas price (base fee). + * + * @return Current L2 gas price (base fee). + */ + function gasPrice() public view returns (uint256) { + return block.basefee; + } + + /** + * @notice Retrieves the current base fee. + * + * @return Current L2 base fee. + */ + function baseFee() public view returns (uint256) { + return block.basefee; + } + + /** + * @notice Retrieves the latest known L1 base fee. + * + * @return Latest known L1 base fee. + */ + function l1BaseFee() public view returns (uint256) { + return L1Block(Predeploys.L1_BLOCK_ATTRIBUTES).basefee(); + } + /** * @notice Computes the amount of L1 gas used for a transaction. Adds the overhead which * represents the per-transaction gas overhead of posting the transaction and state diff --git a/packages/contracts-bedrock/contracts/L2/L1Block.sol b/packages/contracts-bedrock/contracts/L2/L1Block.sol index 332ffde99eb33..0756d34b69a70 100644 --- a/packages/contracts-bedrock/contracts/L2/L1Block.sol +++ b/packages/contracts-bedrock/contracts/L2/L1Block.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.10; +pragma solidity 0.8.15; import { Semver } from "../universal/Semver.sol"; diff --git a/packages/contracts-bedrock/contracts/L2/L2CrossDomainMessenger.sol b/packages/contracts-bedrock/contracts/L2/L2CrossDomainMessenger.sol index 400e0f52b6b95..ef60d3f458614 100644 --- a/packages/contracts-bedrock/contracts/L2/L2CrossDomainMessenger.sol +++ b/packages/contracts-bedrock/contracts/L2/L2CrossDomainMessenger.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity 0.8.15; import { AddressAliasHelper } from "../vendor/AddressAliasHelper.sol"; -import { PredeployAddresses } from "../libraries/PredeployAddresses.sol"; +import { Predeploys } from "../libraries/Predeploys.sol"; import { CrossDomainMessenger } from "../universal/CrossDomainMessenger.sol"; import { Semver } from "../universal/Semver.sol"; import { L2ToL1MessagePasser } from "./L2ToL1MessagePasser.sol"; @@ -33,7 +33,7 @@ contract L2CrossDomainMessenger is CrossDomainMessenger, Semver { function initialize(address _l1CrossDomainMessenger) public initializer { address[] memory blockedSystemAddresses = new address[](2); blockedSystemAddresses[0] = address(this); - blockedSystemAddresses[1] = PredeployAddresses.L2_TO_L1_MESSAGE_PASSER; + blockedSystemAddresses[1] = Predeploys.L2_TO_L1_MESSAGE_PASSER; __CrossDomainMessenger_init(_l1CrossDomainMessenger, blockedSystemAddresses); } @@ -47,15 +47,6 @@ contract L2CrossDomainMessenger is CrossDomainMessenger, Semver { return otherMessenger; } - /** - * @notice Checks that the message sender is the L1CrossDomainMessenger on L1. - * - * @return True if the message sender is the L1CrossDomainMessenger on L1. - */ - function _isOtherMessenger() internal view override returns (bool) { - return AddressAliasHelper.undoL1ToL2Alias(msg.sender) == otherMessenger; - } - /** * @notice Sends a message from L2 to L1. * @@ -70,8 +61,17 @@ contract L2CrossDomainMessenger is CrossDomainMessenger, Semver { uint256 _value, bytes memory _data ) internal override { - L2ToL1MessagePasser(payable(PredeployAddresses.L2_TO_L1_MESSAGE_PASSER)).initiateWithdrawal{ + L2ToL1MessagePasser(payable(Predeploys.L2_TO_L1_MESSAGE_PASSER)).initiateWithdrawal{ value: _value }(_to, _gasLimit, _data); } + + /** + * @notice Checks that the message sender is the L1CrossDomainMessenger on L1. + * + * @return True if the message sender is the L1CrossDomainMessenger on L1. + */ + function _isOtherMessenger() internal view override returns (bool) { + return AddressAliasHelper.undoL1ToL2Alias(msg.sender) == otherMessenger; + } } diff --git a/packages/contracts-bedrock/contracts/L2/L2StandardBridge.sol b/packages/contracts-bedrock/contracts/L2/L2StandardBridge.sol index f213e5a003928..0a79d8c92ca62 100644 --- a/packages/contracts-bedrock/contracts/L2/L2StandardBridge.sol +++ b/packages/contracts-bedrock/contracts/L2/L2StandardBridge.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity 0.8.15; -import { PredeployAddresses } from "../libraries/PredeployAddresses.sol"; +import { Predeploys } from "../libraries/Predeploys.sol"; import { StandardBridge } from "../universal/StandardBridge.sol"; import { Semver } from "../universal/Semver.sol"; import { OptimismMintableERC20 } from "../universal/OptimismMintableERC20.sol"; @@ -87,15 +87,6 @@ contract L2StandardBridge is StandardBridge, Semver { initialize(_otherBridge); } - /** - * @notice Initializer. - * - * @param _otherBridge Address of the L1StandardBridge. - */ - function initialize(address payable _otherBridge) public initializer { - __StandardBridge_init(payable(PredeployAddresses.L2_CROSS_DOMAIN_MESSENGER), _otherBridge); - } - /** * @custom:legacy * @notice Initiates a withdrawal from L2 to L1. @@ -157,7 +148,7 @@ contract L2StandardBridge is StandardBridge, Semver { uint256 _amount, bytes calldata _extraData ) external payable virtual { - if (_l1Token == address(0) && _l2Token == PredeployAddresses.LEGACY_ERC20_ETH) { + if (_l1Token == address(0) && _l2Token == Predeploys.LEGACY_ERC20_ETH) { finalizeBridgeETH(_from, _to, _amount, _extraData); } else { finalizeBridgeERC20(_l2Token, _l1Token, _from, _to, _amount, _extraData); @@ -165,6 +156,15 @@ contract L2StandardBridge is StandardBridge, Semver { emit DepositFinalized(_l1Token, _l2Token, _from, _to, _amount, _extraData); } + /** + * @notice Initializer. + * + * @param _otherBridge Address of the L1StandardBridge. + */ + function initialize(address payable _otherBridge) public initializer { + __StandardBridge_init(payable(Predeploys.L2_CROSS_DOMAIN_MESSENGER), _otherBridge); + } + /** * @custom:legacy * @notice Internal function to a withdrawal from L2 to L1 to a target account on L1. @@ -185,8 +185,12 @@ contract L2StandardBridge is StandardBridge, Semver { bytes calldata _extraData ) internal { address l1Token = OptimismMintableERC20(_l2Token).l1Token(); - if (_l2Token == PredeployAddresses.LEGACY_ERC20_ETH) { - require(msg.value == _amount, "ETH withdrawals must include sufficient ETH value."); + if (_l2Token == Predeploys.LEGACY_ERC20_ETH) { + require( + msg.value == _amount, + "L2StandardBridge: ETH withdrawals must include sufficient ETH value" + ); + _initiateBridgeETH(_from, _to, _amount, _minGasLimit, _extraData); } else { _initiateBridgeERC20(_l2Token, l1Token, _from, _to, _amount, _minGasLimit, _extraData); diff --git a/packages/contracts-bedrock/contracts/L2/L2ToL1MessagePasser.sol b/packages/contracts-bedrock/contracts/L2/L2ToL1MessagePasser.sol index 77b5c5c3665e4..543acbc432edc 100644 --- a/packages/contracts-bedrock/contracts/L2/L2ToL1MessagePasser.sol +++ b/packages/contracts-bedrock/contracts/L2/L2ToL1MessagePasser.sol @@ -1,6 +1,7 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity 0.8.15; +import { Types } from "../libraries/Types.sol"; import { Hashing } from "../libraries/Hashing.sol"; import { Burn } from "../libraries/Burn.sol"; import { Semver } from "../universal/Semver.sol"; @@ -14,6 +15,21 @@ import { Semver } from "../universal/Semver.sol"; * of the L2 output to reduce the cost of proving the existence of sent messages. */ contract L2ToL1MessagePasser is Semver { + /** + * @notice The L1 gas limit set when eth is withdrawn using the receive() function. + */ + uint256 internal constant RECEIVE_DEFAULT_GAS_LIMIT = 100_000; + + /** + * @notice Includes the message hashes for all withdrawals + */ + mapping(bytes32 => bool) public sentMessages; + + /** + * @notice A unique value hashed with each withdrawal. + */ + uint256 public nonce; + /** * @notice Emitted any time a withdrawal is initiated. * @@ -40,21 +56,6 @@ contract L2ToL1MessagePasser is Semver { */ event WithdrawerBalanceBurnt(uint256 indexed amount); - /** - * @notice The L1 gas limit set when eth is withdrawn using the receive() function. - */ - uint256 internal constant RECEIVE_DEFAULT_GAS_LIMIT = 100_000; - - /** - * @notice Includes the message hashes for all withdrawals - */ - mapping(bytes32 => bool) public sentMessages; - - /** - * @notice A unique value hashed with each withdrawal. - */ - uint256 public nonce; - /** * @custom:semver 0.0.1 */ @@ -67,6 +68,18 @@ contract L2ToL1MessagePasser is Semver { initiateWithdrawal(msg.sender, RECEIVE_DEFAULT_GAS_LIMIT, bytes("")); } + /** + * @notice Removes all ETH held by this contract from the state. Used to prevent the amount of + * ETH on L2 inflating when ETH is withdrawn. Currently only way to do this is to + * create a contract and self-destruct it to itself. Anyone can call this function. Not + * incentivized since this function is very cheap. + */ + function burn() external { + uint256 balance = address(this).balance; + Burn.eth(balance); + emit WithdrawerBalanceBurnt(balance); + } + /** * @notice Sends a message from L2 to L1. * @@ -80,12 +93,14 @@ contract L2ToL1MessagePasser is Semver { bytes memory _data ) public payable { bytes32 withdrawalHash = Hashing.hashWithdrawal( - nonce, - msg.sender, - _target, - msg.value, - _gasLimit, - _data + Types.WithdrawalTransaction({ + nonce: nonce, + sender: msg.sender, + target: _target, + value: msg.value, + gasLimit: _gasLimit, + data: _data + }) ); sentMessages[withdrawalHash] = true; @@ -95,16 +110,4 @@ contract L2ToL1MessagePasser is Semver { ++nonce; } } - - /** - * @notice Removes all ETH held by this contract from the state. Used to prevent the amount of - * ETH on L2 inflating when ETH is withdrawn. Currently only way to do this is to - * create a contract and self-destruct it to itself. Anyone can call this function. Not - * incentivized since this function is very cheap. - */ - function burn() external { - uint256 balance = address(this).balance; - Burn.eth(balance); - emit WithdrawerBalanceBurnt(balance); - } } diff --git a/packages/contracts-bedrock/contracts/L2/SequencerFeeVault.sol b/packages/contracts-bedrock/contracts/L2/SequencerFeeVault.sol index 964975d23c51a..3b15ddaf4b8e7 100644 --- a/packages/contracts-bedrock/contracts/L2/SequencerFeeVault.sol +++ b/packages/contracts-bedrock/contracts/L2/SequencerFeeVault.sol @@ -1,9 +1,9 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity 0.8.15; import { Semver } from "../universal/Semver.sol"; import { L2StandardBridge } from "./L2StandardBridge.sol"; -import { PredeployAddresses } from "../libraries/PredeployAddresses.sol"; +import { Predeploys } from "../libraries/Predeploys.sol"; /** * @custom:proxied @@ -39,14 +39,11 @@ contract SequencerFeeVault is Semver { function withdraw() external { require( address(this).balance >= MIN_WITHDRAWAL_AMOUNT, - // solhint-disable-next-line max-line-length - "OVM_SequencerFeeVault: withdrawal amount must be greater than minimum withdrawal amount" + "SequencerFeeVault: withdrawal amount must be greater than minimum withdrawal amount" ); - uint256 balance = address(this).balance; - - L2StandardBridge(payable(PredeployAddresses.L2_STANDARD_BRIDGE)).withdrawTo{ - value: balance - }(PredeployAddresses.LEGACY_ERC20_ETH, l1FeeWallet, balance, 0, bytes("")); + L2StandardBridge(payable(Predeploys.L2_STANDARD_BRIDGE)).withdrawTo{ + value: address(this).balance + }(Predeploys.LEGACY_ERC20_ETH, l1FeeWallet, address(this).balance, 0, bytes("")); } } diff --git a/packages/contracts-bedrock/contracts/legacy/AddressManager.sol b/packages/contracts-bedrock/contracts/legacy/AddressManager.sol index 09220123cea99..246c81770c56f 100644 --- a/packages/contracts-bedrock/contracts/legacy/AddressManager.sol +++ b/packages/contracts-bedrock/contracts/legacy/AddressManager.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity 0.8.15; import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; @@ -12,6 +12,11 @@ import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; * with several older contracts. */ contract AddressManager is Ownable { + /** + * @notice Mapping of the hashes of string names to addresses. + */ + mapping(bytes32 => address) private addresses; + /** * @notice Emitted when an address is modified in the registry. * @@ -21,11 +26,6 @@ contract AddressManager is Ownable { */ event AddressSet(string indexed name, address newAddress, address oldAddress); - /** - * @notice Mapping of the hashes of string names to addresses. - */ - mapping(bytes32 => address) private addresses; - /** * @notice Changes the address associated with a particular name. * diff --git a/packages/contracts-bedrock/contracts/L2/DeployerWhitelist.sol b/packages/contracts-bedrock/contracts/legacy/DeployerWhitelist.sol similarity index 99% rename from packages/contracts-bedrock/contracts/L2/DeployerWhitelist.sol rename to packages/contracts-bedrock/contracts/legacy/DeployerWhitelist.sol index 6f8a77c32e5e9..4d8269abd912c 100644 --- a/packages/contracts-bedrock/contracts/L2/DeployerWhitelist.sol +++ b/packages/contracts-bedrock/contracts/legacy/DeployerWhitelist.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity 0.8.15; import { Semver } from "../universal/Semver.sol"; @@ -15,6 +15,17 @@ import { Semver } from "../universal/Semver.sol"; * system and could, in theory, be removed entirely. */ contract DeployerWhitelist is Semver { + /** + * @notice Address of the owner of this contract. Note that when this address is set to + * address(0), the whitelist is disabled. + */ + address public owner; + + /** + * @notice Mapping of deployer addresses to boolean whitelist status. + */ + mapping(address => bool) public whitelist; + /** * @notice Emitted when the owner of this contract changes. * @@ -38,22 +49,6 @@ contract DeployerWhitelist is Semver { */ event WhitelistDisabled(address oldOwner); - /** - * @notice Address of the owner of this contract. Note that when this address is set to - * address(0), the whitelist is disabled. - */ - address public owner; - - /** - * @notice Mapping of deployer addresses to boolean whitelist status. - */ - mapping(address => bool) public whitelist; - - /** - * @custom:semver 0.0.1 - */ - constructor() Semver(0, 0, 1) {} - /** * @notice Blocks functions to anyone except the contract owner. */ @@ -65,6 +60,11 @@ contract DeployerWhitelist is Semver { _; } + /** + * @custom:semver 0.0.1 + */ + constructor() Semver(0, 0, 1) {} + /** * @notice Adds or removes an address from the deployment whitelist. * diff --git a/packages/contracts-bedrock/contracts/L2/L1BlockNumber.sol b/packages/contracts-bedrock/contracts/legacy/L1BlockNumber.sol similarity index 86% rename from packages/contracts-bedrock/contracts/L2/L1BlockNumber.sol rename to packages/contracts-bedrock/contracts/legacy/L1BlockNumber.sol index 42f9dffb6a8ed..b58d2e7f6524a 100644 --- a/packages/contracts-bedrock/contracts/L2/L1BlockNumber.sol +++ b/packages/contracts-bedrock/contracts/legacy/L1BlockNumber.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.10; +pragma solidity 0.8.15; -import { L1Block } from "./L1Block.sol"; -import { PredeployAddresses } from "../libraries/PredeployAddresses.sol"; +import { L1Block } from "../L2/L1Block.sol"; +import { Predeploys } from "../libraries/Predeploys.sol"; import { Semver } from "../universal/Semver.sol"; /** @@ -50,6 +50,6 @@ contract L1BlockNumber is Semver { * @return Latest L1 block number. */ function getL1BlockNumber() public view returns (uint256) { - return L1Block(PredeployAddresses.L1_BLOCK_ATTRIBUTES).number(); + return L1Block(Predeploys.L1_BLOCK_ATTRIBUTES).number(); } } diff --git a/packages/contracts-bedrock/contracts/legacy/L1ChugSplashProxy.sol b/packages/contracts-bedrock/contracts/legacy/L1ChugSplashProxy.sol index b841454b52bc6..220e3805a215f 100644 --- a/packages/contracts-bedrock/contracts/legacy/L1ChugSplashProxy.sol +++ b/packages/contracts-bedrock/contracts/legacy/L1ChugSplashProxy.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity 0.8.15; /** * @title IL1ChugSplashDeployer @@ -40,13 +40,6 @@ contract L1ChugSplashProxy { bytes32 internal constant OWNER_KEY = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; - /** - * @param _owner Address of the initial contract owner. - */ - constructor(address _owner) { - _setOwner(_owner); - } - /** * @notice Blocks a function from being called when the parent signals that the system should * be paused via an isUpgrading function. @@ -100,14 +93,21 @@ contract L1ChugSplashProxy { } } + /** + * @param _owner Address of the initial contract owner. + */ + constructor(address _owner) { + _setOwner(_owner); + } + // slither-disable-next-line locked-ether - fallback() external payable { + receive() external payable { // Proxy call by default. _doProxyCall(); } // slither-disable-next-line locked-ether - receive() external payable { + fallback() external payable { // Proxy call by default. _doProxyCall(); } @@ -146,7 +146,7 @@ contract L1ChugSplashProxy { // should be doing this check anyway though. require( _getAccountCodeHash(newImplementation) == keccak256(_code), - "L1ChugSplashProxy: code was not correctly deployed." + "L1ChugSplashProxy: code was not correctly deployed" ); _setImplementation(newImplementation); @@ -206,27 +206,57 @@ contract L1ChugSplashProxy { } /** - * @notice Queries the implementation address. + * @notice Changes the owner of the proxy contract. * - * @return Implementation address. + * @param _owner New owner of the proxy contract. */ - function _getImplementation() internal view returns (address) { - address implementation; + function _setOwner(address _owner) internal { assembly { - implementation := sload(IMPLEMENTATION_KEY) + sstore(OWNER_KEY, _owner) } - return implementation; } /** - * @notice Changes the owner of the proxy contract. + * @notice Performs the proxy call via a delegatecall. + */ + function _doProxyCall() internal onlyWhenNotPaused { + address implementation = _getImplementation(); + + require(implementation != address(0), "L1ChugSplashProxy: implementation is not set yet"); + + assembly { + // Copy calldata into memory at 0x0....calldatasize. + calldatacopy(0x0, 0x0, calldatasize()) + + // Perform the delegatecall, make sure to pass all available gas. + let success := delegatecall(gas(), implementation, 0x0, calldatasize(), 0x0, 0x0) + + // Copy returndata into memory at 0x0....returndatasize. Note that this *will* + // overwrite the calldata that we just copied into memory but that doesn't really + // matter because we'll be returning in a second anyway. + returndatacopy(0x0, 0x0, returndatasize()) + + // Success == 0 means a revert. We'll revert too and pass the data up. + if iszero(success) { + revert(0x0, returndatasize()) + } + + // Otherwise we'll just return and pass the data up. + return(0x0, returndatasize()) + } + } + + /** + * @notice Queries the implementation address. * - * @param _owner New owner of the proxy contract. + * @return Implementation address. */ - function _setOwner(address _owner) internal { + function _getImplementation() internal view returns (address) { + address implementation; assembly { - sstore(OWNER_KEY, _owner) + implementation := sload(IMPLEMENTATION_KEY) } + return implementation; } /** @@ -256,34 +286,4 @@ contract L1ChugSplashProxy { } return codeHash; } - - /** - * @notice Performs the proxy call via a delegatecall. - */ - function _doProxyCall() internal onlyWhenNotPaused { - address implementation = _getImplementation(); - - require(implementation != address(0), "L1ChugSplashProxy: implementation is not set yet"); - - assembly { - // Copy calldata into memory at 0x0....calldatasize. - calldatacopy(0x0, 0x0, calldatasize()) - - // Perform the delegatecall, make sure to pass all available gas. - let success := delegatecall(gas(), implementation, 0x0, calldatasize(), 0x0, 0x0) - - // Copy returndata into memory at 0x0....returndatasize. Note that this *will* - // overwrite the calldata that we just copied into memory but that doesn't really - // matter because we'll be returning in a second anyway. - returndatacopy(0x0, 0x0, returndatasize()) - - // Success == 0 means a revert. We'll revert too and pass the data up. - if iszero(success) { - revert(0x0, returndatasize()) - } - - // Otherwise we'll just return and pass the data up. - return(0x0, returndatasize()) - } - } } diff --git a/packages/contracts-bedrock/contracts/legacy/LegacyERC20ETH.sol b/packages/contracts-bedrock/contracts/legacy/LegacyERC20ETH.sol index 101d23db1de91..40c7083c816a4 100644 --- a/packages/contracts-bedrock/contracts/legacy/LegacyERC20ETH.sol +++ b/packages/contracts-bedrock/contracts/legacy/LegacyERC20ETH.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.10; +pragma solidity 0.8.15; -import { PredeployAddresses } from "../libraries/PredeployAddresses.sol"; +import { Predeploys } from "../libraries/Predeploys.sol"; import { OptimismMintableERC20 } from "../universal/OptimismMintableERC20.sol"; /** @@ -19,7 +19,7 @@ contract LegacyERC20ETH is OptimismMintableERC20 { * @notice Initializes the contract as an Optimism Mintable ERC20. */ constructor() - OptimismMintableERC20(PredeployAddresses.L2_STANDARD_BRIDGE, address(0), "Ether", "ETH") + OptimismMintableERC20(Predeploys.L2_STANDARD_BRIDGE, address(0), "Ether", "ETH") {} /** diff --git a/packages/contracts-bedrock/contracts/legacy/ResolvedDelegateProxy.sol b/packages/contracts-bedrock/contracts/legacy/ResolvedDelegateProxy.sol index 06b4a8b606e52..0271ece8fe7c0 100644 --- a/packages/contracts-bedrock/contracts/legacy/ResolvedDelegateProxy.sol +++ b/packages/contracts-bedrock/contracts/legacy/ResolvedDelegateProxy.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity 0.8.15; import { AddressManager } from "./AddressManager.sol"; diff --git a/packages/contracts-bedrock/contracts/libraries/Burn.sol b/packages/contracts-bedrock/contracts/libraries/Burn.sol index 75c05a270cbef..558960bef5959 100644 --- a/packages/contracts-bedrock/contracts/libraries/Burn.sol +++ b/packages/contracts-bedrock/contracts/libraries/Burn.sol @@ -1,17 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.10; - -/** - * @title Burner - * @notice Burner self-destructs on creation and sends all ETH to itself, removing all ETH given to - * the contract from the circulating supply. Self-destructing is the only way to remove ETH - * from the circulating supply. - */ -contract Burner { - constructor() payable { - selfdestruct(payable(address(this))); - } -} +pragma solidity 0.8.15; /** * @title Burn @@ -40,3 +28,15 @@ library Burn { } } } + +/** + * @title Burner + * @notice Burner self-destructs on creation and sends all ETH to itself, removing all ETH given to + * the contract from the circulating supply. Self-destructing is the only way to remove ETH + * from the circulating supply. + */ +contract Burner { + constructor() payable { + selfdestruct(payable(address(this))); + } +} diff --git a/packages/contracts-bedrock/contracts/libraries/BytesUtils.sol b/packages/contracts-bedrock/contracts/libraries/Bytes.sol similarity index 97% rename from packages/contracts-bedrock/contracts/libraries/BytesUtils.sol rename to packages/contracts-bedrock/contracts/libraries/Bytes.sol index 315e56c71b1fd..21d0d77767cca 100644 --- a/packages/contracts-bedrock/contracts/libraries/BytesUtils.sol +++ b/packages/contracts-bedrock/contracts/libraries/Bytes.sol @@ -1,11 +1,11 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity ^0.8.0; /** - * @title BytesUtils - * @notice BytesUtils is a library for manipulating byte arrays. + * @title Bytes + * @notice Bytes is a library for manipulating byte arrays. */ -library BytesUtils { +library Bytes { /** * @custom:attribution https://github.com/GNSPS/solidity-bytes-utils * @notice Slices a byte array with a given starting index and length. Returns a new byte array diff --git a/packages/contracts-bedrock/contracts/libraries/Encoding.sol b/packages/contracts-bedrock/contracts/libraries/Encoding.sol index c05f8702818ad..e0e27355c229a 100644 --- a/packages/contracts-bedrock/contracts/libraries/Encoding.sol +++ b/packages/contracts-bedrock/contracts/libraries/Encoding.sol @@ -1,6 +1,7 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.10; +pragma solidity ^0.8.0; +import { Types } from "./Types.sol"; import { Hashing } from "./Hashing.sol"; import { RLPWriter } from "./rlp/RLPWriter.sol"; @@ -13,39 +14,25 @@ library Encoding { * @notice RLP encodes the L2 transaction that would be generated when a given deposit is sent * to the L2 system. Useful for searching for a deposit in the L2 system. * - * @param _from Address of the sender of the deposit. - * @param _to Address of the receiver of the deposit. - * @param _value ETH value to send to the receiver. - * @param _mint ETH value to mint on L2. - * @param _gasLimit Gas limit to use for the transaction. - * @param _isCreation Whether or not the transaction is a contract creation. - * @param _data Data to send with the transaction. - * @param _l1BlockHash Hash of the L1 block where the deposit was included. - * @param _logIndex Index of the deposit event in the L1 block. + * @param _tx User deposit transaction to encode. * * @return RLP encoded L2 deposit transaction. */ - function encodeDepositTransaction( - address _from, - address _to, - uint256 _value, - uint256 _mint, - uint64 _gasLimit, - bool _isCreation, - bytes memory _data, - bytes32 _l1BlockHash, - uint256 _logIndex - ) internal pure returns (bytes memory) { - bytes32 source = Hashing.hashDepositSource(_l1BlockHash, _logIndex); + function encodeDepositTransaction(Types.UserDepositTransaction memory _tx) + internal + pure + returns (bytes memory) + { + bytes32 source = Hashing.hashDepositSource(_tx.l1BlockHash, _tx.logIndex); bytes[] memory raw = new bytes[](7); raw[0] = RLPWriter.writeBytes(abi.encodePacked(source)); - raw[1] = RLPWriter.writeAddress(_from); - raw[2] = _isCreation ? RLPWriter.writeBytes("") : RLPWriter.writeAddress(_to); - raw[3] = RLPWriter.writeUint(_mint); - raw[4] = RLPWriter.writeUint(_value); - raw[5] = RLPWriter.writeUint(uint256(_gasLimit)); - raw[6] = RLPWriter.writeBytes(_data); - return abi.encodePacked(uint8(0x7e), uint8(0x0), RLPWriter.writeList(raw)); + raw[1] = RLPWriter.writeAddress(_tx.from); + raw[2] = _tx.isCreation ? RLPWriter.writeBytes("") : RLPWriter.writeAddress(_tx.to); + raw[3] = RLPWriter.writeUint(_tx.mint); + raw[4] = RLPWriter.writeUint(_tx.value); + raw[5] = RLPWriter.writeUint(uint256(_tx.gasLimit)); + raw[6] = RLPWriter.writeBytes(_tx.data); + return abi.encodePacked(uint8(0x7e), RLPWriter.writeList(raw)); } /** diff --git a/packages/contracts-bedrock/contracts/libraries/Hashing.sol b/packages/contracts-bedrock/contracts/libraries/Hashing.sol index dfc51d1751083..6b76f20bffe8e 100644 --- a/packages/contracts-bedrock/contracts/libraries/Hashing.sol +++ b/packages/contracts-bedrock/contracts/libraries/Hashing.sol @@ -1,6 +1,7 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.10; +pragma solidity ^0.8.0; +import { Types } from "./Types.sol"; import { Encoding } from "./Encoding.sol"; /** @@ -8,58 +9,21 @@ import { Encoding } from "./Encoding.sol"; * @notice Hashing handles Optimism's various different hashing schemes. */ library Hashing { - /** - * @notice Struct representing the elements that are hashed together to generate an output root - * which itself represents a snapshot of the L2 state. - */ - struct OutputRootProof { - bytes32 version; - bytes32 stateRoot; - bytes32 withdrawerStorageRoot; - bytes32 latestBlockhash; - } - /** * @notice Computes the hash of the RLP encoded L2 transaction that would be generated when a * given deposit is sent to the L2 system. Useful for searching for a deposit in the L2 * system. * - * @param _from Address of the sender of the deposit. - * @param _to Address of the receiver of the deposit. - * @param _value ETH value to send to the receiver. - * @param _mint ETH value to mint on L2. - * @param _gasLimit Gas limit to use for the transaction. - * @param _isCreation Whether or not the transaction is a contract creation. - * @param _data Data to send with the transaction. - * @param _l1BlockHash Hash of the L1 block where the deposit was included. - * @param _logIndex Index of the deposit event in the L1 block. + * @param _tx User deposit transaction to hash. * * @return Hash of the RLP encoded L2 deposit transaction. */ - function hashDepositTransaction( - address _from, - address _to, - uint256 _value, - uint256 _mint, - uint64 _gasLimit, - bool _isCreation, - bytes memory _data, - bytes32 _l1BlockHash, - uint256 _logIndex - ) internal pure returns (bytes32) { - bytes memory raw = Encoding.encodeDepositTransaction( - _from, - _to, - _value, - _mint, - _gasLimit, - _isCreation, - _data, - _l1BlockHash, - _logIndex - ); - - return keccak256(raw); + function hashDepositTransaction(Types.UserDepositTransaction memory _tx) + internal + pure + returns (bytes32) + { + return keccak256(Encoding.encodeDepositTransaction(_tx)); } /** @@ -166,22 +130,20 @@ library Hashing { /** * @notice Derives the withdrawal hash according to the encoding in the L2 Withdrawer contract - * @param _nonce Nonce for the provided message. - * @param _sender Message sender address on L2. - * @param _target Target address on L1. - * @param _value ETH to send to the target. - * @param _gasLimit Gas to be forwarded to the target. - * @param _data Data to send to the target. + * + * @param _tx Withdrawal transaction to hash. + * + * @return Hashed withdrawal transaction. */ - function hashWithdrawal( - uint256 _nonce, - address _sender, - address _target, - uint256 _value, - uint256 _gasLimit, - bytes memory _data - ) internal pure returns (bytes32) { - return keccak256(abi.encode(_nonce, _sender, _target, _value, _gasLimit, _data)); + function hashWithdrawal(Types.WithdrawalTransaction memory _tx) + internal + pure + returns (bytes32) + { + return + keccak256( + abi.encode(_tx.nonce, _tx.sender, _tx.target, _tx.value, _tx.gasLimit, _tx.data) + ); } /** @@ -192,7 +154,7 @@ library Hashing { * * @return Hashed output root proof. */ - function hashOutputRootProof(OutputRootProof memory _outputRootProof) + function hashOutputRootProof(Types.OutputRootProof memory _outputRootProof) internal pure returns (bytes32) diff --git a/packages/contracts-bedrock/contracts/libraries/PredeployAddresses.sol b/packages/contracts-bedrock/contracts/libraries/Predeploys.sol similarity index 96% rename from packages/contracts-bedrock/contracts/libraries/PredeployAddresses.sol rename to packages/contracts-bedrock/contracts/libraries/Predeploys.sol index 8fe039330384c..4ee4431f48c94 100644 --- a/packages/contracts-bedrock/contracts/libraries/PredeployAddresses.sol +++ b/packages/contracts-bedrock/contracts/libraries/Predeploys.sol @@ -1,11 +1,11 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity ^0.8.0; /** - * @title PredeployAddresses + * @title Predeploys * @notice Contains constant addresses for contracts that are pre-deployed to the L2 system. */ -library PredeployAddresses { +library Predeploys { /** * @notice Address of the L2ToL1MessagePasser predeploy. */ diff --git a/packages/contracts-bedrock/contracts/libraries/Types.sol b/packages/contracts-bedrock/contracts/libraries/Types.sol new file mode 100644 index 0000000000000..d14caa2a80764 --- /dev/null +++ b/packages/contracts-bedrock/contracts/libraries/Types.sol @@ -0,0 +1,57 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.9; + +/** + * @title Types + * @notice Contains various types used throughout the Optimism contract system. + */ +library Types { + /** + * @notice OutputProposal represents a commitment to the L2 state. The timestamp is the L1 + * timestamp that the output root is posted. This timestamp is used to verify that the + * finalization period has passed since the output root was submitted. + */ + struct OutputProposal { + bytes32 outputRoot; + uint256 timestamp; + } + + /** + * @notice Struct representing the elements that are hashed together to generate an output root + * which itself represents a snapshot of the L2 state. + */ + struct OutputRootProof { + bytes32 version; + bytes32 stateRoot; + bytes32 withdrawerStorageRoot; + bytes32 latestBlockhash; + } + + /** + * @notice Struct representing a deposit transaction (L1 => L2 transaction) created by an end + * user (as opposed to a system deposit transaction generated by the system). + */ + struct UserDepositTransaction { + address from; + address to; + uint256 value; + uint256 mint; + uint64 gasLimit; + bool isCreation; + bytes data; + bytes32 l1BlockHash; + uint256 logIndex; + } + + /** + * @notice Struct representing a withdrawal transaction. + */ + struct WithdrawalTransaction { + uint256 nonce; + address sender; + address target; + uint256 value; + uint256 gasLimit; + bytes data; + } +} diff --git a/packages/contracts-bedrock/contracts/libraries/rlp/RLPReader.sol b/packages/contracts-bedrock/contracts/libraries/rlp/RLPReader.sol index a8216805764fe..18e41e78a378b 100644 --- a/packages/contracts-bedrock/contracts/libraries/rlp/RLPReader.sol +++ b/packages/contracts-bedrock/contracts/libraries/rlp/RLPReader.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity ^0.8.0; /** * @custom:attribution https://github.com/hamdiallam/Solidity-RLP @@ -9,11 +9,6 @@ pragma solidity ^0.8.9; * various tweaks to improve readability. */ library RLPReader { - /** - * @notice Max list length that this library will accept. - */ - uint256 internal constant MAX_LIST_LENGTH = 32; - /** * @notice RLP item types. * @@ -33,6 +28,11 @@ library RLPReader { uint256 ptr; } + /** + * @notice Max list length that this library will accept. + */ + uint256 internal constant MAX_LIST_LENGTH = 32; + /** * @notice Converts bytes to a reference to memory position and length. * @@ -59,7 +59,7 @@ library RLPReader { function readList(RLPItem memory _in) internal pure returns (RLPItem[] memory) { (uint256 listOffset, , RLPItemType itemType) = _decodeLength(_in); - require(itemType == RLPItemType.LIST_ITEM, "Invalid RLP list value."); + require(itemType == RLPItemType.LIST_ITEM, "RLPReader: invalid RLP list value"); // Solidity in-memory arrays can't be increased in size, but *can* be decreased in size by // writing to the length. Since we can't know the number of RLP items without looping over @@ -70,7 +70,10 @@ library RLPReader { uint256 itemCount = 0; uint256 offset = listOffset; while (offset < _in.length) { - require(itemCount < MAX_LIST_LENGTH, "Provided RLP list exceeds max list length."); + require( + itemCount < MAX_LIST_LENGTH, + "RLPReader: provided RLP list exceeds max list length" + ); (uint256 itemOffset, uint256 itemLength, ) = _decodeLength( RLPItem({ length: _in.length - offset, ptr: _in.ptr + offset }) @@ -111,7 +114,7 @@ library RLPReader { function readBytes(RLPItem memory _in) internal pure returns (bytes memory) { (uint256 itemOffset, uint256 itemLength, RLPItemType itemType) = _decodeLength(_in); - require(itemType == RLPItemType.DATA_ITEM, "Invalid RLP bytes value."); + require(itemType == RLPItemType.DATA_ITEM, "RLPReader: invalid RLP bytes value"); return _copy(_in.ptr, itemOffset, itemLength); } @@ -157,11 +160,11 @@ library RLPReader { * @return Decoded bytes32. */ function readBytes32(RLPItem memory _in) internal pure returns (bytes32) { - require(_in.length <= 33, "Invalid RLP bytes32 value."); + require(_in.length <= 33, "RLPReader: invalid RLP bytes32 value"); (uint256 itemOffset, uint256 itemLength, RLPItemType itemType) = _decodeLength(_in); - require(itemType == RLPItemType.DATA_ITEM, "Invalid RLP bytes32 value."); + require(itemType == RLPItemType.DATA_ITEM, "RLPReader: invalid RLP bytes32 value"); uint256 ptr = _in.ptr + itemOffset; bytes32 out; @@ -218,7 +221,7 @@ library RLPReader { * @return Decoded bool. */ function readBool(RLPItem memory _in) internal pure returns (bool) { - require(_in.length == 1, "Invalid RLP boolean value."); + require(_in.length == 1, "RLPReader: invalid RLP boolean value"); uint256 ptr = _in.ptr; uint256 out; @@ -226,7 +229,7 @@ library RLPReader { out := byte(0, mload(ptr)) } - require(out == 0 || out == 1, "RLPReader: Invalid RLP boolean value, must be 0 or 1"); + require(out == 0 || out == 1, "RLPReader: invalid RLP boolean value, must be 0 or 1"); return out != 0; } @@ -254,7 +257,7 @@ library RLPReader { return address(0); } - require(_in.length == 21, "Invalid RLP address value."); + require(_in.length == 21, "RLPReader: invalid RLP address value"); return address(uint160(readUint256(_in))); } @@ -303,7 +306,7 @@ library RLPReader { RLPItemType ) { - require(_in.length > 0, "RLP item cannot be null."); + require(_in.length > 0, "RLPReader: RLP item cannot be null"); uint256 ptr = _in.ptr; uint256 prefix; @@ -321,14 +324,14 @@ library RLPReader { // slither-disable-next-line variable-scope uint256 strLen = prefix - 0x80; - require(_in.length > strLen, "Invalid RLP short string."); + require(_in.length > strLen, "RLPReader: invalid RLP short string"); return (1, strLen, RLPItemType.DATA_ITEM); } else if (prefix <= 0xbf) { // Long string. uint256 lenOfStrLen = prefix - 0xb7; - require(_in.length > lenOfStrLen, "Invalid RLP long string length."); + require(_in.length > lenOfStrLen, "RLPReader: invalid RLP long string length"); uint256 strLen; assembly { @@ -336,7 +339,7 @@ library RLPReader { strLen := div(mload(add(ptr, 1)), exp(256, sub(32, lenOfStrLen))) } - require(_in.length > lenOfStrLen + strLen, "Invalid RLP long string."); + require(_in.length > lenOfStrLen + strLen, "RLPReader: invalid RLP long string"); return (1 + lenOfStrLen, strLen, RLPItemType.DATA_ITEM); } else if (prefix <= 0xf7) { @@ -344,14 +347,14 @@ library RLPReader { // slither-disable-next-line variable-scope uint256 listLen = prefix - 0xc0; - require(_in.length > listLen, "Invalid RLP short list."); + require(_in.length > listLen, "RLPReader: invalid RLP short list"); return (1, listLen, RLPItemType.LIST_ITEM); } else { // Long list. uint256 lenOfListLen = prefix - 0xf7; - require(_in.length > lenOfListLen, "Invalid RLP long list length."); + require(_in.length > lenOfListLen, "RLPReader: invalid RLP long list length"); uint256 listLen; assembly { @@ -359,7 +362,7 @@ library RLPReader { listLen := div(mload(add(ptr, 1)), exp(256, sub(32, lenOfListLen))) } - require(_in.length > lenOfListLen + listLen, "Invalid RLP long list."); + require(_in.length > lenOfListLen + listLen, "RLPReader: invalid RLP long list"); return (1 + lenOfListLen, listLen, RLPItemType.LIST_ITEM); } diff --git a/packages/contracts-bedrock/contracts/libraries/rlp/RLPWriter.sol b/packages/contracts-bedrock/contracts/libraries/rlp/RLPWriter.sol index 6277634a40b00..b095e6245cc1e 100644 --- a/packages/contracts-bedrock/contracts/libraries/rlp/RLPWriter.sol +++ b/packages/contracts-bedrock/contracts/libraries/rlp/RLPWriter.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity ^0.8.0; /** * @custom:attribution https://github.com/bakaoh/solidity-rlp-encode diff --git a/packages/contracts-bedrock/contracts/libraries/trie/MerkleTrie.sol b/packages/contracts-bedrock/contracts/libraries/trie/MerkleTrie.sol index 8bde4474a602e..c75f83e181599 100644 --- a/packages/contracts-bedrock/contracts/libraries/trie/MerkleTrie.sol +++ b/packages/contracts-bedrock/contracts/libraries/trie/MerkleTrie.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity ^0.8.0; -import { BytesUtils } from "../BytesUtils.sol"; +import { Bytes } from "../Bytes.sol"; import { RLPReader } from "../rlp/RLPReader.sol"; import { RLPWriter } from "../rlp/RLPWriter.sol"; @@ -23,42 +23,42 @@ library MerkleTrie { /** * @notice Determines the number of elements per branch node. */ - uint256 constant TREE_RADIX = 16; + uint256 internal constant TREE_RADIX = 16; /** * @notice Branch nodes have TREE_RADIX elements and one value element. */ - uint256 constant BRANCH_NODE_LENGTH = TREE_RADIX + 1; + uint256 internal constant BRANCH_NODE_LENGTH = TREE_RADIX + 1; /** * @notice Leaf nodes and extension nodes have two elements, a `path` and a `value`. */ - uint256 constant LEAF_OR_EXTENSION_NODE_LENGTH = 2; + uint256 internal constant LEAF_OR_EXTENSION_NODE_LENGTH = 2; /** * @notice Prefix for even-nibbled extension node paths. */ - uint8 constant PREFIX_EXTENSION_EVEN = 0; + uint8 internal constant PREFIX_EXTENSION_EVEN = 0; /** * @notice Prefix for odd-nibbled extension node paths. */ - uint8 constant PREFIX_EXTENSION_ODD = 1; + uint8 internal constant PREFIX_EXTENSION_ODD = 1; /** * @notice Prefix for even-nibbled leaf node paths. */ - uint8 constant PREFIX_LEAF_EVEN = 2; + uint8 internal constant PREFIX_LEAF_EVEN = 2; /** * @notice Prefix for odd-nibbled leaf node paths. */ - uint8 constant PREFIX_LEAF_ODD = 3; + uint8 internal constant PREFIX_LEAF_ODD = 3; /** * @notice RLP representation of `NULL`. */ - bytes1 constant RLP_NULL = bytes1(0x80); + bytes1 internal constant RLP_NULL = bytes1(0x80); /** * @notice Verifies a proof that a given key/value pair is present in the trie. @@ -80,7 +80,7 @@ library MerkleTrie { bytes32 _root ) internal pure returns (bool) { (bool exists, bytes memory value) = get(_key, _proof, _root); - return (exists && BytesUtils.equal(_value, value)); + return (exists && Bytes.equal(_value, value)); } /** @@ -107,7 +107,7 @@ library MerkleTrie { bool exists = keyRemainder.length == 0; - require(exists || isFinalNode, "Provided proof is invalid."); + require(exists || isFinalNode, "MerkleTrie: provided proof is invalid"); bytes memory value = exists ? _getNodeValue(proof[pathLength - 1]) : bytes(""); @@ -125,6 +125,7 @@ library MerkleTrie { * @return Portion of the key remaining after the walk. * @return Whether or not we've hit a dead end. */ + // solhint-disable-next-line code-complexity function _walkNodePath( TrieNode[] memory _proof, bytes memory _key, @@ -139,7 +140,7 @@ library MerkleTrie { ) { uint256 pathLength = 0; - bytes memory key = BytesUtils.toNibbles(_key); + bytes memory key = Bytes.toNibbles(_key); bytes32 currentNodeID = _root; uint256 currentKeyIndex = 0; @@ -157,18 +158,21 @@ library MerkleTrie { if (currentKeyIndex == 0) { // First proof element is always the root node. - require(keccak256(currentNode.encoded) == currentNodeID, "Invalid root hash"); + require( + keccak256(currentNode.encoded) == currentNodeID, + "MerkleTrie: invalid root hash" + ); } else if (currentNode.encoded.length >= 32) { // Nodes 32 bytes or larger are hashed inside branch nodes. require( keccak256(currentNode.encoded) == currentNodeID, - "Invalid large internal hash" + "MerkleTrie: invalid large internal hash" ); } else { // Nodes smaller than 31 bytes aren't hashed. require( bytes32(currentNode.encoded) == currentNodeID, - "Invalid internal node hash" + "MerkleTrie: invalid internal node hash" ); } @@ -190,8 +194,8 @@ library MerkleTrie { bytes memory path = _getNodePath(currentNode); uint8 prefix = uint8(path[0]); uint8 offset = 2 - (prefix % 2); - bytes memory pathRemainder = BytesUtils.slice(path, offset); - bytes memory keyRemainder = BytesUtils.slice(key, currentKeyIndex); + bytes memory pathRemainder = Bytes.slice(path, offset); + bytes memory keyRemainder = Bytes.slice(key, currentKeyIndex); uint256 sharedNibbleLength = _getSharedNibbleLength(pathRemainder, keyRemainder); if (prefix == PREFIX_LEAF_EVEN || prefix == PREFIX_LEAF_ODD) { @@ -222,16 +226,16 @@ library MerkleTrie { continue; } } else { - revert("Received a node with an unknown prefix"); + revert("MerkleTrie: received a node with an unknown prefix"); } } else { - revert("Received an unparseable node."); + revert("MerkleTrie: received an unparseable node"); } } // If our node ID is NULL, then we're at a dead end. bool isFinalNode = currentNodeID == bytes32(RLP_NULL); - return (pathLength, BytesUtils.slice(key, currentKeyIndex), isFinalNode); + return (pathLength, Bytes.slice(key, currentKeyIndex), isFinalNode); } /** @@ -283,7 +287,7 @@ library MerkleTrie { * @return Node path, converted to an array of nibbles. */ function _getNodePath(TrieNode memory _node) private pure returns (bytes memory) { - return BytesUtils.toNibbles(RLPReader.readBytes(_node.decoded[0])); + return Bytes.toNibbles(RLPReader.readBytes(_node.decoded[0])); } /** diff --git a/packages/contracts-bedrock/contracts/libraries/trie/SecureMerkleTrie.sol b/packages/contracts-bedrock/contracts/libraries/trie/SecureMerkleTrie.sol index 38adb562b531c..d0b63ed260ed4 100644 --- a/packages/contracts-bedrock/contracts/libraries/trie/SecureMerkleTrie.sol +++ b/packages/contracts-bedrock/contracts/libraries/trie/SecureMerkleTrie.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity ^0.8.0; /* Library Imports */ import { MerkleTrie } from "./MerkleTrie.sol"; diff --git a/packages/contracts-bedrock/contracts/test/BenchmarkTest.t.sol b/packages/contracts-bedrock/contracts/test/BenchmarkTest.t.sol index 1a351852af45c..774ad57c30cd1 100644 --- a/packages/contracts-bedrock/contracts/test/BenchmarkTest.t.sol +++ b/packages/contracts-bedrock/contracts/test/BenchmarkTest.t.sol @@ -1,5 +1,5 @@ -//SPDX-License-Identifier: MIT -pragma solidity 0.8.10; +// SPDX-License-Identifier: MIT +pragma solidity 0.8.15; /* Testing utilities */ import { Test } from "forge-std/Test.sol"; @@ -129,11 +129,11 @@ contract GasBenchMark_L2OutputOracle is L2OutputOracle_Initializer { function setUp() public override { super.setUp(); nextBlockNumber = oracle.nextBlockNumber(); - warpToAppendTime(nextBlockNumber); - vm.startPrank(sequencer); + warpToProposeTime(nextBlockNumber); + vm.startPrank(proposer); } - function test_appendL2Output_benchmark() external { - oracle.appendL2Output(nonZeroHash, nextBlockNumber, 0, 0); + function test_proposeL2Output_benchmark() external { + oracle.proposeL2Output(nonZeroHash, nextBlockNumber, 0, 0); } } diff --git a/packages/contracts-bedrock/contracts/test/CommonTest.t.sol b/packages/contracts-bedrock/contracts/test/CommonTest.t.sol index 7e70430e3fe02..34fe1d8c12c7a 100644 --- a/packages/contracts-bedrock/contracts/test/CommonTest.t.sol +++ b/packages/contracts-bedrock/contracts/test/CommonTest.t.sol @@ -1,5 +1,5 @@ -//SPDX-License-Identifier: MIT -pragma solidity 0.8.10; +// SPDX-License-Identifier: MIT +pragma solidity 0.8.15; /* Testing utilities */ import { Test } from "forge-std/Test.sol"; @@ -10,12 +10,11 @@ import { L2StandardBridge } from "../L2/L2StandardBridge.sol"; import { OptimismMintableERC20Factory } from "../universal/OptimismMintableERC20Factory.sol"; import { OptimismMintableERC20 } from "../universal/OptimismMintableERC20.sol"; import { OptimismPortal } from "../L1/OptimismPortal.sol"; -import { L2ToL1MessagePasser } from "../L2/L2ToL1MessagePasser.sol"; import { L1CrossDomainMessenger } from "../L1/L1CrossDomainMessenger.sol"; import { L2CrossDomainMessenger } from "../L2/L2CrossDomainMessenger.sol"; import { AddressAliasHelper } from "../vendor/AddressAliasHelper.sol"; import { LegacyERC20ETH } from "../legacy/LegacyERC20ETH.sol"; -import { PredeployAddresses } from "../libraries/PredeployAddresses.sol"; +import { Predeploys } from "../libraries/Predeploys.sol"; import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import { Proxy } from "../universal/Proxy.sol"; import { Initializable } from "@openzeppelin/contracts/proxy/utils/Initializable.sol"; @@ -23,6 +22,7 @@ import { ResolvedDelegateProxy } from "../legacy/ResolvedDelegateProxy.sol"; import { AddressManager } from "../legacy/AddressManager.sol"; import { L1ChugSplashProxy } from "../legacy/L1ChugSplashProxy.sol"; import { IL1ChugSplashDeployer } from "../legacy/L1ChugSplashProxy.sol"; +import { Strings } from "@openzeppelin/contracts/utils/Strings.sol"; contract CommonTest is Test { address alice = address(128); @@ -37,6 +37,15 @@ contract CommonTest is Test { bytes32 nonZeroHash = keccak256(abi.encode("NON_ZERO")); bytes NON_ZERO_DATA = hex"0000111122223333444455556666777788889999aaaabbbbccccddddeeeeffff0000"; + event TransactionDeposited( + address indexed from, + address indexed to, + uint256 indexed version, + bytes opaqueData + ); + + FFIInterface ffi; + function _setUp() public { // Give alice and bob some ETH vm.deal(alice, 1 << 16); @@ -49,7 +58,27 @@ contract CommonTest is Test { // Make sure we have a non-zero base fee vm.fee(1000000000); + + ffi = new FFIInterface(); } + + function emitTransactionDeposited( + address _from, + address _to, + uint256 _mint, + uint256 _value, + uint64 _gasLimit, + bool _isCreation, + bytes memory _data + ) internal { + emit TransactionDeposited( + _from, + _to, + 0, + abi.encodePacked(_mint, _value, _gasLimit, _isCreation, _data) + ); + } + } contract L2OutputOracle_Initializer is CommonTest { @@ -57,8 +86,11 @@ contract L2OutputOracle_Initializer is CommonTest { L2OutputOracle oracle; L2OutputOracle oracleImpl; + L2ToL1MessagePasser messagePasser = + L2ToL1MessagePasser(payable(Predeploys.L2_TO_L1_MESSAGE_PASSER)); + // Constructor arguments - address sequencer = 0x000000000000000000000000000000000000AbBa; + address proposer = 0x000000000000000000000000000000000000AbBa; address owner = 0x000000000000000000000000000000000000ACDC; uint256 submissionInterval = 1800; uint256 l2BlockTime = 2; @@ -70,8 +102,8 @@ contract L2OutputOracle_Initializer is CommonTest { // Test data uint256 initL1Time; - // Advance the evm's time to meet the L2OutputOracle's requirements for appendL2Output - function warpToAppendTime(uint256 _nextBlockNumber) public { + // Advance the evm's time to meet the L2OutputOracle's requirements for proposeL2Output + function warpToProposeTime(uint256 _nextBlockNumber) public { vm.warp(oracle.computeL2Timestamp(_nextBlockNumber) + 1); } @@ -83,7 +115,7 @@ contract L2OutputOracle_Initializer is CommonTest { initL1Time = startingTimestamp + 1; vm.warp(initL1Time); vm.roll(startingBlockNumber); - // Deploy the L2OutputOracle and transfer owernship to the sequencer + // Deploy the L2OutputOracle and transfer owernship to the proposer oracleImpl = new L2OutputOracle( submissionInterval, genesisL2Output, @@ -91,7 +123,7 @@ contract L2OutputOracle_Initializer is CommonTest { startingBlockNumber, startingTimestamp, l2BlockTime, - sequencer, + proposer, owner ); Proxy proxy = new Proxy(multisig); @@ -102,11 +134,20 @@ contract L2OutputOracle_Initializer is CommonTest { L2OutputOracle.initialize.selector, genesisL2Output, startingBlockNumber, - sequencer, + proposer, owner ) ); oracle = L2OutputOracle(address(proxy)); + vm.label(address(oracle), "L2OutputOracle"); + + // Set the L2ToL1MessagePasser at the correct address + vm.etch( + Predeploys.L2_TO_L1_MESSAGE_PASSER, + address(new L2ToL1MessagePasser()).code + ); + + vm.label(Predeploys.L2_TO_L1_MESSAGE_PASSER, "L2ToL1MessagePasser"); } } @@ -117,6 +158,7 @@ contract Portal_Initializer is L2OutputOracle_Initializer { function setUp() public virtual override { L2OutputOracle_Initializer.setUp(); + opImpl = new OptimismPortal(oracle, 7 days); Proxy proxy = new Proxy(multisig); vm.prank(multisig); @@ -133,9 +175,7 @@ contract Messenger_Initializer is L2OutputOracle_Initializer { AddressManager addressManager; L1CrossDomainMessenger L1Messenger; L2CrossDomainMessenger L2Messenger = - L2CrossDomainMessenger(PredeployAddresses.L2_CROSS_DOMAIN_MESSENGER); - L2ToL1MessagePasser messagePasser = - L2ToL1MessagePasser(payable(PredeployAddresses.L2_TO_L1_MESSAGE_PASSER)); + L2CrossDomainMessenger(Predeploys.L2_CROSS_DOMAIN_MESSENGER); event SentMessage( address indexed target, @@ -145,6 +185,11 @@ contract Messenger_Initializer is L2OutputOracle_Initializer { uint256 gasLimit ); + event SentMessageExtension1( + address indexed sender, + uint256 value + ); + event WithdrawalInitiated( uint256 indexed nonce, address indexed sender, @@ -168,6 +213,8 @@ contract Messenger_Initializer is L2OutputOracle_Initializer { event WithdrawalFinalized(bytes32 indexed, bool success); + event WhatHappened(bool success, bytes returndata); + function setUp() public virtual override { super.setUp(); @@ -193,25 +240,18 @@ contract Messenger_Initializer is L2OutputOracle_Initializer { L1Messenger.initialize(); vm.etch( - PredeployAddresses.L2_CROSS_DOMAIN_MESSENGER, + Predeploys.L2_CROSS_DOMAIN_MESSENGER, address(new L2CrossDomainMessenger(address(L1Messenger))).code ); L2Messenger.initialize(address(L1Messenger)); - // Set the L2ToL1MessagePasser at the correct address - vm.etch( - PredeployAddresses.L2_TO_L1_MESSAGE_PASSER, - address(new L2ToL1MessagePasser()).code - ); - // Label addresses vm.label(address(addressManager), "AddressManager"); vm.label(address(L1MessengerImpl), "L1CrossDomainMessenger_Impl"); vm.label(address(L1Messenger), "L1CrossDomainMessenger_Proxy"); - vm.label(PredeployAddresses.LEGACY_ERC20_ETH, "LegacyERC20ETH"); - vm.label(PredeployAddresses.L2_TO_L1_MESSAGE_PASSER, "L2ToL1MessagePasser"); - vm.label(PredeployAddresses.L2_CROSS_DOMAIN_MESSENGER, "L2CrossDomainMessenger"); + vm.label(Predeploys.LEGACY_ERC20_ETH, "LegacyERC20ETH"); + vm.label(Predeploys.L2_CROSS_DOMAIN_MESSENGER, "L2CrossDomainMessenger"); vm.label( AddressAliasHelper.applyL1ToL2Alias(address(L1Messenger)), @@ -226,8 +266,10 @@ contract Bridge_Initializer is Messenger_Initializer { OptimismMintableERC20Factory L2TokenFactory; OptimismMintableERC20Factory L1TokenFactory; ERC20 L1Token; + ERC20 BadL1Token; OptimismMintableERC20 L2Token; ERC20 NativeL2Token; + ERC20 BadL2Token; OptimismMintableERC20 RemoteL1Token; event ETHDepositInitiated( @@ -333,8 +375,8 @@ contract Bridge_Initializer is Messenger_Initializer { function setUp() public virtual override { super.setUp(); - vm.label(PredeployAddresses.L2_STANDARD_BRIDGE, "L2StandardBridge"); - vm.label(PredeployAddresses.OPTIMISM_MINTABLE_ERC20_FACTORY, "OptimismMintableERC20Factory"); + vm.label(Predeploys.L2_STANDARD_BRIDGE, "L2StandardBridge"); + vm.label(Predeploys.OPTIMISM_MINTABLE_ERC20_FACTORY, "OptimismMintableERC20Factory"); // Deploy the L1 bridge and initialize it with the address of the // L1CrossDomainMessenger @@ -358,21 +400,21 @@ contract Bridge_Initializer is Messenger_Initializer { // Deploy the L2StandardBridge, move it to the correct predeploy // address and then initialize it - L2StandardBridge l2B = new L2StandardBridge(payable(PredeployAddresses.L2_STANDARD_BRIDGE)); - vm.etch(PredeployAddresses.L2_STANDARD_BRIDGE, address(l2B).code); - L2Bridge = L2StandardBridge(payable(PredeployAddresses.L2_STANDARD_BRIDGE)); + L2StandardBridge l2B = new L2StandardBridge(payable(Predeploys.L2_STANDARD_BRIDGE)); + vm.etch(Predeploys.L2_STANDARD_BRIDGE, address(l2B).code); + L2Bridge = L2StandardBridge(payable(Predeploys.L2_STANDARD_BRIDGE)); L2Bridge.initialize(payable(address(L1Bridge))); // Set up the L2 mintable token factory OptimismMintableERC20Factory factory = new OptimismMintableERC20Factory( - PredeployAddresses.L2_STANDARD_BRIDGE + Predeploys.L2_STANDARD_BRIDGE ); - vm.etch(PredeployAddresses.OPTIMISM_MINTABLE_ERC20_FACTORY, address(factory).code); + vm.etch(Predeploys.OPTIMISM_MINTABLE_ERC20_FACTORY, address(factory).code); L2TokenFactory = OptimismMintableERC20Factory( - PredeployAddresses.OPTIMISM_MINTABLE_ERC20_FACTORY + Predeploys.OPTIMISM_MINTABLE_ERC20_FACTORY ); - vm.etch(PredeployAddresses.LEGACY_ERC20_ETH, address(new LegacyERC20ETH()).code); + vm.etch(Predeploys.LEGACY_ERC20_ETH, address(new LegacyERC20ETH()).code); L1Token = new ERC20("Native L1 Token", "L1T"); @@ -385,6 +427,14 @@ contract Bridge_Initializer is Messenger_Initializer { ) ); + BadL2Token = OptimismMintableERC20( + L2TokenFactory.createStandardL2Token( + address(1), + string(abi.encodePacked("L2-", L1Token.name())), + string(abi.encodePacked("L2-", L1Token.symbol())) + ) + ); + NativeL2Token = new ERC20("Native L2 Token", "L2T"); L1TokenFactory = new OptimismMintableERC20Factory(address(L1Bridge)); @@ -395,6 +445,172 @@ contract Bridge_Initializer is Messenger_Initializer { string(abi.encodePacked("L1-", NativeL2Token.symbol())) ) ); + + BadL1Token = OptimismMintableERC20( + L1TokenFactory.createStandardL2Token( + address(1), + string(abi.encodePacked("L1-", NativeL2Token.name())), + string(abi.encodePacked("L1-", NativeL2Token.symbol())) + ) + ); + } +} + +contract FFIInterface is Test { + function getFinalizeWithdrawalTransactionInputs( + uint256 _nonce, + address _sender, + address _target, + uint64 _value, + uint256 _gasLimit, + bytes memory _data + ) external returns (bytes32, bytes32, bytes32, bytes32, bytes memory) { + string[] memory cmds = new string[](9); + cmds[0] = "node"; + cmds[1] = "dist/scripts/differential-testing.js"; + cmds[2] = "getFinalizeWithdrawalTransactionInputs"; + cmds[3] = vm.toString(_nonce); + cmds[4] = vm.toString(_sender); + cmds[5] = vm.toString(_target); + cmds[6] = vm.toString(_value); + cmds[7] = vm.toString(_gasLimit); + cmds[8] = vm.toString(_data); + + bytes memory result = vm.ffi(cmds); + ( + bytes32 stateRoot, + bytes32 storageRoot, + bytes32 outputRoot, + bytes32 withdrawalHash, + bytes memory withdrawalProof + ) = abi.decode(result, (bytes32, bytes32, bytes32, bytes32, bytes)); + + return (stateRoot, storageRoot, outputRoot, withdrawalHash, withdrawalProof); + } + + function hashCrossDomainMessage( + uint256 _nonce, + address _sender, + address _target, + uint256 _value, + uint256 _gasLimit, + bytes memory _data + ) external returns (bytes32) { + string[] memory cmds = new string[](9); + cmds[0] = "node"; + cmds[1] = "dist/scripts/differential-testing.js"; + cmds[2] = "hashCrossDomainMessage"; + cmds[3] = vm.toString(_nonce); + cmds[4] = vm.toString(_sender); + cmds[5] = vm.toString(_target); + cmds[6] = vm.toString(_value); + cmds[7] = vm.toString(_gasLimit); + cmds[8] = vm.toString(_data); + + bytes memory result = vm.ffi(cmds); + return abi.decode(result, (bytes32)); + } + + function hashWithdrawal( + uint256 _nonce, + address _sender, + address _target, + uint256 _value, + uint256 _gasLimit, + bytes memory _data + ) external returns (bytes32) { + string[] memory cmds = new string[](9); + cmds[0] = "node"; + cmds[1] = "dist/scripts/differential-testing.js"; + cmds[2] = "hashWithdrawal"; + cmds[3] = vm.toString(_nonce); + cmds[4] = vm.toString(_sender); + cmds[5] = vm.toString(_target); + cmds[6] = vm.toString(_value); + cmds[7] = vm.toString(_gasLimit); + cmds[8] = vm.toString(_data); + + bytes memory result = vm.ffi(cmds); + return abi.decode(result, (bytes32)); + } + + function hashOutputRootProof( + bytes32 _version, + bytes32 _stateRoot, + bytes32 _withdrawerStorageRoot, + bytes32 _latestBlockhash + ) external returns (bytes32) { + string[] memory cmds = new string[](7); + cmds[0] = "node"; + cmds[1] = "dist/scripts/differential-testing.js"; + cmds[2] = "hashOutputRootProof"; + cmds[3] = Strings.toHexString(uint256(_version)); + cmds[4] = Strings.toHexString(uint256(_stateRoot)); + cmds[5] = Strings.toHexString(uint256(_withdrawerStorageRoot)); + cmds[6] = Strings.toHexString(uint256(_latestBlockhash)); + + bytes memory result = vm.ffi(cmds); + return abi.decode(result, (bytes32)); + } + + function hashDepositTransaction( + address _from, + address _to, + uint256 _mint, + uint256 _value, + uint64 _gas, + bytes memory _data, + uint256 _logIndex + ) external returns (bytes32) { + string[] memory cmds = new string[](11); + cmds[0] = "node"; + cmds[1] = "dist/scripts/differential-testing.js"; + cmds[2] = "hashDepositTransaction"; + cmds[3] = "0x0000000000000000000000000000000000000000000000000000000000000000"; + cmds[4] = vm.toString(_logIndex); + cmds[5] = vm.toString(_from); + cmds[6] = vm.toString(_to); + cmds[7] = vm.toString(_mint); + cmds[8] = vm.toString(_value); + cmds[9] = vm.toString(_gas); + cmds[10] = vm.toString(_data); + bytes memory result = vm.ffi(cmds); + + return abi.decode(result, (bytes32)); + } + + function encodeCrossDomainMessage( + uint256 _nonce, + address _sender, + address _target, + uint256 _value, + uint256 _gasLimit, + bytes memory _data + ) external returns (bytes memory) { + string[] memory cmds = new string[](9); + cmds[0] = "node"; + cmds[1] = "dist/scripts/differential-testing.js"; + cmds[2] = "encodeCrossDomainMessage"; + cmds[3] = vm.toString(_nonce); + cmds[4] = vm.toString(_sender); + cmds[5] = vm.toString(_target); + cmds[6] = vm.toString(_value); + cmds[7] = vm.toString(_gasLimit); + cmds[8] = vm.toString(_data); + + bytes memory result = vm.ffi(cmds); + return abi.decode(result, (bytes)); + } + + function decodeVersionedNonce(uint256 nonce) external returns (uint256, uint256) { + string[] memory cmds = new string[](4); + cmds[0] = "node"; + cmds[1] = "dist/scripts/differential-testing.js"; + cmds[2] = "decodeVersionedNonce"; + cmds[3] = vm.toString(nonce); + + bytes memory result = vm.ffi(cmds); + return abi.decode(result, (uint256, uint256)); } } @@ -413,3 +629,27 @@ contract NextImpl is Initializable { slot21 = slot21Init; } } + +contract Reverter { + fallback() external { + revert(); + } +} + +// Useful for testing reentrancy guards +contract CallerCaller { + event WhatHappened( + bool success, + bytes returndata + ); + + fallback() external { + (bool success, bytes memory returndata) = msg.sender.call(msg.data); + emit WhatHappened(success, returndata); + assembly { + switch success + case 0 { revert(add(returndata, 0x20), mload(returndata)) } + default { return(add(returndata, 0x20), mload(returndata)) } + } + } +} diff --git a/packages/contracts-bedrock/contracts/test/DeployerWhitelist.t.sol b/packages/contracts-bedrock/contracts/test/DeployerWhitelist.t.sol index eafdffbdf7ccb..eed7fe8d3fd79 100644 --- a/packages/contracts-bedrock/contracts/test/DeployerWhitelist.t.sol +++ b/packages/contracts-bedrock/contracts/test/DeployerWhitelist.t.sol @@ -1,8 +1,8 @@ -//SPDX-License-Identifier: MIT -pragma solidity 0.8.10; +// SPDX-License-Identifier: MIT +pragma solidity 0.8.15; import { CommonTest } from "./CommonTest.t.sol"; -import { DeployerWhitelist } from "../L2/DeployerWhitelist.sol"; +import { DeployerWhitelist } from "../legacy/DeployerWhitelist.sol"; contract DeployerWhitelist_Test is CommonTest { DeployerWhitelist list; diff --git a/packages/contracts-bedrock/contracts/test/Encoding.t.sol b/packages/contracts-bedrock/contracts/test/Encoding.t.sol index 1ffabd55793c9..0c3ba6cb873ec 100644 --- a/packages/contracts-bedrock/contracts/test/Encoding.t.sol +++ b/packages/contracts-bedrock/contracts/test/Encoding.t.sol @@ -1,10 +1,15 @@ -//SPDX-License-Identifier: MIT -pragma solidity 0.8.10; +// SPDX-License-Identifier: MIT +pragma solidity 0.8.15; import { CommonTest } from "./CommonTest.t.sol"; +import { Types } from "../libraries/Types.sol"; import { Encoding } from "../libraries/Encoding.sol"; contract Encoding_Test is CommonTest { + function setUp() external { + _setUp(); + } + function test_nonceVersioning(uint240 _nonce, uint16 _version) external { (uint240 nonce, uint16 version) = Encoding.decodeVersionedNonce( Encoding.encodeVersionedNonce(_nonce, _version) @@ -13,22 +18,51 @@ contract Encoding_Test is CommonTest { assertEq(nonce, _nonce); } - function test_encodeDepositTransaction() external { - bytes memory raw = Encoding.encodeDepositTransaction( - 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266, - 0xB79f76EF2c5F0286176833E7B2eEe103b1CC3244, - 0xde0b6b3a7640000, - 0xe043da617250000, - 0x2dc6c0, - false, - hex"", - 0xd25df7858efc1778118fb133ac561b138845361626dfb976699c5287ed0f4959, - 0x1 + function test_decodeVersionedNonce_differential(uint240 _nonce, uint16 _version) external { + uint256 nonce = uint256(Encoding.encodeVersionedNonce(_nonce, _version)); + (uint256 decodedNonce, uint256 decodedVersion) = ffi.decodeVersionedNonce(nonce); + + assertEq( + _version, + uint16(decodedVersion) ); assertEq( - raw, - hex"7e00f862a0f923fb07134d7d287cb52c770cc619e17e82606c21a875c92f4c63b65280a5cc94f39fd6e51aad88f6f4ce6ab8827279cfffb9226694b79f76ef2c5f0286176833e7b2eee103b1cc3244880e043da617250000880de0b6b3a7640000832dc6c080" + _nonce, + uint240(decodedNonce) ); } + + function test_encodeCrossDomainMessage_differential( + uint240 _nonce, + uint8 _version, + address _sender, + address _target, + uint256 _value, + uint256 _gasLimit, + bytes memory _data + ) external { + uint8 version = _version % 2; + uint256 nonce = Encoding.encodeVersionedNonce(_nonce, version); + + bytes memory encoding = Encoding.encodeCrossDomainMessage( + nonce, + _sender, + _target, + _value, + _gasLimit, + _data + ); + + bytes memory _encoding = ffi.encodeCrossDomainMessage( + nonce, + _sender, + _target, + _value, + _gasLimit, + _data + ); + + assertEq(encoding, _encoding); + } } diff --git a/packages/contracts-bedrock/contracts/test/GasPriceOracle.t.sol b/packages/contracts-bedrock/contracts/test/GasPriceOracle.t.sol index 4a12e928e0ecd..acd8fe32b6b65 100644 --- a/packages/contracts-bedrock/contracts/test/GasPriceOracle.t.sol +++ b/packages/contracts-bedrock/contracts/test/GasPriceOracle.t.sol @@ -1,10 +1,10 @@ -//SPDX-License-Identifier: MIT -pragma solidity 0.8.10; +// SPDX-License-Identifier: MIT +pragma solidity 0.8.15; import { CommonTest } from "./CommonTest.t.sol"; import { GasPriceOracle } from "../L2/GasPriceOracle.sol"; import { L1Block } from "../L2/L1Block.sol"; -import { PredeployAddresses } from "../libraries/PredeployAddresses.sol"; +import { Predeploys } from "../libraries/Predeploys.sol"; contract GasPriceOracle_Test is CommonTest { @@ -19,11 +19,11 @@ contract GasPriceOracle_Test is CommonTest { function setUp() external { // place the L1Block contract at the predeploy address vm.etch( - PredeployAddresses.L1_BLOCK_ATTRIBUTES, + Predeploys.L1_BLOCK_ATTRIBUTES, address(new L1Block()).code ); - l1Block = L1Block(PredeployAddresses.L1_BLOCK_ATTRIBUTES); + l1Block = L1Block(Predeploys.L1_BLOCK_ATTRIBUTES); depositor = l1Block.DEPOSITOR_ACCOUNT(); // We are not setting the gas oracle at its predeploy diff --git a/packages/contracts-bedrock/contracts/test/Hashing.t.sol b/packages/contracts-bedrock/contracts/test/Hashing.t.sol index 6e3460b12a95d..29b4f814eee12 100644 --- a/packages/contracts-bedrock/contracts/test/Hashing.t.sol +++ b/packages/contracts-bedrock/contracts/test/Hashing.t.sol @@ -1,13 +1,16 @@ -//SPDX-License-Identifier: MIT -pragma solidity 0.8.10; +// SPDX-License-Identifier: MIT +pragma solidity 0.8.15; import { CommonTest } from "./CommonTest.t.sol"; +import { Types } from "../libraries/Types.sol"; import { Hashing } from "../libraries/Hashing.sol"; import { Encoding } from "../libraries/Encoding.sol"; contract Hashing_Test is CommonTest { - // TODO(tynes): turn this into differential fuzzing - // it is very easy to do so with the typescript + function setUp() external { + _setUp(); + } + function test_hashDepositSource() external { bytes32 sourceHash = Hashing.hashDepositSource( 0xd25df7858efc1778118fb133ac561b138845361626dfb976699c5287ed0f4959, @@ -20,22 +23,130 @@ contract Hashing_Test is CommonTest { ); } - function test_hashDepositTransaction() external { - bytes32 digest = Hashing.hashDepositTransaction( - 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266, - 0xB79f76EF2c5F0286176833E7B2eEe103b1CC3244, - 0xde0b6b3a7640000, - 0xe043da617250000, - 0x2dc6c0, - false, - hex"", - 0xd25df7858efc1778118fb133ac561b138845361626dfb976699c5287ed0f4959, - 0x1 + function test_hashCrossDomainMessage_differential( + uint256 _nonce, + address _sender, + address _target, + uint256 _value, + uint256 _gasLimit, + bytes memory _data + ) external { + // Discard any fuzz tests with an invalid version + (, uint16 version) = Encoding.decodeVersionedNonce(_nonce); + vm.assume(version < 2); + + bytes32 _hash = ffi.hashCrossDomainMessage( + _nonce, + _sender, + _target, + _value, + _gasLimit, + _data ); - assertEq( - digest, - 0xf58e30138cb01330f6450b9a5e717a63840ad2e21f17340105b388ad3c668749 + bytes32 hash = Hashing.hashCrossDomainMessage( + _nonce, + _sender, + _target, + _value, + _gasLimit, + _data ); + + assertEq(hash, _hash); + } + + function test_hashWithdrawal_differential( + uint256 _nonce, + address _sender, + address _target, + uint256 _value, + uint256 _gasLimit, + bytes memory _data + ) external { + bytes32 hash = Hashing.hashWithdrawal( + Types.WithdrawalTransaction( + _nonce, + _sender, + _target, + _value, + _gasLimit, + _data + ) + ); + + bytes32 _hash = ffi.hashWithdrawal( + _nonce, + _sender, + _target, + _value, + _gasLimit, + _data + ); + + assertEq(hash, _hash); + } + + function test_hashOutputRootProof_differential( + bytes32 _version, + bytes32 _stateRoot, + bytes32 _withdrawerStorageRoot, + bytes32 _latestBlockhash + ) external { + Types.OutputRootProof memory proof = Types.OutputRootProof({ + version: _version, + stateRoot: _stateRoot, + withdrawerStorageRoot: _withdrawerStorageRoot, + latestBlockhash: _latestBlockhash + }); + + bytes32 hash = Hashing.hashOutputRootProof(proof); + + bytes32 _hash = ffi.hashOutputRootProof( + _version, + _stateRoot, + _withdrawerStorageRoot, + _latestBlockhash + ); + + assertEq(hash, _hash); + } + + // TODO(tynes): foundry bug cannot serialize + // bytes32 as strings with vm.toString + function test_hashDepositTransaction_differential( + address _from, + address _to, + uint256 _mint, + uint256 _value, + uint64 _gas, + bytes memory _data, + uint256 _logIndex + ) external { + bytes32 hash = Hashing.hashDepositTransaction( + Types.UserDepositTransaction( + _from, + _to, + _value, + _mint, + _gas, + false, // isCreate + _data, + bytes32(uint256(0)), + _logIndex + ) + ); + + bytes32 _hash = ffi.hashDepositTransaction( + _from, + _to, + _mint, + _value, + _gas, + _data, + _logIndex + ); + + assertEq(hash, _hash); } } diff --git a/packages/contracts-bedrock/contracts/test/L1Block.t.sol b/packages/contracts-bedrock/contracts/test/L1Block.t.sol index d89d18fa3577f..b96e909a3a774 100644 --- a/packages/contracts-bedrock/contracts/test/L1Block.t.sol +++ b/packages/contracts-bedrock/contracts/test/L1Block.t.sol @@ -1,5 +1,5 @@ -//SPDX-License-Identifier: MIT -pragma solidity 0.8.10; +// SPDX-License-Identifier: MIT +pragma solidity 0.8.15; import { CommonTest } from "./CommonTest.t.sol"; import { L1Block } from "../L2/L1Block.sol"; diff --git a/packages/contracts-bedrock/contracts/test/L1BlockNumber.t.sol b/packages/contracts-bedrock/contracts/test/L1BlockNumber.t.sol index 52ad5d85ba16b..655e74457098e 100644 --- a/packages/contracts-bedrock/contracts/test/L1BlockNumber.t.sol +++ b/packages/contracts-bedrock/contracts/test/L1BlockNumber.t.sol @@ -1,18 +1,18 @@ -//SPDX-License-Identifier: MIT -pragma solidity 0.8.10; +// SPDX-License-Identifier: MIT +pragma solidity 0.8.15; import { Test } from "forge-std/Test.sol"; import { L1Block } from "../L2/L1Block.sol"; -import { L1BlockNumber } from "../L2/L1BlockNumber.sol"; -import { PredeployAddresses } from "../libraries/PredeployAddresses.sol"; +import { L1BlockNumber } from "../legacy/L1BlockNumber.sol"; +import { Predeploys } from "../libraries/Predeploys.sol"; contract L1BlockNumberTest is Test { L1Block lb; L1BlockNumber bn; function setUp() external { - vm.etch(PredeployAddresses.L1_BLOCK_ATTRIBUTES, address(new L1Block()).code); - lb = L1Block(PredeployAddresses.L1_BLOCK_ATTRIBUTES); + vm.etch(Predeploys.L1_BLOCK_ATTRIBUTES, address(new L1Block()).code); + lb = L1Block(Predeploys.L1_BLOCK_ATTRIBUTES); bn = new L1BlockNumber(); vm.prank(lb.DEPOSITOR_ACCOUNT()); lb.setL1BlockValues(uint64(999), uint64(2), 3, keccak256(abi.encode(1)), uint64(4)); diff --git a/packages/contracts-bedrock/contracts/test/L1CrossDomainMessenger.t.sol b/packages/contracts-bedrock/contracts/test/L1CrossDomainMessenger.t.sol index 6b6bf614f7147..95b7acbddfa3b 100644 --- a/packages/contracts-bedrock/contracts/test/L1CrossDomainMessenger.t.sol +++ b/packages/contracts-bedrock/contracts/test/L1CrossDomainMessenger.t.sol @@ -1,13 +1,13 @@ -//SPDX-License-Identifier: MIT -pragma solidity 0.8.10; +// SPDX-License-Identifier: MIT +pragma solidity 0.8.15; /* Testing utilities */ -import { Messenger_Initializer } from "./CommonTest.t.sol"; +import { Messenger_Initializer, Reverter, CallerCaller } from "./CommonTest.t.sol"; import { L2OutputOracle_Initializer } from "./L2OutputOracle.t.sol"; /* Libraries */ import { AddressAliasHelper } from "../vendor/AddressAliasHelper.sol"; -import { PredeployAddresses } from "../libraries/PredeployAddresses.sol"; +import { Predeploys } from "../libraries/Predeploys.sol"; import { Hashing } from "../libraries/Hashing.sol"; import { Encoding } from "../libraries/Encoding.sol"; @@ -69,7 +69,7 @@ contract L1CrossDomainMessenger_Test is Messenger_Initializer { address(op), abi.encodeWithSelector( OptimismPortal.depositTransaction.selector, - PredeployAddresses.L2_CROSS_DOMAIN_MESSENGER, + Predeploys.L2_CROSS_DOMAIN_MESSENGER, 0, L1Messenger.baseGas(hex"ff", 100), false, @@ -86,9 +86,9 @@ contract L1CrossDomainMessenger_Test is Messenger_Initializer { // TransactionDeposited event vm.expectEmit(true, true, true, true); - emit TransactionDeposited( + emitTransactionDeposited( AddressAliasHelper.applyL1ToL2Alias(address(L1Messenger)), - PredeployAddresses.L2_CROSS_DOMAIN_MESSENGER, + Predeploys.L2_CROSS_DOMAIN_MESSENGER, 0, 0, L1Messenger.baseGas(hex"ff", 100), @@ -107,6 +107,10 @@ contract L1CrossDomainMessenger_Test is Messenger_Initializer { vm.expectEmit(true, true, true, true); emit SentMessage(recipient, alice, hex"ff", L1Messenger.messageNonce(), 100); + // SentMessageExtension1 event + vm.expectEmit(true, true, true, true); + emit SentMessageExtension1(alice, 0); + vm.prank(alice); L1Messenger.sendMessage(recipient, hex"ff", uint32(100)); } @@ -121,7 +125,7 @@ contract L1CrossDomainMessenger_Test is Messenger_Initializer { } function test_L1MessengerXDomainSenderReverts() external { - vm.expectRevert("xDomainMessageSender is not set"); + vm.expectRevert("CrossDomainMessenger: xDomainMessageSender is not set"); L1Messenger.xDomainMessageSender(); } @@ -132,7 +136,7 @@ contract L1CrossDomainMessenger_Test is Messenger_Initializer { // relayMessage: should send a successful call to the target contract function test_L1MessengerRelayMessageSucceeds() external { address target = address(0xabcd); - address sender = PredeployAddresses.L2_CROSS_DOMAIN_MESSENGER; + address sender = Predeploys.L2_CROSS_DOMAIN_MESSENGER; vm.expectCall(target, hex"1111"); @@ -166,36 +170,36 @@ contract L1CrossDomainMessenger_Test is Messenger_Initializer { function test_L1MessengerRelayMessageToSystemContract() external { // set the target to be the OptimismPortal address target = address(op); - address sender = PredeployAddresses.L2_CROSS_DOMAIN_MESSENGER; + address sender = Predeploys.L2_CROSS_DOMAIN_MESSENGER; bytes memory message = hex"1111"; vm.prank(address(op)); - vm.expectRevert("Message cannot be replayed."); + vm.expectRevert("CrossDomainMessenger: message cannot be replayed"); L1Messenger.relayMessage(0, sender, target, 0, 0, message); vm.store(address(op), 0, bytes32(abi.encode(sender))); - vm.expectRevert("Message cannot be replayed."); + vm.expectRevert("CrossDomainMessenger: message cannot be replayed"); L1Messenger.relayMessage(0, sender, target, 0, 0, message); } // relayMessage: should revert if eth is sent from a contract other than the standard bridge function test_L1MessengerReplayMessageWithValue() external { address target = address(0xabcd); - address sender = PredeployAddresses.L2_CROSS_DOMAIN_MESSENGER; + address sender = Predeploys.L2_CROSS_DOMAIN_MESSENGER; bytes memory message = hex"1111"; vm.expectRevert( - "CrossDomainMessenger: Value must be zero unless message is from a system address." + "CrossDomainMessenger: value must be zero unless message is from a system address" ); L1Messenger.relayMessage{ value: 100 }(0, sender, target, 0, 0, message); } // relayMessage: the xDomainMessageSender is reset to the original value function test_L1MessengerxDomainMessageSenderResets() external { - vm.expectRevert("xDomainMessageSender is not set"); + vm.expectRevert("CrossDomainMessenger: xDomainMessageSender is not set"); L1Messenger.xDomainMessageSender(); - address sender = PredeployAddresses.L2_CROSS_DOMAIN_MESSENGER; + address sender = Predeploys.L2_CROSS_DOMAIN_MESSENGER; uint256 senderSlotIndex = 51; @@ -203,7 +207,7 @@ contract L1CrossDomainMessenger_Test is Messenger_Initializer { vm.prank(address(op)); L1Messenger.relayMessage(0, address(0), address(0), 0, 0, hex""); - vm.expectRevert("xDomainMessageSender is not set"); + vm.expectRevert("CrossDomainMessenger: xDomainMessageSender is not set"); L1Messenger.xDomainMessageSender(); } @@ -215,4 +219,94 @@ contract L1CrossDomainMessenger_Test is Messenger_Initializer { vm.expectRevert("Pausable: paused"); L1Messenger.relayMessage(0, address(0), address(0), 0, 0, hex""); } + + // relayMessage: should send a successful call to the target contract after the first message + // fails and ETH gets stuck, but the second message succeeds + function test_L1MessengerRelayMessageFirstStuckSecondSucceeds() external { + address target = address(0xabcd); + address sender = Predeploys.L2_CROSS_DOMAIN_MESSENGER; + uint256 value = 100; + + vm.expectCall(target, hex"1111"); + + bytes32 hash = Hashing.hashCrossDomainMessage(0, sender, target, value, 0, hex"1111"); + + uint256 senderSlotIndex = 51; + vm.store(address(op), bytes32(senderSlotIndex), bytes32(abi.encode(sender))); + vm.etch(target, address(new Reverter()).code); + vm.deal(address(op), value); + vm.prank(address(op)); + L1Messenger.relayMessage{value: value}( + 0, // nonce + sender, + target, + value, + 0, + hex"1111" + ); + + assertEq(address(L1Messenger).balance, value); + assertEq(address(target).balance, 0); + assertEq(L1Messenger.successfulMessages(hash), false); + assertEq(L1Messenger.receivedMessages(hash), true); + + vm.expectEmit(true, true, true, true); + + emit RelayedMessage(hash); + + vm.etch(target, address(0).code); + vm.prank(address(sender)); + L1Messenger.relayMessage( + 0, // nonce + sender, + target, + value, + 0, + hex"1111" + ); + + assertEq(address(L1Messenger).balance, 0); + assertEq(address(target).balance, value); + assertEq(L1Messenger.successfulMessages(hash), true); + assertEq(L1Messenger.receivedMessages(hash), true); + } + + // relayMessage: should revert if recipient is trying to reenter + function test_L1MessengerRelayMessageRevertsOnReentrancy() external { + address target = address(0xabcd); + address sender = Predeploys.L2_CROSS_DOMAIN_MESSENGER; + bytes memory message = abi.encodeWithSelector( + L1Messenger.relayMessage.selector, + 0, + sender, + target, + 0, + 0, + hex"1111" + ); + + bytes32 hash = Hashing.hashCrossDomainMessage(0, sender, target, 0, 0, message); + + uint256 senderSlotIndex = 51; + vm.store(address(op), bytes32(senderSlotIndex), bytes32(abi.encode(sender))); + vm.etch(target, address(new CallerCaller()).code); + + vm.expectEmit(true, true, true, true, target); + + emit WhatHappened(false, abi.encodeWithSignature("Error(string)", "ReentrancyGuard: reentrant call")); + + vm.prank(address(op)); + vm.expectCall(target, message); + L1Messenger.relayMessage( + 0, // nonce + sender, + target, + 0, // value + 0, + message + ); + + assertEq(L1Messenger.successfulMessages(hash), false); + assertEq(L1Messenger.receivedMessages(hash), true); + } } diff --git a/packages/contracts-bedrock/contracts/test/L1StandardBridge.t.sol b/packages/contracts-bedrock/contracts/test/L1StandardBridge.t.sol index 95aacbc111a69..d6770799cfa49 100644 --- a/packages/contracts-bedrock/contracts/test/L1StandardBridge.t.sol +++ b/packages/contracts-bedrock/contracts/test/L1StandardBridge.t.sol @@ -1,11 +1,11 @@ -//SPDX-License-Identifier: MIT -pragma solidity 0.8.10; +// SPDX-License-Identifier: MIT +pragma solidity 0.8.15; import { Bridge_Initializer } from "./CommonTest.t.sol"; import { StandardBridge } from "../universal/StandardBridge.sol"; import { L2StandardBridge } from "../L2/L2StandardBridge.sol"; import { CrossDomainMessenger } from "../universal/CrossDomainMessenger.sol"; -import { PredeployAddresses } from "../libraries/PredeployAddresses.sol"; +import { Predeploys } from "../libraries/Predeploys.sol"; import { AddressAliasHelper } from "../vendor/AddressAliasHelper.sol"; import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import { stdStorage, StdStorage } from "forge-std/Test.sol"; @@ -25,12 +25,12 @@ contract L1StandardBridge_Test is Bridge_Initializer { assertEq( address(L1Bridge.otherBridge()), - PredeployAddresses.L2_STANDARD_BRIDGE + Predeploys.L2_STANDARD_BRIDGE ); assertEq( address(L2Bridge), - PredeployAddresses.L2_STANDARD_BRIDGE + Predeploys.L2_STANDARD_BRIDGE ); } @@ -100,7 +100,7 @@ contract L1StandardBridge_Test is Bridge_Initializer { // turn alice into a contract vm.etch(alice, address(L1Token).code); - vm.expectRevert("Account not EOA"); + vm.expectRevert("StandardBridge: function can only be called from an EOA"); vm.prank(alice); L1Bridge.depositETH{ value: 1 }(300, hex""); } @@ -207,7 +207,7 @@ contract L1StandardBridge_Test is Bridge_Initializer { // turn alice into a contract vm.etch(alice, hex"ffff"); - vm.expectRevert("Account not EOA"); + vm.expectRevert("StandardBridge: function can only be called from an EOA"); vm.prank(alice, alice); L1Bridge.depositERC20( address(0), @@ -363,7 +363,7 @@ contract L1StandardBridge_Test is Bridge_Initializer { abi.encode(address(L1Bridge.otherBridge())) ); vm.prank(address(28)); - vm.expectRevert("Could not authenticate bridge message."); + vm.expectRevert("StandardBridge: function can only be called from the other bridge"); L1Bridge.finalizeERC20Withdrawal( address(L1Token), address(L2Token), @@ -381,7 +381,7 @@ contract L1StandardBridge_Test is Bridge_Initializer { abi.encode(address(address(0))) ); vm.prank(address(L1Bridge.messenger())); - vm.expectRevert("Could not authenticate bridge message."); + vm.expectRevert("StandardBridge: function can only be called from the other bridge"); L1Bridge.finalizeERC20Withdrawal( address(L1Token), address(L2Token), @@ -391,4 +391,48 @@ contract L1StandardBridge_Test is Bridge_Initializer { hex"" ); } + + function test_finalizeBridgeERC20FailSendBack() external { + deal(address(BadL1Token), address(L1Bridge), 100, true); + + uint256 slot = stdstore + .target(address(L1Bridge)) + .sig("deposits(address,address)") + .with_key(address(BadL1Token)) + .with_key(address(L2Token)) + .find(); + + // Give the L1 bridge some ERC20 tokens + vm.store(address(L1Bridge), bytes32(slot), bytes32(uint256(100))); + assertEq(L1Bridge.deposits(address(BadL1Token), address(L2Token)), 100); + + vm.expectEmit(true, true, true, true); + + emit ERC20BridgeInitiated( + address(BadL1Token), + address(L2Token), + bob, + alice, + 100, + hex"" + ); + + vm.mockCall( + address(L1Bridge.messenger()), + abi.encodeWithSelector(CrossDomainMessenger.xDomainMessageSender.selector), + abi.encode(address(L1Bridge.otherBridge())) + ); + vm.prank(address(L1Bridge.messenger())); + L1Bridge.finalizeBridgeERC20( + address(BadL1Token), + address(L2Token), + alice, + bob, + 100, + hex"" + ); + + assertEq(BadL1Token.balanceOf(address(L1Bridge)), 100); + assertEq(BadL1Token.balanceOf(address(alice)), 0); + } } diff --git a/packages/contracts-bedrock/contracts/test/L2CrossDomainMessenger.t.sol b/packages/contracts-bedrock/contracts/test/L2CrossDomainMessenger.t.sol index f8381e08b1401..ded2b97f5ea43 100644 --- a/packages/contracts-bedrock/contracts/test/L2CrossDomainMessenger.t.sol +++ b/packages/contracts-bedrock/contracts/test/L2CrossDomainMessenger.t.sol @@ -1,7 +1,7 @@ -//SPDX-License-Identifier: MIT -pragma solidity 0.8.10; +// SPDX-License-Identifier: MIT +pragma solidity 0.8.15; -import { Messenger_Initializer } from "./CommonTest.t.sol"; +import { Messenger_Initializer, Reverter, CallerCaller } from "./CommonTest.t.sol"; import { AddressAliasHelper } from "../vendor/AddressAliasHelper.sol"; import { L2ToL1MessagePasser } from "../L2/L2ToL1MessagePasser.sol"; @@ -90,7 +90,7 @@ contract L2CrossDomainMessenger_Test is Messenger_Initializer { } function test_L2MessengerXDomainSenderReverts() external { - vm.expectRevert("xDomainMessageSender is not set"); + vm.expectRevert("CrossDomainMessenger: xDomainMessageSender is not set"); L2Messenger.xDomainMessageSender(); } @@ -139,20 +139,20 @@ contract L2CrossDomainMessenger_Test is Messenger_Initializer { bytes memory message = hex"1111"; vm.prank(caller); - vm.expectRevert("Message cannot be replayed."); + vm.expectRevert("CrossDomainMessenger: message cannot be replayed"); L1Messenger.relayMessage(0, sender, target, 0, 0, message); } // relayMessage: the xDomainMessageSender is reset to the original value function test_L2MessengerxDomainMessageSenderResets() external { - vm.expectRevert("xDomainMessageSender is not set"); + vm.expectRevert("CrossDomainMessenger: xDomainMessageSender is not set"); L2Messenger.xDomainMessageSender(); address caller = AddressAliasHelper.applyL1ToL2Alias(address(L1Messenger)); vm.prank(caller); L2Messenger.relayMessage(0, address(0), address(0), 0, 0, hex""); - vm.expectRevert("xDomainMessageSender is not set"); + vm.expectRevert("CrossDomainMessenger: xDomainMessageSender is not set"); L2Messenger.xDomainMessageSender(); } @@ -164,4 +164,90 @@ contract L2CrossDomainMessenger_Test is Messenger_Initializer { vm.expectRevert("Pausable: paused"); L2Messenger.relayMessage(0, address(0), address(0), 0, 0, hex""); } + + // relayMessage: should send a successful call to the target contract after the first message + // fails and ETH gets stuck, but the second message succeeds + function test_L2MessengerRelayMessageFirstStuckSecondSucceeds() external { + address target = address(0xabcd); + address sender = address(L1Messenger); + address caller = AddressAliasHelper.applyL1ToL2Alias(address(L1Messenger)); + uint256 value = 100; + + bytes32 hash = Hashing.hashCrossDomainMessage(0, sender, target, value, 0, hex"1111"); + + vm.etch(target, address(new Reverter()).code); + vm.deal(address(caller), value); + vm.prank(caller); + L2Messenger.relayMessage{value: value}( + 0, // nonce + sender, + target, + value, + 0, + hex"1111" + ); + + assertEq(address(L2Messenger).balance, value); + assertEq(address(target).balance, 0); + assertEq(L2Messenger.successfulMessages(hash), false); + assertEq(L2Messenger.receivedMessages(hash), true); + + vm.expectEmit(true, true, true, true); + + emit RelayedMessage(hash); + + vm.etch(target, address(0).code); + vm.prank(address(sender)); + L2Messenger.relayMessage( + 0, // nonce + sender, + target, + value, + 0, + hex"1111" + ); + + assertEq(address(L2Messenger).balance, 0); + assertEq(address(target).balance, value); + assertEq(L2Messenger.successfulMessages(hash), true); + assertEq(L2Messenger.receivedMessages(hash), true); + } + + // relayMessage: should revert if recipient is trying to reenter + function test_L1MessengerRelayMessageRevertsOnReentrancy() external { + address target = address(0xabcd); + address sender = address(L1Messenger); + address caller = AddressAliasHelper.applyL1ToL2Alias(address(L1Messenger)); + bytes memory message = abi.encodeWithSelector( + L2Messenger.relayMessage.selector, + 0, + sender, + target, + 0, + 0, + hex"1111" + ); + + bytes32 hash = Hashing.hashCrossDomainMessage(0, sender, target, 0, 0, message); + + vm.etch(target, address(new CallerCaller()).code); + + vm.expectEmit(true, true, true, true, target); + + emit WhatHappened(false, abi.encodeWithSignature("Error(string)", "ReentrancyGuard: reentrant call")); + + vm.prank(caller); + vm.expectCall(target, message); + L2Messenger.relayMessage( + 0, // nonce + sender, + target, + 0, // value + 0, + message + ); + + assertEq(L2Messenger.successfulMessages(hash), false); + assertEq(L2Messenger.receivedMessages(hash), true); + } } diff --git a/packages/contracts-bedrock/contracts/test/L2OutputOracle.t.sol b/packages/contracts-bedrock/contracts/test/L2OutputOracle.t.sol index 4b1299e61420b..ec86200d7139c 100644 --- a/packages/contracts-bedrock/contracts/test/L2OutputOracle.t.sol +++ b/packages/contracts-bedrock/contracts/test/L2OutputOracle.t.sol @@ -1,13 +1,13 @@ -//SPDX-License-Identifier: MIT -pragma solidity 0.8.10; +// SPDX-License-Identifier: MIT +pragma solidity 0.8.15; import { L2OutputOracle_Initializer, NextImpl } from "./CommonTest.t.sol"; import { L2OutputOracle } from "../L1/L2OutputOracle.sol"; import { Proxy } from "../universal/Proxy.sol"; - +import { Types } from "../libraries/Types.sol"; contract L2OutputOracleTest is L2OutputOracle_Initializer { - bytes32 appendedOutput1 = keccak256(abi.encode(1)); + bytes32 proposedOutput1 = keccak256(abi.encode(1)); function setUp() public override { super.setUp(); @@ -20,10 +20,10 @@ contract L2OutputOracleTest is L2OutputOracle_Initializer { assertEq(oracle.latestBlockNumber(), startingBlockNumber); assertEq(oracle.STARTING_BLOCK_NUMBER(), startingBlockNumber); assertEq(oracle.STARTING_TIMESTAMP(), startingTimestamp); - assertEq(oracle.sequencer(), sequencer); + assertEq(oracle.proposer(), proposer); assertEq(oracle.owner(), owner); - L2OutputOracle.OutputProposal memory proposal = oracle.getL2Output(startingBlockNumber); + Types.OutputProposal memory proposal = oracle.getL2Output(startingBlockNumber); assertEq(proposal.outputRoot, genesisL2Output); assertEq(proposal.timestamp, initL1Time); } @@ -34,29 +34,38 @@ contract L2OutputOracleTest is L2OutputOracle_Initializer { // Test: latestBlockNumber() should return the correct value function test_latestBlockNumber() external { - uint256 appendedNumber = oracle.nextBlockNumber(); + uint256 proposedNumber = oracle.nextBlockNumber(); - // Roll to after the block number we'll append - warpToAppendTime(appendedNumber); - vm.prank(sequencer); - oracle.appendL2Output(appendedOutput1, appendedNumber, 0, 0); - assertEq(oracle.latestBlockNumber(), appendedNumber); + // Roll to after the block number we'll propose + warpToProposeTime(proposedNumber); + vm.prank(proposer); + oracle.proposeL2Output(proposedOutput1, proposedNumber, 0, 0); + assertEq(oracle.latestBlockNumber(), proposedNumber); } // Test: getL2Output() should return the correct value function test_getL2Output() external { uint256 nextBlockNumber = oracle.nextBlockNumber(); - warpToAppendTime(nextBlockNumber); - vm.prank(sequencer); - oracle.appendL2Output(appendedOutput1, nextBlockNumber, 0, 0); + warpToProposeTime(nextBlockNumber); + vm.prank(proposer); + oracle.proposeL2Output(proposedOutput1, nextBlockNumber, 0, 0); + + Types.OutputProposal memory proposal = oracle.getL2Output(nextBlockNumber); + assertEq(proposal.outputRoot, proposedOutput1); + assertEq(proposal.timestamp, block.timestamp); - L2OutputOracle.OutputProposal memory proposal = oracle.getL2Output(nextBlockNumber); - assertEq(proposal.outputRoot, appendedOutput1); + // Handles a block number that is between checkpoints: + proposal = oracle.getL2Output(nextBlockNumber - 1); + assertEq(proposal.outputRoot, proposedOutput1); assertEq(proposal.timestamp, block.timestamp); - L2OutputOracle.OutputProposal memory proposal2 = oracle.getL2Output(0); - assertEq(proposal2.outputRoot, bytes32(0)); - assertEq(proposal2.timestamp, 0); + // The block number is too low: + vm.expectRevert("L2OutputOracle: block number cannot be less than the starting block number."); + oracle.getL2Output(0); + + // The block number is larger than the latest proposed output: + vm.expectRevert("L2OutputOracle: No output found for that block number."); + oracle.getL2Output(nextBlockNumber + 1); } // Test: nextBlockNumber() should return the correct value @@ -71,7 +80,7 @@ contract L2OutputOracleTest is L2OutputOracle_Initializer { function test_computeL2Timestamp() external { // reverts if timestamp is too low vm.expectRevert( - "OutputOracle: Block number must be greater than or equal to the starting block number." + "L2OutputOracle: block number must be greater than or equal to starting block number" ); oracle.computeL2Timestamp(startingBlockNumber - 1); @@ -96,26 +105,26 @@ contract L2OutputOracleTest is L2OutputOracle_Initializer { * Ownership tests * *******************/ - event SequencerChanged(address indexed previousSequencer, address indexed newSequencer); + event ProposerChanged(address indexed previousProposer, address indexed newProposer); - function test_changeSequencer() public { - address newSequencer = address(20); + function test_changeProposer() public { + address newProposer = address(20); vm.expectRevert("Ownable: caller is not the owner"); - oracle.changeSequencer(newSequencer); + oracle.changeProposer(newProposer); vm.startPrank(owner); - vm.expectRevert("OutputOracle: new sequencer is the zero address"); - oracle.changeSequencer(address(0)); + vm.expectRevert("L2OutputOracle: new proposer cannot be the zero address"); + oracle.changeProposer(address(0)); - vm.expectRevert("OutputOracle: sequencer cannot be same as the owner"); - oracle.changeSequencer(owner); + vm.expectRevert("L2OutputOracle: proposer cannot be the same as the owner"); + oracle.changeProposer(owner); - // Double check sequencer has not changed. - assertEq(sequencer, oracle.sequencer()); + // Double check proposer has not changed. + assertEq(proposer, oracle.proposer()); vm.expectEmit(true, true, true, true); - emit SequencerChanged(sequencer, newSequencer); - oracle.changeSequencer(newSequencer); + emit ProposerChanged(proposer, newProposer); + oracle.changeProposer(newProposer); vm.stopPrank(); } @@ -136,89 +145,89 @@ contract L2OutputOracleTest is L2OutputOracle_Initializer { } /***************************** - * Append Tests - Happy Path * + * Propose Tests - Happy Path * *****************************/ - // Test: appendL2Output succeeds when given valid input, and no block hash and number are + // Test: proposeL2Output succeeds when given valid input, and no block hash and number are // specified. - function test_appendingAnotherOutput() public { - bytes32 appendedOutput2 = keccak256(abi.encode(2)); + function test_proposingAnotherOutput() public { + bytes32 proposedOutput2 = keccak256(abi.encode(2)); uint256 nextBlockNumber = oracle.nextBlockNumber(); - warpToAppendTime(nextBlockNumber); - uint256 appendedNumber = oracle.latestBlockNumber(); + warpToProposeTime(nextBlockNumber); + uint256 proposedNumber = oracle.latestBlockNumber(); // Ensure the submissionInterval is enforced - assertEq(nextBlockNumber, appendedNumber + submissionInterval); + assertEq(nextBlockNumber, proposedNumber + submissionInterval); vm.roll(nextBlockNumber + 1); - vm.prank(sequencer); - oracle.appendL2Output(appendedOutput2, nextBlockNumber, 0, 0); + vm.prank(proposer); + oracle.proposeL2Output(proposedOutput2, nextBlockNumber, 0, 0); } - // Test: appendL2Output succeeds when given valid input, and when a block hash and number are + // Test: proposeL2Output succeeds when given valid input, and when a block hash and number are // specified for reorg protection. - function test_appendWithBlockhashAndHeight() external { + function test_proposeWithBlockhashAndHeight() external { // Get the number and hash of a previous block in the chain uint256 prevL1BlockNumber = block.number - 1; bytes32 prevL1BlockHash = blockhash(prevL1BlockNumber); uint256 nextBlockNumber = oracle.nextBlockNumber(); - warpToAppendTime(nextBlockNumber); - vm.prank(sequencer); - oracle.appendL2Output(nonZeroHash, nextBlockNumber, prevL1BlockHash, prevL1BlockNumber); + warpToProposeTime(nextBlockNumber); + vm.prank(proposer); + oracle.proposeL2Output(nonZeroHash, nextBlockNumber, prevL1BlockHash, prevL1BlockNumber); } /*************************** - * Append Tests - Sad Path * + * Propose Tests - Sad Path * ***************************/ - // Test: appendL2Output fails if called by a party that is not the sequencer. - function testCannot_appendOutputIfNotSequencer() external { + // Test: proposeL2Output fails if called by a party that is not the proposer. + function testCannot_proposeL2OutputIfNotProposer() external { uint256 nextBlockNumber = oracle.nextBlockNumber(); - warpToAppendTime(nextBlockNumber); + warpToProposeTime(nextBlockNumber); vm.prank(address(128)); - vm.expectRevert("OutputOracle: caller is not the sequencer"); - oracle.appendL2Output(nonZeroHash, nextBlockNumber, 0, 0); + vm.expectRevert("L2OutputOracle: function can only be called by proposer"); + oracle.proposeL2Output(nonZeroHash, nextBlockNumber, 0, 0); } - // Test: appendL2Output fails given a zero blockhash. - function testCannot_appendEmptyOutput() external { - bytes32 outputToAppend = bytes32(0); + // Test: proposeL2Output fails given a zero blockhash. + function testCannot_proposeEmptyOutput() external { + bytes32 outputToPropose = bytes32(0); uint256 nextBlockNumber = oracle.nextBlockNumber(); - warpToAppendTime(nextBlockNumber); - vm.prank(sequencer); - vm.expectRevert("OutputOracle: Cannot submit empty L2 output."); - oracle.appendL2Output(outputToAppend, nextBlockNumber, 0, 0); + warpToProposeTime(nextBlockNumber); + vm.prank(proposer); + vm.expectRevert("L2OutputOracle: L2 output proposal cannot be the zero hash"); + oracle.proposeL2Output(outputToPropose, nextBlockNumber, 0, 0); } - // Test: appendL2Output fails if the block number doesn't match the next expected number. - function testCannot_appendUnexpectedBlockNumber() external { + // Test: proposeL2Output fails if the block number doesn't match the next expected number. + function testCannot_proposeUnexpectedBlockNumber() external { uint256 nextBlockNumber = oracle.nextBlockNumber(); - warpToAppendTime(nextBlockNumber); - vm.prank(sequencer); - vm.expectRevert("OutputOracle: Block number must be equal to next expected block number."); - oracle.appendL2Output(nonZeroHash, nextBlockNumber - 1, 0, 0); + warpToProposeTime(nextBlockNumber); + vm.prank(proposer); + vm.expectRevert("L2OutputOracle: block number must be equal to next expected block number"); + oracle.proposeL2Output(nonZeroHash, nextBlockNumber - 1, 0, 0); } - // Test: appendL2Output fails if it would have a timestamp in the future. - function testCannot_appendFutureTimetamp() external { + // Test: proposeL2Output fails if it would have a timestamp in the future. + function testCannot_proposeFutureTimetamp() external { uint256 nextBlockNumber = oracle.nextBlockNumber(); uint256 nextTimestamp = oracle.computeL2Timestamp(nextBlockNumber); vm.warp(nextTimestamp); - vm.prank(sequencer); - vm.expectRevert("OutputOracle: Cannot append L2 output in future."); - oracle.appendL2Output(nonZeroHash, nextBlockNumber, 0, 0); + vm.prank(proposer); + vm.expectRevert("L2OutputOracle: cannot propose L2 output in the future"); + oracle.proposeL2Output(nonZeroHash, nextBlockNumber, 0, 0); } - // Test: appendL2Output fails if a non-existent L1 block hash and number are provided for reorg + // Test: proposeL2Output fails if a non-existent L1 block hash and number are provided for reorg // protection. - function testCannot_appendOnWrongFork() external { + function testCannot_proposeOnWrongFork() external { uint256 nextBlockNumber = oracle.nextBlockNumber(); - warpToAppendTime(nextBlockNumber); - vm.prank(sequencer); - vm.expectRevert("OutputOracle: Blockhash does not match the hash at the expected height."); - oracle.appendL2Output( + warpToProposeTime(nextBlockNumber); + vm.prank(proposer); + vm.expectRevert("L2OutputOracle: blockhash does not match the hash at the expected height"); + oracle.proposeL2Output( nonZeroHash, nextBlockNumber, bytes32(uint256(0x01)), @@ -226,9 +235,9 @@ contract L2OutputOracleTest is L2OutputOracle_Initializer { ); } - // Test: appendL2Output fails when given valid input, but the block hash and number do not + // Test: proposeL2Output fails when given valid input, but the block hash and number do not // match. - function testCannot_AppendWithUnmatchedBlockhash() external { + function testCannot_ProposeWithUnmatchedBlockhash() external { // Move ahead to block 100 so that we can reference historical blocks vm.roll(100); @@ -237,38 +246,38 @@ contract L2OutputOracleTest is L2OutputOracle_Initializer { bytes32 l1BlockHash = blockhash(l1BlockNumber); uint256 nextBlockNumber = oracle.nextBlockNumber(); - warpToAppendTime(nextBlockNumber); - vm.prank(sequencer); + warpToProposeTime(nextBlockNumber); + vm.prank(proposer); // This will fail when foundry no longer returns zerod block hashes - vm.expectRevert("OutputOracle: Blockhash does not match the hash at the expected height."); - oracle.appendL2Output(nonZeroHash, nextBlockNumber, l1BlockHash, l1BlockNumber - 1); + vm.expectRevert("L2OutputOracle: blockhash does not match the hash at the expected height"); + oracle.proposeL2Output(nonZeroHash, nextBlockNumber, l1BlockHash, l1BlockNumber - 1); } /***************************** * Delete Tests - Happy Path * *****************************/ - event L2OutputDeleted( + event OutputDeleted( bytes32 indexed l2Output, uint256 indexed l1Timestamp, uint256 indexed l2BlockNumber ); - function test_deleteL2Output() external { - test_appendingAnotherOutput(); + function test_deleteOutput() external { + test_proposingAnotherOutput(); uint256 latestBlockNumber = oracle.latestBlockNumber(); - L2OutputOracle.OutputProposal memory proposalToDelete = oracle.getL2Output( + Types.OutputProposal memory proposalToDelete = oracle.getL2Output( latestBlockNumber ); - L2OutputOracle.OutputProposal memory newLatestOutput = oracle.getL2Output( + Types.OutputProposal memory newLatestOutput = oracle.getL2Output( latestBlockNumber - submissionInterval ); vm.prank(owner); vm.expectEmit(true, true, false, false); - emit L2OutputDeleted( + emit OutputDeleted( proposalToDelete.outputRoot, proposalToDelete.timestamp, latestBlockNumber @@ -279,7 +288,7 @@ contract L2OutputOracleTest is L2OutputOracle_Initializer { uint256 latestBlockNumberAfter = oracle.latestBlockNumber(); assertEq(latestBlockNumber - submissionInterval, latestBlockNumberAfter); - L2OutputOracle.OutputProposal memory proposal = oracle.getL2Output(latestBlockNumberAfter); + Types.OutputProposal memory proposal = oracle.getL2Output(latestBlockNumberAfter); // validate that the new latest output is as expected. assertEq(newLatestOutput.outputRoot, proposal.outputRoot); assertEq(newLatestOutput.timestamp, proposal.timestamp); @@ -291,32 +300,32 @@ contract L2OutputOracleTest is L2OutputOracle_Initializer { function testCannot_deleteL2Output_ifNotOwner() external { uint256 latestBlockNumber = oracle.latestBlockNumber(); - L2OutputOracle.OutputProposal memory proposal = oracle.getL2Output(latestBlockNumber); + Types.OutputProposal memory proposal = oracle.getL2Output(latestBlockNumber); vm.expectRevert("Ownable: caller is not the owner"); oracle.deleteL2Output(proposal); } function testCannot_deleteL2Output_withWrongRoot() external { - test_appendingAnotherOutput(); + test_proposingAnotherOutput(); uint256 previousBlockNumber = oracle.latestBlockNumber() - submissionInterval; - L2OutputOracle.OutputProposal memory proposalToDelete = oracle.getL2Output( + Types.OutputProposal memory proposalToDelete = oracle.getL2Output( previousBlockNumber ); vm.prank(owner); vm.expectRevert( - "OutputOracle: The output root to delete does not match the latest output proposal." + "L2OutputOracle: output root to delete does not match the latest output proposal" ); oracle.deleteL2Output(proposalToDelete); } function testCannot_deleteL2Output_withWrongTime() external { - test_appendingAnotherOutput(); + test_proposingAnotherOutput(); uint256 latestBlockNumber = oracle.latestBlockNumber(); - L2OutputOracle.OutputProposal memory proposalToDelete = oracle.getL2Output( + Types.OutputProposal memory proposalToDelete = oracle.getL2Output( latestBlockNumber ); @@ -324,7 +333,7 @@ contract L2OutputOracleTest is L2OutputOracle_Initializer { proposalToDelete.timestamp -= 1; vm.prank(owner); vm.expectRevert( - "OutputOracle: The timestamp to delete does not match the latest output proposal." + "L2OutputOracle: timestamp to delete does not match the latest output proposal" ); oracle.deleteL2Output(proposalToDelete); } @@ -345,13 +354,13 @@ contract L2OutputOracleUpgradeable_Test is L2OutputOracle_Initializer { assertEq(startingTimestamp, oracleImpl.STARTING_TIMESTAMP()); assertEq(l2BlockTime, oracleImpl.L2_BLOCK_TIME()); - L2OutputOracle.OutputProposal memory initOutput = oracleImpl.getL2Output( + Types.OutputProposal memory initOutput = oracleImpl.getL2Output( startingBlockNumber ); assertEq(genesisL2Output, initOutput.outputRoot); assertEq(initL1Time, initOutput.timestamp); - assertEq(sequencer, oracleImpl.sequencer()); + assertEq(proposer, oracleImpl.proposer()); assertEq(owner, oracleImpl.owner()); } @@ -360,7 +369,7 @@ contract L2OutputOracleUpgradeable_Test is L2OutputOracle_Initializer { L2OutputOracle(payable(proxy)).initialize( genesisL2Output, startingBlockNumber, - sequencer, + proposer, owner ); } @@ -370,7 +379,7 @@ contract L2OutputOracleUpgradeable_Test is L2OutputOracle_Initializer { L2OutputOracle(oracleImpl).initialize( genesisL2Output, startingBlockNumber, - sequencer, + proposer, owner ); } diff --git a/packages/contracts-bedrock/contracts/test/L2StandardBridge.t.sol b/packages/contracts-bedrock/contracts/test/L2StandardBridge.t.sol index 1ceddd72df223..ce11faa39ef72 100644 --- a/packages/contracts-bedrock/contracts/test/L2StandardBridge.t.sol +++ b/packages/contracts-bedrock/contracts/test/L2StandardBridge.t.sol @@ -1,10 +1,10 @@ -//SPDX-License-Identifier: MIT -pragma solidity 0.8.10; +// SPDX-License-Identifier: MIT +pragma solidity 0.8.15; import { Bridge_Initializer } from "./CommonTest.t.sol"; import { stdStorage, StdStorage } from "forge-std/Test.sol"; import { CrossDomainMessenger } from "../universal/CrossDomainMessenger.sol"; -import { PredeployAddresses } from "../libraries/PredeployAddresses.sol"; +import { Predeploys } from "../libraries/Predeploys.sol"; import { console } from "forge-std/console.sol"; contract L2StandardBridge_Test is Bridge_Initializer { @@ -50,10 +50,10 @@ contract L2StandardBridge_Test is Bridge_Initializer { function test_cannotWithdrawEthWithoutSendingIt() external { assertEq(address(messagePasser).balance, 0); - vm.expectRevert("ETH withdrawals must include sufficient ETH value."); + vm.expectRevert("L2StandardBridge: ETH withdrawals must include sufficient ETH value"); vm.prank(alice, alice); L2Bridge.withdraw( - address(PredeployAddresses.LEGACY_ERC20_ETH), + address(Predeploys.LEGACY_ERC20_ETH), 100, 1000, hex"" @@ -86,7 +86,7 @@ contract L2StandardBridge_Test is Bridge_Initializer { // This contract has 100 L2Token deal(address(L2Token), address(this), 100, true); - vm.expectRevert("Account not EOA"); + vm.expectRevert("StandardBridge: function can only be called from an EOA"); L2Bridge.withdraw( address(L2Token), 100, @@ -197,5 +197,48 @@ contract L2StandardBridge_Test is Bridge_Initializer { vm.prank(address(L2Messenger)); L2Bridge.finalizeDeposit(address(L1Token), address(L2Bridge), alice, bob, 100, hex""); } -} + function test_finalizeBridgeERC20FailSendBack() external { + deal(address(BadL2Token), address(L2Bridge), 100, true); + + uint256 slot = stdstore + .target(address(L2Bridge)) + .sig("deposits(address,address)") + .with_key(address(BadL2Token)) + .with_key(address(L1Token)) + .find(); + + // Give the L2 bridge some ERC20 tokens + vm.store(address(L2Bridge), bytes32(slot), bytes32(uint256(100))); + assertEq(L2Bridge.deposits(address(BadL2Token), address(L1Token)), 100); + + vm.expectEmit(true, true, true, true); + + emit ERC20BridgeInitiated( + address(BadL2Token), + address(L1Token), + bob, + alice, + 100, + hex"" + ); + + vm.mockCall( + address(L2Bridge.messenger()), + abi.encodeWithSelector(CrossDomainMessenger.xDomainMessageSender.selector), + abi.encode(address(L2Bridge.otherBridge())) + ); + vm.prank(address(L2Bridge.messenger())); + L2Bridge.finalizeBridgeERC20( + address(BadL2Token), + address(L1Token), + alice, + bob, + 100, + hex"" + ); + + assertEq(BadL2Token.balanceOf(address(L2Bridge)), 100); + assertEq(BadL2Token.balanceOf(address(alice)), 0); + } +} diff --git a/packages/contracts-bedrock/contracts/test/L2ToL1MessagePasser.t.sol b/packages/contracts-bedrock/contracts/test/L2ToL1MessagePasser.t.sol index f1147277e09b1..2b6422bd16bcf 100644 --- a/packages/contracts-bedrock/contracts/test/L2ToL1MessagePasser.t.sol +++ b/packages/contracts-bedrock/contracts/test/L2ToL1MessagePasser.t.sol @@ -1,8 +1,9 @@ -//SPDX-License-Identifier: MIT -pragma solidity 0.8.10; +// SPDX-License-Identifier: MIT +pragma solidity 0.8.15; import { CommonTest } from "./CommonTest.t.sol"; import { L2ToL1MessagePasser } from "../L2/L2ToL1MessagePasser.sol"; +import { Types } from "../libraries/Types.sol"; import { Hashing } from "../libraries/Hashing.sol"; contract L2ToL1MessagePasserTest is CommonTest { @@ -65,12 +66,14 @@ contract L2ToL1MessagePasserTest is CommonTest { ); bytes32 withdrawalHash = Hashing.hashWithdrawal( - nonce, - alice, - target, - value, - gasLimit, - data + Types.WithdrawalTransaction( + nonce, + alice, + target, + value, + gasLimit, + data + ) ); messagePasser.initiateWithdrawal{ value: value }( diff --git a/packages/contracts-bedrock/contracts/test/LegacyERC20ETH.t.sol b/packages/contracts-bedrock/contracts/test/LegacyERC20ETH.t.sol index bf82e666a62e0..0fb84a028fa07 100644 --- a/packages/contracts-bedrock/contracts/test/LegacyERC20ETH.t.sol +++ b/packages/contracts-bedrock/contracts/test/LegacyERC20ETH.t.sol @@ -1,9 +1,9 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity 0.8.15; import { CommonTest } from "./CommonTest.t.sol"; import { LegacyERC20ETH } from "../legacy/LegacyERC20ETH.sol"; -import { PredeployAddresses } from "../libraries/PredeployAddresses.sol"; +import { Predeploys } from "../libraries/Predeploys.sol"; contract LegacyERC20ETH_Test is CommonTest { LegacyERC20ETH eth; @@ -19,7 +19,7 @@ contract LegacyERC20ETH_Test is CommonTest { } function test_crossDomain() external { - assertEq(eth.l2Bridge(), PredeployAddresses.L2_STANDARD_BRIDGE); + assertEq(eth.l2Bridge(), Predeploys.L2_STANDARD_BRIDGE); assertEq(eth.l1Token(), address(0)); } diff --git a/packages/contracts-bedrock/contracts/test/OptimismMintableERC20.t.sol b/packages/contracts-bedrock/contracts/test/OptimismMintableERC20.t.sol index 0b77bd7688f90..77877ebb49fb5 100644 --- a/packages/contracts-bedrock/contracts/test/OptimismMintableERC20.t.sol +++ b/packages/contracts-bedrock/contracts/test/OptimismMintableERC20.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.10; +pragma solidity 0.8.15; import { Bridge_Initializer } from "./CommonTest.t.sol"; import "../universal/SupportedInterfaces.sol"; diff --git a/packages/contracts-bedrock/contracts/test/OptimismMintableERC20Factory.t.sol b/packages/contracts-bedrock/contracts/test/OptimismMintableERC20Factory.t.sol index 728df977781a9..9148a03c0e6c8 100644 --- a/packages/contracts-bedrock/contracts/test/OptimismMintableERC20Factory.t.sol +++ b/packages/contracts-bedrock/contracts/test/OptimismMintableERC20Factory.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.10; +pragma solidity 0.8.15; import { Bridge_Initializer } from "./CommonTest.t.sol"; import { LibRLP } from "./RLP.t.sol"; @@ -22,7 +22,7 @@ contract OptimismMintableTokenFactory_Test is Bridge_Initializer { function test_createStandardL2Token() external { address remote = address(4); - address local = LibRLP.computeAddress(address(L2TokenFactory), 1); + address local = LibRLP.computeAddress(address(L2TokenFactory), 2); vm.expectEmit(true, true, true, true); emit StandardL2TokenCreated( @@ -47,7 +47,7 @@ contract OptimismMintableTokenFactory_Test is Bridge_Initializer { vm.prank(alice); L2TokenFactory.createStandardL2Token(remote, "Beep", "BOOP"); - address local = LibRLP.computeAddress(address(L2TokenFactory), 2); + address local = LibRLP.computeAddress(address(L2TokenFactory), 3); vm.expectEmit(true, true, true, true); emit StandardL2TokenCreated( diff --git a/packages/contracts-bedrock/contracts/test/OptimismPortal.t.sol b/packages/contracts-bedrock/contracts/test/OptimismPortal.t.sol index bdb85b4e46718..89da96bfaa4ba 100644 --- a/packages/contracts-bedrock/contracts/test/OptimismPortal.t.sol +++ b/packages/contracts-bedrock/contracts/test/OptimismPortal.t.sol @@ -1,24 +1,15 @@ -//SPDX-License-Identifier: MIT -pragma solidity 0.8.10; +// SPDX-License-Identifier: MIT +pragma solidity 0.8.15; import { Portal_Initializer, CommonTest, NextImpl } from "./CommonTest.t.sol"; - import { AddressAliasHelper } from "../vendor/AddressAliasHelper.sol"; import { L2OutputOracle } from "../L1/L2OutputOracle.sol"; import { OptimismPortal } from "../L1/OptimismPortal.sol"; +import { Types } from "../libraries/Types.sol"; import { Hashing } from "../libraries/Hashing.sol"; import { Proxy } from "../universal/Proxy.sol"; contract OptimismPortal_Test is Portal_Initializer { - event TransactionDeposited( - address indexed from, - address indexed to, - uint256 mint, - uint256 value, - uint64 gasLimit, - bool isCreation, - bytes data - ); function test_OptimismPortalConstructor() external { assertEq(op.FINALIZATION_PERIOD_SECONDS(), 7 days); @@ -28,7 +19,7 @@ contract OptimismPortal_Test is Portal_Initializer { function test_OptimismPortalReceiveEth() external { vm.expectEmit(true, true, false, true); - emit TransactionDeposited(alice, alice, 100, 100, 100_000, false, hex""); + emitTransactionDeposited(alice, alice, 100, 100, 100_000, false, hex""); // give alice money and send as an eoa vm.deal(alice, 2**64); @@ -39,8 +30,6 @@ contract OptimismPortal_Test is Portal_Initializer { assertEq(address(op).balance, 100); } - // function test_OptimismPortalDepositTransaction() external {} - // Test: depositTransaction fails when contract creation has a non-zero destination address function test_OptimismPortalContractCreationReverts() external { // contract creation must have a target of address(0) @@ -53,7 +42,7 @@ contract OptimismPortal_Test is Portal_Initializer { // EOA emulation vm.prank(address(this), address(this)); vm.expectEmit(true, true, false, true); - emit TransactionDeposited( + emitTransactionDeposited( address(this), NON_ZERO_ADDRESS, ZERO_VALUE, @@ -75,7 +64,7 @@ contract OptimismPortal_Test is Portal_Initializer { // Test: depositTransaction should emit the correct log when a contract deposits a tx with 0 value function test_depositTransaction_NoValueContract() external { vm.expectEmit(true, true, false, true); - emit TransactionDeposited( + emitTransactionDeposited( AddressAliasHelper.applyL1ToL2Alias(address(this)), NON_ZERO_ADDRESS, ZERO_VALUE, @@ -100,7 +89,7 @@ contract OptimismPortal_Test is Portal_Initializer { vm.prank(address(this), address(this)); vm.expectEmit(true, true, false, true); - emit TransactionDeposited( + emitTransactionDeposited( address(this), ZERO_ADDRESS, ZERO_VALUE, @@ -116,7 +105,7 @@ contract OptimismPortal_Test is Portal_Initializer { // Test: depositTransaction should emit the correct log when a contract deposits a contract creation with 0 value function test_depositTransaction_createWithZeroValueForContract() external { vm.expectEmit(true, true, false, true); - emit TransactionDeposited( + emitTransactionDeposited( AddressAliasHelper.applyL1ToL2Alias(address(this)), ZERO_ADDRESS, ZERO_VALUE, @@ -135,7 +124,7 @@ contract OptimismPortal_Test is Portal_Initializer { vm.prank(address(this), address(this)); vm.expectEmit(true, true, false, true); - emit TransactionDeposited( + emitTransactionDeposited( address(this), NON_ZERO_ADDRESS, NON_ZERO_VALUE, @@ -158,7 +147,7 @@ contract OptimismPortal_Test is Portal_Initializer { // Test: depositTransaction should increase its eth balance when a contract deposits a transaction with ETH function test_depositTransaction_withEthValueFromContract() external { vm.expectEmit(true, true, false, true); - emit TransactionDeposited( + emitTransactionDeposited( AddressAliasHelper.applyL1ToL2Alias(address(this)), NON_ZERO_ADDRESS, NON_ZERO_VALUE, @@ -183,7 +172,7 @@ contract OptimismPortal_Test is Portal_Initializer { vm.prank(address(this), address(this)); vm.expectEmit(true, true, false, true); - emit TransactionDeposited( + emitTransactionDeposited( address(this), ZERO_ADDRESS, NON_ZERO_VALUE, @@ -206,7 +195,7 @@ contract OptimismPortal_Test is Portal_Initializer { // Test: depositTransaction should increase its eth balance when a contract deposits a contract creation with ETH function test_depositTransaction_withEthValueAndContractContractCreation() external { vm.expectEmit(true, true, false, true); - emit TransactionDeposited( + emitTransactionDeposited( AddressAliasHelper.applyL1ToL2Alias(address(this)), ZERO_ADDRESS, NON_ZERO_VALUE, @@ -226,24 +215,34 @@ contract OptimismPortal_Test is Portal_Initializer { assertEq(address(op).balance, NON_ZERO_VALUE); } - // TODO: test this deeply - // function test_verifyWithdrawal() external {} - function test_cannotVerifyRecentWithdrawal() external { - Hashing.OutputRootProof memory outputRootProof = Hashing + Types.OutputRootProof memory outputRootProof = Types .OutputRootProof({ version: bytes32(0), stateRoot: bytes32(0), withdrawerStorageRoot: bytes32(0), latestBlockhash: bytes32(0) }); + // Setup the Oracle to return an output with a recent timestamp + uint256 recentTimestamp = block.timestamp - 1000; + vm.mockCall( + address(op.L2_ORACLE()), + abi.encodeWithSelector(L2OutputOracle.getL2Output.selector), + abi.encode(Types.OutputProposal(bytes32(uint256(1)), recentTimestamp)) + ); vm.expectRevert("OptimismPortal: proposal is not yet finalized"); - op.finalizeWithdrawalTransaction(0, alice, alice, 0, 0, hex"", 0, outputRootProof, hex""); + op.finalizeWithdrawalTransaction(Types.WithdrawalTransaction(0, alice, alice, 0, 0, hex""), 0, outputRootProof, hex""); } function test_invalidWithdrawalProof() external { - Hashing.OutputRootProof memory outputRootProof = Hashing + vm.mockCall( + address(op.L2_ORACLE()), + abi.encodeWithSelector(L2OutputOracle.getL2Output.selector), + abi.encode(Types.OutputProposal(bytes32(uint256(1)), block.timestamp)) + ); + + Types.OutputRootProof memory outputRootProof = Types .OutputRootProof({ version: bytes32(0), stateRoot: bytes32(0), @@ -252,64 +251,149 @@ contract OptimismPortal_Test is Portal_Initializer { }); vm.warp( - oracle.getL2Output( - oracle.latestBlockNumber() - ).timestamp - + op.FINALIZATION_PERIOD_SECONDS() + oracle.getL2Output(oracle.latestBlockNumber()).timestamp + + op.FINALIZATION_PERIOD_SECONDS() + 1 ); vm.expectRevert("OptimismPortal: invalid output root proof"); - op.finalizeWithdrawalTransaction(0, alice, alice, 0, 0, hex"", 0, outputRootProof, hex""); + op.finalizeWithdrawalTransaction(Types.WithdrawalTransaction(0, alice, alice, 0, 0, hex""), 0, outputRootProof, hex""); } - function test_simple_isOutputFinalized() external { + function test_simple_isBlockFinalized() external { vm.mockCall( address(op.L2_ORACLE()), abi.encodeWithSelector( L2OutputOracle.getL2Output.selector ), abi.encode( - L2OutputOracle.OutputProposal( + Types.OutputProposal( bytes32(uint256(1)), - 0 + startingBlockNumber ) ) ); // warp to the finalization period - vm.warp(op.FINALIZATION_PERIOD_SECONDS()); - assertEq(op.isOutputFinalized(0), false); + vm.warp(startingBlockNumber + op.FINALIZATION_PERIOD_SECONDS()); + assertEq(op.isBlockFinalized(startingBlockNumber), false); // warp past the finalization period - vm.warp(op.FINALIZATION_PERIOD_SECONDS() + 1); - assertEq(op.isOutputFinalized(0), true); + vm.warp(startingBlockNumber + op.FINALIZATION_PERIOD_SECONDS() + 1); + assertEq(op.isBlockFinalized(startingBlockNumber), true); } - function test_isOutputFinalized() external { + function test_isBlockFinalized() external { uint256 checkpoint = oracle.nextBlockNumber(); vm.roll(checkpoint); vm.warp(oracle.computeL2Timestamp(checkpoint) + 1); - vm.prank(oracle.sequencer()); - oracle.appendL2Output(keccak256(abi.encode(2)), checkpoint, 0, 0); + vm.prank(oracle.proposer()); + oracle.proposeL2Output(keccak256(abi.encode(2)), checkpoint, 0, 0); // warp to the final second of the finalization period uint256 finalizationHorizon = block.timestamp + op.FINALIZATION_PERIOD_SECONDS(); vm.warp(finalizationHorizon); // The checkpointed block should not be finalized until 1 second from now. - assertEq(op.isOutputFinalized(checkpoint), false); + assertEq(op.isBlockFinalized(checkpoint), false); // Nor should a block after it - assertEq(op.isOutputFinalized(checkpoint + 1), false); + vm.expectRevert("L2OutputOracle: No output found for that block number."); + assertEq(op.isBlockFinalized(checkpoint + 1), false); // Nor a block before it, even though the finalization period has passed, there is // not yet a checkpoint block on top of it for which that is true. - assertEq(op.isOutputFinalized(checkpoint - 1), false); + assertEq(op.isBlockFinalized(checkpoint - 1), false); // warp past the finalization period vm.warp(finalizationHorizon + 1); // It should now be finalized. - assertEq(op.isOutputFinalized(checkpoint), true); + assertEq(op.isBlockFinalized(checkpoint), true); // So should the block before it. - assertEq(op.isOutputFinalized(checkpoint - 1), true); + assertEq(op.isBlockFinalized(checkpoint - 1), true); // But not the block after it. - assertEq(op.isOutputFinalized(checkpoint + 1), false); + vm.expectRevert("L2OutputOracle: No output found for that block number."); + assertEq(op.isBlockFinalized(checkpoint + 1), false); + } + + function test_finalizeWithdrawalTransaction_differential( + address _sender, + address _target, + uint64 _value, + uint8 _gasLimit, + bytes memory _data + ) external { + // Cannot call the optimism portal + vm.assume(_target != address(op)); + uint256 _nonce = messagePasser.nonce(); + + ( + bytes32 stateRoot, + bytes32 storageRoot, + bytes32 outputRoot, + bytes32 withdrawalHash, + bytes memory withdrawalProof + ) = ffi.getFinalizeWithdrawalTransactionInputs( + _nonce, + _sender, + _target, + _value, + uint256(_gasLimit), + _data + ); + + // Ensure the values returned from ffi are correct + assertEq(outputRoot, Hashing.hashOutputRootProof(Types.OutputRootProof({ + version: bytes32(uint256(0)), + stateRoot: stateRoot, + withdrawerStorageRoot: storageRoot, + latestBlockhash: bytes32(uint256(0)) + }))); + + assertEq(withdrawalHash, Hashing.hashWithdrawal( + Types.WithdrawalTransaction( + _nonce, + _sender, + _target, + _value, + uint64(_gasLimit), + _data + ) + )); + + // Mock the call to the oracle + vm.mockCall( + address(oracle), + abi.encodeWithSelector(oracle.getL2Output.selector), + abi.encode(outputRoot, 0) + ); + + // Start the withdrawal, it must be initiated by the _sender and the + // correct value must be passed along + vm.deal(_sender, _value); + vm.prank(_sender); + messagePasser.initiateWithdrawal{ value: _value }( + _target, + uint256(_gasLimit), + _data + ); + // Ensure that the sentMessages is correct + assertEq(messagePasser.sentMessages(withdrawalHash), true); + + vm.warp(op.FINALIZATION_PERIOD_SECONDS() + 1); + op.finalizeWithdrawalTransaction{ value: _value }( + Types.WithdrawalTransaction( + messagePasser.nonce() - 1, + _sender, + _target, + _value, + uint64(_gasLimit), + _data + ), + 100, // l2BlockNumber + Types.OutputRootProof({ + version: bytes32(uint256(0)), + stateRoot: stateRoot, + withdrawerStorageRoot: storageRoot, + latestBlockhash: bytes32(uint256(0)) + }), + withdrawalProof + ); } } diff --git a/packages/contracts-bedrock/contracts/test/Proxy.t.sol b/packages/contracts-bedrock/contracts/test/Proxy.t.sol index bfccc890f1852..4b72bf957253f 100644 --- a/packages/contracts-bedrock/contracts/test/Proxy.t.sol +++ b/packages/contracts-bedrock/contracts/test/Proxy.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity 0.8.15; import { Test } from "forge-std/Test.sol"; import { Proxy } from "../universal/Proxy.sol"; diff --git a/packages/contracts-bedrock/contracts/test/ProxyAdmin.t.sol b/packages/contracts-bedrock/contracts/test/ProxyAdmin.t.sol index ed41c93a10b14..f061cded10ef6 100644 --- a/packages/contracts-bedrock/contracts/test/ProxyAdmin.t.sol +++ b/packages/contracts-bedrock/contracts/test/ProxyAdmin.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity 0.8.15; import { Test } from "forge-std/Test.sol"; import { Proxy } from "../universal/Proxy.sol"; diff --git a/packages/contracts-bedrock/contracts/test/RLP.t.sol b/packages/contracts-bedrock/contracts/test/RLP.t.sol index 5e8d6fd503ba8..4193624c539c0 100644 --- a/packages/contracts-bedrock/contracts/test/RLP.t.sol +++ b/packages/contracts-bedrock/contracts/test/RLP.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity ^0.8.0; import { Bytes32AddressLib } from "@rari-capital/solmate/src/utils/Bytes32AddressLib.sol"; diff --git a/packages/contracts-bedrock/contracts/test/RLPReader.t.sol b/packages/contracts-bedrock/contracts/test/RLPReader.t.sol index e9d07d8bbea7d..c24f1b19be91a 100644 --- a/packages/contracts-bedrock/contracts/test/RLPReader.t.sol +++ b/packages/contracts-bedrock/contracts/test/RLPReader.t.sol @@ -1,5 +1,5 @@ -// SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +// SPDX-License-Identifier: MIT +pragma solidity 0.8.15; import { RLPReader } from "../libraries/rlp/RLPReader.sol"; import { CommonTest } from "./CommonTest.t.sol"; @@ -18,12 +18,12 @@ contract RLPReader_Test is CommonTest { } function test_readBoolInvalidValue() external { - vm.expectRevert("RLPReader: Invalid RLP boolean value, must be 0 or 1"); + vm.expectRevert("RLPReader: invalid RLP boolean value, must be 0 or 1"); RLPReader.readBool(hex"02"); } function test_readBoolLargeInput() external { - vm.expectRevert("Invalid RLP boolean value."); + vm.expectRevert("RLPReader: invalid RLP boolean value"); RLPReader.readBool(hex"0101"); } @@ -42,12 +42,12 @@ contract RLPReader_Test is CommonTest { } function test_readAddressTooLarge() external { - vm.expectRevert("Invalid RLP address value."); + vm.expectRevert("RLPReader: invalid RLP address value"); RLPReader.readAddress(hex"94121212121212121212121212121212121212121212121212"); } function test_readAddressTooShort() external { - vm.expectRevert("Invalid RLP address value."); + vm.expectRevert("RLPReader: invalid RLP address value"); RLPReader.readAddress(hex"94121212121212121212121212"); } @@ -73,27 +73,27 @@ contract RLPReader_Test is CommonTest { } function test_readBytes_revertListItem() external { - vm.expectRevert("Invalid RLP bytes value."); + vm.expectRevert("RLPReader: invalid RLP bytes value"); RLPReader.readBytes(hex"c7c0c1c0c3c0c1c0"); } function test_readBytes_invalidStringLength() external { - vm.expectRevert("Invalid RLP long string length."); + vm.expectRevert("RLPReader: invalid RLP long string length"); RLPReader.readBytes(hex"b9"); } function test_readBytes_invalidListLength() external { - vm.expectRevert("Invalid RLP long list length."); + vm.expectRevert("RLPReader: invalid RLP long list length"); RLPReader.readBytes(hex"ff"); } function test_readBytes32_revertOnList() external { - vm.expectRevert("Invalid RLP bytes32 value."); + vm.expectRevert("RLPReader: invalid RLP bytes32 value"); RLPReader.readBytes32(hex"c7c0c1c0c3c0c1c0"); } function test_readBytes32_revertOnTooLong() external { - vm.expectRevert("Invalid RLP bytes32 value."); + vm.expectRevert("RLPReader: invalid RLP bytes32 value"); RLPReader.readBytes32(hex"11110000000000000000000000000000000000000000000000000000000000000000"); } @@ -273,62 +273,62 @@ contract RLPReader_Test is CommonTest { } function test_readList_invalidShortList() external { - vm.expectRevert("Invalid RLP short list."); + vm.expectRevert("RLPReader: invalid RLP short list"); RLPReader.readList(hex"efdebd"); } function test_readList_longStringLength() external { - vm.expectRevert("Invalid RLP short list."); + vm.expectRevert("RLPReader: invalid RLP short list"); RLPReader.readList(hex"efb83600"); } function test_readList_notLongEnough() external { - vm.expectRevert("Invalid RLP short list."); + vm.expectRevert("RLPReader: invalid RLP short list"); RLPReader.readList(hex"efdebdaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); } function test_readList_int32Overflow() external { - vm.expectRevert("Invalid RLP long string."); + vm.expectRevert("RLPReader: invalid RLP long string"); RLPReader.readList(hex"bf0f000000000000021111"); } function test_readList_int32Overflow2() external { - vm.expectRevert("Invalid RLP long list."); + vm.expectRevert("RLPReader: invalid RLP long list"); RLPReader.readList(hex"ff0f000000000000021111"); } function test_readList_incorrectLengthInArray() external { - vm.expectRevert("Invalid RLP list value."); + vm.expectRevert("RLPReader: invalid RLP list value"); RLPReader.readList(hex"b9002100dc2b275d0f74e8a53e6f4ec61b27f24278820be3f82ea2110e582081b0565df0"); } function test_readList_leadingZerosInLongLengthArray1() external { - vm.expectRevert("Invalid RLP list value."); + vm.expectRevert("RLPReader: invalid RLP list value"); RLPReader.readList(hex"b90040000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f"); } function test_readList_leadingZerosInLongLengthArray2() external { - vm.expectRevert("Invalid RLP list value."); + vm.expectRevert("RLPReader: invalid RLP list value"); RLPReader.readList(hex"b800"); } function test_readList_leadingZerosInLongLengthList1() external { - vm.expectRevert("Provided RLP list exceeds max list length."); + vm.expectRevert("RLPReader: provided RLP list exceeds max list length"); RLPReader.readList(hex"fb00000040000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f"); } function test_readList_nonOptimalLongLengthArray1() external { - vm.expectRevert("Invalid RLP list value."); + vm.expectRevert("RLPReader: invalid RLP list value"); RLPReader.readList(hex"b81000112233445566778899aabbccddeeff"); } function test_readList_nonOptimalLongLengthArray2() external { - vm.expectRevert("Invalid RLP list value."); + vm.expectRevert("RLPReader: invalid RLP list value"); RLPReader.readList(hex"b801ff"); } function test_readList_invalidValue() external { - vm.expectRevert("Invalid RLP short string."); + vm.expectRevert("RLPReader: invalid RLP short string"); RLPReader.readList(hex"91"); } } diff --git a/packages/contracts-bedrock/contracts/test/RLPWriter.t.sol b/packages/contracts-bedrock/contracts/test/RLPWriter.t.sol index a8f17feacd4f9..426af74b72b71 100644 --- a/packages/contracts-bedrock/contracts/test/RLPWriter.t.sol +++ b/packages/contracts-bedrock/contracts/test/RLPWriter.t.sol @@ -1,5 +1,5 @@ -// SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +// SPDX-License-Identifier: MIT +pragma solidity 0.8.15; import { RLPWriter } from "../libraries/rlp/RLPWriter.sol"; import { CommonTest } from "./CommonTest.t.sol"; diff --git a/packages/contracts-bedrock/contracts/test/ResourceMetering.t.sol b/packages/contracts-bedrock/contracts/test/ResourceMetering.t.sol index e8f9fec319085..1c3bcf5bb3228 100644 --- a/packages/contracts-bedrock/contracts/test/ResourceMetering.t.sol +++ b/packages/contracts-bedrock/contracts/test/ResourceMetering.t.sol @@ -1,5 +1,5 @@ -//SPDX-License-Identifier: MIT -pragma solidity 0.8.10; +// SPDX-License-Identifier: MIT +pragma solidity 0.8.15; import { CommonTest } from "./CommonTest.t.sol"; import { ResourceMetering } from "../L1/ResourceMetering.sol"; @@ -105,7 +105,7 @@ contract ResourceMetering_Test is CommonTest { function test_useMoreThanMaxReverts() external { uint64 target = uint64(uint256(meter.TARGET_RESOURCE_LIMIT())); uint64 elasticity = uint64(uint256(meter.ELASTICITY_MULTIPLIER())); - vm.expectRevert("OptimismPortal: cannot buy more gas than available gas limit"); + vm.expectRevert("ResourceMetering: cannot buy more gas than available gas limit"); meter.use(target * elasticity + 1); } } diff --git a/packages/contracts-bedrock/contracts/test/Semver.t.sol b/packages/contracts-bedrock/contracts/test/Semver.t.sol index a2c38dbda1ca9..c2042a89a9c2c 100644 --- a/packages/contracts-bedrock/contracts/test/Semver.t.sol +++ b/packages/contracts-bedrock/contracts/test/Semver.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity 0.8.15; import { CommonTest } from "./CommonTest.t.sol"; import { Semver } from "../universal/Semver.sol"; @@ -20,36 +20,16 @@ contract Semver_Test is CommonTest { * @notice Deploy a Semver contract */ function setUp() external { - semver = new Semver(7, 8, 9); + semver = new Semver(7, 8, 0); } /** - * @notice Test the getter of the major version + * @notice Test the version getter */ - function test_major() external { + function test_version() external { assertEq( - semver.MAJOR_VERSION(), - 7 - ); - } - - /** - * @notice Test the getter of the minor version - */ - function test_minor() external { - assertEq( - semver.MINOR_VERSION(), - 8 - ); - } - - /** - * @notice Test the getter of the patch version - */ - function test_patch() external { - assertEq( - semver.PATCH_VERSION(), - 9 + semver.version(), + "7.8.0" ); } @@ -64,18 +44,8 @@ contract Semver_Test is CommonTest { proxy.upgradeTo(address(semver)); assertEq( - Semver(address(proxy)).MAJOR_VERSION(), - 7 - ); - - assertEq( - Semver(address(proxy)).MINOR_VERSION(), - 8 - ); - - assertEq( - Semver(address(proxy)).PATCH_VERSION(), - 9 + Semver(address(proxy)).version(), + "7.8.0" ); } } diff --git a/packages/contracts-bedrock/contracts/test/SequencerFeeVault.t.sol b/packages/contracts-bedrock/contracts/test/SequencerFeeVault.t.sol index a00b56fcbbf2a..0687ea56200c3 100644 --- a/packages/contracts-bedrock/contracts/test/SequencerFeeVault.t.sol +++ b/packages/contracts-bedrock/contracts/test/SequencerFeeVault.t.sol @@ -1,27 +1,27 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity 0.8.15; import { Bridge_Initializer } from "./CommonTest.t.sol"; import { SequencerFeeVault } from "../L2/SequencerFeeVault.sol"; import { L2StandardBridge } from "../L2/L2StandardBridge.sol"; -import { PredeployAddresses } from "../libraries/PredeployAddresses.sol"; +import { Predeploys } from "../libraries/Predeploys.sol"; contract SequencerFeeVault_Test is Bridge_Initializer { SequencerFeeVault vault = - SequencerFeeVault(payable(PredeployAddresses.SEQUENCER_FEE_WALLET)); + SequencerFeeVault(payable(Predeploys.SEQUENCER_FEE_WALLET)); address constant recipient = address(256); function setUp() public override { super.setUp(); vm.etch( - PredeployAddresses.SEQUENCER_FEE_WALLET, + Predeploys.SEQUENCER_FEE_WALLET, address(new SequencerFeeVault()).code ); vm.store( - PredeployAddresses.SEQUENCER_FEE_WALLET, + Predeploys.SEQUENCER_FEE_WALLET, bytes32(uint256(0)), bytes32(uint256(uint160(recipient))) ); @@ -61,7 +61,7 @@ contract SequencerFeeVault_Test is Bridge_Initializer { assert(address(vault).balance < vault.MIN_WITHDRAWAL_AMOUNT()); vm.expectRevert( - "OVM_SequencerFeeVault: withdrawal amount must be greater than minimum withdrawal amount" + "SequencerFeeVault: withdrawal amount must be greater than minimum withdrawal amount" ); vault.withdraw(); } @@ -70,10 +70,10 @@ contract SequencerFeeVault_Test is Bridge_Initializer { vm.deal(address(vault), vault.MIN_WITHDRAWAL_AMOUNT() + 1); vm.expectCall( - PredeployAddresses.L2_STANDARD_BRIDGE, + Predeploys.L2_STANDARD_BRIDGE, abi.encodeWithSelector( L2StandardBridge.withdrawTo.selector, - PredeployAddresses.LEGACY_ERC20_ETH, + Predeploys.LEGACY_ERC20_ETH, vault.l1FeeWallet(), address(vault).balance, 0, diff --git a/packages/contracts-bedrock/contracts/universal/CrossDomainMessenger.sol b/packages/contracts-bedrock/contracts/universal/CrossDomainMessenger.sol index 7674779e0a005..ec84bbd6984bc 100644 --- a/packages/contracts-bedrock/contracts/universal/CrossDomainMessenger.sol +++ b/packages/contracts-bedrock/contracts/universal/CrossDomainMessenger.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity 0.8.15; import { OwnableUpgradeable @@ -27,37 +27,6 @@ abstract contract CrossDomainMessenger is PausableUpgradeable, ReentrancyGuardUpgradeable { - /** - * @notice Emitted whenever a message is sent to the other chain. - * - * @param target Address of the recipient of the message. - * @param sender Address of the sender of the message. - * @param message Message to trigger the recipient address with. - * @param messageNonce Unique nonce attached to the message. - * @param gasLimit Minimum gas limit that the message can be executed with. - */ - event SentMessage( - address indexed target, - address sender, - bytes message, - uint256 messageNonce, - uint256 gasLimit - ); - - /** - * @notice Emitted whenever a message is successfully relayed on this chain. - * - * @param msgHash Hash of the message that was relayed. - */ - event RelayedMessage(bytes32 indexed msgHash); - - /** - * @notice Emitted whenever a message fails to be relayed on this chain. - * - * @param msgHash Hash of the message that failed to be relayed. - */ - event FailedRelayedMessage(bytes32 indexed msgHash); - /** * @notice Current message version identifier. */ @@ -146,65 +115,59 @@ abstract contract CrossDomainMessenger is mapping(address => bool) public blockedSystemAddresses; /** - * @notice Allows the owner of this contract to temporarily pause message relaying. Backup - * security mechanism just in case. Owner should be the same as the upgrade wallet to - * maintain the security model of the system as a whole. + * @notice Emitted whenever a message is sent to the other chain. + * + * @param target Address of the recipient of the message. + * @param sender Address of the sender of the message. + * @param message Message to trigger the recipient address with. + * @param messageNonce Unique nonce attached to the message. + * @param gasLimit Minimum gas limit that the message can be executed with. */ - function pause() external onlyOwner { - _pause(); - } + event SentMessage( + address indexed target, + address sender, + bytes message, + uint256 messageNonce, + uint256 gasLimit + ); /** - * @notice Allows the owner of this contract to resume message relaying once paused. + * @notice Additional event data to emit, required as of Bedrock. Cannot be merged with the + * SentMessage event without breaking the ABI of this contract, this is good enough. + * + * @param sender Address of the sender of the message. + * @param value ETH value sent along with the message to the recipient. */ - function unpause() external onlyOwner { - _unpause(); - } + event SentMessageExtension1(address indexed sender, uint256 value); /** - * @notice Retrieves the address of the contract or wallet that initiated the currently - * executing message on the other chain. Will throw an error if there is no message - * currently being executed. Allows the recipient of a call to see who triggered it. + * @notice Emitted whenever a message is successfully relayed on this chain. * - * @return Address of the sender of the currently executing message on the other chain. + * @param msgHash Hash of the message that was relayed. */ - function xDomainMessageSender() external view returns (address) { - require(xDomainMsgSender != DEFAULT_XDOMAIN_SENDER, "xDomainMessageSender is not set"); - - return xDomainMsgSender; - } + event RelayedMessage(bytes32 indexed msgHash); /** - * @notice Retrieves the next message nonce. Message version will be added to the upper two - * bytes of the message nonce. Message version allows us to treat messages as having - * different structures. + * @notice Emitted whenever a message fails to be relayed on this chain. * - * @return Nonce of the next message to be sent, with added message version. + * @param msgHash Hash of the message that failed to be relayed. */ - function messageNonce() public view returns (uint256) { - return Encoding.encodeVersionedNonce(msgNonce, MESSAGE_VERSION); + event FailedRelayedMessage(bytes32 indexed msgHash); + + /** + * @notice Allows the owner of this contract to temporarily pause message relaying. Backup + * security mechanism just in case. Owner should be the same as the upgrade wallet to + * maintain the security model of the system as a whole. + */ + function pause() external onlyOwner { + _pause(); } /** - * @notice Computes the amount of gas required to guarantee that a given message will be - * received on the other chain without running out of gas. Guaranteeing that a message - * will not run out of gas is important because this ensures that a message can always - * be replayed on the other chain if it fails to execute completely. - * - * @param _message Message to compute the amount of required gas for. - * @param _minGasLimit Minimum desired gas limit when message goes to target. - * - * @return Amount of gas required to guarantee message receipt. + * @notice Allows the owner of this contract to resume message relaying once paused. */ - function baseGas(bytes memory _message, uint32 _minGasLimit) public pure returns (uint32) { - return - // Dynamic overhead - ((_minGasLimit * MIN_GAS_DYNAMIC_OVERHEAD_NUMERATOR) / - MIN_GAS_DYNAMIC_OVERHEAD_DENOMINATOR) + - // Calldata overhead - (uint32(_message.length) * MIN_GAS_CALLDATA_OVERHEAD) + - // Constant overhead - MIN_GAS_CONSTANT_OVERHEAD; + function unpause() external onlyOwner { + _unpause(); } /** @@ -239,6 +202,7 @@ abstract contract CrossDomainMessenger is ); emit SentMessage(_target, msg.sender, _message, messageNonce(), _minGasLimit); + emit SentMessageExtension1(msg.sender, msg.value); unchecked { ++msgNonce; @@ -276,25 +240,32 @@ abstract contract CrossDomainMessenger is if (_isOtherMessenger()) { // Should never happen. - require(msg.value == _value, "Mismatched message value."); + require(msg.value == _value, "CrossDomainMessenger: mismatched message value"); } else { require( msg.value == 0, - "CrossDomainMessenger: Value must be zero unless message is from a system address." + "CrossDomainMessenger: value must be zero unless message is from a system address" + ); + + require( + receivedMessages[versionedHash], + "CrossDomainMessenger: message cannot be replayed" ); - require(receivedMessages[versionedHash], "Message cannot be replayed."); } require( blockedSystemAddresses[_target] == false, - "Cannot send message to blocked system address." + "CrossDomainMessenger: cannot send message to blocked system address" ); - require(successfulMessages[versionedHash] == false, "Message has already been relayed."); + require( + successfulMessages[versionedHash] == false, + "CrossDomainMessenger: message has already been relayed" + ); require( gasleft() >= _minGasLimit + RELAY_GAS_REQUIRED, - "Insufficient gas to relay message." + "CrossDomainMessenger: insufficient gas to relay message" ); xDomainMsgSender = _sender; @@ -316,6 +287,55 @@ abstract contract CrossDomainMessenger is } } + /** + * @notice Retrieves the address of the contract or wallet that initiated the currently + * executing message on the other chain. Will throw an error if there is no message + * currently being executed. Allows the recipient of a call to see who triggered it. + * + * @return Address of the sender of the currently executing message on the other chain. + */ + function xDomainMessageSender() external view returns (address) { + require( + xDomainMsgSender != DEFAULT_XDOMAIN_SENDER, + "CrossDomainMessenger: xDomainMessageSender is not set" + ); + + return xDomainMsgSender; + } + + /** + * @notice Retrieves the next message nonce. Message version will be added to the upper two + * bytes of the message nonce. Message version allows us to treat messages as having + * different structures. + * + * @return Nonce of the next message to be sent, with added message version. + */ + function messageNonce() public view returns (uint256) { + return Encoding.encodeVersionedNonce(msgNonce, MESSAGE_VERSION); + } + + /** + * @notice Computes the amount of gas required to guarantee that a given message will be + * received on the other chain without running out of gas. Guaranteeing that a message + * will not run out of gas is important because this ensures that a message can always + * be replayed on the other chain if it fails to execute completely. + * + * @param _message Message to compute the amount of required gas for. + * @param _minGasLimit Minimum desired gas limit when message goes to target. + * + * @return Amount of gas required to guarantee message receipt. + */ + function baseGas(bytes calldata _message, uint32 _minGasLimit) public pure returns (uint32) { + return + // Dynamic overhead + ((_minGasLimit * MIN_GAS_DYNAMIC_OVERHEAD_NUMERATOR) / + MIN_GAS_DYNAMIC_OVERHEAD_DENOMINATOR) + + // Calldata overhead + (uint32(_message.length) * MIN_GAS_CALLDATA_OVERHEAD) + + // Constant overhead + MIN_GAS_CONSTANT_OVERHEAD; + } + /** * @notice Intializer. * @@ -344,13 +364,6 @@ abstract contract CrossDomainMessenger is __ReentrancyGuard_init_unchained(); } - /** - * @notice Checks whether the message is coming from the other messenger. Implemented by child - * contracts because the logic for this depends on the network where the messenger is - * being deployed. - */ - function _isOtherMessenger() internal view virtual returns (bool); - /** * @notice Sends a low-level message to the other messenger. Needs to be implemented by child * contracts because the logic for this depends on the network where the messenger is @@ -362,4 +375,11 @@ abstract contract CrossDomainMessenger is uint256 _value, bytes memory _data ) internal virtual; + + /** + * @notice Checks whether the message is coming from the other messenger. Implemented by child + * contracts because the logic for this depends on the network where the messenger is + * being deployed. + */ + function _isOtherMessenger() internal view virtual returns (bool); } diff --git a/packages/contracts-bedrock/contracts/universal/OptimismMintableERC20.sol b/packages/contracts-bedrock/contracts/universal/OptimismMintableERC20.sol index adaf0667a7e63..9ed0edeb20570 100644 --- a/packages/contracts-bedrock/contracts/universal/OptimismMintableERC20.sol +++ b/packages/contracts-bedrock/contracts/universal/OptimismMintableERC20.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity 0.8.15; import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "./SupportedInterfaces.sol"; @@ -13,6 +13,16 @@ import "./SupportedInterfaces.sol"; * meant for use on L2. */ contract OptimismMintableERC20 is ERC20 { + /** + * @notice Address of the corresponding version of this token on the remote chain. + */ + address public remoteToken; + + /** + * @notice Address of the StandardBridge on this network. + */ + address public bridge; + /** * @notice Emitted whenever tokens are minted for an account. * @@ -30,14 +40,12 @@ contract OptimismMintableERC20 is ERC20 { event Burn(address indexed account, uint256 amount); /** - * @notice Address of the corresponding version of this token on the remote chain. - */ - address public remoteToken; - - /** - * @notice Address of the StandardBridge on this network. + * @notice A modifier that only allows the bridge to call */ - address public bridge; + modifier onlyBridge() { + require(msg.sender == bridge, "OptimismMintableERC20: only bridge can mint and burn"); + _; + } /** * @param _bridge Address of the L2 standard bridge. @@ -56,27 +64,25 @@ contract OptimismMintableERC20 is ERC20 { } /** - * @custom:legacy - * @notice Legacy getter for the remote token. Use remoteToken going forward. - */ - function l1Token() public view returns (address) { - return remoteToken; - } - - /** - * @custom:legacy - * @notice Legacy getter for the bridge. Use bridge going forward. + * @notice Allows the StandardBridge on this network to mint tokens. + * + * @param _to Address to mint tokens to. + * @param _amount Amount of tokens to mint. */ - function l2Bridge() public view returns (address) { - return bridge; + function mint(address _to, uint256 _amount) external virtual onlyBridge { + _mint(_to, _amount); + emit Mint(_to, _amount); } /** - * @notice A modifier that only allows the bridge to call + * @notice Allows the StandardBridge on this network to burn tokens. + * + * @param _from Address to burn tokens from. + * @param _amount Amount of tokens to burn. */ - modifier onlyBridge() { - require(msg.sender == bridge, "OptimismMintableERC20: only bridge can mint and burn"); - _; + function burn(address _from, uint256 _amount) external virtual onlyBridge { + _burn(_from, _amount); + emit Burn(_from, _amount); } /** @@ -94,24 +100,18 @@ contract OptimismMintableERC20 is ERC20 { } /** - * @notice Allows the StandardBridge on this network to mint tokens. - * - * @param _to Address to mint tokens to. - * @param _amount Amount of tokens to mint. + * @custom:legacy + * @notice Legacy getter for the remote token. Use remoteToken going forward. */ - function mint(address _to, uint256 _amount) external virtual onlyBridge { - _mint(_to, _amount); - emit Mint(_to, _amount); + function l1Token() public view returns (address) { + return remoteToken; } /** - * @notice Allows the StandardBridge on this network to burn tokens. - * - * @param _from Address to burn tokens from. - * @param _amount Amount of tokens to burn. + * @custom:legacy + * @notice Legacy getter for the bridge. Use bridge going forward. */ - function burn(address _from, uint256 _amount) external virtual onlyBridge { - _burn(_from, _amount); - emit Burn(_from, _amount); + function l2Bridge() public view returns (address) { + return bridge; } } diff --git a/packages/contracts-bedrock/contracts/universal/OptimismMintableERC20Factory.sol b/packages/contracts-bedrock/contracts/universal/OptimismMintableERC20Factory.sol index 4988c36b3b5f3..f9e8b7dc92141 100644 --- a/packages/contracts-bedrock/contracts/universal/OptimismMintableERC20Factory.sol +++ b/packages/contracts-bedrock/contracts/universal/OptimismMintableERC20Factory.sol @@ -1,9 +1,8 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity 0.8.15; /* Contract Imports */ import { OptimismMintableERC20 } from "../universal/OptimismMintableERC20.sol"; -import { PredeployAddresses } from "../libraries/PredeployAddresses.sol"; /** * @custom:proxied @@ -15,6 +14,11 @@ import { PredeployAddresses } from "../libraries/PredeployAddresses.sol"; * compatible with the older StandardL2ERC20Factory contract. */ contract OptimismMintableERC20Factory { + /** + * @notice Address of the StandardBridge on this chain. + */ + address public immutable bridge; + /** * @custom:legacy * @notice Emitted whenever a new OptimismMintableERC20 is created. Legacy version of the newer @@ -38,11 +42,6 @@ contract OptimismMintableERC20Factory { address deployer ); - /** - * @notice Address of the StandardBridge on this chain. - */ - address public immutable bridge; - /** * @param _bridge Address of the StandardBridge on this chain. */ @@ -88,11 +87,6 @@ contract OptimismMintableERC20Factory { "OptimismMintableERC20Factory: must provide remote token address" ); - require( - bridge != address(0), - "OptimismMintableERC20Factory: must initialize contract first" - ); - OptimismMintableERC20 localToken = new OptimismMintableERC20( bridge, _remoteToken, diff --git a/packages/contracts-bedrock/contracts/universal/Proxy.sol b/packages/contracts-bedrock/contracts/universal/Proxy.sol index b3d619447bebd..f2fead040b611 100644 --- a/packages/contracts-bedrock/contracts/universal/Proxy.sol +++ b/packages/contracts-bedrock/contracts/universal/Proxy.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity 0.8.15; /** * @title Proxy @@ -8,6 +8,20 @@ pragma solidity ^0.8.9; * simulation. */ contract Proxy { + /** + * @notice The storage slot that holds the address of the implementation. + * bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1) + */ + bytes32 internal constant IMPLEMENTATION_KEY = + 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; + + /** + * @notice The storage slot that holds the address of the owner. + * bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1) + */ + bytes32 internal constant OWNER_KEY = + 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; + /** * @notice An event that is emitted each time the implementation is changed. This event is part * of the EIP-1967 specification. @@ -26,18 +40,19 @@ contract Proxy { event AdminChanged(address previousAdmin, address newAdmin); /** - * @notice The storage slot that holds the address of the implementation. - * bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1) - */ - bytes32 internal constant IMPLEMENTATION_KEY = - 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; - - /** - * @notice The storage slot that holds the address of the owner. - * bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1) + * @notice A modifier that reverts if not called by the owner or by address(0) to allow + * eth_call to interact with this proxy without needing to use low-level storage + * inspection. We assume that nobody is able to trigger calls from address(0) during + * normal EVM execution. */ - bytes32 internal constant OWNER_KEY = - 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; + modifier proxyCallIfNotAdmin() { + if (msg.sender == _getAdmin() || msg.sender == address(0)) { + _; + } else { + // This WILL halt the call frame on completion. + _doProxyCall(); + } + } /** * @notice Sets the initial admin during contract deployment. Admin address is stored at the @@ -52,32 +67,17 @@ contract Proxy { } // slither-disable-next-line locked-ether - fallback() external payable { + receive() external payable { // Proxy call by default. _doProxyCall(); } // slither-disable-next-line locked-ether - receive() external payable { + fallback() external payable { // Proxy call by default. _doProxyCall(); } - /** - * @notice A modifier that reverts if not called by the owner or by address(0) to allow - * eth_call to interact with this proxy without needing to use low-level storage - * inspection. We assume that nobody is able to trigger calls from address(0) during - * normal EVM execution. - */ - modifier proxyCallIfNotAdmin() { - if (msg.sender == _getAdmin() || msg.sender == address(0)) { - _; - } else { - // This WILL halt the call frame on completion. - _doProxyCall(); - } - } - /** * @notice Set the implementation contract address. The code at the given address will execute * when this contract is called. @@ -146,19 +146,6 @@ contract Proxy { emit Upgraded(_implementation); } - /** - * @notice Queries the implementation address. - * - * @return Implementation address. - */ - function _getImplementation() internal view returns (address) { - address impl; - assembly { - impl := sload(IMPLEMENTATION_KEY) - } - return impl; - } - /** * @notice Changes the owner of the proxy contract. * @@ -172,19 +159,6 @@ contract Proxy { emit AdminChanged(previous, _admin); } - /** - * @notice Queries the owner of the proxy contract. - * - * @return Owner address. - */ - function _getAdmin() internal view returns (address) { - address owner; - assembly { - owner := sload(OWNER_KEY) - } - return owner; - } - /** * @notice Performs the proxy call via a delegatecall. */ @@ -213,4 +187,30 @@ contract Proxy { return(0x0, returndatasize()) } } + + /** + * @notice Queries the implementation address. + * + * @return Implementation address. + */ + function _getImplementation() internal view returns (address) { + address impl; + assembly { + impl := sload(IMPLEMENTATION_KEY) + } + return impl; + } + + /** + * @notice Queries the owner of the proxy contract. + * + * @return Owner address. + */ + function _getAdmin() internal view returns (address) { + address owner; + assembly { + owner := sload(OWNER_KEY) + } + return owner; + } } diff --git a/packages/contracts-bedrock/contracts/universal/ProxyAdmin.sol b/packages/contracts-bedrock/contracts/universal/ProxyAdmin.sol index fe9beca53df7a..48b0b9c20bd23 100644 --- a/packages/contracts-bedrock/contracts/universal/ProxyAdmin.sol +++ b/packages/contracts-bedrock/contracts/universal/ProxyAdmin.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity 0.8.15; import { Owned } from "@rari-capital/solmate/src/auth/Owned.sol"; import { Proxy } from "./Proxy.sol"; @@ -125,24 +125,67 @@ contract ProxyAdmin is Owned { /** * @custom:legacy - * @notice Legacy function used to tell ChugSplashProxy contracts if an upgrade is happening. + * @notice Set the upgrading status for the Chugsplash proxy type. * - * @return Whether or not there is an upgrade going on. May not actually tell you whether an - * upgrade is going on, since we don't currently plan to use this variable for anything - * other than a legacy indicator to fix a UX bug in the ChugSplash proxy. + * @param _upgrading Whether or not the system is upgrading. */ - function isUpgrading() external view returns (bool) { - return upgrading; + function setUpgrading(bool _upgrading) external onlyOwner { + upgrading = _upgrading; + } + + /** + * @notice Updates the admin of the given proxy address. + * + * @param _proxy Address of the proxy to update. + * @param _newAdmin Address of the new proxy admin. + */ + function changeProxyAdmin(address payable _proxy, address _newAdmin) external onlyOwner { + ProxyType ptype = proxyType[_proxy]; + if (ptype == ProxyType.ERC1967) { + Proxy(_proxy).changeAdmin(_newAdmin); + } else if (ptype == ProxyType.CHUGSPLASH) { + L1ChugSplashProxy(_proxy).setOwner(_newAdmin); + } else if (ptype == ProxyType.RESOLVED) { + addressManager.transferOwnership(_newAdmin); + } else { + revert("ProxyAdmin: unknown proxy type"); + } + } + + /** + * @notice Changes a proxy's implementation contract and delegatecalls the new implementation + * with some given data. Useful for atomic upgrade-and-initialize calls. + * + * @param _proxy Address of the proxy to upgrade. + * @param _implementation Address of the new implementation address. + * @param _data Data to trigger the new implementation with. + */ + function upgradeAndCall( + address payable _proxy, + address _implementation, + bytes memory _data + ) external payable onlyOwner { + ProxyType ptype = proxyType[_proxy]; + if (ptype == ProxyType.ERC1967) { + Proxy(_proxy).upgradeToAndCall{ value: msg.value }(_implementation, _data); + } else { + // reverts if proxy type is unknown + upgrade(_proxy, _implementation); + (bool success, ) = _proxy.call{ value: msg.value }(_data); + require(success, "ProxyAdmin: call to proxy after upgrade failed"); + } } /** * @custom:legacy - * @notice Set the upgrading status for the Chugsplash proxy type. + * @notice Legacy function used to tell ChugSplashProxy contracts if an upgrade is happening. * - * @param _upgrading Whether or not the system is upgrading. + * @return Whether or not there is an upgrade going on. May not actually tell you whether an + * upgrade is going on, since we don't currently plan to use this variable for anything + * other than a legacy indicator to fix a UX bug in the ChugSplash proxy. */ - function setUpgrading(bool _upgrading) external onlyOwner { - upgrading = _upgrading; + function isUpgrading() external view returns (bool) { + return upgrading; } /** @@ -185,25 +228,6 @@ contract ProxyAdmin is Owned { } } - /** - * @notice Updates the admin of the given proxy address. - * - * @param _proxy Address of the proxy to update. - * @param _newAdmin Address of the new proxy admin. - */ - function changeProxyAdmin(address payable _proxy, address _newAdmin) external onlyOwner { - ProxyType ptype = proxyType[_proxy]; - if (ptype == ProxyType.ERC1967) { - Proxy(_proxy).changeAdmin(_newAdmin); - } else if (ptype == ProxyType.CHUGSPLASH) { - L1ChugSplashProxy(_proxy).setOwner(_newAdmin); - } else if (ptype == ProxyType.RESOLVED) { - addressManager.transferOwnership(_newAdmin); - } else { - revert("ProxyAdmin: unknown proxy type"); - } - } - /** * @notice Changes a proxy's implementation contract. * @@ -226,28 +250,4 @@ contract ProxyAdmin is Owned { revert("ProxyAdmin: unknown proxy type"); } } - - /** - * @notice Changes a proxy's implementation contract and delegatecalls the new implementation - * with some given data. Useful for atomic upgrade-and-initialize calls. - * - * @param _proxy Address of the proxy to upgrade. - * @param _implementation Address of the new implementation address. - * @param _data Data to trigger the new implementation with. - */ - function upgradeAndCall( - address payable _proxy, - address _implementation, - bytes memory _data - ) external payable onlyOwner { - ProxyType ptype = proxyType[_proxy]; - if (ptype == ProxyType.ERC1967) { - Proxy(_proxy).upgradeToAndCall{ value: msg.value }(_implementation, _data); - } else { - // reverts if proxy type is unknown - upgrade(_proxy, _implementation); - (bool success, ) = _proxy.call{ value: msg.value }(_data); - require(success, "ProxyAdmin: call to proxy after upgrade failed"); - } - } } diff --git a/packages/contracts-bedrock/contracts/universal/Semver.sol b/packages/contracts-bedrock/contracts/universal/Semver.sol index 6a9078d162599..507f4382716b4 100644 --- a/packages/contracts-bedrock/contracts/universal/Semver.sol +++ b/packages/contracts-bedrock/contracts/universal/Semver.sol @@ -1,5 +1,7 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity ^0.8.15; + +import { Strings } from "@openzeppelin/contracts/utils/Strings.sol"; /** * @title Semver @@ -10,19 +12,19 @@ contract Semver { * @notice Contract version number (major). */ // solhint-disable-next-line var-name-mixedcase - uint256 public immutable MAJOR_VERSION; + uint256 private immutable MAJOR_VERSION; /** * @notice Contract version number (minor). */ // solhint-disable-next-line var-name-mixedcase - uint256 public immutable MINOR_VERSION; + uint256 private immutable MINOR_VERSION; /** * @notice Contract version number (patch). */ // solhint-disable-next-line var-name-mixedcase - uint256 public immutable PATCH_VERSION; + uint256 private immutable PATCH_VERSION; /** * @param _major Version number (major). @@ -38,4 +40,22 @@ contract Semver { MINOR_VERSION = _minor; PATCH_VERSION = _patch; } + + /** + * @notice Returns the full semver contract version. + * + * @return Semver contract version as a string. + */ + function version() public view returns (string memory) { + return + string( + abi.encodePacked( + Strings.toString(MAJOR_VERSION), + ".", + Strings.toString(MINOR_VERSION), + ".", + Strings.toString(PATCH_VERSION) + ) + ); + } } diff --git a/packages/contracts-bedrock/contracts/universal/StandardBridge.sol b/packages/contracts-bedrock/contracts/universal/StandardBridge.sol index 6af30a31f7f46..24e3cf8e07f05 100644 --- a/packages/contracts-bedrock/contracts/universal/StandardBridge.sol +++ b/packages/contracts-bedrock/contracts/universal/StandardBridge.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity 0.8.15; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { ERC165Checker } from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol"; @@ -17,6 +17,26 @@ import { OptimismMintableERC20 } from "./OptimismMintableERC20.sol"; abstract contract StandardBridge is Initializable { using SafeERC20 for IERC20; + /** + * @notice The L2 gas limit set when eth is depoisited using the receive() function. + */ + uint32 internal constant RECEIVE_DEFAULT_GAS_LIMIT = 200_000; + + /** + * @notice Messenger contract on this domain. + */ + CrossDomainMessenger public messenger; + + /** + * @notice Corresponding bridge on the other domain. + */ + StandardBridge public otherBridge; + + /** + * @notice Mapping that stores deposits for a given pair of local and remote tokens. + */ + mapping(address => mapping(address => uint256)) public deposits; + /** * @notice Emitted when an ETH bridge is initiated to the other chain. * @@ -104,33 +124,16 @@ abstract contract StandardBridge is Initializable { bytes extraData ); - /** - * @notice The L2 gas limit set when eth is depoisited using the receive() function. - */ - uint32 internal constant RECEIVE_DEFAULT_GAS_LIMIT = 200_000; - - /** - * @notice Messenger contract on this domain. - */ - CrossDomainMessenger public messenger; - - /** - * @notice Corresponding bridge on the other domain. - */ - StandardBridge public otherBridge; - - /** - * @notice Mapping that stores deposits for a given pair of local and remote tokens. - */ - mapping(address => mapping(address => uint256)) public deposits; - /** * @notice Only allow EOAs to call the functions. Note that this is not safe against contracts * calling code within their constructors, but also doesn't really matter since we're * just trying to prevent users accidentally depositing with smart contract wallets. */ modifier onlyEOA() { - require(!Address.isContract(msg.sender), "Account not EOA"); + require( + !Address.isContract(msg.sender), + "StandardBridge: function can only be called from an EOA" + ); _; } @@ -141,7 +144,7 @@ abstract contract StandardBridge is Initializable { require( msg.sender == address(messenger) && messenger.xDomainMessageSender() == address(otherBridge), - "Could not authenticate bridge message." + "StandardBridge: function can only be called from the other bridge" ); _; } @@ -150,7 +153,7 @@ abstract contract StandardBridge is Initializable { * @notice Ensures that the caller is this contract. */ modifier onlySelf() { - require(msg.sender == address(this), "Function can only be called by self."); + require(msg.sender == address(this), "StandardBridge: function can only be called by self"); _; } @@ -277,12 +280,12 @@ abstract contract StandardBridge is Initializable { uint256 _amount, bytes calldata _extraData ) public payable onlyOtherBridge { - require(msg.value == _amount, "Amount sent does not match amount required."); - require(_to != address(this), "Cannot send to self."); + require(msg.value == _amount, "StandardBridge: amount sent does not match amount required"); + require(_to != address(this), "StandardBridge: cannot send to self"); emit ETHBridgeFinalized(_from, _to, _amount, _extraData); (bool success, ) = _to.call{ value: _amount }(new bytes(0)); - require(success, "ETH transfer failed."); + require(success, "StandardBridge: ETH transfer failed"); } /** @@ -312,8 +315,9 @@ abstract contract StandardBridge is Initializable { } catch { // Something went wrong during the bridging process, return to sender. // Can happen if a bridge UI specifies the wrong L2 token. - // We reverse both the local and remote token addresses, as well as the to and from - // addresses. This will preserve the accuracy of accounting based on emitted events. + // We reverse the to and from addresses to make sure the tokens are returned to the + // sender on the other chain and preserve the accuracy of accounting based on emitted + // events. _initiateBridgeERC20Unchecked( _localToken, _remoteToken, @@ -347,12 +351,12 @@ abstract contract StandardBridge is Initializable { ) public onlySelf { // Make sure external function calls can't be used to trigger calls to // completeOutboundTransfer. We only make external (write) calls to _localToken. - require(_localToken != address(this), "Local token cannot be self"); + require(_localToken != address(this), "StandardBridge: local token cannot be self"); if (_isOptimismMintableERC20(_localToken)) { require( _isCorrectTokenPair(_localToken, _remoteToken), - "Wrong remote token for Optimism Mintable ERC20 local token" + "StandardBridge: wrong remote token for Optimism Mintable ERC20 local token" ); OptimismMintableERC20(_localToken).mint(_to, _amount); @@ -433,12 +437,12 @@ abstract contract StandardBridge is Initializable { ) internal { // Make sure external function calls can't be used to trigger calls to // completeOutboundTransfer. We only make external (write) calls to _localToken. - require(_localToken != address(this), "Local token cannot be self"); + require(_localToken != address(this), "StandardBridge: local token cannot be self"); if (_isOptimismMintableERC20(_localToken)) { require( _isCorrectTokenPair(_localToken, _remoteToken), - "Wrong remote token for Optimism Mintable ERC20 local token" + "StandardBridge: wrong remote token for Optimism Mintable ERC20 local token" ); OptimismMintableERC20(_localToken).burn(_from, _amount); diff --git a/packages/contracts-bedrock/contracts/universal/SupportedInterfaces.sol b/packages/contracts-bedrock/contracts/universal/SupportedInterfaces.sol index d1b01e7cc8a17..773de5e9a08bc 100644 --- a/packages/contracts-bedrock/contracts/universal/SupportedInterfaces.sol +++ b/packages/contracts-bedrock/contracts/universal/SupportedInterfaces.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity ^0.8.0; // Import this here to make it available just by importing this file import { IERC165 } from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; diff --git a/packages/contracts-bedrock/contracts/vendor/AddressAliasHelper.sol b/packages/contracts-bedrock/contracts/vendor/AddressAliasHelper.sol index 6a4edefae3e9f..7bcdbb96154c4 100644 --- a/packages/contracts-bedrock/contracts/vendor/AddressAliasHelper.sol +++ b/packages/contracts-bedrock/contracts/vendor/AddressAliasHelper.sol @@ -16,7 +16,7 @@ * limitations under the License. */ -pragma solidity ^0.8.7; +pragma solidity ^0.8.0; library AddressAliasHelper { uint160 constant offset = uint160(0x1111000000000000000000000000000000001111); diff --git a/packages/contracts-bedrock/foundry.toml b/packages/contracts-bedrock/foundry.toml index d640cc7209147..a6ff109d2ba02 100644 --- a/packages/contracts-bedrock/foundry.toml +++ b/packages/contracts-bedrock/foundry.toml @@ -16,3 +16,8 @@ remappings = [ extra_output = ['devdoc', 'userdoc', 'metadata', 'storageLayout'] bytecode_hash = 'none' build_info = true +ffi = true +fuzz_runs = 16 + +[ci] +fuzz_runs = 512 diff --git a/packages/contracts-bedrock/package.json b/packages/contracts-bedrock/package.json index 5a5dcdd17b108..c024452741fe7 100644 --- a/packages/contracts-bedrock/package.json +++ b/packages/contracts-bedrock/package.json @@ -9,17 +9,18 @@ "dist/**/*.js", "dist/**/*.d.ts", "dist/types/*.ts", - "artifacts/src/**/*.json", + "artifacts/contracts/**/*.json", "deployments/**/*.json", "contracts/**/*.sol" ], "scripts": { "build:forge": "forge build", "prebuild": "yarn ts-node scripts/verifyFoundryInstall.ts", - "build": "hardhat compile && yarn build:ts && yarn typechain", + "build": "hardhat compile && yarn autogen:artifacts && yarn build:ts && yarn typechain", "build:ts": "tsc -p tsconfig.json", + "autogen:artifacts": "ts-node scripts/generate-artifacts.ts", "deploy": "hardhat deploy", - "test": "forge test", + "test": "yarn build:ts && forge test", "gas-snapshot": "forge snapshot", "storage-snapshot": "./scripts/storage-snapshot.sh", "slither": "./scripts/slither.sh", @@ -35,6 +36,8 @@ }, "dependencies": { "@eth-optimism/core-utils": "^0.9.1", + "@ethereumjs/trie": "^5.0.0-beta.1", + "@ethereumjs/util": "^8.0.0-beta.1", "@openzeppelin/contracts": "^4.5.0", "@openzeppelin/contracts-upgradeable": "^4.5.2", "@rari-capital/solmate": "https://github.com/rari-capital/solmate.git#8f9b23f8838670afda0fd8983f2c41e8037ae6bc", @@ -43,7 +46,7 @@ "ethereumjs-wallet": "^1.0.2", "ethers": "^5.6.8", "excessively-safe-call": "https://github.com/nomad-xyz/ExcessivelySafeCall.git#4fcdfd3593d21381f696c790fa6180b8ef559c1e", - "forge-std": "https://github.com/foundry-rs/forge-std.git#62caef29b0f87a2c6aaaf634b2ca4c09b6867c92", + "forge-std": "https://github.com/foundry-rs/forge-std.git#f18682b2874fc57d7c80a511fed0b35ec4201ffa", "hardhat": "^2.9.6", "merkle-patricia-tree": "^4.2.4", "rlp": "^2.2.7" @@ -62,6 +65,7 @@ "dotenv": "^16.0.0", "ethereum-waffle": "^3.0.0", "ethers": "^5.6.8", + "glob": "^7.1.6", "hardhat-deploy": "^0.11.4", "solhint": "^3.3.6", "solhint-plugin-prettier": "^0.0.5", diff --git a/packages/contracts-bedrock/scripts/differential-testing.ts b/packages/contracts-bedrock/scripts/differential-testing.ts new file mode 100644 index 0000000000000..5ed83b01a4fa4 --- /dev/null +++ b/packages/contracts-bedrock/scripts/differential-testing.ts @@ -0,0 +1,202 @@ +import { BigNumber, utils, constants } from 'ethers' +import { + decodeVersionedNonce, + hashCrossDomainMessage, + DepositTx, + SourceHashDomain, + encodeCrossDomainMessage, + hashWithdrawal, + hashOutputRootProof, +} from '@eth-optimism/core-utils' +import { SecureTrie } from '@ethereumjs/trie' +import { Account, Address, toBuffer, bufferToHex } from '@ethereumjs/util' + +import { predeploys } from '../src' + +const { hexZeroPad, RLP, keccak256 } = utils + +const args = process.argv.slice(2) +const command = args[0] + +;(async () => { + switch (command) { + case 'decodeVersionedNonce': { + const input = BigNumber.from(args[1]) + const [nonce, version] = decodeVersionedNonce(input) + + const output = utils.defaultAbiCoder.encode( + ['uint256', 'uint256'], + [nonce.toHexString(), version.toHexString()] + ) + process.stdout.write(output) + break + } + case 'encodeCrossDomainMessage': { + const nonce = BigNumber.from(args[1]) + const sender = args[2] + const target = args[3] + const value = BigNumber.from(args[4]) + const gasLimit = BigNumber.from(args[5]) + const data = args[6] + + const encoding = encodeCrossDomainMessage( + nonce, + sender, + target, + value, + gasLimit, + data + ) + + const output = utils.defaultAbiCoder.encode(['bytes'], [encoding]) + process.stdout.write(output) + break + } + case 'hashCrossDomainMessage': { + const nonce = BigNumber.from(args[1]) + const sender = args[2] + const target = args[3] + const value = BigNumber.from(args[4]) + const gasLimit = BigNumber.from(args[5]) + const data = args[6] + + const hash = hashCrossDomainMessage( + nonce, + sender, + target, + value, + gasLimit, + data + ) + const output = utils.defaultAbiCoder.encode(['bytes32'], [hash]) + process.stdout.write(output) + break + } + case 'hashDepositTransaction': { + // The solidity transaction hash computation currently only works with + // user deposits. System deposit transaction hashing is not supported. + const l1BlockHash = args[1] + const logIndex = BigNumber.from(args[2]) + const from = args[3] + const to = args[4] + const mint = BigNumber.from(args[5]) + const value = BigNumber.from(args[6]) + const gas = BigNumber.from(args[7]) + const data = args[8] + + const tx = new DepositTx({ + l1BlockHash, + logIndex, + from, + to, + mint, + value, + gas, + data, + domain: SourceHashDomain.UserDeposit, + }) + + const digest = tx.hash() + const output = utils.defaultAbiCoder.encode(['bytes32'], [digest]) + process.stdout.write(output) + break + } + case 'hashWithdrawal': { + const nonce = BigNumber.from(args[1]) + const sender = args[2] + const target = args[3] + const value = BigNumber.from(args[4]) + const gas = BigNumber.from(args[5]) + const data = args[6] + + const hash = hashWithdrawal(nonce, sender, target, value, gas, data) + const output = utils.defaultAbiCoder.encode(['bytes32'], [hash]) + process.stdout.write(output) + break + } + case 'hashOutputRootProof': { + const version = hexZeroPad(BigNumber.from(args[1]).toHexString(), 32) + const stateRoot = hexZeroPad(BigNumber.from(args[2]).toHexString(), 32) + const withdrawerStorageRoot = hexZeroPad( + BigNumber.from(args[3]).toHexString(), + 32 + ) + const latestBlockhash = hexZeroPad( + BigNumber.from(args[4]).toHexString(), + 32 + ) + + const hash = hashOutputRootProof({ + version, + stateRoot, + withdrawerStorageRoot, + latestBlockhash, + }) + const output = utils.defaultAbiCoder.encode(['bytes32'], [hash]) + process.stdout.write(output) + break + } + case 'getFinalizeWithdrawalTransactionInputs': { + const nonce = BigNumber.from(args[1]) + const sender = args[2] + const target = args[3] + const value = BigNumber.from(args[4]) + const gas = BigNumber.from(args[5]) + const data = args[6] + + // Compute the withdrawalHash + const withdrawalHash = hashWithdrawal( + nonce, + sender, + target, + value, + gas, + data + ) + + // Compute the storage slot the withdrawalHash will be stored in + const slot = utils.defaultAbiCoder.encode( + ['bytes32', 'bytes32'], + [withdrawalHash, utils.hexZeroPad('0x', 32)] + ) + const key = keccak256(slot) + + // Create the account storage trie + const storage = new SecureTrie() + // Put a bool "true" into storage + await storage.put(toBuffer(key), toBuffer('0x01')) + + // Put the storage root into the L2ToL1MessagePasser storage + const address = Address.fromString(predeploys.L2ToL1MessagePasser) + const account = Account.fromAccountData({ + nonce: 0, + balance: 0, + stateRoot: storage.root, + }) + + const world = new SecureTrie() + await world.put(address.toBuffer(), account.serialize()) + + const proof = await SecureTrie.createProof(storage, toBuffer(key)) + + const outputRoot = hashOutputRootProof({ + version: constants.HashZero, + stateRoot: bufferToHex(world.root), + withdrawerStorageRoot: bufferToHex(storage.root), + latestBlockhash: constants.HashZero, + }) + + const encodedProof = RLP.encode(proof) + + const output = utils.defaultAbiCoder.encode( + ['bytes32', 'bytes32', 'bytes32', 'bytes32', 'bytes'], + [world.root, storage.root, outputRoot, withdrawalHash, encodedProof] + ) + process.stdout.write(output) + break + } + } +})().catch((err: Error) => { + console.error(err) + process.stdout.write('') +}) diff --git a/packages/contracts-bedrock/scripts/ffiMakeProof.ts b/packages/contracts-bedrock/scripts/ffiMakeProof.ts deleted file mode 100644 index 0180f82fe3232..0000000000000 --- a/packages/contracts-bedrock/scripts/ffiMakeProof.ts +++ /dev/null @@ -1,18 +0,0 @@ -// Script for generating an inclusion proof for use in testing -// Intended for use with forge test --ffi, accepts abi encoded input and returns -// only the storageTrieWitness. -import { generateMockWithdrawalProof } from '../helpers' - -let args = process.argv.slice(2)[0] - -args = args - .replace('0x', '') - .split('') - .filter((char) => '0123456789abcdef'.includes(char)) - .join('') - -const main = async () => { - const proof = await generateMockWithdrawalProof('0x' + args) - console.log(proof.storageTrieWitness.slice(2)) -} -main() diff --git a/packages/contracts-bedrock/scripts/generate-artifacts.ts b/packages/contracts-bedrock/scripts/generate-artifacts.ts new file mode 100644 index 0000000000000..9fb89b7be4e58 --- /dev/null +++ b/packages/contracts-bedrock/scripts/generate-artifacts.ts @@ -0,0 +1,67 @@ +import path from 'path' +import fs from 'fs' + +import glob from 'glob' + +/** + * Script for automatically generating a file which has a series of `require` statements for + * importing JSON contract artifacts. We do this to preserve browser compatibility. + */ +const main = async () => { + const contractArtifactsFolder = path.resolve( + __dirname, + `../artifacts/contracts` + ) + + const artifactPaths = glob + .sync(`${contractArtifactsFolder}/**/*[!.t].sol/**.json`) + .filter((match) => { + // Filter out the debug outputs. + return !match.endsWith('.dbg.json') + }) + + const content = ` + /* eslint-disable @typescript-eslint/no-var-requires, no-empty */ + /* + THIS FILE IS AUTOMATICALLY GENERATED. + DO NOT EDIT. + */ + + ${artifactPaths + .map((artifactPath) => { + // eslint-disable-next-line @typescript-eslint/no-var-requires + const artifact = require(artifactPath) + // handles the case - '\u' (\utils folder) is considered as an unicode encoded char + const pattern = /\\/g + const relPath = path + .relative(__dirname, artifactPath) + .replace(pattern, '/') + return ` + let ${artifact.contractName} + try { + ${artifact.contractName} = require('${relPath}') + } catch {} + ` + }) + .join('\n')} + + export const getContractArtifact = (name: string): any => { + return { + ${artifactPaths + .map((artifactPath) => { + // eslint-disable-next-line @typescript-eslint/no-var-requires + const artifact = require(artifactPath) + return `${artifact.contractName}` + }) + .join(',\n')} + }[name] + } + ` + + fs.writeFileSync( + path.resolve(__dirname, `../src/contract-artifacts.ts`), + content + ) +} + +main() diff --git a/packages/contracts-bedrock/scripts/makeProof.ts b/packages/contracts-bedrock/scripts/makeProof.ts deleted file mode 100644 index 09989e90aaafe..0000000000000 --- a/packages/contracts-bedrock/scripts/makeProof.ts +++ /dev/null @@ -1,21 +0,0 @@ -// Script for generating an inclusion proof for use in testing. -// Meant for manual usage, ie. -// ts-node scripts/makeProof.ts 1 0x0000000000000000000000000000000000000002 0x0000000000000000000000000000000000000003 4 500000 0x06 -import { generateMockWithdrawalProof } from '../helpers' - -const args = process.argv.slice(2) - -const [nonce, sender, target, value, gasLimit, data] = args - -const main = async () => { - const proof = await generateMockWithdrawalProof({ - nonce: +nonce, - sender, - target, - value: +value, - gasLimit: +gasLimit, - data, - }) - console.log(proof) -} -main() diff --git a/packages/contracts-bedrock/slither.db.json b/packages/contracts-bedrock/slither.db.json index ddd1e749faabc..762c9a83c955a 100644 --- a/packages/contracts-bedrock/slither.db.json +++ b/packages/contracts-bedrock/slither.db.json @@ -1 +1,421 @@ -[{"elements": [{"type": "contract", "name": "DepositFeed", "source_mapping": {"start": 86, "length": 1929, "filename_used": "contracts/L1/DepositFeed.sol", "filename_relative": "contracts/L1/DepositFeed.sol", "filename_absolute": "contracts/L1/DepositFeed.sol", "filename_short": "contracts/L1/DepositFeed.sol", "is_dependency": false, "lines": [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67], "starting_column": 1, "ending_column": 2}}, {"type": "function", "name": "receive", "source_mapping": {"start": 826, "length": 110, "filename_used": "contracts/L1/DepositFeed.sol", "filename_relative": "contracts/L1/DepositFeed.sol", "filename_absolute": "contracts/L1/DepositFeed.sol", "filename_short": "contracts/L1/DepositFeed.sol", "is_dependency": false, "lines": [33, 34, 35], "starting_column": 5, "ending_column": 6}, "type_specific_fields": {"parent": {"type": "contract", "name": "DepositFeed", "source_mapping": {"start": 86, "length": 1929, "filename_used": "contracts/L1/DepositFeed.sol", "filename_relative": "contracts/L1/DepositFeed.sol", "filename_absolute": "contracts/L1/DepositFeed.sol", "filename_short": "contracts/L1/DepositFeed.sol", "is_dependency": false, "lines": [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67], "starting_column": 1, "ending_column": 2}}, "signature": "receive()"}}, {"type": "function", "name": "depositTransaction", "source_mapping": {"start": 1367, "length": 646, "filename_used": "contracts/L1/DepositFeed.sol", "filename_relative": "contracts/L1/DepositFeed.sol", "filename_absolute": "contracts/L1/DepositFeed.sol", "filename_short": "contracts/L1/DepositFeed.sol", "is_dependency": false, "lines": [46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66], "starting_column": 5, "ending_column": 6}, "type_specific_fields": {"parent": {"type": "contract", "name": "DepositFeed", "source_mapping": {"start": 86, "length": 1929, "filename_used": "contracts/L1/DepositFeed.sol", "filename_relative": "contracts/L1/DepositFeed.sol", "filename_absolute": "contracts/L1/DepositFeed.sol", "filename_short": "contracts/L1/DepositFeed.sol", "is_dependency": false, "lines": [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67], "starting_column": 1, "ending_column": 2}}, "signature": "depositTransaction(address,uint256,uint256,bool,bytes)"}}], "description": "Contract locking ether found:\n\tContract DepositFeed (contracts/L1/DepositFeed.sol#7-67) has payable functions:\n\t - DepositFeed.receive() (contracts/L1/DepositFeed.sol#33-35)\n\t - DepositFeed.depositTransaction(address,uint256,uint256,bool,bytes) (contracts/L1/DepositFeed.sol#46-66)\n\tBut does not have a function to withdraw the ether\n", "markdown": "Contract locking ether found:\n\tContract [DepositFeed](contracts/L1/DepositFeed.sol#L7-L67) has payable functions:\n\t - [DepositFeed.receive()](contracts/L1/DepositFeed.sol#L33-L35)\n\t - [DepositFeed.depositTransaction(address,uint256,uint256,bool,bytes)](contracts/L1/DepositFeed.sol#L46-L66)\n\tBut does not have a function to withdraw the ether\n", "first_markdown_element": "contracts/L1/DepositFeed.sol#L7-L67", "id": "288a726f2c33db8578a9b3b43eaabd069d963e2dbe1fb2ae508c861783d169f5", "check": "locked-ether", "impact": "Medium", "confidence": "High"}, {"elements": [{"type": "contract", "name": "DepositFeed", "source_mapping": {"start": 86, "length": 1666, "filename_used": "./contracts/L1/DepositFeed.sol", "filename_relative": "contracts/L1/DepositFeed.sol", "filename_absolute": "./contracts/contracts/L1/DepositFeed.sol", "filename_short": "contracts/L1/DepositFeed.sol", "is_dependency": false, "lines": [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59], "starting_column": 1, "ending_column": 2}}, {"type": "function", "name": "depositTransaction", "source_mapping": {"start": 1102, "length": 648, "filename_used": "./contracts/contracts/L1/DepositFeed.sol", "filename_relative": "contracts/L1/DepositFeed.sol", "filename_absolute": "./contracts/contracts/L1/DepositFeed.sol", "filename_short": "contracts/L1/DepositFeed.sol", "is_dependency": false, "lines": [38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58], "starting_column": 5, "ending_column": 6}, "type_specific_fields": {"parent": {"type": "contract", "name": "DepositFeed", "source_mapping": {"start": 86, "length": 1666, "filename_used": "./contracts/contracts/L1/DepositFeed.sol", "filename_relative": "contracts/L1/DepositFeed.sol", "filename_absolute": "./contracts/contracts/L1/DepositFeed.sol", "filename_short": "contracts/L1/DepositFeed.sol", "is_dependency": false, "lines": [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59], "starting_column": 1, "ending_column": 2}}, "signature": "depositTransaction(address,uint256,uint256,bool,bytes)"}}], "description": "Contract locking ether found:\n\tContract DepositFeed (contracts/L1/DepositFeed.sol#7-59) has payable functions:\n\t - DepositFeed.depositTransaction(address,uint256,uint256,bool,bytes) (contracts/L1/DepositFeed.sol#38-58)\n\tBut does not have a function to withdraw the ether\n", "markdown": "Contract locking ether found:\n\tContract [DepositFeed](contracts/L1/DepositFeed.sol#L7-L59) has payable functions:\n\t - [DepositFeed.depositTransaction(address,uint256,uint256,bool,bytes)](contracts/L1/DepositFeed.sol#L38-L58)\n\tBut does not have a function to withdraw the ether\n", "first_markdown_element": "contracts/L1/DepositFeed.sol#L7-L59", "id": "be013b000d4c176d4d893619bdca725d93e4761e4b2e22fa77a64144e53abb26", "check": "locked-ether", "impact": "Medium", "confidence": "High"}, {"elements": [{"type": "function", "name": "appendL2Output", "source_mapping": {"start": 1769, "length": 422, "filename_used": "./contracts/L1/MockL2OutputOracle.sol", "filename_relative": "contracts/L1/MockL2OutputOracle.sol", "filename_absolute": "./contracts/L1/MockL2OutputOracle.sol", "filename_short": "contracts/L1/MockL2OutputOracle.sol", "is_dependency": false, "lines": [45, 46, 47, 48, 49, 50, 51], "starting_column": 5, "ending_column": 6}, "type_specific_fields": {"parent": {"type": "contract", "name": "MockL2OutputOracle", "source_mapping": {"start": 95, "length": 2773, "filename_used": "./contracts/L1/MockL2OutputOracle.sol", "filename_relative": "contracts/L1/MockL2OutputOracle.sol", "filename_absolute": "./contracts/L1/MockL2OutputOracle.sol", "filename_short": "contracts/L1/MockL2OutputOracle.sol", "is_dependency": false, "lines": [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69], "starting_column": 1, "ending_column": 2}}, "signature": "appendL2Output(bytes32,uint256)"}}, {"type": "node", "name": "require(bool,string)(_timestamp == nextTimestamp(),Timestamp not equal to next expected timestamp)", "source_mapping": {"start": 2010, "length": 88, "filename_used": "./contracts/L1/MockL2OutputOracle.sol", "filename_relative": "contracts/L1/MockL2OutputOracle.sol", "filename_absolute": "./contracts/L1/MockL2OutputOracle.sol", "filename_short": "contracts/L1/MockL2OutputOracle.sol", "is_dependency": false, "lines": [48], "starting_column": 9, "ending_column": 97}, "type_specific_fields": {"parent": {"type": "function", "name": "appendL2Output", "source_mapping": {"start": 1769, "length": 422, "filename_used": "./contracts/L1/MockL2OutputOracle.sol", "filename_relative": "contracts/L1/MockL2OutputOracle.sol", "filename_absolute": "./contracts/L1/MockL2OutputOracle.sol", "filename_short": "contracts/L1/MockL2OutputOracle.sol", "is_dependency": false, "lines": [45, 46, 47, 48, 49, 50, 51], "starting_column": 5, "ending_column": 6}, "type_specific_fields": {"parent": {"type": "contract", "name": "MockL2OutputOracle", "source_mapping": {"start": 95, "length": 2773, "filename_used": "./contracts/L1/MockL2OutputOracle.sol", "filename_relative": "contracts/L1/MockL2OutputOracle.sol", "filename_absolute": "./contracts/L1/MockL2OutputOracle.sol", "filename_short": "contracts/L1/MockL2OutputOracle.sol", "is_dependency": false, "lines": [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69], "starting_column": 1, "ending_column": 2}}, "signature": "appendL2Output(bytes32,uint256)"}}}}], "description": "MockL2OutputOracle.appendL2Output(bytes32,uint256) (contracts/L1/MockL2OutputOracle.sol#45-51) uses a dangerous strict equality:\n\t- require(bool,string)(_timestamp == nextTimestamp(),Timestamp not equal to next expected timestamp) (contracts/L1/MockL2OutputOracle.sol#48)\n", "markdown": "[MockL2OutputOracle.appendL2Output(bytes32,uint256)](contracts/L1/MockL2OutputOracle.sol#L45-L51) uses a dangerous strict equality:\n\t- [require(bool,string)(_timestamp == nextTimestamp(),Timestamp not equal to next expected timestamp)](contracts/L1/MockL2OutputOracle.sol#L48)\n", "first_markdown_element": "contracts/L1/MockL2OutputOracle.sol#L45-L51", "id": "74ee9955ede80e105221045625f8b4f963a0ca8422674891166ad65bdcdba57a", "check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"elements": [{"type": "function", "name": "slitherConstructorConstantVariables", "source_mapping": {"start": 86, "length": 1666, "filename_used": "./contracts/L1/DepositFeed.sol", "filename_relative": "contracts/L1/DepositFeed.sol", "filename_absolute": "./contracts/L1/DepositFeed.sol", "filename_short": "contracts/L1/DepositFeed.sol", "is_dependency": false, "lines": [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59], "starting_column": 1, "ending_column": 2}, "type_specific_fields": {"parent": {"type": "contract", "name": "DepositFeed", "source_mapping": {"start": 86, "length": 1666, "filename_used": "./contracts/L1/DepositFeed.sol", "filename_relative": "contracts/L1/DepositFeed.sol", "filename_absolute": "./contracts/L1/DepositFeed.sol", "filename_short": "contracts/L1/DepositFeed.sol", "is_dependency": false, "lines": [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59], "starting_column": 1, "ending_column": 2}}, "signature": "slitherConstructorConstantVariables()"}}, {"type": "node", "name": "OFFSET = uint160(0x1111000000000000000000000000000000001111)", "source_mapping": {"start": 284, "length": 85, "filename_used": "./contracts/L1/DepositFeed.sol", "filename_relative": "contracts/L1/DepositFeed.sol", "filename_absolute": "./contracts/L1/DepositFeed.sol", "filename_short": "contracts/L1/DepositFeed.sol", "is_dependency": false, "lines": [14], "starting_column": 5, "ending_column": 90}, "type_specific_fields": {"parent": {"type": "function", "name": "slitherConstructorConstantVariables", "source_mapping": {"start": 86, "length": 1666, "filename_used": "./contracts/L1/DepositFeed.sol", "filename_relative": "contracts/L1/DepositFeed.sol", "filename_absolute": "./contracts/L1/DepositFeed.sol", "filename_short": "contracts/L1/DepositFeed.sol", "is_dependency": false, "lines": [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59], "starting_column": 1, "ending_column": 2}, "type_specific_fields": {"parent": {"type": "contract", "name": "DepositFeed", "source_mapping": {"start": 86, "length": 1666, "filename_used": "./contracts/L1/DepositFeed.sol", "filename_relative": "contracts/L1/DepositFeed.sol", "filename_absolute": "./contracts/L1/DepositFeed.sol", "filename_short": "contracts/L1/DepositFeed.sol", "is_dependency": false, "lines": [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59], "starting_column": 1, "ending_column": 2}}, "signature": "slitherConstructorConstantVariables()"}}}}], "description": "DepositFeed.slitherConstructorConstantVariables() (contracts/L1/DepositFeed.sol#7-59) uses literals with too many digits:\n\t- OFFSET = uint160(0x1111000000000000000000000000000000001111) (contracts/L1/DepositFeed.sol#14)\n", "markdown": "[DepositFeed.slitherConstructorConstantVariables()](contracts/L1/DepositFeed.sol#L7-L59) uses literals with too many digits:\n\t- [OFFSET = uint160(0x1111000000000000000000000000000000001111)](contracts/L1/DepositFeed.sol#L14)\n", "first_markdown_element": "contracts/L1/DepositFeed.sol#L7-L59", "id": "14adc89c437b961183112ca2328ae0e07b627d12995c5555d2c2fca5d4dbe1aa", "check": "too-many-digits", "impact": "Informational", "confidence": "Medium"}] +[ + { + "elements": [ + { + "type": "contract", + "name": "DepositFeed", + "source_mapping": { + "start": 86, + "length": 1929, + "filename_used": "contracts/L1/DepositFeed.sol", + "filename_relative": "contracts/L1/DepositFeed.sol", + "filename_absolute": "contracts/L1/DepositFeed.sol", + "filename_short": "contracts/L1/DepositFeed.sol", + "is_dependency": false, + "lines": [ + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "receive", + "source_mapping": { + "start": 826, + "length": 110, + "filename_used": "contracts/L1/DepositFeed.sol", + "filename_relative": "contracts/L1/DepositFeed.sol", + "filename_absolute": "contracts/L1/DepositFeed.sol", + "filename_short": "contracts/L1/DepositFeed.sol", + "is_dependency": false, + "lines": [33, 34, 35], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DepositFeed", + "source_mapping": { + "start": 86, + "length": 1929, + "filename_used": "contracts/L1/DepositFeed.sol", + "filename_relative": "contracts/L1/DepositFeed.sol", + "filename_absolute": "contracts/L1/DepositFeed.sol", + "filename_short": "contracts/L1/DepositFeed.sol", + "is_dependency": false, + "lines": [ + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "receive()" + } + }, + { + "type": "function", + "name": "depositTransaction", + "source_mapping": { + "start": 1367, + "length": 646, + "filename_used": "contracts/L1/DepositFeed.sol", + "filename_relative": "contracts/L1/DepositFeed.sol", + "filename_absolute": "contracts/L1/DepositFeed.sol", + "filename_short": "contracts/L1/DepositFeed.sol", + "is_dependency": false, + "lines": [ + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DepositFeed", + "source_mapping": { + "start": 86, + "length": 1929, + "filename_used": "contracts/L1/DepositFeed.sol", + "filename_relative": "contracts/L1/DepositFeed.sol", + "filename_absolute": "contracts/L1/DepositFeed.sol", + "filename_short": "contracts/L1/DepositFeed.sol", + "is_dependency": false, + "lines": [ + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "depositTransaction(address,uint256,uint256,bool,bytes)" + } + } + ], + "description": "Contract locking ether found:\n\tContract DepositFeed (contracts/L1/DepositFeed.sol#7-67) has payable functions:\n\t - DepositFeed.receive() (contracts/L1/DepositFeed.sol#33-35)\n\t - DepositFeed.depositTransaction(address,uint256,uint256,bool,bytes) (contracts/L1/DepositFeed.sol#46-66)\n\tBut does not have a function to withdraw the ether\n", + "markdown": "Contract locking ether found:\n\tContract [DepositFeed](contracts/L1/DepositFeed.sol#L7-L67) has payable functions:\n\t - [DepositFeed.receive()](contracts/L1/DepositFeed.sol#L33-L35)\n\t - [DepositFeed.depositTransaction(address,uint256,uint256,bool,bytes)](contracts/L1/DepositFeed.sol#L46-L66)\n\tBut does not have a function to withdraw the ether\n", + "first_markdown_element": "contracts/L1/DepositFeed.sol#L7-L67", + "id": "288a726f2c33db8578a9b3b43eaabd069d963e2dbe1fb2ae508c861783d169f5", + "check": "locked-ether", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "contract", + "name": "DepositFeed", + "source_mapping": { + "start": 86, + "length": 1666, + "filename_used": "./contracts/L1/DepositFeed.sol", + "filename_relative": "contracts/L1/DepositFeed.sol", + "filename_absolute": "./contracts/contracts/L1/DepositFeed.sol", + "filename_short": "contracts/L1/DepositFeed.sol", + "is_dependency": false, + "lines": [ + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "function", + "name": "depositTransaction", + "source_mapping": { + "start": 1102, + "length": 648, + "filename_used": "./contracts/contracts/L1/DepositFeed.sol", + "filename_relative": "contracts/L1/DepositFeed.sol", + "filename_absolute": "./contracts/contracts/L1/DepositFeed.sol", + "filename_short": "contracts/L1/DepositFeed.sol", + "is_dependency": false, + "lines": [ + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DepositFeed", + "source_mapping": { + "start": 86, + "length": 1666, + "filename_used": "./contracts/contracts/L1/DepositFeed.sol", + "filename_relative": "contracts/L1/DepositFeed.sol", + "filename_absolute": "./contracts/contracts/L1/DepositFeed.sol", + "filename_short": "contracts/L1/DepositFeed.sol", + "is_dependency": false, + "lines": [ + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "depositTransaction(address,uint256,uint256,bool,bytes)" + } + } + ], + "description": "Contract locking ether found:\n\tContract DepositFeed (contracts/L1/DepositFeed.sol#7-59) has payable functions:\n\t - DepositFeed.depositTransaction(address,uint256,uint256,bool,bytes) (contracts/L1/DepositFeed.sol#38-58)\n\tBut does not have a function to withdraw the ether\n", + "markdown": "Contract locking ether found:\n\tContract [DepositFeed](contracts/L1/DepositFeed.sol#L7-L59) has payable functions:\n\t - [DepositFeed.depositTransaction(address,uint256,uint256,bool,bytes)](contracts/L1/DepositFeed.sol#L38-L58)\n\tBut does not have a function to withdraw the ether\n", + "first_markdown_element": "contracts/L1/DepositFeed.sol#L7-L59", + "id": "be013b000d4c176d4d893619bdca725d93e4761e4b2e22fa77a64144e53abb26", + "check": "locked-ether", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "proposeL2Output", + "source_mapping": { + "start": 1769, + "length": 422, + "filename_used": "./contracts/L1/MockL2OutputOracle.sol", + "filename_relative": "contracts/L1/MockL2OutputOracle.sol", + "filename_absolute": "./contracts/L1/MockL2OutputOracle.sol", + "filename_short": "contracts/L1/MockL2OutputOracle.sol", + "is_dependency": false, + "lines": [45, 46, 47, 48, 49, 50, 51], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "MockL2OutputOracle", + "source_mapping": { + "start": 95, + "length": 2773, + "filename_used": "./contracts/L1/MockL2OutputOracle.sol", + "filename_relative": "contracts/L1/MockL2OutputOracle.sol", + "filename_absolute": "./contracts/L1/MockL2OutputOracle.sol", + "filename_short": "contracts/L1/MockL2OutputOracle.sol", + "is_dependency": false, + "lines": [ + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "proposeL2Output(bytes32,uint256)" + } + }, + { + "type": "node", + "name": "require(bool,string)(_timestamp == nextTimestamp(),Timestamp not equal to next expected timestamp)", + "source_mapping": { + "start": 2010, + "length": 88, + "filename_used": "./contracts/L1/MockL2OutputOracle.sol", + "filename_relative": "contracts/L1/MockL2OutputOracle.sol", + "filename_absolute": "./contracts/L1/MockL2OutputOracle.sol", + "filename_short": "contracts/L1/MockL2OutputOracle.sol", + "is_dependency": false, + "lines": [48], + "starting_column": 9, + "ending_column": 97 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "proposeL2Output", + "source_mapping": { + "start": 1769, + "length": 422, + "filename_used": "./contracts/L1/MockL2OutputOracle.sol", + "filename_relative": "contracts/L1/MockL2OutputOracle.sol", + "filename_absolute": "./contracts/L1/MockL2OutputOracle.sol", + "filename_short": "contracts/L1/MockL2OutputOracle.sol", + "is_dependency": false, + "lines": [45, 46, 47, 48, 49, 50, 51], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "MockL2OutputOracle", + "source_mapping": { + "start": 95, + "length": 2773, + "filename_used": "./contracts/L1/MockL2OutputOracle.sol", + "filename_relative": "contracts/L1/MockL2OutputOracle.sol", + "filename_absolute": "./contracts/L1/MockL2OutputOracle.sol", + "filename_short": "contracts/L1/MockL2OutputOracle.sol", + "is_dependency": false, + "lines": [ + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "proposeL2Output(bytes32,uint256)" + } + } + } + } + ], + "description": "MockL2OutputOracle.proposeL2Output(bytes32,uint256) (contracts/L1/MockL2OutputOracle.sol#45-51) uses a dangerous strict equality:\n\t- require(bool,string)(_timestamp == nextTimestamp(),Timestamp not equal to next expected timestamp) (contracts/L1/MockL2OutputOracle.sol#48)\n", + "markdown": "[MockL2OutputOracle.proposeL2Output(bytes32,uint256)](contracts/L1/MockL2OutputOracle.sol#L45-L51) uses a dangerous strict equality:\n\t- [require(bool,string)(_timestamp == nextTimestamp(),Timestamp not equal to next expected timestamp)](contracts/L1/MockL2OutputOracle.sol#L48)\n", + "first_markdown_element": "contracts/L1/MockL2OutputOracle.sol#L45-L51", + "id": "74ee9955ede80e105221045625f8b4f963a0ca8422674891166ad65bdcdba57a", + "check": "incorrect-equality", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "slitherConstructorConstantVariables", + "source_mapping": { + "start": 86, + "length": 1666, + "filename_used": "./contracts/L1/DepositFeed.sol", + "filename_relative": "contracts/L1/DepositFeed.sol", + "filename_absolute": "./contracts/L1/DepositFeed.sol", + "filename_short": "contracts/L1/DepositFeed.sol", + "is_dependency": false, + "lines": [ + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59 + ], + "starting_column": 1, + "ending_column": 2 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DepositFeed", + "source_mapping": { + "start": 86, + "length": 1666, + "filename_used": "./contracts/L1/DepositFeed.sol", + "filename_relative": "contracts/L1/DepositFeed.sol", + "filename_absolute": "./contracts/L1/DepositFeed.sol", + "filename_short": "contracts/L1/DepositFeed.sol", + "is_dependency": false, + "lines": [ + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "slitherConstructorConstantVariables()" + } + }, + { + "type": "node", + "name": "OFFSET = uint160(0x1111000000000000000000000000000000001111)", + "source_mapping": { + "start": 284, + "length": 85, + "filename_used": "./contracts/L1/DepositFeed.sol", + "filename_relative": "contracts/L1/DepositFeed.sol", + "filename_absolute": "./contracts/L1/DepositFeed.sol", + "filename_short": "contracts/L1/DepositFeed.sol", + "is_dependency": false, + "lines": [14], + "starting_column": 5, + "ending_column": 90 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "slitherConstructorConstantVariables", + "source_mapping": { + "start": 86, + "length": 1666, + "filename_used": "./contracts/L1/DepositFeed.sol", + "filename_relative": "contracts/L1/DepositFeed.sol", + "filename_absolute": "./contracts/L1/DepositFeed.sol", + "filename_short": "contracts/L1/DepositFeed.sol", + "is_dependency": false, + "lines": [ + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59 + ], + "starting_column": 1, + "ending_column": 2 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DepositFeed", + "source_mapping": { + "start": 86, + "length": 1666, + "filename_used": "./contracts/L1/DepositFeed.sol", + "filename_relative": "contracts/L1/DepositFeed.sol", + "filename_absolute": "./contracts/L1/DepositFeed.sol", + "filename_short": "contracts/L1/DepositFeed.sol", + "is_dependency": false, + "lines": [ + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "slitherConstructorConstantVariables()" + } + } + } + } + ], + "description": "DepositFeed.slitherConstructorConstantVariables() (contracts/L1/DepositFeed.sol#7-59) uses literals with too many digits:\n\t- OFFSET = uint160(0x1111000000000000000000000000000000001111) (contracts/L1/DepositFeed.sol#14)\n", + "markdown": "[DepositFeed.slitherConstructorConstantVariables()](contracts/L1/DepositFeed.sol#L7-L59) uses literals with too many digits:\n\t- [OFFSET = uint160(0x1111000000000000000000000000000000001111)](contracts/L1/DepositFeed.sol#L14)\n", + "first_markdown_element": "contracts/L1/DepositFeed.sol#L7-L59", + "id": "14adc89c437b961183112ca2328ae0e07b627d12995c5555d2c2fca5d4dbe1aa", + "check": "too-many-digits", + "impact": "Informational", + "confidence": "Medium" + } +] diff --git a/packages/contracts-bedrock/src/contract-defs.ts b/packages/contracts-bedrock/src/contract-defs.ts new file mode 100644 index 0000000000000..2bd0a6f17eb20 --- /dev/null +++ b/packages/contracts-bedrock/src/contract-defs.ts @@ -0,0 +1,52 @@ +import { ethers } from 'ethers' + +/** + * Gets the hardhat artifact for the given contract name. + * Will throw an error if the contract artifact is not found. + * + * @param name Contract name. + * @returns The artifact for the given contract name. + */ +export const getContractDefinition = (name: string): any => { + // We import this using `require` because hardhat tries to build this file when compiling + // the contracts, but we need the contracts to be compiled before the contract-artifacts.ts + // file can be generated. + // eslint-disable-next-line @typescript-eslint/no-var-requires + const { getContractArtifact } = require('./contract-artifacts') + const artifact = getContractArtifact(name) + if (artifact === undefined) { + throw new Error(`Unable to find artifact for contract: ${name}`) + } + return artifact +} + +/** + * Gets an ethers Interface instance for the given contract name. + * + * @param name Contract name. + * @returns The interface for the given contract name. + */ +export const getContractInterface = (name: string): ethers.utils.Interface => { + const definition = getContractDefinition(name) + return new ethers.utils.Interface(definition.abi) +} + +/** + * Gets an ethers ContractFactory instance for the given contract name. + * + * @param name Contract name. + * @param signer The signer for the ContractFactory to use. + * @returns The contract factory for the given contract name. + */ +export const getContractFactory = ( + name: string, + signer?: ethers.Signer +): ethers.ContractFactory => { + const definition = getContractDefinition(name) + const contractInterface = getContractInterface(name) + return new ethers.ContractFactory( + contractInterface, + definition.bytecode, + signer + ) +} diff --git a/packages/contracts-bedrock/src/generateProofs.ts b/packages/contracts-bedrock/src/generateProofs.ts deleted file mode 100644 index 1315d7b55e2b9..0000000000000 --- a/packages/contracts-bedrock/src/generateProofs.ts +++ /dev/null @@ -1,101 +0,0 @@ -import { ethers } from 'ethers' -import { toHexString } from '@eth-optimism/core-utils' - -import { TrieTestGenerator } from './trie-test-generator' -import { predeploys } from './constants' - -interface WithdrawalArgs { - nonce: number - sender: string - target: string - value: number - gasLimit: number - data: string -} - -interface OutputRootProof { - version: string - stateRoot: string - withdrawerStorageRoot: string - latestBlockhash: string -} - -export const deriveWithdrawalHash = (wd: WithdrawalArgs): string => { - return ethers.utils.keccak256( - ethers.utils.defaultAbiCoder.encode( - ['uint256', 'address', 'address', 'uint256', 'uint256', 'bytes'], - [wd.nonce, wd.sender, wd.target, wd.value, wd.gasLimit, wd.data] - ) - ) -} - -export const generateMockWithdrawalProof = async ( - wd: WithdrawalArgs | string -): Promise<{ - outputRootProof: OutputRootProof - storageTrieWitness: string -}> => { - let withdrawalHash - if (typeof wd == 'string') { - // wd should be an abi encoded string - withdrawalHash = ethers.utils.keccak256(wd) - } else { - withdrawalHash = deriveWithdrawalHash(wd as WithdrawalArgs) - } - - const storageKey = ethers.utils.keccak256( - ethers.utils.hexConcat([ - withdrawalHash, - ethers.utils.hexZeroPad('0x01', 32), - ]) - ) - - const storageGenerator = await TrieTestGenerator.fromNodes({ - nodes: [ - { - key: storageKey, - val: '0x' + '01'.padStart(2, '0'), - }, - ], - secure: true, - }) - - const generator = await TrieTestGenerator.fromAccounts({ - accounts: [ - { - address: predeploys.L2ToL1MessagePasser, - nonce: 0, - balance: 0, - codeHash: ethers.utils.keccak256('0x1234'), - storageRoot: toHexString(storageGenerator._trie.root), - }, - ], - secure: true, - }) - - return { - outputRootProof: { - version: ethers.constants.HashZero, - stateRoot: toHexString(generator._trie.root), - withdrawerStorageRoot: toHexString(storageGenerator._trie.root), - latestBlockhash: ethers.constants.HashZero, - }, - storageTrieWitness: ( - await storageGenerator.makeInclusionProofTest(storageKey) - ).proof, - } -} - -export const generateOutputRoot = (outputElements: { - version: string - stateRoot: string - withdrawerStorageRoot: string - latestBlockhash: string -}) => { - const { version, stateRoot, withdrawerStorageRoot, latestBlockhash } = - outputElements - return ethers.utils.solidityKeccak256( - ['bytes32', 'bytes32', 'bytes32', 'bytes32'], - [version, stateRoot, withdrawerStorageRoot, latestBlockhash] - ) -} diff --git a/packages/contracts-bedrock/src/index.ts b/packages/contracts-bedrock/src/index.ts index e481028f072b3..6cba13dfe5892 100644 --- a/packages/contracts-bedrock/src/index.ts +++ b/packages/contracts-bedrock/src/index.ts @@ -1,2 +1,2 @@ -export * from './generateProofs' export * from './constants' +export * from './contract-defs' diff --git a/packages/contracts-bedrock/src/trie-test-generator.ts b/packages/contracts-bedrock/src/trie-test-generator.ts deleted file mode 100644 index 8e5bd6caed1b1..0000000000000 --- a/packages/contracts-bedrock/src/trie-test-generator.ts +++ /dev/null @@ -1,261 +0,0 @@ -/* External Imports */ -import * as rlp from 'rlp' -// import { default as seedbytes } from 'random-bytes-seed' -import { SecureTrie, BaseTrie } from 'merkle-patricia-tree' -import { fromHexString, toHexString } from '@eth-optimism/core-utils' -import { ethers } from 'ethers' - -interface TrieNode { - key: string - val: string -} - -interface InclusionProofTest { - key: string - val: string - proof: string - root: string -} - -interface NodeUpdateTest extends InclusionProofTest { - newRoot: string -} - -interface EthereumAccount { - address?: string - nonce: number - balance: number - codeHash: string - storageRoot?: string - storage?: TrieNode[] -} - -interface AccountProofTest { - address: string - account: EthereumAccount - accountTrieWitness: string - accountTrieRoot: string -} - -interface AccountUpdateTest extends AccountProofTest { - newAccountTrieRoot: string -} - -const rlpEncodeAccount = (account: EthereumAccount): string => { - return toHexString( - rlp.encode([ - account.nonce, - account.balance, - account.storageRoot || ethers.constants.HashZero, - account.codeHash || ethers.constants.HashZero, - ]) - ) -} - -const rlpDecodeAccount = (encoded: string): EthereumAccount => { - const decoded = rlp.decode(fromHexString(encoded)) as any - return { - nonce: decoded[0].length ? parseInt(decoded[0], 16) : 0, - balance: decoded[1].length ? parseInt(decoded[1], 16) : 0, - storageRoot: decoded[2].length - ? toHexString(decoded[2]) - : ethers.constants.HashZero, - codeHash: decoded[3].length - ? toHexString(decoded[3]) - : ethers.constants.HashZero, - } -} - -const makeTrie = async ( - nodes: TrieNode[], - secure?: boolean -): Promise<{ - trie: SecureTrie | BaseTrie - TrieClass: any -}> => { - const TrieClass = secure ? SecureTrie : BaseTrie - const trie = new TrieClass() - - for (const node of nodes) { - await trie.put(fromHexString(node.key), fromHexString(node.val)) - } - - return { - trie, - TrieClass, - } -} - -export class TrieTestGenerator { - constructor( - public _TrieClass: any, - public _trie: SecureTrie | BaseTrie, - public _nodes: TrieNode[], - public _subGenerators?: TrieTestGenerator[] - ) {} - - static async fromNodes(opts: { - nodes: TrieNode[] - secure?: boolean - }): Promise { - const { trie, TrieClass } = await makeTrie(opts.nodes, opts.secure) - - return new TrieTestGenerator(TrieClass, trie, opts.nodes) - } - - // static async fromRandom(opts: { - // seed: string - // nodeCount: number - // secure?: boolean - // keySize?: number - // valSize?: number - // }): Promise { - // const getRandomBytes = seedbytes(opts.seed) - // const nodes: TrieNode[] = [...Array(opts.nodeCount)].map(() => { - // return { - // key: toHexString(getRandomBytes(opts.keySize || 32)), - // val: toHexString(getRandomBytes(opts.valSize || 32)), - // } - // }) - - // return TrieTestGenerator.fromNodes({ - // nodes, - // secure: opts.secure, - // }) - // } - - static async fromAccounts(opts: { - accounts: EthereumAccount[] - secure?: boolean - }): Promise { - const subGenerators: TrieTestGenerator[] = [] - - for (const account of opts.accounts) { - if (account.storage) { - const subGenerator = await TrieTestGenerator.fromNodes({ - nodes: account.storage, - secure: opts.secure, - }) - - account.storageRoot = toHexString(subGenerator._trie.root) - subGenerators.push(subGenerator) - } - } - - const nodes = opts.accounts.map((account) => { - return { - key: account.address as string, - val: rlpEncodeAccount(account), - } - }) - - const { trie, TrieClass } = await makeTrie(nodes, opts.secure) - - return new TrieTestGenerator(TrieClass, trie, nodes, subGenerators) - } - - public async makeInclusionProofTest( - key: string | number - ): Promise { - if (typeof key === 'number') { - key = this._nodes[key].key - } - - const trie = this._trie.copy() - - const proof = await this.prove(key) - const val = await trie.get(fromHexString(key)) - - return { - proof: toHexString(rlp.encode(proof)), - key: toHexString(key), - val: toHexString(val), - root: toHexString(trie.root), - } - } - - public async makeAllInclusionProofTests(): Promise { - return Promise.all( - this._nodes.map(async (node) => { - return this.makeInclusionProofTest(node.key) - }) - ) - } - - public async makeNodeUpdateTest( - key: string | number, - val: string - ): Promise { - if (typeof key === 'number') { - key = this._nodes[key].key - } - - const trie = this._trie.copy() - - const proof = await this.prove(key) - const oldRoot = trie.root - - await trie.put(fromHexString(key), fromHexString(val)) - const newRoot = trie.root - - return { - proof: toHexString(rlp.encode(proof)), - key: toHexString(key), - val: toHexString(val), - root: toHexString(oldRoot), - newRoot: toHexString(newRoot), - } - } - - public async makeAccountProofTest( - address: string | number - ): Promise { - if (typeof address === 'number') { - address = this._nodes[address].key - } - - const trie = this._trie.copy() - - const proof = await this.prove(address) - const account = await trie.get(fromHexString(address)) - - return { - address, - account: rlpDecodeAccount(toHexString(account)), - accountTrieWitness: toHexString(rlp.encode(proof)), - accountTrieRoot: toHexString(trie.root), - } - } - - public async makeAccountUpdateTest( - address: string | number, - account: EthereumAccount - ): Promise { - if (typeof address === 'number') { - address = this._nodes[address].key - } - - const trie = this._trie.copy() - - const proof = await this.prove(address) - const oldRoot = trie.root - - await trie.put( - fromHexString(address), - fromHexString(rlpEncodeAccount(account)) - ) - const newRoot = trie.root - - return { - address, - account, - accountTrieWitness: toHexString(rlp.encode(proof)), - accountTrieRoot: toHexString(oldRoot), - newAccountTrieRoot: toHexString(newRoot), - } - } - - private async prove(key: string): Promise { - return this._TrieClass.prove(this._trie, fromHexString(key)) - } -} diff --git a/packages/contracts-bedrock/tasks/deposits.ts b/packages/contracts-bedrock/tasks/deposits.ts index 48aa5ad4ba93a..cf07b54293b91 100644 --- a/packages/contracts-bedrock/tasks/deposits.ts +++ b/packages/contracts-bedrock/tasks/deposits.ts @@ -99,16 +99,19 @@ task('deposit', 'Deposits funds onto L2.') if (expected) { console.log('Deposit success') console.log(JSON.stringify(expected, null, 2)) + console.log('Receipt:') + const l2Receipt = await l2Provider.getTransactionReceipt(hash) + console.log(JSON.stringify(l2Receipt, null, 2)) break } - const postL2Balance = await l2Provider.getBalance(to) - if (postL2Balance.gt(preL2Balance)) { - console.log( - `Unexpected balance increase without detecting deposit transaction` - ) - } if (i % 100 === 0) { + const postL2Balance = await l2Provider.getBalance(to) + if (postL2Balance.gt(preL2Balance)) { + console.log( + `Unexpected balance increase without detecting deposit transaction` + ) + } const block = await l2Provider.getBlock('latest') console.log(`latest block ${block.number}:${block.hash}`) } diff --git a/packages/contracts-bedrock/tasks/genesis-l1.ts b/packages/contracts-bedrock/tasks/genesis-l1.ts index dd22245423d6e..e01043582f545 100644 --- a/packages/contracts-bedrock/tasks/genesis-l1.ts +++ b/packages/contracts-bedrock/tasks/genesis-l1.ts @@ -3,6 +3,7 @@ import fs from 'fs' import { ethers } from 'ethers' import { task } from 'hardhat/config' import { Genesis, State } from '@eth-optimism/core-utils' +import '@eth-optimism/hardhat-deploy-config' task('genesis-l1', 'create a genesis config') .addOptionalParam( diff --git a/packages/contracts-bedrock/tasks/genesis-l2.ts b/packages/contracts-bedrock/tasks/genesis-l2.ts index 01b973bfe5565..7aa1d1fab1fba 100644 --- a/packages/contracts-bedrock/tasks/genesis-l2.ts +++ b/packages/contracts-bedrock/tasks/genesis-l2.ts @@ -141,7 +141,6 @@ task('genesis-l2', 'create a genesis config') predeployAddrs.add(ethers.utils.getAddress(addr)) } - // TODO: geth likes strings for nonce and balance now const alloc: State = {} // Set a proxy at each predeploy address @@ -170,6 +169,28 @@ task('genesis-l2', 'create a genesis config') } if (predeployAddrs.has(ethers.utils.getAddress(addr))) { + const predeploy = Object.entries(predeploys).find(([, address]) => { + return ethers.utils.getAddress(address) === addr + }) + + // Really shouldn't happen, since predeployAddrs is a set generated from predeploys. + if (predeploy === undefined) { + throw new Error('could not find address') + } + + const name = predeploy[0] + if (variables[name]) { + const storageLayout = await getStorageLayout(hre, name) + if (storageLayout === undefined) { + throw new Error(`cannot find storage layout for ${name}`) + } + const slots = computeStorageSlots(storageLayout, variables[name]) + + for (const slot of slots) { + alloc[addr].storage[slot.key] = slot.val + } + } + alloc[addr].storage[implementationSlot] = toCodeAddr(addr) } } @@ -247,16 +268,6 @@ task('genesis-l2', 'create a genesis config') code: artifact.deployedBytecode, storage: {}, } - - const storageLayout = await getStorageLayout(hre, name) - if (storageLayout === undefined) { - throw new Error(`cannot find storage layout for ${name}`) - } - const slots = computeStorageSlots(storageLayout, variables[name]) - - for (const slot of slots) { - alloc[allocAddr].storage[slot.key] = slot.val - } } const portal = await hre.deployments.get('OptimismPortalProxy') @@ -276,11 +287,11 @@ task('genesis-l2', 'create a genesis config') muirGlacierBlock: 0, berlinBlock: 0, londonBlock: 0, - mergeForkBlock: 0, + mergeNetsplitBlock: 0, terminalTotalDifficulty: 0, - clique: { - period: 0, - epoch: 30000, + optimism: { + baseFeeRecipient: deployConfig.optimismBaseFeeRecipient, + l1FeeRecipient: deployConfig.optimismL1FeeRecipient, }, }, nonce: '0x1234', @@ -288,11 +299,6 @@ task('genesis-l2', 'create a genesis config') timestamp: ethers.BigNumber.from(l1StartingBlock.timestamp).toHexString(), gasLimit: deployConfig.genesisBlockGasLimit, extraData: deployConfig.genesisBlockExtradata, - optimism: { - enabled: true, - baseFeeRecipient: deployConfig.optimismBaseFeeRecipient, - l1FeeRecipient: deployConfig.optimismL1FeeRecipient, - }, alloc, } diff --git a/packages/contracts-bedrock/tasks/rollup-config.ts b/packages/contracts-bedrock/tasks/rollup-config.ts index b90add90c0d41..268d2b39e47fe 100644 --- a/packages/contracts-bedrock/tasks/rollup-config.ts +++ b/packages/contracts-bedrock/tasks/rollup-config.ts @@ -3,6 +3,8 @@ import fs from 'fs' import { task } from 'hardhat/config' import { OpNodeConfig, getChainId } from '@eth-optimism/core-utils' import { ethers } from 'ethers' +import 'hardhat-deploy' +import '@eth-optimism/hardhat-deploy-config' task('rollup-config', 'create a genesis config') .addOptionalParam( diff --git a/packages/contracts-bedrock/test/helpers.spec.ts b/packages/contracts-bedrock/test/helpers.spec.ts deleted file mode 100644 index e476f309db89c..0000000000000 --- a/packages/contracts-bedrock/test/helpers.spec.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { expect } from 'chai' -import { BigNumber } from 'ethers' - -import { DepositTx, SourceHashDomain } from '../src' - -describe('Helpers', () => { - describe('DepositTx', () => { - // TODO(tynes): this is out of date now that the subversion - // byte has been added - it('should serialize/deserialize and hash', () => { - // constants serialized using optimistic-geth - // TODO(tynes): more tests - const hash = - '0xf58e30138cb01330f6450b9a5e717a63840ad2e21f17340105b388ad3c668749' - const raw = - '0x7e00f862a0f923fb07134d7d287cb52c770cc619e17e82606c21a875c92f4c63b65280a5cc94f39fd6e51aad88f6f4ce6ab8827279cfffb9226694b79f76ef2c5f0286176833e7b2eee103b1cc3244880e043da617250000880de0b6b3a7640000832dc6c080' - - const tx = new DepositTx({ - from: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266', - gas: '0x2dc6c0', - data: '0x', - to: '0xB79f76EF2c5F0286176833E7B2eEe103b1CC3244', - value: '0xde0b6b3a7640000', - domain: SourceHashDomain.UserDeposit, - l1BlockHash: - '0xd25df7858efc1778118fb133ac561b138845361626dfb976699c5287ed0f4959', - logIndex: 1, - mint: '0xe043da617250000', - }) - - const sourceHash = tx.sourceHash() - expect(sourceHash).to.deep.eq( - '0xf923fb07134d7d287cb52c770cc619e17e82606c21a875c92f4c63b65280a5cc' - ) - - const encoded = tx.encode() - expect(encoded).to.deep.eq(raw) - const hashed = tx.hash() - expect(hashed).to.deep.eq(hash) - - const decoded = DepositTx.decode(raw, { - domain: SourceHashDomain.UserDeposit, - l1BlockHash: tx.l1BlockHash, - logIndex: tx.logIndex, - }) - expect(decoded.from).to.deep.eq(tx.from) - expect(decoded.gas).to.deep.eq(BigNumber.from(tx.gas)) - expect(decoded.data).to.deep.eq(tx.data) - expect(decoded.to).to.deep.eq(tx.to) - expect(decoded.value).to.deep.eq(BigNumber.from(tx.value)) - expect(decoded.domain).to.deep.eq(SourceHashDomain.UserDeposit) - expect(decoded.l1BlockHash).to.deep.eq(tx.l1BlockHash) - expect(decoded.logIndex).to.deep.eq(tx.logIndex) - expect(decoded.mint).to.deep.eq(BigNumber.from(tx.mint)) - }) - }) -}) diff --git a/packages/contracts-bedrock/tsconfig.json b/packages/contracts-bedrock/tsconfig.json index cfdbeb7b68f4e..e52b25676cce8 100644 --- a/packages/contracts-bedrock/tsconfig.json +++ b/packages/contracts-bedrock/tsconfig.json @@ -1,9 +1,9 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "rootDir": "./src", + "rootDir": ".", "outDir": "./dist" }, "exclude": ["hardhat.config.ts", "deploy", "tasks", "test"], - "include": ["src/**/*"] + "include": ["src/**/*", "scripts/**/*"] } diff --git a/packages/contracts-periphery/contracts/L1/L1ERC721Bridge.sol b/packages/contracts-periphery/contracts/L1/L1ERC721Bridge.sol index 531a169de82e2..0ee2d260ae709 100644 --- a/packages/contracts-periphery/contracts/L1/L1ERC721Bridge.sol +++ b/packages/contracts-periphery/contracts/L1/L1ERC721Bridge.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity 0.8.15; import { CrossDomainEnabled diff --git a/packages/contracts-periphery/contracts/L1/TeleportrDeposit.sol b/packages/contracts-periphery/contracts/L1/TeleportrDeposit.sol index 4ae09b42a5a99..d4c4fa83b0f80 100644 --- a/packages/contracts-periphery/contracts/L1/TeleportrDeposit.sol +++ b/packages/contracts-periphery/contracts/L1/TeleportrDeposit.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.8.9; +pragma solidity 0.8.15; import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; diff --git a/packages/contracts-periphery/contracts/L1/TeleportrWithdrawer.sol b/packages/contracts-periphery/contracts/L1/TeleportrWithdrawer.sol index 5f34ae04884dc..21241dc877ee1 100644 --- a/packages/contracts-periphery/contracts/L1/TeleportrWithdrawer.sol +++ b/packages/contracts-periphery/contracts/L1/TeleportrWithdrawer.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity 0.8.15; import { AssetReceiver } from "../universal/AssetReceiver.sol"; diff --git a/packages/contracts-periphery/contracts/L2/L2ERC721Bridge.sol b/packages/contracts-periphery/contracts/L2/L2ERC721Bridge.sol index 0262fdac5d192..05b8ddc06ee2c 100644 --- a/packages/contracts-periphery/contracts/L2/L2ERC721Bridge.sol +++ b/packages/contracts-periphery/contracts/L2/L2ERC721Bridge.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity 0.8.15; import { CrossDomainEnabled diff --git a/packages/contracts-periphery/contracts/L2/TeleportrDisburser.sol b/packages/contracts-periphery/contracts/L2/TeleportrDisburser.sol index 17eb557f720c3..02f574e69e3ed 100644 --- a/packages/contracts-periphery/contracts/L2/TeleportrDisburser.sol +++ b/packages/contracts-periphery/contracts/L2/TeleportrDisburser.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.8.9; +pragma solidity 0.8.15; import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; diff --git a/packages/contracts-periphery/contracts/foundry-tests/AssetReceiver.t.sol b/packages/contracts-periphery/contracts/foundry-tests/AssetReceiver.t.sol index fa73b7c7bf2f1..70df31c2f1647 100644 --- a/packages/contracts-periphery/contracts/foundry-tests/AssetReceiver.t.sol +++ b/packages/contracts-periphery/contracts/foundry-tests/AssetReceiver.t.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: MIT -pragma solidity 0.8.10; +pragma solidity 0.8.15; /* Testing utilities */ import { Test } from "forge-std/Test.sol"; diff --git a/packages/contracts-periphery/contracts/foundry-tests/TeleportrWithdrawer.t.sol b/packages/contracts-periphery/contracts/foundry-tests/TeleportrWithdrawer.t.sol index a229b8101bb1e..c2a7e9ca24325 100644 --- a/packages/contracts-periphery/contracts/foundry-tests/TeleportrWithdrawer.t.sol +++ b/packages/contracts-periphery/contracts/foundry-tests/TeleportrWithdrawer.t.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: MIT -pragma solidity 0.8.10; +pragma solidity 0.8.15; /* Testing utilities */ import { Test } from "forge-std/Test.sol"; diff --git a/packages/contracts-periphery/contracts/foundry-tests/Transactor.t.sol b/packages/contracts-periphery/contracts/foundry-tests/Transactor.t.sol index 8410d77b2bc24..f78468da13f65 100644 --- a/packages/contracts-periphery/contracts/foundry-tests/Transactor.t.sol +++ b/packages/contracts-periphery/contracts/foundry-tests/Transactor.t.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: MIT -pragma solidity 0.8.10; +pragma solidity 0.8.15; /* Testing utilities */ import { Test } from "forge-std/Test.sol"; diff --git a/packages/contracts-periphery/contracts/testing/helpers/CallRecorder.sol b/packages/contracts-periphery/contracts/testing/helpers/CallRecorder.sol index b57228d43bf92..eb9c41714d2af 100644 --- a/packages/contracts-periphery/contracts/testing/helpers/CallRecorder.sol +++ b/packages/contracts-periphery/contracts/testing/helpers/CallRecorder.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity 0.8.15; contract CallRecorder { struct CallInfo { diff --git a/packages/contracts-periphery/contracts/testing/helpers/ExternalContractCompiler.sol b/packages/contracts-periphery/contracts/testing/helpers/ExternalContractCompiler.sol index 04eaa3fa92ab5..67c3f84436aea 100644 --- a/packages/contracts-periphery/contracts/testing/helpers/ExternalContractCompiler.sol +++ b/packages/contracts-periphery/contracts/testing/helpers/ExternalContractCompiler.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity 0.8.15; import { ProxyAdmin } from "@eth-optimism/contracts-bedrock/contracts/universal/ProxyAdmin.sol"; import { Proxy } from "@eth-optimism/contracts-bedrock/contracts/universal/Proxy.sol"; diff --git a/packages/contracts-periphery/contracts/testing/helpers/FailingReceiver.sol b/packages/contracts-periphery/contracts/testing/helpers/FailingReceiver.sol index 4f7fdc047d88b..ebc8d2501dcf7 100644 --- a/packages/contracts-periphery/contracts/testing/helpers/FailingReceiver.sol +++ b/packages/contracts-periphery/contracts/testing/helpers/FailingReceiver.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity 0.8.15; contract FailingReceiver { receive() external payable { diff --git a/packages/contracts-periphery/contracts/testing/helpers/MockTeleportr.sol b/packages/contracts-periphery/contracts/testing/helpers/MockTeleportr.sol index 16a329711b0d1..9d9fbe6b51028 100644 --- a/packages/contracts-periphery/contracts/testing/helpers/MockTeleportr.sol +++ b/packages/contracts-periphery/contracts/testing/helpers/MockTeleportr.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity 0.8.15; contract MockTeleportr { function withdrawBalance() external { diff --git a/packages/contracts-periphery/contracts/testing/helpers/Reverter.sol b/packages/contracts-periphery/contracts/testing/helpers/Reverter.sol index 75f83cf75aac3..eeaed478563c0 100644 --- a/packages/contracts-periphery/contracts/testing/helpers/Reverter.sol +++ b/packages/contracts-periphery/contracts/testing/helpers/Reverter.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity 0.8.15; contract Reverter { function doRevert() public pure { diff --git a/packages/contracts-periphery/contracts/testing/helpers/SimpleStorage.sol b/packages/contracts-periphery/contracts/testing/helpers/SimpleStorage.sol index 68554dcacf377..47c59eb7c40da 100644 --- a/packages/contracts-periphery/contracts/testing/helpers/SimpleStorage.sol +++ b/packages/contracts-periphery/contracts/testing/helpers/SimpleStorage.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity 0.8.15; contract SimpleStorage { mapping(bytes32 => bytes32) public db; diff --git a/packages/contracts-periphery/contracts/testing/helpers/TestERC20.sol b/packages/contracts-periphery/contracts/testing/helpers/TestERC20.sol index f66d870a51716..03e3052fc94dc 100644 --- a/packages/contracts-periphery/contracts/testing/helpers/TestERC20.sol +++ b/packages/contracts-periphery/contracts/testing/helpers/TestERC20.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity 0.8.15; import { ERC20 } from "@rari-capital/solmate/src/tokens/ERC20.sol"; diff --git a/packages/contracts-periphery/contracts/testing/helpers/TestERC721.sol b/packages/contracts-periphery/contracts/testing/helpers/TestERC721.sol index a9c37b38805e5..81fb3810d7c3e 100644 --- a/packages/contracts-periphery/contracts/testing/helpers/TestERC721.sol +++ b/packages/contracts-periphery/contracts/testing/helpers/TestERC721.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity 0.8.15; import { ERC721 } from "@rari-capital/solmate/src/tokens/ERC721.sol"; diff --git a/packages/contracts-periphery/contracts/universal/AssetReceiver.sol b/packages/contracts-periphery/contracts/universal/AssetReceiver.sol index 2b05aa8e90854..2fae8eda67568 100644 --- a/packages/contracts-periphery/contracts/universal/AssetReceiver.sol +++ b/packages/contracts-periphery/contracts/universal/AssetReceiver.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity ^0.8.0; import { ERC20 } from "@rari-capital/solmate/src/tokens/ERC20.sol"; import { ERC721 } from "@rari-capital/solmate/src/tokens/ERC721.sol"; diff --git a/packages/contracts-periphery/contracts/universal/Transactor.sol b/packages/contracts-periphery/contracts/universal/Transactor.sol index bb8455f398e2a..d128b89fa8a02 100644 --- a/packages/contracts-periphery/contracts/universal/Transactor.sol +++ b/packages/contracts-periphery/contracts/universal/Transactor.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity ^0.8.0; import { Owned } from "@rari-capital/solmate/src/auth/Owned.sol"; diff --git a/packages/contracts-periphery/contracts/universal/drippie/Drippie.sol b/packages/contracts-periphery/contracts/universal/drippie/Drippie.sol index 81709d82356c2..502180d564523 100644 --- a/packages/contracts-periphery/contracts/universal/drippie/Drippie.sol +++ b/packages/contracts-periphery/contracts/universal/drippie/Drippie.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity 0.8.15; import { AssetReceiver } from "../AssetReceiver.sol"; import { IDripCheck } from "./IDripCheck.sol"; diff --git a/packages/contracts-periphery/contracts/universal/drippie/IDripCheck.sol b/packages/contracts-periphery/contracts/universal/drippie/IDripCheck.sol index 5c7655588be92..fbb691780a0a2 100644 --- a/packages/contracts-periphery/contracts/universal/drippie/IDripCheck.sol +++ b/packages/contracts-periphery/contracts/universal/drippie/IDripCheck.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity ^0.8.0; interface IDripCheck { // DripCheck contracts that want to take parameters as inputs MUST expose a struct called diff --git a/packages/contracts-periphery/contracts/universal/drippie/dripchecks/CheckBalanceHigh.sol b/packages/contracts-periphery/contracts/universal/drippie/dripchecks/CheckBalanceHigh.sol index 846352842f0ba..4ce8bf46a7c3f 100644 --- a/packages/contracts-periphery/contracts/universal/drippie/dripchecks/CheckBalanceHigh.sol +++ b/packages/contracts-periphery/contracts/universal/drippie/dripchecks/CheckBalanceHigh.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity 0.8.15; import { IDripCheck } from "../IDripCheck.sol"; diff --git a/packages/contracts-periphery/contracts/universal/drippie/dripchecks/CheckBalanceLow.sol b/packages/contracts-periphery/contracts/universal/drippie/dripchecks/CheckBalanceLow.sol index 9920e972db1f4..8ccb099bdf1dd 100644 --- a/packages/contracts-periphery/contracts/universal/drippie/dripchecks/CheckBalanceLow.sol +++ b/packages/contracts-periphery/contracts/universal/drippie/dripchecks/CheckBalanceLow.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity 0.8.15; import { IDripCheck } from "../IDripCheck.sol"; diff --git a/packages/contracts-periphery/contracts/universal/drippie/dripchecks/CheckGelatoLow.sol b/packages/contracts-periphery/contracts/universal/drippie/dripchecks/CheckGelatoLow.sol index 00e986d4fe243..30773d1801d95 100644 --- a/packages/contracts-periphery/contracts/universal/drippie/dripchecks/CheckGelatoLow.sol +++ b/packages/contracts-periphery/contracts/universal/drippie/dripchecks/CheckGelatoLow.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity 0.8.15; import { IDripCheck } from "../IDripCheck.sol"; diff --git a/packages/contracts-periphery/contracts/universal/drippie/dripchecks/CheckTrue.sol b/packages/contracts-periphery/contracts/universal/drippie/dripchecks/CheckTrue.sol index 3fc8b8b240edc..32015d5f10b2a 100644 --- a/packages/contracts-periphery/contracts/universal/drippie/dripchecks/CheckTrue.sol +++ b/packages/contracts-periphery/contracts/universal/drippie/dripchecks/CheckTrue.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity 0.8.15; import { IDripCheck } from "../IDripCheck.sol"; diff --git a/packages/contracts-periphery/contracts/universal/op-erc721/IOptimismMintableERC721.sol b/packages/contracts-periphery/contracts/universal/op-erc721/IOptimismMintableERC721.sol index 0c2174261fad4..c801cc79b272d 100644 --- a/packages/contracts-periphery/contracts/universal/op-erc721/IOptimismMintableERC721.sol +++ b/packages/contracts-periphery/contracts/universal/op-erc721/IOptimismMintableERC721.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity ^0.8.0; import { IERC721Enumerable diff --git a/packages/contracts-periphery/contracts/universal/op-erc721/OptimismMintableERC721.sol b/packages/contracts-periphery/contracts/universal/op-erc721/OptimismMintableERC721.sol index 9a0a56badfffe..de8d1cc7de266 100644 --- a/packages/contracts-periphery/contracts/universal/op-erc721/OptimismMintableERC721.sol +++ b/packages/contracts-periphery/contracts/universal/op-erc721/OptimismMintableERC721.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity ^0.8.0; import { ERC721Enumerable diff --git a/packages/contracts-periphery/contracts/universal/op-erc721/OptimismMintableERC721Factory.sol b/packages/contracts-periphery/contracts/universal/op-erc721/OptimismMintableERC721Factory.sol index 77830cf5a334c..ea5315dc41db3 100644 --- a/packages/contracts-periphery/contracts/universal/op-erc721/OptimismMintableERC721Factory.sol +++ b/packages/contracts-periphery/contracts/universal/op-erc721/OptimismMintableERC721Factory.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity 0.8.15; import { OwnableUpgradeable diff --git a/packages/contracts-periphery/hardhat.config.ts b/packages/contracts-periphery/hardhat.config.ts index c7d28c6a6b751..e5d0c4c3b8885 100644 --- a/packages/contracts-periphery/hardhat.config.ts +++ b/packages/contracts-periphery/hardhat.config.ts @@ -100,7 +100,7 @@ const config: HardhatUserConfig = { solidity: { compilers: [ { - version: '0.8.9', + version: '0.8.15', settings: { optimizer: { enabled: true, runs: 10_000 }, }, diff --git a/packages/contracts-periphery/package.json b/packages/contracts-periphery/package.json index 0c7e963a42536..03f01967287ad 100644 --- a/packages/contracts-periphery/package.json +++ b/packages/contracts-periphery/package.json @@ -64,7 +64,7 @@ "@nomiclabs/hardhat-waffle": "^2.0.3", "@rari-capital/solmate": "https://github.com/rari-capital/solmate.git#eaaccf88ac5290299884437e1aee098a96583d54", "@openzeppelin/contracts": "4.6.0", - "@openzeppelin/contracts-upgradeable": "4.6.0", + "@openzeppelin/contracts-upgradeable": "4.7.1", "@types/chai": "^4.2.18", "@types/mocha": "^8.2.2", "@types/node": "^17.0.21", @@ -77,7 +77,7 @@ "ds-test": "https://github.com/dapphub/ds-test.git#9310e879db8ba3ea6d5c6489a579118fd264a3f5", "ethereum-waffle": "^3.4.4", "ethers": "^5.6.8", - "forge-std": "https://github.com/foundry-rs/forge-std.git#62caef29b0f87a2c6aaaf634b2ca4c09b6867c92", + "forge-std": "https://github.com/foundry-rs/forge-std.git#f18682b2874fc57d7c80a511fed0b35ec4201ffa", "hardhat": "^2.9.6", "hardhat-deploy": "^0.11.10", "hardhat-gas-reporter": "^1.0.8", diff --git a/packages/contracts/deploy-config/goerli.ts b/packages/contracts/deploy-config/goerli.ts index 46334fe953e5a..81c5ea2315fa7 100644 --- a/packages/contracts/deploy-config/goerli.ts +++ b/packages/contracts/deploy-config/goerli.ts @@ -5,7 +5,7 @@ const config = { l2ChainId: 420, ctcL2GasDiscountDivisor: 32, ctcEnqueueGasCost: 60_000, - sccFaultProofWindowSeconds: 604800, + sccFaultProofWindowSeconds: 10, sccSequencerPublishWindowSeconds: 12592000, ovmSequencerAddress: '0x7431310e026B69BFC676C0013E12A1A11411EEc9', ovmProposerAddress: '0x02b1786A85Ec3f71fBbBa46507780dB7cF9014f6', diff --git a/packages/contracts/deployments/goerli/AddressDictator.json b/packages/contracts/deployments/goerli/AddressDictator.json index 01cd4b3c06c15..f8ccea4409b2e 100644 --- a/packages/contracts/deployments/goerli/AddressDictator.json +++ b/packages/contracts/deployments/goerli/AddressDictator.json @@ -1,5 +1,5 @@ { - "address": "0xfA5b622409E1782597952a4A78c1D34CF32fF5e2", + "address": "0x406905414D6c250C186F4616EFA38D5fc0759437", "abi": [ { "inputs": [ @@ -93,19 +93,19 @@ "type": "function" } ], - "transactionHash": "0xaea15e8dfb33a1cec4da0a20127d0cd1455ce8f8361ff3c59e5d913fa59ee0c5", + "transactionHash": "0x32ab785cd443eb8290d85810fbd3b76e92016e3ad2bf5298fe593a07188483b5", "receipt": { "to": null, "from": "0x3a605B442055DF2898E18cF518feb2e2A6BD0D31", - "contractAddress": "0xfA5b622409E1782597952a4A78c1D34CF32fF5e2", - "transactionIndex": 21, - "gasUsed": "1222274", + "contractAddress": "0x406905414D6c250C186F4616EFA38D5fc0759437", + "transactionIndex": 9, + "gasUsed": "618072", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x78c93db67eb71d35e5fb9f06b7077ae21c1bd92ba2ff7013431e37910c913de8", - "transactionHash": "0xaea15e8dfb33a1cec4da0a20127d0cd1455ce8f8361ff3c59e5d913fa59ee0c5", + "blockHash": "0x45f0f8b061f80949a0520b87f833da7f6c3635abe2c5cf5a9d9c783ec1f1bb6a", + "transactionHash": "0x32ab785cd443eb8290d85810fbd3b76e92016e3ad2bf5298fe593a07188483b5", "logs": [], - "blockNumber": 7017146, - "cumulativeGasUsed": "7367133", + "blockNumber": 7260725, + "cumulativeGasUsed": "1237384", "status": 1, "byzantium": true }, @@ -113,34 +113,14 @@ "0xa6f73589243a6A7a9023b1Fa0651b1d89c177111", "0xf80267194936da1E98dB10bcE06F3147D580a62e", [ - "ChainStorageContainer-CTC-batches", - "ChainStorageContainer-SCC-batches", - "CanonicalTransactionChain", - "StateCommitmentChain", - "BondManager", - "OVM_L1CrossDomainMessenger", - "Proxy__OVM_L1CrossDomainMessenger", - "Proxy__OVM_L1StandardBridge", - "L2CrossDomainMessenger", - "OVM_Sequencer", - "OVM_Proposer" + "StateCommitmentChain" ], [ - "0x4325Ac17c7fF5Afc0d05335dD30Db3D010455813", - "0x41eF5DaF4A7719bfe89A88BA3DD0DCFF5feCeD39", - "0x607F755149cFEB3a14E1Dc3A4E2450Cde7dfb04D", - "0x72281826E90dD8A65Ab686fF254eb45Be426DD22", - "0xfC2ab6987C578218f99E85d61Dcf4814A26637Bd", - "0x2eB424e0930E93Cf250e488f6117a929714Bb928", - "0x5086d1eEF304eb5284A0f6720f79403b4e9bE294", - "0x636Af16bf2f682dD3109e60102b8E1A089FedAa8", - "0x4200000000000000000000000000000000000007", - "0x7431310e026B69BFC676C0013E12A1A11411EEc9", - "0x02b1786A85Ec3f71fBbBa46507780dB7cF9014f6" + "0x9c945aC97Baf48cB784AbBB61399beB71aF7A378" ] ], - "numDeployments": 1, - "solcInputHash": "5aae07ef9122520401369865ebc0eb3e", + "numDeployments": 3, + "solcInputHash": "96c709f6604e7bd8a94077f137b56cbc", "metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract Lib_AddressManager\",\"name\":\"_manager\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_finalOwner\",\"type\":\"address\"},{\"internalType\":\"string[]\",\"name\":\"_names\",\"type\":\"string[]\"},{\"internalType\":\"address[]\",\"name\":\"_addresses\",\"type\":\"address[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"finalOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getNamedAddresses\",\"outputs\":[{\"components\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"internalType\":\"struct AddressDictator.NamedAddress[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manager\",\"outputs\":[{\"internalType\":\"contract Lib_AddressManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"returnOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"setAddresses\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"The AddressDictator (glory to Arstotzka) is a contract that allows us to safely manipulate many different addresses in the AddressManager without transferring ownership of the AddressManager to a hot wallet or hardware wallet.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"params\":{\"_addresses\":\"Array of addresses to associate with the name.\",\"_finalOwner\":\"Address to transfer AddressManager ownership to afterwards.\",\"_manager\":\"Address of the AddressManager contract.\",\"_names\":\"Array of names to associate an address with.\"}}},\"title\":\"AddressDictator\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"getNamedAddresses()\":{\"notice\":\"Returns the full namedAddresses array.\"},\"returnOwnership()\":{\"notice\":\"Transfers ownership of this contract to the finalOwner. Only callable by the Final Owner, which is intended to be our multisig. This function shouldn't be necessary, but it gives a sense of reassurance that we can recover if something really surprising goes wrong.\"},\"setAddresses()\":{\"notice\":\"Called to finalize the transfer, this function is callable by anyone, but will only result in an upgrade if this contract is the owner Address Manager.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/L1/deployment/AddressDictator.sol\":\"AddressDictator\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _setOwner(_msgSender());\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _setOwner(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _setOwner(newOwner);\\n }\\n\\n function _setOwner(address newOwner) private {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0x6bb804a310218875e89d12c053e94a13a4607cdf7cc2052f3e52bd32a0dc50a1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x90565a39ae45c80f0468dc96c7b20d0afc3055f344c8203a0c9258239f350b9f\",\"license\":\"MIT\"},\"contracts/L1/deployment/AddressDictator.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.9;\\n\\nimport { Lib_AddressManager } from \\\"../../libraries/resolver/Lib_AddressManager.sol\\\";\\n\\n/**\\n * @title AddressDictator\\n * @dev The AddressDictator (glory to Arstotzka) is a contract that allows us to safely manipulate\\n * many different addresses in the AddressManager without transferring ownership of the\\n * AddressManager to a hot wallet or hardware wallet.\\n */\\ncontract AddressDictator {\\n /*********\\n * Types *\\n *********/\\n\\n struct NamedAddress {\\n string name;\\n address addr;\\n }\\n\\n /*************\\n * Variables *\\n *************/\\n\\n Lib_AddressManager public manager;\\n address public finalOwner;\\n NamedAddress[] namedAddresses;\\n\\n /***************\\n * Constructor *\\n ***************/\\n\\n /**\\n * @param _manager Address of the AddressManager contract.\\n * @param _finalOwner Address to transfer AddressManager ownership to afterwards.\\n * @param _names Array of names to associate an address with.\\n * @param _addresses Array of addresses to associate with the name.\\n */\\n constructor(\\n Lib_AddressManager _manager,\\n address _finalOwner,\\n string[] memory _names,\\n address[] memory _addresses\\n ) {\\n manager = _manager;\\n finalOwner = _finalOwner;\\n require(\\n _names.length == _addresses.length,\\n \\\"AddressDictator: Must provide an equal number of names and addresses.\\\"\\n );\\n for (uint256 i = 0; i < _names.length; i++) {\\n namedAddresses.push(NamedAddress({ name: _names[i], addr: _addresses[i] }));\\n }\\n }\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Called to finalize the transfer, this function is callable by anyone, but will only result in\\n * an upgrade if this contract is the owner Address Manager.\\n */\\n // slither-disable-next-line calls-loop\\n function setAddresses() external {\\n for (uint256 i = 0; i < namedAddresses.length; i++) {\\n manager.setAddress(namedAddresses[i].name, namedAddresses[i].addr);\\n }\\n // note that this will revert if _finalOwner == currentOwner\\n manager.transferOwnership(finalOwner);\\n }\\n\\n /**\\n * Transfers ownership of this contract to the finalOwner.\\n * Only callable by the Final Owner, which is intended to be our multisig.\\n * This function shouldn't be necessary, but it gives a sense of reassurance that we can recover\\n * if something really surprising goes wrong.\\n */\\n function returnOwnership() external {\\n require(msg.sender == finalOwner, \\\"AddressDictator: only callable by finalOwner\\\");\\n manager.transferOwnership(finalOwner);\\n }\\n\\n /******************\\n * View Functions *\\n ******************/\\n\\n /**\\n * Returns the full namedAddresses array.\\n */\\n function getNamedAddresses() external view returns (NamedAddress[] memory) {\\n return namedAddresses;\\n }\\n}\\n\",\"keccak256\":\"0xd67a7b7ca6d5554bca411d64c6b2d633dfe62ab74480494b99cefff2c672d06a\",\"license\":\"MIT\"},\"contracts/libraries/resolver/Lib_AddressManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.9;\\n\\n/* External Imports */\\nimport { Ownable } from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\n/**\\n * @title Lib_AddressManager\\n */\\ncontract Lib_AddressManager is Ownable {\\n /**********\\n * Events *\\n **********/\\n\\n event AddressSet(string indexed _name, address _newAddress, address _oldAddress);\\n\\n /*************\\n * Variables *\\n *************/\\n\\n mapping(bytes32 => address) private addresses;\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Changes the address associated with a particular name.\\n * @param _name String name to associate an address with.\\n * @param _address Address to associate with the name.\\n */\\n function setAddress(string memory _name, address _address) external onlyOwner {\\n bytes32 nameHash = _getNameHash(_name);\\n address oldAddress = addresses[nameHash];\\n addresses[nameHash] = _address;\\n\\n emit AddressSet(_name, _address, oldAddress);\\n }\\n\\n /**\\n * Retrieves the address associated with a given name.\\n * @param _name Name to retrieve an address for.\\n * @return Address associated with the given name.\\n */\\n function getAddress(string memory _name) external view returns (address) {\\n return addresses[_getNameHash(_name)];\\n }\\n\\n /**********************\\n * Internal Functions *\\n **********************/\\n\\n /**\\n * Computes the hash of a name.\\n * @param _name Name to compute a hash for.\\n * @return Hash of the given name.\\n */\\n function _getNameHash(string memory _name) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(_name));\\n }\\n}\\n\",\"keccak256\":\"0xcde9b29429d512c549f7c1b8a033f161fa71c18cda08b241748663854196ae14\",\"license\":\"MIT\"}},\"version\":1}", "bytecode": "0x60806040523480156200001157600080fd5b5060405162000d5e38038062000d5e83398101604081905262000034916200037a565b600080546001600160a01b038087166001600160a01b03199283161790925560018054928616929091169190911790558051825114620000ee5760405162461bcd60e51b815260206004820152604560248201527f416464726573734469637461746f723a204d7573742070726f7669646520616e60448201527f20657175616c206e756d626572206f66206e616d657320616e6420616464726560648201526439b9b2b99760d91b608482015260a40160405180910390fd5b60005b8251811015620001c357600260405180604001604052808584815181106200011d576200011d62000505565b602002602001015181526020018484815181106200013f576200013f62000505565b6020908102919091018101516001600160a01b0316909152825460018101845560009384529281902082518051939460020290910192620001849284920190620001ce565b5060209190910151600190910180546001600160a01b0319166001600160a01b0390921691909117905580620001ba816200051b565b915050620000f1565b505050505062000582565b828054620001dc9062000545565b90600052602060002090601f0160209004810192826200020057600085556200024b565b82601f106200021b57805160ff19168380011785556200024b565b828001600101855582156200024b579182015b828111156200024b5782518255916020019190600101906200022e565b50620002599291506200025d565b5090565b5b808211156200025957600081556001016200025e565b6001600160a01b03811681146200028a57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715620002ce57620002ce6200028d565b604052919050565b60006001600160401b03821115620002f257620002f26200028d565b5060051b60200190565b600082601f8301126200030e57600080fd5b81516020620003276200032183620002d6565b620002a3565b82815260059290921b840181019181810190868411156200034757600080fd5b8286015b848110156200036f578051620003618162000274565b83529183019183016200034b565b509695505050505050565b600080600080608085870312156200039157600080fd5b84516200039e8162000274565b80945050602080860151620003b38162000274565b60408701519094506001600160401b0380821115620003d157600080fd5b818801915088601f830112620003e657600080fd5b8151620003f76200032182620002d6565b81815260059190911b8301840190848101908b8311156200041757600080fd5b8585015b83811015620004ce57805185811115620004355760008081fd5b8601603f81018e13620004485760008081fd5b87810151868111156200045f576200045f6200028d565b62000473601f8201601f19168a01620002a3565b8181528f60408385010111156200048a5760008081fd5b60005b82811015620004ab57838101604001518282018c01528a016200048d565b82811115620004bd5760008b84840101525b50855250509186019186016200041b565b5060608b01519097509450505080831115620004e957600080fd5b5050620004f987828801620002fc565b91505092959194509250565b634e487b7160e01b600052603260045260246000fd5b60006000198214156200053e57634e487b7160e01b600052601160045260246000fd5b5060010190565b600181811c908216806200055a57607f821691505b602082108114156200057c57634e487b7160e01b600052602260045260246000fd5b50919050565b6107cc80620005926000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c80633ccad6fc116100505780633ccad6fc146100c0578063481c6a75146100d5578063bc3a429b146100f557600080fd5b806317ad94ec1461006c578063297d1a34146100b6575b600080fd5b60015461008c9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100be6100fd565b005b6100c8610232565b6040516100ad91906104af565b60005461008c9073ffffffffffffffffffffffffffffffffffffffff1681565b6100be610343565b60015473ffffffffffffffffffffffffffffffffffffffff1633146101a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f416464726573734469637461746f723a206f6e6c792063616c6c61626c65206260448201527f792066696e616c4f776e65720000000000000000000000000000000000000000606482015260840160405180910390fd5b6000546001546040517ff2fde38b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff918216600482015291169063f2fde38b906024015b600060405180830381600087803b15801561021857600080fd5b505af115801561022c573d6000803e3d6000fd5b50505050565b60606002805480602002602001604051908101604052809291908181526020016000905b8282101561033a5783829060005260206000209060020201604051806040016040529081600082018054610289906105ae565b80601f01602080910402602001604051908101604052809291908181526020018280546102b5906105ae565b80156103025780601f106102d757610100808354040283529160200191610302565b820191906000526020600020905b8154815290600101906020018083116102e557829003601f168201915b505050918352505060019182015473ffffffffffffffffffffffffffffffffffffffff16602091820152918352929092019101610256565b50505050905090565b60005b600254811015610454576000546002805473ffffffffffffffffffffffffffffffffffffffff90921691639b2ea4bd91908490811061038757610387610602565b9060005260206000209060020201600001600284815481106103ab576103ab610602565b60009182526020909120600160029092020101546040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815261040f929173ffffffffffffffffffffffffffffffffffffffff1690600401610631565b600060405180830381600087803b15801561042957600080fd5b505af115801561043d573d6000803e3d6000fd5b50505050808061044c90610736565b915050610346565b506000546001546040517ff2fde38b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff918216600482015291169063f2fde38b906024016101fe565b60006020808301818452808551808352604092508286019150828160051b8701018488016000805b8481101561059f577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08a8503018652825180518886528051808a880152845b81811015610532578281018c0151888201606001528b01610516565b8181111561054357856060838a0101525b50918a015173ffffffffffffffffffffffffffffffffffffffff16868b01525095880195601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01690930160600192918701916001016104d7565b50919998505050505050505050565b600181811c908216806105c257607f821691505b602082108114156105fc577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60408152600080845481600182811c91508083168061065157607f831692505b602080841082141561068a577f4e487b710000000000000000000000000000000000000000000000000000000086526022600452602486fd5b60408801849052606088018280156106a957600181146106d857610703565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00871682528282019750610703565b60008c81526020902060005b878110156106fd578154848201529086019084016106e4565b83019850505b50508596506107298189018a73ffffffffffffffffffffffffffffffffffffffff169052565b5050505050509392505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561078f577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b506001019056fea26469706673582212207993fbd341ec4f9e20c9ca42c43294b14f2a103fa8da10fc05d197e3abc8766164736f6c63430008090033", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100675760003560e01c80633ccad6fc116100505780633ccad6fc146100c0578063481c6a75146100d5578063bc3a429b146100f557600080fd5b806317ad94ec1461006c578063297d1a34146100b6575b600080fd5b60015461008c9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100be6100fd565b005b6100c8610232565b6040516100ad91906104af565b60005461008c9073ffffffffffffffffffffffffffffffffffffffff1681565b6100be610343565b60015473ffffffffffffffffffffffffffffffffffffffff1633146101a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f416464726573734469637461746f723a206f6e6c792063616c6c61626c65206260448201527f792066696e616c4f776e65720000000000000000000000000000000000000000606482015260840160405180910390fd5b6000546001546040517ff2fde38b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff918216600482015291169063f2fde38b906024015b600060405180830381600087803b15801561021857600080fd5b505af115801561022c573d6000803e3d6000fd5b50505050565b60606002805480602002602001604051908101604052809291908181526020016000905b8282101561033a5783829060005260206000209060020201604051806040016040529081600082018054610289906105ae565b80601f01602080910402602001604051908101604052809291908181526020018280546102b5906105ae565b80156103025780601f106102d757610100808354040283529160200191610302565b820191906000526020600020905b8154815290600101906020018083116102e557829003601f168201915b505050918352505060019182015473ffffffffffffffffffffffffffffffffffffffff16602091820152918352929092019101610256565b50505050905090565b60005b600254811015610454576000546002805473ffffffffffffffffffffffffffffffffffffffff90921691639b2ea4bd91908490811061038757610387610602565b9060005260206000209060020201600001600284815481106103ab576103ab610602565b60009182526020909120600160029092020101546040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815261040f929173ffffffffffffffffffffffffffffffffffffffff1690600401610631565b600060405180830381600087803b15801561042957600080fd5b505af115801561043d573d6000803e3d6000fd5b50505050808061044c90610736565b915050610346565b506000546001546040517ff2fde38b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff918216600482015291169063f2fde38b906024016101fe565b60006020808301818452808551808352604092508286019150828160051b8701018488016000805b8481101561059f577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08a8503018652825180518886528051808a880152845b81811015610532578281018c0151888201606001528b01610516565b8181111561054357856060838a0101525b50918a015173ffffffffffffffffffffffffffffffffffffffff16868b01525095880195601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01690930160600192918701916001016104d7565b50919998505050505050505050565b600181811c908216806105c257607f821691505b602082108114156105fc577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60408152600080845481600182811c91508083168061065157607f831692505b602080841082141561068a577f4e487b710000000000000000000000000000000000000000000000000000000086526022600452602486fd5b60408801849052606088018280156106a957600181146106d857610703565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00871682528282019750610703565b60008c81526020902060005b878110156106fd578154848201529086019084016106e4565b83019850505b50508596506107298189018a73ffffffffffffffffffffffffffffffffffffffff169052565b5050505050509392505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561078f577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b506001019056fea26469706673582212207993fbd341ec4f9e20c9ca42c43294b14f2a103fa8da10fc05d197e3abc8766164736f6c63430008090033", diff --git a/packages/contracts/deployments/goerli/StateCommitmentChain.json b/packages/contracts/deployments/goerli/StateCommitmentChain.json index f51c593f5452c..593eaf5f8bc90 100644 --- a/packages/contracts/deployments/goerli/StateCommitmentChain.json +++ b/packages/contracts/deployments/goerli/StateCommitmentChain.json @@ -1,5 +1,5 @@ { - "address": "0x72281826E90dD8A65Ab686fF254eb45Be426DD22", + "address": "0x9c945aC97Baf48cB784AbBB61399beB71aF7A378", "abi": [ { "inputs": [ @@ -361,29 +361,29 @@ "type": "function" } ], - "transactionHash": "0x3d2e3b8abb71f84f8f36317430b6372d33dc119d616f64a82ef0febbbd35ec41", + "transactionHash": "0x7c4fab6bc5e07e3f5984a0681402ae9b22a623b3eb26ada439044abd56d25767", "receipt": { "to": null, "from": "0x3a605B442055DF2898E18cF518feb2e2A6BD0D31", - "contractAddress": "0x72281826E90dD8A65Ab686fF254eb45Be426DD22", - "transactionIndex": 22, - "gasUsed": "1888197", + "contractAddress": "0x9c945aC97Baf48cB784AbBB61399beB71aF7A378", + "transactionIndex": 8, + "gasUsed": "1888173", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x05bcfe664eb6dfebc04869275bd8f1bd29e7b74c6a9d482223d3fe6c412b6251", - "transactionHash": "0x3d2e3b8abb71f84f8f36317430b6372d33dc119d616f64a82ef0febbbd35ec41", + "blockHash": "0xa1307d9fc4ab3a83f9780f6ac8f36a9dce22f49d4502abb3751ca8d329ad41b6", + "transactionHash": "0x7c4fab6bc5e07e3f5984a0681402ae9b22a623b3eb26ada439044abd56d25767", "logs": [], - "blockNumber": 7017104, - "cumulativeGasUsed": "3848492", + "blockNumber": 7260717, + "cumulativeGasUsed": "2333328", "status": 1, "byzantium": true }, "args": [ "0xa6f73589243a6A7a9023b1Fa0651b1d89c177111", - 604800, + 10, 12592000 ], "numDeployments": 1, - "solcInputHash": "0b6b0f2f7cbf6cb1011b2fd242eb9f69", + "solcInputHash": "12afc2c6487cfec4471fc920fd475624", "metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_libAddressManager\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_fraudProofWindow\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_sequencerPublishWindow\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_batchIndex\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"_batchRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_batchSize\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_prevTotalElements\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"StateBatchAppended\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_batchIndex\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"_batchRoot\",\"type\":\"bytes32\"}],\"name\":\"StateBatchDeleted\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"FRAUD_PROOF_WINDOW\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SEQUENCER_PUBLISH_WINDOW\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"_batch\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint256\",\"name\":\"_shouldStartAtElement\",\"type\":\"uint256\"}],\"name\":\"appendStateBatch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"batches\",\"outputs\":[{\"internalType\":\"contract IChainStorageContainer\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"batchIndex\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"batchRoot\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"batchSize\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"prevTotalElements\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Lib_OVMCodec.ChainBatchHeader\",\"name\":\"_batchHeader\",\"type\":\"tuple\"}],\"name\":\"deleteStateBatch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLastSequencerTimestamp\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_lastSequencerTimestamp\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTotalBatches\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_totalBatches\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTotalElements\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_totalElements\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"batchIndex\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"batchRoot\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"batchSize\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"prevTotalElements\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Lib_OVMCodec.ChainBatchHeader\",\"name\":\"_batchHeader\",\"type\":\"tuple\"}],\"name\":\"insideFraudProofWindow\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"_inside\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"libAddressManager\",\"outputs\":[{\"internalType\":\"contract Lib_AddressManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_element\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"batchIndex\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"batchRoot\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"batchSize\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"prevTotalElements\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Lib_OVMCodec.ChainBatchHeader\",\"name\":\"_batchHeader\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"},{\"internalType\":\"bytes32[]\",\"name\":\"siblings\",\"type\":\"bytes32[]\"}],\"internalType\":\"struct Lib_OVMCodec.ChainInclusionProof\",\"name\":\"_proof\",\"type\":\"tuple\"}],\"name\":\"verifyStateCommitment\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"The State Commitment Chain (SCC) contract contains a list of proposed state roots which Proposers assert to be a result of each transaction in the Canonical Transaction Chain (CTC). Elements here have a 1:1 correspondence with transactions in the CTC, and should be the unique state root calculated off-chain by applying the canonical transactions one by one.\",\"kind\":\"dev\",\"methods\":{\"appendStateBatch(bytes32[],uint256)\":{\"params\":{\"_batch\":\"Batch of state roots.\",\"_shouldStartAtElement\":\"Index of the element at which this batch should start.\"}},\"batches()\":{\"returns\":{\"_0\":\"Reference to the batch storage container.\"}},\"constructor\":{\"params\":{\"_libAddressManager\":\"Address of the Address Manager.\"}},\"deleteStateBatch((uint256,bytes32,uint256,uint256,bytes))\":{\"params\":{\"_batchHeader\":\"Header of the batch to start deleting from.\"}},\"getLastSequencerTimestamp()\":{\"returns\":{\"_lastSequencerTimestamp\":\"Last sequencer batch timestamp.\"}},\"getTotalBatches()\":{\"returns\":{\"_totalBatches\":\"Total submitted batches.\"}},\"getTotalElements()\":{\"returns\":{\"_totalElements\":\"Total submitted elements.\"}},\"insideFraudProofWindow((uint256,bytes32,uint256,uint256,bytes))\":{\"params\":{\"_batchHeader\":\"Header of the batch to check.\"},\"returns\":{\"_inside\":\"Whether or not the batch is inside the fraud proof window.\"}},\"resolve(string)\":{\"params\":{\"_name\":\"Name to resolve an address for.\"},\"returns\":{\"_0\":\"Address associated with the given name.\"}},\"verifyStateCommitment(bytes32,(uint256,bytes32,uint256,uint256,bytes),(uint256,bytes32[]))\":{\"params\":{\"_batchHeader\":\"Header of the batch in which the element was included.\",\"_element\":\"Hash of the element to verify a proof for.\",\"_proof\":\"Merkle inclusion proof for the element.\"}}},\"title\":\"StateCommitmentChain\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"appendStateBatch(bytes32[],uint256)\":{\"notice\":\"Appends a batch of state roots to the chain.\"},\"batches()\":{\"notice\":\"Accesses the batch storage container.\"},\"deleteStateBatch((uint256,bytes32,uint256,uint256,bytes))\":{\"notice\":\"Deletes all state roots after (and including) a given batch.\"},\"getLastSequencerTimestamp()\":{\"notice\":\"Retrieves the timestamp of the last batch submitted by the sequencer.\"},\"getTotalBatches()\":{\"notice\":\"Retrieves the total number of batches submitted.\"},\"getTotalElements()\":{\"notice\":\"Retrieves the total number of elements submitted.\"},\"insideFraudProofWindow((uint256,bytes32,uint256,uint256,bytes))\":{\"notice\":\"Checks whether a given batch is still inside its fraud proof window.\"},\"resolve(string)\":{\"notice\":\"Resolves the address associated with a given name.\"},\"verifyStateCommitment(bytes32,(uint256,bytes32,uint256,uint256,bytes),(uint256,bytes32[]))\":{\"notice\":\"Verifies a batch inclusion proof.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/L1/rollup/StateCommitmentChain.sol\":\"StateCommitmentChain\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _setOwner(_msgSender());\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _setOwner(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _setOwner(newOwner);\\n }\\n\\n function _setOwner(address newOwner) private {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0x6bb804a310218875e89d12c053e94a13a4607cdf7cc2052f3e52bd32a0dc50a1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x90565a39ae45c80f0468dc96c7b20d0afc3055f344c8203a0c9258239f350b9f\",\"license\":\"MIT\"},\"contracts/L1/rollup/ICanonicalTransactionChain.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.9.0;\\n\\n/* Library Imports */\\nimport { Lib_OVMCodec } from \\\"../../libraries/codec/Lib_OVMCodec.sol\\\";\\n\\n/* Interface Imports */\\nimport { IChainStorageContainer } from \\\"./IChainStorageContainer.sol\\\";\\n\\n/**\\n * @title ICanonicalTransactionChain\\n */\\ninterface ICanonicalTransactionChain {\\n /**********\\n * Events *\\n **********/\\n\\n event L2GasParamsUpdated(\\n uint256 l2GasDiscountDivisor,\\n uint256 enqueueGasCost,\\n uint256 enqueueL2GasPrepaid\\n );\\n\\n event TransactionEnqueued(\\n address indexed _l1TxOrigin,\\n address indexed _target,\\n uint256 _gasLimit,\\n bytes _data,\\n uint256 indexed _queueIndex,\\n uint256 _timestamp\\n );\\n\\n event QueueBatchAppended(\\n uint256 _startingQueueIndex,\\n uint256 _numQueueElements,\\n uint256 _totalElements\\n );\\n\\n event SequencerBatchAppended(\\n uint256 _startingQueueIndex,\\n uint256 _numQueueElements,\\n uint256 _totalElements\\n );\\n\\n event TransactionBatchAppended(\\n uint256 indexed _batchIndex,\\n bytes32 _batchRoot,\\n uint256 _batchSize,\\n uint256 _prevTotalElements,\\n bytes _extraData\\n );\\n\\n /***********\\n * Structs *\\n ***********/\\n\\n struct BatchContext {\\n uint256 numSequencedTransactions;\\n uint256 numSubsequentQueueTransactions;\\n uint256 timestamp;\\n uint256 blockNumber;\\n }\\n\\n /*******************************\\n * Authorized Setter Functions *\\n *******************************/\\n\\n /**\\n * Allows the Burn Admin to update the parameters which determine the amount of gas to burn.\\n * The value of enqueueL2GasPrepaid is immediately updated as well.\\n */\\n function setGasParams(uint256 _l2GasDiscountDivisor, uint256 _enqueueGasCost) external;\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Accesses the batch storage container.\\n * @return Reference to the batch storage container.\\n */\\n function batches() external view returns (IChainStorageContainer);\\n\\n /**\\n * Retrieves the total number of elements submitted.\\n * @return _totalElements Total submitted elements.\\n */\\n function getTotalElements() external view returns (uint256 _totalElements);\\n\\n /**\\n * Retrieves the total number of batches submitted.\\n * @return _totalBatches Total submitted batches.\\n */\\n function getTotalBatches() external view returns (uint256 _totalBatches);\\n\\n /**\\n * Returns the index of the next element to be enqueued.\\n * @return Index for the next queue element.\\n */\\n function getNextQueueIndex() external view returns (uint40);\\n\\n /**\\n * Gets the queue element at a particular index.\\n * @param _index Index of the queue element to access.\\n * @return _element Queue element at the given index.\\n */\\n function getQueueElement(uint256 _index)\\n external\\n view\\n returns (Lib_OVMCodec.QueueElement memory _element);\\n\\n /**\\n * Returns the timestamp of the last transaction.\\n * @return Timestamp for the last transaction.\\n */\\n function getLastTimestamp() external view returns (uint40);\\n\\n /**\\n * Returns the blocknumber of the last transaction.\\n * @return Blocknumber for the last transaction.\\n */\\n function getLastBlockNumber() external view returns (uint40);\\n\\n /**\\n * Get the number of queue elements which have not yet been included.\\n * @return Number of pending queue elements.\\n */\\n function getNumPendingQueueElements() external view returns (uint40);\\n\\n /**\\n * Retrieves the length of the queue, including\\n * both pending and canonical transactions.\\n * @return Length of the queue.\\n */\\n function getQueueLength() external view returns (uint40);\\n\\n /**\\n * Adds a transaction to the queue.\\n * @param _target Target contract to send the transaction to.\\n * @param _gasLimit Gas limit for the given transaction.\\n * @param _data Transaction data.\\n */\\n function enqueue(\\n address _target,\\n uint256 _gasLimit,\\n bytes memory _data\\n ) external;\\n\\n /**\\n * Allows the sequencer to append a batch of transactions.\\n * @dev This function uses a custom encoding scheme for efficiency reasons.\\n * .param _shouldStartAtElement Specific batch we expect to start appending to.\\n * .param _totalElementsToAppend Total number of batch elements we expect to append.\\n * .param _contexts Array of batch contexts.\\n * .param _transactionDataFields Array of raw transaction data.\\n */\\n function appendSequencerBatch(\\n // uint40 _shouldStartAtElement,\\n // uint24 _totalElementsToAppend,\\n // BatchContext[] _contexts,\\n // bytes[] _transactionDataFields\\n ) external;\\n}\\n\",\"keccak256\":\"0xa534e90efd57e3c36053cb4aabba63ef8f53e35e3a4ce3d0f127ec2d0af1f618\",\"license\":\"MIT\"},\"contracts/L1/rollup/IChainStorageContainer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.9.0;\\n\\n/**\\n * @title IChainStorageContainer\\n */\\ninterface IChainStorageContainer {\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Sets the container's global metadata field. We're using `bytes27` here because we use five\\n * bytes to maintain the length of the underlying data structure, meaning we have an extra\\n * 27 bytes to store arbitrary data.\\n * @param _globalMetadata New global metadata to set.\\n */\\n function setGlobalMetadata(bytes27 _globalMetadata) external;\\n\\n /**\\n * Retrieves the container's global metadata field.\\n * @return Container global metadata field.\\n */\\n function getGlobalMetadata() external view returns (bytes27);\\n\\n /**\\n * Retrieves the number of objects stored in the container.\\n * @return Number of objects in the container.\\n */\\n function length() external view returns (uint256);\\n\\n /**\\n * Pushes an object into the container.\\n * @param _object A 32 byte value to insert into the container.\\n */\\n function push(bytes32 _object) external;\\n\\n /**\\n * Pushes an object into the container. Function allows setting the global metadata since\\n * we'll need to touch the \\\"length\\\" storage slot anyway, which also contains the global\\n * metadata (it's an optimization).\\n * @param _object A 32 byte value to insert into the container.\\n * @param _globalMetadata New global metadata for the container.\\n */\\n function push(bytes32 _object, bytes27 _globalMetadata) external;\\n\\n /**\\n * Retrieves an object from the container.\\n * @param _index Index of the particular object to access.\\n * @return 32 byte object value.\\n */\\n function get(uint256 _index) external view returns (bytes32);\\n\\n /**\\n * Removes all objects after and including a given index.\\n * @param _index Object index to delete from.\\n */\\n function deleteElementsAfterInclusive(uint256 _index) external;\\n\\n /**\\n * Removes all objects after and including a given index. Also allows setting the global\\n * metadata field.\\n * @param _index Object index to delete from.\\n * @param _globalMetadata New global metadata for the container.\\n */\\n function deleteElementsAfterInclusive(uint256 _index, bytes27 _globalMetadata) external;\\n}\\n\",\"keccak256\":\"0xe55ad72572ec47dc09a02228d0c5a438571c76a41d16d92b35add057811977ce\",\"license\":\"MIT\"},\"contracts/L1/rollup/IStateCommitmentChain.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >0.5.0 <0.9.0;\\n\\n/* Library Imports */\\nimport { Lib_OVMCodec } from \\\"../../libraries/codec/Lib_OVMCodec.sol\\\";\\n\\n/**\\n * @title IStateCommitmentChain\\n */\\ninterface IStateCommitmentChain {\\n /**********\\n * Events *\\n **********/\\n\\n event StateBatchAppended(\\n uint256 indexed _batchIndex,\\n bytes32 _batchRoot,\\n uint256 _batchSize,\\n uint256 _prevTotalElements,\\n bytes _extraData\\n );\\n\\n event StateBatchDeleted(uint256 indexed _batchIndex, bytes32 _batchRoot);\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Retrieves the total number of elements submitted.\\n * @return _totalElements Total submitted elements.\\n */\\n function getTotalElements() external view returns (uint256 _totalElements);\\n\\n /**\\n * Retrieves the total number of batches submitted.\\n * @return _totalBatches Total submitted batches.\\n */\\n function getTotalBatches() external view returns (uint256 _totalBatches);\\n\\n /**\\n * Retrieves the timestamp of the last batch submitted by the sequencer.\\n * @return _lastSequencerTimestamp Last sequencer batch timestamp.\\n */\\n function getLastSequencerTimestamp() external view returns (uint256 _lastSequencerTimestamp);\\n\\n /**\\n * Appends a batch of state roots to the chain.\\n * @param _batch Batch of state roots.\\n * @param _shouldStartAtElement Index of the element at which this batch should start.\\n */\\n function appendStateBatch(bytes32[] calldata _batch, uint256 _shouldStartAtElement) external;\\n\\n /**\\n * Deletes all state roots after (and including) a given batch.\\n * @param _batchHeader Header of the batch to start deleting from.\\n */\\n function deleteStateBatch(Lib_OVMCodec.ChainBatchHeader memory _batchHeader) external;\\n\\n /**\\n * Verifies a batch inclusion proof.\\n * @param _element Hash of the element to verify a proof for.\\n * @param _batchHeader Header of the batch in which the element was included.\\n * @param _proof Merkle inclusion proof for the element.\\n */\\n function verifyStateCommitment(\\n bytes32 _element,\\n Lib_OVMCodec.ChainBatchHeader memory _batchHeader,\\n Lib_OVMCodec.ChainInclusionProof memory _proof\\n ) external view returns (bool _verified);\\n\\n /**\\n * Checks whether a given batch is still inside its fraud proof window.\\n * @param _batchHeader Header of the batch to check.\\n * @return _inside Whether or not the batch is inside the fraud proof window.\\n */\\n function insideFraudProofWindow(Lib_OVMCodec.ChainBatchHeader memory _batchHeader)\\n external\\n view\\n returns (bool _inside);\\n}\\n\",\"keccak256\":\"0x47253e63bc34a006102374c39c052470b977e1eb63dacc953e2cbff19940de69\",\"license\":\"MIT\"},\"contracts/L1/rollup/StateCommitmentChain.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.9;\\n\\n/* Library Imports */\\nimport { Lib_OVMCodec } from \\\"../../libraries/codec/Lib_OVMCodec.sol\\\";\\nimport { Lib_AddressResolver } from \\\"../../libraries/resolver/Lib_AddressResolver.sol\\\";\\nimport { Lib_MerkleTree } from \\\"../../libraries/utils/Lib_MerkleTree.sol\\\";\\n\\n/* Interface Imports */\\nimport { IStateCommitmentChain } from \\\"./IStateCommitmentChain.sol\\\";\\nimport { ICanonicalTransactionChain } from \\\"./ICanonicalTransactionChain.sol\\\";\\nimport { IBondManager } from \\\"../verification/IBondManager.sol\\\";\\nimport { IChainStorageContainer } from \\\"./IChainStorageContainer.sol\\\";\\n\\n/**\\n * @title StateCommitmentChain\\n * @dev The State Commitment Chain (SCC) contract contains a list of proposed state roots which\\n * Proposers assert to be a result of each transaction in the Canonical Transaction Chain (CTC).\\n * Elements here have a 1:1 correspondence with transactions in the CTC, and should be the unique\\n * state root calculated off-chain by applying the canonical transactions one by one.\\n *\\n */\\ncontract StateCommitmentChain is IStateCommitmentChain, Lib_AddressResolver {\\n /*************\\n * Constants *\\n *************/\\n\\n uint256 public FRAUD_PROOF_WINDOW;\\n uint256 public SEQUENCER_PUBLISH_WINDOW;\\n\\n /***************\\n * Constructor *\\n ***************/\\n\\n /**\\n * @param _libAddressManager Address of the Address Manager.\\n */\\n constructor(\\n address _libAddressManager,\\n uint256 _fraudProofWindow,\\n uint256 _sequencerPublishWindow\\n ) Lib_AddressResolver(_libAddressManager) {\\n FRAUD_PROOF_WINDOW = _fraudProofWindow;\\n SEQUENCER_PUBLISH_WINDOW = _sequencerPublishWindow;\\n }\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Accesses the batch storage container.\\n * @return Reference to the batch storage container.\\n */\\n function batches() public view returns (IChainStorageContainer) {\\n return IChainStorageContainer(resolve(\\\"ChainStorageContainer-SCC-batches\\\"));\\n }\\n\\n /**\\n * @inheritdoc IStateCommitmentChain\\n */\\n function getTotalElements() public view returns (uint256 _totalElements) {\\n (uint40 totalElements, ) = _getBatchExtraData();\\n return uint256(totalElements);\\n }\\n\\n /**\\n * @inheritdoc IStateCommitmentChain\\n */\\n function getTotalBatches() public view returns (uint256 _totalBatches) {\\n return batches().length();\\n }\\n\\n /**\\n * @inheritdoc IStateCommitmentChain\\n */\\n // slither-disable-next-line external-function\\n function getLastSequencerTimestamp() public view returns (uint256 _lastSequencerTimestamp) {\\n (, uint40 lastSequencerTimestamp) = _getBatchExtraData();\\n return uint256(lastSequencerTimestamp);\\n }\\n\\n /**\\n * @inheritdoc IStateCommitmentChain\\n */\\n // slither-disable-next-line external-function\\n function appendStateBatch(bytes32[] memory _batch, uint256 _shouldStartAtElement) public {\\n // Fail fast in to make sure our batch roots aren't accidentally made fraudulent by the\\n // publication of batches by some other user.\\n require(\\n _shouldStartAtElement == getTotalElements(),\\n \\\"Actual batch start index does not match expected start index.\\\"\\n );\\n\\n // Proposers must have previously staked at the BondManager\\n require(\\n IBondManager(resolve(\\\"BondManager\\\")).isCollateralized(msg.sender),\\n \\\"Proposer does not have enough collateral posted\\\"\\n );\\n\\n require(_batch.length > 0, \\\"Cannot submit an empty state batch.\\\");\\n\\n require(\\n getTotalElements() + _batch.length <=\\n ICanonicalTransactionChain(resolve(\\\"CanonicalTransactionChain\\\")).getTotalElements(),\\n \\\"Number of state roots cannot exceed the number of canonical transactions.\\\"\\n );\\n\\n // Pass the block's timestamp and the publisher of the data\\n // to be used in the fraud proofs\\n _appendBatch(_batch, abi.encode(block.timestamp, msg.sender));\\n }\\n\\n /**\\n * @inheritdoc IStateCommitmentChain\\n */\\n // slither-disable-next-line external-function\\n function deleteStateBatch(Lib_OVMCodec.ChainBatchHeader memory _batchHeader) public {\\n require(\\n msg.sender == resolve(\\\"OVM_FraudVerifier\\\"),\\n \\\"State batches can only be deleted by the OVM_FraudVerifier.\\\"\\n );\\n\\n require(_isValidBatchHeader(_batchHeader), \\\"Invalid batch header.\\\");\\n\\n require(\\n insideFraudProofWindow(_batchHeader),\\n \\\"State batches can only be deleted within the fraud proof window.\\\"\\n );\\n\\n _deleteBatch(_batchHeader);\\n }\\n\\n /**\\n * @inheritdoc IStateCommitmentChain\\n */\\n // slither-disable-next-line external-function\\n function verifyStateCommitment(\\n bytes32 _element,\\n Lib_OVMCodec.ChainBatchHeader memory _batchHeader,\\n Lib_OVMCodec.ChainInclusionProof memory _proof\\n ) public view returns (bool) {\\n require(_isValidBatchHeader(_batchHeader), \\\"Invalid batch header.\\\");\\n\\n require(\\n Lib_MerkleTree.verify(\\n _batchHeader.batchRoot,\\n _element,\\n _proof.index,\\n _proof.siblings,\\n _batchHeader.batchSize\\n ),\\n \\\"Invalid inclusion proof.\\\"\\n );\\n\\n return true;\\n }\\n\\n /**\\n * @inheritdoc IStateCommitmentChain\\n */\\n function insideFraudProofWindow(Lib_OVMCodec.ChainBatchHeader memory _batchHeader)\\n public\\n view\\n returns (bool _inside)\\n {\\n (uint256 timestamp, ) = abi.decode(_batchHeader.extraData, (uint256, address));\\n\\n require(timestamp != 0, \\\"Batch header timestamp cannot be zero\\\");\\n return (timestamp + FRAUD_PROOF_WINDOW) > block.timestamp;\\n }\\n\\n /**********************\\n * Internal Functions *\\n **********************/\\n\\n /**\\n * Parses the batch context from the extra data.\\n * @return Total number of elements submitted.\\n * @return Timestamp of the last batch submitted by the sequencer.\\n */\\n function _getBatchExtraData() internal view returns (uint40, uint40) {\\n bytes27 extraData = batches().getGlobalMetadata();\\n\\n // solhint-disable max-line-length\\n uint40 totalElements;\\n uint40 lastSequencerTimestamp;\\n assembly {\\n extraData := shr(40, extraData)\\n totalElements := and(\\n extraData,\\n 0x000000000000000000000000000000000000000000000000000000FFFFFFFFFF\\n )\\n lastSequencerTimestamp := shr(\\n 40,\\n and(extraData, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000)\\n )\\n }\\n // solhint-enable max-line-length\\n\\n return (totalElements, lastSequencerTimestamp);\\n }\\n\\n /**\\n * Encodes the batch context for the extra data.\\n * @param _totalElements Total number of elements submitted.\\n * @param _lastSequencerTimestamp Timestamp of the last batch submitted by the sequencer.\\n * @return Encoded batch context.\\n */\\n function _makeBatchExtraData(uint40 _totalElements, uint40 _lastSequencerTimestamp)\\n internal\\n pure\\n returns (bytes27)\\n {\\n bytes27 extraData;\\n assembly {\\n extraData := _totalElements\\n extraData := or(extraData, shl(40, _lastSequencerTimestamp))\\n extraData := shl(40, extraData)\\n }\\n\\n return extraData;\\n }\\n\\n /**\\n * Appends a batch to the chain.\\n * @param _batch Elements within the batch.\\n * @param _extraData Any extra data to append to the batch.\\n */\\n function _appendBatch(bytes32[] memory _batch, bytes memory _extraData) internal {\\n address sequencer = resolve(\\\"OVM_Proposer\\\");\\n (uint40 totalElements, uint40 lastSequencerTimestamp) = _getBatchExtraData();\\n\\n if (msg.sender == sequencer) {\\n lastSequencerTimestamp = uint40(block.timestamp);\\n } else {\\n // We keep track of the last batch submitted by the sequencer so there's a window in\\n // which only the sequencer can publish state roots. A window like this just reduces\\n // the chance of \\\"system breaking\\\" state roots being published while we're still in\\n // testing mode. This window should be removed or significantly reduced in the future.\\n require(\\n lastSequencerTimestamp + SEQUENCER_PUBLISH_WINDOW < block.timestamp,\\n \\\"Cannot publish state roots within the sequencer publication window.\\\"\\n );\\n }\\n\\n // For efficiency reasons getMerkleRoot modifies the `_batch` argument in place\\n // while calculating the root hash therefore any arguments passed to it must not\\n // be used again afterwards\\n Lib_OVMCodec.ChainBatchHeader memory batchHeader = Lib_OVMCodec.ChainBatchHeader({\\n batchIndex: getTotalBatches(),\\n batchRoot: Lib_MerkleTree.getMerkleRoot(_batch),\\n batchSize: _batch.length,\\n prevTotalElements: totalElements,\\n extraData: _extraData\\n });\\n\\n emit StateBatchAppended(\\n batchHeader.batchIndex,\\n batchHeader.batchRoot,\\n batchHeader.batchSize,\\n batchHeader.prevTotalElements,\\n batchHeader.extraData\\n );\\n\\n batches().push(\\n Lib_OVMCodec.hashBatchHeader(batchHeader),\\n _makeBatchExtraData(\\n uint40(batchHeader.prevTotalElements + batchHeader.batchSize),\\n lastSequencerTimestamp\\n )\\n );\\n }\\n\\n /**\\n * Removes a batch and all subsequent batches from the chain.\\n * @param _batchHeader Header of the batch to remove.\\n */\\n function _deleteBatch(Lib_OVMCodec.ChainBatchHeader memory _batchHeader) internal {\\n require(_batchHeader.batchIndex < batches().length(), \\\"Invalid batch index.\\\");\\n\\n require(_isValidBatchHeader(_batchHeader), \\\"Invalid batch header.\\\");\\n\\n // slither-disable-next-line reentrancy-events\\n batches().deleteElementsAfterInclusive(\\n _batchHeader.batchIndex,\\n _makeBatchExtraData(uint40(_batchHeader.prevTotalElements), 0)\\n );\\n\\n // slither-disable-next-line reentrancy-events\\n emit StateBatchDeleted(_batchHeader.batchIndex, _batchHeader.batchRoot);\\n }\\n\\n /**\\n * Checks that a batch header matches the stored hash for the given index.\\n * @param _batchHeader Batch header to validate.\\n * @return Whether or not the header matches the stored one.\\n */\\n function _isValidBatchHeader(Lib_OVMCodec.ChainBatchHeader memory _batchHeader)\\n internal\\n view\\n returns (bool)\\n {\\n return Lib_OVMCodec.hashBatchHeader(_batchHeader) == batches().get(_batchHeader.batchIndex);\\n }\\n}\\n\",\"keccak256\":\"0x1d0a0880402b860af05ee5cbdafc8e2ea1e5cc260cf74ea4aa3376b92391e435\",\"license\":\"MIT\"},\"contracts/L1/verification/IBondManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.9;\\n\\n/**\\n * @title IBondManager\\n */\\ninterface IBondManager {\\n /********************\\n * Public Functions *\\n ********************/\\n\\n function isCollateralized(address _who) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x4ae2dc7bf175626d2930299e73d50a7ba936171d07810497ef71fa38a4e246a7\",\"license\":\"MIT\"},\"contracts/libraries/codec/Lib_OVMCodec.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.9;\\n\\n/* Library Imports */\\nimport { Lib_RLPReader } from \\\"../rlp/Lib_RLPReader.sol\\\";\\nimport { Lib_RLPWriter } from \\\"../rlp/Lib_RLPWriter.sol\\\";\\nimport { Lib_BytesUtils } from \\\"../utils/Lib_BytesUtils.sol\\\";\\nimport { Lib_Bytes32Utils } from \\\"../utils/Lib_Bytes32Utils.sol\\\";\\n\\n/**\\n * @title Lib_OVMCodec\\n */\\nlibrary Lib_OVMCodec {\\n /*********\\n * Enums *\\n *********/\\n\\n enum QueueOrigin {\\n SEQUENCER_QUEUE,\\n L1TOL2_QUEUE\\n }\\n\\n /***********\\n * Structs *\\n ***********/\\n\\n struct EVMAccount {\\n uint256 nonce;\\n uint256 balance;\\n bytes32 storageRoot;\\n bytes32 codeHash;\\n }\\n\\n struct ChainBatchHeader {\\n uint256 batchIndex;\\n bytes32 batchRoot;\\n uint256 batchSize;\\n uint256 prevTotalElements;\\n bytes extraData;\\n }\\n\\n struct ChainInclusionProof {\\n uint256 index;\\n bytes32[] siblings;\\n }\\n\\n struct Transaction {\\n uint256 timestamp;\\n uint256 blockNumber;\\n QueueOrigin l1QueueOrigin;\\n address l1TxOrigin;\\n address entrypoint;\\n uint256 gasLimit;\\n bytes data;\\n }\\n\\n struct TransactionChainElement {\\n bool isSequenced;\\n uint256 queueIndex; // QUEUED TX ONLY\\n uint256 timestamp; // SEQUENCER TX ONLY\\n uint256 blockNumber; // SEQUENCER TX ONLY\\n bytes txData; // SEQUENCER TX ONLY\\n }\\n\\n struct QueueElement {\\n bytes32 transactionHash;\\n uint40 timestamp;\\n uint40 blockNumber;\\n }\\n\\n /**********************\\n * Internal Functions *\\n **********************/\\n\\n /**\\n * Encodes a standard OVM transaction.\\n * @param _transaction OVM transaction to encode.\\n * @return Encoded transaction bytes.\\n */\\n function encodeTransaction(Transaction memory _transaction)\\n internal\\n pure\\n returns (bytes memory)\\n {\\n return\\n abi.encodePacked(\\n _transaction.timestamp,\\n _transaction.blockNumber,\\n _transaction.l1QueueOrigin,\\n _transaction.l1TxOrigin,\\n _transaction.entrypoint,\\n _transaction.gasLimit,\\n _transaction.data\\n );\\n }\\n\\n /**\\n * Hashes a standard OVM transaction.\\n * @param _transaction OVM transaction to encode.\\n * @return Hashed transaction\\n */\\n function hashTransaction(Transaction memory _transaction) internal pure returns (bytes32) {\\n return keccak256(encodeTransaction(_transaction));\\n }\\n\\n /**\\n * @notice Decodes an RLP-encoded account state into a useful struct.\\n * @param _encoded RLP-encoded account state.\\n * @return Account state struct.\\n */\\n function decodeEVMAccount(bytes memory _encoded) internal pure returns (EVMAccount memory) {\\n Lib_RLPReader.RLPItem[] memory accountState = Lib_RLPReader.readList(_encoded);\\n\\n return\\n EVMAccount({\\n nonce: Lib_RLPReader.readUint256(accountState[0]),\\n balance: Lib_RLPReader.readUint256(accountState[1]),\\n storageRoot: Lib_RLPReader.readBytes32(accountState[2]),\\n codeHash: Lib_RLPReader.readBytes32(accountState[3])\\n });\\n }\\n\\n /**\\n * Calculates a hash for a given batch header.\\n * @param _batchHeader Header to hash.\\n * @return Hash of the header.\\n */\\n function hashBatchHeader(Lib_OVMCodec.ChainBatchHeader memory _batchHeader)\\n internal\\n pure\\n returns (bytes32)\\n {\\n return\\n keccak256(\\n abi.encode(\\n _batchHeader.batchRoot,\\n _batchHeader.batchSize,\\n _batchHeader.prevTotalElements,\\n _batchHeader.extraData\\n )\\n );\\n }\\n}\\n\",\"keccak256\":\"0xb5009ac1e0617e0b3b2fb917f08f8e8a7ae706034cc3a675258bc3d91978525e\",\"license\":\"MIT\"},\"contracts/libraries/resolver/Lib_AddressManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.9;\\n\\n/* External Imports */\\nimport { Ownable } from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\n/**\\n * @title Lib_AddressManager\\n */\\ncontract Lib_AddressManager is Ownable {\\n /**********\\n * Events *\\n **********/\\n\\n event AddressSet(string indexed _name, address _newAddress, address _oldAddress);\\n\\n /*************\\n * Variables *\\n *************/\\n\\n mapping(bytes32 => address) private addresses;\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Changes the address associated with a particular name.\\n * @param _name String name to associate an address with.\\n * @param _address Address to associate with the name.\\n */\\n function setAddress(string memory _name, address _address) external onlyOwner {\\n bytes32 nameHash = _getNameHash(_name);\\n address oldAddress = addresses[nameHash];\\n addresses[nameHash] = _address;\\n\\n emit AddressSet(_name, _address, oldAddress);\\n }\\n\\n /**\\n * Retrieves the address associated with a given name.\\n * @param _name Name to retrieve an address for.\\n * @return Address associated with the given name.\\n */\\n function getAddress(string memory _name) external view returns (address) {\\n return addresses[_getNameHash(_name)];\\n }\\n\\n /**********************\\n * Internal Functions *\\n **********************/\\n\\n /**\\n * Computes the hash of a name.\\n * @param _name Name to compute a hash for.\\n * @return Hash of the given name.\\n */\\n function _getNameHash(string memory _name) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(_name));\\n }\\n}\\n\",\"keccak256\":\"0xcde9b29429d512c549f7c1b8a033f161fa71c18cda08b241748663854196ae14\",\"license\":\"MIT\"},\"contracts/libraries/resolver/Lib_AddressResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.9;\\n\\n/* Library Imports */\\nimport { Lib_AddressManager } from \\\"./Lib_AddressManager.sol\\\";\\n\\n/**\\n * @title Lib_AddressResolver\\n */\\nabstract contract Lib_AddressResolver {\\n /*************\\n * Variables *\\n *************/\\n\\n Lib_AddressManager public libAddressManager;\\n\\n /***************\\n * Constructor *\\n ***************/\\n\\n /**\\n * @param _libAddressManager Address of the Lib_AddressManager.\\n */\\n constructor(address _libAddressManager) {\\n libAddressManager = Lib_AddressManager(_libAddressManager);\\n }\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Resolves the address associated with a given name.\\n * @param _name Name to resolve an address for.\\n * @return Address associated with the given name.\\n */\\n function resolve(string memory _name) public view returns (address) {\\n return libAddressManager.getAddress(_name);\\n }\\n}\\n\",\"keccak256\":\"0x515c4db671a28e2fe180201f6d11c0208c05f582ca3489fb6b8e81c27659bc62\",\"license\":\"MIT\"},\"contracts/libraries/rlp/Lib_RLPReader.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.9;\\n\\n/**\\n * @title Lib_RLPReader\\n * @dev Adapted from \\\"RLPReader\\\" by Hamdi Allam (hamdi.allam97@gmail.com).\\n */\\nlibrary Lib_RLPReader {\\n /*************\\n * Constants *\\n *************/\\n\\n uint256 internal constant MAX_LIST_LENGTH = 32;\\n\\n /*********\\n * Enums *\\n *********/\\n\\n enum RLPItemType {\\n DATA_ITEM,\\n LIST_ITEM\\n }\\n\\n /***********\\n * Structs *\\n ***********/\\n\\n struct RLPItem {\\n uint256 length;\\n uint256 ptr;\\n }\\n\\n /**********************\\n * Internal Functions *\\n **********************/\\n\\n /**\\n * Converts bytes to a reference to memory position and length.\\n * @param _in Input bytes to convert.\\n * @return Output memory reference.\\n */\\n function toRLPItem(bytes memory _in) internal pure returns (RLPItem memory) {\\n uint256 ptr;\\n assembly {\\n ptr := add(_in, 32)\\n }\\n\\n return RLPItem({ length: _in.length, ptr: ptr });\\n }\\n\\n /**\\n * Reads an RLP list value into a list of RLP items.\\n * @param _in RLP list value.\\n * @return Decoded RLP list items.\\n */\\n function readList(RLPItem memory _in) internal pure returns (RLPItem[] memory) {\\n (uint256 listOffset, , RLPItemType itemType) = _decodeLength(_in);\\n\\n require(itemType == RLPItemType.LIST_ITEM, \\\"Invalid RLP list value.\\\");\\n\\n // Solidity in-memory arrays can't be increased in size, but *can* be decreased in size by\\n // writing to the length. Since we can't know the number of RLP items without looping over\\n // the entire input, we'd have to loop twice to accurately size this array. It's easier to\\n // simply set a reasonable maximum list length and decrease the size before we finish.\\n RLPItem[] memory out = new RLPItem[](MAX_LIST_LENGTH);\\n\\n uint256 itemCount = 0;\\n uint256 offset = listOffset;\\n while (offset < _in.length) {\\n require(itemCount < MAX_LIST_LENGTH, \\\"Provided RLP list exceeds max list length.\\\");\\n\\n (uint256 itemOffset, uint256 itemLength, ) = _decodeLength(\\n RLPItem({ length: _in.length - offset, ptr: _in.ptr + offset })\\n );\\n\\n out[itemCount] = RLPItem({ length: itemLength + itemOffset, ptr: _in.ptr + offset });\\n\\n itemCount += 1;\\n offset += itemOffset + itemLength;\\n }\\n\\n // Decrease the array size to match the actual item count.\\n assembly {\\n mstore(out, itemCount)\\n }\\n\\n return out;\\n }\\n\\n /**\\n * Reads an RLP list value into a list of RLP items.\\n * @param _in RLP list value.\\n * @return Decoded RLP list items.\\n */\\n function readList(bytes memory _in) internal pure returns (RLPItem[] memory) {\\n return readList(toRLPItem(_in));\\n }\\n\\n /**\\n * Reads an RLP bytes value into bytes.\\n * @param _in RLP bytes value.\\n * @return Decoded bytes.\\n */\\n function readBytes(RLPItem memory _in) internal pure returns (bytes memory) {\\n (uint256 itemOffset, uint256 itemLength, RLPItemType itemType) = _decodeLength(_in);\\n\\n require(itemType == RLPItemType.DATA_ITEM, \\\"Invalid RLP bytes value.\\\");\\n\\n return _copy(_in.ptr, itemOffset, itemLength);\\n }\\n\\n /**\\n * Reads an RLP bytes value into bytes.\\n * @param _in RLP bytes value.\\n * @return Decoded bytes.\\n */\\n function readBytes(bytes memory _in) internal pure returns (bytes memory) {\\n return readBytes(toRLPItem(_in));\\n }\\n\\n /**\\n * Reads an RLP string value into a string.\\n * @param _in RLP string value.\\n * @return Decoded string.\\n */\\n function readString(RLPItem memory _in) internal pure returns (string memory) {\\n return string(readBytes(_in));\\n }\\n\\n /**\\n * Reads an RLP string value into a string.\\n * @param _in RLP string value.\\n * @return Decoded string.\\n */\\n function readString(bytes memory _in) internal pure returns (string memory) {\\n return readString(toRLPItem(_in));\\n }\\n\\n /**\\n * Reads an RLP bytes32 value into a bytes32.\\n * @param _in RLP bytes32 value.\\n * @return Decoded bytes32.\\n */\\n function readBytes32(RLPItem memory _in) internal pure returns (bytes32) {\\n require(_in.length <= 33, \\\"Invalid RLP bytes32 value.\\\");\\n\\n (uint256 itemOffset, uint256 itemLength, RLPItemType itemType) = _decodeLength(_in);\\n\\n require(itemType == RLPItemType.DATA_ITEM, \\\"Invalid RLP bytes32 value.\\\");\\n\\n uint256 ptr = _in.ptr + itemOffset;\\n bytes32 out;\\n assembly {\\n out := mload(ptr)\\n\\n // Shift the bytes over to match the item size.\\n if lt(itemLength, 32) {\\n out := div(out, exp(256, sub(32, itemLength)))\\n }\\n }\\n\\n return out;\\n }\\n\\n /**\\n * Reads an RLP bytes32 value into a bytes32.\\n * @param _in RLP bytes32 value.\\n * @return Decoded bytes32.\\n */\\n function readBytes32(bytes memory _in) internal pure returns (bytes32) {\\n return readBytes32(toRLPItem(_in));\\n }\\n\\n /**\\n * Reads an RLP uint256 value into a uint256.\\n * @param _in RLP uint256 value.\\n * @return Decoded uint256.\\n */\\n function readUint256(RLPItem memory _in) internal pure returns (uint256) {\\n return uint256(readBytes32(_in));\\n }\\n\\n /**\\n * Reads an RLP uint256 value into a uint256.\\n * @param _in RLP uint256 value.\\n * @return Decoded uint256.\\n */\\n function readUint256(bytes memory _in) internal pure returns (uint256) {\\n return readUint256(toRLPItem(_in));\\n }\\n\\n /**\\n * Reads an RLP bool value into a bool.\\n * @param _in RLP bool value.\\n * @return Decoded bool.\\n */\\n function readBool(RLPItem memory _in) internal pure returns (bool) {\\n require(_in.length == 1, \\\"Invalid RLP boolean value.\\\");\\n\\n uint256 ptr = _in.ptr;\\n uint256 out;\\n assembly {\\n out := byte(0, mload(ptr))\\n }\\n\\n require(out == 0 || out == 1, \\\"Lib_RLPReader: Invalid RLP boolean value, must be 0 or 1\\\");\\n\\n return out != 0;\\n }\\n\\n /**\\n * Reads an RLP bool value into a bool.\\n * @param _in RLP bool value.\\n * @return Decoded bool.\\n */\\n function readBool(bytes memory _in) internal pure returns (bool) {\\n return readBool(toRLPItem(_in));\\n }\\n\\n /**\\n * Reads an RLP address value into a address.\\n * @param _in RLP address value.\\n * @return Decoded address.\\n */\\n function readAddress(RLPItem memory _in) internal pure returns (address) {\\n if (_in.length == 1) {\\n return address(0);\\n }\\n\\n require(_in.length == 21, \\\"Invalid RLP address value.\\\");\\n\\n return address(uint160(readUint256(_in)));\\n }\\n\\n /**\\n * Reads an RLP address value into a address.\\n * @param _in RLP address value.\\n * @return Decoded address.\\n */\\n function readAddress(bytes memory _in) internal pure returns (address) {\\n return readAddress(toRLPItem(_in));\\n }\\n\\n /**\\n * Reads the raw bytes of an RLP item.\\n * @param _in RLP item to read.\\n * @return Raw RLP bytes.\\n */\\n function readRawBytes(RLPItem memory _in) internal pure returns (bytes memory) {\\n return _copy(_in);\\n }\\n\\n /*********************\\n * Private Functions *\\n *********************/\\n\\n /**\\n * Decodes the length of an RLP item.\\n * @param _in RLP item to decode.\\n * @return Offset of the encoded data.\\n * @return Length of the encoded data.\\n * @return RLP item type (LIST_ITEM or DATA_ITEM).\\n */\\n function _decodeLength(RLPItem memory _in)\\n private\\n pure\\n returns (\\n uint256,\\n uint256,\\n RLPItemType\\n )\\n {\\n require(_in.length > 0, \\\"RLP item cannot be null.\\\");\\n\\n uint256 ptr = _in.ptr;\\n uint256 prefix;\\n assembly {\\n prefix := byte(0, mload(ptr))\\n }\\n\\n if (prefix <= 0x7f) {\\n // Single byte.\\n\\n return (0, 1, RLPItemType.DATA_ITEM);\\n } else if (prefix <= 0xb7) {\\n // Short string.\\n\\n // slither-disable-next-line variable-scope\\n uint256 strLen = prefix - 0x80;\\n\\n require(_in.length > strLen, \\\"Invalid RLP short string.\\\");\\n\\n return (1, strLen, RLPItemType.DATA_ITEM);\\n } else if (prefix <= 0xbf) {\\n // Long string.\\n uint256 lenOfStrLen = prefix - 0xb7;\\n\\n require(_in.length > lenOfStrLen, \\\"Invalid RLP long string length.\\\");\\n\\n uint256 strLen;\\n assembly {\\n // Pick out the string length.\\n strLen := div(mload(add(ptr, 1)), exp(256, sub(32, lenOfStrLen)))\\n }\\n\\n require(_in.length > lenOfStrLen + strLen, \\\"Invalid RLP long string.\\\");\\n\\n return (1 + lenOfStrLen, strLen, RLPItemType.DATA_ITEM);\\n } else if (prefix <= 0xf7) {\\n // Short list.\\n // slither-disable-next-line variable-scope\\n uint256 listLen = prefix - 0xc0;\\n\\n require(_in.length > listLen, \\\"Invalid RLP short list.\\\");\\n\\n return (1, listLen, RLPItemType.LIST_ITEM);\\n } else {\\n // Long list.\\n uint256 lenOfListLen = prefix - 0xf7;\\n\\n require(_in.length > lenOfListLen, \\\"Invalid RLP long list length.\\\");\\n\\n uint256 listLen;\\n assembly {\\n // Pick out the list length.\\n listLen := div(mload(add(ptr, 1)), exp(256, sub(32, lenOfListLen)))\\n }\\n\\n require(_in.length > lenOfListLen + listLen, \\\"Invalid RLP long list.\\\");\\n\\n return (1 + lenOfListLen, listLen, RLPItemType.LIST_ITEM);\\n }\\n }\\n\\n /**\\n * Copies the bytes from a memory location.\\n * @param _src Pointer to the location to read from.\\n * @param _offset Offset to start reading from.\\n * @param _length Number of bytes to read.\\n * @return Copied bytes.\\n */\\n function _copy(\\n uint256 _src,\\n uint256 _offset,\\n uint256 _length\\n ) private pure returns (bytes memory) {\\n bytes memory out = new bytes(_length);\\n if (out.length == 0) {\\n return out;\\n }\\n\\n uint256 src = _src + _offset;\\n uint256 dest;\\n assembly {\\n dest := add(out, 32)\\n }\\n\\n // Copy over as many complete words as we can.\\n for (uint256 i = 0; i < _length / 32; i++) {\\n assembly {\\n mstore(dest, mload(src))\\n }\\n\\n src += 32;\\n dest += 32;\\n }\\n\\n // Pick out the remaining bytes.\\n uint256 mask;\\n unchecked {\\n mask = 256**(32 - (_length % 32)) - 1;\\n }\\n\\n assembly {\\n mstore(dest, or(and(mload(src), not(mask)), and(mload(dest), mask)))\\n }\\n return out;\\n }\\n\\n /**\\n * Copies an RLP item into bytes.\\n * @param _in RLP item to copy.\\n * @return Copied bytes.\\n */\\n function _copy(RLPItem memory _in) private pure returns (bytes memory) {\\n return _copy(_in.ptr, 0, _in.length);\\n }\\n}\\n\",\"keccak256\":\"0xd794d1b32c6e31d40e2526b5e519de1b4e8d14d6933889f9b916e69c5d1848c6\",\"license\":\"MIT\"},\"contracts/libraries/rlp/Lib_RLPWriter.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.9;\\n\\n/**\\n * @title Lib_RLPWriter\\n * @author Bakaoh (with modifications)\\n */\\nlibrary Lib_RLPWriter {\\n /**********************\\n * Internal Functions *\\n **********************/\\n\\n /**\\n * RLP encodes a byte string.\\n * @param _in The byte string to encode.\\n * @return The RLP encoded string in bytes.\\n */\\n function writeBytes(bytes memory _in) internal pure returns (bytes memory) {\\n bytes memory encoded;\\n\\n if (_in.length == 1 && uint8(_in[0]) < 128) {\\n encoded = _in;\\n } else {\\n encoded = abi.encodePacked(_writeLength(_in.length, 128), _in);\\n }\\n\\n return encoded;\\n }\\n\\n /**\\n * RLP encodes a list of RLP encoded byte byte strings.\\n * @param _in The list of RLP encoded byte strings.\\n * @return The RLP encoded list of items in bytes.\\n */\\n function writeList(bytes[] memory _in) internal pure returns (bytes memory) {\\n bytes memory list = _flatten(_in);\\n return abi.encodePacked(_writeLength(list.length, 192), list);\\n }\\n\\n /**\\n * RLP encodes a string.\\n * @param _in The string to encode.\\n * @return The RLP encoded string in bytes.\\n */\\n function writeString(string memory _in) internal pure returns (bytes memory) {\\n return writeBytes(bytes(_in));\\n }\\n\\n /**\\n * RLP encodes an address.\\n * @param _in The address to encode.\\n * @return The RLP encoded address in bytes.\\n */\\n function writeAddress(address _in) internal pure returns (bytes memory) {\\n return writeBytes(abi.encodePacked(_in));\\n }\\n\\n /**\\n * RLP encodes a uint.\\n * @param _in The uint256 to encode.\\n * @return The RLP encoded uint256 in bytes.\\n */\\n function writeUint(uint256 _in) internal pure returns (bytes memory) {\\n return writeBytes(_toBinary(_in));\\n }\\n\\n /**\\n * RLP encodes a bool.\\n * @param _in The bool to encode.\\n * @return The RLP encoded bool in bytes.\\n */\\n function writeBool(bool _in) internal pure returns (bytes memory) {\\n bytes memory encoded = new bytes(1);\\n encoded[0] = (_in ? bytes1(0x01) : bytes1(0x80));\\n return encoded;\\n }\\n\\n /*********************\\n * Private Functions *\\n *********************/\\n\\n /**\\n * Encode the first byte, followed by the `len` in binary form if `length` is more than 55.\\n * @param _len The length of the string or the payload.\\n * @param _offset 128 if item is string, 192 if item is list.\\n * @return RLP encoded bytes.\\n */\\n function _writeLength(uint256 _len, uint256 _offset) private pure returns (bytes memory) {\\n bytes memory encoded;\\n\\n if (_len < 56) {\\n encoded = new bytes(1);\\n encoded[0] = bytes1(uint8(_len) + uint8(_offset));\\n } else {\\n uint256 lenLen;\\n uint256 i = 1;\\n while (_len / i != 0) {\\n lenLen++;\\n i *= 256;\\n }\\n\\n encoded = new bytes(lenLen + 1);\\n encoded[0] = bytes1(uint8(lenLen) + uint8(_offset) + 55);\\n for (i = 1; i <= lenLen; i++) {\\n encoded[i] = bytes1(uint8((_len / (256**(lenLen - i))) % 256));\\n }\\n }\\n\\n return encoded;\\n }\\n\\n /**\\n * Encode integer in big endian binary form with no leading zeroes.\\n * @notice TODO: This should be optimized with assembly to save gas costs.\\n * @param _x The integer to encode.\\n * @return RLP encoded bytes.\\n */\\n function _toBinary(uint256 _x) private pure returns (bytes memory) {\\n bytes memory b = abi.encodePacked(_x);\\n\\n uint256 i = 0;\\n for (; i < 32; i++) {\\n if (b[i] != 0) {\\n break;\\n }\\n }\\n\\n bytes memory res = new bytes(32 - i);\\n for (uint256 j = 0; j < res.length; j++) {\\n res[j] = b[i++];\\n }\\n\\n return res;\\n }\\n\\n /**\\n * Copies a piece of memory to another location.\\n * @notice From: https://github.com/Arachnid/solidity-stringutils/blob/master/src/strings.sol.\\n * @param _dest Destination location.\\n * @param _src Source location.\\n * @param _len Length of memory to copy.\\n */\\n function _memcpy(\\n uint256 _dest,\\n uint256 _src,\\n uint256 _len\\n ) private pure {\\n uint256 dest = _dest;\\n uint256 src = _src;\\n uint256 len = _len;\\n\\n for (; len >= 32; len -= 32) {\\n assembly {\\n mstore(dest, mload(src))\\n }\\n dest += 32;\\n src += 32;\\n }\\n\\n uint256 mask;\\n unchecked {\\n mask = 256**(32 - len) - 1;\\n }\\n assembly {\\n let srcpart := and(mload(src), not(mask))\\n let destpart := and(mload(dest), mask)\\n mstore(dest, or(destpart, srcpart))\\n }\\n }\\n\\n /**\\n * Flattens a list of byte strings into one byte string.\\n * @notice From: https://github.com/sammayo/solidity-rlp-encoder/blob/master/RLPEncode.sol.\\n * @param _list List of byte strings to flatten.\\n * @return The flattened byte string.\\n */\\n function _flatten(bytes[] memory _list) private pure returns (bytes memory) {\\n if (_list.length == 0) {\\n return new bytes(0);\\n }\\n\\n uint256 len;\\n uint256 i = 0;\\n for (; i < _list.length; i++) {\\n len += _list[i].length;\\n }\\n\\n bytes memory flattened = new bytes(len);\\n uint256 flattenedPtr;\\n assembly {\\n flattenedPtr := add(flattened, 0x20)\\n }\\n\\n for (i = 0; i < _list.length; i++) {\\n bytes memory item = _list[i];\\n\\n uint256 listPtr;\\n assembly {\\n listPtr := add(item, 0x20)\\n }\\n\\n _memcpy(flattenedPtr, listPtr, item.length);\\n flattenedPtr += _list[i].length;\\n }\\n\\n return flattened;\\n }\\n}\\n\",\"keccak256\":\"0x215b90672ce126effc3f2df61ca0cdf52d2b1cc9be602877e637829b0bf229fd\",\"license\":\"MIT\"},\"contracts/libraries/utils/Lib_Bytes32Utils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.9;\\n\\n/**\\n * @title Lib_Byte32Utils\\n */\\nlibrary Lib_Bytes32Utils {\\n /**********************\\n * Internal Functions *\\n **********************/\\n\\n /**\\n * Converts a bytes32 value to a boolean. Anything non-zero will be converted to \\\"true.\\\"\\n * @param _in Input bytes32 value.\\n * @return Bytes32 as a boolean.\\n */\\n function toBool(bytes32 _in) internal pure returns (bool) {\\n return _in != 0;\\n }\\n\\n /**\\n * Converts a boolean to a bytes32 value.\\n * @param _in Input boolean value.\\n * @return Boolean as a bytes32.\\n */\\n function fromBool(bool _in) internal pure returns (bytes32) {\\n return bytes32(uint256(_in ? 1 : 0));\\n }\\n\\n /**\\n * Converts a bytes32 value to an address. Takes the *last* 20 bytes.\\n * @param _in Input bytes32 value.\\n * @return Bytes32 as an address.\\n */\\n function toAddress(bytes32 _in) internal pure returns (address) {\\n return address(uint160(uint256(_in)));\\n }\\n\\n /**\\n * Converts an address to a bytes32.\\n * @param _in Input address value.\\n * @return Address as a bytes32.\\n */\\n function fromAddress(address _in) internal pure returns (bytes32) {\\n return bytes32(uint256(uint160(_in)));\\n }\\n}\\n\",\"keccak256\":\"0xf2d1a526f2529e51fc2fffccf093c1691e291cbbb6de8a3da7d7f80024a9a234\",\"license\":\"MIT\"},\"contracts/libraries/utils/Lib_BytesUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.9;\\n\\n/**\\n * @title Lib_BytesUtils\\n */\\nlibrary Lib_BytesUtils {\\n /**********************\\n * Internal Functions *\\n **********************/\\n\\n function slice(\\n bytes memory _bytes,\\n uint256 _start,\\n uint256 _length\\n ) internal pure returns (bytes memory) {\\n require(_length + 31 >= _length, \\\"slice_overflow\\\");\\n require(_start + _length >= _start, \\\"slice_overflow\\\");\\n require(_bytes.length >= _start + _length, \\\"slice_outOfBounds\\\");\\n\\n bytes memory tempBytes;\\n\\n assembly {\\n switch iszero(_length)\\n case 0 {\\n // Get a location of some free memory and store it in tempBytes as\\n // Solidity does for memory variables.\\n tempBytes := mload(0x40)\\n\\n // The first word of the slice result is potentially a partial\\n // word read from the original array. To read it, we calculate\\n // the length of that partial word and start copying that many\\n // bytes into the array. The first word we copy will start with\\n // data we don't care about, but the last `lengthmod` bytes will\\n // land at the beginning of the contents of the new array. When\\n // we're done copying, we overwrite the full first word with\\n // the actual length of the slice.\\n let lengthmod := and(_length, 31)\\n\\n // The multiplication in the next line is necessary\\n // because when slicing multiples of 32 bytes (lengthmod == 0)\\n // the following copy loop was copying the origin's length\\n // and then ending prematurely not copying everything it should.\\n let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod)))\\n let end := add(mc, _length)\\n\\n for {\\n // The multiplication in the next line has the same exact purpose\\n // as the one above.\\n let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start)\\n } lt(mc, end) {\\n mc := add(mc, 0x20)\\n cc := add(cc, 0x20)\\n } {\\n mstore(mc, mload(cc))\\n }\\n\\n mstore(tempBytes, _length)\\n\\n //update free-memory pointer\\n //allocating the array padded to 32 bytes like the compiler does now\\n mstore(0x40, and(add(mc, 31), not(31)))\\n }\\n //if we want a zero-length slice let's just return a zero-length array\\n default {\\n tempBytes := mload(0x40)\\n\\n //zero out the 32 bytes slice we are about to return\\n //we need to do it because Solidity does not garbage collect\\n mstore(tempBytes, 0)\\n\\n mstore(0x40, add(tempBytes, 0x20))\\n }\\n }\\n\\n return tempBytes;\\n }\\n\\n function slice(bytes memory _bytes, uint256 _start) internal pure returns (bytes memory) {\\n if (_start >= _bytes.length) {\\n return bytes(\\\"\\\");\\n }\\n\\n return slice(_bytes, _start, _bytes.length - _start);\\n }\\n\\n function toBytes32(bytes memory _bytes) internal pure returns (bytes32) {\\n if (_bytes.length < 32) {\\n bytes32 ret;\\n assembly {\\n ret := mload(add(_bytes, 32))\\n }\\n return ret;\\n }\\n\\n return abi.decode(_bytes, (bytes32)); // will truncate if input length > 32 bytes\\n }\\n\\n function toUint256(bytes memory _bytes) internal pure returns (uint256) {\\n return uint256(toBytes32(_bytes));\\n }\\n\\n function toNibbles(bytes memory _bytes) internal pure returns (bytes memory) {\\n bytes memory nibbles = new bytes(_bytes.length * 2);\\n\\n for (uint256 i = 0; i < _bytes.length; i++) {\\n nibbles[i * 2] = _bytes[i] >> 4;\\n nibbles[i * 2 + 1] = bytes1(uint8(_bytes[i]) % 16);\\n }\\n\\n return nibbles;\\n }\\n\\n function fromNibbles(bytes memory _bytes) internal pure returns (bytes memory) {\\n bytes memory ret = new bytes(_bytes.length / 2);\\n\\n for (uint256 i = 0; i < ret.length; i++) {\\n ret[i] = (_bytes[i * 2] << 4) | (_bytes[i * 2 + 1]);\\n }\\n\\n return ret;\\n }\\n\\n function equal(bytes memory _bytes, bytes memory _other) internal pure returns (bool) {\\n return keccak256(_bytes) == keccak256(_other);\\n }\\n}\\n\",\"keccak256\":\"0xc39ee13f97e4ccfbc72a5aac571deb3c1aff882fca2dd18be794d43ac5de0a30\",\"license\":\"MIT\"},\"contracts/libraries/utils/Lib_MerkleTree.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.9;\\n\\n/**\\n * @title Lib_MerkleTree\\n * @author River Keefer\\n */\\nlibrary Lib_MerkleTree {\\n /**********************\\n * Internal Functions *\\n **********************/\\n\\n /**\\n * Calculates a merkle root for a list of 32-byte leaf hashes. WARNING: If the number\\n * of leaves passed in is not a power of two, it pads out the tree with zero hashes.\\n * If you do not know the original length of elements for the tree you are verifying, then\\n * this may allow empty leaves past _elements.length to pass a verification check down the line.\\n * Note that the _elements argument is modified, therefore it must not be used again afterwards\\n * @param _elements Array of hashes from which to generate a merkle root.\\n * @return Merkle root of the leaves, with zero hashes for non-powers-of-two (see above).\\n */\\n function getMerkleRoot(bytes32[] memory _elements) internal pure returns (bytes32) {\\n require(_elements.length > 0, \\\"Lib_MerkleTree: Must provide at least one leaf hash.\\\");\\n\\n if (_elements.length == 1) {\\n return _elements[0];\\n }\\n\\n uint256[16] memory defaults = [\\n 0x290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563,\\n 0x633dc4d7da7256660a892f8f1604a44b5432649cc8ec5cb3ced4c4e6ac94dd1d,\\n 0x890740a8eb06ce9be422cb8da5cdafc2b58c0a5e24036c578de2a433c828ff7d,\\n 0x3b8ec09e026fdc305365dfc94e189a81b38c7597b3d941c279f042e8206e0bd8,\\n 0xecd50eee38e386bd62be9bedb990706951b65fe053bd9d8a521af753d139e2da,\\n 0xdefff6d330bb5403f63b14f33b578274160de3a50df4efecf0e0db73bcdd3da5,\\n 0x617bdd11f7c0a11f49db22f629387a12da7596f9d1704d7465177c63d88ec7d7,\\n 0x292c23a9aa1d8bea7e2435e555a4a60e379a5a35f3f452bae60121073fb6eead,\\n 0xe1cea92ed99acdcb045a6726b2f87107e8a61620a232cf4d7d5b5766b3952e10,\\n 0x7ad66c0a68c72cb89e4fb4303841966e4062a76ab97451e3b9fb526a5ceb7f82,\\n 0xe026cc5a4aed3c22a58cbd3d2ac754c9352c5436f638042dca99034e83636516,\\n 0x3d04cffd8b46a874edf5cfae63077de85f849a660426697b06a829c70dd1409c,\\n 0xad676aa337a485e4728a0b240d92b3ef7b3c372d06d189322bfd5f61f1e7203e,\\n 0xa2fca4a49658f9fab7aa63289c91b7c7b6c832a6d0e69334ff5b0a3483d09dab,\\n 0x4ebfd9cd7bca2505f7bef59cc1c12ecc708fff26ae4af19abe852afe9e20c862,\\n 0x2def10d13dd169f550f578bda343d9717a138562e0093b380a1120789d53cf10\\n ];\\n\\n // Reserve memory space for our hashes.\\n bytes memory buf = new bytes(64);\\n\\n // We'll need to keep track of left and right siblings.\\n bytes32 leftSibling;\\n bytes32 rightSibling;\\n\\n // Number of non-empty nodes at the current depth.\\n uint256 rowSize = _elements.length;\\n\\n // Current depth, counting from 0 at the leaves\\n uint256 depth = 0;\\n\\n // Common sub-expressions\\n uint256 halfRowSize; // rowSize / 2\\n bool rowSizeIsOdd; // rowSize % 2 == 1\\n\\n while (rowSize > 1) {\\n halfRowSize = rowSize / 2;\\n rowSizeIsOdd = rowSize % 2 == 1;\\n\\n for (uint256 i = 0; i < halfRowSize; i++) {\\n leftSibling = _elements[(2 * i)];\\n rightSibling = _elements[(2 * i) + 1];\\n assembly {\\n mstore(add(buf, 32), leftSibling)\\n mstore(add(buf, 64), rightSibling)\\n }\\n\\n _elements[i] = keccak256(buf);\\n }\\n\\n if (rowSizeIsOdd) {\\n leftSibling = _elements[rowSize - 1];\\n rightSibling = bytes32(defaults[depth]);\\n assembly {\\n mstore(add(buf, 32), leftSibling)\\n mstore(add(buf, 64), rightSibling)\\n }\\n\\n _elements[halfRowSize] = keccak256(buf);\\n }\\n\\n rowSize = halfRowSize + (rowSizeIsOdd ? 1 : 0);\\n depth++;\\n }\\n\\n return _elements[0];\\n }\\n\\n /**\\n * Verifies a merkle branch for the given leaf hash. Assumes the original length\\n * of leaves generated is a known, correct input, and does not return true for indices\\n * extending past that index (even if _siblings would be otherwise valid.)\\n * @param _root The Merkle root to verify against.\\n * @param _leaf The leaf hash to verify inclusion of.\\n * @param _index The index in the tree of this leaf.\\n * @param _siblings Array of sibline nodes in the inclusion proof, starting from depth 0\\n * (bottom of the tree).\\n * @param _totalLeaves The total number of leaves originally passed into.\\n * @return Whether or not the merkle branch and leaf passes verification.\\n */\\n function verify(\\n bytes32 _root,\\n bytes32 _leaf,\\n uint256 _index,\\n bytes32[] memory _siblings,\\n uint256 _totalLeaves\\n ) internal pure returns (bool) {\\n require(_totalLeaves > 0, \\\"Lib_MerkleTree: Total leaves must be greater than zero.\\\");\\n\\n require(_index < _totalLeaves, \\\"Lib_MerkleTree: Index out of bounds.\\\");\\n\\n require(\\n _siblings.length == _ceilLog2(_totalLeaves),\\n \\\"Lib_MerkleTree: Total siblings does not correctly correspond to total leaves.\\\"\\n );\\n\\n bytes32 computedRoot = _leaf;\\n\\n for (uint256 i = 0; i < _siblings.length; i++) {\\n if ((_index & 1) == 1) {\\n computedRoot = keccak256(abi.encodePacked(_siblings[i], computedRoot));\\n } else {\\n computedRoot = keccak256(abi.encodePacked(computedRoot, _siblings[i]));\\n }\\n\\n _index >>= 1;\\n }\\n\\n return _root == computedRoot;\\n }\\n\\n /*********************\\n * Private Functions *\\n *********************/\\n\\n /**\\n * Calculates the integer ceiling of the log base 2 of an input.\\n * @param _in Unsigned input to calculate the log.\\n * @return ceil(log_base_2(_in))\\n */\\n function _ceilLog2(uint256 _in) private pure returns (uint256) {\\n require(_in > 0, \\\"Lib_MerkleTree: Cannot compute ceil(log_2) of 0.\\\");\\n\\n if (_in == 1) {\\n return 0;\\n }\\n\\n // Find the highest set bit (will be floor(log_2)).\\n // Borrowed with <3 from https://github.com/ethereum/solidity-examples\\n uint256 val = _in;\\n uint256 highest = 0;\\n for (uint256 i = 128; i >= 1; i >>= 1) {\\n if (val & (((uint256(1) << i) - 1) << i) != 0) {\\n highest += i;\\n val >>= i;\\n }\\n }\\n\\n // Increment by one if this is not a perfect logarithm.\\n if ((uint256(1) << highest) != _in) {\\n highest += 1;\\n }\\n\\n return highest;\\n }\\n}\\n\",\"keccak256\":\"0x84351e7b8be5007b77a67c1e3f34f46ed0c1ddc67e4e76797fd06f01ca9325aa\",\"license\":\"MIT\"}},\"version\":1}", "bytecode": "0x608060405234801561001057600080fd5b506040516120bb3803806120bb83398101604081905261002f9161005b565b600080546001600160a01b0319166001600160a01b03949094169390931790925560015560025561009e565b60008060006060848603121561007057600080fd5b83516001600160a01b038116811461008757600080fd5b602085015160409095015190969495509392505050565b61200e806100ad6000396000f3fe608060405234801561001057600080fd5b50600436106100d45760003560e01c80638ca5cbb911610081578063c17b291b1161005b578063c17b291b146101bb578063cfdf677e146101c4578063e561dddc146101cc57600080fd5b80638ca5cbb9146101805780639418bddd14610195578063b8e189ac146101a857600080fd5b80637aa63a86116100b25780637aa63a86146101595780637ad168a01461016f57806381eb62ef1461017757600080fd5b8063299ca478146100d9578063461a4478146101235780634d69ee5714610136575b600080fd5b6000546100f99073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100f9610131366004611a1b565b6101d4565b610149610144366004611b8d565b610281565b604051901515815260200161011a565b610161610350565b60405190815260200161011a565b610161610369565b61016160025481565b61019361018e366004611c4a565b610382565b005b6101496101a3366004611c8f565b61075c565b6101936101b6366004611c8f565b610804565b61016160015481565b6100f96109c0565b6101616109e8565b600080546040517fbf40fac100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169063bf40fac19061022b908590600401611d2f565b60206040518083038186803b15801561024357600080fd5b505afa158015610257573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061027b9190611d64565b92915050565b600061028c83610a6f565b6102dd5760405162461bcd60e51b815260206004820152601560248201527f496e76616c6964206261746368206865616465722e000000000000000000000060448201526064015b60405180910390fd5b6102fa836020015185846000015185602001518760400151610b31565b6103465760405162461bcd60e51b815260206004820152601860248201527f496e76616c696420696e636c7573696f6e2070726f6f662e000000000000000060448201526064016102d4565b5060019392505050565b60008061035b610d9f565b5064ffffffffff1692915050565b600080610374610d9f565b64ffffffffff169392505050565b61038a610350565b81146103fe5760405162461bcd60e51b815260206004820152603d60248201527f41637475616c20626174636820737461727420696e64657820646f6573206e6f60448201527f74206d6174636820657870656374656420737461727420696e6465782e00000060648201526084016102d4565b61043c6040518060400160405280600b81526020017f426f6e644d616e616765720000000000000000000000000000000000000000008152506101d4565b6040517f02ad4d2a00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff91909116906302ad4d2a9060240160206040518083038186803b1580156104a357600080fd5b505afa1580156104b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104db9190611d81565b61054d5760405162461bcd60e51b815260206004820152602f60248201527f50726f706f73657220646f6573206e6f74206861766520656e6f75676820636f60448201527f6c6c61746572616c20706f73746564000000000000000000000000000000000060648201526084016102d4565b60008251116105c45760405162461bcd60e51b815260206004820152602360248201527f43616e6e6f74207375626d697420616e20656d7074792073746174652062617460448201527f63682e000000000000000000000000000000000000000000000000000000000060648201526084016102d4565b6106026040518060400160405280601981526020017f43616e6f6e6963616c5472616e73616374696f6e436861696e000000000000008152506101d4565b73ffffffffffffffffffffffffffffffffffffffff16637aa63a866040518163ffffffff1660e01b815260040160206040518083038186803b15801561064757600080fd5b505afa15801561065b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061067f9190611da3565b8251610689610350565b6106939190611deb565b111561072d5760405162461bcd60e51b815260206004820152604960248201527f4e756d626572206f6620737461746520726f6f74732063616e6e6f742065786360448201527f65656420746865206e756d626572206f662063616e6f6e6963616c207472616e60648201527f73616374696f6e732e0000000000000000000000000000000000000000000000608482015260a4016102d4565b6040805142602082015233818301528151808203830181526060909101909152610758908390610e43565b5050565b60008082608001518060200190518101906107779190611e03565b509050806107ed5760405162461bcd60e51b815260206004820152602560248201527f4261746368206865616465722074696d657374616d702063616e6e6f7420626560448201527f207a65726f00000000000000000000000000000000000000000000000000000060648201526084016102d4565b42600154826107fc9190611deb565b119392505050565b6108426040518060400160405280601181526020017f4f564d5f467261756456657269666965720000000000000000000000000000008152506101d4565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108e25760405162461bcd60e51b815260206004820152603b60248201527f537461746520626174636865732063616e206f6e6c792062652064656c65746560448201527f6420627920746865204f564d5f467261756456657269666965722e000000000060648201526084016102d4565b6108eb81610a6f565b6109375760405162461bcd60e51b815260206004820152601560248201527f496e76616c6964206261746368206865616465722e000000000000000000000060448201526064016102d4565b6109408161075c565b6109b4576040805162461bcd60e51b81526020600482015260248101919091527f537461746520626174636865732063616e206f6e6c792062652064656c65746560448201527f642077697468696e207468652066726175642070726f6f662077696e646f772e60648201526084016102d4565b6109bd816110e6565b50565b60006109e3604051806060016040528060218152602001611fb8602191396101d4565b905090565b60006109f26109c0565b73ffffffffffffffffffffffffffffffffffffffff16631f7b6d326040518163ffffffff1660e01b815260040160206040518083038186803b158015610a3757600080fd5b505afa158015610a4b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e39190611da3565b6000610a796109c0565b82516040517f9507d39a00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9290921691639507d39a91610ad19160040190815260200190565b60206040518083038186803b158015610ae957600080fd5b505afa158015610afd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b219190611da3565b610b2a83611317565b1492915050565b6000808211610ba85760405162461bcd60e51b815260206004820152603760248201527f4c69625f4d65726b6c65547265653a20546f74616c206c6561766573206d757360448201527f742062652067726561746572207468616e207a65726f2e00000000000000000060648201526084016102d4565b818410610c1c5760405162461bcd60e51b8152602060048201526024808201527f4c69625f4d65726b6c65547265653a20496e646578206f7574206f6620626f7560448201527f6e64732e0000000000000000000000000000000000000000000000000000000060648201526084016102d4565b610c258261135d565b835114610cc05760405162461bcd60e51b815260206004820152604d60248201527f4c69625f4d65726b6c65547265653a20546f74616c207369626c696e6773206460448201527f6f6573206e6f7420636f72726563746c7920636f72726573706f6e6420746f2060648201527f746f74616c206c65617665732e00000000000000000000000000000000000000608482015260a4016102d4565b8460005b8451811015610d92578560011660011415610d2b57848181518110610ceb57610ceb611e33565b602002602001015182604051602001610d0e929190918252602082015260400190565b604051602081830303815290604052805190602001209150610d79565b81858281518110610d3e57610d3e611e33565b6020026020010151604051602001610d60929190918252602082015260400190565b6040516020818303038152906040528051906020012091505b60019590951c9480610d8a81611e62565b915050610cc4565b5090951495945050505050565b6000806000610dac6109c0565b73ffffffffffffffffffffffffffffffffffffffff1663ccf8f9696040518163ffffffff1660e01b815260040160206040518083038186803b158015610df157600080fd5b505afa158015610e05573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e299190611e9b565b64ffffffffff602882901c169460509190911c9350915050565b6000610e836040518060400160405280600c81526020017f4f564d5f50726f706f73657200000000000000000000000000000000000000008152506101d4565b9050600080610e90610d9f565b90925090503373ffffffffffffffffffffffffffffffffffffffff84161415610eba575042610f69565b426002548264ffffffffff16610ed09190611deb565b10610f695760405162461bcd60e51b815260206004820152604360248201527f43616e6e6f74207075626c69736820737461746520726f6f747320776974686960448201527f6e207468652073657175656e636572207075626c69636174696f6e2077696e6460648201527f6f772e0000000000000000000000000000000000000000000000000000000000608482015260a4016102d4565b60006040518060a00160405280610f7e6109e8565b8152602001610f8c88611443565b8152602001875181526020018464ffffffffff16815260200186815250905080600001517f16be4c5129a4e03cf3350262e181dc02ddfb4a6008d925368c0899fcd97ca9c58260200151836040015184606001518560800151604051610ff59493929190611edd565b60405180910390a26110056109c0565b73ffffffffffffffffffffffffffffffffffffffff16632015276c61102983611317565b61104e846040015185606001516110409190611deb565b602887811b91909117901b90565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815260048101929092527fffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000166024820152604401600060405180830381600087803b1580156110c657600080fd5b505af11580156110da573d6000803e3d6000fd5b50505050505050505050565b6110ee6109c0565b73ffffffffffffffffffffffffffffffffffffffff16631f7b6d326040518163ffffffff1660e01b815260040160206040518083038186803b15801561113357600080fd5b505afa158015611147573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061116b9190611da3565b8151106111ba5760405162461bcd60e51b815260206004820152601460248201527f496e76616c696420626174636820696e6465782e00000000000000000000000060448201526064016102d4565b6111c381610a6f565b61120f5760405162461bcd60e51b815260206004820152601560248201527f496e76616c6964206261746368206865616465722e000000000000000000000060448201526064016102d4565b6112176109c0565b8151606083015173ffffffffffffffffffffffffffffffffffffffff929092169163167fd681919060281b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815260048101929092527fffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000166024820152604401600060405180830381600087803b1580156112ba57600080fd5b505af11580156112ce573d6000803e3d6000fd5b5050505080600001517f8747b69ce8fdb31c3b9b0a67bd8049ad8c1a69ea417b69b12174068abd9cbd64826020015160405161130c91815260200190565b60405180910390a250565b600081602001518260400151836060015184608001516040516020016113409493929190611edd565b604051602081830303815290604052805190602001209050919050565b60008082116113d45760405162461bcd60e51b815260206004820152603060248201527f4c69625f4d65726b6c65547265653a2043616e6e6f7420636f6d70757465206360448201527f65696c286c6f675f3229206f6620302e0000000000000000000000000000000060648201526084016102d4565b81600114156113e557506000919050565b81600060805b600181106114235780611401600180831b611f0c565b901b83161561141b576114148183611deb565b92811c9291505b60011c6113eb565b506001811b841461143c57611439600182611deb565b90505b9392505050565b6000808251116114bb5760405162461bcd60e51b815260206004820152603460248201527f4c69625f4d65726b6c65547265653a204d7573742070726f766964652061742060448201527f6c65617374206f6e65206c65616620686173682e00000000000000000000000060648201526084016102d4565b8151600114156114e757816000815181106114d8576114d8611e33565b60200260200101519050919050565b60408051610200810182527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e56381527f633dc4d7da7256660a892f8f1604a44b5432649cc8ec5cb3ced4c4e6ac94dd1d60208201527f890740a8eb06ce9be422cb8da5cdafc2b58c0a5e24036c578de2a433c828ff7d818301527f3b8ec09e026fdc305365dfc94e189a81b38c7597b3d941c279f042e8206e0bd86060808301919091527fecd50eee38e386bd62be9bedb990706951b65fe053bd9d8a521af753d139e2da60808301527fdefff6d330bb5403f63b14f33b578274160de3a50df4efecf0e0db73bcdd3da560a08301527f617bdd11f7c0a11f49db22f629387a12da7596f9d1704d7465177c63d88ec7d760c08301527f292c23a9aa1d8bea7e2435e555a4a60e379a5a35f3f452bae60121073fb6eead60e08301527fe1cea92ed99acdcb045a6726b2f87107e8a61620a232cf4d7d5b5766b3952e106101008301527f7ad66c0a68c72cb89e4fb4303841966e4062a76ab97451e3b9fb526a5ceb7f826101208301527fe026cc5a4aed3c22a58cbd3d2ac754c9352c5436f638042dca99034e836365166101408301527f3d04cffd8b46a874edf5cfae63077de85f849a660426697b06a829c70dd1409c6101608301527fad676aa337a485e4728a0b240d92b3ef7b3c372d06d189322bfd5f61f1e7203e6101808301527fa2fca4a49658f9fab7aa63289c91b7c7b6c832a6d0e69334ff5b0a3483d09dab6101a08301527f4ebfd9cd7bca2505f7bef59cc1c12ecc708fff26ae4af19abe852afe9e20c8626101c08301527f2def10d13dd169f550f578bda343d9717a138562e0093b380a1120789d53cf106101e083015282518381529081018352909160009190602082018180368337505085519192506000918291508180805b60018411156118fd57611798600285611f52565b91506117a5600285611f66565b600114905060005b82811015611851578a6117c1826002611f7a565b815181106117d1576117d1611e33565b602002602001015196508a8160026117e99190611f7a565b6117f4906001611deb565b8151811061180457611804611e33565b6020026020010151955086602089015285604089015287805190602001208b828151811061183457611834611e33565b60209081029190910101528061184981611e62565b9150506117ad565b5080156118cd5789611864600186611f0c565b8151811061187457611874611e33565b6020026020010151955087836010811061189057611890611e33565b602002015160001b945085602088015284604088015286805190602001208a83815181106118c0576118c0611e33565b6020026020010181815250505b806118d95760006118dc565b60015b6118e99060ff1683611deb565b9350826118f581611e62565b935050611784565b8960008151811061191057611910611e33565b602002602001015198505050505050505050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561199d5761199d611927565b604052919050565b600067ffffffffffffffff8311156119bf576119bf611927565b6119f060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f86011601611956565b9050828152838383011115611a0457600080fd5b828260208301376000602084830101529392505050565b600060208284031215611a2d57600080fd5b813567ffffffffffffffff811115611a4457600080fd5b8201601f81018413611a5557600080fd5b611a64848235602084016119a5565b949350505050565b600060a08284031215611a7e57600080fd5b60405160a0810167ffffffffffffffff8282108183111715611aa257611aa2611927565b81604052829350843583526020850135602084015260408501356040840152606085013560608401526080850135915080821115611adf57600080fd5b508301601f81018513611af157600080fd5b611b00858235602084016119a5565b6080830152505092915050565b600082601f830112611b1e57600080fd5b8135602067ffffffffffffffff821115611b3a57611b3a611927565b8160051b611b49828201611956565b9283528481018201928281019087851115611b6357600080fd5b83870192505b84831015611b8257823582529183019190830190611b69565b979650505050505050565b600080600060608486031215611ba257600080fd5b83359250602084013567ffffffffffffffff80821115611bc157600080fd5b611bcd87838801611a6c565b93506040860135915080821115611be357600080fd5b9085019060408288031215611bf757600080fd5b604051604081018181108382111715611c1257611c12611927565b60405282358152602083013582811115611c2b57600080fd5b611c3789828601611b0d565b6020830152508093505050509250925092565b60008060408385031215611c5d57600080fd5b823567ffffffffffffffff811115611c7457600080fd5b611c8085828601611b0d565b95602094909401359450505050565b600060208284031215611ca157600080fd5b813567ffffffffffffffff811115611cb857600080fd5b611a6484828501611a6c565b6000815180845260005b81811015611cea57602081850181015186830182015201611cce565b81811115611cfc576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60208152600061143c6020830184611cc4565b73ffffffffffffffffffffffffffffffffffffffff811681146109bd57600080fd5b600060208284031215611d7657600080fd5b815161143c81611d42565b600060208284031215611d9357600080fd5b8151801515811461143c57600080fd5b600060208284031215611db557600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008219821115611dfe57611dfe611dbc565b500190565b60008060408385031215611e1657600080fd5b825191506020830151611e2881611d42565b809150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611e9457611e94611dbc565b5060010190565b600060208284031215611ead57600080fd5b81517fffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000008116811461143c57600080fd5b848152836020820152826040820152608060608201526000611f026080830184611cc4565b9695505050505050565b600082821015611f1e57611f1e611dbc565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082611f6157611f61611f23565b500490565b600082611f7557611f75611f23565b500690565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615611fb257611fb2611dbc565b50029056fe436861696e53746f72616765436f6e7461696e65722d5343432d62617463686573a2646970667358221220f97433bcdfea89f96da4dd35233c6b44aadecb94f82aab10226e964aff14127064736f6c63430008090033", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100d45760003560e01c80638ca5cbb911610081578063c17b291b1161005b578063c17b291b146101bb578063cfdf677e146101c4578063e561dddc146101cc57600080fd5b80638ca5cbb9146101805780639418bddd14610195578063b8e189ac146101a857600080fd5b80637aa63a86116100b25780637aa63a86146101595780637ad168a01461016f57806381eb62ef1461017757600080fd5b8063299ca478146100d9578063461a4478146101235780634d69ee5714610136575b600080fd5b6000546100f99073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100f9610131366004611a1b565b6101d4565b610149610144366004611b8d565b610281565b604051901515815260200161011a565b610161610350565b60405190815260200161011a565b610161610369565b61016160025481565b61019361018e366004611c4a565b610382565b005b6101496101a3366004611c8f565b61075c565b6101936101b6366004611c8f565b610804565b61016160015481565b6100f96109c0565b6101616109e8565b600080546040517fbf40fac100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169063bf40fac19061022b908590600401611d2f565b60206040518083038186803b15801561024357600080fd5b505afa158015610257573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061027b9190611d64565b92915050565b600061028c83610a6f565b6102dd5760405162461bcd60e51b815260206004820152601560248201527f496e76616c6964206261746368206865616465722e000000000000000000000060448201526064015b60405180910390fd5b6102fa836020015185846000015185602001518760400151610b31565b6103465760405162461bcd60e51b815260206004820152601860248201527f496e76616c696420696e636c7573696f6e2070726f6f662e000000000000000060448201526064016102d4565b5060019392505050565b60008061035b610d9f565b5064ffffffffff1692915050565b600080610374610d9f565b64ffffffffff169392505050565b61038a610350565b81146103fe5760405162461bcd60e51b815260206004820152603d60248201527f41637475616c20626174636820737461727420696e64657820646f6573206e6f60448201527f74206d6174636820657870656374656420737461727420696e6465782e00000060648201526084016102d4565b61043c6040518060400160405280600b81526020017f426f6e644d616e616765720000000000000000000000000000000000000000008152506101d4565b6040517f02ad4d2a00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff91909116906302ad4d2a9060240160206040518083038186803b1580156104a357600080fd5b505afa1580156104b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104db9190611d81565b61054d5760405162461bcd60e51b815260206004820152602f60248201527f50726f706f73657220646f6573206e6f74206861766520656e6f75676820636f60448201527f6c6c61746572616c20706f73746564000000000000000000000000000000000060648201526084016102d4565b60008251116105c45760405162461bcd60e51b815260206004820152602360248201527f43616e6e6f74207375626d697420616e20656d7074792073746174652062617460448201527f63682e000000000000000000000000000000000000000000000000000000000060648201526084016102d4565b6106026040518060400160405280601981526020017f43616e6f6e6963616c5472616e73616374696f6e436861696e000000000000008152506101d4565b73ffffffffffffffffffffffffffffffffffffffff16637aa63a866040518163ffffffff1660e01b815260040160206040518083038186803b15801561064757600080fd5b505afa15801561065b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061067f9190611da3565b8251610689610350565b6106939190611deb565b111561072d5760405162461bcd60e51b815260206004820152604960248201527f4e756d626572206f6620737461746520726f6f74732063616e6e6f742065786360448201527f65656420746865206e756d626572206f662063616e6f6e6963616c207472616e60648201527f73616374696f6e732e0000000000000000000000000000000000000000000000608482015260a4016102d4565b6040805142602082015233818301528151808203830181526060909101909152610758908390610e43565b5050565b60008082608001518060200190518101906107779190611e03565b509050806107ed5760405162461bcd60e51b815260206004820152602560248201527f4261746368206865616465722074696d657374616d702063616e6e6f7420626560448201527f207a65726f00000000000000000000000000000000000000000000000000000060648201526084016102d4565b42600154826107fc9190611deb565b119392505050565b6108426040518060400160405280601181526020017f4f564d5f467261756456657269666965720000000000000000000000000000008152506101d4565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108e25760405162461bcd60e51b815260206004820152603b60248201527f537461746520626174636865732063616e206f6e6c792062652064656c65746560448201527f6420627920746865204f564d5f467261756456657269666965722e000000000060648201526084016102d4565b6108eb81610a6f565b6109375760405162461bcd60e51b815260206004820152601560248201527f496e76616c6964206261746368206865616465722e000000000000000000000060448201526064016102d4565b6109408161075c565b6109b4576040805162461bcd60e51b81526020600482015260248101919091527f537461746520626174636865732063616e206f6e6c792062652064656c65746560448201527f642077697468696e207468652066726175642070726f6f662077696e646f772e60648201526084016102d4565b6109bd816110e6565b50565b60006109e3604051806060016040528060218152602001611fb8602191396101d4565b905090565b60006109f26109c0565b73ffffffffffffffffffffffffffffffffffffffff16631f7b6d326040518163ffffffff1660e01b815260040160206040518083038186803b158015610a3757600080fd5b505afa158015610a4b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e39190611da3565b6000610a796109c0565b82516040517f9507d39a00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9290921691639507d39a91610ad19160040190815260200190565b60206040518083038186803b158015610ae957600080fd5b505afa158015610afd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b219190611da3565b610b2a83611317565b1492915050565b6000808211610ba85760405162461bcd60e51b815260206004820152603760248201527f4c69625f4d65726b6c65547265653a20546f74616c206c6561766573206d757360448201527f742062652067726561746572207468616e207a65726f2e00000000000000000060648201526084016102d4565b818410610c1c5760405162461bcd60e51b8152602060048201526024808201527f4c69625f4d65726b6c65547265653a20496e646578206f7574206f6620626f7560448201527f6e64732e0000000000000000000000000000000000000000000000000000000060648201526084016102d4565b610c258261135d565b835114610cc05760405162461bcd60e51b815260206004820152604d60248201527f4c69625f4d65726b6c65547265653a20546f74616c207369626c696e6773206460448201527f6f6573206e6f7420636f72726563746c7920636f72726573706f6e6420746f2060648201527f746f74616c206c65617665732e00000000000000000000000000000000000000608482015260a4016102d4565b8460005b8451811015610d92578560011660011415610d2b57848181518110610ceb57610ceb611e33565b602002602001015182604051602001610d0e929190918252602082015260400190565b604051602081830303815290604052805190602001209150610d79565b81858281518110610d3e57610d3e611e33565b6020026020010151604051602001610d60929190918252602082015260400190565b6040516020818303038152906040528051906020012091505b60019590951c9480610d8a81611e62565b915050610cc4565b5090951495945050505050565b6000806000610dac6109c0565b73ffffffffffffffffffffffffffffffffffffffff1663ccf8f9696040518163ffffffff1660e01b815260040160206040518083038186803b158015610df157600080fd5b505afa158015610e05573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e299190611e9b565b64ffffffffff602882901c169460509190911c9350915050565b6000610e836040518060400160405280600c81526020017f4f564d5f50726f706f73657200000000000000000000000000000000000000008152506101d4565b9050600080610e90610d9f565b90925090503373ffffffffffffffffffffffffffffffffffffffff84161415610eba575042610f69565b426002548264ffffffffff16610ed09190611deb565b10610f695760405162461bcd60e51b815260206004820152604360248201527f43616e6e6f74207075626c69736820737461746520726f6f747320776974686960448201527f6e207468652073657175656e636572207075626c69636174696f6e2077696e6460648201527f6f772e0000000000000000000000000000000000000000000000000000000000608482015260a4016102d4565b60006040518060a00160405280610f7e6109e8565b8152602001610f8c88611443565b8152602001875181526020018464ffffffffff16815260200186815250905080600001517f16be4c5129a4e03cf3350262e181dc02ddfb4a6008d925368c0899fcd97ca9c58260200151836040015184606001518560800151604051610ff59493929190611edd565b60405180910390a26110056109c0565b73ffffffffffffffffffffffffffffffffffffffff16632015276c61102983611317565b61104e846040015185606001516110409190611deb565b602887811b91909117901b90565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815260048101929092527fffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000166024820152604401600060405180830381600087803b1580156110c657600080fd5b505af11580156110da573d6000803e3d6000fd5b50505050505050505050565b6110ee6109c0565b73ffffffffffffffffffffffffffffffffffffffff16631f7b6d326040518163ffffffff1660e01b815260040160206040518083038186803b15801561113357600080fd5b505afa158015611147573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061116b9190611da3565b8151106111ba5760405162461bcd60e51b815260206004820152601460248201527f496e76616c696420626174636820696e6465782e00000000000000000000000060448201526064016102d4565b6111c381610a6f565b61120f5760405162461bcd60e51b815260206004820152601560248201527f496e76616c6964206261746368206865616465722e000000000000000000000060448201526064016102d4565b6112176109c0565b8151606083015173ffffffffffffffffffffffffffffffffffffffff929092169163167fd681919060281b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815260048101929092527fffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000166024820152604401600060405180830381600087803b1580156112ba57600080fd5b505af11580156112ce573d6000803e3d6000fd5b5050505080600001517f8747b69ce8fdb31c3b9b0a67bd8049ad8c1a69ea417b69b12174068abd9cbd64826020015160405161130c91815260200190565b60405180910390a250565b600081602001518260400151836060015184608001516040516020016113409493929190611edd565b604051602081830303815290604052805190602001209050919050565b60008082116113d45760405162461bcd60e51b815260206004820152603060248201527f4c69625f4d65726b6c65547265653a2043616e6e6f7420636f6d70757465206360448201527f65696c286c6f675f3229206f6620302e0000000000000000000000000000000060648201526084016102d4565b81600114156113e557506000919050565b81600060805b600181106114235780611401600180831b611f0c565b901b83161561141b576114148183611deb565b92811c9291505b60011c6113eb565b506001811b841461143c57611439600182611deb565b90505b9392505050565b6000808251116114bb5760405162461bcd60e51b815260206004820152603460248201527f4c69625f4d65726b6c65547265653a204d7573742070726f766964652061742060448201527f6c65617374206f6e65206c65616620686173682e00000000000000000000000060648201526084016102d4565b8151600114156114e757816000815181106114d8576114d8611e33565b60200260200101519050919050565b60408051610200810182527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e56381527f633dc4d7da7256660a892f8f1604a44b5432649cc8ec5cb3ced4c4e6ac94dd1d60208201527f890740a8eb06ce9be422cb8da5cdafc2b58c0a5e24036c578de2a433c828ff7d818301527f3b8ec09e026fdc305365dfc94e189a81b38c7597b3d941c279f042e8206e0bd86060808301919091527fecd50eee38e386bd62be9bedb990706951b65fe053bd9d8a521af753d139e2da60808301527fdefff6d330bb5403f63b14f33b578274160de3a50df4efecf0e0db73bcdd3da560a08301527f617bdd11f7c0a11f49db22f629387a12da7596f9d1704d7465177c63d88ec7d760c08301527f292c23a9aa1d8bea7e2435e555a4a60e379a5a35f3f452bae60121073fb6eead60e08301527fe1cea92ed99acdcb045a6726b2f87107e8a61620a232cf4d7d5b5766b3952e106101008301527f7ad66c0a68c72cb89e4fb4303841966e4062a76ab97451e3b9fb526a5ceb7f826101208301527fe026cc5a4aed3c22a58cbd3d2ac754c9352c5436f638042dca99034e836365166101408301527f3d04cffd8b46a874edf5cfae63077de85f849a660426697b06a829c70dd1409c6101608301527fad676aa337a485e4728a0b240d92b3ef7b3c372d06d189322bfd5f61f1e7203e6101808301527fa2fca4a49658f9fab7aa63289c91b7c7b6c832a6d0e69334ff5b0a3483d09dab6101a08301527f4ebfd9cd7bca2505f7bef59cc1c12ecc708fff26ae4af19abe852afe9e20c8626101c08301527f2def10d13dd169f550f578bda343d9717a138562e0093b380a1120789d53cf106101e083015282518381529081018352909160009190602082018180368337505085519192506000918291508180805b60018411156118fd57611798600285611f52565b91506117a5600285611f66565b600114905060005b82811015611851578a6117c1826002611f7a565b815181106117d1576117d1611e33565b602002602001015196508a8160026117e99190611f7a565b6117f4906001611deb565b8151811061180457611804611e33565b6020026020010151955086602089015285604089015287805190602001208b828151811061183457611834611e33565b60209081029190910101528061184981611e62565b9150506117ad565b5080156118cd5789611864600186611f0c565b8151811061187457611874611e33565b6020026020010151955087836010811061189057611890611e33565b602002015160001b945085602088015284604088015286805190602001208a83815181106118c0576118c0611e33565b6020026020010181815250505b806118d95760006118dc565b60015b6118e99060ff1683611deb565b9350826118f581611e62565b935050611784565b8960008151811061191057611910611e33565b602002602001015198505050505050505050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561199d5761199d611927565b604052919050565b600067ffffffffffffffff8311156119bf576119bf611927565b6119f060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f86011601611956565b9050828152838383011115611a0457600080fd5b828260208301376000602084830101529392505050565b600060208284031215611a2d57600080fd5b813567ffffffffffffffff811115611a4457600080fd5b8201601f81018413611a5557600080fd5b611a64848235602084016119a5565b949350505050565b600060a08284031215611a7e57600080fd5b60405160a0810167ffffffffffffffff8282108183111715611aa257611aa2611927565b81604052829350843583526020850135602084015260408501356040840152606085013560608401526080850135915080821115611adf57600080fd5b508301601f81018513611af157600080fd5b611b00858235602084016119a5565b6080830152505092915050565b600082601f830112611b1e57600080fd5b8135602067ffffffffffffffff821115611b3a57611b3a611927565b8160051b611b49828201611956565b9283528481018201928281019087851115611b6357600080fd5b83870192505b84831015611b8257823582529183019190830190611b69565b979650505050505050565b600080600060608486031215611ba257600080fd5b83359250602084013567ffffffffffffffff80821115611bc157600080fd5b611bcd87838801611a6c565b93506040860135915080821115611be357600080fd5b9085019060408288031215611bf757600080fd5b604051604081018181108382111715611c1257611c12611927565b60405282358152602083013582811115611c2b57600080fd5b611c3789828601611b0d565b6020830152508093505050509250925092565b60008060408385031215611c5d57600080fd5b823567ffffffffffffffff811115611c7457600080fd5b611c8085828601611b0d565b95602094909401359450505050565b600060208284031215611ca157600080fd5b813567ffffffffffffffff811115611cb857600080fd5b611a6484828501611a6c565b6000815180845260005b81811015611cea57602081850181015186830182015201611cce565b81811115611cfc576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60208152600061143c6020830184611cc4565b73ffffffffffffffffffffffffffffffffffffffff811681146109bd57600080fd5b600060208284031215611d7657600080fd5b815161143c81611d42565b600060208284031215611d9357600080fd5b8151801515811461143c57600080fd5b600060208284031215611db557600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008219821115611dfe57611dfe611dbc565b500190565b60008060408385031215611e1657600080fd5b825191506020830151611e2881611d42565b809150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611e9457611e94611dbc565b5060010190565b600060208284031215611ead57600080fd5b81517fffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000008116811461143c57600080fd5b848152836020820152826040820152608060608201526000611f026080830184611cc4565b9695505050505050565b600082821015611f1e57611f1e611dbc565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082611f6157611f61611f23565b500490565b600082611f7557611f75611f23565b500690565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615611fb257611fb2611dbc565b50029056fe436861696e53746f72616765436f6e7461696e65722d5343432d62617463686573a2646970667358221220f97433bcdfea89f96da4dd35233c6b44aadecb94f82aab10226e964aff14127064736f6c63430008090033", diff --git a/packages/contracts/deployments/goerli/solcInputs/12afc2c6487cfec4471fc920fd475624.json b/packages/contracts/deployments/goerli/solcInputs/12afc2c6487cfec4471fc920fd475624.json new file mode 100644 index 0000000000000..3e4a2346b27cd --- /dev/null +++ b/packages/contracts/deployments/goerli/solcInputs/12afc2c6487cfec4471fc920fd475624.json @@ -0,0 +1,252 @@ +{ + "language": "Solidity", + "sources": { + "contracts/L1/deployment/AddressDictator.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\nimport { Lib_AddressManager } from \"../../libraries/resolver/Lib_AddressManager.sol\";\n\n/**\n * @title AddressDictator\n * @dev The AddressDictator (glory to Arstotzka) is a contract that allows us to safely manipulate\n * many different addresses in the AddressManager without transferring ownership of the\n * AddressManager to a hot wallet or hardware wallet.\n */\ncontract AddressDictator {\n /*********\n * Types *\n *********/\n\n struct NamedAddress {\n string name;\n address addr;\n }\n\n /*************\n * Variables *\n *************/\n\n Lib_AddressManager public manager;\n address public finalOwner;\n NamedAddress[] namedAddresses;\n\n /***************\n * Constructor *\n ***************/\n\n /**\n * @param _manager Address of the AddressManager contract.\n * @param _finalOwner Address to transfer AddressManager ownership to afterwards.\n * @param _names Array of names to associate an address with.\n * @param _addresses Array of addresses to associate with the name.\n */\n constructor(\n Lib_AddressManager _manager,\n address _finalOwner,\n string[] memory _names,\n address[] memory _addresses\n ) {\n manager = _manager;\n finalOwner = _finalOwner;\n require(\n _names.length == _addresses.length,\n \"AddressDictator: Must provide an equal number of names and addresses.\"\n );\n for (uint256 i = 0; i < _names.length; i++) {\n namedAddresses.push(NamedAddress({ name: _names[i], addr: _addresses[i] }));\n }\n }\n\n /********************\n * Public Functions *\n ********************/\n\n /**\n * Called to finalize the transfer, this function is callable by anyone, but will only result in\n * an upgrade if this contract is the owner Address Manager.\n */\n // slither-disable-next-line calls-loop\n function setAddresses() external {\n for (uint256 i = 0; i < namedAddresses.length; i++) {\n manager.setAddress(namedAddresses[i].name, namedAddresses[i].addr);\n }\n // note that this will revert if _finalOwner == currentOwner\n manager.transferOwnership(finalOwner);\n }\n\n /**\n * Transfers ownership of this contract to the finalOwner.\n * Only callable by the Final Owner, which is intended to be our multisig.\n * This function shouldn't be necessary, but it gives a sense of reassurance that we can recover\n * if something really surprising goes wrong.\n */\n function returnOwnership() external {\n require(msg.sender == finalOwner, \"AddressDictator: only callable by finalOwner\");\n manager.transferOwnership(finalOwner);\n }\n\n /******************\n * View Functions *\n ******************/\n\n /**\n * Returns the full namedAddresses array.\n */\n function getNamedAddresses() external view returns (NamedAddress[] memory) {\n return namedAddresses;\n }\n}\n" + }, + "contracts/libraries/resolver/Lib_AddressManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* External Imports */\nimport { Ownable } from \"@openzeppelin/contracts/access/Ownable.sol\";\n\n/**\n * @title Lib_AddressManager\n */\ncontract Lib_AddressManager is Ownable {\n /**********\n * Events *\n **********/\n\n event AddressSet(string indexed _name, address _newAddress, address _oldAddress);\n\n /*************\n * Variables *\n *************/\n\n mapping(bytes32 => address) private addresses;\n\n /********************\n * Public Functions *\n ********************/\n\n /**\n * Changes the address associated with a particular name.\n * @param _name String name to associate an address with.\n * @param _address Address to associate with the name.\n */\n function setAddress(string memory _name, address _address) external onlyOwner {\n bytes32 nameHash = _getNameHash(_name);\n address oldAddress = addresses[nameHash];\n addresses[nameHash] = _address;\n\n emit AddressSet(_name, _address, oldAddress);\n }\n\n /**\n * Retrieves the address associated with a given name.\n * @param _name Name to retrieve an address for.\n * @return Address associated with the given name.\n */\n function getAddress(string memory _name) external view returns (address) {\n return addresses[_getNameHash(_name)];\n }\n\n /**********************\n * Internal Functions *\n **********************/\n\n /**\n * Computes the hash of a name.\n * @param _name Name to compute a hash for.\n * @return Hash of the given name.\n */\n function _getNameHash(string memory _name) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(_name));\n }\n}\n" + }, + "@openzeppelin/contracts/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _setOwner(_msgSender());\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _setOwner(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _setOwner(newOwner);\n }\n\n function _setOwner(address newOwner) private {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" + }, + "contracts/libraries/resolver/Lib_ResolvedDelegateProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Library Imports */\nimport { Lib_AddressManager } from \"./Lib_AddressManager.sol\";\n\n/**\n * @title Lib_ResolvedDelegateProxy\n */\ncontract Lib_ResolvedDelegateProxy {\n /*************\n * Variables *\n *************/\n\n // Using mappings to store fields to avoid overwriting storage slots in the\n // implementation contract. For example, instead of storing these fields at\n // storage slot `0` & `1`, they are stored at `keccak256(key + slot)`.\n // See: https://solidity.readthedocs.io/en/v0.7.0/internals/layout_in_storage.html\n // NOTE: Do not use this code in your own contract system.\n // There is a known flaw in this contract, and we will remove it from the repository\n // in the near future. Due to the very limited way that we are using it, this flaw is\n // not an issue in our system.\n mapping(address => string) private implementationName;\n mapping(address => Lib_AddressManager) private addressManager;\n\n /***************\n * Constructor *\n ***************/\n\n /**\n * @param _libAddressManager Address of the Lib_AddressManager.\n * @param _implementationName implementationName of the contract to proxy to.\n */\n constructor(address _libAddressManager, string memory _implementationName) {\n addressManager[address(this)] = Lib_AddressManager(_libAddressManager);\n implementationName[address(this)] = _implementationName;\n }\n\n /*********************\n * Fallback Function *\n *********************/\n\n fallback() external payable {\n address target = addressManager[address(this)].getAddress(\n (implementationName[address(this)])\n );\n\n require(target != address(0), \"Target address must be initialized.\");\n\n // slither-disable-next-line controlled-delegatecall\n (bool success, bytes memory returndata) = target.delegatecall(msg.data);\n\n if (success == true) {\n assembly {\n return(add(returndata, 0x20), mload(returndata))\n }\n } else {\n assembly {\n revert(add(returndata, 0x20), mload(returndata))\n }\n }\n }\n}\n" + }, + "contracts/libraries/resolver/Lib_AddressResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Library Imports */\nimport { Lib_AddressManager } from \"./Lib_AddressManager.sol\";\n\n/**\n * @title Lib_AddressResolver\n */\nabstract contract Lib_AddressResolver {\n /*************\n * Variables *\n *************/\n\n Lib_AddressManager public libAddressManager;\n\n /***************\n * Constructor *\n ***************/\n\n /**\n * @param _libAddressManager Address of the Lib_AddressManager.\n */\n constructor(address _libAddressManager) {\n libAddressManager = Lib_AddressManager(_libAddressManager);\n }\n\n /********************\n * Public Functions *\n ********************/\n\n /**\n * Resolves the address associated with a given name.\n * @param _name Name to resolve an address for.\n * @return Address associated with the given name.\n */\n function resolve(string memory _name) public view returns (address) {\n return libAddressManager.getAddress(_name);\n }\n}\n" + }, + "contracts/L1/verification/BondManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Interface Imports */\nimport { IBondManager } from \"./IBondManager.sol\";\n\n/* Contract Imports */\nimport { Lib_AddressResolver } from \"../../libraries/resolver/Lib_AddressResolver.sol\";\n\n/**\n * @title BondManager\n * @dev This contract is, for now, a stub of the \"real\" BondManager that does nothing but\n * allow the \"OVM_Proposer\" to submit state root batches.\n *\n */\ncontract BondManager is IBondManager, Lib_AddressResolver {\n /**\n * @param _libAddressManager Address of the Address Manager.\n */\n constructor(address _libAddressManager) Lib_AddressResolver(_libAddressManager) {}\n\n /**\n * Checks whether a given address is properly collateralized and can perform actions within\n * the system.\n * @param _who Address to check.\n * @return true if the address is properly collateralized, false otherwise.\n */\n // slither-disable-next-line external-function\n function isCollateralized(address _who) public view returns (bool) {\n // Only authenticate sequencer to submit state root batches.\n return _who == resolve(\"OVM_Proposer\");\n }\n}\n" + }, + "contracts/L1/verification/IBondManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/**\n * @title IBondManager\n */\ninterface IBondManager {\n /********************\n * Public Functions *\n ********************/\n\n function isCollateralized(address _who) external view returns (bool);\n}\n" + }, + "contracts/L1/rollup/StateCommitmentChain.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Library Imports */\nimport { Lib_OVMCodec } from \"../../libraries/codec/Lib_OVMCodec.sol\";\nimport { Lib_AddressResolver } from \"../../libraries/resolver/Lib_AddressResolver.sol\";\nimport { Lib_MerkleTree } from \"../../libraries/utils/Lib_MerkleTree.sol\";\n\n/* Interface Imports */\nimport { IStateCommitmentChain } from \"./IStateCommitmentChain.sol\";\nimport { ICanonicalTransactionChain } from \"./ICanonicalTransactionChain.sol\";\nimport { IBondManager } from \"../verification/IBondManager.sol\";\nimport { IChainStorageContainer } from \"./IChainStorageContainer.sol\";\n\n/**\n * @title StateCommitmentChain\n * @dev The State Commitment Chain (SCC) contract contains a list of proposed state roots which\n * Proposers assert to be a result of each transaction in the Canonical Transaction Chain (CTC).\n * Elements here have a 1:1 correspondence with transactions in the CTC, and should be the unique\n * state root calculated off-chain by applying the canonical transactions one by one.\n *\n */\ncontract StateCommitmentChain is IStateCommitmentChain, Lib_AddressResolver {\n /*************\n * Constants *\n *************/\n\n uint256 public FRAUD_PROOF_WINDOW;\n uint256 public SEQUENCER_PUBLISH_WINDOW;\n\n /***************\n * Constructor *\n ***************/\n\n /**\n * @param _libAddressManager Address of the Address Manager.\n */\n constructor(\n address _libAddressManager,\n uint256 _fraudProofWindow,\n uint256 _sequencerPublishWindow\n ) Lib_AddressResolver(_libAddressManager) {\n FRAUD_PROOF_WINDOW = _fraudProofWindow;\n SEQUENCER_PUBLISH_WINDOW = _sequencerPublishWindow;\n }\n\n /********************\n * Public Functions *\n ********************/\n\n /**\n * Accesses the batch storage container.\n * @return Reference to the batch storage container.\n */\n function batches() public view returns (IChainStorageContainer) {\n return IChainStorageContainer(resolve(\"ChainStorageContainer-SCC-batches\"));\n }\n\n /**\n * @inheritdoc IStateCommitmentChain\n */\n function getTotalElements() public view returns (uint256 _totalElements) {\n (uint40 totalElements, ) = _getBatchExtraData();\n return uint256(totalElements);\n }\n\n /**\n * @inheritdoc IStateCommitmentChain\n */\n function getTotalBatches() public view returns (uint256 _totalBatches) {\n return batches().length();\n }\n\n /**\n * @inheritdoc IStateCommitmentChain\n */\n // slither-disable-next-line external-function\n function getLastSequencerTimestamp() public view returns (uint256 _lastSequencerTimestamp) {\n (, uint40 lastSequencerTimestamp) = _getBatchExtraData();\n return uint256(lastSequencerTimestamp);\n }\n\n /**\n * @inheritdoc IStateCommitmentChain\n */\n // slither-disable-next-line external-function\n function appendStateBatch(bytes32[] memory _batch, uint256 _shouldStartAtElement) public {\n // Fail fast in to make sure our batch roots aren't accidentally made fraudulent by the\n // publication of batches by some other user.\n require(\n _shouldStartAtElement == getTotalElements(),\n \"Actual batch start index does not match expected start index.\"\n );\n\n // Proposers must have previously staked at the BondManager\n require(\n IBondManager(resolve(\"BondManager\")).isCollateralized(msg.sender),\n \"Proposer does not have enough collateral posted\"\n );\n\n require(_batch.length > 0, \"Cannot submit an empty state batch.\");\n\n require(\n getTotalElements() + _batch.length <=\n ICanonicalTransactionChain(resolve(\"CanonicalTransactionChain\")).getTotalElements(),\n \"Number of state roots cannot exceed the number of canonical transactions.\"\n );\n\n // Pass the block's timestamp and the publisher of the data\n // to be used in the fraud proofs\n _appendBatch(_batch, abi.encode(block.timestamp, msg.sender));\n }\n\n /**\n * @inheritdoc IStateCommitmentChain\n */\n // slither-disable-next-line external-function\n function deleteStateBatch(Lib_OVMCodec.ChainBatchHeader memory _batchHeader) public {\n require(\n msg.sender == resolve(\"OVM_FraudVerifier\"),\n \"State batches can only be deleted by the OVM_FraudVerifier.\"\n );\n\n require(_isValidBatchHeader(_batchHeader), \"Invalid batch header.\");\n\n require(\n insideFraudProofWindow(_batchHeader),\n \"State batches can only be deleted within the fraud proof window.\"\n );\n\n _deleteBatch(_batchHeader);\n }\n\n /**\n * @inheritdoc IStateCommitmentChain\n */\n // slither-disable-next-line external-function\n function verifyStateCommitment(\n bytes32 _element,\n Lib_OVMCodec.ChainBatchHeader memory _batchHeader,\n Lib_OVMCodec.ChainInclusionProof memory _proof\n ) public view returns (bool) {\n require(_isValidBatchHeader(_batchHeader), \"Invalid batch header.\");\n\n require(\n Lib_MerkleTree.verify(\n _batchHeader.batchRoot,\n _element,\n _proof.index,\n _proof.siblings,\n _batchHeader.batchSize\n ),\n \"Invalid inclusion proof.\"\n );\n\n return true;\n }\n\n /**\n * @inheritdoc IStateCommitmentChain\n */\n function insideFraudProofWindow(Lib_OVMCodec.ChainBatchHeader memory _batchHeader)\n public\n view\n returns (bool _inside)\n {\n (uint256 timestamp, ) = abi.decode(_batchHeader.extraData, (uint256, address));\n\n require(timestamp != 0, \"Batch header timestamp cannot be zero\");\n return (timestamp + FRAUD_PROOF_WINDOW) > block.timestamp;\n }\n\n /**********************\n * Internal Functions *\n **********************/\n\n /**\n * Parses the batch context from the extra data.\n * @return Total number of elements submitted.\n * @return Timestamp of the last batch submitted by the sequencer.\n */\n function _getBatchExtraData() internal view returns (uint40, uint40) {\n bytes27 extraData = batches().getGlobalMetadata();\n\n // solhint-disable max-line-length\n uint40 totalElements;\n uint40 lastSequencerTimestamp;\n assembly {\n extraData := shr(40, extraData)\n totalElements := and(\n extraData,\n 0x000000000000000000000000000000000000000000000000000000FFFFFFFFFF\n )\n lastSequencerTimestamp := shr(\n 40,\n and(extraData, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000)\n )\n }\n // solhint-enable max-line-length\n\n return (totalElements, lastSequencerTimestamp);\n }\n\n /**\n * Encodes the batch context for the extra data.\n * @param _totalElements Total number of elements submitted.\n * @param _lastSequencerTimestamp Timestamp of the last batch submitted by the sequencer.\n * @return Encoded batch context.\n */\n function _makeBatchExtraData(uint40 _totalElements, uint40 _lastSequencerTimestamp)\n internal\n pure\n returns (bytes27)\n {\n bytes27 extraData;\n assembly {\n extraData := _totalElements\n extraData := or(extraData, shl(40, _lastSequencerTimestamp))\n extraData := shl(40, extraData)\n }\n\n return extraData;\n }\n\n /**\n * Appends a batch to the chain.\n * @param _batch Elements within the batch.\n * @param _extraData Any extra data to append to the batch.\n */\n function _appendBatch(bytes32[] memory _batch, bytes memory _extraData) internal {\n address sequencer = resolve(\"OVM_Proposer\");\n (uint40 totalElements, uint40 lastSequencerTimestamp) = _getBatchExtraData();\n\n if (msg.sender == sequencer) {\n lastSequencerTimestamp = uint40(block.timestamp);\n } else {\n // We keep track of the last batch submitted by the sequencer so there's a window in\n // which only the sequencer can publish state roots. A window like this just reduces\n // the chance of \"system breaking\" state roots being published while we're still in\n // testing mode. This window should be removed or significantly reduced in the future.\n require(\n lastSequencerTimestamp + SEQUENCER_PUBLISH_WINDOW < block.timestamp,\n \"Cannot publish state roots within the sequencer publication window.\"\n );\n }\n\n // For efficiency reasons getMerkleRoot modifies the `_batch` argument in place\n // while calculating the root hash therefore any arguments passed to it must not\n // be used again afterwards\n Lib_OVMCodec.ChainBatchHeader memory batchHeader = Lib_OVMCodec.ChainBatchHeader({\n batchIndex: getTotalBatches(),\n batchRoot: Lib_MerkleTree.getMerkleRoot(_batch),\n batchSize: _batch.length,\n prevTotalElements: totalElements,\n extraData: _extraData\n });\n\n emit StateBatchAppended(\n batchHeader.batchIndex,\n batchHeader.batchRoot,\n batchHeader.batchSize,\n batchHeader.prevTotalElements,\n batchHeader.extraData\n );\n\n batches().push(\n Lib_OVMCodec.hashBatchHeader(batchHeader),\n _makeBatchExtraData(\n uint40(batchHeader.prevTotalElements + batchHeader.batchSize),\n lastSequencerTimestamp\n )\n );\n }\n\n /**\n * Removes a batch and all subsequent batches from the chain.\n * @param _batchHeader Header of the batch to remove.\n */\n function _deleteBatch(Lib_OVMCodec.ChainBatchHeader memory _batchHeader) internal {\n require(_batchHeader.batchIndex < batches().length(), \"Invalid batch index.\");\n\n require(_isValidBatchHeader(_batchHeader), \"Invalid batch header.\");\n\n // slither-disable-next-line reentrancy-events\n batches().deleteElementsAfterInclusive(\n _batchHeader.batchIndex,\n _makeBatchExtraData(uint40(_batchHeader.prevTotalElements), 0)\n );\n\n // slither-disable-next-line reentrancy-events\n emit StateBatchDeleted(_batchHeader.batchIndex, _batchHeader.batchRoot);\n }\n\n /**\n * Checks that a batch header matches the stored hash for the given index.\n * @param _batchHeader Batch header to validate.\n * @return Whether or not the header matches the stored one.\n */\n function _isValidBatchHeader(Lib_OVMCodec.ChainBatchHeader memory _batchHeader)\n internal\n view\n returns (bool)\n {\n return Lib_OVMCodec.hashBatchHeader(_batchHeader) == batches().get(_batchHeader.batchIndex);\n }\n}\n" + }, + "contracts/libraries/codec/Lib_OVMCodec.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Library Imports */\nimport { Lib_RLPReader } from \"../rlp/Lib_RLPReader.sol\";\nimport { Lib_RLPWriter } from \"../rlp/Lib_RLPWriter.sol\";\nimport { Lib_BytesUtils } from \"../utils/Lib_BytesUtils.sol\";\nimport { Lib_Bytes32Utils } from \"../utils/Lib_Bytes32Utils.sol\";\n\n/**\n * @title Lib_OVMCodec\n */\nlibrary Lib_OVMCodec {\n /*********\n * Enums *\n *********/\n\n enum QueueOrigin {\n SEQUENCER_QUEUE,\n L1TOL2_QUEUE\n }\n\n /***********\n * Structs *\n ***********/\n\n struct EVMAccount {\n uint256 nonce;\n uint256 balance;\n bytes32 storageRoot;\n bytes32 codeHash;\n }\n\n struct ChainBatchHeader {\n uint256 batchIndex;\n bytes32 batchRoot;\n uint256 batchSize;\n uint256 prevTotalElements;\n bytes extraData;\n }\n\n struct ChainInclusionProof {\n uint256 index;\n bytes32[] siblings;\n }\n\n struct Transaction {\n uint256 timestamp;\n uint256 blockNumber;\n QueueOrigin l1QueueOrigin;\n address l1TxOrigin;\n address entrypoint;\n uint256 gasLimit;\n bytes data;\n }\n\n struct TransactionChainElement {\n bool isSequenced;\n uint256 queueIndex; // QUEUED TX ONLY\n uint256 timestamp; // SEQUENCER TX ONLY\n uint256 blockNumber; // SEQUENCER TX ONLY\n bytes txData; // SEQUENCER TX ONLY\n }\n\n struct QueueElement {\n bytes32 transactionHash;\n uint40 timestamp;\n uint40 blockNumber;\n }\n\n /**********************\n * Internal Functions *\n **********************/\n\n /**\n * Encodes a standard OVM transaction.\n * @param _transaction OVM transaction to encode.\n * @return Encoded transaction bytes.\n */\n function encodeTransaction(Transaction memory _transaction)\n internal\n pure\n returns (bytes memory)\n {\n return\n abi.encodePacked(\n _transaction.timestamp,\n _transaction.blockNumber,\n _transaction.l1QueueOrigin,\n _transaction.l1TxOrigin,\n _transaction.entrypoint,\n _transaction.gasLimit,\n _transaction.data\n );\n }\n\n /**\n * Hashes a standard OVM transaction.\n * @param _transaction OVM transaction to encode.\n * @return Hashed transaction\n */\n function hashTransaction(Transaction memory _transaction) internal pure returns (bytes32) {\n return keccak256(encodeTransaction(_transaction));\n }\n\n /**\n * @notice Decodes an RLP-encoded account state into a useful struct.\n * @param _encoded RLP-encoded account state.\n * @return Account state struct.\n */\n function decodeEVMAccount(bytes memory _encoded) internal pure returns (EVMAccount memory) {\n Lib_RLPReader.RLPItem[] memory accountState = Lib_RLPReader.readList(_encoded);\n\n return\n EVMAccount({\n nonce: Lib_RLPReader.readUint256(accountState[0]),\n balance: Lib_RLPReader.readUint256(accountState[1]),\n storageRoot: Lib_RLPReader.readBytes32(accountState[2]),\n codeHash: Lib_RLPReader.readBytes32(accountState[3])\n });\n }\n\n /**\n * Calculates a hash for a given batch header.\n * @param _batchHeader Header to hash.\n * @return Hash of the header.\n */\n function hashBatchHeader(Lib_OVMCodec.ChainBatchHeader memory _batchHeader)\n internal\n pure\n returns (bytes32)\n {\n return\n keccak256(\n abi.encode(\n _batchHeader.batchRoot,\n _batchHeader.batchSize,\n _batchHeader.prevTotalElements,\n _batchHeader.extraData\n )\n );\n }\n}\n" + }, + "contracts/libraries/utils/Lib_MerkleTree.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/**\n * @title Lib_MerkleTree\n * @author River Keefer\n */\nlibrary Lib_MerkleTree {\n /**********************\n * Internal Functions *\n **********************/\n\n /**\n * Calculates a merkle root for a list of 32-byte leaf hashes. WARNING: If the number\n * of leaves passed in is not a power of two, it pads out the tree with zero hashes.\n * If you do not know the original length of elements for the tree you are verifying, then\n * this may allow empty leaves past _elements.length to pass a verification check down the line.\n * Note that the _elements argument is modified, therefore it must not be used again afterwards\n * @param _elements Array of hashes from which to generate a merkle root.\n * @return Merkle root of the leaves, with zero hashes for non-powers-of-two (see above).\n */\n function getMerkleRoot(bytes32[] memory _elements) internal pure returns (bytes32) {\n require(_elements.length > 0, \"Lib_MerkleTree: Must provide at least one leaf hash.\");\n\n if (_elements.length == 1) {\n return _elements[0];\n }\n\n uint256[16] memory defaults = [\n 0x290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563,\n 0x633dc4d7da7256660a892f8f1604a44b5432649cc8ec5cb3ced4c4e6ac94dd1d,\n 0x890740a8eb06ce9be422cb8da5cdafc2b58c0a5e24036c578de2a433c828ff7d,\n 0x3b8ec09e026fdc305365dfc94e189a81b38c7597b3d941c279f042e8206e0bd8,\n 0xecd50eee38e386bd62be9bedb990706951b65fe053bd9d8a521af753d139e2da,\n 0xdefff6d330bb5403f63b14f33b578274160de3a50df4efecf0e0db73bcdd3da5,\n 0x617bdd11f7c0a11f49db22f629387a12da7596f9d1704d7465177c63d88ec7d7,\n 0x292c23a9aa1d8bea7e2435e555a4a60e379a5a35f3f452bae60121073fb6eead,\n 0xe1cea92ed99acdcb045a6726b2f87107e8a61620a232cf4d7d5b5766b3952e10,\n 0x7ad66c0a68c72cb89e4fb4303841966e4062a76ab97451e3b9fb526a5ceb7f82,\n 0xe026cc5a4aed3c22a58cbd3d2ac754c9352c5436f638042dca99034e83636516,\n 0x3d04cffd8b46a874edf5cfae63077de85f849a660426697b06a829c70dd1409c,\n 0xad676aa337a485e4728a0b240d92b3ef7b3c372d06d189322bfd5f61f1e7203e,\n 0xa2fca4a49658f9fab7aa63289c91b7c7b6c832a6d0e69334ff5b0a3483d09dab,\n 0x4ebfd9cd7bca2505f7bef59cc1c12ecc708fff26ae4af19abe852afe9e20c862,\n 0x2def10d13dd169f550f578bda343d9717a138562e0093b380a1120789d53cf10\n ];\n\n // Reserve memory space for our hashes.\n bytes memory buf = new bytes(64);\n\n // We'll need to keep track of left and right siblings.\n bytes32 leftSibling;\n bytes32 rightSibling;\n\n // Number of non-empty nodes at the current depth.\n uint256 rowSize = _elements.length;\n\n // Current depth, counting from 0 at the leaves\n uint256 depth = 0;\n\n // Common sub-expressions\n uint256 halfRowSize; // rowSize / 2\n bool rowSizeIsOdd; // rowSize % 2 == 1\n\n while (rowSize > 1) {\n halfRowSize = rowSize / 2;\n rowSizeIsOdd = rowSize % 2 == 1;\n\n for (uint256 i = 0; i < halfRowSize; i++) {\n leftSibling = _elements[(2 * i)];\n rightSibling = _elements[(2 * i) + 1];\n assembly {\n mstore(add(buf, 32), leftSibling)\n mstore(add(buf, 64), rightSibling)\n }\n\n _elements[i] = keccak256(buf);\n }\n\n if (rowSizeIsOdd) {\n leftSibling = _elements[rowSize - 1];\n rightSibling = bytes32(defaults[depth]);\n assembly {\n mstore(add(buf, 32), leftSibling)\n mstore(add(buf, 64), rightSibling)\n }\n\n _elements[halfRowSize] = keccak256(buf);\n }\n\n rowSize = halfRowSize + (rowSizeIsOdd ? 1 : 0);\n depth++;\n }\n\n return _elements[0];\n }\n\n /**\n * Verifies a merkle branch for the given leaf hash. Assumes the original length\n * of leaves generated is a known, correct input, and does not return true for indices\n * extending past that index (even if _siblings would be otherwise valid.)\n * @param _root The Merkle root to verify against.\n * @param _leaf The leaf hash to verify inclusion of.\n * @param _index The index in the tree of this leaf.\n * @param _siblings Array of sibline nodes in the inclusion proof, starting from depth 0\n * (bottom of the tree).\n * @param _totalLeaves The total number of leaves originally passed into.\n * @return Whether or not the merkle branch and leaf passes verification.\n */\n function verify(\n bytes32 _root,\n bytes32 _leaf,\n uint256 _index,\n bytes32[] memory _siblings,\n uint256 _totalLeaves\n ) internal pure returns (bool) {\n require(_totalLeaves > 0, \"Lib_MerkleTree: Total leaves must be greater than zero.\");\n\n require(_index < _totalLeaves, \"Lib_MerkleTree: Index out of bounds.\");\n\n require(\n _siblings.length == _ceilLog2(_totalLeaves),\n \"Lib_MerkleTree: Total siblings does not correctly correspond to total leaves.\"\n );\n\n bytes32 computedRoot = _leaf;\n\n for (uint256 i = 0; i < _siblings.length; i++) {\n if ((_index & 1) == 1) {\n computedRoot = keccak256(abi.encodePacked(_siblings[i], computedRoot));\n } else {\n computedRoot = keccak256(abi.encodePacked(computedRoot, _siblings[i]));\n }\n\n _index >>= 1;\n }\n\n return _root == computedRoot;\n }\n\n /*********************\n * Private Functions *\n *********************/\n\n /**\n * Calculates the integer ceiling of the log base 2 of an input.\n * @param _in Unsigned input to calculate the log.\n * @return ceil(log_base_2(_in))\n */\n function _ceilLog2(uint256 _in) private pure returns (uint256) {\n require(_in > 0, \"Lib_MerkleTree: Cannot compute ceil(log_2) of 0.\");\n\n if (_in == 1) {\n return 0;\n }\n\n // Find the highest set bit (will be floor(log_2)).\n // Borrowed with <3 from https://github.com/ethereum/solidity-examples\n uint256 val = _in;\n uint256 highest = 0;\n for (uint256 i = 128; i >= 1; i >>= 1) {\n if (val & (((uint256(1) << i) - 1) << i) != 0) {\n highest += i;\n val >>= i;\n }\n }\n\n // Increment by one if this is not a perfect logarithm.\n if ((uint256(1) << highest) != _in) {\n highest += 1;\n }\n\n return highest;\n }\n}\n" + }, + "contracts/L1/rollup/IStateCommitmentChain.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >0.5.0 <0.9.0;\n\n/* Library Imports */\nimport { Lib_OVMCodec } from \"../../libraries/codec/Lib_OVMCodec.sol\";\n\n/**\n * @title IStateCommitmentChain\n */\ninterface IStateCommitmentChain {\n /**********\n * Events *\n **********/\n\n event StateBatchAppended(\n uint256 indexed _batchIndex,\n bytes32 _batchRoot,\n uint256 _batchSize,\n uint256 _prevTotalElements,\n bytes _extraData\n );\n\n event StateBatchDeleted(uint256 indexed _batchIndex, bytes32 _batchRoot);\n\n /********************\n * Public Functions *\n ********************/\n\n /**\n * Retrieves the total number of elements submitted.\n * @return _totalElements Total submitted elements.\n */\n function getTotalElements() external view returns (uint256 _totalElements);\n\n /**\n * Retrieves the total number of batches submitted.\n * @return _totalBatches Total submitted batches.\n */\n function getTotalBatches() external view returns (uint256 _totalBatches);\n\n /**\n * Retrieves the timestamp of the last batch submitted by the sequencer.\n * @return _lastSequencerTimestamp Last sequencer batch timestamp.\n */\n function getLastSequencerTimestamp() external view returns (uint256 _lastSequencerTimestamp);\n\n /**\n * Appends a batch of state roots to the chain.\n * @param _batch Batch of state roots.\n * @param _shouldStartAtElement Index of the element at which this batch should start.\n */\n function appendStateBatch(bytes32[] calldata _batch, uint256 _shouldStartAtElement) external;\n\n /**\n * Deletes all state roots after (and including) a given batch.\n * @param _batchHeader Header of the batch to start deleting from.\n */\n function deleteStateBatch(Lib_OVMCodec.ChainBatchHeader memory _batchHeader) external;\n\n /**\n * Verifies a batch inclusion proof.\n * @param _element Hash of the element to verify a proof for.\n * @param _batchHeader Header of the batch in which the element was included.\n * @param _proof Merkle inclusion proof for the element.\n */\n function verifyStateCommitment(\n bytes32 _element,\n Lib_OVMCodec.ChainBatchHeader memory _batchHeader,\n Lib_OVMCodec.ChainInclusionProof memory _proof\n ) external view returns (bool _verified);\n\n /**\n * Checks whether a given batch is still inside its fraud proof window.\n * @param _batchHeader Header of the batch to check.\n * @return _inside Whether or not the batch is inside the fraud proof window.\n */\n function insideFraudProofWindow(Lib_OVMCodec.ChainBatchHeader memory _batchHeader)\n external\n view\n returns (bool _inside);\n}\n" + }, + "contracts/L1/rollup/ICanonicalTransactionChain.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >0.5.0 <0.9.0;\n\n/* Library Imports */\nimport { Lib_OVMCodec } from \"../../libraries/codec/Lib_OVMCodec.sol\";\n\n/* Interface Imports */\nimport { IChainStorageContainer } from \"./IChainStorageContainer.sol\";\n\n/**\n * @title ICanonicalTransactionChain\n */\ninterface ICanonicalTransactionChain {\n /**********\n * Events *\n **********/\n\n event L2GasParamsUpdated(\n uint256 l2GasDiscountDivisor,\n uint256 enqueueGasCost,\n uint256 enqueueL2GasPrepaid\n );\n\n event TransactionEnqueued(\n address indexed _l1TxOrigin,\n address indexed _target,\n uint256 _gasLimit,\n bytes _data,\n uint256 indexed _queueIndex,\n uint256 _timestamp\n );\n\n event QueueBatchAppended(\n uint256 _startingQueueIndex,\n uint256 _numQueueElements,\n uint256 _totalElements\n );\n\n event SequencerBatchAppended(\n uint256 _startingQueueIndex,\n uint256 _numQueueElements,\n uint256 _totalElements\n );\n\n event TransactionBatchAppended(\n uint256 indexed _batchIndex,\n bytes32 _batchRoot,\n uint256 _batchSize,\n uint256 _prevTotalElements,\n bytes _extraData\n );\n\n /***********\n * Structs *\n ***********/\n\n struct BatchContext {\n uint256 numSequencedTransactions;\n uint256 numSubsequentQueueTransactions;\n uint256 timestamp;\n uint256 blockNumber;\n }\n\n /*******************************\n * Authorized Setter Functions *\n *******************************/\n\n /**\n * Allows the Burn Admin to update the parameters which determine the amount of gas to burn.\n * The value of enqueueL2GasPrepaid is immediately updated as well.\n */\n function setGasParams(uint256 _l2GasDiscountDivisor, uint256 _enqueueGasCost) external;\n\n /********************\n * Public Functions *\n ********************/\n\n /**\n * Accesses the batch storage container.\n * @return Reference to the batch storage container.\n */\n function batches() external view returns (IChainStorageContainer);\n\n /**\n * Retrieves the total number of elements submitted.\n * @return _totalElements Total submitted elements.\n */\n function getTotalElements() external view returns (uint256 _totalElements);\n\n /**\n * Retrieves the total number of batches submitted.\n * @return _totalBatches Total submitted batches.\n */\n function getTotalBatches() external view returns (uint256 _totalBatches);\n\n /**\n * Returns the index of the next element to be enqueued.\n * @return Index for the next queue element.\n */\n function getNextQueueIndex() external view returns (uint40);\n\n /**\n * Gets the queue element at a particular index.\n * @param _index Index of the queue element to access.\n * @return _element Queue element at the given index.\n */\n function getQueueElement(uint256 _index)\n external\n view\n returns (Lib_OVMCodec.QueueElement memory _element);\n\n /**\n * Returns the timestamp of the last transaction.\n * @return Timestamp for the last transaction.\n */\n function getLastTimestamp() external view returns (uint40);\n\n /**\n * Returns the blocknumber of the last transaction.\n * @return Blocknumber for the last transaction.\n */\n function getLastBlockNumber() external view returns (uint40);\n\n /**\n * Get the number of queue elements which have not yet been included.\n * @return Number of pending queue elements.\n */\n function getNumPendingQueueElements() external view returns (uint40);\n\n /**\n * Retrieves the length of the queue, including\n * both pending and canonical transactions.\n * @return Length of the queue.\n */\n function getQueueLength() external view returns (uint40);\n\n /**\n * Adds a transaction to the queue.\n * @param _target Target contract to send the transaction to.\n * @param _gasLimit Gas limit for the given transaction.\n * @param _data Transaction data.\n */\n function enqueue(\n address _target,\n uint256 _gasLimit,\n bytes memory _data\n ) external;\n\n /**\n * Allows the sequencer to append a batch of transactions.\n * @dev This function uses a custom encoding scheme for efficiency reasons.\n * .param _shouldStartAtElement Specific batch we expect to start appending to.\n * .param _totalElementsToAppend Total number of batch elements we expect to append.\n * .param _contexts Array of batch contexts.\n * .param _transactionDataFields Array of raw transaction data.\n */\n function appendSequencerBatch(\n // uint40 _shouldStartAtElement,\n // uint24 _totalElementsToAppend,\n // BatchContext[] _contexts,\n // bytes[] _transactionDataFields\n ) external;\n}\n" + }, + "contracts/L1/rollup/IChainStorageContainer.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >0.5.0 <0.9.0;\n\n/**\n * @title IChainStorageContainer\n */\ninterface IChainStorageContainer {\n /********************\n * Public Functions *\n ********************/\n\n /**\n * Sets the container's global metadata field. We're using `bytes27` here because we use five\n * bytes to maintain the length of the underlying data structure, meaning we have an extra\n * 27 bytes to store arbitrary data.\n * @param _globalMetadata New global metadata to set.\n */\n function setGlobalMetadata(bytes27 _globalMetadata) external;\n\n /**\n * Retrieves the container's global metadata field.\n * @return Container global metadata field.\n */\n function getGlobalMetadata() external view returns (bytes27);\n\n /**\n * Retrieves the number of objects stored in the container.\n * @return Number of objects in the container.\n */\n function length() external view returns (uint256);\n\n /**\n * Pushes an object into the container.\n * @param _object A 32 byte value to insert into the container.\n */\n function push(bytes32 _object) external;\n\n /**\n * Pushes an object into the container. Function allows setting the global metadata since\n * we'll need to touch the \"length\" storage slot anyway, which also contains the global\n * metadata (it's an optimization).\n * @param _object A 32 byte value to insert into the container.\n * @param _globalMetadata New global metadata for the container.\n */\n function push(bytes32 _object, bytes27 _globalMetadata) external;\n\n /**\n * Retrieves an object from the container.\n * @param _index Index of the particular object to access.\n * @return 32 byte object value.\n */\n function get(uint256 _index) external view returns (bytes32);\n\n /**\n * Removes all objects after and including a given index.\n * @param _index Object index to delete from.\n */\n function deleteElementsAfterInclusive(uint256 _index) external;\n\n /**\n * Removes all objects after and including a given index. Also allows setting the global\n * metadata field.\n * @param _index Object index to delete from.\n * @param _globalMetadata New global metadata for the container.\n */\n function deleteElementsAfterInclusive(uint256 _index, bytes27 _globalMetadata) external;\n}\n" + }, + "contracts/libraries/rlp/Lib_RLPReader.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/**\n * @title Lib_RLPReader\n * @dev Adapted from \"RLPReader\" by Hamdi Allam (hamdi.allam97@gmail.com).\n */\nlibrary Lib_RLPReader {\n /*************\n * Constants *\n *************/\n\n uint256 internal constant MAX_LIST_LENGTH = 32;\n\n /*********\n * Enums *\n *********/\n\n enum RLPItemType {\n DATA_ITEM,\n LIST_ITEM\n }\n\n /***********\n * Structs *\n ***********/\n\n struct RLPItem {\n uint256 length;\n uint256 ptr;\n }\n\n /**********************\n * Internal Functions *\n **********************/\n\n /**\n * Converts bytes to a reference to memory position and length.\n * @param _in Input bytes to convert.\n * @return Output memory reference.\n */\n function toRLPItem(bytes memory _in) internal pure returns (RLPItem memory) {\n uint256 ptr;\n assembly {\n ptr := add(_in, 32)\n }\n\n return RLPItem({ length: _in.length, ptr: ptr });\n }\n\n /**\n * Reads an RLP list value into a list of RLP items.\n * @param _in RLP list value.\n * @return Decoded RLP list items.\n */\n function readList(RLPItem memory _in) internal pure returns (RLPItem[] memory) {\n (uint256 listOffset, , RLPItemType itemType) = _decodeLength(_in);\n\n require(itemType == RLPItemType.LIST_ITEM, \"Invalid RLP list value.\");\n\n // Solidity in-memory arrays can't be increased in size, but *can* be decreased in size by\n // writing to the length. Since we can't know the number of RLP items without looping over\n // the entire input, we'd have to loop twice to accurately size this array. It's easier to\n // simply set a reasonable maximum list length and decrease the size before we finish.\n RLPItem[] memory out = new RLPItem[](MAX_LIST_LENGTH);\n\n uint256 itemCount = 0;\n uint256 offset = listOffset;\n while (offset < _in.length) {\n require(itemCount < MAX_LIST_LENGTH, \"Provided RLP list exceeds max list length.\");\n\n (uint256 itemOffset, uint256 itemLength, ) = _decodeLength(\n RLPItem({ length: _in.length - offset, ptr: _in.ptr + offset })\n );\n\n out[itemCount] = RLPItem({ length: itemLength + itemOffset, ptr: _in.ptr + offset });\n\n itemCount += 1;\n offset += itemOffset + itemLength;\n }\n\n // Decrease the array size to match the actual item count.\n assembly {\n mstore(out, itemCount)\n }\n\n return out;\n }\n\n /**\n * Reads an RLP list value into a list of RLP items.\n * @param _in RLP list value.\n * @return Decoded RLP list items.\n */\n function readList(bytes memory _in) internal pure returns (RLPItem[] memory) {\n return readList(toRLPItem(_in));\n }\n\n /**\n * Reads an RLP bytes value into bytes.\n * @param _in RLP bytes value.\n * @return Decoded bytes.\n */\n function readBytes(RLPItem memory _in) internal pure returns (bytes memory) {\n (uint256 itemOffset, uint256 itemLength, RLPItemType itemType) = _decodeLength(_in);\n\n require(itemType == RLPItemType.DATA_ITEM, \"Invalid RLP bytes value.\");\n\n return _copy(_in.ptr, itemOffset, itemLength);\n }\n\n /**\n * Reads an RLP bytes value into bytes.\n * @param _in RLP bytes value.\n * @return Decoded bytes.\n */\n function readBytes(bytes memory _in) internal pure returns (bytes memory) {\n return readBytes(toRLPItem(_in));\n }\n\n /**\n * Reads an RLP string value into a string.\n * @param _in RLP string value.\n * @return Decoded string.\n */\n function readString(RLPItem memory _in) internal pure returns (string memory) {\n return string(readBytes(_in));\n }\n\n /**\n * Reads an RLP string value into a string.\n * @param _in RLP string value.\n * @return Decoded string.\n */\n function readString(bytes memory _in) internal pure returns (string memory) {\n return readString(toRLPItem(_in));\n }\n\n /**\n * Reads an RLP bytes32 value into a bytes32.\n * @param _in RLP bytes32 value.\n * @return Decoded bytes32.\n */\n function readBytes32(RLPItem memory _in) internal pure returns (bytes32) {\n require(_in.length <= 33, \"Invalid RLP bytes32 value.\");\n\n (uint256 itemOffset, uint256 itemLength, RLPItemType itemType) = _decodeLength(_in);\n\n require(itemType == RLPItemType.DATA_ITEM, \"Invalid RLP bytes32 value.\");\n\n uint256 ptr = _in.ptr + itemOffset;\n bytes32 out;\n assembly {\n out := mload(ptr)\n\n // Shift the bytes over to match the item size.\n if lt(itemLength, 32) {\n out := div(out, exp(256, sub(32, itemLength)))\n }\n }\n\n return out;\n }\n\n /**\n * Reads an RLP bytes32 value into a bytes32.\n * @param _in RLP bytes32 value.\n * @return Decoded bytes32.\n */\n function readBytes32(bytes memory _in) internal pure returns (bytes32) {\n return readBytes32(toRLPItem(_in));\n }\n\n /**\n * Reads an RLP uint256 value into a uint256.\n * @param _in RLP uint256 value.\n * @return Decoded uint256.\n */\n function readUint256(RLPItem memory _in) internal pure returns (uint256) {\n return uint256(readBytes32(_in));\n }\n\n /**\n * Reads an RLP uint256 value into a uint256.\n * @param _in RLP uint256 value.\n * @return Decoded uint256.\n */\n function readUint256(bytes memory _in) internal pure returns (uint256) {\n return readUint256(toRLPItem(_in));\n }\n\n /**\n * Reads an RLP bool value into a bool.\n * @param _in RLP bool value.\n * @return Decoded bool.\n */\n function readBool(RLPItem memory _in) internal pure returns (bool) {\n require(_in.length == 1, \"Invalid RLP boolean value.\");\n\n uint256 ptr = _in.ptr;\n uint256 out;\n assembly {\n out := byte(0, mload(ptr))\n }\n\n require(out == 0 || out == 1, \"Lib_RLPReader: Invalid RLP boolean value, must be 0 or 1\");\n\n return out != 0;\n }\n\n /**\n * Reads an RLP bool value into a bool.\n * @param _in RLP bool value.\n * @return Decoded bool.\n */\n function readBool(bytes memory _in) internal pure returns (bool) {\n return readBool(toRLPItem(_in));\n }\n\n /**\n * Reads an RLP address value into a address.\n * @param _in RLP address value.\n * @return Decoded address.\n */\n function readAddress(RLPItem memory _in) internal pure returns (address) {\n if (_in.length == 1) {\n return address(0);\n }\n\n require(_in.length == 21, \"Invalid RLP address value.\");\n\n return address(uint160(readUint256(_in)));\n }\n\n /**\n * Reads an RLP address value into a address.\n * @param _in RLP address value.\n * @return Decoded address.\n */\n function readAddress(bytes memory _in) internal pure returns (address) {\n return readAddress(toRLPItem(_in));\n }\n\n /**\n * Reads the raw bytes of an RLP item.\n * @param _in RLP item to read.\n * @return Raw RLP bytes.\n */\n function readRawBytes(RLPItem memory _in) internal pure returns (bytes memory) {\n return _copy(_in);\n }\n\n /*********************\n * Private Functions *\n *********************/\n\n /**\n * Decodes the length of an RLP item.\n * @param _in RLP item to decode.\n * @return Offset of the encoded data.\n * @return Length of the encoded data.\n * @return RLP item type (LIST_ITEM or DATA_ITEM).\n */\n function _decodeLength(RLPItem memory _in)\n private\n pure\n returns (\n uint256,\n uint256,\n RLPItemType\n )\n {\n require(_in.length > 0, \"RLP item cannot be null.\");\n\n uint256 ptr = _in.ptr;\n uint256 prefix;\n assembly {\n prefix := byte(0, mload(ptr))\n }\n\n if (prefix <= 0x7f) {\n // Single byte.\n\n return (0, 1, RLPItemType.DATA_ITEM);\n } else if (prefix <= 0xb7) {\n // Short string.\n\n // slither-disable-next-line variable-scope\n uint256 strLen = prefix - 0x80;\n\n require(_in.length > strLen, \"Invalid RLP short string.\");\n\n return (1, strLen, RLPItemType.DATA_ITEM);\n } else if (prefix <= 0xbf) {\n // Long string.\n uint256 lenOfStrLen = prefix - 0xb7;\n\n require(_in.length > lenOfStrLen, \"Invalid RLP long string length.\");\n\n uint256 strLen;\n assembly {\n // Pick out the string length.\n strLen := div(mload(add(ptr, 1)), exp(256, sub(32, lenOfStrLen)))\n }\n\n require(_in.length > lenOfStrLen + strLen, \"Invalid RLP long string.\");\n\n return (1 + lenOfStrLen, strLen, RLPItemType.DATA_ITEM);\n } else if (prefix <= 0xf7) {\n // Short list.\n // slither-disable-next-line variable-scope\n uint256 listLen = prefix - 0xc0;\n\n require(_in.length > listLen, \"Invalid RLP short list.\");\n\n return (1, listLen, RLPItemType.LIST_ITEM);\n } else {\n // Long list.\n uint256 lenOfListLen = prefix - 0xf7;\n\n require(_in.length > lenOfListLen, \"Invalid RLP long list length.\");\n\n uint256 listLen;\n assembly {\n // Pick out the list length.\n listLen := div(mload(add(ptr, 1)), exp(256, sub(32, lenOfListLen)))\n }\n\n require(_in.length > lenOfListLen + listLen, \"Invalid RLP long list.\");\n\n return (1 + lenOfListLen, listLen, RLPItemType.LIST_ITEM);\n }\n }\n\n /**\n * Copies the bytes from a memory location.\n * @param _src Pointer to the location to read from.\n * @param _offset Offset to start reading from.\n * @param _length Number of bytes to read.\n * @return Copied bytes.\n */\n function _copy(\n uint256 _src,\n uint256 _offset,\n uint256 _length\n ) private pure returns (bytes memory) {\n bytes memory out = new bytes(_length);\n if (out.length == 0) {\n return out;\n }\n\n uint256 src = _src + _offset;\n uint256 dest;\n assembly {\n dest := add(out, 32)\n }\n\n // Copy over as many complete words as we can.\n for (uint256 i = 0; i < _length / 32; i++) {\n assembly {\n mstore(dest, mload(src))\n }\n\n src += 32;\n dest += 32;\n }\n\n // Pick out the remaining bytes.\n uint256 mask;\n unchecked {\n mask = 256**(32 - (_length % 32)) - 1;\n }\n\n assembly {\n mstore(dest, or(and(mload(src), not(mask)), and(mload(dest), mask)))\n }\n return out;\n }\n\n /**\n * Copies an RLP item into bytes.\n * @param _in RLP item to copy.\n * @return Copied bytes.\n */\n function _copy(RLPItem memory _in) private pure returns (bytes memory) {\n return _copy(_in.ptr, 0, _in.length);\n }\n}\n" + }, + "contracts/libraries/rlp/Lib_RLPWriter.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/**\n * @title Lib_RLPWriter\n * @author Bakaoh (with modifications)\n */\nlibrary Lib_RLPWriter {\n /**********************\n * Internal Functions *\n **********************/\n\n /**\n * RLP encodes a byte string.\n * @param _in The byte string to encode.\n * @return The RLP encoded string in bytes.\n */\n function writeBytes(bytes memory _in) internal pure returns (bytes memory) {\n bytes memory encoded;\n\n if (_in.length == 1 && uint8(_in[0]) < 128) {\n encoded = _in;\n } else {\n encoded = abi.encodePacked(_writeLength(_in.length, 128), _in);\n }\n\n return encoded;\n }\n\n /**\n * RLP encodes a list of RLP encoded byte byte strings.\n * @param _in The list of RLP encoded byte strings.\n * @return The RLP encoded list of items in bytes.\n */\n function writeList(bytes[] memory _in) internal pure returns (bytes memory) {\n bytes memory list = _flatten(_in);\n return abi.encodePacked(_writeLength(list.length, 192), list);\n }\n\n /**\n * RLP encodes a string.\n * @param _in The string to encode.\n * @return The RLP encoded string in bytes.\n */\n function writeString(string memory _in) internal pure returns (bytes memory) {\n return writeBytes(bytes(_in));\n }\n\n /**\n * RLP encodes an address.\n * @param _in The address to encode.\n * @return The RLP encoded address in bytes.\n */\n function writeAddress(address _in) internal pure returns (bytes memory) {\n return writeBytes(abi.encodePacked(_in));\n }\n\n /**\n * RLP encodes a uint.\n * @param _in The uint256 to encode.\n * @return The RLP encoded uint256 in bytes.\n */\n function writeUint(uint256 _in) internal pure returns (bytes memory) {\n return writeBytes(_toBinary(_in));\n }\n\n /**\n * RLP encodes a bool.\n * @param _in The bool to encode.\n * @return The RLP encoded bool in bytes.\n */\n function writeBool(bool _in) internal pure returns (bytes memory) {\n bytes memory encoded = new bytes(1);\n encoded[0] = (_in ? bytes1(0x01) : bytes1(0x80));\n return encoded;\n }\n\n /*********************\n * Private Functions *\n *********************/\n\n /**\n * Encode the first byte, followed by the `len` in binary form if `length` is more than 55.\n * @param _len The length of the string or the payload.\n * @param _offset 128 if item is string, 192 if item is list.\n * @return RLP encoded bytes.\n */\n function _writeLength(uint256 _len, uint256 _offset) private pure returns (bytes memory) {\n bytes memory encoded;\n\n if (_len < 56) {\n encoded = new bytes(1);\n encoded[0] = bytes1(uint8(_len) + uint8(_offset));\n } else {\n uint256 lenLen;\n uint256 i = 1;\n while (_len / i != 0) {\n lenLen++;\n i *= 256;\n }\n\n encoded = new bytes(lenLen + 1);\n encoded[0] = bytes1(uint8(lenLen) + uint8(_offset) + 55);\n for (i = 1; i <= lenLen; i++) {\n encoded[i] = bytes1(uint8((_len / (256**(lenLen - i))) % 256));\n }\n }\n\n return encoded;\n }\n\n /**\n * Encode integer in big endian binary form with no leading zeroes.\n * @notice TODO: This should be optimized with assembly to save gas costs.\n * @param _x The integer to encode.\n * @return RLP encoded bytes.\n */\n function _toBinary(uint256 _x) private pure returns (bytes memory) {\n bytes memory b = abi.encodePacked(_x);\n\n uint256 i = 0;\n for (; i < 32; i++) {\n if (b[i] != 0) {\n break;\n }\n }\n\n bytes memory res = new bytes(32 - i);\n for (uint256 j = 0; j < res.length; j++) {\n res[j] = b[i++];\n }\n\n return res;\n }\n\n /**\n * Copies a piece of memory to another location.\n * @notice From: https://github.com/Arachnid/solidity-stringutils/blob/master/src/strings.sol.\n * @param _dest Destination location.\n * @param _src Source location.\n * @param _len Length of memory to copy.\n */\n function _memcpy(\n uint256 _dest,\n uint256 _src,\n uint256 _len\n ) private pure {\n uint256 dest = _dest;\n uint256 src = _src;\n uint256 len = _len;\n\n for (; len >= 32; len -= 32) {\n assembly {\n mstore(dest, mload(src))\n }\n dest += 32;\n src += 32;\n }\n\n uint256 mask;\n unchecked {\n mask = 256**(32 - len) - 1;\n }\n assembly {\n let srcpart := and(mload(src), not(mask))\n let destpart := and(mload(dest), mask)\n mstore(dest, or(destpart, srcpart))\n }\n }\n\n /**\n * Flattens a list of byte strings into one byte string.\n * @notice From: https://github.com/sammayo/solidity-rlp-encoder/blob/master/RLPEncode.sol.\n * @param _list List of byte strings to flatten.\n * @return The flattened byte string.\n */\n function _flatten(bytes[] memory _list) private pure returns (bytes memory) {\n if (_list.length == 0) {\n return new bytes(0);\n }\n\n uint256 len;\n uint256 i = 0;\n for (; i < _list.length; i++) {\n len += _list[i].length;\n }\n\n bytes memory flattened = new bytes(len);\n uint256 flattenedPtr;\n assembly {\n flattenedPtr := add(flattened, 0x20)\n }\n\n for (i = 0; i < _list.length; i++) {\n bytes memory item = _list[i];\n\n uint256 listPtr;\n assembly {\n listPtr := add(item, 0x20)\n }\n\n _memcpy(flattenedPtr, listPtr, item.length);\n flattenedPtr += _list[i].length;\n }\n\n return flattened;\n }\n}\n" + }, + "contracts/libraries/utils/Lib_BytesUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/**\n * @title Lib_BytesUtils\n */\nlibrary Lib_BytesUtils {\n /**********************\n * Internal Functions *\n **********************/\n\n function slice(\n bytes memory _bytes,\n uint256 _start,\n uint256 _length\n ) internal pure returns (bytes memory) {\n require(_length + 31 >= _length, \"slice_overflow\");\n require(_start + _length >= _start, \"slice_overflow\");\n require(_bytes.length >= _start + _length, \"slice_outOfBounds\");\n\n bytes memory tempBytes;\n\n assembly {\n switch iszero(_length)\n case 0 {\n // Get a location of some free memory and store it in tempBytes as\n // Solidity does for memory variables.\n tempBytes := mload(0x40)\n\n // The first word of the slice result is potentially a partial\n // word read from the original array. To read it, we calculate\n // the length of that partial word and start copying that many\n // bytes into the array. The first word we copy will start with\n // data we don't care about, but the last `lengthmod` bytes will\n // land at the beginning of the contents of the new array. When\n // we're done copying, we overwrite the full first word with\n // the actual length of the slice.\n let lengthmod := and(_length, 31)\n\n // The multiplication in the next line is necessary\n // because when slicing multiples of 32 bytes (lengthmod == 0)\n // the following copy loop was copying the origin's length\n // and then ending prematurely not copying everything it should.\n let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod)))\n let end := add(mc, _length)\n\n for {\n // The multiplication in the next line has the same exact purpose\n // as the one above.\n let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start)\n } lt(mc, end) {\n mc := add(mc, 0x20)\n cc := add(cc, 0x20)\n } {\n mstore(mc, mload(cc))\n }\n\n mstore(tempBytes, _length)\n\n //update free-memory pointer\n //allocating the array padded to 32 bytes like the compiler does now\n mstore(0x40, and(add(mc, 31), not(31)))\n }\n //if we want a zero-length slice let's just return a zero-length array\n default {\n tempBytes := mload(0x40)\n\n //zero out the 32 bytes slice we are about to return\n //we need to do it because Solidity does not garbage collect\n mstore(tempBytes, 0)\n\n mstore(0x40, add(tempBytes, 0x20))\n }\n }\n\n return tempBytes;\n }\n\n function slice(bytes memory _bytes, uint256 _start) internal pure returns (bytes memory) {\n if (_start >= _bytes.length) {\n return bytes(\"\");\n }\n\n return slice(_bytes, _start, _bytes.length - _start);\n }\n\n function toBytes32(bytes memory _bytes) internal pure returns (bytes32) {\n if (_bytes.length < 32) {\n bytes32 ret;\n assembly {\n ret := mload(add(_bytes, 32))\n }\n return ret;\n }\n\n return abi.decode(_bytes, (bytes32)); // will truncate if input length > 32 bytes\n }\n\n function toUint256(bytes memory _bytes) internal pure returns (uint256) {\n return uint256(toBytes32(_bytes));\n }\n\n function toNibbles(bytes memory _bytes) internal pure returns (bytes memory) {\n bytes memory nibbles = new bytes(_bytes.length * 2);\n\n for (uint256 i = 0; i < _bytes.length; i++) {\n nibbles[i * 2] = _bytes[i] >> 4;\n nibbles[i * 2 + 1] = bytes1(uint8(_bytes[i]) % 16);\n }\n\n return nibbles;\n }\n\n function fromNibbles(bytes memory _bytes) internal pure returns (bytes memory) {\n bytes memory ret = new bytes(_bytes.length / 2);\n\n for (uint256 i = 0; i < ret.length; i++) {\n ret[i] = (_bytes[i * 2] << 4) | (_bytes[i * 2 + 1]);\n }\n\n return ret;\n }\n\n function equal(bytes memory _bytes, bytes memory _other) internal pure returns (bool) {\n return keccak256(_bytes) == keccak256(_other);\n }\n}\n" + }, + "contracts/libraries/utils/Lib_Bytes32Utils.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/**\n * @title Lib_Byte32Utils\n */\nlibrary Lib_Bytes32Utils {\n /**********************\n * Internal Functions *\n **********************/\n\n /**\n * Converts a bytes32 value to a boolean. Anything non-zero will be converted to \"true.\"\n * @param _in Input bytes32 value.\n * @return Bytes32 as a boolean.\n */\n function toBool(bytes32 _in) internal pure returns (bool) {\n return _in != 0;\n }\n\n /**\n * Converts a boolean to a bytes32 value.\n * @param _in Input boolean value.\n * @return Boolean as a bytes32.\n */\n function fromBool(bool _in) internal pure returns (bytes32) {\n return bytes32(uint256(_in ? 1 : 0));\n }\n\n /**\n * Converts a bytes32 value to an address. Takes the *last* 20 bytes.\n * @param _in Input bytes32 value.\n * @return Bytes32 as an address.\n */\n function toAddress(bytes32 _in) internal pure returns (address) {\n return address(uint160(uint256(_in)));\n }\n\n /**\n * Converts an address to a bytes32.\n * @param _in Input address value.\n * @return Address as a bytes32.\n */\n function fromAddress(address _in) internal pure returns (bytes32) {\n return bytes32(uint256(uint160(_in)));\n }\n}\n" + }, + "contracts/L1/rollup/ChainStorageContainer.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Library Imports */\nimport { Lib_Buffer } from \"../../libraries/utils/Lib_Buffer.sol\";\nimport { Lib_AddressResolver } from \"../../libraries/resolver/Lib_AddressResolver.sol\";\n\n/* Interface Imports */\nimport { IChainStorageContainer } from \"./IChainStorageContainer.sol\";\n\n/**\n * @title ChainStorageContainer\n * @dev The Chain Storage Container provides its owner contract with read, write and delete\n * functionality. This provides gas efficiency gains by enabling it to overwrite storage slots which\n * can no longer be used in a fraud proof due to the fraud window having passed, and the associated\n * chain state or transactions being finalized.\n * Three distinct Chain Storage Containers will be deployed on Layer 1:\n * 1. Stores transaction batches for the Canonical Transaction Chain\n * 2. Stores queued transactions for the Canonical Transaction Chain\n * 3. Stores chain state batches for the State Commitment Chain\n *\n */\ncontract ChainStorageContainer is IChainStorageContainer, Lib_AddressResolver {\n /*************\n * Libraries *\n *************/\n\n using Lib_Buffer for Lib_Buffer.Buffer;\n\n /*************\n * Variables *\n *************/\n\n string public owner;\n Lib_Buffer.Buffer internal buffer;\n\n /***************\n * Constructor *\n ***************/\n\n /**\n * @param _libAddressManager Address of the Address Manager.\n * @param _owner Name of the contract that owns this container (will be resolved later).\n */\n constructor(address _libAddressManager, string memory _owner)\n Lib_AddressResolver(_libAddressManager)\n {\n owner = _owner;\n }\n\n /**********************\n * Function Modifiers *\n **********************/\n\n modifier onlyOwner() {\n require(\n msg.sender == resolve(owner),\n \"ChainStorageContainer: Function can only be called by the owner.\"\n );\n _;\n }\n\n /********************\n * Public Functions *\n ********************/\n\n /**\n * @inheritdoc IChainStorageContainer\n */\n // slither-disable-next-line external-function\n function setGlobalMetadata(bytes27 _globalMetadata) public onlyOwner {\n return buffer.setExtraData(_globalMetadata);\n }\n\n /**\n * @inheritdoc IChainStorageContainer\n */\n // slither-disable-next-line external-function\n function getGlobalMetadata() public view returns (bytes27) {\n return buffer.getExtraData();\n }\n\n /**\n * @inheritdoc IChainStorageContainer\n */\n // slither-disable-next-line external-function\n function length() public view returns (uint256) {\n return uint256(buffer.getLength());\n }\n\n /**\n * @inheritdoc IChainStorageContainer\n */\n // slither-disable-next-line external-function\n function push(bytes32 _object) public onlyOwner {\n buffer.push(_object);\n }\n\n /**\n * @inheritdoc IChainStorageContainer\n */\n // slither-disable-next-line external-function\n function push(bytes32 _object, bytes27 _globalMetadata) public onlyOwner {\n buffer.push(_object, _globalMetadata);\n }\n\n /**\n * @inheritdoc IChainStorageContainer\n */\n // slither-disable-next-line external-function\n function get(uint256 _index) public view returns (bytes32) {\n return buffer.get(uint40(_index));\n }\n\n /**\n * @inheritdoc IChainStorageContainer\n */\n // slither-disable-next-line external-function\n function deleteElementsAfterInclusive(uint256 _index) public onlyOwner {\n buffer.deleteElementsAfterInclusive(uint40(_index));\n }\n\n /**\n * @inheritdoc IChainStorageContainer\n */\n // slither-disable-next-line external-function\n function deleteElementsAfterInclusive(uint256 _index, bytes27 _globalMetadata)\n public\n onlyOwner\n {\n buffer.deleteElementsAfterInclusive(uint40(_index), _globalMetadata);\n }\n}\n" + }, + "contracts/libraries/utils/Lib_Buffer.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/**\n * @title Lib_Buffer\n * @dev This library implements a bytes32 storage array with some additional gas-optimized\n * functionality. In particular, it encodes its length as a uint40, and tightly packs this with an\n * overwritable \"extra data\" field so we can store more information with a single SSTORE.\n */\nlibrary Lib_Buffer {\n /*************\n * Libraries *\n *************/\n\n using Lib_Buffer for Buffer;\n\n /***********\n * Structs *\n ***********/\n\n struct Buffer {\n bytes32 context;\n mapping(uint256 => bytes32) buf;\n }\n\n struct BufferContext {\n // Stores the length of the array. Uint40 is way more elements than we'll ever reasonably\n // need in an array and we get an extra 27 bytes of extra data to play with.\n uint40 length;\n // Arbitrary extra data that can be modified whenever the length is updated. Useful for\n // squeezing out some gas optimizations.\n bytes27 extraData;\n }\n\n /**********************\n * Internal Functions *\n **********************/\n\n /**\n * Pushes a single element to the buffer.\n * @param _self Buffer to access.\n * @param _value Value to push to the buffer.\n * @param _extraData Global extra data.\n */\n function push(\n Buffer storage _self,\n bytes32 _value,\n bytes27 _extraData\n ) internal {\n BufferContext memory ctx = _self.getContext();\n\n _self.buf[ctx.length] = _value;\n\n // Bump the global index and insert our extra data, then save the context.\n ctx.length++;\n ctx.extraData = _extraData;\n _self.setContext(ctx);\n }\n\n /**\n * Pushes a single element to the buffer.\n * @param _self Buffer to access.\n * @param _value Value to push to the buffer.\n */\n function push(Buffer storage _self, bytes32 _value) internal {\n BufferContext memory ctx = _self.getContext();\n\n _self.push(_value, ctx.extraData);\n }\n\n /**\n * Retrieves an element from the buffer.\n * @param _self Buffer to access.\n * @param _index Element index to retrieve.\n * @return Value of the element at the given index.\n */\n function get(Buffer storage _self, uint256 _index) internal view returns (bytes32) {\n BufferContext memory ctx = _self.getContext();\n\n require(_index < ctx.length, \"Index out of bounds.\");\n\n return _self.buf[_index];\n }\n\n /**\n * Deletes all elements after (and including) a given index.\n * @param _self Buffer to access.\n * @param _index Index of the element to delete from (inclusive).\n * @param _extraData Optional global extra data.\n */\n function deleteElementsAfterInclusive(\n Buffer storage _self,\n uint40 _index,\n bytes27 _extraData\n ) internal {\n BufferContext memory ctx = _self.getContext();\n\n require(_index < ctx.length, \"Index out of bounds.\");\n\n // Set our length and extra data, save the context.\n ctx.length = _index;\n ctx.extraData = _extraData;\n _self.setContext(ctx);\n }\n\n /**\n * Deletes all elements after (and including) a given index.\n * @param _self Buffer to access.\n * @param _index Index of the element to delete from (inclusive).\n */\n function deleteElementsAfterInclusive(Buffer storage _self, uint40 _index) internal {\n BufferContext memory ctx = _self.getContext();\n _self.deleteElementsAfterInclusive(_index, ctx.extraData);\n }\n\n /**\n * Retrieves the current global index.\n * @param _self Buffer to access.\n * @return Current global index.\n */\n function getLength(Buffer storage _self) internal view returns (uint40) {\n BufferContext memory ctx = _self.getContext();\n return ctx.length;\n }\n\n /**\n * Changes current global extra data.\n * @param _self Buffer to access.\n * @param _extraData New global extra data.\n */\n function setExtraData(Buffer storage _self, bytes27 _extraData) internal {\n BufferContext memory ctx = _self.getContext();\n ctx.extraData = _extraData;\n _self.setContext(ctx);\n }\n\n /**\n * Retrieves the current global extra data.\n * @param _self Buffer to access.\n * @return Current global extra data.\n */\n function getExtraData(Buffer storage _self) internal view returns (bytes27) {\n BufferContext memory ctx = _self.getContext();\n return ctx.extraData;\n }\n\n /**\n * Sets the current buffer context.\n * @param _self Buffer to access.\n * @param _ctx Current buffer context.\n */\n function setContext(Buffer storage _self, BufferContext memory _ctx) internal {\n bytes32 context;\n uint40 length = _ctx.length;\n bytes27 extraData = _ctx.extraData;\n assembly {\n context := length\n context := or(context, extraData)\n }\n\n if (_self.context != context) {\n _self.context = context;\n }\n }\n\n /**\n * Retrieves the current buffer context.\n * @param _self Buffer to access.\n * @return Current buffer context.\n */\n function getContext(Buffer storage _self) internal view returns (BufferContext memory) {\n bytes32 context = _self.context;\n uint40 length;\n bytes27 extraData;\n assembly {\n length := and(\n context,\n 0x000000000000000000000000000000000000000000000000000000FFFFFFFFFF\n )\n extraData := and(\n context,\n 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000\n )\n }\n\n return BufferContext({ length: length, extraData: extraData });\n }\n}\n" + }, + "contracts/test-libraries/utils/TestLib_Buffer.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Library Imports */\nimport { Lib_Buffer } from \"../../libraries/utils/Lib_Buffer.sol\";\n\n/**\n * @title TestLib_Buffer\n */\ncontract TestLib_Buffer {\n using Lib_Buffer for Lib_Buffer.Buffer;\n using Lib_Buffer for Lib_Buffer.BufferContext;\n\n Lib_Buffer.Buffer internal buf;\n\n function push(bytes32 _value, bytes27 _extraData) public {\n buf.push(_value, _extraData);\n }\n\n function push(bytes32 _value) public {\n buf.push(_value);\n }\n\n function get(uint256 _index) public view returns (bytes32) {\n return buf.get(_index);\n }\n\n function deleteElementsAfterInclusive(uint40 _index) public {\n return buf.deleteElementsAfterInclusive(_index);\n }\n\n function deleteElementsAfterInclusive(uint40 _index, bytes27 _extraData) public {\n return buf.deleteElementsAfterInclusive(_index, _extraData);\n }\n\n function getLength() public view returns (uint40) {\n return buf.getLength();\n }\n\n function setExtraData(bytes27 _extraData) public {\n return buf.setExtraData(_extraData);\n }\n\n function getExtraData() public view returns (bytes27) {\n return buf.getExtraData();\n }\n\n function getContext() public view returns (Lib_Buffer.BufferContext memory) {\n return buf.getContext();\n }\n\n function setContext(uint40 _index, bytes27 _extraData) public {\n Lib_Buffer.BufferContext memory _ctx = Lib_Buffer.BufferContext({\n length: _index,\n extraData: _extraData\n });\n return buf.setContext(_ctx);\n }\n}\n" + }, + "contracts/L1/rollup/CanonicalTransactionChain.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Library Imports */\nimport { AddressAliasHelper } from \"../../standards/AddressAliasHelper.sol\";\nimport { Lib_OVMCodec } from \"../../libraries/codec/Lib_OVMCodec.sol\";\nimport { Lib_AddressResolver } from \"../../libraries/resolver/Lib_AddressResolver.sol\";\n\n/* Interface Imports */\nimport { ICanonicalTransactionChain } from \"./ICanonicalTransactionChain.sol\";\nimport { IChainStorageContainer } from \"./IChainStorageContainer.sol\";\n\n/**\n * @title CanonicalTransactionChain\n * @dev The Canonical Transaction Chain (CTC) contract is an append-only log of transactions\n * which must be applied to the rollup state. It defines the ordering of rollup transactions by\n * writing them to the 'CTC:batches' instance of the Chain Storage Container.\n * The CTC also allows any account to 'enqueue' an L2 transaction, which will require that the\n * Sequencer will eventually append it to the rollup state.\n *\n */\ncontract CanonicalTransactionChain is ICanonicalTransactionChain, Lib_AddressResolver {\n /*************\n * Constants *\n *************/\n\n // L2 tx gas-related\n uint256 public constant MIN_ROLLUP_TX_GAS = 100000;\n uint256 public constant MAX_ROLLUP_TX_SIZE = 50000;\n\n // The approximate cost of calling the enqueue function\n uint256 public enqueueGasCost;\n // The ratio of the cost of L1 gas to the cost of L2 gas\n uint256 public l2GasDiscountDivisor;\n // The amount of L2 gas which can be forwarded to L2 without spam prevention via 'gas burn'.\n // Calculated as the product of l2GasDiscountDivisor * enqueueGasCost.\n // See comments in enqueue() for further detail.\n uint256 public enqueueL2GasPrepaid;\n\n // Encoding-related (all in bytes)\n uint256 internal constant BATCH_CONTEXT_SIZE = 16;\n // slither-disable-next-line unused-state\n uint256 internal constant BATCH_CONTEXT_LENGTH_POS = 12;\n uint256 internal constant BATCH_CONTEXT_START_POS = 15;\n // slither-disable-next-line unused-state\n uint256 internal constant TX_DATA_HEADER_SIZE = 3;\n // slither-disable-next-line unused-state\n uint256 internal constant BYTES_TILL_TX_DATA = 65;\n\n /*************\n * Variables *\n *************/\n\n uint256 public maxTransactionGasLimit;\n\n /***************\n * Queue State *\n ***************/\n\n uint40 private _nextQueueIndex; // index of the first queue element not yet included\n Lib_OVMCodec.QueueElement[] queueElements;\n\n /***************\n * Constructor *\n ***************/\n\n constructor(\n address _libAddressManager,\n uint256 _maxTransactionGasLimit,\n uint256 _l2GasDiscountDivisor,\n uint256 _enqueueGasCost\n ) Lib_AddressResolver(_libAddressManager) {\n maxTransactionGasLimit = _maxTransactionGasLimit;\n l2GasDiscountDivisor = _l2GasDiscountDivisor;\n enqueueGasCost = _enqueueGasCost;\n enqueueL2GasPrepaid = _l2GasDiscountDivisor * _enqueueGasCost;\n }\n\n /**********************\n * Function Modifiers *\n **********************/\n\n /**\n * Modifier to enforce that, if configured, only the Burn Admin may\n * successfully call a method.\n */\n modifier onlyBurnAdmin() {\n require(msg.sender == libAddressManager.owner(), \"Only callable by the Burn Admin.\");\n _;\n }\n\n /*******************************\n * Authorized Setter Functions *\n *******************************/\n\n /**\n * Allows the Burn Admin to update the parameters which determine the amount of gas to burn.\n * The value of enqueueL2GasPrepaid is immediately updated as well.\n */\n function setGasParams(uint256 _l2GasDiscountDivisor, uint256 _enqueueGasCost)\n external\n onlyBurnAdmin\n {\n enqueueGasCost = _enqueueGasCost;\n l2GasDiscountDivisor = _l2GasDiscountDivisor;\n // See the comment in enqueue() for the rationale behind this formula.\n enqueueL2GasPrepaid = _l2GasDiscountDivisor * _enqueueGasCost;\n\n emit L2GasParamsUpdated(l2GasDiscountDivisor, enqueueGasCost, enqueueL2GasPrepaid);\n }\n\n /********************\n * Public Functions *\n ********************/\n\n /**\n * Accesses the batch storage container.\n * @return Reference to the batch storage container.\n */\n function batches() public view returns (IChainStorageContainer) {\n return IChainStorageContainer(resolve(\"ChainStorageContainer-CTC-batches\"));\n }\n\n /**\n * Retrieves the total number of elements submitted.\n * @return _totalElements Total submitted elements.\n */\n function getTotalElements() public view returns (uint256 _totalElements) {\n (uint40 totalElements, , , ) = _getBatchExtraData();\n return uint256(totalElements);\n }\n\n /**\n * Retrieves the total number of batches submitted.\n * @return _totalBatches Total submitted batches.\n */\n // slither-disable-next-line external-function\n function getTotalBatches() public view returns (uint256 _totalBatches) {\n return batches().length();\n }\n\n /**\n * Returns the index of the next element to be enqueued.\n * @return Index for the next queue element.\n */\n // slither-disable-next-line external-function\n function getNextQueueIndex() public view returns (uint40) {\n return _nextQueueIndex;\n }\n\n /**\n * Returns the timestamp of the last transaction.\n * @return Timestamp for the last transaction.\n */\n // slither-disable-next-line external-function\n function getLastTimestamp() public view returns (uint40) {\n (, , uint40 lastTimestamp, ) = _getBatchExtraData();\n return lastTimestamp;\n }\n\n /**\n * Returns the blocknumber of the last transaction.\n * @return Blocknumber for the last transaction.\n */\n // slither-disable-next-line external-function\n function getLastBlockNumber() public view returns (uint40) {\n (, , , uint40 lastBlockNumber) = _getBatchExtraData();\n return lastBlockNumber;\n }\n\n /**\n * Gets the queue element at a particular index.\n * @param _index Index of the queue element to access.\n * @return _element Queue element at the given index.\n */\n // slither-disable-next-line external-function\n function getQueueElement(uint256 _index)\n public\n view\n returns (Lib_OVMCodec.QueueElement memory _element)\n {\n return queueElements[_index];\n }\n\n /**\n * Get the number of queue elements which have not yet been included.\n * @return Number of pending queue elements.\n */\n // slither-disable-next-line external-function\n function getNumPendingQueueElements() public view returns (uint40) {\n return uint40(queueElements.length) - _nextQueueIndex;\n }\n\n /**\n * Retrieves the length of the queue, including\n * both pending and canonical transactions.\n * @return Length of the queue.\n */\n // slither-disable-next-line external-function\n function getQueueLength() public view returns (uint40) {\n return uint40(queueElements.length);\n }\n\n /**\n * Adds a transaction to the queue.\n * @param _target Target L2 contract to send the transaction to.\n * @param _gasLimit Gas limit for the enqueued L2 transaction.\n * @param _data Transaction data.\n */\n function enqueue(\n address _target,\n uint256 _gasLimit,\n bytes memory _data\n ) external {\n require(\n _data.length <= MAX_ROLLUP_TX_SIZE,\n \"Transaction data size exceeds maximum for rollup transaction.\"\n );\n\n require(\n _gasLimit <= maxTransactionGasLimit,\n \"Transaction gas limit exceeds maximum for rollup transaction.\"\n );\n\n require(_gasLimit >= MIN_ROLLUP_TX_GAS, \"Transaction gas limit too low to enqueue.\");\n\n // Transactions submitted to the queue lack a method for paying gas fees to the Sequencer.\n // So we need to prevent spam attacks by ensuring that the cost of enqueueing a transaction\n // from L1 to L2 is not underpriced. For transaction with a high L2 gas limit, we do this by\n // burning some extra gas on L1. Of course there is also some intrinsic cost to enqueueing a\n // transaction, so we want to make sure not to over-charge (by burning too much L1 gas).\n // Therefore, we define 'enqueueL2GasPrepaid' as the L2 gas limit above which we must burn\n // additional gas on L1. This threshold is the product of two inputs:\n // 1. enqueueGasCost: the base cost of calling this function.\n // 2. l2GasDiscountDivisor: the ratio between the cost of gas on L1 and L2. This is a\n // positive integer, meaning we assume L2 gas is always less costly.\n // The calculation below for gasToConsume can be seen as converting the difference (between\n // the specified L2 gas limit and the prepaid L2 gas limit) to an L1 gas amount.\n if (_gasLimit > enqueueL2GasPrepaid) {\n uint256 gasToConsume = (_gasLimit - enqueueL2GasPrepaid) / l2GasDiscountDivisor;\n uint256 startingGas = gasleft();\n\n // Although this check is not necessary (burn below will run out of gas if not true), it\n // gives the user an explicit reason as to why the enqueue attempt failed.\n require(startingGas > gasToConsume, \"Insufficient gas for L2 rate limiting burn.\");\n\n uint256 i;\n while (startingGas - gasleft() < gasToConsume) {\n i++;\n }\n }\n\n // Apply an aliasing unless msg.sender == tx.origin. This prevents an attack in which a\n // contract on L1 has the same address as a contract on L2 but doesn't have the same code.\n // We can safely ignore this for EOAs because they're guaranteed to have the same \"code\"\n // (i.e. no code at all). This also makes it possible for users to interact with contracts\n // on L2 even when the Sequencer is down.\n address sender;\n if (msg.sender == tx.origin) {\n sender = msg.sender;\n } else {\n sender = AddressAliasHelper.applyL1ToL2Alias(msg.sender);\n }\n\n bytes32 transactionHash = keccak256(abi.encode(sender, _target, _gasLimit, _data));\n\n queueElements.push(\n Lib_OVMCodec.QueueElement({\n transactionHash: transactionHash,\n timestamp: uint40(block.timestamp),\n blockNumber: uint40(block.number)\n })\n );\n uint256 queueIndex = queueElements.length - 1;\n emit TransactionEnqueued(sender, _target, _gasLimit, _data, queueIndex, block.timestamp);\n }\n\n /**\n * Allows the sequencer to append a batch of transactions.\n * @dev This function uses a custom encoding scheme for efficiency reasons.\n * .param _shouldStartAtElement Specific batch we expect to start appending to.\n * .param _totalElementsToAppend Total number of batch elements we expect to append.\n * .param _contexts Array of batch contexts.\n * .param _transactionDataFields Array of raw transaction data.\n */\n function appendSequencerBatch() external {\n uint40 shouldStartAtElement;\n uint24 totalElementsToAppend;\n uint24 numContexts;\n assembly {\n shouldStartAtElement := shr(216, calldataload(4))\n totalElementsToAppend := shr(232, calldataload(9))\n numContexts := shr(232, calldataload(12))\n }\n\n require(\n shouldStartAtElement == getTotalElements(),\n \"Actual batch start index does not match expected start index.\"\n );\n\n require(\n msg.sender == resolve(\"OVM_Sequencer\"),\n \"Function can only be called by the Sequencer.\"\n );\n\n uint40 nextTransactionPtr = uint40(\n BATCH_CONTEXT_START_POS + BATCH_CONTEXT_SIZE * numContexts\n );\n\n require(msg.data.length >= nextTransactionPtr, \"Not enough BatchContexts provided.\");\n\n // Counter for number of sequencer transactions appended so far.\n uint32 numSequencerTransactions = 0;\n\n // Cache the _nextQueueIndex storage variable to a temporary stack variable.\n // This is safe as long as nothing reads or writes to the storage variable\n // until it is updated by the temp variable.\n uint40 nextQueueIndex = _nextQueueIndex;\n\n BatchContext memory curContext;\n for (uint32 i = 0; i < numContexts; i++) {\n BatchContext memory nextContext = _getBatchContext(i);\n\n // Now we can update our current context.\n curContext = nextContext;\n\n // Process sequencer transactions first.\n numSequencerTransactions += uint32(curContext.numSequencedTransactions);\n\n // Now process any subsequent queue transactions.\n nextQueueIndex += uint40(curContext.numSubsequentQueueTransactions);\n }\n\n require(\n nextQueueIndex <= queueElements.length,\n \"Attempted to append more elements than are available in the queue.\"\n );\n\n // Generate the required metadata that we need to append this batch\n uint40 numQueuedTransactions = totalElementsToAppend - numSequencerTransactions;\n uint40 blockTimestamp;\n uint40 blockNumber;\n if (curContext.numSubsequentQueueTransactions == 0) {\n // The last element is a sequencer tx, therefore pull timestamp and block number from\n // the last context.\n blockTimestamp = uint40(curContext.timestamp);\n blockNumber = uint40(curContext.blockNumber);\n } else {\n // The last element is a queue tx, therefore pull timestamp and block number from the\n // queue element.\n // curContext.numSubsequentQueueTransactions > 0 which means that we've processed at\n // least one queue element. We increment nextQueueIndex after processing each queue\n // element, so the index of the last element we processed is nextQueueIndex - 1.\n Lib_OVMCodec.QueueElement memory lastElement = queueElements[nextQueueIndex - 1];\n\n blockTimestamp = lastElement.timestamp;\n blockNumber = lastElement.blockNumber;\n }\n\n // Cache the previous blockhash to ensure all transaction data can be retrieved efficiently.\n // slither-disable-next-line reentrancy-no-eth, reentrancy-events\n _appendBatch(\n blockhash(block.number - 1),\n totalElementsToAppend,\n numQueuedTransactions,\n blockTimestamp,\n blockNumber\n );\n\n // slither-disable-next-line reentrancy-events\n emit SequencerBatchAppended(\n nextQueueIndex - numQueuedTransactions,\n numQueuedTransactions,\n getTotalElements()\n );\n\n // Update the _nextQueueIndex storage variable.\n // slither-disable-next-line reentrancy-no-eth\n _nextQueueIndex = nextQueueIndex;\n }\n\n /**********************\n * Internal Functions *\n **********************/\n\n /**\n * Returns the BatchContext located at a particular index.\n * @param _index The index of the BatchContext\n * @return The BatchContext at the specified index.\n */\n function _getBatchContext(uint256 _index) internal pure returns (BatchContext memory) {\n uint256 contextPtr = 15 + _index * BATCH_CONTEXT_SIZE;\n // slither-disable-next-line similar-names\n uint256 numSequencedTransactions;\n uint256 numSubsequentQueueTransactions;\n uint256 ctxTimestamp;\n uint256 ctxBlockNumber;\n\n assembly {\n numSequencedTransactions := shr(232, calldataload(contextPtr))\n numSubsequentQueueTransactions := shr(232, calldataload(add(contextPtr, 3)))\n ctxTimestamp := shr(216, calldataload(add(contextPtr, 6)))\n ctxBlockNumber := shr(216, calldataload(add(contextPtr, 11)))\n }\n\n return\n BatchContext({\n numSequencedTransactions: numSequencedTransactions,\n numSubsequentQueueTransactions: numSubsequentQueueTransactions,\n timestamp: ctxTimestamp,\n blockNumber: ctxBlockNumber\n });\n }\n\n /**\n * Parses the batch context from the extra data.\n * @return Total number of elements submitted.\n * @return Index of the next queue element.\n */\n function _getBatchExtraData()\n internal\n view\n returns (\n uint40,\n uint40,\n uint40,\n uint40\n )\n {\n bytes27 extraData = batches().getGlobalMetadata();\n\n uint40 totalElements;\n uint40 nextQueueIndex;\n uint40 lastTimestamp;\n uint40 lastBlockNumber;\n\n // solhint-disable max-line-length\n assembly {\n extraData := shr(40, extraData)\n totalElements := and(\n extraData,\n 0x000000000000000000000000000000000000000000000000000000FFFFFFFFFF\n )\n nextQueueIndex := shr(\n 40,\n and(extraData, 0x00000000000000000000000000000000000000000000FFFFFFFFFF0000000000)\n )\n lastTimestamp := shr(\n 80,\n and(extraData, 0x0000000000000000000000000000000000FFFFFFFFFF00000000000000000000)\n )\n lastBlockNumber := shr(\n 120,\n and(extraData, 0x000000000000000000000000FFFFFFFFFF000000000000000000000000000000)\n )\n }\n // solhint-enable max-line-length\n\n return (totalElements, nextQueueIndex, lastTimestamp, lastBlockNumber);\n }\n\n /**\n * Encodes the batch context for the extra data.\n * @param _totalElements Total number of elements submitted.\n * @param _nextQueueIdx Index of the next queue element.\n * @param _timestamp Timestamp for the last batch.\n * @param _blockNumber Block number of the last batch.\n * @return Encoded batch context.\n */\n function _makeBatchExtraData(\n uint40 _totalElements,\n uint40 _nextQueueIdx,\n uint40 _timestamp,\n uint40 _blockNumber\n ) internal pure returns (bytes27) {\n bytes27 extraData;\n assembly {\n extraData := _totalElements\n extraData := or(extraData, shl(40, _nextQueueIdx))\n extraData := or(extraData, shl(80, _timestamp))\n extraData := or(extraData, shl(120, _blockNumber))\n extraData := shl(40, extraData)\n }\n\n return extraData;\n }\n\n /**\n * Inserts a batch into the chain of batches.\n * @param _transactionRoot Root of the transaction tree for this batch.\n * @param _batchSize Number of elements in the batch.\n * @param _numQueuedTransactions Number of queue transactions in the batch.\n * @param _timestamp The latest batch timestamp.\n * @param _blockNumber The latest batch blockNumber.\n */\n function _appendBatch(\n bytes32 _transactionRoot,\n uint256 _batchSize,\n uint256 _numQueuedTransactions,\n uint40 _timestamp,\n uint40 _blockNumber\n ) internal {\n IChainStorageContainer batchesRef = batches();\n (uint40 totalElements, uint40 nextQueueIndex, , ) = _getBatchExtraData();\n\n Lib_OVMCodec.ChainBatchHeader memory header = Lib_OVMCodec.ChainBatchHeader({\n batchIndex: batchesRef.length(),\n batchRoot: _transactionRoot,\n batchSize: _batchSize,\n prevTotalElements: totalElements,\n extraData: hex\"\"\n });\n\n emit TransactionBatchAppended(\n header.batchIndex,\n header.batchRoot,\n header.batchSize,\n header.prevTotalElements,\n header.extraData\n );\n\n bytes32 batchHeaderHash = Lib_OVMCodec.hashBatchHeader(header);\n bytes27 latestBatchContext = _makeBatchExtraData(\n totalElements + uint40(header.batchSize),\n nextQueueIndex + uint40(_numQueuedTransactions),\n _timestamp,\n _blockNumber\n );\n\n // slither-disable-next-line reentrancy-no-eth, reentrancy-events\n batchesRef.push(batchHeaderHash, latestBatchContext);\n }\n}\n" + }, + "contracts/standards/AddressAliasHelper.sol": { + "content": "// SPDX-License-Identifier: Apache-2.0\n\n/*\n * Copyright 2019-2021, Offchain Labs, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity ^0.8.7;\n\nlibrary AddressAliasHelper {\n uint160 constant offset = uint160(0x1111000000000000000000000000000000001111);\n\n /// @notice Utility function that converts the address in the L1 that submitted a tx to\n /// the inbox to the msg.sender viewed in the L2\n /// @param l1Address the address in the L1 that triggered the tx to L2\n /// @return l2Address L2 address as viewed in msg.sender\n function applyL1ToL2Alias(address l1Address) internal pure returns (address l2Address) {\n unchecked {\n l2Address = address(uint160(l1Address) + offset);\n }\n }\n\n /// @notice Utility function that converts the msg.sender viewed in the L2 to the\n /// address in the L1 that submitted a tx to the inbox\n /// @param l2Address L2 address as viewed in msg.sender\n /// @return l1Address the address in the L1 that triggered the tx to L2\n function undoL1ToL2Alias(address l2Address) internal pure returns (address l1Address) {\n unchecked {\n l1Address = address(uint160(l2Address) - offset);\n }\n }\n}\n" + }, + "contracts/test-libraries/codec/TestLib_OVMCodec.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Library Imports */\nimport { Lib_OVMCodec } from \"../../libraries/codec/Lib_OVMCodec.sol\";\n\n/**\n * @title TestLib_OVMCodec\n */\ncontract TestLib_OVMCodec {\n function encodeTransaction(Lib_OVMCodec.Transaction memory _transaction)\n public\n pure\n returns (bytes memory _encoded)\n {\n return Lib_OVMCodec.encodeTransaction(_transaction);\n }\n\n function hashTransaction(Lib_OVMCodec.Transaction memory _transaction)\n public\n pure\n returns (bytes32 _hash)\n {\n return Lib_OVMCodec.hashTransaction(_transaction);\n }\n}\n" + }, + "contracts/L1/messaging/L1CrossDomainMessenger.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Library Imports */\nimport { AddressAliasHelper } from \"../../standards/AddressAliasHelper.sol\";\nimport { Lib_AddressResolver } from \"../../libraries/resolver/Lib_AddressResolver.sol\";\nimport { Lib_OVMCodec } from \"../../libraries/codec/Lib_OVMCodec.sol\";\nimport { Lib_AddressManager } from \"../../libraries/resolver/Lib_AddressManager.sol\";\nimport { Lib_SecureMerkleTrie } from \"../../libraries/trie/Lib_SecureMerkleTrie.sol\";\nimport { Lib_DefaultValues } from \"../../libraries/constants/Lib_DefaultValues.sol\";\nimport { Lib_PredeployAddresses } from \"../../libraries/constants/Lib_PredeployAddresses.sol\";\nimport { Lib_CrossDomainUtils } from \"../../libraries/bridge/Lib_CrossDomainUtils.sol\";\n\n/* Interface Imports */\nimport { IL1CrossDomainMessenger } from \"./IL1CrossDomainMessenger.sol\";\nimport { ICanonicalTransactionChain } from \"../rollup/ICanonicalTransactionChain.sol\";\nimport { IStateCommitmentChain } from \"../rollup/IStateCommitmentChain.sol\";\n\n/* External Imports */\nimport {\n OwnableUpgradeable\n} from \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport {\n PausableUpgradeable\n} from \"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\";\nimport {\n ReentrancyGuardUpgradeable\n} from \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\n\n/**\n * @title L1CrossDomainMessenger\n * @dev The L1 Cross Domain Messenger contract sends messages from L1 to L2, and relays messages\n * from L2 onto L1. In the event that a message sent from L1 to L2 is rejected for exceeding the L2\n * epoch gas limit, it can be resubmitted via this contract's replay function.\n *\n */\ncontract L1CrossDomainMessenger is\n IL1CrossDomainMessenger,\n Lib_AddressResolver,\n OwnableUpgradeable,\n PausableUpgradeable,\n ReentrancyGuardUpgradeable\n{\n /**********\n * Events *\n **********/\n\n event MessageBlocked(bytes32 indexed _xDomainCalldataHash);\n\n event MessageAllowed(bytes32 indexed _xDomainCalldataHash);\n\n /**********************\n * Contract Variables *\n **********************/\n\n mapping(bytes32 => bool) public blockedMessages;\n mapping(bytes32 => bool) public relayedMessages;\n mapping(bytes32 => bool) public successfulMessages;\n\n address internal xDomainMsgSender = Lib_DefaultValues.DEFAULT_XDOMAIN_SENDER;\n\n /***************\n * Constructor *\n ***************/\n\n /**\n * This contract is intended to be behind a delegate proxy.\n * We pass the zero address to the address resolver just to satisfy the constructor.\n * We still need to set this value in initialize().\n */\n constructor() Lib_AddressResolver(address(0)) {}\n\n /********************\n * Public Functions *\n ********************/\n\n /**\n * @param _libAddressManager Address of the Address Manager.\n */\n // slither-disable-next-line external-function\n function initialize(address _libAddressManager) public initializer {\n require(\n address(libAddressManager) == address(0),\n \"L1CrossDomainMessenger already intialized.\"\n );\n libAddressManager = Lib_AddressManager(_libAddressManager);\n xDomainMsgSender = Lib_DefaultValues.DEFAULT_XDOMAIN_SENDER;\n\n // Initialize upgradable OZ contracts\n __Context_init_unchained(); // Context is a dependency for both Ownable and Pausable\n __Ownable_init_unchained();\n __Pausable_init_unchained();\n __ReentrancyGuard_init_unchained();\n }\n\n /**\n * Pause relaying.\n */\n function pause() external onlyOwner {\n _pause();\n }\n\n /**\n * Block a message.\n * @param _xDomainCalldataHash Hash of the message to block.\n */\n function blockMessage(bytes32 _xDomainCalldataHash) external onlyOwner {\n blockedMessages[_xDomainCalldataHash] = true;\n emit MessageBlocked(_xDomainCalldataHash);\n }\n\n /**\n * Allow a message.\n * @param _xDomainCalldataHash Hash of the message to block.\n */\n function allowMessage(bytes32 _xDomainCalldataHash) external onlyOwner {\n blockedMessages[_xDomainCalldataHash] = false;\n emit MessageAllowed(_xDomainCalldataHash);\n }\n\n // slither-disable-next-line external-function\n function xDomainMessageSender() public view returns (address) {\n require(\n xDomainMsgSender != Lib_DefaultValues.DEFAULT_XDOMAIN_SENDER,\n \"xDomainMessageSender is not set\"\n );\n return xDomainMsgSender;\n }\n\n /**\n * Sends a cross domain message to the target messenger.\n * @param _target Target contract address.\n * @param _message Message to send to the target.\n * @param _gasLimit Gas limit for the provided message.\n */\n // slither-disable-next-line external-function\n function sendMessage(\n address _target,\n bytes memory _message,\n uint32 _gasLimit\n ) public {\n address ovmCanonicalTransactionChain = resolve(\"CanonicalTransactionChain\");\n // Use the CTC queue length as nonce\n uint40 nonce = ICanonicalTransactionChain(ovmCanonicalTransactionChain).getQueueLength();\n\n bytes memory xDomainCalldata = Lib_CrossDomainUtils.encodeXDomainCalldata(\n _target,\n msg.sender,\n _message,\n nonce\n );\n\n // slither-disable-next-line reentrancy-events\n _sendXDomainMessage(ovmCanonicalTransactionChain, xDomainCalldata, _gasLimit);\n\n // slither-disable-next-line reentrancy-events\n emit SentMessage(_target, msg.sender, _message, nonce, _gasLimit);\n }\n\n /**\n * Relays a cross domain message to a contract.\n * @inheritdoc IL1CrossDomainMessenger\n */\n // slither-disable-next-line external-function\n function relayMessage(\n address _target,\n address _sender,\n bytes memory _message,\n uint256 _messageNonce,\n L2MessageInclusionProof memory _proof\n ) public nonReentrant whenNotPaused {\n bytes memory xDomainCalldata = Lib_CrossDomainUtils.encodeXDomainCalldata(\n _target,\n _sender,\n _message,\n _messageNonce\n );\n\n require(\n _verifyXDomainMessage(xDomainCalldata, _proof) == true,\n \"Provided message could not be verified.\"\n );\n\n bytes32 xDomainCalldataHash = keccak256(xDomainCalldata);\n\n require(\n successfulMessages[xDomainCalldataHash] == false,\n \"Provided message has already been received.\"\n );\n\n require(\n blockedMessages[xDomainCalldataHash] == false,\n \"Provided message has been blocked.\"\n );\n\n require(\n _target != resolve(\"CanonicalTransactionChain\"),\n \"Cannot send L2->L1 messages to L1 system contracts.\"\n );\n\n xDomainMsgSender = _sender;\n // slither-disable-next-line reentrancy-no-eth, reentrancy-events, reentrancy-benign\n (bool success, ) = _target.call(_message);\n // slither-disable-next-line reentrancy-benign\n xDomainMsgSender = Lib_DefaultValues.DEFAULT_XDOMAIN_SENDER;\n\n // Mark the message as received if the call was successful. Ensures that a message can be\n // relayed multiple times in the case that the call reverted.\n if (success == true) {\n // slither-disable-next-line reentrancy-no-eth\n successfulMessages[xDomainCalldataHash] = true;\n // slither-disable-next-line reentrancy-events\n emit RelayedMessage(xDomainCalldataHash);\n } else {\n // slither-disable-next-line reentrancy-events\n emit FailedRelayedMessage(xDomainCalldataHash);\n }\n\n // Store an identifier that can be used to prove that the given message was relayed by some\n // user. Gives us an easy way to pay relayers for their work.\n bytes32 relayId = keccak256(abi.encodePacked(xDomainCalldata, msg.sender, block.number));\n // slither-disable-next-line reentrancy-benign\n relayedMessages[relayId] = true;\n }\n\n /**\n * Replays a cross domain message to the target messenger.\n * @inheritdoc IL1CrossDomainMessenger\n */\n // slither-disable-next-line external-function\n function replayMessage(\n address _target,\n address _sender,\n bytes memory _message,\n uint256 _queueIndex,\n uint32 _oldGasLimit,\n uint32 _newGasLimit\n ) public {\n // Verify that the message is in the queue:\n address canonicalTransactionChain = resolve(\"CanonicalTransactionChain\");\n Lib_OVMCodec.QueueElement memory element = ICanonicalTransactionChain(\n canonicalTransactionChain\n ).getQueueElement(_queueIndex);\n\n // Compute the calldata that was originally used to send the message.\n bytes memory xDomainCalldata = Lib_CrossDomainUtils.encodeXDomainCalldata(\n _target,\n _sender,\n _message,\n _queueIndex\n );\n\n // Compute the transactionHash\n bytes32 transactionHash = keccak256(\n abi.encode(\n AddressAliasHelper.applyL1ToL2Alias(address(this)),\n Lib_PredeployAddresses.L2_CROSS_DOMAIN_MESSENGER,\n _oldGasLimit,\n xDomainCalldata\n )\n );\n\n // Now check that the provided message data matches the one in the queue element.\n require(\n transactionHash == element.transactionHash,\n \"Provided message has not been enqueued.\"\n );\n\n // Send the same message but with the new gas limit.\n _sendXDomainMessage(canonicalTransactionChain, xDomainCalldata, _newGasLimit);\n }\n\n /**********************\n * Internal Functions *\n **********************/\n\n /**\n * Verifies that the given message is valid.\n * @param _xDomainCalldata Calldata to verify.\n * @param _proof Inclusion proof for the message.\n * @return Whether or not the provided message is valid.\n */\n function _verifyXDomainMessage(\n bytes memory _xDomainCalldata,\n L2MessageInclusionProof memory _proof\n ) internal view returns (bool) {\n return (_verifyStateRootProof(_proof) && _verifyStorageProof(_xDomainCalldata, _proof));\n }\n\n /**\n * Verifies that the state root within an inclusion proof is valid.\n * @param _proof Message inclusion proof.\n * @return Whether or not the provided proof is valid.\n */\n function _verifyStateRootProof(L2MessageInclusionProof memory _proof)\n internal\n view\n returns (bool)\n {\n IStateCommitmentChain ovmStateCommitmentChain = IStateCommitmentChain(\n resolve(\"StateCommitmentChain\")\n );\n\n return (ovmStateCommitmentChain.insideFraudProofWindow(_proof.stateRootBatchHeader) ==\n false &&\n ovmStateCommitmentChain.verifyStateCommitment(\n _proof.stateRoot,\n _proof.stateRootBatchHeader,\n _proof.stateRootProof\n ));\n }\n\n /**\n * Verifies that the storage proof within an inclusion proof is valid.\n * @param _xDomainCalldata Encoded message calldata.\n * @param _proof Message inclusion proof.\n * @return Whether or not the provided proof is valid.\n */\n function _verifyStorageProof(\n bytes memory _xDomainCalldata,\n L2MessageInclusionProof memory _proof\n ) internal view returns (bool) {\n bytes32 storageKey = keccak256(\n abi.encodePacked(\n keccak256(\n abi.encodePacked(\n _xDomainCalldata,\n Lib_PredeployAddresses.L2_CROSS_DOMAIN_MESSENGER\n )\n ),\n uint256(0)\n )\n );\n\n (bool exists, bytes memory encodedMessagePassingAccount) = Lib_SecureMerkleTrie.get(\n abi.encodePacked(Lib_PredeployAddresses.L2_TO_L1_MESSAGE_PASSER),\n _proof.stateTrieWitness,\n _proof.stateRoot\n );\n\n require(\n exists == true,\n \"Message passing predeploy has not been initialized or invalid proof provided.\"\n );\n\n Lib_OVMCodec.EVMAccount memory account = Lib_OVMCodec.decodeEVMAccount(\n encodedMessagePassingAccount\n );\n\n return\n Lib_SecureMerkleTrie.verifyInclusionProof(\n abi.encodePacked(storageKey),\n abi.encodePacked(uint8(1)),\n _proof.storageTrieWitness,\n account.storageRoot\n );\n }\n\n /**\n * Sends a cross domain message.\n * @param _canonicalTransactionChain Address of the CanonicalTransactionChain instance.\n * @param _message Message to send.\n * @param _gasLimit OVM gas limit for the message.\n */\n function _sendXDomainMessage(\n address _canonicalTransactionChain,\n bytes memory _message,\n uint256 _gasLimit\n ) internal {\n // slither-disable-next-line reentrancy-events\n ICanonicalTransactionChain(_canonicalTransactionChain).enqueue(\n Lib_PredeployAddresses.L2_CROSS_DOMAIN_MESSENGER,\n _gasLimit,\n _message\n );\n }\n}\n" + }, + "contracts/libraries/trie/Lib_SecureMerkleTrie.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Library Imports */\nimport { Lib_MerkleTrie } from \"./Lib_MerkleTrie.sol\";\n\n/**\n * @title Lib_SecureMerkleTrie\n */\nlibrary Lib_SecureMerkleTrie {\n /**********************\n * Internal Functions *\n **********************/\n\n /**\n * @notice Verifies a proof that a given key/value pair is present in the\n * Merkle trie.\n * @param _key Key of the node to search for, as a hex string.\n * @param _value Value of the node to search for, as a hex string.\n * @param _proof Merkle trie inclusion proof for the desired node. Unlike\n * traditional Merkle trees, this proof is executed top-down and consists\n * of a list of RLP-encoded nodes that make a path down to the target node.\n * @param _root Known root of the Merkle trie. Used to verify that the\n * included proof is correctly constructed.\n * @return _verified `true` if the k/v pair exists in the trie, `false` otherwise.\n */\n function verifyInclusionProof(\n bytes memory _key,\n bytes memory _value,\n bytes memory _proof,\n bytes32 _root\n ) internal pure returns (bool _verified) {\n bytes memory key = _getSecureKey(_key);\n return Lib_MerkleTrie.verifyInclusionProof(key, _value, _proof, _root);\n }\n\n /**\n * @notice Retrieves the value associated with a given key.\n * @param _key Key to search for, as hex bytes.\n * @param _proof Merkle trie inclusion proof for the key.\n * @param _root Known root of the Merkle trie.\n * @return _exists Whether or not the key exists.\n * @return _value Value of the key if it exists.\n */\n function get(\n bytes memory _key,\n bytes memory _proof,\n bytes32 _root\n ) internal pure returns (bool _exists, bytes memory _value) {\n bytes memory key = _getSecureKey(_key);\n return Lib_MerkleTrie.get(key, _proof, _root);\n }\n\n /*********************\n * Private Functions *\n *********************/\n\n /**\n * Computes the secure counterpart to a key.\n * @param _key Key to get a secure key from.\n * @return _secureKey Secure version of the key.\n */\n function _getSecureKey(bytes memory _key) private pure returns (bytes memory _secureKey) {\n return abi.encodePacked(keccak256(_key));\n }\n}\n" + }, + "contracts/libraries/constants/Lib_DefaultValues.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/**\n * @title Lib_DefaultValues\n */\nlibrary Lib_DefaultValues {\n // The default x-domain message sender being set to a non-zero value makes\n // deployment a bit more expensive, but in exchange the refund on every call to\n // `relayMessage` by the L1 and L2 messengers will be higher.\n address internal constant DEFAULT_XDOMAIN_SENDER = 0x000000000000000000000000000000000000dEaD;\n}\n" + }, + "contracts/libraries/constants/Lib_PredeployAddresses.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/**\n * @title Lib_PredeployAddresses\n */\nlibrary Lib_PredeployAddresses {\n address internal constant L2_TO_L1_MESSAGE_PASSER = 0x4200000000000000000000000000000000000000;\n address internal constant L1_MESSAGE_SENDER = 0x4200000000000000000000000000000000000001;\n address internal constant DEPLOYER_WHITELIST = 0x4200000000000000000000000000000000000002;\n address payable internal constant OVM_ETH = payable(0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000);\n address internal constant L2_CROSS_DOMAIN_MESSENGER =\n 0x4200000000000000000000000000000000000007;\n address internal constant LIB_ADDRESS_MANAGER = 0x4200000000000000000000000000000000000008;\n address internal constant PROXY_EOA = 0x4200000000000000000000000000000000000009;\n address internal constant L2_STANDARD_BRIDGE = 0x4200000000000000000000000000000000000010;\n address internal constant SEQUENCER_FEE_WALLET = 0x4200000000000000000000000000000000000011;\n address internal constant L2_STANDARD_TOKEN_FACTORY =\n 0x4200000000000000000000000000000000000012;\n address internal constant L1_BLOCK_NUMBER = 0x4200000000000000000000000000000000000013;\n}\n" + }, + "contracts/libraries/bridge/Lib_CrossDomainUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/**\n * @title Lib_CrossDomainUtils\n */\nlibrary Lib_CrossDomainUtils {\n /**\n * Generates the correct cross domain calldata for a message.\n * @param _target Target contract address.\n * @param _sender Message sender address.\n * @param _message Message to send to the target.\n * @param _messageNonce Nonce for the provided message.\n * @return ABI encoded cross domain calldata.\n */\n function encodeXDomainCalldata(\n address _target,\n address _sender,\n bytes memory _message,\n uint256 _messageNonce\n ) internal pure returns (bytes memory) {\n return\n abi.encodeWithSignature(\n \"relayMessage(address,address,bytes,uint256)\",\n _target,\n _sender,\n _message,\n _messageNonce\n );\n }\n}\n" + }, + "contracts/L1/messaging/IL1CrossDomainMessenger.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Library Imports */\nimport { Lib_OVMCodec } from \"../../libraries/codec/Lib_OVMCodec.sol\";\n\n/* Interface Imports */\nimport { ICrossDomainMessenger } from \"../../libraries/bridge/ICrossDomainMessenger.sol\";\n\n/**\n * @title IL1CrossDomainMessenger\n */\ninterface IL1CrossDomainMessenger is ICrossDomainMessenger {\n /*******************\n * Data Structures *\n *******************/\n\n struct L2MessageInclusionProof {\n bytes32 stateRoot;\n Lib_OVMCodec.ChainBatchHeader stateRootBatchHeader;\n Lib_OVMCodec.ChainInclusionProof stateRootProof;\n bytes stateTrieWitness;\n bytes storageTrieWitness;\n }\n\n /********************\n * Public Functions *\n ********************/\n\n /**\n * Relays a cross domain message to a contract.\n * @param _target Target contract address.\n * @param _sender Message sender address.\n * @param _message Message to send to the target.\n * @param _messageNonce Nonce for the provided message.\n * @param _proof Inclusion proof for the given message.\n */\n function relayMessage(\n address _target,\n address _sender,\n bytes memory _message,\n uint256 _messageNonce,\n L2MessageInclusionProof memory _proof\n ) external;\n\n /**\n * Replays a cross domain message to the target messenger.\n * @param _target Target contract address.\n * @param _sender Original sender address.\n * @param _message Message to send to the target.\n * @param _queueIndex CTC Queue index for the message to replay.\n * @param _oldGasLimit Original gas limit used to send the message.\n * @param _newGasLimit New gas limit to be used for this message.\n */\n function replayMessage(\n address _target,\n address _sender,\n bytes memory _message,\n uint256 _queueIndex,\n uint32 _oldGasLimit,\n uint32 _newGasLimit\n ) external;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n function __Ownable_init() internal initializer {\n __Context_init_unchained();\n __Ownable_init_unchained();\n }\n\n function __Ownable_init_unchained() internal initializer {\n _setOwner(_msgSender());\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _setOwner(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _setOwner(newOwner);\n }\n\n function _setOwner(address newOwner) private {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract PausableUpgradeable is Initializable, ContextUpgradeable {\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state.\n */\n function __Pausable_init() internal initializer {\n __Context_init_unchained();\n __Pausable_init_unchained();\n }\n\n function __Pausable_init_unchained() internal initializer {\n _paused = false;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n require(!paused(), \"Pausable: paused\");\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n require(paused(), \"Pausable: not paused\");\n _;\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuardUpgradeable is Initializable {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction's gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n function __ReentrancyGuard_init() internal initializer {\n __ReentrancyGuard_init_unchained();\n }\n\n function __ReentrancyGuard_init_unchained() internal initializer {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and make it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n // On the first call to nonReentrant, _notEntered will be true\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n\n _;\n\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\n }\n uint256[49] private __gap;\n}\n" + }, + "contracts/libraries/trie/Lib_MerkleTrie.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Library Imports */\nimport { Lib_BytesUtils } from \"../utils/Lib_BytesUtils.sol\";\nimport { Lib_RLPReader } from \"../rlp/Lib_RLPReader.sol\";\nimport { Lib_RLPWriter } from \"../rlp/Lib_RLPWriter.sol\";\n\n/**\n * @title Lib_MerkleTrie\n */\nlibrary Lib_MerkleTrie {\n /*******************\n * Data Structures *\n *******************/\n\n enum NodeType {\n BranchNode,\n ExtensionNode,\n LeafNode\n }\n\n struct TrieNode {\n bytes encoded;\n Lib_RLPReader.RLPItem[] decoded;\n }\n\n /**********************\n * Contract Constants *\n **********************/\n\n // TREE_RADIX determines the number of elements per branch node.\n uint256 constant TREE_RADIX = 16;\n // Branch nodes have TREE_RADIX elements plus an additional `value` slot.\n uint256 constant BRANCH_NODE_LENGTH = TREE_RADIX + 1;\n // Leaf nodes and extension nodes always have two elements, a `path` and a `value`.\n uint256 constant LEAF_OR_EXTENSION_NODE_LENGTH = 2;\n\n // Prefixes are prepended to the `path` within a leaf or extension node and\n // allow us to differentiate between the two node types. `ODD` or `EVEN` is\n // determined by the number of nibbles within the unprefixed `path`. If the\n // number of nibbles if even, we need to insert an extra padding nibble so\n // the resulting prefixed `path` has an even number of nibbles.\n uint8 constant PREFIX_EXTENSION_EVEN = 0;\n uint8 constant PREFIX_EXTENSION_ODD = 1;\n uint8 constant PREFIX_LEAF_EVEN = 2;\n uint8 constant PREFIX_LEAF_ODD = 3;\n\n // Just a utility constant. RLP represents `NULL` as 0x80.\n bytes1 constant RLP_NULL = bytes1(0x80);\n\n /**********************\n * Internal Functions *\n **********************/\n\n /**\n * @notice Verifies a proof that a given key/value pair is present in the\n * Merkle trie.\n * @param _key Key of the node to search for, as a hex string.\n * @param _value Value of the node to search for, as a hex string.\n * @param _proof Merkle trie inclusion proof for the desired node. Unlike\n * traditional Merkle trees, this proof is executed top-down and consists\n * of a list of RLP-encoded nodes that make a path down to the target node.\n * @param _root Known root of the Merkle trie. Used to verify that the\n * included proof is correctly constructed.\n * @return _verified `true` if the k/v pair exists in the trie, `false` otherwise.\n */\n function verifyInclusionProof(\n bytes memory _key,\n bytes memory _value,\n bytes memory _proof,\n bytes32 _root\n ) internal pure returns (bool _verified) {\n (bool exists, bytes memory value) = get(_key, _proof, _root);\n\n return (exists && Lib_BytesUtils.equal(_value, value));\n }\n\n /**\n * @notice Retrieves the value associated with a given key.\n * @param _key Key to search for, as hex bytes.\n * @param _proof Merkle trie inclusion proof for the key.\n * @param _root Known root of the Merkle trie.\n * @return _exists Whether or not the key exists.\n * @return _value Value of the key if it exists.\n */\n function get(\n bytes memory _key,\n bytes memory _proof,\n bytes32 _root\n ) internal pure returns (bool _exists, bytes memory _value) {\n TrieNode[] memory proof = _parseProof(_proof);\n (uint256 pathLength, bytes memory keyRemainder, bool isFinalNode) = _walkNodePath(\n proof,\n _key,\n _root\n );\n\n bool exists = keyRemainder.length == 0;\n\n require(exists || isFinalNode, \"Provided proof is invalid.\");\n\n bytes memory value = exists ? _getNodeValue(proof[pathLength - 1]) : bytes(\"\");\n\n return (exists, value);\n }\n\n /*********************\n * Private Functions *\n *********************/\n\n /**\n * @notice Walks through a proof using a provided key.\n * @param _proof Inclusion proof to walk through.\n * @param _key Key to use for the walk.\n * @param _root Known root of the trie.\n * @return _pathLength Length of the final path\n * @return _keyRemainder Portion of the key remaining after the walk.\n * @return _isFinalNode Whether or not we've hit a dead end.\n */\n function _walkNodePath(\n TrieNode[] memory _proof,\n bytes memory _key,\n bytes32 _root\n )\n private\n pure\n returns (\n uint256 _pathLength,\n bytes memory _keyRemainder,\n bool _isFinalNode\n )\n {\n uint256 pathLength = 0;\n bytes memory key = Lib_BytesUtils.toNibbles(_key);\n\n bytes32 currentNodeID = _root;\n uint256 currentKeyIndex = 0;\n uint256 currentKeyIncrement = 0;\n TrieNode memory currentNode;\n\n // Proof is top-down, so we start at the first element (root).\n for (uint256 i = 0; i < _proof.length; i++) {\n currentNode = _proof[i];\n currentKeyIndex += currentKeyIncrement;\n\n // Keep track of the proof elements we actually need.\n // It's expensive to resize arrays, so this simply reduces gas costs.\n pathLength += 1;\n\n if (currentKeyIndex == 0) {\n // First proof element is always the root node.\n require(keccak256(currentNode.encoded) == currentNodeID, \"Invalid root hash\");\n } else if (currentNode.encoded.length >= 32) {\n // Nodes 32 bytes or larger are hashed inside branch nodes.\n require(\n keccak256(currentNode.encoded) == currentNodeID,\n \"Invalid large internal hash\"\n );\n } else {\n // Nodes smaller than 31 bytes aren't hashed.\n require(\n Lib_BytesUtils.toBytes32(currentNode.encoded) == currentNodeID,\n \"Invalid internal node hash\"\n );\n }\n\n if (currentNode.decoded.length == BRANCH_NODE_LENGTH) {\n if (currentKeyIndex == key.length) {\n // We've hit the end of the key\n // meaning the value should be within this branch node.\n break;\n } else {\n // We're not at the end of the key yet.\n // Figure out what the next node ID should be and continue.\n uint8 branchKey = uint8(key[currentKeyIndex]);\n Lib_RLPReader.RLPItem memory nextNode = currentNode.decoded[branchKey];\n currentNodeID = _getNodeID(nextNode);\n currentKeyIncrement = 1;\n continue;\n }\n } else if (currentNode.decoded.length == LEAF_OR_EXTENSION_NODE_LENGTH) {\n bytes memory path = _getNodePath(currentNode);\n uint8 prefix = uint8(path[0]);\n uint8 offset = 2 - (prefix % 2);\n bytes memory pathRemainder = Lib_BytesUtils.slice(path, offset);\n bytes memory keyRemainder = Lib_BytesUtils.slice(key, currentKeyIndex);\n uint256 sharedNibbleLength = _getSharedNibbleLength(pathRemainder, keyRemainder);\n\n if (prefix == PREFIX_LEAF_EVEN || prefix == PREFIX_LEAF_ODD) {\n if (\n pathRemainder.length == sharedNibbleLength &&\n keyRemainder.length == sharedNibbleLength\n ) {\n // The key within this leaf matches our key exactly.\n // Increment the key index to reflect that we have no remainder.\n currentKeyIndex += sharedNibbleLength;\n }\n\n // We've hit a leaf node, so our next node should be NULL.\n currentNodeID = bytes32(RLP_NULL);\n break;\n } else if (prefix == PREFIX_EXTENSION_EVEN || prefix == PREFIX_EXTENSION_ODD) {\n if (sharedNibbleLength != pathRemainder.length) {\n // Our extension node is not identical to the remainder.\n // We've hit the end of this path\n // updates will need to modify this extension.\n currentNodeID = bytes32(RLP_NULL);\n break;\n } else {\n // Our extension shares some nibbles.\n // Carry on to the next node.\n currentNodeID = _getNodeID(currentNode.decoded[1]);\n currentKeyIncrement = sharedNibbleLength;\n continue;\n }\n } else {\n revert(\"Received a node with an unknown prefix\");\n }\n } else {\n revert(\"Received an unparseable node.\");\n }\n }\n\n // If our node ID is NULL, then we're at a dead end.\n bool isFinalNode = currentNodeID == bytes32(RLP_NULL);\n return (pathLength, Lib_BytesUtils.slice(key, currentKeyIndex), isFinalNode);\n }\n\n /**\n * @notice Parses an RLP-encoded proof into something more useful.\n * @param _proof RLP-encoded proof to parse.\n * @return _parsed Proof parsed into easily accessible structs.\n */\n function _parseProof(bytes memory _proof) private pure returns (TrieNode[] memory _parsed) {\n Lib_RLPReader.RLPItem[] memory nodes = Lib_RLPReader.readList(_proof);\n TrieNode[] memory proof = new TrieNode[](nodes.length);\n\n for (uint256 i = 0; i < nodes.length; i++) {\n bytes memory encoded = Lib_RLPReader.readBytes(nodes[i]);\n proof[i] = TrieNode({ encoded: encoded, decoded: Lib_RLPReader.readList(encoded) });\n }\n\n return proof;\n }\n\n /**\n * @notice Picks out the ID for a node. Node ID is referred to as the\n * \"hash\" within the specification, but nodes < 32 bytes are not actually\n * hashed.\n * @param _node Node to pull an ID for.\n * @return _nodeID ID for the node, depending on the size of its contents.\n */\n function _getNodeID(Lib_RLPReader.RLPItem memory _node) private pure returns (bytes32 _nodeID) {\n bytes memory nodeID;\n\n if (_node.length < 32) {\n // Nodes smaller than 32 bytes are RLP encoded.\n nodeID = Lib_RLPReader.readRawBytes(_node);\n } else {\n // Nodes 32 bytes or larger are hashed.\n nodeID = Lib_RLPReader.readBytes(_node);\n }\n\n return Lib_BytesUtils.toBytes32(nodeID);\n }\n\n /**\n * @notice Gets the path for a leaf or extension node.\n * @param _node Node to get a path for.\n * @return _path Node path, converted to an array of nibbles.\n */\n function _getNodePath(TrieNode memory _node) private pure returns (bytes memory _path) {\n return Lib_BytesUtils.toNibbles(Lib_RLPReader.readBytes(_node.decoded[0]));\n }\n\n /**\n * @notice Gets the path for a node.\n * @param _node Node to get a value for.\n * @return _value Node value, as hex bytes.\n */\n function _getNodeValue(TrieNode memory _node) private pure returns (bytes memory _value) {\n return Lib_RLPReader.readBytes(_node.decoded[_node.decoded.length - 1]);\n }\n\n /**\n * @notice Utility; determines the number of nibbles shared between two\n * nibble arrays.\n * @param _a First nibble array.\n * @param _b Second nibble array.\n * @return _shared Number of shared nibbles.\n */\n function _getSharedNibbleLength(bytes memory _a, bytes memory _b)\n private\n pure\n returns (uint256 _shared)\n {\n uint256 i = 0;\n while (_a.length > i && _b.length > i && _a[i] == _b[i]) {\n i++;\n }\n return i;\n }\n}\n" + }, + "contracts/libraries/bridge/ICrossDomainMessenger.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >0.5.0 <0.9.0;\n\n/**\n * @title ICrossDomainMessenger\n */\ninterface ICrossDomainMessenger {\n /**********\n * Events *\n **********/\n\n event SentMessage(\n address indexed target,\n address sender,\n bytes message,\n uint256 messageNonce,\n uint256 gasLimit\n );\n event RelayedMessage(bytes32 indexed msgHash);\n event FailedRelayedMessage(bytes32 indexed msgHash);\n\n /*************\n * Variables *\n *************/\n\n function xDomainMessageSender() external view returns (address);\n\n /********************\n * Public Functions *\n ********************/\n\n /**\n * Sends a cross domain message to the target messenger.\n * @param _target Target contract address.\n * @param _message Message to send to the target.\n * @param _gasLimit Gas limit for the provided message.\n */\n function sendMessage(\n address _target,\n bytes calldata _message,\n uint32 _gasLimit\n ) external;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n function __Context_init() internal initializer {\n __Context_init_unchained();\n }\n\n function __Context_init_unchained() internal initializer {\n }\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n */\n bool private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Modifier to protect an initializer function from being invoked twice.\n */\n modifier initializer() {\n require(_initializing || !_initialized, \"Initializable: contract is already initialized\");\n\n bool isTopLevelCall = !_initializing;\n if (isTopLevelCall) {\n _initializing = true;\n _initialized = true;\n }\n\n _;\n\n if (isTopLevelCall) {\n _initializing = false;\n }\n }\n}\n" + }, + "contracts/L2/messaging/IL2CrossDomainMessenger.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Interface Imports */\nimport { ICrossDomainMessenger } from \"../../libraries/bridge/ICrossDomainMessenger.sol\";\n\n/**\n * @title IL2CrossDomainMessenger\n */\ninterface IL2CrossDomainMessenger is ICrossDomainMessenger {\n /********************\n * Public Functions *\n ********************/\n\n /**\n * Relays a cross domain message to a contract.\n * @param _target Target contract address.\n * @param _sender Message sender address.\n * @param _message Message to send to the target.\n * @param _messageNonce Nonce for the provided message.\n */\n function relayMessage(\n address _target,\n address _sender,\n bytes memory _message,\n uint256 _messageNonce\n ) external;\n}\n" + }, + "contracts/L2/messaging/L2CrossDomainMessenger.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Library Imports */\nimport { AddressAliasHelper } from \"../../standards/AddressAliasHelper.sol\";\nimport { Lib_CrossDomainUtils } from \"../../libraries/bridge/Lib_CrossDomainUtils.sol\";\nimport { Lib_DefaultValues } from \"../../libraries/constants/Lib_DefaultValues.sol\";\nimport { Lib_PredeployAddresses } from \"../../libraries/constants/Lib_PredeployAddresses.sol\";\n\n/* Interface Imports */\nimport { IL2CrossDomainMessenger } from \"./IL2CrossDomainMessenger.sol\";\nimport { iOVM_L2ToL1MessagePasser } from \"../predeploys/iOVM_L2ToL1MessagePasser.sol\";\n\n/**\n * @title L2CrossDomainMessenger\n * @dev The L2 Cross Domain Messenger contract sends messages from L2 to L1, and is the entry point\n * for L2 messages sent via the L1 Cross Domain Messenger.\n *\n */\ncontract L2CrossDomainMessenger is IL2CrossDomainMessenger {\n /*************\n * Variables *\n *************/\n\n mapping(bytes32 => bool) public relayedMessages;\n mapping(bytes32 => bool) public successfulMessages;\n mapping(bytes32 => bool) public sentMessages;\n uint256 public messageNonce;\n address internal xDomainMsgSender = Lib_DefaultValues.DEFAULT_XDOMAIN_SENDER;\n address public l1CrossDomainMessenger;\n\n /***************\n * Constructor *\n ***************/\n\n constructor(address _l1CrossDomainMessenger) {\n l1CrossDomainMessenger = _l1CrossDomainMessenger;\n }\n\n /********************\n * Public Functions *\n ********************/\n\n // slither-disable-next-line external-function\n function xDomainMessageSender() public view returns (address) {\n require(\n xDomainMsgSender != Lib_DefaultValues.DEFAULT_XDOMAIN_SENDER,\n \"xDomainMessageSender is not set\"\n );\n return xDomainMsgSender;\n }\n\n /**\n * Sends a cross domain message to the target messenger.\n * @param _target Target contract address.\n * @param _message Message to send to the target.\n * @param _gasLimit Gas limit for the provided message.\n */\n // slither-disable-next-line external-function\n function sendMessage(\n address _target,\n bytes memory _message,\n uint32 _gasLimit\n ) public {\n bytes memory xDomainCalldata = Lib_CrossDomainUtils.encodeXDomainCalldata(\n _target,\n msg.sender,\n _message,\n messageNonce\n );\n\n sentMessages[keccak256(xDomainCalldata)] = true;\n\n // Actually send the message.\n // slither-disable-next-line reentrancy-no-eth, reentrancy-events\n iOVM_L2ToL1MessagePasser(Lib_PredeployAddresses.L2_TO_L1_MESSAGE_PASSER).passMessageToL1(\n xDomainCalldata\n );\n\n // Emit an event before we bump the nonce or the nonce will be off by one.\n // slither-disable-next-line reentrancy-events\n emit SentMessage(_target, msg.sender, _message, messageNonce, _gasLimit);\n // slither-disable-next-line reentrancy-no-eth\n messageNonce += 1;\n }\n\n /**\n * Relays a cross domain message to a contract.\n * @inheritdoc IL2CrossDomainMessenger\n */\n // slither-disable-next-line external-function\n function relayMessage(\n address _target,\n address _sender,\n bytes memory _message,\n uint256 _messageNonce\n ) public {\n // Since it is impossible to deploy a contract to an address on L2 which matches\n // the alias of the L1CrossDomainMessenger, this check can only pass when it is called in\n // the first call from of a deposit transaction. Thus reentrancy is prevented here.\n require(\n AddressAliasHelper.undoL1ToL2Alias(msg.sender) == l1CrossDomainMessenger,\n \"Provided message could not be verified.\"\n );\n\n bytes memory xDomainCalldata = Lib_CrossDomainUtils.encodeXDomainCalldata(\n _target,\n _sender,\n _message,\n _messageNonce\n );\n\n bytes32 xDomainCalldataHash = keccak256(xDomainCalldata);\n\n require(\n successfulMessages[xDomainCalldataHash] == false,\n \"Provided message has already been received.\"\n );\n\n // Prevent calls to OVM_L2ToL1MessagePasser, which would enable\n // an attacker to maliciously craft the _message to spoof\n // a call from any L2 account.\n if (_target == Lib_PredeployAddresses.L2_TO_L1_MESSAGE_PASSER) {\n // Write to the successfulMessages mapping and return immediately.\n successfulMessages[xDomainCalldataHash] = true;\n return;\n }\n\n xDomainMsgSender = _sender;\n // slither-disable-next-line reentrancy-no-eth, reentrancy-events, reentrancy-benign\n (bool success, ) = _target.call(_message);\n // slither-disable-next-line reentrancy-benign\n xDomainMsgSender = Lib_DefaultValues.DEFAULT_XDOMAIN_SENDER;\n\n // Mark the message as received if the call was successful. Ensures that a message can be\n // relayed multiple times in the case that the call reverted.\n if (success == true) {\n // slither-disable-next-line reentrancy-no-eth\n successfulMessages[xDomainCalldataHash] = true;\n // slither-disable-next-line reentrancy-events\n emit RelayedMessage(xDomainCalldataHash);\n } else {\n // slither-disable-next-line reentrancy-events\n emit FailedRelayedMessage(xDomainCalldataHash);\n }\n\n // Store an identifier that can be used to prove that the given message was relayed by some\n // user. Gives us an easy way to pay relayers for their work.\n bytes32 relayId = keccak256(abi.encodePacked(xDomainCalldata, msg.sender, block.number));\n\n // slither-disable-next-line reentrancy-benign\n relayedMessages[relayId] = true;\n }\n}\n" + }, + "contracts/L2/predeploys/iOVM_L2ToL1MessagePasser.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/**\n * @title iOVM_L2ToL1MessagePasser\n */\ninterface iOVM_L2ToL1MessagePasser {\n /**********\n * Events *\n **********/\n\n event L2ToL1Message(uint256 _nonce, address _sender, bytes _data);\n\n /********************\n * Public Functions *\n ********************/\n\n function passMessageToL1(bytes calldata _message) external;\n}\n" + }, + "contracts/L2/predeploys/OVM_L2ToL1MessagePasser.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Interface Imports */\nimport { iOVM_L2ToL1MessagePasser } from \"./iOVM_L2ToL1MessagePasser.sol\";\n\n/**\n * @title OVM_L2ToL1MessagePasser\n * @dev The L2 to L1 Message Passer is a utility contract which facilitate an L1 proof of the\n * of a message on L2. The L1 Cross Domain Messenger performs this proof in its\n * _verifyStorageProof function, which verifies the existence of the transaction hash in this\n * contract's `sentMessages` mapping.\n */\ncontract OVM_L2ToL1MessagePasser is iOVM_L2ToL1MessagePasser {\n /**********************\n * Contract Variables *\n **********************/\n\n mapping(bytes32 => bool) public sentMessages;\n\n /********************\n * Public Functions *\n ********************/\n\n /**\n * Passes a message to L1.\n * @param _message Message to pass to L1.\n */\n // slither-disable-next-line external-function\n function passMessageToL1(bytes memory _message) public {\n // Note: although this function is public, only messages sent from the\n // L2CrossDomainMessenger will be relayed by the L1CrossDomainMessenger.\n // This is enforced by a check in L1CrossDomainMessenger._verifyStorageProof().\n sentMessages[keccak256(abi.encodePacked(_message, msg.sender))] = true;\n }\n}\n" + }, + "contracts/L2/predeploys/OVM_SequencerFeeVault.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Library Imports */\nimport { Lib_PredeployAddresses } from \"../../libraries/constants/Lib_PredeployAddresses.sol\";\n\n/* Contract Imports */\nimport { L2StandardBridge } from \"../messaging/L2StandardBridge.sol\";\n\n/**\n * @title OVM_SequencerFeeVault\n * @dev Simple holding contract for fees paid to the Sequencer. Likely to be replaced in the future\n * but \"good enough for now\".\n */\ncontract OVM_SequencerFeeVault {\n /*************\n * Constants *\n *************/\n\n // Minimum ETH balance that can be withdrawn in a single withdrawal.\n uint256 public constant MIN_WITHDRAWAL_AMOUNT = 15 ether;\n\n /*************\n * Variables *\n *************/\n\n // Address on L1 that will hold the fees once withdrawn. Dynamically initialized within l2geth.\n address public l1FeeWallet;\n\n /***************\n * Constructor *\n ***************/\n\n /**\n * @param _l1FeeWallet Initial address for the L1 wallet that will hold fees once withdrawn.\n * Currently HAS NO EFFECT in production because l2geth will mutate this storage slot during\n * the genesis block. This is ONLY for testing purposes.\n */\n constructor(address _l1FeeWallet) {\n l1FeeWallet = _l1FeeWallet;\n }\n\n /************\n * Fallback *\n ************/\n\n // slither-disable-next-line locked-ether\n receive() external payable {}\n\n /********************\n * Public Functions *\n ********************/\n\n // slither-disable-next-line external-function\n function withdraw() public {\n require(\n address(this).balance >= MIN_WITHDRAWAL_AMOUNT,\n // solhint-disable-next-line max-line-length\n \"OVM_SequencerFeeVault: withdrawal amount must be greater than minimum withdrawal amount\"\n );\n\n L2StandardBridge(Lib_PredeployAddresses.L2_STANDARD_BRIDGE).withdrawTo(\n Lib_PredeployAddresses.OVM_ETH,\n l1FeeWallet,\n address(this).balance,\n 0,\n bytes(\"\")\n );\n }\n}\n" + }, + "contracts/L2/messaging/L2StandardBridge.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Interface Imports */\nimport { IL1StandardBridge } from \"../../L1/messaging/IL1StandardBridge.sol\";\nimport { IL1ERC20Bridge } from \"../../L1/messaging/IL1ERC20Bridge.sol\";\nimport { IL2ERC20Bridge } from \"./IL2ERC20Bridge.sol\";\n\n/* Library Imports */\nimport { ERC165Checker } from \"@openzeppelin/contracts/utils/introspection/ERC165Checker.sol\";\nimport { CrossDomainEnabled } from \"../../libraries/bridge/CrossDomainEnabled.sol\";\nimport { Lib_PredeployAddresses } from \"../../libraries/constants/Lib_PredeployAddresses.sol\";\n\n/* Contract Imports */\nimport { IL2StandardERC20 } from \"../../standards/IL2StandardERC20.sol\";\n\n/**\n * @title L2StandardBridge\n * @dev The L2 Standard bridge is a contract which works together with the L1 Standard bridge to\n * enable ETH and ERC20 transitions between L1 and L2.\n * This contract acts as a minter for new tokens when it hears about deposits into the L1 Standard\n * bridge.\n * This contract also acts as a burner of the tokens intended for withdrawal, informing the L1\n * bridge to release L1 funds.\n */\ncontract L2StandardBridge is IL2ERC20Bridge, CrossDomainEnabled {\n /********************************\n * External Contract References *\n ********************************/\n\n address public l1TokenBridge;\n\n /***************\n * Constructor *\n ***************/\n\n /**\n * @param _l2CrossDomainMessenger Cross-domain messenger used by this contract.\n * @param _l1TokenBridge Address of the L1 bridge deployed to the main chain.\n */\n constructor(address _l2CrossDomainMessenger, address _l1TokenBridge)\n CrossDomainEnabled(_l2CrossDomainMessenger)\n {\n l1TokenBridge = _l1TokenBridge;\n }\n\n /***************\n * Withdrawing *\n ***************/\n\n /**\n * @inheritdoc IL2ERC20Bridge\n */\n function withdraw(\n address _l2Token,\n uint256 _amount,\n uint32 _l1Gas,\n bytes calldata _data\n ) external virtual {\n _initiateWithdrawal(_l2Token, msg.sender, msg.sender, _amount, _l1Gas, _data);\n }\n\n /**\n * @inheritdoc IL2ERC20Bridge\n */\n function withdrawTo(\n address _l2Token,\n address _to,\n uint256 _amount,\n uint32 _l1Gas,\n bytes calldata _data\n ) external virtual {\n _initiateWithdrawal(_l2Token, msg.sender, _to, _amount, _l1Gas, _data);\n }\n\n /**\n * @dev Performs the logic for withdrawals by burning the token and informing\n * the L1 token Gateway of the withdrawal.\n * @param _l2Token Address of L2 token where withdrawal is initiated.\n * @param _from Account to pull the withdrawal from on L2.\n * @param _to Account to give the withdrawal to on L1.\n * @param _amount Amount of the token to withdraw.\n * @param _l1Gas Unused, but included for potential forward compatibility considerations.\n * @param _data Optional data to forward to L1. This data is provided\n * solely as a convenience for external contracts. Aside from enforcing a maximum\n * length, these contracts provide no guarantees about its content.\n */\n function _initiateWithdrawal(\n address _l2Token,\n address _from,\n address _to,\n uint256 _amount,\n uint32 _l1Gas,\n bytes calldata _data\n ) internal {\n // When a withdrawal is initiated, we burn the withdrawer's funds to prevent subsequent L2\n // usage\n // slither-disable-next-line reentrancy-events\n IL2StandardERC20(_l2Token).burn(msg.sender, _amount);\n\n // Construct calldata for l1TokenBridge.finalizeERC20Withdrawal(_to, _amount)\n // slither-disable-next-line reentrancy-events\n address l1Token = IL2StandardERC20(_l2Token).l1Token();\n bytes memory message;\n\n if (_l2Token == Lib_PredeployAddresses.OVM_ETH) {\n message = abi.encodeWithSelector(\n IL1StandardBridge.finalizeETHWithdrawal.selector,\n _from,\n _to,\n _amount,\n _data\n );\n } else {\n message = abi.encodeWithSelector(\n IL1ERC20Bridge.finalizeERC20Withdrawal.selector,\n l1Token,\n _l2Token,\n _from,\n _to,\n _amount,\n _data\n );\n }\n\n // Send message up to L1 bridge\n // slither-disable-next-line reentrancy-events\n sendCrossDomainMessage(l1TokenBridge, _l1Gas, message);\n\n // slither-disable-next-line reentrancy-events\n emit WithdrawalInitiated(l1Token, _l2Token, msg.sender, _to, _amount, _data);\n }\n\n /************************************\n * Cross-chain Function: Depositing *\n ************************************/\n\n /**\n * @inheritdoc IL2ERC20Bridge\n */\n function finalizeDeposit(\n address _l1Token,\n address _l2Token,\n address _from,\n address _to,\n uint256 _amount,\n bytes calldata _data\n ) external virtual onlyFromCrossDomainAccount(l1TokenBridge) {\n // Check the target token is compliant and\n // verify the deposited token on L1 matches the L2 deposited token representation here\n if (\n // slither-disable-next-line reentrancy-events\n ERC165Checker.supportsInterface(_l2Token, 0x1d1d8b63) &&\n _l1Token == IL2StandardERC20(_l2Token).l1Token()\n ) {\n // When a deposit is finalized, we credit the account on L2 with the same amount of\n // tokens.\n // slither-disable-next-line reentrancy-events\n IL2StandardERC20(_l2Token).mint(_to, _amount);\n // slither-disable-next-line reentrancy-events\n emit DepositFinalized(_l1Token, _l2Token, _from, _to, _amount, _data);\n } else {\n // Either the L2 token which is being deposited-into disagrees about the correct address\n // of its L1 token, or does not support the correct interface.\n // This should only happen if there is a malicious L2 token, or if a user somehow\n // specified the wrong L2 token address to deposit into.\n // In either case, we stop the process here and construct a withdrawal\n // message so that users can get their funds out in some cases.\n // There is no way to prevent malicious token contracts altogether, but this does limit\n // user error and mitigate some forms of malicious contract behavior.\n bytes memory message = abi.encodeWithSelector(\n IL1ERC20Bridge.finalizeERC20Withdrawal.selector,\n _l1Token,\n _l2Token,\n _to, // switched the _to and _from here to bounce back the deposit to the sender\n _from,\n _amount,\n _data\n );\n\n // Send message up to L1 bridge\n // slither-disable-next-line reentrancy-events\n sendCrossDomainMessage(l1TokenBridge, 0, message);\n // slither-disable-next-line reentrancy-events\n emit DepositFailed(_l1Token, _l2Token, _from, _to, _amount, _data);\n }\n }\n}\n" + }, + "contracts/L1/messaging/IL1StandardBridge.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >0.5.0 <0.9.0;\n\nimport \"./IL1ERC20Bridge.sol\";\n\n/**\n * @title IL1StandardBridge\n */\ninterface IL1StandardBridge is IL1ERC20Bridge {\n /**********\n * Events *\n **********/\n event ETHDepositInitiated(\n address indexed _from,\n address indexed _to,\n uint256 _amount,\n bytes _data\n );\n\n event ETHWithdrawalFinalized(\n address indexed _from,\n address indexed _to,\n uint256 _amount,\n bytes _data\n );\n\n /********************\n * Public Functions *\n ********************/\n\n /**\n * @dev Deposit an amount of the ETH to the caller's balance on L2.\n * @param _l2Gas Gas limit required to complete the deposit on L2.\n * @param _data Optional data to forward to L2. This data is provided\n * solely as a convenience for external contracts. Aside from enforcing a maximum\n * length, these contracts provide no guarantees about its content.\n */\n function depositETH(uint32 _l2Gas, bytes calldata _data) external payable;\n\n /**\n * @dev Deposit an amount of ETH to a recipient's balance on L2.\n * @param _to L2 address to credit the withdrawal to.\n * @param _l2Gas Gas limit required to complete the deposit on L2.\n * @param _data Optional data to forward to L2. This data is provided\n * solely as a convenience for external contracts. Aside from enforcing a maximum\n * length, these contracts provide no guarantees about its content.\n */\n function depositETHTo(\n address _to,\n uint32 _l2Gas,\n bytes calldata _data\n ) external payable;\n\n /*************************\n * Cross-chain Functions *\n *************************/\n\n /**\n * @dev Complete a withdrawal from L2 to L1, and credit funds to the recipient's balance of the\n * L1 ETH token. Since only the xDomainMessenger can call this function, it will never be called\n * before the withdrawal is finalized.\n * @param _from L2 address initiating the transfer.\n * @param _to L1 address to credit the withdrawal to.\n * @param _amount Amount of the ERC20 to deposit.\n * @param _data Optional data to forward to L2. This data is provided\n * solely as a convenience for external contracts. Aside from enforcing a maximum\n * length, these contracts provide no guarantees about its content.\n */\n function finalizeETHWithdrawal(\n address _from,\n address _to,\n uint256 _amount,\n bytes calldata _data\n ) external;\n}\n" + }, + "contracts/L1/messaging/IL1ERC20Bridge.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >0.5.0 <0.9.0;\n\n/**\n * @title IL1ERC20Bridge\n */\ninterface IL1ERC20Bridge {\n /**********\n * Events *\n **********/\n\n event ERC20DepositInitiated(\n address indexed _l1Token,\n address indexed _l2Token,\n address indexed _from,\n address _to,\n uint256 _amount,\n bytes _data\n );\n\n event ERC20WithdrawalFinalized(\n address indexed _l1Token,\n address indexed _l2Token,\n address indexed _from,\n address _to,\n uint256 _amount,\n bytes _data\n );\n\n /********************\n * Public Functions *\n ********************/\n\n /**\n * @dev get the address of the corresponding L2 bridge contract.\n * @return Address of the corresponding L2 bridge contract.\n */\n function l2TokenBridge() external returns (address);\n\n /**\n * @dev deposit an amount of the ERC20 to the caller's balance on L2.\n * @param _l1Token Address of the L1 ERC20 we are depositing\n * @param _l2Token Address of the L1 respective L2 ERC20\n * @param _amount Amount of the ERC20 to deposit\n * @param _l2Gas Gas limit required to complete the deposit on L2.\n * @param _data Optional data to forward to L2. This data is provided\n * solely as a convenience for external contracts. Aside from enforcing a maximum\n * length, these contracts provide no guarantees about its content.\n */\n function depositERC20(\n address _l1Token,\n address _l2Token,\n uint256 _amount,\n uint32 _l2Gas,\n bytes calldata _data\n ) external;\n\n /**\n * @dev deposit an amount of ERC20 to a recipient's balance on L2.\n * @param _l1Token Address of the L1 ERC20 we are depositing\n * @param _l2Token Address of the L1 respective L2 ERC20\n * @param _to L2 address to credit the withdrawal to.\n * @param _amount Amount of the ERC20 to deposit.\n * @param _l2Gas Gas limit required to complete the deposit on L2.\n * @param _data Optional data to forward to L2. This data is provided\n * solely as a convenience for external contracts. Aside from enforcing a maximum\n * length, these contracts provide no guarantees about its content.\n */\n function depositERC20To(\n address _l1Token,\n address _l2Token,\n address _to,\n uint256 _amount,\n uint32 _l2Gas,\n bytes calldata _data\n ) external;\n\n /*************************\n * Cross-chain Functions *\n *************************/\n\n /**\n * @dev Complete a withdrawal from L2 to L1, and credit funds to the recipient's balance of the\n * L1 ERC20 token.\n * This call will fail if the initialized withdrawal from L2 has not been finalized.\n *\n * @param _l1Token Address of L1 token to finalizeWithdrawal for.\n * @param _l2Token Address of L2 token where withdrawal was initiated.\n * @param _from L2 address initiating the transfer.\n * @param _to L1 address to credit the withdrawal to.\n * @param _amount Amount of the ERC20 to deposit.\n * @param _data Data provided by the sender on L2. This data is provided\n * solely as a convenience for external contracts. Aside from enforcing a maximum\n * length, these contracts provide no guarantees about its content.\n */\n function finalizeERC20Withdrawal(\n address _l1Token,\n address _l2Token,\n address _from,\n address _to,\n uint256 _amount,\n bytes calldata _data\n ) external;\n}\n" + }, + "contracts/L2/messaging/IL2ERC20Bridge.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/**\n * @title IL2ERC20Bridge\n */\ninterface IL2ERC20Bridge {\n /**********\n * Events *\n **********/\n\n event WithdrawalInitiated(\n address indexed _l1Token,\n address indexed _l2Token,\n address indexed _from,\n address _to,\n uint256 _amount,\n bytes _data\n );\n\n event DepositFinalized(\n address indexed _l1Token,\n address indexed _l2Token,\n address indexed _from,\n address _to,\n uint256 _amount,\n bytes _data\n );\n\n event DepositFailed(\n address indexed _l1Token,\n address indexed _l2Token,\n address indexed _from,\n address _to,\n uint256 _amount,\n bytes _data\n );\n\n /********************\n * Public Functions *\n ********************/\n\n /**\n * @dev get the address of the corresponding L1 bridge contract.\n * @return Address of the corresponding L1 bridge contract.\n */\n function l1TokenBridge() external returns (address);\n\n /**\n * @dev initiate a withdraw of some tokens to the caller's account on L1\n * @param _l2Token Address of L2 token where withdrawal was initiated.\n * @param _amount Amount of the token to withdraw.\n * param _l1Gas Unused, but included for potential forward compatibility considerations.\n * @param _data Optional data to forward to L1. This data is provided\n * solely as a convenience for external contracts. Aside from enforcing a maximum\n * length, these contracts provide no guarantees about its content.\n */\n function withdraw(\n address _l2Token,\n uint256 _amount,\n uint32 _l1Gas,\n bytes calldata _data\n ) external;\n\n /**\n * @dev initiate a withdraw of some token to a recipient's account on L1.\n * @param _l2Token Address of L2 token where withdrawal is initiated.\n * @param _to L1 adress to credit the withdrawal to.\n * @param _amount Amount of the token to withdraw.\n * param _l1Gas Unused, but included for potential forward compatibility considerations.\n * @param _data Optional data to forward to L1. This data is provided\n * solely as a convenience for external contracts. Aside from enforcing a maximum\n * length, these contracts provide no guarantees about its content.\n */\n function withdrawTo(\n address _l2Token,\n address _to,\n uint256 _amount,\n uint32 _l1Gas,\n bytes calldata _data\n ) external;\n\n /*************************\n * Cross-chain Functions *\n *************************/\n\n /**\n * @dev Complete a deposit from L1 to L2, and credits funds to the recipient's balance of this\n * L2 token. This call will fail if it did not originate from a corresponding deposit in\n * L1StandardTokenBridge.\n * @param _l1Token Address for the l1 token this is called with\n * @param _l2Token Address for the l2 token this is called with\n * @param _from Account to pull the deposit from on L2.\n * @param _to Address to receive the withdrawal at\n * @param _amount Amount of the token to withdraw\n * @param _data Data provider by the sender on L1. This data is provided\n * solely as a convenience for external contracts. Aside from enforcing a maximum\n * length, these contracts provide no guarantees about its content.\n */\n function finalizeDeposit(\n address _l1Token,\n address _l2Token,\n address _from,\n address _to,\n uint256 _amount,\n bytes calldata _data\n ) external;\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165.sol\";\n\n/**\n * @dev Library used to query support of an interface declared via {IERC165}.\n *\n * Note that these functions return the actual result of the query: they do not\n * `revert` if an interface is not supported. It is up to the caller to decide\n * what to do in these cases.\n */\nlibrary ERC165Checker {\n // As per the EIP-165 spec, no interface should ever match 0xffffffff\n bytes4 private constant _INTERFACE_ID_INVALID = 0xffffffff;\n\n /**\n * @dev Returns true if `account` supports the {IERC165} interface,\n */\n function supportsERC165(address account) internal view returns (bool) {\n // Any contract that implements ERC165 must explicitly indicate support of\n // InterfaceId_ERC165 and explicitly indicate non-support of InterfaceId_Invalid\n return\n _supportsERC165Interface(account, type(IERC165).interfaceId) &&\n !_supportsERC165Interface(account, _INTERFACE_ID_INVALID);\n }\n\n /**\n * @dev Returns true if `account` supports the interface defined by\n * `interfaceId`. Support for {IERC165} itself is queried automatically.\n *\n * See {IERC165-supportsInterface}.\n */\n function supportsInterface(address account, bytes4 interfaceId) internal view returns (bool) {\n // query support of both ERC165 as per the spec and support of _interfaceId\n return supportsERC165(account) && _supportsERC165Interface(account, interfaceId);\n }\n\n /**\n * @dev Returns a boolean array where each value corresponds to the\n * interfaces passed in and whether they're supported or not. This allows\n * you to batch check interfaces for a contract where your expectation\n * is that some interfaces may not be supported.\n *\n * See {IERC165-supportsInterface}.\n *\n * _Available since v3.4._\n */\n function getSupportedInterfaces(address account, bytes4[] memory interfaceIds)\n internal\n view\n returns (bool[] memory)\n {\n // an array of booleans corresponding to interfaceIds and whether they're supported or not\n bool[] memory interfaceIdsSupported = new bool[](interfaceIds.length);\n\n // query support of ERC165 itself\n if (supportsERC165(account)) {\n // query support of each interface in interfaceIds\n for (uint256 i = 0; i < interfaceIds.length; i++) {\n interfaceIdsSupported[i] = _supportsERC165Interface(account, interfaceIds[i]);\n }\n }\n\n return interfaceIdsSupported;\n }\n\n /**\n * @dev Returns true if `account` supports all the interfaces defined in\n * `interfaceIds`. Support for {IERC165} itself is queried automatically.\n *\n * Batch-querying can lead to gas savings by skipping repeated checks for\n * {IERC165} support.\n *\n * See {IERC165-supportsInterface}.\n */\n function supportsAllInterfaces(address account, bytes4[] memory interfaceIds) internal view returns (bool) {\n // query support of ERC165 itself\n if (!supportsERC165(account)) {\n return false;\n }\n\n // query support of each interface in _interfaceIds\n for (uint256 i = 0; i < interfaceIds.length; i++) {\n if (!_supportsERC165Interface(account, interfaceIds[i])) {\n return false;\n }\n }\n\n // all interfaces supported\n return true;\n }\n\n /**\n * @notice Query if a contract implements an interface, does not check ERC165 support\n * @param account The address of the contract to query for support of an interface\n * @param interfaceId The interface identifier, as specified in ERC-165\n * @return true if the contract at account indicates support of the interface with\n * identifier interfaceId, false otherwise\n * @dev Assumes that account contains a contract that supports ERC165, otherwise\n * the behavior of this method is undefined. This precondition can be checked\n * with {supportsERC165}.\n * Interface identification is specified in ERC-165.\n */\n function _supportsERC165Interface(address account, bytes4 interfaceId) private view returns (bool) {\n bytes memory encodedParams = abi.encodeWithSelector(IERC165.supportsInterface.selector, interfaceId);\n (bool success, bytes memory result) = account.staticcall{gas: 30000}(encodedParams);\n if (result.length < 32) return false;\n return success && abi.decode(result, (bool));\n }\n}\n" + }, + "contracts/libraries/bridge/CrossDomainEnabled.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >0.5.0 <0.9.0;\n\n/* Interface Imports */\nimport { ICrossDomainMessenger } from \"./ICrossDomainMessenger.sol\";\n\n/**\n * @title CrossDomainEnabled\n * @dev Helper contract for contracts performing cross-domain communications\n *\n * Compiler used: defined by inheriting contract\n */\ncontract CrossDomainEnabled {\n /*************\n * Variables *\n *************/\n\n // Messenger contract used to send and recieve messages from the other domain.\n address public messenger;\n\n /***************\n * Constructor *\n ***************/\n\n /**\n * @param _messenger Address of the CrossDomainMessenger on the current layer.\n */\n constructor(address _messenger) {\n messenger = _messenger;\n }\n\n /**********************\n * Function Modifiers *\n **********************/\n\n /**\n * Enforces that the modified function is only callable by a specific cross-domain account.\n * @param _sourceDomainAccount The only account on the originating domain which is\n * authenticated to call this function.\n */\n modifier onlyFromCrossDomainAccount(address _sourceDomainAccount) {\n require(\n msg.sender == address(getCrossDomainMessenger()),\n \"OVM_XCHAIN: messenger contract unauthenticated\"\n );\n\n require(\n getCrossDomainMessenger().xDomainMessageSender() == _sourceDomainAccount,\n \"OVM_XCHAIN: wrong sender of cross-domain message\"\n );\n\n _;\n }\n\n /**********************\n * Internal Functions *\n **********************/\n\n /**\n * Gets the messenger, usually from storage. This function is exposed in case a child contract\n * needs to override.\n * @return The address of the cross-domain messenger contract which should be used.\n */\n function getCrossDomainMessenger() internal virtual returns (ICrossDomainMessenger) {\n return ICrossDomainMessenger(messenger);\n }\n\n /**q\n * Sends a message to an account on another domain\n * @param _crossDomainTarget The intended recipient on the destination domain\n * @param _message The data to send to the target (usually calldata to a function with\n * `onlyFromCrossDomainAccount()`)\n * @param _gasLimit The gasLimit for the receipt of the message on the target domain.\n */\n function sendCrossDomainMessage(\n address _crossDomainTarget,\n uint32 _gasLimit,\n bytes memory _message\n ) internal {\n // slither-disable-next-line reentrancy-events, reentrancy-benign\n getCrossDomainMessenger().sendMessage(_crossDomainTarget, _message, _gasLimit);\n }\n}\n" + }, + "contracts/standards/IL2StandardERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport { IERC165 } from \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\n\ninterface IL2StandardERC20 is IERC20, IERC165 {\n function l1Token() external returns (address);\n\n function mint(address _to, uint256 _amount) external;\n\n function burn(address _from, uint256 _amount) external;\n\n event Mint(address indexed _account, uint256 _amount);\n event Burn(address indexed _account, uint256 _amount);\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) external returns (bool);\n\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n}\n" + }, + "contracts/standards/L2StandardERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\nimport { ERC20 } from \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"./IL2StandardERC20.sol\";\n\ncontract L2StandardERC20 is IL2StandardERC20, ERC20 {\n address public l1Token;\n address public l2Bridge;\n\n /**\n * @param _l2Bridge Address of the L2 standard bridge.\n * @param _l1Token Address of the corresponding L1 token.\n * @param _name ERC20 name.\n * @param _symbol ERC20 symbol.\n */\n constructor(\n address _l2Bridge,\n address _l1Token,\n string memory _name,\n string memory _symbol\n ) ERC20(_name, _symbol) {\n l1Token = _l1Token;\n l2Bridge = _l2Bridge;\n }\n\n modifier onlyL2Bridge() {\n require(msg.sender == l2Bridge, \"Only L2 Bridge can mint and burn\");\n _;\n }\n\n // slither-disable-next-line external-function\n function supportsInterface(bytes4 _interfaceId) public pure returns (bool) {\n bytes4 firstSupportedInterface = bytes4(keccak256(\"supportsInterface(bytes4)\")); // ERC165\n bytes4 secondSupportedInterface = IL2StandardERC20.l1Token.selector ^\n IL2StandardERC20.mint.selector ^\n IL2StandardERC20.burn.selector;\n return _interfaceId == firstSupportedInterface || _interfaceId == secondSupportedInterface;\n }\n\n // slither-disable-next-line external-function\n function mint(address _to, uint256 _amount) public virtual onlyL2Bridge {\n _mint(_to, _amount);\n\n emit Mint(_to, _amount);\n }\n\n // slither-disable-next-line external-function\n function burn(address _from, uint256 _amount) public virtual onlyL2Bridge {\n _burn(_from, _amount);\n\n emit Burn(_from, _amount);\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `recipient` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address recipient, uint256 amount) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * Requirements:\n *\n * - `sender` and `recipient` cannot be the zero address.\n * - `sender` must have a balance of at least `amount`.\n * - the caller must have allowance for ``sender``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(currentAllowance >= amount, \"ERC20: transfer amount exceeds allowance\");\n unchecked {\n _approve(sender, _msgSender(), currentAllowance - amount);\n }\n\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `sender` to `recipient`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `sender` cannot be the zero address.\n * - `recipient` cannot be the zero address.\n * - `sender` must have a balance of at least `amount`.\n */\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(sender, recipient, amount);\n\n uint256 senderBalance = _balances[sender];\n require(senderBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[sender] = senderBalance - amount;\n }\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n\n _afterTokenTransfer(sender, recipient, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n _balances[account] += amount;\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n }\n _totalSupply -= amount;\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "contracts/L2/predeploys/OVM_ETH.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Library Imports */\nimport { Lib_PredeployAddresses } from \"../../libraries/constants/Lib_PredeployAddresses.sol\";\n\n/* Contract Imports */\nimport { L2StandardERC20 } from \"../../standards/L2StandardERC20.sol\";\n\n/**\n * @title OVM_ETH\n * @dev The ETH predeploy provides an ERC20 interface for ETH deposited to Layer 2. Note that\n * unlike on Layer 1, Layer 2 accounts do not have a balance field.\n */\ncontract OVM_ETH is L2StandardERC20 {\n /***************\n * Constructor *\n ***************/\n\n constructor()\n L2StandardERC20(Lib_PredeployAddresses.L2_STANDARD_BRIDGE, address(0), \"Ether\", \"ETH\")\n {}\n\n // ETH ERC20 features are disabled until further notice.\n // Discussion here: https://github.com/ethereum-optimism/optimism/discussions/1444\n\n function transfer(address recipient, uint256 amount) public virtual override returns (bool) {\n revert(\"OVM_ETH: transfer is disabled pending further community discussion.\");\n }\n\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n revert(\"OVM_ETH: approve is disabled pending further community discussion.\");\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n revert(\"OVM_ETH: transferFrom is disabled pending further community discussion.\");\n }\n\n function increaseAllowance(address spender, uint256 addedValue)\n public\n virtual\n override\n returns (bool)\n {\n revert(\"OVM_ETH: increaseAllowance is disabled pending further community discussion.\");\n }\n\n function decreaseAllowance(address spender, uint256 subtractedValue)\n public\n virtual\n override\n returns (bool)\n {\n revert(\"OVM_ETH: decreaseAllowance is disabled pending further community discussion.\");\n }\n}\n" + }, + "contracts/test-helpers/TestERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\nimport { ERC20 } from \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\n\ncontract TestERC20 is ERC20 {\n constructor() ERC20(\"TEST\", \"TST\") {}\n\n function mint(address to, uint256 value) public {\n _mint(to, value);\n }\n}\n" + }, + "contracts/test-libraries/utils/TestLib_BytesUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Library Imports */\nimport { Lib_BytesUtils } from \"../../libraries/utils/Lib_BytesUtils.sol\";\nimport { TestERC20 } from \"../../test-helpers/TestERC20.sol\";\n\n/**\n * @title TestLib_BytesUtils\n */\ncontract TestLib_BytesUtils {\n function concat(bytes memory _preBytes, bytes memory _postBytes)\n public\n pure\n returns (bytes memory)\n {\n return abi.encodePacked(_preBytes, _postBytes);\n }\n\n function slice(\n bytes memory _bytes,\n uint256 _start,\n uint256 _length\n ) public pure returns (bytes memory) {\n return Lib_BytesUtils.slice(_bytes, _start, _length);\n }\n\n function toBytes32(bytes memory _bytes) public pure returns (bytes32) {\n return Lib_BytesUtils.toBytes32(_bytes);\n }\n\n function toUint256(bytes memory _bytes) public pure returns (uint256) {\n return Lib_BytesUtils.toUint256(_bytes);\n }\n\n function toNibbles(bytes memory _bytes) public pure returns (bytes memory) {\n return Lib_BytesUtils.toNibbles(_bytes);\n }\n\n function fromNibbles(bytes memory _bytes) public pure returns (bytes memory) {\n return Lib_BytesUtils.fromNibbles(_bytes);\n }\n\n function equal(bytes memory _bytes, bytes memory _other) public pure returns (bool) {\n return Lib_BytesUtils.equal(_bytes, _other);\n }\n\n function sliceWithTaintedMemory(\n bytes memory _bytes,\n uint256 _start,\n uint256 _length\n ) public returns (bytes memory) {\n new TestERC20();\n return Lib_BytesUtils.slice(_bytes, _start, _length);\n }\n}\n" + }, + "contracts/test-libraries/trie/TestLib_MerkleTrie.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Library Imports */\nimport { Lib_MerkleTrie } from \"../../libraries/trie/Lib_MerkleTrie.sol\";\n\n/**\n * @title TestLib_MerkleTrie\n */\ncontract TestLib_MerkleTrie {\n function verifyInclusionProof(\n bytes memory _key,\n bytes memory _value,\n bytes memory _proof,\n bytes32 _root\n ) public pure returns (bool) {\n return Lib_MerkleTrie.verifyInclusionProof(_key, _value, _proof, _root);\n }\n\n function get(\n bytes memory _key,\n bytes memory _proof,\n bytes32 _root\n ) public pure returns (bool, bytes memory) {\n return Lib_MerkleTrie.get(_key, _proof, _root);\n }\n}\n" + }, + "contracts/test-libraries/rlp/TestLib_RLPWriter.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Library Imports */\nimport { Lib_RLPWriter } from \"../../libraries/rlp/Lib_RLPWriter.sol\";\nimport { TestERC20 } from \"../../test-helpers/TestERC20.sol\";\n\n/**\n * @title TestLib_RLPWriter\n */\ncontract TestLib_RLPWriter {\n function writeBytes(bytes memory _in) public pure returns (bytes memory _out) {\n return Lib_RLPWriter.writeBytes(_in);\n }\n\n function writeList(bytes[] memory _in) public pure returns (bytes memory _out) {\n return Lib_RLPWriter.writeList(_in);\n }\n\n function writeString(string memory _in) public pure returns (bytes memory _out) {\n return Lib_RLPWriter.writeString(_in);\n }\n\n function writeAddress(address _in) public pure returns (bytes memory _out) {\n return Lib_RLPWriter.writeAddress(_in);\n }\n\n function writeUint(uint256 _in) public pure returns (bytes memory _out) {\n return Lib_RLPWriter.writeUint(_in);\n }\n\n function writeBool(bool _in) public pure returns (bytes memory _out) {\n return Lib_RLPWriter.writeBool(_in);\n }\n\n function writeAddressWithTaintedMemory(address _in) public returns (bytes memory _out) {\n new TestERC20();\n return Lib_RLPWriter.writeAddress(_in);\n }\n}\n" + }, + "contracts/test-libraries/rlp/TestLib_RLPReader.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Library Imports */\nimport { Lib_RLPReader } from \"../../libraries/rlp/Lib_RLPReader.sol\";\n\n/**\n * @title TestLib_RLPReader\n */\ncontract TestLib_RLPReader {\n function readList(bytes memory _in) public pure returns (bytes[] memory) {\n Lib_RLPReader.RLPItem[] memory decoded = Lib_RLPReader.readList(_in);\n bytes[] memory out = new bytes[](decoded.length);\n for (uint256 i = 0; i < out.length; i++) {\n out[i] = Lib_RLPReader.readRawBytes(decoded[i]);\n }\n return out;\n }\n\n function readString(bytes memory _in) public pure returns (string memory) {\n return Lib_RLPReader.readString(_in);\n }\n\n function readBytes(bytes memory _in) public pure returns (bytes memory) {\n return Lib_RLPReader.readBytes(_in);\n }\n\n function readBytes32(bytes memory _in) public pure returns (bytes32) {\n return Lib_RLPReader.readBytes32(_in);\n }\n\n function readUint256(bytes memory _in) public pure returns (uint256) {\n return Lib_RLPReader.readUint256(_in);\n }\n\n function readBool(bytes memory _in) public pure returns (bool) {\n return Lib_RLPReader.readBool(_in);\n }\n\n function readAddress(bytes memory _in) public pure returns (address) {\n return Lib_RLPReader.readAddress(_in);\n }\n}\n" + }, + "contracts/test-libraries/trie/TestLib_SecureMerkleTrie.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Library Imports */\nimport { Lib_SecureMerkleTrie } from \"../../libraries/trie/Lib_SecureMerkleTrie.sol\";\n\n/**\n * @title TestLib_SecureMerkleTrie\n */\ncontract TestLib_SecureMerkleTrie {\n function verifyInclusionProof(\n bytes memory _key,\n bytes memory _value,\n bytes memory _proof,\n bytes32 _root\n ) public pure returns (bool) {\n return Lib_SecureMerkleTrie.verifyInclusionProof(_key, _value, _proof, _root);\n }\n\n function get(\n bytes memory _key,\n bytes memory _proof,\n bytes32 _root\n ) public pure returns (bool, bytes memory) {\n return Lib_SecureMerkleTrie.get(_key, _proof, _root);\n }\n}\n" + }, + "contracts/L2/teleportr/TeleportrDisburser.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.9;\n\nimport { Ownable } from \"@openzeppelin/contracts/access/Ownable.sol\";\n\n/**\n * @title TeleportrDisburser\n */\ncontract TeleportrDisburser is Ownable {\n /**\n * @notice A struct holding the address and amount to disbursement.\n */\n struct Disbursement {\n uint256 amount;\n address addr;\n }\n\n /// The total number of disbursements processed.\n uint256 public totalDisbursements;\n\n /**\n * @notice Emitted any time the balance is withdrawn by the owner.\n * @param owner The current owner and recipient of the funds.\n * @param balance The current contract balance paid to the owner.\n */\n event BalanceWithdrawn(address indexed owner, uint256 balance);\n\n /**\n * @notice Emitted any time a disbursement is successfuly sent.\n * @param depositId The unique sequence number identifying the deposit.\n * @param to The recipient of the disbursement.\n * @param amount The amount sent to the recipient.\n */\n event DisbursementSuccess(uint256 indexed depositId, address indexed to, uint256 amount);\n\n /**\n * @notice Emitted any time a disbursement fails to send.\n * @param depositId The unique sequence number identifying the deposit.\n * @param to The intended recipient of the disbursement.\n * @param amount The amount intended to be sent to the recipient.\n */\n event DisbursementFailed(uint256 indexed depositId, address indexed to, uint256 amount);\n\n /**\n * @notice Initializes a new TeleportrDisburser contract.\n */\n constructor() {\n totalDisbursements = 0;\n }\n\n /**\n * @notice Accepts a list of Disbursements and forwards the amount paid to\n * the contract to each recipient. The method reverts if there are zero\n * disbursements, the total amount to forward differs from the amount sent\n * in the transaction, or the _nextDepositId is unexpected. Failed\n * disbursements will not cause the method to revert, but will instead be\n * held by the contract and availabe for the owner to withdraw.\n * @param _nextDepositId The depositId of the first Dispursement.\n * @param _disbursements A list of Disbursements to process.\n */\n function disburse(uint256 _nextDepositId, Disbursement[] calldata _disbursements)\n external\n payable\n onlyOwner\n {\n // Ensure there are disbursements to process.\n uint256 _numDisbursements = _disbursements.length;\n require(_numDisbursements > 0, \"No disbursements\");\n\n // Ensure the _nextDepositId matches our expected value.\n uint256 _depositId = totalDisbursements;\n require(_depositId == _nextDepositId, \"Unexpected next deposit id\");\n unchecked {\n totalDisbursements += _numDisbursements;\n }\n\n // Ensure the amount sent in the transaction is equal to the sum of the\n // disbursements.\n uint256 _totalDisbursed = 0;\n for (uint256 i = 0; i < _numDisbursements; i++) {\n _totalDisbursed += _disbursements[i].amount;\n }\n require(_totalDisbursed == msg.value, \"Disbursement total != amount sent\");\n\n // Process disbursements.\n for (uint256 i = 0; i < _numDisbursements; i++) {\n uint256 _amount = _disbursements[i].amount;\n address _addr = _disbursements[i].addr;\n\n // Deliver the dispursement amount to the receiver. If the\n // disbursement fails, the amount will be kept by the contract\n // rather than reverting to prevent blocking progress on other\n // disbursements.\n\n // slither-disable-next-line calls-loop,reentrancy-events\n (bool success, ) = _addr.call{ value: _amount, gas: 2300 }(\"\");\n if (success) emit DisbursementSuccess(_depositId, _addr, _amount);\n else emit DisbursementFailed(_depositId, _addr, _amount);\n\n unchecked {\n _depositId += 1;\n }\n }\n }\n\n /**\n * @notice Sends the contract's current balance to the owner.\n */\n function withdrawBalance() external onlyOwner {\n address _owner = owner();\n uint256 balance = address(this).balance;\n emit BalanceWithdrawn(_owner, balance);\n payable(_owner).transfer(balance);\n }\n}\n" + }, + "contracts/L2/predeploys/OVM_GasPriceOracle.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* External Imports */\nimport { Ownable } from \"@openzeppelin/contracts/access/Ownable.sol\";\n\n/**\n * @title OVM_GasPriceOracle\n * @dev This contract exposes the current l2 gas price, a measure of how congested the network\n * currently is. This measure is used by the Sequencer to determine what fee to charge for\n * transactions. When the system is more congested, the l2 gas price will increase and fees\n * will also increase as a result.\n *\n * All public variables are set while generating the initial L2 state. The\n * constructor doesn't run in practice as the L2 state generation script uses\n * the deployed bytecode instead of running the initcode.\n */\ncontract OVM_GasPriceOracle is Ownable {\n /*************\n * Variables *\n *************/\n\n // Current L2 gas price\n uint256 public gasPrice;\n // Current L1 base fee\n uint256 public l1BaseFee;\n // Amortized cost of batch submission per transaction\n uint256 public overhead;\n // Value to scale the fee up by\n uint256 public scalar;\n // Number of decimals of the scalar\n uint256 public decimals;\n\n /***************\n * Constructor *\n ***************/\n\n /**\n * @param _owner Address that will initially own this contract.\n */\n constructor(address _owner) Ownable() {\n transferOwnership(_owner);\n }\n\n /**********\n * Events *\n **********/\n\n event GasPriceUpdated(uint256);\n event L1BaseFeeUpdated(uint256);\n event OverheadUpdated(uint256);\n event ScalarUpdated(uint256);\n event DecimalsUpdated(uint256);\n\n /********************\n * Public Functions *\n ********************/\n\n /**\n * Allows the owner to modify the l2 gas price.\n * @param _gasPrice New l2 gas price.\n */\n // slither-disable-next-line external-function\n function setGasPrice(uint256 _gasPrice) public onlyOwner {\n gasPrice = _gasPrice;\n emit GasPriceUpdated(_gasPrice);\n }\n\n /**\n * Allows the owner to modify the l1 base fee.\n * @param _baseFee New l1 base fee\n */\n // slither-disable-next-line external-function\n function setL1BaseFee(uint256 _baseFee) public onlyOwner {\n l1BaseFee = _baseFee;\n emit L1BaseFeeUpdated(_baseFee);\n }\n\n /**\n * Allows the owner to modify the overhead.\n * @param _overhead New overhead\n */\n // slither-disable-next-line external-function\n function setOverhead(uint256 _overhead) public onlyOwner {\n overhead = _overhead;\n emit OverheadUpdated(_overhead);\n }\n\n /**\n * Allows the owner to modify the scalar.\n * @param _scalar New scalar\n */\n // slither-disable-next-line external-function\n function setScalar(uint256 _scalar) public onlyOwner {\n scalar = _scalar;\n emit ScalarUpdated(_scalar);\n }\n\n /**\n * Allows the owner to modify the decimals.\n * @param _decimals New decimals\n */\n // slither-disable-next-line external-function\n function setDecimals(uint256 _decimals) public onlyOwner {\n decimals = _decimals;\n emit DecimalsUpdated(_decimals);\n }\n\n /**\n * Computes the L1 portion of the fee\n * based on the size of the RLP encoded tx\n * and the current l1BaseFee\n * @param _data Unsigned RLP encoded tx, 6 elements\n * @return L1 fee that should be paid for the tx\n */\n // slither-disable-next-line external-function\n function getL1Fee(bytes memory _data) public view returns (uint256) {\n uint256 l1GasUsed = getL1GasUsed(_data);\n uint256 l1Fee = l1GasUsed * l1BaseFee;\n uint256 divisor = 10**decimals;\n uint256 unscaled = l1Fee * scalar;\n uint256 scaled = unscaled / divisor;\n return scaled;\n }\n\n // solhint-disable max-line-length\n /**\n * Computes the amount of L1 gas used for a transaction\n * The overhead represents the per batch gas overhead of\n * posting both transaction and state roots to L1 given larger\n * batch sizes.\n * 4 gas for 0 byte\n * https://github.com/ethereum/go-ethereum/blob/9ada4a2e2c415e6b0b51c50e901336872e028872/params/protocol_params.go#L33\n * 16 gas for non zero byte\n * https://github.com/ethereum/go-ethereum/blob/9ada4a2e2c415e6b0b51c50e901336872e028872/params/protocol_params.go#L87\n * This will need to be updated if calldata gas prices change\n * Account for the transaction being unsigned\n * Padding is added to account for lack of signature on transaction\n * 1 byte for RLP V prefix\n * 1 byte for V\n * 1 byte for RLP R prefix\n * 32 bytes for R\n * 1 byte for RLP S prefix\n * 32 bytes for S\n * Total: 68 bytes of padding\n * @param _data Unsigned RLP encoded tx, 6 elements\n * @return Amount of L1 gas used for a transaction\n */\n // solhint-enable max-line-length\n function getL1GasUsed(bytes memory _data) public view returns (uint256) {\n uint256 total = 0;\n for (uint256 i = 0; i < _data.length; i++) {\n if (_data[i] == 0) {\n total += 4;\n } else {\n total += 16;\n }\n }\n uint256 unsigned = total + overhead;\n return unsigned + (68 * 16);\n }\n}\n" + }, + "contracts/L1/teleportr/TeleportrDeposit.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.9;\n\nimport { Ownable } from \"@openzeppelin/contracts/access/Ownable.sol\";\n\n/**\n * @title TeleportrDeposit\n *\n * Shout out to 0xclem for providing the inspiration for this contract:\n * https://github.com/0xclem/teleportr/blob/main/contracts/BridgeDeposit.sol\n */\ncontract TeleportrDeposit is Ownable {\n /// The minimum amount that be deposited in a receive.\n uint256 public minDepositAmount;\n /// The maximum amount that be deposited in a receive.\n uint256 public maxDepositAmount;\n /// The maximum balance the contract can hold after a receive.\n uint256 public maxBalance;\n /// The total number of successful deposits received.\n uint256 public totalDeposits;\n\n /**\n * @notice Emitted any time the minimum deposit amount is set.\n * @param previousAmount The previous minimum deposit amount.\n * @param newAmount The new minimum deposit amount.\n */\n event MinDepositAmountSet(uint256 previousAmount, uint256 newAmount);\n\n /**\n * @notice Emitted any time the maximum deposit amount is set.\n * @param previousAmount The previous maximum deposit amount.\n * @param newAmount The new maximum deposit amount.\n */\n event MaxDepositAmountSet(uint256 previousAmount, uint256 newAmount);\n\n /**\n * @notice Emitted any time the contract maximum balance is set.\n * @param previousBalance The previous maximum contract balance.\n * @param newBalance The new maximum contract balance.\n */\n event MaxBalanceSet(uint256 previousBalance, uint256 newBalance);\n\n /**\n * @notice Emitted any time the balance is withdrawn by the owner.\n * @param owner The current owner and recipient of the funds.\n * @param balance The current contract balance paid to the owner.\n */\n event BalanceWithdrawn(address indexed owner, uint256 balance);\n\n /**\n * @notice Emitted any time a successful deposit is received.\n * @param depositId A unique sequencer number identifying the deposit.\n * @param emitter The sending address of the payer.\n * @param amount The amount deposited by the payer.\n */\n event EtherReceived(uint256 indexed depositId, address indexed emitter, uint256 indexed amount);\n\n /**\n * @notice Initializes a new TeleportrDeposit contract.\n * @param _minDepositAmount The initial minimum deposit amount.\n * @param _maxDepositAmount The initial maximum deposit amount.\n * @param _maxBalance The initial maximum contract balance.\n */\n constructor(\n uint256 _minDepositAmount,\n uint256 _maxDepositAmount,\n uint256 _maxBalance\n ) {\n minDepositAmount = _minDepositAmount;\n maxDepositAmount = _maxDepositAmount;\n maxBalance = _maxBalance;\n totalDeposits = 0;\n emit MinDepositAmountSet(0, _minDepositAmount);\n emit MaxDepositAmountSet(0, _maxDepositAmount);\n emit MaxBalanceSet(0, _maxBalance);\n }\n\n /**\n * @notice Accepts deposits that will be disbursed to the sender's address on L2.\n * The method reverts if the amount is less than the current\n * minDepositAmount, the amount is greater than the current\n * maxDepositAmount, or the amount causes the contract to exceed its maximum\n * allowed balance.\n */\n receive() external payable {\n require(msg.value >= minDepositAmount, \"Deposit amount is too small\");\n require(msg.value <= maxDepositAmount, \"Deposit amount is too big\");\n require(address(this).balance <= maxBalance, \"Contract max balance exceeded\");\n\n emit EtherReceived(totalDeposits, msg.sender, msg.value);\n unchecked {\n totalDeposits += 1;\n }\n }\n\n /**\n * @notice Sends the contract's current balance to the owner.\n */\n function withdrawBalance() external onlyOwner {\n address _owner = owner();\n uint256 _balance = address(this).balance;\n emit BalanceWithdrawn(_owner, _balance);\n payable(_owner).transfer(_balance);\n }\n\n /**\n * @notice Sets the minimum amount that can be deposited in a receive.\n * @param _minDepositAmount The new minimum deposit amount.\n */\n function setMinAmount(uint256 _minDepositAmount) external onlyOwner {\n emit MinDepositAmountSet(minDepositAmount, _minDepositAmount);\n minDepositAmount = _minDepositAmount;\n }\n\n /**\n * @notice Sets the maximum amount that can be deposited in a receive.\n * @param _maxDepositAmount The new maximum deposit amount.\n */\n function setMaxAmount(uint256 _maxDepositAmount) external onlyOwner {\n emit MaxDepositAmountSet(maxDepositAmount, _maxDepositAmount);\n maxDepositAmount = _maxDepositAmount;\n }\n\n /**\n * @notice Sets the maximum balance the contract can hold after a receive.\n * @param _maxBalance The new maximum contract balance.\n */\n function setMaxBalance(uint256 _maxBalance) external onlyOwner {\n emit MaxBalanceSet(maxBalance, _maxBalance);\n maxBalance = _maxBalance;\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\nimport \"../../../utils/Address.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using Address for address;\n\n function safeTransfer(\n IERC20 token,\n address to,\n uint256 value\n ) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n }\n\n function safeTransferFrom(\n IERC20 token,\n address from,\n address to,\n uint256 value\n ) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n }\n\n /**\n * @dev Deprecated. This function has issues similar to the ones found in\n * {IERC20-approve}, and its usage is discouraged.\n *\n * Whenever possible, use {safeIncreaseAllowance} and\n * {safeDecreaseAllowance} instead.\n */\n function safeApprove(\n IERC20 token,\n address spender,\n uint256 value\n ) internal {\n // safeApprove should only be called when setting an initial allowance,\n // or when resetting it to zero. To increase and decrease it, use\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\n require(\n (value == 0) || (token.allowance(address(this), spender) == 0),\n \"SafeERC20: approve from non-zero to non-zero allowance\"\n );\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n }\n\n function safeIncreaseAllowance(\n IERC20 token,\n address spender,\n uint256 value\n ) internal {\n uint256 newAllowance = token.allowance(address(this), spender) + value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n function safeDecreaseAllowance(\n IERC20 token,\n address spender,\n uint256 value\n ) internal {\n unchecked {\n uint256 oldAllowance = token.allowance(address(this), spender);\n require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n uint256 newAllowance = oldAllowance - value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\n if (returndata.length > 0) {\n // Return data is optional\n require(abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize, which returns 0 for contracts in\n // construction, since the code is only stored at the end of the\n // constructor execution.\n\n uint256 size;\n assembly {\n size := extcodesize(account)\n }\n return size > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n require(isContract(target), \"Address: call to non-contract\");\n\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(isContract(target), \"Address: delegate call to non-contract\");\n\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" + }, + "contracts/L1/messaging/L1StandardBridge.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Interface Imports */\nimport { IL1StandardBridge } from \"./IL1StandardBridge.sol\";\nimport { IL1ERC20Bridge } from \"./IL1ERC20Bridge.sol\";\nimport { IL2ERC20Bridge } from \"../../L2/messaging/IL2ERC20Bridge.sol\";\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\n/* Library Imports */\nimport { CrossDomainEnabled } from \"../../libraries/bridge/CrossDomainEnabled.sol\";\nimport { Lib_PredeployAddresses } from \"../../libraries/constants/Lib_PredeployAddresses.sol\";\nimport { Address } from \"@openzeppelin/contracts/utils/Address.sol\";\nimport { SafeERC20 } from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\n\n/**\n * @title L1StandardBridge\n * @dev The L1 ETH and ERC20 Bridge is a contract which stores deposited L1 funds and standard\n * tokens that are in use on L2. It synchronizes a corresponding L2 Bridge, informing it of deposits\n * and listening to it for newly finalized withdrawals.\n *\n */\ncontract L1StandardBridge is IL1StandardBridge, CrossDomainEnabled {\n using SafeERC20 for IERC20;\n\n /********************************\n * External Contract References *\n ********************************/\n\n address public l2TokenBridge;\n\n // Maps L1 token to L2 token to balance of the L1 token deposited\n mapping(address => mapping(address => uint256)) public deposits;\n\n /***************\n * Constructor *\n ***************/\n\n // This contract lives behind a proxy, so the constructor parameters will go unused.\n constructor() CrossDomainEnabled(address(0)) {}\n\n /******************\n * Initialization *\n ******************/\n\n /**\n * @param _l1messenger L1 Messenger address being used for cross-chain communications.\n * @param _l2TokenBridge L2 standard bridge address.\n */\n // slither-disable-next-line external-function\n function initialize(address _l1messenger, address _l2TokenBridge) public {\n require(messenger == address(0), \"Contract has already been initialized.\");\n messenger = _l1messenger;\n l2TokenBridge = _l2TokenBridge;\n }\n\n /**************\n * Depositing *\n **************/\n\n /** @dev Modifier requiring sender to be EOA. This check could be bypassed by a malicious\n * contract via initcode, but it takes care of the user error we want to avoid.\n */\n modifier onlyEOA() {\n // Used to stop deposits from contracts (avoid accidentally lost tokens)\n require(!Address.isContract(msg.sender), \"Account not EOA\");\n _;\n }\n\n /**\n * @dev This function can be called with no data\n * to deposit an amount of ETH to the caller's balance on L2.\n * Since the receive function doesn't take data, a conservative\n * default amount is forwarded to L2.\n */\n receive() external payable onlyEOA {\n _initiateETHDeposit(msg.sender, msg.sender, 200_000, bytes(\"\"));\n }\n\n /**\n * @inheritdoc IL1StandardBridge\n */\n function depositETH(uint32 _l2Gas, bytes calldata _data) external payable onlyEOA {\n _initiateETHDeposit(msg.sender, msg.sender, _l2Gas, _data);\n }\n\n /**\n * @inheritdoc IL1StandardBridge\n */\n function depositETHTo(\n address _to,\n uint32 _l2Gas,\n bytes calldata _data\n ) external payable {\n _initiateETHDeposit(msg.sender, _to, _l2Gas, _data);\n }\n\n /**\n * @dev Performs the logic for deposits by storing the ETH and informing the L2 ETH Gateway of\n * the deposit.\n * @param _from Account to pull the deposit from on L1.\n * @param _to Account to give the deposit to on L2.\n * @param _l2Gas Gas limit required to complete the deposit on L2.\n * @param _data Optional data to forward to L2. This data is provided\n * solely as a convenience for external contracts. Aside from enforcing a maximum\n * length, these contracts provide no guarantees about its content.\n */\n function _initiateETHDeposit(\n address _from,\n address _to,\n uint32 _l2Gas,\n bytes memory _data\n ) internal {\n // Construct calldata for finalizeDeposit call\n bytes memory message = abi.encodeWithSelector(\n IL2ERC20Bridge.finalizeDeposit.selector,\n address(0),\n Lib_PredeployAddresses.OVM_ETH,\n _from,\n _to,\n msg.value,\n _data\n );\n\n // Send calldata into L2\n // slither-disable-next-line reentrancy-events\n sendCrossDomainMessage(l2TokenBridge, _l2Gas, message);\n\n // slither-disable-next-line reentrancy-events\n emit ETHDepositInitiated(_from, _to, msg.value, _data);\n }\n\n /**\n * @inheritdoc IL1ERC20Bridge\n */\n function depositERC20(\n address _l1Token,\n address _l2Token,\n uint256 _amount,\n uint32 _l2Gas,\n bytes calldata _data\n ) external virtual onlyEOA {\n _initiateERC20Deposit(_l1Token, _l2Token, msg.sender, msg.sender, _amount, _l2Gas, _data);\n }\n\n /**\n * @inheritdoc IL1ERC20Bridge\n */\n function depositERC20To(\n address _l1Token,\n address _l2Token,\n address _to,\n uint256 _amount,\n uint32 _l2Gas,\n bytes calldata _data\n ) external virtual {\n _initiateERC20Deposit(_l1Token, _l2Token, msg.sender, _to, _amount, _l2Gas, _data);\n }\n\n /**\n * @dev Performs the logic for deposits by informing the L2 Deposited Token\n * contract of the deposit and calling a handler to lock the L1 funds. (e.g. transferFrom)\n *\n * @param _l1Token Address of the L1 ERC20 we are depositing\n * @param _l2Token Address of the L1 respective L2 ERC20\n * @param _from Account to pull the deposit from on L1\n * @param _to Account to give the deposit to on L2\n * @param _amount Amount of the ERC20 to deposit.\n * @param _l2Gas Gas limit required to complete the deposit on L2.\n * @param _data Optional data to forward to L2. This data is provided\n * solely as a convenience for external contracts. Aside from enforcing a maximum\n * length, these contracts provide no guarantees about its content.\n */\n function _initiateERC20Deposit(\n address _l1Token,\n address _l2Token,\n address _from,\n address _to,\n uint256 _amount,\n uint32 _l2Gas,\n bytes calldata _data\n ) internal {\n // When a deposit is initiated on L1, the L1 Bridge transfers the funds to itself for future\n // withdrawals. The use of safeTransferFrom enables support of \"broken tokens\" which do not\n // return a boolean value.\n // slither-disable-next-line reentrancy-events, reentrancy-benign\n IERC20(_l1Token).safeTransferFrom(_from, address(this), _amount);\n\n // Construct calldata for _l2Token.finalizeDeposit(_to, _amount)\n bytes memory message = abi.encodeWithSelector(\n IL2ERC20Bridge.finalizeDeposit.selector,\n _l1Token,\n _l2Token,\n _from,\n _to,\n _amount,\n _data\n );\n\n // Send calldata into L2\n // slither-disable-next-line reentrancy-events, reentrancy-benign\n sendCrossDomainMessage(l2TokenBridge, _l2Gas, message);\n\n // slither-disable-next-line reentrancy-benign\n deposits[_l1Token][_l2Token] = deposits[_l1Token][_l2Token] + _amount;\n\n // slither-disable-next-line reentrancy-events\n emit ERC20DepositInitiated(_l1Token, _l2Token, _from, _to, _amount, _data);\n }\n\n /*************************\n * Cross-chain Functions *\n *************************/\n\n /**\n * @inheritdoc IL1StandardBridge\n */\n function finalizeETHWithdrawal(\n address _from,\n address _to,\n uint256 _amount,\n bytes calldata _data\n ) external onlyFromCrossDomainAccount(l2TokenBridge) {\n // slither-disable-next-line reentrancy-events\n (bool success, ) = _to.call{ value: _amount }(new bytes(0));\n require(success, \"TransferHelper::safeTransferETH: ETH transfer failed\");\n\n // slither-disable-next-line reentrancy-events\n emit ETHWithdrawalFinalized(_from, _to, _amount, _data);\n }\n\n /**\n * @inheritdoc IL1ERC20Bridge\n */\n function finalizeERC20Withdrawal(\n address _l1Token,\n address _l2Token,\n address _from,\n address _to,\n uint256 _amount,\n bytes calldata _data\n ) external onlyFromCrossDomainAccount(l2TokenBridge) {\n deposits[_l1Token][_l2Token] = deposits[_l1Token][_l2Token] - _amount;\n\n // When a withdrawal is finalized on L1, the L1 Bridge transfers the funds to the withdrawer\n // slither-disable-next-line reentrancy-events\n IERC20(_l1Token).safeTransfer(_to, _amount);\n\n // slither-disable-next-line reentrancy-events\n emit ERC20WithdrawalFinalized(_l1Token, _l2Token, _from, _to, _amount, _data);\n }\n\n /*****************************\n * Temporary - Migrating ETH *\n *****************************/\n\n /**\n * @dev Adds ETH balance to the account. This is meant to allow for ETH\n * to be migrated from an old gateway to a new gateway.\n * NOTE: This is left for one upgrade only so we are able to receive the migrated ETH from the\n * old contract\n */\n function donateETH() external payable {}\n}\n" + }, + "contracts/L2/messaging/L2StandardTokenFactory.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Contract Imports */\nimport { L2StandardERC20 } from \"../../standards/L2StandardERC20.sol\";\nimport { Lib_PredeployAddresses } from \"../../libraries/constants/Lib_PredeployAddresses.sol\";\n\n/**\n * @title L2StandardTokenFactory\n * @dev Factory contract for creating standard L2 token representations of L1 ERC20s\n * compatible with and working on the standard bridge.\n */\ncontract L2StandardTokenFactory {\n event StandardL2TokenCreated(address indexed _l1Token, address indexed _l2Token);\n\n /**\n * @dev Creates an instance of the standard ERC20 token on L2.\n * @param _l1Token Address of the corresponding L1 token.\n * @param _name ERC20 name.\n * @param _symbol ERC20 symbol.\n */\n function createStandardL2Token(\n address _l1Token,\n string memory _name,\n string memory _symbol\n ) external {\n require(_l1Token != address(0), \"Must provide L1 token address\");\n\n L2StandardERC20 l2Token = new L2StandardERC20(\n Lib_PredeployAddresses.L2_STANDARD_BRIDGE,\n _l1Token,\n _name,\n _symbol\n );\n\n emit StandardL2TokenCreated(_l1Token, address(l2Token));\n }\n}\n" + }, + "contracts/test-libraries/bridge/TestLib_CrossDomainUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Library Imports */\nimport { Lib_CrossDomainUtils } from \"../../libraries/bridge/Lib_CrossDomainUtils.sol\";\n\n/**\n * @title TestLib_CrossDomainUtils\n */\nlibrary TestLib_CrossDomainUtils {\n function encodeXDomainCalldata(\n address _target,\n address _sender,\n bytes memory _message,\n uint256 _messageNonce\n ) public pure returns (bytes memory) {\n return\n Lib_CrossDomainUtils.encodeXDomainCalldata(_target, _sender, _message, _messageNonce);\n }\n}\n" + }, + "contracts/test-libraries/standards/TestLib_AddressAliasHelper.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.8;\n\n/* Library Imports */\nimport { AddressAliasHelper } from \"../../standards/AddressAliasHelper.sol\";\n\n/**\n * @title TestLib_AddressAliasHelper\n */\ncontract TestLib_AddressAliasHelper {\n function applyL1ToL2Alias(address _address) public pure returns (address) {\n return AddressAliasHelper.applyL1ToL2Alias(_address);\n }\n\n function undoL1ToL2Alias(address _address) public pure returns (address) {\n return AddressAliasHelper.undoL1ToL2Alias(_address);\n }\n}\n" + }, + "contracts/test-libraries/utils/TestLib_Bytes32Utils.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Library Imports */\nimport { Lib_Bytes32Utils } from \"../../libraries/utils/Lib_Bytes32Utils.sol\";\n\n/**\n * @title TestLib_Byte32Utils\n */\ncontract TestLib_Bytes32Utils {\n function toBool(bytes32 _in) public pure returns (bool _out) {\n return Lib_Bytes32Utils.toBool(_in);\n }\n\n function fromBool(bool _in) public pure returns (bytes32 _out) {\n return Lib_Bytes32Utils.fromBool(_in);\n }\n\n function toAddress(bytes32 _in) public pure returns (address _out) {\n return Lib_Bytes32Utils.toAddress(_in);\n }\n\n function fromAddress(address _in) public pure returns (bytes32 _out) {\n return Lib_Bytes32Utils.fromAddress(_in);\n }\n}\n" + }, + "contracts/test-libraries/utils/TestLib_MerkleTree.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Library Imports */\nimport { Lib_MerkleTree } from \"../../libraries/utils/Lib_MerkleTree.sol\";\n\n/**\n * @title TestLib_MerkleTree\n */\ncontract TestLib_MerkleTree {\n function getMerkleRoot(bytes32[] memory _elements) public pure returns (bytes32) {\n return Lib_MerkleTree.getMerkleRoot(_elements);\n }\n\n function verify(\n bytes32 _root,\n bytes32 _leaf,\n uint256 _index,\n bytes32[] memory _siblings,\n uint256 _totalLeaves\n ) public pure returns (bool) {\n return Lib_MerkleTree.verify(_root, _leaf, _index, _siblings, _totalLeaves);\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 10000 + }, + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates", + "devdoc", + "userdoc", + "devdoc", + "userdoc" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/packages/contracts/deployments/goerli/solcInputs/96c709f6604e7bd8a94077f137b56cbc.json b/packages/contracts/deployments/goerli/solcInputs/96c709f6604e7bd8a94077f137b56cbc.json new file mode 100644 index 0000000000000..489c7b4802454 --- /dev/null +++ b/packages/contracts/deployments/goerli/solcInputs/96c709f6604e7bd8a94077f137b56cbc.json @@ -0,0 +1,256 @@ +{ + "language": "Solidity", + "sources": { + "contracts/L1/deployment/AddressDictator.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\nimport { Lib_AddressManager } from \"../../libraries/resolver/Lib_AddressManager.sol\";\n\n/**\n * @title AddressDictator\n * @dev The AddressDictator (glory to Arstotzka) is a contract that allows us to safely manipulate\n * many different addresses in the AddressManager without transferring ownership of the\n * AddressManager to a hot wallet or hardware wallet.\n */\ncontract AddressDictator {\n /*********\n * Types *\n *********/\n\n struct NamedAddress {\n string name;\n address addr;\n }\n\n /*************\n * Variables *\n *************/\n\n Lib_AddressManager public manager;\n address public finalOwner;\n NamedAddress[] namedAddresses;\n\n /***************\n * Constructor *\n ***************/\n\n /**\n * @param _manager Address of the AddressManager contract.\n * @param _finalOwner Address to transfer AddressManager ownership to afterwards.\n * @param _names Array of names to associate an address with.\n * @param _addresses Array of addresses to associate with the name.\n */\n constructor(\n Lib_AddressManager _manager,\n address _finalOwner,\n string[] memory _names,\n address[] memory _addresses\n ) {\n manager = _manager;\n finalOwner = _finalOwner;\n require(\n _names.length == _addresses.length,\n \"AddressDictator: Must provide an equal number of names and addresses.\"\n );\n for (uint256 i = 0; i < _names.length; i++) {\n namedAddresses.push(NamedAddress({ name: _names[i], addr: _addresses[i] }));\n }\n }\n\n /********************\n * Public Functions *\n ********************/\n\n /**\n * Called to finalize the transfer, this function is callable by anyone, but will only result in\n * an upgrade if this contract is the owner Address Manager.\n */\n // slither-disable-next-line calls-loop\n function setAddresses() external {\n for (uint256 i = 0; i < namedAddresses.length; i++) {\n manager.setAddress(namedAddresses[i].name, namedAddresses[i].addr);\n }\n // note that this will revert if _finalOwner == currentOwner\n manager.transferOwnership(finalOwner);\n }\n\n /**\n * Transfers ownership of this contract to the finalOwner.\n * Only callable by the Final Owner, which is intended to be our multisig.\n * This function shouldn't be necessary, but it gives a sense of reassurance that we can recover\n * if something really surprising goes wrong.\n */\n function returnOwnership() external {\n require(msg.sender == finalOwner, \"AddressDictator: only callable by finalOwner\");\n manager.transferOwnership(finalOwner);\n }\n\n /******************\n * View Functions *\n ******************/\n\n /**\n * Returns the full namedAddresses array.\n */\n function getNamedAddresses() external view returns (NamedAddress[] memory) {\n return namedAddresses;\n }\n}\n" + }, + "contracts/libraries/resolver/Lib_AddressManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* External Imports */\nimport { Ownable } from \"@openzeppelin/contracts/access/Ownable.sol\";\n\n/**\n * @title Lib_AddressManager\n */\ncontract Lib_AddressManager is Ownable {\n /**********\n * Events *\n **********/\n\n event AddressSet(string indexed _name, address _newAddress, address _oldAddress);\n\n /*************\n * Variables *\n *************/\n\n mapping(bytes32 => address) private addresses;\n\n /********************\n * Public Functions *\n ********************/\n\n /**\n * Changes the address associated with a particular name.\n * @param _name String name to associate an address with.\n * @param _address Address to associate with the name.\n */\n function setAddress(string memory _name, address _address) external onlyOwner {\n bytes32 nameHash = _getNameHash(_name);\n address oldAddress = addresses[nameHash];\n addresses[nameHash] = _address;\n\n emit AddressSet(_name, _address, oldAddress);\n }\n\n /**\n * Retrieves the address associated with a given name.\n * @param _name Name to retrieve an address for.\n * @return Address associated with the given name.\n */\n function getAddress(string memory _name) external view returns (address) {\n return addresses[_getNameHash(_name)];\n }\n\n /**********************\n * Internal Functions *\n **********************/\n\n /**\n * Computes the hash of a name.\n * @param _name Name to compute a hash for.\n * @return Hash of the given name.\n */\n function _getNameHash(string memory _name) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(_name));\n }\n}\n" + }, + "@openzeppelin/contracts/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _setOwner(_msgSender());\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _setOwner(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _setOwner(newOwner);\n }\n\n function _setOwner(address newOwner) private {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" + }, + "contracts/libraries/resolver/Lib_ResolvedDelegateProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Library Imports */\nimport { Lib_AddressManager } from \"./Lib_AddressManager.sol\";\n\n/**\n * @title Lib_ResolvedDelegateProxy\n */\ncontract Lib_ResolvedDelegateProxy {\n /*************\n * Variables *\n *************/\n\n // Using mappings to store fields to avoid overwriting storage slots in the\n // implementation contract. For example, instead of storing these fields at\n // storage slot `0` & `1`, they are stored at `keccak256(key + slot)`.\n // See: https://solidity.readthedocs.io/en/v0.7.0/internals/layout_in_storage.html\n // NOTE: Do not use this code in your own contract system.\n // There is a known flaw in this contract, and we will remove it from the repository\n // in the near future. Due to the very limited way that we are using it, this flaw is\n // not an issue in our system.\n mapping(address => string) private implementationName;\n mapping(address => Lib_AddressManager) private addressManager;\n\n /***************\n * Constructor *\n ***************/\n\n /**\n * @param _libAddressManager Address of the Lib_AddressManager.\n * @param _implementationName implementationName of the contract to proxy to.\n */\n constructor(address _libAddressManager, string memory _implementationName) {\n addressManager[address(this)] = Lib_AddressManager(_libAddressManager);\n implementationName[address(this)] = _implementationName;\n }\n\n /*********************\n * Fallback Function *\n *********************/\n\n fallback() external payable {\n address target = addressManager[address(this)].getAddress(\n (implementationName[address(this)])\n );\n\n require(target != address(0), \"Target address must be initialized.\");\n\n // slither-disable-next-line controlled-delegatecall\n (bool success, bytes memory returndata) = target.delegatecall(msg.data);\n\n if (success == true) {\n assembly {\n return(add(returndata, 0x20), mload(returndata))\n }\n } else {\n assembly {\n revert(add(returndata, 0x20), mload(returndata))\n }\n }\n }\n}\n" + }, + "contracts/libraries/resolver/Lib_AddressResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Library Imports */\nimport { Lib_AddressManager } from \"./Lib_AddressManager.sol\";\n\n/**\n * @title Lib_AddressResolver\n */\nabstract contract Lib_AddressResolver {\n /*************\n * Variables *\n *************/\n\n Lib_AddressManager public libAddressManager;\n\n /***************\n * Constructor *\n ***************/\n\n /**\n * @param _libAddressManager Address of the Lib_AddressManager.\n */\n constructor(address _libAddressManager) {\n libAddressManager = Lib_AddressManager(_libAddressManager);\n }\n\n /********************\n * Public Functions *\n ********************/\n\n /**\n * Resolves the address associated with a given name.\n * @param _name Name to resolve an address for.\n * @return Address associated with the given name.\n */\n function resolve(string memory _name) public view returns (address) {\n return libAddressManager.getAddress(_name);\n }\n}\n" + }, + "contracts/L1/verification/BondManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Interface Imports */\nimport { IBondManager } from \"./IBondManager.sol\";\n\n/* Contract Imports */\nimport { Lib_AddressResolver } from \"../../libraries/resolver/Lib_AddressResolver.sol\";\n\n/**\n * @title BondManager\n * @dev This contract is, for now, a stub of the \"real\" BondManager that does nothing but\n * allow the \"OVM_Proposer\" to submit state root batches.\n *\n */\ncontract BondManager is IBondManager, Lib_AddressResolver {\n /**\n * @param _libAddressManager Address of the Address Manager.\n */\n constructor(address _libAddressManager) Lib_AddressResolver(_libAddressManager) {}\n\n /**\n * Checks whether a given address is properly collateralized and can perform actions within\n * the system.\n * @param _who Address to check.\n * @return true if the address is properly collateralized, false otherwise.\n */\n // slither-disable-next-line external-function\n function isCollateralized(address _who) public view returns (bool) {\n // Only authenticate sequencer to submit state root batches.\n return _who == resolve(\"OVM_Proposer\");\n }\n}\n" + }, + "contracts/L1/verification/IBondManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/**\n * @title IBondManager\n */\ninterface IBondManager {\n /********************\n * Public Functions *\n ********************/\n\n function isCollateralized(address _who) external view returns (bool);\n}\n" + }, + "contracts/L1/rollup/StateCommitmentChain.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Library Imports */\nimport { Lib_OVMCodec } from \"../../libraries/codec/Lib_OVMCodec.sol\";\nimport { Lib_AddressResolver } from \"../../libraries/resolver/Lib_AddressResolver.sol\";\nimport { Lib_MerkleTree } from \"../../libraries/utils/Lib_MerkleTree.sol\";\n\n/* Interface Imports */\nimport { IStateCommitmentChain } from \"./IStateCommitmentChain.sol\";\nimport { ICanonicalTransactionChain } from \"./ICanonicalTransactionChain.sol\";\nimport { IBondManager } from \"../verification/IBondManager.sol\";\nimport { IChainStorageContainer } from \"./IChainStorageContainer.sol\";\n\n/**\n * @title StateCommitmentChain\n * @dev The State Commitment Chain (SCC) contract contains a list of proposed state roots which\n * Proposers assert to be a result of each transaction in the Canonical Transaction Chain (CTC).\n * Elements here have a 1:1 correspondence with transactions in the CTC, and should be the unique\n * state root calculated off-chain by applying the canonical transactions one by one.\n *\n */\ncontract StateCommitmentChain is IStateCommitmentChain, Lib_AddressResolver {\n /*************\n * Constants *\n *************/\n\n uint256 public FRAUD_PROOF_WINDOW;\n uint256 public SEQUENCER_PUBLISH_WINDOW;\n\n /***************\n * Constructor *\n ***************/\n\n /**\n * @param _libAddressManager Address of the Address Manager.\n */\n constructor(\n address _libAddressManager,\n uint256 _fraudProofWindow,\n uint256 _sequencerPublishWindow\n ) Lib_AddressResolver(_libAddressManager) {\n FRAUD_PROOF_WINDOW = _fraudProofWindow;\n SEQUENCER_PUBLISH_WINDOW = _sequencerPublishWindow;\n }\n\n /********************\n * Public Functions *\n ********************/\n\n /**\n * Accesses the batch storage container.\n * @return Reference to the batch storage container.\n */\n function batches() public view returns (IChainStorageContainer) {\n return IChainStorageContainer(resolve(\"ChainStorageContainer-SCC-batches\"));\n }\n\n /**\n * @inheritdoc IStateCommitmentChain\n */\n function getTotalElements() public view returns (uint256 _totalElements) {\n (uint40 totalElements, ) = _getBatchExtraData();\n return uint256(totalElements);\n }\n\n /**\n * @inheritdoc IStateCommitmentChain\n */\n function getTotalBatches() public view returns (uint256 _totalBatches) {\n return batches().length();\n }\n\n /**\n * @inheritdoc IStateCommitmentChain\n */\n // slither-disable-next-line external-function\n function getLastSequencerTimestamp() public view returns (uint256 _lastSequencerTimestamp) {\n (, uint40 lastSequencerTimestamp) = _getBatchExtraData();\n return uint256(lastSequencerTimestamp);\n }\n\n /**\n * @inheritdoc IStateCommitmentChain\n */\n // slither-disable-next-line external-function\n function appendStateBatch(bytes32[] memory _batch, uint256 _shouldStartAtElement) public {\n // Fail fast in to make sure our batch roots aren't accidentally made fraudulent by the\n // publication of batches by some other user.\n require(\n _shouldStartAtElement == getTotalElements(),\n \"Actual batch start index does not match expected start index.\"\n );\n\n // Proposers must have previously staked at the BondManager\n require(\n IBondManager(resolve(\"BondManager\")).isCollateralized(msg.sender),\n \"Proposer does not have enough collateral posted\"\n );\n\n require(_batch.length > 0, \"Cannot submit an empty state batch.\");\n\n require(\n getTotalElements() + _batch.length <=\n ICanonicalTransactionChain(resolve(\"CanonicalTransactionChain\")).getTotalElements(),\n \"Number of state roots cannot exceed the number of canonical transactions.\"\n );\n\n // Pass the block's timestamp and the publisher of the data\n // to be used in the fraud proofs\n _appendBatch(_batch, abi.encode(block.timestamp, msg.sender));\n }\n\n /**\n * @inheritdoc IStateCommitmentChain\n */\n // slither-disable-next-line external-function\n function deleteStateBatch(Lib_OVMCodec.ChainBatchHeader memory _batchHeader) public {\n require(\n msg.sender == resolve(\"OVM_FraudVerifier\"),\n \"State batches can only be deleted by the OVM_FraudVerifier.\"\n );\n\n require(_isValidBatchHeader(_batchHeader), \"Invalid batch header.\");\n\n require(\n insideFraudProofWindow(_batchHeader),\n \"State batches can only be deleted within the fraud proof window.\"\n );\n\n _deleteBatch(_batchHeader);\n }\n\n /**\n * @inheritdoc IStateCommitmentChain\n */\n // slither-disable-next-line external-function\n function verifyStateCommitment(\n bytes32 _element,\n Lib_OVMCodec.ChainBatchHeader memory _batchHeader,\n Lib_OVMCodec.ChainInclusionProof memory _proof\n ) public view returns (bool) {\n require(_isValidBatchHeader(_batchHeader), \"Invalid batch header.\");\n\n require(\n Lib_MerkleTree.verify(\n _batchHeader.batchRoot,\n _element,\n _proof.index,\n _proof.siblings,\n _batchHeader.batchSize\n ),\n \"Invalid inclusion proof.\"\n );\n\n return true;\n }\n\n /**\n * @inheritdoc IStateCommitmentChain\n */\n function insideFraudProofWindow(Lib_OVMCodec.ChainBatchHeader memory _batchHeader)\n public\n view\n returns (bool _inside)\n {\n (uint256 timestamp, ) = abi.decode(_batchHeader.extraData, (uint256, address));\n\n require(timestamp != 0, \"Batch header timestamp cannot be zero\");\n return (timestamp + FRAUD_PROOF_WINDOW) > block.timestamp;\n }\n\n /**********************\n * Internal Functions *\n **********************/\n\n /**\n * Parses the batch context from the extra data.\n * @return Total number of elements submitted.\n * @return Timestamp of the last batch submitted by the sequencer.\n */\n function _getBatchExtraData() internal view returns (uint40, uint40) {\n bytes27 extraData = batches().getGlobalMetadata();\n\n // solhint-disable max-line-length\n uint40 totalElements;\n uint40 lastSequencerTimestamp;\n assembly {\n extraData := shr(40, extraData)\n totalElements := and(\n extraData,\n 0x000000000000000000000000000000000000000000000000000000FFFFFFFFFF\n )\n lastSequencerTimestamp := shr(\n 40,\n and(extraData, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000)\n )\n }\n // solhint-enable max-line-length\n\n return (totalElements, lastSequencerTimestamp);\n }\n\n /**\n * Encodes the batch context for the extra data.\n * @param _totalElements Total number of elements submitted.\n * @param _lastSequencerTimestamp Timestamp of the last batch submitted by the sequencer.\n * @return Encoded batch context.\n */\n function _makeBatchExtraData(uint40 _totalElements, uint40 _lastSequencerTimestamp)\n internal\n pure\n returns (bytes27)\n {\n bytes27 extraData;\n assembly {\n extraData := _totalElements\n extraData := or(extraData, shl(40, _lastSequencerTimestamp))\n extraData := shl(40, extraData)\n }\n\n return extraData;\n }\n\n /**\n * Appends a batch to the chain.\n * @param _batch Elements within the batch.\n * @param _extraData Any extra data to append to the batch.\n */\n function _appendBatch(bytes32[] memory _batch, bytes memory _extraData) internal {\n address sequencer = resolve(\"OVM_Proposer\");\n (uint40 totalElements, uint40 lastSequencerTimestamp) = _getBatchExtraData();\n\n if (msg.sender == sequencer) {\n lastSequencerTimestamp = uint40(block.timestamp);\n } else {\n // We keep track of the last batch submitted by the sequencer so there's a window in\n // which only the sequencer can publish state roots. A window like this just reduces\n // the chance of \"system breaking\" state roots being published while we're still in\n // testing mode. This window should be removed or significantly reduced in the future.\n require(\n lastSequencerTimestamp + SEQUENCER_PUBLISH_WINDOW < block.timestamp,\n \"Cannot publish state roots within the sequencer publication window.\"\n );\n }\n\n // For efficiency reasons getMerkleRoot modifies the `_batch` argument in place\n // while calculating the root hash therefore any arguments passed to it must not\n // be used again afterwards\n Lib_OVMCodec.ChainBatchHeader memory batchHeader = Lib_OVMCodec.ChainBatchHeader({\n batchIndex: getTotalBatches(),\n batchRoot: Lib_MerkleTree.getMerkleRoot(_batch),\n batchSize: _batch.length,\n prevTotalElements: totalElements,\n extraData: _extraData\n });\n\n emit StateBatchAppended(\n batchHeader.batchIndex,\n batchHeader.batchRoot,\n batchHeader.batchSize,\n batchHeader.prevTotalElements,\n batchHeader.extraData\n );\n\n batches().push(\n Lib_OVMCodec.hashBatchHeader(batchHeader),\n _makeBatchExtraData(\n uint40(batchHeader.prevTotalElements + batchHeader.batchSize),\n lastSequencerTimestamp\n )\n );\n }\n\n /**\n * Removes a batch and all subsequent batches from the chain.\n * @param _batchHeader Header of the batch to remove.\n */\n function _deleteBatch(Lib_OVMCodec.ChainBatchHeader memory _batchHeader) internal {\n require(_batchHeader.batchIndex < batches().length(), \"Invalid batch index.\");\n\n require(_isValidBatchHeader(_batchHeader), \"Invalid batch header.\");\n\n // slither-disable-next-line reentrancy-events\n batches().deleteElementsAfterInclusive(\n _batchHeader.batchIndex,\n _makeBatchExtraData(uint40(_batchHeader.prevTotalElements), 0)\n );\n\n // slither-disable-next-line reentrancy-events\n emit StateBatchDeleted(_batchHeader.batchIndex, _batchHeader.batchRoot);\n }\n\n /**\n * Checks that a batch header matches the stored hash for the given index.\n * @param _batchHeader Batch header to validate.\n * @return Whether or not the header matches the stored one.\n */\n function _isValidBatchHeader(Lib_OVMCodec.ChainBatchHeader memory _batchHeader)\n internal\n view\n returns (bool)\n {\n return Lib_OVMCodec.hashBatchHeader(_batchHeader) == batches().get(_batchHeader.batchIndex);\n }\n}\n" + }, + "contracts/libraries/codec/Lib_OVMCodec.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Library Imports */\nimport { Lib_RLPReader } from \"../rlp/Lib_RLPReader.sol\";\nimport { Lib_RLPWriter } from \"../rlp/Lib_RLPWriter.sol\";\nimport { Lib_BytesUtils } from \"../utils/Lib_BytesUtils.sol\";\nimport { Lib_Bytes32Utils } from \"../utils/Lib_Bytes32Utils.sol\";\n\n/**\n * @title Lib_OVMCodec\n */\nlibrary Lib_OVMCodec {\n /*********\n * Enums *\n *********/\n\n enum QueueOrigin {\n SEQUENCER_QUEUE,\n L1TOL2_QUEUE\n }\n\n /***********\n * Structs *\n ***********/\n\n struct EVMAccount {\n uint256 nonce;\n uint256 balance;\n bytes32 storageRoot;\n bytes32 codeHash;\n }\n\n struct ChainBatchHeader {\n uint256 batchIndex;\n bytes32 batchRoot;\n uint256 batchSize;\n uint256 prevTotalElements;\n bytes extraData;\n }\n\n struct ChainInclusionProof {\n uint256 index;\n bytes32[] siblings;\n }\n\n struct Transaction {\n uint256 timestamp;\n uint256 blockNumber;\n QueueOrigin l1QueueOrigin;\n address l1TxOrigin;\n address entrypoint;\n uint256 gasLimit;\n bytes data;\n }\n\n struct TransactionChainElement {\n bool isSequenced;\n uint256 queueIndex; // QUEUED TX ONLY\n uint256 timestamp; // SEQUENCER TX ONLY\n uint256 blockNumber; // SEQUENCER TX ONLY\n bytes txData; // SEQUENCER TX ONLY\n }\n\n struct QueueElement {\n bytes32 transactionHash;\n uint40 timestamp;\n uint40 blockNumber;\n }\n\n /**********************\n * Internal Functions *\n **********************/\n\n /**\n * Encodes a standard OVM transaction.\n * @param _transaction OVM transaction to encode.\n * @return Encoded transaction bytes.\n */\n function encodeTransaction(Transaction memory _transaction)\n internal\n pure\n returns (bytes memory)\n {\n return\n abi.encodePacked(\n _transaction.timestamp,\n _transaction.blockNumber,\n _transaction.l1QueueOrigin,\n _transaction.l1TxOrigin,\n _transaction.entrypoint,\n _transaction.gasLimit,\n _transaction.data\n );\n }\n\n /**\n * Hashes a standard OVM transaction.\n * @param _transaction OVM transaction to encode.\n * @return Hashed transaction\n */\n function hashTransaction(Transaction memory _transaction) internal pure returns (bytes32) {\n return keccak256(encodeTransaction(_transaction));\n }\n\n /**\n * @notice Decodes an RLP-encoded account state into a useful struct.\n * @param _encoded RLP-encoded account state.\n * @return Account state struct.\n */\n function decodeEVMAccount(bytes memory _encoded) internal pure returns (EVMAccount memory) {\n Lib_RLPReader.RLPItem[] memory accountState = Lib_RLPReader.readList(_encoded);\n\n return\n EVMAccount({\n nonce: Lib_RLPReader.readUint256(accountState[0]),\n balance: Lib_RLPReader.readUint256(accountState[1]),\n storageRoot: Lib_RLPReader.readBytes32(accountState[2]),\n codeHash: Lib_RLPReader.readBytes32(accountState[3])\n });\n }\n\n /**\n * Calculates a hash for a given batch header.\n * @param _batchHeader Header to hash.\n * @return Hash of the header.\n */\n function hashBatchHeader(Lib_OVMCodec.ChainBatchHeader memory _batchHeader)\n internal\n pure\n returns (bytes32)\n {\n return\n keccak256(\n abi.encode(\n _batchHeader.batchRoot,\n _batchHeader.batchSize,\n _batchHeader.prevTotalElements,\n _batchHeader.extraData\n )\n );\n }\n}\n" + }, + "contracts/libraries/utils/Lib_MerkleTree.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/**\n * @title Lib_MerkleTree\n * @author River Keefer\n */\nlibrary Lib_MerkleTree {\n /**********************\n * Internal Functions *\n **********************/\n\n /**\n * Calculates a merkle root for a list of 32-byte leaf hashes. WARNING: If the number\n * of leaves passed in is not a power of two, it pads out the tree with zero hashes.\n * If you do not know the original length of elements for the tree you are verifying, then\n * this may allow empty leaves past _elements.length to pass a verification check down the line.\n * Note that the _elements argument is modified, therefore it must not be used again afterwards\n * @param _elements Array of hashes from which to generate a merkle root.\n * @return Merkle root of the leaves, with zero hashes for non-powers-of-two (see above).\n */\n function getMerkleRoot(bytes32[] memory _elements) internal pure returns (bytes32) {\n require(_elements.length > 0, \"Lib_MerkleTree: Must provide at least one leaf hash.\");\n\n if (_elements.length == 1) {\n return _elements[0];\n }\n\n uint256[16] memory defaults = [\n 0x290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563,\n 0x633dc4d7da7256660a892f8f1604a44b5432649cc8ec5cb3ced4c4e6ac94dd1d,\n 0x890740a8eb06ce9be422cb8da5cdafc2b58c0a5e24036c578de2a433c828ff7d,\n 0x3b8ec09e026fdc305365dfc94e189a81b38c7597b3d941c279f042e8206e0bd8,\n 0xecd50eee38e386bd62be9bedb990706951b65fe053bd9d8a521af753d139e2da,\n 0xdefff6d330bb5403f63b14f33b578274160de3a50df4efecf0e0db73bcdd3da5,\n 0x617bdd11f7c0a11f49db22f629387a12da7596f9d1704d7465177c63d88ec7d7,\n 0x292c23a9aa1d8bea7e2435e555a4a60e379a5a35f3f452bae60121073fb6eead,\n 0xe1cea92ed99acdcb045a6726b2f87107e8a61620a232cf4d7d5b5766b3952e10,\n 0x7ad66c0a68c72cb89e4fb4303841966e4062a76ab97451e3b9fb526a5ceb7f82,\n 0xe026cc5a4aed3c22a58cbd3d2ac754c9352c5436f638042dca99034e83636516,\n 0x3d04cffd8b46a874edf5cfae63077de85f849a660426697b06a829c70dd1409c,\n 0xad676aa337a485e4728a0b240d92b3ef7b3c372d06d189322bfd5f61f1e7203e,\n 0xa2fca4a49658f9fab7aa63289c91b7c7b6c832a6d0e69334ff5b0a3483d09dab,\n 0x4ebfd9cd7bca2505f7bef59cc1c12ecc708fff26ae4af19abe852afe9e20c862,\n 0x2def10d13dd169f550f578bda343d9717a138562e0093b380a1120789d53cf10\n ];\n\n // Reserve memory space for our hashes.\n bytes memory buf = new bytes(64);\n\n // We'll need to keep track of left and right siblings.\n bytes32 leftSibling;\n bytes32 rightSibling;\n\n // Number of non-empty nodes at the current depth.\n uint256 rowSize = _elements.length;\n\n // Current depth, counting from 0 at the leaves\n uint256 depth = 0;\n\n // Common sub-expressions\n uint256 halfRowSize; // rowSize / 2\n bool rowSizeIsOdd; // rowSize % 2 == 1\n\n while (rowSize > 1) {\n halfRowSize = rowSize / 2;\n rowSizeIsOdd = rowSize % 2 == 1;\n\n for (uint256 i = 0; i < halfRowSize; i++) {\n leftSibling = _elements[(2 * i)];\n rightSibling = _elements[(2 * i) + 1];\n assembly {\n mstore(add(buf, 32), leftSibling)\n mstore(add(buf, 64), rightSibling)\n }\n\n _elements[i] = keccak256(buf);\n }\n\n if (rowSizeIsOdd) {\n leftSibling = _elements[rowSize - 1];\n rightSibling = bytes32(defaults[depth]);\n assembly {\n mstore(add(buf, 32), leftSibling)\n mstore(add(buf, 64), rightSibling)\n }\n\n _elements[halfRowSize] = keccak256(buf);\n }\n\n rowSize = halfRowSize + (rowSizeIsOdd ? 1 : 0);\n depth++;\n }\n\n return _elements[0];\n }\n\n /**\n * Verifies a merkle branch for the given leaf hash. Assumes the original length\n * of leaves generated is a known, correct input, and does not return true for indices\n * extending past that index (even if _siblings would be otherwise valid.)\n * @param _root The Merkle root to verify against.\n * @param _leaf The leaf hash to verify inclusion of.\n * @param _index The index in the tree of this leaf.\n * @param _siblings Array of sibline nodes in the inclusion proof, starting from depth 0\n * (bottom of the tree).\n * @param _totalLeaves The total number of leaves originally passed into.\n * @return Whether or not the merkle branch and leaf passes verification.\n */\n function verify(\n bytes32 _root,\n bytes32 _leaf,\n uint256 _index,\n bytes32[] memory _siblings,\n uint256 _totalLeaves\n ) internal pure returns (bool) {\n require(_totalLeaves > 0, \"Lib_MerkleTree: Total leaves must be greater than zero.\");\n\n require(_index < _totalLeaves, \"Lib_MerkleTree: Index out of bounds.\");\n\n require(\n _siblings.length == _ceilLog2(_totalLeaves),\n \"Lib_MerkleTree: Total siblings does not correctly correspond to total leaves.\"\n );\n\n bytes32 computedRoot = _leaf;\n\n for (uint256 i = 0; i < _siblings.length; i++) {\n if ((_index & 1) == 1) {\n computedRoot = keccak256(abi.encodePacked(_siblings[i], computedRoot));\n } else {\n computedRoot = keccak256(abi.encodePacked(computedRoot, _siblings[i]));\n }\n\n _index >>= 1;\n }\n\n return _root == computedRoot;\n }\n\n /*********************\n * Private Functions *\n *********************/\n\n /**\n * Calculates the integer ceiling of the log base 2 of an input.\n * @param _in Unsigned input to calculate the log.\n * @return ceil(log_base_2(_in))\n */\n function _ceilLog2(uint256 _in) private pure returns (uint256) {\n require(_in > 0, \"Lib_MerkleTree: Cannot compute ceil(log_2) of 0.\");\n\n if (_in == 1) {\n return 0;\n }\n\n // Find the highest set bit (will be floor(log_2)).\n // Borrowed with <3 from https://github.com/ethereum/solidity-examples\n uint256 val = _in;\n uint256 highest = 0;\n for (uint256 i = 128; i >= 1; i >>= 1) {\n if (val & (((uint256(1) << i) - 1) << i) != 0) {\n highest += i;\n val >>= i;\n }\n }\n\n // Increment by one if this is not a perfect logarithm.\n if ((uint256(1) << highest) != _in) {\n highest += 1;\n }\n\n return highest;\n }\n}\n" + }, + "contracts/L1/rollup/IStateCommitmentChain.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >0.5.0 <0.9.0;\n\n/* Library Imports */\nimport { Lib_OVMCodec } from \"../../libraries/codec/Lib_OVMCodec.sol\";\n\n/**\n * @title IStateCommitmentChain\n */\ninterface IStateCommitmentChain {\n /**********\n * Events *\n **********/\n\n event StateBatchAppended(\n uint256 indexed _batchIndex,\n bytes32 _batchRoot,\n uint256 _batchSize,\n uint256 _prevTotalElements,\n bytes _extraData\n );\n\n event StateBatchDeleted(uint256 indexed _batchIndex, bytes32 _batchRoot);\n\n /********************\n * Public Functions *\n ********************/\n\n /**\n * Retrieves the total number of elements submitted.\n * @return _totalElements Total submitted elements.\n */\n function getTotalElements() external view returns (uint256 _totalElements);\n\n /**\n * Retrieves the total number of batches submitted.\n * @return _totalBatches Total submitted batches.\n */\n function getTotalBatches() external view returns (uint256 _totalBatches);\n\n /**\n * Retrieves the timestamp of the last batch submitted by the sequencer.\n * @return _lastSequencerTimestamp Last sequencer batch timestamp.\n */\n function getLastSequencerTimestamp() external view returns (uint256 _lastSequencerTimestamp);\n\n /**\n * Appends a batch of state roots to the chain.\n * @param _batch Batch of state roots.\n * @param _shouldStartAtElement Index of the element at which this batch should start.\n */\n function appendStateBatch(bytes32[] calldata _batch, uint256 _shouldStartAtElement) external;\n\n /**\n * Deletes all state roots after (and including) a given batch.\n * @param _batchHeader Header of the batch to start deleting from.\n */\n function deleteStateBatch(Lib_OVMCodec.ChainBatchHeader memory _batchHeader) external;\n\n /**\n * Verifies a batch inclusion proof.\n * @param _element Hash of the element to verify a proof for.\n * @param _batchHeader Header of the batch in which the element was included.\n * @param _proof Merkle inclusion proof for the element.\n */\n function verifyStateCommitment(\n bytes32 _element,\n Lib_OVMCodec.ChainBatchHeader memory _batchHeader,\n Lib_OVMCodec.ChainInclusionProof memory _proof\n ) external view returns (bool _verified);\n\n /**\n * Checks whether a given batch is still inside its fraud proof window.\n * @param _batchHeader Header of the batch to check.\n * @return _inside Whether or not the batch is inside the fraud proof window.\n */\n function insideFraudProofWindow(Lib_OVMCodec.ChainBatchHeader memory _batchHeader)\n external\n view\n returns (bool _inside);\n}\n" + }, + "contracts/L1/rollup/ICanonicalTransactionChain.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >0.5.0 <0.9.0;\n\n/* Library Imports */\nimport { Lib_OVMCodec } from \"../../libraries/codec/Lib_OVMCodec.sol\";\n\n/* Interface Imports */\nimport { IChainStorageContainer } from \"./IChainStorageContainer.sol\";\n\n/**\n * @title ICanonicalTransactionChain\n */\ninterface ICanonicalTransactionChain {\n /**********\n * Events *\n **********/\n\n event L2GasParamsUpdated(\n uint256 l2GasDiscountDivisor,\n uint256 enqueueGasCost,\n uint256 enqueueL2GasPrepaid\n );\n\n event TransactionEnqueued(\n address indexed _l1TxOrigin,\n address indexed _target,\n uint256 _gasLimit,\n bytes _data,\n uint256 indexed _queueIndex,\n uint256 _timestamp\n );\n\n event QueueBatchAppended(\n uint256 _startingQueueIndex,\n uint256 _numQueueElements,\n uint256 _totalElements\n );\n\n event SequencerBatchAppended(\n uint256 _startingQueueIndex,\n uint256 _numQueueElements,\n uint256 _totalElements\n );\n\n event TransactionBatchAppended(\n uint256 indexed _batchIndex,\n bytes32 _batchRoot,\n uint256 _batchSize,\n uint256 _prevTotalElements,\n bytes _extraData\n );\n\n /***********\n * Structs *\n ***********/\n\n struct BatchContext {\n uint256 numSequencedTransactions;\n uint256 numSubsequentQueueTransactions;\n uint256 timestamp;\n uint256 blockNumber;\n }\n\n /*******************************\n * Authorized Setter Functions *\n *******************************/\n\n /**\n * Allows the Burn Admin to update the parameters which determine the amount of gas to burn.\n * The value of enqueueL2GasPrepaid is immediately updated as well.\n */\n function setGasParams(uint256 _l2GasDiscountDivisor, uint256 _enqueueGasCost) external;\n\n /********************\n * Public Functions *\n ********************/\n\n /**\n * Accesses the batch storage container.\n * @return Reference to the batch storage container.\n */\n function batches() external view returns (IChainStorageContainer);\n\n /**\n * Retrieves the total number of elements submitted.\n * @return _totalElements Total submitted elements.\n */\n function getTotalElements() external view returns (uint256 _totalElements);\n\n /**\n * Retrieves the total number of batches submitted.\n * @return _totalBatches Total submitted batches.\n */\n function getTotalBatches() external view returns (uint256 _totalBatches);\n\n /**\n * Returns the index of the next element to be enqueued.\n * @return Index for the next queue element.\n */\n function getNextQueueIndex() external view returns (uint40);\n\n /**\n * Gets the queue element at a particular index.\n * @param _index Index of the queue element to access.\n * @return _element Queue element at the given index.\n */\n function getQueueElement(uint256 _index)\n external\n view\n returns (Lib_OVMCodec.QueueElement memory _element);\n\n /**\n * Returns the timestamp of the last transaction.\n * @return Timestamp for the last transaction.\n */\n function getLastTimestamp() external view returns (uint40);\n\n /**\n * Returns the blocknumber of the last transaction.\n * @return Blocknumber for the last transaction.\n */\n function getLastBlockNumber() external view returns (uint40);\n\n /**\n * Get the number of queue elements which have not yet been included.\n * @return Number of pending queue elements.\n */\n function getNumPendingQueueElements() external view returns (uint40);\n\n /**\n * Retrieves the length of the queue, including\n * both pending and canonical transactions.\n * @return Length of the queue.\n */\n function getQueueLength() external view returns (uint40);\n\n /**\n * Adds a transaction to the queue.\n * @param _target Target contract to send the transaction to.\n * @param _gasLimit Gas limit for the given transaction.\n * @param _data Transaction data.\n */\n function enqueue(\n address _target,\n uint256 _gasLimit,\n bytes memory _data\n ) external;\n\n /**\n * Allows the sequencer to append a batch of transactions.\n * @dev This function uses a custom encoding scheme for efficiency reasons.\n * .param _shouldStartAtElement Specific batch we expect to start appending to.\n * .param _totalElementsToAppend Total number of batch elements we expect to append.\n * .param _contexts Array of batch contexts.\n * .param _transactionDataFields Array of raw transaction data.\n */\n function appendSequencerBatch(\n // uint40 _shouldStartAtElement,\n // uint24 _totalElementsToAppend,\n // BatchContext[] _contexts,\n // bytes[] _transactionDataFields\n ) external;\n}\n" + }, + "contracts/L1/rollup/IChainStorageContainer.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >0.5.0 <0.9.0;\n\n/**\n * @title IChainStorageContainer\n */\ninterface IChainStorageContainer {\n /********************\n * Public Functions *\n ********************/\n\n /**\n * Sets the container's global metadata field. We're using `bytes27` here because we use five\n * bytes to maintain the length of the underlying data structure, meaning we have an extra\n * 27 bytes to store arbitrary data.\n * @param _globalMetadata New global metadata to set.\n */\n function setGlobalMetadata(bytes27 _globalMetadata) external;\n\n /**\n * Retrieves the container's global metadata field.\n * @return Container global metadata field.\n */\n function getGlobalMetadata() external view returns (bytes27);\n\n /**\n * Retrieves the number of objects stored in the container.\n * @return Number of objects in the container.\n */\n function length() external view returns (uint256);\n\n /**\n * Pushes an object into the container.\n * @param _object A 32 byte value to insert into the container.\n */\n function push(bytes32 _object) external;\n\n /**\n * Pushes an object into the container. Function allows setting the global metadata since\n * we'll need to touch the \"length\" storage slot anyway, which also contains the global\n * metadata (it's an optimization).\n * @param _object A 32 byte value to insert into the container.\n * @param _globalMetadata New global metadata for the container.\n */\n function push(bytes32 _object, bytes27 _globalMetadata) external;\n\n /**\n * Retrieves an object from the container.\n * @param _index Index of the particular object to access.\n * @return 32 byte object value.\n */\n function get(uint256 _index) external view returns (bytes32);\n\n /**\n * Removes all objects after and including a given index.\n * @param _index Object index to delete from.\n */\n function deleteElementsAfterInclusive(uint256 _index) external;\n\n /**\n * Removes all objects after and including a given index. Also allows setting the global\n * metadata field.\n * @param _index Object index to delete from.\n * @param _globalMetadata New global metadata for the container.\n */\n function deleteElementsAfterInclusive(uint256 _index, bytes27 _globalMetadata) external;\n}\n" + }, + "contracts/libraries/rlp/Lib_RLPReader.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/**\n * @title Lib_RLPReader\n * @dev Adapted from \"RLPReader\" by Hamdi Allam (hamdi.allam97@gmail.com).\n */\nlibrary Lib_RLPReader {\n /*************\n * Constants *\n *************/\n\n uint256 internal constant MAX_LIST_LENGTH = 32;\n\n /*********\n * Enums *\n *********/\n\n enum RLPItemType {\n DATA_ITEM,\n LIST_ITEM\n }\n\n /***********\n * Structs *\n ***********/\n\n struct RLPItem {\n uint256 length;\n uint256 ptr;\n }\n\n /**********************\n * Internal Functions *\n **********************/\n\n /**\n * Converts bytes to a reference to memory position and length.\n * @param _in Input bytes to convert.\n * @return Output memory reference.\n */\n function toRLPItem(bytes memory _in) internal pure returns (RLPItem memory) {\n uint256 ptr;\n assembly {\n ptr := add(_in, 32)\n }\n\n return RLPItem({ length: _in.length, ptr: ptr });\n }\n\n /**\n * Reads an RLP list value into a list of RLP items.\n * @param _in RLP list value.\n * @return Decoded RLP list items.\n */\n function readList(RLPItem memory _in) internal pure returns (RLPItem[] memory) {\n (uint256 listOffset, , RLPItemType itemType) = _decodeLength(_in);\n\n require(itemType == RLPItemType.LIST_ITEM, \"Invalid RLP list value.\");\n\n // Solidity in-memory arrays can't be increased in size, but *can* be decreased in size by\n // writing to the length. Since we can't know the number of RLP items without looping over\n // the entire input, we'd have to loop twice to accurately size this array. It's easier to\n // simply set a reasonable maximum list length and decrease the size before we finish.\n RLPItem[] memory out = new RLPItem[](MAX_LIST_LENGTH);\n\n uint256 itemCount = 0;\n uint256 offset = listOffset;\n while (offset < _in.length) {\n require(itemCount < MAX_LIST_LENGTH, \"Provided RLP list exceeds max list length.\");\n\n (uint256 itemOffset, uint256 itemLength, ) = _decodeLength(\n RLPItem({ length: _in.length - offset, ptr: _in.ptr + offset })\n );\n\n out[itemCount] = RLPItem({ length: itemLength + itemOffset, ptr: _in.ptr + offset });\n\n itemCount += 1;\n offset += itemOffset + itemLength;\n }\n\n // Decrease the array size to match the actual item count.\n assembly {\n mstore(out, itemCount)\n }\n\n return out;\n }\n\n /**\n * Reads an RLP list value into a list of RLP items.\n * @param _in RLP list value.\n * @return Decoded RLP list items.\n */\n function readList(bytes memory _in) internal pure returns (RLPItem[] memory) {\n return readList(toRLPItem(_in));\n }\n\n /**\n * Reads an RLP bytes value into bytes.\n * @param _in RLP bytes value.\n * @return Decoded bytes.\n */\n function readBytes(RLPItem memory _in) internal pure returns (bytes memory) {\n (uint256 itemOffset, uint256 itemLength, RLPItemType itemType) = _decodeLength(_in);\n\n require(itemType == RLPItemType.DATA_ITEM, \"Invalid RLP bytes value.\");\n\n return _copy(_in.ptr, itemOffset, itemLength);\n }\n\n /**\n * Reads an RLP bytes value into bytes.\n * @param _in RLP bytes value.\n * @return Decoded bytes.\n */\n function readBytes(bytes memory _in) internal pure returns (bytes memory) {\n return readBytes(toRLPItem(_in));\n }\n\n /**\n * Reads an RLP string value into a string.\n * @param _in RLP string value.\n * @return Decoded string.\n */\n function readString(RLPItem memory _in) internal pure returns (string memory) {\n return string(readBytes(_in));\n }\n\n /**\n * Reads an RLP string value into a string.\n * @param _in RLP string value.\n * @return Decoded string.\n */\n function readString(bytes memory _in) internal pure returns (string memory) {\n return readString(toRLPItem(_in));\n }\n\n /**\n * Reads an RLP bytes32 value into a bytes32.\n * @param _in RLP bytes32 value.\n * @return Decoded bytes32.\n */\n function readBytes32(RLPItem memory _in) internal pure returns (bytes32) {\n require(_in.length <= 33, \"Invalid RLP bytes32 value.\");\n\n (uint256 itemOffset, uint256 itemLength, RLPItemType itemType) = _decodeLength(_in);\n\n require(itemType == RLPItemType.DATA_ITEM, \"Invalid RLP bytes32 value.\");\n\n uint256 ptr = _in.ptr + itemOffset;\n bytes32 out;\n assembly {\n out := mload(ptr)\n\n // Shift the bytes over to match the item size.\n if lt(itemLength, 32) {\n out := div(out, exp(256, sub(32, itemLength)))\n }\n }\n\n return out;\n }\n\n /**\n * Reads an RLP bytes32 value into a bytes32.\n * @param _in RLP bytes32 value.\n * @return Decoded bytes32.\n */\n function readBytes32(bytes memory _in) internal pure returns (bytes32) {\n return readBytes32(toRLPItem(_in));\n }\n\n /**\n * Reads an RLP uint256 value into a uint256.\n * @param _in RLP uint256 value.\n * @return Decoded uint256.\n */\n function readUint256(RLPItem memory _in) internal pure returns (uint256) {\n return uint256(readBytes32(_in));\n }\n\n /**\n * Reads an RLP uint256 value into a uint256.\n * @param _in RLP uint256 value.\n * @return Decoded uint256.\n */\n function readUint256(bytes memory _in) internal pure returns (uint256) {\n return readUint256(toRLPItem(_in));\n }\n\n /**\n * Reads an RLP bool value into a bool.\n * @param _in RLP bool value.\n * @return Decoded bool.\n */\n function readBool(RLPItem memory _in) internal pure returns (bool) {\n require(_in.length == 1, \"Invalid RLP boolean value.\");\n\n uint256 ptr = _in.ptr;\n uint256 out;\n assembly {\n out := byte(0, mload(ptr))\n }\n\n require(out == 0 || out == 1, \"Lib_RLPReader: Invalid RLP boolean value, must be 0 or 1\");\n\n return out != 0;\n }\n\n /**\n * Reads an RLP bool value into a bool.\n * @param _in RLP bool value.\n * @return Decoded bool.\n */\n function readBool(bytes memory _in) internal pure returns (bool) {\n return readBool(toRLPItem(_in));\n }\n\n /**\n * Reads an RLP address value into a address.\n * @param _in RLP address value.\n * @return Decoded address.\n */\n function readAddress(RLPItem memory _in) internal pure returns (address) {\n if (_in.length == 1) {\n return address(0);\n }\n\n require(_in.length == 21, \"Invalid RLP address value.\");\n\n return address(uint160(readUint256(_in)));\n }\n\n /**\n * Reads an RLP address value into a address.\n * @param _in RLP address value.\n * @return Decoded address.\n */\n function readAddress(bytes memory _in) internal pure returns (address) {\n return readAddress(toRLPItem(_in));\n }\n\n /**\n * Reads the raw bytes of an RLP item.\n * @param _in RLP item to read.\n * @return Raw RLP bytes.\n */\n function readRawBytes(RLPItem memory _in) internal pure returns (bytes memory) {\n return _copy(_in);\n }\n\n /*********************\n * Private Functions *\n *********************/\n\n /**\n * Decodes the length of an RLP item.\n * @param _in RLP item to decode.\n * @return Offset of the encoded data.\n * @return Length of the encoded data.\n * @return RLP item type (LIST_ITEM or DATA_ITEM).\n */\n function _decodeLength(RLPItem memory _in)\n private\n pure\n returns (\n uint256,\n uint256,\n RLPItemType\n )\n {\n require(_in.length > 0, \"RLP item cannot be null.\");\n\n uint256 ptr = _in.ptr;\n uint256 prefix;\n assembly {\n prefix := byte(0, mload(ptr))\n }\n\n if (prefix <= 0x7f) {\n // Single byte.\n\n return (0, 1, RLPItemType.DATA_ITEM);\n } else if (prefix <= 0xb7) {\n // Short string.\n\n // slither-disable-next-line variable-scope\n uint256 strLen = prefix - 0x80;\n\n require(_in.length > strLen, \"Invalid RLP short string.\");\n\n return (1, strLen, RLPItemType.DATA_ITEM);\n } else if (prefix <= 0xbf) {\n // Long string.\n uint256 lenOfStrLen = prefix - 0xb7;\n\n require(_in.length > lenOfStrLen, \"Invalid RLP long string length.\");\n\n uint256 strLen;\n assembly {\n // Pick out the string length.\n strLen := div(mload(add(ptr, 1)), exp(256, sub(32, lenOfStrLen)))\n }\n\n require(_in.length > lenOfStrLen + strLen, \"Invalid RLP long string.\");\n\n return (1 + lenOfStrLen, strLen, RLPItemType.DATA_ITEM);\n } else if (prefix <= 0xf7) {\n // Short list.\n // slither-disable-next-line variable-scope\n uint256 listLen = prefix - 0xc0;\n\n require(_in.length > listLen, \"Invalid RLP short list.\");\n\n return (1, listLen, RLPItemType.LIST_ITEM);\n } else {\n // Long list.\n uint256 lenOfListLen = prefix - 0xf7;\n\n require(_in.length > lenOfListLen, \"Invalid RLP long list length.\");\n\n uint256 listLen;\n assembly {\n // Pick out the list length.\n listLen := div(mload(add(ptr, 1)), exp(256, sub(32, lenOfListLen)))\n }\n\n require(_in.length > lenOfListLen + listLen, \"Invalid RLP long list.\");\n\n return (1 + lenOfListLen, listLen, RLPItemType.LIST_ITEM);\n }\n }\n\n /**\n * Copies the bytes from a memory location.\n * @param _src Pointer to the location to read from.\n * @param _offset Offset to start reading from.\n * @param _length Number of bytes to read.\n * @return Copied bytes.\n */\n function _copy(\n uint256 _src,\n uint256 _offset,\n uint256 _length\n ) private pure returns (bytes memory) {\n bytes memory out = new bytes(_length);\n if (out.length == 0) {\n return out;\n }\n\n uint256 src = _src + _offset;\n uint256 dest;\n assembly {\n dest := add(out, 32)\n }\n\n // Copy over as many complete words as we can.\n for (uint256 i = 0; i < _length / 32; i++) {\n assembly {\n mstore(dest, mload(src))\n }\n\n src += 32;\n dest += 32;\n }\n\n // Pick out the remaining bytes.\n uint256 mask;\n unchecked {\n mask = 256**(32 - (_length % 32)) - 1;\n }\n\n assembly {\n mstore(dest, or(and(mload(src), not(mask)), and(mload(dest), mask)))\n }\n return out;\n }\n\n /**\n * Copies an RLP item into bytes.\n * @param _in RLP item to copy.\n * @return Copied bytes.\n */\n function _copy(RLPItem memory _in) private pure returns (bytes memory) {\n return _copy(_in.ptr, 0, _in.length);\n }\n}\n" + }, + "contracts/libraries/rlp/Lib_RLPWriter.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/**\n * @title Lib_RLPWriter\n * @author Bakaoh (with modifications)\n */\nlibrary Lib_RLPWriter {\n /**********************\n * Internal Functions *\n **********************/\n\n /**\n * RLP encodes a byte string.\n * @param _in The byte string to encode.\n * @return The RLP encoded string in bytes.\n */\n function writeBytes(bytes memory _in) internal pure returns (bytes memory) {\n bytes memory encoded;\n\n if (_in.length == 1 && uint8(_in[0]) < 128) {\n encoded = _in;\n } else {\n encoded = abi.encodePacked(_writeLength(_in.length, 128), _in);\n }\n\n return encoded;\n }\n\n /**\n * RLP encodes a list of RLP encoded byte byte strings.\n * @param _in The list of RLP encoded byte strings.\n * @return The RLP encoded list of items in bytes.\n */\n function writeList(bytes[] memory _in) internal pure returns (bytes memory) {\n bytes memory list = _flatten(_in);\n return abi.encodePacked(_writeLength(list.length, 192), list);\n }\n\n /**\n * RLP encodes a string.\n * @param _in The string to encode.\n * @return The RLP encoded string in bytes.\n */\n function writeString(string memory _in) internal pure returns (bytes memory) {\n return writeBytes(bytes(_in));\n }\n\n /**\n * RLP encodes an address.\n * @param _in The address to encode.\n * @return The RLP encoded address in bytes.\n */\n function writeAddress(address _in) internal pure returns (bytes memory) {\n return writeBytes(abi.encodePacked(_in));\n }\n\n /**\n * RLP encodes a uint.\n * @param _in The uint256 to encode.\n * @return The RLP encoded uint256 in bytes.\n */\n function writeUint(uint256 _in) internal pure returns (bytes memory) {\n return writeBytes(_toBinary(_in));\n }\n\n /**\n * RLP encodes a bool.\n * @param _in The bool to encode.\n * @return The RLP encoded bool in bytes.\n */\n function writeBool(bool _in) internal pure returns (bytes memory) {\n bytes memory encoded = new bytes(1);\n encoded[0] = (_in ? bytes1(0x01) : bytes1(0x80));\n return encoded;\n }\n\n /*********************\n * Private Functions *\n *********************/\n\n /**\n * Encode the first byte, followed by the `len` in binary form if `length` is more than 55.\n * @param _len The length of the string or the payload.\n * @param _offset 128 if item is string, 192 if item is list.\n * @return RLP encoded bytes.\n */\n function _writeLength(uint256 _len, uint256 _offset) private pure returns (bytes memory) {\n bytes memory encoded;\n\n if (_len < 56) {\n encoded = new bytes(1);\n encoded[0] = bytes1(uint8(_len) + uint8(_offset));\n } else {\n uint256 lenLen;\n uint256 i = 1;\n while (_len / i != 0) {\n lenLen++;\n i *= 256;\n }\n\n encoded = new bytes(lenLen + 1);\n encoded[0] = bytes1(uint8(lenLen) + uint8(_offset) + 55);\n for (i = 1; i <= lenLen; i++) {\n encoded[i] = bytes1(uint8((_len / (256**(lenLen - i))) % 256));\n }\n }\n\n return encoded;\n }\n\n /**\n * Encode integer in big endian binary form with no leading zeroes.\n * @notice TODO: This should be optimized with assembly to save gas costs.\n * @param _x The integer to encode.\n * @return RLP encoded bytes.\n */\n function _toBinary(uint256 _x) private pure returns (bytes memory) {\n bytes memory b = abi.encodePacked(_x);\n\n uint256 i = 0;\n for (; i < 32; i++) {\n if (b[i] != 0) {\n break;\n }\n }\n\n bytes memory res = new bytes(32 - i);\n for (uint256 j = 0; j < res.length; j++) {\n res[j] = b[i++];\n }\n\n return res;\n }\n\n /**\n * Copies a piece of memory to another location.\n * @notice From: https://github.com/Arachnid/solidity-stringutils/blob/master/src/strings.sol.\n * @param _dest Destination location.\n * @param _src Source location.\n * @param _len Length of memory to copy.\n */\n function _memcpy(\n uint256 _dest,\n uint256 _src,\n uint256 _len\n ) private pure {\n uint256 dest = _dest;\n uint256 src = _src;\n uint256 len = _len;\n\n for (; len >= 32; len -= 32) {\n assembly {\n mstore(dest, mload(src))\n }\n dest += 32;\n src += 32;\n }\n\n uint256 mask;\n unchecked {\n mask = 256**(32 - len) - 1;\n }\n assembly {\n let srcpart := and(mload(src), not(mask))\n let destpart := and(mload(dest), mask)\n mstore(dest, or(destpart, srcpart))\n }\n }\n\n /**\n * Flattens a list of byte strings into one byte string.\n * @notice From: https://github.com/sammayo/solidity-rlp-encoder/blob/master/RLPEncode.sol.\n * @param _list List of byte strings to flatten.\n * @return The flattened byte string.\n */\n function _flatten(bytes[] memory _list) private pure returns (bytes memory) {\n if (_list.length == 0) {\n return new bytes(0);\n }\n\n uint256 len;\n uint256 i = 0;\n for (; i < _list.length; i++) {\n len += _list[i].length;\n }\n\n bytes memory flattened = new bytes(len);\n uint256 flattenedPtr;\n assembly {\n flattenedPtr := add(flattened, 0x20)\n }\n\n for (i = 0; i < _list.length; i++) {\n bytes memory item = _list[i];\n\n uint256 listPtr;\n assembly {\n listPtr := add(item, 0x20)\n }\n\n _memcpy(flattenedPtr, listPtr, item.length);\n flattenedPtr += _list[i].length;\n }\n\n return flattened;\n }\n}\n" + }, + "contracts/libraries/utils/Lib_BytesUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/**\n * @title Lib_BytesUtils\n */\nlibrary Lib_BytesUtils {\n /**********************\n * Internal Functions *\n **********************/\n\n function slice(\n bytes memory _bytes,\n uint256 _start,\n uint256 _length\n ) internal pure returns (bytes memory) {\n require(_length + 31 >= _length, \"slice_overflow\");\n require(_start + _length >= _start, \"slice_overflow\");\n require(_bytes.length >= _start + _length, \"slice_outOfBounds\");\n\n bytes memory tempBytes;\n\n assembly {\n switch iszero(_length)\n case 0 {\n // Get a location of some free memory and store it in tempBytes as\n // Solidity does for memory variables.\n tempBytes := mload(0x40)\n\n // The first word of the slice result is potentially a partial\n // word read from the original array. To read it, we calculate\n // the length of that partial word and start copying that many\n // bytes into the array. The first word we copy will start with\n // data we don't care about, but the last `lengthmod` bytes will\n // land at the beginning of the contents of the new array. When\n // we're done copying, we overwrite the full first word with\n // the actual length of the slice.\n let lengthmod := and(_length, 31)\n\n // The multiplication in the next line is necessary\n // because when slicing multiples of 32 bytes (lengthmod == 0)\n // the following copy loop was copying the origin's length\n // and then ending prematurely not copying everything it should.\n let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod)))\n let end := add(mc, _length)\n\n for {\n // The multiplication in the next line has the same exact purpose\n // as the one above.\n let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start)\n } lt(mc, end) {\n mc := add(mc, 0x20)\n cc := add(cc, 0x20)\n } {\n mstore(mc, mload(cc))\n }\n\n mstore(tempBytes, _length)\n\n //update free-memory pointer\n //allocating the array padded to 32 bytes like the compiler does now\n mstore(0x40, and(add(mc, 31), not(31)))\n }\n //if we want a zero-length slice let's just return a zero-length array\n default {\n tempBytes := mload(0x40)\n\n //zero out the 32 bytes slice we are about to return\n //we need to do it because Solidity does not garbage collect\n mstore(tempBytes, 0)\n\n mstore(0x40, add(tempBytes, 0x20))\n }\n }\n\n return tempBytes;\n }\n\n function slice(bytes memory _bytes, uint256 _start) internal pure returns (bytes memory) {\n if (_start >= _bytes.length) {\n return bytes(\"\");\n }\n\n return slice(_bytes, _start, _bytes.length - _start);\n }\n\n function toBytes32(bytes memory _bytes) internal pure returns (bytes32) {\n if (_bytes.length < 32) {\n bytes32 ret;\n assembly {\n ret := mload(add(_bytes, 32))\n }\n return ret;\n }\n\n return abi.decode(_bytes, (bytes32)); // will truncate if input length > 32 bytes\n }\n\n function toUint256(bytes memory _bytes) internal pure returns (uint256) {\n return uint256(toBytes32(_bytes));\n }\n\n function toNibbles(bytes memory _bytes) internal pure returns (bytes memory) {\n bytes memory nibbles = new bytes(_bytes.length * 2);\n\n for (uint256 i = 0; i < _bytes.length; i++) {\n nibbles[i * 2] = _bytes[i] >> 4;\n nibbles[i * 2 + 1] = bytes1(uint8(_bytes[i]) % 16);\n }\n\n return nibbles;\n }\n\n function fromNibbles(bytes memory _bytes) internal pure returns (bytes memory) {\n bytes memory ret = new bytes(_bytes.length / 2);\n\n for (uint256 i = 0; i < ret.length; i++) {\n ret[i] = (_bytes[i * 2] << 4) | (_bytes[i * 2 + 1]);\n }\n\n return ret;\n }\n\n function equal(bytes memory _bytes, bytes memory _other) internal pure returns (bool) {\n return keccak256(_bytes) == keccak256(_other);\n }\n}\n" + }, + "contracts/libraries/utils/Lib_Bytes32Utils.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/**\n * @title Lib_Byte32Utils\n */\nlibrary Lib_Bytes32Utils {\n /**********************\n * Internal Functions *\n **********************/\n\n /**\n * Converts a bytes32 value to a boolean. Anything non-zero will be converted to \"true.\"\n * @param _in Input bytes32 value.\n * @return Bytes32 as a boolean.\n */\n function toBool(bytes32 _in) internal pure returns (bool) {\n return _in != 0;\n }\n\n /**\n * Converts a boolean to a bytes32 value.\n * @param _in Input boolean value.\n * @return Boolean as a bytes32.\n */\n function fromBool(bool _in) internal pure returns (bytes32) {\n return bytes32(uint256(_in ? 1 : 0));\n }\n\n /**\n * Converts a bytes32 value to an address. Takes the *last* 20 bytes.\n * @param _in Input bytes32 value.\n * @return Bytes32 as an address.\n */\n function toAddress(bytes32 _in) internal pure returns (address) {\n return address(uint160(uint256(_in)));\n }\n\n /**\n * Converts an address to a bytes32.\n * @param _in Input address value.\n * @return Address as a bytes32.\n */\n function fromAddress(address _in) internal pure returns (bytes32) {\n return bytes32(uint256(uint160(_in)));\n }\n}\n" + }, + "contracts/L1/rollup/ChainStorageContainer.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Library Imports */\nimport { Lib_Buffer } from \"../../libraries/utils/Lib_Buffer.sol\";\nimport { Lib_AddressResolver } from \"../../libraries/resolver/Lib_AddressResolver.sol\";\n\n/* Interface Imports */\nimport { IChainStorageContainer } from \"./IChainStorageContainer.sol\";\n\n/**\n * @title ChainStorageContainer\n * @dev The Chain Storage Container provides its owner contract with read, write and delete\n * functionality. This provides gas efficiency gains by enabling it to overwrite storage slots which\n * can no longer be used in a fraud proof due to the fraud window having passed, and the associated\n * chain state or transactions being finalized.\n * Three distinct Chain Storage Containers will be deployed on Layer 1:\n * 1. Stores transaction batches for the Canonical Transaction Chain\n * 2. Stores queued transactions for the Canonical Transaction Chain\n * 3. Stores chain state batches for the State Commitment Chain\n *\n */\ncontract ChainStorageContainer is IChainStorageContainer, Lib_AddressResolver {\n /*************\n * Libraries *\n *************/\n\n using Lib_Buffer for Lib_Buffer.Buffer;\n\n /*************\n * Variables *\n *************/\n\n string public owner;\n Lib_Buffer.Buffer internal buffer;\n\n /***************\n * Constructor *\n ***************/\n\n /**\n * @param _libAddressManager Address of the Address Manager.\n * @param _owner Name of the contract that owns this container (will be resolved later).\n */\n constructor(address _libAddressManager, string memory _owner)\n Lib_AddressResolver(_libAddressManager)\n {\n owner = _owner;\n }\n\n /**********************\n * Function Modifiers *\n **********************/\n\n modifier onlyOwner() {\n require(\n msg.sender == resolve(owner),\n \"ChainStorageContainer: Function can only be called by the owner.\"\n );\n _;\n }\n\n /********************\n * Public Functions *\n ********************/\n\n /**\n * @inheritdoc IChainStorageContainer\n */\n // slither-disable-next-line external-function\n function setGlobalMetadata(bytes27 _globalMetadata) public onlyOwner {\n return buffer.setExtraData(_globalMetadata);\n }\n\n /**\n * @inheritdoc IChainStorageContainer\n */\n // slither-disable-next-line external-function\n function getGlobalMetadata() public view returns (bytes27) {\n return buffer.getExtraData();\n }\n\n /**\n * @inheritdoc IChainStorageContainer\n */\n // slither-disable-next-line external-function\n function length() public view returns (uint256) {\n return uint256(buffer.getLength());\n }\n\n /**\n * @inheritdoc IChainStorageContainer\n */\n // slither-disable-next-line external-function\n function push(bytes32 _object) public onlyOwner {\n buffer.push(_object);\n }\n\n /**\n * @inheritdoc IChainStorageContainer\n */\n // slither-disable-next-line external-function\n function push(bytes32 _object, bytes27 _globalMetadata) public onlyOwner {\n buffer.push(_object, _globalMetadata);\n }\n\n /**\n * @inheritdoc IChainStorageContainer\n */\n // slither-disable-next-line external-function\n function get(uint256 _index) public view returns (bytes32) {\n return buffer.get(uint40(_index));\n }\n\n /**\n * @inheritdoc IChainStorageContainer\n */\n // slither-disable-next-line external-function\n function deleteElementsAfterInclusive(uint256 _index) public onlyOwner {\n buffer.deleteElementsAfterInclusive(uint40(_index));\n }\n\n /**\n * @inheritdoc IChainStorageContainer\n */\n // slither-disable-next-line external-function\n function deleteElementsAfterInclusive(uint256 _index, bytes27 _globalMetadata)\n public\n onlyOwner\n {\n buffer.deleteElementsAfterInclusive(uint40(_index), _globalMetadata);\n }\n}\n" + }, + "contracts/libraries/utils/Lib_Buffer.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/**\n * @title Lib_Buffer\n * @dev This library implements a bytes32 storage array with some additional gas-optimized\n * functionality. In particular, it encodes its length as a uint40, and tightly packs this with an\n * overwritable \"extra data\" field so we can store more information with a single SSTORE.\n */\nlibrary Lib_Buffer {\n /*************\n * Libraries *\n *************/\n\n using Lib_Buffer for Buffer;\n\n /***********\n * Structs *\n ***********/\n\n struct Buffer {\n bytes32 context;\n mapping(uint256 => bytes32) buf;\n }\n\n struct BufferContext {\n // Stores the length of the array. Uint40 is way more elements than we'll ever reasonably\n // need in an array and we get an extra 27 bytes of extra data to play with.\n uint40 length;\n // Arbitrary extra data that can be modified whenever the length is updated. Useful for\n // squeezing out some gas optimizations.\n bytes27 extraData;\n }\n\n /**********************\n * Internal Functions *\n **********************/\n\n /**\n * Pushes a single element to the buffer.\n * @param _self Buffer to access.\n * @param _value Value to push to the buffer.\n * @param _extraData Global extra data.\n */\n function push(\n Buffer storage _self,\n bytes32 _value,\n bytes27 _extraData\n ) internal {\n BufferContext memory ctx = _self.getContext();\n\n _self.buf[ctx.length] = _value;\n\n // Bump the global index and insert our extra data, then save the context.\n ctx.length++;\n ctx.extraData = _extraData;\n _self.setContext(ctx);\n }\n\n /**\n * Pushes a single element to the buffer.\n * @param _self Buffer to access.\n * @param _value Value to push to the buffer.\n */\n function push(Buffer storage _self, bytes32 _value) internal {\n BufferContext memory ctx = _self.getContext();\n\n _self.push(_value, ctx.extraData);\n }\n\n /**\n * Retrieves an element from the buffer.\n * @param _self Buffer to access.\n * @param _index Element index to retrieve.\n * @return Value of the element at the given index.\n */\n function get(Buffer storage _self, uint256 _index) internal view returns (bytes32) {\n BufferContext memory ctx = _self.getContext();\n\n require(_index < ctx.length, \"Index out of bounds.\");\n\n return _self.buf[_index];\n }\n\n /**\n * Deletes all elements after (and including) a given index.\n * @param _self Buffer to access.\n * @param _index Index of the element to delete from (inclusive).\n * @param _extraData Optional global extra data.\n */\n function deleteElementsAfterInclusive(\n Buffer storage _self,\n uint40 _index,\n bytes27 _extraData\n ) internal {\n BufferContext memory ctx = _self.getContext();\n\n require(_index < ctx.length, \"Index out of bounds.\");\n\n // Set our length and extra data, save the context.\n ctx.length = _index;\n ctx.extraData = _extraData;\n _self.setContext(ctx);\n }\n\n /**\n * Deletes all elements after (and including) a given index.\n * @param _self Buffer to access.\n * @param _index Index of the element to delete from (inclusive).\n */\n function deleteElementsAfterInclusive(Buffer storage _self, uint40 _index) internal {\n BufferContext memory ctx = _self.getContext();\n _self.deleteElementsAfterInclusive(_index, ctx.extraData);\n }\n\n /**\n * Retrieves the current global index.\n * @param _self Buffer to access.\n * @return Current global index.\n */\n function getLength(Buffer storage _self) internal view returns (uint40) {\n BufferContext memory ctx = _self.getContext();\n return ctx.length;\n }\n\n /**\n * Changes current global extra data.\n * @param _self Buffer to access.\n * @param _extraData New global extra data.\n */\n function setExtraData(Buffer storage _self, bytes27 _extraData) internal {\n BufferContext memory ctx = _self.getContext();\n ctx.extraData = _extraData;\n _self.setContext(ctx);\n }\n\n /**\n * Retrieves the current global extra data.\n * @param _self Buffer to access.\n * @return Current global extra data.\n */\n function getExtraData(Buffer storage _self) internal view returns (bytes27) {\n BufferContext memory ctx = _self.getContext();\n return ctx.extraData;\n }\n\n /**\n * Sets the current buffer context.\n * @param _self Buffer to access.\n * @param _ctx Current buffer context.\n */\n function setContext(Buffer storage _self, BufferContext memory _ctx) internal {\n bytes32 context;\n uint40 length = _ctx.length;\n bytes27 extraData = _ctx.extraData;\n assembly {\n context := length\n context := or(context, extraData)\n }\n\n if (_self.context != context) {\n _self.context = context;\n }\n }\n\n /**\n * Retrieves the current buffer context.\n * @param _self Buffer to access.\n * @return Current buffer context.\n */\n function getContext(Buffer storage _self) internal view returns (BufferContext memory) {\n bytes32 context = _self.context;\n uint40 length;\n bytes27 extraData;\n assembly {\n length := and(\n context,\n 0x000000000000000000000000000000000000000000000000000000FFFFFFFFFF\n )\n extraData := and(\n context,\n 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000\n )\n }\n\n return BufferContext({ length: length, extraData: extraData });\n }\n}\n" + }, + "contracts/test-libraries/utils/TestLib_Buffer.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Library Imports */\nimport { Lib_Buffer } from \"../../libraries/utils/Lib_Buffer.sol\";\n\n/**\n * @title TestLib_Buffer\n */\ncontract TestLib_Buffer {\n using Lib_Buffer for Lib_Buffer.Buffer;\n using Lib_Buffer for Lib_Buffer.BufferContext;\n\n Lib_Buffer.Buffer internal buf;\n\n function push(bytes32 _value, bytes27 _extraData) public {\n buf.push(_value, _extraData);\n }\n\n function push(bytes32 _value) public {\n buf.push(_value);\n }\n\n function get(uint256 _index) public view returns (bytes32) {\n return buf.get(_index);\n }\n\n function deleteElementsAfterInclusive(uint40 _index) public {\n return buf.deleteElementsAfterInclusive(_index);\n }\n\n function deleteElementsAfterInclusive(uint40 _index, bytes27 _extraData) public {\n return buf.deleteElementsAfterInclusive(_index, _extraData);\n }\n\n function getLength() public view returns (uint40) {\n return buf.getLength();\n }\n\n function setExtraData(bytes27 _extraData) public {\n return buf.setExtraData(_extraData);\n }\n\n function getExtraData() public view returns (bytes27) {\n return buf.getExtraData();\n }\n\n function getContext() public view returns (Lib_Buffer.BufferContext memory) {\n return buf.getContext();\n }\n\n function setContext(uint40 _index, bytes27 _extraData) public {\n Lib_Buffer.BufferContext memory _ctx = Lib_Buffer.BufferContext({\n length: _index,\n extraData: _extraData\n });\n return buf.setContext(_ctx);\n }\n}\n" + }, + "contracts/L1/rollup/CanonicalTransactionChain.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Library Imports */\nimport { AddressAliasHelper } from \"../../standards/AddressAliasHelper.sol\";\nimport { Lib_OVMCodec } from \"../../libraries/codec/Lib_OVMCodec.sol\";\nimport { Lib_AddressResolver } from \"../../libraries/resolver/Lib_AddressResolver.sol\";\n\n/* Interface Imports */\nimport { ICanonicalTransactionChain } from \"./ICanonicalTransactionChain.sol\";\nimport { IChainStorageContainer } from \"./IChainStorageContainer.sol\";\n\n/**\n * @title CanonicalTransactionChain\n * @dev The Canonical Transaction Chain (CTC) contract is an append-only log of transactions\n * which must be applied to the rollup state. It defines the ordering of rollup transactions by\n * writing them to the 'CTC:batches' instance of the Chain Storage Container.\n * The CTC also allows any account to 'enqueue' an L2 transaction, which will require that the\n * Sequencer will eventually append it to the rollup state.\n *\n */\ncontract CanonicalTransactionChain is ICanonicalTransactionChain, Lib_AddressResolver {\n /*************\n * Constants *\n *************/\n\n // L2 tx gas-related\n uint256 public constant MIN_ROLLUP_TX_GAS = 100000;\n uint256 public constant MAX_ROLLUP_TX_SIZE = 50000;\n\n // The approximate cost of calling the enqueue function\n uint256 public enqueueGasCost;\n // The ratio of the cost of L1 gas to the cost of L2 gas\n uint256 public l2GasDiscountDivisor;\n // The amount of L2 gas which can be forwarded to L2 without spam prevention via 'gas burn'.\n // Calculated as the product of l2GasDiscountDivisor * enqueueGasCost.\n // See comments in enqueue() for further detail.\n uint256 public enqueueL2GasPrepaid;\n\n // Encoding-related (all in bytes)\n uint256 internal constant BATCH_CONTEXT_SIZE = 16;\n // slither-disable-next-line unused-state\n uint256 internal constant BATCH_CONTEXT_LENGTH_POS = 12;\n uint256 internal constant BATCH_CONTEXT_START_POS = 15;\n // slither-disable-next-line unused-state\n uint256 internal constant TX_DATA_HEADER_SIZE = 3;\n // slither-disable-next-line unused-state\n uint256 internal constant BYTES_TILL_TX_DATA = 65;\n\n /*************\n * Variables *\n *************/\n\n uint256 public maxTransactionGasLimit;\n\n /***************\n * Queue State *\n ***************/\n\n uint40 private _nextQueueIndex; // index of the first queue element not yet included\n Lib_OVMCodec.QueueElement[] queueElements;\n\n /***************\n * Constructor *\n ***************/\n\n constructor(\n address _libAddressManager,\n uint256 _maxTransactionGasLimit,\n uint256 _l2GasDiscountDivisor,\n uint256 _enqueueGasCost\n ) Lib_AddressResolver(_libAddressManager) {\n maxTransactionGasLimit = _maxTransactionGasLimit;\n l2GasDiscountDivisor = _l2GasDiscountDivisor;\n enqueueGasCost = _enqueueGasCost;\n enqueueL2GasPrepaid = _l2GasDiscountDivisor * _enqueueGasCost;\n }\n\n /**********************\n * Function Modifiers *\n **********************/\n\n /**\n * Modifier to enforce that, if configured, only the Burn Admin may\n * successfully call a method.\n */\n modifier onlyBurnAdmin() {\n require(msg.sender == libAddressManager.owner(), \"Only callable by the Burn Admin.\");\n _;\n }\n\n /*******************************\n * Authorized Setter Functions *\n *******************************/\n\n /**\n * Allows the Burn Admin to update the parameters which determine the amount of gas to burn.\n * The value of enqueueL2GasPrepaid is immediately updated as well.\n */\n function setGasParams(uint256 _l2GasDiscountDivisor, uint256 _enqueueGasCost)\n external\n onlyBurnAdmin\n {\n enqueueGasCost = _enqueueGasCost;\n l2GasDiscountDivisor = _l2GasDiscountDivisor;\n // See the comment in enqueue() for the rationale behind this formula.\n enqueueL2GasPrepaid = _l2GasDiscountDivisor * _enqueueGasCost;\n\n emit L2GasParamsUpdated(l2GasDiscountDivisor, enqueueGasCost, enqueueL2GasPrepaid);\n }\n\n /********************\n * Public Functions *\n ********************/\n\n /**\n * Accesses the batch storage container.\n * @return Reference to the batch storage container.\n */\n function batches() public view returns (IChainStorageContainer) {\n return IChainStorageContainer(resolve(\"ChainStorageContainer-CTC-batches\"));\n }\n\n /**\n * Retrieves the total number of elements submitted.\n * @return _totalElements Total submitted elements.\n */\n function getTotalElements() public view returns (uint256 _totalElements) {\n (uint40 totalElements, , , ) = _getBatchExtraData();\n return uint256(totalElements);\n }\n\n /**\n * Retrieves the total number of batches submitted.\n * @return _totalBatches Total submitted batches.\n */\n // slither-disable-next-line external-function\n function getTotalBatches() public view returns (uint256 _totalBatches) {\n return batches().length();\n }\n\n /**\n * Returns the index of the next element to be enqueued.\n * @return Index for the next queue element.\n */\n // slither-disable-next-line external-function\n function getNextQueueIndex() public view returns (uint40) {\n return _nextQueueIndex;\n }\n\n /**\n * Returns the timestamp of the last transaction.\n * @return Timestamp for the last transaction.\n */\n // slither-disable-next-line external-function\n function getLastTimestamp() public view returns (uint40) {\n (, , uint40 lastTimestamp, ) = _getBatchExtraData();\n return lastTimestamp;\n }\n\n /**\n * Returns the blocknumber of the last transaction.\n * @return Blocknumber for the last transaction.\n */\n // slither-disable-next-line external-function\n function getLastBlockNumber() public view returns (uint40) {\n (, , , uint40 lastBlockNumber) = _getBatchExtraData();\n return lastBlockNumber;\n }\n\n /**\n * Gets the queue element at a particular index.\n * @param _index Index of the queue element to access.\n * @return _element Queue element at the given index.\n */\n // slither-disable-next-line external-function\n function getQueueElement(uint256 _index)\n public\n view\n returns (Lib_OVMCodec.QueueElement memory _element)\n {\n return queueElements[_index];\n }\n\n /**\n * Get the number of queue elements which have not yet been included.\n * @return Number of pending queue elements.\n */\n // slither-disable-next-line external-function\n function getNumPendingQueueElements() public view returns (uint40) {\n return uint40(queueElements.length) - _nextQueueIndex;\n }\n\n /**\n * Retrieves the length of the queue, including\n * both pending and canonical transactions.\n * @return Length of the queue.\n */\n // slither-disable-next-line external-function\n function getQueueLength() public view returns (uint40) {\n return uint40(queueElements.length);\n }\n\n /**\n * Adds a transaction to the queue.\n * @param _target Target L2 contract to send the transaction to.\n * @param _gasLimit Gas limit for the enqueued L2 transaction.\n * @param _data Transaction data.\n */\n function enqueue(\n address _target,\n uint256 _gasLimit,\n bytes memory _data\n ) external {\n require(\n _data.length <= MAX_ROLLUP_TX_SIZE,\n \"Transaction data size exceeds maximum for rollup transaction.\"\n );\n\n require(\n _gasLimit <= maxTransactionGasLimit,\n \"Transaction gas limit exceeds maximum for rollup transaction.\"\n );\n\n require(_gasLimit >= MIN_ROLLUP_TX_GAS, \"Transaction gas limit too low to enqueue.\");\n\n // Transactions submitted to the queue lack a method for paying gas fees to the Sequencer.\n // So we need to prevent spam attacks by ensuring that the cost of enqueueing a transaction\n // from L1 to L2 is not underpriced. For transaction with a high L2 gas limit, we do this by\n // burning some extra gas on L1. Of course there is also some intrinsic cost to enqueueing a\n // transaction, so we want to make sure not to over-charge (by burning too much L1 gas).\n // Therefore, we define 'enqueueL2GasPrepaid' as the L2 gas limit above which we must burn\n // additional gas on L1. This threshold is the product of two inputs:\n // 1. enqueueGasCost: the base cost of calling this function.\n // 2. l2GasDiscountDivisor: the ratio between the cost of gas on L1 and L2. This is a\n // positive integer, meaning we assume L2 gas is always less costly.\n // The calculation below for gasToConsume can be seen as converting the difference (between\n // the specified L2 gas limit and the prepaid L2 gas limit) to an L1 gas amount.\n if (_gasLimit > enqueueL2GasPrepaid) {\n uint256 gasToConsume = (_gasLimit - enqueueL2GasPrepaid) / l2GasDiscountDivisor;\n uint256 startingGas = gasleft();\n\n // Although this check is not necessary (burn below will run out of gas if not true), it\n // gives the user an explicit reason as to why the enqueue attempt failed.\n require(startingGas > gasToConsume, \"Insufficient gas for L2 rate limiting burn.\");\n\n uint256 i;\n while (startingGas - gasleft() < gasToConsume) {\n i++;\n }\n }\n\n // Apply an aliasing unless msg.sender == tx.origin. This prevents an attack in which a\n // contract on L1 has the same address as a contract on L2 but doesn't have the same code.\n // We can safely ignore this for EOAs because they're guaranteed to have the same \"code\"\n // (i.e. no code at all). This also makes it possible for users to interact with contracts\n // on L2 even when the Sequencer is down.\n address sender;\n if (msg.sender == tx.origin) {\n sender = msg.sender;\n } else {\n sender = AddressAliasHelper.applyL1ToL2Alias(msg.sender);\n }\n\n bytes32 transactionHash = keccak256(abi.encode(sender, _target, _gasLimit, _data));\n\n queueElements.push(\n Lib_OVMCodec.QueueElement({\n transactionHash: transactionHash,\n timestamp: uint40(block.timestamp),\n blockNumber: uint40(block.number)\n })\n );\n uint256 queueIndex = queueElements.length - 1;\n emit TransactionEnqueued(sender, _target, _gasLimit, _data, queueIndex, block.timestamp);\n }\n\n /**\n * Allows the sequencer to append a batch of transactions.\n * @dev This function uses a custom encoding scheme for efficiency reasons.\n * .param _shouldStartAtElement Specific batch we expect to start appending to.\n * .param _totalElementsToAppend Total number of batch elements we expect to append.\n * .param _contexts Array of batch contexts.\n * .param _transactionDataFields Array of raw transaction data.\n */\n function appendSequencerBatch() external {\n uint40 shouldStartAtElement;\n uint24 totalElementsToAppend;\n uint24 numContexts;\n assembly {\n shouldStartAtElement := shr(216, calldataload(4))\n totalElementsToAppend := shr(232, calldataload(9))\n numContexts := shr(232, calldataload(12))\n }\n\n require(\n shouldStartAtElement == getTotalElements(),\n \"Actual batch start index does not match expected start index.\"\n );\n\n require(\n msg.sender == resolve(\"OVM_Sequencer\"),\n \"Function can only be called by the Sequencer.\"\n );\n\n uint40 nextTransactionPtr = uint40(\n BATCH_CONTEXT_START_POS + BATCH_CONTEXT_SIZE * numContexts\n );\n\n require(msg.data.length >= nextTransactionPtr, \"Not enough BatchContexts provided.\");\n\n // Counter for number of sequencer transactions appended so far.\n uint32 numSequencerTransactions = 0;\n\n // Cache the _nextQueueIndex storage variable to a temporary stack variable.\n // This is safe as long as nothing reads or writes to the storage variable\n // until it is updated by the temp variable.\n uint40 nextQueueIndex = _nextQueueIndex;\n\n BatchContext memory curContext;\n for (uint32 i = 0; i < numContexts; i++) {\n BatchContext memory nextContext = _getBatchContext(i);\n\n // Now we can update our current context.\n curContext = nextContext;\n\n // Process sequencer transactions first.\n numSequencerTransactions += uint32(curContext.numSequencedTransactions);\n\n // Now process any subsequent queue transactions.\n nextQueueIndex += uint40(curContext.numSubsequentQueueTransactions);\n }\n\n require(\n nextQueueIndex <= queueElements.length,\n \"Attempted to append more elements than are available in the queue.\"\n );\n\n // Generate the required metadata that we need to append this batch\n uint40 numQueuedTransactions = totalElementsToAppend - numSequencerTransactions;\n uint40 blockTimestamp;\n uint40 blockNumber;\n if (curContext.numSubsequentQueueTransactions == 0) {\n // The last element is a sequencer tx, therefore pull timestamp and block number from\n // the last context.\n blockTimestamp = uint40(curContext.timestamp);\n blockNumber = uint40(curContext.blockNumber);\n } else {\n // The last element is a queue tx, therefore pull timestamp and block number from the\n // queue element.\n // curContext.numSubsequentQueueTransactions > 0 which means that we've processed at\n // least one queue element. We increment nextQueueIndex after processing each queue\n // element, so the index of the last element we processed is nextQueueIndex - 1.\n Lib_OVMCodec.QueueElement memory lastElement = queueElements[nextQueueIndex - 1];\n\n blockTimestamp = lastElement.timestamp;\n blockNumber = lastElement.blockNumber;\n }\n\n // Cache the previous blockhash to ensure all transaction data can be retrieved efficiently.\n // slither-disable-next-line reentrancy-no-eth, reentrancy-events\n _appendBatch(\n blockhash(block.number - 1),\n totalElementsToAppend,\n numQueuedTransactions,\n blockTimestamp,\n blockNumber\n );\n\n // slither-disable-next-line reentrancy-events\n emit SequencerBatchAppended(\n nextQueueIndex - numQueuedTransactions,\n numQueuedTransactions,\n getTotalElements()\n );\n\n // Update the _nextQueueIndex storage variable.\n // slither-disable-next-line reentrancy-no-eth\n _nextQueueIndex = nextQueueIndex;\n }\n\n /**********************\n * Internal Functions *\n **********************/\n\n /**\n * Returns the BatchContext located at a particular index.\n * @param _index The index of the BatchContext\n * @return The BatchContext at the specified index.\n */\n function _getBatchContext(uint256 _index) internal pure returns (BatchContext memory) {\n uint256 contextPtr = 15 + _index * BATCH_CONTEXT_SIZE;\n // slither-disable-next-line similar-names\n uint256 numSequencedTransactions;\n uint256 numSubsequentQueueTransactions;\n uint256 ctxTimestamp;\n uint256 ctxBlockNumber;\n\n assembly {\n numSequencedTransactions := shr(232, calldataload(contextPtr))\n numSubsequentQueueTransactions := shr(232, calldataload(add(contextPtr, 3)))\n ctxTimestamp := shr(216, calldataload(add(contextPtr, 6)))\n ctxBlockNumber := shr(216, calldataload(add(contextPtr, 11)))\n }\n\n return\n BatchContext({\n numSequencedTransactions: numSequencedTransactions,\n numSubsequentQueueTransactions: numSubsequentQueueTransactions,\n timestamp: ctxTimestamp,\n blockNumber: ctxBlockNumber\n });\n }\n\n /**\n * Parses the batch context from the extra data.\n * @return Total number of elements submitted.\n * @return Index of the next queue element.\n */\n function _getBatchExtraData()\n internal\n view\n returns (\n uint40,\n uint40,\n uint40,\n uint40\n )\n {\n bytes27 extraData = batches().getGlobalMetadata();\n\n uint40 totalElements;\n uint40 nextQueueIndex;\n uint40 lastTimestamp;\n uint40 lastBlockNumber;\n\n // solhint-disable max-line-length\n assembly {\n extraData := shr(40, extraData)\n totalElements := and(\n extraData,\n 0x000000000000000000000000000000000000000000000000000000FFFFFFFFFF\n )\n nextQueueIndex := shr(\n 40,\n and(extraData, 0x00000000000000000000000000000000000000000000FFFFFFFFFF0000000000)\n )\n lastTimestamp := shr(\n 80,\n and(extraData, 0x0000000000000000000000000000000000FFFFFFFFFF00000000000000000000)\n )\n lastBlockNumber := shr(\n 120,\n and(extraData, 0x000000000000000000000000FFFFFFFFFF000000000000000000000000000000)\n )\n }\n // solhint-enable max-line-length\n\n return (totalElements, nextQueueIndex, lastTimestamp, lastBlockNumber);\n }\n\n /**\n * Encodes the batch context for the extra data.\n * @param _totalElements Total number of elements submitted.\n * @param _nextQueueIdx Index of the next queue element.\n * @param _timestamp Timestamp for the last batch.\n * @param _blockNumber Block number of the last batch.\n * @return Encoded batch context.\n */\n function _makeBatchExtraData(\n uint40 _totalElements,\n uint40 _nextQueueIdx,\n uint40 _timestamp,\n uint40 _blockNumber\n ) internal pure returns (bytes27) {\n bytes27 extraData;\n assembly {\n extraData := _totalElements\n extraData := or(extraData, shl(40, _nextQueueIdx))\n extraData := or(extraData, shl(80, _timestamp))\n extraData := or(extraData, shl(120, _blockNumber))\n extraData := shl(40, extraData)\n }\n\n return extraData;\n }\n\n /**\n * Inserts a batch into the chain of batches.\n * @param _transactionRoot Root of the transaction tree for this batch.\n * @param _batchSize Number of elements in the batch.\n * @param _numQueuedTransactions Number of queue transactions in the batch.\n * @param _timestamp The latest batch timestamp.\n * @param _blockNumber The latest batch blockNumber.\n */\n function _appendBatch(\n bytes32 _transactionRoot,\n uint256 _batchSize,\n uint256 _numQueuedTransactions,\n uint40 _timestamp,\n uint40 _blockNumber\n ) internal {\n IChainStorageContainer batchesRef = batches();\n (uint40 totalElements, uint40 nextQueueIndex, , ) = _getBatchExtraData();\n\n Lib_OVMCodec.ChainBatchHeader memory header = Lib_OVMCodec.ChainBatchHeader({\n batchIndex: batchesRef.length(),\n batchRoot: _transactionRoot,\n batchSize: _batchSize,\n prevTotalElements: totalElements,\n extraData: hex\"\"\n });\n\n emit TransactionBatchAppended(\n header.batchIndex,\n header.batchRoot,\n header.batchSize,\n header.prevTotalElements,\n header.extraData\n );\n\n bytes32 batchHeaderHash = Lib_OVMCodec.hashBatchHeader(header);\n bytes27 latestBatchContext = _makeBatchExtraData(\n totalElements + uint40(header.batchSize),\n nextQueueIndex + uint40(_numQueuedTransactions),\n _timestamp,\n _blockNumber\n );\n\n // slither-disable-next-line reentrancy-no-eth, reentrancy-events\n batchesRef.push(batchHeaderHash, latestBatchContext);\n }\n}\n" + }, + "contracts/standards/AddressAliasHelper.sol": { + "content": "// SPDX-License-Identifier: Apache-2.0\n\n/*\n * Copyright 2019-2021, Offchain Labs, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity ^0.8.7;\n\nlibrary AddressAliasHelper {\n uint160 constant offset = uint160(0x1111000000000000000000000000000000001111);\n\n /// @notice Utility function that converts the address in the L1 that submitted a tx to\n /// the inbox to the msg.sender viewed in the L2\n /// @param l1Address the address in the L1 that triggered the tx to L2\n /// @return l2Address L2 address as viewed in msg.sender\n function applyL1ToL2Alias(address l1Address) internal pure returns (address l2Address) {\n unchecked {\n l2Address = address(uint160(l1Address) + offset);\n }\n }\n\n /// @notice Utility function that converts the msg.sender viewed in the L2 to the\n /// address in the L1 that submitted a tx to the inbox\n /// @param l2Address L2 address as viewed in msg.sender\n /// @return l1Address the address in the L1 that triggered the tx to L2\n function undoL1ToL2Alias(address l2Address) internal pure returns (address l1Address) {\n unchecked {\n l1Address = address(uint160(l2Address) - offset);\n }\n }\n}\n" + }, + "contracts/test-libraries/codec/TestLib_OVMCodec.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Library Imports */\nimport { Lib_OVMCodec } from \"../../libraries/codec/Lib_OVMCodec.sol\";\n\n/**\n * @title TestLib_OVMCodec\n */\ncontract TestLib_OVMCodec {\n function encodeTransaction(Lib_OVMCodec.Transaction memory _transaction)\n public\n pure\n returns (bytes memory _encoded)\n {\n return Lib_OVMCodec.encodeTransaction(_transaction);\n }\n\n function hashTransaction(Lib_OVMCodec.Transaction memory _transaction)\n public\n pure\n returns (bytes32 _hash)\n {\n return Lib_OVMCodec.hashTransaction(_transaction);\n }\n}\n" + }, + "contracts/L1/messaging/L1CrossDomainMessenger.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Library Imports */\nimport { AddressAliasHelper } from \"../../standards/AddressAliasHelper.sol\";\nimport { Lib_AddressResolver } from \"../../libraries/resolver/Lib_AddressResolver.sol\";\nimport { Lib_OVMCodec } from \"../../libraries/codec/Lib_OVMCodec.sol\";\nimport { Lib_AddressManager } from \"../../libraries/resolver/Lib_AddressManager.sol\";\nimport { Lib_SecureMerkleTrie } from \"../../libraries/trie/Lib_SecureMerkleTrie.sol\";\nimport { Lib_DefaultValues } from \"../../libraries/constants/Lib_DefaultValues.sol\";\nimport { Lib_PredeployAddresses } from \"../../libraries/constants/Lib_PredeployAddresses.sol\";\nimport { Lib_CrossDomainUtils } from \"../../libraries/bridge/Lib_CrossDomainUtils.sol\";\n\n/* Interface Imports */\nimport { IL1CrossDomainMessenger } from \"./IL1CrossDomainMessenger.sol\";\nimport { ICanonicalTransactionChain } from \"../rollup/ICanonicalTransactionChain.sol\";\nimport { IStateCommitmentChain } from \"../rollup/IStateCommitmentChain.sol\";\n\n/* External Imports */\nimport {\n OwnableUpgradeable\n} from \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport {\n PausableUpgradeable\n} from \"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\";\nimport {\n ReentrancyGuardUpgradeable\n} from \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\n\n/**\n * @title L1CrossDomainMessenger\n * @dev The L1 Cross Domain Messenger contract sends messages from L1 to L2, and relays messages\n * from L2 onto L1. In the event that a message sent from L1 to L2 is rejected for exceeding the L2\n * epoch gas limit, it can be resubmitted via this contract's replay function.\n *\n */\ncontract L1CrossDomainMessenger is\n IL1CrossDomainMessenger,\n Lib_AddressResolver,\n OwnableUpgradeable,\n PausableUpgradeable,\n ReentrancyGuardUpgradeable\n{\n /**********\n * Events *\n **********/\n\n event MessageBlocked(bytes32 indexed _xDomainCalldataHash);\n\n event MessageAllowed(bytes32 indexed _xDomainCalldataHash);\n\n /**********************\n * Contract Variables *\n **********************/\n\n mapping(bytes32 => bool) public blockedMessages;\n mapping(bytes32 => bool) public relayedMessages;\n mapping(bytes32 => bool) public successfulMessages;\n\n address internal xDomainMsgSender = Lib_DefaultValues.DEFAULT_XDOMAIN_SENDER;\n\n /***************\n * Constructor *\n ***************/\n\n /**\n * This contract is intended to be behind a delegate proxy.\n * We pass the zero address to the address resolver just to satisfy the constructor.\n * We still need to set this value in initialize().\n */\n constructor() Lib_AddressResolver(address(0)) {}\n\n /********************\n * Public Functions *\n ********************/\n\n /**\n * @param _libAddressManager Address of the Address Manager.\n */\n // slither-disable-next-line external-function\n function initialize(address _libAddressManager) public initializer {\n require(\n address(libAddressManager) == address(0),\n \"L1CrossDomainMessenger already intialized.\"\n );\n libAddressManager = Lib_AddressManager(_libAddressManager);\n xDomainMsgSender = Lib_DefaultValues.DEFAULT_XDOMAIN_SENDER;\n\n // Initialize upgradable OZ contracts\n __Context_init_unchained(); // Context is a dependency for both Ownable and Pausable\n __Ownable_init_unchained();\n __Pausable_init_unchained();\n __ReentrancyGuard_init_unchained();\n }\n\n /**\n * Pause relaying.\n */\n function pause() external onlyOwner {\n _pause();\n }\n\n /**\n * Block a message.\n * @param _xDomainCalldataHash Hash of the message to block.\n */\n function blockMessage(bytes32 _xDomainCalldataHash) external onlyOwner {\n blockedMessages[_xDomainCalldataHash] = true;\n emit MessageBlocked(_xDomainCalldataHash);\n }\n\n /**\n * Allow a message.\n * @param _xDomainCalldataHash Hash of the message to block.\n */\n function allowMessage(bytes32 _xDomainCalldataHash) external onlyOwner {\n blockedMessages[_xDomainCalldataHash] = false;\n emit MessageAllowed(_xDomainCalldataHash);\n }\n\n // slither-disable-next-line external-function\n function xDomainMessageSender() public view returns (address) {\n require(\n xDomainMsgSender != Lib_DefaultValues.DEFAULT_XDOMAIN_SENDER,\n \"xDomainMessageSender is not set\"\n );\n return xDomainMsgSender;\n }\n\n /**\n * Sends a cross domain message to the target messenger.\n * @param _target Target contract address.\n * @param _message Message to send to the target.\n * @param _gasLimit Gas limit for the provided message.\n */\n // slither-disable-next-line external-function\n function sendMessage(\n address _target,\n bytes memory _message,\n uint32 _gasLimit\n ) public {\n address ovmCanonicalTransactionChain = resolve(\"CanonicalTransactionChain\");\n // Use the CTC queue length as nonce\n uint40 nonce = ICanonicalTransactionChain(ovmCanonicalTransactionChain).getQueueLength();\n\n bytes memory xDomainCalldata = Lib_CrossDomainUtils.encodeXDomainCalldata(\n _target,\n msg.sender,\n _message,\n nonce\n );\n\n // slither-disable-next-line reentrancy-events\n _sendXDomainMessage(ovmCanonicalTransactionChain, xDomainCalldata, _gasLimit);\n\n // slither-disable-next-line reentrancy-events\n emit SentMessage(_target, msg.sender, _message, nonce, _gasLimit);\n }\n\n /**\n * Relays a cross domain message to a contract.\n * @inheritdoc IL1CrossDomainMessenger\n */\n // slither-disable-next-line external-function\n function relayMessage(\n address _target,\n address _sender,\n bytes memory _message,\n uint256 _messageNonce,\n L2MessageInclusionProof memory _proof\n ) public nonReentrant whenNotPaused {\n bytes memory xDomainCalldata = Lib_CrossDomainUtils.encodeXDomainCalldata(\n _target,\n _sender,\n _message,\n _messageNonce\n );\n\n require(\n _verifyXDomainMessage(xDomainCalldata, _proof) == true,\n \"Provided message could not be verified.\"\n );\n\n bytes32 xDomainCalldataHash = keccak256(xDomainCalldata);\n\n require(\n successfulMessages[xDomainCalldataHash] == false,\n \"Provided message has already been received.\"\n );\n\n require(\n blockedMessages[xDomainCalldataHash] == false,\n \"Provided message has been blocked.\"\n );\n\n require(\n _target != resolve(\"CanonicalTransactionChain\"),\n \"Cannot send L2->L1 messages to L1 system contracts.\"\n );\n\n xDomainMsgSender = _sender;\n // slither-disable-next-line reentrancy-no-eth, reentrancy-events, reentrancy-benign\n (bool success, ) = _target.call(_message);\n // slither-disable-next-line reentrancy-benign\n xDomainMsgSender = Lib_DefaultValues.DEFAULT_XDOMAIN_SENDER;\n\n // Mark the message as received if the call was successful. Ensures that a message can be\n // relayed multiple times in the case that the call reverted.\n if (success == true) {\n // slither-disable-next-line reentrancy-no-eth\n successfulMessages[xDomainCalldataHash] = true;\n // slither-disable-next-line reentrancy-events\n emit RelayedMessage(xDomainCalldataHash);\n } else {\n // slither-disable-next-line reentrancy-events\n emit FailedRelayedMessage(xDomainCalldataHash);\n }\n\n // Store an identifier that can be used to prove that the given message was relayed by some\n // user. Gives us an easy way to pay relayers for their work.\n bytes32 relayId = keccak256(abi.encodePacked(xDomainCalldata, msg.sender, block.number));\n // slither-disable-next-line reentrancy-benign\n relayedMessages[relayId] = true;\n }\n\n /**\n * Replays a cross domain message to the target messenger.\n * @inheritdoc IL1CrossDomainMessenger\n */\n // slither-disable-next-line external-function\n function replayMessage(\n address _target,\n address _sender,\n bytes memory _message,\n uint256 _queueIndex,\n uint32 _oldGasLimit,\n uint32 _newGasLimit\n ) public {\n // Verify that the message is in the queue:\n address canonicalTransactionChain = resolve(\"CanonicalTransactionChain\");\n Lib_OVMCodec.QueueElement memory element = ICanonicalTransactionChain(\n canonicalTransactionChain\n ).getQueueElement(_queueIndex);\n\n // Compute the calldata that was originally used to send the message.\n bytes memory xDomainCalldata = Lib_CrossDomainUtils.encodeXDomainCalldata(\n _target,\n _sender,\n _message,\n _queueIndex\n );\n\n // Compute the transactionHash\n bytes32 transactionHash = keccak256(\n abi.encode(\n AddressAliasHelper.applyL1ToL2Alias(address(this)),\n Lib_PredeployAddresses.L2_CROSS_DOMAIN_MESSENGER,\n _oldGasLimit,\n xDomainCalldata\n )\n );\n\n // Now check that the provided message data matches the one in the queue element.\n require(\n transactionHash == element.transactionHash,\n \"Provided message has not been enqueued.\"\n );\n\n // Send the same message but with the new gas limit.\n _sendXDomainMessage(canonicalTransactionChain, xDomainCalldata, _newGasLimit);\n }\n\n /**********************\n * Internal Functions *\n **********************/\n\n /**\n * Verifies that the given message is valid.\n * @param _xDomainCalldata Calldata to verify.\n * @param _proof Inclusion proof for the message.\n * @return Whether or not the provided message is valid.\n */\n function _verifyXDomainMessage(\n bytes memory _xDomainCalldata,\n L2MessageInclusionProof memory _proof\n ) internal view returns (bool) {\n return (_verifyStateRootProof(_proof) && _verifyStorageProof(_xDomainCalldata, _proof));\n }\n\n /**\n * Verifies that the state root within an inclusion proof is valid.\n * @param _proof Message inclusion proof.\n * @return Whether or not the provided proof is valid.\n */\n function _verifyStateRootProof(L2MessageInclusionProof memory _proof)\n internal\n view\n returns (bool)\n {\n IStateCommitmentChain ovmStateCommitmentChain = IStateCommitmentChain(\n resolve(\"StateCommitmentChain\")\n );\n\n return (ovmStateCommitmentChain.insideFraudProofWindow(_proof.stateRootBatchHeader) ==\n false &&\n ovmStateCommitmentChain.verifyStateCommitment(\n _proof.stateRoot,\n _proof.stateRootBatchHeader,\n _proof.stateRootProof\n ));\n }\n\n /**\n * Verifies that the storage proof within an inclusion proof is valid.\n * @param _xDomainCalldata Encoded message calldata.\n * @param _proof Message inclusion proof.\n * @return Whether or not the provided proof is valid.\n */\n function _verifyStorageProof(\n bytes memory _xDomainCalldata,\n L2MessageInclusionProof memory _proof\n ) internal view returns (bool) {\n bytes32 storageKey = keccak256(\n abi.encodePacked(\n keccak256(\n abi.encodePacked(\n _xDomainCalldata,\n Lib_PredeployAddresses.L2_CROSS_DOMAIN_MESSENGER\n )\n ),\n uint256(0)\n )\n );\n\n (bool exists, bytes memory encodedMessagePassingAccount) = Lib_SecureMerkleTrie.get(\n abi.encodePacked(Lib_PredeployAddresses.L2_TO_L1_MESSAGE_PASSER),\n _proof.stateTrieWitness,\n _proof.stateRoot\n );\n\n require(\n exists == true,\n \"Message passing predeploy has not been initialized or invalid proof provided.\"\n );\n\n Lib_OVMCodec.EVMAccount memory account = Lib_OVMCodec.decodeEVMAccount(\n encodedMessagePassingAccount\n );\n\n return\n Lib_SecureMerkleTrie.verifyInclusionProof(\n abi.encodePacked(storageKey),\n abi.encodePacked(uint8(1)),\n _proof.storageTrieWitness,\n account.storageRoot\n );\n }\n\n /**\n * Sends a cross domain message.\n * @param _canonicalTransactionChain Address of the CanonicalTransactionChain instance.\n * @param _message Message to send.\n * @param _gasLimit OVM gas limit for the message.\n */\n function _sendXDomainMessage(\n address _canonicalTransactionChain,\n bytes memory _message,\n uint256 _gasLimit\n ) internal {\n // slither-disable-next-line reentrancy-events\n ICanonicalTransactionChain(_canonicalTransactionChain).enqueue(\n Lib_PredeployAddresses.L2_CROSS_DOMAIN_MESSENGER,\n _gasLimit,\n _message\n );\n }\n}\n" + }, + "contracts/libraries/trie/Lib_SecureMerkleTrie.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Library Imports */\nimport { Lib_MerkleTrie } from \"./Lib_MerkleTrie.sol\";\n\n/**\n * @title Lib_SecureMerkleTrie\n */\nlibrary Lib_SecureMerkleTrie {\n /**********************\n * Internal Functions *\n **********************/\n\n /**\n * @notice Verifies a proof that a given key/value pair is present in the\n * Merkle trie.\n * @param _key Key of the node to search for, as a hex string.\n * @param _value Value of the node to search for, as a hex string.\n * @param _proof Merkle trie inclusion proof for the desired node. Unlike\n * traditional Merkle trees, this proof is executed top-down and consists\n * of a list of RLP-encoded nodes that make a path down to the target node.\n * @param _root Known root of the Merkle trie. Used to verify that the\n * included proof is correctly constructed.\n * @return _verified `true` if the k/v pair exists in the trie, `false` otherwise.\n */\n function verifyInclusionProof(\n bytes memory _key,\n bytes memory _value,\n bytes memory _proof,\n bytes32 _root\n ) internal pure returns (bool _verified) {\n bytes memory key = _getSecureKey(_key);\n return Lib_MerkleTrie.verifyInclusionProof(key, _value, _proof, _root);\n }\n\n /**\n * @notice Retrieves the value associated with a given key.\n * @param _key Key to search for, as hex bytes.\n * @param _proof Merkle trie inclusion proof for the key.\n * @param _root Known root of the Merkle trie.\n * @return _exists Whether or not the key exists.\n * @return _value Value of the key if it exists.\n */\n function get(\n bytes memory _key,\n bytes memory _proof,\n bytes32 _root\n ) internal pure returns (bool _exists, bytes memory _value) {\n bytes memory key = _getSecureKey(_key);\n return Lib_MerkleTrie.get(key, _proof, _root);\n }\n\n /*********************\n * Private Functions *\n *********************/\n\n /**\n * Computes the secure counterpart to a key.\n * @param _key Key to get a secure key from.\n * @return _secureKey Secure version of the key.\n */\n function _getSecureKey(bytes memory _key) private pure returns (bytes memory _secureKey) {\n return abi.encodePacked(keccak256(_key));\n }\n}\n" + }, + "contracts/libraries/constants/Lib_DefaultValues.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/**\n * @title Lib_DefaultValues\n */\nlibrary Lib_DefaultValues {\n // The default x-domain message sender being set to a non-zero value makes\n // deployment a bit more expensive, but in exchange the refund on every call to\n // `relayMessage` by the L1 and L2 messengers will be higher.\n address internal constant DEFAULT_XDOMAIN_SENDER = 0x000000000000000000000000000000000000dEaD;\n}\n" + }, + "contracts/libraries/constants/Lib_PredeployAddresses.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/**\n * @title Lib_PredeployAddresses\n */\nlibrary Lib_PredeployAddresses {\n address internal constant L2_TO_L1_MESSAGE_PASSER = 0x4200000000000000000000000000000000000000;\n address internal constant L1_MESSAGE_SENDER = 0x4200000000000000000000000000000000000001;\n address internal constant DEPLOYER_WHITELIST = 0x4200000000000000000000000000000000000002;\n address payable internal constant OVM_ETH = payable(0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000);\n address internal constant L2_CROSS_DOMAIN_MESSENGER =\n 0x4200000000000000000000000000000000000007;\n address internal constant LIB_ADDRESS_MANAGER = 0x4200000000000000000000000000000000000008;\n address internal constant PROXY_EOA = 0x4200000000000000000000000000000000000009;\n address internal constant L2_STANDARD_BRIDGE = 0x4200000000000000000000000000000000000010;\n address internal constant SEQUENCER_FEE_WALLET = 0x4200000000000000000000000000000000000011;\n address internal constant L2_STANDARD_TOKEN_FACTORY =\n 0x4200000000000000000000000000000000000012;\n address internal constant L1_BLOCK_NUMBER = 0x4200000000000000000000000000000000000013;\n}\n" + }, + "contracts/libraries/bridge/Lib_CrossDomainUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/**\n * @title Lib_CrossDomainUtils\n */\nlibrary Lib_CrossDomainUtils {\n /**\n * Generates the correct cross domain calldata for a message.\n * @param _target Target contract address.\n * @param _sender Message sender address.\n * @param _message Message to send to the target.\n * @param _messageNonce Nonce for the provided message.\n * @return ABI encoded cross domain calldata.\n */\n function encodeXDomainCalldata(\n address _target,\n address _sender,\n bytes memory _message,\n uint256 _messageNonce\n ) internal pure returns (bytes memory) {\n return\n abi.encodeWithSignature(\n \"relayMessage(address,address,bytes,uint256)\",\n _target,\n _sender,\n _message,\n _messageNonce\n );\n }\n}\n" + }, + "contracts/L1/messaging/IL1CrossDomainMessenger.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Library Imports */\nimport { Lib_OVMCodec } from \"../../libraries/codec/Lib_OVMCodec.sol\";\n\n/* Interface Imports */\nimport { ICrossDomainMessenger } from \"../../libraries/bridge/ICrossDomainMessenger.sol\";\n\n/**\n * @title IL1CrossDomainMessenger\n */\ninterface IL1CrossDomainMessenger is ICrossDomainMessenger {\n /*******************\n * Data Structures *\n *******************/\n\n struct L2MessageInclusionProof {\n bytes32 stateRoot;\n Lib_OVMCodec.ChainBatchHeader stateRootBatchHeader;\n Lib_OVMCodec.ChainInclusionProof stateRootProof;\n bytes stateTrieWitness;\n bytes storageTrieWitness;\n }\n\n /********************\n * Public Functions *\n ********************/\n\n /**\n * Relays a cross domain message to a contract.\n * @param _target Target contract address.\n * @param _sender Message sender address.\n * @param _message Message to send to the target.\n * @param _messageNonce Nonce for the provided message.\n * @param _proof Inclusion proof for the given message.\n */\n function relayMessage(\n address _target,\n address _sender,\n bytes memory _message,\n uint256 _messageNonce,\n L2MessageInclusionProof memory _proof\n ) external;\n\n /**\n * Replays a cross domain message to the target messenger.\n * @param _target Target contract address.\n * @param _sender Original sender address.\n * @param _message Message to send to the target.\n * @param _queueIndex CTC Queue index for the message to replay.\n * @param _oldGasLimit Original gas limit used to send the message.\n * @param _newGasLimit New gas limit to be used for this message.\n */\n function replayMessage(\n address _target,\n address _sender,\n bytes memory _message,\n uint256 _queueIndex,\n uint32 _oldGasLimit,\n uint32 _newGasLimit\n ) external;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n function __Ownable_init() internal initializer {\n __Context_init_unchained();\n __Ownable_init_unchained();\n }\n\n function __Ownable_init_unchained() internal initializer {\n _setOwner(_msgSender());\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _setOwner(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _setOwner(newOwner);\n }\n\n function _setOwner(address newOwner) private {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract PausableUpgradeable is Initializable, ContextUpgradeable {\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state.\n */\n function __Pausable_init() internal initializer {\n __Context_init_unchained();\n __Pausable_init_unchained();\n }\n\n function __Pausable_init_unchained() internal initializer {\n _paused = false;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n require(!paused(), \"Pausable: paused\");\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n require(paused(), \"Pausable: not paused\");\n _;\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuardUpgradeable is Initializable {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction's gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n function __ReentrancyGuard_init() internal initializer {\n __ReentrancyGuard_init_unchained();\n }\n\n function __ReentrancyGuard_init_unchained() internal initializer {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and make it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n // On the first call to nonReentrant, _notEntered will be true\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n\n _;\n\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\n }\n uint256[49] private __gap;\n}\n" + }, + "contracts/libraries/trie/Lib_MerkleTrie.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Library Imports */\nimport { Lib_BytesUtils } from \"../utils/Lib_BytesUtils.sol\";\nimport { Lib_RLPReader } from \"../rlp/Lib_RLPReader.sol\";\nimport { Lib_RLPWriter } from \"../rlp/Lib_RLPWriter.sol\";\n\n/**\n * @title Lib_MerkleTrie\n */\nlibrary Lib_MerkleTrie {\n /*******************\n * Data Structures *\n *******************/\n\n enum NodeType {\n BranchNode,\n ExtensionNode,\n LeafNode\n }\n\n struct TrieNode {\n bytes encoded;\n Lib_RLPReader.RLPItem[] decoded;\n }\n\n /**********************\n * Contract Constants *\n **********************/\n\n // TREE_RADIX determines the number of elements per branch node.\n uint256 constant TREE_RADIX = 16;\n // Branch nodes have TREE_RADIX elements plus an additional `value` slot.\n uint256 constant BRANCH_NODE_LENGTH = TREE_RADIX + 1;\n // Leaf nodes and extension nodes always have two elements, a `path` and a `value`.\n uint256 constant LEAF_OR_EXTENSION_NODE_LENGTH = 2;\n\n // Prefixes are prepended to the `path` within a leaf or extension node and\n // allow us to differentiate between the two node types. `ODD` or `EVEN` is\n // determined by the number of nibbles within the unprefixed `path`. If the\n // number of nibbles if even, we need to insert an extra padding nibble so\n // the resulting prefixed `path` has an even number of nibbles.\n uint8 constant PREFIX_EXTENSION_EVEN = 0;\n uint8 constant PREFIX_EXTENSION_ODD = 1;\n uint8 constant PREFIX_LEAF_EVEN = 2;\n uint8 constant PREFIX_LEAF_ODD = 3;\n\n // Just a utility constant. RLP represents `NULL` as 0x80.\n bytes1 constant RLP_NULL = bytes1(0x80);\n\n /**********************\n * Internal Functions *\n **********************/\n\n /**\n * @notice Verifies a proof that a given key/value pair is present in the\n * Merkle trie.\n * @param _key Key of the node to search for, as a hex string.\n * @param _value Value of the node to search for, as a hex string.\n * @param _proof Merkle trie inclusion proof for the desired node. Unlike\n * traditional Merkle trees, this proof is executed top-down and consists\n * of a list of RLP-encoded nodes that make a path down to the target node.\n * @param _root Known root of the Merkle trie. Used to verify that the\n * included proof is correctly constructed.\n * @return _verified `true` if the k/v pair exists in the trie, `false` otherwise.\n */\n function verifyInclusionProof(\n bytes memory _key,\n bytes memory _value,\n bytes memory _proof,\n bytes32 _root\n ) internal pure returns (bool _verified) {\n (bool exists, bytes memory value) = get(_key, _proof, _root);\n\n return (exists && Lib_BytesUtils.equal(_value, value));\n }\n\n /**\n * @notice Retrieves the value associated with a given key.\n * @param _key Key to search for, as hex bytes.\n * @param _proof Merkle trie inclusion proof for the key.\n * @param _root Known root of the Merkle trie.\n * @return _exists Whether or not the key exists.\n * @return _value Value of the key if it exists.\n */\n function get(\n bytes memory _key,\n bytes memory _proof,\n bytes32 _root\n ) internal pure returns (bool _exists, bytes memory _value) {\n TrieNode[] memory proof = _parseProof(_proof);\n (uint256 pathLength, bytes memory keyRemainder, bool isFinalNode) = _walkNodePath(\n proof,\n _key,\n _root\n );\n\n bool exists = keyRemainder.length == 0;\n\n require(exists || isFinalNode, \"Provided proof is invalid.\");\n\n bytes memory value = exists ? _getNodeValue(proof[pathLength - 1]) : bytes(\"\");\n\n return (exists, value);\n }\n\n /*********************\n * Private Functions *\n *********************/\n\n /**\n * @notice Walks through a proof using a provided key.\n * @param _proof Inclusion proof to walk through.\n * @param _key Key to use for the walk.\n * @param _root Known root of the trie.\n * @return _pathLength Length of the final path\n * @return _keyRemainder Portion of the key remaining after the walk.\n * @return _isFinalNode Whether or not we've hit a dead end.\n */\n function _walkNodePath(\n TrieNode[] memory _proof,\n bytes memory _key,\n bytes32 _root\n )\n private\n pure\n returns (\n uint256 _pathLength,\n bytes memory _keyRemainder,\n bool _isFinalNode\n )\n {\n uint256 pathLength = 0;\n bytes memory key = Lib_BytesUtils.toNibbles(_key);\n\n bytes32 currentNodeID = _root;\n uint256 currentKeyIndex = 0;\n uint256 currentKeyIncrement = 0;\n TrieNode memory currentNode;\n\n // Proof is top-down, so we start at the first element (root).\n for (uint256 i = 0; i < _proof.length; i++) {\n currentNode = _proof[i];\n currentKeyIndex += currentKeyIncrement;\n\n // Keep track of the proof elements we actually need.\n // It's expensive to resize arrays, so this simply reduces gas costs.\n pathLength += 1;\n\n if (currentKeyIndex == 0) {\n // First proof element is always the root node.\n require(keccak256(currentNode.encoded) == currentNodeID, \"Invalid root hash\");\n } else if (currentNode.encoded.length >= 32) {\n // Nodes 32 bytes or larger are hashed inside branch nodes.\n require(\n keccak256(currentNode.encoded) == currentNodeID,\n \"Invalid large internal hash\"\n );\n } else {\n // Nodes smaller than 31 bytes aren't hashed.\n require(\n Lib_BytesUtils.toBytes32(currentNode.encoded) == currentNodeID,\n \"Invalid internal node hash\"\n );\n }\n\n if (currentNode.decoded.length == BRANCH_NODE_LENGTH) {\n if (currentKeyIndex == key.length) {\n // We've hit the end of the key\n // meaning the value should be within this branch node.\n break;\n } else {\n // We're not at the end of the key yet.\n // Figure out what the next node ID should be and continue.\n uint8 branchKey = uint8(key[currentKeyIndex]);\n Lib_RLPReader.RLPItem memory nextNode = currentNode.decoded[branchKey];\n currentNodeID = _getNodeID(nextNode);\n currentKeyIncrement = 1;\n continue;\n }\n } else if (currentNode.decoded.length == LEAF_OR_EXTENSION_NODE_LENGTH) {\n bytes memory path = _getNodePath(currentNode);\n uint8 prefix = uint8(path[0]);\n uint8 offset = 2 - (prefix % 2);\n bytes memory pathRemainder = Lib_BytesUtils.slice(path, offset);\n bytes memory keyRemainder = Lib_BytesUtils.slice(key, currentKeyIndex);\n uint256 sharedNibbleLength = _getSharedNibbleLength(pathRemainder, keyRemainder);\n\n if (prefix == PREFIX_LEAF_EVEN || prefix == PREFIX_LEAF_ODD) {\n if (\n pathRemainder.length == sharedNibbleLength &&\n keyRemainder.length == sharedNibbleLength\n ) {\n // The key within this leaf matches our key exactly.\n // Increment the key index to reflect that we have no remainder.\n currentKeyIndex += sharedNibbleLength;\n }\n\n // We've hit a leaf node, so our next node should be NULL.\n currentNodeID = bytes32(RLP_NULL);\n break;\n } else if (prefix == PREFIX_EXTENSION_EVEN || prefix == PREFIX_EXTENSION_ODD) {\n if (sharedNibbleLength != pathRemainder.length) {\n // Our extension node is not identical to the remainder.\n // We've hit the end of this path\n // updates will need to modify this extension.\n currentNodeID = bytes32(RLP_NULL);\n break;\n } else {\n // Our extension shares some nibbles.\n // Carry on to the next node.\n currentNodeID = _getNodeID(currentNode.decoded[1]);\n currentKeyIncrement = sharedNibbleLength;\n continue;\n }\n } else {\n revert(\"Received a node with an unknown prefix\");\n }\n } else {\n revert(\"Received an unparseable node.\");\n }\n }\n\n // If our node ID is NULL, then we're at a dead end.\n bool isFinalNode = currentNodeID == bytes32(RLP_NULL);\n return (pathLength, Lib_BytesUtils.slice(key, currentKeyIndex), isFinalNode);\n }\n\n /**\n * @notice Parses an RLP-encoded proof into something more useful.\n * @param _proof RLP-encoded proof to parse.\n * @return _parsed Proof parsed into easily accessible structs.\n */\n function _parseProof(bytes memory _proof) private pure returns (TrieNode[] memory _parsed) {\n Lib_RLPReader.RLPItem[] memory nodes = Lib_RLPReader.readList(_proof);\n TrieNode[] memory proof = new TrieNode[](nodes.length);\n\n for (uint256 i = 0; i < nodes.length; i++) {\n bytes memory encoded = Lib_RLPReader.readBytes(nodes[i]);\n proof[i] = TrieNode({ encoded: encoded, decoded: Lib_RLPReader.readList(encoded) });\n }\n\n return proof;\n }\n\n /**\n * @notice Picks out the ID for a node. Node ID is referred to as the\n * \"hash\" within the specification, but nodes < 32 bytes are not actually\n * hashed.\n * @param _node Node to pull an ID for.\n * @return _nodeID ID for the node, depending on the size of its contents.\n */\n function _getNodeID(Lib_RLPReader.RLPItem memory _node) private pure returns (bytes32 _nodeID) {\n bytes memory nodeID;\n\n if (_node.length < 32) {\n // Nodes smaller than 32 bytes are RLP encoded.\n nodeID = Lib_RLPReader.readRawBytes(_node);\n } else {\n // Nodes 32 bytes or larger are hashed.\n nodeID = Lib_RLPReader.readBytes(_node);\n }\n\n return Lib_BytesUtils.toBytes32(nodeID);\n }\n\n /**\n * @notice Gets the path for a leaf or extension node.\n * @param _node Node to get a path for.\n * @return _path Node path, converted to an array of nibbles.\n */\n function _getNodePath(TrieNode memory _node) private pure returns (bytes memory _path) {\n return Lib_BytesUtils.toNibbles(Lib_RLPReader.readBytes(_node.decoded[0]));\n }\n\n /**\n * @notice Gets the path for a node.\n * @param _node Node to get a value for.\n * @return _value Node value, as hex bytes.\n */\n function _getNodeValue(TrieNode memory _node) private pure returns (bytes memory _value) {\n return Lib_RLPReader.readBytes(_node.decoded[_node.decoded.length - 1]);\n }\n\n /**\n * @notice Utility; determines the number of nibbles shared between two\n * nibble arrays.\n * @param _a First nibble array.\n * @param _b Second nibble array.\n * @return _shared Number of shared nibbles.\n */\n function _getSharedNibbleLength(bytes memory _a, bytes memory _b)\n private\n pure\n returns (uint256 _shared)\n {\n uint256 i = 0;\n while (_a.length > i && _b.length > i && _a[i] == _b[i]) {\n i++;\n }\n return i;\n }\n}\n" + }, + "contracts/libraries/bridge/ICrossDomainMessenger.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >0.5.0 <0.9.0;\n\n/**\n * @title ICrossDomainMessenger\n */\ninterface ICrossDomainMessenger {\n /**********\n * Events *\n **********/\n\n event SentMessage(\n address indexed target,\n address sender,\n bytes message,\n uint256 messageNonce,\n uint256 gasLimit\n );\n event RelayedMessage(bytes32 indexed msgHash);\n event FailedRelayedMessage(bytes32 indexed msgHash);\n\n /*************\n * Variables *\n *************/\n\n function xDomainMessageSender() external view returns (address);\n\n /********************\n * Public Functions *\n ********************/\n\n /**\n * Sends a cross domain message to the target messenger.\n * @param _target Target contract address.\n * @param _message Message to send to the target.\n * @param _gasLimit Gas limit for the provided message.\n */\n function sendMessage(\n address _target,\n bytes calldata _message,\n uint32 _gasLimit\n ) external;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n function __Context_init() internal initializer {\n __Context_init_unchained();\n }\n\n function __Context_init_unchained() internal initializer {\n }\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n */\n bool private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Modifier to protect an initializer function from being invoked twice.\n */\n modifier initializer() {\n require(_initializing || !_initialized, \"Initializable: contract is already initialized\");\n\n bool isTopLevelCall = !_initializing;\n if (isTopLevelCall) {\n _initializing = true;\n _initialized = true;\n }\n\n _;\n\n if (isTopLevelCall) {\n _initializing = false;\n }\n }\n}\n" + }, + "contracts/L2/messaging/IL2CrossDomainMessenger.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Interface Imports */\nimport { ICrossDomainMessenger } from \"../../libraries/bridge/ICrossDomainMessenger.sol\";\n\n/**\n * @title IL2CrossDomainMessenger\n */\ninterface IL2CrossDomainMessenger is ICrossDomainMessenger {\n /********************\n * Public Functions *\n ********************/\n\n /**\n * Relays a cross domain message to a contract.\n * @param _target Target contract address.\n * @param _sender Message sender address.\n * @param _message Message to send to the target.\n * @param _messageNonce Nonce for the provided message.\n */\n function relayMessage(\n address _target,\n address _sender,\n bytes memory _message,\n uint256 _messageNonce\n ) external;\n}\n" + }, + "contracts/L2/messaging/L2CrossDomainMessenger.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Library Imports */\nimport { AddressAliasHelper } from \"../../standards/AddressAliasHelper.sol\";\nimport { Lib_CrossDomainUtils } from \"../../libraries/bridge/Lib_CrossDomainUtils.sol\";\nimport { Lib_DefaultValues } from \"../../libraries/constants/Lib_DefaultValues.sol\";\nimport { Lib_PredeployAddresses } from \"../../libraries/constants/Lib_PredeployAddresses.sol\";\n\n/* Interface Imports */\nimport { IL2CrossDomainMessenger } from \"./IL2CrossDomainMessenger.sol\";\nimport { iOVM_L2ToL1MessagePasser } from \"../predeploys/iOVM_L2ToL1MessagePasser.sol\";\n\n/**\n * @title L2CrossDomainMessenger\n * @dev The L2 Cross Domain Messenger contract sends messages from L2 to L1, and is the entry point\n * for L2 messages sent via the L1 Cross Domain Messenger.\n *\n */\ncontract L2CrossDomainMessenger is IL2CrossDomainMessenger {\n /*************\n * Variables *\n *************/\n\n mapping(bytes32 => bool) public relayedMessages;\n mapping(bytes32 => bool) public successfulMessages;\n mapping(bytes32 => bool) public sentMessages;\n uint256 public messageNonce;\n address internal xDomainMsgSender = Lib_DefaultValues.DEFAULT_XDOMAIN_SENDER;\n address public l1CrossDomainMessenger;\n\n /***************\n * Constructor *\n ***************/\n\n constructor(address _l1CrossDomainMessenger) {\n l1CrossDomainMessenger = _l1CrossDomainMessenger;\n }\n\n /********************\n * Public Functions *\n ********************/\n\n // slither-disable-next-line external-function\n function xDomainMessageSender() public view returns (address) {\n require(\n xDomainMsgSender != Lib_DefaultValues.DEFAULT_XDOMAIN_SENDER,\n \"xDomainMessageSender is not set\"\n );\n return xDomainMsgSender;\n }\n\n /**\n * Sends a cross domain message to the target messenger.\n * @param _target Target contract address.\n * @param _message Message to send to the target.\n * @param _gasLimit Gas limit for the provided message.\n */\n // slither-disable-next-line external-function\n function sendMessage(\n address _target,\n bytes memory _message,\n uint32 _gasLimit\n ) public {\n bytes memory xDomainCalldata = Lib_CrossDomainUtils.encodeXDomainCalldata(\n _target,\n msg.sender,\n _message,\n messageNonce\n );\n\n sentMessages[keccak256(xDomainCalldata)] = true;\n\n // Actually send the message.\n // slither-disable-next-line reentrancy-no-eth, reentrancy-events\n iOVM_L2ToL1MessagePasser(Lib_PredeployAddresses.L2_TO_L1_MESSAGE_PASSER).passMessageToL1(\n xDomainCalldata\n );\n\n // Emit an event before we bump the nonce or the nonce will be off by one.\n // slither-disable-next-line reentrancy-events\n emit SentMessage(_target, msg.sender, _message, messageNonce, _gasLimit);\n // slither-disable-next-line reentrancy-no-eth\n messageNonce += 1;\n }\n\n /**\n * Relays a cross domain message to a contract.\n * @inheritdoc IL2CrossDomainMessenger\n */\n // slither-disable-next-line external-function\n function relayMessage(\n address _target,\n address _sender,\n bytes memory _message,\n uint256 _messageNonce\n ) public {\n // Since it is impossible to deploy a contract to an address on L2 which matches\n // the alias of the L1CrossDomainMessenger, this check can only pass when it is called in\n // the first call from of a deposit transaction. Thus reentrancy is prevented here.\n require(\n AddressAliasHelper.undoL1ToL2Alias(msg.sender) == l1CrossDomainMessenger,\n \"Provided message could not be verified.\"\n );\n\n bytes memory xDomainCalldata = Lib_CrossDomainUtils.encodeXDomainCalldata(\n _target,\n _sender,\n _message,\n _messageNonce\n );\n\n bytes32 xDomainCalldataHash = keccak256(xDomainCalldata);\n\n require(\n successfulMessages[xDomainCalldataHash] == false,\n \"Provided message has already been received.\"\n );\n\n // Prevent calls to OVM_L2ToL1MessagePasser, which would enable\n // an attacker to maliciously craft the _message to spoof\n // a call from any L2 account.\n if (_target == Lib_PredeployAddresses.L2_TO_L1_MESSAGE_PASSER) {\n // Write to the successfulMessages mapping and return immediately.\n successfulMessages[xDomainCalldataHash] = true;\n return;\n }\n\n xDomainMsgSender = _sender;\n // slither-disable-next-line reentrancy-no-eth, reentrancy-events, reentrancy-benign\n (bool success, ) = _target.call(_message);\n // slither-disable-next-line reentrancy-benign\n xDomainMsgSender = Lib_DefaultValues.DEFAULT_XDOMAIN_SENDER;\n\n // Mark the message as received if the call was successful. Ensures that a message can be\n // relayed multiple times in the case that the call reverted.\n if (success == true) {\n // slither-disable-next-line reentrancy-no-eth\n successfulMessages[xDomainCalldataHash] = true;\n // slither-disable-next-line reentrancy-events\n emit RelayedMessage(xDomainCalldataHash);\n } else {\n // slither-disable-next-line reentrancy-events\n emit FailedRelayedMessage(xDomainCalldataHash);\n }\n\n // Store an identifier that can be used to prove that the given message was relayed by some\n // user. Gives us an easy way to pay relayers for their work.\n bytes32 relayId = keccak256(abi.encodePacked(xDomainCalldata, msg.sender, block.number));\n\n // slither-disable-next-line reentrancy-benign\n relayedMessages[relayId] = true;\n }\n}\n" + }, + "contracts/L2/predeploys/iOVM_L2ToL1MessagePasser.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/**\n * @title iOVM_L2ToL1MessagePasser\n */\ninterface iOVM_L2ToL1MessagePasser {\n /**********\n * Events *\n **********/\n\n event L2ToL1Message(uint256 _nonce, address _sender, bytes _data);\n\n /********************\n * Public Functions *\n ********************/\n\n function passMessageToL1(bytes calldata _message) external;\n}\n" + }, + "contracts/L2/predeploys/OVM_L2ToL1MessagePasser.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Interface Imports */\nimport { iOVM_L2ToL1MessagePasser } from \"./iOVM_L2ToL1MessagePasser.sol\";\n\n/**\n * @title OVM_L2ToL1MessagePasser\n * @dev The L2 to L1 Message Passer is a utility contract which facilitate an L1 proof of the\n * of a message on L2. The L1 Cross Domain Messenger performs this proof in its\n * _verifyStorageProof function, which verifies the existence of the transaction hash in this\n * contract's `sentMessages` mapping.\n */\ncontract OVM_L2ToL1MessagePasser is iOVM_L2ToL1MessagePasser {\n /**********************\n * Contract Variables *\n **********************/\n\n mapping(bytes32 => bool) public sentMessages;\n\n /********************\n * Public Functions *\n ********************/\n\n /**\n * Passes a message to L1.\n * @param _message Message to pass to L1.\n */\n // slither-disable-next-line external-function\n function passMessageToL1(bytes memory _message) public {\n // Note: although this function is public, only messages sent from the\n // L2CrossDomainMessenger will be relayed by the L1CrossDomainMessenger.\n // This is enforced by a check in L1CrossDomainMessenger._verifyStorageProof().\n sentMessages[keccak256(abi.encodePacked(_message, msg.sender))] = true;\n }\n}\n" + }, + "contracts/L2/predeploys/OVM_SequencerFeeVault.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Library Imports */\nimport { Lib_PredeployAddresses } from \"../../libraries/constants/Lib_PredeployAddresses.sol\";\n\n/* Contract Imports */\nimport { L2StandardBridge } from \"../messaging/L2StandardBridge.sol\";\n\n/**\n * @title OVM_SequencerFeeVault\n * @dev Simple holding contract for fees paid to the Sequencer. Likely to be replaced in the future\n * but \"good enough for now\".\n */\ncontract OVM_SequencerFeeVault {\n /*************\n * Constants *\n *************/\n\n // Minimum ETH balance that can be withdrawn in a single withdrawal.\n uint256 public constant MIN_WITHDRAWAL_AMOUNT = 15 ether;\n\n /*************\n * Variables *\n *************/\n\n // Address on L1 that will hold the fees once withdrawn. Dynamically initialized within l2geth.\n address public l1FeeWallet;\n\n /***************\n * Constructor *\n ***************/\n\n /**\n * @param _l1FeeWallet Initial address for the L1 wallet that will hold fees once withdrawn.\n * Currently HAS NO EFFECT in production because l2geth will mutate this storage slot during\n * the genesis block. This is ONLY for testing purposes.\n */\n constructor(address _l1FeeWallet) {\n l1FeeWallet = _l1FeeWallet;\n }\n\n /************\n * Fallback *\n ************/\n\n // slither-disable-next-line locked-ether\n receive() external payable {}\n\n /********************\n * Public Functions *\n ********************/\n\n // slither-disable-next-line external-function\n function withdraw() public {\n require(\n address(this).balance >= MIN_WITHDRAWAL_AMOUNT,\n // solhint-disable-next-line max-line-length\n \"OVM_SequencerFeeVault: withdrawal amount must be greater than minimum withdrawal amount\"\n );\n\n L2StandardBridge(Lib_PredeployAddresses.L2_STANDARD_BRIDGE).withdrawTo(\n Lib_PredeployAddresses.OVM_ETH,\n l1FeeWallet,\n address(this).balance,\n 0,\n bytes(\"\")\n );\n }\n}\n" + }, + "contracts/L2/messaging/L2StandardBridge.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Interface Imports */\nimport { IL1StandardBridge } from \"../../L1/messaging/IL1StandardBridge.sol\";\nimport { IL1ERC20Bridge } from \"../../L1/messaging/IL1ERC20Bridge.sol\";\nimport { IL2ERC20Bridge } from \"./IL2ERC20Bridge.sol\";\n\n/* Library Imports */\nimport { ERC165Checker } from \"@openzeppelin/contracts/utils/introspection/ERC165Checker.sol\";\nimport { CrossDomainEnabled } from \"../../libraries/bridge/CrossDomainEnabled.sol\";\nimport { Lib_PredeployAddresses } from \"../../libraries/constants/Lib_PredeployAddresses.sol\";\n\n/* Contract Imports */\nimport { IL2StandardERC20 } from \"../../standards/IL2StandardERC20.sol\";\n\n/**\n * @title L2StandardBridge\n * @dev The L2 Standard bridge is a contract which works together with the L1 Standard bridge to\n * enable ETH and ERC20 transitions between L1 and L2.\n * This contract acts as a minter for new tokens when it hears about deposits into the L1 Standard\n * bridge.\n * This contract also acts as a burner of the tokens intended for withdrawal, informing the L1\n * bridge to release L1 funds.\n */\ncontract L2StandardBridge is IL2ERC20Bridge, CrossDomainEnabled {\n /********************************\n * External Contract References *\n ********************************/\n\n address public l1TokenBridge;\n\n /***************\n * Constructor *\n ***************/\n\n /**\n * @param _l2CrossDomainMessenger Cross-domain messenger used by this contract.\n * @param _l1TokenBridge Address of the L1 bridge deployed to the main chain.\n */\n constructor(address _l2CrossDomainMessenger, address _l1TokenBridge)\n CrossDomainEnabled(_l2CrossDomainMessenger)\n {\n l1TokenBridge = _l1TokenBridge;\n }\n\n /***************\n * Withdrawing *\n ***************/\n\n /**\n * @inheritdoc IL2ERC20Bridge\n */\n function withdraw(\n address _l2Token,\n uint256 _amount,\n uint32 _l1Gas,\n bytes calldata _data\n ) external virtual {\n _initiateWithdrawal(_l2Token, msg.sender, msg.sender, _amount, _l1Gas, _data);\n }\n\n /**\n * @inheritdoc IL2ERC20Bridge\n */\n function withdrawTo(\n address _l2Token,\n address _to,\n uint256 _amount,\n uint32 _l1Gas,\n bytes calldata _data\n ) external virtual {\n _initiateWithdrawal(_l2Token, msg.sender, _to, _amount, _l1Gas, _data);\n }\n\n /**\n * @dev Performs the logic for withdrawals by burning the token and informing\n * the L1 token Gateway of the withdrawal.\n * @param _l2Token Address of L2 token where withdrawal is initiated.\n * @param _from Account to pull the withdrawal from on L2.\n * @param _to Account to give the withdrawal to on L1.\n * @param _amount Amount of the token to withdraw.\n * @param _l1Gas Unused, but included for potential forward compatibility considerations.\n * @param _data Optional data to forward to L1. This data is provided\n * solely as a convenience for external contracts. Aside from enforcing a maximum\n * length, these contracts provide no guarantees about its content.\n */\n function _initiateWithdrawal(\n address _l2Token,\n address _from,\n address _to,\n uint256 _amount,\n uint32 _l1Gas,\n bytes calldata _data\n ) internal {\n // When a withdrawal is initiated, we burn the withdrawer's funds to prevent subsequent L2\n // usage\n // slither-disable-next-line reentrancy-events\n IL2StandardERC20(_l2Token).burn(msg.sender, _amount);\n\n // Construct calldata for l1TokenBridge.finalizeERC20Withdrawal(_to, _amount)\n // slither-disable-next-line reentrancy-events\n address l1Token = IL2StandardERC20(_l2Token).l1Token();\n bytes memory message;\n\n if (_l2Token == Lib_PredeployAddresses.OVM_ETH) {\n message = abi.encodeWithSelector(\n IL1StandardBridge.finalizeETHWithdrawal.selector,\n _from,\n _to,\n _amount,\n _data\n );\n } else {\n message = abi.encodeWithSelector(\n IL1ERC20Bridge.finalizeERC20Withdrawal.selector,\n l1Token,\n _l2Token,\n _from,\n _to,\n _amount,\n _data\n );\n }\n\n // Send message up to L1 bridge\n // slither-disable-next-line reentrancy-events\n sendCrossDomainMessage(l1TokenBridge, _l1Gas, message);\n\n // slither-disable-next-line reentrancy-events\n emit WithdrawalInitiated(l1Token, _l2Token, msg.sender, _to, _amount, _data);\n }\n\n /************************************\n * Cross-chain Function: Depositing *\n ************************************/\n\n /**\n * @inheritdoc IL2ERC20Bridge\n */\n function finalizeDeposit(\n address _l1Token,\n address _l2Token,\n address _from,\n address _to,\n uint256 _amount,\n bytes calldata _data\n ) external virtual onlyFromCrossDomainAccount(l1TokenBridge) {\n // Check the target token is compliant and\n // verify the deposited token on L1 matches the L2 deposited token representation here\n if (\n // slither-disable-next-line reentrancy-events\n ERC165Checker.supportsInterface(_l2Token, 0x1d1d8b63) &&\n _l1Token == IL2StandardERC20(_l2Token).l1Token()\n ) {\n // When a deposit is finalized, we credit the account on L2 with the same amount of\n // tokens.\n // slither-disable-next-line reentrancy-events\n IL2StandardERC20(_l2Token).mint(_to, _amount);\n // slither-disable-next-line reentrancy-events\n emit DepositFinalized(_l1Token, _l2Token, _from, _to, _amount, _data);\n } else {\n // Either the L2 token which is being deposited-into disagrees about the correct address\n // of its L1 token, or does not support the correct interface.\n // This should only happen if there is a malicious L2 token, or if a user somehow\n // specified the wrong L2 token address to deposit into.\n // In either case, we stop the process here and construct a withdrawal\n // message so that users can get their funds out in some cases.\n // There is no way to prevent malicious token contracts altogether, but this does limit\n // user error and mitigate some forms of malicious contract behavior.\n bytes memory message = abi.encodeWithSelector(\n IL1ERC20Bridge.finalizeERC20Withdrawal.selector,\n _l1Token,\n _l2Token,\n _to, // switched the _to and _from here to bounce back the deposit to the sender\n _from,\n _amount,\n _data\n );\n\n // Send message up to L1 bridge\n // slither-disable-next-line reentrancy-events\n sendCrossDomainMessage(l1TokenBridge, 0, message);\n // slither-disable-next-line reentrancy-events\n emit DepositFailed(_l1Token, _l2Token, _from, _to, _amount, _data);\n }\n }\n}\n" + }, + "contracts/L1/messaging/IL1StandardBridge.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >0.5.0 <0.9.0;\n\nimport \"./IL1ERC20Bridge.sol\";\n\n/**\n * @title IL1StandardBridge\n */\ninterface IL1StandardBridge is IL1ERC20Bridge {\n /**********\n * Events *\n **********/\n event ETHDepositInitiated(\n address indexed _from,\n address indexed _to,\n uint256 _amount,\n bytes _data\n );\n\n event ETHWithdrawalFinalized(\n address indexed _from,\n address indexed _to,\n uint256 _amount,\n bytes _data\n );\n\n /********************\n * Public Functions *\n ********************/\n\n /**\n * @dev Deposit an amount of the ETH to the caller's balance on L2.\n * @param _l2Gas Gas limit required to complete the deposit on L2.\n * @param _data Optional data to forward to L2. This data is provided\n * solely as a convenience for external contracts. Aside from enforcing a maximum\n * length, these contracts provide no guarantees about its content.\n */\n function depositETH(uint32 _l2Gas, bytes calldata _data) external payable;\n\n /**\n * @dev Deposit an amount of ETH to a recipient's balance on L2.\n * @param _to L2 address to credit the withdrawal to.\n * @param _l2Gas Gas limit required to complete the deposit on L2.\n * @param _data Optional data to forward to L2. This data is provided\n * solely as a convenience for external contracts. Aside from enforcing a maximum\n * length, these contracts provide no guarantees about its content.\n */\n function depositETHTo(\n address _to,\n uint32 _l2Gas,\n bytes calldata _data\n ) external payable;\n\n /*************************\n * Cross-chain Functions *\n *************************/\n\n /**\n * @dev Complete a withdrawal from L2 to L1, and credit funds to the recipient's balance of the\n * L1 ETH token. Since only the xDomainMessenger can call this function, it will never be called\n * before the withdrawal is finalized.\n * @param _from L2 address initiating the transfer.\n * @param _to L1 address to credit the withdrawal to.\n * @param _amount Amount of the ERC20 to deposit.\n * @param _data Optional data to forward to L2. This data is provided\n * solely as a convenience for external contracts. Aside from enforcing a maximum\n * length, these contracts provide no guarantees about its content.\n */\n function finalizeETHWithdrawal(\n address _from,\n address _to,\n uint256 _amount,\n bytes calldata _data\n ) external;\n}\n" + }, + "contracts/L1/messaging/IL1ERC20Bridge.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >0.5.0 <0.9.0;\n\n/**\n * @title IL1ERC20Bridge\n */\ninterface IL1ERC20Bridge {\n /**********\n * Events *\n **********/\n\n event ERC20DepositInitiated(\n address indexed _l1Token,\n address indexed _l2Token,\n address indexed _from,\n address _to,\n uint256 _amount,\n bytes _data\n );\n\n event ERC20WithdrawalFinalized(\n address indexed _l1Token,\n address indexed _l2Token,\n address indexed _from,\n address _to,\n uint256 _amount,\n bytes _data\n );\n\n /********************\n * Public Functions *\n ********************/\n\n /**\n * @dev get the address of the corresponding L2 bridge contract.\n * @return Address of the corresponding L2 bridge contract.\n */\n function l2TokenBridge() external returns (address);\n\n /**\n * @dev deposit an amount of the ERC20 to the caller's balance on L2.\n * @param _l1Token Address of the L1 ERC20 we are depositing\n * @param _l2Token Address of the L1 respective L2 ERC20\n * @param _amount Amount of the ERC20 to deposit\n * @param _l2Gas Gas limit required to complete the deposit on L2.\n * @param _data Optional data to forward to L2. This data is provided\n * solely as a convenience for external contracts. Aside from enforcing a maximum\n * length, these contracts provide no guarantees about its content.\n */\n function depositERC20(\n address _l1Token,\n address _l2Token,\n uint256 _amount,\n uint32 _l2Gas,\n bytes calldata _data\n ) external;\n\n /**\n * @dev deposit an amount of ERC20 to a recipient's balance on L2.\n * @param _l1Token Address of the L1 ERC20 we are depositing\n * @param _l2Token Address of the L1 respective L2 ERC20\n * @param _to L2 address to credit the withdrawal to.\n * @param _amount Amount of the ERC20 to deposit.\n * @param _l2Gas Gas limit required to complete the deposit on L2.\n * @param _data Optional data to forward to L2. This data is provided\n * solely as a convenience for external contracts. Aside from enforcing a maximum\n * length, these contracts provide no guarantees about its content.\n */\n function depositERC20To(\n address _l1Token,\n address _l2Token,\n address _to,\n uint256 _amount,\n uint32 _l2Gas,\n bytes calldata _data\n ) external;\n\n /*************************\n * Cross-chain Functions *\n *************************/\n\n /**\n * @dev Complete a withdrawal from L2 to L1, and credit funds to the recipient's balance of the\n * L1 ERC20 token.\n * This call will fail if the initialized withdrawal from L2 has not been finalized.\n *\n * @param _l1Token Address of L1 token to finalizeWithdrawal for.\n * @param _l2Token Address of L2 token where withdrawal was initiated.\n * @param _from L2 address initiating the transfer.\n * @param _to L1 address to credit the withdrawal to.\n * @param _amount Amount of the ERC20 to deposit.\n * @param _data Data provided by the sender on L2. This data is provided\n * solely as a convenience for external contracts. Aside from enforcing a maximum\n * length, these contracts provide no guarantees about its content.\n */\n function finalizeERC20Withdrawal(\n address _l1Token,\n address _l2Token,\n address _from,\n address _to,\n uint256 _amount,\n bytes calldata _data\n ) external;\n}\n" + }, + "contracts/L2/messaging/IL2ERC20Bridge.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/**\n * @title IL2ERC20Bridge\n */\ninterface IL2ERC20Bridge {\n /**********\n * Events *\n **********/\n\n event WithdrawalInitiated(\n address indexed _l1Token,\n address indexed _l2Token,\n address indexed _from,\n address _to,\n uint256 _amount,\n bytes _data\n );\n\n event DepositFinalized(\n address indexed _l1Token,\n address indexed _l2Token,\n address indexed _from,\n address _to,\n uint256 _amount,\n bytes _data\n );\n\n event DepositFailed(\n address indexed _l1Token,\n address indexed _l2Token,\n address indexed _from,\n address _to,\n uint256 _amount,\n bytes _data\n );\n\n /********************\n * Public Functions *\n ********************/\n\n /**\n * @dev get the address of the corresponding L1 bridge contract.\n * @return Address of the corresponding L1 bridge contract.\n */\n function l1TokenBridge() external returns (address);\n\n /**\n * @dev initiate a withdraw of some tokens to the caller's account on L1\n * @param _l2Token Address of L2 token where withdrawal was initiated.\n * @param _amount Amount of the token to withdraw.\n * param _l1Gas Unused, but included for potential forward compatibility considerations.\n * @param _data Optional data to forward to L1. This data is provided\n * solely as a convenience for external contracts. Aside from enforcing a maximum\n * length, these contracts provide no guarantees about its content.\n */\n function withdraw(\n address _l2Token,\n uint256 _amount,\n uint32 _l1Gas,\n bytes calldata _data\n ) external;\n\n /**\n * @dev initiate a withdraw of some token to a recipient's account on L1.\n * @param _l2Token Address of L2 token where withdrawal is initiated.\n * @param _to L1 adress to credit the withdrawal to.\n * @param _amount Amount of the token to withdraw.\n * param _l1Gas Unused, but included for potential forward compatibility considerations.\n * @param _data Optional data to forward to L1. This data is provided\n * solely as a convenience for external contracts. Aside from enforcing a maximum\n * length, these contracts provide no guarantees about its content.\n */\n function withdrawTo(\n address _l2Token,\n address _to,\n uint256 _amount,\n uint32 _l1Gas,\n bytes calldata _data\n ) external;\n\n /*************************\n * Cross-chain Functions *\n *************************/\n\n /**\n * @dev Complete a deposit from L1 to L2, and credits funds to the recipient's balance of this\n * L2 token. This call will fail if it did not originate from a corresponding deposit in\n * L1StandardTokenBridge.\n * @param _l1Token Address for the l1 token this is called with\n * @param _l2Token Address for the l2 token this is called with\n * @param _from Account to pull the deposit from on L2.\n * @param _to Address to receive the withdrawal at\n * @param _amount Amount of the token to withdraw\n * @param _data Data provider by the sender on L1. This data is provided\n * solely as a convenience for external contracts. Aside from enforcing a maximum\n * length, these contracts provide no guarantees about its content.\n */\n function finalizeDeposit(\n address _l1Token,\n address _l2Token,\n address _from,\n address _to,\n uint256 _amount,\n bytes calldata _data\n ) external;\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165.sol\";\n\n/**\n * @dev Library used to query support of an interface declared via {IERC165}.\n *\n * Note that these functions return the actual result of the query: they do not\n * `revert` if an interface is not supported. It is up to the caller to decide\n * what to do in these cases.\n */\nlibrary ERC165Checker {\n // As per the EIP-165 spec, no interface should ever match 0xffffffff\n bytes4 private constant _INTERFACE_ID_INVALID = 0xffffffff;\n\n /**\n * @dev Returns true if `account` supports the {IERC165} interface,\n */\n function supportsERC165(address account) internal view returns (bool) {\n // Any contract that implements ERC165 must explicitly indicate support of\n // InterfaceId_ERC165 and explicitly indicate non-support of InterfaceId_Invalid\n return\n _supportsERC165Interface(account, type(IERC165).interfaceId) &&\n !_supportsERC165Interface(account, _INTERFACE_ID_INVALID);\n }\n\n /**\n * @dev Returns true if `account` supports the interface defined by\n * `interfaceId`. Support for {IERC165} itself is queried automatically.\n *\n * See {IERC165-supportsInterface}.\n */\n function supportsInterface(address account, bytes4 interfaceId) internal view returns (bool) {\n // query support of both ERC165 as per the spec and support of _interfaceId\n return supportsERC165(account) && _supportsERC165Interface(account, interfaceId);\n }\n\n /**\n * @dev Returns a boolean array where each value corresponds to the\n * interfaces passed in and whether they're supported or not. This allows\n * you to batch check interfaces for a contract where your expectation\n * is that some interfaces may not be supported.\n *\n * See {IERC165-supportsInterface}.\n *\n * _Available since v3.4._\n */\n function getSupportedInterfaces(address account, bytes4[] memory interfaceIds)\n internal\n view\n returns (bool[] memory)\n {\n // an array of booleans corresponding to interfaceIds and whether they're supported or not\n bool[] memory interfaceIdsSupported = new bool[](interfaceIds.length);\n\n // query support of ERC165 itself\n if (supportsERC165(account)) {\n // query support of each interface in interfaceIds\n for (uint256 i = 0; i < interfaceIds.length; i++) {\n interfaceIdsSupported[i] = _supportsERC165Interface(account, interfaceIds[i]);\n }\n }\n\n return interfaceIdsSupported;\n }\n\n /**\n * @dev Returns true if `account` supports all the interfaces defined in\n * `interfaceIds`. Support for {IERC165} itself is queried automatically.\n *\n * Batch-querying can lead to gas savings by skipping repeated checks for\n * {IERC165} support.\n *\n * See {IERC165-supportsInterface}.\n */\n function supportsAllInterfaces(address account, bytes4[] memory interfaceIds) internal view returns (bool) {\n // query support of ERC165 itself\n if (!supportsERC165(account)) {\n return false;\n }\n\n // query support of each interface in _interfaceIds\n for (uint256 i = 0; i < interfaceIds.length; i++) {\n if (!_supportsERC165Interface(account, interfaceIds[i])) {\n return false;\n }\n }\n\n // all interfaces supported\n return true;\n }\n\n /**\n * @notice Query if a contract implements an interface, does not check ERC165 support\n * @param account The address of the contract to query for support of an interface\n * @param interfaceId The interface identifier, as specified in ERC-165\n * @return true if the contract at account indicates support of the interface with\n * identifier interfaceId, false otherwise\n * @dev Assumes that account contains a contract that supports ERC165, otherwise\n * the behavior of this method is undefined. This precondition can be checked\n * with {supportsERC165}.\n * Interface identification is specified in ERC-165.\n */\n function _supportsERC165Interface(address account, bytes4 interfaceId) private view returns (bool) {\n bytes memory encodedParams = abi.encodeWithSelector(IERC165.supportsInterface.selector, interfaceId);\n (bool success, bytes memory result) = account.staticcall{gas: 30000}(encodedParams);\n if (result.length < 32) return false;\n return success && abi.decode(result, (bool));\n }\n}\n" + }, + "contracts/libraries/bridge/CrossDomainEnabled.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >0.5.0 <0.9.0;\n\n/* Interface Imports */\nimport { ICrossDomainMessenger } from \"./ICrossDomainMessenger.sol\";\n\n/**\n * @title CrossDomainEnabled\n * @dev Helper contract for contracts performing cross-domain communications\n *\n * Compiler used: defined by inheriting contract\n */\ncontract CrossDomainEnabled {\n /*************\n * Variables *\n *************/\n\n // Messenger contract used to send and recieve messages from the other domain.\n address public messenger;\n\n /***************\n * Constructor *\n ***************/\n\n /**\n * @param _messenger Address of the CrossDomainMessenger on the current layer.\n */\n constructor(address _messenger) {\n messenger = _messenger;\n }\n\n /**********************\n * Function Modifiers *\n **********************/\n\n /**\n * Enforces that the modified function is only callable by a specific cross-domain account.\n * @param _sourceDomainAccount The only account on the originating domain which is\n * authenticated to call this function.\n */\n modifier onlyFromCrossDomainAccount(address _sourceDomainAccount) {\n require(\n msg.sender == address(getCrossDomainMessenger()),\n \"OVM_XCHAIN: messenger contract unauthenticated\"\n );\n\n require(\n getCrossDomainMessenger().xDomainMessageSender() == _sourceDomainAccount,\n \"OVM_XCHAIN: wrong sender of cross-domain message\"\n );\n\n _;\n }\n\n /**********************\n * Internal Functions *\n **********************/\n\n /**\n * Gets the messenger, usually from storage. This function is exposed in case a child contract\n * needs to override.\n * @return The address of the cross-domain messenger contract which should be used.\n */\n function getCrossDomainMessenger() internal virtual returns (ICrossDomainMessenger) {\n return ICrossDomainMessenger(messenger);\n }\n\n /**q\n * Sends a message to an account on another domain\n * @param _crossDomainTarget The intended recipient on the destination domain\n * @param _message The data to send to the target (usually calldata to a function with\n * `onlyFromCrossDomainAccount()`)\n * @param _gasLimit The gasLimit for the receipt of the message on the target domain.\n */\n function sendCrossDomainMessage(\n address _crossDomainTarget,\n uint32 _gasLimit,\n bytes memory _message\n ) internal {\n // slither-disable-next-line reentrancy-events, reentrancy-benign\n getCrossDomainMessenger().sendMessage(_crossDomainTarget, _message, _gasLimit);\n }\n}\n" + }, + "contracts/standards/IL2StandardERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport { IERC165 } from \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\n\ninterface IL2StandardERC20 is IERC20, IERC165 {\n function l1Token() external returns (address);\n\n function mint(address _to, uint256 _amount) external;\n\n function burn(address _from, uint256 _amount) external;\n\n event Mint(address indexed _account, uint256 _amount);\n event Burn(address indexed _account, uint256 _amount);\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) external returns (bool);\n\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n}\n" + }, + "contracts/standards/L2StandardERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\nimport { ERC20 } from \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"./IL2StandardERC20.sol\";\n\ncontract L2StandardERC20 is IL2StandardERC20, ERC20 {\n address public l1Token;\n address public l2Bridge;\n\n /**\n * @param _l2Bridge Address of the L2 standard bridge.\n * @param _l1Token Address of the corresponding L1 token.\n * @param _name ERC20 name.\n * @param _symbol ERC20 symbol.\n */\n constructor(\n address _l2Bridge,\n address _l1Token,\n string memory _name,\n string memory _symbol\n ) ERC20(_name, _symbol) {\n l1Token = _l1Token;\n l2Bridge = _l2Bridge;\n }\n\n modifier onlyL2Bridge() {\n require(msg.sender == l2Bridge, \"Only L2 Bridge can mint and burn\");\n _;\n }\n\n // slither-disable-next-line external-function\n function supportsInterface(bytes4 _interfaceId) public pure returns (bool) {\n bytes4 firstSupportedInterface = bytes4(keccak256(\"supportsInterface(bytes4)\")); // ERC165\n bytes4 secondSupportedInterface = IL2StandardERC20.l1Token.selector ^\n IL2StandardERC20.mint.selector ^\n IL2StandardERC20.burn.selector;\n return _interfaceId == firstSupportedInterface || _interfaceId == secondSupportedInterface;\n }\n\n // slither-disable-next-line external-function\n function mint(address _to, uint256 _amount) public virtual onlyL2Bridge {\n _mint(_to, _amount);\n\n emit Mint(_to, _amount);\n }\n\n // slither-disable-next-line external-function\n function burn(address _from, uint256 _amount) public virtual onlyL2Bridge {\n _burn(_from, _amount);\n\n emit Burn(_from, _amount);\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `recipient` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address recipient, uint256 amount) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * Requirements:\n *\n * - `sender` and `recipient` cannot be the zero address.\n * - `sender` must have a balance of at least `amount`.\n * - the caller must have allowance for ``sender``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(currentAllowance >= amount, \"ERC20: transfer amount exceeds allowance\");\n unchecked {\n _approve(sender, _msgSender(), currentAllowance - amount);\n }\n\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `sender` to `recipient`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `sender` cannot be the zero address.\n * - `recipient` cannot be the zero address.\n * - `sender` must have a balance of at least `amount`.\n */\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(sender, recipient, amount);\n\n uint256 senderBalance = _balances[sender];\n require(senderBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[sender] = senderBalance - amount;\n }\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n\n _afterTokenTransfer(sender, recipient, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n _balances[account] += amount;\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n }\n _totalSupply -= amount;\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "contracts/L2/predeploys/OVM_ETH.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Library Imports */\nimport { Lib_PredeployAddresses } from \"../../libraries/constants/Lib_PredeployAddresses.sol\";\n\n/* Contract Imports */\nimport { L2StandardERC20 } from \"../../standards/L2StandardERC20.sol\";\n\n/**\n * @title OVM_ETH\n * @dev The ETH predeploy provides an ERC20 interface for ETH deposited to Layer 2. Note that\n * unlike on Layer 1, Layer 2 accounts do not have a balance field.\n */\ncontract OVM_ETH is L2StandardERC20 {\n /***************\n * Constructor *\n ***************/\n\n constructor()\n L2StandardERC20(Lib_PredeployAddresses.L2_STANDARD_BRIDGE, address(0), \"Ether\", \"ETH\")\n {}\n\n // ETH ERC20 features are disabled until further notice.\n // Discussion here: https://github.com/ethereum-optimism/optimism/discussions/1444\n\n function transfer(address recipient, uint256 amount) public virtual override returns (bool) {\n revert(\"OVM_ETH: transfer is disabled pending further community discussion.\");\n }\n\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n revert(\"OVM_ETH: approve is disabled pending further community discussion.\");\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n revert(\"OVM_ETH: transferFrom is disabled pending further community discussion.\");\n }\n\n function increaseAllowance(address spender, uint256 addedValue)\n public\n virtual\n override\n returns (bool)\n {\n revert(\"OVM_ETH: increaseAllowance is disabled pending further community discussion.\");\n }\n\n function decreaseAllowance(address spender, uint256 subtractedValue)\n public\n virtual\n override\n returns (bool)\n {\n revert(\"OVM_ETH: decreaseAllowance is disabled pending further community discussion.\");\n }\n}\n" + }, + "contracts/test-helpers/TestERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\nimport { ERC20 } from \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\n\ncontract TestERC20 is ERC20 {\n constructor() ERC20(\"TEST\", \"TST\") {}\n\n function mint(address to, uint256 value) public {\n _mint(to, value);\n }\n}\n" + }, + "contracts/test-libraries/utils/TestLib_BytesUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Library Imports */\nimport { Lib_BytesUtils } from \"../../libraries/utils/Lib_BytesUtils.sol\";\nimport { TestERC20 } from \"../../test-helpers/TestERC20.sol\";\n\n/**\n * @title TestLib_BytesUtils\n */\ncontract TestLib_BytesUtils {\n function concat(bytes memory _preBytes, bytes memory _postBytes)\n public\n pure\n returns (bytes memory)\n {\n return abi.encodePacked(_preBytes, _postBytes);\n }\n\n function slice(\n bytes memory _bytes,\n uint256 _start,\n uint256 _length\n ) public pure returns (bytes memory) {\n return Lib_BytesUtils.slice(_bytes, _start, _length);\n }\n\n function toBytes32(bytes memory _bytes) public pure returns (bytes32) {\n return Lib_BytesUtils.toBytes32(_bytes);\n }\n\n function toUint256(bytes memory _bytes) public pure returns (uint256) {\n return Lib_BytesUtils.toUint256(_bytes);\n }\n\n function toNibbles(bytes memory _bytes) public pure returns (bytes memory) {\n return Lib_BytesUtils.toNibbles(_bytes);\n }\n\n function fromNibbles(bytes memory _bytes) public pure returns (bytes memory) {\n return Lib_BytesUtils.fromNibbles(_bytes);\n }\n\n function equal(bytes memory _bytes, bytes memory _other) public pure returns (bool) {\n return Lib_BytesUtils.equal(_bytes, _other);\n }\n\n function sliceWithTaintedMemory(\n bytes memory _bytes,\n uint256 _start,\n uint256 _length\n ) public returns (bytes memory) {\n new TestERC20();\n return Lib_BytesUtils.slice(_bytes, _start, _length);\n }\n}\n" + }, + "contracts/test-libraries/trie/TestLib_MerkleTrie.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Library Imports */\nimport { Lib_MerkleTrie } from \"../../libraries/trie/Lib_MerkleTrie.sol\";\n\n/**\n * @title TestLib_MerkleTrie\n */\ncontract TestLib_MerkleTrie {\n function verifyInclusionProof(\n bytes memory _key,\n bytes memory _value,\n bytes memory _proof,\n bytes32 _root\n ) public pure returns (bool) {\n return Lib_MerkleTrie.verifyInclusionProof(_key, _value, _proof, _root);\n }\n\n function get(\n bytes memory _key,\n bytes memory _proof,\n bytes32 _root\n ) public pure returns (bool, bytes memory) {\n return Lib_MerkleTrie.get(_key, _proof, _root);\n }\n}\n" + }, + "contracts/test-libraries/rlp/TestLib_RLPWriter.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Library Imports */\nimport { Lib_RLPWriter } from \"../../libraries/rlp/Lib_RLPWriter.sol\";\nimport { TestERC20 } from \"../../test-helpers/TestERC20.sol\";\n\n/**\n * @title TestLib_RLPWriter\n */\ncontract TestLib_RLPWriter {\n function writeBytes(bytes memory _in) public pure returns (bytes memory _out) {\n return Lib_RLPWriter.writeBytes(_in);\n }\n\n function writeList(bytes[] memory _in) public pure returns (bytes memory _out) {\n return Lib_RLPWriter.writeList(_in);\n }\n\n function writeString(string memory _in) public pure returns (bytes memory _out) {\n return Lib_RLPWriter.writeString(_in);\n }\n\n function writeAddress(address _in) public pure returns (bytes memory _out) {\n return Lib_RLPWriter.writeAddress(_in);\n }\n\n function writeUint(uint256 _in) public pure returns (bytes memory _out) {\n return Lib_RLPWriter.writeUint(_in);\n }\n\n function writeBool(bool _in) public pure returns (bytes memory _out) {\n return Lib_RLPWriter.writeBool(_in);\n }\n\n function writeAddressWithTaintedMemory(address _in) public returns (bytes memory _out) {\n new TestERC20();\n return Lib_RLPWriter.writeAddress(_in);\n }\n}\n" + }, + "contracts/test-libraries/rlp/TestLib_RLPReader.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Library Imports */\nimport { Lib_RLPReader } from \"../../libraries/rlp/Lib_RLPReader.sol\";\n\n/**\n * @title TestLib_RLPReader\n */\ncontract TestLib_RLPReader {\n function readList(bytes memory _in) public pure returns (bytes[] memory) {\n Lib_RLPReader.RLPItem[] memory decoded = Lib_RLPReader.readList(_in);\n bytes[] memory out = new bytes[](decoded.length);\n for (uint256 i = 0; i < out.length; i++) {\n out[i] = Lib_RLPReader.readRawBytes(decoded[i]);\n }\n return out;\n }\n\n function readString(bytes memory _in) public pure returns (string memory) {\n return Lib_RLPReader.readString(_in);\n }\n\n function readBytes(bytes memory _in) public pure returns (bytes memory) {\n return Lib_RLPReader.readBytes(_in);\n }\n\n function readBytes32(bytes memory _in) public pure returns (bytes32) {\n return Lib_RLPReader.readBytes32(_in);\n }\n\n function readUint256(bytes memory _in) public pure returns (uint256) {\n return Lib_RLPReader.readUint256(_in);\n }\n\n function readBool(bytes memory _in) public pure returns (bool) {\n return Lib_RLPReader.readBool(_in);\n }\n\n function readAddress(bytes memory _in) public pure returns (address) {\n return Lib_RLPReader.readAddress(_in);\n }\n}\n" + }, + "contracts/test-libraries/trie/TestLib_SecureMerkleTrie.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Library Imports */\nimport { Lib_SecureMerkleTrie } from \"../../libraries/trie/Lib_SecureMerkleTrie.sol\";\n\n/**\n * @title TestLib_SecureMerkleTrie\n */\ncontract TestLib_SecureMerkleTrie {\n function verifyInclusionProof(\n bytes memory _key,\n bytes memory _value,\n bytes memory _proof,\n bytes32 _root\n ) public pure returns (bool) {\n return Lib_SecureMerkleTrie.verifyInclusionProof(_key, _value, _proof, _root);\n }\n\n function get(\n bytes memory _key,\n bytes memory _proof,\n bytes32 _root\n ) public pure returns (bool, bytes memory) {\n return Lib_SecureMerkleTrie.get(_key, _proof, _root);\n }\n}\n" + }, + "contracts/L2/teleportr/TeleportrDisburser.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.9;\n\nimport { Ownable } from \"@openzeppelin/contracts/access/Ownable.sol\";\n\n/**\n * @title TeleportrDisburser\n */\ncontract TeleportrDisburser is Ownable {\n /**\n * @notice A struct holding the address and amount to disbursement.\n */\n struct Disbursement {\n uint256 amount;\n address addr;\n }\n\n /// The total number of disbursements processed.\n uint256 public totalDisbursements;\n\n /**\n * @notice Emitted any time the balance is withdrawn by the owner.\n * @param owner The current owner and recipient of the funds.\n * @param balance The current contract balance paid to the owner.\n */\n event BalanceWithdrawn(address indexed owner, uint256 balance);\n\n /**\n * @notice Emitted any time a disbursement is successfuly sent.\n * @param depositId The unique sequence number identifying the deposit.\n * @param to The recipient of the disbursement.\n * @param amount The amount sent to the recipient.\n */\n event DisbursementSuccess(uint256 indexed depositId, address indexed to, uint256 amount);\n\n /**\n * @notice Emitted any time a disbursement fails to send.\n * @param depositId The unique sequence number identifying the deposit.\n * @param to The intended recipient of the disbursement.\n * @param amount The amount intended to be sent to the recipient.\n */\n event DisbursementFailed(uint256 indexed depositId, address indexed to, uint256 amount);\n\n /**\n * @notice Initializes a new TeleportrDisburser contract.\n */\n constructor() {\n totalDisbursements = 0;\n }\n\n /**\n * @notice Accepts a list of Disbursements and forwards the amount paid to\n * the contract to each recipient. The method reverts if there are zero\n * disbursements, the total amount to forward differs from the amount sent\n * in the transaction, or the _nextDepositId is unexpected. Failed\n * disbursements will not cause the method to revert, but will instead be\n * held by the contract and availabe for the owner to withdraw.\n * @param _nextDepositId The depositId of the first Dispursement.\n * @param _disbursements A list of Disbursements to process.\n */\n function disburse(uint256 _nextDepositId, Disbursement[] calldata _disbursements)\n external\n payable\n onlyOwner\n {\n // Ensure there are disbursements to process.\n uint256 _numDisbursements = _disbursements.length;\n require(_numDisbursements > 0, \"No disbursements\");\n\n // Ensure the _nextDepositId matches our expected value.\n uint256 _depositId = totalDisbursements;\n require(_depositId == _nextDepositId, \"Unexpected next deposit id\");\n unchecked {\n totalDisbursements += _numDisbursements;\n }\n\n // Ensure the amount sent in the transaction is equal to the sum of the\n // disbursements.\n uint256 _totalDisbursed = 0;\n for (uint256 i = 0; i < _numDisbursements; i++) {\n _totalDisbursed += _disbursements[i].amount;\n }\n require(_totalDisbursed == msg.value, \"Disbursement total != amount sent\");\n\n // Process disbursements.\n for (uint256 i = 0; i < _numDisbursements; i++) {\n uint256 _amount = _disbursements[i].amount;\n address _addr = _disbursements[i].addr;\n\n // Deliver the dispursement amount to the receiver. If the\n // disbursement fails, the amount will be kept by the contract\n // rather than reverting to prevent blocking progress on other\n // disbursements.\n\n // slither-disable-next-line calls-loop,reentrancy-events\n (bool success, ) = _addr.call{ value: _amount, gas: 2300 }(\"\");\n if (success) emit DisbursementSuccess(_depositId, _addr, _amount);\n else emit DisbursementFailed(_depositId, _addr, _amount);\n\n unchecked {\n _depositId += 1;\n }\n }\n }\n\n /**\n * @notice Sends the contract's current balance to the owner.\n */\n function withdrawBalance() external onlyOwner {\n address _owner = owner();\n uint256 balance = address(this).balance;\n emit BalanceWithdrawn(_owner, balance);\n payable(_owner).transfer(balance);\n }\n}\n" + }, + "contracts/L2/predeploys/OVM_GasPriceOracle.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* External Imports */\nimport { Ownable } from \"@openzeppelin/contracts/access/Ownable.sol\";\n\n/**\n * @title OVM_GasPriceOracle\n * @dev This contract exposes the current l2 gas price, a measure of how congested the network\n * currently is. This measure is used by the Sequencer to determine what fee to charge for\n * transactions. When the system is more congested, the l2 gas price will increase and fees\n * will also increase as a result.\n *\n * All public variables are set while generating the initial L2 state. The\n * constructor doesn't run in practice as the L2 state generation script uses\n * the deployed bytecode instead of running the initcode.\n */\ncontract OVM_GasPriceOracle is Ownable {\n /*************\n * Variables *\n *************/\n\n // Current L2 gas price\n uint256 public gasPrice;\n // Current L1 base fee\n uint256 public l1BaseFee;\n // Amortized cost of batch submission per transaction\n uint256 public overhead;\n // Value to scale the fee up by\n uint256 public scalar;\n // Number of decimals of the scalar\n uint256 public decimals;\n\n /***************\n * Constructor *\n ***************/\n\n /**\n * @param _owner Address that will initially own this contract.\n */\n constructor(address _owner) Ownable() {\n transferOwnership(_owner);\n }\n\n /**********\n * Events *\n **********/\n\n event GasPriceUpdated(uint256);\n event L1BaseFeeUpdated(uint256);\n event OverheadUpdated(uint256);\n event ScalarUpdated(uint256);\n event DecimalsUpdated(uint256);\n\n /********************\n * Public Functions *\n ********************/\n\n /**\n * Allows the owner to modify the l2 gas price.\n * @param _gasPrice New l2 gas price.\n */\n // slither-disable-next-line external-function\n function setGasPrice(uint256 _gasPrice) public onlyOwner {\n gasPrice = _gasPrice;\n emit GasPriceUpdated(_gasPrice);\n }\n\n /**\n * Allows the owner to modify the l1 base fee.\n * @param _baseFee New l1 base fee\n */\n // slither-disable-next-line external-function\n function setL1BaseFee(uint256 _baseFee) public onlyOwner {\n l1BaseFee = _baseFee;\n emit L1BaseFeeUpdated(_baseFee);\n }\n\n /**\n * Allows the owner to modify the overhead.\n * @param _overhead New overhead\n */\n // slither-disable-next-line external-function\n function setOverhead(uint256 _overhead) public onlyOwner {\n overhead = _overhead;\n emit OverheadUpdated(_overhead);\n }\n\n /**\n * Allows the owner to modify the scalar.\n * @param _scalar New scalar\n */\n // slither-disable-next-line external-function\n function setScalar(uint256 _scalar) public onlyOwner {\n scalar = _scalar;\n emit ScalarUpdated(_scalar);\n }\n\n /**\n * Allows the owner to modify the decimals.\n * @param _decimals New decimals\n */\n // slither-disable-next-line external-function\n function setDecimals(uint256 _decimals) public onlyOwner {\n decimals = _decimals;\n emit DecimalsUpdated(_decimals);\n }\n\n /**\n * Computes the L1 portion of the fee\n * based on the size of the RLP encoded tx\n * and the current l1BaseFee\n * @param _data Unsigned RLP encoded tx, 6 elements\n * @return L1 fee that should be paid for the tx\n */\n // slither-disable-next-line external-function\n function getL1Fee(bytes memory _data) public view returns (uint256) {\n uint256 l1GasUsed = getL1GasUsed(_data);\n uint256 l1Fee = l1GasUsed * l1BaseFee;\n uint256 divisor = 10**decimals;\n uint256 unscaled = l1Fee * scalar;\n uint256 scaled = unscaled / divisor;\n return scaled;\n }\n\n // solhint-disable max-line-length\n /**\n * Computes the amount of L1 gas used for a transaction\n * The overhead represents the per batch gas overhead of\n * posting both transaction and state roots to L1 given larger\n * batch sizes.\n * 4 gas for 0 byte\n * https://github.com/ethereum/go-ethereum/blob/9ada4a2e2c415e6b0b51c50e901336872e028872/params/protocol_params.go#L33\n * 16 gas for non zero byte\n * https://github.com/ethereum/go-ethereum/blob/9ada4a2e2c415e6b0b51c50e901336872e028872/params/protocol_params.go#L87\n * This will need to be updated if calldata gas prices change\n * Account for the transaction being unsigned\n * Padding is added to account for lack of signature on transaction\n * 1 byte for RLP V prefix\n * 1 byte for V\n * 1 byte for RLP R prefix\n * 32 bytes for R\n * 1 byte for RLP S prefix\n * 32 bytes for S\n * Total: 68 bytes of padding\n * @param _data Unsigned RLP encoded tx, 6 elements\n * @return Amount of L1 gas used for a transaction\n */\n // solhint-enable max-line-length\n function getL1GasUsed(bytes memory _data) public view returns (uint256) {\n uint256 total = 0;\n for (uint256 i = 0; i < _data.length; i++) {\n if (_data[i] == 0) {\n total += 4;\n } else {\n total += 16;\n }\n }\n uint256 unsigned = total + overhead;\n return unsigned + (68 * 16);\n }\n}\n" + }, + "contracts/L1/teleportr/TeleportrDeposit.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.9;\n\nimport { Ownable } from \"@openzeppelin/contracts/access/Ownable.sol\";\n\n/**\n * @title TeleportrDeposit\n *\n * Shout out to 0xclem for providing the inspiration for this contract:\n * https://github.com/0xclem/teleportr/blob/main/contracts/BridgeDeposit.sol\n */\ncontract TeleportrDeposit is Ownable {\n /// The minimum amount that be deposited in a receive.\n uint256 public minDepositAmount;\n /// The maximum amount that be deposited in a receive.\n uint256 public maxDepositAmount;\n /// The maximum balance the contract can hold after a receive.\n uint256 public maxBalance;\n /// The total number of successful deposits received.\n uint256 public totalDeposits;\n\n /**\n * @notice Emitted any time the minimum deposit amount is set.\n * @param previousAmount The previous minimum deposit amount.\n * @param newAmount The new minimum deposit amount.\n */\n event MinDepositAmountSet(uint256 previousAmount, uint256 newAmount);\n\n /**\n * @notice Emitted any time the maximum deposit amount is set.\n * @param previousAmount The previous maximum deposit amount.\n * @param newAmount The new maximum deposit amount.\n */\n event MaxDepositAmountSet(uint256 previousAmount, uint256 newAmount);\n\n /**\n * @notice Emitted any time the contract maximum balance is set.\n * @param previousBalance The previous maximum contract balance.\n * @param newBalance The new maximum contract balance.\n */\n event MaxBalanceSet(uint256 previousBalance, uint256 newBalance);\n\n /**\n * @notice Emitted any time the balance is withdrawn by the owner.\n * @param owner The current owner and recipient of the funds.\n * @param balance The current contract balance paid to the owner.\n */\n event BalanceWithdrawn(address indexed owner, uint256 balance);\n\n /**\n * @notice Emitted any time a successful deposit is received.\n * @param depositId A unique sequencer number identifying the deposit.\n * @param emitter The sending address of the payer.\n * @param amount The amount deposited by the payer.\n */\n event EtherReceived(uint256 indexed depositId, address indexed emitter, uint256 indexed amount);\n\n /**\n * @notice Initializes a new TeleportrDeposit contract.\n * @param _minDepositAmount The initial minimum deposit amount.\n * @param _maxDepositAmount The initial maximum deposit amount.\n * @param _maxBalance The initial maximum contract balance.\n */\n constructor(\n uint256 _minDepositAmount,\n uint256 _maxDepositAmount,\n uint256 _maxBalance\n ) {\n minDepositAmount = _minDepositAmount;\n maxDepositAmount = _maxDepositAmount;\n maxBalance = _maxBalance;\n totalDeposits = 0;\n emit MinDepositAmountSet(0, _minDepositAmount);\n emit MaxDepositAmountSet(0, _maxDepositAmount);\n emit MaxBalanceSet(0, _maxBalance);\n }\n\n /**\n * @notice Accepts deposits that will be disbursed to the sender's address on L2.\n * The method reverts if the amount is less than the current\n * minDepositAmount, the amount is greater than the current\n * maxDepositAmount, or the amount causes the contract to exceed its maximum\n * allowed balance.\n */\n receive() external payable {\n require(msg.value >= minDepositAmount, \"Deposit amount is too small\");\n require(msg.value <= maxDepositAmount, \"Deposit amount is too big\");\n require(address(this).balance <= maxBalance, \"Contract max balance exceeded\");\n\n emit EtherReceived(totalDeposits, msg.sender, msg.value);\n unchecked {\n totalDeposits += 1;\n }\n }\n\n /**\n * @notice Sends the contract's current balance to the owner.\n */\n function withdrawBalance() external onlyOwner {\n address _owner = owner();\n uint256 _balance = address(this).balance;\n emit BalanceWithdrawn(_owner, _balance);\n payable(_owner).transfer(_balance);\n }\n\n /**\n * @notice Sets the minimum amount that can be deposited in a receive.\n * @param _minDepositAmount The new minimum deposit amount.\n */\n function setMinAmount(uint256 _minDepositAmount) external onlyOwner {\n emit MinDepositAmountSet(minDepositAmount, _minDepositAmount);\n minDepositAmount = _minDepositAmount;\n }\n\n /**\n * @notice Sets the maximum amount that can be deposited in a receive.\n * @param _maxDepositAmount The new maximum deposit amount.\n */\n function setMaxAmount(uint256 _maxDepositAmount) external onlyOwner {\n emit MaxDepositAmountSet(maxDepositAmount, _maxDepositAmount);\n maxDepositAmount = _maxDepositAmount;\n }\n\n /**\n * @notice Sets the maximum balance the contract can hold after a receive.\n * @param _maxBalance The new maximum contract balance.\n */\n function setMaxBalance(uint256 _maxBalance) external onlyOwner {\n emit MaxBalanceSet(maxBalance, _maxBalance);\n maxBalance = _maxBalance;\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\nimport \"../../../utils/Address.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using Address for address;\n\n function safeTransfer(\n IERC20 token,\n address to,\n uint256 value\n ) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n }\n\n function safeTransferFrom(\n IERC20 token,\n address from,\n address to,\n uint256 value\n ) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n }\n\n /**\n * @dev Deprecated. This function has issues similar to the ones found in\n * {IERC20-approve}, and its usage is discouraged.\n *\n * Whenever possible, use {safeIncreaseAllowance} and\n * {safeDecreaseAllowance} instead.\n */\n function safeApprove(\n IERC20 token,\n address spender,\n uint256 value\n ) internal {\n // safeApprove should only be called when setting an initial allowance,\n // or when resetting it to zero. To increase and decrease it, use\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\n require(\n (value == 0) || (token.allowance(address(this), spender) == 0),\n \"SafeERC20: approve from non-zero to non-zero allowance\"\n );\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n }\n\n function safeIncreaseAllowance(\n IERC20 token,\n address spender,\n uint256 value\n ) internal {\n uint256 newAllowance = token.allowance(address(this), spender) + value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n function safeDecreaseAllowance(\n IERC20 token,\n address spender,\n uint256 value\n ) internal {\n unchecked {\n uint256 oldAllowance = token.allowance(address(this), spender);\n require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n uint256 newAllowance = oldAllowance - value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\n if (returndata.length > 0) {\n // Return data is optional\n require(abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize, which returns 0 for contracts in\n // construction, since the code is only stored at the end of the\n // constructor execution.\n\n uint256 size;\n assembly {\n size := extcodesize(account)\n }\n return size > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n require(isContract(target), \"Address: call to non-contract\");\n\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(isContract(target), \"Address: delegate call to non-contract\");\n\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" + }, + "contracts/L1/messaging/L1StandardBridge.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Interface Imports */\nimport { IL1StandardBridge } from \"./IL1StandardBridge.sol\";\nimport { IL1ERC20Bridge } from \"./IL1ERC20Bridge.sol\";\nimport { IL2ERC20Bridge } from \"../../L2/messaging/IL2ERC20Bridge.sol\";\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\n/* Library Imports */\nimport { CrossDomainEnabled } from \"../../libraries/bridge/CrossDomainEnabled.sol\";\nimport { Lib_PredeployAddresses } from \"../../libraries/constants/Lib_PredeployAddresses.sol\";\nimport { Address } from \"@openzeppelin/contracts/utils/Address.sol\";\nimport { SafeERC20 } from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\n\n/**\n * @title L1StandardBridge\n * @dev The L1 ETH and ERC20 Bridge is a contract which stores deposited L1 funds and standard\n * tokens that are in use on L2. It synchronizes a corresponding L2 Bridge, informing it of deposits\n * and listening to it for newly finalized withdrawals.\n *\n */\ncontract L1StandardBridge is IL1StandardBridge, CrossDomainEnabled {\n using SafeERC20 for IERC20;\n\n /********************************\n * External Contract References *\n ********************************/\n\n address public l2TokenBridge;\n\n // Maps L1 token to L2 token to balance of the L1 token deposited\n mapping(address => mapping(address => uint256)) public deposits;\n\n /***************\n * Constructor *\n ***************/\n\n // This contract lives behind a proxy, so the constructor parameters will go unused.\n constructor() CrossDomainEnabled(address(0)) {}\n\n /******************\n * Initialization *\n ******************/\n\n /**\n * @param _l1messenger L1 Messenger address being used for cross-chain communications.\n * @param _l2TokenBridge L2 standard bridge address.\n */\n // slither-disable-next-line external-function\n function initialize(address _l1messenger, address _l2TokenBridge) public {\n require(messenger == address(0), \"Contract has already been initialized.\");\n messenger = _l1messenger;\n l2TokenBridge = _l2TokenBridge;\n }\n\n /**************\n * Depositing *\n **************/\n\n /** @dev Modifier requiring sender to be EOA. This check could be bypassed by a malicious\n * contract via initcode, but it takes care of the user error we want to avoid.\n */\n modifier onlyEOA() {\n // Used to stop deposits from contracts (avoid accidentally lost tokens)\n require(!Address.isContract(msg.sender), \"Account not EOA\");\n _;\n }\n\n /**\n * @dev This function can be called with no data\n * to deposit an amount of ETH to the caller's balance on L2.\n * Since the receive function doesn't take data, a conservative\n * default amount is forwarded to L2.\n */\n receive() external payable onlyEOA {\n _initiateETHDeposit(msg.sender, msg.sender, 200_000, bytes(\"\"));\n }\n\n /**\n * @inheritdoc IL1StandardBridge\n */\n function depositETH(uint32 _l2Gas, bytes calldata _data) external payable onlyEOA {\n _initiateETHDeposit(msg.sender, msg.sender, _l2Gas, _data);\n }\n\n /**\n * @inheritdoc IL1StandardBridge\n */\n function depositETHTo(\n address _to,\n uint32 _l2Gas,\n bytes calldata _data\n ) external payable {\n _initiateETHDeposit(msg.sender, _to, _l2Gas, _data);\n }\n\n /**\n * @dev Performs the logic for deposits by storing the ETH and informing the L2 ETH Gateway of\n * the deposit.\n * @param _from Account to pull the deposit from on L1.\n * @param _to Account to give the deposit to on L2.\n * @param _l2Gas Gas limit required to complete the deposit on L2.\n * @param _data Optional data to forward to L2. This data is provided\n * solely as a convenience for external contracts. Aside from enforcing a maximum\n * length, these contracts provide no guarantees about its content.\n */\n function _initiateETHDeposit(\n address _from,\n address _to,\n uint32 _l2Gas,\n bytes memory _data\n ) internal {\n // Construct calldata for finalizeDeposit call\n bytes memory message = abi.encodeWithSelector(\n IL2ERC20Bridge.finalizeDeposit.selector,\n address(0),\n Lib_PredeployAddresses.OVM_ETH,\n _from,\n _to,\n msg.value,\n _data\n );\n\n // Send calldata into L2\n // slither-disable-next-line reentrancy-events\n sendCrossDomainMessage(l2TokenBridge, _l2Gas, message);\n\n // slither-disable-next-line reentrancy-events\n emit ETHDepositInitiated(_from, _to, msg.value, _data);\n }\n\n /**\n * @inheritdoc IL1ERC20Bridge\n */\n function depositERC20(\n address _l1Token,\n address _l2Token,\n uint256 _amount,\n uint32 _l2Gas,\n bytes calldata _data\n ) external virtual onlyEOA {\n _initiateERC20Deposit(_l1Token, _l2Token, msg.sender, msg.sender, _amount, _l2Gas, _data);\n }\n\n /**\n * @inheritdoc IL1ERC20Bridge\n */\n function depositERC20To(\n address _l1Token,\n address _l2Token,\n address _to,\n uint256 _amount,\n uint32 _l2Gas,\n bytes calldata _data\n ) external virtual {\n _initiateERC20Deposit(_l1Token, _l2Token, msg.sender, _to, _amount, _l2Gas, _data);\n }\n\n /**\n * @dev Performs the logic for deposits by informing the L2 Deposited Token\n * contract of the deposit and calling a handler to lock the L1 funds. (e.g. transferFrom)\n *\n * @param _l1Token Address of the L1 ERC20 we are depositing\n * @param _l2Token Address of the L1 respective L2 ERC20\n * @param _from Account to pull the deposit from on L1\n * @param _to Account to give the deposit to on L2\n * @param _amount Amount of the ERC20 to deposit.\n * @param _l2Gas Gas limit required to complete the deposit on L2.\n * @param _data Optional data to forward to L2. This data is provided\n * solely as a convenience for external contracts. Aside from enforcing a maximum\n * length, these contracts provide no guarantees about its content.\n */\n function _initiateERC20Deposit(\n address _l1Token,\n address _l2Token,\n address _from,\n address _to,\n uint256 _amount,\n uint32 _l2Gas,\n bytes calldata _data\n ) internal {\n // When a deposit is initiated on L1, the L1 Bridge transfers the funds to itself for future\n // withdrawals. The use of safeTransferFrom enables support of \"broken tokens\" which do not\n // return a boolean value.\n // slither-disable-next-line reentrancy-events, reentrancy-benign\n IERC20(_l1Token).safeTransferFrom(_from, address(this), _amount);\n\n // Construct calldata for _l2Token.finalizeDeposit(_to, _amount)\n bytes memory message = abi.encodeWithSelector(\n IL2ERC20Bridge.finalizeDeposit.selector,\n _l1Token,\n _l2Token,\n _from,\n _to,\n _amount,\n _data\n );\n\n // Send calldata into L2\n // slither-disable-next-line reentrancy-events, reentrancy-benign\n sendCrossDomainMessage(l2TokenBridge, _l2Gas, message);\n\n // slither-disable-next-line reentrancy-benign\n deposits[_l1Token][_l2Token] = deposits[_l1Token][_l2Token] + _amount;\n\n // slither-disable-next-line reentrancy-events\n emit ERC20DepositInitiated(_l1Token, _l2Token, _from, _to, _amount, _data);\n }\n\n /*************************\n * Cross-chain Functions *\n *************************/\n\n /**\n * @inheritdoc IL1StandardBridge\n */\n function finalizeETHWithdrawal(\n address _from,\n address _to,\n uint256 _amount,\n bytes calldata _data\n ) external onlyFromCrossDomainAccount(l2TokenBridge) {\n // slither-disable-next-line reentrancy-events\n (bool success, ) = _to.call{ value: _amount }(new bytes(0));\n require(success, \"TransferHelper::safeTransferETH: ETH transfer failed\");\n\n // slither-disable-next-line reentrancy-events\n emit ETHWithdrawalFinalized(_from, _to, _amount, _data);\n }\n\n /**\n * @inheritdoc IL1ERC20Bridge\n */\n function finalizeERC20Withdrawal(\n address _l1Token,\n address _l2Token,\n address _from,\n address _to,\n uint256 _amount,\n bytes calldata _data\n ) external onlyFromCrossDomainAccount(l2TokenBridge) {\n deposits[_l1Token][_l2Token] = deposits[_l1Token][_l2Token] - _amount;\n\n // When a withdrawal is finalized on L1, the L1 Bridge transfers the funds to the withdrawer\n // slither-disable-next-line reentrancy-events\n IERC20(_l1Token).safeTransfer(_to, _amount);\n\n // slither-disable-next-line reentrancy-events\n emit ERC20WithdrawalFinalized(_l1Token, _l2Token, _from, _to, _amount, _data);\n }\n\n /*****************************\n * Temporary - Migrating ETH *\n *****************************/\n\n /**\n * @dev Adds ETH balance to the account. This is meant to allow for ETH\n * to be migrated from an old gateway to a new gateway.\n * NOTE: This is left for one upgrade only so we are able to receive the migrated ETH from the\n * old contract\n */\n function donateETH() external payable {}\n}\n" + }, + "contracts/L2/messaging/L2StandardTokenFactory.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Contract Imports */\nimport { L2StandardERC20 } from \"../../standards/L2StandardERC20.sol\";\nimport { Lib_PredeployAddresses } from \"../../libraries/constants/Lib_PredeployAddresses.sol\";\n\n/**\n * @title L2StandardTokenFactory\n * @dev Factory contract for creating standard L2 token representations of L1 ERC20s\n * compatible with and working on the standard bridge.\n */\ncontract L2StandardTokenFactory {\n event StandardL2TokenCreated(address indexed _l1Token, address indexed _l2Token);\n\n /**\n * @dev Creates an instance of the standard ERC20 token on L2.\n * @param _l1Token Address of the corresponding L1 token.\n * @param _name ERC20 name.\n * @param _symbol ERC20 symbol.\n */\n function createStandardL2Token(\n address _l1Token,\n string memory _name,\n string memory _symbol\n ) external {\n require(_l1Token != address(0), \"Must provide L1 token address\");\n\n L2StandardERC20 l2Token = new L2StandardERC20(\n Lib_PredeployAddresses.L2_STANDARD_BRIDGE,\n _l1Token,\n _name,\n _symbol\n );\n\n emit StandardL2TokenCreated(_l1Token, address(l2Token));\n }\n}\n" + }, + "contracts/test-libraries/bridge/TestLib_CrossDomainUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Library Imports */\nimport { Lib_CrossDomainUtils } from \"../../libraries/bridge/Lib_CrossDomainUtils.sol\";\n\n/**\n * @title TestLib_CrossDomainUtils\n */\nlibrary TestLib_CrossDomainUtils {\n function encodeXDomainCalldata(\n address _target,\n address _sender,\n bytes memory _message,\n uint256 _messageNonce\n ) public pure returns (bytes memory) {\n return\n Lib_CrossDomainUtils.encodeXDomainCalldata(_target, _sender, _message, _messageNonce);\n }\n}\n" + }, + "contracts/test-libraries/standards/TestLib_AddressAliasHelper.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.8;\n\n/* Library Imports */\nimport { AddressAliasHelper } from \"../../standards/AddressAliasHelper.sol\";\n\n/**\n * @title TestLib_AddressAliasHelper\n */\ncontract TestLib_AddressAliasHelper {\n function applyL1ToL2Alias(address _address) public pure returns (address) {\n return AddressAliasHelper.applyL1ToL2Alias(_address);\n }\n\n function undoL1ToL2Alias(address _address) public pure returns (address) {\n return AddressAliasHelper.undoL1ToL2Alias(_address);\n }\n}\n" + }, + "contracts/test-libraries/utils/TestLib_Bytes32Utils.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Library Imports */\nimport { Lib_Bytes32Utils } from \"../../libraries/utils/Lib_Bytes32Utils.sol\";\n\n/**\n * @title TestLib_Byte32Utils\n */\ncontract TestLib_Bytes32Utils {\n function toBool(bytes32 _in) public pure returns (bool _out) {\n return Lib_Bytes32Utils.toBool(_in);\n }\n\n function fromBool(bool _in) public pure returns (bytes32 _out) {\n return Lib_Bytes32Utils.fromBool(_in);\n }\n\n function toAddress(bytes32 _in) public pure returns (address _out) {\n return Lib_Bytes32Utils.toAddress(_in);\n }\n\n function fromAddress(address _in) public pure returns (bytes32 _out) {\n return Lib_Bytes32Utils.fromAddress(_in);\n }\n}\n" + }, + "contracts/test-libraries/utils/TestLib_MerkleTree.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\n/* Library Imports */\nimport { Lib_MerkleTree } from \"../../libraries/utils/Lib_MerkleTree.sol\";\n\n/**\n * @title TestLib_MerkleTree\n */\ncontract TestLib_MerkleTree {\n function getMerkleRoot(bytes32[] memory _elements) public pure returns (bytes32) {\n return Lib_MerkleTree.getMerkleRoot(_elements);\n }\n\n function verify(\n bytes32 _root,\n bytes32 _leaf,\n uint256 _index,\n bytes32[] memory _siblings,\n uint256 _totalLeaves\n ) public pure returns (bool) {\n return Lib_MerkleTree.verify(_root, _leaf, _index, _siblings, _totalLeaves);\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 10000 + }, + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates", + "devdoc", + "userdoc", + "devdoc", + "userdoc", + "devdoc", + "userdoc", + "devdoc", + "userdoc" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/packages/contracts/package.json b/packages/contracts/package.json index d1e87556e4c1a..fbe07456b9f26 100644 --- a/packages/contracts/package.json +++ b/packages/contracts/package.json @@ -74,7 +74,7 @@ "@nomiclabs/hardhat-etherscan": "^3.0.3", "@nomiclabs/hardhat-waffle": "^2.0.1", "@openzeppelin/contracts": "4.3.2", - "@openzeppelin/contracts-upgradeable": "4.3.2", + "@openzeppelin/contracts-upgradeable": "4.7.1", "@primitivefi/hardhat-dodoc": "^0.1.3", "@typechain/ethers-v5": "^10.1.0", "@typechain/hardhat": "^6.1.2", diff --git a/packages/core-utils/src/external/geth/geth-types.ts b/packages/core-utils/src/external/geth/geth-types.ts index f1888c4df574a..434f54f140aca 100644 --- a/packages/core-utils/src/external/geth/geth-types.ts +++ b/packages/core-utils/src/external/geth/geth-types.ts @@ -36,7 +36,7 @@ export interface ChainConfig { londonBlock?: number arrowGlacierBlock?: number grayGlacierBlock?: number - mergeForkBlock?: number + mergeNetsplitBlock?: number terminalTotalDifficulty?: number clique?: { period: number @@ -66,15 +66,16 @@ export interface Genesis { /** * Represents the chain config for an Optimism chain */ -export interface OptimismChainConfig { - enabled: boolean - baseFeeRecipient: string - l1FeeRecipient: string +export interface OptimismChainConfig extends ChainConfig { + optimism: { + baseFeeRecipient: string + l1FeeRecipient: string + } } /** * Represents the Genesis file format for an Optimism chain */ export interface OptimismGenesis extends Genesis { - optimism: OptimismChainConfig + config: OptimismChainConfig } diff --git a/packages/core-utils/src/optimism/deposit-transaction.ts b/packages/core-utils/src/optimism/deposit-transaction.ts index aab78c9cfe599..c84f6c24a657d 100644 --- a/packages/core-utils/src/optimism/deposit-transaction.ts +++ b/packages/core-utils/src/optimism/deposit-transaction.ts @@ -5,10 +5,13 @@ import { ContractReceipt, ethers, Event, + utils, } from 'ethers' +const { hexDataSlice, stripZeros, hexConcat, keccak256, zeroPad } = utils + const formatNumber = (value: BigNumberish, name: string): Uint8Array => { - const result = ethers.utils.stripZeros(BigNumber.from(value).toHexString()) + const result = stripZeros(BigNumber.from(value).toHexString()) if (result.length > 32) { throw new Error(`invalid length for ${name}`) } @@ -27,7 +30,7 @@ const handleAddress = (value: string): string => { // @ts-ignore return null } - return ethers.utils.getAddress(value) + return utils.getAddress(value) } export enum SourceHashDomain { @@ -88,7 +91,7 @@ export class DepositTx { hash() { const encoded = this.encode() - return ethers.utils.keccak256(encoded) + return keccak256(encoded) } sourceHash() { @@ -110,17 +113,11 @@ export class DepositTx { } const l1BlockHash = this.l1BlockHash - const input = ethers.utils.hexConcat([ - l1BlockHash, - ethers.utils.zeroPad(marker, 32), - ]) - const depositIDHash = ethers.utils.keccak256(input) + const input = hexConcat([l1BlockHash, zeroPad(marker, 32)]) + const depositIDHash = keccak256(input) const domain = BigNumber.from(this.domain).toHexString() - const domainInput = ethers.utils.hexConcat([ - ethers.utils.zeroPad(domain, 32), - depositIDHash, - ]) - this._sourceHash = ethers.utils.keccak256(domainInput) + const domainInput = hexConcat([zeroPad(domain, 32), depositIDHash]) + this._sourceHash = keccak256(domainInput) } return this._sourceHash } @@ -128,29 +125,28 @@ export class DepositTx { encode() { const fields: any = [ this.sourceHash() || '0x', - ethers.utils.getAddress(this.from) || '0x', - this.to != null ? ethers.utils.getAddress(this.to) : '0x', + utils.getAddress(this.from) || '0x', + this.to != null ? utils.getAddress(this.to) : '0x', formatNumber(this.mint || 0, 'mint'), formatNumber(this.value || 0, 'value'), formatNumber(this.gas || 0, 'gas'), this.data || '0x', ] - return ethers.utils.hexConcat([ + return hexConcat([ BigNumber.from(this.type).toHexString(), - BigNumber.from(this.version).toHexString(), - ethers.utils.RLP.encode(fields), + utils.RLP.encode(fields), ]) } decode(raw: BytesLike, extra: DepositTxExtraOpts = {}) { - const payload = ethers.utils.arrayify(raw) + const payload = utils.arrayify(raw) if (payload[0] !== this.type) { throw new Error(`Invalid type ${payload[0]}`) } this.version = payload[1] - const transaction = ethers.utils.RLP.decode(payload.slice(2)) + const transaction = utils.RLP.decode(payload.slice(2)) this._sourceHash = transaction[0] this.from = handleAddress(transaction[1]) this.to = handleAddress(transaction[2]) @@ -204,29 +200,36 @@ export class DepositTx { throw new Error('"from" undefined') } this.from = event.args.from - if (typeof event.args.isCreation === 'undefined') { - throw new Error('"isCreation" undefined') - } if (typeof event.args.to === 'undefined') { throw new Error('"to" undefined') } - this.to = event.args.isCreation ? null : event.args.to - if (typeof event.args.mint === 'undefined') { - throw new Error('"mint" undefined') + if (typeof event.args.version === 'undefined') { + throw new Error(`"verison" undefined`) } - this.mint = event.args.mint - if (typeof event.args.value === 'undefined') { - throw new Error('"value" undefined') + if (!event.args.version.eq(0)) { + throw new Error(`Unsupported version ${event.args.version.toString()}`) } - this.value = event.args.value - if (typeof event.args.gasLimit === 'undefined') { - throw new Error('"gasLimit" undefined') + if (typeof event.args.opaqueData === 'undefined') { + throw new Error(`"opaqueData" undefined`) } - this.gas = event.args.gasLimit - if (typeof event.args.data === 'undefined') { - throw new Error('"data" undefined') + + const opaqueData = event.args.opaqueData + if (opaqueData.length < 32 + 32 + 8 + 1) { + throw new Error(`invalid opaqueData size: ${opaqueData.length}`) } - this.data = event.args.data + + let offset = 0 + this.mint = BigNumber.from(hexDataSlice(opaqueData, offset, offset + 32)) + offset += 32 + this.value = BigNumber.from(hexDataSlice(opaqueData, offset, offset + 32)) + offset += 32 + this.gas = BigNumber.from(hexDataSlice(opaqueData, offset, offset + 8)) + offset += 8 + const isCreation = BigNumber.from(opaqueData[offset]).eq(1) + offset += 1 + this.to = isCreation === true ? null : event.args.to + const length = opaqueData.length - offset + this.data = hexDataSlice(opaqueData, offset, offset + length) this.domain = SourceHashDomain.UserDeposit this.l1BlockHash = event.blockHash this.logIndex = event.logIndex diff --git a/packages/core-utils/src/optimism/encoding.ts b/packages/core-utils/src/optimism/encoding.ts new file mode 100644 index 0000000000000..cb1f58fa73c0b --- /dev/null +++ b/packages/core-utils/src/optimism/encoding.ts @@ -0,0 +1,120 @@ +import { ethers, BigNumberish, BigNumber } from 'ethers' + +const iface = new ethers.utils.Interface([ + 'function relayMessage(address,address,bytes,uint256)', + 'function relayMessage(uint256,address,address,uint256,uint256,bytes)', +]) + +const nonceMask = BigNumber.from( + '0x0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff' +) + +export const big0 = BigNumber.from(0) +export const big1 = BigNumber.from(1) + +/** + * Encodes the version into the nonce. + * + * @param nonce + * @param version + */ +export const encodeVersionedNonce = ( + nonce: BigNumber, + version: BigNumber +): BigNumber => { + return version.or(nonce.shl(240)) +} + +/** + * Decodes the version from the nonce and returns the unversioned nonce as well + * as the version. The version is encoded in the first byte of + * the nonce. Note that this nonce is the nonce held in the + * CrossDomainMessenger. + * + * @param nonce + */ +export const decodeVersionedNonce = (nonce: BigNumber): BigNumber[] => { + return [nonce.and(nonceMask), nonce.shr(240)] +} + +/** + * Encodes a V1 cross domain message. This message format was used before + * bedrock and does not support value transfer because ETH was represented as an + * ERC20 natively. + * + * @param target The target of the cross domain message + * @param sender The sender of the cross domain message + * @param data The data passed along with the cross domain message + * @param nonce The cross domain message nonce + */ +export const encodeCrossDomainMessageV0 = ( + target: string, + sender: string, + data: string, + nonce: BigNumber +) => { + return iface.encodeFunctionData( + 'relayMessage(address,address,bytes,uint256)', + [target, sender, data, nonce] + ) +} + +/** + * Encodes a V1 cross domain message. This message format shipped with bedrock + * and supports value transfer with native ETH. + * + * @param nonce The cross domain message nonce + * @param sender The sender of the cross domain message + * @param target The target of the cross domain message + * @param value The value being sent with the cross domain message + * @param gasLimit The gas limit of the cross domain execution + * @param data The data passed along with the cross domain message + */ +export const encodeCrossDomainMessageV1 = ( + nonce: BigNumber, + sender: string, + target: string, + value: BigNumberish, + gasLimit: BigNumberish, + data: string +) => { + return iface.encodeFunctionData( + 'relayMessage(uint256,address,address,uint256,uint256,bytes)', + [nonce, sender, target, value, gasLimit, data] + ) +} + +/** + * Encodes a cross domain message. The version byte in the nonce determines + * the serialization format that is used. + * + * @param nonce The cross domain message nonce + * @param sender The sender of the cross domain message + * @param target The target of the cross domain message + * @param value The value being sent with the cross domain message + * @param gasLimit The gas limit of the cross domain execution + * @param data The data passed along with the cross domain message + */ +export const encodeCrossDomainMessage = ( + nonce: BigNumber, + sender: string, + target: string, + value: BigNumber, + gasLimit: BigNumber, + data: string +) => { + const [, version] = decodeVersionedNonce(nonce) + if (version.eq(big0)) { + return encodeCrossDomainMessageV0(target, sender, data, nonce) + } else if (version.eq(big1)) { + return encodeCrossDomainMessageV1( + nonce, + sender, + target, + value, + gasLimit, + data + ) + } + throw new Error(`unknown version ${version.toString()}`) +} diff --git a/packages/core-utils/src/optimism/hashing.ts b/packages/core-utils/src/optimism/hashing.ts new file mode 100644 index 0000000000000..d639d18366a53 --- /dev/null +++ b/packages/core-utils/src/optimism/hashing.ts @@ -0,0 +1,140 @@ +import { BigNumberish, BigNumber, utils } from 'ethers' +const { keccak256, defaultAbiCoder } = utils + +import { + decodeVersionedNonce, + encodeCrossDomainMessageV0, + encodeCrossDomainMessageV1, + big0, + big1, +} from './encoding' + +export interface OutputRootProof { + version: string + stateRoot: string + withdrawerStorageRoot: string + latestBlockhash: string +} + +/** + * Hahses a cross domain message. + * + * @param nonce The cross domain message nonce + * @param sender The sender of the cross domain message + * @param target The target of the cross domain message + * @param value The value being sent with the cross domain message + * @param gasLimit The gas limit of the cross domain execution + * @param data The data passed along with the cross domain message + */ +export const hashCrossDomainMessage = ( + nonce: BigNumber, + sender: string, + target: string, + value: BigNumber, + gasLimit: BigNumber, + data: string +) => { + const [, version] = decodeVersionedNonce(nonce) + if (version.eq(big0)) { + return hashCrossDomainMessagev0(target, sender, data, nonce) + } else if (version.eq(big1)) { + return hashCrossDomainMessagev1( + nonce, + sender, + target, + value, + gasLimit, + data + ) + } + throw new Error(`unknown version ${version.toString()}`) +} + +/** + * Hahses a V0 cross domain message + * + * @param target The target of the cross domain message + * @param sender The sender of the cross domain message + * @param data The data passed along with the cross domain message + * @param nonce The cross domain message nonce + */ +export const hashCrossDomainMessagev0 = ( + target: string, + sender: string, + data: string, + nonce: BigNumber +) => { + return keccak256(encodeCrossDomainMessageV0(target, sender, data, nonce)) +} + +/** + * Hahses a V1 cross domain message + * + * @param nonce The cross domain message nonce + * @param sender The sender of the cross domain message + * @param target The target of the cross domain message + * @param value The value being sent with the cross domain message + * @param gasLimit The gas limit of the cross domain execution + * @param data The data passed along with the cross domain message + */ +export const hashCrossDomainMessagev1 = ( + nonce: BigNumber, + sender: string, + target: string, + value: BigNumberish, + gasLimit: BigNumberish, + data: string +) => { + return keccak256( + encodeCrossDomainMessageV1(nonce, sender, target, value, gasLimit, data) + ) +} + +/** + * Hashes a withdrawal + * + * @param nonce The cross domain message nonce + * @param sender The sender of the cross domain message + * @param target The target of the cross domain message + * @param value The value being sent with the cross domain message + * @param gasLimit The gas limit of the cross domain execution + * @param data The data passed along with the cross domain message + */ +export const hashWithdrawal = ( + nonce: BigNumber, + sender: string, + target: string, + value: BigNumber, + gasLimit: BigNumber, + data: string +): string => { + const types = ['uint256', 'address', 'address', 'uint256', 'uint256', 'bytes'] + const encoded = defaultAbiCoder.encode(types, [ + nonce, + sender, + target, + value, + gasLimit, + data, + ]) + return keccak256(encoded) +} + +/** + * Hahses an output root proof + * + * @param proof OutputRootProof + */ +export const hashOutputRootProof = (proof: OutputRootProof): string => { + return keccak256( + defaultAbiCoder.encode( + ['bytes32', 'bytes32', 'bytes32', 'bytes32'], + [ + proof.version, + proof.stateRoot, + proof.withdrawerStorageRoot, + proof.latestBlockhash, + ] + ) + ) +} diff --git a/packages/core-utils/src/optimism/index.ts b/packages/core-utils/src/optimism/index.ts index 36b50eb509fca..5691eb6528542 100644 --- a/packages/core-utils/src/optimism/index.ts +++ b/packages/core-utils/src/optimism/index.ts @@ -8,3 +8,5 @@ export * from './fees' export * from './rollup-types' export * from './op-node' export * from './deposit-transaction' +export * from './encoding' +export * from './hashing' diff --git a/packages/integration-tests-bedrock/test/000_withdrawals.spec.ts b/packages/integration-tests-bedrock/test/000_withdrawals.spec.ts index 759733dc1dd33..7c02f3feb4bd0 100644 --- a/packages/integration-tests-bedrock/test/000_withdrawals.spec.ts +++ b/packages/integration-tests-bedrock/test/000_withdrawals.spec.ts @@ -33,9 +33,7 @@ const getTargetOutput = async ( withdrawalTimestamp: number ) => { const submissionInterval = (await oracle.SUBMISSION_INTERVAL()).toNumber() - const startingTimestamp = ( - await oracle.STARTING_TIMESTAMP() - ).toNumber() + const startingTimestamp = (await oracle.STARTING_TIMESTAMP()).toNumber() const nextTimestamp = (await oracle.nextTimestamp()).toNumber() let targetOutputTimestamp if (withdrawalTimestamp < nextTimestamp) { diff --git a/packages/sdk/src/cross-chain-messenger.ts b/packages/sdk/src/cross-chain-messenger.ts index 65ee4080d4819..f4346793c67cd 100644 --- a/packages/sdk/src/cross-chain-messenger.ts +++ b/packages/sdk/src/cross-chain-messenger.ts @@ -85,8 +85,18 @@ export class CrossChainMessenger implements ICrossChainMessenger { }) { this.l1SignerOrProvider = toSignerOrProvider(opts.l1SignerOrProvider) this.l2SignerOrProvider = toSignerOrProvider(opts.l2SignerOrProvider) - this.l1ChainId = toNumber(opts.l1ChainId) - this.l2ChainId = toNumber(opts.l2ChainId) + + try { + this.l1ChainId = toNumber(opts.l1ChainId) + } catch (err) { + throw new Error(`L1 chain ID is missing or invalid: ${opts.l1ChainId}`) + } + + try { + this.l2ChainId = toNumber(opts.l2ChainId) + } catch (err) { + throw new Error(`L2 chain ID is missing or invalid: ${opts.l2ChainId}`) + } this.depositConfirmationBlocks = opts?.depositConfirmationBlocks !== undefined diff --git a/packages/sdk/src/utils/contracts.ts b/packages/sdk/src/utils/contracts.ts index 8c001cb1b1da1..3f63917ab3481 100644 --- a/packages/sdk/src/utils/contracts.ts +++ b/packages/sdk/src/utils/contracts.ts @@ -89,7 +89,7 @@ export const CONTRACT_ADDRESSES: { '0x5086d1eEF304eb5284A0f6720f79403b4e9bE294' as const, L1StandardBridge: '0x636Af16bf2f682dD3109e60102b8E1A089FedAa8' as const, StateCommitmentChain: - '0x72281826E90dD8A65Ab686fF254eb45Be426DD22' as const, + '0x9c945aC97Baf48cB784AbBB61399beB71aF7A378' as const, CanonicalTransactionChain: '0x607F755149cFEB3a14E1Dc3A4E2450Cde7dfb04D' as const, BondManager: '0xfC2ab6987C578218f99E85d61Dcf4814A26637Bd' as const, diff --git a/packages/sdk/test/cross-chain-messenger.spec.ts b/packages/sdk/test/cross-chain-messenger.spec.ts index 35587af981d75..4b2a78d23c33b 100644 --- a/packages/sdk/test/cross-chain-messenger.spec.ts +++ b/packages/sdk/test/cross-chain-messenger.spec.ts @@ -80,6 +80,32 @@ describe('CrossChainMessenger', () => { }) }) + describe('when given a bad L1 chain ID', () => { + it('should throw an error', () => { + expect(() => { + new CrossChainMessenger({ + l1SignerOrProvider: ethers.provider, + l2SignerOrProvider: ethers.provider, + l1ChainId: undefined as any, + l2ChainId: L2ChainID.OPTIMISM, + }) + }).to.throw('L1 chain ID is missing or invalid') + }) + }) + + describe('when given a bad L2 chain ID', () => { + it('should throw an error', () => { + expect(() => { + new CrossChainMessenger({ + l1SignerOrProvider: ethers.provider, + l2SignerOrProvider: ethers.provider, + l1ChainId: L1ChainID.MAINNET, + l2ChainId: undefined as any, + }) + }).to.throw('L2 chain ID is missing or invalid') + }) + }) + describe('when no custom contract addresses are provided', () => { describe('when given a known chain ID', () => { it('should use the contract addresses for the known chain ID', () => { diff --git a/specs/assets/batch-deriv-chain.svg b/specs/assets/batch-deriv-chain.svg new file mode 100644 index 0000000000000..3a2f7c3b6a249 --- /dev/null +++ b/specs/assets/batch-deriv-chain.svg @@ -0,0 +1,3 @@ + + +
100
100
102
102
101
101
3
3
4
4
5
5
6
6
7
7
8
8
Compressed & encoded batch data
Compressed & encoded batch data
A0
A0
B0
B0
B1
B1
9
9
10
10
11
11
A1
A1
B2
B2
L1 Transactions,
~128 KB each
L1 Transactions,...
Channels,
with timeout
Channels,...
Batches,
1 batch = 1 L2 block tx list
Batches,...
L2 Blocks
(a.k.a. execution payloads)
L2 Blocks...
Channel A, Frame 0
Channel A, Frame 0
Channel A, Frame 1
Channel A, Frame 1
Channel B,
Frame 0
Channel B,...
Channel B, Frame 1
Channel B, Frame 1
Channel B, Frame 2
Channel B, Frame 2
Channel C, etc...
Channel C, etc...
L1 Blocks,
These may not be as
frequent/consistent
as L2 blocks.
L1 Blocks,...
Actual inclusion on L1:
channels are valid
within a timeout
Actual inclusion on L1:...
Channel B was seen first,
and will be decoded into batches first.
Channel B was seen first,...
Batches can be buffered
for up to a full sequencing window
worth of L1 blocks
to get the L2 ordering back.
Batches can be buffered...
Time
Time
older L2 data
older L2 data
B1
B1
B0
B0
A1
A1
B2
B2
A0
A0
100-0
100-0
100-1
100-1
100-2
100-2
100-3
100-3
100-2
100-2
101-0
101-0
99-5
99-5
99-4
99-4
99-3
99-3
99-2
99-2
99
99
Each L2 block has a tx with info
about the "origin" L1 block
Each L2 block has a tx with info...
The "sequence number"
helps differentiate between
L2 blocks with the same origin.
The "sequence number"...
deposit
deposit
deposit
deposit
Deposits are L1 log events,
parsed from EVM receipts
Deposits are L1 log events,...
deposit
deposit
deposit
deposit
Deposits get included
the first L2 block that
adopts the L1 origin the
deposits were made in.
Deposits get included...
Security types on L2:
- "unsafe": not submitted on L1
- "safe": is confirmed on L1
- "finalized": fully derived from finalized L1 data
Security types on L2:...
Security types on L1:
- "unsafe": very new
- "safe": decent attestation ratio
- "finalized": with FFG finality gadget
Security types on L1:...
Text is not SVG - cannot display
\ No newline at end of file diff --git a/specs/assets/batch-deriv-pipeline.svg b/specs/assets/batch-deriv-pipeline.svg new file mode 100644 index 0000000000000..c2769ccde340a --- /dev/null +++ b/specs/assets/batch-deriv-pipeline.svg @@ -0,0 +1,3 @@ + + +
110
110
110
110
110
110
100
100
Batch Queue
Batch Queue
Engine Queue
Engine Queue
PayloadAttributes
Queue
PayloadAttributes...
Channel
Input-reader
Channel...
Channel
Bank
Channel...
L1 Traversal
L1 Traversal
100
100
110
110
L1 Deposits
L1 Deposits
130
130
110
110
110
110
110
110
100
100
100
100
130
130
130
130
130
130
130
130
130
130
130
130
1) find safe L2 block
with canonical L1 origin
1) find safe L2 block...
3) reset all stage origins,
traverse chain back
3) reset all stage orig...
4) dry-run pipeline
to heal stage buffers
4) dry-run pipeline...
5) new L1 data
can now stream into L2
5) new L1 data...
2) Stages with gaps will
reconstruct buffer data
2) Stages with gaps wi...
Numbers for illustration,
referring to L1 origin
block numbers
Numbers for illustrati...
"ResetStep":
reset stage with
distance from next
"ResetStep":...
"Step":
progress pipeline.
Start closest to L2,
visit previous stage
for more input data.
"Step":...
L1 block hash > Data TXs > Channel Frames > Batches > Ordered batches > PayloadAttributes > L2 payloads
L1 block hash > Data TXs > Channel Frames > Batches > Ordered batches > PayloadAttributes > L2 payl...
Resets
Channel
timeout
Resets...
Resets
Sequencing
window
ResetsSequenc...
L1 Retrieval
L1 Retrieval
100
100
100
100
130
130
L1 Data
L1 Data
L1 Chain
L1 Chain
L2 Exec
Engine
L2 Exec...
Reset:
Reset:
110
110
110
110
Text is not SVG - cannot display
\ No newline at end of file diff --git a/specs/bridges.md b/specs/bridges.md index 152e2d009cdb2..5836c41d2c520 100644 --- a/specs/bridges.md +++ b/specs/bridges.md @@ -4,9 +4,8 @@ **Table of Contents** -- [Standard Bridges](#standard-bridges) - - [Token Depositing](#token-depositing) - - [Upgradability](#upgradability) +- [Token Depositing](#token-depositing) +- [Upgradability](#upgradability) diff --git a/specs/deposits.md b/specs/deposits.md index 902313d6ad641..f86d02b6df4d9 100644 --- a/specs/deposits.md +++ b/specs/deposits.md @@ -22,22 +22,21 @@ with the authorization and validation conditions on L2. **Table of Contents** -- [Deposits](#deposits) - - [The Deposited Transaction Type](#the-deposited-transaction-type) - - [Source hash computation](#source-hash-computation) - - [Kinds of Deposited Transactions](#kinds-of-deposited-transactions) - - [Validation and Authorization of Deposited Transactions](#validation-and-authorization-of-deposited-transactions) - - [Execution](#execution) - - [Nonce Handling](#nonce-handling) - - [L1 Attributes Deposited Transaction](#l1-attributes-deposited-transaction) - - [Special Accounts on L2](#special-accounts-on-l2) - - [L1 Attributes Depositor Account](#l1-attributes-depositor-account) - - [L1 Attributes Predeployed Contract](#l1-attributes-predeployed-contract) - - [L1 Attributes Predeployed Contract: Reference Implementation](#l1-attributes-predeployed-contract-reference-implementation) - - [User-Deposited Transactions](#user-deposited-transactions) - - [Deposit Contract](#deposit-contract) - - [Address Aliasing](#address-aliasing) - - [Deposit Feed Contract: Reference Implementation](#deposit-feed-contract-reference-implementation) +- [The Deposited Transaction Type](#the-deposited-transaction-type) + - [Source hash computation](#source-hash-computation) + - [Kinds of Deposited Transactions](#kinds-of-deposited-transactions) + - [Validation and Authorization of Deposited Transactions](#validation-and-authorization-of-deposited-transactions) + - [Execution](#execution) + - [Nonce Handling](#nonce-handling) +- [L1 Attributes Deposited Transaction](#l1-attributes-deposited-transaction) +- [Special Accounts on L2](#special-accounts-on-l2) + - [L1 Attributes Depositor Account](#l1-attributes-depositor-account) + - [L1 Attributes Predeployed Contract](#l1-attributes-predeployed-contract) + - [L1 Attributes Predeployed Contract: Reference Implementation](#l1-attributes-predeployed-contract-reference-implementation) +- [User-Deposited Transactions](#user-deposited-transactions) + - [Deposit Contract](#deposit-contract) + - [Address Aliasing](#address-aliasing) + - [Deposit Feed Contract: Reference Implementation](#deposit-feed-contract-reference-implementation) diff --git a/specs/derivation.md b/specs/derivation.md new file mode 100644 index 0000000000000..7128679339d21 --- /dev/null +++ b/specs/derivation.md @@ -0,0 +1,861 @@ +# L2 Chain Derivation Specification + + +[g-derivation]: glossary.md#L2-chain-derivation +[g-payload-attr]: glossary.md#payload-attributes +[g-block]: glossary.md#block +[g-exec-engine]: glossary.md#execution-engine +[g-reorg]: glossary.md#re-organization +[g-receipts]: glossary.md#receipt +[g-inception]: glossary.md#L2-chain-inception +[g-deposit-contract]: glossary.md#deposit-contract +[g-deposited]: glossary.md#deposited-transaction +[g-l1-attr-deposit]: glossary.md#l1-attributes-deposited-transaction +[g-user-deposited]: glossary.md#user-deposited-transaction +[g-deposits]: glossary.md#deposits +[g-deposit-contract]: glossary.md#deposit-contract +[g-l1-attr-predeploy]: glossary.md#l1-attributes-predeployed-contract +[g-depositing-call]: glossary.md#depositing-call +[g-depositing-transaction]: glossary.md#depositing-transaction +[g-sequencing]: glossary.md#sequencing +[g-sequencer]: glossary.md#sequencer +[g-sequencing-epoch]: glossary.md#sequencing-epoch +[g-sequencing-window]: glossary.md#sequencing-window +[g-sequencer-batch]: glossary.md#sequencer-batch +[g-l2-genesis]: glossary.md#l2-genesis-block +[g-l2-chain-inception]: glossary.md#L2-chain-inception +[g-batcher-transaction]: glossary.md#batcher-transaction +[g-avail-provider]: glossary.md#data-availability-provider +[g-batcher]: glossary.md#batcher +[g-l2-output]: glossary.md#l2-output +[g-fault-proof]: glosary.md#fault-proof +[g-channel]: glossary.md#channel +[g-channel-frame]: glossary.md#channel-frame +[g-rollup-node]: glossary.md#rollup-node +[g-channel-timeout]: glossary.md#channel-timeout +[g-block-time]: glossary.md#block-time +[g-time-slot]: glossary.md#time-slot +[g-consolidation]: glossary.md#unsafe-block-consolidation +[g-safe-l2-head]: glossary.md#safe-l2-head +[g-unsafe-l2-head]: glossary.md#unsafe-l2-head +[g-unsafe-l2-block]: glossary.md#unsafe-l2-block +[g-unsafe-sync]: glossary.md#unsafe-sync +[g-l1-origin]: glossary.md#l1-origin +[g-deposit-tx-type]: glossary.md#deposited-transaction-type +[g-finalized-l2-head]: glossary.md#finalized-l2-head + + + +**Table of Contents** + +- [Overview](#overview) + - [Eager Block Derivation](#eager-block-derivation) +- [Batch Submission](#batch-submission) + - [Sequencing & Batch Submission Overview](#sequencing--batch-submission-overview) + - [Batch Submission Wire Format](#batch-submission-wire-format) + - [Batcher Transaction Format](#batcher-transaction-format) + - [Frame Format](#frame-format) + - [Channel Format](#channel-format) + - [Batch Format](#batch-format) +- [Architecture](#architecture) + - [L2 Chain Derivation Pipeline](#l2-chain-derivation-pipeline) + - [L1 Traversal](#l1-traversal) + - [L1 Retrieval](#l1-retrieval) + - [Channel Bank](#channel-bank) + - [Batch Decoding](#batch-decoding) + - [Batch Buffering](#batch-buffering) + - [Payload Attributes Derivation](#payload-attributes-derivation) + - [Engine Queue](#engine-queue) + - [Resetting the Pipeline](#resetting-the-pipeline) +- [Deriving Payload Attributes](#deriving-payload-attributes) + - [Deriving the Transaction List](#deriving-the-transaction-list) + - [Building Individual Payload Attributes](#building-individual-payload-attributes) +- [WARNING: BELOW THIS LINE, THE SPEC HAS NOT BEEN REVIEWED AND MAY CONTAIN MISTAKES](#warning-below-this-line-the-spec-has-not-been-reviewed-and-may-contain-mistakes) +- [Communication with the Execution Engine](#communication-with-the-execution-engine) +- [Handling L1 Re-Orgs](#handling-l1-re-orgs) + - [Resetting the Engine Queue](#resetting-the-engine-queue) + - [Resetting Payload Attribute Derivation](#resetting-payload-attribute-derivation) + - [Resetting Batch Decoding](#resetting-batch-decoding) + - [Resetting Channel Buffering](#resetting-channel-buffering) + - [Resetting L1 Retrieval & L1 Traversal](#resetting-l1-retrieval--l1-traversal) + - [Reorgs Post-Merge](#reorgs-post-merge) + + + +# Overview + +> **Note**: the following assumes a single sequencer and batcher. In the future, the design might be adapted to +> accomodate multiple such entities. + +[L2 chain derivation][g-derivation] — deriving L2 [blocks][g-block] from L1 data — is one of the main responsability of +the [rollup node][g-rollup-node], both in validator mode, and in sequencer mode (where derivation acts as a sanity check +on sequencing, and enables detecting L1 chain [re-organizations][g-reorg]). + +The L2 chain is derived from the L1 chain. In particular, each L1 block is mapped to an L2 [sequencing +epoch][g-sequencing-epoch] comprising multiple L2 blocks. The epoch number is defined to be equal to the corresponding +L1 block number. + +To derive the L2 blocks in an epoch `E`, we need the following inputs: + +- The L1 [sequencing window][g-sequencing-window] for epoch `E`: the L1 blocks in the range `[E, E + SWS)` where `SWS` + is the sequencing window size (note that this means that epochs are overlapping). In particular we need: + - The [batcher transactions][g-batcher-transactions] included in the sequencing window. These allow us to + reconstruct [sequencer batches][g-sequencer-batch] containing the transactions to include in L2 blocks (each batch + maps to a single L2 block). + - The [deposits][g-deposits] made in L1 block `E` (in the form of events emitted by the [deposit + contract][g-deposit-contract]). + - The L1 block attributes from L1 block `E` (to derive the [L1 attributes deposited transaction][g-l1-attr-deposit]). +- The state of the L2 chain after the last L2 block of epoch `E - 1`, or — if epoch `E - 1` does not exist — the + [genesis state][g-l2-genesis] (cf. TODO) of the L2 chain. + - An epoch `E` does not exist if `E <= L2CI`, where `L2CI` is the [L2 chain inception][g-l2-chain-inception]. + +> **TODO** specify sequencing window size +> **TODO** specify genesis block / state (in its own document? include/link predeploy.md) + +To derive the whole L2 chain from scratch, we simply start with the [L2 genesis state][g-l2-genesis], and the [L2 chain +inception][g-l2-chain-inception] as first epoch, then process all sequencing windows in order. Refer to the +[Architecture section][architecture] for more information on how we implement this in practice. + +Each epoch may contain a variable number of L2 blocks (one every `l2_block_time`, 2s on Optimism), at the discretion of +[the sequencer][g-sequencer], but subject to the following constraints for each block: + +- `min_l2_timestamp <= block.timestamp < max_l2_timestamp`, where + - all these values are denominated in seconds + - `min_l2_timestamp = prev_l2_timestamp + l2_block_time` + - `prev_l2_timestamp` is the timestamp of the previous L2 block + - `l2_block_time` is a configurable parameter of the time between L2 blocks (on Optimism, 2s) + - `max_l2_timestamp = max(l1_timestamp + max_sequencer_drift, min_l2_timestamp + l2_block_time)` + - `l1_timestamp` is the timestamp of the L1 block associated with the L2 block's epoch + - `max_sequencer_drift` is the most a sequencer is allowed to get ahead of L1 + +> **TODO** specify max sequencer drift + +Put together, these constraints mean that there must be an L2 block every `l2_block_time` seconds, and that the +timestamp for the first L2 block of an epoch must never fall behind the timestamp of the L1 block matching the epoch. + +Post-merge, Ethereum has a fixed [block time][g-block-time] of 12s (though some slots can be skipped). It is thus +expected that, most of the time, each epoch on Optimism will contain `12/2 = 6` L2 blocks. The sequencer can however +lengthen or shorten epochs (subject to above constraints). The rationale is to maintain liveness in case of either a +skipped slot on L1, or a temporary loss of connection to L1 — which requires longer epochs. Shorter epochs are then +required to avoid L2 timestamps drifting further and further ahead of L1. + +## Eager Block Derivation + +In practice, it is often not necesary to wait for a full sequencing window of L1 blocks in order to start deriving the +L2 blocks in an epoch. Indeed, as long as we are able to reconstruct sequential batches, we can start deriving the +corresponding L2 blocks. We call this *eager block derivation*. + +However, in the very worst case, we can only reconstruct the batch for the first L2 block in the epoch by reading the +last L1 block of the sequencing window. This happens when some data for that batch is included in the last L1 block of +the window. In that case, not only can we not derive the first L2 block in the poch, we also can't derive any further L2 +block in the epoch until then, as they need the state that results from applying the epoch's first L2 block. (Note that +this only applies to *block* derivation. We can still derive further batches, we just won't be able to create blocks +from them.) + +------------------------------------------------------------------------------------------------------------------------ + +# Batch Submission + +## Sequencing & Batch Submission Overview + +The [sequencer][g-sequencer] accepts L2 transactions from users. It is responsible for building blocks out of these. For +each such block, it also creates a corresponding [sequencer batch][g-sequencer-batch]. It is also responsible for +submitting each batch to a [data availability provider][g-avail-provider] (e.g. Ethereum calldata), which it does via +its [batcher][g-batcher] component. + +The difference between an L2 block and a batch is subtle but important: the block includes an L2 state root, whereas the +batch only commits to transactions at a given L2 timestamp (equivalently: L2 block number). A block also includes a +reference to the previous block (\*). + +(\*) This matters in some edge case where a L1 reorg would occur and a batch would be reposted to the L1 chain but not +the preceding batch, whereas the predecessor of an L2 block cannot possibly change. + +This means that even if the sequencer applies a state transition incorrectly, the transactions in the batch will stil be +considered part of the canonical L2 chain. Batches are still subject to validity checks (i.e. they have to be encoded +correctly), and so are individual transactions within the batch (e.g. signatures have to be valid). Invalid batches and +invalid individual transactions within an otherwise valid batch are discarded by correct nodes. + +If the sequencer applies a state transition incorrectly and posts an [output root][g-l2-output], then this output root +will be incorrect. The incorrect output root which will be challenged by a [fault proof][g-fault-proof], then replaced +by a correct output root **for the existing sequencer batches.** + +Refer to the [Batch Submission specification][batcher-spec] for more information. + +[batcher-spec]: batching.md + +> **TODO** rewrite the batch submission specification +> +> Here are some things that should be included there: +> +> - There may be different concurrent data submissions to L1 +> - There may be different actors that submit the data, the system cannot rely on a single EOA nonce value. +> - The batcher requests safe L2 safe head from the rollup node, then queries the execution engine for the block data. +> - In the future we might be able to get the safe hea dinformation from the execution engine directly. Not possible +> right now but there is an upstream geth PR open. + +## Batch Submission Wire Format + +[wire-format]: #batch-submission-wire-format + +Batch submission is closely tied to L2 chain derivation because the derivation process must decode the batches that have +been encoded for the purpose of batch submission. + +The [batcher][g-batcher] submits [batcher transactions][g-batcher-transaction] to a [data availability +provider][g-avail-provider]. These transactions contain one or multiple [channel frames][g-channel-frame], which are +chunks of data belonging to a [channel][g-channel]. + +A [channel][g-channel] is a sequence of [sequencer batches][g-sequencer-batch] (for sequential blocks) compressed +together. The reason to group multiple batches together is simply to obtain a better compression rate, hence reducing +data availability costs. + +Channels might be too large to fit in a single [batcher transaction][g-batcher-transaction], hence we need to split it +into chunks known as [channel frames][g-channel-frame]. A single batcher transaction can also carry multiple frames +(belonging to the same or to different channels). + +This design gives use the maximum flexibility in how we aggregate batches into channels, and split channels over batcher +transactions. It notably allows us to maximize data utilisation in a batcher transaction: for instance it allows us to +pack the final (small) frame of a window with large frames from the next window. It also allows the [batcher][g-batcher] +to employ multiple signers (private keys) to submit one or multiple channels in parallel (1). + +(1) This helps alleviate issues where, because of transaction nonces, multiple transactions made by the same signer are +stuck waiting on the inclusion of a previous transaction. + +Also note that we use a streaming compression scheme, and we do not need to know how many blocks a channel will end up +containing when we start a channel, or even as we send the first frames in the channel. + +All of this is illustrated in the following diagram. + +> **TODO** improve diagram +> +> - I'm a fan of the 4 lines "Transactions" to "L2 Blocks" +> - albeit it would good to show that channels & frames can occur out of order +> - but maybe that makes the diagram too hard to read and we can just include a comment afterwards saying that in +> general, reordering is possible (maybe show a second diagram showcasing a simple reordering? +> - I think L1 blocks should be a new line above "Transactions" — also show deposits (w/ a number) for each block +> - We shouldn't use the L1 attributes tx as a separate line, it makes it look like a additional layer of "data +> derivation", which it is not. Instead I would tag each L2 block with its epoch number. +> - Include numbered deposits under L2 blocks +> - Let's use a sequencing window of size 2 to keep the diagram small +> - Include a textual explanation of the diagram below it + +![batch derivation chain diagram](./assets/batch-deriv-chain.svg) + +### Batcher Transaction Format + +Batcher transactions are encoded as `version_byte ++ rollup_payload` (where `++` denotes concatenation). + +| `version_byte` | `rollup_payload` | +|----------------|------------------------------------------------| +| 0 | `frame ...` (one or more frames, concatenated) | + +Unknown versions make the batcher transaction invalid (it must be ignored by the rollup node). + +The `rollup_payload` may be right-padded with 0s, which will be ignored. It's allowed for them to be +interpreted as frames for channel 0, which must always be ignored. + +> **TODO** specify batcher authentication (i.e. where do we store / make available the public keys of authorize batcher +> signers) + +### Frame Format + +A [channel frame][g-channel-frame] is encoded as: + +```text +frame = channel_id ++ frame_number ++ frame_data_length ++ frame_data ++ is_last + +channel_id = random ++ timestamp +random = bytes32 +timestamp = uvarint +frame_number = uvarint +frame_data_length = uvarint +frame_data = bytes +is_last = bool +``` + +> **TODO** replace `uvarint` by fixed size integers + +where: + +- `uvarint` is a variable-length encoding of a 64-bit unsigned integer into between 1 and 9 bytes, [as specified in + SQLite 4][sqlite-uvarint]. +- `channel_id` uniquely identifies a channel as the concatenation of a random value and a timestamp + - `random` is a random value such that two channels with different batches should have a different random value + - `timestamp` is the time at which the channel was created (UNIX time in seconds) + - The ID includes both the random value and the timestamp, in order to prevent a malicious sequencer from reusing + the random value after the channel has [timed out][g-channel-timeout] (refer to the [batcher + specification][batcher-spec] to learn more about channel timeouts). This will also allow us substitute `random` by + a hash commitment to the batches, should we want to do so in the future. + - Channels whose timestamp are higher than that of the L1 block they first appear in must be ignored. Note that L1 + nodes have a soft constraint to ignore blocks whose timestamps that are ahead of the wallclock time by a certain + margin. (A soft constraint is not a consensus rule — nodes will accept such blocks in the canonical chain but will + not attempt to build directly on them.) +- `frame_number` identifies the index of the frame within the channel +- `frame_data_length` is the length of `frame_data` in bytes +- `frame_data` is a sequence of bytes belonging to the channel, logically after the bytes from the previous frames +- `is_last` is a single byte with a value of 1 if the frame is the last in the channel, 0 if there are frames in the + channel. Any other value makes the frame invalid (it must be ignored by the rollup node). + +> **TODO** +> +> - Is that requirement to drop channels correct? +> - Is it implemented as such? +> - Do we drop the channel or just the first frame? End result is the same but this changes the channel bank size, which +> can influence things down the line!! + +[sqlite-uvarint]: https://www.sqlite.org/src4/doc/trunk/www/varint.wiki +[batcher-spec]: batching.md + +### Channel Format + +A channel is encoded as `channel_encoding`, defined as: + +```text +rlp_batches = [] +for batch in batches: + rlp_batches.append(batch) +channel_encoding = compress(rlp_batches) +``` + +where: + +- `batches` is the input, a sequence of batches byte-encoded as per the next section ("Batch Encoding") +- `rlp_batches` is the concatenation of the RLP-encoded batches +- `compress` is a function performing compression, using the ZLIB algorithm (as specified in [RFC-1950][rfc1950]) with + no dictionary +- `channel_encoding` is the compressed version of `rlp_batches` + +[rfc1950]: https://www.rfc-editor.org/rfc/rfc1950.html + +When decompressing a channel, we limit the amount of decompressed data to `MAX_RLP_BYTES_PER_CHANNEL`, in order to avoid +"zip-bomb" types of attack (where a small compressed input decompresses to a humongous amount of data). If the +decompressed data exceeds the limit, things proceeds as thought the channel contained only the first +`MAX_RLP_BYTES_PER_CHANNEL` decompressed bytes. + +> **TODO** specify `MAX_RLP_BYTES_PER_CHANNEL` + +While the above pseudocode implies that all batches are known in advance, it is possible to perform streaming +compression and decompression of RLP-encoded batches. This means it is possible to start including channel frames in a +[batcher transaction][g-batcher-transaction] before we know how many batches (and how many frames) the channel will +contain. + +### Batch Format + +[batch-format]: #batch-format + +Recall that a batch contains a list of transactions to be included in a specific L2 block. + +A batch is encoded as `batch_version ++ content`, where `content` depends on the version: + +| `batch_version` | `content` | +| --------------- | --------------------------------------------------------------------- | +| 0 | `rlp_encode([epoch_number, epoch_hash, timestamp, transaction_list])` | + +where: + +- `rlp_encode` is a function that encodes a batch according to the [RLP format], and `[x, y, z]` denotes a list + containing items `x`, `y` and `z` +- `epoch_number` and `epoch_hash` are the number and hash of the L1 block corresponding to the [sequencing + epoch][g-sequencing-epoch] of the L2 block +- `timestamp` is the timestamp of the L2 block +- `transaction_list` is an RLP-encoded list of [EIP-2718] encoded transactions. + +[RLP format]: https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp/ +[EIP-2718]: https://eips.ethereum.org/EIPS/eip-2718 + +Unknown versions make the batch invalid (it must be ignored by the rollup node), as do malformed contents. + +The `epoch_number` and the `timestamp` must also respect the constraints listed in the [Batch +Buffering][batch-buffering] section, otherwise the batch is considered invalid. + +------------------------------------------------------------------------------------------------------------------------ + +# Architecture + +[architecture]: #architecture + +The above describes the general process of L2 chain derivation, and specifies how batches are encoded within [batcher +transactions][g-batcher-transaction]. + +However, there remains many details to specify. These are mostly tied to the rollup node architecture for derivation. +Therefore we present this architecture as a way to specify these details. + +A validator that only reads from L1 (and so doesn't interact with the sequencer directly) does not need to be +implemented in the way presented below. It does however need to derive the same blocks (i.e. it needs to be semantically +equivalent). We do believe the architecture presented below has many advantages. + +## L2 Chain Derivation Pipeline + +[pipeline]: #l2-chain-derivation-pipeline + +Our architecture decomposes the derivation process into a pipeline made up of the following stages: + +1. L1 Traversal +2. L1 Retrieval +3. Channel Bank +4. Batch Decoding (called `ChannelInReader` in the code) +5. Batch Buffering (Called `BatchQueue` in the code) +6. Payload Attributes Derivation (called `AttributesQueue` in the code) +7. Engine Queue + +> **TODO** can we change code names for these three things? maybe as part of a refactor + +The data flows flows from the start (outer) of the pipeline towards the end (inner). Each stage is able to push data to +the next stage. + +However, data is *processed* in reverse order. Meaning that if there is any data to be processed in the last stage, it +will be processed first. Processing proceeds in "steps" that can be taken at each stage. We try to take as many steps as +possible in the last (most inner) stage before taking any steps in its outer stage, etc. + +This ensures that we use the data we already have before pulling more data and minimizes the latency of data traversing +the derivation pipeline. + +Each stage can maintain its own inner state as necessary. **In particular, each stage maintains a L1 block reference +(number + hash) to the latest L1 block such that all data originating from previous blocks has been processed, and the +data from that block is or has been processed.** + +Let's briefly describe each stage of the pipeline. + +### L1 Traversal + +In the *L1 Traversal* stage, we simply read the header of the next L1 block. In normal operations, these will be new +L1 blocks as they get created, though we can also read old blocks while syncing, or in case of an L1 [re-org][g-reorg]. + +### L1 Retrieval + +In the *L1 Retrieval* stage, we read the block we get from the outer stage (L1 traversal), and extract data for it. In +particular we extract a byte string that corresponds to the concatenation of the data in all the [batcher +transaction][g-batcher-transaction] belonging to the block. This byte stream encodes a stream of [channel +frames][g-channel-frame] (see the [Batch Submission Wire Format][wire-format] section for more info). + +This frames are parsed, then grouped per [channel][g-channel] into a structure we call the *channel bank*. + +Some frames are ignored: + +- Frames where `frame.frame_number <= highest_frame_number`, where `highest_frame_number` is the highest frame number + that was previously encountered for this channel. + - i.e. in case of duplicate frame, the first frame read from L1 is considered canonical. +- Frames with a higher number than that of the final frame of the channel (i.e. the first frame marked with + `frame.is_last == 1`) are ignored. + - These frames could still be written into the channel bank if we haven't seen the final frame yet. But they will + never be read out from the channel bank. + +### Channel Bank + +The *Channel Bank* stage is responsible from reading from the channel bank that was written to by the L1 retrieval +stage, and decompressing batches from these frames. + +In principle, we should be able to read any channel that has any number of sequential frames at the "front" of the +channel (i.e. right after any frames that have been read from the bank already) and decompress batches from them. (Note +that if we did this, we'd need to keep partially decompressed batches around.) + +However, our current implementation doesn't support streaming decompression, so currently we have to wait until either: + +- We have received all frames in the channel (i.e. we received the last frame in the channel (`is_last == 1`) and every + frame with a lower number). +- The channel has timed out (in which we case we read all contiguous sequential frames from the start of the channel). + - A channel is considered to be *timed out* if `currentL1Block.timestamp > channeld_id.timestamp + CHANNEL_TIMEOUT`. + - where `currentL1Block` is the L1 block maintained by this stage, which is the most recent L1 block whose frames + have been added to the channel bank. + +> **TODO** There is currently `MAX_CHANNEL_BANK_SIZE`, a notion about the maximum amount of channels we can keep track +> of. +> +> - Is this a semantic detail (i.e. if the batcher opens too many frames, valid channels can be dropped?) +> - If so, I feel **very strongly** about changing this. This ties us very much to the current implementation. +> - And it doesn't feel necessary given the channel timeout - if DOS is an issue we can reduce the channel timeout. + +> **TODO** The channel queue is a bit weird as implemented (blocks all other channels until the first channel is closed +> / timed out. Also unclear why we need to wait for channel closure. Maybe something to revisit? +> +> cf. slack discussion with Proto + +### Batch Decoding + +In the *Batch Decoding* stage, we decompress the frames we received in the last stage, then parse +[batches][g-sequencer-batch] from the decompressed byte stream. + +### Batch Buffering + +[batch-buffering]: #batch-buffering + +During the *Batch Buffering* stage, we reorder batches by their timestamps. If batches are missing for some [time +slots][g-time-slot] and a valid batch with a higher timestamp exists, this stage also generates empty batches to fill +the gaps. + +Batches are pushed to the next stage whenever there is one or more sequential batches directly following the timestamp +of the current [safe L2 head][g-safe-l2-head] (the last block that can be derived from the canonical L1 chain). + +Note that the presence of any gaps in the batches derived from L1 means that this stage will need to buffer for a whole +[sequencing window][g-sequencing-window] before it can generate empty batches (because the missing batch(es) could have +data in the last L1 block of the window in the worst case). + +We also ignore invalid batches, which do not satisfy one of the following constraints: + +- The timestamp is aligned to the [block time][g-block-time]: + `(batch.timestamp - genesis_l2_timestamp) % block_time == 0` +- The timestamp is within the allowed range: `min_l2_timestamp <= batch.timestamp < max_l2_timestamp`, where + - all these values are denominated in seconds + - `min_l2_timestamp = prev_l2_timestamp + l2_block_time` + - `prev_l2_timestamp` is the timestamp of the previous L2 block: the last block of the previous epoch, + or the L2 genesis block timestamp if there is no previous epoch. + - `l2_block_time` is a configurable parameter of the time between L2 blocks (on Optimism, 2s) + - `max_l2_timestamp = max(l1_timestamp + max_sequencer_drift, min_l2_timestamp + l2_block_time)` + - `l1_timestamp` is the timestamp of the L1 block associated with the L2 block's epoch + - `max_sequencer_drift` is the maximum amount of time an L2 block's timestamp is allowed to get ahead of the + timestamp of its [L1 origin][g-l1-origin] + - Note that we always have `min_l2_timestamp >= l1_timestamp`, i.e. a L2 block timestamp is always equal or ahead of + the timestamp of its [L1 origin][g-l1-origin]. +- The batch is the first batch with `batch.timestamp` in this sequencing window, i.e. one batch per L2 block number. +- The batch only contains sequenced transactions, i.e. it must NOT contain any [deposited-type transactions][ + g-deposit-tx-type]. + +> **TODO** specify `max_sequencer_drift` + +### Payload Attributes Derivation + +In the *Payload Attributes Derivation* stage, we convert the batches we get from the previous stage into instances of +the [`PayloadAttributes`][g-payload-attr] structure. Such a structure encodes the transactions that need to figure into +a block, as well as other block inputs (timestamp, fee recipient, etc). Payload attributes derivation is detailed in the +section [Deriving Payload Attributes section][deriving-payload-attr] below. + +### Engine Queue + +In the *Engine Queue* stage, the previously derived `PayloadAttributes` structures are buffered and sent to the +[execution engine][g-exec-engine] to be executed and converted into a proper L2 block. + +The engine queue maintains references to two L2 blocks: + +- The [safe L2 head][g-safe-l2-head]: everything up to and including this block can be fully derived from the + canonical L1 chain. +- The [unsafe L2 head][g-unsafe-l2-head]: blocks between the safe and unsafe heads are [unsafe + blocks][g-unsafe-l2-block] that have not been derived from L1. These blocks either come from sequencing (in sequencer + mode) or from [unsafe sync][g-unsafe-sync] to the sequencer (in validator mode). + +If the unsafe head is ahead of the safe head, then [consolidation][g-consolidation] is attempted. + +During consolidation, we consider the oldest unsafe L2 block, i.e. the unsafe L2 block directly after the safe head. If +the payload attributes match this oldest unsafe L2 block, then that block can be considered "safe" and becomes the new +safe head. + +In particular, the following fields of the payload attributes are checked for equality with the block: + +- `parent_hash` +- `timestamp` +- `randao` +- `fee_recipient` +- `transactions_list` (first length, then equality of each of the encoded transactions) + +If consolidation fails, the unsafe L2 head is reset to the safe L2 head. + +If the safe and unsafe L2 heads are identical (whether because of failed consolidation or not), we send the block to the +execution engine to be converted into a proper L2 block, which becomes both the new L2 safe and unsafe heads. + +Interaction with the execution engine via the execution engine API is detailed in the [Communication with the Execution +Engine][exec-engine-comm] section. + +### Resetting the Pipeline + +It is possible to reset the pipeline, for instance if we detect an L1 [re-org][g-reorg]. For more details on this, see +the [Handling L1 Re-Orgs][handling-reorgs] section. + +------------------------------------------------------------------------------------------------------------------------ + +# Deriving Payload Attributes + +[deriving-payload-attr]: #deriving-payload-attributes + +For every L2 block we wish to create, we need to build [payload attributes][g-payload-attr], +represented by an [expanded version][expanded-payload] of the [`PayloadAttributesV1`][eth-payload] object, +which includes the additional `transactions` and `noTxPool` fields. + +[expanded-payload]: exec-engine.md#extended-payloadattributesv1 +[eth-payload]: https://github.com/ethereum/execution-apis/blob/main/src/engine/specification.md#payloadattributesv1 + +## Deriving the Transaction List + +For each such block, we start from a [sequencer batch][g-sequencer-batch] matching the target L2 block number. This +could potentially be an empty auto-generated batch, if the L1 chain did not include a batch for the target L2 block +number. [Remember][batch-format] the batch includes a [sequencing epoch][g-sequencing-epoch] number, an L2 timestamp, +and a transaction list. + +This block is part of a [sequencing epoch][g-sequencing-epoch], +whose number matches that of an L1 block (its *[L1 origin][g-l1-origin]*). +This L1 block is used to derive L1 attributes and (for the first L2 block in the epoch) user deposits. + +Therefore, a [`PayloadAttributesV1`][expanded-payload] object must include the following transactions: + +- one or more [deposited transactions][g-deposited], of two kinds: + - a single *[L1 attributes deposited transaction][g-l1-attr-deposit]*, derived from the L1 origin. + - for the first L2 block in the epoch, zero or more *[user-deposited transactions][g-user-deposited]*, derived from + the [receipts][g-receipts] of the L1 origin. +- zero or more *[sequenced transactions][g-sequencing]*: regular transactions signed by L2 users, included in the + sequencer batch. + +Transactions **must** appear in this order in the payload attributes. + +The L1 attributes are read from the L1 block header, while deposits are read from the L1 block's [receipts][g-receipts]. +Refer to the [**deposit contract specification**][deposit-contract-spec] for details on how deposits are encoded as log +entries. + +[deposit-contract-spec]: deposits.md#deposit-contract + +## Building Individual Payload Attributes + +[payload attributes]: #building-individual-payload-attributes + +After deriving the transaction list, the rollup node constructs a [`PayloadAttributesV1`][expanded-payload] as follows: + +- `timestamp` is set to the batch's timestamp. +- `random` is set to the *random* `prev_randao` L1 block attribute. +- `suggestedFeeRecipient` is set to an address determined by the system. +- `transactions` is the array of the derived transactions: deposited transactions and sequenced transactions, all + encoded with [EIP-2718]. +- `noTxPool` is set to `true`, to use the exact above `transactions` list when constructing the block. + +[expanded-payload]: exec-engine.md#extended-payloadattributesv1 + +> **TODO** specify Optimism mainnet fee recipient + +------------------------------------------------------------------------------------------------------------------------ + +# WARNING: BELOW THIS LINE, THE SPEC HAS NOT BEEN REVIEWED AND MAY CONTAIN MISTAKES + +We still expect that the explanations here should be pretty useful. + +------------------------------------------------------------------------------------------------------------------------ + +# Communication with the Execution Engine + +[exec-engine-comm]: #communication-with-the-execution-engine + +The [engine queue] is responsible for interacting with the execution engine, sending it +[`PayloadAttributesV1`][expanded-payload] objects and receiving L2 block references as a result. This happens whenever +the [safe L2 head][g-safe-l2-head] and the [unsafe L2 head][g-unsafe-l2-head] are identical, either because [unsafe +block consolidation][g-consolidation] failed or because no [unsafe L2 blocks][g-unsafe-l2-block] were known in the first +place. This section explains how this happens. + +> **Note**: This only describes interaction with the execution engine in the context of L2 chain derivation from L1. The +> sequencer also interacts with the engine when it needs to create new L2 blocks using L2 transactions submitted by +> users. + +Let: + +- `refL2` be the (hash of) the current [safe L2 head][g-unsafe-l2-head] +- `finalizedRef` be the (hash of) the [finalized L2 head][g-finalized-l2-head]: the highest L2 block that can be fully + derived from *[finalized][finality]* L1 blocks — i.e. L1 blocks older than two L1 epochs (64 L1 [time + slots][g-time-slot]). +- `payloadAttributes` be some previously derived [payload attributes][g-payload-attr] for the L2 block with number + `l2Number(refL2) + 1` + +[finality]: https://hackmd.io/@prysmaticlabs/finality + +Then we can apply the following pseudocode logic to update the state of both the rollup driver and execution engine: + +```javascript +// request a new execution payload +forkChoiceState = { + headBlockHash: refL2, + safeBlockHash: refL2, + finalizedBlockHash: finalizedRef, +} +[status, payloadID, rpcErr] = engine_forkchoiceUpdatedV1(forkChoiceState, payloadAttributes) +if (rpcErr != null) soft_error() +if (status != "VALID") payload_error() + +// retrieve and execute the execution payload +[executionPayload, rpcErr] = engine_getPayloadV1(payloadID) +if (rpcErr != null) soft_error() + +[status, rpcErr] = engine_newPayloadV1(executionPayload) +if (rpcErr != null) soft_error() +if (status != "VALID") payload_error() + +refL2 = l2Hash(executionPayload) + +// update head to new refL2 +forkChoiceState = { + headBlockHash: refL2, + safeBlockHash: refL2, + finalizedBlockHash: finalizedRef, +} +[status, payloadID, rpcErr] = engine_forkchoiceUpdatedV1(forkChoiceState, null) +if (rpcErr != null) soft_error() +if (status != "SUCCESS") payload_error() +``` + +As should apparent from the assignations, within the `forkChoiceState` object, the properties have the following +meaning: + +- `headBlockHash`: block hash of the last block of the L2 chain, according to the sequencer. +- `safeBlockHash`: same as `headBlockHash`. +- `finalizedBlockHash`: the hash of the L2 block that can be fully derived from finalized L1 data, making it impossible + to derive anything else. + +Error handling: + +- A `payload_error()` means the inputs were wrong, and the payload attributes should thus be dropped from the queue, and + not reattempted. +- A `soft_error()` means that the interaction failed by chance, and should be reattempted. +- If the function completes without error, the attributes were applied successfully, + and can be dropped from the queue while the tracked "safe head" is updated. + +> **TODO** `finalizedRef` is not being changed yet, but can be set to point to a L2 block fully derived from data up to +> a finalized L1 block. + +The following JSON-RPC methods are part of the [execution engine API][exec-engine]: + +[exec-engine]: exec-engine.md + +- [`engine_forkchoiceUpdatedV1`] — updates the forkchoice (i.e. the chain head) to `headBlockHash` if different, and + instructs the engine to start building an execution payload given payload attributes the second argument isn't `null` +- [`engine_getPayloadV1`] — retrieves a previously requested execution payload +- [`engine_newPayloadV1`] — executes an execution payload to create a block + +[`engine_forkchoiceUpdatedV1`]: exec-engine.md#engine_forkchoiceUpdatedV1 +[`engine_getPayloadV1`]: exec-engine.md#engine_newPayloadV1 +[`engine_newPayloadV1`]: exec-engine.md#engine_newPayloadV1 + +The execution payload is an object of type [`ExecutionPayloadV1`][eth-payload]. + +[eth-payload]: https://github.com/ethereum/execution-apis/blob/main/src/engine/specification.md#executionpayloadv1 + +------------------------------------------------------------------------------------------------------------------------ + +# Handling L1 Re-Orgs + +[handling-reorgs]: #handling-l1-re-orgs + +The [L2 chain derivation pipeline][pipeline] as described above assumes linear progression of the L1 chain. + +If the L1 chain [re-orgs][g-reorg], the rollup node must re-derive sections of the L2 chain such that it derives the +same L2 chain that a rollup node would derive if it only followed the new L1 chain. + +A re-org can be recovered without re-deriving the full L2 chain, by resetting each pipeline stage from end (Engine +Queue) to start (L1 Traversal). + +The general idea is to backpropagate the new L1 head through the stages, and reset the state in each stage so that the +stage will next process data originating from that block onwards. + +## Resetting the Engine Queue + +The engine queue maintains references to two L2 blocks: + +- The safe L2 block (or *safe head*): everything up to and including this block can be fully derived from the + canonical L1 chain. +- The unsafe L2 block (or *unsafe head*): blocks between the safe and unsafe heads are blocks that have not been + derived from L1. These blocks either come from sequencing (in sequencer mode) or from "unsafe sync" to the sequencer + (in validator mode). + +When resetting the L1 head, we need to rollback the safe head such that the L1 origin of the new safe head is a +canonical L1 block (i.e. an the new L1 head, or one of its ancestors). We achieved this by walking back the L2 chain +(starting from the current safe head) until we find such an L2 block. While doing this, we must take care not to walk +past the [L2 genesis][g-l2-genesis] or L1 genesis. + +The unsafe head does not necessarily need to be reset, as long as its L1 origin is *plausible*. The L1 origin of the +unsafe head is considered plausible as long as it is in the canonical L1 chain or is ahead (higher number) than the head +of the L1 chain. When we determine that this is no longer the case, we reset the unsafe head to be equal to the safe +head. + +> **TODO** Don't we always need to discard the unsafe head when there is a L1 re-org, because the unsafe head's origin +> builds on L1 blocks that have been re-orged away? +> +> I'm guessing maybe we received some unsafe blocks that build upon the re-orged L2, which we accept without relating +> them back to the safe head? + +## Resetting Payload Attribute Derivation + +In payload attribute derivation, we need to ensure that the L1 head is reset to the safe L2 head's L1 origin. In the +worst case, this would be as far back as `SWS` ([sequencing window][g-sequencing-window] size) blocks before the engine +queue's L1 head. + +In the worst case, a whole sequencing window of L1 blocks was required to derive the L2 safe head (meaning that +`safeL2Head.l1Origin == engineQueue.l1Head - SWS`). This means that to derive the next L2 block, we have to read data +derived from L1 block `engineQueue.l1Head - SWS` and onwards, hence the need to reset the L1 head back to that value for +this stage. + +However, in general, it is only necessary to reset as far back as `safeL2Head.l1Origin`, since it marks the start of the +sequencing window for the safe L2 head's epoch. As such, the next L2 block never depends on data derived from L1 blocks +before `safeL2Head.l1Origin`. + +> **TODO** in the implementation, we always rollback by SWS, which is unecessary +> Quote from original spec:"We must find the first L2 block whose complete sequencing window is unchanged in the reorg." + +> **TODO** sanity check this section, it was incorrect in previous spec, and confused me multiple times + +## Resetting Batch Decoding + +The batch decoding stage is simply reset by resetting its L1 head to the payload attribute derivation stage's L1 head. +(The same reasoning as the payload derivation stage applies.) + +## Resetting Channel Buffering + +> **Note**: in this section, the term *next (L2) block* will refer to the block that will become the next L2 safe head. + +> **TODO** The above can be changed in the case where we always reset the unsafe head to the safe head upon L1 re-org. +> (See TODO above in "Resetting the Engine Queue") + +Because we group [sequencer batches][g-sequencer-batch] into [channels][g-channel], it means that decoding a batch that +has data posted (in a [channel frame][g-channel-frame]) within the sequencing window of its epoch might require [channel +frames][g-channel-frame] posted before the start of the [sequencing window][g-sequencing-window]. Note that this is only +possible if we start sending channel frames before knowing all the batches that will go into the channel. + +In the worst case, decoding the batch for the next L2 block would require reading the last frame from a channel, posted +in a [batcher transaction][g-batcher-transaction] in `safeL2Head.l1Origin + 1` (second L1 block of the next L2 block's +epoch sequencing window, assuming it is in the same epoch as `safeL2Head`). + +> **Note**: In reality, there are no checks or constraints preventing the batch from landing in `safeL2Head.l1Origin`. +> However this would be strange, because the next L2 block is built after the current L2 safe block, which requires +> reading the deposits L1 attributes and deposits from `safeL2Head.l1Origin`. Still, a wonky or misbehaving sequencer +> could post a batch for the L2 block `safeL2Head + 1` on L1 block `safeL2Head.1Origin`. + +Keeping things worst case, `safeL2Head.l1Origin` would also be the last allowable block for the frame to land. The +allowed time range for frames within a channel to land on L1 is `[channel_id.timestamp, channel_id.timestamp + +CHANNEL_TIMEOUT]`. The allowed L1 block range for these frames are any L1 block whose timestamp falls inside this time +range. + +Therefore, to be safe, we can reset the L1 head of Channel Buffering to the oldest L1 block whose timestamp is higher +than `safeL2Head.l1Origin.timestamp - CHANNEL_TIMEOUT`. + +> **Note**: The above is what the implementation currently does. + +In reality it's only strictly necessary to reset the oldest L1 block whose timestamp is higher than the oldest +`channel_id.timestamp` found in the batcher transaction that is not older than `safeL2Head.l1Origin.timestamp - +CHANNEL_TIMEOUT`. + +We define `CHANNEL_TIMEOUT = 600`, i.e. 10 hours. + +> **TODO** does `CHANNEL_TIMEOUT` have a relationship with `SWS`? +> +> I think yes, it has to be shorter than `SWS` but ONLY if we can't do streaming decryption (the case currently). +> Otherwise it could be shorter or longer. + +— and explain its relationship with `SWS` if any? + +This situation is the main purpose of the [channel timeout][g-channel-timeout]: without the timeout, we might have to +look arbitrarily far back on L1 to be able to decompress batches, which is not acceptable for performance reasons. + +The other puprose of the channel timeout is to avoid having the rollup node keep old unclosed channel data around +forever. + +Once the L1 head is reset, we then need to discard any frames read from blocks more recent than this updated L1 head. + +## Resetting L1 Retrieval & L1 Traversal + +These are simply reset by resetting their L1 head to `channelBuffering.l1Head`, and dropping any buffered data. + +## Reorgs Post-Merge + +Note that post-[merge], the depth of re-orgs will be bounded by the [L1 finality delay][l1-finality] (every 2 epochs, or +approximately 12 minutes, unless an attacker controls more than 1/3 of the total stake). + +[merge]: https://ethereum.org/en/upgrades/merge/ +[l1-finality]: https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/#finality + +> **TODO** This was in the spec: +> +> In practice, we'll pick an already-finalized L1 block as L2 +> inception point to preclude the possibility of a re-org past genesis, at the cost of a few empty blocks at the start +> of the L2 chain. +> +> This makes sense, but is in conflict with how the [L2 chain inception][g-l2-chain-inception] is currently determined, +> which is via the L2 output oracle deployment & upgrades. diff --git a/specs/exec-engine.md b/specs/exec-engine.md index 6e19b957e0b3f..3e141c2a7a540 100644 --- a/specs/exec-engine.md +++ b/specs/exec-engine.md @@ -4,18 +4,17 @@ **Table of Contents** -- [L2 Execution Engine](#l2-execution-engine) - - [Deposited transaction processing](#deposited-transaction-processing) - - [Deposited transaction boundaries](#deposited-transaction-boundaries) - - [Engine API](#engine-api) - - [`engine_forkchoiceUpdatedV1`](#engine_forkchoiceupdatedv1) - - [Extended PayloadAttributesV1](#extended-payloadattributesv1) - - [`engine_newPayloadV1`](#engine_newpayloadv1) - - [`engine_getPayloadV1`](#engine_getpayloadv1) - - [Networking](#networking) - - [Sync](#sync) - - [Happy-path sync](#happy-path-sync) - - [Worst-case sync](#worst-case-sync) +- [Deposited transaction processing](#deposited-transaction-processing) + - [Deposited transaction boundaries](#deposited-transaction-boundaries) +- [Engine API](#engine-api) + - [`engine_forkchoiceUpdatedV1`](#engine_forkchoiceupdatedv1) + - [Extended PayloadAttributesV1](#extended-payloadattributesv1) + - [`engine_newPayloadV1`](#engine_newpayloadv1) + - [`engine_getPayloadV1`](#engine_getpayloadv1) +- [Networking](#networking) +- [Sync](#sync) + - [Happy-path sync](#happy-path-sync) + - [Worst-case sync](#worst-case-sync) diff --git a/specs/glossary.md b/specs/glossary.md index d93c15d75f0f5..92ae1a4d98f15 100644 --- a/specs/glossary.md +++ b/specs/glossary.md @@ -4,7 +4,6 @@ **Table of Contents** -- [Glossary](#glossary) - [General Terms](#general-terms) - [Layer 1 (L1)](#layer-1-l1) - [Layer 2 (L2)](#layer-2-l2) @@ -18,9 +17,10 @@ - [Fork Choice Rule](#fork-choice-rule) - [Priority Gas Auction](#priority-gas-auction) - [Sequencing](#sequencing) - - [Sequencing window](#sequencing-window) - - [Sequencing epoch](#sequencing-epoch) - - [Sequencer batch](#sequencer-batch) + - [Sequencer](#sequencer) + - [Sequencing Window](#sequencing-window) + - [Sequencing Epoch](#sequencing-epoch) + - [L1 Origin](#l1-origin) - [Deposits](#deposits) - [Deposited Transaction](#deposited-transaction) - [L1 Attributes Deposited Transaction](#l1-attributes-deposited-transaction) @@ -32,16 +32,38 @@ - [Deposit Contract](#deposit-contract) - [Withdrawals](#withdrawals) - [Relayer](#relayer) + - [Finalization Period](#finalization-period) +- [Batch Submission](#batch-submission) + - [Data Availability](#data-availability) + - [Data Availability Provider](#data-availability-provider) + - [Sequencer Batch](#sequencer-batch) + - [Channel](#channel) + - [Channel Frame](#channel-frame) + - [Batcher](#batcher) + - [Batcher Transaction](#batcher-transaction) + - [Channel Timeout](#channel-timeout) +- [L2 Chain Derivation](#l2-chain-derivation) + - [L2 Derivation Inputs](#l2-derivation-inputs) + - [Payload Attributes](#payload-attributes) + - [L2 Genesis Block](#l2-genesis-block) + - [L2 Chain Inception](#l2-chain-inception) + - [Safe L2 Head](#safe-l2-head) + - [Unsafe L2 Block](#unsafe-l2-block) + - [Unsafe L2 Head](#unsafe-l2-head) + - [Unsafe Block Consolidation](#unsafe-block-consolidation) + - [Finalized L2 Head](#finalized-l2-head) - [Other L2 Chain Concepts](#other-l2-chain-concepts) - [Address Aliasing](#address-aliasing) - - [L2 Chain Inception](#l2-chain-inception) - [Rollup Node](#rollup-node) - [Rollup Driver](#rollup-driver) - - [L2 Chain Derivation](#l2-chain-derivation) - - [L2 Derivation Inputs](#l2-derivation-inputs) - - [Payload Attributes](#payload-attributes) - [L1 Attributes Predeployed Contract](#l1-attributes-predeployed-contract) - [L2 Output Root](#l2-output-root) + - [L2 Output Oracle Contract](#l2-output-oracle-contract) + - [Validator](#validator) + - [Fault Proof](#fault-proof) + - [Time Slot](#time-slot) + - [Block Time](#block-time) + - [Unsafe Sync](#unsafe-sync) - [Execution Engine Concepts](#execution-engine-concepts) - [Execution Engine](#execution-engine) @@ -139,10 +161,8 @@ Different transaction types can contain different payloads, and be handled diffe The fork choice rule is the rule used to determined which block is to be considered as the head of a blockchain. On L1, this is determined by the proof of stake rules. -L2 also has a fork choice rule, although the rules vary depending on whether we want the sequencer-confirmed head, the -on-chain-confirmed head, or the on-chain-finalized head. - -> TODO: define and link to those concepts +L2 also has a fork choice rule, although the rules vary depending on whether we want the [safe L2 head][safe-l2-head], +the [unsafe L2 head][unsafe-l2-head] or the [finalized L2 head][finalized-l2-head]. ## Priority Gas Auction @@ -167,23 +187,47 @@ Transactions in the rollup can be included in two ways: Submitting transactions for inclusion in a batch saves costs by reducing overhead, and enables the sequencer to pre-confirm the transactions before the L1 confirms the data. -## Sequencing window +## Sequencer + +[sequencer]: glossary.md#sequencer + +A sequencer is either a [rollup node][rollup-node] ran in sequencer mode, or the operator of this rollup node. + +The sequencer is a priviledged actor, which receives L2 transactions from L2 users, creates L2 blocks using them, which +it then submits to [data availability provider][avail-provider] (via a [batcher]). It also submits [output +roots][l2-output] to L1. + +## Sequencing Window [sequencing-window]: glossary.md#sequencing-window -A sequencing window is a range of L1 blocks, to parse inputs from during a derivation step. +A sequencing window is a range of L1 blocks from which a [sequencing epoch][sequencing-epoch] can be derived. -## Sequencing epoch +A sequencing window whose first L1 block has number `N` contains [batcher transactions][batcher-transactions] for epoch +`N`. The window contains blocks `[N, N + SWS)` where `SWS` is the sequencer window size. -A sequencing epoch is a number identifying the start of a [sequencing window](#sequencing-window), -equal to the L1 block number of the first block in the window. +> **TODO** specify sequencer window size -## Sequencer batch +Additionally, the first block in the window defines the [depositing transactions][depositing-tx] which determine the +[deposits] to be included in the first L2 block of the epoch. -[sequencer-batch]: glossary.md#sequencer-batch +## Sequencing Epoch + +[sequencing-epoch]: glossary.md#sequencing-epoch + +A sequencing epoch is sequential range of L2 blocks derived from a [sequencing window](#sequencing-window) of L1 blocks. + +Each epoch is identified by an epoch number, which is equal to the block number number of the first L1 block in the +sequencing window. -A sequencer batch is list of L2 transactions tagged with an [`epoch`](#sequencing-epoch) and L2 block `timestamp`. -Each L2 block can have one batch of transactions, an input for the block derivation. +Epochs can have variable size, subject to some constraints. See the [L2 chain derivation specification][derivation-spec] +for more details. + +## L1 Origin + +[l1-origin]: glossary.md#l1-origin + +The L1 origin of an L2 block is the L1 block corresponding to its [sequencing epoch][sequencing-epoch]. ------------------------------------------------------------------------------------------------------------------------ @@ -260,7 +304,7 @@ specification. A *depositing call* is an L1 call to the [deposit contract][deposit-contract], which will be derived to a [user-deposited transaction][user-deposited] by the [rollup driver]. -This call specifies all the data (destination, value, calldata, ...) for the deposited transaction. "submits* +This call specifies all the data (destination, value, calldata, ...) for the deposited transaction. ## Depositing Transaction @@ -282,12 +326,16 @@ call][depositing-call]. The *depositor* is **NOT** the originator of the deposit The *deposited transaction type* is an [EIP-2718] [transaction type][transaction-type], which specifies the input fields and correct handling of a [deposited transaction][deposited]. +See the [corresponding section][spec-deposit-tx-type] of the deposits spec for more information. + +[spec-deposit-tx-type]: deposits.md#the-deposited-transaction-type + ## Deposit Contract [deposit-contract]: glossary.md#deposit-contract The *deposit contract* is qn [L1] contract to which [EOAs][EOA] and contracts may send [deposits]. The deposits are -emitted as log records (in Solidity, these are called *events*) for consumption by [rollup nodes][rollup node]. +emitted as log records (in Solidity, these are called *events*) for consumption by [rollup nodes][rollup-node]. Advanced note: the deposits are not stored in calldata because they can be sent by contracts, in which case the calldata is part of the *internal* execution between contracts, and this intermediate calldata is not captured in one of the @@ -299,6 +347,8 @@ cf. [Deposits Specification](deposits.md) # Withdrawals +> **TODO** expand this whole section to be clearer + [withdrawals]: glossary.md#withdrawals In general, a withdrawal is a transaction sent from L2 to L1 that may transfer data and/or value. @@ -316,55 +366,154 @@ The term *withdrawal* is somewhat ambiguous as these "transactions" exist at mul An EOA on L1 which finalizes a withdrawal by submitting the data necessary to verify its inclusion on L2. +## Finalization Period + +[finalization-period]: glossary.md#finalization-period + +The finalization period — sometimes also called *withdrawal delay* — is the minimum amount of time (in seconds) that +must elapse before a [withdrawal][withrawals] can be finalized. + +The finalization period is necessary to afford sufficient time for [validators][validator] to make a [fault +proof][fault-proof]. + +> **TODO** specify current value for finalization period + ------------------------------------------------------------------------------------------------------------------------ -# Other L2 Chain Concepts +# Batch Submission -## Address Aliasing +[batch-submission]: glossary.md#batch-submission -[address-aliasing]: glossary.md#address-aliasing +## Data Availability -When a contract submits a [deposit][deposits] from L1 to L2, it's address (as returned by `ORIGIN` and `CALLER`) will be -aliased with a modified representation of the address of a contract. + [data-availability]: glossary.md#data-availability -- cf. [Deposit Specification](deposits.md#address-aliasing) +Data availability is the guarantee that some data will be "available" (i.e. *retrievable*) during a reasonably long time +window. In Optimism's case, the data in question are [sequencer batches][sequencer-batch] that [validators][validator] +needs in order to verify the sequencer's work and validate the L2 chain. -## L2 Chain Inception +The [finalization period][finalization-period] should be taken as the lower bound on such the availability window, since +that is when data availability is the most crucial, as it is needed to perform a [fault proof][fault-proof]. -[L2 chain inception]: glossary.md#L2-chain-inception +"Availability" **does not** mean guaranteed long-term storage of the data. -The L1 block number for which the first block of the L2 chain was generated. +## Data Availability Provider -## Rollup Node +[avail-provider]: glossary.md#data-availability-provider -[rollup node]: glossary.md#rollup-node +A data availability provider is a service that can be used to make data available. See the [Data +Availability][data-availability] for more information on what this means. -The rollup node is responsible for [deriving the L2 chain][derivation] from the L1 chain (L1 [blocks][block] and their -associated [receipts][receipt]). This is done by its [rollup driver] component. +Ideally, a good data availability provider such provide strong *verifiable* guarantees of data availability -- cf. [Rollup Node Specification](rollup-node.md) +Currently, the only supported data availability provider is Ethereum call data. [Ethereum data blobs][eip4844] will be +supported when they get deployed on Ethereum. -## Rollup Driver +## Sequencer Batch -[rollup driver]: glossary.md#rollup-driver +[sequencer-batch]: glossary.md#sequencer-batch + +A sequencer batch is list of L2 transactions (that were submitted to a sequencer) tagged with an [epoch +number](#sequencing-epoch) and an L2 block timestamp (which can trivially be converted to a block number, given our +block time is constant). + +Sequencer batches are part of the [L2 derivation inputs][deriv-inputs]. Each batch represents the inputs needed to build +**one** L2 block (given the existing L2 chain state) — excepted for the fist block of each epoch, which also needs +information about deposits (cf. the section on [L2 derivation inputs][deriv-inputs]). -The rollup driver is the [rollup node] component responsible for [deriving the L2 chain][derivation] from the L1 chain -(L1 [blocks][block] and their associated [receipts][receipt]). +## Channel -## L2 Chain Derivation +[channel]: glossary.md#channel + +A channel is a sequence of [sequencer batches][sequencer-batch] (for sequential blocks) compressed together. The reason +to group multiple batches together is simply to obtain a better compression rate, hence reducing data availability +costs. + +A channel can be split in [frames][channel-frame] in order to be transmitted via [batcher +transactions][batcher-transaction]. The reason to split a channel into frames is that a channel might too large to +include in a single batcher transaction. + +A channel is uniquely identified by its timestamp (UNIX time at which the channel was created) and a random value. See +the [Frame Format][frame-format] section of the L2 Chain Derivation specifictaion for more information. + +[frame-format]: derivation.md#frame-format + +On the side of the [rollup node][rollup-node] (which is the consumer of channels), a channel is considered to be +*opened* if its final frame (explicitly marked as such) has not been read, or closed otherwise. + +## Channel Frame + +[channel-frame]: glossary.md#channel-frame + +A channel frame is a chunk of data belonging to a [channel]. [Batcher transactions][batcher-transaction] carry one or +multiple frames. The reason to split a channel into frames is that a channel might too large to include in a single +batcher transaction. + +## Batcher + +[batcher]: glossary.md#batcher + +A batcher is a software component (independant program) that is responsible to make channels available on a data +availability provider. The batcher communicates with the rollup node in order to retrieve the channels. The channels are +then made available using [batcher transactions][batcher-transaction]. + +> **TODO** In the future, we might want to make the batcher responsible for constructing the channels, letting it only +> query the rollup node for L2 block inputs. + +## Batcher Transaction + +[batcher-transaction]: glossary.md#batcher-transaction + +A batcher transaction is a transaction submitted by a [batcher] to a data availability provider, in order to make +channels available. These transactions carry one or more full frames, which may belong to different channels. A +channel's frame may be split between multiple batcher transactions. + +When submitted to Ethereum calldata, the batcher transaction's receiver must be the sequencer inbox address. The +transaction must also be signed by a recognized batch submitter account. + +> **TODO** specify where these recognized batch submitter accounts are stored + +## Channel Timeout + +[channel-timeout]: glossary.md#channel-timeout + +The channel timeout is a duration (in seconds) during which [channel frames][channel-frame may land on L1 within +[batcher transactions][batcher-transaction]. + +The acceptable time range for the frames of a [channel][channel] is `[channel_id.timestamp, channel_id.timestamp + +CHANNEL_TIMEOUT]`. The acceptable L1 block range for these frames are any L1 block whose timestamp falls inside this +time range. (Note that `channel_id.timetamp` must be lower than the L1 block timestamp of any L1 block in which frames +of the channel are seen, or else these frames are ignored.) + +The purpose of channel timeouts is dual: + +- Avoid keeping old unclosed channel data around forever (an unclosed channel is a channel whose final frame was not + sent). +- Bound the number of L1 blocks we have to look back in order to decode [sequencer batches][sequencer-batch] from + channels. This is particularly relevant during L1 re-orgs, see the [Resetting Channel Buffering][reset-channel-buffer] + section of the L2 Chain Derivation specifiction for more information. + +[reset-channel-buffer]: derivation.md#resetting-channel-buffering + +> **TODO** specify `CHANNEL_TIMEOUT` + +------------------------------------------------------------------------------------------------------------------------ + +# L2 Chain Derivation [derivation]: glossary.md#L2-chain-derivation -A process that reads [L2 derivation inputs][deriv-inputs] from L1 in order to derive the L2 chain. +L2 chain derivation is a process that reads [L2 derivation inputs][deriv-inputs] from L1 in order to derive the L2 +chain. -cf. [L2 Chain Derivation (in Rollup Node -Specification)](rollup-node.md#l2-chain-derivation) +See the [L2 chain derivation specification][derivation-spec] for more details. ## L2 Derivation Inputs [deriv-inputs]: glossary.md#l2-chain-derivation-inputs -This term refers to data that is found in L1 blocks and is read by the [rollup node] to construct [payload attributes]. +This term refers to data that is found in L1 blocks and is read by the [rollup node][rollup-node] to construct [payload +attributes][payload-attr]. L2 derivation inputs include: @@ -377,7 +526,7 @@ L2 derivation inputs include: ## Payload Attributes -[payload attributes]: glossary.md#payload-attributes +[payload-attr]: glossary.md#payload-attributes This term refers to an object that can be derived from [L2 chain derivation inputs][deriv-inputs] found on L1, which are then passed to the [execution engine][execution-engine] to construct L2 blocks. @@ -391,6 +540,131 @@ See also the [Building The Payload Attributes][building-payload-attr] section of [building-payload-attr]: rollup-node.md#building-the-payload-attributes +## L2 Genesis Block + +[l2-genesis]: glossary.md#l2-genesis-block + +The L2 genesis block is the first block of the L2 chain in its current version. + +The state of the L2 genesis block comprises: + +- State inherited from the previous version of the L2 chain. + - This state was possibly modified by "state surgeries". For instance, the migration to Bedrock entailed changes on + how native ETH balances were stored in the storage trie. +- [Predeployed contracts][predeploy] + +The timestap of the L2 genesis block must be a multiple of the [block time][block-time] (i.e. a even number, since the +block time is 2 seconds). + +When updating the rollup protocol to a new version, we may perform a *squash fork*, a process that entails the creation +of a new L2 genesis block. This new L2 genesis block will have block number `X + 1`, where `X` is the block number of +the final L2 block before the update. + +A squash fork is not to be confused with a *re-genesis*, a similar process that we employed in the past, which also +resets L2 block numbers, such that the new L2 genesis block has number 0. We will not employ re-genesis in the future. + +Squash forks are superior to re-geneses because they avoid duplicating L2 block numbers, which breaks a lot of external +tools. + +## L2 Chain Inception + +[l2-chain-inception]: glossary.md#L2-chain-inception + +The L1 block number at which the output roots for the [genesis block][l2-genesis] were proposed on the [output +oracle][output-oracle] contract. + +In the current implementation, this is the L1 block number at which the output oracle contract was deployed or upgraded. + +## Safe L2 Head + +[safe-l2-head]: glossary.md#safe-l2-head + +The safe L2 head is most recent L2 block that was can be derived entirely from L1 by a [rollup node][rollup-node]. This +can vary between different nodes, based on their view of the L1 chain. + +## Unsafe L2 Block + +[unsafe-l2-block]: glossary.md#unsafe-l2-block + +An unsafe L2 block is an L2 block that a [rollup node][rollup-node] knows about, but which was not derived from the L1 +chian. In sequencer mode, this will be a block sequenced by the sequencer itself. In validator mode, this will be a +block acquired from the sequencer via [unsafe sync][unsafe-sync]. + +## Unsafe L2 Head + +[unsafe-l2-head]: glossary.md#unsafe-l2-head + +The unsafe L2 head is the highest [unsafe L2 block][unsafe-l2-block] that a [rollup node][rollup-node] knows about. + +## Unsafe Block Consolidation + +[consolidation]: glossary.md#unsafe-block-consolidation + +Unsafe block consolidation is the process through which the [rollup node][rollup-node] attempts to move the [safe L2 +head] a block forward, so that the oldest [unsafe L2 block][unsafe-l2-block] becomes the new safe L2 head. + +In order to perform consolidation, the node verifies that the [payload attributes][payload-attr] derived from the L1 +chain match the oldest unsafe L2 block exactly. + +See the [Engine Queue section][engine-queue] of the L2 chain derivatiaon spec for more information. + +[engine-queue]: derivation.md#engine-queue + +## Finalized L2 Head + +[finalized-l2-head]: glossary.md#finalized-l2-head + +The finalized L2 head is the highest L2 block that can be derived from *[finalized][finality]* L1 blocks — i.e. L1 +blocks older than two L1 epochs (64 L1 [time slots][time-slot]). + +[finality]: *finalized* L1 data. + +------------------------------------------------------------------------------------------------------------------------ + +# Other L2 Chain Concepts + +## Address Aliasing + +[address-aliasing]: glossary.md#address-aliasing + +When a contract submits a [deposit][deposits] from L1 to L2, it's address (as returned by `ORIGIN` and `CALLER`) will be +aliased with a modified representation of the address of a contract. + +- cf. [Deposit Specification](deposits.md#address-aliasing) + +## Rollup Node + +[rollup-node]: glossary.md#rollup-node + +The rollup node is responsible for [deriving the L2 chain][derivation] from the L1 chain (L1 [blocks][block] and their +associated [receipts][receipt]). + +The rollup node can run either in *validator* or *sequencer* mode. + +In sequencer mode, the rollup node receives L2 transactions from users, which it uses to create L2 blocks. These are +then submitted to a [data availability provider][avail-provider] via [batch submission][batch-submission]. The L2 chain +derivation then acts as a sanity check and a way to detect L1 chain [re-orgs][reorg]. + +In validator mode, the rollup node performs derivation as indicated above, but is also able to "run ahead" of the L1 +chain by getting blocks directly from the sequencer, in which case derivation serves to validate the sequencer's +behaviour. + +A rollup node running in validator mode is sometimes called *a replica*. + +> **TODO** expand this to include output root submission + +See the [rollup node specification][rollup-node-spec] for more information. + +## Rollup Driver + +[rollup driver]: glossary.md#rollup-driver + +The rollup driver is the [rollup node][rollup-node] component responsible for [deriving the L2 chain][derivation] +from the L1 chain (L1 [blocks][block] and their associated [receipts][receipt]). + +> **TODO** delete this entry, alongside its reference — can be replaced by "derivation process" or "derivation logic" +> where needed + ## L1 Attributes Predeployed Contract [l1-attr-predeploy]: glossary.md#l1-attributes-predeployed-contract @@ -408,6 +682,70 @@ A 32 byte value which serves as a commitment to the current state of the L2 chai cf. [Proposing L2 output commitments](proposals.md#l2-output-root-proposals-specification) +## L2 Output Oracle Contract + +[output-oracle]: glossary.md#l2-output-oracle-contract + +An L1 contract to which [L2 output roots][l2-output] are posted by the [sequencer]. + +> **TODO** expand + +## Validator + +[validator]: glossary.md#validator + +A validator is an entity (individual or organization) that runs a [rollup node][rollup-node] in validator mode. + +Doing so grants a lot of benefits similar to running an Ethereum node, such as the ability to simulate L2 transactions +locally, without rate limiting. + +It also lets the validator verify the work of the [sequencer], by re-deriving [output roots][l2-output] and comparing +them against those submitted by the sequencer. In case of a mismatch, the validator can perform a [fault +proof][fault-proof]. + +## Fault Proof + +[fault-proof]: glossary.md#fault-proof + +An on-chain *interactive* proof, performed by [validators][validator], that demonstrates that a [sequencer] provided +erroneous [output roots][l2-output]. + +Fault proofs are not specified yet. For now, the best place to find information about fault proofs is the [Cannon +repository][cannon]. + +> **TODO** expand + +## Time Slot + +[time-slot]: glossary.md#time-slot + +On L2, there is a block every 2 second (this duration is known as the [block time][block-time]). + +We say that there is a "time slot" every multiple of 2s after the timestamp of the [L2 genesis block][l2-genesis]. + +On L1, post-[merge], the time slots are every 12s. However, an L1 block may not be produced for every time slot, in case +of even benign consensus issues. + +## Block Time + +[block-time]: glossary.md#block-time + +The L2 block time is 2 second, meaning there is an L2 block at every 2s [time slot][time-slot]. + +Post-[merge], it could be said the that L1 block time is 12s as that is the L1 [time slot][time-slot]. However, in +reality the block time is variable as some time slots might be skipped. + +Pre-merge, the L1 block time is variable, though it is on average 13s. + +## Unsafe Sync + +[unsafe-sync]: glossary.md#unsafe-sync + +Unsafe sync is the process through which a [validator][validator] learns about [unsafe L2 blocks][unsafe-l2-block] from +the [sequencer][sequencer]. + +These unsafe blocks will later need to be confirmed by the L1 chain (via [unsafe block consolidation][consolidation]). + ------------------------------------------------------------------------------------------------------------------------ # Execution Engine Concepts @@ -424,13 +762,17 @@ Both L1 (post-[merge]) and L2 have an execution engine. On L1, the executed blocks can come from L1 block synchronization; or from a block freshly minted by the execution engine (using transactions from the L1 [mempool]), at the request of the L1 consensus layer. -On L2, the executed blocks are freshly minted by the execution engine at the request of the [rollup node], using -transactions [derived from L1 blocks][derivation]. +On L2, the executed blocks are freshly minted by the execution engine at the request of the [rollup node][rollup-node], +using transactions [derived from L1 blocks][derivation]. In these specifications, "execution engine" always refer to the L2 execution engine, unless otherwise specified. - cf. [Execution Engine Specification](exec-engine.md) + +[derivation-spec]: derivation.md +[rollup-node-spec]: rollup-node.md + [mpt-details]: https://github.com/norswap/nanoeth/blob/d4c0c89cc774d4225d16970aa44c74114c1cfa63/src/com/norswap/nanoeth/trees/patricia/README.md [trie]: https://en.wikipedia.org/wiki/Trie @@ -442,3 +784,5 @@ In these specifications, "execution engine" always refer to the L2 execution eng [merge]: https://ethereum.org/en/eth2/merge/ [mempool]: https://www.quicknode.com/guides/defi/how-to-access-ethereum-mempool [L1 consensus layer]: https://github.com/ethereum/consensus-specs/#readme +[cannon]: https://github.com/ethereum-optimism/cannon +[eip4844]: https://www.eip4844.com/ diff --git a/specs/guaranteed-gas-market.md b/specs/guaranteed-gas-market.md index b8b3f67ed4e69..642f194bd5ee0 100644 --- a/specs/guaranteed-gas-market.md +++ b/specs/guaranteed-gas-market.md @@ -4,10 +4,9 @@ **Table of Contents** -- [Guaranteed Gas Fee Market](#guaranteed-gas-fee-market) - - [Gas Stipend](#gas-stipend) - - [Limiting Guaranteed Gas](#limiting-guaranteed-gas) - - [Rationale for burning L1 Gas](#rationale-for-burning-l1-gas) +- [Gas Stipend](#gas-stipend) +- [Limiting Guaranteed Gas](#limiting-guaranteed-gas) +- [Rationale for burning L1 Gas](#rationale-for-burning-l1-gas) diff --git a/specs/introduction.md b/specs/introduction.md index 6aa1d51d4500c..83f77c8205ac8 100644 --- a/specs/introduction.md +++ b/specs/introduction.md @@ -4,21 +4,20 @@ **Table of Contents** -- [Introduction](#introduction) - - [Foundations](#foundations) - - [What is Ethereum scalability?](#what-is-ethereum-scalability) - - [What is an Optimistic Rollup?](#what-is-an-optimistic-rollup) - - [What is EVM Equivalence?](#what-is-evm-equivalence) - - [🎶 All together now 🎶](#-all-together-now-) - - [Protocol Guarantees](#protocol-guarantees) - - [Network Participants](#network-participants) - - [Users](#users) - - [Sequencers](#sequencers) - - [Verifiers](#verifiers) - - [Key Interaction Diagrams](#key-interaction-diagrams) - - [Depositing and Sending Transactions](#depositing-and-sending-transactions) - - [Withdrawing](#withdrawing) - - [Next Steps](#next-steps) +- [Foundations](#foundations) + - [What is Ethereum scalability?](#what-is-ethereum-scalability) + - [What is an Optimistic Rollup?](#what-is-an-optimistic-rollup) + - [What is EVM Equivalence?](#what-is-evm-equivalence) + - [🎶 All together now 🎶](#-all-together-now-) +- [Protocol Guarantees](#protocol-guarantees) +- [Network Participants](#network-participants) + - [Users](#users) + - [Sequencers](#sequencers) + - [Verifiers](#verifiers) +- [Key Interaction Diagrams](#key-interaction-diagrams) + - [Depositing and Sending Transactions](#depositing-and-sending-transactions) + - [Withdrawing](#withdrawing) +- [Next Steps](#next-steps) diff --git a/specs/messengers.md b/specs/messengers.md index ccfa2635beedf..d1c7725c268a9 100644 --- a/specs/messengers.md +++ b/specs/messengers.md @@ -4,13 +4,12 @@ **Table of Contents** -- [Cross Domain Messengers](#cross-domain-messengers) - - [Message Passing](#message-passing) - - [Upgradability](#upgradability) - - [Message Versioning](#message-versioning) - - [Message Version 0](#message-version-0) - - [Message Version 1](#message-version-1) - - [Backwards Compatibility Notes](#backwards-compatibility-notes) +- [Message Passing](#message-passing) +- [Upgradability](#upgradability) +- [Message Versioning](#message-versioning) + - [Message Version 0](#message-version-0) + - [Message Version 1](#message-version-1) +- [Backwards Compatibility Notes](#backwards-compatibility-notes) diff --git a/specs/meta/devnet.md b/specs/meta/devnet.md index 2bd3f7bba625c..00a6ba88f93d3 100644 --- a/specs/meta/devnet.md +++ b/specs/meta/devnet.md @@ -1,5 +1,13 @@ # Bedrock Local Devnet Setup + + +**Table of Contents** + +- [Bedrock Local Devnet Setup](#bedrock-local-devnet-setup) + + + You can spin up a local devnet via `docker-compose`. For convenience, we have defined `make` targets to start and stop the devnet with a single command. To run the devnet, you will need `docker` and `docker-compose` installed. diff --git a/specs/meta/versioning.md b/specs/meta/versioning.md index 333c4c9c91615..01b8ca531352f 100644 --- a/specs/meta/versioning.md +++ b/specs/meta/versioning.md @@ -1,5 +1,15 @@ # Versioning + + +**Table of Contents** + +- [Go modules](#go-modules) + - [versioning process](#versioning-process) +- [Typescript](#typescript) + + + ## Go modules Go modules that are currently versioned: diff --git a/specs/overview.md b/specs/overview.md index edbbe2dee94b6..5db2acce08267 100644 --- a/specs/overview.md +++ b/specs/overview.md @@ -4,19 +4,18 @@ **Table of Contents** -- [Optimism Overview](#optimism-overview) - - [Architecture Design Goals](#architecture-design-goals) - - [Components](#components) - - [L1 Components](#l1-components) - - [L2 Components](#l2-components) - - [Transaction/Block Propagation](#transactionblock-propagation) - - [Key Interactions In Depth](#key-interactions-in-depth) - - [Deposits](#deposits) - - [Block Derivation](#block-derivation) - - [Overview](#overview) - - [Epochs and the Sequencing Window](#epochs-and-the-sequencing-window) - - [Block Derivation Loop](#block-derivation-loop) - - [Engine API](#engine-api) +- [Architecture Design Goals](#architecture-design-goals) +- [Components](#components) + - [L1 Components](#l1-components) + - [L2 Components](#l2-components) + - [Transaction/Block Propagation](#transactionblock-propagation) +- [Key Interactions In Depth](#key-interactions-in-depth) + - [Deposits](#deposits) + - [Block Derivation](#block-derivation) + - [Overview](#overview) + - [Epochs and the Sequencing Window](#epochs-and-the-sequencing-window) + - [Block Derivation Loop](#block-derivation-loop) + - [Engine API](#engine-api) diff --git a/specs/predeploys.md b/specs/predeploys.md index a119df6bdad61..11c92c55499f6 100644 --- a/specs/predeploys.md +++ b/specs/predeploys.md @@ -4,21 +4,20 @@ **Table of Contents** -- [Predeploys](#predeploys) - - [Overview](#overview) - - [OVM\_L2ToL1MessagePasser](#ovm_l2tol1messagepasser) - - [OVM\_DeployerWhitelist](#ovm_deployerwhitelist) - - [OVM\_ETH](#ovm_eth) - - [WETH9](#weth9) - - [L2CrossDomainMessenger](#l2crossdomainmessenger) - - [L2StandardBridge](#l2standardbridge) - - [SequencerFeeVault](#sequencerfeevault) - - [OptimismMintableERC20Factory](#OptimismMintableERC20Factory) - - [L1BlockNumber](#l1blocknumber) - - [OVM\_GasPriceOracle](#ovm_gaspriceoracle) - - [Reserved System Address 1](#reserved-system-address-1) - - [Reserved System Address 2](#reserved-system-address-2) - - [L1Block](#l1block) +- [Overview](#overview) +- [OVM\_L2ToL1MessagePasser](#ovm%5C_l2tol1messagepasser) +- [OVM\_DeployerWhitelist](#ovm%5C_deployerwhitelist) +- [OVM\_ETH](#ovm%5C_eth) +- [WETH9](#weth9) +- [L2CrossDomainMessenger](#l2crossdomainmessenger) +- [L2StandardBridge](#l2standardbridge) +- [SequencerFeeVault](#sequencerfeevault) +- [OptimismMintableERC20Factory](#optimismmintableerc20factory) +- [L1BlockNumber](#l1blocknumber) +- [OVM\_GasPriceOracle](#ovm%5C_gaspriceoracle) +- [Reserved System Address 1](#reserved-system-address-1) +- [Reserved System Address 2](#reserved-system-address-2) +- [L1Block](#l1block) diff --git a/specs/proposals.md b/specs/proposals.md index 80ac704400089..a7f3010d6ee85 100644 --- a/specs/proposals.md +++ b/specs/proposals.md @@ -9,14 +9,13 @@ **Table of Contents** -- [L2 Output Root Proposals Specification](#l2-output-root-proposals-specification) - - [Proposing L2 Output Commitments](#proposing-l2-output-commitments) - - [L2 Output Commitment Construction](#l2-output-commitment-construction) - - [L2 Output Oracle Smart Contract](#l2-output-oracle-smart-contract) - - [Security Considerations](#security-considerations) - - [L1 Reorgs](#l1-reorgs) - - [Summary of Definitions](#summary-of-definitions) - - [Constants](#constants) +- [Proposing L2 Output Commitments](#proposing-l2-output-commitments) +- [L2 Output Commitment Construction](#l2-output-commitment-construction) +- [L2 Output Oracle Smart Contract](#l2-output-oracle-smart-contract) +- [Security Considerations](#security-considerations) + - [L1 Reorgs](#l1-reorgs) +- [Summary of Definitions](#summary-of-definitions) + - [Constants](#constants) @@ -43,7 +42,7 @@ described [below](#l2-output-commitment-construction). If there is no newly finalized output, the service continues querying until it receives one. It then submits this output, and the appropriate timestamp, to the [L2 Output Root](#l2-output-root-smart-contract) contract's -`appendL2Output()` function. The timestamp MUST be the next multiple of the `SUBMISSION_INTERVAL` value. +`proposeL2Output()` function. The timestamp MUST be the next multiple of the `SUBMISSION_INTERVAL` value. The proposer may also delete the most recent output root by calling the `deleteL2Output()` function. The function can be called repeatedly if it is necessary to roll back the state further. @@ -102,13 +101,13 @@ The L2 Output Oracle contract implements the following interface: * @notice Accepts an L2 outputRoot and the timestamp of the corresponding L2 block. The * timestamp must be equal to the current value returned by `nextTimestamp()` in order to be * accepted. - * This function may only be called by the Sequencer. + * This function may only be called by the Proposer. * @param _l2Output The L2 output of the checkpoint block. * @param _l2BlockNumber The L2 block number that resulted in _l2Output. * @param _l1Blockhash A block hash which must be included in the current chain. * @param _l1BlockNumber The block number with the specified block hash. */ - function appendL2Output( + function proposeL2Output( bytes32 _l2Output, uint256 _l2BlockNumber, bytes32 _l1Blockhash, @@ -133,7 +132,7 @@ function nextBlockNumber() public view returns (uint256) { ### L1 Reorgs If the L1 has a reorg after an output has been generated and submitted, the L2 state and correct output may change -leading to a faulty proposal. This is mitigated against by allowing the sequencer to submit an +leading to a faulty proposal. This is mitigated against by allowing the proposer to submit an L1 block number and hash to the Output Oracle when appending a new output; in the event of a reorg, the block hash will not match that of the block with that number and the call will revert. diff --git a/specs/rollup-node-p2p.md b/specs/rollup-node-p2p.md index eb5fdc97661f8..e453783b9df4c 100644 --- a/specs/rollup-node-p2p.md +++ b/specs/rollup-node-p2p.md @@ -29,35 +29,34 @@ and are adopted by several other blockchains, most notably the [L1 consensus lay **Table of Contents** -- [Rollup-node P2P interface](#rollup-node-p2p-interface) - - [P2P configuration](#p2p-configuration) - - [Identification](#identification) - - [Discv5](#discv5) - - [Structure](#structure) - - [LibP2P](#libp2p) - - [Transport](#transport) - - [Dialing](#dialing) - - [NAT](#nat) - - [Peer management](#peer-management) - - [Transport security](#transport-security) - - [Protocol negotiation](#protocol-negotiation) - - [Identify](#identify) - - [Ping](#ping) - - [Multiplexing](#multiplexing) - - [GossipSub](#gossipsub) - - [Content-based message identification](#content-based-message-identification) - - [Message compression and limits](#message-compression-and-limits) - - [Message ID computation](#message-id-computation) - - [Heartbeat and parameters](#heartbeat-and-parameters) - - [Topic configuration](#topic-configuration) - - [Topic validation](#topic-validation) - - [Gossip Topics](#gossip-topics) - - [`blocks`](#blocks) - - [Block encoding](#block-encoding) - - [Block signatures](#block-signatures) - - [Block validation](#block-validation) - - [Block processing](#block-processing) - - [Block topic scoring parameters](#block-topic-scoring-parameters) +- [P2P configuration](#p2p-configuration) + - [Identification](#identification) + - [Discv5](#discv5) + - [Structure](#structure) + - [LibP2P](#libp2p) + - [Transport](#transport) + - [Dialing](#dialing) + - [NAT](#nat) + - [Peer management](#peer-management) + - [Transport security](#transport-security) + - [Protocol negotiation](#protocol-negotiation) + - [Identify](#identify) + - [Ping](#ping) + - [Multiplexing](#multiplexing) + - [GossipSub](#gossipsub) + - [Content-based message identification](#content-based-message-identification) + - [Message compression and limits](#message-compression-and-limits) + - [Message ID computation](#message-id-computation) + - [Heartbeat and parameters](#heartbeat-and-parameters) + - [Topic configuration](#topic-configuration) + - [Topic validation](#topic-validation) +- [Gossip Topics](#gossip-topics) + - [`blocks`](#blocks) + - [Block encoding](#block-encoding) + - [Block signatures](#block-signatures) + - [Block validation](#block-validation) + - [Block processing](#block-processing) + - [Block topic scoring parameters](#block-topic-scoring-parameters) diff --git a/specs/rollup-node.md b/specs/rollup-node.md index 99eee4cc91090..82e176ae9f2f1 100644 --- a/specs/rollup-node.md +++ b/specs/rollup-node.md @@ -8,34 +8,10 @@ [g-exec-engine]: glossary.md#execution-engine [g-reorg]: glossary.md#re-organization [g-rollup-driver]: glossary.md#rollup-driver -[g-inception]: glossary.md#L2-chain-inception [g-receipts]: glossary.md#receipt -[g-deposit-contract]: glossary.md#deposit-contract -[g-deposits]: glossary.md#deposits -[g-deposited]: glossary.md#deposited-transaction -[g-l1-attr-deposit]: glossary.md#l1-attributes-deposited-transaction -[g-user-deposited]: glossary.md#user-deposited-transaction -[g-l1-attr-predeploy]: glossary.md#l1-attributes-predeployed-contract -[g-depositing-call]: glossary.md#depositing-call -[g-depositing-transaction]: glossary.md#depositing-transaction -[g-mpt]: glossary.md#merkle-patricia-trie -[g-sequencing-window]: glossary.md#sequencing-window -[g-sequencing]: glossary.md#sequencing -[g-sequencer-batch]: glossary.md#sequencer-batch The [rollup node][g-rollup-node] is the component responsible for [deriving the L2 chain][g-derivation] from L1 blocks -(and their associated [receipts][g-receipts]). This process happens in three steps: - -1. Select a [sequencing window][g-sequencing-window] from the L1 chain, on top of the last L2 block: - a list of blocks, with transactions and associated receipts. -2. Read L1 information, deposits, and sequencing batches in order to generate [payload attributes][g-payload-attr] - (essentially [a block without output properties][g-block]). -3. Pass the payload attributes to the [execution engine][g-exec-engine], so that the L2 block (including [output block - properties][g-block]) may be computed. - -While this process is conceptually a pure function from the L1 chain to the L2 chain, it is in practice incremental. The -L2 chain is extended whenever new L1 blocks are added to the L1 chain. Similarly, the L2 chain re-organizes whenever the -L1 chain [re-organizes][g-reorg]. +(and their associated [receipts][g-receipts]). The part of the rollup node that derives the L2 chain is called the [rollup driver][g-rollup-driver]. This document is currently only concerned with the specification of the rollup driver. @@ -44,313 +20,39 @@ currently only concerned with the specification of the rollup driver. **Table of Contents** -- [Rollup Node Specification](#rollup-node-specification) -- [L2 Chain Derivation](#l2-chain-derivation) - - [From L1 Sequencing Window to L2 Payload Attributes](#from-l1-sequencing-window-to-l2-payload-attributes) - - [Reading L1 inputs](#reading-l1-inputs) - - [Encoding the L1 Attributes Deposited Transaction](#encoding-the-l1-attributes-deposited-transaction) - - [Encoding User-Deposited Transactions](#encoding-user-deposited-transactions) - - [Deriving all Payload Attributes of a sequencing window](#deriving-all-payload-attributes-of-a-sequencing-window) - - [Building individual Payload Attributes](#building-individual-payload-attributes) - - [From Payload Attributes to L2 Block](#from-payload-attributes-to-l2-block) - - [Inductive Derivation Step](#inductive-derivation-step) - - [Engine API Error Handling](#engine-api-error-handling) - - [Finalization Guarantees](#finalization-guarantees) - - [Whole L2 Chain Derivation](#whole-l2-chain-derivation) - - [L2 Output RPC method](#l2-output-rpc-method) - - [Output Method API](#output-method-api) -- [Handling L1 Re-Orgs](#handling-l1-re-orgs) +- [Driver](#driver) + - [Derivation](#derivation) +- [L2 Output RPC method](#l2-output-rpc-method) + - [Output Method API](#output-method-api) +- [L2 Batch creation RPC method](#l2-batch-creation-rpc-method) -# L2 Chain Derivation - -[l2-chain-derivation]: #l2-chain-derivation - -This section specifies how the [rollup driver][g-rollup-driver] derives a sequence of L2 blocks per sequencing window. - -Every L2 block carries transactions of two categories: - -- *[deposited transactions][g-deposited]*: two kinds: - - derived from the L1 chain: a single *[L1 attributes deposited transaction][g-l1-attr-deposit]* (always first). - - derived from [receipts][g-receipts]: zero or more *[user-deposited transactions][g-user-deposited]*. -- *[sequenced transactions][g-sequencing]*: derived from [sequencer batches][g-sequencer-batch], - zero or more regular transactions, signed by L2 users. - ------------------------------------------------------------------------------------------------------------------------- - -## From L1 Sequencing Window to L2 Payload Attributes - -A [sequencing window][g-sequencing-window] is a fixed number consecutive L1 blocks that a derivation step takes as -input. The window is identified by an `epoch`, equal to the block number of the first block in the window. - -The derivation of the L2 chain from the L1 chain happens in steps. -Each step adds a variable number of L2 blocks to the L2 chain, derived from the sequencing window for the given epoch. -For epoch `N`, the sequencing window comprises L1 blocks `[N, N + SEQUENCING_WINDOW_SIZE)`. -Note that the sequencing windows overlap. - -### Reading L1 inputs - -The rollup reads the following data from the [sequencing window][g-sequencing-window]: - -- Of the *first* block in the window only: - - L1 block attributes: - - block number - - timestamp - - basefee - - *random* (the output of the [`RANDOM` opcode][random]) - - L1 log entries emitted for [user deposits][g-deposits], augmented with a [sourceHash](./deposits.md#). -- Of each block in the window: - - Sequencer batches, derived from the transactions: - - The transaction receiver is the sequencer inbox address - - The transaction must be signed by a recognized sequencer account - - The calldata may contain a bundle of batches. *(calldata will be substituted with blob data in the future.)* - - Batches not matching filter criteria are ignored: - - `batch.epoch == sequencing_window.epoch`, i.e. for this sequencing window - - `(batch.timestamp - genesis_l2_timestamp) % block_time == 0`, i.e. timestamp is aligned - - `min_l2_timestamp <= batch.timestamp < max_l2_timestamp`, i.e. timestamp is within range - - `min_l2_timestamp = prev_l2_timestamp + l2_block_time` - - `prev_l2_timestamp` is the timestamp of the previous L2 block: the last block of the previous epoch, - or the L2 genesis block timestamp if there is no previous epoch. - - `l2_block_time` is a configurable parameter of the time between L2 blocks - - `max_l2_timestamp = max(l1_timestamp + max_sequencer_drift, min_l2_timestamp + l2_block_time)` - - `l1_timestamp` is the timestamp of the L1 block associated with the L2 block's epoch - - `max_sequencer_drift` is the most a sequencer is allowed to get ahead of L1 - - The batch is the first batch with `batch.timestamp` in this sequencing window, - i.e. one batch per L2 block number. - - The batch only contains sequenced transactions, i.e. it must NOT contain any Deposit-type transactions. - -Note that after the above filtering `min_l2_timestamp >= l1_timestamp` always holds, -i.e. a L2 block timestamp is always equal or ahead of the timestamp of the corresponding L1 origin block. - -[random]: https://eips.ethereum.org/EIPS/eip-4399 - -A bundle of batches is versioned by prefixing with a bundle version byte: `bundle = bundle_version ++ bundle_data`. - -Bundle versions: - -- `0`: `bundle_data = RLP([batch_0, batch_1, ..., batch_N])` -- `1`: `bundle_data = compress(RLP([batch_0, batch_1, ..., batch_N]))` (compression algorithm TBD) - -A batch is also versioned by prefixing with a version byte: `batch = batch_version ++ batch_data` -and encoded as a byte-string (including version prefix byte) in the bundle RLP list. - -Batch versions: - -- `0`: `batch_data = RLP([epoch, timestamp, transaction_list])`, where each - -Batch contents: - -- `epoch` is the sequencing window epoch, i.e. the first L1 block number -- `timestamp` is the L2 timestamp of the block -- `transaction_list` is an RLP encoded list of [EIP-2718] encoded transactions. - -[EIP-2718]: https://eips.ethereum.org/EIPS/eip-2718 - -The L1 attributes are read from the L1 block header, while deposits are read from the block's [receipts][g-receipts]. -Refer to the [**deposit contract specification**][deposit-contract-spec] for details on how deposits are encoded as log -entries. The deposited and sequenced transactions are combined when the Payload Attributes are constructed. - -[deposit-contract-spec]: deposits.md#deposit-contract - -### Encoding the L1 Attributes Deposited Transaction - -The [L1 attributes deposited transaction][g-l1-attr-deposit] is a call that submits the L1 block attributes (listed -above) to the [L1 attributes predeployed contract][g-l1-attr-predeploy]. - -To encode the L1 attributes deposited transaction, refer to the following sections of the deposits spec: - -- [The Deposited Transaction Type](deposits.md#the-deposited-transaction-type) -- [L1 Attributes Deposited Transaction](deposits.md#l1-attributes-deposited-transaction) - -### Encoding User-Deposited Transactions - -A [user-deposited-transactions][g-deposited] is an L2 transaction derived from a [user deposit][g-deposits] submitted on -L1 to the [deposit contract][g-deposit-contract]. Refer to the [deposit contract specification][deposit-contract-spec] -for more details. - -The user-deposited transaction is derived from the log entry emitted by the [depositing call][g-depositing-call], which -is stored in the [depositing transaction][g-depositing-transaction]'s log receipt. - -To encode user-deposited transactions, refer to the following sections of the deposits spec: - -- [The Deposited Transaction Type](deposits.md#the-deposited-transaction-type) -- [User-Deposited Transactions](deposits.md#user-deposited-transactions) - -### Deriving all Payload Attributes of a sequencing window - -A sequencing window is derived into a variable number of L2 blocks, defined by a range of timestamps: - -- Starting at `min_l2_timestamp`, as defined in the batch filtering. -- Up to and including (including only if aligned with L2 block time) - `new_head_l2_timestamp = max(highest_valid_batch_timestamp, next_l1_timestamp - 1, min_l2_timestamp)` - - `highest_valid_batch_timestamp = max(batch.timestamp for batch in filtered_batches)`, - or `0` if no there are no `filtered_batches`. - `batch.timestamp` refers to the L2 block timestamp encoded in the batch. - - `next_l1_timestamp` is the timestamp of the next L1 block. - -The L2 chain is extended to `new_head_l2_timestamp` with blocks at a fixed block time (`l2_block_time`). -This means that every `l2_block_time` that has no batch is interpreted as one with no sequenced transactions. - -Each of the derived `PayloadAttributes` starts with a L1 Attributes transaction. -Like other derived deposits, this does not have to be batch-submitted, and exposes the required L1 information for the -process of finding the sync starting point of the L2 chain, without requiring L2 state access. - -The [User-deposited] transactions are all put in the first of the derived `PayloadAttributes`, -inserted after the L1 Attributes transaction, before any [sequenced][g-sequencing] transactions. - -#### Building individual Payload Attributes - -[payload attributes]: #building-individual-payload-attributes - -From the timestamped transaction lists derived from the sequencing window, the rollup node constructs [payload -attributes][g-payload-attr] as an [expanded version][expanded-payload] of the [`PayloadAttributesV1`] object, which -includes the additional `transactions` and `noTxPool` fields. - -Each of the timestamped transaction lists translates to a `PayloadAttributesV1` as follows: - -- `timestamp` is set to the timestamp of the transaction list. -- `random` is set to the *random* `execution_payload.prev_randao` L1 block attribute -- `suggestedFeeRecipient` is set to an address determined by the system -- `transactions` is the array of the derived transactions: deposited transactions and sequenced transactions. - All encoded with [EIP-2718]. -- `noTxPool` is set to `true`, to use the exact above `transactions` list when constructing the block. - -[expanded-payload]: exec-engine.md#extended-payloadattributesv1 -[`PayloadAttributesV1`]: https://github.com/ethereum/execution-apis/blob/main/src/engine/specification.md#payloadattributesv1 +## Driver ------------------------------------------------------------------------------------------------------------------------- +The task of the [driver][g-rollup-driver] in the [rollup node][g-rollup-node] +is to manage the [derivation][g-derivation] process: -## From Payload Attributes to L2 Block +- Keep track of L1 head block +- Keep track of the L2 chain sync progress +- Iterate over the derivation steps as new inputs become available -Once the [payload attributes] for a given L1 block `B` have been built, and if we have already derived an L2 block from -`B`'s parent block, then we can use the payload attributes to derive a new L2 block. +### Derivation -### Inductive Derivation Step +This process happens in three steps: -Let - -- `refL2` be the (hash of) the current L2 chain head -- `refL1` be the (hash of) the L1 block from which `refL2` was derived -- `payloadAttributes` be some previously derived [payload attributes] for the L1 block with number `l1Number(refL1) + 1` - -Then we can apply the following pseudocode logic to update the state of both the rollup driver and execution engine: - -```javascript -// request a new execution payload -forkChoiceState = { - headBlockHash: refL2, - safeBlockHash: refL2, - finalizedBlockHash: l2BlockHashAt(l2Number(refL2) - FINALIZATION_DELAY_BLOCKS) -} -[status, payloadID] = engine_forkchoiceUpdatedV1(forkChoiceState, payloadAttributes) -if (status != "SUCCESS") error() - -// retrieve and execute the execution payload -[executionPayload, error] = engine_getPayloadV1(payloadID) -if (error != null) error() -[status, latestValidHash, validationError] = engine_newPayloadV1(executionPayload) -if (status != "VALID" || validationError != null) error() - -refL2 = latestValidHash -refL1 = l1HashForNumber(l1Number(refL1) + 1)) - -// update head to new refL2 -forkChoiceState = { - headBlockHash: refL2, - safeBlockHash: refL2, - finalizedBlockHash: l2BlockHashAt(l2Number(headBlockHash) - FINALIZATION_DELAY_BLOCKS) -} -[status, payloadID] = engine_forkchoiceUpdatedV1(refL2, null) -if (status != "SUCCESS") error() -``` - -The following JSON-RPC methods are part of the [execution engine API][exec-engine]: - -> **TODO** fortify the execution engine spec with more information regarding JSON-RPC, notably covering -> information found [here][json-rpc-info-1] and [here][json-rpc-info-2] - -[json-rpc-info-1]: https://github.com/ethereum-optimism/optimistic-specs/blob/a3ffa9a8c825d155a0469659b3101db5f41eecc4/specs/rollup-node.md#from-l1-blocks-to-payload-attributes -[json-rpc-info-2]: https://github.com/ethereum-optimism/optimistic-specs/blob/a3ffa9a8c825d155a0469659b3101db5f41eecc4/specs/rollup-node.md#building-the-l2-block-with-the-execution-engine - -[exec-engine]: exec-engine.md - -- [`engine_forkchoiceUpdatedV1`] — updates the forkchoice (i.e. the chain head) to `headBlockHash` if different, and - instructs the engine to start building an execution payload given payload attributes the second argument isn't `null` -- [`engine_getPayloadV1`] — retrieves a previously requested execution payload -- [`engine_newPayloadV1`] — executes an execution payload to create a block - -[`engine_forkchoiceUpdatedV1`]: exec-engine.md#engine_forkchoiceUpdatedV1 -[`engine_getPayloadV1`]: exec-engine.md#engine_newPayloadV1 -[`engine_newPayloadV1`]: exec-engine.md#engine_newPayloadV1 - -The execution payload is an object of type [`ExecutionPayloadV1`]. - -[`ExecutionPayloadV1`]: https://github.com/ethereum/execution-apis/blob/main/src/engine/specification.md#executionpayloadv1 - -Within the `forkChoiceState` object, the properties have the following meaning: - -- `headBlockHash`: block hash of the last block of the L2 chain, according to the rollup driver. -- `safeBlockHash`: same as `headBlockHash`. -- `finalizedBlockHash`: the hash of the block whose number is `l2Number(headBlockHash) - FINALIZATION_DELAY_BLOCKS` if - the number of that block is `>= L2_CHAIN_INCEPTION`, 0 otherwise (\*) See the [Finalization Guarantees][finalization] - section for more details. - -(\*) where: - -- `FINALIZATION_DELAY_BLOCKS == 50400` (approximately 7 days worth of L1 blocks) -- `L2_CHAIN_INCEPTION` is the [L2 chain inception][g-inception] (the number of the first L1 block for which an L2 block - was produced). - -Finally, the `error()` function signals an error that must be handled by the implementation. Refer to the next section -for more details. - -### Engine API Error Handling - -[error-handling]: #engine-api-error-handling - -All invocations of [`engine_forkchoiceUpdatedV1`], [`engine_getPayloadV1`] and [`engine_newPayloadV1`] by the -rollup driver should not result in errors assuming conformity with the specification. Said otherwise, all errors are -implementation concerns and it is up to them to handle them (e.g. by retrying, or by stopping the chain derivation and -requiring manual user intervention). - -The following scenarios are assimilated to errors: - -- [`engine_forkchoiceUpdatedV1`] returning a `status` of `"SYNCING"` instead of `"SUCCESS"` whenever passed a - `headBlockHash` that it retrieved from a previous call to [`engine_newPayloadV1`]. -- [`engine_newPayloadV1`] returning a `status` of `"SYNCING"` or `"INVALID"` whenever passed an execution payload - that was obtained by a previous call to [`engine_getPayloadV1`]. - -### Finalization Guarantees - -[finalization]: #finalization-guarantees - -As stated earlier, an L2 block is considered *finalized* after a delay of `FINALIZATION_DELAY_BLOCKS == 50400` L1 blocks -after the L1 block that generated it. This is a duration of approximately 7 days worth of L1 blocks. This is also known -as the "fault proof window", as after this time the block can no longer be challenged by a fault proof. - -L1 Ethereum reaches [finality][l1-finality] approximately every [12.8 minutes][consensus-time-params]. L2 blocks -generated from finalized L1 blocks are "safer" than most recent L2 blocks because they will never disappear from the -chain's history because of a re-org. However, they can still be challenged by a fault proof until the end of the fault -proof window. - -[l1-finality]: https://www.paradigm.xyz/2021/07/ethereum-reorgs-after-the-merge -[consensus-time-params]: https://github.com/ethereum/consensus-specs/blob/v1.0.0/specs/phase0/beacon-chain.md#time-parameters - -> **TODO** the spec doesn't encode the notion of fault proof yet, revisit this (and include links) when it does - -## Whole L2 Chain Derivation - -The [block derivation](#from-l1-blocks-to-payload-attributes) presents an inductive process: -given that we know the last L2 block derived from the previous [sequencing window][g-sequencing-window], as well as the -next [sequencing window][g-sequencing-window], then we can derive [payload attributes] of the next L2 blocks. +1. Select inputs from the L1 chain, on top of the last L2 block: + a list of blocks, with transactions and associated data and receipts. +2. Read L1 information, deposits, and sequencing batches in order to generate [payload attributes][g-payload-attr] + (essentially [a block without output properties][g-block]). +3. Pass the payload attributes to the [execution engine][g-exec-engine], so that the L2 block (including [output block + properties][g-block]) may be computed. -To derive the whole L2 chain from scratch, we simply start with the L2 genesis block as the last L2 block, and the -block at height `L2_CHAIN_INCEPTION + 1` as the start of the next sequencing window. -Then we iteratively apply the derivation process from the previous section by shifting the sequencing window one L1 -block forward each step, until there is an insufficient number of L1 blocks left for a complete sequencing window. +While this process is conceptually a pure function from the L1 chain to the L2 chain, it is in practice incremental. The +L2 chain is extended whenever new L1 blocks are added to the L1 chain. Similarly, the L2 chain re-organizes whenever the +L1 chain [re-organizes][g-reorg]. -> **TODO** specify genesis block +For a complete specification of the L2 block derivation, refer to the [L2 block derivation document](./derivation.md). ## L2 Output RPC method @@ -373,62 +75,6 @@ The input and return types here are as defined by the [engine API specs][engine- 1. `version`: `DATA`, 32 Bytes - the output root version number, beginning with 0. 1. `l2OutputRoot`: `DATA`, 32 Bytes - the output root -# Handling L1 Re-Orgs - -[l1-reorgs]: #handling-L1-re-orgs - -The [previous section on L2 chain derivation][l2-chain-derivation] assumes linear progression of the L1 chain. It is -also applicable for batch processing, meaning that any given point in time, the canonical L2 chain is given by -processing the whole L1 chain since the [L2 chain inception][g-inception]. - -If the L1 Chain re-orgs, the rollup node must re-derive sections of the L2 chain such that it derives the same L2 chain -that a rollup node would derive if it only followed the new L1 chain. - -> By itself, the previous section fully specifies the behavior of the rollup driver. **The current section is -> non-specificative** but shows how L1 re-orgs can be handled in practice. - -In practice, the L1 chain is processed incrementally. However, the L1 chain may occasionally [re-organize][g-reorg], -meaning the head of the L1 chain changes to a block that is not the child of the previous head but rather another -descendant of an ancestor of the previous head. In that case, the rollup driver must first search for the common L1 -ancestor, and can re-derive the L2 chain from that L1 block and onward. - -The rollup node maintains two heads of the L2 Chain: the unsafe head (often called head) and the safe head. -Each L2 block has an L1 origin block (corresponding to its epoch) that it references in the -[L1 attributes deposited transaction][l1-attr-deposit]. The unsafe head is the head of the L2 chain. -Its L1 origin block should be canonical or potentially extending the canonical chain -(if the rollup node has not yet seen the L1 block that it is based upon). -The safe head is the the last L2 block of the last epoch whose sequencing window is complete -(i.e. the epoch with number `L1Head.number` - `SEQUENCING_WINDOW_SIZE`). - -[l1-attr-deposit]: glossary.md#l1-attributes-deposited-transaction - -Steps during a reorg: - -1. Set "unsafe head" to equal the l2 head we retrieved, just as default -2. Set "latest block" to equal the l2 head we retrieved, also just as default -3. Walk back L2, and stop until block.l1Origin is found AND canonical, and update "latest block" to this block. -And don't override "unsafe head" if it's not found, but do override it when block.l1Origin does not match the -canonical L1 block at that height. -4. Walk back L2 from the "latest block" until a full sequencing window of L1 blocks has been passed. -This is the "safe block". - -The purpose of this is to ensure that if the sequencing window for a L2 block has changed since it was derived, -that L2 block is re-derived. - -The first L1 block of the sequencing window is the L1 attributes for that L2 block. The end of the sequencing -window is the canonical L1 block whose number is `SEQUENCING_WINDOW` larger than the start. The end of the -window must be selected by number otherwise the sequencer would not be able to create batches. The problem -with selecting the end of the window by number is that when an L1 reorg occurs, the blocks (and thus batches) -in the window could change. We must find the find the first L2 block whose complete sequencing window is -unchanged in the reorg. - -When walking back on the L2 chain, care should be taken to not walk past the rollup genesis. - -Note that post-[merge], the depth of re-orgs will be bounded by the [L1 finality delay][l1-finality] (every 2 epochs, -approximately 12 minutes). - -(\*) Post-merge, this is only possible for 12 minutes. In practice, we'll pick an already-finalized L1 block as L2 -inception point to preclude the possibility of a re-org past genesis, at the cost of a few empty blocks at the start of -the L2 chain. +## L2 Batch creation RPC method -[merge]: https://ethereum.org/en/eth2/merge/ +See [Batch derivation](./batching.md) for an RPC specification for batch data submission. diff --git a/specs/withdrawals.md b/specs/withdrawals.md index 65bc1ba292fe4..5f0aa254517e1 100644 --- a/specs/withdrawals.md +++ b/specs/withdrawals.md @@ -33,19 +33,18 @@ finalization. **Table of Contents** -- [Withdrawals](#withdrawals) - - [Withdrawal Flow](#withdrawal-flow) - - [On L2](#on-l2) - - [On L1](#on-l1) - - [The L2ToL1MessagePasser Contract](#the-l2tol1messagepasser-contract) - - [Addresses are not Aliased on Withdrawals](#addresses-are-not-aliased-on-withdrawals) - - [The Optimism Portal Contract](#the-optimism-portal-contract) - - [Withdrawal Verification and Finalization](#withdrawal-verification-and-finalization) - - [Security Considerations](#security-considerations) - - [Key Properties of Withdrawal Verification](#key-properties-of-withdrawal-verification) - - [Handling Successfully Verified Messages That Fail When Relayed](#handling-successfully-verified-messages-that-fail-when-relayed) - - [Summary of Definitions](#summary-of-definitions) - - [Constants](#constants) +- [Withdrawal Flow](#withdrawal-flow) + - [On L2](#on-l2) + - [On L1](#on-l1) +- [The L2ToL1MessagePasser Contract](#the-l2tol1messagepasser-contract) + - [Addresses are not Aliased on Withdrawals](#addresses-are-not-aliased-on-withdrawals) +- [The Optimism Portal Contract](#the-optimism-portal-contract) +- [Withdrawal Verification and Finalization](#withdrawal-verification-and-finalization) +- [Security Considerations](#security-considerations) + - [Key Properties of Withdrawal Verification](#key-properties-of-withdrawal-verification) + - [Handling Successfully Verified Messages That Fail When Relayed](#handling-successfully-verified-messages-that-fail-when-relayed) +- [Summary of Definitions](#summary-of-definitions) + - [Constants](#constants) diff --git a/yarn.lock b/yarn.lock index 3e4f5d33b6568..42db9ca2b55e1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -827,6 +827,20 @@ ethereumjs-util "^7.1.1" miller-rabin "^4.0.0" +"@ethereumjs/trie@^5.0.0-beta.1": + version "5.0.0-beta.1" + resolved "https://registry.yarnpkg.com/@ethereumjs/trie/-/trie-5.0.0-beta.1.tgz#79d1108222b45bc3576d62583364c96626ce4175" + integrity sha512-OjTzt9fK5aMzm84GRSe+C7bO2zorbEWRueLbxOMlS7lHCiXA7akIQ3mzz9VBSMjT7m01hZ1r3fZIOGHzQVCHtw== + dependencies: + "@ethereumjs/util" "8.0.0-beta.1" + abstract-level "^1.0.3" + ethereum-cryptography "^1.0.3" + level "^8.0.0" + memory-level "^1.0.0" + readable-stream "^3.6.0" + rlp "4.0.0-beta.1" + semaphore-async-await "^1.5.1" + "@ethereumjs/tx@^3.2.1": version "3.3.0" resolved "https://registry.yarnpkg.com/@ethereumjs/tx/-/tx-3.3.0.tgz#14ed1b7fa0f28e1cd61e3ecbdab824205f6a4378" @@ -851,6 +865,14 @@ "@ethereumjs/common" "^2.6.3" ethereumjs-util "^7.1.4" +"@ethereumjs/util@8.0.0-beta.1", "@ethereumjs/util@^8.0.0-beta.1": + version "8.0.0-beta.1" + resolved "https://registry.yarnpkg.com/@ethereumjs/util/-/util-8.0.0-beta.1.tgz#369526faf6e9f1cadfd39c7741cc07cf33d128f8" + integrity sha512-yUg3TdJm25HiamAXbNuOagXQPmgdSrV3oEH0h+Adsxt6D7qHw8HyHLA8C+tNrLP2YwcjF1dGJ+F7WtOibzEp9g== + dependencies: + ethereum-cryptography "^1.0.3" + rlp "4.0.0-beta.1" + "@ethereumjs/vm@^5.9.0": version "5.9.0" resolved "https://registry.yarnpkg.com/@ethereumjs/vm/-/vm-5.9.0.tgz#54e485097c6dbb42554d541ef8d84d06b7ddf12f" @@ -2794,20 +2816,10 @@ dependencies: "@octokit/openapi-types" "^9.5.0" -"@openzeppelin/contracts-upgradeable@4.3.2": - version "4.3.2" - resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.3.2.tgz#92df481362e366c388fc02133cf793029c744cea" - integrity sha512-i/pOaOtcqDk4UqsrOv735uYyTbn6dvfiuVu5hstsgV6c4ZKUtu88/31zT2BzkCg+3JfcwOfgg2TtRKVKKZIGkQ== - -"@openzeppelin/contracts-upgradeable@4.6.0", "@openzeppelin/contracts-upgradeable@^4.5.2": - version "4.6.0" - resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.6.0.tgz#1bf55f230f008554d4c6fe25eb165b85112108b0" - integrity sha512-5OnVuO4HlkjSCJO165a4i2Pu1zQGzMs//o54LPrwUgxvEO2P3ax1QuaSI0cEHHTveA77guS0PnNugpR2JMsPfA== - -"@openzeppelin/contracts-upgradeable@^4.3.2": - version "4.4.0" - resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.4.0.tgz#85161d87c840c5bce2b6ed0c727b407e774852ae" - integrity sha512-hIEyWJHu7bDTv6ckxOaV+K3+7mVzhjtyvp3QSaz56Rk5PscXtPAbkiNTb3yz6UJCWHPWpxVyULVgZ6RubuFEZg== +"@openzeppelin/contracts-upgradeable@4.7.1", "@openzeppelin/contracts-upgradeable@^4.3.2", "@openzeppelin/contracts-upgradeable@^4.5.2": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.7.1.tgz#f63fc384255d6ac139e0a2561aa207fd7c14183c" + integrity sha512-5EFiZld3DYFd8aTL8eeMnhnaWh1/oXLXFNuFMrgF3b1DNPshF3LCyO7VR6lc+gac2URJ0BlVcZoCfkk/3MoEfg== "@openzeppelin/contracts@3.4.1-solc-0.7-2": version "3.4.1-solc-0.7-2" @@ -3183,14 +3195,6 @@ fs-extra "^9.1.0" lodash "^4.17.15" -"@typechain/hardhat@^6.1.2": - version "6.1.2" - resolved "https://registry.yarnpkg.com/@typechain/hardhat/-/hardhat-6.1.2.tgz#d3beccc6937d93f9b437616b741f839a8b953693" - integrity sha512-k4Ea3pVITKB2DH8p1a5U38cyy7KZPD04Spo4q5b4wO+n2mT+uAz5dxckPtbczn/Kk5wiFq+ZkuOtw5ZKFhL/+w== - dependencies: - fs-extra "^9.1.0" - lodash "^4.17.15" - "@types/abstract-leveldown@*": version "5.0.2" resolved "https://registry.yarnpkg.com/@types/abstract-leveldown/-/abstract-leveldown-5.0.2.tgz#ee81917fe38f770e29eec8139b6f16ee4a8b0a5f" @@ -3896,6 +3900,19 @@ abort-controller@^3.0.0: dependencies: event-target-shim "^5.0.0" +abstract-level@^1.0.0, abstract-level@^1.0.2, abstract-level@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/abstract-level/-/abstract-level-1.0.3.tgz#78a67d3d84da55ee15201486ab44c09560070741" + integrity sha512-t6jv+xHy+VYwc4xqZMn2Pa9DjcdzvzZmQGRjTFc8spIbRGHgBrEKbPq+rYXc7CCo0lxgYvSgKVg9qZAhpVQSjA== + dependencies: + buffer "^6.0.3" + catering "^2.1.0" + is-buffer "^2.0.5" + level-supports "^4.0.0" + level-transcoder "^1.0.1" + module-error "^1.0.1" + queue-microtask "^1.2.3" + abstract-leveldown@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-3.0.0.tgz#5cb89f958a44f526779d740d1440e743e0c30a57" @@ -5310,6 +5327,16 @@ brorand@^1.0.1, brorand@^1.1.0: resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= +browser-level@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/browser-level/-/browser-level-1.0.1.tgz#36e8c3183d0fe1c405239792faaab5f315871011" + integrity sha512-XECYKJ+Dbzw0lbydyQuJzwNXtOpbMSq737qxJN11sIRTErOMShvDpbzTlgju7orJKvx4epULolZAuJGLzCmWRQ== + dependencies: + abstract-level "^1.0.2" + catering "^2.1.1" + module-error "^1.0.2" + run-parallel-limit "^1.1.0" + browser-stdout@1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" @@ -5444,6 +5471,14 @@ buffer@^5.0.5, buffer@^5.2.1, buffer@^5.5.0, buffer@^5.6.0: base64-js "^1.3.1" ieee754 "^1.1.13" +buffer@^6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" + integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.2.1" + bufferutil@^4.0.1: version "4.0.3" resolved "https://registry.yarnpkg.com/bufferutil/-/bufferutil-4.0.3.tgz#66724b756bed23cd7c28c4d306d7994f9943cc6b" @@ -5669,6 +5704,11 @@ caseless@^0.12.0, caseless@~0.12.0: resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= +catering@^2.1.0, catering@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/catering/-/catering-2.1.1.tgz#66acba06ed5ee28d5286133982a927de9a04b510" + integrity sha512-K7Qy8O9p76sL3/3m7/zLKbRkyOlSZAgzEaLhyj2mXS8PsCud2Eo4hAb8aLtZqHh0QGqLcb9dlJSu6lHRVENm1w== + cbor@^5.0.2: version "5.2.0" resolved "https://registry.yarnpkg.com/cbor/-/cbor-5.2.0.tgz#4cca67783ccd6de7b50ab4ed62636712f287a67c" @@ -5901,6 +5941,17 @@ class-utils@^0.3.5: isobject "^3.0.0" static-extend "^0.1.1" +classic-level@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/classic-level/-/classic-level-1.2.0.tgz#2d52bdec8e7a27f534e67fdeb890abef3e643c27" + integrity sha512-qw5B31ANxSluWz9xBzklRWTUAJ1SXIdaVKTVS7HcTGKOAmExx65Wo5BUICW+YGORe2FOUaDghoI9ZDxj82QcFg== + dependencies: + abstract-level "^1.0.2" + catering "^2.1.0" + module-error "^1.0.1" + napi-macros "~2.0.0" + node-gyp-build "^4.3.0" + clean-regexp@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/clean-regexp/-/clean-regexp-1.0.0.tgz#8df7c7aae51fd36874e8f8d05b9180bc11a3fed7" @@ -8994,9 +9045,9 @@ forever-agent@~0.6.1: resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= -"forge-std@https://github.com/foundry-rs/forge-std.git#62caef29b0f87a2c6aaaf634b2ca4c09b6867c92": +"forge-std@https://github.com/foundry-rs/forge-std.git#f18682b2874fc57d7c80a511fed0b35ec4201ffa": version "0.0.0" - resolved "https://github.com/foundry-rs/forge-std.git#62caef29b0f87a2c6aaaf634b2ca4c09b6867c92" + resolved "https://github.com/foundry-rs/forge-std.git#f18682b2874fc57d7c80a511fed0b35ec4201ffa" form-data@^2.2.0: version "2.5.1" @@ -10113,7 +10164,7 @@ idna-uts46-hx@^2.3.1: dependencies: punycode "2.1.0" -ieee754@^1.1.13: +ieee754@^1.1.13, ieee754@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== @@ -10399,7 +10450,7 @@ is-buffer@^1.1.4, is-buffer@^1.1.5: resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== -is-buffer@~2.0.3: +is-buffer@^2.0.5, is-buffer@~2.0.3: version "2.0.5" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.5.tgz#ebc252e400d22ff8d77fa09888821a24a658c191" integrity sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ== @@ -11399,6 +11450,11 @@ level-sublevel@6.6.4: typewiselite "~1.0.0" xtend "~4.0.0" +level-supports@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/level-supports/-/level-supports-4.0.1.tgz#431546f9d81f10ff0fea0e74533a0e875c08c66a" + integrity sha512-PbXpve8rKeNcZ9C1mUicC9auIYFyGpkV9/i6g76tLgANwWhtG2v7I4xNBUlkn3lE2/dZF3Pi0ygYGtLc4RXXdA== + level-supports@~1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/level-supports/-/level-supports-1.0.1.tgz#2f530a596834c7301622521988e2c36bb77d122d" @@ -11406,6 +11462,14 @@ level-supports@~1.0.0: dependencies: xtend "^4.0.2" +level-transcoder@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/level-transcoder/-/level-transcoder-1.0.1.tgz#f8cef5990c4f1283d4c86d949e73631b0bc8ba9c" + integrity sha512-t7bFwFtsQeD8cl8NIoQ2iwxA0CL/9IFw7/9gAjOonH0PWTTiRfY7Hq+Ejbsxh86tXobDQ6IOiddjNYIfOBs06w== + dependencies: + buffer "^6.0.3" + module-error "^1.0.1" + level-ws@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/level-ws/-/level-ws-0.0.0.tgz#372e512177924a00424b0b43aef2bb42496d228b" @@ -11441,6 +11505,14 @@ level@^6.0.1: level-packager "^5.1.0" leveldown "^5.4.0" +level@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/level/-/level-8.0.0.tgz#41b4c515dabe28212a3e881b61c161ffead14394" + integrity sha512-ypf0jjAk2BWI33yzEaaotpq7fkOPALKAgDBxggO6Q9HGX2MRXn0wbP1Jn/tJv1gtL867+YOjOB49WaUF3UoJNQ== + dependencies: + browser-level "^1.0.1" + classic-level "^1.2.0" + leveldown@^5.4.0: version "5.6.0" resolved "https://registry.yarnpkg.com/leveldown/-/leveldown-5.6.0.tgz#16ba937bb2991c6094e13ac5a6898ee66d3eee98" @@ -12102,6 +12174,15 @@ memdown@~3.0.0: ltgt "~2.2.0" safe-buffer "~5.1.1" +memory-level@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/memory-level/-/memory-level-1.0.0.tgz#7323c3fd368f9af2f71c3cd76ba403a17ac41692" + integrity sha512-UXzwewuWeHBz5krr7EvehKcmLFNoXxGcvuYhC41tRnkrTbJohtS7kVn9akmgirtRygg+f7Yjsfi8Uu5SGSQ4Og== + dependencies: + abstract-level "^1.0.0" + functional-red-black-tree "^1.0.1" + module-error "^1.0.1" + memorystream@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/memorystream/-/memorystream-0.3.1.tgz#86d7090b30ce455d63fbae12dda51a47ddcaf9b2" @@ -12665,6 +12746,11 @@ modify-values@^1.0.0: resolved "https://registry.yarnpkg.com/modify-values/-/modify-values-1.0.1.tgz#b3939fa605546474e3e3e3c63d64bd43b4ee6022" integrity sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw== +module-error@^1.0.1, module-error@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/module-error/-/module-error-1.0.2.tgz#8d1a48897ca883f47a45816d4fb3e3c6ba404d86" + integrity sha512-0yuvsqSCv8LbaOKhnsQ/T5JhyFlCYLPXK3U2sgV10zoKQwzs/MyfuQUOZQ1V/6OCOJsK/TRgNVrPuPDqtdMFtA== + morgan@^1.10.0: version "1.10.0" resolved "https://registry.yarnpkg.com/morgan/-/morgan-1.10.0.tgz#091778abc1fc47cd3509824653dae1faab6b17d7" @@ -12910,6 +12996,11 @@ node-gyp-build@^4.2.0: resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.2.3.tgz#ce6277f853835f718829efb47db20f3e4d9c4739" integrity sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg== +node-gyp-build@^4.3.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.5.0.tgz#7a64eefa0b21112f89f58379da128ac177f20e40" + integrity sha512-2iGbaQBV+ITgCz76ZEjmhUKAKVf7xfY1sRl4UiKQspfZMH2h06SyhNsnSVy50cwkFQDGLyif6m/6uFXHkOZ6rg== + node-gyp-build@~4.1.0: version "4.1.1" resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.1.1.tgz#d7270b5d86717068d114cc57fff352f96d745feb" @@ -14428,7 +14519,7 @@ querystring@0.2.0: resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" integrity sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA= -queue-microtask@^1.2.2: +queue-microtask@^1.2.2, queue-microtask@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== @@ -15139,6 +15230,11 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: hash-base "^3.0.0" inherits "^2.0.1" +rlp@4.0.0-beta.1: + version "4.0.0-beta.1" + resolved "https://registry.yarnpkg.com/rlp/-/rlp-4.0.0-beta.1.tgz#46983ee758344e5eee48f135129407434cfea2b6" + integrity sha512-UVIENF7Rw+nX5cpfzw6X3/oXNQKsSZ8HbDJUeU9RoIs1LLyMjcPZR1o26i1vFbpuVN8GRmcdopEYOMjVsLRsQQ== + rlp@^2.0.0, rlp@^2.2.1, rlp@^2.2.2, rlp@^2.2.3, rlp@^2.2.4, rlp@^2.2.6: version "2.2.6" resolved "https://registry.yarnpkg.com/rlp/-/rlp-2.2.6.tgz#c80ba6266ac7a483ef1e69e8e2f056656de2fb2c" @@ -15163,6 +15259,13 @@ run-async@^2.2.0, run-async@^2.4.0: resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455" integrity sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ== +run-parallel-limit@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/run-parallel-limit/-/run-parallel-limit-1.1.0.tgz#be80e936f5768623a38a963262d6bef8ff11e7ba" + integrity sha512-jJA7irRNM91jaKc3Hcl1npHsFLOXOoTkPCUL1JEa1R82O2miplXXRaGdjW/KM/98YQWDhJLiSs793CnXfblJUw== + dependencies: + queue-microtask "^1.2.2" + run-parallel@^1.1.9: version "1.2.0" resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee"