From 163e6095d73c735dceb3be8a87febf8734c7964c Mon Sep 17 00:00:00 2001 From: Po Date: Mon, 18 Nov 2024 19:09:49 +0800 Subject: [PATCH] feat(MSFDG): copy op-e2e to op-e2e2 --- op-e2e2/.gitignore | 1 + op-e2e2/Makefile | 72 + op-e2e2/README.md | 34 + op-e2e2/actions/action.go | 91 + op-e2e2/actions/blocktime_test.go | 295 ++ op-e2e2/actions/dencun_fork_test.go | 259 ++ op-e2e2/actions/ecotone_fork_test.go | 267 ++ op-e2e2/actions/eip4844_test.go | 185 + op-e2e2/actions/fjord_fork_test.go | 145 + op-e2e2/actions/garbage_channel_out.go | 267 ++ op-e2e2/actions/l1_miner.go | 239 ++ op-e2e2/actions/l1_miner_test.go | 67 + op-e2e2/actions/l1_replica.go | 260 ++ op-e2e2/actions/l1_replica_test.go | 115 + op-e2e2/actions/l2_batcher.go | 500 +++ op-e2e2/actions/l2_batcher_test.go | 561 +++ op-e2e2/actions/l2_engine.go | 208 + op-e2e2/actions/l2_engine_test.go | 218 ++ op-e2e2/actions/l2_proposer.go | 265 ++ op-e2e2/actions/l2_proposer_test.go | 149 + op-e2e2/actions/l2_sequencer.go | 184 + op-e2e2/actions/l2_sequencer_test.go | 183 + op-e2e2/actions/l2_verifier.go | 275 ++ op-e2e2/actions/l2_verifier_test.go | 118 + op-e2e2/actions/plasma_test.go | 624 +++ op-e2e2/actions/reorg_test.go | 903 +++++ op-e2e2/actions/safedb_test.go | 140 + op-e2e2/actions/span_batch_test.go | 719 ++++ op-e2e2/actions/sync_test.go | 1042 +++++ op-e2e2/actions/system_config_test.go | 409 ++ op-e2e2/actions/tx_helper.go | 49 + op-e2e2/actions/user.go | 604 +++ op-e2e2/actions/user_test.go | 316 ++ op-e2e2/bindings/addressmanager.go | 626 +++ op-e2e2/bindings/alphabetvm.go | 264 ++ op-e2e2/bindings/alphabetvm2.go | 264 ++ op-e2e2/bindings/basefeevault.go | 672 ++++ op-e2e2/bindings/create2deployer.go | 327 ++ op-e2e2/bindings/crossdomainmessenger.go | 1433 +++++++ op-e2e2/bindings/delayedvetoable.go | 928 +++++ op-e2e2/bindings/delayedweth.go | 1881 +++++++++ op-e2e2/bindings/deployerwhitelist.go | 793 ++++ .../bindings/deterministicdeploymentproxy.go | 223 ++ op-e2e2/bindings/disputegamefactory.go | 1404 +++++++ op-e2e2/bindings/eas.go | 1693 ++++++++ op-e2e2/bindings/entrypoint.go | 2283 +++++++++++ op-e2e2/bindings/erc20.go | 820 ++++ op-e2e2/bindings/faultdisputegame.go | 1877 +++++++++ op-e2e2/bindings/gaspriceoracle.go | 740 ++++ op-e2e2/bindings/governancetoken.go | 1715 ++++++++ op-e2e2/bindings/isemver.go | 211 + op-e2e2/bindings/l1block.go | 961 +++++ op-e2e2/bindings/l1blocknumber.go | 306 ++ op-e2e2/bindings/l1crossdomainmessenger.go | 1631 ++++++++ op-e2e2/bindings/l1erc721bridge.go | 998 +++++ op-e2e2/bindings/l1feevault.go | 672 ++++ op-e2e2/bindings/l1standardbridge.go | 2220 +++++++++++ op-e2e2/bindings/l2crossdomainmessenger.go | 1538 ++++++++ op-e2e2/bindings/l2erc721bridge.go | 936 +++++ op-e2e2/bindings/l2outputoracle.go | 1373 +++++++ op-e2e2/bindings/l2standardbridge.go | 1785 +++++++++ op-e2e2/bindings/l2tol1messagepasser.go | 699 ++++ op-e2e2/bindings/legacymessagepasser.go | 285 ++ op-e2e2/bindings/mips.go | 316 ++ op-e2e2/bindings/multicall3.go | 665 ++++ op-e2e2/bindings/multisend_v130.go | 223 ++ op-e2e2/bindings/multisendcallonly_v130.go | 223 ++ op-e2e2/bindings/optimismmintableerc20.go | 1381 +++++++ .../bindings/optimismmintableerc20factory.go | 820 ++++ .../bindings/optimismmintableerc721factory.go | 501 +++ op-e2e2/bindings/optimismportal.go | 1478 +++++++ op-e2e2/bindings/permit2.go | 1413 +++++++ op-e2e2/bindings/preimageoracle.go | 1072 +++++ op-e2e2/bindings/protocolversions.go | 965 +++++ op-e2e2/bindings/proxy.go | 628 +++ op-e2e2/bindings/proxyadmin.go | 782 ++++ op-e2e2/bindings/safe.go | 3210 +++++++++++++++ op-e2e2/bindings/safe_v130.go | 3151 +++++++++++++++ op-e2e2/bindings/safel2_v130.go | 3433 +++++++++++++++++ op-e2e2/bindings/safeproxyfactory.go | 472 +++ op-e2e2/bindings/safesingletonfactory.go | 223 ++ op-e2e2/bindings/schemaregistry.go | 447 +++ op-e2e2/bindings/sendercreator.go | 223 ++ op-e2e2/bindings/sequencerfeevault.go | 703 ++++ op-e2e2/bindings/standardbridge.go | 1287 ++++++ op-e2e2/bindings/storagesetter.go | 468 +++ op-e2e2/bindings/superchainconfig.go | 966 +++++ op-e2e2/bindings/systemconfig.go | 1878 +++++++++ op-e2e2/bindings/weth.go | 1133 ++++++ op-e2e2/bindings/weth9.go | 1112 ++++++ op-e2e2/bindingspreview/optimismportal2.go | 1633 ++++++++ op-e2e2/bridge_test.go | 111 + op-e2e2/brotli_batcher_test.go | 125 + op-e2e2/build_helper.go | 26 + op-e2e2/check_scripts_test.go | 80 + op-e2e2/config/init.go | 203 + op-e2e2/custom_gas_token_test.go | 459 +++ op-e2e2/deposit_test.go | 141 + op-e2e2/e2eutils/addresses.go | 66 + op-e2e2/e2eutils/addresses_test.go | 22 + op-e2e2/e2eutils/batcher/batcher.go | 56 + op-e2e2/e2eutils/blobs.go | 49 + op-e2e2/e2eutils/challenger/helper.go | 253 ++ op-e2e2/e2eutils/challenger/metrics.go | 23 + op-e2e2/e2eutils/disputegame/claim_helper.go | 133 + .../e2eutils/disputegame/dishonest_helper.go | 72 + op-e2e2/e2eutils/disputegame/helper.go | 279 ++ .../disputegame/output_alphabet_helper.go | 52 + .../disputegame/output_cannon_helper.go | 316 ++ .../disputegame/output_game_helper.go | 755 ++++ .../disputegame/output_honest_helper.go | 114 + .../disputegame/preimage/preimage_helper.go | 138 + op-e2e2/e2eutils/fakebeacon/blobs.go | 211 + op-e2e2/e2eutils/geth/fakepos.go | 207 + op-e2e2/e2eutils/geth/find.go | 50 + op-e2e2/e2eutils/geth/geth.go | 142 + op-e2e2/e2eutils/geth/peers.go | 49 + op-e2e2/e2eutils/geth/wait.go | 144 + op-e2e2/e2eutils/receipts/logs.go | 25 + op-e2e2/e2eutils/secrets.go | 191 + op-e2e2/e2eutils/setup.go | 237 ++ op-e2e2/e2eutils/setup_test.go | 39 + op-e2e2/e2eutils/testing.go | 39 + op-e2e2/e2eutils/transactions/blobs.go | 53 + op-e2e2/e2eutils/transactions/gas.go | 31 + op-e2e2/e2eutils/wait/blocks.go | 123 + op-e2e2/e2eutils/wait/waits.go | 138 + op-e2e2/e2eutils/wait/withdrawals.go | 131 + op-e2e2/eip4844_test.go | 195 + op-e2e2/external.go | 148 + op-e2e2/external/config.go | 69 + op-e2e2/external_geth/.gitignore | 1 + op-e2e2/external_geth/Makefile | 8 + op-e2e2/external_geth/README.md | 65 + op-e2e2/external_geth/main.go | 199 + op-e2e2/external_geth/main_test.go | 55 + op-e2e2/external_geth/test_parms.json | 5 + op-e2e2/external_geth/tools.go | 5 + op-e2e2/fastlz/fastlz.c | 511 +++ op-e2e2/fastlz/fastlz.go | 34 + op-e2e2/fastlz/fastlz.h | 100 + op-e2e2/fastlz_test.go | 235 ++ .../faultproofs/challenge_preimage_test.go | 68 + op-e2e2/faultproofs/multi_test.go | 41 + op-e2e2/faultproofs/output_alphabet_test.go | 321 ++ op-e2e2/faultproofs/output_cannon_test.go | 819 ++++ op-e2e2/faultproofs/precompile_test.go | 173 + op-e2e2/faultproofs/preimages_test.go | 53 + op-e2e2/faultproofs/util.go | 74 + op-e2e2/helper.go | 108 + op-e2e2/l1_beacon_client_test.go | 53 + op-e2e2/l2_gossip_test.go | 32 + op-e2e2/op_geth.go | 249 ++ op-e2e2/op_geth_test.go | 1130 ++++++ op-e2e2/sequencer_failover_setup.go | 508 +++ op-e2e2/sequencer_failover_test.go | 174 + op-e2e2/setup.go | 974 +++++ op-e2e2/system_adminrpc_test.go | 222 ++ op-e2e2/system_fpp_test.go | 339 ++ op-e2e2/system_test.go | 1748 +++++++++ op-e2e2/system_tob_test.go | 739 ++++ op-e2e2/tracer.go | 36 + op-e2e2/tx_helper.go | 146 + op-e2e2/withdrawal_helper.go | 243 ++ 164 files changed, 87291 insertions(+) create mode 100644 op-e2e2/.gitignore create mode 100644 op-e2e2/Makefile create mode 100644 op-e2e2/README.md create mode 100644 op-e2e2/actions/action.go create mode 100644 op-e2e2/actions/blocktime_test.go create mode 100644 op-e2e2/actions/dencun_fork_test.go create mode 100644 op-e2e2/actions/ecotone_fork_test.go create mode 100644 op-e2e2/actions/eip4844_test.go create mode 100644 op-e2e2/actions/fjord_fork_test.go create mode 100644 op-e2e2/actions/garbage_channel_out.go create mode 100644 op-e2e2/actions/l1_miner.go create mode 100644 op-e2e2/actions/l1_miner_test.go create mode 100644 op-e2e2/actions/l1_replica.go create mode 100644 op-e2e2/actions/l1_replica_test.go create mode 100644 op-e2e2/actions/l2_batcher.go create mode 100644 op-e2e2/actions/l2_batcher_test.go create mode 100644 op-e2e2/actions/l2_engine.go create mode 100644 op-e2e2/actions/l2_engine_test.go create mode 100644 op-e2e2/actions/l2_proposer.go create mode 100644 op-e2e2/actions/l2_proposer_test.go create mode 100644 op-e2e2/actions/l2_sequencer.go create mode 100644 op-e2e2/actions/l2_sequencer_test.go create mode 100644 op-e2e2/actions/l2_verifier.go create mode 100644 op-e2e2/actions/l2_verifier_test.go create mode 100644 op-e2e2/actions/plasma_test.go create mode 100644 op-e2e2/actions/reorg_test.go create mode 100644 op-e2e2/actions/safedb_test.go create mode 100644 op-e2e2/actions/span_batch_test.go create mode 100644 op-e2e2/actions/sync_test.go create mode 100644 op-e2e2/actions/system_config_test.go create mode 100644 op-e2e2/actions/tx_helper.go create mode 100644 op-e2e2/actions/user.go create mode 100644 op-e2e2/actions/user_test.go create mode 100644 op-e2e2/bindings/addressmanager.go create mode 100644 op-e2e2/bindings/alphabetvm.go create mode 100644 op-e2e2/bindings/alphabetvm2.go create mode 100644 op-e2e2/bindings/basefeevault.go create mode 100644 op-e2e2/bindings/create2deployer.go create mode 100644 op-e2e2/bindings/crossdomainmessenger.go create mode 100644 op-e2e2/bindings/delayedvetoable.go create mode 100644 op-e2e2/bindings/delayedweth.go create mode 100644 op-e2e2/bindings/deployerwhitelist.go create mode 100644 op-e2e2/bindings/deterministicdeploymentproxy.go create mode 100644 op-e2e2/bindings/disputegamefactory.go create mode 100644 op-e2e2/bindings/eas.go create mode 100644 op-e2e2/bindings/entrypoint.go create mode 100644 op-e2e2/bindings/erc20.go create mode 100644 op-e2e2/bindings/faultdisputegame.go create mode 100644 op-e2e2/bindings/gaspriceoracle.go create mode 100644 op-e2e2/bindings/governancetoken.go create mode 100644 op-e2e2/bindings/isemver.go create mode 100644 op-e2e2/bindings/l1block.go create mode 100644 op-e2e2/bindings/l1blocknumber.go create mode 100644 op-e2e2/bindings/l1crossdomainmessenger.go create mode 100644 op-e2e2/bindings/l1erc721bridge.go create mode 100644 op-e2e2/bindings/l1feevault.go create mode 100644 op-e2e2/bindings/l1standardbridge.go create mode 100644 op-e2e2/bindings/l2crossdomainmessenger.go create mode 100644 op-e2e2/bindings/l2erc721bridge.go create mode 100644 op-e2e2/bindings/l2outputoracle.go create mode 100644 op-e2e2/bindings/l2standardbridge.go create mode 100644 op-e2e2/bindings/l2tol1messagepasser.go create mode 100644 op-e2e2/bindings/legacymessagepasser.go create mode 100644 op-e2e2/bindings/mips.go create mode 100644 op-e2e2/bindings/multicall3.go create mode 100644 op-e2e2/bindings/multisend_v130.go create mode 100644 op-e2e2/bindings/multisendcallonly_v130.go create mode 100644 op-e2e2/bindings/optimismmintableerc20.go create mode 100644 op-e2e2/bindings/optimismmintableerc20factory.go create mode 100644 op-e2e2/bindings/optimismmintableerc721factory.go create mode 100644 op-e2e2/bindings/optimismportal.go create mode 100644 op-e2e2/bindings/permit2.go create mode 100644 op-e2e2/bindings/preimageoracle.go create mode 100644 op-e2e2/bindings/protocolversions.go create mode 100644 op-e2e2/bindings/proxy.go create mode 100644 op-e2e2/bindings/proxyadmin.go create mode 100644 op-e2e2/bindings/safe.go create mode 100644 op-e2e2/bindings/safe_v130.go create mode 100644 op-e2e2/bindings/safel2_v130.go create mode 100644 op-e2e2/bindings/safeproxyfactory.go create mode 100644 op-e2e2/bindings/safesingletonfactory.go create mode 100644 op-e2e2/bindings/schemaregistry.go create mode 100644 op-e2e2/bindings/sendercreator.go create mode 100644 op-e2e2/bindings/sequencerfeevault.go create mode 100644 op-e2e2/bindings/standardbridge.go create mode 100644 op-e2e2/bindings/storagesetter.go create mode 100644 op-e2e2/bindings/superchainconfig.go create mode 100644 op-e2e2/bindings/systemconfig.go create mode 100644 op-e2e2/bindings/weth.go create mode 100644 op-e2e2/bindings/weth9.go create mode 100644 op-e2e2/bindingspreview/optimismportal2.go create mode 100644 op-e2e2/bridge_test.go create mode 100644 op-e2e2/brotli_batcher_test.go create mode 100644 op-e2e2/build_helper.go create mode 100644 op-e2e2/check_scripts_test.go create mode 100644 op-e2e2/config/init.go create mode 100644 op-e2e2/custom_gas_token_test.go create mode 100644 op-e2e2/deposit_test.go create mode 100644 op-e2e2/e2eutils/addresses.go create mode 100644 op-e2e2/e2eutils/addresses_test.go create mode 100644 op-e2e2/e2eutils/batcher/batcher.go create mode 100644 op-e2e2/e2eutils/blobs.go create mode 100644 op-e2e2/e2eutils/challenger/helper.go create mode 100644 op-e2e2/e2eutils/challenger/metrics.go create mode 100644 op-e2e2/e2eutils/disputegame/claim_helper.go create mode 100644 op-e2e2/e2eutils/disputegame/dishonest_helper.go create mode 100644 op-e2e2/e2eutils/disputegame/helper.go create mode 100644 op-e2e2/e2eutils/disputegame/output_alphabet_helper.go create mode 100644 op-e2e2/e2eutils/disputegame/output_cannon_helper.go create mode 100644 op-e2e2/e2eutils/disputegame/output_game_helper.go create mode 100644 op-e2e2/e2eutils/disputegame/output_honest_helper.go create mode 100644 op-e2e2/e2eutils/disputegame/preimage/preimage_helper.go create mode 100644 op-e2e2/e2eutils/fakebeacon/blobs.go create mode 100644 op-e2e2/e2eutils/geth/fakepos.go create mode 100644 op-e2e2/e2eutils/geth/find.go create mode 100644 op-e2e2/e2eutils/geth/geth.go create mode 100644 op-e2e2/e2eutils/geth/peers.go create mode 100644 op-e2e2/e2eutils/geth/wait.go create mode 100644 op-e2e2/e2eutils/receipts/logs.go create mode 100644 op-e2e2/e2eutils/secrets.go create mode 100644 op-e2e2/e2eutils/setup.go create mode 100644 op-e2e2/e2eutils/setup_test.go create mode 100644 op-e2e2/e2eutils/testing.go create mode 100644 op-e2e2/e2eutils/transactions/blobs.go create mode 100644 op-e2e2/e2eutils/transactions/gas.go create mode 100644 op-e2e2/e2eutils/wait/blocks.go create mode 100644 op-e2e2/e2eutils/wait/waits.go create mode 100644 op-e2e2/e2eutils/wait/withdrawals.go create mode 100644 op-e2e2/eip4844_test.go create mode 100644 op-e2e2/external.go create mode 100644 op-e2e2/external/config.go create mode 100644 op-e2e2/external_geth/.gitignore create mode 100644 op-e2e2/external_geth/Makefile create mode 100644 op-e2e2/external_geth/README.md create mode 100644 op-e2e2/external_geth/main.go create mode 100644 op-e2e2/external_geth/main_test.go create mode 100644 op-e2e2/external_geth/test_parms.json create mode 100644 op-e2e2/external_geth/tools.go create mode 100644 op-e2e2/fastlz/fastlz.c create mode 100644 op-e2e2/fastlz/fastlz.go create mode 100644 op-e2e2/fastlz/fastlz.h create mode 100644 op-e2e2/fastlz_test.go create mode 100644 op-e2e2/faultproofs/challenge_preimage_test.go create mode 100644 op-e2e2/faultproofs/multi_test.go create mode 100644 op-e2e2/faultproofs/output_alphabet_test.go create mode 100644 op-e2e2/faultproofs/output_cannon_test.go create mode 100644 op-e2e2/faultproofs/precompile_test.go create mode 100644 op-e2e2/faultproofs/preimages_test.go create mode 100644 op-e2e2/faultproofs/util.go create mode 100644 op-e2e2/helper.go create mode 100644 op-e2e2/l1_beacon_client_test.go create mode 100644 op-e2e2/l2_gossip_test.go create mode 100644 op-e2e2/op_geth.go create mode 100644 op-e2e2/op_geth_test.go create mode 100644 op-e2e2/sequencer_failover_setup.go create mode 100644 op-e2e2/sequencer_failover_test.go create mode 100644 op-e2e2/setup.go create mode 100644 op-e2e2/system_adminrpc_test.go create mode 100644 op-e2e2/system_fpp_test.go create mode 100644 op-e2e2/system_test.go create mode 100644 op-e2e2/system_tob_test.go create mode 100644 op-e2e2/tracer.go create mode 100644 op-e2e2/tx_helper.go create mode 100644 op-e2e2/withdrawal_helper.go diff --git a/op-e2e2/.gitignore b/op-e2e2/.gitignore new file mode 100644 index 000000000000..7db44382a782 --- /dev/null +++ b/op-e2e2/.gitignore @@ -0,0 +1 @@ +external_*/shim diff --git a/op-e2e2/Makefile b/op-e2e2/Makefile new file mode 100644 index 000000000000..707227f14dac --- /dev/null +++ b/op-e2e2/Makefile @@ -0,0 +1,72 @@ +# Generally, JUNIT_FILE is set in CI but may be specified to an arbitrary file location to emulate CI locally +# If JUNIT_FILE is set, JSON_LOG_FILE should also be set +ifdef JUNIT_FILE + go_test = OP_TESTLOG_DISABLE_COLOR=true OP_E2E_DISABLE_PARALLEL=false gotestsum --format=testname --junitfile=$(JUNIT_FILE) --jsonfile=$(JSON_LOG_FILE) -- -failfast + # Note: -parallel must be set to match the number of cores in the resource class + go_test_flags = -timeout=60m -parallel=8 +else + go_test = go test + go_test_flags = -v +endif + +test: pre-test test-ws +.PHONY: test + +test-external-%: pre-test + make -C ./external_$*/ + $(go_test) $(go_test_flags) --externalL2 ./external_$*/ + +test-ws: pre-test + $(go_test) $(go_test_flags) . ./e2eutils/... +.PHONY: test-ws + +test-actions: pre-test + $(go_test) $(go_test_flags) ./actions +.PHONY: test-actions + +test-http: pre-test + OP_E2E_USE_HTTP=true $(go_test) $(go_test_flags) . ./e2eutils/... +.PHONY: test-http + +test-cannon: pre-test + OP_E2E_CANNON_ENABLED=true $(go_test) $(go_test_flags) ./faultproofs +.PHONY: test-cannon + +test-fault-proofs: pre-test + $(go_test) $(go_test_flags) ./faultproofs +.PHONY: test-faultproofs + +cannon-prestate: + make -C .. cannon-prestate +.PHONY: cannon-prestate + +# We depend on the absolute pre-state generated by cannon to deploy the dispute game contracts. +devnet-allocs: pre-test-cannon + make -C .. devnet-allocs +.PHONY: devnet-allocs + +pre-test: pre-test-cannon pre-test-allocs +.PHONY: pre-test + +pre-test-cannon: + @if [ ! -e ../op-program/bin ]; then \ + make cannon-prestate; \ + fi +.PHONY: pre-test-cannon + +pre-test-allocs: + @if [ ! -e ../.devnet ]; then \ + make devnet-allocs; \ + fi +.PHONY: pre-test-allocs + +clean: + rm -r ../.devnet + rm -r ../op-program/bin +.PHONY: clean + +fuzz: + go test -run NOTAREALTEST -v -fuzztime 10s -fuzz FuzzFjordCostFunction ./ + go test -run NOTAREALTEST -v -fuzztime 10s -fuzz FuzzFastLzGethSolidity ./ + go test -run NOTAREALTEST -v -fuzztime 10s -fuzz FuzzFastLzCgo ./ + diff --git a/op-e2e2/README.md b/op-e2e2/README.md new file mode 100644 index 000000000000..28fdb06dad1b --- /dev/null +++ b/op-e2e2/README.md @@ -0,0 +1,34 @@ +# op-e2e + +The end to end tests in this repo depend on genesis state that is +created with the `bedrock-devnet` package. To create this state, +run the following commands from the root of the repository: + +```bash +make install-geth +make cannon-prestate +make devnet-allocs +``` + +This will leave artifacts in the `.devnet` directory that will be +read into `op-e2e` at runtime. The default deploy configuration +used for starting all `op-e2e` based tests can be found in +`packages/contracts-bedrock/deploy-config/devnetL1.json`. There +are some values that are safe to change in memory in `op-e2e` at +runtime, but others cannot be changed or else it will result in +broken tests. Any changes to `devnetL1.json` should result in +rebuilding the `.devnet` artifacts before the new values will +be present in the `op-e2e` tests. + +## Running tests +Consult the [Makefile](./Makefile) in this directory. Run, e.g.: + +```bash +make test-http +``` + +### Troubleshooting +If you encounter errors: +* ensure you have the latest version of foundry installed: `pnpm update:foundry` +* try deleting the `packages/contracts-bedrock/forge-artifacts` directory +* if the above step doesn't fix the error, try `pnpm clean` diff --git a/op-e2e2/actions/action.go b/op-e2e2/actions/action.go new file mode 100644 index 000000000000..86696db638d3 --- /dev/null +++ b/op-e2e2/actions/action.go @@ -0,0 +1,91 @@ +package actions + +import ( + "context" + + op_e2e "github.com/ethereum-optimism/optimism/op-e2e2" + + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils" +) + +// Testing is an interface to Go-like testing, +// extended with a context getter for the test runner to shut down individual actions without interrupting the test, +// and a signaling function for when an invalid action is hit. +// This helps custom test runners navigate slow or invalid actions, e.g. during fuzzing. +type Testing interface { + e2eutils.TestingBase + // Ctx shares a context to execute an action with, the test runner may interrupt the action without stopping the test. + Ctx() context.Context + // InvalidAction indicates the failure is due to action incompatibility, does not stop the test. + InvalidAction(format string, args ...any) +} + +// Action is a function that may change the state of one or more actors or check their state. +// Action definitions are meant to be very small building blocks, +// and then composed into larger patterns to write more elaborate tests. +type Action func(t Testing) + +// ActionStatus defines the state of an action, to make a basic distinction between InvalidAction() and other calls. +type ActionStatus uint + +const ( + // ActionOK indicates the action is valid to apply + ActionOK ActionStatus = iota + // ActionInvalid indicates the action is not applicable, and a different next action may taken. + ActionInvalid + // More action status types may be used to indicate e.g. required rewinds, + // simple skips, or special cases for fuzzing. +) + +// defaultTesting is a simple implementation of Testing that takes standard Go testing framework, +// and handles invalid actions as errors, and exposes a Reset function to change the context and action state, +// to recover after an invalid action or cancelled context. +type defaultTesting struct { + e2eutils.TestingBase + ctx context.Context + state ActionStatus +} + +type StatefulTesting interface { + Testing + Reset(actionCtx context.Context) + State() ActionStatus +} + +// NewDefaultTesting returns a new testing obj, and enables parallel test execution. +// Returns an interface, we're likely changing the behavior here as we build more action tests. +func NewDefaultTesting(tb e2eutils.TestingBase) StatefulTesting { + op_e2e.InitParallel(tb) + + return &defaultTesting{ + TestingBase: tb, + ctx: context.Background(), + state: ActionOK, + } +} + +// Ctx shares a context to execute an action with, the test runner may interrupt the action without stopping the test. +func (st *defaultTesting) Ctx() context.Context { + return st.ctx +} + +// InvalidAction indicates the failure is due to action incompatibility, does not stop the test. +// The format and args behave the same as fmt.Sprintf, testing.T.Errorf, etc. +func (st *defaultTesting) InvalidAction(format string, args ...any) { + st.TestingBase.Helper() // report the error on the call-site to make debugging clear, not here. + st.Errorf("invalid action err: "+format, args...) + st.state = ActionInvalid +} + +// Reset prepares the testing util for the next action, changing the context and state back to OK. +func (st *defaultTesting) Reset(actionCtx context.Context) { + st.state = ActionOK + st.ctx = actionCtx +} + +// State shares the current action state. +func (st *defaultTesting) State() ActionStatus { + return st.state +} + +var _ Testing = (*defaultTesting)(nil) diff --git a/op-e2e2/actions/blocktime_test.go b/op-e2e2/actions/blocktime_test.go new file mode 100644 index 000000000000..80a71f8fc689 --- /dev/null +++ b/op-e2e2/actions/blocktime_test.go @@ -0,0 +1,295 @@ +package actions + +import ( + "math/big" + "testing" + + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils" + "github.com/ethereum-optimism/optimism/op-service/testlog" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/params" + "github.com/stretchr/testify/require" +) + +// TestBlockTimeBatchType run each blocktime-related test case in singular batch mode and span batch mode. +func TestBlockTimeBatchType(t *testing.T) { + tests := []struct { + name string + f func(gt *testing.T, deltaTimeOffset *hexutil.Uint64) + }{ + {"BatchInLastPossibleBlocks", BatchInLastPossibleBlocks}, + {"LargeL1Gaps", LargeL1Gaps}, + } + for _, test := range tests { + test := test + t.Run(test.name+"_SingularBatch", func(t *testing.T) { + test.f(t, nil) + }) + } + + deltaTimeOffset := hexutil.Uint64(0) + for _, test := range tests { + test := test + t.Run(test.name+"_SpanBatch", func(t *testing.T) { + test.f(t, &deltaTimeOffset) + }) + } +} + +// BatchInLastPossibleBlocks tests that the derivation pipeline +// accepts a batch that is included in the last possible L1 block +// where there are also no other batches included in the sequence +// window. +// This is a regression test against the bug fixed in PR #4566 +func BatchInLastPossibleBlocks(gt *testing.T, deltaTimeOffset *hexutil.Uint64) { + t := NewDefaultTesting(gt) + dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) + applyDeltaTimeOffset(dp, deltaTimeOffset) + dp.DeployConfig.SequencerWindowSize = 4 + dp.DeployConfig.L2BlockTime = 2 + + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelDebug) + + sd, _, miner, sequencer, sequencerEngine, _, _, batcher := setupReorgTestActors(t, dp, sd, log) + + signer := types.LatestSigner(sd.L2Cfg.Config) + cl := sequencerEngine.EthClient() + aliceNonce := uint64(0) // manual nonce management to avoid geth pending-tx nonce non-determinism flakiness + aliceTx := func() { + tx := types.MustSignNewTx(dp.Secrets.Alice, signer, &types.DynamicFeeTx{ + ChainID: sd.L2Cfg.Config.ChainID, + Nonce: aliceNonce, + GasTipCap: big.NewInt(2 * params.GWei), + GasFeeCap: new(big.Int).Add(miner.l1Chain.CurrentBlock().BaseFee, big.NewInt(2*params.GWei)), + Gas: params.TxGas, + To: &dp.Addresses.Bob, + Value: e2eutils.Ether(2), + }) + require.NoError(gt, cl.SendTransaction(t.Ctx(), tx)) + aliceNonce += 1 + } + makeL2BlockWithAliceTx := func() { + aliceTx() + sequencer.ActL2StartBlock(t) + sequencerEngine.ActL2IncludeTx(dp.Addresses.Alice)(t) // include a test tx from alice + sequencer.ActL2EndBlock(t) + } + verifyChainStateOnSequencer := func(l1Number, unsafeHead, unsafeHeadOrigin, safeHead, safeHeadOrigin uint64) { + require.Equal(t, l1Number, miner.l1Chain.CurrentHeader().Number.Uint64()) + require.Equal(t, unsafeHead, sequencer.L2Unsafe().Number) + require.Equal(t, unsafeHeadOrigin, sequencer.L2Unsafe().L1Origin.Number) + require.Equal(t, safeHead, sequencer.L2Safe().Number) + require.Equal(t, safeHeadOrigin, sequencer.L2Safe().L1Origin.Number) + } + + // Make 8 L1 blocks & 17 L2 blocks. + miner.ActL1StartBlock(4)(t) + miner.ActL1EndBlock(t) + sequencer.ActL1HeadSignal(t) + sequencer.ActL2PipelineFull(t) + makeL2BlockWithAliceTx() + makeL2BlockWithAliceTx() + makeL2BlockWithAliceTx() + + for i := 0; i < 7; i++ { + batcher.ActSubmitAll(t) + miner.ActL1StartBlock(4)(t) + miner.ActL1IncludeTx(sd.RollupCfg.Genesis.SystemConfig.BatcherAddr)(t) + miner.ActL1EndBlock(t) + sequencer.ActL1HeadSignal(t) + sequencer.ActL2PipelineFull(t) + makeL2BlockWithAliceTx() + makeL2BlockWithAliceTx() + } + + // 8 L1 blocks with 17 L2 blocks is the unsafe state. + // Because we consistently batch submitted we are one epoch behind the unsafe head with the safe head + verifyChainStateOnSequencer(8, 17, 8, 15, 7) + + // Create the batch for L2 blocks 16 & 17 + batcher.ActSubmitAll(t) + + // L1 Block 8 contains the batch for L2 blocks 14 & 15 + // Then we create L1 blocks 9, 10, 11 + // The L1 origin of L2 block 16 is L1 block 8 + // At a seq window of 4, should be possible to include the batch for L2 block 16 & 17 at L1 block 12 + + // Make 3 more L1 + 6 L2 blocks + for i := 0; i < 3; i++ { + miner.ActL1StartBlock(4)(t) + miner.ActL1EndBlock(t) + sequencer.ActL1HeadSignal(t) + sequencer.ActL2PipelineFull(t) + makeL2BlockWithAliceTx() + makeL2BlockWithAliceTx() + } + + // At this point verify that we have not started auto generating blocks + // by checking that L1 & the unsafe head have advanced as expected, but the safe head is the same. + verifyChainStateOnSequencer(11, 23, 11, 15, 7) + + // Check that the batch can go in on the last block of the sequence window + miner.ActL1StartBlock(4)(t) + miner.ActL1IncludeTx(sd.RollupCfg.Genesis.SystemConfig.BatcherAddr)(t) + miner.ActL1EndBlock(t) + sequencer.ActL1HeadSignal(t) + sequencer.ActL2PipelineFull(t) + + // We have one more L1 block, no more unsafe blocks, but advance one + // epoch on the safe head with the submitted batches + verifyChainStateOnSequencer(12, 23, 11, 17, 8) +} + +// LargeL1Gaps tests the case that there is a gap between two L1 blocks which +// is larger than the sequencer drift. +// This test has the following parameters: +// L1 Block time: 4s. L2 Block time: 2s. Sequencer Drift: 32s +// +// It generates 8 L1 blocks & 16 L2 blocks. +// Then generates an L1 block that has a time delta of 48s. +// It then generates the 24 L2 blocks. +// Then it generates 3 more L1 blocks. +// At this point it can verify that the batches where properly generated. +// Note: It batches submits when possible. +func LargeL1Gaps(gt *testing.T, deltaTimeOffset *hexutil.Uint64) { + t := NewDefaultTesting(gt) + dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) + dp.DeployConfig.L1BlockTime = 4 + dp.DeployConfig.L2BlockTime = 2 + dp.DeployConfig.SequencerWindowSize = 4 + dp.DeployConfig.MaxSequencerDrift = 32 + applyDeltaTimeOffset(dp, deltaTimeOffset) + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelDebug) + + sd, _, miner, sequencer, sequencerEngine, verifier, _, batcher := setupReorgTestActors(t, dp, sd, log) + + signer := types.LatestSigner(sd.L2Cfg.Config) + cl := sequencerEngine.EthClient() + aliceNonce := uint64(0) // manual nonce, avoid pending-tx nonce management, that causes flakes + aliceTx := func() { + tx := types.MustSignNewTx(dp.Secrets.Alice, signer, &types.DynamicFeeTx{ + ChainID: sd.L2Cfg.Config.ChainID, + Nonce: aliceNonce, + GasTipCap: big.NewInt(2 * params.GWei), + GasFeeCap: new(big.Int).Add(miner.l1Chain.CurrentBlock().BaseFee, big.NewInt(2*params.GWei)), + Gas: params.TxGas, + To: &dp.Addresses.Bob, + Value: e2eutils.Ether(2), + }) + require.NoError(gt, cl.SendTransaction(t.Ctx(), tx)) + aliceNonce += 1 + } + makeL2BlockWithAliceTx := func() { + aliceTx() + sequencer.ActL2StartBlock(t) + sequencerEngine.ActL2IncludeTx(dp.Addresses.Alice)(t) // include a test tx from alice + sequencer.ActL2EndBlock(t) + } + + verifyChainStateOnSequencer := func(l1Number, unsafeHead, unsafeHeadOrigin, safeHead, safeHeadOrigin uint64) { + require.Equal(t, l1Number, miner.l1Chain.CurrentHeader().Number.Uint64()) + require.Equal(t, unsafeHead, sequencer.L2Unsafe().Number) + require.Equal(t, unsafeHeadOrigin, sequencer.L2Unsafe().L1Origin.Number) + require.Equal(t, safeHead, sequencer.L2Safe().Number) + require.Equal(t, safeHeadOrigin, sequencer.L2Safe().L1Origin.Number) + } + + verifyChainStateOnVerifier := func(l1Number, unsafeHead, unsafeHeadOrigin, safeHead, safeHeadOrigin uint64) { + require.Equal(t, l1Number, miner.l1Chain.CurrentHeader().Number.Uint64()) + require.Equal(t, unsafeHead, verifier.L2Unsafe().Number) + require.Equal(t, unsafeHeadOrigin, verifier.L2Unsafe().L1Origin.Number) + require.Equal(t, safeHead, verifier.L2Safe().Number) + require.Equal(t, safeHeadOrigin, verifier.L2Safe().L1Origin.Number) + } + + // Make 8 L1 blocks & 16 L2 blocks. + miner.ActL1StartBlock(4)(t) + miner.ActL1EndBlock(t) + sequencer.ActL1HeadSignal(t) + sequencer.ActL2PipelineFull(t) + makeL2BlockWithAliceTx() + makeL2BlockWithAliceTx() + + for i := 0; i < 7; i++ { + batcher.ActSubmitAll(t) + miner.ActL1StartBlock(4)(t) + miner.ActL1IncludeTx(sd.RollupCfg.Genesis.SystemConfig.BatcherAddr)(t) + miner.ActL1EndBlock(t) + sequencer.ActL1HeadSignal(t) + sequencer.ActL2PipelineFull(t) + makeL2BlockWithAliceTx() + makeL2BlockWithAliceTx() + } + + n, err := cl.NonceAt(t.Ctx(), dp.Addresses.Alice, nil) + require.NoError(t, err) + require.Equal(t, uint64(16), n) // 16 valid blocks with txns. + + verifyChainStateOnSequencer(8, 16, 8, 14, 7) + + // Make the really long L1 block. Do include previous batches + batcher.ActSubmitAll(t) + miner.ActL1StartBlock(48)(t) + miner.ActL1IncludeTx(sd.RollupCfg.Genesis.SystemConfig.BatcherAddr)(t) + miner.ActL1EndBlock(t) + sequencer.ActL1HeadSignal(t) + sequencer.ActL2PipelineFull(t) + + verifyChainStateOnSequencer(9, 16, 8, 16, 8) + + // Make the L2 blocks corresponding to the long L1 block + for i := 0; i < 24; i++ { + makeL2BlockWithAliceTx() + } + verifyChainStateOnSequencer(9, 40, 9, 16, 8) + + // Check how many transactions from alice got included on L2 + // We created one transaction for every L2 block. So we should have created 40 transactions. + // The first 16 L2 block where included without issue. + // Then over the long block, 32s seq drift / 2s block time => 16 blocks with transactions + // Then at the last L2 block we reached the next origin, and accept txs again => 17 blocks with transactions + // That leaves 7 L2 blocks without transactions. So we should have 16+17 = 33 transactions on chain. + n, err = cl.PendingNonceAt(t.Ctx(), dp.Addresses.Alice) + require.NoError(t, err) + require.Equal(t, uint64(40), n) + + n, err = cl.NonceAt(t.Ctx(), dp.Addresses.Alice, nil) + require.NoError(t, err) + require.Equal(t, uint64(33), n) + + // Make more L1 blocks to get past the sequence window for the large range. + // Do batch submit the previous L2 blocks. + batcher.ActSubmitAll(t) + miner.ActL1StartBlock(4)(t) + miner.ActL1IncludeTx(sd.RollupCfg.Genesis.SystemConfig.BatcherAddr)(t) + miner.ActL1EndBlock(t) + + // We are not able to do eager batch derivation for these L2 blocks because + // we reject batches with a greater timestamp than the drift. + verifyChainStateOnSequencer(10, 40, 9, 16, 8) + + for i := 0; i < 2; i++ { + miner.ActL1StartBlock(4)(t) + miner.ActL1EndBlock(t) + } + + // Run the pipeline against the batches + to be auto-generated batches. + sequencer.ActL1HeadSignal(t) + sequencer.ActL2PipelineFull(t) + verifyChainStateOnSequencer(12, 40, 9, 40, 9) + + // Recheck nonce. Will fail if no batches where submitted + n, err = cl.NonceAt(t.Ctx(), dp.Addresses.Alice, nil) + require.NoError(t, err) + require.Equal(t, uint64(33), n) // 16 valid blocks with txns. Get seq drift non-empty (32/2 => 16) & 7 forced empty + + // Check that the verifier got the same result + verifier.ActL1HeadSignal(t) + verifier.ActL2PipelineFull(t) + verifyChainStateOnVerifier(12, 40, 9, 40, 9) + require.Equal(t, verifier.L2Safe(), sequencer.L2Safe()) +} diff --git a/op-e2e2/actions/dencun_fork_test.go b/op-e2e2/actions/dencun_fork_test.go new file mode 100644 index 000000000000..e62ba469f0ea --- /dev/null +++ b/op-e2e2/actions/dencun_fork_test.go @@ -0,0 +1,259 @@ +package actions + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/log" + + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/transactions" + "github.com/ethereum-optimism/optimism/op-service/testlog" +) + +func TestDencunL1ForkAfterGenesis(gt *testing.T) { + t := NewDefaultTesting(gt) + dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) + offset := hexutil.Uint64(24) + dp.DeployConfig.L1CancunTimeOffset = &offset + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelDebug) + _, _, miner, sequencer, _, verifier, _, batcher := setupReorgTestActors(t, dp, sd, log) + + l1Head := miner.l1Chain.CurrentBlock() + require.False(t, sd.L1Cfg.Config.IsCancun(l1Head.Number, l1Head.Time), "Cancun not active yet") + require.Nil(t, l1Head.ExcessBlobGas, "Cancun blob gas not in header") + + // start op-nodes + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + + // build empty L1 blocks, crossing the fork boundary + miner.ActL1SetFeeRecipient(common.Address{'A', 0}) + miner.ActEmptyBlock(t) + miner.ActEmptyBlock(t) // Cancun activates here + miner.ActEmptyBlock(t) + // verify Cancun is active + l1Head = miner.l1Chain.CurrentBlock() + require.True(t, sd.L1Cfg.Config.IsCancun(l1Head.Number, l1Head.Time), "Cancun active") + require.NotNil(t, l1Head.ExcessBlobGas, "Cancun blob gas in header") + + // build L2 chain up to and including L2 blocks referencing Cancun L1 blocks + sequencer.ActL1HeadSignal(t) + sequencer.ActBuildToL1Head(t) + miner.ActL1StartBlock(12)(t) + batcher.ActSubmitAll(t) + miner.ActL1IncludeTx(batcher.batcherAddr)(t) + miner.ActL1EndBlock(t) + + // sync verifier + verifier.ActL1HeadSignal(t) + verifier.ActL2PipelineFull(t) + // verify verifier accepted Cancun L1 inputs + require.Equal(t, l1Head.Hash(), verifier.SyncStatus().SafeL2.L1Origin.Hash, "verifier synced L1 chain that includes Cancun headers") + require.Equal(t, sequencer.SyncStatus().UnsafeL2, verifier.SyncStatus().UnsafeL2, "verifier and sequencer agree") +} + +func TestDencunL1ForkAtGenesis(gt *testing.T) { + t := NewDefaultTesting(gt) + dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) + offset := hexutil.Uint64(0) + dp.DeployConfig.L1CancunTimeOffset = &offset + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelDebug) + _, _, miner, sequencer, _, verifier, _, batcher := setupReorgTestActors(t, dp, sd, log) + + l1Head := miner.l1Chain.CurrentBlock() + require.True(t, sd.L1Cfg.Config.IsCancun(l1Head.Number, l1Head.Time), "Cancun active at genesis") + require.NotNil(t, l1Head.ExcessBlobGas, "Cancun blob gas in header") + + // start op-nodes + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + + // build empty L1 blocks + miner.ActL1SetFeeRecipient(common.Address{'A', 0}) + miner.ActEmptyBlock(t) + miner.ActEmptyBlock(t) + + // verify Cancun is still active + l1Head = miner.l1Chain.CurrentBlock() + require.True(t, sd.L1Cfg.Config.IsCancun(l1Head.Number, l1Head.Time), "Cancun active") + require.NotNil(t, l1Head.ExcessBlobGas, "Cancun blob gas in header") + + // build L2 chain + sequencer.ActL1HeadSignal(t) + sequencer.ActBuildToL1Head(t) + miner.ActL1StartBlock(12)(t) + batcher.ActSubmitAll(t) + miner.ActL1IncludeTx(batcher.batcherAddr)(t) + miner.ActL1EndBlock(t) + + // sync verifier + verifier.ActL1HeadSignal(t) + verifier.ActL2PipelineFull(t) + + // verify verifier accepted Cancun L1 inputs + require.Equal(t, l1Head.Hash(), verifier.SyncStatus().SafeL2.L1Origin.Hash, "verifier synced L1 chain that includes Cancun headers") + require.Equal(t, sequencer.SyncStatus().UnsafeL2, verifier.SyncStatus().UnsafeL2, "verifier and sequencer agree") +} + +func verifyPreEcotoneBlock(gt *testing.T, header *types.Header) { + require.Nil(gt, header.ParentBeaconRoot) + require.Nil(gt, header.ExcessBlobGas) + require.Nil(gt, header.BlobGasUsed) +} + +func verifyEcotoneBlock(gt *testing.T, header *types.Header) { + require.NotNil(gt, header.ParentBeaconRoot) + require.NotNil(gt, header.ExcessBlobGas) + require.Equal(gt, *header.ExcessBlobGas, uint64(0)) + require.NotNil(gt, header.BlobGasUsed) + require.Equal(gt, *header.BlobGasUsed, uint64(0)) +} + +func TestDencunL2ForkAfterGenesis(gt *testing.T) { + t := NewDefaultTesting(gt) + dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) + + cancunOffset := hexutil.Uint64(0) + dp.DeployConfig.L1CancunTimeOffset = &cancunOffset + // This test wil fork on the second block + offset := hexutil.Uint64(dp.DeployConfig.L2BlockTime * 2) + dp.DeployConfig.L2GenesisCanyonTimeOffset = &offset + dp.DeployConfig.L2GenesisDeltaTimeOffset = &offset + dp.DeployConfig.L2GenesisEcotoneTimeOffset = &offset + + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelDebug) + _, _, _, sequencer, engine, verifier, _, _ := setupReorgTestActors(t, dp, sd, log) + + // start op-nodes + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + + // Genesis block is pre-ecotone + verifyPreEcotoneBlock(gt, engine.l2Chain.CurrentBlock()) + + // Block before fork block + sequencer.ActL2StartBlock(t) + sequencer.ActL2EndBlock(t) + verifyPreEcotoneBlock(gt, engine.l2Chain.CurrentBlock()) + + // Fork block is ecotone + sequencer.ActL2StartBlock(t) + sequencer.ActL2EndBlock(t) + verifyEcotoneBlock(gt, engine.l2Chain.CurrentBlock()) + + // Blocks post fork have Ecotone properties + sequencer.ActL2StartBlock(t) + sequencer.ActL2EndBlock(t) + verifyEcotoneBlock(gt, engine.l2Chain.CurrentBlock()) +} + +func TestDencunL2ForkAtGenesis(gt *testing.T) { + t := NewDefaultTesting(gt) + dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) + offset := hexutil.Uint64(0) + dp.DeployConfig.L2GenesisRegolithTimeOffset = &offset + dp.DeployConfig.L1CancunTimeOffset = &offset + dp.DeployConfig.L2GenesisCanyonTimeOffset = &offset + dp.DeployConfig.L2GenesisDeltaTimeOffset = &offset + dp.DeployConfig.L2GenesisEcotoneTimeOffset = &offset + + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelDebug) + _, _, _, sequencer, engine, verifier, _, _ := setupReorgTestActors(t, dp, sd, log) + + // start op-nodes + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + + // Genesis block has ecotone properties + verifyEcotoneBlock(gt, engine.l2Chain.CurrentBlock()) + + // Blocks post fork have Ecotone properties + sequencer.ActL2StartBlock(t) + sequencer.ActL2EndBlock(t) + verifyEcotoneBlock(gt, engine.l2Chain.CurrentBlock()) +} + +func aliceSimpleBlobTx(t Testing, dp *e2eutils.DeployParams) *types.Transaction { + txData := transactions.CreateEmptyBlobTx(true, dp.DeployConfig.L2ChainID) + // Manual signer creation, so we can sign a blob tx on the chain, + // even though we have disabled cancun signer support in Ecotone. + signer := types.NewCancunSigner(txData.ChainID.ToBig()) + tx, err := types.SignNewTx(dp.Secrets.Alice, signer, txData) + require.NoError(t, err, "must sign tx") + return tx +} + +func newEngine(t Testing, sd *e2eutils.SetupData, log log.Logger) *L2Engine { + jwtPath := e2eutils.WriteDefaultJWT(t) + return NewL2Engine(t, log, sd.L2Cfg, sd.RollupCfg.Genesis.L1, jwtPath) +} + +// TestDencunBlobTxRPC tries to send a Blob tx to the L2 engine via RPC, it should not be accepted. +func TestDencunBlobTxRPC(gt *testing.T) { + t := NewDefaultTesting(gt) + dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) + offset := hexutil.Uint64(0) + dp.DeployConfig.L2GenesisRegolithTimeOffset = &offset + dp.DeployConfig.L2GenesisCanyonTimeOffset = &offset + dp.DeployConfig.L2GenesisDeltaTimeOffset = &offset + dp.DeployConfig.L2GenesisEcotoneTimeOffset = &offset + + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelDebug) + engine := newEngine(t, sd, log) + cl := engine.EthClient() + tx := aliceSimpleBlobTx(t, dp) + err := cl.SendTransaction(context.Background(), tx) + require.ErrorContains(t, err, "transaction type not supported") +} + +// TestDencunBlobTxInTxPool tries to insert a blob tx directly into the tx pool, it should not be accepted. +func TestDencunBlobTxInTxPool(gt *testing.T) { + t := NewDefaultTesting(gt) + dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) + offset := hexutil.Uint64(0) + dp.DeployConfig.L2GenesisRegolithTimeOffset = &offset + dp.DeployConfig.L2GenesisCanyonTimeOffset = &offset + dp.DeployConfig.L2GenesisDeltaTimeOffset = &offset + dp.DeployConfig.L2GenesisEcotoneTimeOffset = &offset + + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelDebug) + engine := newEngine(t, sd, log) + tx := aliceSimpleBlobTx(t, dp) + errs := engine.eth.TxPool().Add([]*types.Transaction{tx}, true, true) + require.ErrorContains(t, errs[0], "transaction type not supported") +} + +// TestDencunBlobTxInclusion tries to send a Blob tx to the L2 engine, it should not be accepted. +func TestDencunBlobTxInclusion(gt *testing.T) { + t := NewDefaultTesting(gt) + dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) + offset := hexutil.Uint64(0) + dp.DeployConfig.L2GenesisRegolithTimeOffset = &offset + dp.DeployConfig.L2GenesisCanyonTimeOffset = &offset + dp.DeployConfig.L2GenesisDeltaTimeOffset = &offset + dp.DeployConfig.L2GenesisEcotoneTimeOffset = &offset + + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelDebug) + + _, engine, sequencer := setupSequencerTest(t, sd, log) + sequencer.ActL2PipelineFull(t) + + tx := aliceSimpleBlobTx(t, dp) + + sequencer.ActL2StartBlock(t) + err := engine.engineApi.IncludeTx(tx, dp.Addresses.Alice) + require.ErrorContains(t, err, "invalid L2 block (tx 1): failed to apply transaction to L2 block (tx 1): transaction type not supported") +} diff --git a/op-e2e2/actions/ecotone_fork_test.go b/op-e2e2/actions/ecotone_fork_test.go new file mode 100644 index 000000000000..db44a91d29b5 --- /dev/null +++ b/op-e2e2/actions/ecotone_fork_test.go @@ -0,0 +1,267 @@ +package actions + +import ( + "context" + "math/big" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/ethereum/go-ethereum/log" + + "github.com/ethereum-optimism/optimism/op-chain-ops/genesis" + "github.com/ethereum-optimism/optimism/op-e2e2/bindings" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils" + "github.com/ethereum-optimism/optimism/op-node/rollup/derive" + "github.com/ethereum-optimism/optimism/op-service/predeploys" + "github.com/ethereum-optimism/optimism/op-service/testlog" +) + +var ( + l1BlockCodeHash = common.HexToHash("0xc88a313aa75dc4fbf0b6850d9f9ae41e04243b7008cf3eadb29256d4a71c1dfd") + gasPriceOracleCodeHash = common.HexToHash("0x8b71360ea773b4cfaf1ae6d2bd15464a4e1e2e360f786e475f63aeaed8da0ae5") +) + +// verifyCodeHashMatches checks that the has of the code at the given address matches the expected code-hash. +// It also sanity-checks that the code is not empty: we should never deploy empty contract codes. +// Returns the contract code +func verifyCodeHashMatches(t Testing, client *ethclient.Client, address common.Address, expectedCodeHash common.Hash) []byte { + code, err := client.CodeAt(context.Background(), address, nil) + require.NoError(t, err) + require.NotEmpty(t, code) + codeHash := crypto.Keccak256Hash(code) + require.Equal(t, expectedCodeHash, codeHash) + return code +} + +func TestEcotoneNetworkUpgradeTransactions(gt *testing.T) { + t := NewDefaultTesting(gt) + dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) + genesisBlock := hexutil.Uint64(0) + ecotoneOffset := hexutil.Uint64(4) + + dp.DeployConfig.L1CancunTimeOffset = &genesisBlock // can be removed once Cancun on L1 is the default + + // Activate all forks at genesis, and schedule Ecotone the block after + dp.DeployConfig.L2GenesisRegolithTimeOffset = &genesisBlock + dp.DeployConfig.L2GenesisCanyonTimeOffset = &genesisBlock + dp.DeployConfig.L2GenesisDeltaTimeOffset = &genesisBlock + dp.DeployConfig.L2GenesisEcotoneTimeOffset = &ecotoneOffset + require.NoError(t, dp.DeployConfig.Check(), "must have valid config") + + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelDebug) + _, _, miner, sequencer, engine, verifier, _, _ := setupReorgTestActors(t, dp, sd, log) + ethCl := engine.EthClient() + + // build a single block to move away from the genesis with 0-values in L1Block contract + sequencer.ActL2StartBlock(t) + sequencer.ActL2EndBlock(t) + + // start op-nodes + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + + // Get gas price from oracle + gasPriceOracle, err := bindings.NewGasPriceOracleCaller(predeploys.GasPriceOracleAddr, ethCl) + require.NoError(t, err) + + scalar, err := gasPriceOracle.Scalar(nil) + require.NoError(t, err) + require.True(t, scalar.Cmp(big.NewInt(0)) > 0, "scalar must start non-zero") + feeScalar := dp.DeployConfig.FeeScalar() + require.Equal(t, scalar, new(big.Int).SetBytes(feeScalar[:]), "must match deploy config") + + // Get current implementations addresses (by slot) for L1Block + GasPriceOracle + initialGasPriceOracleAddress, err := ethCl.StorageAt(context.Background(), predeploys.GasPriceOracleAddr, genesis.ImplementationSlot, nil) + require.NoError(t, err) + initialL1BlockAddress, err := ethCl.StorageAt(context.Background(), predeploys.L1BlockAddr, genesis.ImplementationSlot, nil) + require.NoError(t, err) + + // Build to the ecotone block + sequencer.ActBuildL2ToEcotone(t) + + // get latest block + latestBlock, err := ethCl.BlockByNumber(context.Background(), nil) + require.NoError(t, err) + require.Equal(t, sequencer.L2Unsafe().Number, latestBlock.Number().Uint64()) + + transactions := latestBlock.Transactions() + // L1Block: 1 set-L1-info + 2 deploys + 2 upgradeTo + 1 enable ecotone on GPO + 1 4788 deploy + // See [derive.EcotoneNetworkUpgradeTransactions] + require.Equal(t, 7, len(transactions)) + + l1Info, err := derive.L1BlockInfoFromBytes(sd.RollupCfg, latestBlock.Time(), transactions[0].Data()) + require.NoError(t, err) + require.Equal(t, derive.L1InfoBedrockLen, len(transactions[0].Data())) + require.Nil(t, l1Info.BlobBaseFee) + + // All transactions are successful + for i := 1; i < 7; i++ { + txn := transactions[i] + receipt, err := ethCl.TransactionReceipt(context.Background(), txn.Hash()) + require.NoError(t, err) + require.Equal(t, types.ReceiptStatusSuccessful, receipt.Status, "tx %d must pass", i) + require.NotEmpty(t, txn.Data(), "upgrade tx must provide input data") + } + + expectedL1BlockAddress := crypto.CreateAddress(derive.L1BlockDeployerAddress, 0) + expectedGasPriceOracleAddress := crypto.CreateAddress(derive.GasPriceOracleDeployerAddress, 0) + + // Gas Price Oracle Proxy is updated + updatedGasPriceOracleAddress, err := ethCl.StorageAt(context.Background(), predeploys.GasPriceOracleAddr, genesis.ImplementationSlot, latestBlock.Number()) + require.NoError(t, err) + require.Equal(t, expectedGasPriceOracleAddress, common.BytesToAddress(updatedGasPriceOracleAddress)) + require.NotEqualf(t, initialGasPriceOracleAddress, updatedGasPriceOracleAddress, "Gas Price Oracle Proxy address should have changed") + verifyCodeHashMatches(t, ethCl, expectedGasPriceOracleAddress, gasPriceOracleCodeHash) + + // L1Block Proxy is updated + updatedL1BlockAddress, err := ethCl.StorageAt(context.Background(), predeploys.L1BlockAddr, genesis.ImplementationSlot, latestBlock.Number()) + require.NoError(t, err) + require.Equal(t, expectedL1BlockAddress, common.BytesToAddress(updatedL1BlockAddress)) + require.NotEqualf(t, initialL1BlockAddress, updatedL1BlockAddress, "L1Block Proxy address should have changed") + verifyCodeHashMatches(t, ethCl, expectedL1BlockAddress, l1BlockCodeHash) + + _, err = gasPriceOracle.Scalar(nil) + require.ErrorContains(t, err, "scalar() is deprecated") + + cost, err := gasPriceOracle.GetL1Fee(nil, []byte{0, 1, 2, 3, 4}) + require.NoError(t, err) + // The L1 info tx does not get included until after the Ecotone upgrade. + // The scalars are thus empty during activation, and only deposits are included, so the L1 fee is unused. + require.True(t, cost.IsUint64()) + require.Equal(t, cost.Uint64(), uint64(0), "expecting zero scalars within activation block") + + // Check that Ecotone was activated + isEcotone, err := gasPriceOracle.IsEcotone(nil) + require.NoError(t, err) + require.True(t, isEcotone) + + // 4788 contract is deployed + expected4788Address := crypto.CreateAddress(derive.EIP4788From, 0) + require.Equal(t, predeploys.EIP4788ContractAddr, expected4788Address) + code := verifyCodeHashMatches(t, ethCl, predeploys.EIP4788ContractAddr, predeploys.EIP4788ContractCodeHash) + require.Equal(t, predeploys.EIP4788ContractCode, code) + // Test that the beacon-block-root has been set + checkBeaconBlockRoot := func(timestamp uint64, expectedHash common.Hash, expectedTime uint64, msg string) { + historyBufferLength := uint64(8191) + rootIdx := common.BigToHash(new(big.Int).SetUint64((timestamp % historyBufferLength) + historyBufferLength)) + timeIdx := common.BigToHash(new(big.Int).SetUint64(timestamp % historyBufferLength)) + + rootValue, err := ethCl.StorageAt(context.Background(), predeploys.EIP4788ContractAddr, rootIdx, nil) + require.NoError(t, err) + require.Equal(t, expectedHash, common.BytesToHash(rootValue), msg) + + timeValue, err := ethCl.StorageAt(context.Background(), predeploys.EIP4788ContractAddr, timeIdx, nil) + require.NoError(t, err) + timeBig := new(big.Int).SetBytes(timeValue) + require.True(t, timeBig.IsUint64()) + require.Equal(t, expectedTime, timeBig.Uint64(), msg) + } + // The header will always have the beacon-block-root, at the very start. + require.NotNil(t, latestBlock.BeaconRoot()) + require.Equal(t, *latestBlock.BeaconRoot(), common.Hash{}, + "L1 genesis block has zeroed parent-beacon-block-root, since it has no parent block, and that propagates into L2") + // Legacy check: + // > The first block is an exception in upgrade-networks, + // > since the beacon-block root contract isn't there at Ecotone activation, + // > and the beacon-block-root insertion is processed at the start of the block before deposit txs. + // > If the contract was permissionlessly deployed before, the contract storage will be updated however. + // > checkBeaconBlockRoot(latestBlock.Time(), common.Hash{}, 0, "ecotone activation block has no data yet (since contract wasn't there)") + // Note: 4788 is now installed as preinstall, and thus always there. + checkBeaconBlockRoot(latestBlock.Time(), common.Hash{}, latestBlock.Time(), "4788 lookup of first cancun block is 0 hash") + + // Build empty L2 block, to pass ecotone activation + sequencer.ActL2StartBlock(t) + sequencer.ActL2EndBlock(t) + + // Test the L2 block after activation: it should have data in the contract storage now + latestBlock, err = ethCl.BlockByNumber(context.Background(), nil) + require.NoError(t, err) + require.NotNil(t, latestBlock.BeaconRoot()) + firstBeaconBlockRoot := *latestBlock.BeaconRoot() + checkBeaconBlockRoot(latestBlock.Time(), *latestBlock.BeaconRoot(), latestBlock.Time(), "post-activation") + + // require.again, now that we are past activation + _, err = gasPriceOracle.Scalar(nil) + require.ErrorContains(t, err, "scalar() is deprecated") + + // test if the migrated scalar matches the deploy config + basefeeScalar, err := gasPriceOracle.BaseFeeScalar(nil) + require.NoError(t, err) + require.Equal(t, uint64(basefeeScalar), dp.DeployConfig.GasPriceOracleScalar, "must match deploy config") + + cost, err = gasPriceOracle.GetL1Fee(nil, []byte{0, 1, 2, 3, 4}) + require.NoError(t, err) + // The GPO getL1Fee contract returns the L1 fee with approximate signature overhead pre-included, + // like the pre-regolith L1 fee. We do the full fee check below. Just sanity check it is not zero anymore first. + require.Greater(t, cost.Uint64(), uint64(0), "expecting non-zero scalars after activation block") + + // Get L1Block info + l1Block, err := bindings.NewL1BlockCaller(predeploys.L1BlockAddr, ethCl) + require.NoError(t, err) + l1BlockInfo, err := l1Block.Timestamp(nil) + require.NoError(t, err) + require.Greater(t, l1BlockInfo, uint64(0)) + + l1OriginBlock, err := miner.EthClient().BlockByHash(context.Background(), sequencer.L2Unsafe().L1Origin.Hash) + require.NoError(t, err) + l1Basefee, err := l1Block.Basefee(nil) + require.NoError(t, err) + require.Equal(t, l1OriginBlock.BaseFee().Uint64(), l1Basefee.Uint64(), "basefee must match") + + // calldataGas*(l1BaseFee*16*l1BaseFeeScalar + l1BlobBaseFee*l1BlobBaseFeeScalar)/16e6 + // _getCalldataGas in GPO adds the cost of 68 non-zero bytes for signature/rlp overhead. + calldataGas := big.NewInt(4*16 + 1*4 + 68*16) + expectedL1Fee := new(big.Int).Mul(calldataGas, l1Basefee) + expectedL1Fee = expectedL1Fee.Mul(expectedL1Fee, big.NewInt(16)) + expectedL1Fee = expectedL1Fee.Mul(expectedL1Fee, new(big.Int).SetUint64(uint64(basefeeScalar))) + expectedL1Fee = expectedL1Fee.Div(expectedL1Fee, big.NewInt(16e6)) + require.Equal(t, expectedL1Fee, cost, "expecting cost based on regular base fee scalar alone") + + // build forward, incorporate new L1 data + miner.ActEmptyBlock(t) + sequencer.ActL1HeadSignal(t) + sequencer.ActBuildToL1Head(t) + + // Contract storage should be updated now, different than before + latestBlock, err = ethCl.BlockByNumber(context.Background(), nil) + require.NoError(t, err) + require.NotNil(t, latestBlock.BeaconRoot()) + require.NotEqual(t, firstBeaconBlockRoot, *latestBlock.BeaconRoot()) + checkBeaconBlockRoot(latestBlock.Time(), *latestBlock.BeaconRoot(), latestBlock.Time(), "updates on new L1 data") +} + +// TestEcotoneBeforeL1 tests that the L2 Ecotone fork can activate before L1 Dencun does +func TestEcotoneBeforeL1(gt *testing.T) { + t := NewDefaultTesting(gt) + dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) + offset := hexutil.Uint64(0) + farOffset := hexutil.Uint64(10000) + dp.DeployConfig.L2GenesisRegolithTimeOffset = &offset + dp.DeployConfig.L1CancunTimeOffset = &farOffset // L1 Dencun will not be active at genesis + dp.DeployConfig.L2GenesisCanyonTimeOffset = &offset + dp.DeployConfig.L2GenesisDeltaTimeOffset = &offset + dp.DeployConfig.L2GenesisEcotoneTimeOffset = &offset + + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelDebug) + _, _, _, sequencer, engine, verifier, _, _ := setupReorgTestActors(t, dp, sd, log) + + // start op-nodes + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + + // Genesis block has ecotone properties + verifyEcotoneBlock(gt, engine.l2Chain.CurrentBlock()) + + // Blocks post fork have Ecotone properties + sequencer.ActL2StartBlock(t) + sequencer.ActL2EndBlock(t) + verifyEcotoneBlock(gt, engine.l2Chain.CurrentBlock()) +} diff --git a/op-e2e2/actions/eip4844_test.go b/op-e2e2/actions/eip4844_test.go new file mode 100644 index 000000000000..71b268519792 --- /dev/null +++ b/op-e2e2/actions/eip4844_test.go @@ -0,0 +1,185 @@ +package actions + +import ( + "testing" + + "github.com/stretchr/testify/require" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/log" + + batcherFlags "github.com/ethereum-optimism/optimism/op-batcher/flags" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils" + "github.com/ethereum-optimism/optimism/op-node/rollup/sync" + "github.com/ethereum-optimism/optimism/op-service/testlog" +) + +func setupEIP4844Test(t Testing, log log.Logger) (*e2eutils.SetupData, *e2eutils.DeployParams, *L1Miner, *L2Sequencer, *L2Engine, *L2Verifier, *L2Engine) { + dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) + genesisActivation := hexutil.Uint64(0) + dp.DeployConfig.L1CancunTimeOffset = &genesisActivation + dp.DeployConfig.L2GenesisCanyonTimeOffset = &genesisActivation + dp.DeployConfig.L2GenesisDeltaTimeOffset = &genesisActivation + dp.DeployConfig.L2GenesisEcotoneTimeOffset = &genesisActivation + + sd := e2eutils.Setup(t, dp, defaultAlloc) + miner, seqEngine, sequencer := setupSequencerTest(t, sd, log) + miner.ActL1SetFeeRecipient(common.Address{'A'}) + sequencer.ActL2PipelineFull(t) + verifEngine, verifier := setupVerifier(t, sd, log, miner.L1Client(t, sd.RollupCfg), miner.BlobStore(), &sync.Config{}) + return sd, dp, miner, sequencer, seqEngine, verifier, verifEngine +} + +func setupBatcher(t Testing, log log.Logger, sd *e2eutils.SetupData, dp *e2eutils.DeployParams, miner *L1Miner, + sequencer *L2Sequencer, engine *L2Engine, daType batcherFlags.DataAvailabilityType, +) *L2Batcher { + return NewL2Batcher(log, sd.RollupCfg, &BatcherCfg{ + MinL1TxSize: 0, + MaxL1TxSize: 128_000, + BatcherKey: dp.Secrets.Batcher, + DataAvailabilityType: daType, + }, sequencer.RollupClient(), miner.EthClient(), engine.EthClient(), engine.EngineClient(t, sd.RollupCfg)) +} + +func TestEIP4844DataAvailability(gt *testing.T) { + t := NewDefaultTesting(gt) + + log := testlog.Logger(t, log.LevelDebug) + sd, dp, miner, sequencer, seqEngine, verifier, _ := setupEIP4844Test(t, log) + + batcher := setupBatcher(t, log, sd, dp, miner, sequencer, seqEngine, batcherFlags.BlobsType) + + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + + // build empty L1 block + miner.ActEmptyBlock(t) + // finalize it, so the L1 geth blob pool doesn't log errors about missing finality + miner.ActL1SafeNext(t) + miner.ActL1FinalizeNext(t) + + // Create L2 blocks, and reference the L1 head as origin + sequencer.ActL1HeadSignal(t) + sequencer.ActBuildToL1Head(t) + + // submit all new L2 blocks + batcher.ActSubmitAll(t) + batchTx := batcher.LastSubmitted + require.Equal(t, uint8(types.BlobTxType), batchTx.Type(), "batch tx must be blob-tx") + + // new L1 block with L2 batch + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTxByHash(batchTx.Hash())(t) + miner.ActL1EndBlock(t) + + // verifier picks up the L2 chain that was submitted + verifier.ActL1HeadSignal(t) + verifier.ActL2PipelineFull(t) + require.Equal(t, verifier.L2Safe(), sequencer.L2Unsafe(), "verifier syncs from sequencer via L1") + require.NotEqual(t, sequencer.L2Safe(), sequencer.L2Unsafe(), "sequencer has not processed L1 yet") +} + +func TestEIP4844MultiBlobs(gt *testing.T) { + t := NewDefaultTesting(gt) + + log := testlog.Logger(t, log.LevelDebug) + sd, dp, miner, sequencer, seqEngine, verifier, _ := setupEIP4844Test(t, log) + + batcher := setupBatcher(t, log, sd, dp, miner, sequencer, seqEngine, batcherFlags.BlobsType) + + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + + // build empty L1 block + miner.ActEmptyBlock(t) + // finalize it, so the L1 geth blob pool doesn't log errors about missing finality + miner.ActL1SafeNext(t) + miner.ActL1FinalizeNext(t) + + // Create L2 blocks, and reference the L1 head as origin + sequencer.ActL1HeadSignal(t) + sequencer.ActBuildToL1Head(t) + + // submit all new L2 blocks + batcher.ActSubmitAllMultiBlobs(t, 6) + batchTx := batcher.LastSubmitted + require.Equal(t, uint8(types.BlobTxType), batchTx.Type(), "batch tx must be blob-tx") + require.Len(t, batchTx.BlobTxSidecar().Blobs, 6) + + // new L1 block with L2 batch + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTxByHash(batchTx.Hash())(t) + miner.ActL1EndBlock(t) + + // verifier picks up the L2 chain that was submitted + verifier.ActL1HeadSignal(t) + verifier.ActL2PipelineFull(t) + require.Equal(t, verifier.L2Safe(), sequencer.L2Unsafe(), "verifier syncs from sequencer via L1") + require.NotEqual(t, sequencer.L2Safe(), sequencer.L2Unsafe(), "sequencer has not processed L1 yet") +} + +func TestEIP4844DataAvailabilitySwitch(gt *testing.T) { + t := NewDefaultTesting(gt) + + log := testlog.Logger(t, log.LevelDebug) + sd, dp, miner, sequencer, seqEngine, verifier, _ := setupEIP4844Test(t, log) + + oldBatcher := setupBatcher(t, log, sd, dp, miner, sequencer, seqEngine, batcherFlags.CalldataType) + + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + + // build empty L1 block + miner.ActEmptyBlock(t) + // finalize it, so the L1 geth blob pool doesn't log errors about missing finality + miner.ActL1SafeNext(t) + miner.ActL1FinalizeNext(t) + + // Create L2 blocks, and reference the L1 head as origin + sequencer.ActL1HeadSignal(t) + sequencer.ActBuildToL1Head(t) + + // submit all new L2 blocks, with legacy calldata DA + oldBatcher.ActSubmitAll(t) + batchTx := oldBatcher.LastSubmitted + require.Equal(t, uint8(types.DynamicFeeTxType), batchTx.Type(), "batch tx must be eip1559 tx") + + // new L1 block with L2 batch + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTxByHash(batchTx.Hash())(t) + miner.ActL1EndBlock(t) + + // verifier picks up the L2 chain that was submitted + verifier.ActL1HeadSignal(t) + verifier.ActL2PipelineFull(t) + require.Equal(t, verifier.L2Safe(), sequencer.L2Unsafe(), "verifier syncs from sequencer via L1") + require.NotEqual(t, sequencer.L2Safe(), sequencer.L2Unsafe(), "sequencer has not processed L1 yet") + + newBatcher := setupBatcher(t, log, sd, dp, miner, sequencer, seqEngine, batcherFlags.BlobsType) + + // build empty L1 block + miner.ActEmptyBlock(t) + + // Create L2 blocks, and reference the L1 head as origin + sequencer.ActL1HeadSignal(t) + sequencer.ActBuildToL1Head(t) + + // submit all new L2 blocks, now with Blobs DA! + newBatcher.ActSubmitAll(t) + batchTx = newBatcher.LastSubmitted + + // new L1 block with L2 batch + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTxByHash(batchTx.Hash())(t) + miner.ActL1EndBlock(t) + + require.Equal(t, uint8(types.BlobTxType), batchTx.Type(), "batch tx must be blob-tx") + + // verifier picks up the L2 chain that was submitted + verifier.ActL1HeadSignal(t) + verifier.ActL2PipelineFull(t) + require.Equal(t, verifier.L2Safe(), sequencer.L2Unsafe(), "verifier syncs from sequencer via L1") + require.NotEqual(t, sequencer.L2Safe(), sequencer.L2Unsafe(), "sequencer has not processed L1 yet") +} diff --git a/op-e2e2/actions/fjord_fork_test.go b/op-e2e2/actions/fjord_fork_test.go new file mode 100644 index 000000000000..d2754beb2eeb --- /dev/null +++ b/op-e2e2/actions/fjord_fork_test.go @@ -0,0 +1,145 @@ +package actions + +import ( + "context" + "encoding/hex" + "math/big" + "testing" + + "github.com/ethereum-optimism/optimism/op-service/predeploys" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" + "github.com/stretchr/testify/require" + + "github.com/ethereum-optimism/optimism/op-chain-ops/genesis" + "github.com/ethereum-optimism/optimism/op-e2e2/bindings" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils" + "github.com/ethereum-optimism/optimism/op-node/rollup/derive" + "github.com/ethereum-optimism/optimism/op-service/testlog" +) + +var ( + fjordGasPriceOracleCodeHash = common.HexToHash("0xa88fa50a2745b15e6794247614b5298483070661adacb8d32d716434ed24c6b2") + // https://basescan.org/tx/0x8debb2fe54200183fb8baa3c6dbd8e6ec2e4f7a4add87416cd60336b8326d16a + txHex = "02f875822105819b8405709fb884057d460082e97f94273ca93a52b817294830ed7572aa591ccfa647fd80881249c58b0021fb3fc080a05bb08ccfd68f83392e446dac64d88a2d28e7072c06502dfabc4a77e77b5c7913a05878d53dd4ebba4f6367e572d524dffcabeec3abb1d8725ee3ac5dc32e1852e3" +) + +func TestFjordNetworkUpgradeTransactions(gt *testing.T) { + t := NewDefaultTesting(gt) + dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) + genesisBlock := hexutil.Uint64(0) + fjordOffset := hexutil.Uint64(2) + + dp.DeployConfig.L1CancunTimeOffset = &genesisBlock // can be removed once Cancun on L1 is the default + + // Activate all forks at genesis, and schedule Fjord the block after + dp.DeployConfig.L2GenesisRegolithTimeOffset = &genesisBlock + dp.DeployConfig.L2GenesisCanyonTimeOffset = &genesisBlock + dp.DeployConfig.L2GenesisDeltaTimeOffset = &genesisBlock + dp.DeployConfig.L2GenesisEcotoneTimeOffset = &genesisBlock + dp.DeployConfig.L2GenesisFjordTimeOffset = &fjordOffset + require.NoError(t, dp.DeployConfig.Check(), "must have valid config") + + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LvlDebug) + _, _, _, sequencer, engine, verifier, _, _ := setupReorgTestActors(t, dp, sd, log) + ethCl := engine.EthClient() + + // start op-nodes + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + + // Get gas price from oracle + gasPriceOracle, err := bindings.NewGasPriceOracleCaller(predeploys.GasPriceOracleAddr, ethCl) + require.NoError(t, err) + + // Get current implementations addresses (by slot) for L1Block + GasPriceOracle + initialGasPriceOracleAddress, err := ethCl.StorageAt(context.Background(), predeploys.GasPriceOracleAddr, genesis.ImplementationSlot, nil) + require.NoError(t, err) + + sequencer.ActBuildL2ToFjord(t) + + // get latest block + latestBlock, err := ethCl.BlockByNumber(context.Background(), nil) + require.NoError(t, err) + require.Equal(t, sequencer.L2Unsafe().Number, latestBlock.Number().Uint64()) + + transactions := latestBlock.Transactions() + // L1Block: 1 set-L1-info + 1 deploys + 1 upgradeTo + 1 enable fjord on GPO + // See [derive.FjordNetworkUpgradeTransactions] + require.Equal(t, 4, len(transactions)) + + // All transactions are successful + for i := 1; i < 4; i++ { + txn := transactions[i] + receipt, err := ethCl.TransactionReceipt(context.Background(), txn.Hash()) + require.NoError(t, err) + require.Equal(t, types.ReceiptStatusSuccessful, receipt.Status) + require.NotEmpty(t, txn.Data(), "upgrade tx must provide input data") + } + + expectedGasPriceOracleAddress := crypto.CreateAddress(derive.GasPriceOracleFjordDeployerAddress, 0) + + // Gas Price Oracle Proxy is updated + updatedGasPriceOracleAddress, err := ethCl.StorageAt(context.Background(), predeploys.GasPriceOracleAddr, genesis.ImplementationSlot, latestBlock.Number()) + require.NoError(t, err) + require.Equal(t, expectedGasPriceOracleAddress, common.BytesToAddress(updatedGasPriceOracleAddress)) + require.NotEqualf(t, initialGasPriceOracleAddress, updatedGasPriceOracleAddress, "Gas Price Oracle Proxy address should have changed") + verifyCodeHashMatches(t, ethCl, expectedGasPriceOracleAddress, fjordGasPriceOracleCodeHash) + + // Check that Fjord was activated + isFjord, err := gasPriceOracle.IsFjord(nil) + require.NoError(t, err) + require.True(t, isFjord) + + // Check GetL1GasUsed is updated + txData, err := hex.DecodeString(txHex) + require.NoError(t, err) + + gpoL1GasUsed, err := gasPriceOracle.GetL1GasUsed(&bind.CallOpts{}, txData) + require.NoError(t, err) + require.Equal(gt, uint64(1_888), gpoL1GasUsed.Uint64()) + + // Check that GetL1Fee takes into account fast LZ + gpoFee, err := gasPriceOracle.GetL1Fee(&bind.CallOpts{}, txData) + require.NoError(t, err) + + gethFee := fjordL1Cost(t, gasPriceOracle, types.RollupCostData{ + FastLzSize: uint64(types.FlzCompressLen(txData) + 68), + }) + require.Equal(t, gethFee.Uint64(), gpoFee.Uint64()) + + // Check that L1FeeUpperBound works + upperBound, err := gasPriceOracle.GetL1FeeUpperBound(&bind.CallOpts{}, big.NewInt(int64(len(txData)))) + require.NoError(t, err) + + txLen := len(txData) + 68 + flzUpperBound := uint64(txLen + txLen/255 + 16) + + upperBoundCost := fjordL1Cost(t, gasPriceOracle, types.RollupCostData{FastLzSize: flzUpperBound}) + require.Equal(t, upperBoundCost.Uint64(), upperBound.Uint64()) +} + +func fjordL1Cost(t require.TestingT, gasPriceOracle *bindings.GasPriceOracleCaller, rollupCostData types.RollupCostData) *big.Int { + baseFeeScalar, err := gasPriceOracle.BaseFeeScalar(nil) + require.NoError(t, err) + l1BaseFee, err := gasPriceOracle.L1BaseFee(nil) + require.NoError(t, err) + blobBaseFeeScalar, err := gasPriceOracle.BlobBaseFeeScalar(nil) + require.NoError(t, err) + blobBaseFee, err := gasPriceOracle.BlobBaseFee(nil) + require.NoError(t, err) + + costFunc := types.NewL1CostFuncFjord( + l1BaseFee, + blobBaseFee, + new(big.Int).SetUint64(uint64(baseFeeScalar)), + new(big.Int).SetUint64(uint64(blobBaseFeeScalar))) + + fee, _ := costFunc(rollupCostData) + return fee +} diff --git a/op-e2e2/actions/garbage_channel_out.go b/op-e2e2/actions/garbage_channel_out.go new file mode 100644 index 000000000000..0dad1438a991 --- /dev/null +++ b/op-e2e2/actions/garbage_channel_out.go @@ -0,0 +1,267 @@ +package actions + +import ( + "bytes" + "compress/gzip" + "compress/zlib" + "crypto/rand" + "errors" + "fmt" + "io" + + "github.com/ethereum-optimism/optimism/op-node/rollup" + "github.com/ethereum-optimism/optimism/op-node/rollup/derive" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/rlp" +) + +type GarbageKind int64 + +const ( + STRIP_VERSION GarbageKind = iota + RANDOM + TRUNCATE_END + DIRTY_APPEND + INVALID_COMPRESSION + MALFORM_RLP +) + +var GarbageKinds = []GarbageKind{ + STRIP_VERSION, + RANDOM, + TRUNCATE_END, + DIRTY_APPEND, + INVALID_COMPRESSION, + MALFORM_RLP, +} + +// GarbageChannelCfg is the configuration for a `GarbageChannelOut` +type GarbageChannelCfg struct { + useInvalidCompression bool + malformRLP bool +} + +// Writer is the interface shared between `zlib.Writer` and `gzip.Writer` +type Writer interface { + Close() error + Flush() error + Reset(io.Writer) + Write([]byte) (int, error) +} + +// ChannelOutIface is the interface implemented by ChannelOut & GarbageChannelOut +type ChannelOutIface interface { + ID() derive.ChannelID + Reset() error + AddBlock(rollupCfg *rollup.Config, block *types.Block) error + ReadyBytes() int + Flush() error + Close() error + OutputFrame(w *bytes.Buffer, maxSize uint64) (uint16, error) +} + +// Compile-time check for ChannelOutIface interface implementation for the SingularChannelOut type. +var _ ChannelOutIface = (*derive.SingularChannelOut)(nil) + +// Compile-time check for ChannelOutIface interface implementation for the SpanChannelOut type. +var _ ChannelOutIface = (*derive.SpanChannelOut)(nil) + +// Compile-time check for ChannelOutIface interface implementation for the GarbageChannelOut type. +var _ ChannelOutIface = (*GarbageChannelOut)(nil) + +// GarbageChannelOut is a modified `derive.ChannelOut` that can be configured to behave differently +// than the original +type GarbageChannelOut struct { + id derive.ChannelID + // Frame ID of the next frame to emit. Increment after emitting + frame uint64 + // rlpLength is the uncompressed size of the channel. Must be less than MAX_RLP_BYTES_PER_CHANNEL + rlpLength int + + // Compressor stage. Write input data to it + compress Writer + // post compression buffer + buf bytes.Buffer + + closed bool + + // Garbage channel configuration + cfg *GarbageChannelCfg +} + +func (co *GarbageChannelOut) ID() derive.ChannelID { + return co.id +} + +// NewGarbageChannelOut creates a new `GarbageChannelOut` with the given configuration. +func NewGarbageChannelOut(cfg *GarbageChannelCfg) (*GarbageChannelOut, error) { + c := &GarbageChannelOut{ + id: derive.ChannelID{}, // TODO: use GUID here instead of fully random data + frame: 0, + rlpLength: 0, + cfg: cfg, + } + _, err := rand.Read(c.id[:]) + if err != nil { + return nil, err + } + + // Optionally use zlib or gzip compression + var compress Writer + if cfg.useInvalidCompression { + compress, err = gzip.NewWriterLevel(&c.buf, gzip.BestCompression) + } else { + compress, err = zlib.NewWriterLevel(&c.buf, zlib.BestCompression) + } + if err != nil { + return nil, err + } + c.compress = compress + + return c, nil +} + +// TODO: reuse ChannelOut for performance +func (co *GarbageChannelOut) Reset() error { + co.frame = 0 + co.rlpLength = 0 + co.buf.Reset() + co.compress.Reset(&co.buf) + co.closed = false + _, err := rand.Read(co.id[:]) + return err +} + +// AddBlock adds a block to the channel. It returns an error +// if there is a problem adding the block. The only sentinel +// error that it returns is ErrTooManyRLPBytes. If this error +// is returned, the channel should be closed and a new one +// should be made. +func (co *GarbageChannelOut) AddBlock(rollupCfg *rollup.Config, block *types.Block) error { + if co.closed { + return errors.New("already closed") + } + batch, err := blockToBatch(rollupCfg, block) + if err != nil { + return err + } + // We encode to a temporary buffer to determine the encoded length to + // ensure that the total size of all RLP elements is less than or equal to MAX_RLP_BYTES_PER_CHANNEL + var buf bytes.Buffer + if err := rlp.Encode(&buf, batch); err != nil { + return err + } + if co.cfg.malformRLP { + // Malform the RLP by incrementing the length prefix by 1. + bufBytes := buf.Bytes() + bufBytes[0] += 1 + buf.Reset() + buf.Write(bufBytes) + } + if co.rlpLength+buf.Len() > rollup.SafeMaxRLPBytesPerChannel { + return fmt.Errorf("could not add %d bytes to channel of %d bytes, max is %d. err: %w", + buf.Len(), co.rlpLength, rollup.SafeMaxRLPBytesPerChannel, derive.ErrTooManyRLPBytes) + } + co.rlpLength += buf.Len() + + _, err = io.Copy(co.compress, &buf) + return err +} + +// ReadyBytes returns the number of bytes that the channel out can immediately output into a frame. +// Use `Flush` or `Close` to move data from the compression buffer into the ready buffer if more bytes +// are needed. Add blocks may add to the ready buffer, but it is not guaranteed due to the compression stage. +func (co *GarbageChannelOut) ReadyBytes() int { + return co.buf.Len() +} + +// Flush flushes the internal compression stage to the ready buffer. It enables pulling a larger & more +// complete frame. It reduces the compression efficiency. +func (co *GarbageChannelOut) Flush() error { + return co.compress.Flush() +} + +func (co *GarbageChannelOut) Close() error { + if co.closed { + return errors.New("already closed") + } + co.closed = true + return co.compress.Close() +} + +// OutputFrame writes a frame to w with a given max size +// Use `ReadyBytes`, `Flush`, and `Close` to modify the ready buffer. +// Returns io.EOF when the channel is closed & there are no more frames +// Returns nil if there is still more buffered data. +// Returns and error if it ran into an error during processing. +func (co *GarbageChannelOut) OutputFrame(w *bytes.Buffer, maxSize uint64) (uint16, error) { + f := derive.Frame{ + ID: co.id, + FrameNumber: uint16(co.frame), + } + fn := f.FrameNumber + + // Copy data from the local buffer into the frame data buffer + // Don't go past the maxSize with the fixed frame overhead. + // Fixed overhead: 32 + 8 + 2 + 4 + 1 = 47 bytes. + // Add one extra byte for the version byte (for the entire L1 tx though) + maxDataSize := maxSize - 47 - 1 + if maxDataSize >= uint64(co.buf.Len()) { + maxDataSize = uint64(co.buf.Len()) + // If we are closed & will not spill past the current frame + // mark it as the final frame of the channel. + if co.closed { + f.IsLast = true + } + } + f.Data = make([]byte, maxDataSize) + + if _, err := io.ReadFull(&co.buf, f.Data); err != nil { + return fn, err + } + + if err := f.MarshalBinary(w); err != nil { + return fn, err + } + + co.frame += 1 + if f.IsLast { + return fn, io.EOF + } else { + return fn, nil + } +} + +// blockToBatch transforms a block into a batch object that can easily be RLP encoded. +func blockToBatch(rollupCfg *rollup.Config, block *types.Block) (*derive.BatchData, error) { + opaqueTxs := make([]hexutil.Bytes, 0, len(block.Transactions())) + for i, tx := range block.Transactions() { + if tx.Type() == types.DepositTxType { + continue + } + otx, err := tx.MarshalBinary() + if err != nil { + return nil, fmt.Errorf("could not encode tx %v in block %v: %w", i, tx.Hash(), err) + } + opaqueTxs = append(opaqueTxs, otx) + } + l1InfoTx := block.Transactions()[0] + if l1InfoTx.Type() != types.DepositTxType { + return nil, derive.ErrNotDepositTx + } + l1Info, err := derive.L1BlockInfoFromBytes(rollupCfg, block.Time(), l1InfoTx.Data()) + if err != nil { + return nil, fmt.Errorf("could not parse the L1 Info deposit: %w", err) + } + + singularBatch := &derive.SingularBatch{ + ParentHash: block.ParentHash(), + EpochNum: rollup.Epoch(l1Info.Number), + EpochHash: l1Info.BlockHash, + Timestamp: block.Time(), + Transactions: opaqueTxs, + } + + return derive.NewBatchData(singularBatch), nil +} diff --git a/op-e2e2/actions/l1_miner.go b/op-e2e2/actions/l1_miner.go new file mode 100644 index 000000000000..a6a9deefd0a1 --- /dev/null +++ b/op-e2e2/actions/l1_miner.go @@ -0,0 +1,239 @@ +package actions + +import ( + "math/big" + + "github.com/stretchr/testify/require" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/consensus/misc/eip1559" + "github.com/ethereum/go-ethereum/consensus/misc/eip4844" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/trie" + + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils" + "github.com/ethereum-optimism/optimism/op-node/rollup/derive" + "github.com/ethereum-optimism/optimism/op-service/eth" +) + +// L1Miner wraps a L1Replica with instrumented block building ability. +type L1Miner struct { + L1Replica + + blobStore *e2eutils.BlobsStore + + // L1 block building preferences + prefCoinbase common.Address + + // L1 block building data + l1BuildingHeader *types.Header // block header that we add txs to for block building + l1BuildingState *state.StateDB // state used for block building + l1GasPool *core.GasPool // track gas used of ongoing building + pendingIndices map[common.Address]uint64 // per account, how many txs from the pool were already included in the block, since the pool is lagging behind block mining. + l1Transactions []*types.Transaction // collects txs that were successfully included into current block build + l1Receipts []*types.Receipt // collect receipts of ongoing building + l1Building bool + l1TxFailed []*types.Transaction // log of failed transactions which could not be included + // sidecars that come with the transactions + l1BuildingBlobSidecars []*types.BlobTxSidecar +} + +// NewL1Miner creates a new L1Replica that can also build blocks. +func NewL1Miner(t Testing, log log.Logger, genesis *core.Genesis) *L1Miner { + rep := NewL1Replica(t, log, genesis) + return &L1Miner{ + L1Replica: *rep, + blobStore: e2eutils.NewBlobStore(), + } +} + +func (s *L1Miner) BlobStore() derive.L1BlobsFetcher { + return s.blobStore +} + +// ActL1StartBlock returns an action to build a new L1 block on top of the head block, +// with timeDelta added to the head block time. +func (s *L1Miner) ActL1StartBlock(timeDelta uint64) Action { + return func(t Testing) { + if s.l1Building { + t.InvalidAction("not valid if we already started building a block") + } + if timeDelta == 0 { + t.Fatalf("invalid time delta: %d", timeDelta) + } + + parent := s.l1Chain.CurrentHeader() + parentHash := parent.Hash() + statedb, err := state.New(parent.Root, state.NewDatabase(s.l1Database), nil) + if err != nil { + t.Fatalf("failed to init state db around block %s (state %s): %w", parentHash, parent.Root, err) + } + header := &types.Header{ + ParentHash: parentHash, + Coinbase: s.prefCoinbase, + Difficulty: common.Big0, + Number: new(big.Int).Add(parent.Number, common.Big1), + GasLimit: parent.GasLimit, + Time: parent.Time + timeDelta, + Extra: []byte("L1 was here"), + MixDigest: common.Hash{}, // TODO: maybe randomize this (prev-randao value) + } + if s.l1Cfg.Config.IsLondon(header.Number) { + header.BaseFee = eip1559.CalcBaseFee(s.l1Cfg.Config, parent, header.Time) + // At the transition, double the gas limit so the gas target is equal to the old gas limit. + if !s.l1Cfg.Config.IsLondon(parent.Number) { + header.GasLimit = parent.GasLimit * s.l1Cfg.Config.ElasticityMultiplier() + } + } + if s.l1Cfg.Config.IsShanghai(header.Number, header.Time) { + header.WithdrawalsHash = &types.EmptyWithdrawalsHash + } + if s.l1Cfg.Config.IsCancun(header.Number, header.Time) { + header.BlobGasUsed = new(uint64) + header.ExcessBlobGas = new(uint64) + root := crypto.Keccak256Hash([]byte("fake-beacon-block-root"), header.Number.Bytes()) + header.ParentBeaconRoot = &root + } + + s.l1Building = true + s.l1BuildingHeader = header + s.l1BuildingState = statedb + s.l1Receipts = make([]*types.Receipt, 0) + s.l1Transactions = make([]*types.Transaction, 0) + s.pendingIndices = make(map[common.Address]uint64) + s.l1BuildingBlobSidecars = make([]*types.BlobTxSidecar, 0) + + s.l1GasPool = new(core.GasPool).AddGas(header.GasLimit) + } +} + +// ActL1IncludeTx includes the next tx from L1 tx pool from the given account +func (s *L1Miner) ActL1IncludeTx(from common.Address) Action { + return func(t Testing) { + if !s.l1Building { + t.InvalidAction("no tx inclusion when not building l1 block") + return + } + getPendingIndex := func(from common.Address) uint64 { + return s.pendingIndices[from] + } + tx := firstValidTx(t, from, getPendingIndex, s.eth.TxPool().ContentFrom, s.EthClient().NonceAt) + s.IncludeTx(t, tx) + s.pendingIndices[from] = s.pendingIndices[from] + 1 // won't retry the tx + } +} + +// ActL1IncludeTxByHash tries to include a tx by tx-hash. +func (s *L1Miner) ActL1IncludeTxByHash(txHash common.Hash) Action { + return func(t Testing) { + if !s.l1Building { + t.InvalidAction("no tx inclusion when not building l1 block") + return + } + tx := s.eth.TxPool().Get(txHash) + require.NotNil(t, tx, "cannot find tx %s", txHash) + s.IncludeTx(t, tx) + from, err := s.l1Signer.Sender(tx) + require.NoError(t, err) + s.pendingIndices[from] = s.pendingIndices[from] + 1 // won't retry the tx + } +} + +func (s *L1Miner) IncludeTx(t Testing, tx *types.Transaction) { + from, err := s.l1Signer.Sender(tx) + require.NoError(t, err) + s.log.Info("including tx", "nonce", tx.Nonce(), "from", from, "to", tx.To()) + if tx.Gas() > s.l1BuildingHeader.GasLimit { + t.Fatalf("tx consumes %d gas, more than available in L1 block %d", tx.Gas(), s.l1BuildingHeader.GasLimit) + } + if tx.Gas() > uint64(*s.l1GasPool) { + t.InvalidAction("action takes too much gas: %d, only have %d", tx.Gas(), uint64(*s.l1GasPool)) + return + } + s.l1BuildingState.SetTxContext(tx.Hash(), len(s.l1Transactions)) + receipt, err := core.ApplyTransaction(s.l1Cfg.Config, s.l1Chain, &s.l1BuildingHeader.Coinbase, + s.l1GasPool, s.l1BuildingState, s.l1BuildingHeader, tx.WithoutBlobTxSidecar(), &s.l1BuildingHeader.GasUsed, *s.l1Chain.GetVMConfig()) + if err != nil { + s.l1TxFailed = append(s.l1TxFailed, tx) + t.Fatalf("failed to apply transaction to L1 block (tx %d): %v", len(s.l1Transactions), err) + } + s.l1Receipts = append(s.l1Receipts, receipt) + s.l1Transactions = append(s.l1Transactions, tx.WithoutBlobTxSidecar()) + if tx.Type() == types.BlobTxType { + require.True(t, s.l1Cfg.Config.IsCancun(s.l1BuildingHeader.Number, s.l1BuildingHeader.Time), "L1 must be cancun to process blob tx") + sidecar := tx.BlobTxSidecar() + if sidecar != nil { + s.l1BuildingBlobSidecars = append(s.l1BuildingBlobSidecars, sidecar) + } + *s.l1BuildingHeader.BlobGasUsed += receipt.BlobGasUsed + } +} + +func (s *L1Miner) ActL1SetFeeRecipient(coinbase common.Address) { + s.prefCoinbase = coinbase + if s.l1Building { + s.l1BuildingHeader.Coinbase = coinbase + } +} + +// ActL1EndBlock finishes the new L1 block, and applies it to the chain as unsafe block +func (s *L1Miner) ActL1EndBlock(t Testing) { + if !s.l1Building { + t.InvalidAction("cannot end L1 block when not building block") + return + } + + s.l1Building = false + s.l1BuildingHeader.GasUsed = s.l1BuildingHeader.GasLimit - uint64(*s.l1GasPool) + s.l1BuildingHeader.Root = s.l1BuildingState.IntermediateRoot(s.l1Cfg.Config.IsEIP158(s.l1BuildingHeader.Number)) + block := types.NewBlock(s.l1BuildingHeader, s.l1Transactions, nil, s.l1Receipts, trie.NewStackTrie(nil)) + if s.l1Cfg.Config.IsShanghai(s.l1BuildingHeader.Number, s.l1BuildingHeader.Time) { + block = block.WithWithdrawals(make([]*types.Withdrawal, 0)) + } + if s.l1Cfg.Config.IsCancun(s.l1BuildingHeader.Number, s.l1BuildingHeader.Time) { + parent := s.l1Chain.GetHeaderByHash(s.l1BuildingHeader.ParentHash) + var ( + parentExcessBlobGas uint64 + parentBlobGasUsed uint64 + ) + if parent.ExcessBlobGas != nil { + parentExcessBlobGas = *parent.ExcessBlobGas + parentBlobGasUsed = *parent.BlobGasUsed + } + excessBlobGas := eip4844.CalcExcessBlobGas(parentExcessBlobGas, parentBlobGasUsed) + s.l1BuildingHeader.ExcessBlobGas = &excessBlobGas + } + + // Write state changes to db + root, err := s.l1BuildingState.Commit(s.l1BuildingHeader.Number.Uint64(), s.l1Cfg.Config.IsEIP158(s.l1BuildingHeader.Number)) + if err != nil { + t.Fatalf("l1 state write error: %v", err) + } + if err := s.l1BuildingState.Database().TrieDB().Commit(root, false); err != nil { + t.Fatalf("l1 trie write error: %v", err) + } + // now that the blob txs are in a canonical block, flush them to the blob store + for _, sidecar := range s.l1BuildingBlobSidecars { + for i, h := range sidecar.BlobHashes() { + blob := (*eth.Blob)(&sidecar.Blobs[i]) + s.blobStore.StoreBlob(block.Hash(), h, blob) + } + } + _, err = s.l1Chain.InsertChain(types.Blocks{block}) + if err != nil { + t.Fatalf("failed to insert block into l1 chain") + } +} + +func (s *L1Miner) ActEmptyBlock(t Testing) { + s.ActL1StartBlock(12)(t) + s.ActL1EndBlock(t) +} + +func (s *L1Miner) Close() error { + return s.L1Replica.Close() +} diff --git a/op-e2e2/actions/l1_miner_test.go b/op-e2e2/actions/l1_miner_test.go new file mode 100644 index 000000000000..b55142ff4fd8 --- /dev/null +++ b/op-e2e2/actions/l1_miner_test.go @@ -0,0 +1,67 @@ +package actions + +import ( + "math/big" + "testing" + + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/params" + "github.com/stretchr/testify/require" + + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils" + "github.com/ethereum-optimism/optimism/op-service/testlog" +) + +func TestL1Miner_BuildBlock(gt *testing.T) { + t := NewDefaultTesting(gt) + dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelDebug) + miner := NewL1Miner(t, log, sd.L1Cfg) + t.Cleanup(func() { + _ = miner.Close() + }) + + cl := miner.EthClient() + signer := types.LatestSigner(sd.L1Cfg.Config) + + // send a tx to the miner + tx := types.MustSignNewTx(dp.Secrets.Alice, signer, &types.DynamicFeeTx{ + ChainID: sd.L1Cfg.Config.ChainID, + Nonce: 0, + GasTipCap: big.NewInt(2 * params.GWei), + GasFeeCap: new(big.Int).Add(miner.l1Chain.CurrentBlock().BaseFee, big.NewInt(2*params.GWei)), + Gas: params.TxGas, + To: &dp.Addresses.Bob, + Value: e2eutils.Ether(2), + }) + require.NoError(gt, cl.SendTransaction(t.Ctx(), tx)) + + // make an empty block, even though a tx may be waiting + miner.ActL1StartBlock(10)(t) + miner.ActL1EndBlock(t) + header := miner.l1Chain.CurrentBlock() + bl := miner.l1Chain.GetBlockByHash(header.Hash()) + require.Equal(t, uint64(1), bl.NumberU64()) + require.Zero(gt, bl.Transactions().Len()) + + // now include the tx when we want it to + miner.ActL1StartBlock(10)(t) + miner.ActL1IncludeTx(dp.Addresses.Alice)(t) + miner.ActL1EndBlock(t) + header = miner.l1Chain.CurrentBlock() + bl = miner.l1Chain.GetBlockByHash(header.Hash()) + require.Equal(t, uint64(2), bl.NumberU64()) + require.Equal(t, 1, bl.Transactions().Len()) + require.Equal(t, tx.Hash(), bl.Transactions()[0].Hash()) + + // now make a replica that syncs these two blocks from the miner + replica := NewL1Replica(t, log, sd.L1Cfg) + t.Cleanup(func() { + _ = replica.Close() + }) + replica.ActL1Sync(miner.CanonL1Chain())(t) + replica.ActL1Sync(miner.CanonL1Chain())(t) + require.Equal(t, replica.l1Chain.CurrentBlock().Hash(), miner.l1Chain.CurrentBlock().Hash()) +} diff --git a/op-e2e2/actions/l1_replica.go b/op-e2e2/actions/l1_replica.go new file mode 100644 index 000000000000..92796ab60fb0 --- /dev/null +++ b/op-e2e2/actions/l1_replica.go @@ -0,0 +1,260 @@ +package actions + +import ( + "errors" + + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/txpool/blobpool" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/eth" + "github.com/ethereum/go-ethereum/eth/ethconfig" + "github.com/ethereum/go-ethereum/eth/tracers" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/node" + "github.com/ethereum/go-ethereum/p2p" + "github.com/stretchr/testify/require" + + "github.com/ethereum-optimism/optimism/op-node/rollup" + "github.com/ethereum-optimism/optimism/op-service/client" + "github.com/ethereum-optimism/optimism/op-service/sources" + "github.com/ethereum-optimism/optimism/op-service/testutils" +) + +// L1CanonSrc is used to sync L1 from another node. +// The other node always has the canonical chain. +// May be nil if there is nothing to sync from +type L1CanonSrc func(num uint64) *types.Block + +// L1Replica is an instrumented in-memory L1 geth node that: +// - can sync from the given canonical L1 blocks source +// - can rewind the chain back (for reorgs) +// - can provide an RPC with mock errors +type L1Replica struct { + log log.Logger + + node *node.Node + eth *eth.Ethereum + + // L1 evm / chain + l1Chain *core.BlockChain + l1Database ethdb.Database + l1Cfg *core.Genesis + l1Signer types.Signer + + failL1RPC func() error // mock error +} + +// NewL1Replica constructs a L1Replica starting at the given genesis. +func NewL1Replica(t Testing, log log.Logger, genesis *core.Genesis) *L1Replica { + ethCfg := ðconfig.Config{ + NetworkId: genesis.Config.ChainID.Uint64(), + Genesis: genesis, + RollupDisableTxPoolGossip: true, + BlobPool: blobpool.Config{ + Datadir: t.TempDir(), + Datacap: blobpool.DefaultConfig.Datacap, + PriceBump: blobpool.DefaultConfig.PriceBump, + }, + } + nodeCfg := &node.Config{ + Name: "l1-geth", + WSHost: "127.0.0.1", + WSPort: 0, + WSModules: []string{"debug", "admin", "eth", "txpool", "net", "rpc", "web3", "personal"}, + HTTPModules: []string{"debug", "admin", "eth", "txpool", "net", "rpc", "web3", "personal"}, + DataDir: "", // in-memory + P2P: p2p.Config{ + NoDiscovery: true, + NoDial: true, + }, + } + n, err := node.New(nodeCfg) + require.NoError(t, err) + t.Cleanup(func() { + _ = n.Close() + }) + + backend, err := eth.New(n, ethCfg) + require.NoError(t, err) + backend.Merger().FinalizePoS() + + n.RegisterAPIs(tracers.APIs(backend.APIBackend)) + + require.NoError(t, n.Start(), "failed to start L1 geth node") + return &L1Replica{ + log: log, + node: n, + eth: backend, + l1Chain: backend.BlockChain(), + l1Database: backend.ChainDb(), + l1Cfg: genesis, + l1Signer: types.LatestSigner(genesis.Config), + failL1RPC: nil, + } +} + +// ActL1RewindToParent rewinds the L1 chain to parent block of head +func (s *L1Replica) ActL1RewindToParent(t Testing) { + s.ActL1RewindDepth(1)(t) +} + +func (s *L1Replica) ActL1RewindDepth(depth uint64) Action { + return func(t Testing) { + if depth == 0 { + return + } + head := s.l1Chain.CurrentHeader().Number.Uint64() + if head < depth { + t.InvalidAction("cannot rewind L1 past genesis (current: %d, rewind depth: %d)", head, depth) + return + } + finalized := s.l1Chain.CurrentFinalBlock() + if finalized != nil && head < finalized.Number.Uint64()+depth { + t.InvalidAction("cannot rewind head of chain past finalized block %d with rewind depth %d", finalized.Number.Uint64(), depth) + return + } + if err := s.l1Chain.SetHead(head - depth); err != nil { + t.Fatalf("failed to rewind L1 chain to nr %d: %v", head-depth, err) + } + } +} + +// ActL1Sync processes the next canonical L1 block, +// or rewinds one block if the canonical block cannot be applied to the head. +func (s *L1Replica) ActL1Sync(canonL1 func(num uint64) *types.Block) Action { + return func(t Testing) { + selfHead := s.l1Chain.CurrentHeader() + n := selfHead.Number.Uint64() + expected := canonL1(n) + if expected == nil || selfHead.Hash() != expected.Hash() { + s.ActL1RewindToParent(t) + return + } + next := canonL1(n + 1) + if next == nil { + t.InvalidAction("already fully synced to head %s (%d), n+1 is not there", selfHead.Hash(), n) + return + } + if next.ParentHash() != selfHead.Hash() { + // canonical chain must be set up wrong - with actions one by one it is not supposed to reorg during a single sync step. + t.Fatalf("canonical L1 source reorged unexpectedly from %s (num %d) to next block %s (parent %s)", n, selfHead.Hash(), next.Hash(), next.ParentHash()) + } + _, err := s.l1Chain.InsertChain([]*types.Block{next}) + require.NoError(t, err, "L1 replica could not sync next canonical L1 block %s (%d)", next.Hash(), next.NumberU64()) + } +} + +func (s *L1Replica) CanonL1Chain() func(num uint64) *types.Block { + return s.l1Chain.GetBlockByNumber +} + +// ActL1RPCFail makes the next L1 RPC request to this node fail +func (s *L1Replica) ActL1RPCFail(t Testing) { + failed := false + s.failL1RPC = func() error { + if failed { + return nil + } + failed = true + return errors.New("mock L1 RPC error") + } +} + +func (s *L1Replica) MockL1RPCErrors(fn func() error) { + s.failL1RPC = fn +} + +func (s *L1Replica) EthClient() *ethclient.Client { + cl := s.node.Attach() + return ethclient.NewClient(cl) +} + +func (s *L1Replica) RPCClient() client.RPC { + cl := s.node.Attach() + return testutils.RPCErrFaker{ + RPC: client.NewBaseRPCClient(cl), + ErrFn: func() error { + if s.failL1RPC != nil { + return s.failL1RPC() + } else { + return nil + } + }, + } +} + +func (s *L1Replica) L1Client(t Testing, cfg *rollup.Config) *sources.L1Client { + l1F, err := sources.NewL1Client(s.RPCClient(), s.log, nil, sources.L1ClientDefaultConfig(cfg, false, sources.RPCKindStandard)) + require.NoError(t, err) + return l1F +} + +func (s *L1Replica) UnsafeNum() uint64 { + head := s.l1Chain.CurrentBlock() + headNum := uint64(0) + if head != nil { + headNum = head.Number.Uint64() + } + return headNum +} + +func (s *L1Replica) SafeNum() uint64 { + safe := s.l1Chain.CurrentSafeBlock() + safeNum := uint64(0) + if safe != nil { + safeNum = safe.Number.Uint64() + } + return safeNum +} + +func (s *L1Replica) FinalizedNum() uint64 { + finalized := s.l1Chain.CurrentFinalBlock() + finalizedNum := uint64(0) + if finalized != nil { + finalizedNum = finalized.Number.Uint64() + } + return finalizedNum +} + +// ActL1Finalize finalizes a later block, which must be marked as safe before doing so (see ActL1SafeNext). +func (s *L1Replica) ActL1Finalize(t Testing, num uint64) { + safeNum := s.SafeNum() + finalizedNum := s.FinalizedNum() + if safeNum < num { + t.InvalidAction("need to move forward safe block before moving finalized block") + return + } + newFinalized := s.l1Chain.GetHeaderByNumber(num) + if newFinalized == nil { + t.Fatalf("expected block at %d after finalized L1 block %d, safe head is ahead", num, finalizedNum) + } + s.l1Chain.SetFinalized(newFinalized) +} + +// ActL1FinalizeNext finalizes the next block, which must be marked as safe before doing so (see ActL1SafeNext). +func (s *L1Replica) ActL1FinalizeNext(t Testing) { + n := s.FinalizedNum() + 1 + s.ActL1Finalize(t, n) +} + +// ActL1Safe marks the given unsafe block as safe. +func (s *L1Replica) ActL1Safe(t Testing, num uint64) { + newSafe := s.l1Chain.GetHeaderByNumber(num) + if newSafe == nil { + t.InvalidAction("could not find L1 block %d, cannot label it as safe", num) + return + } + s.l1Chain.SetSafe(newSafe) +} + +// ActL1SafeNext marks the next unsafe block as safe. +func (s *L1Replica) ActL1SafeNext(t Testing) { + n := s.SafeNum() + 1 + s.ActL1Safe(t, n) +} + +func (s *L1Replica) Close() error { + return s.node.Close() +} diff --git a/op-e2e2/actions/l1_replica_test.go b/op-e2e2/actions/l1_replica_test.go new file mode 100644 index 000000000000..9cba6830a3bd --- /dev/null +++ b/op-e2e2/actions/l1_replica_test.go @@ -0,0 +1,115 @@ +package actions + +import ( + "testing" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/consensus/beacon" + "github.com/ethereum/go-ethereum/consensus/ethash" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/triedb" + "github.com/ethereum/go-ethereum/triedb/hashdb" + "github.com/stretchr/testify/require" + + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils" + "github.com/ethereum-optimism/optimism/op-service/eth" + "github.com/ethereum-optimism/optimism/op-service/sources" + "github.com/ethereum-optimism/optimism/op-service/testlog" +) + +var defaultRollupTestParams = &e2eutils.TestParams{ + MaxSequencerDrift: 40, + SequencerWindowSize: 120, + ChannelTimeout: 120, + L1BlockTime: 15, +} + +var defaultAlloc = &e2eutils.AllocParams{PrefundTestUsers: true} + +// Test if we can mock an RPC failure +func TestL1Replica_ActL1RPCFail(gt *testing.T) { + t := NewDefaultTesting(gt) + dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelDebug) + replica := NewL1Replica(t, log, sd.L1Cfg) + t.Cleanup(func() { + _ = replica.Close() + }) + // mock an RPC failure + replica.ActL1RPCFail(t) + // check RPC failure + l1Cl, err := sources.NewL1Client(replica.RPCClient(), log, nil, sources.L1ClientDefaultConfig(sd.RollupCfg, false, sources.RPCKindStandard)) + require.NoError(t, err) + _, err = l1Cl.InfoByLabel(t.Ctx(), eth.Unsafe) + require.ErrorContains(t, err, "mock") + head, err := l1Cl.InfoByLabel(t.Ctx(), eth.Unsafe) + require.NoError(t, err) + require.Equal(gt, sd.L1Cfg.ToBlock().Hash(), head.Hash(), "expecting replica to start at genesis") +} + +// Test if we can make the replica sync an artificial L1 chain, rewind it, and reorg it +func TestL1Replica_ActL1Sync(gt *testing.T) { + t := NewDefaultTesting(gt) + dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelDebug) + genesisBlock := sd.L1Cfg.ToBlock() + consensus := beacon.New(ethash.NewFaker()) + db := rawdb.NewMemoryDatabase() + tdb := triedb.NewDatabase(db, &triedb.Config{HashDB: hashdb.Defaults}) + sd.L1Cfg.MustCommit(db, tdb) + + chainA, _ := core.GenerateChain(sd.L1Cfg.Config, genesisBlock, consensus, db, 10, func(n int, g *core.BlockGen) { + g.SetCoinbase(common.Address{'A'}) + }) + chainA = append(append([]*types.Block{}, genesisBlock), chainA...) + chainB, _ := core.GenerateChain(sd.L1Cfg.Config, chainA[3], consensus, db, 10, func(n int, g *core.BlockGen) { + g.SetCoinbase(common.Address{'B'}) + }) + chainB = append(append([]*types.Block{}, chainA[:4]...), chainB...) + require.NotEqual(t, chainA[9], chainB[9], "need different chains") + canonL1 := func(blocks []*types.Block) func(num uint64) *types.Block { + return func(num uint64) *types.Block { + if num >= uint64(len(blocks)) { + return nil + } + return blocks[num] + } + } + + // Enough setup, create the test actor and run the actual actions + replica1 := NewL1Replica(t, log, sd.L1Cfg) + t.Cleanup(func() { + _ = replica1.Close() + }) + syncFromA := replica1.ActL1Sync(canonL1(chainA)) + // sync canonical chain A + for replica1.l1Chain.CurrentBlock().Number.Uint64()+1 < uint64(len(chainA)) { + syncFromA(t) + } + require.Equal(t, replica1.l1Chain.CurrentBlock().Hash(), chainA[len(chainA)-1].Hash(), "sync replica1 to head of chain A") + replica1.ActL1RewindToParent(t) + require.Equal(t, replica1.l1Chain.CurrentBlock().Hash(), chainA[len(chainA)-2].Hash(), "rewind replica1 to parent of chain A") + + // sync new canonical chain B + syncFromB := replica1.ActL1Sync(canonL1(chainB)) + for replica1.l1Chain.CurrentBlock().Number.Uint64()+1 < uint64(len(chainB)) { + syncFromB(t) + } + require.Equal(t, replica1.l1Chain.CurrentBlock().Hash(), chainB[len(chainB)-1].Hash(), "sync replica1 to head of chain B") + + // Adding and syncing a new replica + replica2 := NewL1Replica(t, log, sd.L1Cfg) + t.Cleanup(func() { + _ = replica2.Close() + }) + syncFromOther := replica2.ActL1Sync(replica1.CanonL1Chain()) + for replica2.l1Chain.CurrentBlock().Number.Uint64()+1 < uint64(len(chainB)) { + syncFromOther(t) + } + require.Equal(t, replica2.l1Chain.CurrentBlock().Hash(), chainB[len(chainB)-1].Hash(), "sync replica2 to head of chain B") +} diff --git a/op-e2e2/actions/l2_batcher.go b/op-e2e2/actions/l2_batcher.go new file mode 100644 index 000000000000..8a0abd2c84a1 --- /dev/null +++ b/op-e2e2/actions/l2_batcher.go @@ -0,0 +1,500 @@ +package actions + +import ( + "bytes" + "context" + "crypto/ecdsa" + "crypto/rand" + "io" + "math/big" + + "github.com/holiman/uint256" + "github.com/stretchr/testify/require" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/consensus/misc/eip4844" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/params" + + "github.com/ethereum-optimism/optimism/op-batcher/batcher" + "github.com/ethereum-optimism/optimism/op-batcher/compressor" + batcherFlags "github.com/ethereum-optimism/optimism/op-batcher/flags" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils" + "github.com/ethereum-optimism/optimism/op-node/rollup" + "github.com/ethereum-optimism/optimism/op-node/rollup/derive" + plasma "github.com/ethereum-optimism/optimism/op-plasma" + "github.com/ethereum-optimism/optimism/op-service/eth" + "github.com/ethereum-optimism/optimism/op-service/txmgr" +) + +type SyncStatusAPI interface { + SyncStatus(ctx context.Context) (*eth.SyncStatus, error) +} + +type BlocksAPI interface { + BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error) +} + +type L1TxAPI interface { + PendingNonceAt(ctx context.Context, account common.Address) (uint64, error) + HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error) + SendTransaction(ctx context.Context, tx *types.Transaction) error +} + +type PlasmaInputSetter interface { + SetInput(ctx context.Context, img []byte) (plasma.CommitmentData, error) +} + +type BatcherCfg struct { + // Limit the size of txs + MinL1TxSize uint64 + MaxL1TxSize uint64 + + BatcherKey *ecdsa.PrivateKey + + GarbageCfg *GarbageChannelCfg + + ForceSubmitSingularBatch bool + ForceSubmitSpanBatch bool + UsePlasma bool + + DataAvailabilityType batcherFlags.DataAvailabilityType + PlasmaDA PlasmaInputSetter +} + +func DefaultBatcherCfg(dp *e2eutils.DeployParams) *BatcherCfg { + return &BatcherCfg{ + MinL1TxSize: 0, + MaxL1TxSize: 128_000, + BatcherKey: dp.Secrets.Batcher, + DataAvailabilityType: batcherFlags.CalldataType, + } +} + +func PlasmaBatcherCfg(dp *e2eutils.DeployParams, plasmaDa PlasmaInputSetter) *BatcherCfg { + return &BatcherCfg{ + MinL1TxSize: 0, + MaxL1TxSize: 128_000, + BatcherKey: dp.Secrets.Batcher, + DataAvailabilityType: batcherFlags.CalldataType, + PlasmaDA: plasmaDa, + UsePlasma: true, + } +} + +type L2BlockRefs interface { + L2BlockRefByHash(ctx context.Context, hash common.Hash) (eth.L2BlockRef, error) +} + +// L2Batcher buffers and submits L2 batches to L1. +// +// TODO: note the batcher shares little logic/state with actual op-batcher, +// tests should only use this actor to build batch contents for rollup node actors to consume, +// until the op-batcher is refactored and can be covered better. +type L2Batcher struct { + log log.Logger + + rollupCfg *rollup.Config + + syncStatusAPI SyncStatusAPI + l2 BlocksAPI + l1 L1TxAPI + engCl L2BlockRefs + + l1Signer types.Signer + + l2ChannelOut ChannelOutIface + l2Submitting bool // when the channel out is being submitted, and not safe to write to without resetting + l2BufferedBlock eth.L2BlockRef + l2SubmittedBlock eth.L2BlockRef + l2BatcherCfg *BatcherCfg + batcherAddr common.Address + + LastSubmitted *types.Transaction +} + +func NewL2Batcher(log log.Logger, rollupCfg *rollup.Config, batcherCfg *BatcherCfg, api SyncStatusAPI, l1 L1TxAPI, l2 BlocksAPI, engCl L2BlockRefs) *L2Batcher { + return &L2Batcher{ + log: log, + rollupCfg: rollupCfg, + syncStatusAPI: api, + l1: l1, + l2: l2, + engCl: engCl, + l2BatcherCfg: batcherCfg, + l1Signer: types.LatestSignerForChainID(rollupCfg.L1ChainID), + batcherAddr: crypto.PubkeyToAddress(batcherCfg.BatcherKey.PublicKey), + } +} + +// SubmittingData indicates if the actor is submitting buffer data. +// All data must be submitted before it can safely continue buffering more L2 blocks. +func (s *L2Batcher) SubmittingData() bool { + return s.l2Submitting +} + +// ActL2BatchBuffer adds the next L2 block to the batch buffer. +// If the buffer is being submitted, the buffer is wiped. +func (s *L2Batcher) ActL2BatchBuffer(t Testing) { + require.NoError(t, s.Buffer(t), "failed to add block to channel") +} + +func (s *L2Batcher) Buffer(t Testing) error { + if s.l2Submitting { // break ongoing submitting work if necessary + s.l2ChannelOut = nil + s.l2Submitting = false + } + syncStatus, err := s.syncStatusAPI.SyncStatus(t.Ctx()) + require.NoError(t, err, "no sync status error") + // If we just started, start at safe-head + if s.l2SubmittedBlock == (eth.L2BlockRef{}) { + s.log.Info("Starting batch-submitter work at safe-head", "safe", syncStatus.SafeL2) + s.l2SubmittedBlock = syncStatus.SafeL2 + s.l2BufferedBlock = syncStatus.SafeL2 + s.l2ChannelOut = nil + } + // If it's lagging behind, catch it up. + if s.l2SubmittedBlock.Number < syncStatus.SafeL2.Number { + s.log.Warn("last submitted block lagged behind L2 safe head: batch submission will continue from the safe head now", "last", s.l2SubmittedBlock, "safe", syncStatus.SafeL2) + s.l2SubmittedBlock = syncStatus.SafeL2 + s.l2BufferedBlock = syncStatus.SafeL2 + s.l2ChannelOut = nil + } + // Add the next unsafe block to the channel + if s.l2BufferedBlock.Number >= syncStatus.UnsafeL2.Number { + if s.l2BufferedBlock.Number > syncStatus.UnsafeL2.Number || s.l2BufferedBlock.Hash != syncStatus.UnsafeL2.Hash { + s.log.Error("detected a reorg in L2 chain vs previous buffered information, resetting to safe head now", "safe_head", syncStatus.SafeL2) + s.l2SubmittedBlock = syncStatus.SafeL2 + s.l2BufferedBlock = syncStatus.SafeL2 + s.l2ChannelOut = nil + } else { + s.log.Info("nothing left to submit") + return nil + } + } + block, err := s.l2.BlockByNumber(t.Ctx(), big.NewInt(int64(s.l2BufferedBlock.Number+1))) + require.NoError(t, err, "need l2 block %d from sync status", s.l2SubmittedBlock.Number+1) + if block.ParentHash() != s.l2BufferedBlock.Hash { + s.log.Error("detected a reorg in L2 chain vs previous submitted information, resetting to safe head now", "safe_head", syncStatus.SafeL2) + s.l2SubmittedBlock = syncStatus.SafeL2 + s.l2BufferedBlock = syncStatus.SafeL2 + s.l2ChannelOut = nil + } + // Create channel if we don't have one yet + if s.l2ChannelOut == nil { + var ch ChannelOutIface + if s.l2BatcherCfg.GarbageCfg != nil { + ch, err = NewGarbageChannelOut(s.l2BatcherCfg.GarbageCfg) + } else { + target := batcher.MaxDataSize(1, s.l2BatcherCfg.MaxL1TxSize) + c, e := compressor.NewShadowCompressor(compressor.Config{ + TargetOutputSize: target, + CompressionAlgo: derive.Zlib, + }) + require.NoError(t, e, "failed to create compressor") + + if s.l2BatcherCfg.ForceSubmitSingularBatch && s.l2BatcherCfg.ForceSubmitSpanBatch { + t.Fatalf("ForceSubmitSingularBatch and ForceSubmitSpanBatch cannot be set to true at the same time") + } else { + // use span batch if we're forcing it or if we're at/beyond delta + if s.l2BatcherCfg.ForceSubmitSpanBatch || s.rollupCfg.IsDelta(block.Time()) { + ch, err = derive.NewSpanChannelOut(s.rollupCfg.Genesis.L2Time, s.rollupCfg.L2ChainID, target, derive.Zlib) + // use singular batches in all other cases + } else { + ch, err = derive.NewSingularChannelOut(c) + } + } + } + require.NoError(t, err, "failed to create channel") + s.l2ChannelOut = ch + } + if err := s.l2ChannelOut.AddBlock(s.rollupCfg, block); err != nil { + return err + } + ref, err := s.engCl.L2BlockRefByHash(t.Ctx(), block.Hash()) + require.NoError(t, err, "failed to get L2BlockRef") + s.l2BufferedBlock = ref + return nil +} + +func (s *L2Batcher) ActL2ChannelClose(t Testing) { + // Don't run this action if there's no data to submit + if s.l2ChannelOut == nil { + t.InvalidAction("need to buffer data first, cannot batch submit with empty buffer") + return + } + require.NoError(t, s.l2ChannelOut.Close(), "must close channel before submitting it") +} + +// ActL2BatchSubmit constructs a batch tx from previous buffered L2 blocks, and submits it to L1 +func (s *L2Batcher) ActL2BatchSubmit(t Testing, txOpts ...func(tx *types.DynamicFeeTx)) { + // Don't run this action if there's no data to submit + if s.l2ChannelOut == nil { + t.InvalidAction("need to buffer data first, cannot batch submit with empty buffer") + return + } + // Collect the output frame + data := new(bytes.Buffer) + data.WriteByte(derive.DerivationVersion0) + // subtract one, to account for the version byte + if _, err := s.l2ChannelOut.OutputFrame(data, s.l2BatcherCfg.MaxL1TxSize-1); err == io.EOF { + s.l2ChannelOut = nil + s.l2Submitting = false + } else if err != nil { + s.l2Submitting = false + t.Fatalf("failed to output channel data to frame: %v", err) + } + + payload := data.Bytes() + if s.l2BatcherCfg.UsePlasma { + comm, err := s.l2BatcherCfg.PlasmaDA.SetInput(t.Ctx(), payload) + require.NoError(t, err, "failed to set input for plasma") + payload = comm.TxData() + } + + nonce, err := s.l1.PendingNonceAt(t.Ctx(), s.batcherAddr) + require.NoError(t, err, "need batcher nonce") + + gasTipCap := big.NewInt(2 * params.GWei) + pendingHeader, err := s.l1.HeaderByNumber(t.Ctx(), big.NewInt(-1)) + require.NoError(t, err, "need l1 pending header for gas price estimation") + gasFeeCap := new(big.Int).Add(gasTipCap, new(big.Int).Mul(pendingHeader.BaseFee, big.NewInt(2))) + + var txData types.TxData + if s.l2BatcherCfg.DataAvailabilityType == batcherFlags.CalldataType { + rawTx := &types.DynamicFeeTx{ + ChainID: s.rollupCfg.L1ChainID, + Nonce: nonce, + To: &s.rollupCfg.BatchInboxAddress, + GasTipCap: gasTipCap, + GasFeeCap: gasFeeCap, + Data: payload, + } + for _, opt := range txOpts { + opt(rawTx) + } + + gas, err := core.IntrinsicGas(rawTx.Data, nil, false, true, true, false) + require.NoError(t, err, "need to compute intrinsic gas") + rawTx.Gas = gas + txData = rawTx + } else if s.l2BatcherCfg.DataAvailabilityType == batcherFlags.BlobsType { + var b eth.Blob + require.NoError(t, b.FromData(payload), "must turn data into blob") + sidecar, blobHashes, err := txmgr.MakeSidecar([]*eth.Blob{&b}) + require.NoError(t, err) + require.NotNil(t, pendingHeader.ExcessBlobGas, "need L1 header with 4844 properties") + blobBaseFee := eip4844.CalcBlobFee(*pendingHeader.ExcessBlobGas) + blobFeeCap := new(uint256.Int).Mul(uint256.NewInt(2), uint256.MustFromBig(blobBaseFee)) + if blobFeeCap.Lt(uint256.NewInt(params.GWei)) { // ensure we meet 1 gwei geth tx-pool minimum + blobFeeCap = uint256.NewInt(params.GWei) + } + txData = &types.BlobTx{ + To: s.rollupCfg.BatchInboxAddress, + Data: nil, + Gas: params.TxGas, // intrinsic gas only + BlobHashes: blobHashes, + Sidecar: sidecar, + ChainID: uint256.MustFromBig(s.rollupCfg.L1ChainID), + GasTipCap: uint256.MustFromBig(gasTipCap), + GasFeeCap: uint256.MustFromBig(gasFeeCap), + BlobFeeCap: blobFeeCap, + Value: uint256.NewInt(0), + Nonce: nonce, + } + } else { + t.Fatalf("unrecognized DA type: %q", string(s.l2BatcherCfg.DataAvailabilityType)) + } + + tx, err := types.SignNewTx(s.l2BatcherCfg.BatcherKey, s.l1Signer, txData) + require.NoError(t, err, "need to sign tx") + + err = s.l1.SendTransaction(t.Ctx(), tx) + require.NoError(t, err, "need to send tx") + s.LastSubmitted = tx +} + +func (s *L2Batcher) ActL2BatchSubmitMultiBlob(t Testing, numBlobs int) { + if s.l2BatcherCfg.DataAvailabilityType != batcherFlags.BlobsType { + t.InvalidAction("ActL2BatchSubmitMultiBlob only available for Blobs DA type") + return + } else if numBlobs > 6 || numBlobs < 1 { + t.InvalidAction("invalid number of blobs %d, must be within [1,6]", numBlobs) + } + + // Don't run this action if there's no data to submit + if s.l2ChannelOut == nil { + t.InvalidAction("need to buffer data first, cannot batch submit with empty buffer") + return + } + + // Collect the output frames into blobs + blobs := make([]*eth.Blob, numBlobs) + for i := 0; i < numBlobs; i++ { + data := new(bytes.Buffer) + data.WriteByte(derive.DerivationVersion0) + // write only a few bytes to all but the last blob + l := uint64(derive.FrameV0OverHeadSize + 4) // 4 bytes content + if i == numBlobs-1 { + // write remaining channel to last frame + // subtract one, to account for the version byte + l = s.l2BatcherCfg.MaxL1TxSize - 1 + } + if _, err := s.l2ChannelOut.OutputFrame(data, l); err == io.EOF { + s.l2Submitting = false + if i < numBlobs-1 { + t.Fatalf("failed to fill up %d blobs, only filled %d", numBlobs, i+1) + } + s.l2ChannelOut = nil + } else if err != nil { + s.l2Submitting = false + t.Fatalf("failed to output channel data to frame: %v", err) + } + + blobs[i] = new(eth.Blob) + require.NoError(t, blobs[i].FromData(data.Bytes()), "must turn data into blob") + } + + nonce, err := s.l1.PendingNonceAt(t.Ctx(), s.batcherAddr) + require.NoError(t, err, "need batcher nonce") + + gasTipCap := big.NewInt(2 * params.GWei) + pendingHeader, err := s.l1.HeaderByNumber(t.Ctx(), big.NewInt(-1)) + require.NoError(t, err, "need l1 pending header for gas price estimation") + gasFeeCap := new(big.Int).Add(gasTipCap, new(big.Int).Mul(pendingHeader.BaseFee, big.NewInt(2))) + + sidecar, blobHashes, err := txmgr.MakeSidecar(blobs) + require.NoError(t, err) + require.NotNil(t, pendingHeader.ExcessBlobGas, "need L1 header with 4844 properties") + blobBaseFee := eip4844.CalcBlobFee(*pendingHeader.ExcessBlobGas) + blobFeeCap := new(uint256.Int).Mul(uint256.NewInt(2), uint256.MustFromBig(blobBaseFee)) + if blobFeeCap.Lt(uint256.NewInt(params.GWei)) { // ensure we meet 1 gwei geth tx-pool minimum + blobFeeCap = uint256.NewInt(params.GWei) + } + txData := &types.BlobTx{ + To: s.rollupCfg.BatchInboxAddress, + Data: nil, + Gas: params.TxGas, // intrinsic gas only + BlobHashes: blobHashes, + Sidecar: sidecar, + ChainID: uint256.MustFromBig(s.rollupCfg.L1ChainID), + GasTipCap: uint256.MustFromBig(gasTipCap), + GasFeeCap: uint256.MustFromBig(gasFeeCap), + BlobFeeCap: blobFeeCap, + Value: uint256.NewInt(0), + Nonce: nonce, + } + + tx, err := types.SignNewTx(s.l2BatcherCfg.BatcherKey, s.l1Signer, txData) + require.NoError(t, err, "need to sign tx") + + err = s.l1.SendTransaction(t.Ctx(), tx) + require.NoError(t, err, "need to send tx") + s.LastSubmitted = tx +} + +// ActL2BatchSubmitGarbage constructs a malformed channel frame and submits it to the +// batch inbox. This *should* cause the batch inbox to reject the blocks +// encoded within the frame, even if the blocks themselves are valid. +func (s *L2Batcher) ActL2BatchSubmitGarbage(t Testing, kind GarbageKind) { + // Don't run this action if there's no data to submit + if s.l2ChannelOut == nil { + t.InvalidAction("need to buffer data first, cannot batch submit with empty buffer") + return + } + + // Collect the output frame + data := new(bytes.Buffer) + data.WriteByte(derive.DerivationVersion0) + + // subtract one, to account for the version byte + if _, err := s.l2ChannelOut.OutputFrame(data, s.l2BatcherCfg.MaxL1TxSize-1); err == io.EOF { + s.l2ChannelOut = nil + s.l2Submitting = false + } else if err != nil { + s.l2Submitting = false + t.Fatalf("failed to output channel data to frame: %v", err) + } + + outputFrame := data.Bytes() + + // Malform the output frame + switch kind { + // Strip the derivation version byte from the output frame + case STRIP_VERSION: + outputFrame = outputFrame[1:] + // Replace the output frame with random bytes of length [1, 512] + case RANDOM: + i, err := rand.Int(rand.Reader, big.NewInt(512)) + require.NoError(t, err, "error generating random bytes length") + buf := make([]byte, i.Int64()+1) + _, err = rand.Read(buf) + require.NoError(t, err, "error generating random bytes") + outputFrame = buf + // Remove 4 bytes from the tail end of the output frame + case TRUNCATE_END: + outputFrame = outputFrame[:len(outputFrame)-4] + // Append 4 garbage bytes to the end of the output frame + case DIRTY_APPEND: + outputFrame = append(outputFrame, []byte{0xBA, 0xD0, 0xC0, 0xDE}...) + case INVALID_COMPRESSION: + // Do nothing post frame encoding- the `GarbageChannelOut` used for this case is modified to + // use gzip compression rather than zlib, which is invalid. + break + case MALFORM_RLP: + // Do nothing post frame encoding- the `GarbageChannelOut` used for this case is modified to + // write malformed RLP each time a block is added to the channel. + break + default: + t.Fatalf("Unexpected garbage kind: %v", kind) + } + + nonce, err := s.l1.PendingNonceAt(t.Ctx(), s.batcherAddr) + require.NoError(t, err, "need batcher nonce") + + gasTipCap := big.NewInt(2 * params.GWei) + pendingHeader, err := s.l1.HeaderByNumber(t.Ctx(), big.NewInt(-1)) + require.NoError(t, err, "need l1 pending header for gas price estimation") + gasFeeCap := new(big.Int).Add(gasTipCap, new(big.Int).Mul(pendingHeader.BaseFee, big.NewInt(2))) + + rawTx := &types.DynamicFeeTx{ + ChainID: s.rollupCfg.L1ChainID, + Nonce: nonce, + To: &s.rollupCfg.BatchInboxAddress, + GasTipCap: gasTipCap, + GasFeeCap: gasFeeCap, + Data: outputFrame, + } + gas, err := core.IntrinsicGas(rawTx.Data, nil, false, true, true, false) + require.NoError(t, err, "need to compute intrinsic gas") + rawTx.Gas = gas + + tx, err := types.SignNewTx(s.l2BatcherCfg.BatcherKey, s.l1Signer, rawTx) + require.NoError(t, err, "need to sign tx") + + err = s.l1.SendTransaction(t.Ctx(), tx) + require.NoError(t, err, "need to send tx") +} + +func (s *L2Batcher) ActBufferAll(t Testing) { + stat, err := s.syncStatusAPI.SyncStatus(t.Ctx()) + require.NoError(t, err) + for s.l2BufferedBlock.Number < stat.UnsafeL2.Number { + s.ActL2BatchBuffer(t) + } +} + +func (s *L2Batcher) ActSubmitAll(t Testing) { + s.ActBufferAll(t) + s.ActL2ChannelClose(t) + s.ActL2BatchSubmit(t) +} + +func (s *L2Batcher) ActSubmitAllMultiBlobs(t Testing, numBlobs int) { + s.ActBufferAll(t) + s.ActL2ChannelClose(t) + s.ActL2BatchSubmitMultiBlob(t, numBlobs) +} diff --git a/op-e2e2/actions/l2_batcher_test.go b/op-e2e2/actions/l2_batcher_test.go new file mode 100644 index 000000000000..387a3df9a45f --- /dev/null +++ b/op-e2e2/actions/l2_batcher_test.go @@ -0,0 +1,561 @@ +package actions + +import ( + "errors" + "math/big" + "math/rand" + "testing" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/params" + "github.com/stretchr/testify/require" + + batcherFlags "github.com/ethereum-optimism/optimism/op-batcher/flags" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils" + "github.com/ethereum-optimism/optimism/op-node/rollup/derive" + "github.com/ethereum-optimism/optimism/op-node/rollup/sync" + "github.com/ethereum-optimism/optimism/op-service/eth" + "github.com/ethereum-optimism/optimism/op-service/testlog" +) + +// TestL2BatcherBatchType run each batcher-related test case in singular batch mode and span batch mode. +func TestL2BatcherBatchType(t *testing.T) { + tests := []struct { + name string + f func(gt *testing.T, deltaTimeOffset *hexutil.Uint64) + }{ + {"NormalBatcher", NormalBatcher}, + {"L2Finalization", L2Finalization}, + {"L2FinalizationWithSparseL1", L2FinalizationWithSparseL1}, + {"GarbageBatch", GarbageBatch}, + {"ExtendedTimeWithoutL1Batches", ExtendedTimeWithoutL1Batches}, + {"BigL2Txs", BigL2Txs}, + } + for _, test := range tests { + test := test + t.Run(test.name+"_SingularBatch", func(t *testing.T) { + test.f(t, nil) + }) + } + + deltaTimeOffset := hexutil.Uint64(0) + for _, test := range tests { + test := test + t.Run(test.name+"_SpanBatch", func(t *testing.T) { + test.f(t, &deltaTimeOffset) + }) + } +} + +// applyDeltaTimeOffset adjusts fork configuration to not conflict with the delta overrides +func applyDeltaTimeOffset(dp *e2eutils.DeployParams, deltaTimeOffset *hexutil.Uint64) { + dp.DeployConfig.L2GenesisDeltaTimeOffset = deltaTimeOffset + // configure Ecotone to not be before Delta accidentally + if dp.DeployConfig.L2GenesisEcotoneTimeOffset != nil { + if deltaTimeOffset == nil { + dp.DeployConfig.L2GenesisEcotoneTimeOffset = nil + } else if *dp.DeployConfig.L2GenesisEcotoneTimeOffset < *deltaTimeOffset { + dp.DeployConfig.L2GenesisEcotoneTimeOffset = deltaTimeOffset + } + } + // configure Fjord to not be before Delta accidentally + if dp.DeployConfig.L2GenesisFjordTimeOffset != nil { + if deltaTimeOffset == nil { + dp.DeployConfig.L2GenesisFjordTimeOffset = nil + } else if *dp.DeployConfig.L2GenesisFjordTimeOffset < *deltaTimeOffset { + dp.DeployConfig.L2GenesisFjordTimeOffset = deltaTimeOffset + } + } +} + +func NormalBatcher(gt *testing.T, deltaTimeOffset *hexutil.Uint64) { + t := NewDefaultTesting(gt) + p := &e2eutils.TestParams{ + MaxSequencerDrift: 20, // larger than L1 block time we simulate in this test (12) + SequencerWindowSize: 24, + ChannelTimeout: 20, + L1BlockTime: 12, + } + dp := e2eutils.MakeDeployParams(t, p) + applyDeltaTimeOffset(dp, deltaTimeOffset) + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelDebug) + miner, seqEngine, sequencer := setupSequencerTest(t, sd, log) + verifEngine, verifier := setupVerifier(t, sd, log, miner.L1Client(t, sd.RollupCfg), miner.BlobStore(), &sync.Config{}) + + rollupSeqCl := sequencer.RollupClient() + batcher := NewL2Batcher(log, sd.RollupCfg, DefaultBatcherCfg(dp), + rollupSeqCl, miner.EthClient(), seqEngine.EthClient(), seqEngine.EngineClient(t, sd.RollupCfg)) + + // Alice makes a L2 tx + cl := seqEngine.EthClient() + n, err := cl.PendingNonceAt(t.Ctx(), dp.Addresses.Alice) + require.NoError(t, err) + signer := types.LatestSigner(sd.L2Cfg.Config) + tx := types.MustSignNewTx(dp.Secrets.Alice, signer, &types.DynamicFeeTx{ + ChainID: sd.L2Cfg.Config.ChainID, + Nonce: n, + GasTipCap: big.NewInt(2 * params.GWei), + GasFeeCap: new(big.Int).Add(miner.l1Chain.CurrentBlock().BaseFee, big.NewInt(2*params.GWei)), + Gas: params.TxGas, + To: &dp.Addresses.Bob, + Value: e2eutils.Ether(2), + }) + require.NoError(t, cl.SendTransaction(t.Ctx(), tx)) + + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + + // Make L2 block + sequencer.ActL2StartBlock(t) + seqEngine.ActL2IncludeTx(dp.Addresses.Alice)(t) + sequencer.ActL2EndBlock(t) + + // batch submit to L1 + batcher.ActL2BatchBuffer(t) + batcher.ActL2ChannelClose(t) + batcher.ActL2BatchSubmit(t) + + // confirm batch on L1 + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(dp.Addresses.Batcher)(t) + miner.ActL1EndBlock(t) + bl := miner.l1Chain.CurrentBlock() + log.Info("bl", "txs", len(miner.l1Chain.GetBlockByHash(bl.Hash()).Transactions())) + + // Now make enough L1 blocks that the verifier will have to derive a L2 block + // It will also eagerly derive the block from the batcher + for i := uint64(0); i < sd.RollupCfg.SeqWindowSize; i++ { + miner.ActL1StartBlock(12)(t) + miner.ActL1EndBlock(t) + } + + // sync verifier from L1 batch in otherwise empty sequence window + verifier.ActL1HeadSignal(t) + verifier.ActL2PipelineFull(t) + require.Equal(t, uint64(1), verifier.SyncStatus().SafeL2.L1Origin.Number) + + // check that the tx from alice made it into the L2 chain + verifCl := verifEngine.EthClient() + vTx, isPending, err := verifCl.TransactionByHash(t.Ctx(), tx.Hash()) + require.NoError(t, err) + require.False(t, isPending) + require.NotNil(t, vTx) +} + +func L2Finalization(gt *testing.T, deltaTimeOffset *hexutil.Uint64) { + t := NewDefaultTesting(gt) + dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) + applyDeltaTimeOffset(dp, deltaTimeOffset) + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelDebug) + miner, engine, sequencer := setupSequencerTest(t, sd, log) + + sequencer.ActL2PipelineFull(t) + + // build an empty L1 block (#1), mark it as justified + miner.ActEmptyBlock(t) + miner.ActL1SafeNext(t) // #0 -> #1 + + // sequencer builds L2 chain, up to and including a block that has the new L1 block as origin + sequencer.ActL1HeadSignal(t) + sequencer.ActBuildToL1Head(t) + + sequencer.ActL2PipelineFull(t) + sequencer.ActL1SafeSignal(t) + require.Equal(t, uint64(1), sequencer.SyncStatus().SafeL1.Number) + + // build another L1 block (#2), mark it as justified. And mark previous justified as finalized. + miner.ActEmptyBlock(t) + miner.ActL1SafeNext(t) // #1 -> #2 + miner.ActL1FinalizeNext(t) // #0 -> #1 + sequencer.ActL1HeadSignal(t) + sequencer.ActBuildToL1Head(t) + + // continue to build L2 chain referencing the new L1 blocks + sequencer.ActL2PipelineFull(t) + sequencer.ActL1FinalizedSignal(t) + sequencer.ActL1SafeSignal(t) + require.Equal(t, uint64(2), sequencer.SyncStatus().SafeL1.Number) + require.Equal(t, uint64(1), sequencer.SyncStatus().FinalizedL1.Number) + require.Equal(t, uint64(0), sequencer.SyncStatus().FinalizedL2.Number, "L2 block has to be included on L1 before it can be finalized") + + batcher := NewL2Batcher(log, sd.RollupCfg, DefaultBatcherCfg(dp), + sequencer.RollupClient(), miner.EthClient(), engine.EthClient(), engine.EngineClient(t, sd.RollupCfg)) + + heightToSubmit := sequencer.SyncStatus().UnsafeL2.Number + + batcher.ActSubmitAll(t) + // confirm batch on L1, block #3 + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(dp.Addresses.Batcher)(t) + miner.ActL1EndBlock(t) + + // read the batch + sequencer.ActL2PipelineFull(t) + require.Equal(t, uint64(0), sequencer.SyncStatus().FinalizedL2.Number, "Batch must be included in finalized part of L1 chain for L2 block to finalize") + + // build some more L2 blocks, so there is an unsafe part again that hasn't been submitted yet + sequencer.ActL1HeadSignal(t) + sequencer.ActBuildToL1Head(t) + + // submit those blocks too, block #4 + batcher.ActSubmitAll(t) + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(dp.Addresses.Batcher)(t) + miner.ActL1EndBlock(t) + + // add some more L1 blocks #5, #6 + miner.ActEmptyBlock(t) + miner.ActEmptyBlock(t) + + // and more unsafe L2 blocks + sequencer.ActL1HeadSignal(t) + sequencer.ActBuildToL1Head(t) + + // move safe/finalize markers: finalize the L1 chain block with the first batch, but not the second + miner.ActL1SafeNext(t) // #2 -> #3 + miner.ActL1SafeNext(t) // #3 -> #4 + miner.ActL1FinalizeNext(t) // #1 -> #2 + miner.ActL1FinalizeNext(t) // #2 -> #3 + + sequencer.ActL2PipelineFull(t) + sequencer.ActL1FinalizedSignal(t) + sequencer.ActL1SafeSignal(t) + sequencer.ActL1HeadSignal(t) + require.Equal(t, uint64(6), sequencer.SyncStatus().HeadL1.Number) + require.Equal(t, uint64(4), sequencer.SyncStatus().SafeL1.Number) + require.Equal(t, uint64(3), sequencer.SyncStatus().FinalizedL1.Number) + require.Equal(t, heightToSubmit, sequencer.SyncStatus().FinalizedL2.Number, "finalized L2 blocks in first batch") + + // need to act with the engine on the signals still + sequencer.ActL2PipelineFull(t) + + engCl := engine.EngineClient(t, sd.RollupCfg) + engBlock, err := engCl.L2BlockRefByLabel(t.Ctx(), eth.Finalized) + require.NoError(t, err) + require.Equal(t, heightToSubmit, engBlock.Number, "engine finalizes what rollup node finalizes") + + // Now try to finalize block 4, but with a bad/malicious alternative hash. + // If we get this false signal, we shouldn't finalize the L2 chain. + altBlock4 := sequencer.SyncStatus().SafeL1 + altBlock4.Hash = common.HexToHash("0xdead") + sequencer.derivation.Finalize(altBlock4) + sequencer.ActL2PipelineFull(t) + require.Equal(t, uint64(3), sequencer.SyncStatus().FinalizedL1.Number) + require.Equal(t, heightToSubmit, sequencer.SyncStatus().FinalizedL2.Number, "unknown/bad finalized L1 blocks are ignored") +} + +// L2FinalizationWithSparseL1 tests that safe L2 blocks can be finalized even if we do not regularly get a L1 finalization signal +func L2FinalizationWithSparseL1(gt *testing.T, deltaTimeOffset *hexutil.Uint64) { + t := NewDefaultTesting(gt) + dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) + applyDeltaTimeOffset(dp, deltaTimeOffset) + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelDebug) + miner, engine, sequencer := setupSequencerTest(t, sd, log) + + sequencer.ActL2PipelineFull(t) + + miner.ActEmptyBlock(t) + sequencer.ActL1HeadSignal(t) + sequencer.ActBuildToL1Head(t) + + startStatus := sequencer.SyncStatus() + require.Less(t, startStatus.SafeL2.Number, startStatus.UnsafeL2.Number, "sequencer has unsafe L2 block") + + batcher := NewL2Batcher(log, sd.RollupCfg, DefaultBatcherCfg(dp), + sequencer.RollupClient(), miner.EthClient(), engine.EthClient(), engine.EngineClient(t, sd.RollupCfg)) + batcher.ActSubmitAll(t) + + // include in L1 + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(dp.Addresses.Batcher)(t) + miner.ActL1EndBlock(t) + + // Make 2 L1 blocks without batches + miner.ActEmptyBlock(t) + miner.ActEmptyBlock(t) + + // See the L1 head, and traverse the pipeline to it + sequencer.ActL1HeadSignal(t) + sequencer.ActL2PipelineFull(t) + + updatedStatus := sequencer.SyncStatus() + require.Equal(t, updatedStatus.SafeL2.Number, updatedStatus.UnsafeL2.Number, "unsafe L2 block is now safe") + require.Less(t, updatedStatus.FinalizedL2.Number, updatedStatus.UnsafeL2.Number, "submitted block is not yet finalized") + + // Now skip straight to the head with L1 signals (sequencer has traversed the L1 blocks, but they did not have L2 contents) + headL1Num := miner.UnsafeNum() + miner.ActL1Safe(t, headL1Num) + miner.ActL1Finalize(t, headL1Num) + sequencer.ActL1SafeSignal(t) + sequencer.ActL1FinalizedSignal(t) + + // Now see if the signals can be processed + sequencer.ActL2PipelineFull(t) + + finalStatus := sequencer.SyncStatus() + // Verify the signal was processed, even though we signalled a later L1 block than the one with the batch. + require.Equal(t, finalStatus.FinalizedL2.Number, finalStatus.UnsafeL2.Number, "sequencer submitted its L2 block and it finalized") +} + +// GarbageBatch tests the behavior of an invalid/malformed output channel frame containing +// valid batches being submitted to the batch inbox. These batches should always be rejected +// and the safe L2 head should remain unaltered. +func GarbageBatch(gt *testing.T, deltaTimeOffset *hexutil.Uint64) { + t := NewDefaultTesting(gt) + p := defaultRollupTestParams + dp := e2eutils.MakeDeployParams(t, p) + applyDeltaTimeOffset(dp, deltaTimeOffset) + for _, garbageKind := range GarbageKinds { + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelError) + miner, engine, sequencer := setupSequencerTest(t, sd, log) + + _, verifier := setupVerifier(t, sd, log, miner.L1Client(t, sd.RollupCfg), miner.BlobStore(), &sync.Config{}) + + batcherCfg := DefaultBatcherCfg(dp) + + if garbageKind == MALFORM_RLP || garbageKind == INVALID_COMPRESSION { + // If the garbage kind is `INVALID_COMPRESSION` or `MALFORM_RLP`, use the `actions` packages + // modified `ChannelOut`. + batcherCfg.GarbageCfg = &GarbageChannelCfg{ + useInvalidCompression: garbageKind == INVALID_COMPRESSION, + malformRLP: garbageKind == MALFORM_RLP, + } + } + + batcher := NewL2Batcher(log, sd.RollupCfg, batcherCfg, sequencer.RollupClient(), miner.EthClient(), engine.EthClient(), engine.EngineClient(t, sd.RollupCfg)) + + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + + syncAndBuildL2 := func() { + // Send a head signal to the sequencer and verifier + sequencer.ActL1HeadSignal(t) + verifier.ActL1HeadSignal(t) + + // Run the derivation pipeline on the sequencer and verifier + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + + // Build the L2 chain to the L1 head + sequencer.ActBuildToL1Head(t) + } + + // Build an empty block on L1 and run the derivation pipeline + build L2 + // to the L1 head (block #1) + miner.ActEmptyBlock(t) + syncAndBuildL2() + + // Ensure that the L2 safe head has an L1 Origin at genesis before any + // batches are submitted. + require.Equal(t, uint64(0), sequencer.L2Safe().L1Origin.Number) + require.Equal(t, uint64(1), sequencer.L2Unsafe().L1Origin.Number) + + // Submit a batch containing all blocks built on L2 while catching up + // to the L1 head above. The output channel frame submitted to the batch + // inbox will be invalid- it will be malformed depending on the passed + // `garbageKind`. + batcher.ActBufferAll(t) + batcher.ActL2ChannelClose(t) + batcher.ActL2BatchSubmitGarbage(t, garbageKind) + + // Include the batch on L1 in block #2 + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(dp.Addresses.Batcher)(t) + miner.ActL1EndBlock(t) + + // Send a head signal + run the derivation pipeline on the sequencer + // and verifier. + syncAndBuildL2() + + // Verify that the L2 blocks that were batch submitted were *not* marked + // as safe due to the malformed output channel frame. The safe head should + // still have an L1 Origin at genesis. + require.Equal(t, uint64(0), sequencer.L2Safe().L1Origin.Number) + require.Equal(t, uint64(2), sequencer.L2Unsafe().L1Origin.Number) + } +} + +func ExtendedTimeWithoutL1Batches(gt *testing.T, deltaTimeOffset *hexutil.Uint64) { + t := NewDefaultTesting(gt) + p := &e2eutils.TestParams{ + MaxSequencerDrift: 20, // larger than L1 block time we simulate in this test (12) + SequencerWindowSize: 24, + ChannelTimeout: 20, + L1BlockTime: 12, + } + dp := e2eutils.MakeDeployParams(t, p) + applyDeltaTimeOffset(dp, deltaTimeOffset) + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelError) + miner, engine, sequencer := setupSequencerTest(t, sd, log) + + _, verifier := setupVerifier(t, sd, log, miner.L1Client(t, sd.RollupCfg), miner.BlobStore(), &sync.Config{}) + + batcher := NewL2Batcher(log, sd.RollupCfg, DefaultBatcherCfg(dp), + sequencer.RollupClient(), miner.EthClient(), engine.EthClient(), engine.EngineClient(t, sd.RollupCfg)) + + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + + // make a long L1 chain, up to just one block left for L2 blocks to be included. + for i := uint64(0); i < p.SequencerWindowSize-1; i++ { + miner.ActEmptyBlock(t) + } + + // Now build a L2 chain that references all of these L1 blocks + sequencer.ActL1HeadSignal(t) + sequencer.ActBuildToL1Head(t) + + // Now submit all the L2 blocks in the very last L1 block within sequencer window range + batcher.ActSubmitAll(t) + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(dp.Addresses.Batcher)(t) + miner.ActL1EndBlock(t) + + // Now sync the verifier, and see if the L2 chain of the sequencer is safe + verifier.ActL2PipelineFull(t) + require.Equal(t, sequencer.L2Unsafe(), verifier.L2Safe(), "all L2 blocks should have been included just in time") + sequencer.ActL2PipelineFull(t) + require.Equal(t, sequencer.L2Unsafe(), sequencer.L2Safe(), "same for sequencer") +} + +// BigL2Txs tests a high-throughput case with constrained batcher: +// - Fill 40 L2 blocks to near max-capacity, with txs of 120 KB each +// - Buffer the L2 blocks into channels together as much as possible, submit data-txs only when necessary +// (just before crossing the max RLP channel size) +// - Limit the data-tx size to 40 KB, to force data to be split across multiple datat-txs +// - Defer all data-tx inclusion till the end +// - Fill L1 blocks with data-txs until we have processed them all +// - Run the verifier, and check if it derives the same L2 chain as was created by the sequencer. +// +// The goal of this test is to quickly run through an otherwise very slow process of submitting and including lots of data. +// This does not test the batcher code, but is really focused at testing the batcher utils +// and channel-decoding verifier code in the derive package. +func BigL2Txs(gt *testing.T, deltaTimeOffset *hexutil.Uint64) { + t := NewDefaultTesting(gt) + p := &e2eutils.TestParams{ + MaxSequencerDrift: 100, + SequencerWindowSize: 1000, + ChannelTimeout: 200, // give enough space to buffer large amounts of data before submitting it + L1BlockTime: 12, + } + dp := e2eutils.MakeDeployParams(t, p) + applyDeltaTimeOffset(dp, deltaTimeOffset) + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelInfo) + miner, engine, sequencer := setupSequencerTest(t, sd, log) + + _, verifier := setupVerifier(t, sd, log, miner.L1Client(t, sd.RollupCfg), miner.BlobStore(), &sync.Config{}) + + batcher := NewL2Batcher(log, sd.RollupCfg, &BatcherCfg{ + MinL1TxSize: 0, + MaxL1TxSize: 40_000, // try a small batch size, to force the data to be split between more frames + BatcherKey: dp.Secrets.Batcher, + DataAvailabilityType: batcherFlags.CalldataType, + }, sequencer.RollupClient(), miner.EthClient(), engine.EthClient(), engine.EngineClient(t, sd.RollupCfg)) + + sequencer.ActL2PipelineFull(t) + + verifier.ActL2PipelineFull(t) + cl := engine.EthClient() + + batcherNonce := uint64(0) // manually track batcher nonce. the "pending nonce" value in tx-pool is incorrect after we fill the pending-block gas limit and keep adding txs to the pool. + batcherTxOpts := func(tx *types.DynamicFeeTx) { + tx.Nonce = batcherNonce + batcherNonce++ + tx.GasFeeCap = e2eutils.Ether(1) // be very generous with basefee, since we're spamming L1 + } + + rng := rand.New(rand.NewSource(555)) + + // build many L2 blocks filled to the brim with large txs of random data + for i := 0; i < 40; i++ { + aliceNonce, err := cl.PendingNonceAt(t.Ctx(), dp.Addresses.Alice) + status := sequencer.SyncStatus() + // build empty L1 blocks as necessary, so the L2 sequencer can continue to include txs while not drifting too far out + if status.UnsafeL2.Time >= status.HeadL1.Time+12 { + miner.ActEmptyBlock(t) + } + sequencer.ActL1HeadSignal(t) + sequencer.ActL2StartBlock(t) + baseFee := engine.l2Chain.CurrentBlock().BaseFee // this will go quite high, since so many consecutive blocks are filled at capacity. + // fill the block with large L2 txs from alice + for n := aliceNonce; ; n++ { + require.NoError(t, err) + signer := types.LatestSigner(sd.L2Cfg.Config) + data := make([]byte, 120_000) // very large L2 txs, as large as the tx-pool will accept + _, err := rng.Read(data[:]) // fill with random bytes, to make compression ineffective + require.NoError(t, err) + gas, err := core.IntrinsicGas(data, nil, false, true, true, false) + require.NoError(t, err) + if gas > engine.engineApi.RemainingBlockGas() { + break + } + tx := types.MustSignNewTx(dp.Secrets.Alice, signer, &types.DynamicFeeTx{ + ChainID: sd.L2Cfg.Config.ChainID, + Nonce: n, + GasTipCap: big.NewInt(2 * params.GWei), + GasFeeCap: new(big.Int).Add(new(big.Int).Mul(baseFee, big.NewInt(2)), big.NewInt(2*params.GWei)), + Gas: gas, + To: &dp.Addresses.Bob, + Value: big.NewInt(0), + Data: data, + }) + require.NoError(t, cl.SendTransaction(t.Ctx(), tx)) + engine.ActL2IncludeTx(dp.Addresses.Alice)(t) + } + sequencer.ActL2EndBlock(t) + for batcher.l2BufferedBlock.Number < sequencer.SyncStatus().UnsafeL2.Number { + // if we run out of space, close the channel and submit all the txs + if err := batcher.Buffer(t); errors.Is(err, derive.ErrTooManyRLPBytes) || errors.Is(err, derive.ErrCompressorFull) { + log.Info("flushing filled channel to batch txs", "id", batcher.l2ChannelOut.ID()) + batcher.ActL2ChannelClose(t) + for batcher.l2ChannelOut != nil { + batcher.ActL2BatchSubmit(t, batcherTxOpts) + } + } + } + } + + // if anything is left in the channel, submit it + if batcher.l2ChannelOut != nil { + log.Info("flushing trailing channel to batch txs", "id", batcher.l2ChannelOut.ID()) + batcher.ActL2ChannelClose(t) + for batcher.l2ChannelOut != nil { + batcher.ActL2BatchSubmit(t, batcherTxOpts) + } + } + + // build L1 blocks until we're out of txs + txs, _ := miner.eth.TxPool().ContentFrom(dp.Addresses.Batcher) + for { + if len(txs) == 0 { + break + } + miner.ActL1StartBlock(12)(t) + for range txs { + if len(txs) == 0 { + break + } + tx := txs[0] + if miner.l1GasPool.Gas() < tx.Gas() { // fill the L1 block with batcher txs until we run out of gas + break + } + log.Info("including batcher tx", "nonce", tx.Nonce()) + miner.IncludeTx(t, tx) + txs = txs[1:] + } + miner.ActL1EndBlock(t) + } + verifier.ActL1HeadSignal(t) + verifier.ActL2PipelineFull(t) + require.Equal(t, sequencer.SyncStatus().UnsafeL2, verifier.SyncStatus().SafeL2, "verifier synced sequencer data even though of huge tx in block") +} diff --git a/op-e2e2/actions/l2_engine.go b/op-e2e2/actions/l2_engine.go new file mode 100644 index 000000000000..e57762fd6d65 --- /dev/null +++ b/op-e2e2/actions/l2_engine.go @@ -0,0 +1,208 @@ +package actions + +import ( + "errors" + + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils" + "github.com/ethereum-optimism/optimism/op-program/client/l2/engineapi" + "github.com/stretchr/testify/require" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/types" + geth "github.com/ethereum/go-ethereum/eth" + "github.com/ethereum/go-ethereum/eth/ethconfig" + "github.com/ethereum/go-ethereum/eth/tracers" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/ethereum/go-ethereum/ethclient/gethclient" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/node" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/rpc" + + "github.com/ethereum-optimism/optimism/op-node/rollup" + "github.com/ethereum-optimism/optimism/op-service/client" + "github.com/ethereum-optimism/optimism/op-service/eth" + "github.com/ethereum-optimism/optimism/op-service/sources" + "github.com/ethereum-optimism/optimism/op-service/testutils" +) + +// L2Engine is an in-memory implementation of the Engine API, +// without support for snap-sync, and no concurrency or background processes. +type L2Engine struct { + log log.Logger + + node *node.Node + eth *geth.Ethereum + + rollupGenesis *rollup.Genesis + + // L2 evm / chain + l2Chain *core.BlockChain + l2Signer types.Signer + + engineApi *engineapi.L2EngineAPI + + failL2RPC error // mock error +} + +type EngineOption func(ethCfg *ethconfig.Config, nodeCfg *node.Config) error + +func NewL2Engine(t Testing, log log.Logger, genesis *core.Genesis, rollupGenesisL1 eth.BlockID, jwtPath string, options ...EngineOption) *L2Engine { + n, ethBackend, apiBackend := newBackend(t, genesis, jwtPath, options) + engineApi := engineapi.NewL2EngineAPI(log, apiBackend, ethBackend.Downloader()) + chain := ethBackend.BlockChain() + genesisBlock := chain.Genesis() + eng := &L2Engine{ + log: log, + node: n, + eth: ethBackend, + rollupGenesis: &rollup.Genesis{ + L1: rollupGenesisL1, + L2: eth.BlockID{Hash: genesisBlock.Hash(), Number: genesisBlock.NumberU64()}, + L2Time: genesis.Timestamp, + }, + l2Chain: chain, + l2Signer: types.LatestSigner(genesis.Config), + engineApi: engineApi, + } + // register the custom engine API, so we can serve engine requests while having more control + // over sequencing of individual txs. + n.RegisterAPIs([]rpc.API{ + { + Namespace: "engine", + Service: eng.engineApi, + Authenticated: true, + }, + }) + require.NoError(t, n.Start(), "failed to start L2 op-geth node") + + return eng +} + +func newBackend(t e2eutils.TestingBase, genesis *core.Genesis, jwtPath string, options []EngineOption) (*node.Node, *geth.Ethereum, *engineApiBackend) { + ethCfg := ðconfig.Config{ + NetworkId: genesis.Config.ChainID.Uint64(), + Genesis: genesis, + } + nodeCfg := &node.Config{ + Name: "l2-geth", + WSHost: "127.0.0.1", + WSPort: 0, + AuthAddr: "127.0.0.1", + AuthPort: 0, + WSModules: []string{"debug", "admin", "eth", "txpool", "net", "rpc", "web3", "personal"}, + HTTPModules: []string{"debug", "admin", "eth", "txpool", "net", "rpc", "web3", "personal"}, + JWTSecret: jwtPath, + } + for i, opt := range options { + require.NoError(t, opt(ethCfg, nodeCfg), "engine option %d failed", i) + } + n, err := node.New(nodeCfg) + require.NoError(t, err) + t.Cleanup(func() { + _ = n.Close() + }) + backend, err := geth.New(n, ethCfg) + require.NoError(t, err) + n.RegisterAPIs(tracers.APIs(backend.APIBackend)) + + chain := backend.BlockChain() + db := backend.ChainDb() + apiBackend := &engineApiBackend{ + BlockChain: chain, + db: db, + genesis: genesis, + } + return n, backend, apiBackend +} + +type engineApiBackend struct { + *core.BlockChain + db ethdb.Database + genesis *core.Genesis +} + +func (e *engineApiBackend) Database() ethdb.Database { + return e.db +} + +func (e *engineApiBackend) Genesis() *core.Genesis { + return e.genesis +} + +func (s *L2Engine) Enode() *enode.Node { + return s.node.Server().LocalNode().Node() +} + +func (s *L2Engine) AddPeers(peers ...*enode.Node) { + for _, en := range peers { + s.node.Server().AddPeer(en) + } +} + +func (s *L2Engine) PeerCount() int { + return s.node.Server().PeerCount() +} + +func (s *L2Engine) EthClient() *ethclient.Client { + cl := s.node.Attach() + return ethclient.NewClient(cl) +} + +func (s *L2Engine) GethClient() *gethclient.Client { + cl := s.node.Attach() + return gethclient.New(cl) +} + +func (e *L2Engine) RPCClient() client.RPC { + cl := e.node.Attach() + return testutils.RPCErrFaker{ + RPC: client.NewBaseRPCClient(cl), + ErrFn: func() error { + err := e.failL2RPC + e.failL2RPC = nil // reset back, only error once. + return err + }, + } +} + +func (e *L2Engine) EngineClient(t Testing, cfg *rollup.Config) *sources.EngineClient { + l2Cl, err := sources.NewEngineClient(e.RPCClient(), e.log, nil, sources.EngineClientDefaultConfig(cfg)) + require.NoError(t, err) + return l2Cl +} + +// ActL2RPCFail makes the next L2 RPC request fail with given error +func (e *L2Engine) ActL2RPCFail(t Testing, err error) { + if e.failL2RPC != nil { // already set to fail? + t.InvalidAction("already set a mock L2 rpc error") + return + } + e.failL2RPC = err +} + +// ActL2IncludeTx includes the next transaction from the given address in the block that is being built +func (e *L2Engine) ActL2IncludeTx(from common.Address) Action { + return func(t Testing) { + if e.engineApi.ForcedEmpty() { + e.log.Info("Skipping including a transaction because e.L2ForceEmpty is true") + return + } + + tx := firstValidTx(t, from, e.engineApi.PendingIndices, e.eth.TxPool().ContentFrom, e.EthClient().NonceAt) + err := e.engineApi.IncludeTx(tx, from) + if errors.Is(err, engineapi.ErrNotBuildingBlock) { + t.InvalidAction(err.Error()) + } else if errors.Is(err, engineapi.ErrUsesTooMuchGas) { + t.InvalidAction("included tx uses too much gas: %v", err) + } else if err != nil { + require.NoError(t, err, "include tx") + } + } +} + +func (e *L2Engine) Close() error { + return e.node.Close() +} diff --git a/op-e2e2/actions/l2_engine_test.go b/op-e2e2/actions/l2_engine_test.go new file mode 100644 index 000000000000..0624aeaa213a --- /dev/null +++ b/op-e2e2/actions/l2_engine_test.go @@ -0,0 +1,218 @@ +package actions + +import ( + "errors" + "math/big" + "testing" + + "github.com/ethereum-optimism/optimism/op-program/client/l2/engineapi" + "github.com/ethereum-optimism/optimism/op-program/client/l2/engineapi/test" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/consensus/beacon" + "github.com/ethereum/go-ethereum/consensus/ethash" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/triedb" + "github.com/ethereum/go-ethereum/triedb/hashdb" + "github.com/stretchr/testify/require" + + "github.com/ethereum/go-ethereum/log" + + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils" + "github.com/ethereum-optimism/optimism/op-service/eth" + "github.com/ethereum-optimism/optimism/op-service/sources" + "github.com/ethereum-optimism/optimism/op-service/testlog" +) + +func TestL2EngineAPI(gt *testing.T) { + t := NewDefaultTesting(gt) + jwtPath := e2eutils.WriteDefaultJWT(t) + dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelDebug) + genesisBlock := sd.L2Cfg.ToBlock() + consensus := beacon.New(ethash.NewFaker()) + db := rawdb.NewMemoryDatabase() + tdb := triedb.NewDatabase(db, &triedb.Config{HashDB: hashdb.Defaults}) + sd.L2Cfg.MustCommit(db, tdb) + + engine := NewL2Engine(t, log, sd.L2Cfg, sd.RollupCfg.Genesis.L1, jwtPath) + + l2Cl, err := sources.NewEngineClient(engine.RPCClient(), log, nil, sources.EngineClientDefaultConfig(sd.RollupCfg)) + require.NoError(t, err) + + // build an empty block + chainA, _ := core.GenerateChain(sd.L2Cfg.Config, genesisBlock, consensus, db, 1, func(i int, gen *core.BlockGen) { + gen.SetCoinbase(common.Address{'A'}) + }) + payloadA, err := eth.BlockAsPayload(chainA[0], sd.RollupCfg.CanyonTime) + require.NoError(t, err) + + // apply the payload + status, err := l2Cl.NewPayload(t.Ctx(), payloadA, nil) + require.NoError(t, err) + require.Equal(t, status.Status, eth.ExecutionValid) + require.Equal(t, genesisBlock.Hash(), engine.l2Chain.CurrentBlock().Hash(), "processed payloads are not immediately canonical") + + // recognize the payload as canonical + fcRes, err := l2Cl.ForkchoiceUpdate(t.Ctx(), ð.ForkchoiceState{ + HeadBlockHash: payloadA.BlockHash, + SafeBlockHash: genesisBlock.Hash(), + FinalizedBlockHash: genesisBlock.Hash(), + }, nil) + require.NoError(t, err) + require.Equal(t, fcRes.PayloadStatus.Status, eth.ExecutionValid) + require.Equal(t, payloadA.BlockHash, engine.l2Chain.CurrentBlock().Hash(), "now payload A is canonical") + + // build an alternative block + chainB, _ := core.GenerateChain(sd.L2Cfg.Config, genesisBlock, consensus, db, 1, func(i int, gen *core.BlockGen) { + gen.SetCoinbase(common.Address{'B'}) + }) + payloadB, err := eth.BlockAsPayload(chainB[0], sd.RollupCfg.CanyonTime) + require.NoError(t, err) + + // apply the payload + status, err = l2Cl.NewPayload(t.Ctx(), payloadB, nil) + require.NoError(t, err) + require.Equal(t, status.Status, eth.ExecutionValid) + require.Equal(t, payloadA.BlockHash, engine.l2Chain.CurrentBlock().Hash(), "processed payloads are not immediately canonical") + + // reorg block A in favor of block B + fcRes, err = l2Cl.ForkchoiceUpdate(t.Ctx(), ð.ForkchoiceState{ + HeadBlockHash: payloadB.BlockHash, + SafeBlockHash: genesisBlock.Hash(), + FinalizedBlockHash: genesisBlock.Hash(), + }, nil) + require.NoError(t, err) + require.Equal(t, fcRes.PayloadStatus.Status, eth.ExecutionValid) + require.Equal(t, payloadB.BlockHash, engine.l2Chain.CurrentBlock().Hash(), "now payload B is canonical") +} + +func TestL2EngineAPIBlockBuilding(gt *testing.T) { + t := NewDefaultTesting(gt) + jwtPath := e2eutils.WriteDefaultJWT(t) + dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelDebug) + genesisBlock := sd.L2Cfg.ToBlock() + db := rawdb.NewMemoryDatabase() + tdb := triedb.NewDatabase(db, &triedb.Config{HashDB: hashdb.Defaults}) + sd.L2Cfg.MustCommit(db, tdb) + + engine := NewL2Engine(t, log, sd.L2Cfg, sd.RollupCfg.Genesis.L1, jwtPath) + t.Cleanup(func() { + _ = engine.Close() + }) + + cl := engine.EthClient() + signer := types.LatestSigner(sd.L2Cfg.Config) + + // send a tx to the miner + tx := types.MustSignNewTx(dp.Secrets.Alice, signer, &types.DynamicFeeTx{ + ChainID: sd.L2Cfg.Config.ChainID, + Nonce: 0, + GasTipCap: big.NewInt(2 * params.GWei), + GasFeeCap: new(big.Int).Add(engine.l2Chain.CurrentBlock().BaseFee, big.NewInt(2*params.GWei)), + Gas: params.TxGas, + To: &dp.Addresses.Bob, + Value: e2eutils.Ether(2), + }) + require.NoError(gt, cl.SendTransaction(t.Ctx(), tx)) + + buildBlock := func(includeAlice bool) { + parent := engine.l2Chain.CurrentBlock() + l2Cl, err := sources.NewEngineClient(engine.RPCClient(), log, nil, sources.EngineClientDefaultConfig(sd.RollupCfg)) + require.NoError(t, err) + + nextBlockTime := eth.Uint64Quantity(parent.Time) + 2 + + var w *types.Withdrawals + if sd.RollupCfg.IsCanyon(uint64(nextBlockTime)) { + w = &types.Withdrawals{} + } + + // Now let's ask the engine to build a block + fcRes, err := l2Cl.ForkchoiceUpdate(t.Ctx(), ð.ForkchoiceState{ + HeadBlockHash: parent.Hash(), + SafeBlockHash: genesisBlock.Hash(), + FinalizedBlockHash: genesisBlock.Hash(), + }, ð.PayloadAttributes{ + Timestamp: nextBlockTime, + PrevRandao: eth.Bytes32{}, + SuggestedFeeRecipient: common.Address{'C'}, + Transactions: nil, + NoTxPool: false, + GasLimit: (*eth.Uint64Quantity)(&sd.RollupCfg.Genesis.SystemConfig.GasLimit), + Withdrawals: w, + }) + require.NoError(t, err) + require.Equal(t, fcRes.PayloadStatus.Status, eth.ExecutionValid) + require.NotNil(t, fcRes.PayloadID, "building a block now") + + if includeAlice { + engine.ActL2IncludeTx(dp.Addresses.Alice)(t) + } + + envelope, err := l2Cl.GetPayload(t.Ctx(), eth.PayloadInfo{ID: *fcRes.PayloadID, Timestamp: uint64(nextBlockTime)}) + payload := envelope.ExecutionPayload + require.NoError(t, err) + require.Equal(t, parent.Hash(), payload.ParentHash, "block builds on parent block") + + // apply the payload + status, err := l2Cl.NewPayload(t.Ctx(), payload, nil) + require.NoError(t, err) + require.Equal(t, status.Status, eth.ExecutionValid) + require.Equal(t, parent.Hash(), engine.l2Chain.CurrentBlock().Hash(), "processed payloads are not immediately canonical") + + // recognize the payload as canonical + fcRes, err = l2Cl.ForkchoiceUpdate(t.Ctx(), ð.ForkchoiceState{ + HeadBlockHash: payload.BlockHash, + SafeBlockHash: genesisBlock.Hash(), + FinalizedBlockHash: genesisBlock.Hash(), + }, nil) + require.NoError(t, err) + require.Equal(t, fcRes.PayloadStatus.Status, eth.ExecutionValid) + require.Equal(t, payload.BlockHash, engine.l2Chain.CurrentBlock().Hash(), "now payload is canonical") + } + buildBlock(false) + require.Zero(t, engine.l2Chain.GetBlockByHash(engine.l2Chain.CurrentBlock().Hash()).Transactions().Len(), "no tx included") + buildBlock(true) + require.Equal(gt, 1, engine.l2Chain.GetBlockByHash(engine.l2Chain.CurrentBlock().Hash()).Transactions().Len(), "tx from alice is included") + buildBlock(false) + require.Zero(t, engine.l2Chain.GetBlockByHash(engine.l2Chain.CurrentBlock().Hash()).Transactions().Len(), "no tx included") + require.Equal(t, uint64(3), engine.l2Chain.CurrentBlock().Number.Uint64(), "built 3 blocks") +} + +func TestL2EngineAPIFail(gt *testing.T) { + t := NewDefaultTesting(gt) + jwtPath := e2eutils.WriteDefaultJWT(t) + dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelDebug) + engine := NewL2Engine(t, log, sd.L2Cfg, sd.RollupCfg.Genesis.L1, jwtPath) + // mock an RPC failure + mockErr := errors.New("mock L2 RPC error") + engine.ActL2RPCFail(t, mockErr) + // check RPC failure + l2Cl, err := sources.NewL2Client(engine.RPCClient(), log, nil, sources.L2ClientDefaultConfig(sd.RollupCfg, false)) + require.NoError(t, err) + _, err = l2Cl.InfoByLabel(t.Ctx(), eth.Unsafe) + require.ErrorIs(t, err, mockErr) + head, err := l2Cl.InfoByLabel(t.Ctx(), eth.Unsafe) + require.NoError(t, err) + require.Equal(gt, sd.L2Cfg.ToBlock().Hash(), head.Hash(), "expecting engine to start at genesis") +} + +func TestEngineAPITests(t *testing.T) { + test.RunEngineAPITests(t, func(t *testing.T) engineapi.EngineBackend { + jwtPath := e2eutils.WriteDefaultJWT(t) + dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) + sd := e2eutils.Setup(t, dp, defaultAlloc) + n, _, apiBackend := newBackend(t, sd.L2Cfg, jwtPath, nil) + err := n.Start() + require.NoError(t, err) + return apiBackend + }) +} diff --git a/op-e2e2/actions/l2_proposer.go b/op-e2e2/actions/l2_proposer.go new file mode 100644 index 000000000000..6dc0b5aa56d2 --- /dev/null +++ b/op-e2e2/actions/l2_proposer.go @@ -0,0 +1,265 @@ +package actions + +import ( + "context" + "crypto/ecdsa" + "math/big" + "time" + + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/params" + "github.com/stretchr/testify/require" + + "github.com/ethereum-optimism/optimism/op-e2e2/bindings" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils" + "github.com/ethereum-optimism/optimism/op-proposer/metrics" + "github.com/ethereum-optimism/optimism/op-proposer/proposer" + "github.com/ethereum-optimism/optimism/op-service/dial" + "github.com/ethereum-optimism/optimism/op-service/eth" + "github.com/ethereum-optimism/optimism/op-service/sources" + "github.com/ethereum-optimism/optimism/op-service/txmgr" +) + +type ProposerCfg struct { + OutputOracleAddr *common.Address + DisputeGameFactoryAddr *common.Address + ProposalInterval time.Duration + DisputeGameType uint32 + ProposerKey *ecdsa.PrivateKey + AllowNonFinalized bool +} + +type L2Proposer struct { + log log.Logger + l1 *ethclient.Client + driver *proposer.L2OutputSubmitter + l2OutputOracle *bindings.L2OutputOracleCaller + l2OutputOracleAddr *common.Address + disputeGameFactory *bindings.DisputeGameFactoryCaller + disputeGameFactoryAddr *common.Address + address common.Address + privKey *ecdsa.PrivateKey + lastTx common.Hash +} + +type fakeTxMgr struct { + from common.Address +} + +func (f fakeTxMgr) From() common.Address { + return f.from +} + +func (f fakeTxMgr) BlockNumber(_ context.Context) (uint64, error) { + panic("unimplemented") +} + +func (f fakeTxMgr) Send(_ context.Context, _ txmgr.TxCandidate) (*types.Receipt, error) { + panic("unimplemented") +} + +func (f fakeTxMgr) Close() { +} + +func (f fakeTxMgr) IsClosed() bool { + return false +} + +func NewL2Proposer(t Testing, log log.Logger, cfg *ProposerCfg, l1 *ethclient.Client, rollupCl *sources.RollupClient) *L2Proposer { + proposerConfig := proposer.ProposerConfig{ + PollInterval: time.Second, + NetworkTimeout: time.Second, + ProposalInterval: cfg.ProposalInterval, + L2OutputOracleAddr: cfg.OutputOracleAddr, + DisputeGameFactoryAddr: cfg.DisputeGameFactoryAddr, + DisputeGameType: cfg.DisputeGameType, + AllowNonFinalized: cfg.AllowNonFinalized, + } + rollupProvider, err := dial.NewStaticL2RollupProviderFromExistingRollup(rollupCl) + require.NoError(t, err) + driverSetup := proposer.DriverSetup{ + Log: log, + Metr: metrics.NoopMetrics, + Cfg: proposerConfig, + Txmgr: fakeTxMgr{from: crypto.PubkeyToAddress(cfg.ProposerKey.PublicKey)}, + L1Client: l1, + RollupProvider: rollupProvider, + } + + dr, err := proposer.NewL2OutputSubmitter(driverSetup) + require.NoError(t, err) + + address := crypto.PubkeyToAddress(cfg.ProposerKey.PublicKey) + + var l2OutputOracle *bindings.L2OutputOracleCaller + var disputeGameFactory *bindings.DisputeGameFactoryCaller + if e2eutils.UseFPAC() { + disputeGameFactory, err = bindings.NewDisputeGameFactoryCaller(*cfg.DisputeGameFactoryAddr, l1) + require.NoError(t, err) + } else { + l2OutputOracle, err := bindings.NewL2OutputOracleCaller(*cfg.OutputOracleAddr, l1) + require.NoError(t, err) + proposer, err := l2OutputOracle.PROPOSER(&bind.CallOpts{}) + require.NoError(t, err) + require.Equal(t, proposer, address, "PROPOSER must be the proposer's address") + } + + return &L2Proposer{ + log: log, + l1: l1, + driver: dr, + l2OutputOracle: l2OutputOracle, + l2OutputOracleAddr: cfg.OutputOracleAddr, + disputeGameFactory: disputeGameFactory, + disputeGameFactoryAddr: cfg.DisputeGameFactoryAddr, + address: address, + privKey: cfg.ProposerKey, + } +} + +// sendTx reimplements creating & sending transactions because we need to do the final send as async in +// the action tests while we do it synchronously in the real system. +func (p *L2Proposer) sendTx(t Testing, data []byte) { + gasTipCap := big.NewInt(2 * params.GWei) + pendingHeader, err := p.l1.HeaderByNumber(t.Ctx(), big.NewInt(-1)) + require.NoError(t, err, "need l1 pending header for gas price estimation") + gasFeeCap := new(big.Int).Add(gasTipCap, new(big.Int).Mul(pendingHeader.BaseFee, big.NewInt(2))) + chainID, err := p.l1.ChainID(t.Ctx()) + require.NoError(t, err) + nonce, err := p.l1.NonceAt(t.Ctx(), p.address, nil) + require.NoError(t, err) + + var addr common.Address + if e2eutils.UseFPAC() { + addr = *p.disputeGameFactoryAddr + } else { + addr = *p.l2OutputOracleAddr + } + + gasLimit, err := estimateGasPending(t.Ctx(), p.l1, ethereum.CallMsg{ + From: p.address, + To: &addr, + GasFeeCap: gasFeeCap, + GasTipCap: gasTipCap, + Data: data, + }) + require.NoError(t, err) + + rawTx := &types.DynamicFeeTx{ + Nonce: nonce, + To: &addr, + Data: data, + GasFeeCap: gasFeeCap, + GasTipCap: gasTipCap, + Gas: gasLimit, + ChainID: chainID, + } + + tx, err := types.SignNewTx(p.privKey, types.LatestSignerForChainID(chainID), rawTx) + require.NoError(t, err, "need to sign tx") + + err = p.l1.SendTransaction(t.Ctx(), tx) + require.NoError(t, err, "need to send tx") + + p.lastTx = tx.Hash() +} + +// estimateGasPending calls eth_estimateGas specifying the pending block. This is required for transactions from the +// proposer because they include a reference to the latest block which isn't available via `BLOCKHASH` if `latest` is +// used. In production code, the proposer waits until another L1 block is published but in e2e tests no new L1 blocks +// will be created so pending must be used. +func estimateGasPending(ctx context.Context, ec *ethclient.Client, msg ethereum.CallMsg) (uint64, error) { + var hex hexutil.Uint64 + err := ec.Client().CallContext(ctx, &hex, "eth_estimateGas", toCallArg(msg), "pending") + if err != nil { + return 0, err + } + return uint64(hex), nil +} + +func toCallArg(msg ethereum.CallMsg) interface{} { + arg := map[string]interface{}{ + "from": msg.From, + "to": msg.To, + } + if len(msg.Data) > 0 { + arg["data"] = hexutil.Bytes(msg.Data) + } + if msg.Value != nil { + arg["value"] = (*hexutil.Big)(msg.Value) + } + if msg.Gas != 0 { + arg["gas"] = hexutil.Uint64(msg.Gas) + } + if msg.GasPrice != nil { + arg["gasPrice"] = (*hexutil.Big)(msg.GasPrice) + } + return arg +} + +func (p *L2Proposer) fetchNextOutput(t Testing) (*eth.OutputResponse, bool, error) { + if e2eutils.UseFPAC() { + blockNumber, err := p.driver.FetchCurrentBlockNumber(t.Ctx()) + if err != nil { + return nil, false, err + } + + output, _, err := p.driver.FetchOutput(t.Ctx(), blockNumber) + if err != nil { + return nil, false, err + } + + encodedBlockNumber := make([]byte, 32) + copy(encodedBlockNumber[32-len(blockNumber.Bytes()):], blockNumber.Bytes()) + game, err := p.disputeGameFactory.Games(&bind.CallOpts{}, p.driver.Cfg.DisputeGameType, output.OutputRoot, encodedBlockNumber) + if err != nil { + return nil, false, err + } + if game.Timestamp != 0 { + return nil, false, nil + } + + return output, true, nil + } else { + return p.driver.FetchNextOutputInfo(t.Ctx()) + } +} + +func (p *L2Proposer) CanPropose(t Testing) bool { + _, shouldPropose, err := p.fetchNextOutput(t) + require.NoError(t, err) + return shouldPropose +} + +func (p *L2Proposer) ActMakeProposalTx(t Testing) { + output, shouldPropose, err := p.fetchNextOutput(t) + require.NoError(t, err) + + if !shouldPropose { + return + } + + var txData []byte + if e2eutils.UseFPAC() { + txData, _, err = p.driver.ProposeL2OutputDGFTxData(output) + require.NoError(t, err) + } else { + txData, err = p.driver.ProposeL2OutputTxData(output) + require.NoError(t, err) + } + + // Note: Use L1 instead of the output submitter's transaction manager because + // this is non-blocking while the txmgr is blocking & deadlocks the tests + p.sendTx(t, txData) +} + +func (p *L2Proposer) LastProposalTx() common.Hash { + return p.lastTx +} diff --git a/op-e2e2/actions/l2_proposer_test.go b/op-e2e2/actions/l2_proposer_test.go new file mode 100644 index 000000000000..8be562368f40 --- /dev/null +++ b/op-e2e2/actions/l2_proposer_test.go @@ -0,0 +1,149 @@ +package actions + +import ( + "math/big" + "testing" + "time" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/log" + "github.com/stretchr/testify/require" + + "github.com/ethereum-optimism/optimism/op-e2e2/bindings" + "github.com/ethereum-optimism/optimism/op-e2e2/bindingspreview" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils" + "github.com/ethereum-optimism/optimism/op-service/eth" + "github.com/ethereum-optimism/optimism/op-service/testlog" +) + +// TestProposerBatchType run each proposer-related test case in singular batch mode and span batch mode. +func TestProposerBatchType(t *testing.T) { + tests := []struct { + name string + f func(gt *testing.T, deltaTimeOffset *hexutil.Uint64) + }{ + {"RunProposerTest", RunProposerTest}, + } + for _, test := range tests { + test := test + t.Run(test.name+"_SingularBatch", func(t *testing.T) { + test.f(t, nil) + }) + } + + deltaTimeOffset := hexutil.Uint64(0) + for _, test := range tests { + test := test + t.Run(test.name+"_SpanBatch", func(t *testing.T) { + test.f(t, &deltaTimeOffset) + }) + } +} + +func RunProposerTest(gt *testing.T, deltaTimeOffset *hexutil.Uint64) { + t := NewDefaultTesting(gt) + dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) + dp.DeployConfig.L2GenesisDeltaTimeOffset = deltaTimeOffset + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelDebug) + miner, seqEngine, sequencer := setupSequencerTest(t, sd, log) + + rollupSeqCl := sequencer.RollupClient() + batcher := NewL2Batcher(log, sd.RollupCfg, DefaultBatcherCfg(dp), + rollupSeqCl, miner.EthClient(), seqEngine.EthClient(), seqEngine.EngineClient(t, sd.RollupCfg)) + + var proposer *L2Proposer + if e2eutils.UseFPAC() { + proposer = NewL2Proposer(t, log, &ProposerCfg{ + DisputeGameFactoryAddr: &sd.DeploymentsL1.DisputeGameFactoryProxy, + ProposalInterval: 6 * time.Second, + DisputeGameType: 0, + ProposerKey: dp.Secrets.Proposer, + AllowNonFinalized: true, + }, miner.EthClient(), rollupSeqCl) + } else { + proposer = NewL2Proposer(t, log, &ProposerCfg{ + OutputOracleAddr: &sd.DeploymentsL1.L2OutputOracleProxy, + ProposerKey: dp.Secrets.Proposer, + AllowNonFinalized: false, + }, miner.EthClient(), rollupSeqCl) + } + + // L1 block + miner.ActEmptyBlock(t) + // L2 block + sequencer.ActL1HeadSignal(t) + sequencer.ActL2PipelineFull(t) + sequencer.ActBuildToL1Head(t) + // submit and include in L1 + batcher.ActSubmitAll(t) + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(dp.Addresses.Batcher)(t) + miner.ActL1EndBlock(t) + // finalize the first and second L1 blocks, including the batch + miner.ActL1SafeNext(t) + miner.ActL1SafeNext(t) + miner.ActL1FinalizeNext(t) + miner.ActL1FinalizeNext(t) + // derive and see the L2 chain fully finalize + sequencer.ActL2PipelineFull(t) + sequencer.ActL1SafeSignal(t) + sequencer.ActL1FinalizedSignal(t) + require.Equal(t, sequencer.SyncStatus().UnsafeL2, sequencer.SyncStatus().FinalizedL2) + require.True(t, proposer.CanPropose(t)) + + // make proposals until there is nothing left to propose + for proposer.CanPropose(t) { + proposer.ActMakeProposalTx(t) + // include proposal on L1 + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(dp.Addresses.Proposer)(t) + miner.ActL1EndBlock(t) + // Check proposal was successful + receipt, err := miner.EthClient().TransactionReceipt(t.Ctx(), proposer.LastProposalTx()) + require.NoError(t, err) + require.Equal(t, types.ReceiptStatusSuccessful, receipt.Status, "proposal failed") + } + + // check that L1 stored the expected output root + if e2eutils.UseFPAC() { + optimismPortal2Contract, err := bindingspreview.NewOptimismPortal2(sd.DeploymentsL1.OptimismPortalProxy, miner.EthClient()) + require.NoError(t, err) + respectedGameType, err := optimismPortal2Contract.RespectedGameType(&bind.CallOpts{}) + require.NoError(t, err) + disputeGameFactoryContract, err := bindings.NewDisputeGameFactory(sd.DeploymentsL1.DisputeGameFactoryProxy, miner.EthClient()) + require.NoError(t, err) + gameCount, err := disputeGameFactoryContract.GameCount(&bind.CallOpts{}) + require.NoError(t, err) + require.Greater(t, gameCount.Uint64(), uint64(0), "game count must be greater than 0") + latestGames, err := disputeGameFactoryContract.FindLatestGames(&bind.CallOpts{}, respectedGameType, new(big.Int).Sub(gameCount, common.Big1), common.Big1) + require.NoError(t, err) + require.Greater(t, len(latestGames), 0, "latest games must be greater than 0") + latestGame := latestGames[0] + gameBlockNumber := new(big.Int) + gameBlockNumber.SetBytes(latestGame.ExtraData[0:32]) + block, err := seqEngine.EthClient().BlockByNumber(t.Ctx(), gameBlockNumber) + require.NoError(t, err) + require.Less(t, block.Time(), latestGame.Timestamp, "output is registered with L1 timestamp of proposal tx, past L2 block") + outputComputed, err := sequencer.RollupClient().OutputAtBlock(t.Ctx(), gameBlockNumber.Uint64()) + require.NoError(t, err) + require.Equal(t, eth.Bytes32(latestGame.RootClaim), outputComputed.OutputRoot, "output roots must match") + } else { + outputOracleContract, err := bindings.NewL2OutputOracle(sd.DeploymentsL1.L2OutputOracleProxy, miner.EthClient()) + require.NoError(t, err) + blockNumber, err := outputOracleContract.LatestBlockNumber(&bind.CallOpts{}) + require.NoError(t, err) + require.Greater(t, int64(blockNumber.Uint64()), int64(0), "latest block number must be greater than 0") + block, err := seqEngine.EthClient().BlockByNumber(t.Ctx(), blockNumber) + require.NoError(t, err) + outputOnL1, err := outputOracleContract.GetL2OutputAfter(&bind.CallOpts{}, blockNumber) + require.NoError(t, err) + require.Less(t, block.Time(), outputOnL1.Timestamp.Uint64(), "output is registered with L1 timestamp of proposal tx, past L2 block") + outputComputed, err := sequencer.RollupClient().OutputAtBlock(t.Ctx(), blockNumber.Uint64()) + require.NoError(t, err) + require.Equal(t, eth.Bytes32(outputOnL1.OutputRoot), outputComputed.OutputRoot, "output roots must match") + } +} diff --git a/op-e2e2/actions/l2_sequencer.go b/op-e2e2/actions/l2_sequencer.go new file mode 100644 index 000000000000..dfd4c80c4062 --- /dev/null +++ b/op-e2e2/actions/l2_sequencer.go @@ -0,0 +1,184 @@ +package actions + +import ( + "context" + "errors" + + "github.com/ethereum-optimism/optimism/op-node/node/safedb" + "github.com/ethereum/go-ethereum/log" + "github.com/stretchr/testify/require" + + "github.com/ethereum-optimism/optimism/op-node/metrics" + "github.com/ethereum-optimism/optimism/op-node/rollup" + "github.com/ethereum-optimism/optimism/op-node/rollup/async" + "github.com/ethereum-optimism/optimism/op-node/rollup/conductor" + "github.com/ethereum-optimism/optimism/op-node/rollup/derive" + "github.com/ethereum-optimism/optimism/op-node/rollup/driver" + "github.com/ethereum-optimism/optimism/op-node/rollup/sync" + "github.com/ethereum-optimism/optimism/op-service/eth" +) + +// MockL1OriginSelector is a shim to override the origin as sequencer, so we can force it to stay on an older origin. +type MockL1OriginSelector struct { + actual *driver.L1OriginSelector + originOverride eth.L1BlockRef // override which origin gets picked +} + +func (m *MockL1OriginSelector) FindL1Origin(ctx context.Context, l2Head eth.L2BlockRef) (eth.L1BlockRef, error) { + if m.originOverride != (eth.L1BlockRef{}) { + return m.originOverride, nil + } + return m.actual.FindL1Origin(ctx, l2Head) +} + +// L2Sequencer is an actor that functions like a rollup node, +// without the full P2P/API/Node stack, but just the derivation state, and simplified driver with sequencing ability. +type L2Sequencer struct { + L2Verifier + + sequencer *driver.Sequencer + + failL2GossipUnsafeBlock error // mock error + + mockL1OriginSelector *MockL1OriginSelector +} + +func NewL2Sequencer(t Testing, log log.Logger, l1 derive.L1Fetcher, blobSrc derive.L1BlobsFetcher, + plasmaSrc derive.PlasmaInputFetcher, eng L2API, cfg *rollup.Config, seqConfDepth uint64) *L2Sequencer { + ver := NewL2Verifier(t, log, l1, blobSrc, plasmaSrc, eng, cfg, &sync.Config{}, safedb.Disabled) + attrBuilder := derive.NewFetchingAttributesBuilder(cfg, l1, eng) + seqConfDepthL1 := driver.NewConfDepth(seqConfDepth, ver.l1State.L1Head, l1) + l1OriginSelector := &MockL1OriginSelector{ + actual: driver.NewL1OriginSelector(log, cfg, seqConfDepthL1), + } + return &L2Sequencer{ + L2Verifier: *ver, + sequencer: driver.NewSequencer(log, cfg, ver.engine, attrBuilder, l1OriginSelector, metrics.NoopMetrics), + mockL1OriginSelector: l1OriginSelector, + failL2GossipUnsafeBlock: nil, + } +} + +// ActL2StartBlock starts building of a new L2 block on top of the head +func (s *L2Sequencer) ActL2StartBlock(t Testing) { + s.ActL2StartBlockCheckErr(t, nil) +} + +func (s *L2Sequencer) ActL2StartBlockCheckErr(t Testing, checkErr error) { + if !s.l2PipelineIdle { + t.InvalidAction("cannot start L2 build when derivation is not idle") + return + } + if s.l2Building { + t.InvalidAction("already started building L2 block") + return + } + + err := s.sequencer.StartBuildingBlock(t.Ctx()) + if checkErr == nil { + require.NoError(t, err, "failed to start block building") + } else { + require.ErrorIs(t, err, checkErr, "expected typed error") + } + + if errors.Is(err, derive.ErrReset) { + s.derivation.Reset() + } + + if err == nil { + s.l2Building = true + } +} + +// ActL2EndBlock completes a new L2 block and applies it to the L2 chain as new canonical unsafe head +func (s *L2Sequencer) ActL2EndBlock(t Testing) { + if !s.l2Building { + t.InvalidAction("cannot end L2 block building when no block is being built") + return + } + s.l2Building = false + + _, err := s.sequencer.CompleteBuildingBlock(t.Ctx(), async.NoOpGossiper{}, &conductor.NoOpConductor{}) + // TODO: there may be legitimate temporary errors here, if we mock engine API RPC-failure. + // For advanced tests we can catch those and print a warning instead. + require.NoError(t, err) + + // TODO: action-test publishing of payload on p2p +} + +// ActL2KeepL1Origin makes the sequencer use the current L1 origin, even if the next origin is available. +func (s *L2Sequencer) ActL2KeepL1Origin(t Testing) { + parent := s.engine.UnsafeL2Head() + // force old origin, for testing purposes + oldOrigin, err := s.l1.L1BlockRefByHash(t.Ctx(), parent.L1Origin.Hash) + require.NoError(t, err, "failed to get current origin: %s", parent.L1Origin) + s.mockL1OriginSelector.originOverride = oldOrigin +} + +// ActBuildToL1Head builds empty blocks until (incl.) the L1 head becomes the L2 origin +func (s *L2Sequencer) ActBuildToL1Head(t Testing) { + for s.engine.UnsafeL2Head().L1Origin.Number < s.l1State.L1Head().Number { + s.ActL2PipelineFull(t) + s.ActL2StartBlock(t) + s.ActL2EndBlock(t) + } +} + +// ActBuildToL1HeadUnsafe builds empty blocks until (incl.) the L1 head becomes the L1 origin of the L2 head +func (s *L2Sequencer) ActBuildToL1HeadUnsafe(t Testing) { + for s.engine.UnsafeL2Head().L1Origin.Number < s.l1State.L1Head().Number { + // Note: the derivation pipeline does not run, we are just sequencing a block on top of the existing L2 chain. + s.ActL2StartBlock(t) + s.ActL2EndBlock(t) + } +} + +// ActBuildToL1HeadExcl builds empty blocks until (excl.) the L1 head becomes the L1 origin of the L2 head +func (s *L2Sequencer) ActBuildToL1HeadExcl(t Testing) { + for { + s.ActL2PipelineFull(t) + nextOrigin, err := s.mockL1OriginSelector.FindL1Origin(t.Ctx(), s.engine.UnsafeL2Head()) + require.NoError(t, err) + if nextOrigin.Number >= s.l1State.L1Head().Number { + break + } + s.ActL2StartBlock(t) + s.ActL2EndBlock(t) + } +} + +// ActBuildToL1HeadExclUnsafe builds empty blocks until (excl.) the L1 head becomes the L1 origin of the L2 head, without safe-head progression. +func (s *L2Sequencer) ActBuildToL1HeadExclUnsafe(t Testing) { + for { + // Note: the derivation pipeline does not run, we are just sequencing a block on top of the existing L2 chain. + nextOrigin, err := s.mockL1OriginSelector.FindL1Origin(t.Ctx(), s.engine.UnsafeL2Head()) + require.NoError(t, err) + if nextOrigin.Number >= s.l1State.L1Head().Number { + break + } + s.ActL2StartBlock(t) + s.ActL2EndBlock(t) + } +} + +func (s *L2Sequencer) ActBuildL2ToTime(t Testing, target uint64) { + for s.L2Unsafe().Time < target { + s.ActL2StartBlock(t) + s.ActL2EndBlock(t) + } +} + +func (s *L2Sequencer) ActBuildL2ToEcotone(t Testing) { + require.NotNil(t, s.rollupCfg.EcotoneTime, "cannot activate Ecotone when it is not scheduled") + for s.L2Unsafe().Time < *s.rollupCfg.EcotoneTime { + s.ActL2StartBlock(t) + s.ActL2EndBlock(t) + } +} +func (s *L2Sequencer) ActBuildL2ToFjord(t Testing) { + require.NotNil(t, s.rollupCfg.FjordTime, "cannot activate FjordTime when it is not scheduled") + for s.L2Unsafe().Time < *s.rollupCfg.FjordTime { + s.ActL2StartBlock(t) + s.ActL2EndBlock(t) + } +} diff --git a/op-e2e2/actions/l2_sequencer_test.go b/op-e2e2/actions/l2_sequencer_test.go new file mode 100644 index 000000000000..86c50cc3a84c --- /dev/null +++ b/op-e2e2/actions/l2_sequencer_test.go @@ -0,0 +1,183 @@ +package actions + +import ( + "math/big" + "testing" + + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/eth/ethconfig" + "github.com/ethereum/go-ethereum/node" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/params" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/log" + "github.com/stretchr/testify/require" + + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils" + plasma "github.com/ethereum-optimism/optimism/op-plasma" + "github.com/ethereum-optimism/optimism/op-service/sources" + "github.com/ethereum-optimism/optimism/op-service/testlog" +) + +func EngineWithP2P() EngineOption { + return func(ethCfg *ethconfig.Config, nodeCfg *node.Config) error { + p2pKey, err := crypto.GenerateKey() + if err != nil { + return err + } + nodeCfg.P2P = p2p.Config{ + MaxPeers: 100, + NoDiscovery: true, + ListenAddr: "127.0.0.1:0", + PrivateKey: p2pKey, + } + return nil + } +} + +func setupSequencerTest(t Testing, sd *e2eutils.SetupData, log log.Logger) (*L1Miner, *L2Engine, *L2Sequencer) { + jwtPath := e2eutils.WriteDefaultJWT(t) + + miner := NewL1Miner(t, log, sd.L1Cfg) + + l1F, err := sources.NewL1Client(miner.RPCClient(), log, nil, sources.L1ClientDefaultConfig(sd.RollupCfg, false, sources.RPCKindStandard)) + require.NoError(t, err) + engine := NewL2Engine(t, log, sd.L2Cfg, sd.RollupCfg.Genesis.L1, jwtPath, EngineWithP2P()) + l2Cl, err := sources.NewEngineClient(engine.RPCClient(), log, nil, sources.EngineClientDefaultConfig(sd.RollupCfg)) + require.NoError(t, err) + + sequencer := NewL2Sequencer(t, log, l1F, miner.BlobStore(), plasma.Disabled, l2Cl, sd.RollupCfg, 0) + return miner, engine, sequencer +} + +func TestL2Sequencer_SequencerDrift(gt *testing.T) { + t := NewDefaultTesting(gt) + p := &e2eutils.TestParams{ + MaxSequencerDrift: 20, // larger than L1 block time we simulate in this test (12) + SequencerWindowSize: 24, + ChannelTimeout: 20, + L1BlockTime: 12, + } + dp := e2eutils.MakeDeployParams(t, p) + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelDebug) + miner, engine, sequencer := setupSequencerTest(t, sd, log) + miner.ActL1SetFeeRecipient(common.Address{'A'}) + + sequencer.ActL2PipelineFull(t) + + signer := types.LatestSigner(sd.L2Cfg.Config) + cl := engine.EthClient() + aliceTx := func() { + n, err := cl.PendingNonceAt(t.Ctx(), dp.Addresses.Alice) + require.NoError(t, err) + tx := types.MustSignNewTx(dp.Secrets.Alice, signer, &types.DynamicFeeTx{ + ChainID: sd.L2Cfg.Config.ChainID, + Nonce: n, + GasTipCap: big.NewInt(2 * params.GWei), + GasFeeCap: new(big.Int).Add(miner.l1Chain.CurrentBlock().BaseFee, big.NewInt(2*params.GWei)), + Gas: params.TxGas, + To: &dp.Addresses.Bob, + Value: e2eutils.Ether(2), + }) + require.NoError(gt, cl.SendTransaction(t.Ctx(), tx)) + } + makeL2BlockWithAliceTx := func() { + aliceTx() + sequencer.ActL2StartBlock(t) + engine.ActL2IncludeTx(dp.Addresses.Alice)(t) // include a test tx from alice + sequencer.ActL2EndBlock(t) + } + + // L1 makes a block + miner.ActL1StartBlock(12)(t) + miner.ActL1EndBlock(t) + sequencer.ActL1HeadSignal(t) + origin := miner.l1Chain.CurrentBlock() + + // L2 makes blocks to catch up + for sequencer.SyncStatus().UnsafeL2.Time+sd.RollupCfg.BlockTime < origin.Time { + makeL2BlockWithAliceTx() + require.Equal(t, uint64(0), sequencer.SyncStatus().UnsafeL2.L1Origin.Number, "no L1 origin change before time matches") + } + // Check that we adopted the origin as soon as we could (conf depth is 0) + makeL2BlockWithAliceTx() + require.Equal(t, uint64(1), sequencer.SyncStatus().UnsafeL2.L1Origin.Number, "L1 origin changes as soon as L2 time equals or exceeds L1 time") + + miner.ActL1StartBlock(12)(t) + miner.ActL1EndBlock(t) + sequencer.ActL1HeadSignal(t) + + // Make blocks up till the sequencer drift is about to surpass, but keep the old L1 origin + for sequencer.SyncStatus().UnsafeL2.Time+sd.RollupCfg.BlockTime <= origin.Time+sd.ChainSpec.MaxSequencerDrift(origin.Time) { + sequencer.ActL2KeepL1Origin(t) + makeL2BlockWithAliceTx() + require.Equal(t, uint64(1), sequencer.SyncStatus().UnsafeL2.L1Origin.Number, "expected to keep old L1 origin") + } + + // We passed the sequencer drift: we can still keep the old origin, but can't include any txs + sequencer.ActL2KeepL1Origin(t) + sequencer.ActL2StartBlock(t) + require.True(t, engine.engineApi.ForcedEmpty(), "engine should not be allowed to include anything after sequencer drift is surpassed") +} + +// TestL2Sequencer_SequencerOnlyReorg regression-tests a Goerli halt where the sequencer +// would build an unsafe L2 block with a L1 origin that then gets reorged out, +// while the verifier-codepath only ever sees the valid post-reorg L1 chain. +func TestL2Sequencer_SequencerOnlyReorg(gt *testing.T) { + t := NewDefaultTesting(gt) + dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelDebug) + miner, _, sequencer := setupSequencerTest(t, sd, log) + + // Sequencer at first only recognizes the genesis as safe. + // The rest of the L1 chain will be incorporated as L1 origins into unsafe L2 blocks. + sequencer.ActL2PipelineFull(t) + + // build L1 block with coinbase A + miner.ActL1SetFeeRecipient(common.Address{'A'}) + miner.ActEmptyBlock(t) + + // sequencer builds L2 blocks, until (incl.) it creates a L2 block with a L1 origin that has A as coinbase address + sequencer.ActL1HeadSignal(t) + sequencer.ActBuildToL1HeadUnsafe(t) + + status := sequencer.SyncStatus() + require.Zero(t, status.SafeL2.L1Origin.Number, "no safe head progress") + require.Equal(t, status.HeadL1.Hash, status.UnsafeL2.L1Origin.Hash, "have head L1 origin") + // reorg out block with coinbase A, and make a block with coinbase B + miner.ActL1RewindToParent(t) + miner.ActL1SetFeeRecipient(common.Address{'B'}) + miner.ActEmptyBlock(t) + + // and a second block, for derivation to pick up on the new L1 chain + // (height is used as heuristic to not flip-flop between chains too frequently) + miner.ActEmptyBlock(t) + + // Make the sequencer aware of the new head, and try to sync it. + // Since the safe chain never incorporated the now reorged L1 block with coinbase A, + // it will sync the new L1 chain fine. + // No batches are submitted yet however, + // so it'll keep the L2 block with the old L1 origin, since no conflict is detected. + sequencer.ActL1HeadSignal(t) + sequencer.ActL2PipelineFull(t) + // Verifier should detect the inconsistency of the L1 origin and reset the pipeline to follow the reorg + newStatus := sequencer.SyncStatus() + require.Zero(t, newStatus.UnsafeL2.L1Origin.Number, "back to genesis block with good L1 origin, drop old unsafe L2 chain with bad L1 origins") + require.NotEqual(t, status.HeadL1.Hash, newStatus.HeadL1.Hash, "did see the new L1 head change") + require.Equal(t, newStatus.HeadL1.Hash, newStatus.CurrentL1.Hash, "did sync the new L1 head as verifier") + + // the block N+1 cannot build on the old N which still refers to the now orphaned L1 origin + require.Equal(t, status.UnsafeL2.L1Origin.Number, newStatus.HeadL1.Number-1, "seeing N+1 to attempt to build on N") + require.NotEqual(t, status.UnsafeL2.L1Origin.Hash, newStatus.HeadL1.ParentHash, "but N+1 cannot fit on N") + + // After hitting a reset error, it resets derivation, and drops the old L1 chain + sequencer.ActL2PipelineFull(t) + + // Can build new L2 blocks with good L1 origin + sequencer.ActBuildToL1HeadUnsafe(t) + require.Equal(t, newStatus.HeadL1.Hash, sequencer.SyncStatus().UnsafeL2.L1Origin.Hash, "build L2 chain with new correct L1 origins") +} diff --git a/op-e2e2/actions/l2_verifier.go b/op-e2e2/actions/l2_verifier.go new file mode 100644 index 000000000000..305f161e8d06 --- /dev/null +++ b/op-e2e2/actions/l2_verifier.go @@ -0,0 +1,275 @@ +package actions + +import ( + "context" + "errors" + "io" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/log" + gnode "github.com/ethereum/go-ethereum/node" + "github.com/ethereum/go-ethereum/rpc" + "github.com/stretchr/testify/require" + + "github.com/ethereum-optimism/optimism/op-node/node" + "github.com/ethereum-optimism/optimism/op-node/rollup" + "github.com/ethereum-optimism/optimism/op-node/rollup/derive" + "github.com/ethereum-optimism/optimism/op-node/rollup/driver" + "github.com/ethereum-optimism/optimism/op-node/rollup/sync" + "github.com/ethereum-optimism/optimism/op-service/client" + "github.com/ethereum-optimism/optimism/op-service/eth" + "github.com/ethereum-optimism/optimism/op-service/sources" + "github.com/ethereum-optimism/optimism/op-service/testutils" +) + +// L2Verifier is an actor that functions like a rollup node, +// without the full P2P/API/Node stack, but just the derivation state, and simplified driver. +type L2Verifier struct { + log log.Logger + + eng interface { + derive.Engine + L2BlockRefByNumber(ctx context.Context, num uint64) (eth.L2BlockRef, error) + } + + // L2 rollup + engine *derive.EngineController + derivation *derive.DerivationPipeline + + l1 derive.L1Fetcher + l1State *driver.L1State + + l2PipelineIdle bool + l2Building bool + + rollupCfg *rollup.Config + + rpc *rpc.Server + + failRPC error // mock error +} + +type L2API interface { + derive.Engine + L2BlockRefByNumber(ctx context.Context, num uint64) (eth.L2BlockRef, error) + InfoByHash(ctx context.Context, hash common.Hash) (eth.BlockInfo, error) + // GetProof returns a proof of the account, it may return a nil result without error if the address was not found. + GetProof(ctx context.Context, address common.Address, storage []common.Hash, blockTag string) (*eth.AccountResult, error) + OutputV0AtBlock(ctx context.Context, blockHash common.Hash) (*eth.OutputV0, error) +} + +type safeDB interface { + derive.SafeHeadListener + node.SafeDBReader +} + +func NewL2Verifier(t Testing, log log.Logger, l1 derive.L1Fetcher, blobsSrc derive.L1BlobsFetcher, plasmaSrc derive.PlasmaInputFetcher, eng L2API, cfg *rollup.Config, syncCfg *sync.Config, safeHeadListener safeDB) *L2Verifier { + metrics := &testutils.TestDerivationMetrics{} + engine := derive.NewEngineController(eng, log, metrics, cfg, syncCfg.SyncMode) + pipeline := derive.NewDerivationPipeline(log, cfg, l1, blobsSrc, plasmaSrc, eng, engine, metrics, syncCfg, safeHeadListener) + pipeline.Reset() + + rollupNode := &L2Verifier{ + log: log, + eng: eng, + engine: engine, + derivation: pipeline, + l1: l1, + l1State: driver.NewL1State(log, metrics), + l2PipelineIdle: true, + l2Building: false, + rollupCfg: cfg, + rpc: rpc.NewServer(), + } + t.Cleanup(rollupNode.rpc.Stop) + + // setup RPC server for rollup node, hooked to the actor as backend + m := &testutils.TestRPCMetrics{} + backend := &l2VerifierBackend{verifier: rollupNode} + apis := []rpc.API{ + { + Namespace: "optimism", + Service: node.NewNodeAPI(cfg, eng, backend, safeHeadListener, log, m), + Public: true, + Authenticated: false, + }, + { + Namespace: "admin", + Version: "", + Service: node.NewAdminAPI(backend, m, log), + Public: true, // TODO: this field is deprecated. Do we even need this anymore? + Authenticated: false, + }, + } + require.NoError(t, gnode.RegisterApis(apis, nil, rollupNode.rpc), "failed to set up APIs") + return rollupNode +} + +type l2VerifierBackend struct { + verifier *L2Verifier +} + +func (s *l2VerifierBackend) BlockRefWithStatus(ctx context.Context, num uint64) (eth.L2BlockRef, *eth.SyncStatus, error) { + ref, err := s.verifier.eng.L2BlockRefByNumber(ctx, num) + return ref, s.verifier.SyncStatus(), err +} + +func (s *l2VerifierBackend) SyncStatus(ctx context.Context) (*eth.SyncStatus, error) { + return s.verifier.SyncStatus(), nil +} + +func (s *l2VerifierBackend) ResetDerivationPipeline(ctx context.Context) error { + s.verifier.derivation.Reset() + return nil +} + +func (s *l2VerifierBackend) StartSequencer(ctx context.Context, blockHash common.Hash) error { + return nil +} + +func (s *l2VerifierBackend) StopSequencer(ctx context.Context) (common.Hash, error) { + return common.Hash{}, errors.New("stopping the L2Verifier sequencer is not supported") +} + +func (s *l2VerifierBackend) SequencerActive(ctx context.Context) (bool, error) { + return false, nil +} + +func (s *l2VerifierBackend) OnUnsafeL2Payload(ctx context.Context, envelope *eth.ExecutionPayloadEnvelope) error { + return nil +} + +func (s *L2Verifier) L2Finalized() eth.L2BlockRef { + return s.engine.Finalized() +} + +func (s *L2Verifier) L2Safe() eth.L2BlockRef { + return s.engine.SafeL2Head() +} + +func (s *L2Verifier) L2PendingSafe() eth.L2BlockRef { + return s.engine.PendingSafeL2Head() +} + +func (s *L2Verifier) L2Unsafe() eth.L2BlockRef { + return s.engine.UnsafeL2Head() +} + +func (s *L2Verifier) L2BackupUnsafe() eth.L2BlockRef { + return s.engine.BackupUnsafeL2Head() +} + +func (s *L2Verifier) SyncStatus() *eth.SyncStatus { + return ð.SyncStatus{ + CurrentL1: s.derivation.Origin(), + CurrentL1Finalized: s.derivation.FinalizedL1(), + HeadL1: s.l1State.L1Head(), + SafeL1: s.l1State.L1Safe(), + FinalizedL1: s.l1State.L1Finalized(), + UnsafeL2: s.L2Unsafe(), + SafeL2: s.L2Safe(), + FinalizedL2: s.L2Finalized(), + PendingSafeL2: s.L2PendingSafe(), + } +} + +func (s *L2Verifier) RollupClient() *sources.RollupClient { + return sources.NewRollupClient(s.RPCClient()) +} + +func (s *L2Verifier) RPCClient() client.RPC { + cl := rpc.DialInProc(s.rpc) + return testutils.RPCErrFaker{ + RPC: client.NewBaseRPCClient(cl), + ErrFn: func() error { + err := s.failRPC + s.failRPC = nil // reset back, only error once. + return err + }, + } +} + +// ActRPCFail makes the next L2 RPC request fail +func (s *L2Verifier) ActRPCFail(t Testing) { + if s.failRPC != nil { // already set to fail? + t.InvalidAction("already set a mock rpc error") + return + } + s.failRPC = errors.New("mock RPC error") +} + +func (s *L2Verifier) ActL1HeadSignal(t Testing) { + head, err := s.l1.L1BlockRefByLabel(t.Ctx(), eth.Unsafe) + require.NoError(t, err) + s.l1State.HandleNewL1HeadBlock(head) +} + +func (s *L2Verifier) ActL1SafeSignal(t Testing) { + safe, err := s.l1.L1BlockRefByLabel(t.Ctx(), eth.Safe) + require.NoError(t, err) + s.l1State.HandleNewL1SafeBlock(safe) +} + +func (s *L2Verifier) ActL1FinalizedSignal(t Testing) { + finalized, err := s.l1.L1BlockRefByLabel(t.Ctx(), eth.Finalized) + require.NoError(t, err) + s.l1State.HandleNewL1FinalizedBlock(finalized) + s.derivation.Finalize(finalized) +} + +// ActL2PipelineStep runs one iteration of the L2 derivation pipeline +func (s *L2Verifier) ActL2PipelineStep(t Testing) { + if s.l2Building { + t.InvalidAction("cannot derive new data while building L2 block") + return + } + + s.l2PipelineIdle = false + err := s.derivation.Step(t.Ctx()) + if err == io.EOF || (err != nil && errors.Is(err, derive.EngineELSyncing)) { + s.l2PipelineIdle = true + return + } else if err != nil && errors.Is(err, derive.NotEnoughData) { + return + } else if err != nil && errors.Is(err, derive.ErrReset) { + s.log.Warn("Derivation pipeline is reset", "err", err) + s.derivation.Reset() + return + } else if err != nil && errors.Is(err, derive.ErrTemporary) { + s.log.Warn("Derivation process temporary error", "err", err) + if errors.Is(err, sync.WrongChainErr) { // action-tests don't back off on temporary errors. Avoid a bad genesis setup from looping. + t.Fatalf("genesis setup issue: %v", err) + } + return + } else if err != nil && errors.Is(err, derive.ErrCritical) { + t.Fatalf("derivation failed critically: %v", err) + } else if err != nil { + t.Fatalf("derivation failed: %v", err) + } else { + return + } +} + +func (s *L2Verifier) ActL2PipelineFull(t Testing) { + s.l2PipelineIdle = false + for !s.l2PipelineIdle { + s.ActL2PipelineStep(t) + } +} + +// ActL2UnsafeGossipReceive creates an action that can receive an unsafe execution payload, like gossipsub +func (s *L2Verifier) ActL2UnsafeGossipReceive(payload *eth.ExecutionPayloadEnvelope) Action { + return func(t Testing) { + s.derivation.AddUnsafePayload(payload) + } +} + +// ActL2InsertUnsafePayload creates an action that can insert an unsafe execution payload +func (s *L2Verifier) ActL2InsertUnsafePayload(payload *eth.ExecutionPayloadEnvelope) Action { + return func(t Testing) { + ref, err := derive.PayloadToBlockRef(s.rollupCfg, payload.ExecutionPayload) + require.NoError(t, err) + err = s.engine.InsertUnsafePayload(t.Ctx(), payload, ref) + require.NoError(t, err) + } +} diff --git a/op-e2e2/actions/l2_verifier_test.go b/op-e2e2/actions/l2_verifier_test.go new file mode 100644 index 000000000000..3f63f417edd8 --- /dev/null +++ b/op-e2e2/actions/l2_verifier_test.go @@ -0,0 +1,118 @@ +package actions + +import ( + "testing" + + "github.com/ethereum-optimism/optimism/op-node/node/safedb" + plasma "github.com/ethereum-optimism/optimism/op-plasma" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/log" + "github.com/stretchr/testify/require" + + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils" + "github.com/ethereum-optimism/optimism/op-node/rollup/derive" + "github.com/ethereum-optimism/optimism/op-node/rollup/sync" + "github.com/ethereum-optimism/optimism/op-service/testlog" +) + +type verifierCfg struct { + safeHeadListener safeDB +} + +type VerifierOpt func(opts *verifierCfg) + +func WithSafeHeadListener(l safeDB) VerifierOpt { + return func(opts *verifierCfg) { + opts.safeHeadListener = l + } +} + +func defaultVerifierCfg() *verifierCfg { + return &verifierCfg{ + safeHeadListener: safedb.Disabled, + } +} + +func setupVerifier(t Testing, sd *e2eutils.SetupData, log log.Logger, l1F derive.L1Fetcher, blobSrc derive.L1BlobsFetcher, syncCfg *sync.Config, opts ...VerifierOpt) (*L2Engine, *L2Verifier) { + cfg := defaultVerifierCfg() + for _, opt := range opts { + opt(cfg) + } + jwtPath := e2eutils.WriteDefaultJWT(t) + engine := NewL2Engine(t, log, sd.L2Cfg, sd.RollupCfg.Genesis.L1, jwtPath, EngineWithP2P()) + engCl := engine.EngineClient(t, sd.RollupCfg) + verifier := NewL2Verifier(t, log, l1F, blobSrc, plasma.Disabled, engCl, sd.RollupCfg, syncCfg, cfg.safeHeadListener) + return engine, verifier +} + +func setupVerifierOnlyTest(t Testing, sd *e2eutils.SetupData, log log.Logger) (*L1Miner, *L2Engine, *L2Verifier) { + miner := NewL1Miner(t, log, sd.L1Cfg) + l1Cl := miner.L1Client(t, sd.RollupCfg) + engine, verifier := setupVerifier(t, sd, log, l1Cl, miner.BlobStore(), &sync.Config{}) + return miner, engine, verifier +} + +func TestL2Verifier_SequenceWindow(gt *testing.T) { + t := NewDefaultTesting(gt) + p := &e2eutils.TestParams{ + MaxSequencerDrift: 10, + SequencerWindowSize: 24, + ChannelTimeout: 10, + L1BlockTime: 15, + } + dp := e2eutils.MakeDeployParams(t, p) + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelDebug) + miner, engine, verifier := setupVerifierOnlyTest(t, sd, log) + miner.ActL1SetFeeRecipient(common.Address{'A'}) + + // Make two sequence windows worth of empty L1 blocks. After we pass the first sequence window, the L2 chain should get blocks + for miner.l1Chain.CurrentBlock().Number.Uint64() < sd.RollupCfg.SeqWindowSize*2 { + miner.ActL1StartBlock(10)(t) + miner.ActL1EndBlock(t) + + verifier.ActL2PipelineFull(t) + + l1Head := miner.l1Chain.CurrentBlock().Number.Uint64() + expectedL1Origin := uint64(0) + // as soon as we complete the sequence window, we force-adopt the L1 origin + if l1Head >= sd.RollupCfg.SeqWindowSize { + expectedL1Origin = l1Head - sd.RollupCfg.SeqWindowSize + } + require.Equal(t, expectedL1Origin, verifier.SyncStatus().SafeL2.L1Origin.Number, "L1 origin is forced in, given enough L1 blocks pass by") + require.LessOrEqual(t, miner.l1Chain.GetBlockByNumber(expectedL1Origin).Time(), engine.l2Chain.CurrentBlock().Time, "L2 time higher than L1 origin time") + } + tip2N := verifier.SyncStatus() + + // Do a deep L1 reorg as deep as a sequence window, this should affect the safe L2 chain + miner.ActL1RewindDepth(sd.RollupCfg.SeqWindowSize)(t) + + // Without new L1 block, the L1 appears to not be synced, and the node shouldn't reorg + verifier.ActL2PipelineFull(t) + require.Equal(t, tip2N.SafeL2, verifier.SyncStatus().SafeL2, "still the same after verifier work") + + // Make a new empty L1 block with different data than there was before. + miner.ActL1SetFeeRecipient(common.Address{'B'}) + miner.ActL1StartBlock(10)(t) + miner.ActL1EndBlock(t) + reorgL1Block := miner.l1Chain.CurrentBlock() + + // Still no reorg, we need more L1 blocks first, before the reorged L1 block is forced in by sequence window + verifier.ActL2PipelineFull(t) + require.Equal(t, tip2N.SafeL2, verifier.SyncStatus().SafeL2) + + for miner.l1Chain.CurrentBlock().Number.Uint64() < sd.RollupCfg.SeqWindowSize*2 { + miner.ActL1StartBlock(10)(t) + miner.ActL1EndBlock(t) + } + + // workaround: in L1Traversal we only recognize the reorg once we see origin N+1, we don't reorg to shorter L1 chains + miner.ActL1StartBlock(10)(t) + miner.ActL1EndBlock(t) + + // Now it will reorg + verifier.ActL2PipelineFull(t) + + got := miner.l1Chain.GetBlockByHash(miner.l1Chain.GetBlockByHash(verifier.SyncStatus().SafeL2.L1Origin.Hash).Hash()) + require.Equal(t, reorgL1Block.Hash(), got.Hash(), "must have reorged L2 chain to the new L1 chain") +} diff --git a/op-e2e2/actions/plasma_test.go b/op-e2e2/actions/plasma_test.go new file mode 100644 index 000000000000..1111bc6528b7 --- /dev/null +++ b/op-e2e2/actions/plasma_test.go @@ -0,0 +1,624 @@ +package actions + +import ( + "math/big" + "math/rand" + "testing" + + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils" + "github.com/ethereum-optimism/optimism/op-node/node/safedb" + "github.com/ethereum-optimism/optimism/op-node/rollup/sync" + plasma "github.com/ethereum-optimism/optimism/op-plasma" + "github.com/ethereum-optimism/optimism/op-plasma/bindings" + "github.com/ethereum-optimism/optimism/op-service/sources" + "github.com/ethereum-optimism/optimism/op-service/testlog" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/log" + "github.com/stretchr/testify/require" +) + +// Devnet allocs should have plasma mode enabled for these tests to pass + +// L2PlasmaDA is a test harness for manipulating plasma DA state. +type L2PlasmaDA struct { + log log.Logger + storage *plasma.DAErrFaker + daMgr *plasma.DA + plasmaCfg plasma.Config + contract *bindings.DataAvailabilityChallenge + batcher *L2Batcher + sequencer *L2Sequencer + engine *L2Engine + engCl *sources.EngineClient + sd *e2eutils.SetupData + dp *e2eutils.DeployParams + miner *L1Miner + alice *CrossLayerUser + lastComm []byte + lastCommBn uint64 +} + +type PlasmaParam func(p *e2eutils.TestParams) + +func NewL2PlasmaDA(t Testing, params ...PlasmaParam) *L2PlasmaDA { + p := &e2eutils.TestParams{ + MaxSequencerDrift: 40, + SequencerWindowSize: 120, + ChannelTimeout: 120, + L1BlockTime: 12, + UsePlasma: true, + } + for _, apply := range params { + apply(p) + } + log := testlog.Logger(t, log.LvlDebug) + + dp := e2eutils.MakeDeployParams(t, p) + sd := e2eutils.Setup(t, dp, defaultAlloc) + + require.True(t, sd.RollupCfg.PlasmaEnabled()) + + miner := NewL1Miner(t, log, sd.L1Cfg) + l1Client := miner.EthClient() + + jwtPath := e2eutils.WriteDefaultJWT(t) + engine := NewL2Engine(t, log, sd.L2Cfg, sd.RollupCfg.Genesis.L1, jwtPath) + engCl := engine.EngineClient(t, sd.RollupCfg) + + storage := &plasma.DAErrFaker{Client: plasma.NewMockDAClient(log)} + + l1F, err := sources.NewL1Client(miner.RPCClient(), log, nil, sources.L1ClientDefaultConfig(sd.RollupCfg, false, sources.RPCKindBasic)) + require.NoError(t, err) + + plasmaCfg, err := sd.RollupCfg.GetOPPlasmaConfig() + require.NoError(t, err) + + daMgr := plasma.NewPlasmaDAWithStorage(log, plasmaCfg, storage, &plasma.NoopMetrics{}) + + sequencer := NewL2Sequencer(t, log, l1F, nil, daMgr, engCl, sd.RollupCfg, 0) + miner.ActL1SetFeeRecipient(common.Address{'A'}) + sequencer.ActL2PipelineFull(t) + + batcher := NewL2Batcher(log, sd.RollupCfg, PlasmaBatcherCfg(dp, storage), sequencer.RollupClient(), l1Client, engine.EthClient(), engCl) + + addresses := e2eutils.CollectAddresses(sd, dp) + cl := engine.EthClient() + l2UserEnv := &BasicUserEnv[*L2Bindings]{ + EthCl: cl, + Signer: types.LatestSigner(sd.L2Cfg.Config), + AddressCorpora: addresses, + Bindings: NewL2Bindings(t, cl, engine.GethClient()), + } + alice := NewCrossLayerUser(log, dp.Secrets.Alice, rand.New(rand.NewSource(0xa57b))) + alice.L2.SetUserEnv(l2UserEnv) + + contract, err := bindings.NewDataAvailabilityChallenge(sd.RollupCfg.PlasmaConfig.DAChallengeAddress, l1Client) + require.NoError(t, err) + + challengeWindow, err := contract.ChallengeWindow(nil) + require.NoError(t, err) + require.Equal(t, plasmaCfg.ChallengeWindow, challengeWindow.Uint64()) + + resolveWindow, err := contract.ResolveWindow(nil) + require.NoError(t, err) + require.Equal(t, plasmaCfg.ResolveWindow, resolveWindow.Uint64()) + + return &L2PlasmaDA{ + log: log, + storage: storage, + daMgr: daMgr, + plasmaCfg: plasmaCfg, + contract: contract, + batcher: batcher, + sequencer: sequencer, + engine: engine, + engCl: engCl, + sd: sd, + dp: dp, + miner: miner, + alice: alice, + } +} + +func (a *L2PlasmaDA) StorageClient() *plasma.DAErrFaker { + return a.storage +} + +func (a *L2PlasmaDA) NewVerifier(t Testing) *L2Verifier { + jwtPath := e2eutils.WriteDefaultJWT(t) + engine := NewL2Engine(t, a.log, a.sd.L2Cfg, a.sd.RollupCfg.Genesis.L1, jwtPath) + engCl := engine.EngineClient(t, a.sd.RollupCfg) + l1F, err := sources.NewL1Client(a.miner.RPCClient(), a.log, nil, sources.L1ClientDefaultConfig(a.sd.RollupCfg, false, sources.RPCKindBasic)) + require.NoError(t, err) + + daMgr := plasma.NewPlasmaDAWithStorage(a.log, a.plasmaCfg, a.storage, &plasma.NoopMetrics{}) + + verifier := NewL2Verifier(t, a.log, l1F, nil, daMgr, engCl, a.sd.RollupCfg, &sync.Config{}, safedb.Disabled) + + return verifier +} + +func (a *L2PlasmaDA) ActSequencerIncludeTx(t Testing) { + a.alice.L2.ActResetTxOpts(t) + a.alice.L2.ActSetTxToAddr(&a.dp.Addresses.Bob)(t) + a.alice.L2.ActMakeTx(t) + + a.sequencer.ActL2PipelineFull(t) + + a.sequencer.ActL2StartBlock(t) + a.engine.ActL2IncludeTx(a.alice.Address())(t) + a.sequencer.ActL2EndBlock(t) +} + +func (a *L2PlasmaDA) ActNewL2Tx(t Testing) { + a.ActSequencerIncludeTx(t) + + a.batcher.ActL2BatchBuffer(t) + a.batcher.ActL2ChannelClose(t) + a.batcher.ActL2BatchSubmit(t, func(tx *types.DynamicFeeTx) { + // skip txdata version byte + a.lastComm = tx.Data[1:] + }) + + a.miner.ActL1StartBlock(12)(t) + a.miner.ActL1IncludeTx(a.dp.Addresses.Batcher)(t) + a.miner.ActL1EndBlock(t) + + a.lastCommBn = a.miner.l1Chain.CurrentBlock().Number.Uint64() +} + +func (a *L2PlasmaDA) ActDeleteLastInput(t Testing) { + require.NoError(t, a.storage.Client.DeleteData(a.lastComm)) +} + +func (a *L2PlasmaDA) ActChallengeLastInput(t Testing) { + a.ActChallengeInput(t, a.lastComm, a.lastCommBn) + + a.log.Info("challenged last input", "block", a.lastCommBn) +} + +func (a *L2PlasmaDA) ActChallengeInput(t Testing, comm []byte, bn uint64) { + bondValue, err := a.contract.BondSize(&bind.CallOpts{}) + require.NoError(t, err) + + txOpts, err := bind.NewKeyedTransactorWithChainID(a.dp.Secrets.Alice, a.sd.L1Cfg.Config.ChainID) + require.NoError(t, err) + + txOpts.Value = bondValue + _, err = a.contract.Deposit(txOpts) + require.NoError(t, err) + + a.miner.ActL1StartBlock(12)(t) + a.miner.ActL1IncludeTx(a.alice.Address())(t) + a.miner.ActL1EndBlock(t) + + txOpts, err = bind.NewKeyedTransactorWithChainID(a.dp.Secrets.Alice, a.sd.L1Cfg.Config.ChainID) + require.NoError(t, err) + + _, err = a.contract.Challenge(txOpts, big.NewInt(int64(bn)), comm) + require.NoError(t, err) + + a.miner.ActL1StartBlock(12)(t) + a.miner.ActL1IncludeTx(a.alice.Address())(t) + a.miner.ActL1EndBlock(t) +} + +func (a *L2PlasmaDA) ActExpireLastInput(t Testing) { + reorgWindow := a.plasmaCfg.ResolveWindow + a.plasmaCfg.ChallengeWindow + for a.miner.l1Chain.CurrentBlock().Number.Uint64() <= a.lastCommBn+reorgWindow { + a.miner.ActL1StartBlock(12)(t) + a.miner.ActL1EndBlock(t) + } +} + +func (a *L2PlasmaDA) ActResolveInput(t Testing, comm []byte, input []byte, bn uint64) { + txOpts, err := bind.NewKeyedTransactorWithChainID(a.dp.Secrets.Alice, a.sd.L1Cfg.Config.ChainID) + require.NoError(t, err) + + _, err = a.contract.Resolve(txOpts, big.NewInt(int64(bn)), comm, input) + require.NoError(t, err) + + a.miner.ActL1StartBlock(12)(t) + a.miner.ActL1IncludeTx(a.alice.Address())(t) + a.miner.ActL1EndBlock(t) +} + +func (a *L2PlasmaDA) ActResolveLastChallenge(t Testing) { + // remove derivation byte prefix + input, err := a.storage.GetInput(t.Ctx(), plasma.Keccak256Commitment(a.lastComm[1:])) + require.NoError(t, err) + + a.ActResolveInput(t, a.lastComm, input, a.lastCommBn) +} + +func (a *L2PlasmaDA) ActL1Blocks(t Testing, n uint64) { + for i := uint64(0); i < n; i++ { + a.miner.ActL1StartBlock(12)(t) + a.miner.ActL1EndBlock(t) + } +} + +func (a *L2PlasmaDA) GetLastTxBlock(t Testing) *types.Block { + rcpt, err := a.engine.EthClient().TransactionReceipt(t.Ctx(), a.alice.L2.lastTxHash) + require.NoError(t, err) + blk, err := a.engine.EthClient().BlockByHash(t.Ctx(), rcpt.BlockHash) + require.NoError(t, err) + return blk +} + +func (a *L2PlasmaDA) ActL1Finalized(t Testing) { + latest := a.miner.l1Chain.CurrentBlock().Number.Uint64() + a.miner.ActL1Safe(t, latest) + a.miner.ActL1Finalize(t, latest) + a.sequencer.ActL1FinalizedSignal(t) +} + +// Commitment is challenged but never resolved, chain reorgs when challenge window expires. +func TestPlasma_ChallengeExpired(gt *testing.T) { + if !e2eutils.UsePlasma() { + gt.Skip("Plasma is not enabled") + } + + t := NewDefaultTesting(gt) + harness := NewL2PlasmaDA(t) + + // generate enough initial l1 blocks to have a finalized head. + harness.ActL1Blocks(t, 5) + + // Include a new l2 transaction, submitting an input commitment to the l1. + harness.ActNewL2Tx(t) + + // Challenge the input commitment on the l1 challenge contract. + harness.ActChallengeLastInput(t) + + blk := harness.GetLastTxBlock(t) + + // catch up the sequencer derivation pipeline with the new l1 blocks. + harness.sequencer.ActL2PipelineFull(t) + + // create enough l1 blocks to expire the resolve window. + harness.ActExpireLastInput(t) + + // catch up the sequencer derivation pipeline with the new l1 blocks. + harness.sequencer.ActL2PipelineFull(t) + + // the L1 finalized signal should trigger plasma to finalize the engine queue. + harness.ActL1Finalized(t) + + // move one more block for engine controller to update. + harness.ActL1Blocks(t, 1) + harness.sequencer.ActL2PipelineFull(t) + + // get new block with same number to compare + newBlk, err := harness.engine.EthClient().BlockByNumber(t.Ctx(), blk.Number()) + require.NoError(t, err) + + // reorg happened even though data was available + require.NotEqual(t, blk.Hash(), newBlk.Hash()) + + // now delete the data from the storage service so it is not available at all + // to the verifier derivation pipeline. + harness.ActDeleteLastInput(t) + + syncStatus := harness.sequencer.SyncStatus() + + // verifier is able to sync with expired missing data + verifier := harness.NewVerifier(t) + verifier.ActL2PipelineFull(t) + verifier.ActL1FinalizedSignal(t) + + verifSyncStatus := verifier.SyncStatus() + + require.Equal(t, syncStatus.FinalizedL2, verifSyncStatus.FinalizedL2) +} + +// Commitment is challenged after sequencer derived the chain but data disappears. A verifier +// derivation pipeline stalls until the challenge is resolved and then resumes with data from the contract. +func TestPlasma_ChallengeResolved(gt *testing.T) { + if !e2eutils.UsePlasma() { + gt.Skip("Plasma is not enabled") + } + + t := NewDefaultTesting(gt) + harness := NewL2PlasmaDA(t) + + // include a new l2 transaction, submitting an input commitment to the l1. + harness.ActNewL2Tx(t) + + // generate 3 l1 blocks. + harness.ActL1Blocks(t, 3) + + // challenge the input commitment for that l2 transaction on the l1 challenge contract. + harness.ActChallengeLastInput(t) + + // catch up sequencer derivation pipeline. + // this syncs the latest event within the AltDA manager. + harness.sequencer.ActL2PipelineFull(t) + + // resolve the challenge on the l1 challenge contract. + harness.ActResolveLastChallenge(t) + + // catch up the sequencer derivation pipeline with the new l1 blocks. + // this syncs the resolved status and input data within the AltDA manager. + harness.sequencer.ActL2PipelineFull(t) + + // finalize l1 + harness.ActL1Finalized(t) + + // delete the data from the storage service so it is not available at all + // to the verifier derivation pipeline. + harness.ActDeleteLastInput(t) + + syncStatus := harness.sequencer.SyncStatus() + + // new verifier is able to sync and resolve the input from calldata + verifier := harness.NewVerifier(t) + verifier.ActL2PipelineFull(t) + verifier.ActL1FinalizedSignal(t) + + verifSyncStatus := verifier.SyncStatus() + + require.Equal(t, syncStatus.SafeL2, verifSyncStatus.SafeL2) +} + +// DA storage service goes offline while sequencer keeps making blocks. When storage comes back online, it should be able to catch up. +func TestPlasma_StorageError(gt *testing.T) { + if !e2eutils.UsePlasma() { + gt.Skip("Plasma is not enabled") + } + + t := NewDefaultTesting(gt) + harness := NewL2PlasmaDA(t) + + // include a new l2 transaction, submitting an input commitment to the l1. + harness.ActNewL2Tx(t) + + txBlk := harness.GetLastTxBlock(t) + + // mock a storage client error when trying to get the pre-image. + // this simulates the storage service going offline for example. + harness.storage.ActGetPreImageFail() + + // try to derive the l2 chain from the submitted inputs commitments. + // the storage call will fail the first time then succeed. + harness.sequencer.ActL2PipelineFull(t) + + // sequencer derivation was able to sync to latest l1 origin + syncStatus := harness.sequencer.SyncStatus() + require.Equal(t, uint64(1), syncStatus.SafeL2.Number) + require.Equal(t, txBlk.Hash(), syncStatus.SafeL2.Hash) +} + +// L1 chain reorgs a resolved challenge so it expires instead causing +// the l2 chain to reorg as well. +func TestPlasma_ChallengeReorg(gt *testing.T) { + if !e2eutils.UsePlasma() { + gt.Skip("Plasma is not enabled") + } + + t := NewDefaultTesting(gt) + harness := NewL2PlasmaDA(t) + + // New L2 tx added to a batch and committed to L1 + harness.ActNewL2Tx(t) + + // add a buffer of L1 blocks + harness.ActL1Blocks(t, 3) + + // challenge the input commitment + harness.ActChallengeLastInput(t) + + // keep track of the block where the L2 tx was included + blk := harness.GetLastTxBlock(t) + + // progress derivation pipeline + harness.sequencer.ActL2PipelineFull(t) + + // resolve the challenge so pipeline can progress + harness.ActResolveLastChallenge(t) + + // derivation marks the challenge as resolve, chain is not impacted + harness.sequencer.ActL2PipelineFull(t) + + // Rewind the L1, essentially reorging the challenge resolution + harness.miner.ActL1RewindToParent(t) + + // Now the L1 chain advances without the challenge resolution + // so the challenge is expired. + harness.ActExpireLastInput(t) + + // derivation pipeline reorgs the commitment out of the chain + harness.sequencer.ActL2PipelineFull(t) + + newBlk, err := harness.engine.EthClient().BlockByNumber(t.Ctx(), blk.Number()) + require.NoError(t, err) + + // confirm the reorg did happen + require.NotEqual(t, blk.Hash(), newBlk.Hash()) +} + +// Sequencer stalls as data is not available, batcher keeps posting, untracked commitments are +// challenged and resolved, then sequencer resumes and catches up. +func TestPlasma_SequencerStalledMultiChallenges(gt *testing.T) { + if !e2eutils.UsePlasma() { + gt.Skip("Plasma is not enabled") + } + + t := NewDefaultTesting(gt) + a := NewL2PlasmaDA(t) + + // generate some initial L1 blocks. + a.ActL1Blocks(t, 5) + a.sequencer.ActL1HeadSignal(t) + + // create a new tx on l2 and commit it to l1 + a.ActNewL2Tx(t) + + // keep track of the related commitment + comm1 := a.lastComm + input1, err := a.storage.GetInput(t.Ctx(), plasma.Keccak256Commitment(comm1[1:])) + bn1 := a.lastCommBn + require.NoError(t, err) + + // delete it from the DA provider so the pipeline cannot verify it + a.ActDeleteLastInput(t) + + // build more empty l2 unsafe blocks as the l1 origin progresses + a.ActL1Blocks(t, 10) + a.sequencer.ActBuildToL1HeadUnsafe(t) + + // build another L2 block without advancing derivation + a.alice.L2.ActResetTxOpts(t) + a.alice.L2.ActSetTxToAddr(&a.dp.Addresses.Bob)(t) + a.alice.L2.ActMakeTx(t) + + a.sequencer.ActL2StartBlock(t) + a.engine.ActL2IncludeTx(a.alice.Address())(t) + a.sequencer.ActL2EndBlock(t) + + a.batcher.ActL2BatchBuffer(t) + a.batcher.ActL2ChannelClose(t) + a.batcher.ActL2BatchSubmit(t, func(tx *types.DynamicFeeTx) { + a.lastComm = tx.Data[1:] + }) + + // include it in L1 + a.miner.ActL1StartBlock(120)(t) + a.miner.ActL1IncludeTx(a.dp.Addresses.Batcher)(t) + a.miner.ActL1EndBlock(t) + + a.sequencer.ActL1HeadSignal(t) + + unsafe := a.sequencer.L2Unsafe() + unsafeBlk, err := a.engine.EthClient().BlockByHash(t.Ctx(), unsafe.Hash) + require.NoError(t, err) + + // advance the pipeline until it errors out as it is still stuck + // on deriving the first commitment + for i := 0; i < 3; i++ { + a.sequencer.ActL2PipelineStep(t) + } + + // keep track of the second commitment + comm2 := a.lastComm + _, err = a.storage.GetInput(t.Ctx(), plasma.Keccak256Commitment(comm2[1:])) + require.NoError(t, err) + a.lastCommBn = a.miner.l1Chain.CurrentBlock().Number.Uint64() + + // ensure the second commitment is distinct from the first + require.NotEqual(t, comm1, comm2) + + // challenge the last commitment while the pipeline is stuck on the first + a.ActChallengeLastInput(t) + + // resolve the latest commitment before the first one is event challenged. + a.ActResolveLastChallenge(t) + + // now we delete it to force the pipeline to resolve the second commitment + // from the challenge data. + a.ActDeleteLastInput(t) + + // finally challenge the first commitment + a.ActChallengeInput(t, comm1, bn1) + + // resolve it immediately so we can resume derivation + a.ActResolveInput(t, comm1, input1, bn1) + + // pipeline can go on + a.sequencer.ActL2PipelineFull(t) + + // verify that the chain did not reorg out + safeBlk, err := a.engine.EthClient().BlockByNumber(t.Ctx(), unsafeBlk.Number()) + require.NoError(t, err) + require.Equal(t, unsafeBlk.Hash(), safeBlk.Hash()) +} + +// Verify that finalization happens based on plasma DA windows. +// based on l2_batcher_test.go L2Finalization +func TestPlasma_Finalization(gt *testing.T) { + if !e2eutils.UsePlasma() { + gt.Skip("Plasma is not enabled") + } + t := NewDefaultTesting(gt) + a := NewL2PlasmaDA(t) + + // build L1 block #1 + a.ActL1Blocks(t, 1) + a.miner.ActL1SafeNext(t) + + // Fill with l2 blocks up to the L1 head + a.sequencer.ActL1HeadSignal(t) + a.sequencer.ActBuildToL1Head(t) + + a.sequencer.ActL2PipelineFull(t) + a.sequencer.ActL1SafeSignal(t) + require.Equal(t, uint64(1), a.sequencer.SyncStatus().SafeL1.Number) + + // add L1 block #2 + a.ActL1Blocks(t, 1) + a.miner.ActL1SafeNext(t) + a.miner.ActL1FinalizeNext(t) + a.sequencer.ActL1HeadSignal(t) + a.sequencer.ActBuildToL1Head(t) + + // Catch up derivation + a.sequencer.ActL2PipelineFull(t) + a.sequencer.ActL1FinalizedSignal(t) + a.sequencer.ActL1SafeSignal(t) + + // commit all the l2 blocks to L1 + a.batcher.ActSubmitAll(t) + a.miner.ActL1StartBlock(12)(t) + a.miner.ActL1IncludeTx(a.dp.Addresses.Batcher)(t) + a.miner.ActL1EndBlock(t) + + // verify + a.sequencer.ActL2PipelineFull(t) + + // fill with more unsafe L2 blocks + a.sequencer.ActL1HeadSignal(t) + a.sequencer.ActBuildToL1Head(t) + + // submit those blocks too, block #4 + a.batcher.ActSubmitAll(t) + a.miner.ActL1StartBlock(12)(t) + a.miner.ActL1IncludeTx(a.dp.Addresses.Batcher)(t) + a.miner.ActL1EndBlock(t) + + // add some more L1 blocks #5, #6 + a.miner.ActEmptyBlock(t) + a.miner.ActEmptyBlock(t) + + // and more unsafe L2 blocks + a.sequencer.ActL1HeadSignal(t) + a.sequencer.ActBuildToL1Head(t) + + // move safe/finalize markers: finalize the L1 chain block with the first batch, but not the second + a.miner.ActL1SafeNext(t) // #2 -> #3 + a.miner.ActL1SafeNext(t) // #3 -> #4 + a.miner.ActL1FinalizeNext(t) // #1 -> #2 + a.miner.ActL1FinalizeNext(t) // #2 -> #3 + + // L1 safe and finalized as expected + a.sequencer.ActL2PipelineFull(t) + a.sequencer.ActL1FinalizedSignal(t) + a.sequencer.ActL1SafeSignal(t) + a.sequencer.ActL1HeadSignal(t) + require.Equal(t, uint64(6), a.sequencer.SyncStatus().HeadL1.Number) + require.Equal(t, uint64(4), a.sequencer.SyncStatus().SafeL1.Number) + require.Equal(t, uint64(3), a.sequencer.SyncStatus().FinalizedL1.Number) + // l2 cannot finalize yet as the challenge window is not passed + require.Equal(t, uint64(0), a.sequencer.SyncStatus().FinalizedL2.Number) + + // expire the challenge window so these blocks can no longer be challenged + a.ActL1Blocks(t, a.plasmaCfg.ChallengeWindow) + + // advance derivation and finalize plasma via the L1 signal + a.sequencer.ActL2PipelineFull(t) + a.ActL1Finalized(t) + + // given 12s l1 time and 1s l2 time, l2 should be 12 * 3 = 36 blocks finalized + require.Equal(t, uint64(36), a.sequencer.SyncStatus().FinalizedL2.Number) +} diff --git a/op-e2e2/actions/reorg_test.go b/op-e2e2/actions/reorg_test.go new file mode 100644 index 000000000000..99055de6a44d --- /dev/null +++ b/op-e2e2/actions/reorg_test.go @@ -0,0 +1,903 @@ +package actions + +import ( + "math/big" + "math/rand" + "path" + "testing" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/eth/ethconfig" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/node" + "github.com/stretchr/testify/require" + + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils" + "github.com/ethereum-optimism/optimism/op-node/rollup/sync" + plasma "github.com/ethereum-optimism/optimism/op-plasma" + "github.com/ethereum-optimism/optimism/op-service/client" + "github.com/ethereum-optimism/optimism/op-service/eth" + "github.com/ethereum-optimism/optimism/op-service/sources" + "github.com/ethereum-optimism/optimism/op-service/testlog" +) + +func setupReorgTest(t Testing, config *e2eutils.TestParams, deltaTimeOffset *hexutil.Uint64) (*e2eutils.SetupData, *e2eutils.DeployParams, *L1Miner, *L2Sequencer, *L2Engine, *L2Verifier, *L2Engine, *L2Batcher) { + dp := e2eutils.MakeDeployParams(t, config) + dp.DeployConfig.L2GenesisDeltaTimeOffset = deltaTimeOffset + + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelDebug) + + return setupReorgTestActors(t, dp, sd, log) +} + +func setupReorgTestActors(t Testing, dp *e2eutils.DeployParams, sd *e2eutils.SetupData, log log.Logger) (*e2eutils.SetupData, *e2eutils.DeployParams, *L1Miner, *L2Sequencer, *L2Engine, *L2Verifier, *L2Engine, *L2Batcher) { + miner, seqEngine, sequencer := setupSequencerTest(t, sd, log) + miner.ActL1SetFeeRecipient(common.Address{'A'}) + sequencer.ActL2PipelineFull(t) + verifEngine, verifier := setupVerifier(t, sd, log, miner.L1Client(t, sd.RollupCfg), miner.BlobStore(), &sync.Config{}) + rollupSeqCl := sequencer.RollupClient() + batcher := NewL2Batcher(log, sd.RollupCfg, DefaultBatcherCfg(dp), + rollupSeqCl, miner.EthClient(), seqEngine.EthClient(), seqEngine.EngineClient(t, sd.RollupCfg)) + return sd, dp, miner, sequencer, seqEngine, verifier, verifEngine, batcher +} + +// TestReorgBatchType run each reorg-related test case in singular batch mode and span batch mode. +func TestReorgBatchType(t *testing.T) { + tests := []struct { + name string + f func(gt *testing.T, deltaTimeOffset *hexutil.Uint64) + }{ + {"ReorgOrphanBlock", ReorgOrphanBlock}, + {"ReorgFlipFlop", ReorgFlipFlop}, + {"DeepReorg", DeepReorg}, + {"RestartOpGeth", RestartOpGeth}, + {"ConflictingL2Blocks", ConflictingL2Blocks}, + {"SyncAfterReorg", SyncAfterReorg}, + } + for _, test := range tests { + test := test + t.Run(test.name+"_SingularBatch", func(t *testing.T) { + test.f(t, nil) + }) + } + + deltaTimeOffset := hexutil.Uint64(0) + for _, test := range tests { + test := test + t.Run(test.name+"_SpanBatch", func(t *testing.T) { + test.f(t, &deltaTimeOffset) + }) + } +} + +func ReorgOrphanBlock(gt *testing.T, deltaTimeOffset *hexutil.Uint64) { + t := NewDefaultTesting(gt) + sd, _, miner, sequencer, _, verifier, verifierEng, batcher := setupReorgTest(t, defaultRollupTestParams, deltaTimeOffset) + verifEngClient := verifierEng.EngineClient(t, sd.RollupCfg) + + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + + // build empty L1 block + miner.ActEmptyBlock(t) + + // Create L2 blocks, and reference the L1 head as origin + sequencer.ActL1HeadSignal(t) + sequencer.ActBuildToL1Head(t) + + // submit all new L2 blocks + batcher.ActSubmitAll(t) + + // new L1 block with L2 batch + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(sd.RollupCfg.Genesis.SystemConfig.BatcherAddr)(t) + batchTx := miner.l1Transactions[0] + miner.ActL1EndBlock(t) + + // verifier picks up the L2 chain that was submitted + verifier.ActL1HeadSignal(t) + verifier.ActL2PipelineFull(t) + require.Equal(t, verifier.L2Safe(), sequencer.L2Unsafe(), "verifier syncs from sequencer via L1") + require.NotEqual(t, sequencer.L2Safe(), sequencer.L2Unsafe(), "sequencer has not processed L1 yet") + + // orphan the L1 block that included the batch tx, and build a new different L1 block + miner.ActL1RewindToParent(t) + miner.ActL1SetFeeRecipient(common.Address{'B'}) + miner.ActEmptyBlock(t) + miner.ActEmptyBlock(t) // needs to be a longer chain for reorg to be applied. TODO: maybe more aggressively react to reorgs to shorter chains? + + // sync verifier again. The L1 reorg excluded the batch, so now the previous L2 chain should be unsafe again. + // However, the L2 chain can still be canonical later, since it did not reference the reorged L1 block + verifier.ActL1HeadSignal(t) + verifier.ActL2PipelineFull(t) + require.Equal(t, verifier.L2Safe(), sequencer.L2Safe(), "verifier rewinds safe when L1 reorgs out batch") + ref, err := verifEngClient.L2BlockRefByLabel(t.Ctx(), eth.Safe) + require.NoError(t, err) + require.Equal(t, verifier.L2Safe(), ref, "verifier engine matches rollup client") + + // Now replay the batch tx in a new L1 block + miner.ActL1StartBlock(12)(t) + miner.ActL1SetFeeRecipient(common.Address{'C'}) + // note: the geth tx pool reorgLoop is too slow (responds to chain head events, but async), + // and there's no way to manually trigger runReorg, so we re-insert it ourselves. + require.NoError(t, miner.eth.TxPool().Add([]*types.Transaction{batchTx}, true, true)[0]) + // need to re-insert previously included tx into the block + miner.ActL1IncludeTx(sd.RollupCfg.Genesis.SystemConfig.BatcherAddr)(t) + miner.ActL1EndBlock(t) + + // sync the verifier again: now it should be safe again + verifier.ActL1HeadSignal(t) + verifier.ActL2PipelineFull(t) + require.Equal(t, verifier.L2Safe(), sequencer.L2Unsafe(), "verifier syncs from sequencer via replayed batch on L1") + ref, err = verifEngClient.L2BlockRefByLabel(t.Ctx(), eth.Safe) + require.NoError(t, err) + require.Equal(t, verifier.L2Safe(), ref, "verifier engine matches rollup client") + + sequencer.ActL1HeadSignal(t) + sequencer.ActL2PipelineFull(t) + require.Equal(t, verifier.L2Safe(), sequencer.L2Safe(), "verifier and sequencer see same safe L2 block, while only verifier dealt with the orphan and replay") +} + +func ReorgFlipFlop(gt *testing.T, deltaTimeOffset *hexutil.Uint64) { + t := NewDefaultTesting(gt) + sd, _, miner, sequencer, _, verifier, verifierEng, batcher := setupReorgTest(t, defaultRollupTestParams, deltaTimeOffset) + minerCl := miner.L1Client(t, sd.RollupCfg) + verifEngClient := verifierEng.EngineClient(t, sd.RollupCfg) + checkVerifEngine := func() { + // TODO: geth preserves L2 chain with origin A1 after flip-flopping to B? + //ref, err := verifEngClient.L2BlockRefByLabel(t.Ctx(), eth.Unsafe) + //require.NoError(t, err) + //t.Logf("l2 unsafe head %s with origin %s", ref, ref.L1Origin) + //require.NotEqual(t, verifier.L2Unsafe().Hash, ref.ParentHash, "TODO off by one, engine syncs A0 after reorging back from B, while rollup node only inserts up to A0 (excl.)") + //require.Equal(t, verifier.L2Unsafe(), ref, "verifier safe head of engine matches rollup client") + + ref, err := verifEngClient.L2BlockRefByLabel(t.Ctx(), eth.Safe) + require.NoError(t, err) + require.Equal(t, verifier.L2Safe(), ref, "verifier safe head of engine matches rollup client") + } + + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + + // Start building chain A + miner.ActL1SetFeeRecipient(common.Address{'A', 0}) + miner.ActEmptyBlock(t) + blockA0, err := minerCl.L1BlockRefByLabel(t.Ctx(), eth.Unsafe) + require.NoError(t, err) + + // Create L2 blocks, and reference the L1 head A0 as origin + sequencer.ActL1HeadSignal(t) + sequencer.ActBuildToL1Head(t) + + // submit all new L2 blocks + batcher.ActSubmitAll(t) + + // new L1 block A1 with L2 batch + miner.ActL1SetFeeRecipient(common.Address{'A', 1}) + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(sd.RollupCfg.Genesis.SystemConfig.BatcherAddr)(t) + batchTxA := miner.l1Transactions[0] + miner.ActL1EndBlock(t) + + // verifier picks up the L2 chain that was submitted + verifier.ActL1HeadSignal(t) + verifier.ActL2PipelineFull(t) + require.Equal(t, verifier.L2Safe().L1Origin, blockA0.ID(), "verifier syncs L2 chain with L1 A0 origin") + checkVerifEngine() + + // Flip to chain B! + miner.ActL1RewindToParent(t) // undo A1 + miner.ActL1RewindToParent(t) // undo A0 + // build B0 + miner.ActL1SetFeeRecipient(common.Address{'B', 0}) + miner.ActEmptyBlock(t) + blockB0, err := minerCl.L1BlockRefByLabel(t.Ctx(), eth.Unsafe) + require.NoError(t, err) + require.Equal(t, blockA0.Number, blockB0.Number, "same height") + require.NotEqual(t, blockA0.Hash, blockB0.Hash, "different content") + + // re-include the batch tx that submitted L2 chain data that pointed to A0, in the new block B1 + miner.ActL1SetFeeRecipient(common.Address{'B', 1}) + miner.ActL1StartBlock(12)(t) + require.NoError(t, miner.eth.TxPool().Add([]*types.Transaction{batchTxA}, true, true)[0]) + miner.ActL1IncludeTx(sd.RollupCfg.Genesis.SystemConfig.BatcherAddr)(t) + miner.ActL1EndBlock(t) + + // make B2, the reorg is picked up when we have a new longer chain + miner.ActL1SetFeeRecipient(common.Address{'B', 2}) + miner.ActEmptyBlock(t) + blockB2, err := minerCl.L1BlockRefByLabel(t.Ctx(), eth.Unsafe) + require.NoError(t, err) + + // now sync the verifier: some of the batches should be ignored: + // The safe head should have a genesis L1 origin, but past genesis, as some L2 blocks were built to get to A0 time + verifier.ActL1HeadSignal(t) + verifier.ActL2PipelineFull(t) + require.Equal(t, sd.RollupCfg.Genesis.L1, verifier.L2Safe().L1Origin, "expected to be back at genesis origin after losing A0 and A1") + + if sd.RollupCfg.DeltaTime == nil { + // before delta hard fork + require.NotZero(t, verifier.L2Safe().Number, "still preserving old L2 blocks that did not reference reorged L1 chain (assuming more than one L2 block per L1 block)") + require.Equal(t, verifier.L2Safe(), verifier.L2Unsafe(), "head is at safe block after L1 reorg") + } else { + // after delta hard fork + require.Zero(t, verifier.L2Safe().Number, "safe head is at genesis block because span batch referenced reorged L1 chain is not accepted") + require.Equal(t, verifier.L2Unsafe().ID(), sequencer.L2Unsafe().ParentID(), "head is at the highest unsafe block that references canonical L1 chain(genesis block)") + batcher.l2BufferedBlock = eth.L2BlockRef{} // must reset batcher to resubmit blocks included in the last batch + } + checkVerifEngine() + + // and sync the sequencer, then build some new L2 blocks, up to and including with L1 origin B2 + sequencer.ActL1HeadSignal(t) + sequencer.ActL2PipelineFull(t) + sequencer.ActBuildToL1Head(t) + require.Equal(t, sequencer.L2Unsafe().L1Origin, blockB2.ID(), "B2 is the unsafe L1 origin of sequencer now") + + // submit all new L2 blocks for chain B, and include in new block B3 + batcher.ActSubmitAll(t) + miner.ActL1SetFeeRecipient(common.Address{'B', 3}) + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(sd.RollupCfg.Genesis.SystemConfig.BatcherAddr)(t) + miner.ActL1EndBlock(t) + + // sync the verifier to the L2 chain with origin B2 + verifier.ActL1HeadSignal(t) + verifier.ActL2PipelineFull(t) + require.Equal(t, verifier.L2Safe().L1Origin, blockB2.ID(), "B2 is the L1 origin of verifier now") + require.Equal(t, verifier.L2Unsafe(), sequencer.L2Unsafe(), "verifier unsafe head is reorged along sequencer") + checkVerifEngine() + + // Flop back to chain A! + miner.ActL1RewindDepth(4)(t) // B3, B2, B1, B0 + pivotBlock, err := minerCl.L1BlockRefByLabel(t.Ctx(), eth.Unsafe) + require.NoError(t, err) + require.Equal(t, sd.RollupCfg.Genesis.L1, pivotBlock.ID(), "back at L1 genesis") + miner.ActL1SetFeeRecipient(common.Address{'A', 0}) + miner.ActEmptyBlock(t) + blockA0Again, err := minerCl.L1BlockRefByLabel(t.Ctx(), eth.Unsafe) + require.NoError(t, err) + require.Equal(t, blockA0, blockA0Again, "block A0 is back again after flip-flop") + + // Continue to build on A, and replay the old A-chain batch transaction (we can't replay B, since the nonce values would conflict) + miner.ActL1SetFeeRecipient(common.Address{'A', 1}) + miner.ActEmptyBlock(t) + + miner.ActL1SetFeeRecipient(common.Address{'A', 2}) + miner.ActL1StartBlock(12)(t) + require.NoError(t, miner.eth.TxPool().Add([]*types.Transaction{batchTxA}, true, true)[0]) // replay chain A batches, but now in A2 instead of A1 + miner.ActL1IncludeTx(sd.RollupCfg.Genesis.SystemConfig.BatcherAddr)(t) + miner.ActL1EndBlock(t) + + // build more L1 blocks, so the chain is long enough for reorg to be picked up + miner.ActL1SetFeeRecipient(common.Address{'A', 3}) + miner.ActEmptyBlock(t) + miner.ActL1SetFeeRecipient(common.Address{'A', 4}) + miner.ActEmptyBlock(t) + blockA4, err := minerCl.L1BlockRefByLabel(t.Ctx(), eth.Unsafe) + require.NoError(t, err) + + // sync verifier, and see if A0 is safe, using the old replayed batch for chain A + verifier.ActL1HeadSignal(t) + verifier.ActL2PipelineFull(t) + require.Equal(t, verifier.L2Safe().L1Origin, blockA0.ID(), "B2 is the L1 origin of verifier now") + checkVerifEngine() + + // sync sequencer to the replayed L1 chain A + sequencer.ActL1HeadSignal(t) + sequencer.ActL2PipelineFull(t) + require.Equal(t, verifier.L2Safe(), sequencer.L2Safe(), "sequencer reorgs to match verifier again") + + // and adopt the rest of L1 chain A into L2 + sequencer.ActBuildToL1Head(t) + + // submit the new unsafe A blocks + batcher.ActSubmitAll(t) + miner.ActL1SetFeeRecipient(common.Address{'A', 5}) + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(sd.RollupCfg.Genesis.SystemConfig.BatcherAddr)(t) + miner.ActL1EndBlock(t) + + // sync verifier to what ths sequencer submitted + verifier.ActL1HeadSignal(t) + verifier.ActL2PipelineFull(t) + require.Equal(t, verifier.L2Safe(), sequencer.L2Unsafe(), "verifier syncs from sequencer") + require.Equal(t, verifier.L2Safe().L1Origin, blockA4.ID(), "L2 chain origin is A4") + checkVerifEngine() +} + +// Deep Reorg Test +// +// Steps: +// 1. Create an L1 actor +// 2. Ask the L1 actor to build three sequence windows of empty blocks +// 2.a alice submits a transaction on l2 with an l1 origin of block #35 +// 2.b in block #50, include the batch that contains the l2 block with alice's transaction as well +// as all other blocks before it. +// 3. Ask the L2 sequencer to build a chain that references these L1 blocks +// 4. Ask the batch submitter to submit remaining unsafe L2 blocks to L1 +// 5. Ask the L1 to include this data +// 6. Rewind chain A 21 blocks +// 7. Ask the L1 actor to build one sequence window + 1 empty blocks on chain B +// 8. Ask the L1 actor to build an empty block in place of the batch submission block on chain A +// 9. Ask the L1 actor to create another empty block so that chain B is longer than chain A +// 10. Ask the L2 sequencer to send a head signal and run one iteration of the derivation pipeline. +// 11. Ask the L2 sequencer build a chain that references chain B's blocks +// 12. Sync the verifier and assert that the L2 safe head L1 origin has caught up with chain B +// 13. Ensure that the parent L2 block of the block that contains Alice's transaction still exists +// after the L2 has re-derived from chain B. +// 14. Ensure that the L2 block that contained Alice's transaction before the reorg no longer exists. +// +// Chain A +// - 61 blocks total +// - 60 empty blocks +// - Alice submits her L2 transaction with an L1 Origin of block #35 +// - In block 50, submit the batch containing the L2 block with Alice's transaction. +// - Block 61 includes batch with blocks [1, 60] +// +// Verifier +// - Prior to second batch submission, safe head origin is block A50 +// - After batch, safe head origin is block A60 +// - Unsafe head origin is A61 +// +// Reorg L1 (start: block #61, depth: 22 blocks) +// - Rewind depth: Batch submission block + SeqWindowSize+1 blocks +// - Wind back to block #39 +// +// Before building L2 to L1 head / syncing verifier & sequencer: +// Verifier +// - Unsafe head L1 origin is block #60 +// - Safe head L1 origin is at genesis block #60 +// +// Build Chain B +// - 62 blocks total +// - 39 empty blocks left over from chain A +// - 21 empty blocks +// - empty block (61) +// - empty block (62) <- Makes chain B longer than chain A, the re-org will be picked up +// +// After building L2 to L1 head: +// Verifier +// - Unsafe head is 62 +// - Safe head is 42 +func DeepReorg(gt *testing.T, deltaTimeOffset *hexutil.Uint64) { + t := NewDefaultTesting(gt) + + // Create actor and verification engine client + sd, dp, miner, sequencer, seqEngine, verifier, verifierEng, batcher := setupReorgTest(t, &e2eutils.TestParams{ + MaxSequencerDrift: 40, + SequencerWindowSize: 20, + ChannelTimeout: 120, + L1BlockTime: 4, + }, deltaTimeOffset) + minerCl := miner.L1Client(t, sd.RollupCfg) + l2Client := seqEngine.EthClient() + verifEngClient := verifierEng.EngineClient(t, sd.RollupCfg) + checkVerifEngine := func() { + ref, err := verifEngClient.L2BlockRefByLabel(t.Ctx(), eth.Safe) + require.NoError(t, err) + require.Equal(t, verifier.L2Safe(), ref, "verifier safe head of engine matches rollup client") + } + + // Set up alice + log := testlog.Logger(t, log.LevelDebug) + addresses := e2eutils.CollectAddresses(sd, dp) + l2UserEnv := &BasicUserEnv[*L2Bindings]{ + EthCl: l2Client, + Signer: types.LatestSigner(sd.L2Cfg.Config), + AddressCorpora: addresses, + Bindings: NewL2Bindings(t, l2Client, seqEngine.GethClient()), + } + alice := NewCrossLayerUser(log, dp.Secrets.Alice, rand.New(rand.NewSource(0xa57b))) + alice.L2.SetUserEnv(l2UserEnv) + + // Run one iteration of the L2 derivation pipeline + sequencer.ActL1HeadSignal(t) + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + + // Start building chain A + miner.ActL1SetFeeRecipient(common.Address{0x0A, 0x00}) + + // Create a var to store the ref for the second to last block of the second sequencing window + var blockA39 eth.L1BlockRef + + var aliceL2TxBlock types.Block + // Mine enough empty blocks on L1 to reach two sequence windows. + for i := uint64(0); i < sd.RollupCfg.SeqWindowSize*3; i++ { + // At block #50, send a batch to L1 containing all L2 blocks built up to this point. + // This batch contains alice's transaction, and will be reorg'd out of the L1 chain + // later in the test. + if i == 50 { + batcher.ActSubmitAll(t) + + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(sd.RollupCfg.Genesis.SystemConfig.BatcherAddr)(t) + miner.ActL1EndBlock(t) + } else { + miner.ActEmptyBlock(t) + } + + // Get the second to last block of the first sequence window + // This is used later to verify the head of chain B after rewinding + // chain A 1 sequence window + 1 block + Block A1 (batch submission with two + // sequence windows worth of transactions) + if i == sd.RollupCfg.SeqWindowSize*2-2 { + var err error + blockA39, err = minerCl.L1BlockRefByLabel(t.Ctx(), eth.Unsafe) + require.NoError(t, err) + require.Equal(t, uint64(39), blockA39.Number) + } + + // Submit a dummy tx on L2 as alice with an L1 origin that will remain in the + // canonical chain after the reorg. The batch that contains this transaction + // will be submitted in block #50, which *will* be reorg'd out of the L1 chain, so the + // L2 block that contains this transaction should no longer exist after L2 has + // been re-derived from chain B later on in the test. + if i == 35 { + // Include alice's transaction on L2 + sequencer.ActL2StartBlock(t) + + // Submit a dummy tx + alice.L2.ActResetTxOpts(t) + alice.L2.ActSetTxToAddr(&dp.Addresses.Bob)(t) + alice.L2.ActMakeTx(t) + + // Include the tx in the block we're making + seqEngine.ActL2IncludeTx(alice.Address())(t) + + // Finalize the L2 block containing alice's transaction + sequencer.ActL2EndBlock(t) + + // Store the ref to the L2 block that the transaction was included in for later. + b0, err := l2Client.BlockByNumber(t.Ctx(), big.NewInt(int64(sequencer.L2Unsafe().Number))) + require.NoError(t, err, "failed to fetch unsafe head of L2 after submitting alice's transaction") + + aliceL2TxBlock = *b0 + } + + // Ask sequencer to handle new L1 head and build L2 blocks up to the L1 head + sequencer.ActL1HeadSignal(t) + sequencer.ActL2PipelineFull(t) + sequencer.ActBuildToL1Head(t) + } + + // Get the last empty block built in the loop above. + // This will be the last block in the third sequencing window. + blockA60, err := minerCl.L1BlockRefByLabel(t.Ctx(), eth.Unsafe) + require.NoError(t, err) + + // Check that the safe head's L1 origin is block A50 before batch submission + require.Equal(t, uint64(50), sequencer.L2Safe().L1Origin.Number) + // Check that the unsafe head's L1 origin is block A60 + require.Equal(t, blockA60.ID(), sequencer.L2Unsafe().L1Origin) + + // Batch and submit all new L2 blocks that were built above to L1 + batcher.ActSubmitAll(t) + + // Build a new block on L1 that includes the L2 batch containing all blocks + // between [51, 60] + miner.ActL1SetFeeRecipient(common.Address{0x0A, 0x01}) + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(sd.RollupCfg.Genesis.SystemConfig.BatcherAddr)(t) + miner.ActL1EndBlock(t) + + // Handle the new head block on both the verifier and the sequencer + verifier.ActL1HeadSignal(t) + sequencer.ActL1HeadSignal(t) + + // Run one iteration of the L2 derivation pipeline on both the verifier and sequencer + verifier.ActL2PipelineFull(t) + sequencer.ActL2PipelineFull(t) + + // Ensure that the verifier picks up that the L2 blocks were submitted to L1 + // and marks them as safe. + // We check that the L2 safe L1 origin is block A240, or the last block + // within the second sequencing window. This is the block directly before + // the block that included the batch on chain A. + require.Equal(t, blockA60.ID(), verifier.L2Safe().L1Origin) + checkVerifEngine() + + // Perform a deep reorg the size of one sequencing window + 2 blocks. + // This will affect the safe L2 chain. + miner.ActL1RewindToParent(t) // Rewind the batch submission + miner.ActL1RewindDepth(sd.RollupCfg.SeqWindowSize + 1)(t) // Rewind one sequence window + 1 block + + // Ensure that the block we rewinded to on L1 is the second to last block of the first + // sequencing window. + headAfterReorg, err := minerCl.L1BlockRefByLabel(t.Ctx(), eth.Unsafe) + require.NoError(t, err) + + // Ensure that we landed on the intended L1 block after the reorg + require.Equal(t, blockA39.ID(), headAfterReorg.ID()) + + // Ensure that the safe L2 head has not been altered yet- we have not issued + // a head signal to the sequencer or verifier post reorg. + require.Equal(t, blockA60.ID(), verifier.L2Safe().L1Origin) + require.Equal(t, blockA60.ID(), sequencer.L2Safe().L1Origin) + // Ensure that the L2 unsafe head has not been altered yet- we have not issued + // a head signal to the sequencer or verifier post reorg. + require.Equal(t, blockA60.ID(), verifier.L2Unsafe().L1Origin) + require.Equal(t, blockA60.ID(), sequencer.L2Unsafe().L1Origin) + checkVerifEngine() + + // --------- [ CHAIN B ] --------- + + // Start building chain B + miner.ActL1SetFeeRecipient(common.Address{0x0B, 0x00}) + // Mine enough empty blocks on L1 to reach three sequence windows or 60 blocks. + // We already have 39 empty blocks on the rewinded L1 that are left over from chain A. + for i := uint64(0); i < sd.RollupCfg.SeqWindowSize+1; i++ { + miner.ActEmptyBlock(t) + + // Ask sequencer to handle new L1 head and build L2 blocks up to the L1 head + sequencer.ActL1HeadSignal(t) + sequencer.ActL2PipelineFull(t) + sequencer.ActBuildToL1Head(t) + } + + // Get the last unsafe block on chain B after creating SeqWindowSize+1 empty blocks + blockB60, err := minerCl.L1BlockRefByLabel(t.Ctx(), eth.Unsafe) + require.NoError(t, err) + // Ensure blockB60 is #60 on chain B + require.Equal(t, uint64(60), blockB60.Number) + + // Mine an empty block in place of the block that included the final batch on chain A + miner.ActL1SetFeeRecipient(common.Address{0x0B, 0x01}) + miner.ActEmptyBlock(t) + + // Make block B62. the reorg is picked up when we have a new, longer chain. + miner.ActL1SetFeeRecipient(common.Address{0x0B, 0x02}) + miner.ActEmptyBlock(t) + blockB62, err := minerCl.L1BlockRefByLabel(t.Ctx(), eth.Unsafe) + require.NoError(t, err) + + // Now sync the verifier. The batch from chain A is invalid, so it should have been ignored. + // The safe head should have an origin at block B42 + verifier.ActL1HeadSignal(t) + verifier.ActL2PipelineFull(t) + + // Ensure that the L2 Safe block is B42 + require.Equal(t, uint64(42), verifier.L2Safe().L1Origin.Number, "expected to be at block #42 after losing A40-61") + require.NotZero(t, verifier.L2Safe().Number, "still preserving old L2 blocks that did not reference reorged L1 chain (assuming more than one L2 block per L1 block)") + require.Equal(t, verifier.L2Safe(), verifier.L2Unsafe(), "L2 safe and unsafe head should be equal") + checkVerifEngine() + + // Sync the sequencer, then build some new L2 blocks, up to and including with L1 origin B62 + sequencer.ActL1HeadSignal(t) + sequencer.ActL2PipelineFull(t) + sequencer.ActBuildToL1Head(t) + require.Equal(t, sequencer.L2Unsafe().L1Origin, blockB62.ID()) + + // Sync the verifier to the L2 chain with origin B62 + // Run an iteration of the derivation pipeline and ensure that the L2 safe L1 origin is block B62 + verifier.ActL1HeadSignal(t) + verifier.ActL2PipelineFull(t) + require.Equal(t, uint64(42), verifier.L2Safe().L1Origin.Number, "expected to be at block #42 after losing A40-61 and building 23 blocks on reorged chain") + require.Equal(t, verifier.L2Safe(), verifier.L2Unsafe(), "L2 safe and unsafe head should be equal") + checkVerifEngine() + + // Ensure that the parent of the L2 block containing Alice's transaction still exists + b0, err := l2Client.BlockByHash(t.Ctx(), aliceL2TxBlock.ParentHash()) + require.NoError(t, err, "Parent of the L2 block containing Alice's transaction should still exist on L2") + require.Equal(t, b0.Hash(), aliceL2TxBlock.ParentHash()) + + // Ensure that the L2 block containing Alice's transaction no longer exists. + b1, err := l2Client.BlockByNumber(t.Ctx(), aliceL2TxBlock.Number()) + require.NoError(t, err, "A block that has the same number as the block that contained Alice's transaction should still exist on L2") + require.Equal(t, b1.Number(), aliceL2TxBlock.Number()) + require.NotEqual(t, b1.Hash(), aliceL2TxBlock.Hash(), "L2 block containing Alice's transaction should no longer exist on L2") +} + +type rpcWrapper struct { + client.RPC +} + +// RestartOpGeth tests that the sequencer can restart its execution engine without rollup-node restart, +// including recovering the finalized/safe state of L2 chain without reorging. +func RestartOpGeth(gt *testing.T, deltaTimeOffset *hexutil.Uint64) { + t := NewDefaultTesting(gt) + dbPath := path.Join(t.TempDir(), "testdb") + dbOption := func(_ *ethconfig.Config, nodeCfg *node.Config) error { + nodeCfg.DataDir = dbPath + return nil + } + dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) + dp.DeployConfig.L2GenesisDeltaTimeOffset = deltaTimeOffset + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelDebug) + jwtPath := e2eutils.WriteDefaultJWT(t) + // L1 + miner := NewL1Miner(t, log, sd.L1Cfg) + l1F, err := sources.NewL1Client(miner.RPCClient(), log, nil, sources.L1ClientDefaultConfig(sd.RollupCfg, false, sources.RPCKindStandard)) + require.NoError(t, err) + // Sequencer + seqEng := NewL2Engine(t, log, sd.L2Cfg, sd.RollupCfg.Genesis.L1, jwtPath, dbOption) + engRpc := &rpcWrapper{seqEng.RPCClient()} + l2Cl, err := sources.NewEngineClient(engRpc, log, nil, sources.EngineClientDefaultConfig(sd.RollupCfg)) + require.NoError(t, err) + sequencer := NewL2Sequencer(t, log, l1F, miner.BlobStore(), plasma.Disabled, l2Cl, sd.RollupCfg, 0) + + batcher := NewL2Batcher(log, sd.RollupCfg, DefaultBatcherCfg(dp), + sequencer.RollupClient(), miner.EthClient(), seqEng.EthClient(), seqEng.EngineClient(t, sd.RollupCfg)) + + // start + sequencer.ActL2PipelineFull(t) + + miner.ActEmptyBlock(t) + + buildAndSubmit := func() { + // build some blocks + sequencer.ActL1HeadSignal(t) + sequencer.ActBuildToL1Head(t) + // submit the blocks, confirm on L1 + batcher.ActSubmitAll(t) + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(sd.RollupCfg.Genesis.SystemConfig.BatcherAddr)(t) + miner.ActL1EndBlock(t) + sequencer.ActL2PipelineFull(t) + } + buildAndSubmit() + + // finalize the L1 data (first block, and the new block with batch) + miner.ActL1SafeNext(t) + miner.ActL1SafeNext(t) + miner.ActL1FinalizeNext(t) + miner.ActL1FinalizeNext(t) + sequencer.ActL1FinalizedSignal(t) + sequencer.ActL1SafeSignal(t) + + // build and submit more + buildAndSubmit() + // but only mark the L1 block with this batch as safe + miner.ActL1SafeNext(t) + sequencer.ActL1SafeSignal(t) + + // build some more, these stay unsafe + miner.ActEmptyBlock(t) + sequencer.ActL1HeadSignal(t) + sequencer.ActBuildToL1Head(t) + + statusBeforeRestart := sequencer.SyncStatus() + // before restart scenario: we have a distinct finalized, safe, and unsafe part of the L2 chain + require.NotZero(t, statusBeforeRestart.FinalizedL2.L1Origin.Number) + require.Less(t, statusBeforeRestart.FinalizedL2.L1Origin.Number, statusBeforeRestart.SafeL2.L1Origin.Number) + require.Less(t, statusBeforeRestart.SafeL2.L1Origin.Number, statusBeforeRestart.UnsafeL2.L1Origin.Number) + + // close the sequencer engine + require.NoError(t, seqEng.Close()) + // and start a new one with same db path + seqEngNew := NewL2Engine(t, log, sd.L2Cfg, sd.RollupCfg.Genesis.L1, jwtPath, dbOption) + // swap in the new rpc. This is as close as we can get to reconnecting to a new in-memory rpc connection + engRpc.RPC = seqEngNew.RPCClient() + + // note: geth does not persist the safe block label, only the finalized block label + safe, err := l2Cl.L2BlockRefByLabel(t.Ctx(), eth.Safe) + require.NoError(t, err) + finalized, err := l2Cl.L2BlockRefByLabel(t.Ctx(), eth.Finalized) + require.NoError(t, err) + require.Equal(t, statusBeforeRestart.FinalizedL2, safe, "expecting to revert safe head to finalized head upon restart") + require.Equal(t, statusBeforeRestart.FinalizedL2, finalized, "expecting to keep same finalized head upon restart") + + // sequencer runs pipeline, but now attached to the restarted geth node + sequencer.ActL2PipelineFull(t) + require.Equal(t, statusBeforeRestart.UnsafeL2, sequencer.L2Unsafe(), "expecting to keep same unsafe head upon restart") + require.Equal(t, statusBeforeRestart.SafeL2, sequencer.L2Safe(), "expecting the safe block to catch up to what it was before shutdown after syncing from L1, and not be stuck at the finalized block") +} + +// ConflictingL2Blocks tests that a second copy of the sequencer stack cannot introduce an alternative +// L2 block (compared to something already secured by the first sequencer): +// the alt block is not synced by the verifier, in unsafe and safe sync modes. +func ConflictingL2Blocks(gt *testing.T, deltaTimeOffset *hexutil.Uint64) { + t := NewDefaultTesting(gt) + dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) + dp.DeployConfig.L2GenesisDeltaTimeOffset = deltaTimeOffset + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelDebug) + + sd, _, miner, sequencer, seqEng, verifier, _, batcher := setupReorgTestActors(t, dp, sd, log) + + // Extra setup: a full alternative sequencer, sequencer engine, and batcher + jwtPath := e2eutils.WriteDefaultJWT(t) + altSeqEng := NewL2Engine(t, log, sd.L2Cfg, sd.RollupCfg.Genesis.L1, jwtPath) + altSeqEngCl, err := sources.NewEngineClient(altSeqEng.RPCClient(), log, nil, sources.EngineClientDefaultConfig(sd.RollupCfg)) + require.NoError(t, err) + l1F, err := sources.NewL1Client(miner.RPCClient(), log, nil, sources.L1ClientDefaultConfig(sd.RollupCfg, false, sources.RPCKindStandard)) + require.NoError(t, err) + altSequencer := NewL2Sequencer(t, log, l1F, miner.BlobStore(), plasma.Disabled, altSeqEngCl, sd.RollupCfg, 0) + altBatcher := NewL2Batcher(log, sd.RollupCfg, DefaultBatcherCfg(dp), + altSequencer.RollupClient(), miner.EthClient(), altSeqEng.EthClient(), altSeqEng.EngineClient(t, sd.RollupCfg)) + + // And set up user Alice, using the alternative sequencer endpoint + l2Cl := altSeqEng.EthClient() + addresses := e2eutils.CollectAddresses(sd, dp) + l2UserEnv := &BasicUserEnv[*L2Bindings]{ + EthCl: l2Cl, + Signer: types.LatestSigner(sd.L2Cfg.Config), + AddressCorpora: addresses, + Bindings: NewL2Bindings(t, l2Cl, altSeqEng.GethClient()), + } + alice := NewCrossLayerUser(log, dp.Secrets.Alice, rand.New(rand.NewSource(1234))) + alice.L2.SetUserEnv(l2UserEnv) + + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + altSequencer.ActL2PipelineFull(t) + + // build empty L1 block + miner.ActEmptyBlock(t) + + // Create L2 blocks, and reference the L1 head as origin + sequencer.ActL1HeadSignal(t) + sequencer.ActBuildToL1Head(t) + + // submit all new L2 blocks + batcher.ActSubmitAll(t) + + // new L1 block with L2 batch + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(sd.RollupCfg.Genesis.SystemConfig.BatcherAddr)(t) + miner.ActL1EndBlock(t) + + // verifier picks up the L2 chain that was submitted + verifier.ActL1HeadSignal(t) + verifier.ActL2PipelineFull(t) + verifierHead := verifier.L2Unsafe() + require.Equal(t, verifier.L2Safe(), sequencer.L2Unsafe(), "verifier syncs from sequencer via L1") + require.Equal(t, verifier.L2Safe(), verifierHead, "verifier head is the same as that what was derived from L1") + require.NotEqual(t, sequencer.L2Safe(), sequencer.L2Unsafe(), "sequencer has not processed L1 yet") + + require.Less(t, altSequencer.L2Unsafe().L1Origin.Number, sequencer.L2Unsafe().L1Origin.Number, "alt-sequencer is behind") + + // produce a conflicting L2 block with the alt sequencer: + // a new unsafe block that should not replace the existing safe block at the same height + altSequencer.ActL2StartBlock(t) + // include tx to force the L2 block to really be different than the previous empty block + alice.L2.ActResetTxOpts(t) + alice.L2.ActSetTxToAddr(&dp.Addresses.Bob)(t) + alice.L2.ActMakeTx(t) + altSeqEng.ActL2IncludeTx(alice.Address())(t) + altSequencer.ActL2EndBlock(t) + + conflictBlock := seqEng.l2Chain.GetBlockByNumber(altSequencer.L2Unsafe().Number) + require.NotEqual(t, conflictBlock.Hash(), altSequencer.L2Unsafe().Hash, "alt sequencer has built a conflicting block") + + // give the unsafe block to the verifier, and see if it reorgs because of any unsafe inputs + head, err := altSeqEngCl.PayloadByLabel(t.Ctx(), eth.Unsafe) + require.NoError(t, err) + verifier.ActL2UnsafeGossipReceive(head) + + // make sure verifier has processed everything + verifier.ActL2PipelineFull(t) + + // check if verifier is still following safe chain + require.Equal(t, verifier.L2Unsafe(), verifierHead, "verifier must not accept the unsafe payload that orphans the safe payload") + + // now submit it to L1, and see if the verifier respects the inclusion order and preserves the original block + altBatcher.ActSubmitAll(t) + // include it in L1 + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(sd.RollupCfg.Genesis.SystemConfig.BatcherAddr)(t) + miner.ActL1EndBlock(t) + l1Number := miner.l1Chain.CurrentHeader().Number.Uint64() + + // show latest L1 block with new batch data to verifier, and make it sync. + verifier.ActL1HeadSignal(t) + verifier.ActL2PipelineFull(t) + require.Equal(t, verifier.SyncStatus().CurrentL1.Number, l1Number, "verifier has synced all new L1 blocks") + require.Equal(t, verifier.L2Unsafe(), verifierHead, "verifier sticks to first included L2 block") + + // Now make the alt sequencer aware of the L1 chain and derive the L2 chain like the verifier; + // it should reorg out its conflicting blocks to get back in harmony with the verifier. + altSequencer.ActL1HeadSignal(t) + altSequencer.ActL2PipelineFull(t) + require.Equal(t, verifier.L2Unsafe(), altSequencer.L2Unsafe(), "alt-sequencer gets back in harmony with verifier by reorging out its conflicting data") + require.Equal(t, sequencer.L2Unsafe(), altSequencer.L2Unsafe(), "and gets back in harmony with original sequencer") +} + +func SyncAfterReorg(gt *testing.T, deltaTimeOffset *hexutil.Uint64) { + t := NewDefaultTesting(gt) + testingParams := e2eutils.TestParams{ + MaxSequencerDrift: 60, + SequencerWindowSize: 4, + ChannelTimeout: 2, + L1BlockTime: 12, + } + sd, dp, miner, sequencer, seqEngine, verifier, _, batcher := setupReorgTest(t, &testingParams, deltaTimeOffset) + l2Client := seqEngine.EthClient() + log := testlog.Logger(t, log.LevelDebug) + addresses := e2eutils.CollectAddresses(sd, dp) + l2UserEnv := &BasicUserEnv[*L2Bindings]{ + EthCl: l2Client, + Signer: types.LatestSigner(sd.L2Cfg.Config), + AddressCorpora: addresses, + Bindings: NewL2Bindings(t, l2Client, seqEngine.GethClient()), + } + alice := NewCrossLayerUser(log, dp.Secrets.Alice, rand.New(rand.NewSource(0xa57b))) + alice.L2.SetUserEnv(l2UserEnv) + + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + + // build empty L1 block: A0 + miner.ActL1SetFeeRecipient(common.Address{'A', 0}) + miner.ActEmptyBlock(t) + sequencer.ActL1HeadSignal(t) + for sequencer.engine.UnsafeL2Head().L1Origin.Number < sequencer.l1State.L1Head().Number { + // build L2 blocks until the L1 origin is the current L1 head(A0) + sequencer.ActL2PipelineFull(t) + sequencer.ActL2StartBlock(t) + if sequencer.engine.UnsafeL2Head().Number == 11 { + // include a user tx at L2 block #12 to make a state transition + alice.L2.ActResetTxOpts(t) + alice.L2.ActSetTxToAddr(&dp.Addresses.Bob)(t) + alice.L2.ActMakeTx(t) + // Include the tx in the block we're making + seqEngine.ActL2IncludeTx(alice.Address())(t) + } + sequencer.ActL2EndBlock(t) + } + // submit all new L2 blocks: #1 ~ #12 + batcher.ActSubmitAll(t) + + // build an L1 block included batch TX: A1 + miner.ActL1SetFeeRecipient(common.Address{'A', 1}) + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(sd.RollupCfg.Genesis.SystemConfig.BatcherAddr)(t) + miner.ActL1EndBlock(t) + + for i := 2; i < 6; i++ { + // build L2 blocks until the L1 origin is the current L1 head + sequencer.ActL1HeadSignal(t) + sequencer.ActBuildToL1Head(t) + // submt all new L2 blocks + batcher.ActSubmitAll(t) + + // build an L1 block included batch TX: A2 ~ A5 + miner.ActL1SetFeeRecipient(common.Address{'A', byte(i)}) + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(sd.RollupCfg.Genesis.SystemConfig.BatcherAddr)(t) + miner.ActL1EndBlock(t) + } + + sequencer.ActL1HeadSignal(t) + sequencer.ActL2PipelineFull(t) + // capture current L2 safe head + submittedSafeHead := sequencer.L2Safe().ID() + + // build L2 blocks until the L1 origin is the current L1 head(A5) + sequencer.ActBuildToL1Head(t) + batcher.ActSubmitAll(t) + + // build an L1 block included batch TX: A6 + miner.ActL1SetFeeRecipient(common.Address{'A', 6}) + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(sd.RollupCfg.Genesis.SystemConfig.BatcherAddr)(t) + miner.ActL1EndBlock(t) + + sequencer.ActL1HeadSignal(t) + sequencer.ActL2PipelineFull(t) + verifier.ActL1HeadSignal(t) + verifier.ActL2PipelineFull(t) + + // reorg L1 + miner.ActL1RewindToParent(t) // undo A6 + miner.ActL1SetFeeRecipient(common.Address{'B', 6}) // build B6 + miner.ActEmptyBlock(t) + miner.ActL1SetFeeRecipient(common.Address{'B', 7}) // build B7 + miner.ActEmptyBlock(t) + + // sequencer and verifier detect L1 reorg + // derivation pipeline is reset + // safe head may be reset to block #11 + sequencer.ActL1HeadSignal(t) + sequencer.ActL2PipelineFull(t) + verifier.ActL1HeadSignal(t) + verifier.ActL2PipelineFull(t) + + // sequencer and verifier must derive all submitted batches and reach to the captured block + require.Equal(t, sequencer.L2Safe().ID(), submittedSafeHead) + require.Equal(t, verifier.L2Safe().ID(), submittedSafeHead) +} diff --git a/op-e2e2/actions/safedb_test.go b/op-e2e2/actions/safedb_test.go new file mode 100644 index 000000000000..52b6bd06d421 --- /dev/null +++ b/op-e2e2/actions/safedb_test.go @@ -0,0 +1,140 @@ +package actions + +import ( + "context" + "testing" + + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils" + "github.com/ethereum-optimism/optimism/op-node/node/safedb" + "github.com/ethereum-optimism/optimism/op-node/rollup/sync" + "github.com/ethereum-optimism/optimism/op-service/eth" + "github.com/ethereum-optimism/optimism/op-service/testlog" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/log" + "github.com/stretchr/testify/require" +) + +func TestRecordSafeHeadUpdates(gt *testing.T) { + t := NewDefaultTesting(gt) + sd, miner, sequencer, verifier, verifierEng, batcher := setupSafeDBTest(t, defaultRollupTestParams) + verifEngClient := verifierEng.EngineClient(t, sd.RollupCfg) + + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + + // build empty L1 block + miner.ActEmptyBlock(t) + + // Create L2 blocks, and reference the L1 head as origin + sequencer.ActL1HeadSignal(t) + sequencer.ActBuildToL1Head(t) + + // submit all new L2 blocks + batcher.ActSubmitAll(t) + + // new L1 block with L2 batch + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(sd.RollupCfg.Genesis.SystemConfig.BatcherAddr)(t) + batchTx := miner.l1Transactions[0] + miner.ActL1EndBlock(t) + + // verifier picks up the L2 chain that was submitted + verifier.ActL1HeadSignal(t) + verifier.ActL2PipelineFull(t) + require.Equal(t, verifier.L2Safe(), sequencer.L2Unsafe(), "verifier syncs from sequencer via L1") + require.NotEqual(t, sequencer.L2Safe(), sequencer.L2Unsafe(), "sequencer has not processed L1 yet") + + // Verify the safe head is recorded + l1Head := miner.l1Chain.CurrentBlock() + firstSafeHeadUpdateL1Block := l1Head.Number.Uint64() + response, err := verifier.RollupClient().SafeHeadAtL1Block(context.Background(), firstSafeHeadUpdateL1Block) + require.NoError(t, err) + require.Equal(t, eth.HeaderBlockID(l1Head), response.L1Block) + require.Equal(t, verifier.L2Unsafe().ID(), response.SafeHead) + + // Should get the same result for anything after that L1 block too + response, err = verifier.RollupClient().SafeHeadAtL1Block(context.Background(), firstSafeHeadUpdateL1Block+1) + require.NoError(t, err) + require.Equal(t, eth.HeaderBlockID(l1Head), response.L1Block) + require.Equal(t, verifier.L2Unsafe().ID(), response.SafeHead) + + // Only genesis is safe at this point + response, err = verifier.RollupClient().SafeHeadAtL1Block(context.Background(), firstSafeHeadUpdateL1Block-1) + require.NoError(t, err) + require.Equal(t, eth.HeaderBlockID(miner.l1Chain.Genesis().Header()), response.L1Block) + require.Equal(t, sd.RollupCfg.Genesis.L2, response.SafeHead) + + // orphan the L1 block that included the batch tx, and build a new different L1 block + miner.ActL1RewindToParent(t) + miner.ActL1SetFeeRecipient(common.Address{'B'}) + miner.ActEmptyBlock(t) + miner.ActEmptyBlock(t) // needs to be a longer chain for reorg to be applied. + + // sync verifier again. The L1 reorg excluded the batch, so now the previous L2 chain should be unsafe again. + // However, the L2 chain can still be canonical later, since it did not reference the reorged L1 block + verifier.ActL1HeadSignal(t) + verifier.ActL2PipelineFull(t) + require.Equal(t, verifier.L2Safe(), sequencer.L2Safe(), "verifier rewinds safe when L1 reorgs out batch") + ref, err := verifEngClient.L2BlockRefByLabel(t.Ctx(), eth.Safe) + require.NoError(t, err) + require.Equal(t, verifier.L2Safe(), ref, "verifier engine matches rollup client") + + // The safe head has been reorged so the record should have been deleted, leaving us back with just genesis safe + response, err = verifier.RollupClient().SafeHeadAtL1Block(context.Background(), firstSafeHeadUpdateL1Block) + require.NoError(t, err) + require.Equal(t, eth.HeaderBlockID(miner.l1Chain.Genesis().Header()), response.L1Block) + require.Equal(t, sd.RollupCfg.Genesis.L2, response.SafeHead) + + // Now replay the batch tx in a new L1 block + miner.ActL1StartBlock(12)(t) + miner.ActL1SetFeeRecipient(common.Address{'C'}) + // note: the geth tx pool reorgLoop is too slow (responds to chain head events, but async), + // and there's no way to manually trigger runReorg, so we re-insert it ourselves. + require.NoError(t, miner.eth.TxPool().Add([]*types.Transaction{batchTx}, true, true)[0]) + // need to re-insert previously included tx into the block + miner.ActL1IncludeTx(sd.RollupCfg.Genesis.SystemConfig.BatcherAddr)(t) + miner.ActL1EndBlock(t) + + // sync the verifier again: now it should be safe again + verifier.ActL1HeadSignal(t) + verifier.ActL2PipelineFull(t) + require.Equal(t, verifier.L2Safe(), sequencer.L2Unsafe(), "verifier syncs from sequencer via replayed batch on L1") + ref, err = verifEngClient.L2BlockRefByLabel(t.Ctx(), eth.Safe) + require.NoError(t, err) + require.Equal(t, verifier.L2Safe(), ref, "verifier engine matches rollup client") + + // Verify the safe head is recorded again + l1Head = miner.l1Chain.CurrentBlock() + firstSafeHeadUpdateL1Block = l1Head.Number.Uint64() + response, err = verifier.RollupClient().SafeHeadAtL1Block(context.Background(), firstSafeHeadUpdateL1Block) + require.NoError(t, err) + require.Equal(t, eth.HeaderBlockID(l1Head), response.L1Block) + require.Equal(t, verifier.L2Unsafe().ID(), response.SafeHead) +} + +func setupSafeDBTest(t Testing, config *e2eutils.TestParams) (*e2eutils.SetupData, *L1Miner, *L2Sequencer, *L2Verifier, *L2Engine, *L2Batcher) { + dp := e2eutils.MakeDeployParams(t, config) + + sd := e2eutils.Setup(t, dp, defaultAlloc) + logger := testlog.Logger(t, log.LevelDebug) + + return setupSafeDBTestActors(t, dp, sd, logger) +} + +func setupSafeDBTestActors(t Testing, dp *e2eutils.DeployParams, sd *e2eutils.SetupData, log log.Logger) (*e2eutils.SetupData, *L1Miner, *L2Sequencer, *L2Verifier, *L2Engine, *L2Batcher) { + dir := t.TempDir() + db, err := safedb.NewSafeDB(log, dir) + require.NoError(t, err) + t.Cleanup(func() { + _ = db.Close() + }) + miner, seqEngine, sequencer := setupSequencerTest(t, sd, log) + miner.ActL1SetFeeRecipient(common.Address{'A'}) + sequencer.ActL2PipelineFull(t) + verifEngine, verifier := setupVerifier(t, sd, log, miner.L1Client(t, sd.RollupCfg), miner.BlobStore(), &sync.Config{}, WithSafeHeadListener(db)) + rollupSeqCl := sequencer.RollupClient() + batcher := NewL2Batcher(log, sd.RollupCfg, DefaultBatcherCfg(dp), + rollupSeqCl, miner.EthClient(), seqEngine.EthClient(), seqEngine.EngineClient(t, sd.RollupCfg)) + return sd, miner, sequencer, verifier, verifEngine, batcher +} diff --git a/op-e2e2/actions/span_batch_test.go b/op-e2e2/actions/span_batch_test.go new file mode 100644 index 000000000000..ed5c30284b0d --- /dev/null +++ b/op-e2e2/actions/span_batch_test.go @@ -0,0 +1,719 @@ +package actions + +import ( + "context" + "crypto/ecdsa" + crand "crypto/rand" + "fmt" + "math/big" + "math/rand" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/params" + + batcherFlags "github.com/ethereum-optimism/optimism/op-batcher/flags" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils" + "github.com/ethereum-optimism/optimism/op-node/rollup/sync" + "github.com/ethereum-optimism/optimism/op-service/testlog" +) + +// TestDropSpanBatchBeforeHardfork tests behavior of op-node before Delta hardfork. +// op-node must drop SpanBatch before Delta hardfork. +func TestDropSpanBatchBeforeHardfork(gt *testing.T) { + t := NewDefaultTesting(gt) + p := &e2eutils.TestParams{ + MaxSequencerDrift: 20, // larger than L1 block time we simulate in this test (12) + SequencerWindowSize: 24, + ChannelTimeout: 20, + L1BlockTime: 12, + } + dp := e2eutils.MakeDeployParams(t, p) + // do not activate Delta hardfork for verifier + dp.DeployConfig.L2GenesisDeltaTimeOffset = nil + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelError) + miner, seqEngine, sequencer := setupSequencerTest(t, sd, log) + verifEngine, verifier := setupVerifier(t, sd, log, miner.L1Client(t, sd.RollupCfg), miner.BlobStore(), &sync.Config{}) + rollupSeqCl := sequencer.RollupClient() + + // Force batcher to submit SpanBatches to L1. + batcher := NewL2Batcher(log, sd.RollupCfg, &BatcherCfg{ + MinL1TxSize: 0, + MaxL1TxSize: 128_000, + BatcherKey: dp.Secrets.Batcher, + ForceSubmitSpanBatch: true, + DataAvailabilityType: batcherFlags.CalldataType, + }, rollupSeqCl, miner.EthClient(), seqEngine.EthClient(), seqEngine.EngineClient(t, sd.RollupCfg)) + + // Alice makes a L2 tx + cl := seqEngine.EthClient() + n, err := cl.PendingNonceAt(t.Ctx(), dp.Addresses.Alice) + require.NoError(t, err) + signer := types.LatestSigner(sd.L2Cfg.Config) + tx := types.MustSignNewTx(dp.Secrets.Alice, signer, &types.DynamicFeeTx{ + ChainID: sd.L2Cfg.Config.ChainID, + Nonce: n, + GasTipCap: big.NewInt(2 * params.GWei), + GasFeeCap: new(big.Int).Add(miner.l1Chain.CurrentBlock().BaseFee, big.NewInt(2*params.GWei)), + Gas: params.TxGas, + To: &dp.Addresses.Bob, + Value: e2eutils.Ether(2), + }) + require.NoError(gt, cl.SendTransaction(t.Ctx(), tx)) + + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + + // Make L2 block + sequencer.ActL2StartBlock(t) + seqEngine.ActL2IncludeTx(dp.Addresses.Alice)(t) + sequencer.ActL2EndBlock(t) + + // batch submit to L1. batcher should submit span batches. + batcher.ActL2BatchBuffer(t) + batcher.ActL2ChannelClose(t) + batcher.ActL2BatchSubmit(t) + + // confirm batch on L1 + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(dp.Addresses.Batcher)(t) + miner.ActL1EndBlock(t) + bl := miner.l1Chain.CurrentBlock() + log.Info("bl", "txs", len(miner.l1Chain.GetBlockByHash(bl.Hash()).Transactions())) + + // Now make enough L1 blocks that the verifier will have to derive a L2 block + // It will also eagerly derive the block from the batcher + for i := uint64(0); i < sd.RollupCfg.SeqWindowSize; i++ { + miner.ActL1StartBlock(12)(t) + miner.ActL1EndBlock(t) + } + + // try to sync verifier from L1 batch. but verifier should drop every span batch. + verifier.ActL1HeadSignal(t) + verifier.ActL2PipelineFull(t) + require.Equal(t, uint64(1), verifier.SyncStatus().SafeL2.L1Origin.Number) + + verifCl := verifEngine.EthClient() + for i := int64(1); i < int64(verifier.L2Safe().Number); i++ { + block, _ := verifCl.BlockByNumber(t.Ctx(), big.NewInt(i)) + require.NoError(t, err) + // because verifier drops every span batch, it should generate empty blocks. + // so every block has only L1 attribute deposit transaction. + require.Equal(t, block.Transactions().Len(), 1) + } + // check that the tx from alice is not included in verifier's chain + _, _, err = verifCl.TransactionByHash(t.Ctx(), tx.Hash()) + require.ErrorIs(t, err, ethereum.NotFound) +} + +// TestHardforkMiddleOfSpanBatch tests behavior of op-node Delta hardfork. +// If Delta activation time is in the middle of time range of a SpanBatch, op-node must drop the batch. +func TestHardforkMiddleOfSpanBatch(gt *testing.T) { + t := NewDefaultTesting(gt) + p := &e2eutils.TestParams{ + MaxSequencerDrift: 20, // larger than L1 block time we simulate in this test (12) + SequencerWindowSize: 24, + ChannelTimeout: 20, + L1BlockTime: 12, + } + dp := e2eutils.MakeDeployParams(t, p) + + // Activate HF in the middle of the first epoch + deltaOffset := hexutil.Uint64(6) + dp.DeployConfig.L2GenesisDeltaTimeOffset = &deltaOffset + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelError) + miner, seqEngine, sequencer := setupSequencerTest(t, sd, log) + verifEngine, verifier := setupVerifier(t, sd, log, miner.L1Client(t, sd.RollupCfg), miner.BlobStore(), &sync.Config{}) + minerCl := miner.EthClient() + rollupSeqCl := sequencer.RollupClient() + + // Force batcher to submit SpanBatches to L1. + batcher := NewL2Batcher(log, sd.RollupCfg, &BatcherCfg{ + MinL1TxSize: 0, + MaxL1TxSize: 128_000, + BatcherKey: dp.Secrets.Batcher, + ForceSubmitSpanBatch: true, + DataAvailabilityType: batcherFlags.CalldataType, + }, rollupSeqCl, miner.EthClient(), seqEngine.EthClient(), seqEngine.EngineClient(t, sd.RollupCfg)) + + // Alice makes a L2 tx + cl := seqEngine.EthClient() + n, err := cl.PendingNonceAt(t.Ctx(), dp.Addresses.Alice) + require.NoError(t, err) + signer := types.LatestSigner(sd.L2Cfg.Config) + tx := types.MustSignNewTx(dp.Secrets.Alice, signer, &types.DynamicFeeTx{ + ChainID: sd.L2Cfg.Config.ChainID, + Nonce: n, + GasTipCap: big.NewInt(2 * params.GWei), + GasFeeCap: new(big.Int).Add(miner.l1Chain.CurrentBlock().BaseFee, big.NewInt(2*params.GWei)), + Gas: params.TxGas, + To: &dp.Addresses.Bob, + Value: e2eutils.Ether(2), + }) + require.NoError(gt, cl.SendTransaction(t.Ctx(), tx)) + + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + + miner.ActEmptyBlock(t) + sequencer.ActL1HeadSignal(t) + + // Make a L2 block with the TX + sequencer.ActL2StartBlock(t) + seqEngine.ActL2IncludeTx(dp.Addresses.Alice)(t) + sequencer.ActL2EndBlock(t) + + // HF is not activated yet + unsafeOriginNum := new(big.Int).SetUint64(sequencer.L2Unsafe().L1Origin.Number) + unsafeHeader, err := minerCl.HeaderByNumber(t.Ctx(), unsafeOriginNum) + require.NoError(t, err) + require.False(t, sd.RollupCfg.IsDelta(unsafeHeader.Time)) + + // Make L2 blocks until the next epoch + sequencer.ActBuildToL1Head(t) + + // HF is activated for the last unsafe block + unsafeOriginNum = new(big.Int).SetUint64(sequencer.L2Unsafe().L1Origin.Number) + unsafeHeader, err = minerCl.HeaderByNumber(t.Ctx(), unsafeOriginNum) + require.NoError(t, err) + require.True(t, sd.RollupCfg.IsDelta(unsafeHeader.Time)) + + // Batch submit to L1. batcher should submit span batches. + batcher.ActSubmitAll(t) + + // Confirm batch on L1 + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(dp.Addresses.Batcher)(t) + miner.ActL1EndBlock(t) + bl := miner.l1Chain.CurrentBlock() + log.Info("bl", "txs", len(miner.l1Chain.GetBlockByHash(bl.Hash()).Transactions())) + + // Now make enough L1 blocks that the verifier will have to derive a L2 block + // It will also eagerly derive the block from the batcher + for i := uint64(0); i < sd.RollupCfg.SeqWindowSize; i++ { + miner.ActL1StartBlock(12)(t) + miner.ActL1EndBlock(t) + } + + // Try to sync verifier from L1 batch. but verifier should drop every span batch. + verifier.ActL1HeadSignal(t) + verifier.ActL2PipelineFull(t) + require.Equal(t, uint64(2), verifier.SyncStatus().SafeL2.L1Origin.Number) + + verifCl := verifEngine.EthClient() + for i := int64(1); i < int64(verifier.L2Safe().Number); i++ { + block, _ := verifCl.BlockByNumber(t.Ctx(), big.NewInt(i)) + require.NoError(t, err) + // Because verifier drops every span batch, it should generate empty blocks. + // So every block has only L1 attribute deposit transaction. + require.Equal(t, block.Transactions().Len(), 1) + } + // Check that the tx from alice is not included in verifier's chain + _, _, err = verifCl.TransactionByHash(t.Ctx(), tx.Hash()) + require.ErrorIs(t, err, ethereum.NotFound) +} + +// TestAcceptSingularBatchAfterHardfork tests behavior of op-node after Delta hardfork. +// op-node must accept SingularBatch after Delta hardfork. +func TestAcceptSingularBatchAfterHardfork(gt *testing.T) { + t := NewDefaultTesting(gt) + p := &e2eutils.TestParams{ + MaxSequencerDrift: 20, // larger than L1 block time we simulate in this test (12) + SequencerWindowSize: 24, + ChannelTimeout: 20, + L1BlockTime: 12, + } + minTs := hexutil.Uint64(0) + dp := e2eutils.MakeDeployParams(t, p) + + // activate Delta hardfork for verifier. + dp.DeployConfig.L2GenesisDeltaTimeOffset = &minTs + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelError) + miner, seqEngine, sequencer := setupSequencerTest(t, sd, log) + verifEngine, verifier := setupVerifier(t, sd, log, miner.L1Client(t, sd.RollupCfg), miner.BlobStore(), &sync.Config{}) + rollupSeqCl := sequencer.RollupClient() + + // Force batcher to submit SingularBatches to L1. + batcher := NewL2Batcher(log, sd.RollupCfg, &BatcherCfg{ + MinL1TxSize: 0, + MaxL1TxSize: 128_000, + BatcherKey: dp.Secrets.Batcher, + ForceSubmitSingularBatch: true, + DataAvailabilityType: batcherFlags.CalldataType, + }, rollupSeqCl, miner.EthClient(), seqEngine.EthClient(), seqEngine.EngineClient(t, sd.RollupCfg)) + + // Alice makes a L2 tx + cl := seqEngine.EthClient() + n, err := cl.PendingNonceAt(t.Ctx(), dp.Addresses.Alice) + require.NoError(t, err) + signer := types.LatestSigner(sd.L2Cfg.Config) + tx := types.MustSignNewTx(dp.Secrets.Alice, signer, &types.DynamicFeeTx{ + ChainID: sd.L2Cfg.Config.ChainID, + Nonce: n, + GasTipCap: big.NewInt(2 * params.GWei), + GasFeeCap: new(big.Int).Add(miner.l1Chain.CurrentBlock().BaseFee, big.NewInt(2*params.GWei)), + Gas: params.TxGas, + To: &dp.Addresses.Bob, + Value: e2eutils.Ether(2), + }) + require.NoError(gt, cl.SendTransaction(t.Ctx(), tx)) + + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + + // Make L2 block + sequencer.ActL2StartBlock(t) + seqEngine.ActL2IncludeTx(dp.Addresses.Alice)(t) + sequencer.ActL2EndBlock(t) + + // batch submit to L1. batcher should submit singular batches. + batcher.ActL2BatchBuffer(t) + batcher.ActL2ChannelClose(t) + batcher.ActL2BatchSubmit(t) + + // confirm batch on L1 + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(dp.Addresses.Batcher)(t) + miner.ActL1EndBlock(t) + bl := miner.l1Chain.CurrentBlock() + log.Info("bl", "txs", len(miner.l1Chain.GetBlockByHash(bl.Hash()).Transactions())) + + // Now make enough L1 blocks that the verifier will have to derive a L2 block + // It will also eagerly derive the block from the batcher + for i := uint64(0); i < sd.RollupCfg.SeqWindowSize; i++ { + miner.ActL1StartBlock(12)(t) + miner.ActL1EndBlock(t) + } + + // sync verifier from L1 batch in otherwise empty sequence window + verifier.ActL1HeadSignal(t) + verifier.ActL2PipelineFull(t) + require.Equal(t, uint64(1), verifier.SyncStatus().SafeL2.L1Origin.Number) + + // check that the tx from alice made it into the L2 chain + verifCl := verifEngine.EthClient() + vTx, isPending, err := verifCl.TransactionByHash(t.Ctx(), tx.Hash()) + require.NoError(t, err) + require.False(t, isPending) + require.NotNil(t, vTx) +} + +// TestMixOfBatchesAfterHardfork tests behavior of op-node after Delta hardfork. +// op-node must accept SingularBatch and SpanBatch in sequence. +func TestMixOfBatchesAfterHardfork(gt *testing.T) { + t := NewDefaultTesting(gt) + p := &e2eutils.TestParams{ + MaxSequencerDrift: 20, // larger than L1 block time we simulate in this test (12) + SequencerWindowSize: 24, + ChannelTimeout: 20, + L1BlockTime: 12, + } + minTs := hexutil.Uint64(0) + dp := e2eutils.MakeDeployParams(t, p) + + // Activate Delta hardfork for verifier. + dp.DeployConfig.L2GenesisDeltaTimeOffset = &minTs + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelError) + miner, seqEngine, sequencer := setupSequencerTest(t, sd, log) + verifEngine, verifier := setupVerifier(t, sd, log, miner.L1Client(t, sd.RollupCfg), miner.BlobStore(), &sync.Config{}) + rollupSeqCl := sequencer.RollupClient() + seqEngCl := seqEngine.EthClient() + + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + miner.ActEmptyBlock(t) + + var txHashes [4]common.Hash + for i := 0; i < 4; i++ { + // Alice makes a L2 tx + n, err := seqEngCl.PendingNonceAt(t.Ctx(), dp.Addresses.Alice) + require.NoError(t, err) + signer := types.LatestSigner(sd.L2Cfg.Config) + tx := types.MustSignNewTx(dp.Secrets.Alice, signer, &types.DynamicFeeTx{ + ChainID: sd.L2Cfg.Config.ChainID, + Nonce: n, + GasTipCap: big.NewInt(2 * params.GWei), + GasFeeCap: new(big.Int).Add(miner.l1Chain.CurrentBlock().BaseFee, big.NewInt(2*params.GWei)), + Gas: params.TxGas, + To: &dp.Addresses.Bob, + Value: e2eutils.Ether(2), + }) + require.NoError(gt, seqEngCl.SendTransaction(t.Ctx(), tx)) + txHashes[i] = tx.Hash() + + // Make L2 block + sequencer.ActL1HeadSignal(t) + sequencer.ActL2StartBlock(t) + seqEngine.ActL2IncludeTx(dp.Addresses.Alice)(t) + sequencer.ActL2EndBlock(t) + sequencer.ActBuildToL1Head(t) + + // Select batcher mode + batcherCfg := BatcherCfg{ + MinL1TxSize: 0, + MaxL1TxSize: 128_000, + BatcherKey: dp.Secrets.Batcher, + ForceSubmitSpanBatch: i%2 == 0, // Submit SpanBatch for odd numbered batches + ForceSubmitSingularBatch: i%2 == 1, // Submit SingularBatch for even numbered batches + DataAvailabilityType: batcherFlags.CalldataType, + } + batcher := NewL2Batcher(log, sd.RollupCfg, &batcherCfg, rollupSeqCl, miner.EthClient(), seqEngine.EthClient(), seqEngine.EngineClient(t, sd.RollupCfg)) + // Submit all new blocks + batcher.ActSubmitAll(t) + + // Confirm batch on L1 + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(dp.Addresses.Batcher)(t) + miner.ActL1EndBlock(t) + } + + // Now make enough L1 blocks that the verifier will have to derive a L2 block + // It will also eagerly derive the block from the batcher + for i := uint64(0); i < sd.RollupCfg.SeqWindowSize; i++ { + miner.ActL1StartBlock(12)(t) + miner.ActL1EndBlock(t) + } + + // Sync verifier from L1 batch in otherwise empty sequence window + verifier.ActL1HeadSignal(t) + verifier.ActL2PipelineFull(t) + require.Equal(t, uint64(5), verifier.SyncStatus().SafeL2.L1Origin.Number) + + // Check that the tx from alice made it into the L2 chain + verifCl := verifEngine.EthClient() + for _, txHash := range txHashes { + vTx, isPending, err := verifCl.TransactionByHash(t.Ctx(), txHash) + require.NoError(t, err) + require.False(t, isPending) + require.NotNil(t, vTx) + } +} + +// TestSpanBatchEmptyChain tests derivation of empty chain using SpanBatch. +func TestSpanBatchEmptyChain(gt *testing.T) { + t := NewDefaultTesting(gt) + p := &e2eutils.TestParams{ + MaxSequencerDrift: 20, + SequencerWindowSize: 24, + ChannelTimeout: 20, + L1BlockTime: 12, + } + dp := e2eutils.MakeDeployParams(t, p) + minTs := hexutil.Uint64(0) + // Activate Delta hardfork + dp.DeployConfig.L2GenesisDeltaTimeOffset = &minTs + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelError) + miner, seqEngine, sequencer := setupSequencerTest(t, sd, log) + _, verifier := setupVerifier(t, sd, log, miner.L1Client(t, sd.RollupCfg), miner.BlobStore(), &sync.Config{}) + + rollupSeqCl := sequencer.RollupClient() + batcher := NewL2Batcher(log, sd.RollupCfg, DefaultBatcherCfg(dp), + rollupSeqCl, miner.EthClient(), seqEngine.EthClient(), seqEngine.EngineClient(t, sd.RollupCfg)) + + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + + miner.ActEmptyBlock(t) + sequencer.ActL1HeadSignal(t) + // Make 1200 empty L2 blocks (L1BlockTime / L2BlockTime * 100) + for i := 0; i < 100; i++ { + sequencer.ActBuildToL1Head(t) + + if i%10 == 9 { + // batch submit to L1 + batcher.ActSubmitAll(t) + + // Since the unsafe head could be changed due to the reorg during derivation, save the current unsafe head. + unsafeHead := sequencer.L2Unsafe().ID() + + // confirm batch on L1 + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(dp.Addresses.Batcher)(t) + miner.ActL1EndBlock(t) + + sequencer.ActL1HeadSignal(t) + sequencer.ActL2PipelineFull(t) + + // After derivation pipeline, the safe head must be same as latest unsafe head + // i.e. There must be no reorg during derivation pipeline. + require.Equal(t, sequencer.L2Safe().ID(), unsafeHead) + } else { + miner.ActEmptyBlock(t) + sequencer.ActL1HeadSignal(t) + } + } + + verifier.ActL1HeadSignal(t) + verifier.ActL2PipelineFull(t) + + require.Equal(t, sequencer.L2Unsafe(), sequencer.L2Safe()) + require.Equal(t, verifier.L2Unsafe(), verifier.L2Safe()) + require.Equal(t, sequencer.L2Safe(), verifier.L2Safe()) +} + +// TestSpanBatchLowThroughputChain tests derivation of low-throughput chain using SpanBatch. +func TestSpanBatchLowThroughputChain(gt *testing.T) { + t := NewDefaultTesting(gt) + p := &e2eutils.TestParams{ + MaxSequencerDrift: 20, + SequencerWindowSize: 24, + ChannelTimeout: 20, + L1BlockTime: 12, + } + dp := e2eutils.MakeDeployParams(t, p) + minTs := hexutil.Uint64(0) + // Activate Delta hardfork + dp.DeployConfig.L2GenesisDeltaTimeOffset = &minTs + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelError) + miner, seqEngine, sequencer := setupSequencerTest(t, sd, log) + _, verifier := setupVerifier(t, sd, log, miner.L1Client(t, sd.RollupCfg), miner.BlobStore(), &sync.Config{}) + + rollupSeqCl := sequencer.RollupClient() + batcher := NewL2Batcher(log, sd.RollupCfg, DefaultBatcherCfg(dp), + rollupSeqCl, miner.EthClient(), seqEngine.EthClient(), seqEngine.EngineClient(t, sd.RollupCfg)) + cl := seqEngine.EthClient() + + const numTestUsers = 5 + var privKeys [numTestUsers]*ecdsa.PrivateKey + var addrs [numTestUsers]common.Address + for i := 0; i < numTestUsers; i++ { + // Create a new test account + privateKey, err := dp.Secrets.Wallet.PrivateKey(accounts.Account{ + URL: accounts.URL{ + Path: fmt.Sprintf("m/44'/60'/0'/0/%d", 10+i), + }, + }) + privKeys[i] = privateKey + addr := crypto.PubkeyToAddress(privateKey.PublicKey) + require.NoError(t, err) + addrs[i] = addr + + bal, err := cl.BalanceAt(context.Background(), addr, nil) + require.NoError(gt, err) + require.Equal(gt, 1, bal.Cmp(common.Big0), "account %d must have non-zero balance, address: %s, balance: %d", i, addr, bal) + } + + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + + miner.ActEmptyBlock(t) + totalTxCount := 0 + // Make 600 L2 blocks (L1BlockTime / L2BlockTime * 50) including 1~3 txs + for i := 0; i < 50; i++ { + for sequencer.engine.UnsafeL2Head().L1Origin.Number < sequencer.l1State.L1Head().Number { + sequencer.ActL2StartBlock(t) + // fill the block with random number of L2 txs + for j := 0; j < rand.Intn(3); j++ { + userIdx := totalTxCount % numTestUsers + signer := types.LatestSigner(sd.L2Cfg.Config) + data := make([]byte, rand.Intn(100)) + _, err := crand.Read(data[:]) // fill with random bytes + require.NoError(t, err) + gas, err := core.IntrinsicGas(data, nil, false, true, true, false) + require.NoError(t, err) + baseFee := seqEngine.l2Chain.CurrentBlock().BaseFee + nonce, err := cl.PendingNonceAt(t.Ctx(), addrs[userIdx]) + require.NoError(t, err) + tx := types.MustSignNewTx(privKeys[userIdx], signer, &types.DynamicFeeTx{ + ChainID: sd.L2Cfg.Config.ChainID, + Nonce: nonce, + GasTipCap: big.NewInt(2 * params.GWei), + GasFeeCap: new(big.Int).Add(new(big.Int).Mul(baseFee, big.NewInt(2)), big.NewInt(2*params.GWei)), + Gas: gas, + To: &dp.Addresses.Bob, + Value: big.NewInt(0), + Data: data, + }) + require.NoError(gt, cl.SendTransaction(t.Ctx(), tx)) + seqEngine.ActL2IncludeTx(addrs[userIdx])(t) + totalTxCount += 1 + } + sequencer.ActL2EndBlock(t) + } + + if i%10 == 9 { + // batch submit to L1 + batcher.ActSubmitAll(t) + + // Since the unsafe head could be changed due to the reorg during derivation, save the current unsafe head. + unsafeHead := sequencer.L2Unsafe().ID() + + // confirm batch on L1 + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(dp.Addresses.Batcher)(t) + miner.ActL1EndBlock(t) + + sequencer.ActL1HeadSignal(t) + sequencer.ActL2PipelineFull(t) + + // After derivation pipeline, the safe head must be same as latest unsafe head + // i.e. There must be no reorg during derivation pipeline. + require.Equal(t, sequencer.L2Safe().ID(), unsafeHead) + } else { + miner.ActEmptyBlock(t) + sequencer.ActL1HeadSignal(t) + } + } + + verifier.ActL1HeadSignal(t) + verifier.ActL2PipelineFull(t) + + require.Equal(t, sequencer.L2Unsafe(), sequencer.L2Safe()) + require.Equal(t, verifier.L2Unsafe(), verifier.L2Safe()) + require.Equal(t, sequencer.L2Safe(), verifier.L2Safe()) +} + +func TestBatchEquivalence(gt *testing.T) { + t := NewDefaultTesting(gt) + log := testlog.Logger(t, log.LevelError) + + p := &e2eutils.TestParams{ + MaxSequencerDrift: 20, // larger than L1 block time we simulate in this test (12) + SequencerWindowSize: 24, + ChannelTimeout: 20, + L1BlockTime: 12, + } + // Delta activated deploy config + dp := e2eutils.MakeDeployParams(t, p) + minTs := hexutil.Uint64(0) + dp.DeployConfig.L2GenesisDeltaTimeOffset = &minTs + sdDeltaActivated := e2eutils.Setup(t, dp, defaultAlloc) + + // Delta deactivated deploy config + rcfg := *sdDeltaActivated.RollupCfg + rcfg.DeltaTime = nil + sdDeltaDeactivated := &e2eutils.SetupData{ + L1Cfg: sdDeltaActivated.L1Cfg, + L2Cfg: sdDeltaActivated.L2Cfg, + RollupCfg: &rcfg, + DeploymentsL1: sdDeltaActivated.DeploymentsL1, + } + + // Setup sequencer + miner, seqEngine, sequencer := setupSequencerTest(t, sdDeltaActivated, log) + rollupSeqCl := sequencer.RollupClient() + seqEngCl := seqEngine.EthClient() + + // Setup Delta activated spanVerifier + _, spanVerifier := setupVerifier(t, sdDeltaActivated, log, miner.L1Client(t, sdDeltaActivated.RollupCfg), miner.BlobStore(), &sync.Config{}) + + // Setup Delta deactivated spanVerifier + _, singularVerifier := setupVerifier(t, sdDeltaDeactivated, log, miner.L1Client(t, sdDeltaDeactivated.RollupCfg), miner.BlobStore(), &sync.Config{}) + + // Setup SpanBatcher + spanBatcher := NewL2Batcher(log, sdDeltaActivated.RollupCfg, &BatcherCfg{ + MinL1TxSize: 0, + MaxL1TxSize: 128_000, + BatcherKey: dp.Secrets.Batcher, + ForceSubmitSpanBatch: true, + DataAvailabilityType: batcherFlags.CalldataType, + }, rollupSeqCl, miner.EthClient(), seqEngine.EthClient(), seqEngine.EngineClient(t, sdDeltaActivated.RollupCfg)) + + // Setup SingularBatcher + singularBatcher := NewL2Batcher(log, sdDeltaDeactivated.RollupCfg, &BatcherCfg{ + MinL1TxSize: 0, + MaxL1TxSize: 128_000, + BatcherKey: dp.Secrets.Batcher, + ForceSubmitSingularBatch: true, + DataAvailabilityType: batcherFlags.CalldataType, + }, rollupSeqCl, miner.EthClient(), seqEngine.EthClient(), seqEngine.EngineClient(t, sdDeltaDeactivated.RollupCfg)) + + const numTestUsers = 5 + var privKeys [numTestUsers]*ecdsa.PrivateKey + var addrs [numTestUsers]common.Address + for i := 0; i < numTestUsers; i++ { + // Create a new test account + privateKey, err := dp.Secrets.Wallet.PrivateKey(accounts.Account{ + URL: accounts.URL{ + Path: fmt.Sprintf("m/44'/60'/0'/0/%d", 10+i), + }, + }) + privKeys[i] = privateKey + addr := crypto.PubkeyToAddress(privateKey.PublicKey) + require.NoError(t, err) + addrs[i] = addr + } + + miner.ActEmptyBlock(t) + sequencer.ActL1HeadSignal(t) + sequencer.ActL2PipelineFull(t) + totalTxCount := 0 + // Build random blocks + for sequencer.engine.UnsafeL2Head().L1Origin.Number < sequencer.l1State.L1Head().Number { + sequencer.ActL2StartBlock(t) + // fill the block with random number of L2 txs + for j := 0; j < rand.Intn(3); j++ { + userIdx := totalTxCount % numTestUsers + signer := types.LatestSigner(sdDeltaActivated.L2Cfg.Config) + data := make([]byte, rand.Intn(100)) + _, err := crand.Read(data[:]) // fill with random bytes + require.NoError(t, err) + gas, err := core.IntrinsicGas(data, nil, false, true, true, false) + require.NoError(t, err) + baseFee := seqEngine.l2Chain.CurrentBlock().BaseFee + nonce, err := seqEngCl.PendingNonceAt(t.Ctx(), addrs[userIdx]) + require.NoError(t, err) + tx := types.MustSignNewTx(privKeys[userIdx], signer, &types.DynamicFeeTx{ + ChainID: sdDeltaActivated.L2Cfg.Config.ChainID, + Nonce: nonce, + GasTipCap: big.NewInt(2 * params.GWei), + GasFeeCap: new(big.Int).Add(new(big.Int).Mul(baseFee, big.NewInt(2)), big.NewInt(2*params.GWei)), + Gas: gas, + To: &dp.Addresses.Bob, + Value: big.NewInt(0), + Data: data, + }) + require.NoError(gt, seqEngCl.SendTransaction(t.Ctx(), tx)) + seqEngine.ActL2IncludeTx(addrs[userIdx])(t) + totalTxCount += 1 + } + sequencer.ActL2EndBlock(t) + } + + // Submit SpanBatch + spanBatcher.ActSubmitAll(t) + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(dp.Addresses.Batcher)(t) + miner.ActL1EndBlock(t) + + // Run derivation pipeline for verifiers + spanVerifier.ActL1HeadSignal(t) + spanVerifier.ActL2PipelineFull(t) + singularVerifier.ActL1HeadSignal(t) + singularVerifier.ActL2PipelineFull(t) + + // Delta activated spanVerifier must be synced + require.Equal(t, spanVerifier.L2Safe(), sequencer.L2Unsafe()) + // Delta deactivated spanVerifier could not derive SpanBatch + require.Equal(t, singularVerifier.L2Safe().Number, uint64(0)) + + // Submit SingularBatches + singularBatcher.ActSubmitAll(t) + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(dp.Addresses.Batcher)(t) + miner.ActL1EndBlock(t) + + // Run derivation pipeline for verifiers + spanVerifier.ActL1HeadSignal(t) + spanVerifier.ActL2PipelineFull(t) + singularVerifier.ActL1HeadSignal(t) + singularVerifier.ActL2PipelineFull(t) + + // Delta deactivated spanVerifier must be synced + require.Equal(t, spanVerifier.L2Safe(), singularVerifier.L2Safe()) +} diff --git a/op-e2e2/actions/sync_test.go b/op-e2e2/actions/sync_test.go new file mode 100644 index 000000000000..df4182a9cef8 --- /dev/null +++ b/op-e2e2/actions/sync_test.go @@ -0,0 +1,1042 @@ +package actions + +import ( + "errors" + "math/big" + "math/rand" + "testing" + "time" + + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils" + "github.com/ethereum-optimism/optimism/op-node/rollup/derive" + "github.com/ethereum-optimism/optimism/op-node/rollup/sync" + "github.com/ethereum-optimism/optimism/op-service/eth" + "github.com/ethereum-optimism/optimism/op-service/sources" + "github.com/ethereum-optimism/optimism/op-service/testlog" + "github.com/ethereum-optimism/optimism/op-service/testutils" + + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/beacon/engine" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/params" + "github.com/stretchr/testify/require" +) + +func newSpanChannelOut(t StatefulTesting, e e2eutils.SetupData) derive.ChannelOut { + channelOut, err := derive.NewSpanChannelOut(e.RollupCfg.Genesis.L2Time, e.RollupCfg.L2ChainID, 128_000, derive.Zlib) + require.NoError(t, err) + return channelOut +} + +// TestSyncBatchType run each sync test case in singular batch mode and span batch mode. +func TestSyncBatchType(t *testing.T) { + tests := []struct { + name string + f func(gt *testing.T, deltaTimeOffset *hexutil.Uint64) + }{ + {"DerivationWithFlakyL1RPC", DerivationWithFlakyL1RPC}, + {"FinalizeWhileSyncing", FinalizeWhileSyncing}, + } + for _, test := range tests { + test := test + t.Run(test.name+"_SingularBatch", func(t *testing.T) { + test.f(t, nil) + }) + } + + deltaTimeOffset := hexutil.Uint64(0) + for _, test := range tests { + test := test + t.Run(test.name+"_SpanBatch", func(t *testing.T) { + test.f(t, &deltaTimeOffset) + }) + } +} + +func DerivationWithFlakyL1RPC(gt *testing.T, deltaTimeOffset *hexutil.Uint64) { + t := NewDefaultTesting(gt) + dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) + dp.DeployConfig.L2GenesisDeltaTimeOffset = deltaTimeOffset + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelError) // mute all the temporary derivation errors that we forcefully create + _, _, miner, sequencer, _, verifier, _, batcher := setupReorgTestActors(t, dp, sd, log) + + rng := rand.New(rand.NewSource(1234)) + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + + // build a L1 chain with 20 blocks and matching L2 chain and batches to test some derivation work + miner.ActEmptyBlock(t) + for i := 0; i < 20; i++ { + sequencer.ActL1HeadSignal(t) + sequencer.ActL2PipelineFull(t) + sequencer.ActBuildToL1Head(t) + batcher.ActSubmitAll(t) + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(batcher.batcherAddr)(t) + miner.ActL1EndBlock(t) + } + // Make verifier aware of head + verifier.ActL1HeadSignal(t) + + // Now make the L1 RPC very flaky: requests will randomly fail with 50% chance + miner.MockL1RPCErrors(func() error { + if rng.Intn(2) == 0 { + return errors.New("mock rpc error") + } + return nil + }) + + // And sync the verifier + verifier.ActL2PipelineFull(t) + // Verifier should be synced, even though it hit lots of temporary L1 RPC errors + require.Equal(t, sequencer.L2Unsafe(), verifier.L2Safe(), "verifier is synced") +} + +func FinalizeWhileSyncing(gt *testing.T, deltaTimeOffset *hexutil.Uint64) { + t := NewDefaultTesting(gt) + dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) + dp.DeployConfig.L2GenesisDeltaTimeOffset = deltaTimeOffset + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelError) // mute all the temporary derivation errors that we forcefully create + _, _, miner, sequencer, _, verifier, _, batcher := setupReorgTestActors(t, dp, sd, log) + + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + + verifierStartStatus := verifier.SyncStatus() + + // Build an L1 chain with 64 + 1 blocks, containing batches of L2 chain. + // Enough to go past the finalityDelay of the engine queue, + // to make the verifier finalize while it syncs. + miner.ActEmptyBlock(t) + for i := 0; i < 64+1; i++ { + sequencer.ActL1HeadSignal(t) + sequencer.ActL2PipelineFull(t) + sequencer.ActBuildToL1Head(t) + batcher.ActSubmitAll(t) + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(batcher.batcherAddr)(t) + miner.ActL1EndBlock(t) + } + l1Head := miner.l1Chain.CurrentHeader() + // finalize all of L1 + miner.ActL1Safe(t, l1Head.Number.Uint64()) + miner.ActL1Finalize(t, l1Head.Number.Uint64()) + + // Now signal L1 finality to the verifier, while the verifier is not synced. + verifier.ActL1HeadSignal(t) + verifier.ActL1SafeSignal(t) + verifier.ActL1FinalizedSignal(t) + + // Now sync the verifier, without repeating the signal. + // While it's syncing, it should finalize on interval now, based on the future L1 finalized block it remembered. + verifier.ActL2PipelineFull(t) + + // Verify the verifier finalized something new + require.Less(t, verifierStartStatus.FinalizedL2.Number, verifier.SyncStatus().FinalizedL2.Number, "verifier finalized L2 blocks during sync") +} + +// TestUnsafeSync tests that a verifier properly imports unsafe blocks via gossip. +func TestUnsafeSync(gt *testing.T) { + t := NewDefaultTesting(gt) + dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelInfo) + + sd, _, _, sequencer, seqEng, verifier, _, _ := setupReorgTestActors(t, dp, sd, log) + seqEngCl, err := sources.NewEngineClient(seqEng.RPCClient(), log, nil, sources.EngineClientDefaultConfig(sd.RollupCfg)) + require.NoError(t, err) + + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + + for i := 0; i < 10; i++ { + // Build a L2 block + sequencer.ActL2StartBlock(t) + sequencer.ActL2EndBlock(t) + // Notify new L2 block to verifier by unsafe gossip + seqHead, err := seqEngCl.PayloadByLabel(t.Ctx(), eth.Unsafe) + require.NoError(t, err) + verifier.ActL2UnsafeGossipReceive(seqHead)(t) + // Handle unsafe payload + verifier.ActL2PipelineFull(t) + // Verifier must advance its unsafe head. + require.Equal(t, sequencer.L2Unsafe().Hash, verifier.L2Unsafe().Hash) + } +} + +func TestBackupUnsafe(gt *testing.T) { + t := NewDefaultTesting(gt) + dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) + minTs := hexutil.Uint64(0) + // Activate Delta hardfork + dp.DeployConfig.L2GenesisDeltaTimeOffset = &minTs + dp.DeployConfig.L2BlockTime = 2 + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LvlInfo) + _, dp, miner, sequencer, seqEng, verifier, _, batcher := setupReorgTestActors(t, dp, sd, log) + l2Cl := seqEng.EthClient() + seqEngCl, err := sources.NewEngineClient(seqEng.RPCClient(), log, nil, sources.EngineClientDefaultConfig(sd.RollupCfg)) + require.NoError(t, err) + + rng := rand.New(rand.NewSource(1234)) + signer := types.LatestSigner(sd.L2Cfg.Config) + + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + + // Create block A1 ~ A5 + for i := 0; i < 5; i++ { + // Build a L2 block + sequencer.ActL2StartBlock(t) + sequencer.ActL2EndBlock(t) + + // Notify new L2 block to verifier by unsafe gossip + seqHead, err := seqEngCl.PayloadByLabel(t.Ctx(), eth.Unsafe) + require.NoError(t, err) + verifier.ActL2UnsafeGossipReceive(seqHead)(t) + } + + seqHead, err := seqEngCl.PayloadByLabel(t.Ctx(), eth.Unsafe) + require.NoError(t, err) + // eventually correct hash for A5 + targetUnsafeHeadHash := seqHead.ExecutionPayload.BlockHash + + // only advance unsafe head to A5 + require.Equal(t, sequencer.L2Unsafe().Number, uint64(5)) + require.Equal(t, sequencer.L2Safe().Number, uint64(0)) + + // Handle unsafe payload + verifier.ActL2PipelineFull(t) + // only advance unsafe head to A5 + require.Equal(t, verifier.L2Unsafe().Number, uint64(5)) + require.Equal(t, verifier.L2Safe().Number, uint64(0)) + + channelOut := newSpanChannelOut(t, *sd) + + for i := uint64(1); i <= sequencer.L2Unsafe().Number; i++ { + block, err := l2Cl.BlockByNumber(t.Ctx(), new(big.Int).SetUint64(i)) + require.NoError(t, err) + if i == 2 { + // Make block B2 as an valid block different with unsafe block + // Alice makes a L2 tx + n, err := l2Cl.PendingNonceAt(t.Ctx(), dp.Addresses.Alice) + require.NoError(t, err) + validTx := types.MustSignNewTx(dp.Secrets.Alice, signer, &types.DynamicFeeTx{ + ChainID: sd.L2Cfg.Config.ChainID, + Nonce: n, + GasTipCap: big.NewInt(2 * params.GWei), + GasFeeCap: new(big.Int).Add(miner.l1Chain.CurrentBlock().BaseFee, big.NewInt(2*params.GWei)), + Gas: params.TxGas, + To: &dp.Addresses.Bob, + Value: e2eutils.Ether(2), + }) + block = block.WithBody([]*types.Transaction{block.Transactions()[0], validTx}, []*types.Header{}) + } + if i == 3 { + // Make block B3 as an invalid block + invalidTx := testutils.RandomTx(rng, big.NewInt(100), signer) + block = block.WithBody([]*types.Transaction{block.Transactions()[0], invalidTx}, []*types.Header{}) + } + // Add A1, B2, B3, B4, B5 into the channel + err = channelOut.AddBlock(sd.RollupCfg, block) + require.NoError(t, err) + } + + // Submit span batch(A1, B2, invalid B3, B4, B5) + batcher.l2ChannelOut = channelOut + batcher.ActL2ChannelClose(t) + batcher.ActL2BatchSubmit(t) + + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(dp.Addresses.Batcher)(t) + miner.ActL1EndBlock(t) + + // let sequencer process invalid span batch + sequencer.ActL1HeadSignal(t) + // before stepping, make sure backupUnsafe is empty + require.Equal(t, eth.L2BlockRef{}, sequencer.L2BackupUnsafe()) + // pendingSafe must not be advanced as well + require.Equal(t, sequencer.L2PendingSafe().Number, uint64(0)) + // Preheat engine queue and consume A1 from batch + for i := 0; i < 4; i++ { + sequencer.ActL2PipelineStep(t) + } + // A1 is valid original block so pendingSafe is advanced + require.Equal(t, sequencer.L2PendingSafe().Number, uint64(1)) + require.Equal(t, sequencer.L2Unsafe().Number, uint64(5)) + // backupUnsafe is still empty + require.Equal(t, eth.L2BlockRef{}, sequencer.L2BackupUnsafe()) + + // Process B2 + sequencer.ActL2PipelineStep(t) + sequencer.ActL2PipelineStep(t) + // B2 is valid different block, triggering unsafe chain reorg + require.Equal(t, sequencer.L2Unsafe().Number, uint64(2)) + // B2 is valid different block, triggering unsafe block backup + require.Equal(t, targetUnsafeHeadHash, sequencer.L2BackupUnsafe().Hash) + // B2 is valid different block, so pendingSafe is advanced + require.Equal(t, sequencer.L2PendingSafe().Number, uint64(2)) + // try to process invalid leftovers: B3, B4, B5 + sequencer.ActL2PipelineFull(t) + // backupUnsafe is used because A3 is invalid. Check backupUnsafe is emptied after used + require.Equal(t, eth.L2BlockRef{}, sequencer.L2BackupUnsafe()) + + // check pendingSafe is reset + require.Equal(t, sequencer.L2PendingSafe().Number, uint64(0)) + // check backupUnsafe is applied + require.Equal(t, sequencer.L2Unsafe().Hash, targetUnsafeHeadHash) + require.Equal(t, sequencer.L2Unsafe().Number, uint64(5)) + // safe head cannot be advanced because batch contained invalid blocks + require.Equal(t, sequencer.L2Safe().Number, uint64(0)) + + // let verifier process invalid span batch + verifier.ActL1HeadSignal(t) + verifier.ActL2PipelineFull(t) + + // safe head cannot be advanced, while unsafe head not changed + require.Equal(t, verifier.L2Unsafe().Number, uint64(5)) + require.Equal(t, verifier.L2Safe().Number, uint64(0)) + require.Equal(t, verifier.L2Unsafe().Hash, targetUnsafeHeadHash) + + // Build and submit a span batch with A1 ~ A5 + batcher.ActSubmitAll(t) + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(dp.Addresses.Batcher)(t) + miner.ActL1EndBlock(t) + + // let sequencer process valid span batch + sequencer.ActL1HeadSignal(t) + sequencer.ActL2PipelineFull(t) + + // safe/unsafe head must be advanced + require.Equal(t, sequencer.L2Unsafe().Number, uint64(5)) + require.Equal(t, sequencer.L2Safe().Number, uint64(5)) + require.Equal(t, sequencer.L2Safe().Hash, targetUnsafeHeadHash) + // check backupUnsafe is emptied after consolidation + require.Equal(t, eth.L2BlockRef{}, sequencer.L2BackupUnsafe()) + + // let verifier process valid span batch + verifier.ActL1HeadSignal(t) + verifier.ActL2PipelineFull(t) + + // safe and unsafe head must be advanced + require.Equal(t, verifier.L2Unsafe().Number, uint64(5)) + require.Equal(t, verifier.L2Safe().Number, uint64(5)) + require.Equal(t, verifier.L2Safe().Hash, targetUnsafeHeadHash) + // check backupUnsafe is emptied after consolidation + require.Equal(t, eth.L2BlockRef{}, verifier.L2BackupUnsafe()) +} + +func TestBackupUnsafeReorgForkChoiceInputError(gt *testing.T) { + t := NewDefaultTesting(gt) + dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) + minTs := hexutil.Uint64(0) + // Activate Delta hardfork + dp.DeployConfig.L2GenesisDeltaTimeOffset = &minTs + dp.DeployConfig.L2BlockTime = 2 + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LvlInfo) + _, dp, miner, sequencer, seqEng, verifier, _, batcher := setupReorgTestActors(t, dp, sd, log) + l2Cl := seqEng.EthClient() + seqEngCl, err := sources.NewEngineClient(seqEng.RPCClient(), log, nil, sources.EngineClientDefaultConfig(sd.RollupCfg)) + require.NoError(t, err) + + rng := rand.New(rand.NewSource(1234)) + signer := types.LatestSigner(sd.L2Cfg.Config) + + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + + // Create block A1 ~ A5 + for i := 0; i < 5; i++ { + // Build a L2 block + sequencer.ActL2StartBlock(t) + sequencer.ActL2EndBlock(t) + + // Notify new L2 block to verifier by unsafe gossip + seqHead, err := seqEngCl.PayloadByLabel(t.Ctx(), eth.Unsafe) + require.NoError(t, err) + verifier.ActL2UnsafeGossipReceive(seqHead)(t) + } + + seqHead, err := seqEngCl.PayloadByLabel(t.Ctx(), eth.Unsafe) + require.NoError(t, err) + // eventually correct hash for A5 + targetUnsafeHeadHash := seqHead.ExecutionPayload.BlockHash + + // only advance unsafe head to A5 + require.Equal(t, sequencer.L2Unsafe().Number, uint64(5)) + require.Equal(t, sequencer.L2Safe().Number, uint64(0)) + + // Handle unsafe payload + verifier.ActL2PipelineFull(t) + // only advance unsafe head to A5 + require.Equal(t, verifier.L2Unsafe().Number, uint64(5)) + require.Equal(t, verifier.L2Safe().Number, uint64(0)) + + channelOut := newSpanChannelOut(t, *sd) + + for i := uint64(1); i <= sequencer.L2Unsafe().Number; i++ { + block, err := l2Cl.BlockByNumber(t.Ctx(), new(big.Int).SetUint64(i)) + require.NoError(t, err) + if i == 2 { + // Make block B2 as an valid block different with unsafe block + // Alice makes a L2 tx + n, err := l2Cl.PendingNonceAt(t.Ctx(), dp.Addresses.Alice) + require.NoError(t, err) + validTx := types.MustSignNewTx(dp.Secrets.Alice, signer, &types.DynamicFeeTx{ + ChainID: sd.L2Cfg.Config.ChainID, + Nonce: n, + GasTipCap: big.NewInt(2 * params.GWei), + GasFeeCap: new(big.Int).Add(miner.l1Chain.CurrentBlock().BaseFee, big.NewInt(2*params.GWei)), + Gas: params.TxGas, + To: &dp.Addresses.Bob, + Value: e2eutils.Ether(2), + }) + block = block.WithBody([]*types.Transaction{block.Transactions()[0], validTx}, []*types.Header{}) + } + if i == 3 { + // Make block B3 as an invalid block + invalidTx := testutils.RandomTx(rng, big.NewInt(100), signer) + block = block.WithBody([]*types.Transaction{block.Transactions()[0], invalidTx}, []*types.Header{}) + } + // Add A1, B2, B3, B4, B5 into the channel + err = channelOut.AddBlock(sd.RollupCfg, block) + require.NoError(t, err) + } + + // Submit span batch(A1, B2, invalid B3, B4, B5) + batcher.l2ChannelOut = channelOut + batcher.ActL2ChannelClose(t) + batcher.ActL2BatchSubmit(t) + + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(dp.Addresses.Batcher)(t) + miner.ActL1EndBlock(t) + + // let sequencer process invalid span batch + sequencer.ActL1HeadSignal(t) + // before stepping, make sure backupUnsafe is empty + require.Equal(t, eth.L2BlockRef{}, sequencer.L2BackupUnsafe()) + // pendingSafe must not be advanced as well + require.Equal(t, sequencer.L2PendingSafe().Number, uint64(0)) + // Preheat engine queue and consume A1 from batch + for i := 0; i < 4; i++ { + sequencer.ActL2PipelineStep(t) + } + // A1 is valid original block so pendingSafe is advanced + require.Equal(t, sequencer.L2PendingSafe().Number, uint64(1)) + require.Equal(t, sequencer.L2Unsafe().Number, uint64(5)) + // backupUnsafe is still empty + require.Equal(t, eth.L2BlockRef{}, sequencer.L2BackupUnsafe()) + + // Process B2 + sequencer.ActL2PipelineStep(t) + sequencer.ActL2PipelineStep(t) + // B2 is valid different block, triggering unsafe chain reorg + require.Equal(t, sequencer.L2Unsafe().Number, uint64(2)) + // B2 is valid different block, triggering unsafe block backup + require.Equal(t, targetUnsafeHeadHash, sequencer.L2BackupUnsafe().Hash) + // B2 is valid different block, so pendingSafe is advanced + require.Equal(t, sequencer.L2PendingSafe().Number, uint64(2)) + + // B3 is invalid block + // NextAttributes is called + sequencer.ActL2PipelineStep(t) + // forceNextSafeAttributes is called + sequencer.ActL2PipelineStep(t) + // mock forkChoiceUpdate error while restoring previous unsafe chain using backupUnsafe. + seqEng.ActL2RPCFail(t, eth.InputError{Inner: errors.New("mock L2 RPC error"), Code: eth.InvalidForkchoiceState}) + + // TryBackupUnsafeReorg is called + sequencer.ActL2PipelineStep(t) + + // try to process invalid leftovers: B4, B5 + sequencer.ActL2PipelineFull(t) + + // backupUnsafe is not used because forkChoiceUpdate returned an error. + // Check backupUnsafe is emptied. + require.Equal(t, eth.L2BlockRef{}, sequencer.L2BackupUnsafe()) + + // check pendingSafe is reset + require.Equal(t, sequencer.L2PendingSafe().Number, uint64(0)) + // unsafe head is not restored due to forkchoiceUpdate error in TryBackupUnsafeReorg + require.Equal(t, sequencer.L2Unsafe().Number, uint64(2)) + // safe head cannot be advanced because batch contained invalid blocks + require.Equal(t, sequencer.L2Safe().Number, uint64(0)) +} + +func TestBackupUnsafeReorgForkChoiceNotInputError(gt *testing.T) { + t := NewDefaultTesting(gt) + dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) + minTs := hexutil.Uint64(0) + // Activate Delta hardfork + dp.DeployConfig.L2GenesisDeltaTimeOffset = &minTs + dp.DeployConfig.L2BlockTime = 2 + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LvlInfo) + _, dp, miner, sequencer, seqEng, verifier, _, batcher := setupReorgTestActors(t, dp, sd, log) + l2Cl := seqEng.EthClient() + seqEngCl, err := sources.NewEngineClient(seqEng.RPCClient(), log, nil, sources.EngineClientDefaultConfig(sd.RollupCfg)) + require.NoError(t, err) + + rng := rand.New(rand.NewSource(1234)) + signer := types.LatestSigner(sd.L2Cfg.Config) + + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + + // Create block A1 ~ A5 + for i := 0; i < 5; i++ { + // Build a L2 block + sequencer.ActL2StartBlock(t) + sequencer.ActL2EndBlock(t) + + // Notify new L2 block to verifier by unsafe gossip + seqHead, err := seqEngCl.PayloadByLabel(t.Ctx(), eth.Unsafe) + require.NoError(t, err) + verifier.ActL2UnsafeGossipReceive(seqHead)(t) + } + + seqHead, err := seqEngCl.PayloadByLabel(t.Ctx(), eth.Unsafe) + require.NoError(t, err) + // eventually correct hash for A5 + targetUnsafeHeadHash := seqHead.ExecutionPayload.BlockHash + + // only advance unsafe head to A5 + require.Equal(t, sequencer.L2Unsafe().Number, uint64(5)) + require.Equal(t, sequencer.L2Safe().Number, uint64(0)) + + // Handle unsafe payload + verifier.ActL2PipelineFull(t) + // only advance unsafe head to A5 + require.Equal(t, verifier.L2Unsafe().Number, uint64(5)) + require.Equal(t, verifier.L2Safe().Number, uint64(0)) + + channelOut := newSpanChannelOut(t, *sd) + + for i := uint64(1); i <= sequencer.L2Unsafe().Number; i++ { + block, err := l2Cl.BlockByNumber(t.Ctx(), new(big.Int).SetUint64(i)) + require.NoError(t, err) + if i == 2 { + // Make block B2 as an valid block different with unsafe block + // Alice makes a L2 tx + n, err := l2Cl.PendingNonceAt(t.Ctx(), dp.Addresses.Alice) + require.NoError(t, err) + validTx := types.MustSignNewTx(dp.Secrets.Alice, signer, &types.DynamicFeeTx{ + ChainID: sd.L2Cfg.Config.ChainID, + Nonce: n, + GasTipCap: big.NewInt(2 * params.GWei), + GasFeeCap: new(big.Int).Add(miner.l1Chain.CurrentBlock().BaseFee, big.NewInt(2*params.GWei)), + Gas: params.TxGas, + To: &dp.Addresses.Bob, + Value: e2eutils.Ether(2), + }) + block = block.WithBody([]*types.Transaction{block.Transactions()[0], validTx}, []*types.Header{}) + } + if i == 3 { + // Make block B3 as an invalid block + invalidTx := testutils.RandomTx(rng, big.NewInt(100), signer) + block = block.WithBody([]*types.Transaction{block.Transactions()[0], invalidTx}, []*types.Header{}) + } + // Add A1, B2, B3, B4, B5 into the channel + err = channelOut.AddBlock(sd.RollupCfg, block) + require.NoError(t, err) + } + + // Submit span batch(A1, B2, invalid B3, B4, B5) + batcher.l2ChannelOut = channelOut + batcher.ActL2ChannelClose(t) + batcher.ActL2BatchSubmit(t) + + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(dp.Addresses.Batcher)(t) + miner.ActL1EndBlock(t) + + // let sequencer process invalid span batch + sequencer.ActL1HeadSignal(t) + // before stepping, make sure backupUnsafe is empty + require.Equal(t, eth.L2BlockRef{}, sequencer.L2BackupUnsafe()) + // pendingSafe must not be advanced as well + require.Equal(t, sequencer.L2PendingSafe().Number, uint64(0)) + // Preheat engine queue and consume A1 from batch + for i := 0; i < 4; i++ { + sequencer.ActL2PipelineStep(t) + } + // A1 is valid original block so pendingSafe is advanced + require.Equal(t, sequencer.L2PendingSafe().Number, uint64(1)) + require.Equal(t, sequencer.L2Unsafe().Number, uint64(5)) + // backupUnsafe is still empty + require.Equal(t, eth.L2BlockRef{}, sequencer.L2BackupUnsafe()) + + // Process B2 + sequencer.ActL2PipelineStep(t) + sequencer.ActL2PipelineStep(t) + // B2 is valid different block, triggering unsafe chain reorg + require.Equal(t, sequencer.L2Unsafe().Number, uint64(2)) + // B2 is valid different block, triggering unsafe block backup + require.Equal(t, targetUnsafeHeadHash, sequencer.L2BackupUnsafe().Hash) + // B2 is valid different block, so pendingSafe is advanced + require.Equal(t, sequencer.L2PendingSafe().Number, uint64(2)) + + // B3 is invalid block + // NextAttributes is called + sequencer.ActL2PipelineStep(t) + // forceNextSafeAttributes is called + sequencer.ActL2PipelineStep(t) + + serverErrCnt := 2 + for i := 0; i < serverErrCnt; i++ { + // mock forkChoiceUpdate failure while restoring previous unsafe chain using backupUnsafe. + seqEng.ActL2RPCFail(t, engine.GenericServerError) + // TryBackupUnsafeReorg is called - forkChoiceUpdate returns GenericServerError so retry + sequencer.ActL2PipelineStep(t) + // backupUnsafeHead not emptied yet + require.Equal(t, targetUnsafeHeadHash, sequencer.L2BackupUnsafe().Hash) + } + // now forkchoice succeeds + // try to process invalid leftovers: B4, B5 + sequencer.ActL2PipelineFull(t) + + // backupUnsafe is used because forkChoiceUpdate eventually succeeded. + // Check backupUnsafe is emptied. + require.Equal(t, eth.L2BlockRef{}, sequencer.L2BackupUnsafe()) + + // check pendingSafe is reset + require.Equal(t, sequencer.L2PendingSafe().Number, uint64(0)) + // check backupUnsafe is applied + require.Equal(t, sequencer.L2Unsafe().Hash, targetUnsafeHeadHash) + require.Equal(t, sequencer.L2Unsafe().Number, uint64(5)) + // safe head cannot be advanced because batch contained invalid blocks + require.Equal(t, sequencer.L2Safe().Number, uint64(0)) +} + +// TestELSync tests that a verifier will have the EL import the full chain from the sequencer +// when passed a single unsafe block. op-geth can either snap sync or full sync here. +func TestELSync(gt *testing.T) { + t := NewDefaultTesting(gt) + dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelInfo) + + miner, seqEng, sequencer := setupSequencerTest(t, sd, log) + // Enable engine P2P sync + verEng, verifier := setupVerifier(t, sd, log, miner.L1Client(t, sd.RollupCfg), miner.BlobStore(), &sync.Config{SyncMode: sync.ELSync}) + + seqEngCl, err := sources.NewEngineClient(seqEng.RPCClient(), log, nil, sources.EngineClientDefaultConfig(sd.RollupCfg)) + require.NoError(t, err) + + sequencer.ActL2PipelineFull(t) + + // Build 10 L1 blocks on the sequencer + for i := 0; i < 10; i++ { + // Build a L2 block + sequencer.ActL2StartBlock(t) + sequencer.ActL2EndBlock(t) + } + + // Wait longer to peer. This tests flakes or takes a long time when the op-geth instances are not able to peer. + verEng.AddPeers(seqEng.Enode()) + + // Insert it on the verifier + seqHead, err := seqEngCl.PayloadByLabel(t.Ctx(), eth.Unsafe) + require.NoError(t, err) + seqStart, err := seqEngCl.PayloadByNumber(t.Ctx(), 1) + require.NoError(t, err) + verifier.ActL2InsertUnsafePayload(seqHead)(t) + + require.Eventually(t, + func() bool { + return seqEng.PeerCount() > 0 && verEng.PeerCount() > 0 + }, + 120*time.Second, 1500*time.Millisecond, + "Sequencer & Verifier must peer with each other for snap sync to work", + ) + + // Expect snap sync to download & execute the entire chain + // Verify this by checking that the verifier has the correct value for block 1 + require.Eventually(t, + func() bool { + block, err := verifier.eng.L2BlockRefByNumber(t.Ctx(), 1) + if err != nil { + return false + } + return seqStart.ExecutionPayload.BlockHash == block.Hash + }, + 60*time.Second, 1500*time.Millisecond, + "verifier did not snap sync", + ) +} + +// TestELSyncTransitionstoCL tests that a verifier which starts with EL sync can switch back to a proper CL sync. +// It takes a sequencer & verifier through the following: +// 1. Build 10 unsafe blocks on the sequencer +// 2. Snap sync those blocks to the verifier +// 3. Build & insert 1 unsafe block from the sequencer to the verifier to end snap sync +// 4. Batch submit everything +// 5. Build 10 more unsafe blocks on the sequencer +// 6. Gossip in the highest block to the verifier. **Expect that it does not snap sync** +// 7. Then gossip the rest of the blocks to the verifier. Once this is complete it should pick up all of the unsafe blocks. +// Prior to this PR, the test would fail at this point. +// 8. Create 1 more block & batch submit everything & assert that the verifier picked up those blocks +func TestELSyncTransitionstoCL(gt *testing.T) { + t := NewDefaultTesting(gt) + dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) + sd := e2eutils.Setup(t, dp, defaultAlloc) + logger := testlog.Logger(t, log.LevelInfo) + + captureLog, captureLogHandler := testlog.CaptureLogger(t, log.LevelInfo) + + miner, seqEng, sequencer := setupSequencerTest(t, sd, logger) + batcher := NewL2Batcher(logger, sd.RollupCfg, DefaultBatcherCfg(dp), sequencer.RollupClient(), miner.EthClient(), seqEng.EthClient(), seqEng.EngineClient(t, sd.RollupCfg)) + // Enable engine P2P sync + verEng, verifier := setupVerifier(t, sd, captureLog, miner.L1Client(t, sd.RollupCfg), miner.BlobStore(), &sync.Config{SyncMode: sync.ELSync}) + + seqEngCl, err := sources.NewEngineClient(seqEng.RPCClient(), logger, nil, sources.EngineClientDefaultConfig(sd.RollupCfg)) + require.NoError(t, err) + + miner.ActEmptyBlock(t) + sequencer.ActL2PipelineFull(t) + + // Build 10 L1 blocks on the sequencer + for i := 0; i < 10; i++ { + // Build a L2 block + sequencer.ActL2StartBlock(t) + sequencer.ActL2EndBlock(t) + } + + // Wait longer to peer. This tests flakes or takes a long time when the op-geth instances are not able to peer. + verEng.AddPeers(seqEng.Enode()) + + // Insert it on the verifier + seqHead, err := seqEngCl.PayloadByLabel(t.Ctx(), eth.Unsafe) + require.NoError(t, err) + seqStart, err := seqEngCl.PayloadByNumber(t.Ctx(), 1) + require.NoError(t, err) + verifier.ActL2InsertUnsafePayload(seqHead)(t) + + require.Eventually(t, + func() bool { + return seqEng.PeerCount() > 0 && verEng.PeerCount() > 0 + }, + 120*time.Second, 1500*time.Millisecond, + "Sequencer & Verifier must peer with each other for snap sync to work", + ) + + // Expect snap sync to download & execute the entire chain + // Verify this by checking that the verifier has the correct value for block 1 + require.Eventually(t, + func() bool { + block, err := verifier.eng.L2BlockRefByNumber(t.Ctx(), 1) + if err != nil { + return false + } + return seqStart.ExecutionPayload.BlockHash == block.Hash + }, + 60*time.Second, 1500*time.Millisecond, + "verifier did not snap sync", + ) + // Despite downloading the blocks, it has not finished finalizing + _, err = verifier.eng.L2BlockRefByLabel(t.Ctx(), "safe") + require.ErrorIs(t, err, ethereum.NotFound) + + // Insert a block on the verifier to end snap sync + sequencer.ActL2StartBlock(t) + sequencer.ActL2EndBlock(t) + seqHead, err = seqEngCl.PayloadByLabel(t.Ctx(), eth.Unsafe) + require.NoError(t, err) + verifier.ActL2InsertUnsafePayload(seqHead)(t) + + // Check that safe + finalized are there + id, err := verifier.eng.L2BlockRefByLabel(t.Ctx(), eth.Safe) + require.Equal(t, uint64(11), id.Number) + require.NoError(t, err) + id, err = verifier.eng.L2BlockRefByLabel(t.Ctx(), eth.Finalized) + require.Equal(t, uint64(11), id.Number) + require.NoError(t, err) + + // Batch submit everything + sequencer.ActL2StartBlock(t) + sequencer.ActL2EndBlock(t) + batcher.ActSubmitAll(t) + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(dp.Addresses.Batcher)(t) + miner.ActL1EndBlock(t) + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + + // Verify that the batch submitted blocks are there now + id, err = sequencer.eng.L2BlockRefByLabel(t.Ctx(), eth.Safe) + require.NoError(t, err) + require.Equal(t, uint64(12), id.Number) + id, err = verifier.eng.L2BlockRefByLabel(t.Ctx(), eth.Safe) + require.NoError(t, err) + require.Equal(t, uint64(12), id.Number) + + // Build another 10 L1 blocks on the sequencer + for i := 0; i < 10; i++ { + // Build a L2 block + sequencer.ActL2StartBlock(t) + sequencer.ActL2EndBlock(t) + } + + // Now pass payloads to the derivation pipeline + // This is a little hacky that we have to manually switch between InsertBlock + // and UnsafeGossipReceive in the tests + seqHead, err = seqEngCl.PayloadByLabel(t.Ctx(), eth.Unsafe) + require.NoError(t, err) + verifier.ActL2UnsafeGossipReceive(seqHead)(t) + verifier.ActL2PipelineFull(t) + // Verify that the derivation pipeline did not request a sync to the new head. This is the core of the test, but a little fragile. + record := captureLogHandler.FindLog(testlog.NewMessageFilter("Forkchoice requested sync to new head"), testlog.NewAttributesFilter("number", "22")) + require.Nil(t, record, "The verifier should not request to sync to block number 22 because it is in CL mode, not EL mode at this point.") + + for i := 13; i < 23; i++ { + seqHead, err = seqEngCl.PayloadByNumber(t.Ctx(), uint64(i)) + require.NoError(t, err) + verifier.ActL2UnsafeGossipReceive(seqHead)(t) + } + verifier.ActL2PipelineFull(t) + + // Verify that the unsafe blocks are there now + // This was failing prior to PR 9661 because op-node would attempt to immediately insert blocks into the EL inside the engine queue. op-geth + // would not be able to fetch the second range of blocks & it would wipe out the unsafe payloads queue because op-node thought that it had a + // higher unsafe block but op-geth did not. + id, err = verifier.eng.L2BlockRefByLabel(t.Ctx(), eth.Unsafe) + require.NoError(t, err) + require.Equal(t, uint64(22), id.Number) + + // Create 1 more block & batch submit everything + sequencer.ActL2StartBlock(t) + sequencer.ActL2EndBlock(t) + batcher.ActSubmitAll(t) + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(dp.Addresses.Batcher)(t) + miner.ActL1EndBlock(t) + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + + // Verify that the batch submitted blocks are there now + id, err = sequencer.eng.L2BlockRefByLabel(t.Ctx(), eth.Safe) + require.NoError(t, err) + require.Equal(t, uint64(23), id.Number) + id, err = verifier.eng.L2BlockRefByLabel(t.Ctx(), eth.Safe) + require.NoError(t, err) + require.Equal(t, uint64(23), id.Number) +} + +func TestInvalidPayloadInSpanBatch(gt *testing.T) { + t := NewDefaultTesting(gt) + dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) + minTs := hexutil.Uint64(0) + // Activate Delta hardfork + dp.DeployConfig.L2GenesisDeltaTimeOffset = &minTs + dp.DeployConfig.L2BlockTime = 2 + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelInfo) + _, _, miner, sequencer, seqEng, verifier, _, batcher := setupReorgTestActors(t, dp, sd, log) + l2Cl := seqEng.EthClient() + rng := rand.New(rand.NewSource(1234)) + signer := types.LatestSigner(sd.L2Cfg.Config) + + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + + channelOut := newSpanChannelOut(t, *sd) + + // Create block A1 ~ A12 for L1 block #0 ~ #2 + miner.ActEmptyBlock(t) + miner.ActEmptyBlock(t) + sequencer.ActL1HeadSignal(t) + sequencer.ActBuildToL1HeadUnsafe(t) + + for i := uint64(1); i <= sequencer.L2Unsafe().Number; i++ { + block, err := l2Cl.BlockByNumber(t.Ctx(), new(big.Int).SetUint64(i)) + require.NoError(t, err) + if i == 8 { + // Make block A8 as an invalid block + invalidTx := testutils.RandomTx(rng, big.NewInt(100), signer) + block = block.WithBody([]*types.Transaction{block.Transactions()[0], invalidTx}, []*types.Header{}) + } + // Add A1 ~ A12 into the channel + err = channelOut.AddBlock(sd.RollupCfg, block) + require.NoError(t, err) + } + + // Submit span batch(A1, ..., A7, invalid A8, A9, ..., A12) + batcher.l2ChannelOut = channelOut + batcher.ActL2ChannelClose(t) + batcher.ActL2BatchSubmit(t) + + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(dp.Addresses.Batcher)(t) + miner.ActL1EndBlock(t) + miner.ActL1SafeNext(t) + miner.ActL1FinalizeNext(t) + + // After the verifier processed the span batch, only unsafe head should be advanced to A7. + // Safe head is not updated because the span batch is not fully processed. + verifier.ActL1HeadSignal(t) + verifier.ActL2PipelineFull(t) + require.Equal(t, verifier.L2Unsafe().Number, uint64(7)) + require.Equal(t, verifier.L2Safe().Number, uint64(0)) + + channelOut = newSpanChannelOut(t, *sd) + + for i := uint64(1); i <= sequencer.L2Unsafe().Number; i++ { + block, err := l2Cl.BlockByNumber(t.Ctx(), new(big.Int).SetUint64(i)) + require.NoError(t, err) + if i == 1 { + // Create valid TX + aliceNonce, err := seqEng.EthClient().PendingNonceAt(t.Ctx(), dp.Addresses.Alice) + require.NoError(t, err) + data := make([]byte, rand.Intn(100)) + gas, err := core.IntrinsicGas(data, nil, false, true, true, false) + require.NoError(t, err) + baseFee := seqEng.l2Chain.CurrentBlock().BaseFee + tx := types.MustSignNewTx(dp.Secrets.Alice, signer, &types.DynamicFeeTx{ + ChainID: sd.L2Cfg.Config.ChainID, + Nonce: aliceNonce, + GasTipCap: big.NewInt(2 * params.GWei), + GasFeeCap: new(big.Int).Add(new(big.Int).Mul(baseFee, big.NewInt(2)), big.NewInt(2*params.GWei)), + Gas: gas, + To: &dp.Addresses.Bob, + Value: big.NewInt(0), + Data: data, + }) + // Create valid new block B1 at the same height as A1 + block = block.WithBody([]*types.Transaction{block.Transactions()[0], tx}, []*types.Header{}) + } + // Add B1, A2 ~ A12 into the channel + err = channelOut.AddBlock(sd.RollupCfg, block) + require.NoError(t, err) + } + // Submit span batch(B1, A2, ... A12) + batcher.l2ChannelOut = channelOut + batcher.ActL2ChannelClose(t) + batcher.ActL2BatchSubmit(t) + + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(dp.Addresses.Batcher)(t) + miner.ActL1EndBlock(t) + miner.ActL1SafeNext(t) + miner.ActL1FinalizeNext(t) + + verifier.ActL1HeadSignal(t) + verifier.ActL2PipelineFull(t) + + // verifier should advance its unsafe and safe head to the height of A12. + require.Equal(t, verifier.L2Unsafe().Number, uint64(12)) + require.Equal(t, verifier.L2Safe().Number, uint64(12)) +} + +func TestSpanBatchAtomicity_Consolidation(gt *testing.T) { + t := NewDefaultTesting(gt) + dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) + minTs := hexutil.Uint64(0) + // Activate Delta hardfork + dp.DeployConfig.L2GenesisDeltaTimeOffset = &minTs + dp.DeployConfig.L2BlockTime = 2 + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelInfo) + _, _, miner, sequencer, seqEng, verifier, _, batcher := setupReorgTestActors(t, dp, sd, log) + seqEngCl, err := sources.NewEngineClient(seqEng.RPCClient(), log, nil, sources.EngineClientDefaultConfig(sd.RollupCfg)) + require.NoError(t, err) + + targetHeadNumber := uint64(6) // L1 block time / L2 block time + + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + + // Create 6 blocks + miner.ActEmptyBlock(t) + sequencer.ActL1HeadSignal(t) + sequencer.ActBuildToL1HeadUnsafe(t) + require.Equal(t, sequencer.L2Unsafe().Number, targetHeadNumber) + + // Gossip unsafe blocks to the verifier + for i := uint64(1); i <= sequencer.L2Unsafe().Number; i++ { + seqHead, err := seqEngCl.PayloadByNumber(t.Ctx(), i) + require.NoError(t, err) + verifier.ActL2UnsafeGossipReceive(seqHead)(t) + } + verifier.ActL2PipelineFull(t) + + // Check if the verifier's unsafe sync is done + require.Equal(t, sequencer.L2Unsafe().Hash, verifier.L2Unsafe().Hash) + + // Build and submit a span batch with 6 blocks + batcher.ActSubmitAll(t) + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(dp.Addresses.Batcher)(t) + miner.ActL1EndBlock(t) + + // Start verifier safe sync + verifier.ActL1HeadSignal(t) + verifier.l2PipelineIdle = false + for !verifier.l2PipelineIdle { + verifier.ActL2PipelineStep(t) + if verifier.L2PendingSafe().Number < targetHeadNumber { + // If the span batch is not fully processed, the safe head must not advance. + require.Equal(t, verifier.L2Safe().Number, uint64(0)) + } else { + // Once the span batch is fully processed, the safe head must advance to the end of span batch. + require.Equal(t, verifier.L2Safe().Number, targetHeadNumber) + require.Equal(t, verifier.L2Safe(), verifier.L2PendingSafe()) + } + // The unsafe head must not be changed + require.Equal(t, verifier.L2Unsafe(), sequencer.L2Unsafe()) + } +} + +func TestSpanBatchAtomicity_ForceAdvance(gt *testing.T) { + t := NewDefaultTesting(gt) + dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) + minTs := hexutil.Uint64(0) + // Activate Delta hardfork + dp.DeployConfig.L2GenesisDeltaTimeOffset = &minTs + dp.DeployConfig.L2BlockTime = 2 + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelInfo) + _, _, miner, sequencer, _, verifier, _, batcher := setupReorgTestActors(t, dp, sd, log) + + targetHeadNumber := uint64(6) // L1 block time / L2 block time + + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + require.Equal(t, verifier.L2Unsafe().Number, uint64(0)) + + // Create 6 blocks + miner.ActEmptyBlock(t) + sequencer.ActL1HeadSignal(t) + sequencer.ActBuildToL1HeadUnsafe(t) + require.Equal(t, sequencer.L2Unsafe().Number, targetHeadNumber) + + // Build and submit a span batch with 6 blocks + batcher.ActSubmitAll(t) + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(dp.Addresses.Batcher)(t) + miner.ActL1EndBlock(t) + + // Start verifier safe sync + verifier.ActL1HeadSignal(t) + verifier.l2PipelineIdle = false + for !verifier.l2PipelineIdle { + verifier.ActL2PipelineStep(t) + if verifier.L2PendingSafe().Number < targetHeadNumber { + // If the span batch is not fully processed, the safe head must not advance. + require.Equal(t, verifier.L2Safe().Number, uint64(0)) + } else { + // Once the span batch is fully processed, the safe head must advance to the end of span batch. + require.Equal(t, verifier.L2Safe().Number, targetHeadNumber) + require.Equal(t, verifier.L2Safe(), verifier.L2PendingSafe()) + } + // The unsafe head and the pending safe head must be the same + require.Equal(t, verifier.L2Unsafe(), verifier.L2PendingSafe()) + } +} diff --git a/op-e2e2/actions/system_config_test.go b/op-e2e2/actions/system_config_test.go new file mode 100644 index 000000000000..8ae309d5f362 --- /dev/null +++ b/op-e2e2/actions/system_config_test.go @@ -0,0 +1,409 @@ +package actions + +import ( + "math/big" + "math/rand" + "testing" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/log" + "github.com/stretchr/testify/require" + + "github.com/ethereum-optimism/optimism/op-e2e2/bindings" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils" + "github.com/ethereum-optimism/optimism/op-node/rollup/derive" + "github.com/ethereum-optimism/optimism/op-node/rollup/sync" + "github.com/ethereum-optimism/optimism/op-service/eth" + "github.com/ethereum-optimism/optimism/op-service/testlog" +) + +// TestSystemConfigBatchType run each system config-related test case in singular batch mode and span batch mode. +func TestSystemConfigBatchType(t *testing.T) { + tests := []struct { + name string + f func(gt *testing.T, deltaTimeOffset *hexutil.Uint64) + }{ + {"BatcherKeyRotation", BatcherKeyRotation}, + {"GPOParamsChange", GPOParamsChange}, + {"GasLimitChange", GasLimitChange}, + } + for _, test := range tests { + test := test + t.Run(test.name+"_SingularBatch", func(t *testing.T) { + test.f(t, nil) + }) + } + + deltaTimeOffset := hexutil.Uint64(0) + for _, test := range tests { + test := test + t.Run(test.name+"_SpanBatch", func(t *testing.T) { + test.f(t, &deltaTimeOffset) + }) + } +} + +// BatcherKeyRotation tests that batcher A can operate, then be replaced with batcher B, then ignore old batcher A, +// and that the change to batcher B is reverted properly upon reorg of L1. +func BatcherKeyRotation(gt *testing.T, deltaTimeOffset *hexutil.Uint64) { + t := NewDefaultTesting(gt) + + dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) + dp.DeployConfig.L2BlockTime = 2 + dp.DeployConfig.L2GenesisDeltaTimeOffset = deltaTimeOffset + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelDebug) + miner, seqEngine, sequencer := setupSequencerTest(t, sd, log) + miner.ActL1SetFeeRecipient(common.Address{'A'}) + sequencer.ActL2PipelineFull(t) + _, verifier := setupVerifier(t, sd, log, miner.L1Client(t, sd.RollupCfg), miner.BlobStore(), &sync.Config{}) + rollupSeqCl := sequencer.RollupClient() + + // the default batcher + batcherA := NewL2Batcher(log, sd.RollupCfg, DefaultBatcherCfg(dp), + rollupSeqCl, miner.EthClient(), seqEngine.EthClient(), seqEngine.EngineClient(t, sd.RollupCfg)) + + // a batcher with a new key + altCfg := *DefaultBatcherCfg(dp) + altCfg.BatcherKey = dp.Secrets.Bob + batcherB := NewL2Batcher(log, sd.RollupCfg, &altCfg, + rollupSeqCl, miner.EthClient(), seqEngine.EthClient(), seqEngine.EngineClient(t, sd.RollupCfg)) + + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + + // build a L1 chain, and then L2 chain, for batcher A to submit + miner.ActEmptyBlock(t) + miner.ActEmptyBlock(t) + sequencer.ActL1HeadSignal(t) + sequencer.ActBuildToL1Head(t) + batcherA.ActSubmitAll(t) + + // include the batch data on L1 + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(dp.Addresses.Batcher)(t) + miner.ActL1EndBlock(t) + + // sync from L1 + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + require.Equal(t, uint64(2), sequencer.L2Safe().L1Origin.Number, "l2 chain with new L1 origins") + require.Equal(t, sequencer.L2Safe(), verifier.L2Safe(), "fully synced verifier") + + sysCfgContract, err := bindings.NewSystemConfig(sd.RollupCfg.L1SystemConfigAddress, miner.EthClient()) + require.NoError(t, err) + + sysCfgOwner, err := bind.NewKeyedTransactorWithChainID(dp.Secrets.SysCfgOwner, sd.RollupCfg.L1ChainID) + require.NoError(t, err) + + owner, err := sysCfgContract.Owner(&bind.CallOpts{}) + require.NoError(t, err) + require.Equal(t, dp.Addresses.SysCfgOwner, owner, "system config owner mismatch") + + // Change the batch sender key to Bob! + tx, err := sysCfgContract.SetBatcherHash(sysCfgOwner, eth.AddressAsLeftPaddedHash(dp.Addresses.Bob)) + require.NoError(t, err) + t.Logf("batcher changes in L1 tx %s", tx.Hash()) + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(dp.Addresses.SysCfgOwner)(t) + miner.ActL1EndBlock(t) + + receipt, err := miner.EthClient().TransactionReceipt(t.Ctx(), tx.Hash()) + require.NoError(t, err) + + cfgChangeL1BlockNum := miner.l1Chain.CurrentBlock().Number.Uint64() + require.Equal(t, cfgChangeL1BlockNum, receipt.BlockNumber.Uint64()) + + // sequence L2 blocks, and submit with new batcher + sequencer.ActL1HeadSignal(t) + sequencer.ActBuildToL1Head(t) + batcherB.ActSubmitAll(t) + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(dp.Addresses.Bob)(t) + miner.ActL1EndBlock(t) + + // check that the first L2 payload that adopted the L1 block with the batcher key change + // indeed changed the batcher key in the system config + engCl := seqEngine.EngineClient(t, sd.RollupCfg) + // 12 new L2 blocks: 5 with origin before L1 block with batch, 6 with origin of L1 block + // with batch, 1 with new origin that changed the batcher + for i := 0; i <= 12; i++ { + envelope, err := engCl.PayloadByNumber(t.Ctx(), sequencer.L2Safe().Number+uint64(i)) + require.NoError(t, err) + ref, err := derive.PayloadToBlockRef(sd.RollupCfg, envelope.ExecutionPayload) + require.NoError(t, err) + if i < 6 { + require.Equal(t, ref.L1Origin.Number, cfgChangeL1BlockNum-2) + require.Equal(t, ref.SequenceNumber, uint64(i)) + } else if i < 12 { + require.Equal(t, ref.L1Origin.Number, cfgChangeL1BlockNum-1) + require.Equal(t, ref.SequenceNumber, uint64(i-6)) + } else { + require.Equal(t, ref.L1Origin.Number, cfgChangeL1BlockNum) + require.Equal(t, ref.SequenceNumber, uint64(0), "first L2 block with this origin") + sysCfg, err := derive.PayloadToSystemConfig(sd.RollupCfg, envelope.ExecutionPayload) + require.NoError(t, err) + require.Equal(t, dp.Addresses.Bob, sysCfg.BatcherAddr, "bob should be batcher now") + } + } + + // sync from L1 + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + require.Equal(t, sequencer.L2Safe().L1Origin.Number, uint64(4), "safe l2 chain with two new l1 blocks") + require.Equal(t, sequencer.L2Safe(), verifier.L2Safe(), "fully synced verifier") + + // now try to build a new L1 block, and corresponding L2 blocks, and submit with the old batcher + before := sequencer.L2Safe() + miner.ActEmptyBlock(t) + sequencer.ActL1HeadSignal(t) + sequencer.ActBuildToL1Head(t) + batcherA.ActSubmitAll(t) + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(dp.Addresses.Batcher)(t) + miner.ActL1EndBlock(t) + + // check that the data submitted by the old batcher is ignored + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + require.Equal(t, sequencer.L2Safe(), before, "no new safe l1 chain") + require.Equal(t, verifier.L2Safe(), before, "verifier is ignoring old batcher too") + + // now submit with the new batcher + batcherB.ActSubmitAll(t) + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(dp.Addresses.Bob)(t) + miner.ActL1EndBlock(t) + + // not ignored now with new batcher + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + require.NotEqual(t, sequencer.L2Safe(), before, "new safe l1 chain") + require.NotEqual(t, verifier.L2Safe(), before, "verifier is not ignoring new batcher") + + // twist: reorg L1, including the batcher key change + miner.ActL1RewindDepth(5)(t) + for i := 0; i < 6; i++ { // build some empty blocks so the reorg is picked up + miner.ActEmptyBlock(t) + } + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + require.Equal(t, uint64(2), sequencer.L2Safe().L1Origin.Number, "l2 safe is first batch submission with original batcher") + require.Equal(t, uint64(3), sequencer.L2Unsafe().L1Origin.Number, "l2 unsafe l1 origin is the block that included the first batch") + require.Equal(t, sequencer.L2Safe(), verifier.L2Safe(), "verifier safe head check") + require.Equal(t, sequencer.L2Unsafe(), verifier.L2Unsafe(), "verifier unsafe head check") + + // without building L2 chain for the new L1 blocks yet, just batch-submit the unsafe part + batcherA.ActL2BatchBuffer(t) // forces the buffer state to handle the rewind, before we loop with ActSubmitAll + batcherA.ActSubmitAll(t) + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(dp.Addresses.Batcher)(t) + miner.ActL1EndBlock(t) + + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + require.Equal(t, sequencer.L2Safe(), sequencer.L2Unsafe(), "all L2 blocks are safe now") + require.Equal(t, sequencer.L2Unsafe(), verifier.L2Unsafe(), "verifier synced") + + // and see if we can go past it, with new L2 blocks + sequencer.ActL1HeadSignal(t) + sequencer.ActBuildToL1Head(t) + batcherA.ActSubmitAll(t) + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(dp.Addresses.Batcher)(t) + miner.ActL1EndBlock(t) + + sequencer.ActL2PipelineFull(t) + verifier.ActL2PipelineFull(t) + require.Equal(t, uint64(3+6+1), verifier.L2Safe().L1Origin.Number, "sync new L1 chain, while key change is reorged out") + require.Equal(t, sequencer.L2Unsafe(), verifier.L2Unsafe(), "verifier synced") +} + +// GPOParamsChange tests that the GPO params can be updated to adjust fees of L2 transactions, +// and that the L1 data fees to the L2 transaction are applied correctly before, during and after the GPO update in L2. +func GPOParamsChange(gt *testing.T, deltaTimeOffset *hexutil.Uint64) { + t := NewDefaultTesting(gt) + dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) + dp.DeployConfig.L2GenesisDeltaTimeOffset = deltaTimeOffset + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelDebug) + miner, seqEngine, sequencer := setupSequencerTest(t, sd, log) + batcher := NewL2Batcher(log, sd.RollupCfg, DefaultBatcherCfg(dp), + sequencer.RollupClient(), miner.EthClient(), seqEngine.EthClient(), seqEngine.EngineClient(t, sd.RollupCfg)) + + alice := NewBasicUser[any](log, dp.Secrets.Alice, rand.New(rand.NewSource(1234))) + alice.SetUserEnv(&BasicUserEnv[any]{ + EthCl: seqEngine.EthClient(), + Signer: types.LatestSigner(sd.L2Cfg.Config), + }) + + sequencer.ActL2PipelineFull(t) + + // new L1 block, with new L2 chain + miner.ActEmptyBlock(t) + sequencer.ActL1HeadSignal(t) + sequencer.ActBuildToL1Head(t) + basefee := miner.l1Chain.CurrentBlock().BaseFee + + // alice makes a L2 tx, sequencer includes it + alice.ActResetTxOpts(t) + alice.ActMakeTx(t) + sequencer.ActL2StartBlock(t) + seqEngine.ActL2IncludeTx(dp.Addresses.Alice)(t) + sequencer.ActL2EndBlock(t) + + receipt := alice.LastTxReceipt(t) + require.Equal(t, basefee, receipt.L1GasPrice, "L1 gas price matches basefee of L1 origin") + require.NotZero(t, receipt.L1GasUsed, "L2 tx uses L1 data") + require.Equal(t, + new(big.Float).Mul( + new(big.Float).SetInt(basefee), + new(big.Float).Mul(new(big.Float).SetInt(receipt.L1GasUsed), receipt.FeeScalar), + ), + new(big.Float).SetInt(receipt.L1Fee), "fee field in receipt matches gas used times scalar times basefee") + // receipt.L1GasUsed includes the overhead already, so subtract that before passing it into the L1 cost func + l1Cost := types.L1Cost(receipt.L1GasUsed.Uint64()-2100, basefee, big.NewInt(2100), big.NewInt(1000_000)) + require.Equal(t, l1Cost, receipt.L1Fee, "L1 fee is computed with standard GPO params") + require.Equal(t, "1", receipt.FeeScalar.String(), "1000_000 divided by 6 decimals = float(1)") + + // confirm L2 chain on L1 + batcher.ActSubmitAll(t) + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(dp.Addresses.Batcher)(t) + miner.ActL1EndBlock(t) + + sysCfgContract, err := bindings.NewSystemConfig(sd.RollupCfg.L1SystemConfigAddress, miner.EthClient()) + require.NoError(t, err) + + sysCfgOwner, err := bind.NewKeyedTransactorWithChainID(dp.Secrets.SysCfgOwner, sd.RollupCfg.L1ChainID) + require.NoError(t, err) + + // overhead changes from 2100 (default) to 1000 + // scalar changes from 1_000_000 (default) to 2_300_000 + // e.g. if system operator determines that l2 txs need to be more expensive, but small ones less + _, err = sysCfgContract.SetGasConfig(sysCfgOwner, big.NewInt(1000), big.NewInt(2_300_000)) + require.NoError(t, err) + + // include the GPO change tx in L1 + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(dp.Addresses.SysCfgOwner)(t) + miner.ActL1EndBlock(t) + basefeeGPOUpdate := miner.l1Chain.CurrentBlock().BaseFee + + // build empty L2 chain, up to but excluding the L2 block with the L1 origin that processes the GPO change + sequencer.ActL1HeadSignal(t) + sequencer.ActBuildToL1HeadExcl(t) + + engCl := seqEngine.EngineClient(t, sd.RollupCfg) + envelope, err := engCl.PayloadByLabel(t.Ctx(), eth.Unsafe) + require.NoError(t, err) + sysCfg, err := derive.PayloadToSystemConfig(sd.RollupCfg, envelope.ExecutionPayload) + require.NoError(t, err) + require.Equal(t, sd.RollupCfg.Genesis.SystemConfig, sysCfg, "still have genesis system config before we adopt the L1 block with GPO change") + + // Now alice makes another transaction, which gets included in the same block that adopts the L1 origin with GPO change + alice.ActResetTxOpts(t) + alice.ActMakeTx(t) + sequencer.ActL2StartBlock(t) + seqEngine.ActL2IncludeTx(dp.Addresses.Alice)(t) + sequencer.ActL2EndBlock(t) + + envelope, err = engCl.PayloadByLabel(t.Ctx(), eth.Unsafe) + require.NoError(t, err) + sysCfg, err = derive.PayloadToSystemConfig(sd.RollupCfg, envelope.ExecutionPayload) + require.NoError(t, err) + require.Equal(t, eth.Bytes32(common.BigToHash(big.NewInt(1000))), sysCfg.Overhead, "overhead changed") + require.Equal(t, eth.Bytes32(common.BigToHash(big.NewInt(2_300_000))), sysCfg.Scalar, "scalar changed") + + receipt = alice.LastTxReceipt(t) + require.Equal(t, basefeeGPOUpdate, receipt.L1GasPrice, "L1 gas price matches basefee of L1 origin") + require.NotZero(t, receipt.L1GasUsed, "L2 tx uses L1 data") + // subtract overhead from L1GasUsed receipt field, types.L1Cost applies it again + l1Cost = types.L1Cost(receipt.L1GasUsed.Uint64()-1000, basefeeGPOUpdate, big.NewInt(1000), big.NewInt(2_300_000)) + require.Equal(t, l1Cost, receipt.L1Fee, "L1 fee is computed with updated GPO params") + require.Equal(t, "2.3", receipt.FeeScalar.String(), "2_300_000 divided by 6 decimals = float(2.3)") + + // build more L2 blocks, with new L1 origin + miner.ActEmptyBlock(t) + basefee = miner.l1Chain.CurrentBlock().BaseFee + sequencer.ActL1HeadSignal(t) + sequencer.ActBuildToL1Head(t) + // and Alice makes a tx again + alice.ActResetTxOpts(t) + alice.ActMakeTx(t) + sequencer.ActL2StartBlock(t) + seqEngine.ActL2IncludeTx(dp.Addresses.Alice)(t) + sequencer.ActL2EndBlock(t) + + // and verify the new GPO params are persistent, even though the L1 origin and L2 chain have progressed + receipt = alice.LastTxReceipt(t) + require.Equal(t, basefee, receipt.L1GasPrice, "L1 gas price matches basefee of L1 origin") + require.NotZero(t, receipt.L1GasUsed, "L2 tx uses L1 data") + // subtract overhead from L1GasUsed receipt field, types.L1Cost applies it again + l1Cost = types.L1Cost(receipt.L1GasUsed.Uint64()-1000, basefee, big.NewInt(1000), big.NewInt(2_300_000)) + require.Equal(t, l1Cost, receipt.L1Fee, "L1 fee is computed with updated GPO params") + require.Equal(t, "2.3", receipt.FeeScalar.String(), "2_300_000 divided by 6 decimals = float(2.3)") +} + +// GasLimitChange tests that the gas limit can be configured to L1, +// and that the L2 changes the gas limit instantly at the exact block that adopts the L1 origin with +// the gas limit change event. And checks if a verifier node can reproduce the same gas limit change. +func GasLimitChange(gt *testing.T, deltaTimeOffset *hexutil.Uint64) { + t := NewDefaultTesting(gt) + dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) + dp.DeployConfig.L2GenesisDeltaTimeOffset = deltaTimeOffset + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelDebug) + miner, seqEngine, sequencer := setupSequencerTest(t, sd, log) + batcher := NewL2Batcher(log, sd.RollupCfg, DefaultBatcherCfg(dp), + sequencer.RollupClient(), miner.EthClient(), seqEngine.EthClient(), seqEngine.EngineClient(t, sd.RollupCfg)) + + sequencer.ActL2PipelineFull(t) + miner.ActEmptyBlock(t) + sequencer.ActL1HeadSignal(t) + sequencer.ActBuildToL1Head(t) + + oldGasLimit := seqEngine.l2Chain.CurrentBlock().GasLimit + require.Equal(t, oldGasLimit, uint64(dp.DeployConfig.L2GenesisBlockGasLimit)) + + // change gas limit on L1 to triple what it was + sysCfgContract, err := bindings.NewSystemConfig(sd.RollupCfg.L1SystemConfigAddress, miner.EthClient()) + require.NoError(t, err) + + sysCfgOwner, err := bind.NewKeyedTransactorWithChainID(dp.Secrets.SysCfgOwner, sd.RollupCfg.L1ChainID) + require.NoError(t, err) + + _, err = sysCfgContract.SetGasLimit(sysCfgOwner, oldGasLimit*3) + require.NoError(t, err) + + // include the gaslimit update on L1 + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(dp.Addresses.SysCfgOwner)(t) + miner.ActL1EndBlock(t) + + // build to latest L1, excluding the block that adopts the L1 block with the gaslimit change + sequencer.ActL1HeadSignal(t) + sequencer.ActBuildToL1HeadExcl(t) + + require.Equal(t, oldGasLimit, seqEngine.l2Chain.CurrentBlock().GasLimit) + require.Equal(t, uint64(1), sequencer.SyncStatus().UnsafeL2.L1Origin.Number) + + // now include the L1 block with the gaslimit change, and see if it changes as expected + sequencer.ActBuildToL1Head(t) + require.Equal(t, oldGasLimit*3, seqEngine.l2Chain.CurrentBlock().GasLimit) + require.Equal(t, uint64(2), sequencer.SyncStatus().UnsafeL2.L1Origin.Number) + + // now submit all this to L1, and see if a verifier can sync and reproduce it + batcher.ActSubmitAll(t) + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(dp.Addresses.Batcher)(t) + miner.ActL1EndBlock(t) + + _, verifier := setupVerifier(t, sd, log, miner.L1Client(t, sd.RollupCfg), miner.BlobStore(), &sync.Config{}) + verifier.ActL2PipelineFull(t) + + require.Equal(t, sequencer.L2Unsafe(), verifier.L2Safe(), "verifier stays in sync, even with gaslimit changes") +} diff --git a/op-e2e2/actions/tx_helper.go b/op-e2e2/actions/tx_helper.go new file mode 100644 index 000000000000..ff577375e93c --- /dev/null +++ b/op-e2e2/actions/tx_helper.go @@ -0,0 +1,49 @@ +package actions + +import ( + "context" + "math/big" + "time" + + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/wait" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/stretchr/testify/require" +) + +// firstValidTx finds the first transaction that is valid for inclusion from the specified address. +// It uses a waiter and filtering of already included transactions to avoid race conditions with the async +// updates to the transaction pool. +func firstValidTx( + t Testing, + from common.Address, + pendingIndices func(common.Address) uint64, + contentFrom func(common.Address) ([]*types.Transaction, []*types.Transaction), + nonceAt func(context.Context, common.Address, *big.Int) (uint64, error), +) *types.Transaction { + var i uint64 + var txs []*types.Transaction + var q []*types.Transaction + // Wait for the tx to be in the pending tx queue + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + err := wait.For(ctx, time.Second, func() (bool, error) { + i = pendingIndices(from) + txs, q = contentFrom(from) + // Remove any transactions that have already been included in the head block + // The tx pool only prunes included transactions async so they may still be in the list + nonce, err := nonceAt(ctx, from, nil) + if err != nil { + return false, err + } + for len(txs) > 0 && txs[0].Nonce() < nonce { + t.Logf("Removing already included transaction from list of length %v", len(txs)) + txs = txs[1:] + } + return uint64(len(txs)) > i, nil + }) + require.NoError(t, err, + "no pending txs from %s, and have %d unprocessable queued txs from this account: %w", from, len(q), err) + + return txs[i] +} diff --git a/op-e2e2/actions/user.go b/op-e2e2/actions/user.go new file mode 100644 index 000000000000..138643d15280 --- /dev/null +++ b/op-e2e2/actions/user.go @@ -0,0 +1,604 @@ +package actions + +import ( + "crypto/ecdsa" + "errors" + "fmt" + "math/big" + "math/rand" + "time" + + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/params" + "github.com/stretchr/testify/require" + + "github.com/ethereum-optimism/optimism/op-chain-ops/crossdomain" + e2e "github.com/ethereum-optimism/optimism/op-e2e2" + legacybindings "github.com/ethereum-optimism/optimism/op-e2e2/bindings" + "github.com/ethereum-optimism/optimism/op-e2e2/config" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils" + "github.com/ethereum-optimism/optimism/op-node/bindings" + bindingspreview "github.com/ethereum-optimism/optimism/op-node/bindings/preview" + "github.com/ethereum-optimism/optimism/op-node/rollup/derive" + "github.com/ethereum-optimism/optimism/op-node/withdrawals" + "github.com/ethereum-optimism/optimism/op-service/predeploys" +) + +type L1Bindings struct { + // contract bindings + OptimismPortal *bindings.OptimismPortal + L2OutputOracle *bindings.L2OutputOracle + OptimismPortal2 *bindingspreview.OptimismPortal2 + DisputeGameFactory *bindings.DisputeGameFactory +} + +func NewL1Bindings(t Testing, l1Cl *ethclient.Client) *L1Bindings { + optimismPortal, err := bindings.NewOptimismPortal(config.L1Deployments.OptimismPortalProxy, l1Cl) + require.NoError(t, err) + + l2OutputOracle, err := bindings.NewL2OutputOracle(config.L1Deployments.L2OutputOracleProxy, l1Cl) + require.NoError(t, err) + + optimismPortal2, err := bindingspreview.NewOptimismPortal2(config.L1Deployments.OptimismPortalProxy, l1Cl) + require.NoError(t, err) + + disputeGameFactory, err := bindings.NewDisputeGameFactory(config.L1Deployments.DisputeGameFactoryProxy, l1Cl) + require.NoError(t, err) + + return &L1Bindings{ + OptimismPortal: optimismPortal, + L2OutputOracle: l2OutputOracle, + OptimismPortal2: optimismPortal2, + DisputeGameFactory: disputeGameFactory, + } +} + +type L2Bindings struct { + L2ToL1MessagePasser *bindings.L2ToL1MessagePasser + + ProofClient withdrawals.ProofClient +} + +func NewL2Bindings(t Testing, l2Cl *ethclient.Client, proofCl withdrawals.ProofClient) *L2Bindings { + l2ToL1MessagePasser, err := bindings.NewL2ToL1MessagePasser(predeploys.L2ToL1MessagePasserAddr, l2Cl) + require.NoError(t, err) + + return &L2Bindings{ + L2ToL1MessagePasser: l2ToL1MessagePasser, + ProofClient: proofCl, + } +} + +// BasicUserEnv provides access to the eth RPC, signer, and contract bindings for a single ethereum layer. +// This environment can be shared between different BasicUser instances. +type BasicUserEnv[B any] struct { + EthCl *ethclient.Client + Signer types.Signer + + AddressCorpora []common.Address + + Bindings B +} + +// BasicUser is an actor on a single ethereum layer, with one account key. +// The user maintains a set of standard txOpts to build its transactions with, +// along with configurable txToAddr and txCallData. +// The user has an RNG source with actions to randomize its transaction building. +type BasicUser[B any] struct { + log log.Logger + rng *rand.Rand + env *BasicUserEnv[B] + + account *ecdsa.PrivateKey + address common.Address + + txOpts bind.TransactOpts + + txToAddr *common.Address + txCallData []byte + + // lastTxHash persists the last transaction, + // so we can chain together tx sending and tx checking easily. + // Sending and checking are detached, since txs may not be instantly confirmed. + lastTxHash common.Hash +} + +func NewBasicUser[B any](log log.Logger, priv *ecdsa.PrivateKey, rng *rand.Rand) *BasicUser[B] { + return &BasicUser[B]{ + log: log, + rng: rng, + account: priv, + address: crypto.PubkeyToAddress(priv.PublicKey), + } +} + +// SetUserEnv changes the user environment. +// This way a user can be initialized before being embedded in a genesis allocation, +// and change between different endpoints that may be initialized after the user. +func (s *BasicUser[B]) SetUserEnv(env *BasicUserEnv[B]) { + s.env = env +} + +func (s *BasicUser[B]) signerFn(address common.Address, tx *types.Transaction) (*types.Transaction, error) { + if address != s.address { + return nil, bind.ErrNotAuthorized + } + signature, err := crypto.Sign(s.env.Signer.Hash(tx).Bytes(), s.account) + if err != nil { + return nil, err + } + return tx.WithSignature(s.env.Signer, signature) +} + +// ActResetTxOpts prepares the tx options to default values, based on the current pending block header. +func (s *BasicUser[B]) ActResetTxOpts(t Testing) { + latestHeader, err := s.env.EthCl.HeaderByNumber(t.Ctx(), nil) + require.NoError(t, err, "need l2 latest header for accurate basefee info") + + gasTipCap := big.NewInt(2 * params.GWei) + gasFeeCap := new(big.Int).Add(gasTipCap, new(big.Int).Mul(latestHeader.BaseFee, big.NewInt(2))) + + s.txOpts = bind.TransactOpts{ + From: s.address, + Nonce: nil, // pick nonce based on pending state + Signer: s.signerFn, + Value: big.NewInt(0), + GasFeeCap: gasFeeCap, + GasTipCap: gasTipCap, + GasLimit: 0, // a.k.a. estimate + NoSend: true, // actions should be explicit about sending + } +} + +func (s *BasicUser[B]) ActRandomTxToAddr(t Testing) { + i := s.rng.Intn(len(s.env.AddressCorpora)) + var to *common.Address + if i > 0 { // 0 == nil + to = &s.env.AddressCorpora[i] + } + s.txToAddr = to +} + +func (s *BasicUser[B]) ActSetTxCalldata(calldata []byte) Action { + return func(t Testing) { + require.NotNil(t, calldata) + s.txCallData = calldata + } +} + +func (s *BasicUser[B]) ActSetTxToAddr(to *common.Address) Action { + return func(t Testing) { + s.txToAddr = to + } +} + +func (s *BasicUser[B]) ActRandomTxValue(t Testing) { + // compute a random portion of balance + precision := int64(1000) + bal, err := s.env.EthCl.BalanceAt(t.Ctx(), s.address, nil) + require.NoError(t, err) + part := big.NewInt(s.rng.Int63n(precision)) + new(big.Int).Div(new(big.Int).Mul(bal, part), big.NewInt(precision)) + s.txOpts.Value = big.NewInt(s.rng.Int63()) +} + +func (s *BasicUser[B]) ActSetTxValue(value *big.Int) Action { + return func(t Testing) { + s.txOpts.Value = value + } +} + +func (s *BasicUser[B]) ActRandomTxData(t Testing) { + dataLen := s.rng.Intn(128_000) + out := make([]byte, dataLen) + _, err := s.rng.Read(out[:]) + require.NoError(t, err) + s.txCallData = out +} + +func (s *BasicUser[B]) PendingNonce(t Testing) uint64 { + if s.txOpts.Nonce != nil { + return s.txOpts.Nonce.Uint64() + } + // fetch from pending state + nonce, err := s.env.EthCl.PendingNonceAt(t.Ctx(), s.address) + require.NoError(t, err, "failed to get L1 nonce for account %s", s.address) + return nonce +} + +func (s *BasicUser[B]) TxValue() *big.Int { + if s.txOpts.Value != nil { + return s.txOpts.Value + } + return big.NewInt(0) +} + +func (s *BasicUser[B]) LastTxReceipt(t Testing) *types.Receipt { + require.NotEqual(t, s.lastTxHash, common.Hash{}, "must send tx before getting last receipt") + receipt, err := s.env.EthCl.TransactionReceipt(t.Ctx(), s.lastTxHash) + require.NoError(t, err) + return receipt +} + +// ActMakeTx makes a tx with the predetermined contents (see randomization and other actions) +// and sends it to the tx pool +func (s *BasicUser[B]) ActMakeTx(t Testing) { + gas, err := s.env.EthCl.EstimateGas(t.Ctx(), ethereum.CallMsg{ + From: s.address, + To: s.txToAddr, + GasFeeCap: s.txOpts.GasFeeCap, + GasTipCap: s.txOpts.GasTipCap, + Value: s.TxValue(), + Data: s.txCallData, + }) + require.NoError(t, err, "gas estimation should pass") + tx := types.MustSignNewTx(s.account, s.env.Signer, &types.DynamicFeeTx{ + To: s.txToAddr, + GasFeeCap: s.txOpts.GasFeeCap, + GasTipCap: s.txOpts.GasTipCap, + Value: s.TxValue(), + ChainID: s.env.Signer.ChainID(), + Nonce: s.PendingNonce(t), + Gas: gas, + Data: s.txCallData, + }) + err = s.env.EthCl.SendTransaction(t.Ctx(), tx) + require.NoError(t, err, "must send tx") + s.lastTxHash = tx.Hash() + // reset the calldata + s.txCallData = []byte{} +} + +func (s *BasicUser[B]) ActCheckReceiptStatusOfLastTx(success bool) func(t Testing) { + return func(t Testing) { + s.CheckReceipt(t, success, s.lastTxHash) + } +} + +func (s *BasicUser[B]) CheckReceipt(t Testing, success bool, txHash common.Hash) *types.Receipt { + receipt, err := s.env.EthCl.TransactionReceipt(t.Ctx(), txHash) + if receipt != nil && err == nil { + expected := types.ReceiptStatusFailed + if success { + expected = types.ReceiptStatusSuccessful + } + require.Equal(t, expected, receipt.Status, "expected receipt status to match") + return receipt + } else if err != nil && !errors.Is(err, ethereum.NotFound) { + t.Fatalf("receipt for tx %s was not found", txHash) + } else { + t.Fatalf("receipt error: %v", err) + } + return nil +} + +type L1User struct { + BasicUser[*L1Bindings] +} + +type L2User struct { + BasicUser[*L2Bindings] +} + +// CrossLayerUser represents the same user account on L1 and L2, +// and provides actions to make cross-layer transactions. +type CrossLayerUser struct { + L1 L1User + L2 L2User + + // track the last deposit, to easily chain together deposit actions + lastL1DepositTxHash common.Hash + + lastL2WithdrawalTxHash common.Hash +} + +func NewCrossLayerUser(log log.Logger, priv *ecdsa.PrivateKey, rng *rand.Rand) *CrossLayerUser { + addr := crypto.PubkeyToAddress(priv.PublicKey) + return &CrossLayerUser{ + L1: L1User{ + BasicUser: BasicUser[*L1Bindings]{ + log: log, + rng: rng, + account: priv, + address: addr, + }, + }, + L2: L2User{ + BasicUser: BasicUser[*L2Bindings]{ + log: log, + rng: rng, + account: priv, + address: addr, + }, + }, + } +} + +func (s *CrossLayerUser) ActDeposit(t Testing) { + isCreation := false + toAddr := common.Address{} + if s.L2.txToAddr == nil { + isCreation = true + } else { + toAddr = *s.L2.txToAddr + } + depositTransferValue := s.L2.TxValue() + depositGas := s.L2.txOpts.GasLimit + if s.L2.txOpts.GasLimit == 0 { + // estimate gas used by deposit + gas, err := s.L2.env.EthCl.EstimateGas(t.Ctx(), ethereum.CallMsg{ + From: s.L2.address, + To: &toAddr, + Value: depositTransferValue, // TODO: estimate gas does not support minting yet + Data: s.L2.txCallData, + AccessList: nil, + }) + require.NoError(t, err) + depositGas = gas + } + + // Finally send TX + s.L1.txOpts.GasLimit = 0 + tx, err := s.L1.env.Bindings.OptimismPortal.DepositTransaction(&s.L1.txOpts, toAddr, depositTransferValue, depositGas, isCreation, s.L2.txCallData) + require.Nil(t, err, "with deposit tx") + + // Add 10% padding for the L1 gas limit because the estimation process can be affected by the 1559 style cost scale + // for buying L2 gas in the portal contracts. + s.L1.txOpts.GasLimit = tx.Gas() + (tx.Gas() / 10) + + tx, err = s.L1.env.Bindings.OptimismPortal.DepositTransaction(&s.L1.txOpts, toAddr, depositTransferValue, depositGas, isCreation, s.L2.txCallData) + require.NoError(t, err, "failed to create deposit tx") + + s.L1.txOpts.GasLimit = 0 + + fmt.Printf("Gas limit: %v\n", tx.Gas()) + // Send the actual tx (since tx opts don't send by default) + err = s.L1.env.EthCl.SendTransaction(t.Ctx(), tx) + require.NoError(t, err, "must send tx") + s.lastL1DepositTxHash = tx.Hash() +} + +func (s *CrossLayerUser) ActCheckDepositStatus(l1Success, l2Success bool) Action { + return func(t Testing) { + s.CheckDepositTx(t, s.lastL1DepositTxHash, 0, l1Success, l2Success) + } +} + +func (s *CrossLayerUser) CheckDepositTx(t Testing, l1TxHash common.Hash, index int, l1Success, l2Success bool) { + depositReceipt := s.L1.CheckReceipt(t, l1Success, l1TxHash) + if depositReceipt == nil { + require.False(t, l1Success) + require.False(t, l2Success) + } else { + require.Less(t, index, len(depositReceipt.Logs), "must have enough logs in receipt") + reconstructedDep, err := derive.UnmarshalDepositLogEvent(depositReceipt.Logs[index]) + require.NoError(t, err, "Could not reconstruct L2 Deposit") + l2Tx := types.NewTx(reconstructedDep) + s.L2.CheckReceipt(t, l2Success, l2Tx.Hash()) + } +} + +func (s *CrossLayerUser) ActStartWithdrawal(t Testing) { + targetAddr := common.Address{} + if s.L1.txToAddr != nil { + targetAddr = *s.L2.txToAddr + } + tx, err := s.L2.env.Bindings.L2ToL1MessagePasser.InitiateWithdrawal(&s.L2.txOpts, targetAddr, new(big.Int).SetUint64(s.L1.txOpts.GasLimit), s.L1.txCallData) + require.NoError(t, err, "create initiate withdraw tx") + err = s.L2.env.EthCl.SendTransaction(t.Ctx(), tx) + require.NoError(t, err, "must send tx") + s.lastL2WithdrawalTxHash = tx.Hash() +} + +// ActCheckStartWithdrawal checks that a previous witdrawal tx was either successful or failed. +func (s *CrossLayerUser) ActCheckStartWithdrawal(success bool) Action { + return func(t Testing) { + s.L2.CheckReceipt(t, success, s.lastL2WithdrawalTxHash) + } +} + +func (s *CrossLayerUser) Address() common.Address { + return s.L1.address +} + +func (s *CrossLayerUser) getLatestWithdrawalParams(t Testing) (*withdrawals.ProvenWithdrawalParameters, error) { + receipt := s.L2.CheckReceipt(t, true, s.lastL2WithdrawalTxHash) + l2WithdrawalBlock, err := s.L2.env.EthCl.BlockByNumber(t.Ctx(), receipt.BlockNumber) + require.NoError(t, err) + + var l2OutputBlockNr *big.Int + var l2OutputBlock *types.Block + if e2eutils.UseFPAC() { + latestGame, err := withdrawals.FindLatestGame(t.Ctx(), &s.L1.env.Bindings.DisputeGameFactory.DisputeGameFactoryCaller, &s.L1.env.Bindings.OptimismPortal2.OptimismPortal2Caller) + require.NoError(t, err) + l2OutputBlockNr = new(big.Int).SetBytes(latestGame.ExtraData[0:32]) + l2OutputBlock, err = s.L2.env.EthCl.BlockByNumber(t.Ctx(), l2OutputBlockNr) + require.NoError(t, err) + } else { + l2OutputBlockNr, err = s.L1.env.Bindings.L2OutputOracle.LatestBlockNumber(&bind.CallOpts{}) + require.NoError(t, err) + l2OutputBlock, err = s.L2.env.EthCl.BlockByNumber(t.Ctx(), l2OutputBlockNr) + require.NoError(t, err) + } + + if l2OutputBlock.NumberU64() < l2WithdrawalBlock.NumberU64() { + return nil, fmt.Errorf("the latest L2 output is %d and is not past L2 block %d that includes the withdrawal yet, no withdrawal can be proved yet", l2OutputBlock.NumberU64(), l2WithdrawalBlock.NumberU64()) + } + + if !e2eutils.UseFPAC() { + finalizationPeriod, err := s.L1.env.Bindings.L2OutputOracle.FINALIZATIONPERIODSECONDS(&bind.CallOpts{}) + require.NoError(t, err) + l1Head, err := s.L1.env.EthCl.HeaderByNumber(t.Ctx(), nil) + require.NoError(t, err) + + if l2OutputBlock.Time()+finalizationPeriod.Uint64() >= l1Head.Time { + return nil, fmt.Errorf("L2 output block %d (time %d) is not past finalization period %d from L2 block %d (time %d) at head %d (time %d)", l2OutputBlock.NumberU64(), l2OutputBlock.Time(), finalizationPeriod.Uint64(), l2WithdrawalBlock.NumberU64(), l2WithdrawalBlock.Time(), l1Head.Number.Uint64(), l1Head.Time) + } + } + + header, err := s.L2.env.EthCl.HeaderByNumber(t.Ctx(), l2OutputBlockNr) + require.NoError(t, err) + params, err := e2e.ProveWithdrawalParameters(t.Ctx(), s.L2.env.Bindings.ProofClient, s.L2.env.EthCl, s.L2.env.EthCl, s.lastL2WithdrawalTxHash, header, &s.L1.env.Bindings.L2OutputOracle.L2OutputOracleCaller, &s.L1.env.Bindings.DisputeGameFactory.DisputeGameFactoryCaller, &s.L1.env.Bindings.OptimismPortal2.OptimismPortal2Caller) + require.NoError(t, err) + + return ¶ms, nil +} + +func (s *CrossLayerUser) getDisputeGame(t Testing, params withdrawals.ProvenWithdrawalParameters) (*legacybindings.FaultDisputeGame, error) { + wd := crossdomain.Withdrawal{ + Nonce: params.Nonce, + Sender: ¶ms.Sender, + Target: ¶ms.Target, + Value: params.Value, + GasLimit: params.GasLimit, + Data: params.Data, + } + + portal2, err := bindingspreview.NewOptimismPortal2(config.L1Deployments.OptimismPortalProxy, s.L1.env.EthCl) + require.Nil(t, err) + + wdHash, err := wd.Hash() + require.Nil(t, err) + + game, err := portal2.ProvenWithdrawals(&bind.CallOpts{}, wdHash, s.L1.address) + require.Nil(t, err) + require.NotNil(t, game, "withdrawal should be proven") + + proxy, err := legacybindings.NewFaultDisputeGame(game.DisputeGameProxy, s.L1.env.EthCl) + require.Nil(t, err) + + return proxy, nil +} + +// ActCompleteWithdrawal creates a L1 proveWithdrawal tx for latest withdrawal. +// The tx hash is remembered as the last L1 tx, to check as L1 actor. +func (s *CrossLayerUser) ActProveWithdrawal(t Testing) { + s.L1.lastTxHash = s.ProveWithdrawal(t, s.lastL2WithdrawalTxHash) +} + +// ProveWithdrawal creates a L1 proveWithdrawal tx for the given L2 withdrawal tx, returning the tx hash. +func (s *CrossLayerUser) ProveWithdrawal(t Testing, l2TxHash common.Hash) common.Hash { + params, err := s.getLatestWithdrawalParams(t) + if err != nil { + t.InvalidAction("cannot prove withdrawal: %v", err) + return common.Hash{} + } + + // Create the prove tx + tx, err := s.L1.env.Bindings.OptimismPortal.ProveWithdrawalTransaction( + &s.L1.txOpts, + bindings.TypesWithdrawalTransaction{ + Nonce: params.Nonce, + Sender: params.Sender, + Target: params.Target, + Value: params.Value, + GasLimit: params.GasLimit, + Data: params.Data, + }, + params.L2OutputIndex, + params.OutputRootProof, + params.WithdrawalProof, + ) + require.NoError(t, err) + + // Send the actual tx (since tx opts don't send by default) + err = s.L1.env.EthCl.SendTransaction(t.Ctx(), tx) + require.NoError(t, err, "must send prove tx") + return tx.Hash() +} + +// ActCompleteWithdrawal creates a L1 withdrawal finalization tx for latest withdrawal. +// The tx hash is remembered as the last L1 tx, to check as L1 actor. +// The withdrawal functions like CompleteWithdrawal +func (s *CrossLayerUser) ActCompleteWithdrawal(t Testing) { + s.L1.lastTxHash = s.CompleteWithdrawal(t, s.lastL2WithdrawalTxHash) +} + +// CompleteWithdrawal creates a L1 withdrawal finalization tx for the given L2 withdrawal tx, returning the tx hash. +// It's an invalid action to attempt to complete a withdrawal that has not passed the L1 finalization period yet +func (s *CrossLayerUser) CompleteWithdrawal(t Testing, l2TxHash common.Hash) common.Hash { + params, err := s.getLatestWithdrawalParams(t) + if err != nil { + t.InvalidAction("cannot complete withdrawal: %v", err) + return common.Hash{} + } + + // Create the withdrawal tx + tx, err := s.L1.env.Bindings.OptimismPortal.FinalizeWithdrawalTransaction( + &s.L1.txOpts, + bindings.TypesWithdrawalTransaction{ + Nonce: params.Nonce, + Sender: params.Sender, + Target: params.Target, + Value: params.Value, + GasLimit: params.GasLimit, + Data: params.Data, + }, + ) + require.NoError(t, err) + + // Send the actual tx (since tx opts don't send by default) + err = s.L1.env.EthCl.SendTransaction(t.Ctx(), tx) + require.NoError(t, err, "must send finalize tx") + return tx.Hash() +} + +// ActResolveClaim creates a L1 resolveClaim tx for the latest withdrawal. +func (s *CrossLayerUser) ActResolveClaim(t Testing) { + s.L1.lastTxHash = s.ResolveClaim(t, s.lastL2WithdrawalTxHash) +} + +// ResolveClaim creates a L1 resolveClaim tx for the given L2 withdrawal tx, returning the tx hash. +func (s *CrossLayerUser) ResolveClaim(t Testing, l2TxHash common.Hash) common.Hash { + params, err := s.getLatestWithdrawalParams(t) + if err != nil { + t.InvalidAction("cannot resolve claim: %v", err) + return common.Hash{} + } + + game, err := s.getDisputeGame(t, *params) + require.NoError(t, err) + + expiry, err := game.MaxClockDuration(&bind.CallOpts{}) + require.Nil(t, err) + + time.Sleep(time.Duration(expiry) * time.Second) + resolveClaimTx, err := game.ResolveClaim(&s.L1.txOpts, common.Big0, common.Big0) + require.Nil(t, err) + + err = s.L1.env.EthCl.SendTransaction(t.Ctx(), resolveClaimTx) + require.Nil(t, err) + return resolveClaimTx.Hash() +} + +// ActResolve creates a L1 resolve tx for the latest withdrawal. +// Resolve is different than resolving a claim, the root claim must be resolved first and then +// the game itself can be resolved. +func (s *CrossLayerUser) ActResolve(t Testing) { + s.L1.lastTxHash = s.Resolve(t, s.lastL2WithdrawalTxHash) +} + +// Resolve creates a L1 resolve tx for the given L2 withdrawal tx, returning the tx hash. +func (s *CrossLayerUser) Resolve(t Testing, l2TxHash common.Hash) common.Hash { + params, err := s.getLatestWithdrawalParams(t) + if err != nil { + t.InvalidAction("cannot resolve game: %v", err) + return common.Hash{} + } + + game, err := s.getDisputeGame(t, *params) + require.NoError(t, err) + + resolveTx, err := game.Resolve(&s.L1.txOpts) + require.Nil(t, err) + + err = s.L1.env.EthCl.SendTransaction(t.Ctx(), resolveTx) + require.Nil(t, err) + return resolveTx.Hash() +} diff --git a/op-e2e2/actions/user_test.go b/op-e2e2/actions/user_test.go new file mode 100644 index 000000000000..08f4b139b93a --- /dev/null +++ b/op-e2e2/actions/user_test.go @@ -0,0 +1,316 @@ +package actions + +import ( + "fmt" + "math/rand" + "testing" + "time" + + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/log" + "github.com/stretchr/testify/require" + + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils" + "github.com/ethereum-optimism/optimism/op-service/testlog" +) + +type hardforkScheduledTest struct { + regolithTime *hexutil.Uint64 + canyonTime *hexutil.Uint64 + deltaTime *hexutil.Uint64 + ecotoneTime *hexutil.Uint64 + fjordTime *hexutil.Uint64 + runToFork string +} + +func (tc *hardforkScheduledTest) SetFork(fork string, v uint64) { + *tc.fork(fork) = (*hexutil.Uint64)(&v) +} + +func (tc *hardforkScheduledTest) GetFork(fork string) *uint64 { + return (*uint64)(*tc.fork(fork)) +} + +func (tc *hardforkScheduledTest) fork(fork string) **hexutil.Uint64 { + switch fork { + case "fjord": + return &tc.fjordTime + case "ecotone": + return &tc.ecotoneTime + case "delta": + return &tc.deltaTime + case "canyon": + return &tc.canyonTime + case "regolith": + return &tc.regolithTime + default: + panic(fmt.Errorf("unrecognized fork: %s", fork)) + } +} + +// TestCrossLayerUser tests that common actions of the CrossLayerUser actor work in various hardfork configurations: +// - transact on L1 +// - transact on L2 +// - deposit on L1 +// - withdraw from L2 +// - prove tx on L1 +// - wait 1 week + 1 second +// - finalize withdrawal on L1 +func TestCrossLayerUser(t *testing.T) { + futureTime := uint64(20) + farFutureTime := uint64(2000) + + forks := []string{ + "regolith", + "canyon", + "delta", + "ecotone", + "fjord", + } + for i, fork := range forks { + i := i + fork := fork + t.Run("fork_"+fork, func(t *testing.T) { + t.Run("at_genesis", func(t *testing.T) { + tc := hardforkScheduledTest{} + for _, f := range forks[:i+1] { // activate, all up to and incl this fork, at genesis + tc.SetFork(f, 0) + } + runCrossLayerUserTest(t, tc) + }) + t.Run("after_genesis", func(t *testing.T) { + tc := hardforkScheduledTest{} + for _, f := range forks[:i] { // activate, all up to this fork, at genesis + tc.SetFork(f, 0) + } + // activate this fork after genesis + tc.SetFork(fork, futureTime) + tc.runToFork = fork + runCrossLayerUserTest(t, tc) + }) + t.Run("not_yet", func(t *testing.T) { + tc := hardforkScheduledTest{} + for _, f := range forks[:i] { // activate, all up to this fork, at genesis + tc.SetFork(f, 0) + } + // activate this fork later + tc.SetFork(fork, farFutureTime) + if i > 0 { + tc.runToFork = forks[i-1] + } + runCrossLayerUserTest(t, tc) + }) + }) + } +} + +func runCrossLayerUserTest(gt *testing.T, test hardforkScheduledTest) { + t := NewDefaultTesting(gt) + dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) + // This overwrites all deploy-config settings, + // so even when the deploy-config defaults change, we test the right transitions. + dp.DeployConfig.L2GenesisRegolithTimeOffset = test.regolithTime + dp.DeployConfig.L2GenesisCanyonTimeOffset = test.canyonTime + dp.DeployConfig.L2GenesisDeltaTimeOffset = test.deltaTime + dp.DeployConfig.L2GenesisEcotoneTimeOffset = test.ecotoneTime + dp.DeployConfig.L2GenesisFjordTimeOffset = test.fjordTime + + if test.canyonTime != nil { + require.Zero(t, uint64(*test.canyonTime)%uint64(dp.DeployConfig.L2BlockTime), "canyon fork must be aligned") + } + if test.ecotoneTime != nil { + require.Zero(t, uint64(*test.ecotoneTime)%uint64(dp.DeployConfig.L2BlockTime), "ecotone fork must be aligned") + } + + sd := e2eutils.Setup(t, dp, defaultAlloc) + log := testlog.Logger(t, log.LevelDebug) + + require.Equal(t, dp.Secrets.Addresses().Batcher, dp.DeployConfig.BatchSenderAddress) + require.Equal(t, dp.Secrets.Addresses().Proposer, dp.DeployConfig.L2OutputOracleProposer) + + miner, seqEngine, seq := setupSequencerTest(t, sd, log) + batcher := NewL2Batcher(log, sd.RollupCfg, DefaultBatcherCfg(dp), + seq.RollupClient(), miner.EthClient(), seqEngine.EthClient(), seqEngine.EngineClient(t, sd.RollupCfg)) + + var proposer *L2Proposer + if e2eutils.UseFPAC() { + proposer = NewL2Proposer(t, log, &ProposerCfg{ + DisputeGameFactoryAddr: &sd.DeploymentsL1.DisputeGameFactoryProxy, + ProposalInterval: 6 * time.Second, + DisputeGameType: 0, + ProposerKey: dp.Secrets.Proposer, + AllowNonFinalized: true, + }, miner.EthClient(), seq.RollupClient()) + } else { + proposer = NewL2Proposer(t, log, &ProposerCfg{ + OutputOracleAddr: &sd.DeploymentsL1.L2OutputOracleProxy, + ProposerKey: dp.Secrets.Proposer, + AllowNonFinalized: true, + }, miner.EthClient(), seq.RollupClient()) + } + + // need to start derivation before we can make L2 blocks + seq.ActL2PipelineFull(t) + + l1Cl := miner.EthClient() + l2Cl := seqEngine.EthClient() + l2ProofCl := seqEngine.GethClient() + + addresses := e2eutils.CollectAddresses(sd, dp) + + l1UserEnv := &BasicUserEnv[*L1Bindings]{ + EthCl: l1Cl, + Signer: types.LatestSigner(sd.L1Cfg.Config), + AddressCorpora: addresses, + Bindings: NewL1Bindings(t, l1Cl), + } + l2UserEnv := &BasicUserEnv[*L2Bindings]{ + EthCl: l2Cl, + Signer: types.LatestSigner(sd.L2Cfg.Config), + AddressCorpora: addresses, + Bindings: NewL2Bindings(t, l2Cl, l2ProofCl), + } + + alice := NewCrossLayerUser(log, dp.Secrets.Alice, rand.New(rand.NewSource(1234))) + alice.L1.SetUserEnv(l1UserEnv) + alice.L2.SetUserEnv(l2UserEnv) + + // Build at least one l2 block so we have an unsafe head with a deposit info tx (genesis block doesn't) + seq.ActL2StartBlock(t) + seq.ActL2EndBlock(t) + + if test.runToFork != "" { + forkTime := test.GetFork(test.runToFork) + require.NotNil(t, forkTime, "fork we are running up to must be configured") + // advance L2 enough to activate the fork we are running up to + seq.ActBuildL2ToTime(t, *forkTime) + } + // Check Regolith is active or not by confirming the system info tx is not a system tx + infoTx, err := l2Cl.TransactionInBlock(t.Ctx(), seq.L2Unsafe().Hash, 0) + require.NoError(t, err) + require.True(t, infoTx.IsDepositTx()) + // Should only be a system tx if regolith is not enabled + require.Equal(t, !seq.rollupCfg.IsRegolith(seq.L2Unsafe().Time), infoTx.IsSystemTx()) + + // regular L2 tx, in new L2 block + alice.L2.ActResetTxOpts(t) + alice.L2.ActSetTxToAddr(&dp.Addresses.Bob)(t) + alice.L2.ActMakeTx(t) + seq.ActL2StartBlock(t) + seqEngine.ActL2IncludeTx(alice.Address())(t) + seq.ActL2EndBlock(t) + alice.L2.ActCheckReceiptStatusOfLastTx(true)(t) + + // regular L1 tx, in new L1 block + alice.L1.ActResetTxOpts(t) + alice.L1.ActSetTxToAddr(&dp.Addresses.Bob)(t) + alice.L1.ActMakeTx(t) + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(alice.Address())(t) + miner.ActL1EndBlock(t) + alice.L1.ActCheckReceiptStatusOfLastTx(true)(t) + + // regular Deposit, in new L1 block + alice.ActDeposit(t) + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(alice.Address())(t) + miner.ActL1EndBlock(t) + + seq.ActL1HeadSignal(t) + + // sync sequencer build enough blocks to adopt latest L1 origin + for seq.SyncStatus().UnsafeL2.L1Origin.Number < miner.l1Chain.CurrentBlock().Number.Uint64() { + seq.ActL2StartBlock(t) + seq.ActL2EndBlock(t) + } + // Now that the L2 chain adopted the latest L1 block, check that we processed the deposit + alice.ActCheckDepositStatus(true, true)(t) + + // regular withdrawal, in new L2 block + alice.ActStartWithdrawal(t) + seq.ActL2StartBlock(t) + seqEngine.ActL2IncludeTx(alice.Address())(t) + seq.ActL2EndBlock(t) + alice.ActCheckStartWithdrawal(true)(t) + + // build a L1 block and more L2 blocks, + // to ensure the L2 withdrawal is old enough to be able to get into an output root proposal on L1 + miner.ActEmptyBlock(t) + seq.ActL1HeadSignal(t) + seq.ActBuildToL1Head(t) + + // submit everything to L1 + batcher.ActSubmitAll(t) + // include batch on L1 + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(dp.Addresses.Batcher)(t) + miner.ActL1EndBlock(t) + + // derive from L1, blocks will now become safe to propose + seq.ActL2PipelineFull(t) + + // make proposals until there is nothing left to propose + for proposer.CanPropose(t) { + // propose it to L1 + proposer.ActMakeProposalTx(t) + // include proposal on L1 + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(dp.Addresses.Proposer)(t) + miner.ActL1EndBlock(t) + // Check proposal was successful + receipt, err := miner.EthClient().TransactionReceipt(t.Ctx(), proposer.LastProposalTx()) + require.NoError(t, err) + require.Equal(t, types.ReceiptStatusSuccessful, receipt.Status, "proposal failed") + } + + // prove our withdrawal on L1 + alice.ActProveWithdrawal(t) + // include proved withdrawal in new L1 block + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(alice.Address())(t) + miner.ActL1EndBlock(t) + // check withdrawal succeeded + alice.L1.ActCheckReceiptStatusOfLastTx(true)(t) + + // A bit hacky- Mines an empty block with the time delta + // of the finalization period (12s) + 1 in order for the + // withdrawal to be finalized successfully. + miner.ActL1StartBlock(13)(t) + miner.ActL1EndBlock(t) + + // If using FPAC we need to resolve the game + if e2eutils.UseFPAC() { + // Resolve the root claim + alice.ActResolveClaim(t) + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(alice.Address())(t) + miner.ActL1EndBlock(t) + // Resolve the game + alice.L1.ActCheckReceiptStatusOfLastTx(true)(t) + alice.ActResolve(t) + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(alice.Address())(t) + miner.ActL1EndBlock(t) + // Create an empty block to pass the air-gap window + alice.L1.ActCheckReceiptStatusOfLastTx(true)(t) + miner.ActL1StartBlock(13)(t) + miner.ActL1EndBlock(t) + } + + // make the L1 finalize withdrawal tx + alice.ActCompleteWithdrawal(t) + // include completed withdrawal in new L1 block + miner.ActL1StartBlock(12)(t) + miner.ActL1IncludeTx(alice.Address())(t) + miner.ActL1EndBlock(t) + // check withdrawal succeeded + alice.L1.ActCheckReceiptStatusOfLastTx(true)(t) + + // Check Regolith wasn't activated during the test unintentionally + infoTx, err = l2Cl.TransactionInBlock(t.Ctx(), seq.L2Unsafe().Hash, 0) + require.NoError(t, err) + require.True(t, infoTx.IsDepositTx()) + // Should only be a system tx if regolith is not enabled + require.Equal(t, !seq.rollupCfg.IsRegolith(seq.L2Unsafe().Time), infoTx.IsSystemTx()) +} diff --git a/op-e2e2/bindings/addressmanager.go b/op-e2e2/bindings/addressmanager.go new file mode 100644 index 000000000000..dd650e998d6c --- /dev/null +++ b/op-e2e2/bindings/addressmanager.go @@ -0,0 +1,626 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// AddressManagerMetaData contains all meta data concerning the AddressManager contract. +var AddressManagerMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"function\",\"name\":\"getAddress\",\"inputs\":[{\"name\":\"_name\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setAddress\",\"inputs\":[{\"name\":\"_name\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"_address\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"AddressSet\",\"inputs\":[{\"name\":\"name\",\"type\":\"string\",\"indexed\":true,\"internalType\":\"string\"},{\"name\":\"newAddress\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"oldAddress\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false}]", + Bin: "0x608060405234801561001057600080fd5b5061001a3361001f565b61006f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6105ef8061007e6000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c80639b2ea4bd116100505780639b2ea4bd146100b9578063bf40fac1146100cc578063f2fde38b146100df57600080fd5b8063715018a61461006c5780638da5cb5b14610076575b600080fd5b6100746100f2565b005b60005473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b6100746100c73660046104fa565b610106565b6100906100da366004610548565b6101d9565b6100746100ed366004610585565b610215565b6100fa6102d1565b6101046000610352565b565b61010e6102d1565b6000610119836103c7565b60008181526001602052604090819020805473ffffffffffffffffffffffffffffffffffffffff8681167fffffffffffffffffffffffff00000000000000000000000000000000000000008316179092559151929350169061017c9085906105a7565b6040805191829003822073ffffffffffffffffffffffffffffffffffffffff808716845284166020840152917f9416a153a346f93d95f94b064ae3f148b6460473c6e82b3f9fc2521b873fcd6c910160405180910390a250505050565b6000600160006101e8846103c7565b815260208101919091526040016000205473ffffffffffffffffffffffffffffffffffffffff1692915050565b61021d6102d1565b73ffffffffffffffffffffffffffffffffffffffff81166102c5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6102ce81610352565b50565b60005473ffffffffffffffffffffffffffffffffffffffff163314610104576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102bc565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000816040516020016103da91906105a7565b604051602081830303815290604052805190602001209050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f83011261043757600080fd5b813567ffffffffffffffff80821115610452576104526103f7565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715610498576104986103f7565b816040528381528660208588010111156104b157600080fd5b836020870160208301376000602085830101528094505050505092915050565b803573ffffffffffffffffffffffffffffffffffffffff811681146104f557600080fd5b919050565b6000806040838503121561050d57600080fd5b823567ffffffffffffffff81111561052457600080fd5b61053085828601610426565b92505061053f602084016104d1565b90509250929050565b60006020828403121561055a57600080fd5b813567ffffffffffffffff81111561057157600080fd5b61057d84828501610426565b949350505050565b60006020828403121561059757600080fd5b6105a0826104d1565b9392505050565b6000825160005b818110156105c857602081860181015185830152016105ae565b818111156105d7576000828501525b50919091019291505056fea164736f6c634300080f000a", +} + +// AddressManagerABI is the input ABI used to generate the binding from. +// Deprecated: Use AddressManagerMetaData.ABI instead. +var AddressManagerABI = AddressManagerMetaData.ABI + +// AddressManagerBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use AddressManagerMetaData.Bin instead. +var AddressManagerBin = AddressManagerMetaData.Bin + +// DeployAddressManager deploys a new Ethereum contract, binding an instance of AddressManager to it. +func DeployAddressManager(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *AddressManager, error) { + parsed, err := AddressManagerMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(AddressManagerBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &AddressManager{AddressManagerCaller: AddressManagerCaller{contract: contract}, AddressManagerTransactor: AddressManagerTransactor{contract: contract}, AddressManagerFilterer: AddressManagerFilterer{contract: contract}}, nil +} + +// AddressManager is an auto generated Go binding around an Ethereum contract. +type AddressManager struct { + AddressManagerCaller // Read-only binding to the contract + AddressManagerTransactor // Write-only binding to the contract + AddressManagerFilterer // Log filterer for contract events +} + +// AddressManagerCaller is an auto generated read-only Go binding around an Ethereum contract. +type AddressManagerCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// AddressManagerTransactor is an auto generated write-only Go binding around an Ethereum contract. +type AddressManagerTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// AddressManagerFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type AddressManagerFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// AddressManagerSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type AddressManagerSession struct { + Contract *AddressManager // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// AddressManagerCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type AddressManagerCallerSession struct { + Contract *AddressManagerCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// AddressManagerTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type AddressManagerTransactorSession struct { + Contract *AddressManagerTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// AddressManagerRaw is an auto generated low-level Go binding around an Ethereum contract. +type AddressManagerRaw struct { + Contract *AddressManager // Generic contract binding to access the raw methods on +} + +// AddressManagerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type AddressManagerCallerRaw struct { + Contract *AddressManagerCaller // Generic read-only contract binding to access the raw methods on +} + +// AddressManagerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type AddressManagerTransactorRaw struct { + Contract *AddressManagerTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewAddressManager creates a new instance of AddressManager, bound to a specific deployed contract. +func NewAddressManager(address common.Address, backend bind.ContractBackend) (*AddressManager, error) { + contract, err := bindAddressManager(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &AddressManager{AddressManagerCaller: AddressManagerCaller{contract: contract}, AddressManagerTransactor: AddressManagerTransactor{contract: contract}, AddressManagerFilterer: AddressManagerFilterer{contract: contract}}, nil +} + +// NewAddressManagerCaller creates a new read-only instance of AddressManager, bound to a specific deployed contract. +func NewAddressManagerCaller(address common.Address, caller bind.ContractCaller) (*AddressManagerCaller, error) { + contract, err := bindAddressManager(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &AddressManagerCaller{contract: contract}, nil +} + +// NewAddressManagerTransactor creates a new write-only instance of AddressManager, bound to a specific deployed contract. +func NewAddressManagerTransactor(address common.Address, transactor bind.ContractTransactor) (*AddressManagerTransactor, error) { + contract, err := bindAddressManager(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &AddressManagerTransactor{contract: contract}, nil +} + +// NewAddressManagerFilterer creates a new log filterer instance of AddressManager, bound to a specific deployed contract. +func NewAddressManagerFilterer(address common.Address, filterer bind.ContractFilterer) (*AddressManagerFilterer, error) { + contract, err := bindAddressManager(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &AddressManagerFilterer{contract: contract}, nil +} + +// bindAddressManager binds a generic wrapper to an already deployed contract. +func bindAddressManager(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(AddressManagerABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_AddressManager *AddressManagerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _AddressManager.Contract.AddressManagerCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_AddressManager *AddressManagerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _AddressManager.Contract.AddressManagerTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_AddressManager *AddressManagerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _AddressManager.Contract.AddressManagerTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_AddressManager *AddressManagerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _AddressManager.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_AddressManager *AddressManagerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _AddressManager.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_AddressManager *AddressManagerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _AddressManager.Contract.contract.Transact(opts, method, params...) +} + +// GetAddress is a free data retrieval call binding the contract method 0xbf40fac1. +// +// Solidity: function getAddress(string _name) view returns(address) +func (_AddressManager *AddressManagerCaller) GetAddress(opts *bind.CallOpts, _name string) (common.Address, error) { + var out []interface{} + err := _AddressManager.contract.Call(opts, &out, "getAddress", _name) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// GetAddress is a free data retrieval call binding the contract method 0xbf40fac1. +// +// Solidity: function getAddress(string _name) view returns(address) +func (_AddressManager *AddressManagerSession) GetAddress(_name string) (common.Address, error) { + return _AddressManager.Contract.GetAddress(&_AddressManager.CallOpts, _name) +} + +// GetAddress is a free data retrieval call binding the contract method 0xbf40fac1. +// +// Solidity: function getAddress(string _name) view returns(address) +func (_AddressManager *AddressManagerCallerSession) GetAddress(_name string) (common.Address, error) { + return _AddressManager.Contract.GetAddress(&_AddressManager.CallOpts, _name) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_AddressManager *AddressManagerCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _AddressManager.contract.Call(opts, &out, "owner") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_AddressManager *AddressManagerSession) Owner() (common.Address, error) { + return _AddressManager.Contract.Owner(&_AddressManager.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_AddressManager *AddressManagerCallerSession) Owner() (common.Address, error) { + return _AddressManager.Contract.Owner(&_AddressManager.CallOpts) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_AddressManager *AddressManagerTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _AddressManager.contract.Transact(opts, "renounceOwnership") +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_AddressManager *AddressManagerSession) RenounceOwnership() (*types.Transaction, error) { + return _AddressManager.Contract.RenounceOwnership(&_AddressManager.TransactOpts) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_AddressManager *AddressManagerTransactorSession) RenounceOwnership() (*types.Transaction, error) { + return _AddressManager.Contract.RenounceOwnership(&_AddressManager.TransactOpts) +} + +// SetAddress is a paid mutator transaction binding the contract method 0x9b2ea4bd. +// +// Solidity: function setAddress(string _name, address _address) returns() +func (_AddressManager *AddressManagerTransactor) SetAddress(opts *bind.TransactOpts, _name string, _address common.Address) (*types.Transaction, error) { + return _AddressManager.contract.Transact(opts, "setAddress", _name, _address) +} + +// SetAddress is a paid mutator transaction binding the contract method 0x9b2ea4bd. +// +// Solidity: function setAddress(string _name, address _address) returns() +func (_AddressManager *AddressManagerSession) SetAddress(_name string, _address common.Address) (*types.Transaction, error) { + return _AddressManager.Contract.SetAddress(&_AddressManager.TransactOpts, _name, _address) +} + +// SetAddress is a paid mutator transaction binding the contract method 0x9b2ea4bd. +// +// Solidity: function setAddress(string _name, address _address) returns() +func (_AddressManager *AddressManagerTransactorSession) SetAddress(_name string, _address common.Address) (*types.Transaction, error) { + return _AddressManager.Contract.SetAddress(&_AddressManager.TransactOpts, _name, _address) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_AddressManager *AddressManagerTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { + return _AddressManager.contract.Transact(opts, "transferOwnership", newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_AddressManager *AddressManagerSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _AddressManager.Contract.TransferOwnership(&_AddressManager.TransactOpts, newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_AddressManager *AddressManagerTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _AddressManager.Contract.TransferOwnership(&_AddressManager.TransactOpts, newOwner) +} + +// AddressManagerAddressSetIterator is returned from FilterAddressSet and is used to iterate over the raw logs and unpacked data for AddressSet events raised by the AddressManager contract. +type AddressManagerAddressSetIterator struct { + Event *AddressManagerAddressSet // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *AddressManagerAddressSetIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(AddressManagerAddressSet) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(AddressManagerAddressSet) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *AddressManagerAddressSetIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *AddressManagerAddressSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// AddressManagerAddressSet represents a AddressSet event raised by the AddressManager contract. +type AddressManagerAddressSet struct { + Name common.Hash + NewAddress common.Address + OldAddress common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterAddressSet is a free log retrieval operation binding the contract event 0x9416a153a346f93d95f94b064ae3f148b6460473c6e82b3f9fc2521b873fcd6c. +// +// Solidity: event AddressSet(string indexed name, address newAddress, address oldAddress) +func (_AddressManager *AddressManagerFilterer) FilterAddressSet(opts *bind.FilterOpts, name []string) (*AddressManagerAddressSetIterator, error) { + + var nameRule []interface{} + for _, nameItem := range name { + nameRule = append(nameRule, nameItem) + } + + logs, sub, err := _AddressManager.contract.FilterLogs(opts, "AddressSet", nameRule) + if err != nil { + return nil, err + } + return &AddressManagerAddressSetIterator{contract: _AddressManager.contract, event: "AddressSet", logs: logs, sub: sub}, nil +} + +// WatchAddressSet is a free log subscription operation binding the contract event 0x9416a153a346f93d95f94b064ae3f148b6460473c6e82b3f9fc2521b873fcd6c. +// +// Solidity: event AddressSet(string indexed name, address newAddress, address oldAddress) +func (_AddressManager *AddressManagerFilterer) WatchAddressSet(opts *bind.WatchOpts, sink chan<- *AddressManagerAddressSet, name []string) (event.Subscription, error) { + + var nameRule []interface{} + for _, nameItem := range name { + nameRule = append(nameRule, nameItem) + } + + logs, sub, err := _AddressManager.contract.WatchLogs(opts, "AddressSet", nameRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(AddressManagerAddressSet) + if err := _AddressManager.contract.UnpackLog(event, "AddressSet", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseAddressSet is a log parse operation binding the contract event 0x9416a153a346f93d95f94b064ae3f148b6460473c6e82b3f9fc2521b873fcd6c. +// +// Solidity: event AddressSet(string indexed name, address newAddress, address oldAddress) +func (_AddressManager *AddressManagerFilterer) ParseAddressSet(log types.Log) (*AddressManagerAddressSet, error) { + event := new(AddressManagerAddressSet) + if err := _AddressManager.contract.UnpackLog(event, "AddressSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// AddressManagerOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the AddressManager contract. +type AddressManagerOwnershipTransferredIterator struct { + Event *AddressManagerOwnershipTransferred // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *AddressManagerOwnershipTransferredIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(AddressManagerOwnershipTransferred) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(AddressManagerOwnershipTransferred) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *AddressManagerOwnershipTransferredIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *AddressManagerOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// AddressManagerOwnershipTransferred represents a OwnershipTransferred event raised by the AddressManager contract. +type AddressManagerOwnershipTransferred struct { + PreviousOwner common.Address + NewOwner common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_AddressManager *AddressManagerFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*AddressManagerOwnershipTransferredIterator, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _AddressManager.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return &AddressManagerOwnershipTransferredIterator{contract: _AddressManager.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_AddressManager *AddressManagerFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *AddressManagerOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _AddressManager.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(AddressManagerOwnershipTransferred) + if err := _AddressManager.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_AddressManager *AddressManagerFilterer) ParseOwnershipTransferred(log types.Log) (*AddressManagerOwnershipTransferred, error) { + event := new(AddressManagerOwnershipTransferred) + if err := _AddressManager.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/op-e2e2/bindings/alphabetvm.go b/op-e2e2/bindings/alphabetvm.go new file mode 100644 index 000000000000..7f0607b6cee1 --- /dev/null +++ b/op-e2e2/bindings/alphabetvm.go @@ -0,0 +1,264 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// AlphabetVMMetaData contains all meta data concerning the AlphabetVM contract. +var AlphabetVMMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_absolutePrestate\",\"type\":\"bytes32\",\"internalType\":\"Claim\"},{\"name\":\"_oracle\",\"type\":\"address\",\"internalType\":\"contractPreimageOracle\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"oracle\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIPreimageOracle\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"step\",\"inputs\":[{\"name\":\"_stateData\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"_localContext\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"postState_\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"}]", + Bin: "0x60a060405234801561001057600080fd5b506040516105d23803806105d283398101604081905261002f91610059565b608091909152600080546001600160a01b0319166001600160a01b03909216919091179055610096565b6000806040838503121561006c57600080fd5b825160208401519092506001600160a01b038116811461008b57600080fd5b809150509250929050565b6080516105226100b0600039600060af01526105226000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80637dc0d1d01461003b578063e14ced3214610085575b600080fd5b60005461005b9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b61009861009336600461039c565b6100a6565b60405190815260200161007c565b600080600060087f0000000000000000000000000000000000000000000000000000000000000000901b600889896040516100e2929190610410565b6040518091039020901b036101e0576000805473ffffffffffffffffffffffffffffffffffffffff1663e03110e161011b6004886102a6565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526004810191909152600060248201526044016040805180830381865afa158015610175573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101999190610420565b50905060006101b3600163ffffffff608085901c16610473565b600481901b9450905060006101ca8a8c018c61048a565b90506101d685826104a3565b935050505061020d565b6101ec878901896104bb565b9092509050816101fb816104dd565b9250508080610209906104dd565b9150505b6040805160208101849052908101829052606001604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291905280516020909101207effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f01000000000000000000000000000000000000000000000000000000000000001798975050505050505050565b7f01000000000000000000000000000000000000000000000000000000000000007effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83161761034c818360408051600093845233602052918152606090922091527effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f01000000000000000000000000000000000000000000000000000000000000001790565b9392505050565b60008083601f84011261036557600080fd5b50813567ffffffffffffffff81111561037d57600080fd5b60208301915083602082850101111561039557600080fd5b9250929050565b6000806000806000606086880312156103b457600080fd5b853567ffffffffffffffff808211156103cc57600080fd5b6103d889838a01610353565b909750955060208801359150808211156103f157600080fd5b506103fe88828901610353565b96999598509660400135949350505050565b8183823760009101908152919050565b6000806040838503121561043357600080fd5b505080516020909101519092909150565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008282101561048557610485610444565b500390565b60006020828403121561049c57600080fd5b5035919050565b600082198211156104b6576104b6610444565b500190565b600080604083850312156104ce57600080fd5b50508035926020909101359150565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361050e5761050e610444565b506001019056fea164736f6c634300080f000a", +} + +// AlphabetVMABI is the input ABI used to generate the binding from. +// Deprecated: Use AlphabetVMMetaData.ABI instead. +var AlphabetVMABI = AlphabetVMMetaData.ABI + +// AlphabetVMBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use AlphabetVMMetaData.Bin instead. +var AlphabetVMBin = AlphabetVMMetaData.Bin + +// DeployAlphabetVM deploys a new Ethereum contract, binding an instance of AlphabetVM to it. +func DeployAlphabetVM(auth *bind.TransactOpts, backend bind.ContractBackend, _absolutePrestate [32]byte, _oracle common.Address) (common.Address, *types.Transaction, *AlphabetVM, error) { + parsed, err := AlphabetVMMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(AlphabetVMBin), backend, _absolutePrestate, _oracle) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &AlphabetVM{AlphabetVMCaller: AlphabetVMCaller{contract: contract}, AlphabetVMTransactor: AlphabetVMTransactor{contract: contract}, AlphabetVMFilterer: AlphabetVMFilterer{contract: contract}}, nil +} + +// AlphabetVM is an auto generated Go binding around an Ethereum contract. +type AlphabetVM struct { + AlphabetVMCaller // Read-only binding to the contract + AlphabetVMTransactor // Write-only binding to the contract + AlphabetVMFilterer // Log filterer for contract events +} + +// AlphabetVMCaller is an auto generated read-only Go binding around an Ethereum contract. +type AlphabetVMCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// AlphabetVMTransactor is an auto generated write-only Go binding around an Ethereum contract. +type AlphabetVMTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// AlphabetVMFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type AlphabetVMFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// AlphabetVMSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type AlphabetVMSession struct { + Contract *AlphabetVM // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// AlphabetVMCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type AlphabetVMCallerSession struct { + Contract *AlphabetVMCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// AlphabetVMTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type AlphabetVMTransactorSession struct { + Contract *AlphabetVMTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// AlphabetVMRaw is an auto generated low-level Go binding around an Ethereum contract. +type AlphabetVMRaw struct { + Contract *AlphabetVM // Generic contract binding to access the raw methods on +} + +// AlphabetVMCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type AlphabetVMCallerRaw struct { + Contract *AlphabetVMCaller // Generic read-only contract binding to access the raw methods on +} + +// AlphabetVMTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type AlphabetVMTransactorRaw struct { + Contract *AlphabetVMTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewAlphabetVM creates a new instance of AlphabetVM, bound to a specific deployed contract. +func NewAlphabetVM(address common.Address, backend bind.ContractBackend) (*AlphabetVM, error) { + contract, err := bindAlphabetVM(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &AlphabetVM{AlphabetVMCaller: AlphabetVMCaller{contract: contract}, AlphabetVMTransactor: AlphabetVMTransactor{contract: contract}, AlphabetVMFilterer: AlphabetVMFilterer{contract: contract}}, nil +} + +// NewAlphabetVMCaller creates a new read-only instance of AlphabetVM, bound to a specific deployed contract. +func NewAlphabetVMCaller(address common.Address, caller bind.ContractCaller) (*AlphabetVMCaller, error) { + contract, err := bindAlphabetVM(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &AlphabetVMCaller{contract: contract}, nil +} + +// NewAlphabetVMTransactor creates a new write-only instance of AlphabetVM, bound to a specific deployed contract. +func NewAlphabetVMTransactor(address common.Address, transactor bind.ContractTransactor) (*AlphabetVMTransactor, error) { + contract, err := bindAlphabetVM(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &AlphabetVMTransactor{contract: contract}, nil +} + +// NewAlphabetVMFilterer creates a new log filterer instance of AlphabetVM, bound to a specific deployed contract. +func NewAlphabetVMFilterer(address common.Address, filterer bind.ContractFilterer) (*AlphabetVMFilterer, error) { + contract, err := bindAlphabetVM(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &AlphabetVMFilterer{contract: contract}, nil +} + +// bindAlphabetVM binds a generic wrapper to an already deployed contract. +func bindAlphabetVM(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(AlphabetVMABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_AlphabetVM *AlphabetVMRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _AlphabetVM.Contract.AlphabetVMCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_AlphabetVM *AlphabetVMRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _AlphabetVM.Contract.AlphabetVMTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_AlphabetVM *AlphabetVMRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _AlphabetVM.Contract.AlphabetVMTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_AlphabetVM *AlphabetVMCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _AlphabetVM.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_AlphabetVM *AlphabetVMTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _AlphabetVM.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_AlphabetVM *AlphabetVMTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _AlphabetVM.Contract.contract.Transact(opts, method, params...) +} + +// Oracle is a free data retrieval call binding the contract method 0x7dc0d1d0. +// +// Solidity: function oracle() view returns(address) +func (_AlphabetVM *AlphabetVMCaller) Oracle(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _AlphabetVM.contract.Call(opts, &out, "oracle") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Oracle is a free data retrieval call binding the contract method 0x7dc0d1d0. +// +// Solidity: function oracle() view returns(address) +func (_AlphabetVM *AlphabetVMSession) Oracle() (common.Address, error) { + return _AlphabetVM.Contract.Oracle(&_AlphabetVM.CallOpts) +} + +// Oracle is a free data retrieval call binding the contract method 0x7dc0d1d0. +// +// Solidity: function oracle() view returns(address) +func (_AlphabetVM *AlphabetVMCallerSession) Oracle() (common.Address, error) { + return _AlphabetVM.Contract.Oracle(&_AlphabetVM.CallOpts) +} + +// Step is a free data retrieval call binding the contract method 0xe14ced32. +// +// Solidity: function step(bytes _stateData, bytes , bytes32 _localContext) view returns(bytes32 postState_) +func (_AlphabetVM *AlphabetVMCaller) Step(opts *bind.CallOpts, _stateData []byte, arg1 []byte, _localContext [32]byte) ([32]byte, error) { + var out []interface{} + err := _AlphabetVM.contract.Call(opts, &out, "step", _stateData, arg1, _localContext) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// Step is a free data retrieval call binding the contract method 0xe14ced32. +// +// Solidity: function step(bytes _stateData, bytes , bytes32 _localContext) view returns(bytes32 postState_) +func (_AlphabetVM *AlphabetVMSession) Step(_stateData []byte, arg1 []byte, _localContext [32]byte) ([32]byte, error) { + return _AlphabetVM.Contract.Step(&_AlphabetVM.CallOpts, _stateData, arg1, _localContext) +} + +// Step is a free data retrieval call binding the contract method 0xe14ced32. +// +// Solidity: function step(bytes _stateData, bytes , bytes32 _localContext) view returns(bytes32 postState_) +func (_AlphabetVM *AlphabetVMCallerSession) Step(_stateData []byte, arg1 []byte, _localContext [32]byte) ([32]byte, error) { + return _AlphabetVM.Contract.Step(&_AlphabetVM.CallOpts, _stateData, arg1, _localContext) +} diff --git a/op-e2e2/bindings/alphabetvm2.go b/op-e2e2/bindings/alphabetvm2.go new file mode 100644 index 000000000000..5ec135eed596 --- /dev/null +++ b/op-e2e2/bindings/alphabetvm2.go @@ -0,0 +1,264 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// AlphabetVM2MetaData contains all meta data concerning the AlphabetVM2 contract. +var AlphabetVM2MetaData = &bind.MetaData{ + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_absolutePrestate\",\"type\":\"bytes32\",\"internalType\":\"Claim\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"oracle\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIPreimageOracle\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"step\",\"inputs\":[{\"name\":\"_stateData\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"_localContext\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"postState_\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"}]", + Bin: "0x60a060405234801561001057600080fd5b50604051610c23380380610c2383398101604081905261002f91610090565b608081905260405161004090610083565b604051809103906000f08015801561005c573d6000803e3d6000fd5b50600080546001600160a01b0319166001600160a01b0392909216919091179055506100a9565b61065c806105c783390190565b6000602082840312156100a257600080fd5b5051919050565b6080516105046100c3600039600060af01526105046000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80637dc0d1d01461003b578063e14ced3214610085575b600080fd5b60005461005b9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b610098610093366004610395565b6100a6565b60405190815260200161007c565b600080600060087f0000000000000000000000000000000000000000000000000000000000000000901b600889896040516100e2929190610409565b6040518091039020901b036101d9576000805473ffffffffffffffffffffffffffffffffffffffff1663e03110e161011b60048861029f565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526004810191909152600060248201526044016040805180830381865afa158015610175573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101999190610419565b50640ffffffff0607c82901c169350905063ffffffff608082901c1660006101c38a8c018c61043d565b90506101cf8582610485565b9350505050610206565b6101e58789018961049d565b9092509050816101f4816104bf565b9250508080610202906104bf565b9150505b6040805160208101849052908101829052606001604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291905280516020909101207effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f01000000000000000000000000000000000000000000000000000000000000001798975050505050505050565b7f01000000000000000000000000000000000000000000000000000000000000007effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831617610345818360408051600093845233602052918152606090922091527effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f01000000000000000000000000000000000000000000000000000000000000001790565b9392505050565b60008083601f84011261035e57600080fd5b50813567ffffffffffffffff81111561037657600080fd5b60208301915083602082850101111561038e57600080fd5b9250929050565b6000806000806000606086880312156103ad57600080fd5b853567ffffffffffffffff808211156103c557600080fd5b6103d189838a0161034c565b909750955060208801359150808211156103ea57600080fd5b506103f78882890161034c565b96999598509660400135949350505050565b8183823760009101908152919050565b6000806040838503121561042c57600080fd5b505080516020909101519092909150565b60006020828403121561044f57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000821982111561049857610498610456565b500190565b600080604083850312156104b057600080fd5b50508035926020909101359150565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036104f0576104f0610456565b506001019056fea164736f6c634300080f000a608060405234801561001057600080fd5b5061063c806100206000396000f3fe608060405234801561001057600080fd5b50600436106100725760003560e01c8063e03110e111610050578063e03110e114610106578063e15926111461012e578063fef2b4ed1461014357600080fd5b806352f0f3ad1461007757806361238bde1461009d5780638542cf50146100c8575b600080fd5b61008a6100853660046104df565b610163565b6040519081526020015b60405180910390f35b61008a6100ab36600461051a565b600160209081526000928352604080842090915290825290205481565b6100f66100d636600461051a565b600260209081526000928352604080842090915290825290205460ff1681565b6040519015158152602001610094565b61011961011436600461051a565b610238565b60408051928352602083019190915201610094565b61014161013c36600461053c565b610329565b005b61008a6101513660046105b8565b60006020819052908152604090205481565b600061016f8686610432565b905061017c836008610600565b8211806101895750602083115b156101c0576040517ffe25498700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000602081815260c085901b82526008959095528251828252600286526040808320858452875280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660019081179091558484528752808320948352938652838220558181529384905292205592915050565b6000828152600260209081526040808320848452909152812054819060ff166102c1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f7072652d696d616765206d757374206578697374000000000000000000000000604482015260640160405180910390fd5b50600083815260208181526040909120546102dd816008610600565b6102e8856020610600565b1061030657836102f9826008610600565b6103039190610618565b91505b506000938452600160209081526040808620948652939052919092205492909150565b604435600080600883018611156103485763fe2549876000526004601cfd5b60c083901b6080526088838682378087017ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80151908490207effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f02000000000000000000000000000000000000000000000000000000000000001760008181526002602090815260408083208b8452825280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600190811790915584845282528083209a83529981528982209390935590815290819052959095209190915550505050565b7f01000000000000000000000000000000000000000000000000000000000000007effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8316176104d8818360408051600093845233602052918152606090922091527effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f01000000000000000000000000000000000000000000000000000000000000001790565b9392505050565b600080600080600060a086880312156104f757600080fd5b505083359560208501359550604085013594606081013594506080013592509050565b6000806040838503121561052d57600080fd5b50508035926020909101359150565b60008060006040848603121561055157600080fd5b83359250602084013567ffffffffffffffff8082111561057057600080fd5b818601915086601f83011261058457600080fd5b81358181111561059357600080fd5b8760208285010111156105a557600080fd5b6020830194508093505050509250925092565b6000602082840312156105ca57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008219821115610613576106136105d1565b500190565b60008282101561062a5761062a6105d1565b50039056fea164736f6c634300080f000a", +} + +// AlphabetVM2ABI is the input ABI used to generate the binding from. +// Deprecated: Use AlphabetVM2MetaData.ABI instead. +var AlphabetVM2ABI = AlphabetVM2MetaData.ABI + +// AlphabetVM2Bin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use AlphabetVM2MetaData.Bin instead. +var AlphabetVM2Bin = AlphabetVM2MetaData.Bin + +// DeployAlphabetVM2 deploys a new Ethereum contract, binding an instance of AlphabetVM2 to it. +func DeployAlphabetVM2(auth *bind.TransactOpts, backend bind.ContractBackend, _absolutePrestate [32]byte) (common.Address, *types.Transaction, *AlphabetVM2, error) { + parsed, err := AlphabetVM2MetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(AlphabetVM2Bin), backend, _absolutePrestate) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &AlphabetVM2{AlphabetVM2Caller: AlphabetVM2Caller{contract: contract}, AlphabetVM2Transactor: AlphabetVM2Transactor{contract: contract}, AlphabetVM2Filterer: AlphabetVM2Filterer{contract: contract}}, nil +} + +// AlphabetVM2 is an auto generated Go binding around an Ethereum contract. +type AlphabetVM2 struct { + AlphabetVM2Caller // Read-only binding to the contract + AlphabetVM2Transactor // Write-only binding to the contract + AlphabetVM2Filterer // Log filterer for contract events +} + +// AlphabetVM2Caller is an auto generated read-only Go binding around an Ethereum contract. +type AlphabetVM2Caller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// AlphabetVM2Transactor is an auto generated write-only Go binding around an Ethereum contract. +type AlphabetVM2Transactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// AlphabetVM2Filterer is an auto generated log filtering Go binding around an Ethereum contract events. +type AlphabetVM2Filterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// AlphabetVM2Session is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type AlphabetVM2Session struct { + Contract *AlphabetVM2 // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// AlphabetVM2CallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type AlphabetVM2CallerSession struct { + Contract *AlphabetVM2Caller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// AlphabetVM2TransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type AlphabetVM2TransactorSession struct { + Contract *AlphabetVM2Transactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// AlphabetVM2Raw is an auto generated low-level Go binding around an Ethereum contract. +type AlphabetVM2Raw struct { + Contract *AlphabetVM2 // Generic contract binding to access the raw methods on +} + +// AlphabetVM2CallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type AlphabetVM2CallerRaw struct { + Contract *AlphabetVM2Caller // Generic read-only contract binding to access the raw methods on +} + +// AlphabetVM2TransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type AlphabetVM2TransactorRaw struct { + Contract *AlphabetVM2Transactor // Generic write-only contract binding to access the raw methods on +} + +// NewAlphabetVM2 creates a new instance of AlphabetVM2, bound to a specific deployed contract. +func NewAlphabetVM2(address common.Address, backend bind.ContractBackend) (*AlphabetVM2, error) { + contract, err := bindAlphabetVM2(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &AlphabetVM2{AlphabetVM2Caller: AlphabetVM2Caller{contract: contract}, AlphabetVM2Transactor: AlphabetVM2Transactor{contract: contract}, AlphabetVM2Filterer: AlphabetVM2Filterer{contract: contract}}, nil +} + +// NewAlphabetVM2Caller creates a new read-only instance of AlphabetVM2, bound to a specific deployed contract. +func NewAlphabetVM2Caller(address common.Address, caller bind.ContractCaller) (*AlphabetVM2Caller, error) { + contract, err := bindAlphabetVM2(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &AlphabetVM2Caller{contract: contract}, nil +} + +// NewAlphabetVM2Transactor creates a new write-only instance of AlphabetVM2, bound to a specific deployed contract. +func NewAlphabetVM2Transactor(address common.Address, transactor bind.ContractTransactor) (*AlphabetVM2Transactor, error) { + contract, err := bindAlphabetVM2(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &AlphabetVM2Transactor{contract: contract}, nil +} + +// NewAlphabetVM2Filterer creates a new log filterer instance of AlphabetVM2, bound to a specific deployed contract. +func NewAlphabetVM2Filterer(address common.Address, filterer bind.ContractFilterer) (*AlphabetVM2Filterer, error) { + contract, err := bindAlphabetVM2(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &AlphabetVM2Filterer{contract: contract}, nil +} + +// bindAlphabetVM2 binds a generic wrapper to an already deployed contract. +func bindAlphabetVM2(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(AlphabetVM2ABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_AlphabetVM2 *AlphabetVM2Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _AlphabetVM2.Contract.AlphabetVM2Caller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_AlphabetVM2 *AlphabetVM2Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _AlphabetVM2.Contract.AlphabetVM2Transactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_AlphabetVM2 *AlphabetVM2Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _AlphabetVM2.Contract.AlphabetVM2Transactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_AlphabetVM2 *AlphabetVM2CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _AlphabetVM2.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_AlphabetVM2 *AlphabetVM2TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _AlphabetVM2.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_AlphabetVM2 *AlphabetVM2TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _AlphabetVM2.Contract.contract.Transact(opts, method, params...) +} + +// Oracle is a free data retrieval call binding the contract method 0x7dc0d1d0. +// +// Solidity: function oracle() view returns(address) +func (_AlphabetVM2 *AlphabetVM2Caller) Oracle(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _AlphabetVM2.contract.Call(opts, &out, "oracle") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Oracle is a free data retrieval call binding the contract method 0x7dc0d1d0. +// +// Solidity: function oracle() view returns(address) +func (_AlphabetVM2 *AlphabetVM2Session) Oracle() (common.Address, error) { + return _AlphabetVM2.Contract.Oracle(&_AlphabetVM2.CallOpts) +} + +// Oracle is a free data retrieval call binding the contract method 0x7dc0d1d0. +// +// Solidity: function oracle() view returns(address) +func (_AlphabetVM2 *AlphabetVM2CallerSession) Oracle() (common.Address, error) { + return _AlphabetVM2.Contract.Oracle(&_AlphabetVM2.CallOpts) +} + +// Step is a free data retrieval call binding the contract method 0xe14ced32. +// +// Solidity: function step(bytes _stateData, bytes , bytes32 _localContext) view returns(bytes32 postState_) +func (_AlphabetVM2 *AlphabetVM2Caller) Step(opts *bind.CallOpts, _stateData []byte, arg1 []byte, _localContext [32]byte) ([32]byte, error) { + var out []interface{} + err := _AlphabetVM2.contract.Call(opts, &out, "step", _stateData, arg1, _localContext) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// Step is a free data retrieval call binding the contract method 0xe14ced32. +// +// Solidity: function step(bytes _stateData, bytes , bytes32 _localContext) view returns(bytes32 postState_) +func (_AlphabetVM2 *AlphabetVM2Session) Step(_stateData []byte, arg1 []byte, _localContext [32]byte) ([32]byte, error) { + return _AlphabetVM2.Contract.Step(&_AlphabetVM2.CallOpts, _stateData, arg1, _localContext) +} + +// Step is a free data retrieval call binding the contract method 0xe14ced32. +// +// Solidity: function step(bytes _stateData, bytes , bytes32 _localContext) view returns(bytes32 postState_) +func (_AlphabetVM2 *AlphabetVM2CallerSession) Step(_stateData []byte, arg1 []byte, _localContext [32]byte) ([32]byte, error) { + return _AlphabetVM2.Contract.Step(&_AlphabetVM2.CallOpts, _stateData, arg1, _localContext) +} diff --git a/op-e2e2/bindings/basefeevault.go b/op-e2e2/bindings/basefeevault.go new file mode 100644 index 000000000000..c81c322485c5 --- /dev/null +++ b/op-e2e2/bindings/basefeevault.go @@ -0,0 +1,672 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// BaseFeeVaultMetaData contains all meta data concerning the BaseFeeVault contract. +var BaseFeeVaultMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_recipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_minWithdrawalAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_withdrawalNetwork\",\"type\":\"uint8\",\"internalType\":\"enumFeeVault.WithdrawalNetwork\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"MIN_WITHDRAWAL_AMOUNT\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"RECIPIENT\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"WITHDRAWAL_NETWORK\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"enumFeeVault.WithdrawalNetwork\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"totalProcessed\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"withdraw\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"Withdrawal\",\"inputs\":[{\"name\":\"value\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"from\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Withdrawal\",\"inputs\":[{\"name\":\"value\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"from\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"withdrawalNetwork\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"enumFeeVault.WithdrawalNetwork\"}],\"anonymous\":false}]", + Bin: "0x60e060405234801561001057600080fd5b506040516108d13803806108d183398101604081905261002f91610079565b6001600160a01b03831660a0526080829052828282806001811115610056576100566100cc565b60c081600181111561006a5761006a6100cc565b815250505050505050506100e2565b60008060006060848603121561008e57600080fd5b83516001600160a01b03811681146100a557600080fd5b602085015160408601519194509250600281106100c157600080fd5b809150509250925092565b634e487b7160e01b600052602160045260246000fd5b60805160a05160c051610790610141600039600081816101760152818161038901526103c40152600081816087015281816102d801528181610367015281816103fd01526105640152600081816101b701526101db01526107906000f3fe6080604052600436106100695760003560e01c806384411d651161004357806384411d6514610140578063d0e12f9014610164578063d3e5792b146101a557600080fd5b80630d9019e1146100755780633ccfd60b146100d357806354fd4d50146100ea57600080fd5b3661007057005b600080fd5b34801561008157600080fd5b506100a97f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b3480156100df57600080fd5b506100e86101d9565b005b3480156100f657600080fd5b506101336040518060400160405280600581526020017f312e342e3100000000000000000000000000000000000000000000000000000081525081565b6040516100ca9190610630565b34801561014c57600080fd5b5061015660005481565b6040519081526020016100ca565b34801561017057600080fd5b506101987f000000000000000000000000000000000000000000000000000000000000000081565b6040516100ca91906106b4565b3480156101b157600080fd5b506101567f000000000000000000000000000000000000000000000000000000000000000081565b7f00000000000000000000000000000000000000000000000000000000000000004710156102b4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604a60248201527f4665655661756c743a207769746864726177616c20616d6f756e74206d75737460448201527f2062652067726561746572207468616e206d696e696d756d207769746864726160648201527f77616c20616d6f756e7400000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b6000479050806000808282546102ca91906106c8565b9091555050604080518281527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166020820152338183015290517fc8a211cc64b6ed1b50595a9fcb1932b6d1e5a6e8ef15b60e5b1f988ea9086bba9181900360600190a17f38e04cbeb8c10f8f568618aa75be0f10b6729b8b4237743b4de20cbcde2839ee817f0000000000000000000000000000000000000000000000000000000000000000337f00000000000000000000000000000000000000000000000000000000000000006040516103b89493929190610707565b60405180910390a160017f000000000000000000000000000000000000000000000000000000000000000060018111156103f4576103f461064a565b0361050d5760007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d8060008114610473576040519150601f19603f3d011682016040523d82523d6000602084013e610478565b606091505b5050905080610509576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f4665655661756c743a206661696c656420746f2073656e642045544820746f2060448201527f4c322066656520726563697069656e740000000000000000000000000000000060648201526084016102ab565b5050565b604080516020810182526000815290517fe11013dd0000000000000000000000000000000000000000000000000000000081527342000000000000000000000000000000000000109163e11013dd918491610590917f0000000000000000000000000000000000000000000000000000000000000000916188b891600401610748565b6000604051808303818588803b1580156105a957600080fd5b505af11580156105bd573d6000803e3d6000fd5b505050505050565b6000815180845260005b818110156105eb576020818501810151868301820152016105cf565b818111156105fd576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60208152600061064360208301846105c5565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600281106106b0577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9052565b602081016106c28284610679565b92915050565b60008219821115610702577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b500190565b84815273ffffffffffffffffffffffffffffffffffffffff8481166020830152831660408201526080810161073f6060830184610679565b95945050505050565b73ffffffffffffffffffffffffffffffffffffffff8416815263ffffffff8316602082015260606040820152600061073f60608301846105c556fea164736f6c634300080f000a", +} + +// BaseFeeVaultABI is the input ABI used to generate the binding from. +// Deprecated: Use BaseFeeVaultMetaData.ABI instead. +var BaseFeeVaultABI = BaseFeeVaultMetaData.ABI + +// BaseFeeVaultBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use BaseFeeVaultMetaData.Bin instead. +var BaseFeeVaultBin = BaseFeeVaultMetaData.Bin + +// DeployBaseFeeVault deploys a new Ethereum contract, binding an instance of BaseFeeVault to it. +func DeployBaseFeeVault(auth *bind.TransactOpts, backend bind.ContractBackend, _recipient common.Address, _minWithdrawalAmount *big.Int, _withdrawalNetwork uint8) (common.Address, *types.Transaction, *BaseFeeVault, error) { + parsed, err := BaseFeeVaultMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(BaseFeeVaultBin), backend, _recipient, _minWithdrawalAmount, _withdrawalNetwork) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &BaseFeeVault{BaseFeeVaultCaller: BaseFeeVaultCaller{contract: contract}, BaseFeeVaultTransactor: BaseFeeVaultTransactor{contract: contract}, BaseFeeVaultFilterer: BaseFeeVaultFilterer{contract: contract}}, nil +} + +// BaseFeeVault is an auto generated Go binding around an Ethereum contract. +type BaseFeeVault struct { + BaseFeeVaultCaller // Read-only binding to the contract + BaseFeeVaultTransactor // Write-only binding to the contract + BaseFeeVaultFilterer // Log filterer for contract events +} + +// BaseFeeVaultCaller is an auto generated read-only Go binding around an Ethereum contract. +type BaseFeeVaultCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// BaseFeeVaultTransactor is an auto generated write-only Go binding around an Ethereum contract. +type BaseFeeVaultTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// BaseFeeVaultFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type BaseFeeVaultFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// BaseFeeVaultSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type BaseFeeVaultSession struct { + Contract *BaseFeeVault // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// BaseFeeVaultCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type BaseFeeVaultCallerSession struct { + Contract *BaseFeeVaultCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// BaseFeeVaultTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type BaseFeeVaultTransactorSession struct { + Contract *BaseFeeVaultTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// BaseFeeVaultRaw is an auto generated low-level Go binding around an Ethereum contract. +type BaseFeeVaultRaw struct { + Contract *BaseFeeVault // Generic contract binding to access the raw methods on +} + +// BaseFeeVaultCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type BaseFeeVaultCallerRaw struct { + Contract *BaseFeeVaultCaller // Generic read-only contract binding to access the raw methods on +} + +// BaseFeeVaultTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type BaseFeeVaultTransactorRaw struct { + Contract *BaseFeeVaultTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewBaseFeeVault creates a new instance of BaseFeeVault, bound to a specific deployed contract. +func NewBaseFeeVault(address common.Address, backend bind.ContractBackend) (*BaseFeeVault, error) { + contract, err := bindBaseFeeVault(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &BaseFeeVault{BaseFeeVaultCaller: BaseFeeVaultCaller{contract: contract}, BaseFeeVaultTransactor: BaseFeeVaultTransactor{contract: contract}, BaseFeeVaultFilterer: BaseFeeVaultFilterer{contract: contract}}, nil +} + +// NewBaseFeeVaultCaller creates a new read-only instance of BaseFeeVault, bound to a specific deployed contract. +func NewBaseFeeVaultCaller(address common.Address, caller bind.ContractCaller) (*BaseFeeVaultCaller, error) { + contract, err := bindBaseFeeVault(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &BaseFeeVaultCaller{contract: contract}, nil +} + +// NewBaseFeeVaultTransactor creates a new write-only instance of BaseFeeVault, bound to a specific deployed contract. +func NewBaseFeeVaultTransactor(address common.Address, transactor bind.ContractTransactor) (*BaseFeeVaultTransactor, error) { + contract, err := bindBaseFeeVault(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &BaseFeeVaultTransactor{contract: contract}, nil +} + +// NewBaseFeeVaultFilterer creates a new log filterer instance of BaseFeeVault, bound to a specific deployed contract. +func NewBaseFeeVaultFilterer(address common.Address, filterer bind.ContractFilterer) (*BaseFeeVaultFilterer, error) { + contract, err := bindBaseFeeVault(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &BaseFeeVaultFilterer{contract: contract}, nil +} + +// bindBaseFeeVault binds a generic wrapper to an already deployed contract. +func bindBaseFeeVault(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(BaseFeeVaultABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_BaseFeeVault *BaseFeeVaultRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _BaseFeeVault.Contract.BaseFeeVaultCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_BaseFeeVault *BaseFeeVaultRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _BaseFeeVault.Contract.BaseFeeVaultTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_BaseFeeVault *BaseFeeVaultRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _BaseFeeVault.Contract.BaseFeeVaultTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_BaseFeeVault *BaseFeeVaultCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _BaseFeeVault.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_BaseFeeVault *BaseFeeVaultTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _BaseFeeVault.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_BaseFeeVault *BaseFeeVaultTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _BaseFeeVault.Contract.contract.Transact(opts, method, params...) +} + +// MINWITHDRAWALAMOUNT is a free data retrieval call binding the contract method 0xd3e5792b. +// +// Solidity: function MIN_WITHDRAWAL_AMOUNT() view returns(uint256) +func (_BaseFeeVault *BaseFeeVaultCaller) MINWITHDRAWALAMOUNT(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _BaseFeeVault.contract.Call(opts, &out, "MIN_WITHDRAWAL_AMOUNT") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// MINWITHDRAWALAMOUNT is a free data retrieval call binding the contract method 0xd3e5792b. +// +// Solidity: function MIN_WITHDRAWAL_AMOUNT() view returns(uint256) +func (_BaseFeeVault *BaseFeeVaultSession) MINWITHDRAWALAMOUNT() (*big.Int, error) { + return _BaseFeeVault.Contract.MINWITHDRAWALAMOUNT(&_BaseFeeVault.CallOpts) +} + +// MINWITHDRAWALAMOUNT is a free data retrieval call binding the contract method 0xd3e5792b. +// +// Solidity: function MIN_WITHDRAWAL_AMOUNT() view returns(uint256) +func (_BaseFeeVault *BaseFeeVaultCallerSession) MINWITHDRAWALAMOUNT() (*big.Int, error) { + return _BaseFeeVault.Contract.MINWITHDRAWALAMOUNT(&_BaseFeeVault.CallOpts) +} + +// RECIPIENT is a free data retrieval call binding the contract method 0x0d9019e1. +// +// Solidity: function RECIPIENT() view returns(address) +func (_BaseFeeVault *BaseFeeVaultCaller) RECIPIENT(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _BaseFeeVault.contract.Call(opts, &out, "RECIPIENT") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// RECIPIENT is a free data retrieval call binding the contract method 0x0d9019e1. +// +// Solidity: function RECIPIENT() view returns(address) +func (_BaseFeeVault *BaseFeeVaultSession) RECIPIENT() (common.Address, error) { + return _BaseFeeVault.Contract.RECIPIENT(&_BaseFeeVault.CallOpts) +} + +// RECIPIENT is a free data retrieval call binding the contract method 0x0d9019e1. +// +// Solidity: function RECIPIENT() view returns(address) +func (_BaseFeeVault *BaseFeeVaultCallerSession) RECIPIENT() (common.Address, error) { + return _BaseFeeVault.Contract.RECIPIENT(&_BaseFeeVault.CallOpts) +} + +// WITHDRAWALNETWORK is a free data retrieval call binding the contract method 0xd0e12f90. +// +// Solidity: function WITHDRAWAL_NETWORK() view returns(uint8) +func (_BaseFeeVault *BaseFeeVaultCaller) WITHDRAWALNETWORK(opts *bind.CallOpts) (uint8, error) { + var out []interface{} + err := _BaseFeeVault.contract.Call(opts, &out, "WITHDRAWAL_NETWORK") + + if err != nil { + return *new(uint8), err + } + + out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) + + return out0, err + +} + +// WITHDRAWALNETWORK is a free data retrieval call binding the contract method 0xd0e12f90. +// +// Solidity: function WITHDRAWAL_NETWORK() view returns(uint8) +func (_BaseFeeVault *BaseFeeVaultSession) WITHDRAWALNETWORK() (uint8, error) { + return _BaseFeeVault.Contract.WITHDRAWALNETWORK(&_BaseFeeVault.CallOpts) +} + +// WITHDRAWALNETWORK is a free data retrieval call binding the contract method 0xd0e12f90. +// +// Solidity: function WITHDRAWAL_NETWORK() view returns(uint8) +func (_BaseFeeVault *BaseFeeVaultCallerSession) WITHDRAWALNETWORK() (uint8, error) { + return _BaseFeeVault.Contract.WITHDRAWALNETWORK(&_BaseFeeVault.CallOpts) +} + +// TotalProcessed is a free data retrieval call binding the contract method 0x84411d65. +// +// Solidity: function totalProcessed() view returns(uint256) +func (_BaseFeeVault *BaseFeeVaultCaller) TotalProcessed(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _BaseFeeVault.contract.Call(opts, &out, "totalProcessed") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// TotalProcessed is a free data retrieval call binding the contract method 0x84411d65. +// +// Solidity: function totalProcessed() view returns(uint256) +func (_BaseFeeVault *BaseFeeVaultSession) TotalProcessed() (*big.Int, error) { + return _BaseFeeVault.Contract.TotalProcessed(&_BaseFeeVault.CallOpts) +} + +// TotalProcessed is a free data retrieval call binding the contract method 0x84411d65. +// +// Solidity: function totalProcessed() view returns(uint256) +func (_BaseFeeVault *BaseFeeVaultCallerSession) TotalProcessed() (*big.Int, error) { + return _BaseFeeVault.Contract.TotalProcessed(&_BaseFeeVault.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_BaseFeeVault *BaseFeeVaultCaller) Version(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _BaseFeeVault.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 (_BaseFeeVault *BaseFeeVaultSession) Version() (string, error) { + return _BaseFeeVault.Contract.Version(&_BaseFeeVault.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_BaseFeeVault *BaseFeeVaultCallerSession) Version() (string, error) { + return _BaseFeeVault.Contract.Version(&_BaseFeeVault.CallOpts) +} + +// Withdraw is a paid mutator transaction binding the contract method 0x3ccfd60b. +// +// Solidity: function withdraw() returns() +func (_BaseFeeVault *BaseFeeVaultTransactor) Withdraw(opts *bind.TransactOpts) (*types.Transaction, error) { + return _BaseFeeVault.contract.Transact(opts, "withdraw") +} + +// Withdraw is a paid mutator transaction binding the contract method 0x3ccfd60b. +// +// Solidity: function withdraw() returns() +func (_BaseFeeVault *BaseFeeVaultSession) Withdraw() (*types.Transaction, error) { + return _BaseFeeVault.Contract.Withdraw(&_BaseFeeVault.TransactOpts) +} + +// Withdraw is a paid mutator transaction binding the contract method 0x3ccfd60b. +// +// Solidity: function withdraw() returns() +func (_BaseFeeVault *BaseFeeVaultTransactorSession) Withdraw() (*types.Transaction, error) { + return _BaseFeeVault.Contract.Withdraw(&_BaseFeeVault.TransactOpts) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_BaseFeeVault *BaseFeeVaultTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { + return _BaseFeeVault.contract.RawTransact(opts, nil) // calldata is disallowed for receive function +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_BaseFeeVault *BaseFeeVaultSession) Receive() (*types.Transaction, error) { + return _BaseFeeVault.Contract.Receive(&_BaseFeeVault.TransactOpts) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_BaseFeeVault *BaseFeeVaultTransactorSession) Receive() (*types.Transaction, error) { + return _BaseFeeVault.Contract.Receive(&_BaseFeeVault.TransactOpts) +} + +// BaseFeeVaultWithdrawalIterator is returned from FilterWithdrawal and is used to iterate over the raw logs and unpacked data for Withdrawal events raised by the BaseFeeVault contract. +type BaseFeeVaultWithdrawalIterator struct { + Event *BaseFeeVaultWithdrawal // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *BaseFeeVaultWithdrawalIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(BaseFeeVaultWithdrawal) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(BaseFeeVaultWithdrawal) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *BaseFeeVaultWithdrawalIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *BaseFeeVaultWithdrawalIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// BaseFeeVaultWithdrawal represents a Withdrawal event raised by the BaseFeeVault contract. +type BaseFeeVaultWithdrawal struct { + Value *big.Int + To common.Address + From common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterWithdrawal is a free log retrieval operation binding the contract event 0xc8a211cc64b6ed1b50595a9fcb1932b6d1e5a6e8ef15b60e5b1f988ea9086bba. +// +// Solidity: event Withdrawal(uint256 value, address to, address from) +func (_BaseFeeVault *BaseFeeVaultFilterer) FilterWithdrawal(opts *bind.FilterOpts) (*BaseFeeVaultWithdrawalIterator, error) { + + logs, sub, err := _BaseFeeVault.contract.FilterLogs(opts, "Withdrawal") + if err != nil { + return nil, err + } + return &BaseFeeVaultWithdrawalIterator{contract: _BaseFeeVault.contract, event: "Withdrawal", logs: logs, sub: sub}, nil +} + +// WatchWithdrawal is a free log subscription operation binding the contract event 0xc8a211cc64b6ed1b50595a9fcb1932b6d1e5a6e8ef15b60e5b1f988ea9086bba. +// +// Solidity: event Withdrawal(uint256 value, address to, address from) +func (_BaseFeeVault *BaseFeeVaultFilterer) WatchWithdrawal(opts *bind.WatchOpts, sink chan<- *BaseFeeVaultWithdrawal) (event.Subscription, error) { + + logs, sub, err := _BaseFeeVault.contract.WatchLogs(opts, "Withdrawal") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(BaseFeeVaultWithdrawal) + if err := _BaseFeeVault.contract.UnpackLog(event, "Withdrawal", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseWithdrawal is a log parse operation binding the contract event 0xc8a211cc64b6ed1b50595a9fcb1932b6d1e5a6e8ef15b60e5b1f988ea9086bba. +// +// Solidity: event Withdrawal(uint256 value, address to, address from) +func (_BaseFeeVault *BaseFeeVaultFilterer) ParseWithdrawal(log types.Log) (*BaseFeeVaultWithdrawal, error) { + event := new(BaseFeeVaultWithdrawal) + if err := _BaseFeeVault.contract.UnpackLog(event, "Withdrawal", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// BaseFeeVaultWithdrawal0Iterator is returned from FilterWithdrawal0 and is used to iterate over the raw logs and unpacked data for Withdrawal0 events raised by the BaseFeeVault contract. +type BaseFeeVaultWithdrawal0Iterator struct { + Event *BaseFeeVaultWithdrawal0 // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *BaseFeeVaultWithdrawal0Iterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(BaseFeeVaultWithdrawal0) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(BaseFeeVaultWithdrawal0) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *BaseFeeVaultWithdrawal0Iterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *BaseFeeVaultWithdrawal0Iterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// BaseFeeVaultWithdrawal0 represents a Withdrawal0 event raised by the BaseFeeVault contract. +type BaseFeeVaultWithdrawal0 struct { + Value *big.Int + To common.Address + From common.Address + WithdrawalNetwork uint8 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterWithdrawal0 is a free log retrieval operation binding the contract event 0x38e04cbeb8c10f8f568618aa75be0f10b6729b8b4237743b4de20cbcde2839ee. +// +// Solidity: event Withdrawal(uint256 value, address to, address from, uint8 withdrawalNetwork) +func (_BaseFeeVault *BaseFeeVaultFilterer) FilterWithdrawal0(opts *bind.FilterOpts) (*BaseFeeVaultWithdrawal0Iterator, error) { + + logs, sub, err := _BaseFeeVault.contract.FilterLogs(opts, "Withdrawal0") + if err != nil { + return nil, err + } + return &BaseFeeVaultWithdrawal0Iterator{contract: _BaseFeeVault.contract, event: "Withdrawal0", logs: logs, sub: sub}, nil +} + +// WatchWithdrawal0 is a free log subscription operation binding the contract event 0x38e04cbeb8c10f8f568618aa75be0f10b6729b8b4237743b4de20cbcde2839ee. +// +// Solidity: event Withdrawal(uint256 value, address to, address from, uint8 withdrawalNetwork) +func (_BaseFeeVault *BaseFeeVaultFilterer) WatchWithdrawal0(opts *bind.WatchOpts, sink chan<- *BaseFeeVaultWithdrawal0) (event.Subscription, error) { + + logs, sub, err := _BaseFeeVault.contract.WatchLogs(opts, "Withdrawal0") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(BaseFeeVaultWithdrawal0) + if err := _BaseFeeVault.contract.UnpackLog(event, "Withdrawal0", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseWithdrawal0 is a log parse operation binding the contract event 0x38e04cbeb8c10f8f568618aa75be0f10b6729b8b4237743b4de20cbcde2839ee. +// +// Solidity: event Withdrawal(uint256 value, address to, address from, uint8 withdrawalNetwork) +func (_BaseFeeVault *BaseFeeVaultFilterer) ParseWithdrawal0(log types.Log) (*BaseFeeVaultWithdrawal0, error) { + event := new(BaseFeeVaultWithdrawal0) + if err := _BaseFeeVault.contract.UnpackLog(event, "Withdrawal0", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/op-e2e2/bindings/create2deployer.go b/op-e2e2/bindings/create2deployer.go new file mode 100644 index 000000000000..5e2141ea7a4b --- /dev/null +++ b/op-e2e2/bindings/create2deployer.go @@ -0,0 +1,327 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// Create2DeployerMetaData contains all meta data concerning the Create2Deployer contract. +var Create2DeployerMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"salt\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"codeHash\",\"type\":\"bytes32\"}],\"name\":\"computeAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"salt\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"codeHash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"deployer\",\"type\":\"address\"}],\"name\":\"computeAddressWithDeployer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"salt\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"code\",\"type\":\"bytes\"}],\"name\":\"deploy\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"salt\",\"type\":\"bytes32\"}],\"name\":\"deployERC1820Implementer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", + Bin: "0x608060405234801561001057600080fd5b50610630806100206000396000f3fe6080604052600436106100435760003560e01c8063076c37b21461004f578063481286e61461007157806356299481146100ba57806366cfa057146100da57600080fd5b3661004a57005b600080fd5b34801561005b57600080fd5b5061006f61006a366004610327565b6100fa565b005b34801561007d57600080fd5b5061009161008c366004610327565b61014a565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100c657600080fd5b506100916100d5366004610349565b61015d565b3480156100e657600080fd5b5061006f6100f53660046103ca565b610172565b61014582826040518060200161010f9061031a565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe082820381018352601f90910116604052610183565b505050565b600061015683836102e7565b9392505050565b600061016a8484846102f0565b949350505050565b61017d838383610183565b50505050565b6000834710156101f4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f437265617465323a20696e73756666696369656e742062616c616e636500000060448201526064015b60405180910390fd5b815160000361025f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f437265617465323a2062797465636f6465206c656e677468206973207a65726f60448201526064016101eb565b8282516020840186f5905073ffffffffffffffffffffffffffffffffffffffff8116610156576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f437265617465323a204661696c6564206f6e206465706c6f790000000000000060448201526064016101eb565b60006101568383305b6000604051836040820152846020820152828152600b8101905060ff815360559020949350505050565b61014e806104ad83390190565b6000806040838503121561033a57600080fd5b50508035926020909101359150565b60008060006060848603121561035e57600080fd5b8335925060208401359150604084013573ffffffffffffffffffffffffffffffffffffffff8116811461039057600080fd5b809150509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000806000606084860312156103df57600080fd5b8335925060208401359150604084013567ffffffffffffffff8082111561040557600080fd5b818601915086601f83011261041957600080fd5b81358181111561042b5761042b61039b565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156104715761047161039b565b8160405282815289602084870101111561048a57600080fd5b826020860160208301376000602084830101528095505050505050925092509256fe608060405234801561001057600080fd5b5061012e806100206000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063249cb3fa14602d575b600080fd5b603c603836600460b1565b604e565b60405190815260200160405180910390f35b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915281205460ff16608857600060aa565b7fa2ef4600d742022d532d4747cb3547474667d6f13804902513b2ec01c848f4b45b9392505050565b6000806040838503121560c357600080fd5b82359150602083013573ffffffffffffffffffffffffffffffffffffffff8116811460ed57600080fd5b80915050925092905056fea26469706673582212205ffd4e6cede7d06a5daf93d48d0541fc68189eeb16608c1999a82063b666eb1164736f6c63430008130033a2646970667358221220fdc4a0fe96e3b21c108ca155438d37c9143fb01278a3c1d274948bad89c564ba64736f6c63430008130033", +} + +// Create2DeployerABI is the input ABI used to generate the binding from. +// Deprecated: Use Create2DeployerMetaData.ABI instead. +var Create2DeployerABI = Create2DeployerMetaData.ABI + +// Create2DeployerBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use Create2DeployerMetaData.Bin instead. +var Create2DeployerBin = Create2DeployerMetaData.Bin + +// DeployCreate2Deployer deploys a new Ethereum contract, binding an instance of Create2Deployer to it. +func DeployCreate2Deployer(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Create2Deployer, error) { + parsed, err := Create2DeployerMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(Create2DeployerBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &Create2Deployer{Create2DeployerCaller: Create2DeployerCaller{contract: contract}, Create2DeployerTransactor: Create2DeployerTransactor{contract: contract}, Create2DeployerFilterer: Create2DeployerFilterer{contract: contract}}, nil +} + +// Create2Deployer is an auto generated Go binding around an Ethereum contract. +type Create2Deployer struct { + Create2DeployerCaller // Read-only binding to the contract + Create2DeployerTransactor // Write-only binding to the contract + Create2DeployerFilterer // Log filterer for contract events +} + +// Create2DeployerCaller is an auto generated read-only Go binding around an Ethereum contract. +type Create2DeployerCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// Create2DeployerTransactor is an auto generated write-only Go binding around an Ethereum contract. +type Create2DeployerTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// Create2DeployerFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type Create2DeployerFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// Create2DeployerSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type Create2DeployerSession struct { + Contract *Create2Deployer // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// Create2DeployerCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type Create2DeployerCallerSession struct { + Contract *Create2DeployerCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// Create2DeployerTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type Create2DeployerTransactorSession struct { + Contract *Create2DeployerTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// Create2DeployerRaw is an auto generated low-level Go binding around an Ethereum contract. +type Create2DeployerRaw struct { + Contract *Create2Deployer // Generic contract binding to access the raw methods on +} + +// Create2DeployerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type Create2DeployerCallerRaw struct { + Contract *Create2DeployerCaller // Generic read-only contract binding to access the raw methods on +} + +// Create2DeployerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type Create2DeployerTransactorRaw struct { + Contract *Create2DeployerTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewCreate2Deployer creates a new instance of Create2Deployer, bound to a specific deployed contract. +func NewCreate2Deployer(address common.Address, backend bind.ContractBackend) (*Create2Deployer, error) { + contract, err := bindCreate2Deployer(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &Create2Deployer{Create2DeployerCaller: Create2DeployerCaller{contract: contract}, Create2DeployerTransactor: Create2DeployerTransactor{contract: contract}, Create2DeployerFilterer: Create2DeployerFilterer{contract: contract}}, nil +} + +// NewCreate2DeployerCaller creates a new read-only instance of Create2Deployer, bound to a specific deployed contract. +func NewCreate2DeployerCaller(address common.Address, caller bind.ContractCaller) (*Create2DeployerCaller, error) { + contract, err := bindCreate2Deployer(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &Create2DeployerCaller{contract: contract}, nil +} + +// NewCreate2DeployerTransactor creates a new write-only instance of Create2Deployer, bound to a specific deployed contract. +func NewCreate2DeployerTransactor(address common.Address, transactor bind.ContractTransactor) (*Create2DeployerTransactor, error) { + contract, err := bindCreate2Deployer(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &Create2DeployerTransactor{contract: contract}, nil +} + +// NewCreate2DeployerFilterer creates a new log filterer instance of Create2Deployer, bound to a specific deployed contract. +func NewCreate2DeployerFilterer(address common.Address, filterer bind.ContractFilterer) (*Create2DeployerFilterer, error) { + contract, err := bindCreate2Deployer(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &Create2DeployerFilterer{contract: contract}, nil +} + +// bindCreate2Deployer binds a generic wrapper to an already deployed contract. +func bindCreate2Deployer(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(Create2DeployerABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Create2Deployer *Create2DeployerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Create2Deployer.Contract.Create2DeployerCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Create2Deployer *Create2DeployerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Create2Deployer.Contract.Create2DeployerTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Create2Deployer *Create2DeployerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Create2Deployer.Contract.Create2DeployerTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Create2Deployer *Create2DeployerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Create2Deployer.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Create2Deployer *Create2DeployerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Create2Deployer.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Create2Deployer *Create2DeployerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Create2Deployer.Contract.contract.Transact(opts, method, params...) +} + +// ComputeAddress is a free data retrieval call binding the contract method 0x481286e6. +// +// Solidity: function computeAddress(bytes32 salt, bytes32 codeHash) view returns(address) +func (_Create2Deployer *Create2DeployerCaller) ComputeAddress(opts *bind.CallOpts, salt [32]byte, codeHash [32]byte) (common.Address, error) { + var out []interface{} + err := _Create2Deployer.contract.Call(opts, &out, "computeAddress", salt, codeHash) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// ComputeAddress is a free data retrieval call binding the contract method 0x481286e6. +// +// Solidity: function computeAddress(bytes32 salt, bytes32 codeHash) view returns(address) +func (_Create2Deployer *Create2DeployerSession) ComputeAddress(salt [32]byte, codeHash [32]byte) (common.Address, error) { + return _Create2Deployer.Contract.ComputeAddress(&_Create2Deployer.CallOpts, salt, codeHash) +} + +// ComputeAddress is a free data retrieval call binding the contract method 0x481286e6. +// +// Solidity: function computeAddress(bytes32 salt, bytes32 codeHash) view returns(address) +func (_Create2Deployer *Create2DeployerCallerSession) ComputeAddress(salt [32]byte, codeHash [32]byte) (common.Address, error) { + return _Create2Deployer.Contract.ComputeAddress(&_Create2Deployer.CallOpts, salt, codeHash) +} + +// ComputeAddressWithDeployer is a free data retrieval call binding the contract method 0x56299481. +// +// Solidity: function computeAddressWithDeployer(bytes32 salt, bytes32 codeHash, address deployer) pure returns(address) +func (_Create2Deployer *Create2DeployerCaller) ComputeAddressWithDeployer(opts *bind.CallOpts, salt [32]byte, codeHash [32]byte, deployer common.Address) (common.Address, error) { + var out []interface{} + err := _Create2Deployer.contract.Call(opts, &out, "computeAddressWithDeployer", salt, codeHash, deployer) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// ComputeAddressWithDeployer is a free data retrieval call binding the contract method 0x56299481. +// +// Solidity: function computeAddressWithDeployer(bytes32 salt, bytes32 codeHash, address deployer) pure returns(address) +func (_Create2Deployer *Create2DeployerSession) ComputeAddressWithDeployer(salt [32]byte, codeHash [32]byte, deployer common.Address) (common.Address, error) { + return _Create2Deployer.Contract.ComputeAddressWithDeployer(&_Create2Deployer.CallOpts, salt, codeHash, deployer) +} + +// ComputeAddressWithDeployer is a free data retrieval call binding the contract method 0x56299481. +// +// Solidity: function computeAddressWithDeployer(bytes32 salt, bytes32 codeHash, address deployer) pure returns(address) +func (_Create2Deployer *Create2DeployerCallerSession) ComputeAddressWithDeployer(salt [32]byte, codeHash [32]byte, deployer common.Address) (common.Address, error) { + return _Create2Deployer.Contract.ComputeAddressWithDeployer(&_Create2Deployer.CallOpts, salt, codeHash, deployer) +} + +// Deploy is a paid mutator transaction binding the contract method 0x66cfa057. +// +// Solidity: function deploy(uint256 value, bytes32 salt, bytes code) returns() +func (_Create2Deployer *Create2DeployerTransactor) Deploy(opts *bind.TransactOpts, value *big.Int, salt [32]byte, code []byte) (*types.Transaction, error) { + return _Create2Deployer.contract.Transact(opts, "deploy", value, salt, code) +} + +// Deploy is a paid mutator transaction binding the contract method 0x66cfa057. +// +// Solidity: function deploy(uint256 value, bytes32 salt, bytes code) returns() +func (_Create2Deployer *Create2DeployerSession) Deploy(value *big.Int, salt [32]byte, code []byte) (*types.Transaction, error) { + return _Create2Deployer.Contract.Deploy(&_Create2Deployer.TransactOpts, value, salt, code) +} + +// Deploy is a paid mutator transaction binding the contract method 0x66cfa057. +// +// Solidity: function deploy(uint256 value, bytes32 salt, bytes code) returns() +func (_Create2Deployer *Create2DeployerTransactorSession) Deploy(value *big.Int, salt [32]byte, code []byte) (*types.Transaction, error) { + return _Create2Deployer.Contract.Deploy(&_Create2Deployer.TransactOpts, value, salt, code) +} + +// DeployERC1820Implementer is a paid mutator transaction binding the contract method 0x076c37b2. +// +// Solidity: function deployERC1820Implementer(uint256 value, bytes32 salt) returns() +func (_Create2Deployer *Create2DeployerTransactor) DeployERC1820Implementer(opts *bind.TransactOpts, value *big.Int, salt [32]byte) (*types.Transaction, error) { + return _Create2Deployer.contract.Transact(opts, "deployERC1820Implementer", value, salt) +} + +// DeployERC1820Implementer is a paid mutator transaction binding the contract method 0x076c37b2. +// +// Solidity: function deployERC1820Implementer(uint256 value, bytes32 salt) returns() +func (_Create2Deployer *Create2DeployerSession) DeployERC1820Implementer(value *big.Int, salt [32]byte) (*types.Transaction, error) { + return _Create2Deployer.Contract.DeployERC1820Implementer(&_Create2Deployer.TransactOpts, value, salt) +} + +// DeployERC1820Implementer is a paid mutator transaction binding the contract method 0x076c37b2. +// +// Solidity: function deployERC1820Implementer(uint256 value, bytes32 salt) returns() +func (_Create2Deployer *Create2DeployerTransactorSession) DeployERC1820Implementer(value *big.Int, salt [32]byte) (*types.Transaction, error) { + return _Create2Deployer.Contract.DeployERC1820Implementer(&_Create2Deployer.TransactOpts, value, salt) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_Create2Deployer *Create2DeployerTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Create2Deployer.contract.RawTransact(opts, nil) // calldata is disallowed for receive function +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_Create2Deployer *Create2DeployerSession) Receive() (*types.Transaction, error) { + return _Create2Deployer.Contract.Receive(&_Create2Deployer.TransactOpts) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_Create2Deployer *Create2DeployerTransactorSession) Receive() (*types.Transaction, error) { + return _Create2Deployer.Contract.Receive(&_Create2Deployer.TransactOpts) +} diff --git a/op-e2e2/bindings/crossdomainmessenger.go b/op-e2e2/bindings/crossdomainmessenger.go new file mode 100644 index 000000000000..516b49cbffab --- /dev/null +++ b/op-e2e2/bindings/crossdomainmessenger.go @@ -0,0 +1,1433 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// CrossDomainMessengerMetaData contains all meta data concerning the CrossDomainMessenger contract. +var CrossDomainMessengerMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"function\",\"name\":\"MESSAGE_VERSION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MIN_GAS_CALLDATA_OVERHEAD\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MIN_GAS_DYNAMIC_OVERHEAD_DENOMINATOR\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MIN_GAS_DYNAMIC_OVERHEAD_NUMERATOR\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"OTHER_MESSENGER\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractCrossDomainMessenger\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"RELAY_CALL_OVERHEAD\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"RELAY_CONSTANT_OVERHEAD\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"RELAY_GAS_CHECK_BUFFER\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"RELAY_RESERVED_GAS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"baseGas\",\"inputs\":[{\"name\":\"_message\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"_minGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"failedMessages\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"messageNonce\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"otherMessenger\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractCrossDomainMessenger\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"paused\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"relayMessage\",\"inputs\":[{\"name\":\"_nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_sender\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_target\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_value\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_minGasLimit\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_message\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"sendMessage\",\"inputs\":[{\"name\":\"_target\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_message\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"_minGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"successfulMessages\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"xDomainMessageSender\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"FailedRelayedMessage\",\"inputs\":[{\"name\":\"msgHash\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RelayedMessage\",\"inputs\":[{\"name\":\"msgHash\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"SentMessage\",\"inputs\":[{\"name\":\"target\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"sender\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"message\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"},{\"name\":\"messageNonce\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"gasLimit\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"SentMessageExtension1\",\"inputs\":[{\"name\":\"sender\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false}]", +} + +// CrossDomainMessengerABI is the input ABI used to generate the binding from. +// Deprecated: Use CrossDomainMessengerMetaData.ABI instead. +var CrossDomainMessengerABI = CrossDomainMessengerMetaData.ABI + +// CrossDomainMessenger is an auto generated Go binding around an Ethereum contract. +type CrossDomainMessenger struct { + CrossDomainMessengerCaller // Read-only binding to the contract + CrossDomainMessengerTransactor // Write-only binding to the contract + CrossDomainMessengerFilterer // Log filterer for contract events +} + +// CrossDomainMessengerCaller is an auto generated read-only Go binding around an Ethereum contract. +type CrossDomainMessengerCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// CrossDomainMessengerTransactor is an auto generated write-only Go binding around an Ethereum contract. +type CrossDomainMessengerTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// CrossDomainMessengerFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type CrossDomainMessengerFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// CrossDomainMessengerSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type CrossDomainMessengerSession struct { + Contract *CrossDomainMessenger // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// CrossDomainMessengerCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type CrossDomainMessengerCallerSession struct { + Contract *CrossDomainMessengerCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// CrossDomainMessengerTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type CrossDomainMessengerTransactorSession struct { + Contract *CrossDomainMessengerTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// CrossDomainMessengerRaw is an auto generated low-level Go binding around an Ethereum contract. +type CrossDomainMessengerRaw struct { + Contract *CrossDomainMessenger // Generic contract binding to access the raw methods on +} + +// CrossDomainMessengerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type CrossDomainMessengerCallerRaw struct { + Contract *CrossDomainMessengerCaller // Generic read-only contract binding to access the raw methods on +} + +// CrossDomainMessengerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type CrossDomainMessengerTransactorRaw struct { + Contract *CrossDomainMessengerTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewCrossDomainMessenger creates a new instance of CrossDomainMessenger, bound to a specific deployed contract. +func NewCrossDomainMessenger(address common.Address, backend bind.ContractBackend) (*CrossDomainMessenger, error) { + contract, err := bindCrossDomainMessenger(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &CrossDomainMessenger{CrossDomainMessengerCaller: CrossDomainMessengerCaller{contract: contract}, CrossDomainMessengerTransactor: CrossDomainMessengerTransactor{contract: contract}, CrossDomainMessengerFilterer: CrossDomainMessengerFilterer{contract: contract}}, nil +} + +// NewCrossDomainMessengerCaller creates a new read-only instance of CrossDomainMessenger, bound to a specific deployed contract. +func NewCrossDomainMessengerCaller(address common.Address, caller bind.ContractCaller) (*CrossDomainMessengerCaller, error) { + contract, err := bindCrossDomainMessenger(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &CrossDomainMessengerCaller{contract: contract}, nil +} + +// NewCrossDomainMessengerTransactor creates a new write-only instance of CrossDomainMessenger, bound to a specific deployed contract. +func NewCrossDomainMessengerTransactor(address common.Address, transactor bind.ContractTransactor) (*CrossDomainMessengerTransactor, error) { + contract, err := bindCrossDomainMessenger(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &CrossDomainMessengerTransactor{contract: contract}, nil +} + +// NewCrossDomainMessengerFilterer creates a new log filterer instance of CrossDomainMessenger, bound to a specific deployed contract. +func NewCrossDomainMessengerFilterer(address common.Address, filterer bind.ContractFilterer) (*CrossDomainMessengerFilterer, error) { + contract, err := bindCrossDomainMessenger(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &CrossDomainMessengerFilterer{contract: contract}, nil +} + +// bindCrossDomainMessenger binds a generic wrapper to an already deployed contract. +func bindCrossDomainMessenger(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(CrossDomainMessengerABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_CrossDomainMessenger *CrossDomainMessengerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _CrossDomainMessenger.Contract.CrossDomainMessengerCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_CrossDomainMessenger *CrossDomainMessengerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _CrossDomainMessenger.Contract.CrossDomainMessengerTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_CrossDomainMessenger *CrossDomainMessengerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _CrossDomainMessenger.Contract.CrossDomainMessengerTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_CrossDomainMessenger *CrossDomainMessengerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _CrossDomainMessenger.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_CrossDomainMessenger *CrossDomainMessengerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _CrossDomainMessenger.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_CrossDomainMessenger *CrossDomainMessengerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _CrossDomainMessenger.Contract.contract.Transact(opts, method, params...) +} + +// MESSAGEVERSION is a free data retrieval call binding the contract method 0x3f827a5a. +// +// Solidity: function MESSAGE_VERSION() view returns(uint16) +func (_CrossDomainMessenger *CrossDomainMessengerCaller) MESSAGEVERSION(opts *bind.CallOpts) (uint16, error) { + var out []interface{} + err := _CrossDomainMessenger.contract.Call(opts, &out, "MESSAGE_VERSION") + + if err != nil { + return *new(uint16), err + } + + out0 := *abi.ConvertType(out[0], new(uint16)).(*uint16) + + return out0, err + +} + +// MESSAGEVERSION is a free data retrieval call binding the contract method 0x3f827a5a. +// +// Solidity: function MESSAGE_VERSION() view returns(uint16) +func (_CrossDomainMessenger *CrossDomainMessengerSession) MESSAGEVERSION() (uint16, error) { + return _CrossDomainMessenger.Contract.MESSAGEVERSION(&_CrossDomainMessenger.CallOpts) +} + +// MESSAGEVERSION is a free data retrieval call binding the contract method 0x3f827a5a. +// +// Solidity: function MESSAGE_VERSION() view returns(uint16) +func (_CrossDomainMessenger *CrossDomainMessengerCallerSession) MESSAGEVERSION() (uint16, error) { + return _CrossDomainMessenger.Contract.MESSAGEVERSION(&_CrossDomainMessenger.CallOpts) +} + +// MINGASCALLDATAOVERHEAD is a free data retrieval call binding the contract method 0x028f85f7. +// +// Solidity: function MIN_GAS_CALLDATA_OVERHEAD() view returns(uint64) +func (_CrossDomainMessenger *CrossDomainMessengerCaller) MINGASCALLDATAOVERHEAD(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _CrossDomainMessenger.contract.Call(opts, &out, "MIN_GAS_CALLDATA_OVERHEAD") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// MINGASCALLDATAOVERHEAD is a free data retrieval call binding the contract method 0x028f85f7. +// +// Solidity: function MIN_GAS_CALLDATA_OVERHEAD() view returns(uint64) +func (_CrossDomainMessenger *CrossDomainMessengerSession) MINGASCALLDATAOVERHEAD() (uint64, error) { + return _CrossDomainMessenger.Contract.MINGASCALLDATAOVERHEAD(&_CrossDomainMessenger.CallOpts) +} + +// MINGASCALLDATAOVERHEAD is a free data retrieval call binding the contract method 0x028f85f7. +// +// Solidity: function MIN_GAS_CALLDATA_OVERHEAD() view returns(uint64) +func (_CrossDomainMessenger *CrossDomainMessengerCallerSession) MINGASCALLDATAOVERHEAD() (uint64, error) { + return _CrossDomainMessenger.Contract.MINGASCALLDATAOVERHEAD(&_CrossDomainMessenger.CallOpts) +} + +// MINGASDYNAMICOVERHEADDENOMINATOR is a free data retrieval call binding the contract method 0x0c568498. +// +// Solidity: function MIN_GAS_DYNAMIC_OVERHEAD_DENOMINATOR() view returns(uint64) +func (_CrossDomainMessenger *CrossDomainMessengerCaller) MINGASDYNAMICOVERHEADDENOMINATOR(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _CrossDomainMessenger.contract.Call(opts, &out, "MIN_GAS_DYNAMIC_OVERHEAD_DENOMINATOR") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// MINGASDYNAMICOVERHEADDENOMINATOR is a free data retrieval call binding the contract method 0x0c568498. +// +// Solidity: function MIN_GAS_DYNAMIC_OVERHEAD_DENOMINATOR() view returns(uint64) +func (_CrossDomainMessenger *CrossDomainMessengerSession) MINGASDYNAMICOVERHEADDENOMINATOR() (uint64, error) { + return _CrossDomainMessenger.Contract.MINGASDYNAMICOVERHEADDENOMINATOR(&_CrossDomainMessenger.CallOpts) +} + +// MINGASDYNAMICOVERHEADDENOMINATOR is a free data retrieval call binding the contract method 0x0c568498. +// +// Solidity: function MIN_GAS_DYNAMIC_OVERHEAD_DENOMINATOR() view returns(uint64) +func (_CrossDomainMessenger *CrossDomainMessengerCallerSession) MINGASDYNAMICOVERHEADDENOMINATOR() (uint64, error) { + return _CrossDomainMessenger.Contract.MINGASDYNAMICOVERHEADDENOMINATOR(&_CrossDomainMessenger.CallOpts) +} + +// MINGASDYNAMICOVERHEADNUMERATOR is a free data retrieval call binding the contract method 0x2828d7e8. +// +// Solidity: function MIN_GAS_DYNAMIC_OVERHEAD_NUMERATOR() view returns(uint64) +func (_CrossDomainMessenger *CrossDomainMessengerCaller) MINGASDYNAMICOVERHEADNUMERATOR(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _CrossDomainMessenger.contract.Call(opts, &out, "MIN_GAS_DYNAMIC_OVERHEAD_NUMERATOR") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// MINGASDYNAMICOVERHEADNUMERATOR is a free data retrieval call binding the contract method 0x2828d7e8. +// +// Solidity: function MIN_GAS_DYNAMIC_OVERHEAD_NUMERATOR() view returns(uint64) +func (_CrossDomainMessenger *CrossDomainMessengerSession) MINGASDYNAMICOVERHEADNUMERATOR() (uint64, error) { + return _CrossDomainMessenger.Contract.MINGASDYNAMICOVERHEADNUMERATOR(&_CrossDomainMessenger.CallOpts) +} + +// MINGASDYNAMICOVERHEADNUMERATOR is a free data retrieval call binding the contract method 0x2828d7e8. +// +// Solidity: function MIN_GAS_DYNAMIC_OVERHEAD_NUMERATOR() view returns(uint64) +func (_CrossDomainMessenger *CrossDomainMessengerCallerSession) MINGASDYNAMICOVERHEADNUMERATOR() (uint64, error) { + return _CrossDomainMessenger.Contract.MINGASDYNAMICOVERHEADNUMERATOR(&_CrossDomainMessenger.CallOpts) +} + +// OTHERMESSENGER is a free data retrieval call binding the contract method 0x9fce812c. +// +// Solidity: function OTHER_MESSENGER() view returns(address) +func (_CrossDomainMessenger *CrossDomainMessengerCaller) OTHERMESSENGER(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _CrossDomainMessenger.contract.Call(opts, &out, "OTHER_MESSENGER") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// OTHERMESSENGER is a free data retrieval call binding the contract method 0x9fce812c. +// +// Solidity: function OTHER_MESSENGER() view returns(address) +func (_CrossDomainMessenger *CrossDomainMessengerSession) OTHERMESSENGER() (common.Address, error) { + return _CrossDomainMessenger.Contract.OTHERMESSENGER(&_CrossDomainMessenger.CallOpts) +} + +// OTHERMESSENGER is a free data retrieval call binding the contract method 0x9fce812c. +// +// Solidity: function OTHER_MESSENGER() view returns(address) +func (_CrossDomainMessenger *CrossDomainMessengerCallerSession) OTHERMESSENGER() (common.Address, error) { + return _CrossDomainMessenger.Contract.OTHERMESSENGER(&_CrossDomainMessenger.CallOpts) +} + +// RELAYCALLOVERHEAD is a free data retrieval call binding the contract method 0x4c1d6a69. +// +// Solidity: function RELAY_CALL_OVERHEAD() view returns(uint64) +func (_CrossDomainMessenger *CrossDomainMessengerCaller) RELAYCALLOVERHEAD(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _CrossDomainMessenger.contract.Call(opts, &out, "RELAY_CALL_OVERHEAD") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// RELAYCALLOVERHEAD is a free data retrieval call binding the contract method 0x4c1d6a69. +// +// Solidity: function RELAY_CALL_OVERHEAD() view returns(uint64) +func (_CrossDomainMessenger *CrossDomainMessengerSession) RELAYCALLOVERHEAD() (uint64, error) { + return _CrossDomainMessenger.Contract.RELAYCALLOVERHEAD(&_CrossDomainMessenger.CallOpts) +} + +// RELAYCALLOVERHEAD is a free data retrieval call binding the contract method 0x4c1d6a69. +// +// Solidity: function RELAY_CALL_OVERHEAD() view returns(uint64) +func (_CrossDomainMessenger *CrossDomainMessengerCallerSession) RELAYCALLOVERHEAD() (uint64, error) { + return _CrossDomainMessenger.Contract.RELAYCALLOVERHEAD(&_CrossDomainMessenger.CallOpts) +} + +// RELAYCONSTANTOVERHEAD is a free data retrieval call binding the contract method 0x83a74074. +// +// Solidity: function RELAY_CONSTANT_OVERHEAD() view returns(uint64) +func (_CrossDomainMessenger *CrossDomainMessengerCaller) RELAYCONSTANTOVERHEAD(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _CrossDomainMessenger.contract.Call(opts, &out, "RELAY_CONSTANT_OVERHEAD") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// RELAYCONSTANTOVERHEAD is a free data retrieval call binding the contract method 0x83a74074. +// +// Solidity: function RELAY_CONSTANT_OVERHEAD() view returns(uint64) +func (_CrossDomainMessenger *CrossDomainMessengerSession) RELAYCONSTANTOVERHEAD() (uint64, error) { + return _CrossDomainMessenger.Contract.RELAYCONSTANTOVERHEAD(&_CrossDomainMessenger.CallOpts) +} + +// RELAYCONSTANTOVERHEAD is a free data retrieval call binding the contract method 0x83a74074. +// +// Solidity: function RELAY_CONSTANT_OVERHEAD() view returns(uint64) +func (_CrossDomainMessenger *CrossDomainMessengerCallerSession) RELAYCONSTANTOVERHEAD() (uint64, error) { + return _CrossDomainMessenger.Contract.RELAYCONSTANTOVERHEAD(&_CrossDomainMessenger.CallOpts) +} + +// RELAYGASCHECKBUFFER is a free data retrieval call binding the contract method 0x5644cfdf. +// +// Solidity: function RELAY_GAS_CHECK_BUFFER() view returns(uint64) +func (_CrossDomainMessenger *CrossDomainMessengerCaller) RELAYGASCHECKBUFFER(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _CrossDomainMessenger.contract.Call(opts, &out, "RELAY_GAS_CHECK_BUFFER") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// RELAYGASCHECKBUFFER is a free data retrieval call binding the contract method 0x5644cfdf. +// +// Solidity: function RELAY_GAS_CHECK_BUFFER() view returns(uint64) +func (_CrossDomainMessenger *CrossDomainMessengerSession) RELAYGASCHECKBUFFER() (uint64, error) { + return _CrossDomainMessenger.Contract.RELAYGASCHECKBUFFER(&_CrossDomainMessenger.CallOpts) +} + +// RELAYGASCHECKBUFFER is a free data retrieval call binding the contract method 0x5644cfdf. +// +// Solidity: function RELAY_GAS_CHECK_BUFFER() view returns(uint64) +func (_CrossDomainMessenger *CrossDomainMessengerCallerSession) RELAYGASCHECKBUFFER() (uint64, error) { + return _CrossDomainMessenger.Contract.RELAYGASCHECKBUFFER(&_CrossDomainMessenger.CallOpts) +} + +// RELAYRESERVEDGAS is a free data retrieval call binding the contract method 0x8cbeeef2. +// +// Solidity: function RELAY_RESERVED_GAS() view returns(uint64) +func (_CrossDomainMessenger *CrossDomainMessengerCaller) RELAYRESERVEDGAS(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _CrossDomainMessenger.contract.Call(opts, &out, "RELAY_RESERVED_GAS") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// RELAYRESERVEDGAS is a free data retrieval call binding the contract method 0x8cbeeef2. +// +// Solidity: function RELAY_RESERVED_GAS() view returns(uint64) +func (_CrossDomainMessenger *CrossDomainMessengerSession) RELAYRESERVEDGAS() (uint64, error) { + return _CrossDomainMessenger.Contract.RELAYRESERVEDGAS(&_CrossDomainMessenger.CallOpts) +} + +// RELAYRESERVEDGAS is a free data retrieval call binding the contract method 0x8cbeeef2. +// +// Solidity: function RELAY_RESERVED_GAS() view returns(uint64) +func (_CrossDomainMessenger *CrossDomainMessengerCallerSession) RELAYRESERVEDGAS() (uint64, error) { + return _CrossDomainMessenger.Contract.RELAYRESERVEDGAS(&_CrossDomainMessenger.CallOpts) +} + +// BaseGas is a free data retrieval call binding the contract method 0xb28ade25. +// +// Solidity: function baseGas(bytes _message, uint32 _minGasLimit) pure returns(uint64) +func (_CrossDomainMessenger *CrossDomainMessengerCaller) BaseGas(opts *bind.CallOpts, _message []byte, _minGasLimit uint32) (uint64, error) { + var out []interface{} + err := _CrossDomainMessenger.contract.Call(opts, &out, "baseGas", _message, _minGasLimit) + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// BaseGas is a free data retrieval call binding the contract method 0xb28ade25. +// +// Solidity: function baseGas(bytes _message, uint32 _minGasLimit) pure returns(uint64) +func (_CrossDomainMessenger *CrossDomainMessengerSession) BaseGas(_message []byte, _minGasLimit uint32) (uint64, error) { + return _CrossDomainMessenger.Contract.BaseGas(&_CrossDomainMessenger.CallOpts, _message, _minGasLimit) +} + +// BaseGas is a free data retrieval call binding the contract method 0xb28ade25. +// +// Solidity: function baseGas(bytes _message, uint32 _minGasLimit) pure returns(uint64) +func (_CrossDomainMessenger *CrossDomainMessengerCallerSession) BaseGas(_message []byte, _minGasLimit uint32) (uint64, error) { + return _CrossDomainMessenger.Contract.BaseGas(&_CrossDomainMessenger.CallOpts, _message, _minGasLimit) +} + +// FailedMessages is a free data retrieval call binding the contract method 0xa4e7f8bd. +// +// Solidity: function failedMessages(bytes32 ) view returns(bool) +func (_CrossDomainMessenger *CrossDomainMessengerCaller) FailedMessages(opts *bind.CallOpts, arg0 [32]byte) (bool, error) { + var out []interface{} + err := _CrossDomainMessenger.contract.Call(opts, &out, "failedMessages", arg0) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// FailedMessages is a free data retrieval call binding the contract method 0xa4e7f8bd. +// +// Solidity: function failedMessages(bytes32 ) view returns(bool) +func (_CrossDomainMessenger *CrossDomainMessengerSession) FailedMessages(arg0 [32]byte) (bool, error) { + return _CrossDomainMessenger.Contract.FailedMessages(&_CrossDomainMessenger.CallOpts, arg0) +} + +// FailedMessages is a free data retrieval call binding the contract method 0xa4e7f8bd. +// +// Solidity: function failedMessages(bytes32 ) view returns(bool) +func (_CrossDomainMessenger *CrossDomainMessengerCallerSession) FailedMessages(arg0 [32]byte) (bool, error) { + return _CrossDomainMessenger.Contract.FailedMessages(&_CrossDomainMessenger.CallOpts, arg0) +} + +// MessageNonce is a free data retrieval call binding the contract method 0xecc70428. +// +// Solidity: function messageNonce() view returns(uint256) +func (_CrossDomainMessenger *CrossDomainMessengerCaller) MessageNonce(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _CrossDomainMessenger.contract.Call(opts, &out, "messageNonce") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// MessageNonce is a free data retrieval call binding the contract method 0xecc70428. +// +// Solidity: function messageNonce() view returns(uint256) +func (_CrossDomainMessenger *CrossDomainMessengerSession) MessageNonce() (*big.Int, error) { + return _CrossDomainMessenger.Contract.MessageNonce(&_CrossDomainMessenger.CallOpts) +} + +// MessageNonce is a free data retrieval call binding the contract method 0xecc70428. +// +// Solidity: function messageNonce() view returns(uint256) +func (_CrossDomainMessenger *CrossDomainMessengerCallerSession) MessageNonce() (*big.Int, error) { + return _CrossDomainMessenger.Contract.MessageNonce(&_CrossDomainMessenger.CallOpts) +} + +// OtherMessenger is a free data retrieval call binding the contract method 0xdb505d80. +// +// Solidity: function otherMessenger() view returns(address) +func (_CrossDomainMessenger *CrossDomainMessengerCaller) OtherMessenger(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _CrossDomainMessenger.contract.Call(opts, &out, "otherMessenger") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// OtherMessenger is a free data retrieval call binding the contract method 0xdb505d80. +// +// Solidity: function otherMessenger() view returns(address) +func (_CrossDomainMessenger *CrossDomainMessengerSession) OtherMessenger() (common.Address, error) { + return _CrossDomainMessenger.Contract.OtherMessenger(&_CrossDomainMessenger.CallOpts) +} + +// OtherMessenger is a free data retrieval call binding the contract method 0xdb505d80. +// +// Solidity: function otherMessenger() view returns(address) +func (_CrossDomainMessenger *CrossDomainMessengerCallerSession) OtherMessenger() (common.Address, error) { + return _CrossDomainMessenger.Contract.OtherMessenger(&_CrossDomainMessenger.CallOpts) +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool) +func (_CrossDomainMessenger *CrossDomainMessengerCaller) Paused(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _CrossDomainMessenger.contract.Call(opts, &out, "paused") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool) +func (_CrossDomainMessenger *CrossDomainMessengerSession) Paused() (bool, error) { + return _CrossDomainMessenger.Contract.Paused(&_CrossDomainMessenger.CallOpts) +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool) +func (_CrossDomainMessenger *CrossDomainMessengerCallerSession) Paused() (bool, error) { + return _CrossDomainMessenger.Contract.Paused(&_CrossDomainMessenger.CallOpts) +} + +// SuccessfulMessages is a free data retrieval call binding the contract method 0xb1b1b209. +// +// Solidity: function successfulMessages(bytes32 ) view returns(bool) +func (_CrossDomainMessenger *CrossDomainMessengerCaller) SuccessfulMessages(opts *bind.CallOpts, arg0 [32]byte) (bool, error) { + var out []interface{} + err := _CrossDomainMessenger.contract.Call(opts, &out, "successfulMessages", arg0) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// SuccessfulMessages is a free data retrieval call binding the contract method 0xb1b1b209. +// +// Solidity: function successfulMessages(bytes32 ) view returns(bool) +func (_CrossDomainMessenger *CrossDomainMessengerSession) SuccessfulMessages(arg0 [32]byte) (bool, error) { + return _CrossDomainMessenger.Contract.SuccessfulMessages(&_CrossDomainMessenger.CallOpts, arg0) +} + +// SuccessfulMessages is a free data retrieval call binding the contract method 0xb1b1b209. +// +// Solidity: function successfulMessages(bytes32 ) view returns(bool) +func (_CrossDomainMessenger *CrossDomainMessengerCallerSession) SuccessfulMessages(arg0 [32]byte) (bool, error) { + return _CrossDomainMessenger.Contract.SuccessfulMessages(&_CrossDomainMessenger.CallOpts, arg0) +} + +// XDomainMessageSender is a free data retrieval call binding the contract method 0x6e296e45. +// +// Solidity: function xDomainMessageSender() view returns(address) +func (_CrossDomainMessenger *CrossDomainMessengerCaller) XDomainMessageSender(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _CrossDomainMessenger.contract.Call(opts, &out, "xDomainMessageSender") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// XDomainMessageSender is a free data retrieval call binding the contract method 0x6e296e45. +// +// Solidity: function xDomainMessageSender() view returns(address) +func (_CrossDomainMessenger *CrossDomainMessengerSession) XDomainMessageSender() (common.Address, error) { + return _CrossDomainMessenger.Contract.XDomainMessageSender(&_CrossDomainMessenger.CallOpts) +} + +// XDomainMessageSender is a free data retrieval call binding the contract method 0x6e296e45. +// +// Solidity: function xDomainMessageSender() view returns(address) +func (_CrossDomainMessenger *CrossDomainMessengerCallerSession) XDomainMessageSender() (common.Address, error) { + return _CrossDomainMessenger.Contract.XDomainMessageSender(&_CrossDomainMessenger.CallOpts) +} + +// RelayMessage is a paid mutator transaction binding the contract method 0xd764ad0b. +// +// Solidity: function relayMessage(uint256 _nonce, address _sender, address _target, uint256 _value, uint256 _minGasLimit, bytes _message) payable returns() +func (_CrossDomainMessenger *CrossDomainMessengerTransactor) RelayMessage(opts *bind.TransactOpts, _nonce *big.Int, _sender common.Address, _target common.Address, _value *big.Int, _minGasLimit *big.Int, _message []byte) (*types.Transaction, error) { + return _CrossDomainMessenger.contract.Transact(opts, "relayMessage", _nonce, _sender, _target, _value, _minGasLimit, _message) +} + +// RelayMessage is a paid mutator transaction binding the contract method 0xd764ad0b. +// +// Solidity: function relayMessage(uint256 _nonce, address _sender, address _target, uint256 _value, uint256 _minGasLimit, bytes _message) payable returns() +func (_CrossDomainMessenger *CrossDomainMessengerSession) RelayMessage(_nonce *big.Int, _sender common.Address, _target common.Address, _value *big.Int, _minGasLimit *big.Int, _message []byte) (*types.Transaction, error) { + return _CrossDomainMessenger.Contract.RelayMessage(&_CrossDomainMessenger.TransactOpts, _nonce, _sender, _target, _value, _minGasLimit, _message) +} + +// RelayMessage is a paid mutator transaction binding the contract method 0xd764ad0b. +// +// Solidity: function relayMessage(uint256 _nonce, address _sender, address _target, uint256 _value, uint256 _minGasLimit, bytes _message) payable returns() +func (_CrossDomainMessenger *CrossDomainMessengerTransactorSession) RelayMessage(_nonce *big.Int, _sender common.Address, _target common.Address, _value *big.Int, _minGasLimit *big.Int, _message []byte) (*types.Transaction, error) { + return _CrossDomainMessenger.Contract.RelayMessage(&_CrossDomainMessenger.TransactOpts, _nonce, _sender, _target, _value, _minGasLimit, _message) +} + +// SendMessage is a paid mutator transaction binding the contract method 0x3dbb202b. +// +// Solidity: function sendMessage(address _target, bytes _message, uint32 _minGasLimit) payable returns() +func (_CrossDomainMessenger *CrossDomainMessengerTransactor) SendMessage(opts *bind.TransactOpts, _target common.Address, _message []byte, _minGasLimit uint32) (*types.Transaction, error) { + return _CrossDomainMessenger.contract.Transact(opts, "sendMessage", _target, _message, _minGasLimit) +} + +// SendMessage is a paid mutator transaction binding the contract method 0x3dbb202b. +// +// Solidity: function sendMessage(address _target, bytes _message, uint32 _minGasLimit) payable returns() +func (_CrossDomainMessenger *CrossDomainMessengerSession) SendMessage(_target common.Address, _message []byte, _minGasLimit uint32) (*types.Transaction, error) { + return _CrossDomainMessenger.Contract.SendMessage(&_CrossDomainMessenger.TransactOpts, _target, _message, _minGasLimit) +} + +// SendMessage is a paid mutator transaction binding the contract method 0x3dbb202b. +// +// Solidity: function sendMessage(address _target, bytes _message, uint32 _minGasLimit) payable returns() +func (_CrossDomainMessenger *CrossDomainMessengerTransactorSession) SendMessage(_target common.Address, _message []byte, _minGasLimit uint32) (*types.Transaction, error) { + return _CrossDomainMessenger.Contract.SendMessage(&_CrossDomainMessenger.TransactOpts, _target, _message, _minGasLimit) +} + +// CrossDomainMessengerFailedRelayedMessageIterator is returned from FilterFailedRelayedMessage and is used to iterate over the raw logs and unpacked data for FailedRelayedMessage events raised by the CrossDomainMessenger contract. +type CrossDomainMessengerFailedRelayedMessageIterator struct { + Event *CrossDomainMessengerFailedRelayedMessage // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *CrossDomainMessengerFailedRelayedMessageIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(CrossDomainMessengerFailedRelayedMessage) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(CrossDomainMessengerFailedRelayedMessage) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *CrossDomainMessengerFailedRelayedMessageIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *CrossDomainMessengerFailedRelayedMessageIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// CrossDomainMessengerFailedRelayedMessage represents a FailedRelayedMessage event raised by the CrossDomainMessenger contract. +type CrossDomainMessengerFailedRelayedMessage struct { + MsgHash [32]byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterFailedRelayedMessage is a free log retrieval operation binding the contract event 0x99d0e048484baa1b1540b1367cb128acd7ab2946d1ed91ec10e3c85e4bf51b8f. +// +// Solidity: event FailedRelayedMessage(bytes32 indexed msgHash) +func (_CrossDomainMessenger *CrossDomainMessengerFilterer) FilterFailedRelayedMessage(opts *bind.FilterOpts, msgHash [][32]byte) (*CrossDomainMessengerFailedRelayedMessageIterator, error) { + + var msgHashRule []interface{} + for _, msgHashItem := range msgHash { + msgHashRule = append(msgHashRule, msgHashItem) + } + + logs, sub, err := _CrossDomainMessenger.contract.FilterLogs(opts, "FailedRelayedMessage", msgHashRule) + if err != nil { + return nil, err + } + return &CrossDomainMessengerFailedRelayedMessageIterator{contract: _CrossDomainMessenger.contract, event: "FailedRelayedMessage", logs: logs, sub: sub}, nil +} + +// WatchFailedRelayedMessage is a free log subscription operation binding the contract event 0x99d0e048484baa1b1540b1367cb128acd7ab2946d1ed91ec10e3c85e4bf51b8f. +// +// Solidity: event FailedRelayedMessage(bytes32 indexed msgHash) +func (_CrossDomainMessenger *CrossDomainMessengerFilterer) WatchFailedRelayedMessage(opts *bind.WatchOpts, sink chan<- *CrossDomainMessengerFailedRelayedMessage, msgHash [][32]byte) (event.Subscription, error) { + + var msgHashRule []interface{} + for _, msgHashItem := range msgHash { + msgHashRule = append(msgHashRule, msgHashItem) + } + + logs, sub, err := _CrossDomainMessenger.contract.WatchLogs(opts, "FailedRelayedMessage", msgHashRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(CrossDomainMessengerFailedRelayedMessage) + if err := _CrossDomainMessenger.contract.UnpackLog(event, "FailedRelayedMessage", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseFailedRelayedMessage is a log parse operation binding the contract event 0x99d0e048484baa1b1540b1367cb128acd7ab2946d1ed91ec10e3c85e4bf51b8f. +// +// Solidity: event FailedRelayedMessage(bytes32 indexed msgHash) +func (_CrossDomainMessenger *CrossDomainMessengerFilterer) ParseFailedRelayedMessage(log types.Log) (*CrossDomainMessengerFailedRelayedMessage, error) { + event := new(CrossDomainMessengerFailedRelayedMessage) + if err := _CrossDomainMessenger.contract.UnpackLog(event, "FailedRelayedMessage", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// CrossDomainMessengerInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the CrossDomainMessenger contract. +type CrossDomainMessengerInitializedIterator struct { + Event *CrossDomainMessengerInitialized // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *CrossDomainMessengerInitializedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(CrossDomainMessengerInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(CrossDomainMessengerInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *CrossDomainMessengerInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *CrossDomainMessengerInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// CrossDomainMessengerInitialized represents a Initialized event raised by the CrossDomainMessenger contract. +type CrossDomainMessengerInitialized struct { + Version uint8 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_CrossDomainMessenger *CrossDomainMessengerFilterer) FilterInitialized(opts *bind.FilterOpts) (*CrossDomainMessengerInitializedIterator, error) { + + logs, sub, err := _CrossDomainMessenger.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &CrossDomainMessengerInitializedIterator{contract: _CrossDomainMessenger.contract, event: "Initialized", logs: logs, sub: sub}, nil +} + +// WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_CrossDomainMessenger *CrossDomainMessengerFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *CrossDomainMessengerInitialized) (event.Subscription, error) { + + logs, sub, err := _CrossDomainMessenger.contract.WatchLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(CrossDomainMessengerInitialized) + if err := _CrossDomainMessenger.contract.UnpackLog(event, "Initialized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_CrossDomainMessenger *CrossDomainMessengerFilterer) ParseInitialized(log types.Log) (*CrossDomainMessengerInitialized, error) { + event := new(CrossDomainMessengerInitialized) + if err := _CrossDomainMessenger.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// CrossDomainMessengerRelayedMessageIterator is returned from FilterRelayedMessage and is used to iterate over the raw logs and unpacked data for RelayedMessage events raised by the CrossDomainMessenger contract. +type CrossDomainMessengerRelayedMessageIterator struct { + Event *CrossDomainMessengerRelayedMessage // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *CrossDomainMessengerRelayedMessageIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(CrossDomainMessengerRelayedMessage) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(CrossDomainMessengerRelayedMessage) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *CrossDomainMessengerRelayedMessageIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *CrossDomainMessengerRelayedMessageIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// CrossDomainMessengerRelayedMessage represents a RelayedMessage event raised by the CrossDomainMessenger contract. +type CrossDomainMessengerRelayedMessage struct { + MsgHash [32]byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterRelayedMessage is a free log retrieval operation binding the contract event 0x4641df4a962071e12719d8c8c8e5ac7fc4d97b927346a3d7a335b1f7517e133c. +// +// Solidity: event RelayedMessage(bytes32 indexed msgHash) +func (_CrossDomainMessenger *CrossDomainMessengerFilterer) FilterRelayedMessage(opts *bind.FilterOpts, msgHash [][32]byte) (*CrossDomainMessengerRelayedMessageIterator, error) { + + var msgHashRule []interface{} + for _, msgHashItem := range msgHash { + msgHashRule = append(msgHashRule, msgHashItem) + } + + logs, sub, err := _CrossDomainMessenger.contract.FilterLogs(opts, "RelayedMessage", msgHashRule) + if err != nil { + return nil, err + } + return &CrossDomainMessengerRelayedMessageIterator{contract: _CrossDomainMessenger.contract, event: "RelayedMessage", logs: logs, sub: sub}, nil +} + +// WatchRelayedMessage is a free log subscription operation binding the contract event 0x4641df4a962071e12719d8c8c8e5ac7fc4d97b927346a3d7a335b1f7517e133c. +// +// Solidity: event RelayedMessage(bytes32 indexed msgHash) +func (_CrossDomainMessenger *CrossDomainMessengerFilterer) WatchRelayedMessage(opts *bind.WatchOpts, sink chan<- *CrossDomainMessengerRelayedMessage, msgHash [][32]byte) (event.Subscription, error) { + + var msgHashRule []interface{} + for _, msgHashItem := range msgHash { + msgHashRule = append(msgHashRule, msgHashItem) + } + + logs, sub, err := _CrossDomainMessenger.contract.WatchLogs(opts, "RelayedMessage", msgHashRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(CrossDomainMessengerRelayedMessage) + if err := _CrossDomainMessenger.contract.UnpackLog(event, "RelayedMessage", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseRelayedMessage is a log parse operation binding the contract event 0x4641df4a962071e12719d8c8c8e5ac7fc4d97b927346a3d7a335b1f7517e133c. +// +// Solidity: event RelayedMessage(bytes32 indexed msgHash) +func (_CrossDomainMessenger *CrossDomainMessengerFilterer) ParseRelayedMessage(log types.Log) (*CrossDomainMessengerRelayedMessage, error) { + event := new(CrossDomainMessengerRelayedMessage) + if err := _CrossDomainMessenger.contract.UnpackLog(event, "RelayedMessage", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// CrossDomainMessengerSentMessageIterator is returned from FilterSentMessage and is used to iterate over the raw logs and unpacked data for SentMessage events raised by the CrossDomainMessenger contract. +type CrossDomainMessengerSentMessageIterator struct { + Event *CrossDomainMessengerSentMessage // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *CrossDomainMessengerSentMessageIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(CrossDomainMessengerSentMessage) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(CrossDomainMessengerSentMessage) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *CrossDomainMessengerSentMessageIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *CrossDomainMessengerSentMessageIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// CrossDomainMessengerSentMessage represents a SentMessage event raised by the CrossDomainMessenger contract. +type CrossDomainMessengerSentMessage struct { + Target common.Address + Sender common.Address + Message []byte + MessageNonce *big.Int + GasLimit *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSentMessage is a free log retrieval operation binding the contract event 0xcb0f7ffd78f9aee47a248fae8db181db6eee833039123e026dcbff529522e52a. +// +// Solidity: event SentMessage(address indexed target, address sender, bytes message, uint256 messageNonce, uint256 gasLimit) +func (_CrossDomainMessenger *CrossDomainMessengerFilterer) FilterSentMessage(opts *bind.FilterOpts, target []common.Address) (*CrossDomainMessengerSentMessageIterator, error) { + + var targetRule []interface{} + for _, targetItem := range target { + targetRule = append(targetRule, targetItem) + } + + logs, sub, err := _CrossDomainMessenger.contract.FilterLogs(opts, "SentMessage", targetRule) + if err != nil { + return nil, err + } + return &CrossDomainMessengerSentMessageIterator{contract: _CrossDomainMessenger.contract, event: "SentMessage", logs: logs, sub: sub}, nil +} + +// WatchSentMessage is a free log subscription operation binding the contract event 0xcb0f7ffd78f9aee47a248fae8db181db6eee833039123e026dcbff529522e52a. +// +// Solidity: event SentMessage(address indexed target, address sender, bytes message, uint256 messageNonce, uint256 gasLimit) +func (_CrossDomainMessenger *CrossDomainMessengerFilterer) WatchSentMessage(opts *bind.WatchOpts, sink chan<- *CrossDomainMessengerSentMessage, target []common.Address) (event.Subscription, error) { + + var targetRule []interface{} + for _, targetItem := range target { + targetRule = append(targetRule, targetItem) + } + + logs, sub, err := _CrossDomainMessenger.contract.WatchLogs(opts, "SentMessage", targetRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(CrossDomainMessengerSentMessage) + if err := _CrossDomainMessenger.contract.UnpackLog(event, "SentMessage", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseSentMessage is a log parse operation binding the contract event 0xcb0f7ffd78f9aee47a248fae8db181db6eee833039123e026dcbff529522e52a. +// +// Solidity: event SentMessage(address indexed target, address sender, bytes message, uint256 messageNonce, uint256 gasLimit) +func (_CrossDomainMessenger *CrossDomainMessengerFilterer) ParseSentMessage(log types.Log) (*CrossDomainMessengerSentMessage, error) { + event := new(CrossDomainMessengerSentMessage) + if err := _CrossDomainMessenger.contract.UnpackLog(event, "SentMessage", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// CrossDomainMessengerSentMessageExtension1Iterator is returned from FilterSentMessageExtension1 and is used to iterate over the raw logs and unpacked data for SentMessageExtension1 events raised by the CrossDomainMessenger contract. +type CrossDomainMessengerSentMessageExtension1Iterator struct { + Event *CrossDomainMessengerSentMessageExtension1 // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *CrossDomainMessengerSentMessageExtension1Iterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(CrossDomainMessengerSentMessageExtension1) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(CrossDomainMessengerSentMessageExtension1) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *CrossDomainMessengerSentMessageExtension1Iterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *CrossDomainMessengerSentMessageExtension1Iterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// CrossDomainMessengerSentMessageExtension1 represents a SentMessageExtension1 event raised by the CrossDomainMessenger contract. +type CrossDomainMessengerSentMessageExtension1 struct { + Sender common.Address + Value *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSentMessageExtension1 is a free log retrieval operation binding the contract event 0x8ebb2ec2465bdb2a06a66fc37a0963af8a2a6a1479d81d56fdb8cbb98096d546. +// +// Solidity: event SentMessageExtension1(address indexed sender, uint256 value) +func (_CrossDomainMessenger *CrossDomainMessengerFilterer) FilterSentMessageExtension1(opts *bind.FilterOpts, sender []common.Address) (*CrossDomainMessengerSentMessageExtension1Iterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _CrossDomainMessenger.contract.FilterLogs(opts, "SentMessageExtension1", senderRule) + if err != nil { + return nil, err + } + return &CrossDomainMessengerSentMessageExtension1Iterator{contract: _CrossDomainMessenger.contract, event: "SentMessageExtension1", logs: logs, sub: sub}, nil +} + +// WatchSentMessageExtension1 is a free log subscription operation binding the contract event 0x8ebb2ec2465bdb2a06a66fc37a0963af8a2a6a1479d81d56fdb8cbb98096d546. +// +// Solidity: event SentMessageExtension1(address indexed sender, uint256 value) +func (_CrossDomainMessenger *CrossDomainMessengerFilterer) WatchSentMessageExtension1(opts *bind.WatchOpts, sink chan<- *CrossDomainMessengerSentMessageExtension1, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _CrossDomainMessenger.contract.WatchLogs(opts, "SentMessageExtension1", senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(CrossDomainMessengerSentMessageExtension1) + if err := _CrossDomainMessenger.contract.UnpackLog(event, "SentMessageExtension1", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseSentMessageExtension1 is a log parse operation binding the contract event 0x8ebb2ec2465bdb2a06a66fc37a0963af8a2a6a1479d81d56fdb8cbb98096d546. +// +// Solidity: event SentMessageExtension1(address indexed sender, uint256 value) +func (_CrossDomainMessenger *CrossDomainMessengerFilterer) ParseSentMessageExtension1(log types.Log) (*CrossDomainMessengerSentMessageExtension1, error) { + event := new(CrossDomainMessengerSentMessageExtension1) + if err := _CrossDomainMessenger.contract.UnpackLog(event, "SentMessageExtension1", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/op-e2e2/bindings/delayedvetoable.go b/op-e2e2/bindings/delayedvetoable.go new file mode 100644 index 000000000000..989bb0278d20 --- /dev/null +++ b/op-e2e2/bindings/delayedvetoable.go @@ -0,0 +1,928 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// DelayedVetoableMetaData contains all meta data concerning the DelayedVetoable contract. +var DelayedVetoableMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"vetoer_\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"initiator_\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"target_\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatingDelay_\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"fallback\",\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"delay\",\"inputs\":[],\"outputs\":[{\"name\":\"delay_\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initiator\",\"inputs\":[],\"outputs\":[{\"name\":\"initiator_\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"queuedAt\",\"inputs\":[{\"name\":\"callHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"queuedAt_\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"target\",\"inputs\":[],\"outputs\":[{\"name\":\"target_\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"vetoer\",\"inputs\":[],\"outputs\":[{\"name\":\"vetoer_\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"DelayActivated\",\"inputs\":[{\"name\":\"delay\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Forwarded\",\"inputs\":[{\"name\":\"callHash\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"data\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initiated\",\"inputs\":[{\"name\":\"callHash\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"data\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Vetoed\",\"inputs\":[{\"name\":\"callHash\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"data\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"ForwardingEarly\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Unauthorized\",\"inputs\":[{\"name\":\"expected\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"actual\",\"type\":\"address\",\"internalType\":\"address\"}]}]", + Bin: "0x61010060405234801561001157600080fd5b506040516108ff3803806108ff8339810160408190526100309161006e565b6001600160a01b0393841660a05291831660c05290911660805260e0526100b9565b80516001600160a01b038116811461006957600080fd5b919050565b6000806000806080858703121561008457600080fd5b61008d85610052565b935061009b60208601610052565b92506100a960408601610052565b6060959095015193969295505050565b60805160a05160c05160e0516107dc610123600039600061023f01526000818161015f01528181610205015281816102cd0152818161045801526105050152600081816101a001528181610384015261059d01526000818161057101526105ff01526107dc6000f3fe608060405234801561001057600080fd5b50600436106100725760003560e01c8063b912de5d11610050578063b912de5d14610111578063d4b8399214610124578063d8bff4401461012c57610072565b806354fd4d501461007c5780635c39fcc1146100ce5780636a42b8f8146100fb575b61007a610134565b005b6100b86040518060400160405280600581526020017f312e302e3000000000000000000000000000000000000000000000000000000081525081565b6040516100c591906106a7565b60405180910390f35b6100d66104fb565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100c5565b610103610532565b6040519081526020016100c5565b61010361011f36600461071a565b610540565b6100d6610567565b6100d6610593565b361580156101425750600054155b15610298573373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016148015906101c357503373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614155b1561023d576040517f295a81c100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001660048201523360248201526044015b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000060008190556040519081527febf28bfb587e28dfffd9173cf71c32ba5d3f0544a0117b5539c9b274a5bba2a89060200160405180910390a1565b600080366040516102aa929190610733565b60405190819003902090503373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000161480156103065750600081815260016020526040902054155b1561036c5760005460000361031e5761031e816105bf565b6000818152600160205260408082204290555182917f87a332a414acbc7da074543639ce7ae02ff1ea72e88379da9f261b080beb5a139161036191903690610743565b60405180910390a250565b3373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000161480156103be575060008181526001602052604090205415155b15610406576000818152600160205260408082208290555182917fbede6852c1d97d93ff557f676de76670cd0dec861e7fe8beb13aa0ba2b0ab0409161036191903690610743565b600081815260016020526040812054900361048b576040517f295a81c100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000166004820152336024820152604401610234565b60008054828252600160205260409091205442916104a891610790565b11156104e0576040517f43dc986d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000818152600160205260408120556104f8816105bf565b50565b60003361052757507f000000000000000000000000000000000000000000000000000000000000000090565b61052f610134565b90565b600033610527575060005490565b60003361055a575060009081526001602052604090205490565b610562610134565b919050565b60003361052757507f000000000000000000000000000000000000000000000000000000000000000090565b60003361052757507f000000000000000000000000000000000000000000000000000000000000000090565b807f4c109d85bcd0bb5c735b4be850953d652afe4cd9aa2e0b1426a65a4dcb2e12296000366040516105f2929190610743565b60405180910390a26000807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16600036604051610645929190610733565b6000604051808303816000865af19150503d8060008114610682576040519150601f19603f3d011682016040523d82523d6000602084013e610687565b606091505b50909250905081151560010361069f57805160208201f35b805160208201fd5b600060208083528351808285015260005b818110156106d4578581018301518582016040015282016106b8565b818111156106e6576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b60006020828403121561072c57600080fd5b5035919050565b8183823760009101908152919050565b60208152816020820152818360408301376000818301604090810191909152601f9092017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0160101919050565b600082198211156107ca577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b50019056fea164736f6c634300080f000a", +} + +// DelayedVetoableABI is the input ABI used to generate the binding from. +// Deprecated: Use DelayedVetoableMetaData.ABI instead. +var DelayedVetoableABI = DelayedVetoableMetaData.ABI + +// DelayedVetoableBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use DelayedVetoableMetaData.Bin instead. +var DelayedVetoableBin = DelayedVetoableMetaData.Bin + +// DeployDelayedVetoable deploys a new Ethereum contract, binding an instance of DelayedVetoable to it. +func DeployDelayedVetoable(auth *bind.TransactOpts, backend bind.ContractBackend, vetoer_ common.Address, initiator_ common.Address, target_ common.Address, operatingDelay_ *big.Int) (common.Address, *types.Transaction, *DelayedVetoable, error) { + parsed, err := DelayedVetoableMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(DelayedVetoableBin), backend, vetoer_, initiator_, target_, operatingDelay_) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &DelayedVetoable{DelayedVetoableCaller: DelayedVetoableCaller{contract: contract}, DelayedVetoableTransactor: DelayedVetoableTransactor{contract: contract}, DelayedVetoableFilterer: DelayedVetoableFilterer{contract: contract}}, nil +} + +// DelayedVetoable is an auto generated Go binding around an Ethereum contract. +type DelayedVetoable struct { + DelayedVetoableCaller // Read-only binding to the contract + DelayedVetoableTransactor // Write-only binding to the contract + DelayedVetoableFilterer // Log filterer for contract events +} + +// DelayedVetoableCaller is an auto generated read-only Go binding around an Ethereum contract. +type DelayedVetoableCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// DelayedVetoableTransactor is an auto generated write-only Go binding around an Ethereum contract. +type DelayedVetoableTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// DelayedVetoableFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type DelayedVetoableFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// DelayedVetoableSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type DelayedVetoableSession struct { + Contract *DelayedVetoable // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// DelayedVetoableCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type DelayedVetoableCallerSession struct { + Contract *DelayedVetoableCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// DelayedVetoableTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type DelayedVetoableTransactorSession struct { + Contract *DelayedVetoableTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// DelayedVetoableRaw is an auto generated low-level Go binding around an Ethereum contract. +type DelayedVetoableRaw struct { + Contract *DelayedVetoable // Generic contract binding to access the raw methods on +} + +// DelayedVetoableCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type DelayedVetoableCallerRaw struct { + Contract *DelayedVetoableCaller // Generic read-only contract binding to access the raw methods on +} + +// DelayedVetoableTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type DelayedVetoableTransactorRaw struct { + Contract *DelayedVetoableTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewDelayedVetoable creates a new instance of DelayedVetoable, bound to a specific deployed contract. +func NewDelayedVetoable(address common.Address, backend bind.ContractBackend) (*DelayedVetoable, error) { + contract, err := bindDelayedVetoable(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &DelayedVetoable{DelayedVetoableCaller: DelayedVetoableCaller{contract: contract}, DelayedVetoableTransactor: DelayedVetoableTransactor{contract: contract}, DelayedVetoableFilterer: DelayedVetoableFilterer{contract: contract}}, nil +} + +// NewDelayedVetoableCaller creates a new read-only instance of DelayedVetoable, bound to a specific deployed contract. +func NewDelayedVetoableCaller(address common.Address, caller bind.ContractCaller) (*DelayedVetoableCaller, error) { + contract, err := bindDelayedVetoable(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &DelayedVetoableCaller{contract: contract}, nil +} + +// NewDelayedVetoableTransactor creates a new write-only instance of DelayedVetoable, bound to a specific deployed contract. +func NewDelayedVetoableTransactor(address common.Address, transactor bind.ContractTransactor) (*DelayedVetoableTransactor, error) { + contract, err := bindDelayedVetoable(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &DelayedVetoableTransactor{contract: contract}, nil +} + +// NewDelayedVetoableFilterer creates a new log filterer instance of DelayedVetoable, bound to a specific deployed contract. +func NewDelayedVetoableFilterer(address common.Address, filterer bind.ContractFilterer) (*DelayedVetoableFilterer, error) { + contract, err := bindDelayedVetoable(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &DelayedVetoableFilterer{contract: contract}, nil +} + +// bindDelayedVetoable binds a generic wrapper to an already deployed contract. +func bindDelayedVetoable(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(DelayedVetoableABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_DelayedVetoable *DelayedVetoableRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _DelayedVetoable.Contract.DelayedVetoableCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_DelayedVetoable *DelayedVetoableRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DelayedVetoable.Contract.DelayedVetoableTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_DelayedVetoable *DelayedVetoableRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _DelayedVetoable.Contract.DelayedVetoableTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_DelayedVetoable *DelayedVetoableCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _DelayedVetoable.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_DelayedVetoable *DelayedVetoableTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DelayedVetoable.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_DelayedVetoable *DelayedVetoableTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _DelayedVetoable.Contract.contract.Transact(opts, method, params...) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_DelayedVetoable *DelayedVetoableCaller) Version(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _DelayedVetoable.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 (_DelayedVetoable *DelayedVetoableSession) Version() (string, error) { + return _DelayedVetoable.Contract.Version(&_DelayedVetoable.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_DelayedVetoable *DelayedVetoableCallerSession) Version() (string, error) { + return _DelayedVetoable.Contract.Version(&_DelayedVetoable.CallOpts) +} + +// Delay is a paid mutator transaction binding the contract method 0x6a42b8f8. +// +// Solidity: function delay() returns(uint256 delay_) +func (_DelayedVetoable *DelayedVetoableTransactor) Delay(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DelayedVetoable.contract.Transact(opts, "delay") +} + +// Delay is a paid mutator transaction binding the contract method 0x6a42b8f8. +// +// Solidity: function delay() returns(uint256 delay_) +func (_DelayedVetoable *DelayedVetoableSession) Delay() (*types.Transaction, error) { + return _DelayedVetoable.Contract.Delay(&_DelayedVetoable.TransactOpts) +} + +// Delay is a paid mutator transaction binding the contract method 0x6a42b8f8. +// +// Solidity: function delay() returns(uint256 delay_) +func (_DelayedVetoable *DelayedVetoableTransactorSession) Delay() (*types.Transaction, error) { + return _DelayedVetoable.Contract.Delay(&_DelayedVetoable.TransactOpts) +} + +// Initiator is a paid mutator transaction binding the contract method 0x5c39fcc1. +// +// Solidity: function initiator() returns(address initiator_) +func (_DelayedVetoable *DelayedVetoableTransactor) Initiator(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DelayedVetoable.contract.Transact(opts, "initiator") +} + +// Initiator is a paid mutator transaction binding the contract method 0x5c39fcc1. +// +// Solidity: function initiator() returns(address initiator_) +func (_DelayedVetoable *DelayedVetoableSession) Initiator() (*types.Transaction, error) { + return _DelayedVetoable.Contract.Initiator(&_DelayedVetoable.TransactOpts) +} + +// Initiator is a paid mutator transaction binding the contract method 0x5c39fcc1. +// +// Solidity: function initiator() returns(address initiator_) +func (_DelayedVetoable *DelayedVetoableTransactorSession) Initiator() (*types.Transaction, error) { + return _DelayedVetoable.Contract.Initiator(&_DelayedVetoable.TransactOpts) +} + +// QueuedAt is a paid mutator transaction binding the contract method 0xb912de5d. +// +// Solidity: function queuedAt(bytes32 callHash) returns(uint256 queuedAt_) +func (_DelayedVetoable *DelayedVetoableTransactor) QueuedAt(opts *bind.TransactOpts, callHash [32]byte) (*types.Transaction, error) { + return _DelayedVetoable.contract.Transact(opts, "queuedAt", callHash) +} + +// QueuedAt is a paid mutator transaction binding the contract method 0xb912de5d. +// +// Solidity: function queuedAt(bytes32 callHash) returns(uint256 queuedAt_) +func (_DelayedVetoable *DelayedVetoableSession) QueuedAt(callHash [32]byte) (*types.Transaction, error) { + return _DelayedVetoable.Contract.QueuedAt(&_DelayedVetoable.TransactOpts, callHash) +} + +// QueuedAt is a paid mutator transaction binding the contract method 0xb912de5d. +// +// Solidity: function queuedAt(bytes32 callHash) returns(uint256 queuedAt_) +func (_DelayedVetoable *DelayedVetoableTransactorSession) QueuedAt(callHash [32]byte) (*types.Transaction, error) { + return _DelayedVetoable.Contract.QueuedAt(&_DelayedVetoable.TransactOpts, callHash) +} + +// Target is a paid mutator transaction binding the contract method 0xd4b83992. +// +// Solidity: function target() returns(address target_) +func (_DelayedVetoable *DelayedVetoableTransactor) Target(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DelayedVetoable.contract.Transact(opts, "target") +} + +// Target is a paid mutator transaction binding the contract method 0xd4b83992. +// +// Solidity: function target() returns(address target_) +func (_DelayedVetoable *DelayedVetoableSession) Target() (*types.Transaction, error) { + return _DelayedVetoable.Contract.Target(&_DelayedVetoable.TransactOpts) +} + +// Target is a paid mutator transaction binding the contract method 0xd4b83992. +// +// Solidity: function target() returns(address target_) +func (_DelayedVetoable *DelayedVetoableTransactorSession) Target() (*types.Transaction, error) { + return _DelayedVetoable.Contract.Target(&_DelayedVetoable.TransactOpts) +} + +// Vetoer is a paid mutator transaction binding the contract method 0xd8bff440. +// +// Solidity: function vetoer() returns(address vetoer_) +func (_DelayedVetoable *DelayedVetoableTransactor) Vetoer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DelayedVetoable.contract.Transact(opts, "vetoer") +} + +// Vetoer is a paid mutator transaction binding the contract method 0xd8bff440. +// +// Solidity: function vetoer() returns(address vetoer_) +func (_DelayedVetoable *DelayedVetoableSession) Vetoer() (*types.Transaction, error) { + return _DelayedVetoable.Contract.Vetoer(&_DelayedVetoable.TransactOpts) +} + +// Vetoer is a paid mutator transaction binding the contract method 0xd8bff440. +// +// Solidity: function vetoer() returns(address vetoer_) +func (_DelayedVetoable *DelayedVetoableTransactorSession) Vetoer() (*types.Transaction, error) { + return _DelayedVetoable.Contract.Vetoer(&_DelayedVetoable.TransactOpts) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() returns() +func (_DelayedVetoable *DelayedVetoableTransactor) Fallback(opts *bind.TransactOpts, calldata []byte) (*types.Transaction, error) { + return _DelayedVetoable.contract.RawTransact(opts, calldata) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() returns() +func (_DelayedVetoable *DelayedVetoableSession) Fallback(calldata []byte) (*types.Transaction, error) { + return _DelayedVetoable.Contract.Fallback(&_DelayedVetoable.TransactOpts, calldata) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() returns() +func (_DelayedVetoable *DelayedVetoableTransactorSession) Fallback(calldata []byte) (*types.Transaction, error) { + return _DelayedVetoable.Contract.Fallback(&_DelayedVetoable.TransactOpts, calldata) +} + +// DelayedVetoableDelayActivatedIterator is returned from FilterDelayActivated and is used to iterate over the raw logs and unpacked data for DelayActivated events raised by the DelayedVetoable contract. +type DelayedVetoableDelayActivatedIterator struct { + Event *DelayedVetoableDelayActivated // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *DelayedVetoableDelayActivatedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(DelayedVetoableDelayActivated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(DelayedVetoableDelayActivated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *DelayedVetoableDelayActivatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *DelayedVetoableDelayActivatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// DelayedVetoableDelayActivated represents a DelayActivated event raised by the DelayedVetoable contract. +type DelayedVetoableDelayActivated struct { + Delay *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterDelayActivated is a free log retrieval operation binding the contract event 0xebf28bfb587e28dfffd9173cf71c32ba5d3f0544a0117b5539c9b274a5bba2a8. +// +// Solidity: event DelayActivated(uint256 delay) +func (_DelayedVetoable *DelayedVetoableFilterer) FilterDelayActivated(opts *bind.FilterOpts) (*DelayedVetoableDelayActivatedIterator, error) { + + logs, sub, err := _DelayedVetoable.contract.FilterLogs(opts, "DelayActivated") + if err != nil { + return nil, err + } + return &DelayedVetoableDelayActivatedIterator{contract: _DelayedVetoable.contract, event: "DelayActivated", logs: logs, sub: sub}, nil +} + +// WatchDelayActivated is a free log subscription operation binding the contract event 0xebf28bfb587e28dfffd9173cf71c32ba5d3f0544a0117b5539c9b274a5bba2a8. +// +// Solidity: event DelayActivated(uint256 delay) +func (_DelayedVetoable *DelayedVetoableFilterer) WatchDelayActivated(opts *bind.WatchOpts, sink chan<- *DelayedVetoableDelayActivated) (event.Subscription, error) { + + logs, sub, err := _DelayedVetoable.contract.WatchLogs(opts, "DelayActivated") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(DelayedVetoableDelayActivated) + if err := _DelayedVetoable.contract.UnpackLog(event, "DelayActivated", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseDelayActivated is a log parse operation binding the contract event 0xebf28bfb587e28dfffd9173cf71c32ba5d3f0544a0117b5539c9b274a5bba2a8. +// +// Solidity: event DelayActivated(uint256 delay) +func (_DelayedVetoable *DelayedVetoableFilterer) ParseDelayActivated(log types.Log) (*DelayedVetoableDelayActivated, error) { + event := new(DelayedVetoableDelayActivated) + if err := _DelayedVetoable.contract.UnpackLog(event, "DelayActivated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// DelayedVetoableForwardedIterator is returned from FilterForwarded and is used to iterate over the raw logs and unpacked data for Forwarded events raised by the DelayedVetoable contract. +type DelayedVetoableForwardedIterator struct { + Event *DelayedVetoableForwarded // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *DelayedVetoableForwardedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(DelayedVetoableForwarded) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(DelayedVetoableForwarded) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *DelayedVetoableForwardedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *DelayedVetoableForwardedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// DelayedVetoableForwarded represents a Forwarded event raised by the DelayedVetoable contract. +type DelayedVetoableForwarded struct { + CallHash [32]byte + Data []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterForwarded is a free log retrieval operation binding the contract event 0x4c109d85bcd0bb5c735b4be850953d652afe4cd9aa2e0b1426a65a4dcb2e1229. +// +// Solidity: event Forwarded(bytes32 indexed callHash, bytes data) +func (_DelayedVetoable *DelayedVetoableFilterer) FilterForwarded(opts *bind.FilterOpts, callHash [][32]byte) (*DelayedVetoableForwardedIterator, error) { + + var callHashRule []interface{} + for _, callHashItem := range callHash { + callHashRule = append(callHashRule, callHashItem) + } + + logs, sub, err := _DelayedVetoable.contract.FilterLogs(opts, "Forwarded", callHashRule) + if err != nil { + return nil, err + } + return &DelayedVetoableForwardedIterator{contract: _DelayedVetoable.contract, event: "Forwarded", logs: logs, sub: sub}, nil +} + +// WatchForwarded is a free log subscription operation binding the contract event 0x4c109d85bcd0bb5c735b4be850953d652afe4cd9aa2e0b1426a65a4dcb2e1229. +// +// Solidity: event Forwarded(bytes32 indexed callHash, bytes data) +func (_DelayedVetoable *DelayedVetoableFilterer) WatchForwarded(opts *bind.WatchOpts, sink chan<- *DelayedVetoableForwarded, callHash [][32]byte) (event.Subscription, error) { + + var callHashRule []interface{} + for _, callHashItem := range callHash { + callHashRule = append(callHashRule, callHashItem) + } + + logs, sub, err := _DelayedVetoable.contract.WatchLogs(opts, "Forwarded", callHashRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(DelayedVetoableForwarded) + if err := _DelayedVetoable.contract.UnpackLog(event, "Forwarded", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseForwarded is a log parse operation binding the contract event 0x4c109d85bcd0bb5c735b4be850953d652afe4cd9aa2e0b1426a65a4dcb2e1229. +// +// Solidity: event Forwarded(bytes32 indexed callHash, bytes data) +func (_DelayedVetoable *DelayedVetoableFilterer) ParseForwarded(log types.Log) (*DelayedVetoableForwarded, error) { + event := new(DelayedVetoableForwarded) + if err := _DelayedVetoable.contract.UnpackLog(event, "Forwarded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// DelayedVetoableInitiatedIterator is returned from FilterInitiated and is used to iterate over the raw logs and unpacked data for Initiated events raised by the DelayedVetoable contract. +type DelayedVetoableInitiatedIterator struct { + Event *DelayedVetoableInitiated // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *DelayedVetoableInitiatedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(DelayedVetoableInitiated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(DelayedVetoableInitiated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *DelayedVetoableInitiatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *DelayedVetoableInitiatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// DelayedVetoableInitiated represents a Initiated event raised by the DelayedVetoable contract. +type DelayedVetoableInitiated struct { + CallHash [32]byte + Data []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInitiated is a free log retrieval operation binding the contract event 0x87a332a414acbc7da074543639ce7ae02ff1ea72e88379da9f261b080beb5a13. +// +// Solidity: event Initiated(bytes32 indexed callHash, bytes data) +func (_DelayedVetoable *DelayedVetoableFilterer) FilterInitiated(opts *bind.FilterOpts, callHash [][32]byte) (*DelayedVetoableInitiatedIterator, error) { + + var callHashRule []interface{} + for _, callHashItem := range callHash { + callHashRule = append(callHashRule, callHashItem) + } + + logs, sub, err := _DelayedVetoable.contract.FilterLogs(opts, "Initiated", callHashRule) + if err != nil { + return nil, err + } + return &DelayedVetoableInitiatedIterator{contract: _DelayedVetoable.contract, event: "Initiated", logs: logs, sub: sub}, nil +} + +// WatchInitiated is a free log subscription operation binding the contract event 0x87a332a414acbc7da074543639ce7ae02ff1ea72e88379da9f261b080beb5a13. +// +// Solidity: event Initiated(bytes32 indexed callHash, bytes data) +func (_DelayedVetoable *DelayedVetoableFilterer) WatchInitiated(opts *bind.WatchOpts, sink chan<- *DelayedVetoableInitiated, callHash [][32]byte) (event.Subscription, error) { + + var callHashRule []interface{} + for _, callHashItem := range callHash { + callHashRule = append(callHashRule, callHashItem) + } + + logs, sub, err := _DelayedVetoable.contract.WatchLogs(opts, "Initiated", callHashRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(DelayedVetoableInitiated) + if err := _DelayedVetoable.contract.UnpackLog(event, "Initiated", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseInitiated is a log parse operation binding the contract event 0x87a332a414acbc7da074543639ce7ae02ff1ea72e88379da9f261b080beb5a13. +// +// Solidity: event Initiated(bytes32 indexed callHash, bytes data) +func (_DelayedVetoable *DelayedVetoableFilterer) ParseInitiated(log types.Log) (*DelayedVetoableInitiated, error) { + event := new(DelayedVetoableInitiated) + if err := _DelayedVetoable.contract.UnpackLog(event, "Initiated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// DelayedVetoableVetoedIterator is returned from FilterVetoed and is used to iterate over the raw logs and unpacked data for Vetoed events raised by the DelayedVetoable contract. +type DelayedVetoableVetoedIterator struct { + Event *DelayedVetoableVetoed // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *DelayedVetoableVetoedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(DelayedVetoableVetoed) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(DelayedVetoableVetoed) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *DelayedVetoableVetoedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *DelayedVetoableVetoedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// DelayedVetoableVetoed represents a Vetoed event raised by the DelayedVetoable contract. +type DelayedVetoableVetoed struct { + CallHash [32]byte + Data []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterVetoed is a free log retrieval operation binding the contract event 0xbede6852c1d97d93ff557f676de76670cd0dec861e7fe8beb13aa0ba2b0ab040. +// +// Solidity: event Vetoed(bytes32 indexed callHash, bytes data) +func (_DelayedVetoable *DelayedVetoableFilterer) FilterVetoed(opts *bind.FilterOpts, callHash [][32]byte) (*DelayedVetoableVetoedIterator, error) { + + var callHashRule []interface{} + for _, callHashItem := range callHash { + callHashRule = append(callHashRule, callHashItem) + } + + logs, sub, err := _DelayedVetoable.contract.FilterLogs(opts, "Vetoed", callHashRule) + if err != nil { + return nil, err + } + return &DelayedVetoableVetoedIterator{contract: _DelayedVetoable.contract, event: "Vetoed", logs: logs, sub: sub}, nil +} + +// WatchVetoed is a free log subscription operation binding the contract event 0xbede6852c1d97d93ff557f676de76670cd0dec861e7fe8beb13aa0ba2b0ab040. +// +// Solidity: event Vetoed(bytes32 indexed callHash, bytes data) +func (_DelayedVetoable *DelayedVetoableFilterer) WatchVetoed(opts *bind.WatchOpts, sink chan<- *DelayedVetoableVetoed, callHash [][32]byte) (event.Subscription, error) { + + var callHashRule []interface{} + for _, callHashItem := range callHash { + callHashRule = append(callHashRule, callHashItem) + } + + logs, sub, err := _DelayedVetoable.contract.WatchLogs(opts, "Vetoed", callHashRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(DelayedVetoableVetoed) + if err := _DelayedVetoable.contract.UnpackLog(event, "Vetoed", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseVetoed is a log parse operation binding the contract event 0xbede6852c1d97d93ff557f676de76670cd0dec861e7fe8beb13aa0ba2b0ab040. +// +// Solidity: event Vetoed(bytes32 indexed callHash, bytes data) +func (_DelayedVetoable *DelayedVetoableFilterer) ParseVetoed(log types.Log) (*DelayedVetoableVetoed, error) { + event := new(DelayedVetoableVetoed) + if err := _DelayedVetoable.contract.UnpackLog(event, "Vetoed", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/op-e2e2/bindings/delayedweth.go b/op-e2e2/bindings/delayedweth.go new file mode 100644 index 000000000000..0b1c69a953df --- /dev/null +++ b/op-e2e2/bindings/delayedweth.go @@ -0,0 +1,1881 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// DelayedWETHMetaData contains all meta data concerning the DelayedWETH contract. +var DelayedWETHMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_delay\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"fallback\",\"stateMutability\":\"payable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"allowance\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"approve\",\"inputs\":[{\"name\":\"guy\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"wad\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"balanceOf\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"config\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractSuperchainConfig\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"decimals\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"delay\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"deposit\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"hold\",\"inputs\":[{\"name\":\"_guy\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_wad\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_config\",\"type\":\"address\",\"internalType\":\"contractSuperchainConfig\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"name\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"recover\",\"inputs\":[{\"name\":\"_wad\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"symbol\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"totalSupply\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"transfer\",\"inputs\":[{\"name\":\"dst\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"wad\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferFrom\",\"inputs\":[{\"name\":\"src\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"dst\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"wad\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"unlock\",\"inputs\":[{\"name\":\"_guy\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_wad\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"withdraw\",\"inputs\":[{\"name\":\"_wad\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdraw\",\"inputs\":[{\"name\":\"_guy\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_wad\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawals\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"timestamp\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"Approval\",\"inputs\":[{\"name\":\"src\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"guy\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"wad\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Deposit\",\"inputs\":[{\"name\":\"dst\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"wad\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Transfer\",\"inputs\":[{\"name\":\"src\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"dst\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"wad\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Unwrap\",\"inputs\":[{\"name\":\"src\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"wad\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Withdrawal\",\"inputs\":[{\"name\":\"src\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"wad\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false}]", + Bin: "0x60a06040523480156200001157600080fd5b50604051620018aa380380620018aa8339810160408190526200003491620002d7565b6080819052620000466000806200004d565b50620002f1565b600054610100900460ff16158080156200006e5750600054600160ff909116105b806200009e57506200008b30620001a760201b6200107f1760201c565b1580156200009e575060005460ff166001145b620001075760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff1916600117905580156200012b576000805461ff0019166101001790555b62000135620001b6565b62000140836200021e565b606880546001600160a01b0319166001600160a01b0384161790558015620001a2576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b6001600160a01b03163b151590565b600054610100900460ff16620002125760405162461bcd60e51b815260206004820152602b60248201526000805160206200188a83398151915260448201526a6e697469616c697a696e6760a81b6064820152608401620000fe565b6200021c62000270565b565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff16620002cc5760405162461bcd60e51b815260206004820152602b60248201526000805160206200188a83398151915260448201526a6e697469616c697a696e6760a81b6064820152608401620000fe565b6200021c336200021e565b600060208284031215620002ea57600080fd5b5051919050565b608051611576620003146000396000818161033f0152610fa001526115766000f3fe6080604052600436106101845760003560e01c8063715018a6116100d6578063a9059cbb1161007f578063dd62ed3e11610059578063dd62ed3e1461051c578063f2fde38b14610554578063f3fef3a31461057457610193565b8063a9059cbb146104a8578063cd47bde1146104c8578063d0e30db01461019357610193565b80638da5cb5b116100b05780638da5cb5b1461041757806395d89b4114610442578063977a5ec51461048857610193565b8063715018a61461039057806379502c55146103a55780637eee288d146103f757610193565b80632e1a7d4d1161013857806354fd4d501161011257806354fd4d50146102e75780636a42b8f81461033057806370a082311461036357610193565b80632e1a7d4d14610280578063313ce567146102a0578063485cc955146102c757610193565b80630ca35682116101695780630ca356821461022357806318160ddd1461024357806323b872dd1461026057610193565b806306fdde031461019b578063095ea7b3146101f357610193565b3661019357610191610594565b005b610191610594565b3480156101a757600080fd5b5060408051808201909152600d81527f577261707065642045746865720000000000000000000000000000000000000060208201525b6040516101ea9190611378565b60405180910390f35b3480156101ff57600080fd5b5061021361020e36600461140d565b6105ef565b60405190151581526020016101ea565b34801561022f57600080fd5b5061019161023e366004611439565b610668565b34801561024f57600080fd5b50475b6040519081526020016101ea565b34801561026c57600080fd5b5061021361027b366004611452565b610734565b34801561028c57600080fd5b5061019161029b366004611439565b61094b565b3480156102ac57600080fd5b506102b5601281565b60405160ff90911681526020016101ea565b3480156102d357600080fd5b506101916102e2366004611493565b610958565b3480156102f357600080fd5b506101dd6040518060400160405280600581526020017f302e322e3000000000000000000000000000000000000000000000000000000081525081565b34801561033c57600080fd5b507f0000000000000000000000000000000000000000000000000000000000000000610252565b34801561036f57600080fd5b5061025261037e3660046114cc565b60656020526000908152604090205481565b34801561039c57600080fd5b50610191610b34565b3480156103b157600080fd5b506068546103d29073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101ea565b34801561040357600080fd5b5061019161041236600461140d565b610b48565b34801561042357600080fd5b5060335473ffffffffffffffffffffffffffffffffffffffff166103d2565b34801561044e57600080fd5b5060408051808201909152600481527f574554480000000000000000000000000000000000000000000000000000000060208201526101dd565b34801561049457600080fd5b506101916104a336600461140d565b610b9c565b3480156104b457600080fd5b506102136104c336600461140d565b610c89565b3480156104d457600080fd5b506105076104e3366004611493565b60676020908152600092835260408084209091529082529020805460019091015482565b604080519283526020830191909152016101ea565b34801561052857600080fd5b50610252610537366004611493565b606660209081526000928352604080842090915290825290205481565b34801561056057600080fd5b5061019161056f3660046114cc565b610c9d565b34801561058057600080fd5b5061019161058f36600461140d565b610d51565b33600090815260656020526040812080543492906105b3908490611518565b909155505060405134815233907fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9060200160405180910390a2565b33600081815260666020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906106579086815260200190565b60405180910390a350600192915050565b60335473ffffffffffffffffffffffffffffffffffffffff1633146106ee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f44656c61796564574554483a206e6f74206f776e65720000000000000000000060448201526064015b60405180910390fd5b60004782106106fd57476106ff565b815b604051909150339082156108fc029083906000818181858888f1935050505015801561072f573d6000803e3d6000fd5b505050565b73ffffffffffffffffffffffffffffffffffffffff831660009081526065602052604081205482111561076657600080fd5b73ffffffffffffffffffffffffffffffffffffffff841633148015906107dc575073ffffffffffffffffffffffffffffffffffffffff841660009081526066602090815260408083203384529091529020547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14155b156108645773ffffffffffffffffffffffffffffffffffffffff8416600090815260666020908152604080832033845290915290205482111561081e57600080fd5b73ffffffffffffffffffffffffffffffffffffffff841660009081526066602090815260408083203384529091528120805484929061085e908490611530565b90915550505b73ffffffffffffffffffffffffffffffffffffffff841660009081526065602052604081208054849290610899908490611530565b909155505073ffffffffffffffffffffffffffffffffffffffff8316600090815260656020526040812080548492906108d3908490611518565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161093991815260200190565b60405180910390a35060019392505050565b6109553382610d51565b50565b600054610100900460ff16158080156109785750600054600160ff909116105b806109925750303b158015610992575060005460ff166001145b610a1e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016106e5565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015610a7c57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b610a8461109b565b610a8d8361113a565b606880547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8416179055801561072f57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b610b3c6111b1565b610b46600061113a565b565b33600090815260676020908152604080832073ffffffffffffffffffffffffffffffffffffffff861684529091528120426001820155805490918391839190610b92908490611518565b9091555050505050565b60335473ffffffffffffffffffffffffffffffffffffffff163314610c1d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f44656c61796564574554483a206e6f74206f776e65720000000000000000000060448201526064016106e5565b73ffffffffffffffffffffffffffffffffffffffff821660008181526066602090815260408083203380855290835292819020859055518481529192917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a35050565b6000610c96338484610734565b9392505050565b610ca56111b1565b73ffffffffffffffffffffffffffffffffffffffff8116610d48576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016106e5565b6109558161113a565b606860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610dbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de29190611547565b15610e49576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f44656c61796564574554483a20636f6e7472616374206973207061757365640060448201526064016106e5565b33600090815260676020908152604080832073ffffffffffffffffffffffffffffffffffffffff8616845290915290208054821115610f0a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f44656c61796564574554483a20696e73756666696369656e7420756e6c6f636b60448201527f6564207769746864726177616c0000000000000000000000000000000000000060648201526084016106e5565b6000816001015411610f9d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f44656c61796564574554483a207769746864726177616c206e6f7420756e6c6f60448201527f636b65640000000000000000000000000000000000000000000000000000000060648201526084016106e5565b427f00000000000000000000000000000000000000000000000000000000000000008260010154610fce9190611518565b111561105c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f44656c61796564574554483a207769746864726177616c2064656c6179206e6f60448201527f74206d657400000000000000000000000000000000000000000000000000000060648201526084016106e5565b818160000160008282546110709190611530565b9091555061072f905082611232565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b600054610100900460ff16611132576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016106e5565b610b466112d8565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60335473ffffffffffffffffffffffffffffffffffffffff163314610b46576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106e5565b3360009081526065602052604090205481111561124e57600080fd5b336000908152606560205260408120805483929061126d908490611530565b9091555050604051339082156108fc029083906000818181858888f1935050505015801561129f573d6000803e3d6000fd5b5060405181815233907f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b659060200160405180910390a250565b600054610100900460ff1661136f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016106e5565b610b463361113a565b600060208083528351808285015260005b818110156113a557858101830151858201604001528201611389565b818111156113b7576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b73ffffffffffffffffffffffffffffffffffffffff8116811461095557600080fd5b6000806040838503121561142057600080fd5b823561142b816113eb565b946020939093013593505050565b60006020828403121561144b57600080fd5b5035919050565b60008060006060848603121561146757600080fd5b8335611472816113eb565b92506020840135611482816113eb565b929592945050506040919091013590565b600080604083850312156114a657600080fd5b82356114b1816113eb565b915060208301356114c1816113eb565b809150509250929050565b6000602082840312156114de57600080fd5b8135610c96816113eb565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000821982111561152b5761152b6114e9565b500190565b600082821015611542576115426114e9565b500390565b60006020828403121561155957600080fd5b81518015158114610c9657600080fdfea164736f6c634300080f000a496e697469616c697a61626c653a20636f6e7472616374206973206e6f742069", +} + +// DelayedWETHABI is the input ABI used to generate the binding from. +// Deprecated: Use DelayedWETHMetaData.ABI instead. +var DelayedWETHABI = DelayedWETHMetaData.ABI + +// DelayedWETHBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use DelayedWETHMetaData.Bin instead. +var DelayedWETHBin = DelayedWETHMetaData.Bin + +// DeployDelayedWETH deploys a new Ethereum contract, binding an instance of DelayedWETH to it. +func DeployDelayedWETH(auth *bind.TransactOpts, backend bind.ContractBackend, _delay *big.Int) (common.Address, *types.Transaction, *DelayedWETH, error) { + parsed, err := DelayedWETHMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(DelayedWETHBin), backend, _delay) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &DelayedWETH{DelayedWETHCaller: DelayedWETHCaller{contract: contract}, DelayedWETHTransactor: DelayedWETHTransactor{contract: contract}, DelayedWETHFilterer: DelayedWETHFilterer{contract: contract}}, nil +} + +// DelayedWETH is an auto generated Go binding around an Ethereum contract. +type DelayedWETH struct { + DelayedWETHCaller // Read-only binding to the contract + DelayedWETHTransactor // Write-only binding to the contract + DelayedWETHFilterer // Log filterer for contract events +} + +// DelayedWETHCaller is an auto generated read-only Go binding around an Ethereum contract. +type DelayedWETHCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// DelayedWETHTransactor is an auto generated write-only Go binding around an Ethereum contract. +type DelayedWETHTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// DelayedWETHFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type DelayedWETHFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// DelayedWETHSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type DelayedWETHSession struct { + Contract *DelayedWETH // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// DelayedWETHCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type DelayedWETHCallerSession struct { + Contract *DelayedWETHCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// DelayedWETHTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type DelayedWETHTransactorSession struct { + Contract *DelayedWETHTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// DelayedWETHRaw is an auto generated low-level Go binding around an Ethereum contract. +type DelayedWETHRaw struct { + Contract *DelayedWETH // Generic contract binding to access the raw methods on +} + +// DelayedWETHCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type DelayedWETHCallerRaw struct { + Contract *DelayedWETHCaller // Generic read-only contract binding to access the raw methods on +} + +// DelayedWETHTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type DelayedWETHTransactorRaw struct { + Contract *DelayedWETHTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewDelayedWETH creates a new instance of DelayedWETH, bound to a specific deployed contract. +func NewDelayedWETH(address common.Address, backend bind.ContractBackend) (*DelayedWETH, error) { + contract, err := bindDelayedWETH(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &DelayedWETH{DelayedWETHCaller: DelayedWETHCaller{contract: contract}, DelayedWETHTransactor: DelayedWETHTransactor{contract: contract}, DelayedWETHFilterer: DelayedWETHFilterer{contract: contract}}, nil +} + +// NewDelayedWETHCaller creates a new read-only instance of DelayedWETH, bound to a specific deployed contract. +func NewDelayedWETHCaller(address common.Address, caller bind.ContractCaller) (*DelayedWETHCaller, error) { + contract, err := bindDelayedWETH(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &DelayedWETHCaller{contract: contract}, nil +} + +// NewDelayedWETHTransactor creates a new write-only instance of DelayedWETH, bound to a specific deployed contract. +func NewDelayedWETHTransactor(address common.Address, transactor bind.ContractTransactor) (*DelayedWETHTransactor, error) { + contract, err := bindDelayedWETH(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &DelayedWETHTransactor{contract: contract}, nil +} + +// NewDelayedWETHFilterer creates a new log filterer instance of DelayedWETH, bound to a specific deployed contract. +func NewDelayedWETHFilterer(address common.Address, filterer bind.ContractFilterer) (*DelayedWETHFilterer, error) { + contract, err := bindDelayedWETH(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &DelayedWETHFilterer{contract: contract}, nil +} + +// bindDelayedWETH binds a generic wrapper to an already deployed contract. +func bindDelayedWETH(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(DelayedWETHABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_DelayedWETH *DelayedWETHRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _DelayedWETH.Contract.DelayedWETHCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_DelayedWETH *DelayedWETHRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DelayedWETH.Contract.DelayedWETHTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_DelayedWETH *DelayedWETHRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _DelayedWETH.Contract.DelayedWETHTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_DelayedWETH *DelayedWETHCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _DelayedWETH.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_DelayedWETH *DelayedWETHTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DelayedWETH.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_DelayedWETH *DelayedWETHTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _DelayedWETH.Contract.contract.Transact(opts, method, params...) +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address , address ) view returns(uint256) +func (_DelayedWETH *DelayedWETHCaller) Allowance(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address) (*big.Int, error) { + var out []interface{} + err := _DelayedWETH.contract.Call(opts, &out, "allowance", arg0, arg1) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address , address ) view returns(uint256) +func (_DelayedWETH *DelayedWETHSession) Allowance(arg0 common.Address, arg1 common.Address) (*big.Int, error) { + return _DelayedWETH.Contract.Allowance(&_DelayedWETH.CallOpts, arg0, arg1) +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address , address ) view returns(uint256) +func (_DelayedWETH *DelayedWETHCallerSession) Allowance(arg0 common.Address, arg1 common.Address) (*big.Int, error) { + return _DelayedWETH.Contract.Allowance(&_DelayedWETH.CallOpts, arg0, arg1) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address ) view returns(uint256) +func (_DelayedWETH *DelayedWETHCaller) BalanceOf(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { + var out []interface{} + err := _DelayedWETH.contract.Call(opts, &out, "balanceOf", arg0) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address ) view returns(uint256) +func (_DelayedWETH *DelayedWETHSession) BalanceOf(arg0 common.Address) (*big.Int, error) { + return _DelayedWETH.Contract.BalanceOf(&_DelayedWETH.CallOpts, arg0) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address ) view returns(uint256) +func (_DelayedWETH *DelayedWETHCallerSession) BalanceOf(arg0 common.Address) (*big.Int, error) { + return _DelayedWETH.Contract.BalanceOf(&_DelayedWETH.CallOpts, arg0) +} + +// Config is a free data retrieval call binding the contract method 0x79502c55. +// +// Solidity: function config() view returns(address) +func (_DelayedWETH *DelayedWETHCaller) Config(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _DelayedWETH.contract.Call(opts, &out, "config") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Config is a free data retrieval call binding the contract method 0x79502c55. +// +// Solidity: function config() view returns(address) +func (_DelayedWETH *DelayedWETHSession) Config() (common.Address, error) { + return _DelayedWETH.Contract.Config(&_DelayedWETH.CallOpts) +} + +// Config is a free data retrieval call binding the contract method 0x79502c55. +// +// Solidity: function config() view returns(address) +func (_DelayedWETH *DelayedWETHCallerSession) Config() (common.Address, error) { + return _DelayedWETH.Contract.Config(&_DelayedWETH.CallOpts) +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_DelayedWETH *DelayedWETHCaller) Decimals(opts *bind.CallOpts) (uint8, error) { + var out []interface{} + err := _DelayedWETH.contract.Call(opts, &out, "decimals") + + if err != nil { + return *new(uint8), err + } + + out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) + + return out0, err + +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_DelayedWETH *DelayedWETHSession) Decimals() (uint8, error) { + return _DelayedWETH.Contract.Decimals(&_DelayedWETH.CallOpts) +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_DelayedWETH *DelayedWETHCallerSession) Decimals() (uint8, error) { + return _DelayedWETH.Contract.Decimals(&_DelayedWETH.CallOpts) +} + +// Delay is a free data retrieval call binding the contract method 0x6a42b8f8. +// +// Solidity: function delay() view returns(uint256) +func (_DelayedWETH *DelayedWETHCaller) Delay(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _DelayedWETH.contract.Call(opts, &out, "delay") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Delay is a free data retrieval call binding the contract method 0x6a42b8f8. +// +// Solidity: function delay() view returns(uint256) +func (_DelayedWETH *DelayedWETHSession) Delay() (*big.Int, error) { + return _DelayedWETH.Contract.Delay(&_DelayedWETH.CallOpts) +} + +// Delay is a free data retrieval call binding the contract method 0x6a42b8f8. +// +// Solidity: function delay() view returns(uint256) +func (_DelayedWETH *DelayedWETHCallerSession) Delay() (*big.Int, error) { + return _DelayedWETH.Contract.Delay(&_DelayedWETH.CallOpts) +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_DelayedWETH *DelayedWETHCaller) Name(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _DelayedWETH.contract.Call(opts, &out, "name") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_DelayedWETH *DelayedWETHSession) Name() (string, error) { + return _DelayedWETH.Contract.Name(&_DelayedWETH.CallOpts) +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_DelayedWETH *DelayedWETHCallerSession) Name() (string, error) { + return _DelayedWETH.Contract.Name(&_DelayedWETH.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_DelayedWETH *DelayedWETHCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _DelayedWETH.contract.Call(opts, &out, "owner") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_DelayedWETH *DelayedWETHSession) Owner() (common.Address, error) { + return _DelayedWETH.Contract.Owner(&_DelayedWETH.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_DelayedWETH *DelayedWETHCallerSession) Owner() (common.Address, error) { + return _DelayedWETH.Contract.Owner(&_DelayedWETH.CallOpts) +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_DelayedWETH *DelayedWETHCaller) Symbol(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _DelayedWETH.contract.Call(opts, &out, "symbol") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_DelayedWETH *DelayedWETHSession) Symbol() (string, error) { + return _DelayedWETH.Contract.Symbol(&_DelayedWETH.CallOpts) +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_DelayedWETH *DelayedWETHCallerSession) Symbol() (string, error) { + return _DelayedWETH.Contract.Symbol(&_DelayedWETH.CallOpts) +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_DelayedWETH *DelayedWETHCaller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _DelayedWETH.contract.Call(opts, &out, "totalSupply") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_DelayedWETH *DelayedWETHSession) TotalSupply() (*big.Int, error) { + return _DelayedWETH.Contract.TotalSupply(&_DelayedWETH.CallOpts) +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_DelayedWETH *DelayedWETHCallerSession) TotalSupply() (*big.Int, error) { + return _DelayedWETH.Contract.TotalSupply(&_DelayedWETH.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_DelayedWETH *DelayedWETHCaller) Version(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _DelayedWETH.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 (_DelayedWETH *DelayedWETHSession) Version() (string, error) { + return _DelayedWETH.Contract.Version(&_DelayedWETH.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_DelayedWETH *DelayedWETHCallerSession) Version() (string, error) { + return _DelayedWETH.Contract.Version(&_DelayedWETH.CallOpts) +} + +// Withdrawals is a free data retrieval call binding the contract method 0xcd47bde1. +// +// Solidity: function withdrawals(address , address ) view returns(uint256 amount, uint256 timestamp) +func (_DelayedWETH *DelayedWETHCaller) Withdrawals(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address) (struct { + Amount *big.Int + Timestamp *big.Int +}, error) { + var out []interface{} + err := _DelayedWETH.contract.Call(opts, &out, "withdrawals", arg0, arg1) + + outstruct := new(struct { + Amount *big.Int + Timestamp *big.Int + }) + if err != nil { + return *outstruct, err + } + + outstruct.Amount = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + outstruct.Timestamp = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + + return *outstruct, err + +} + +// Withdrawals is a free data retrieval call binding the contract method 0xcd47bde1. +// +// Solidity: function withdrawals(address , address ) view returns(uint256 amount, uint256 timestamp) +func (_DelayedWETH *DelayedWETHSession) Withdrawals(arg0 common.Address, arg1 common.Address) (struct { + Amount *big.Int + Timestamp *big.Int +}, error) { + return _DelayedWETH.Contract.Withdrawals(&_DelayedWETH.CallOpts, arg0, arg1) +} + +// Withdrawals is a free data retrieval call binding the contract method 0xcd47bde1. +// +// Solidity: function withdrawals(address , address ) view returns(uint256 amount, uint256 timestamp) +func (_DelayedWETH *DelayedWETHCallerSession) Withdrawals(arg0 common.Address, arg1 common.Address) (struct { + Amount *big.Int + Timestamp *big.Int +}, error) { + return _DelayedWETH.Contract.Withdrawals(&_DelayedWETH.CallOpts, arg0, arg1) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address guy, uint256 wad) returns(bool) +func (_DelayedWETH *DelayedWETHTransactor) Approve(opts *bind.TransactOpts, guy common.Address, wad *big.Int) (*types.Transaction, error) { + return _DelayedWETH.contract.Transact(opts, "approve", guy, wad) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address guy, uint256 wad) returns(bool) +func (_DelayedWETH *DelayedWETHSession) Approve(guy common.Address, wad *big.Int) (*types.Transaction, error) { + return _DelayedWETH.Contract.Approve(&_DelayedWETH.TransactOpts, guy, wad) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address guy, uint256 wad) returns(bool) +func (_DelayedWETH *DelayedWETHTransactorSession) Approve(guy common.Address, wad *big.Int) (*types.Transaction, error) { + return _DelayedWETH.Contract.Approve(&_DelayedWETH.TransactOpts, guy, wad) +} + +// Deposit is a paid mutator transaction binding the contract method 0xd0e30db0. +// +// Solidity: function deposit() payable returns() +func (_DelayedWETH *DelayedWETHTransactor) Deposit(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DelayedWETH.contract.Transact(opts, "deposit") +} + +// Deposit is a paid mutator transaction binding the contract method 0xd0e30db0. +// +// Solidity: function deposit() payable returns() +func (_DelayedWETH *DelayedWETHSession) Deposit() (*types.Transaction, error) { + return _DelayedWETH.Contract.Deposit(&_DelayedWETH.TransactOpts) +} + +// Deposit is a paid mutator transaction binding the contract method 0xd0e30db0. +// +// Solidity: function deposit() payable returns() +func (_DelayedWETH *DelayedWETHTransactorSession) Deposit() (*types.Transaction, error) { + return _DelayedWETH.Contract.Deposit(&_DelayedWETH.TransactOpts) +} + +// Hold is a paid mutator transaction binding the contract method 0x977a5ec5. +// +// Solidity: function hold(address _guy, uint256 _wad) returns() +func (_DelayedWETH *DelayedWETHTransactor) Hold(opts *bind.TransactOpts, _guy common.Address, _wad *big.Int) (*types.Transaction, error) { + return _DelayedWETH.contract.Transact(opts, "hold", _guy, _wad) +} + +// Hold is a paid mutator transaction binding the contract method 0x977a5ec5. +// +// Solidity: function hold(address _guy, uint256 _wad) returns() +func (_DelayedWETH *DelayedWETHSession) Hold(_guy common.Address, _wad *big.Int) (*types.Transaction, error) { + return _DelayedWETH.Contract.Hold(&_DelayedWETH.TransactOpts, _guy, _wad) +} + +// Hold is a paid mutator transaction binding the contract method 0x977a5ec5. +// +// Solidity: function hold(address _guy, uint256 _wad) returns() +func (_DelayedWETH *DelayedWETHTransactorSession) Hold(_guy common.Address, _wad *big.Int) (*types.Transaction, error) { + return _DelayedWETH.Contract.Hold(&_DelayedWETH.TransactOpts, _guy, _wad) +} + +// Initialize is a paid mutator transaction binding the contract method 0x485cc955. +// +// Solidity: function initialize(address _owner, address _config) returns() +func (_DelayedWETH *DelayedWETHTransactor) Initialize(opts *bind.TransactOpts, _owner common.Address, _config common.Address) (*types.Transaction, error) { + return _DelayedWETH.contract.Transact(opts, "initialize", _owner, _config) +} + +// Initialize is a paid mutator transaction binding the contract method 0x485cc955. +// +// Solidity: function initialize(address _owner, address _config) returns() +func (_DelayedWETH *DelayedWETHSession) Initialize(_owner common.Address, _config common.Address) (*types.Transaction, error) { + return _DelayedWETH.Contract.Initialize(&_DelayedWETH.TransactOpts, _owner, _config) +} + +// Initialize is a paid mutator transaction binding the contract method 0x485cc955. +// +// Solidity: function initialize(address _owner, address _config) returns() +func (_DelayedWETH *DelayedWETHTransactorSession) Initialize(_owner common.Address, _config common.Address) (*types.Transaction, error) { + return _DelayedWETH.Contract.Initialize(&_DelayedWETH.TransactOpts, _owner, _config) +} + +// Recover is a paid mutator transaction binding the contract method 0x0ca35682. +// +// Solidity: function recover(uint256 _wad) returns() +func (_DelayedWETH *DelayedWETHTransactor) Recover(opts *bind.TransactOpts, _wad *big.Int) (*types.Transaction, error) { + return _DelayedWETH.contract.Transact(opts, "recover", _wad) +} + +// Recover is a paid mutator transaction binding the contract method 0x0ca35682. +// +// Solidity: function recover(uint256 _wad) returns() +func (_DelayedWETH *DelayedWETHSession) Recover(_wad *big.Int) (*types.Transaction, error) { + return _DelayedWETH.Contract.Recover(&_DelayedWETH.TransactOpts, _wad) +} + +// Recover is a paid mutator transaction binding the contract method 0x0ca35682. +// +// Solidity: function recover(uint256 _wad) returns() +func (_DelayedWETH *DelayedWETHTransactorSession) Recover(_wad *big.Int) (*types.Transaction, error) { + return _DelayedWETH.Contract.Recover(&_DelayedWETH.TransactOpts, _wad) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_DelayedWETH *DelayedWETHTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DelayedWETH.contract.Transact(opts, "renounceOwnership") +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_DelayedWETH *DelayedWETHSession) RenounceOwnership() (*types.Transaction, error) { + return _DelayedWETH.Contract.RenounceOwnership(&_DelayedWETH.TransactOpts) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_DelayedWETH *DelayedWETHTransactorSession) RenounceOwnership() (*types.Transaction, error) { + return _DelayedWETH.Contract.RenounceOwnership(&_DelayedWETH.TransactOpts) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address dst, uint256 wad) returns(bool) +func (_DelayedWETH *DelayedWETHTransactor) Transfer(opts *bind.TransactOpts, dst common.Address, wad *big.Int) (*types.Transaction, error) { + return _DelayedWETH.contract.Transact(opts, "transfer", dst, wad) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address dst, uint256 wad) returns(bool) +func (_DelayedWETH *DelayedWETHSession) Transfer(dst common.Address, wad *big.Int) (*types.Transaction, error) { + return _DelayedWETH.Contract.Transfer(&_DelayedWETH.TransactOpts, dst, wad) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address dst, uint256 wad) returns(bool) +func (_DelayedWETH *DelayedWETHTransactorSession) Transfer(dst common.Address, wad *big.Int) (*types.Transaction, error) { + return _DelayedWETH.Contract.Transfer(&_DelayedWETH.TransactOpts, dst, wad) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address src, address dst, uint256 wad) returns(bool) +func (_DelayedWETH *DelayedWETHTransactor) TransferFrom(opts *bind.TransactOpts, src common.Address, dst common.Address, wad *big.Int) (*types.Transaction, error) { + return _DelayedWETH.contract.Transact(opts, "transferFrom", src, dst, wad) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address src, address dst, uint256 wad) returns(bool) +func (_DelayedWETH *DelayedWETHSession) TransferFrom(src common.Address, dst common.Address, wad *big.Int) (*types.Transaction, error) { + return _DelayedWETH.Contract.TransferFrom(&_DelayedWETH.TransactOpts, src, dst, wad) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address src, address dst, uint256 wad) returns(bool) +func (_DelayedWETH *DelayedWETHTransactorSession) TransferFrom(src common.Address, dst common.Address, wad *big.Int) (*types.Transaction, error) { + return _DelayedWETH.Contract.TransferFrom(&_DelayedWETH.TransactOpts, src, dst, wad) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_DelayedWETH *DelayedWETHTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { + return _DelayedWETH.contract.Transact(opts, "transferOwnership", newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_DelayedWETH *DelayedWETHSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _DelayedWETH.Contract.TransferOwnership(&_DelayedWETH.TransactOpts, newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_DelayedWETH *DelayedWETHTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _DelayedWETH.Contract.TransferOwnership(&_DelayedWETH.TransactOpts, newOwner) +} + +// Unlock is a paid mutator transaction binding the contract method 0x7eee288d. +// +// Solidity: function unlock(address _guy, uint256 _wad) returns() +func (_DelayedWETH *DelayedWETHTransactor) Unlock(opts *bind.TransactOpts, _guy common.Address, _wad *big.Int) (*types.Transaction, error) { + return _DelayedWETH.contract.Transact(opts, "unlock", _guy, _wad) +} + +// Unlock is a paid mutator transaction binding the contract method 0x7eee288d. +// +// Solidity: function unlock(address _guy, uint256 _wad) returns() +func (_DelayedWETH *DelayedWETHSession) Unlock(_guy common.Address, _wad *big.Int) (*types.Transaction, error) { + return _DelayedWETH.Contract.Unlock(&_DelayedWETH.TransactOpts, _guy, _wad) +} + +// Unlock is a paid mutator transaction binding the contract method 0x7eee288d. +// +// Solidity: function unlock(address _guy, uint256 _wad) returns() +func (_DelayedWETH *DelayedWETHTransactorSession) Unlock(_guy common.Address, _wad *big.Int) (*types.Transaction, error) { + return _DelayedWETH.Contract.Unlock(&_DelayedWETH.TransactOpts, _guy, _wad) +} + +// Withdraw is a paid mutator transaction binding the contract method 0x2e1a7d4d. +// +// Solidity: function withdraw(uint256 _wad) returns() +func (_DelayedWETH *DelayedWETHTransactor) Withdraw(opts *bind.TransactOpts, _wad *big.Int) (*types.Transaction, error) { + return _DelayedWETH.contract.Transact(opts, "withdraw", _wad) +} + +// Withdraw is a paid mutator transaction binding the contract method 0x2e1a7d4d. +// +// Solidity: function withdraw(uint256 _wad) returns() +func (_DelayedWETH *DelayedWETHSession) Withdraw(_wad *big.Int) (*types.Transaction, error) { + return _DelayedWETH.Contract.Withdraw(&_DelayedWETH.TransactOpts, _wad) +} + +// Withdraw is a paid mutator transaction binding the contract method 0x2e1a7d4d. +// +// Solidity: function withdraw(uint256 _wad) returns() +func (_DelayedWETH *DelayedWETHTransactorSession) Withdraw(_wad *big.Int) (*types.Transaction, error) { + return _DelayedWETH.Contract.Withdraw(&_DelayedWETH.TransactOpts, _wad) +} + +// Withdraw0 is a paid mutator transaction binding the contract method 0xf3fef3a3. +// +// Solidity: function withdraw(address _guy, uint256 _wad) returns() +func (_DelayedWETH *DelayedWETHTransactor) Withdraw0(opts *bind.TransactOpts, _guy common.Address, _wad *big.Int) (*types.Transaction, error) { + return _DelayedWETH.contract.Transact(opts, "withdraw0", _guy, _wad) +} + +// Withdraw0 is a paid mutator transaction binding the contract method 0xf3fef3a3. +// +// Solidity: function withdraw(address _guy, uint256 _wad) returns() +func (_DelayedWETH *DelayedWETHSession) Withdraw0(_guy common.Address, _wad *big.Int) (*types.Transaction, error) { + return _DelayedWETH.Contract.Withdraw0(&_DelayedWETH.TransactOpts, _guy, _wad) +} + +// Withdraw0 is a paid mutator transaction binding the contract method 0xf3fef3a3. +// +// Solidity: function withdraw(address _guy, uint256 _wad) returns() +func (_DelayedWETH *DelayedWETHTransactorSession) Withdraw0(_guy common.Address, _wad *big.Int) (*types.Transaction, error) { + return _DelayedWETH.Contract.Withdraw0(&_DelayedWETH.TransactOpts, _guy, _wad) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() payable returns() +func (_DelayedWETH *DelayedWETHTransactor) Fallback(opts *bind.TransactOpts, calldata []byte) (*types.Transaction, error) { + return _DelayedWETH.contract.RawTransact(opts, calldata) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() payable returns() +func (_DelayedWETH *DelayedWETHSession) Fallback(calldata []byte) (*types.Transaction, error) { + return _DelayedWETH.Contract.Fallback(&_DelayedWETH.TransactOpts, calldata) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() payable returns() +func (_DelayedWETH *DelayedWETHTransactorSession) Fallback(calldata []byte) (*types.Transaction, error) { + return _DelayedWETH.Contract.Fallback(&_DelayedWETH.TransactOpts, calldata) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_DelayedWETH *DelayedWETHTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DelayedWETH.contract.RawTransact(opts, nil) // calldata is disallowed for receive function +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_DelayedWETH *DelayedWETHSession) Receive() (*types.Transaction, error) { + return _DelayedWETH.Contract.Receive(&_DelayedWETH.TransactOpts) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_DelayedWETH *DelayedWETHTransactorSession) Receive() (*types.Transaction, error) { + return _DelayedWETH.Contract.Receive(&_DelayedWETH.TransactOpts) +} + +// DelayedWETHApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the DelayedWETH contract. +type DelayedWETHApprovalIterator struct { + Event *DelayedWETHApproval // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *DelayedWETHApprovalIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(DelayedWETHApproval) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(DelayedWETHApproval) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *DelayedWETHApprovalIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *DelayedWETHApprovalIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// DelayedWETHApproval represents a Approval event raised by the DelayedWETH contract. +type DelayedWETHApproval struct { + Src common.Address + Guy common.Address + Wad *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed src, address indexed guy, uint256 wad) +func (_DelayedWETH *DelayedWETHFilterer) FilterApproval(opts *bind.FilterOpts, src []common.Address, guy []common.Address) (*DelayedWETHApprovalIterator, error) { + + var srcRule []interface{} + for _, srcItem := range src { + srcRule = append(srcRule, srcItem) + } + var guyRule []interface{} + for _, guyItem := range guy { + guyRule = append(guyRule, guyItem) + } + + logs, sub, err := _DelayedWETH.contract.FilterLogs(opts, "Approval", srcRule, guyRule) + if err != nil { + return nil, err + } + return &DelayedWETHApprovalIterator{contract: _DelayedWETH.contract, event: "Approval", logs: logs, sub: sub}, nil +} + +// WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed src, address indexed guy, uint256 wad) +func (_DelayedWETH *DelayedWETHFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *DelayedWETHApproval, src []common.Address, guy []common.Address) (event.Subscription, error) { + + var srcRule []interface{} + for _, srcItem := range src { + srcRule = append(srcRule, srcItem) + } + var guyRule []interface{} + for _, guyItem := range guy { + guyRule = append(guyRule, guyItem) + } + + logs, sub, err := _DelayedWETH.contract.WatchLogs(opts, "Approval", srcRule, guyRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(DelayedWETHApproval) + if err := _DelayedWETH.contract.UnpackLog(event, "Approval", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed src, address indexed guy, uint256 wad) +func (_DelayedWETH *DelayedWETHFilterer) ParseApproval(log types.Log) (*DelayedWETHApproval, error) { + event := new(DelayedWETHApproval) + if err := _DelayedWETH.contract.UnpackLog(event, "Approval", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// DelayedWETHDepositIterator is returned from FilterDeposit and is used to iterate over the raw logs and unpacked data for Deposit events raised by the DelayedWETH contract. +type DelayedWETHDepositIterator struct { + Event *DelayedWETHDeposit // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *DelayedWETHDepositIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(DelayedWETHDeposit) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(DelayedWETHDeposit) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *DelayedWETHDepositIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *DelayedWETHDepositIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// DelayedWETHDeposit represents a Deposit event raised by the DelayedWETH contract. +type DelayedWETHDeposit struct { + Dst common.Address + Wad *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterDeposit is a free log retrieval operation binding the contract event 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c. +// +// Solidity: event Deposit(address indexed dst, uint256 wad) +func (_DelayedWETH *DelayedWETHFilterer) FilterDeposit(opts *bind.FilterOpts, dst []common.Address) (*DelayedWETHDepositIterator, error) { + + var dstRule []interface{} + for _, dstItem := range dst { + dstRule = append(dstRule, dstItem) + } + + logs, sub, err := _DelayedWETH.contract.FilterLogs(opts, "Deposit", dstRule) + if err != nil { + return nil, err + } + return &DelayedWETHDepositIterator{contract: _DelayedWETH.contract, event: "Deposit", logs: logs, sub: sub}, nil +} + +// WatchDeposit is a free log subscription operation binding the contract event 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c. +// +// Solidity: event Deposit(address indexed dst, uint256 wad) +func (_DelayedWETH *DelayedWETHFilterer) WatchDeposit(opts *bind.WatchOpts, sink chan<- *DelayedWETHDeposit, dst []common.Address) (event.Subscription, error) { + + var dstRule []interface{} + for _, dstItem := range dst { + dstRule = append(dstRule, dstItem) + } + + logs, sub, err := _DelayedWETH.contract.WatchLogs(opts, "Deposit", dstRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(DelayedWETHDeposit) + if err := _DelayedWETH.contract.UnpackLog(event, "Deposit", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseDeposit is a log parse operation binding the contract event 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c. +// +// Solidity: event Deposit(address indexed dst, uint256 wad) +func (_DelayedWETH *DelayedWETHFilterer) ParseDeposit(log types.Log) (*DelayedWETHDeposit, error) { + event := new(DelayedWETHDeposit) + if err := _DelayedWETH.contract.UnpackLog(event, "Deposit", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// DelayedWETHInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the DelayedWETH contract. +type DelayedWETHInitializedIterator struct { + Event *DelayedWETHInitialized // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *DelayedWETHInitializedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(DelayedWETHInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(DelayedWETHInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *DelayedWETHInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *DelayedWETHInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// DelayedWETHInitialized represents a Initialized event raised by the DelayedWETH contract. +type DelayedWETHInitialized struct { + Version uint8 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_DelayedWETH *DelayedWETHFilterer) FilterInitialized(opts *bind.FilterOpts) (*DelayedWETHInitializedIterator, error) { + + logs, sub, err := _DelayedWETH.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &DelayedWETHInitializedIterator{contract: _DelayedWETH.contract, event: "Initialized", logs: logs, sub: sub}, nil +} + +// WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_DelayedWETH *DelayedWETHFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *DelayedWETHInitialized) (event.Subscription, error) { + + logs, sub, err := _DelayedWETH.contract.WatchLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(DelayedWETHInitialized) + if err := _DelayedWETH.contract.UnpackLog(event, "Initialized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_DelayedWETH *DelayedWETHFilterer) ParseInitialized(log types.Log) (*DelayedWETHInitialized, error) { + event := new(DelayedWETHInitialized) + if err := _DelayedWETH.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// DelayedWETHOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the DelayedWETH contract. +type DelayedWETHOwnershipTransferredIterator struct { + Event *DelayedWETHOwnershipTransferred // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *DelayedWETHOwnershipTransferredIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(DelayedWETHOwnershipTransferred) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(DelayedWETHOwnershipTransferred) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *DelayedWETHOwnershipTransferredIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *DelayedWETHOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// DelayedWETHOwnershipTransferred represents a OwnershipTransferred event raised by the DelayedWETH contract. +type DelayedWETHOwnershipTransferred struct { + PreviousOwner common.Address + NewOwner common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_DelayedWETH *DelayedWETHFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*DelayedWETHOwnershipTransferredIterator, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _DelayedWETH.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return &DelayedWETHOwnershipTransferredIterator{contract: _DelayedWETH.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_DelayedWETH *DelayedWETHFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *DelayedWETHOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _DelayedWETH.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(DelayedWETHOwnershipTransferred) + if err := _DelayedWETH.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_DelayedWETH *DelayedWETHFilterer) ParseOwnershipTransferred(log types.Log) (*DelayedWETHOwnershipTransferred, error) { + event := new(DelayedWETHOwnershipTransferred) + if err := _DelayedWETH.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// DelayedWETHTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the DelayedWETH contract. +type DelayedWETHTransferIterator struct { + Event *DelayedWETHTransfer // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *DelayedWETHTransferIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(DelayedWETHTransfer) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(DelayedWETHTransfer) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *DelayedWETHTransferIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *DelayedWETHTransferIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// DelayedWETHTransfer represents a Transfer event raised by the DelayedWETH contract. +type DelayedWETHTransfer struct { + Src common.Address + Dst common.Address + Wad *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed src, address indexed dst, uint256 wad) +func (_DelayedWETH *DelayedWETHFilterer) FilterTransfer(opts *bind.FilterOpts, src []common.Address, dst []common.Address) (*DelayedWETHTransferIterator, error) { + + var srcRule []interface{} + for _, srcItem := range src { + srcRule = append(srcRule, srcItem) + } + var dstRule []interface{} + for _, dstItem := range dst { + dstRule = append(dstRule, dstItem) + } + + logs, sub, err := _DelayedWETH.contract.FilterLogs(opts, "Transfer", srcRule, dstRule) + if err != nil { + return nil, err + } + return &DelayedWETHTransferIterator{contract: _DelayedWETH.contract, event: "Transfer", logs: logs, sub: sub}, nil +} + +// WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed src, address indexed dst, uint256 wad) +func (_DelayedWETH *DelayedWETHFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *DelayedWETHTransfer, src []common.Address, dst []common.Address) (event.Subscription, error) { + + var srcRule []interface{} + for _, srcItem := range src { + srcRule = append(srcRule, srcItem) + } + var dstRule []interface{} + for _, dstItem := range dst { + dstRule = append(dstRule, dstItem) + } + + logs, sub, err := _DelayedWETH.contract.WatchLogs(opts, "Transfer", srcRule, dstRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(DelayedWETHTransfer) + if err := _DelayedWETH.contract.UnpackLog(event, "Transfer", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed src, address indexed dst, uint256 wad) +func (_DelayedWETH *DelayedWETHFilterer) ParseTransfer(log types.Log) (*DelayedWETHTransfer, error) { + event := new(DelayedWETHTransfer) + if err := _DelayedWETH.contract.UnpackLog(event, "Transfer", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// DelayedWETHUnwrapIterator is returned from FilterUnwrap and is used to iterate over the raw logs and unpacked data for Unwrap events raised by the DelayedWETH contract. +type DelayedWETHUnwrapIterator struct { + Event *DelayedWETHUnwrap // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *DelayedWETHUnwrapIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(DelayedWETHUnwrap) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(DelayedWETHUnwrap) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *DelayedWETHUnwrapIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *DelayedWETHUnwrapIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// DelayedWETHUnwrap represents a Unwrap event raised by the DelayedWETH contract. +type DelayedWETHUnwrap struct { + Src common.Address + Wad *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterUnwrap is a free log retrieval operation binding the contract event 0x5dd085b6070b4cae004f84daafd199fd55b0bdfa11c3a802baffe89c2419d8c2. +// +// Solidity: event Unwrap(address indexed src, uint256 wad) +func (_DelayedWETH *DelayedWETHFilterer) FilterUnwrap(opts *bind.FilterOpts, src []common.Address) (*DelayedWETHUnwrapIterator, error) { + + var srcRule []interface{} + for _, srcItem := range src { + srcRule = append(srcRule, srcItem) + } + + logs, sub, err := _DelayedWETH.contract.FilterLogs(opts, "Unwrap", srcRule) + if err != nil { + return nil, err + } + return &DelayedWETHUnwrapIterator{contract: _DelayedWETH.contract, event: "Unwrap", logs: logs, sub: sub}, nil +} + +// WatchUnwrap is a free log subscription operation binding the contract event 0x5dd085b6070b4cae004f84daafd199fd55b0bdfa11c3a802baffe89c2419d8c2. +// +// Solidity: event Unwrap(address indexed src, uint256 wad) +func (_DelayedWETH *DelayedWETHFilterer) WatchUnwrap(opts *bind.WatchOpts, sink chan<- *DelayedWETHUnwrap, src []common.Address) (event.Subscription, error) { + + var srcRule []interface{} + for _, srcItem := range src { + srcRule = append(srcRule, srcItem) + } + + logs, sub, err := _DelayedWETH.contract.WatchLogs(opts, "Unwrap", srcRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(DelayedWETHUnwrap) + if err := _DelayedWETH.contract.UnpackLog(event, "Unwrap", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseUnwrap is a log parse operation binding the contract event 0x5dd085b6070b4cae004f84daafd199fd55b0bdfa11c3a802baffe89c2419d8c2. +// +// Solidity: event Unwrap(address indexed src, uint256 wad) +func (_DelayedWETH *DelayedWETHFilterer) ParseUnwrap(log types.Log) (*DelayedWETHUnwrap, error) { + event := new(DelayedWETHUnwrap) + if err := _DelayedWETH.contract.UnpackLog(event, "Unwrap", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// DelayedWETHWithdrawalIterator is returned from FilterWithdrawal and is used to iterate over the raw logs and unpacked data for Withdrawal events raised by the DelayedWETH contract. +type DelayedWETHWithdrawalIterator struct { + Event *DelayedWETHWithdrawal // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *DelayedWETHWithdrawalIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(DelayedWETHWithdrawal) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(DelayedWETHWithdrawal) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *DelayedWETHWithdrawalIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *DelayedWETHWithdrawalIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// DelayedWETHWithdrawal represents a Withdrawal event raised by the DelayedWETH contract. +type DelayedWETHWithdrawal struct { + Src common.Address + Wad *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterWithdrawal is a free log retrieval operation binding the contract event 0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65. +// +// Solidity: event Withdrawal(address indexed src, uint256 wad) +func (_DelayedWETH *DelayedWETHFilterer) FilterWithdrawal(opts *bind.FilterOpts, src []common.Address) (*DelayedWETHWithdrawalIterator, error) { + + var srcRule []interface{} + for _, srcItem := range src { + srcRule = append(srcRule, srcItem) + } + + logs, sub, err := _DelayedWETH.contract.FilterLogs(opts, "Withdrawal", srcRule) + if err != nil { + return nil, err + } + return &DelayedWETHWithdrawalIterator{contract: _DelayedWETH.contract, event: "Withdrawal", logs: logs, sub: sub}, nil +} + +// WatchWithdrawal is a free log subscription operation binding the contract event 0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65. +// +// Solidity: event Withdrawal(address indexed src, uint256 wad) +func (_DelayedWETH *DelayedWETHFilterer) WatchWithdrawal(opts *bind.WatchOpts, sink chan<- *DelayedWETHWithdrawal, src []common.Address) (event.Subscription, error) { + + var srcRule []interface{} + for _, srcItem := range src { + srcRule = append(srcRule, srcItem) + } + + logs, sub, err := _DelayedWETH.contract.WatchLogs(opts, "Withdrawal", srcRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(DelayedWETHWithdrawal) + if err := _DelayedWETH.contract.UnpackLog(event, "Withdrawal", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseWithdrawal is a log parse operation binding the contract event 0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65. +// +// Solidity: event Withdrawal(address indexed src, uint256 wad) +func (_DelayedWETH *DelayedWETHFilterer) ParseWithdrawal(log types.Log) (*DelayedWETHWithdrawal, error) { + event := new(DelayedWETHWithdrawal) + if err := _DelayedWETH.contract.UnpackLog(event, "Withdrawal", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/op-e2e2/bindings/deployerwhitelist.go b/op-e2e2/bindings/deployerwhitelist.go new file mode 100644 index 000000000000..f70892a12f7a --- /dev/null +++ b/op-e2e2/bindings/deployerwhitelist.go @@ -0,0 +1,793 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// DeployerWhitelistMetaData contains all meta data concerning the DeployerWhitelist contract. +var DeployerWhitelistMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"function\",\"name\":\"enableArbitraryContractDeployment\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"isDeployerAllowed\",\"inputs\":[{\"name\":\"_deployer\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"setOwner\",\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setWhitelistedDeployer\",\"inputs\":[{\"name\":\"_deployer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_isWhitelisted\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"whitelist\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"OwnerChanged\",\"inputs\":[{\"name\":\"oldOwner\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"WhitelistDisabled\",\"inputs\":[{\"name\":\"oldOwner\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"WhitelistStatusChanged\",\"inputs\":[{\"name\":\"deployer\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"whitelisted\",\"type\":\"bool\",\"indexed\":false,\"internalType\":\"bool\"}],\"anonymous\":false}]", + Bin: "0x608060405234801561001057600080fd5b506107bc806100206000396000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c80638da5cb5b1161005b5780638da5cb5b146100fc5780639b19251a14610141578063b1540a0114610174578063bdc7b54f1461018757600080fd5b806308fd63221461008257806313af40351461009757806354fd4d50146100aa575b600080fd5b6100956100903660046106de565b61018f565b005b6100956100a536600461071a565b6102ef565b6100e66040518060400160405280600581526020017f312e312e3000000000000000000000000000000000000000000000000000000081525081565b6040516100f3919061073c565b60405180910390f35b60005461011c9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100f3565b61016461014f36600461071a565b60016020526000908152604090205460ff1681565b60405190151581526020016100f3565b61016461018236600461071a565b610520565b610095610571565b60005473ffffffffffffffffffffffffffffffffffffffff163314610261576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604c60248201527f4465706c6f79657257686974656c6973743a2066756e6374696f6e2063616e2060448201527f6f6e6c792062652063616c6c656420627920746865206f776e6572206f66207460648201527f68697320636f6e74726163740000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff821660008181526001602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168515159081179091558251938452908301527f8daaf060c3306c38e068a75c054bf96ecd85a3db1252712c4d93632744c42e0d910160405180910390a15050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146103bc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604c60248201527f4465706c6f79657257686974656c6973743a2066756e6374696f6e2063616e2060448201527f6f6e6c792062652063616c6c656420627920746865206f776e6572206f66207460648201527f68697320636f6e74726163740000000000000000000000000000000000000000608482015260a401610258565b73ffffffffffffffffffffffffffffffffffffffff8116610485576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604d60248201527f4465706c6f79657257686974656c6973743a2063616e206f6e6c79206265206460448201527f697361626c65642076696120656e61626c65417262697472617279436f6e747260648201527f6163744465706c6f796d656e7400000000000000000000000000000000000000608482015260a401610258565b6000546040805173ffffffffffffffffffffffffffffffffffffffff928316815291831660208301527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c910160405180910390a1600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6000805473ffffffffffffffffffffffffffffffffffffffff16158061056b575073ffffffffffffffffffffffffffffffffffffffff821660009081526001602052604090205460ff165b92915050565b60005473ffffffffffffffffffffffffffffffffffffffff16331461063e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604c60248201527f4465706c6f79657257686974656c6973743a2066756e6374696f6e2063616e2060448201527f6f6e6c792062652063616c6c656420627920746865206f776e6572206f66207460648201527f68697320636f6e74726163740000000000000000000000000000000000000000608482015260a401610258565b60005460405173ffffffffffffffffffffffffffffffffffffffff90911681527fc0e106cf568e50698fdbde1eff56f5a5c966cc7958e37e276918e9e4ccdf8cd49060200160405180910390a1600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b803573ffffffffffffffffffffffffffffffffffffffff811681146106d957600080fd5b919050565b600080604083850312156106f157600080fd5b6106fa836106b5565b91506020830135801515811461070f57600080fd5b809150509250929050565b60006020828403121561072c57600080fd5b610735826106b5565b9392505050565b600060208083528351808285015260005b818110156107695785810183015185820160400152820161074d565b8181111561077b576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01692909201604001939250505056fea164736f6c634300080f000a", +} + +// DeployerWhitelistABI is the input ABI used to generate the binding from. +// Deprecated: Use DeployerWhitelistMetaData.ABI instead. +var DeployerWhitelistABI = DeployerWhitelistMetaData.ABI + +// DeployerWhitelistBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use DeployerWhitelistMetaData.Bin instead. +var DeployerWhitelistBin = DeployerWhitelistMetaData.Bin + +// DeployDeployerWhitelist deploys a new Ethereum contract, binding an instance of DeployerWhitelist to it. +func DeployDeployerWhitelist(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *DeployerWhitelist, error) { + parsed, err := DeployerWhitelistMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(DeployerWhitelistBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &DeployerWhitelist{DeployerWhitelistCaller: DeployerWhitelistCaller{contract: contract}, DeployerWhitelistTransactor: DeployerWhitelistTransactor{contract: contract}, DeployerWhitelistFilterer: DeployerWhitelistFilterer{contract: contract}}, nil +} + +// DeployerWhitelist is an auto generated Go binding around an Ethereum contract. +type DeployerWhitelist struct { + DeployerWhitelistCaller // Read-only binding to the contract + DeployerWhitelistTransactor // Write-only binding to the contract + DeployerWhitelistFilterer // Log filterer for contract events +} + +// DeployerWhitelistCaller is an auto generated read-only Go binding around an Ethereum contract. +type DeployerWhitelistCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// DeployerWhitelistTransactor is an auto generated write-only Go binding around an Ethereum contract. +type DeployerWhitelistTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// DeployerWhitelistFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type DeployerWhitelistFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// DeployerWhitelistSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type DeployerWhitelistSession struct { + Contract *DeployerWhitelist // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// DeployerWhitelistCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type DeployerWhitelistCallerSession struct { + Contract *DeployerWhitelistCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// DeployerWhitelistTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type DeployerWhitelistTransactorSession struct { + Contract *DeployerWhitelistTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// DeployerWhitelistRaw is an auto generated low-level Go binding around an Ethereum contract. +type DeployerWhitelistRaw struct { + Contract *DeployerWhitelist // Generic contract binding to access the raw methods on +} + +// DeployerWhitelistCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type DeployerWhitelistCallerRaw struct { + Contract *DeployerWhitelistCaller // Generic read-only contract binding to access the raw methods on +} + +// DeployerWhitelistTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type DeployerWhitelistTransactorRaw struct { + Contract *DeployerWhitelistTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewDeployerWhitelist creates a new instance of DeployerWhitelist, bound to a specific deployed contract. +func NewDeployerWhitelist(address common.Address, backend bind.ContractBackend) (*DeployerWhitelist, error) { + contract, err := bindDeployerWhitelist(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &DeployerWhitelist{DeployerWhitelistCaller: DeployerWhitelistCaller{contract: contract}, DeployerWhitelistTransactor: DeployerWhitelistTransactor{contract: contract}, DeployerWhitelistFilterer: DeployerWhitelistFilterer{contract: contract}}, nil +} + +// NewDeployerWhitelistCaller creates a new read-only instance of DeployerWhitelist, bound to a specific deployed contract. +func NewDeployerWhitelistCaller(address common.Address, caller bind.ContractCaller) (*DeployerWhitelistCaller, error) { + contract, err := bindDeployerWhitelist(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &DeployerWhitelistCaller{contract: contract}, nil +} + +// NewDeployerWhitelistTransactor creates a new write-only instance of DeployerWhitelist, bound to a specific deployed contract. +func NewDeployerWhitelistTransactor(address common.Address, transactor bind.ContractTransactor) (*DeployerWhitelistTransactor, error) { + contract, err := bindDeployerWhitelist(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &DeployerWhitelistTransactor{contract: contract}, nil +} + +// NewDeployerWhitelistFilterer creates a new log filterer instance of DeployerWhitelist, bound to a specific deployed contract. +func NewDeployerWhitelistFilterer(address common.Address, filterer bind.ContractFilterer) (*DeployerWhitelistFilterer, error) { + contract, err := bindDeployerWhitelist(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &DeployerWhitelistFilterer{contract: contract}, nil +} + +// bindDeployerWhitelist binds a generic wrapper to an already deployed contract. +func bindDeployerWhitelist(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(DeployerWhitelistABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_DeployerWhitelist *DeployerWhitelistRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _DeployerWhitelist.Contract.DeployerWhitelistCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_DeployerWhitelist *DeployerWhitelistRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DeployerWhitelist.Contract.DeployerWhitelistTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_DeployerWhitelist *DeployerWhitelistRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _DeployerWhitelist.Contract.DeployerWhitelistTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_DeployerWhitelist *DeployerWhitelistCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _DeployerWhitelist.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_DeployerWhitelist *DeployerWhitelistTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DeployerWhitelist.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_DeployerWhitelist *DeployerWhitelistTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _DeployerWhitelist.Contract.contract.Transact(opts, method, params...) +} + +// IsDeployerAllowed is a free data retrieval call binding the contract method 0xb1540a01. +// +// Solidity: function isDeployerAllowed(address _deployer) view returns(bool) +func (_DeployerWhitelist *DeployerWhitelistCaller) IsDeployerAllowed(opts *bind.CallOpts, _deployer common.Address) (bool, error) { + var out []interface{} + err := _DeployerWhitelist.contract.Call(opts, &out, "isDeployerAllowed", _deployer) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsDeployerAllowed is a free data retrieval call binding the contract method 0xb1540a01. +// +// Solidity: function isDeployerAllowed(address _deployer) view returns(bool) +func (_DeployerWhitelist *DeployerWhitelistSession) IsDeployerAllowed(_deployer common.Address) (bool, error) { + return _DeployerWhitelist.Contract.IsDeployerAllowed(&_DeployerWhitelist.CallOpts, _deployer) +} + +// IsDeployerAllowed is a free data retrieval call binding the contract method 0xb1540a01. +// +// Solidity: function isDeployerAllowed(address _deployer) view returns(bool) +func (_DeployerWhitelist *DeployerWhitelistCallerSession) IsDeployerAllowed(_deployer common.Address) (bool, error) { + return _DeployerWhitelist.Contract.IsDeployerAllowed(&_DeployerWhitelist.CallOpts, _deployer) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_DeployerWhitelist *DeployerWhitelistCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _DeployerWhitelist.contract.Call(opts, &out, "owner") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_DeployerWhitelist *DeployerWhitelistSession) Owner() (common.Address, error) { + return _DeployerWhitelist.Contract.Owner(&_DeployerWhitelist.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_DeployerWhitelist *DeployerWhitelistCallerSession) Owner() (common.Address, error) { + return _DeployerWhitelist.Contract.Owner(&_DeployerWhitelist.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_DeployerWhitelist *DeployerWhitelistCaller) Version(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _DeployerWhitelist.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 (_DeployerWhitelist *DeployerWhitelistSession) Version() (string, error) { + return _DeployerWhitelist.Contract.Version(&_DeployerWhitelist.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_DeployerWhitelist *DeployerWhitelistCallerSession) Version() (string, error) { + return _DeployerWhitelist.Contract.Version(&_DeployerWhitelist.CallOpts) +} + +// Whitelist is a free data retrieval call binding the contract method 0x9b19251a. +// +// Solidity: function whitelist(address ) view returns(bool) +func (_DeployerWhitelist *DeployerWhitelistCaller) Whitelist(opts *bind.CallOpts, arg0 common.Address) (bool, error) { + var out []interface{} + err := _DeployerWhitelist.contract.Call(opts, &out, "whitelist", arg0) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// Whitelist is a free data retrieval call binding the contract method 0x9b19251a. +// +// Solidity: function whitelist(address ) view returns(bool) +func (_DeployerWhitelist *DeployerWhitelistSession) Whitelist(arg0 common.Address) (bool, error) { + return _DeployerWhitelist.Contract.Whitelist(&_DeployerWhitelist.CallOpts, arg0) +} + +// Whitelist is a free data retrieval call binding the contract method 0x9b19251a. +// +// Solidity: function whitelist(address ) view returns(bool) +func (_DeployerWhitelist *DeployerWhitelistCallerSession) Whitelist(arg0 common.Address) (bool, error) { + return _DeployerWhitelist.Contract.Whitelist(&_DeployerWhitelist.CallOpts, arg0) +} + +// EnableArbitraryContractDeployment is a paid mutator transaction binding the contract method 0xbdc7b54f. +// +// Solidity: function enableArbitraryContractDeployment() returns() +func (_DeployerWhitelist *DeployerWhitelistTransactor) EnableArbitraryContractDeployment(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DeployerWhitelist.contract.Transact(opts, "enableArbitraryContractDeployment") +} + +// EnableArbitraryContractDeployment is a paid mutator transaction binding the contract method 0xbdc7b54f. +// +// Solidity: function enableArbitraryContractDeployment() returns() +func (_DeployerWhitelist *DeployerWhitelistSession) EnableArbitraryContractDeployment() (*types.Transaction, error) { + return _DeployerWhitelist.Contract.EnableArbitraryContractDeployment(&_DeployerWhitelist.TransactOpts) +} + +// EnableArbitraryContractDeployment is a paid mutator transaction binding the contract method 0xbdc7b54f. +// +// Solidity: function enableArbitraryContractDeployment() returns() +func (_DeployerWhitelist *DeployerWhitelistTransactorSession) EnableArbitraryContractDeployment() (*types.Transaction, error) { + return _DeployerWhitelist.Contract.EnableArbitraryContractDeployment(&_DeployerWhitelist.TransactOpts) +} + +// SetOwner is a paid mutator transaction binding the contract method 0x13af4035. +// +// Solidity: function setOwner(address _owner) returns() +func (_DeployerWhitelist *DeployerWhitelistTransactor) SetOwner(opts *bind.TransactOpts, _owner common.Address) (*types.Transaction, error) { + return _DeployerWhitelist.contract.Transact(opts, "setOwner", _owner) +} + +// SetOwner is a paid mutator transaction binding the contract method 0x13af4035. +// +// Solidity: function setOwner(address _owner) returns() +func (_DeployerWhitelist *DeployerWhitelistSession) SetOwner(_owner common.Address) (*types.Transaction, error) { + return _DeployerWhitelist.Contract.SetOwner(&_DeployerWhitelist.TransactOpts, _owner) +} + +// SetOwner is a paid mutator transaction binding the contract method 0x13af4035. +// +// Solidity: function setOwner(address _owner) returns() +func (_DeployerWhitelist *DeployerWhitelistTransactorSession) SetOwner(_owner common.Address) (*types.Transaction, error) { + return _DeployerWhitelist.Contract.SetOwner(&_DeployerWhitelist.TransactOpts, _owner) +} + +// SetWhitelistedDeployer is a paid mutator transaction binding the contract method 0x08fd6322. +// +// Solidity: function setWhitelistedDeployer(address _deployer, bool _isWhitelisted) returns() +func (_DeployerWhitelist *DeployerWhitelistTransactor) SetWhitelistedDeployer(opts *bind.TransactOpts, _deployer common.Address, _isWhitelisted bool) (*types.Transaction, error) { + return _DeployerWhitelist.contract.Transact(opts, "setWhitelistedDeployer", _deployer, _isWhitelisted) +} + +// SetWhitelistedDeployer is a paid mutator transaction binding the contract method 0x08fd6322. +// +// Solidity: function setWhitelistedDeployer(address _deployer, bool _isWhitelisted) returns() +func (_DeployerWhitelist *DeployerWhitelistSession) SetWhitelistedDeployer(_deployer common.Address, _isWhitelisted bool) (*types.Transaction, error) { + return _DeployerWhitelist.Contract.SetWhitelistedDeployer(&_DeployerWhitelist.TransactOpts, _deployer, _isWhitelisted) +} + +// SetWhitelistedDeployer is a paid mutator transaction binding the contract method 0x08fd6322. +// +// Solidity: function setWhitelistedDeployer(address _deployer, bool _isWhitelisted) returns() +func (_DeployerWhitelist *DeployerWhitelistTransactorSession) SetWhitelistedDeployer(_deployer common.Address, _isWhitelisted bool) (*types.Transaction, error) { + return _DeployerWhitelist.Contract.SetWhitelistedDeployer(&_DeployerWhitelist.TransactOpts, _deployer, _isWhitelisted) +} + +// DeployerWhitelistOwnerChangedIterator is returned from FilterOwnerChanged and is used to iterate over the raw logs and unpacked data for OwnerChanged events raised by the DeployerWhitelist contract. +type DeployerWhitelistOwnerChangedIterator struct { + Event *DeployerWhitelistOwnerChanged // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *DeployerWhitelistOwnerChangedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(DeployerWhitelistOwnerChanged) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(DeployerWhitelistOwnerChanged) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *DeployerWhitelistOwnerChangedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *DeployerWhitelistOwnerChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// DeployerWhitelistOwnerChanged represents a OwnerChanged event raised by the DeployerWhitelist contract. +type DeployerWhitelistOwnerChanged struct { + OldOwner common.Address + NewOwner common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOwnerChanged is a free log retrieval operation binding the contract event 0xb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c. +// +// Solidity: event OwnerChanged(address oldOwner, address newOwner) +func (_DeployerWhitelist *DeployerWhitelistFilterer) FilterOwnerChanged(opts *bind.FilterOpts) (*DeployerWhitelistOwnerChangedIterator, error) { + + logs, sub, err := _DeployerWhitelist.contract.FilterLogs(opts, "OwnerChanged") + if err != nil { + return nil, err + } + return &DeployerWhitelistOwnerChangedIterator{contract: _DeployerWhitelist.contract, event: "OwnerChanged", logs: logs, sub: sub}, nil +} + +// WatchOwnerChanged is a free log subscription operation binding the contract event 0xb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c. +// +// Solidity: event OwnerChanged(address oldOwner, address newOwner) +func (_DeployerWhitelist *DeployerWhitelistFilterer) WatchOwnerChanged(opts *bind.WatchOpts, sink chan<- *DeployerWhitelistOwnerChanged) (event.Subscription, error) { + + logs, sub, err := _DeployerWhitelist.contract.WatchLogs(opts, "OwnerChanged") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(DeployerWhitelistOwnerChanged) + if err := _DeployerWhitelist.contract.UnpackLog(event, "OwnerChanged", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseOwnerChanged is a log parse operation binding the contract event 0xb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c. +// +// Solidity: event OwnerChanged(address oldOwner, address newOwner) +func (_DeployerWhitelist *DeployerWhitelistFilterer) ParseOwnerChanged(log types.Log) (*DeployerWhitelistOwnerChanged, error) { + event := new(DeployerWhitelistOwnerChanged) + if err := _DeployerWhitelist.contract.UnpackLog(event, "OwnerChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// DeployerWhitelistWhitelistDisabledIterator is returned from FilterWhitelistDisabled and is used to iterate over the raw logs and unpacked data for WhitelistDisabled events raised by the DeployerWhitelist contract. +type DeployerWhitelistWhitelistDisabledIterator struct { + Event *DeployerWhitelistWhitelistDisabled // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *DeployerWhitelistWhitelistDisabledIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(DeployerWhitelistWhitelistDisabled) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(DeployerWhitelistWhitelistDisabled) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *DeployerWhitelistWhitelistDisabledIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *DeployerWhitelistWhitelistDisabledIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// DeployerWhitelistWhitelistDisabled represents a WhitelistDisabled event raised by the DeployerWhitelist contract. +type DeployerWhitelistWhitelistDisabled struct { + OldOwner common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterWhitelistDisabled is a free log retrieval operation binding the contract event 0xc0e106cf568e50698fdbde1eff56f5a5c966cc7958e37e276918e9e4ccdf8cd4. +// +// Solidity: event WhitelistDisabled(address oldOwner) +func (_DeployerWhitelist *DeployerWhitelistFilterer) FilterWhitelistDisabled(opts *bind.FilterOpts) (*DeployerWhitelistWhitelistDisabledIterator, error) { + + logs, sub, err := _DeployerWhitelist.contract.FilterLogs(opts, "WhitelistDisabled") + if err != nil { + return nil, err + } + return &DeployerWhitelistWhitelistDisabledIterator{contract: _DeployerWhitelist.contract, event: "WhitelistDisabled", logs: logs, sub: sub}, nil +} + +// WatchWhitelistDisabled is a free log subscription operation binding the contract event 0xc0e106cf568e50698fdbde1eff56f5a5c966cc7958e37e276918e9e4ccdf8cd4. +// +// Solidity: event WhitelistDisabled(address oldOwner) +func (_DeployerWhitelist *DeployerWhitelistFilterer) WatchWhitelistDisabled(opts *bind.WatchOpts, sink chan<- *DeployerWhitelistWhitelistDisabled) (event.Subscription, error) { + + logs, sub, err := _DeployerWhitelist.contract.WatchLogs(opts, "WhitelistDisabled") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(DeployerWhitelistWhitelistDisabled) + if err := _DeployerWhitelist.contract.UnpackLog(event, "WhitelistDisabled", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseWhitelistDisabled is a log parse operation binding the contract event 0xc0e106cf568e50698fdbde1eff56f5a5c966cc7958e37e276918e9e4ccdf8cd4. +// +// Solidity: event WhitelistDisabled(address oldOwner) +func (_DeployerWhitelist *DeployerWhitelistFilterer) ParseWhitelistDisabled(log types.Log) (*DeployerWhitelistWhitelistDisabled, error) { + event := new(DeployerWhitelistWhitelistDisabled) + if err := _DeployerWhitelist.contract.UnpackLog(event, "WhitelistDisabled", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// DeployerWhitelistWhitelistStatusChangedIterator is returned from FilterWhitelistStatusChanged and is used to iterate over the raw logs and unpacked data for WhitelistStatusChanged events raised by the DeployerWhitelist contract. +type DeployerWhitelistWhitelistStatusChangedIterator struct { + Event *DeployerWhitelistWhitelistStatusChanged // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *DeployerWhitelistWhitelistStatusChangedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(DeployerWhitelistWhitelistStatusChanged) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(DeployerWhitelistWhitelistStatusChanged) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *DeployerWhitelistWhitelistStatusChangedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *DeployerWhitelistWhitelistStatusChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// DeployerWhitelistWhitelistStatusChanged represents a WhitelistStatusChanged event raised by the DeployerWhitelist contract. +type DeployerWhitelistWhitelistStatusChanged struct { + Deployer common.Address + Whitelisted bool + Raw types.Log // Blockchain specific contextual infos +} + +// FilterWhitelistStatusChanged is a free log retrieval operation binding the contract event 0x8daaf060c3306c38e068a75c054bf96ecd85a3db1252712c4d93632744c42e0d. +// +// Solidity: event WhitelistStatusChanged(address deployer, bool whitelisted) +func (_DeployerWhitelist *DeployerWhitelistFilterer) FilterWhitelistStatusChanged(opts *bind.FilterOpts) (*DeployerWhitelistWhitelistStatusChangedIterator, error) { + + logs, sub, err := _DeployerWhitelist.contract.FilterLogs(opts, "WhitelistStatusChanged") + if err != nil { + return nil, err + } + return &DeployerWhitelistWhitelistStatusChangedIterator{contract: _DeployerWhitelist.contract, event: "WhitelistStatusChanged", logs: logs, sub: sub}, nil +} + +// WatchWhitelistStatusChanged is a free log subscription operation binding the contract event 0x8daaf060c3306c38e068a75c054bf96ecd85a3db1252712c4d93632744c42e0d. +// +// Solidity: event WhitelistStatusChanged(address deployer, bool whitelisted) +func (_DeployerWhitelist *DeployerWhitelistFilterer) WatchWhitelistStatusChanged(opts *bind.WatchOpts, sink chan<- *DeployerWhitelistWhitelistStatusChanged) (event.Subscription, error) { + + logs, sub, err := _DeployerWhitelist.contract.WatchLogs(opts, "WhitelistStatusChanged") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(DeployerWhitelistWhitelistStatusChanged) + if err := _DeployerWhitelist.contract.UnpackLog(event, "WhitelistStatusChanged", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseWhitelistStatusChanged is a log parse operation binding the contract event 0x8daaf060c3306c38e068a75c054bf96ecd85a3db1252712c4d93632744c42e0d. +// +// Solidity: event WhitelistStatusChanged(address deployer, bool whitelisted) +func (_DeployerWhitelist *DeployerWhitelistFilterer) ParseWhitelistStatusChanged(log types.Log) (*DeployerWhitelistWhitelistStatusChanged, error) { + event := new(DeployerWhitelistWhitelistStatusChanged) + if err := _DeployerWhitelist.contract.UnpackLog(event, "WhitelistStatusChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/op-e2e2/bindings/deterministicdeploymentproxy.go b/op-e2e2/bindings/deterministicdeploymentproxy.go new file mode 100644 index 000000000000..329d5f8366f9 --- /dev/null +++ b/op-e2e2/bindings/deterministicdeploymentproxy.go @@ -0,0 +1,223 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// DeterministicDeploymentProxyMetaData contains all meta data concerning the DeterministicDeploymentProxy contract. +var DeterministicDeploymentProxyMetaData = &bind.MetaData{ + ABI: "[{\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"fallback\",\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"salt\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"creationCode\",\"type\":\"bytes\"}]}]", + Bin: "0x604580600e600039806000f350fe7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf3", +} + +// DeterministicDeploymentProxyABI is the input ABI used to generate the binding from. +// Deprecated: Use DeterministicDeploymentProxyMetaData.ABI instead. +var DeterministicDeploymentProxyABI = DeterministicDeploymentProxyMetaData.ABI + +// DeterministicDeploymentProxyBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use DeterministicDeploymentProxyMetaData.Bin instead. +var DeterministicDeploymentProxyBin = DeterministicDeploymentProxyMetaData.Bin + +// DeployDeterministicDeploymentProxy deploys a new Ethereum contract, binding an instance of DeterministicDeploymentProxy to it. +func DeployDeterministicDeploymentProxy(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *DeterministicDeploymentProxy, error) { + parsed, err := DeterministicDeploymentProxyMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(DeterministicDeploymentProxyBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &DeterministicDeploymentProxy{DeterministicDeploymentProxyCaller: DeterministicDeploymentProxyCaller{contract: contract}, DeterministicDeploymentProxyTransactor: DeterministicDeploymentProxyTransactor{contract: contract}, DeterministicDeploymentProxyFilterer: DeterministicDeploymentProxyFilterer{contract: contract}}, nil +} + +// DeterministicDeploymentProxy is an auto generated Go binding around an Ethereum contract. +type DeterministicDeploymentProxy struct { + DeterministicDeploymentProxyCaller // Read-only binding to the contract + DeterministicDeploymentProxyTransactor // Write-only binding to the contract + DeterministicDeploymentProxyFilterer // Log filterer for contract events +} + +// DeterministicDeploymentProxyCaller is an auto generated read-only Go binding around an Ethereum contract. +type DeterministicDeploymentProxyCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// DeterministicDeploymentProxyTransactor is an auto generated write-only Go binding around an Ethereum contract. +type DeterministicDeploymentProxyTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// DeterministicDeploymentProxyFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type DeterministicDeploymentProxyFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// DeterministicDeploymentProxySession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type DeterministicDeploymentProxySession struct { + Contract *DeterministicDeploymentProxy // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// DeterministicDeploymentProxyCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type DeterministicDeploymentProxyCallerSession struct { + Contract *DeterministicDeploymentProxyCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// DeterministicDeploymentProxyTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type DeterministicDeploymentProxyTransactorSession struct { + Contract *DeterministicDeploymentProxyTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// DeterministicDeploymentProxyRaw is an auto generated low-level Go binding around an Ethereum contract. +type DeterministicDeploymentProxyRaw struct { + Contract *DeterministicDeploymentProxy // Generic contract binding to access the raw methods on +} + +// DeterministicDeploymentProxyCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type DeterministicDeploymentProxyCallerRaw struct { + Contract *DeterministicDeploymentProxyCaller // Generic read-only contract binding to access the raw methods on +} + +// DeterministicDeploymentProxyTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type DeterministicDeploymentProxyTransactorRaw struct { + Contract *DeterministicDeploymentProxyTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewDeterministicDeploymentProxy creates a new instance of DeterministicDeploymentProxy, bound to a specific deployed contract. +func NewDeterministicDeploymentProxy(address common.Address, backend bind.ContractBackend) (*DeterministicDeploymentProxy, error) { + contract, err := bindDeterministicDeploymentProxy(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &DeterministicDeploymentProxy{DeterministicDeploymentProxyCaller: DeterministicDeploymentProxyCaller{contract: contract}, DeterministicDeploymentProxyTransactor: DeterministicDeploymentProxyTransactor{contract: contract}, DeterministicDeploymentProxyFilterer: DeterministicDeploymentProxyFilterer{contract: contract}}, nil +} + +// NewDeterministicDeploymentProxyCaller creates a new read-only instance of DeterministicDeploymentProxy, bound to a specific deployed contract. +func NewDeterministicDeploymentProxyCaller(address common.Address, caller bind.ContractCaller) (*DeterministicDeploymentProxyCaller, error) { + contract, err := bindDeterministicDeploymentProxy(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &DeterministicDeploymentProxyCaller{contract: contract}, nil +} + +// NewDeterministicDeploymentProxyTransactor creates a new write-only instance of DeterministicDeploymentProxy, bound to a specific deployed contract. +func NewDeterministicDeploymentProxyTransactor(address common.Address, transactor bind.ContractTransactor) (*DeterministicDeploymentProxyTransactor, error) { + contract, err := bindDeterministicDeploymentProxy(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &DeterministicDeploymentProxyTransactor{contract: contract}, nil +} + +// NewDeterministicDeploymentProxyFilterer creates a new log filterer instance of DeterministicDeploymentProxy, bound to a specific deployed contract. +func NewDeterministicDeploymentProxyFilterer(address common.Address, filterer bind.ContractFilterer) (*DeterministicDeploymentProxyFilterer, error) { + contract, err := bindDeterministicDeploymentProxy(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &DeterministicDeploymentProxyFilterer{contract: contract}, nil +} + +// bindDeterministicDeploymentProxy binds a generic wrapper to an already deployed contract. +func bindDeterministicDeploymentProxy(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(DeterministicDeploymentProxyABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_DeterministicDeploymentProxy *DeterministicDeploymentProxyRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _DeterministicDeploymentProxy.Contract.DeterministicDeploymentProxyCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_DeterministicDeploymentProxy *DeterministicDeploymentProxyRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DeterministicDeploymentProxy.Contract.DeterministicDeploymentProxyTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_DeterministicDeploymentProxy *DeterministicDeploymentProxyRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _DeterministicDeploymentProxy.Contract.DeterministicDeploymentProxyTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_DeterministicDeploymentProxy *DeterministicDeploymentProxyCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _DeterministicDeploymentProxy.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_DeterministicDeploymentProxy *DeterministicDeploymentProxyTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DeterministicDeploymentProxy.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_DeterministicDeploymentProxy *DeterministicDeploymentProxyTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _DeterministicDeploymentProxy.Contract.contract.Transact(opts, method, params...) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() payable returns() +func (_DeterministicDeploymentProxy *DeterministicDeploymentProxyTransactor) Fallback(opts *bind.TransactOpts, calldata []byte) (*types.Transaction, error) { + return _DeterministicDeploymentProxy.contract.RawTransact(opts, calldata) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() payable returns() +func (_DeterministicDeploymentProxy *DeterministicDeploymentProxySession) Fallback(calldata []byte) (*types.Transaction, error) { + return _DeterministicDeploymentProxy.Contract.Fallback(&_DeterministicDeploymentProxy.TransactOpts, calldata) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() payable returns() +func (_DeterministicDeploymentProxy *DeterministicDeploymentProxyTransactorSession) Fallback(calldata []byte) (*types.Transaction, error) { + return _DeterministicDeploymentProxy.Contract.Fallback(&_DeterministicDeploymentProxy.TransactOpts, calldata) +} diff --git a/op-e2e2/bindings/disputegamefactory.go b/op-e2e2/bindings/disputegamefactory.go new file mode 100644 index 000000000000..1bfb6a73da2b --- /dev/null +++ b/op-e2e2/bindings/disputegamefactory.go @@ -0,0 +1,1404 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// IDisputeGameFactoryGameSearchResult is an auto generated low-level Go binding around an user-defined struct. +type IDisputeGameFactoryGameSearchResult struct { + Index *big.Int + Metadata [32]byte + Timestamp uint64 + RootClaim [32]byte + ExtraData []byte +} + +// DisputeGameFactoryMetaData contains all meta data concerning the DisputeGameFactory contract. +var DisputeGameFactoryMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"create\",\"inputs\":[{\"name\":\"_gameType\",\"type\":\"uint32\",\"internalType\":\"GameType\"},{\"name\":\"_rootClaim\",\"type\":\"bytes32\",\"internalType\":\"Claim\"},{\"name\":\"_extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"proxy_\",\"type\":\"address\",\"internalType\":\"contractIDisputeGame\"}],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"findLatestGames\",\"inputs\":[{\"name\":\"_gameType\",\"type\":\"uint32\",\"internalType\":\"GameType\"},{\"name\":\"_start\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_n\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"games_\",\"type\":\"tuple[]\",\"internalType\":\"structIDisputeGameFactory.GameSearchResult[]\",\"components\":[{\"name\":\"index\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"metadata\",\"type\":\"bytes32\",\"internalType\":\"GameId\"},{\"name\":\"timestamp\",\"type\":\"uint64\",\"internalType\":\"Timestamp\"},{\"name\":\"rootClaim\",\"type\":\"bytes32\",\"internalType\":\"Claim\"},{\"name\":\"extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"gameAtIndex\",\"inputs\":[{\"name\":\"_index\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"gameType_\",\"type\":\"uint32\",\"internalType\":\"GameType\"},{\"name\":\"timestamp_\",\"type\":\"uint64\",\"internalType\":\"Timestamp\"},{\"name\":\"proxy_\",\"type\":\"address\",\"internalType\":\"contractIDisputeGame\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"gameCount\",\"inputs\":[],\"outputs\":[{\"name\":\"gameCount_\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"gameImpls\",\"inputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"GameType\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIDisputeGame\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"games\",\"inputs\":[{\"name\":\"_gameType\",\"type\":\"uint32\",\"internalType\":\"GameType\"},{\"name\":\"_rootClaim\",\"type\":\"bytes32\",\"internalType\":\"Claim\"},{\"name\":\"_extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"proxy_\",\"type\":\"address\",\"internalType\":\"contractIDisputeGame\"},{\"name\":\"timestamp_\",\"type\":\"uint64\",\"internalType\":\"Timestamp\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getGameUUID\",\"inputs\":[{\"name\":\"_gameType\",\"type\":\"uint32\",\"internalType\":\"GameType\"},{\"name\":\"_rootClaim\",\"type\":\"bytes32\",\"internalType\":\"Claim\"},{\"name\":\"_extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"uuid_\",\"type\":\"bytes32\",\"internalType\":\"Hash\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"initBonds\",\"inputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"GameType\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setImplementation\",\"inputs\":[{\"name\":\"_gameType\",\"type\":\"uint32\",\"internalType\":\"GameType\"},{\"name\":\"_impl\",\"type\":\"address\",\"internalType\":\"contractIDisputeGame\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setInitBond\",\"inputs\":[{\"name\":\"_gameType\",\"type\":\"uint32\",\"internalType\":\"GameType\"},{\"name\":\"_initBond\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"DisputeGameCreated\",\"inputs\":[{\"name\":\"disputeProxy\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"gameType\",\"type\":\"uint32\",\"indexed\":true,\"internalType\":\"GameType\"},{\"name\":\"rootClaim\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"Claim\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ImplementationSet\",\"inputs\":[{\"name\":\"impl\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"gameType\",\"type\":\"uint32\",\"indexed\":true,\"internalType\":\"GameType\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"InitBondUpdated\",\"inputs\":[{\"name\":\"gameType\",\"type\":\"uint32\",\"indexed\":true,\"internalType\":\"GameType\"},{\"name\":\"newBond\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"GameAlreadyExists\",\"inputs\":[{\"name\":\"uuid\",\"type\":\"bytes32\",\"internalType\":\"Hash\"}]},{\"type\":\"error\",\"name\":\"IncorrectBondAmount\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NoImplementation\",\"inputs\":[{\"name\":\"gameType\",\"type\":\"uint32\",\"internalType\":\"GameType\"}]}]", + Bin: "0x60806040523480156200001157600080fd5b506200001e600062000024565b62000292565b600054610100900460ff1615808015620000455750600054600160ff909116105b8062000075575062000062306200016260201b62000cdd1760201c565b15801562000075575060005460ff166001145b620000de5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff19166001179055801562000102576000805461ff0019166101001790555b6200010c62000171565b6200011782620001d9565b80156200015e576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050565b6001600160a01b03163b151590565b600054610100900460ff16620001cd5760405162461bcd60e51b815260206004820152602b60248201526000805160206200185283398151915260448201526a6e697469616c697a696e6760a81b6064820152608401620000d5565b620001d76200022b565b565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff16620002875760405162461bcd60e51b815260206004820152602b60248201526000805160206200185283398151915260448201526a6e697469616c697a696e6760a81b6064820152608401620000d5565b620001d733620001d9565b6115b080620002a26000396000f3fe6080604052600436106100e85760003560e01c80636593dc6e1161008a57806396cd97201161005957806396cd972014610313578063bb8aa1fc14610333578063c4d66de814610394578063f2fde38b146103b457600080fd5b80636593dc6e14610293578063715018a6146102c057806382ecf2f6146102d55780638da5cb5b146102e857600080fd5b8063254bd683116100c6578063254bd6831461019c5780634d1975b4146101c957806354fd4d50146101e85780635f0150cb1461023e57600080fd5b806314f6b1a3146100ed5780631b685b9e1461010f5780631e3342401461017c575b600080fd5b3480156100f957600080fd5b5061010d6101083660046110bf565b6103d4565b005b34801561011b57600080fd5b5061015261012a3660046110f6565b60656020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b34801561018857600080fd5b5061010d610197366004611111565b61045e565b3480156101a857600080fd5b506101bc6101b736600461113b565b6104aa565b60405161017391906111e8565b3480156101d557600080fd5b506068545b604051908152602001610173565b3480156101f457600080fd5b506102316040518060400160405280600581526020017f302e362e3000000000000000000000000000000000000000000000000000000081525081565b60405161017391906112a5565b34801561024a57600080fd5b5061025e6102593660046112b8565b6106ee565b6040805173ffffffffffffffffffffffffffffffffffffffff909316835267ffffffffffffffff909116602083015201610173565b34801561029f57600080fd5b506101da6102ae3660046110f6565b60666020526000908152604090205481565b3480156102cc57600080fd5b5061010d610741565b6101526102e33660046112b8565b610755565b3480156102f457600080fd5b5060335473ffffffffffffffffffffffffffffffffffffffff16610152565b34801561031f57600080fd5b506101da61032e3660046112b8565b6109ef565b34801561033f57600080fd5b5061035361034e36600461133f565b610a28565b6040805163ffffffff909416845267ffffffffffffffff909216602084015273ffffffffffffffffffffffffffffffffffffffff1690820152606001610173565b3480156103a057600080fd5b5061010d6103af366004611358565b610a8a565b3480156103c057600080fd5b5061010d6103cf366004611358565b610c26565b6103dc610cf9565b63ffffffff821660008181526065602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8616908117909155905190917fff513d80e2c7fa487608f70a618dfbc0cf415699dc69588c747e8c71566c88de91a35050565b610466610cf9565b63ffffffff8216600081815260666020526040808220849055518392917f74d6665c4b26d5596a5aa13d3014e0c06af4d322075a797f87b03cd4c5bc91ca91a35050565b606854606090831015806104bc575081155b6106e7575060408051600583901b8101602001909152825b8381116106e5576000606882815481106104f0576104f0611375565b600091825260209091200154905060e081901c60a082901c67ffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff831663ffffffff891683036106b6576001865101865260008173ffffffffffffffffffffffffffffffffffffffff1663609d33346040518163ffffffff1660e01b8152600401600060405180830381865afa15801561058a573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526105d091908101906113d3565b905060008273ffffffffffffffffffffffffffffffffffffffff1663bcef3b556040518163ffffffff1660e01b8152600401602060405180830381865afa15801561061f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610643919061149e565b90506040518060a001604052808881526020018781526020018567ffffffffffffffff168152602001828152602001838152508860018a5161068591906114b7565b8151811061069557610695611375565b6020026020010181905250888851106106b3575050505050506106e5565b50505b50507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90920191506104d49050565b505b9392505050565b60008060006106ff878787876109ef565b60009081526067602052604090205473ffffffffffffffffffffffffffffffffffffffff81169860a09190911c67ffffffffffffffff16975095505050505050565b610749610cf9565b6107536000610d7a565b565b63ffffffff841660009081526065602052604081205473ffffffffffffffffffffffffffffffffffffffff16806107c5576040517f031c6de400000000000000000000000000000000000000000000000000000000815263ffffffff871660048201526024015b60405180910390fd5b63ffffffff86166000908152606660205260409020543414610813576040517f8620aa1900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006108206001436114b7565b40905061088a338783888860405160200161083f9594939291906114f5565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291905273ffffffffffffffffffffffffffffffffffffffff841690610df1565b92508273ffffffffffffffffffffffffffffffffffffffff16638129fc1c346040518263ffffffff1660e01b81526004016000604051808303818588803b1580156108d457600080fd5b505af11580156108e8573d6000803e3d6000fd5b505050505060006108fb888888886109ef565b60008181526067602052604090205490915015610947576040517f014f6fe5000000000000000000000000000000000000000000000000000000008152600481018290526024016107bc565b60004260a01b60e08a901b178517600083815260676020526040808220839055606880546001810182559083527fa2153420d844928b4421650203c77babc8b33d7f2e7b450e2966db0c220977530183905551919250899163ffffffff8c169173ffffffffffffffffffffffffffffffffffffffff8916917f5b565efe82411da98814f356d0e7bcb8f0219b8d970307c5afb4a6903a8b2e359190a450505050949350505050565b600084848484604051602001610a089493929190611542565b604051602081830303815290604052805190602001209050949350505050565b6000806000610a7d60688581548110610a4357610a43611375565b906000526020600020015460e081901c9160a082901c67ffffffffffffffff169173ffffffffffffffffffffffffffffffffffffffff1690565b9196909550909350915050565b600054610100900460ff1615808015610aaa5750600054600160ff909116105b80610ac45750303b158015610ac4575060005460ff166001145b610b50576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016107bc565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015610bae57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b610bb6610dff565b610bbf82610d7a565b8015610c2257600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050565b610c2e610cf9565b73ffffffffffffffffffffffffffffffffffffffff8116610cd1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016107bc565b610cda81610d7a565b50565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b60335473ffffffffffffffffffffffffffffffffffffffff163314610753576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016107bc565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60006106e760008484610e9e565b600054610100900460ff16610e96576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016107bc565b610753610fe4565b600060608203516040830351602084035184518060208701018051600283016c5af43d3d93803e606057fd5bf3895289600d8a035278593da1005b363d3d373d3d3d3d610000806062363936013d738160481b1760218a03527f9e4ac34f21c619cefc926c8bd93b54bf5a39c7ab2127a895af1cc0691d7e3dff603a8a035272fd6100003d81600a3d39f336602c57343d527f6062820160781b1761ff9e82106059018a03528060f01b8352606c8101604c8a038cf097505086610f6a5763301164256000526004601cfd5b905285527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08501527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08401527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa09092019190915292915050565b600054610100900460ff1661107b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016107bc565b61075333610d7a565b803563ffffffff8116811461109857600080fd5b919050565b73ffffffffffffffffffffffffffffffffffffffff81168114610cda57600080fd5b600080604083850312156110d257600080fd5b6110db83611084565b915060208301356110eb8161109d565b809150509250929050565b60006020828403121561110857600080fd5b6106e782611084565b6000806040838503121561112457600080fd5b61112d83611084565b946020939093013593505050565b60008060006060848603121561115057600080fd5b61115984611084565b95602085013595506040909401359392505050565b60005b83811015611189578181015183820152602001611171565b83811115611198576000848401525b50505050565b600081518084526111b681602086016020860161116e565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b83811015611297578883037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc001855281518051845287810151888501528681015167ffffffffffffffff16878501526060808201519085015260809081015160a0918501829052906112838186018361119e565b96890196945050509086019060010161120f565b509098975050505050505050565b6020815260006106e7602083018461119e565b600080600080606085870312156112ce57600080fd5b6112d785611084565b935060208501359250604085013567ffffffffffffffff808211156112fb57600080fd5b818701915087601f83011261130f57600080fd5b81358181111561131e57600080fd5b88602082850101111561133057600080fd5b95989497505060200194505050565b60006020828403121561135157600080fd5b5035919050565b60006020828403121561136a57600080fd5b81356106e78161109d565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000602082840312156113e557600080fd5b815167ffffffffffffffff808211156113fd57600080fd5b818401915084601f83011261141157600080fd5b815181811115611423576114236113a4565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908382118183101715611469576114696113a4565b8160405282815287602084870101111561148257600080fd5b61149383602083016020880161116e565b979650505050505050565b6000602082840312156114b057600080fd5b5051919050565b6000828210156114f0577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b500390565b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000008660601b1681528460148201528360348201528183605483013760009101605401908152949350505050565b63ffffffff8516815283602082015260606040820152816060820152818360808301376000818301608090810191909152601f9092017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0160101939250505056fea164736f6c634300080f000a496e697469616c697a61626c653a20636f6e7472616374206973206e6f742069", +} + +// DisputeGameFactoryABI is the input ABI used to generate the binding from. +// Deprecated: Use DisputeGameFactoryMetaData.ABI instead. +var DisputeGameFactoryABI = DisputeGameFactoryMetaData.ABI + +// DisputeGameFactoryBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use DisputeGameFactoryMetaData.Bin instead. +var DisputeGameFactoryBin = DisputeGameFactoryMetaData.Bin + +// DeployDisputeGameFactory deploys a new Ethereum contract, binding an instance of DisputeGameFactory to it. +func DeployDisputeGameFactory(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *DisputeGameFactory, error) { + parsed, err := DisputeGameFactoryMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(DisputeGameFactoryBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &DisputeGameFactory{DisputeGameFactoryCaller: DisputeGameFactoryCaller{contract: contract}, DisputeGameFactoryTransactor: DisputeGameFactoryTransactor{contract: contract}, DisputeGameFactoryFilterer: DisputeGameFactoryFilterer{contract: contract}}, nil +} + +// DisputeGameFactory is an auto generated Go binding around an Ethereum contract. +type DisputeGameFactory struct { + DisputeGameFactoryCaller // Read-only binding to the contract + DisputeGameFactoryTransactor // Write-only binding to the contract + DisputeGameFactoryFilterer // Log filterer for contract events +} + +// DisputeGameFactoryCaller is an auto generated read-only Go binding around an Ethereum contract. +type DisputeGameFactoryCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// DisputeGameFactoryTransactor is an auto generated write-only Go binding around an Ethereum contract. +type DisputeGameFactoryTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// DisputeGameFactoryFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type DisputeGameFactoryFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// DisputeGameFactorySession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type DisputeGameFactorySession struct { + Contract *DisputeGameFactory // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// DisputeGameFactoryCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type DisputeGameFactoryCallerSession struct { + Contract *DisputeGameFactoryCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// DisputeGameFactoryTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type DisputeGameFactoryTransactorSession struct { + Contract *DisputeGameFactoryTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// DisputeGameFactoryRaw is an auto generated low-level Go binding around an Ethereum contract. +type DisputeGameFactoryRaw struct { + Contract *DisputeGameFactory // Generic contract binding to access the raw methods on +} + +// DisputeGameFactoryCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type DisputeGameFactoryCallerRaw struct { + Contract *DisputeGameFactoryCaller // Generic read-only contract binding to access the raw methods on +} + +// DisputeGameFactoryTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type DisputeGameFactoryTransactorRaw struct { + Contract *DisputeGameFactoryTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewDisputeGameFactory creates a new instance of DisputeGameFactory, bound to a specific deployed contract. +func NewDisputeGameFactory(address common.Address, backend bind.ContractBackend) (*DisputeGameFactory, error) { + contract, err := bindDisputeGameFactory(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &DisputeGameFactory{DisputeGameFactoryCaller: DisputeGameFactoryCaller{contract: contract}, DisputeGameFactoryTransactor: DisputeGameFactoryTransactor{contract: contract}, DisputeGameFactoryFilterer: DisputeGameFactoryFilterer{contract: contract}}, nil +} + +// NewDisputeGameFactoryCaller creates a new read-only instance of DisputeGameFactory, bound to a specific deployed contract. +func NewDisputeGameFactoryCaller(address common.Address, caller bind.ContractCaller) (*DisputeGameFactoryCaller, error) { + contract, err := bindDisputeGameFactory(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &DisputeGameFactoryCaller{contract: contract}, nil +} + +// NewDisputeGameFactoryTransactor creates a new write-only instance of DisputeGameFactory, bound to a specific deployed contract. +func NewDisputeGameFactoryTransactor(address common.Address, transactor bind.ContractTransactor) (*DisputeGameFactoryTransactor, error) { + contract, err := bindDisputeGameFactory(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &DisputeGameFactoryTransactor{contract: contract}, nil +} + +// NewDisputeGameFactoryFilterer creates a new log filterer instance of DisputeGameFactory, bound to a specific deployed contract. +func NewDisputeGameFactoryFilterer(address common.Address, filterer bind.ContractFilterer) (*DisputeGameFactoryFilterer, error) { + contract, err := bindDisputeGameFactory(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &DisputeGameFactoryFilterer{contract: contract}, nil +} + +// bindDisputeGameFactory binds a generic wrapper to an already deployed contract. +func bindDisputeGameFactory(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(DisputeGameFactoryABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_DisputeGameFactory *DisputeGameFactoryRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _DisputeGameFactory.Contract.DisputeGameFactoryCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_DisputeGameFactory *DisputeGameFactoryRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DisputeGameFactory.Contract.DisputeGameFactoryTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_DisputeGameFactory *DisputeGameFactoryRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _DisputeGameFactory.Contract.DisputeGameFactoryTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_DisputeGameFactory *DisputeGameFactoryCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _DisputeGameFactory.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_DisputeGameFactory *DisputeGameFactoryTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DisputeGameFactory.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_DisputeGameFactory *DisputeGameFactoryTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _DisputeGameFactory.Contract.contract.Transact(opts, method, params...) +} + +// FindLatestGames is a free data retrieval call binding the contract method 0x254bd683. +// +// Solidity: function findLatestGames(uint32 _gameType, uint256 _start, uint256 _n) view returns((uint256,bytes32,uint64,bytes32,bytes)[] games_) +func (_DisputeGameFactory *DisputeGameFactoryCaller) FindLatestGames(opts *bind.CallOpts, _gameType uint32, _start *big.Int, _n *big.Int) ([]IDisputeGameFactoryGameSearchResult, error) { + var out []interface{} + err := _DisputeGameFactory.contract.Call(opts, &out, "findLatestGames", _gameType, _start, _n) + + if err != nil { + return *new([]IDisputeGameFactoryGameSearchResult), err + } + + out0 := *abi.ConvertType(out[0], new([]IDisputeGameFactoryGameSearchResult)).(*[]IDisputeGameFactoryGameSearchResult) + + return out0, err + +} + +// FindLatestGames is a free data retrieval call binding the contract method 0x254bd683. +// +// Solidity: function findLatestGames(uint32 _gameType, uint256 _start, uint256 _n) view returns((uint256,bytes32,uint64,bytes32,bytes)[] games_) +func (_DisputeGameFactory *DisputeGameFactorySession) FindLatestGames(_gameType uint32, _start *big.Int, _n *big.Int) ([]IDisputeGameFactoryGameSearchResult, error) { + return _DisputeGameFactory.Contract.FindLatestGames(&_DisputeGameFactory.CallOpts, _gameType, _start, _n) +} + +// FindLatestGames is a free data retrieval call binding the contract method 0x254bd683. +// +// Solidity: function findLatestGames(uint32 _gameType, uint256 _start, uint256 _n) view returns((uint256,bytes32,uint64,bytes32,bytes)[] games_) +func (_DisputeGameFactory *DisputeGameFactoryCallerSession) FindLatestGames(_gameType uint32, _start *big.Int, _n *big.Int) ([]IDisputeGameFactoryGameSearchResult, error) { + return _DisputeGameFactory.Contract.FindLatestGames(&_DisputeGameFactory.CallOpts, _gameType, _start, _n) +} + +// GameAtIndex is a free data retrieval call binding the contract method 0xbb8aa1fc. +// +// Solidity: function gameAtIndex(uint256 _index) view returns(uint32 gameType_, uint64 timestamp_, address proxy_) +func (_DisputeGameFactory *DisputeGameFactoryCaller) GameAtIndex(opts *bind.CallOpts, _index *big.Int) (struct { + GameType uint32 + Timestamp uint64 + Proxy common.Address +}, error) { + var out []interface{} + err := _DisputeGameFactory.contract.Call(opts, &out, "gameAtIndex", _index) + + outstruct := new(struct { + GameType uint32 + Timestamp uint64 + Proxy common.Address + }) + if err != nil { + return *outstruct, err + } + + outstruct.GameType = *abi.ConvertType(out[0], new(uint32)).(*uint32) + outstruct.Timestamp = *abi.ConvertType(out[1], new(uint64)).(*uint64) + outstruct.Proxy = *abi.ConvertType(out[2], new(common.Address)).(*common.Address) + + return *outstruct, err + +} + +// GameAtIndex is a free data retrieval call binding the contract method 0xbb8aa1fc. +// +// Solidity: function gameAtIndex(uint256 _index) view returns(uint32 gameType_, uint64 timestamp_, address proxy_) +func (_DisputeGameFactory *DisputeGameFactorySession) GameAtIndex(_index *big.Int) (struct { + GameType uint32 + Timestamp uint64 + Proxy common.Address +}, error) { + return _DisputeGameFactory.Contract.GameAtIndex(&_DisputeGameFactory.CallOpts, _index) +} + +// GameAtIndex is a free data retrieval call binding the contract method 0xbb8aa1fc. +// +// Solidity: function gameAtIndex(uint256 _index) view returns(uint32 gameType_, uint64 timestamp_, address proxy_) +func (_DisputeGameFactory *DisputeGameFactoryCallerSession) GameAtIndex(_index *big.Int) (struct { + GameType uint32 + Timestamp uint64 + Proxy common.Address +}, error) { + return _DisputeGameFactory.Contract.GameAtIndex(&_DisputeGameFactory.CallOpts, _index) +} + +// GameCount is a free data retrieval call binding the contract method 0x4d1975b4. +// +// Solidity: function gameCount() view returns(uint256 gameCount_) +func (_DisputeGameFactory *DisputeGameFactoryCaller) GameCount(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _DisputeGameFactory.contract.Call(opts, &out, "gameCount") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GameCount is a free data retrieval call binding the contract method 0x4d1975b4. +// +// Solidity: function gameCount() view returns(uint256 gameCount_) +func (_DisputeGameFactory *DisputeGameFactorySession) GameCount() (*big.Int, error) { + return _DisputeGameFactory.Contract.GameCount(&_DisputeGameFactory.CallOpts) +} + +// GameCount is a free data retrieval call binding the contract method 0x4d1975b4. +// +// Solidity: function gameCount() view returns(uint256 gameCount_) +func (_DisputeGameFactory *DisputeGameFactoryCallerSession) GameCount() (*big.Int, error) { + return _DisputeGameFactory.Contract.GameCount(&_DisputeGameFactory.CallOpts) +} + +// GameImpls is a free data retrieval call binding the contract method 0x1b685b9e. +// +// Solidity: function gameImpls(uint32 ) view returns(address) +func (_DisputeGameFactory *DisputeGameFactoryCaller) GameImpls(opts *bind.CallOpts, arg0 uint32) (common.Address, error) { + var out []interface{} + err := _DisputeGameFactory.contract.Call(opts, &out, "gameImpls", arg0) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// GameImpls is a free data retrieval call binding the contract method 0x1b685b9e. +// +// Solidity: function gameImpls(uint32 ) view returns(address) +func (_DisputeGameFactory *DisputeGameFactorySession) GameImpls(arg0 uint32) (common.Address, error) { + return _DisputeGameFactory.Contract.GameImpls(&_DisputeGameFactory.CallOpts, arg0) +} + +// GameImpls is a free data retrieval call binding the contract method 0x1b685b9e. +// +// Solidity: function gameImpls(uint32 ) view returns(address) +func (_DisputeGameFactory *DisputeGameFactoryCallerSession) GameImpls(arg0 uint32) (common.Address, error) { + return _DisputeGameFactory.Contract.GameImpls(&_DisputeGameFactory.CallOpts, arg0) +} + +// Games is a free data retrieval call binding the contract method 0x5f0150cb. +// +// Solidity: function games(uint32 _gameType, bytes32 _rootClaim, bytes _extraData) view returns(address proxy_, uint64 timestamp_) +func (_DisputeGameFactory *DisputeGameFactoryCaller) Games(opts *bind.CallOpts, _gameType uint32, _rootClaim [32]byte, _extraData []byte) (struct { + Proxy common.Address + Timestamp uint64 +}, error) { + var out []interface{} + err := _DisputeGameFactory.contract.Call(opts, &out, "games", _gameType, _rootClaim, _extraData) + + outstruct := new(struct { + Proxy common.Address + Timestamp uint64 + }) + if err != nil { + return *outstruct, err + } + + outstruct.Proxy = *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + outstruct.Timestamp = *abi.ConvertType(out[1], new(uint64)).(*uint64) + + return *outstruct, err + +} + +// Games is a free data retrieval call binding the contract method 0x5f0150cb. +// +// Solidity: function games(uint32 _gameType, bytes32 _rootClaim, bytes _extraData) view returns(address proxy_, uint64 timestamp_) +func (_DisputeGameFactory *DisputeGameFactorySession) Games(_gameType uint32, _rootClaim [32]byte, _extraData []byte) (struct { + Proxy common.Address + Timestamp uint64 +}, error) { + return _DisputeGameFactory.Contract.Games(&_DisputeGameFactory.CallOpts, _gameType, _rootClaim, _extraData) +} + +// Games is a free data retrieval call binding the contract method 0x5f0150cb. +// +// Solidity: function games(uint32 _gameType, bytes32 _rootClaim, bytes _extraData) view returns(address proxy_, uint64 timestamp_) +func (_DisputeGameFactory *DisputeGameFactoryCallerSession) Games(_gameType uint32, _rootClaim [32]byte, _extraData []byte) (struct { + Proxy common.Address + Timestamp uint64 +}, error) { + return _DisputeGameFactory.Contract.Games(&_DisputeGameFactory.CallOpts, _gameType, _rootClaim, _extraData) +} + +// GetGameUUID is a free data retrieval call binding the contract method 0x96cd9720. +// +// Solidity: function getGameUUID(uint32 _gameType, bytes32 _rootClaim, bytes _extraData) pure returns(bytes32 uuid_) +func (_DisputeGameFactory *DisputeGameFactoryCaller) GetGameUUID(opts *bind.CallOpts, _gameType uint32, _rootClaim [32]byte, _extraData []byte) ([32]byte, error) { + var out []interface{} + err := _DisputeGameFactory.contract.Call(opts, &out, "getGameUUID", _gameType, _rootClaim, _extraData) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// GetGameUUID is a free data retrieval call binding the contract method 0x96cd9720. +// +// Solidity: function getGameUUID(uint32 _gameType, bytes32 _rootClaim, bytes _extraData) pure returns(bytes32 uuid_) +func (_DisputeGameFactory *DisputeGameFactorySession) GetGameUUID(_gameType uint32, _rootClaim [32]byte, _extraData []byte) ([32]byte, error) { + return _DisputeGameFactory.Contract.GetGameUUID(&_DisputeGameFactory.CallOpts, _gameType, _rootClaim, _extraData) +} + +// GetGameUUID is a free data retrieval call binding the contract method 0x96cd9720. +// +// Solidity: function getGameUUID(uint32 _gameType, bytes32 _rootClaim, bytes _extraData) pure returns(bytes32 uuid_) +func (_DisputeGameFactory *DisputeGameFactoryCallerSession) GetGameUUID(_gameType uint32, _rootClaim [32]byte, _extraData []byte) ([32]byte, error) { + return _DisputeGameFactory.Contract.GetGameUUID(&_DisputeGameFactory.CallOpts, _gameType, _rootClaim, _extraData) +} + +// InitBonds is a free data retrieval call binding the contract method 0x6593dc6e. +// +// Solidity: function initBonds(uint32 ) view returns(uint256) +func (_DisputeGameFactory *DisputeGameFactoryCaller) InitBonds(opts *bind.CallOpts, arg0 uint32) (*big.Int, error) { + var out []interface{} + err := _DisputeGameFactory.contract.Call(opts, &out, "initBonds", arg0) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// InitBonds is a free data retrieval call binding the contract method 0x6593dc6e. +// +// Solidity: function initBonds(uint32 ) view returns(uint256) +func (_DisputeGameFactory *DisputeGameFactorySession) InitBonds(arg0 uint32) (*big.Int, error) { + return _DisputeGameFactory.Contract.InitBonds(&_DisputeGameFactory.CallOpts, arg0) +} + +// InitBonds is a free data retrieval call binding the contract method 0x6593dc6e. +// +// Solidity: function initBonds(uint32 ) view returns(uint256) +func (_DisputeGameFactory *DisputeGameFactoryCallerSession) InitBonds(arg0 uint32) (*big.Int, error) { + return _DisputeGameFactory.Contract.InitBonds(&_DisputeGameFactory.CallOpts, arg0) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_DisputeGameFactory *DisputeGameFactoryCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _DisputeGameFactory.contract.Call(opts, &out, "owner") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_DisputeGameFactory *DisputeGameFactorySession) Owner() (common.Address, error) { + return _DisputeGameFactory.Contract.Owner(&_DisputeGameFactory.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_DisputeGameFactory *DisputeGameFactoryCallerSession) Owner() (common.Address, error) { + return _DisputeGameFactory.Contract.Owner(&_DisputeGameFactory.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_DisputeGameFactory *DisputeGameFactoryCaller) Version(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _DisputeGameFactory.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 (_DisputeGameFactory *DisputeGameFactorySession) Version() (string, error) { + return _DisputeGameFactory.Contract.Version(&_DisputeGameFactory.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_DisputeGameFactory *DisputeGameFactoryCallerSession) Version() (string, error) { + return _DisputeGameFactory.Contract.Version(&_DisputeGameFactory.CallOpts) +} + +// Create is a paid mutator transaction binding the contract method 0x82ecf2f6. +// +// Solidity: function create(uint32 _gameType, bytes32 _rootClaim, bytes _extraData) payable returns(address proxy_) +func (_DisputeGameFactory *DisputeGameFactoryTransactor) Create(opts *bind.TransactOpts, _gameType uint32, _rootClaim [32]byte, _extraData []byte) (*types.Transaction, error) { + return _DisputeGameFactory.contract.Transact(opts, "create", _gameType, _rootClaim, _extraData) +} + +// Create is a paid mutator transaction binding the contract method 0x82ecf2f6. +// +// Solidity: function create(uint32 _gameType, bytes32 _rootClaim, bytes _extraData) payable returns(address proxy_) +func (_DisputeGameFactory *DisputeGameFactorySession) Create(_gameType uint32, _rootClaim [32]byte, _extraData []byte) (*types.Transaction, error) { + return _DisputeGameFactory.Contract.Create(&_DisputeGameFactory.TransactOpts, _gameType, _rootClaim, _extraData) +} + +// Create is a paid mutator transaction binding the contract method 0x82ecf2f6. +// +// Solidity: function create(uint32 _gameType, bytes32 _rootClaim, bytes _extraData) payable returns(address proxy_) +func (_DisputeGameFactory *DisputeGameFactoryTransactorSession) Create(_gameType uint32, _rootClaim [32]byte, _extraData []byte) (*types.Transaction, error) { + return _DisputeGameFactory.Contract.Create(&_DisputeGameFactory.TransactOpts, _gameType, _rootClaim, _extraData) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. +// +// Solidity: function initialize(address _owner) returns() +func (_DisputeGameFactory *DisputeGameFactoryTransactor) Initialize(opts *bind.TransactOpts, _owner common.Address) (*types.Transaction, error) { + return _DisputeGameFactory.contract.Transact(opts, "initialize", _owner) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. +// +// Solidity: function initialize(address _owner) returns() +func (_DisputeGameFactory *DisputeGameFactorySession) Initialize(_owner common.Address) (*types.Transaction, error) { + return _DisputeGameFactory.Contract.Initialize(&_DisputeGameFactory.TransactOpts, _owner) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. +// +// Solidity: function initialize(address _owner) returns() +func (_DisputeGameFactory *DisputeGameFactoryTransactorSession) Initialize(_owner common.Address) (*types.Transaction, error) { + return _DisputeGameFactory.Contract.Initialize(&_DisputeGameFactory.TransactOpts, _owner) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_DisputeGameFactory *DisputeGameFactoryTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DisputeGameFactory.contract.Transact(opts, "renounceOwnership") +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_DisputeGameFactory *DisputeGameFactorySession) RenounceOwnership() (*types.Transaction, error) { + return _DisputeGameFactory.Contract.RenounceOwnership(&_DisputeGameFactory.TransactOpts) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_DisputeGameFactory *DisputeGameFactoryTransactorSession) RenounceOwnership() (*types.Transaction, error) { + return _DisputeGameFactory.Contract.RenounceOwnership(&_DisputeGameFactory.TransactOpts) +} + +// SetImplementation is a paid mutator transaction binding the contract method 0x14f6b1a3. +// +// Solidity: function setImplementation(uint32 _gameType, address _impl) returns() +func (_DisputeGameFactory *DisputeGameFactoryTransactor) SetImplementation(opts *bind.TransactOpts, _gameType uint32, _impl common.Address) (*types.Transaction, error) { + return _DisputeGameFactory.contract.Transact(opts, "setImplementation", _gameType, _impl) +} + +// SetImplementation is a paid mutator transaction binding the contract method 0x14f6b1a3. +// +// Solidity: function setImplementation(uint32 _gameType, address _impl) returns() +func (_DisputeGameFactory *DisputeGameFactorySession) SetImplementation(_gameType uint32, _impl common.Address) (*types.Transaction, error) { + return _DisputeGameFactory.Contract.SetImplementation(&_DisputeGameFactory.TransactOpts, _gameType, _impl) +} + +// SetImplementation is a paid mutator transaction binding the contract method 0x14f6b1a3. +// +// Solidity: function setImplementation(uint32 _gameType, address _impl) returns() +func (_DisputeGameFactory *DisputeGameFactoryTransactorSession) SetImplementation(_gameType uint32, _impl common.Address) (*types.Transaction, error) { + return _DisputeGameFactory.Contract.SetImplementation(&_DisputeGameFactory.TransactOpts, _gameType, _impl) +} + +// SetInitBond is a paid mutator transaction binding the contract method 0x1e334240. +// +// Solidity: function setInitBond(uint32 _gameType, uint256 _initBond) returns() +func (_DisputeGameFactory *DisputeGameFactoryTransactor) SetInitBond(opts *bind.TransactOpts, _gameType uint32, _initBond *big.Int) (*types.Transaction, error) { + return _DisputeGameFactory.contract.Transact(opts, "setInitBond", _gameType, _initBond) +} + +// SetInitBond is a paid mutator transaction binding the contract method 0x1e334240. +// +// Solidity: function setInitBond(uint32 _gameType, uint256 _initBond) returns() +func (_DisputeGameFactory *DisputeGameFactorySession) SetInitBond(_gameType uint32, _initBond *big.Int) (*types.Transaction, error) { + return _DisputeGameFactory.Contract.SetInitBond(&_DisputeGameFactory.TransactOpts, _gameType, _initBond) +} + +// SetInitBond is a paid mutator transaction binding the contract method 0x1e334240. +// +// Solidity: function setInitBond(uint32 _gameType, uint256 _initBond) returns() +func (_DisputeGameFactory *DisputeGameFactoryTransactorSession) SetInitBond(_gameType uint32, _initBond *big.Int) (*types.Transaction, error) { + return _DisputeGameFactory.Contract.SetInitBond(&_DisputeGameFactory.TransactOpts, _gameType, _initBond) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_DisputeGameFactory *DisputeGameFactoryTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { + return _DisputeGameFactory.contract.Transact(opts, "transferOwnership", newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_DisputeGameFactory *DisputeGameFactorySession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _DisputeGameFactory.Contract.TransferOwnership(&_DisputeGameFactory.TransactOpts, newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_DisputeGameFactory *DisputeGameFactoryTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _DisputeGameFactory.Contract.TransferOwnership(&_DisputeGameFactory.TransactOpts, newOwner) +} + +// DisputeGameFactoryDisputeGameCreatedIterator is returned from FilterDisputeGameCreated and is used to iterate over the raw logs and unpacked data for DisputeGameCreated events raised by the DisputeGameFactory contract. +type DisputeGameFactoryDisputeGameCreatedIterator struct { + Event *DisputeGameFactoryDisputeGameCreated // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *DisputeGameFactoryDisputeGameCreatedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(DisputeGameFactoryDisputeGameCreated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(DisputeGameFactoryDisputeGameCreated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *DisputeGameFactoryDisputeGameCreatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *DisputeGameFactoryDisputeGameCreatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// DisputeGameFactoryDisputeGameCreated represents a DisputeGameCreated event raised by the DisputeGameFactory contract. +type DisputeGameFactoryDisputeGameCreated struct { + DisputeProxy common.Address + GameType uint32 + RootClaim [32]byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterDisputeGameCreated is a free log retrieval operation binding the contract event 0x5b565efe82411da98814f356d0e7bcb8f0219b8d970307c5afb4a6903a8b2e35. +// +// Solidity: event DisputeGameCreated(address indexed disputeProxy, uint32 indexed gameType, bytes32 indexed rootClaim) +func (_DisputeGameFactory *DisputeGameFactoryFilterer) FilterDisputeGameCreated(opts *bind.FilterOpts, disputeProxy []common.Address, gameType []uint32, rootClaim [][32]byte) (*DisputeGameFactoryDisputeGameCreatedIterator, error) { + + var disputeProxyRule []interface{} + for _, disputeProxyItem := range disputeProxy { + disputeProxyRule = append(disputeProxyRule, disputeProxyItem) + } + var gameTypeRule []interface{} + for _, gameTypeItem := range gameType { + gameTypeRule = append(gameTypeRule, gameTypeItem) + } + var rootClaimRule []interface{} + for _, rootClaimItem := range rootClaim { + rootClaimRule = append(rootClaimRule, rootClaimItem) + } + + logs, sub, err := _DisputeGameFactory.contract.FilterLogs(opts, "DisputeGameCreated", disputeProxyRule, gameTypeRule, rootClaimRule) + if err != nil { + return nil, err + } + return &DisputeGameFactoryDisputeGameCreatedIterator{contract: _DisputeGameFactory.contract, event: "DisputeGameCreated", logs: logs, sub: sub}, nil +} + +// WatchDisputeGameCreated is a free log subscription operation binding the contract event 0x5b565efe82411da98814f356d0e7bcb8f0219b8d970307c5afb4a6903a8b2e35. +// +// Solidity: event DisputeGameCreated(address indexed disputeProxy, uint32 indexed gameType, bytes32 indexed rootClaim) +func (_DisputeGameFactory *DisputeGameFactoryFilterer) WatchDisputeGameCreated(opts *bind.WatchOpts, sink chan<- *DisputeGameFactoryDisputeGameCreated, disputeProxy []common.Address, gameType []uint32, rootClaim [][32]byte) (event.Subscription, error) { + + var disputeProxyRule []interface{} + for _, disputeProxyItem := range disputeProxy { + disputeProxyRule = append(disputeProxyRule, disputeProxyItem) + } + var gameTypeRule []interface{} + for _, gameTypeItem := range gameType { + gameTypeRule = append(gameTypeRule, gameTypeItem) + } + var rootClaimRule []interface{} + for _, rootClaimItem := range rootClaim { + rootClaimRule = append(rootClaimRule, rootClaimItem) + } + + logs, sub, err := _DisputeGameFactory.contract.WatchLogs(opts, "DisputeGameCreated", disputeProxyRule, gameTypeRule, rootClaimRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(DisputeGameFactoryDisputeGameCreated) + if err := _DisputeGameFactory.contract.UnpackLog(event, "DisputeGameCreated", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseDisputeGameCreated is a log parse operation binding the contract event 0x5b565efe82411da98814f356d0e7bcb8f0219b8d970307c5afb4a6903a8b2e35. +// +// Solidity: event DisputeGameCreated(address indexed disputeProxy, uint32 indexed gameType, bytes32 indexed rootClaim) +func (_DisputeGameFactory *DisputeGameFactoryFilterer) ParseDisputeGameCreated(log types.Log) (*DisputeGameFactoryDisputeGameCreated, error) { + event := new(DisputeGameFactoryDisputeGameCreated) + if err := _DisputeGameFactory.contract.UnpackLog(event, "DisputeGameCreated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// DisputeGameFactoryImplementationSetIterator is returned from FilterImplementationSet and is used to iterate over the raw logs and unpacked data for ImplementationSet events raised by the DisputeGameFactory contract. +type DisputeGameFactoryImplementationSetIterator struct { + Event *DisputeGameFactoryImplementationSet // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *DisputeGameFactoryImplementationSetIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(DisputeGameFactoryImplementationSet) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(DisputeGameFactoryImplementationSet) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *DisputeGameFactoryImplementationSetIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *DisputeGameFactoryImplementationSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// DisputeGameFactoryImplementationSet represents a ImplementationSet event raised by the DisputeGameFactory contract. +type DisputeGameFactoryImplementationSet struct { + Impl common.Address + GameType uint32 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterImplementationSet is a free log retrieval operation binding the contract event 0xff513d80e2c7fa487608f70a618dfbc0cf415699dc69588c747e8c71566c88de. +// +// Solidity: event ImplementationSet(address indexed impl, uint32 indexed gameType) +func (_DisputeGameFactory *DisputeGameFactoryFilterer) FilterImplementationSet(opts *bind.FilterOpts, impl []common.Address, gameType []uint32) (*DisputeGameFactoryImplementationSetIterator, error) { + + var implRule []interface{} + for _, implItem := range impl { + implRule = append(implRule, implItem) + } + var gameTypeRule []interface{} + for _, gameTypeItem := range gameType { + gameTypeRule = append(gameTypeRule, gameTypeItem) + } + + logs, sub, err := _DisputeGameFactory.contract.FilterLogs(opts, "ImplementationSet", implRule, gameTypeRule) + if err != nil { + return nil, err + } + return &DisputeGameFactoryImplementationSetIterator{contract: _DisputeGameFactory.contract, event: "ImplementationSet", logs: logs, sub: sub}, nil +} + +// WatchImplementationSet is a free log subscription operation binding the contract event 0xff513d80e2c7fa487608f70a618dfbc0cf415699dc69588c747e8c71566c88de. +// +// Solidity: event ImplementationSet(address indexed impl, uint32 indexed gameType) +func (_DisputeGameFactory *DisputeGameFactoryFilterer) WatchImplementationSet(opts *bind.WatchOpts, sink chan<- *DisputeGameFactoryImplementationSet, impl []common.Address, gameType []uint32) (event.Subscription, error) { + + var implRule []interface{} + for _, implItem := range impl { + implRule = append(implRule, implItem) + } + var gameTypeRule []interface{} + for _, gameTypeItem := range gameType { + gameTypeRule = append(gameTypeRule, gameTypeItem) + } + + logs, sub, err := _DisputeGameFactory.contract.WatchLogs(opts, "ImplementationSet", implRule, gameTypeRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(DisputeGameFactoryImplementationSet) + if err := _DisputeGameFactory.contract.UnpackLog(event, "ImplementationSet", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseImplementationSet is a log parse operation binding the contract event 0xff513d80e2c7fa487608f70a618dfbc0cf415699dc69588c747e8c71566c88de. +// +// Solidity: event ImplementationSet(address indexed impl, uint32 indexed gameType) +func (_DisputeGameFactory *DisputeGameFactoryFilterer) ParseImplementationSet(log types.Log) (*DisputeGameFactoryImplementationSet, error) { + event := new(DisputeGameFactoryImplementationSet) + if err := _DisputeGameFactory.contract.UnpackLog(event, "ImplementationSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// DisputeGameFactoryInitBondUpdatedIterator is returned from FilterInitBondUpdated and is used to iterate over the raw logs and unpacked data for InitBondUpdated events raised by the DisputeGameFactory contract. +type DisputeGameFactoryInitBondUpdatedIterator struct { + Event *DisputeGameFactoryInitBondUpdated // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *DisputeGameFactoryInitBondUpdatedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(DisputeGameFactoryInitBondUpdated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(DisputeGameFactoryInitBondUpdated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *DisputeGameFactoryInitBondUpdatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *DisputeGameFactoryInitBondUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// DisputeGameFactoryInitBondUpdated represents a InitBondUpdated event raised by the DisputeGameFactory contract. +type DisputeGameFactoryInitBondUpdated struct { + GameType uint32 + NewBond *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInitBondUpdated is a free log retrieval operation binding the contract event 0x74d6665c4b26d5596a5aa13d3014e0c06af4d322075a797f87b03cd4c5bc91ca. +// +// Solidity: event InitBondUpdated(uint32 indexed gameType, uint256 indexed newBond) +func (_DisputeGameFactory *DisputeGameFactoryFilterer) FilterInitBondUpdated(opts *bind.FilterOpts, gameType []uint32, newBond []*big.Int) (*DisputeGameFactoryInitBondUpdatedIterator, error) { + + var gameTypeRule []interface{} + for _, gameTypeItem := range gameType { + gameTypeRule = append(gameTypeRule, gameTypeItem) + } + var newBondRule []interface{} + for _, newBondItem := range newBond { + newBondRule = append(newBondRule, newBondItem) + } + + logs, sub, err := _DisputeGameFactory.contract.FilterLogs(opts, "InitBondUpdated", gameTypeRule, newBondRule) + if err != nil { + return nil, err + } + return &DisputeGameFactoryInitBondUpdatedIterator{contract: _DisputeGameFactory.contract, event: "InitBondUpdated", logs: logs, sub: sub}, nil +} + +// WatchInitBondUpdated is a free log subscription operation binding the contract event 0x74d6665c4b26d5596a5aa13d3014e0c06af4d322075a797f87b03cd4c5bc91ca. +// +// Solidity: event InitBondUpdated(uint32 indexed gameType, uint256 indexed newBond) +func (_DisputeGameFactory *DisputeGameFactoryFilterer) WatchInitBondUpdated(opts *bind.WatchOpts, sink chan<- *DisputeGameFactoryInitBondUpdated, gameType []uint32, newBond []*big.Int) (event.Subscription, error) { + + var gameTypeRule []interface{} + for _, gameTypeItem := range gameType { + gameTypeRule = append(gameTypeRule, gameTypeItem) + } + var newBondRule []interface{} + for _, newBondItem := range newBond { + newBondRule = append(newBondRule, newBondItem) + } + + logs, sub, err := _DisputeGameFactory.contract.WatchLogs(opts, "InitBondUpdated", gameTypeRule, newBondRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(DisputeGameFactoryInitBondUpdated) + if err := _DisputeGameFactory.contract.UnpackLog(event, "InitBondUpdated", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseInitBondUpdated is a log parse operation binding the contract event 0x74d6665c4b26d5596a5aa13d3014e0c06af4d322075a797f87b03cd4c5bc91ca. +// +// Solidity: event InitBondUpdated(uint32 indexed gameType, uint256 indexed newBond) +func (_DisputeGameFactory *DisputeGameFactoryFilterer) ParseInitBondUpdated(log types.Log) (*DisputeGameFactoryInitBondUpdated, error) { + event := new(DisputeGameFactoryInitBondUpdated) + if err := _DisputeGameFactory.contract.UnpackLog(event, "InitBondUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// DisputeGameFactoryInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the DisputeGameFactory contract. +type DisputeGameFactoryInitializedIterator struct { + Event *DisputeGameFactoryInitialized // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *DisputeGameFactoryInitializedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(DisputeGameFactoryInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(DisputeGameFactoryInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *DisputeGameFactoryInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *DisputeGameFactoryInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// DisputeGameFactoryInitialized represents a Initialized event raised by the DisputeGameFactory contract. +type DisputeGameFactoryInitialized struct { + Version uint8 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_DisputeGameFactory *DisputeGameFactoryFilterer) FilterInitialized(opts *bind.FilterOpts) (*DisputeGameFactoryInitializedIterator, error) { + + logs, sub, err := _DisputeGameFactory.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &DisputeGameFactoryInitializedIterator{contract: _DisputeGameFactory.contract, event: "Initialized", logs: logs, sub: sub}, nil +} + +// WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_DisputeGameFactory *DisputeGameFactoryFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *DisputeGameFactoryInitialized) (event.Subscription, error) { + + logs, sub, err := _DisputeGameFactory.contract.WatchLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(DisputeGameFactoryInitialized) + if err := _DisputeGameFactory.contract.UnpackLog(event, "Initialized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_DisputeGameFactory *DisputeGameFactoryFilterer) ParseInitialized(log types.Log) (*DisputeGameFactoryInitialized, error) { + event := new(DisputeGameFactoryInitialized) + if err := _DisputeGameFactory.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// DisputeGameFactoryOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the DisputeGameFactory contract. +type DisputeGameFactoryOwnershipTransferredIterator struct { + Event *DisputeGameFactoryOwnershipTransferred // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *DisputeGameFactoryOwnershipTransferredIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(DisputeGameFactoryOwnershipTransferred) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(DisputeGameFactoryOwnershipTransferred) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *DisputeGameFactoryOwnershipTransferredIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *DisputeGameFactoryOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// DisputeGameFactoryOwnershipTransferred represents a OwnershipTransferred event raised by the DisputeGameFactory contract. +type DisputeGameFactoryOwnershipTransferred struct { + PreviousOwner common.Address + NewOwner common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_DisputeGameFactory *DisputeGameFactoryFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*DisputeGameFactoryOwnershipTransferredIterator, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _DisputeGameFactory.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return &DisputeGameFactoryOwnershipTransferredIterator{contract: _DisputeGameFactory.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_DisputeGameFactory *DisputeGameFactoryFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *DisputeGameFactoryOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _DisputeGameFactory.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(DisputeGameFactoryOwnershipTransferred) + if err := _DisputeGameFactory.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_DisputeGameFactory *DisputeGameFactoryFilterer) ParseOwnershipTransferred(log types.Log) (*DisputeGameFactoryOwnershipTransferred, error) { + event := new(DisputeGameFactoryOwnershipTransferred) + if err := _DisputeGameFactory.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/op-e2e2/bindings/eas.go b/op-e2e2/bindings/eas.go new file mode 100644 index 000000000000..ff8141960bce --- /dev/null +++ b/op-e2e2/bindings/eas.go @@ -0,0 +1,1693 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// Attestation is an auto generated low-level Go binding around an user-defined struct. +type Attestation struct { + Uid [32]byte + Schema [32]byte + Time uint64 + ExpirationTime uint64 + RevocationTime uint64 + RefUID [32]byte + Recipient common.Address + Attester common.Address + Revocable bool + Data []byte +} + +// AttestationRequest is an auto generated low-level Go binding around an user-defined struct. +type AttestationRequest struct { + Schema [32]byte + Data AttestationRequestData +} + +// AttestationRequestData is an auto generated low-level Go binding around an user-defined struct. +type AttestationRequestData struct { + Recipient common.Address + ExpirationTime uint64 + Revocable bool + RefUID [32]byte + Data []byte + Value *big.Int +} + +// DelegatedAttestationRequest is an auto generated low-level Go binding around an user-defined struct. +type DelegatedAttestationRequest struct { + Schema [32]byte + Data AttestationRequestData + Signature Signature + Attester common.Address + Deadline uint64 +} + +// DelegatedRevocationRequest is an auto generated low-level Go binding around an user-defined struct. +type DelegatedRevocationRequest struct { + Schema [32]byte + Data RevocationRequestData + Signature Signature + Revoker common.Address + Deadline uint64 +} + +// MultiAttestationRequest is an auto generated low-level Go binding around an user-defined struct. +type MultiAttestationRequest struct { + Schema [32]byte + Data []AttestationRequestData +} + +// MultiDelegatedAttestationRequest is an auto generated low-level Go binding around an user-defined struct. +type MultiDelegatedAttestationRequest struct { + Schema [32]byte + Data []AttestationRequestData + Signatures []Signature + Attester common.Address + Deadline uint64 +} + +// MultiDelegatedRevocationRequest is an auto generated low-level Go binding around an user-defined struct. +type MultiDelegatedRevocationRequest struct { + Schema [32]byte + Data []RevocationRequestData + Signatures []Signature + Revoker common.Address + Deadline uint64 +} + +// MultiRevocationRequest is an auto generated low-level Go binding around an user-defined struct. +type MultiRevocationRequest struct { + Schema [32]byte + Data []RevocationRequestData +} + +// RevocationRequest is an auto generated low-level Go binding around an user-defined struct. +type RevocationRequest struct { + Schema [32]byte + Data RevocationRequestData +} + +// RevocationRequestData is an auto generated low-level Go binding around an user-defined struct. +type RevocationRequestData struct { + Uid [32]byte + Value *big.Int +} + +// Signature is an auto generated low-level Go binding around an user-defined struct. +type Signature struct { + V uint8 + R [32]byte + S [32]byte +} + +// EASMetaData contains all meta data concerning the EAS contract. +var EASMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"attest\",\"inputs\":[{\"name\":\"request\",\"type\":\"tuple\",\"internalType\":\"structAttestationRequest\",\"components\":[{\"name\":\"schema\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"data\",\"type\":\"tuple\",\"internalType\":\"structAttestationRequestData\",\"components\":[{\"name\":\"recipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"expirationTime\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revocable\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"refUID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"attestByDelegation\",\"inputs\":[{\"name\":\"delegatedRequest\",\"type\":\"tuple\",\"internalType\":\"structDelegatedAttestationRequest\",\"components\":[{\"name\":\"schema\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"data\",\"type\":\"tuple\",\"internalType\":\"structAttestationRequestData\",\"components\":[{\"name\":\"recipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"expirationTime\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revocable\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"refUID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"signature\",\"type\":\"tuple\",\"internalType\":\"structSignature\",\"components\":[{\"name\":\"v\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"r\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"s\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"name\":\"attester\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"deadline\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"getAttestTypeHash\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"getAttestation\",\"inputs\":[{\"name\":\"uid\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structAttestation\",\"components\":[{\"name\":\"uid\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"schema\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"time\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"expirationTime\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revocationTime\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"refUID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"recipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"attester\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"revocable\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getDomainSeparator\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getName\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getNonce\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getRevokeOffchain\",\"inputs\":[{\"name\":\"revoker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"data\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getRevokeTypeHash\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"getSchemaRegistry\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractISchemaRegistry\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"getTimestamp\",\"inputs\":[{\"name\":\"data\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"increaseNonce\",\"inputs\":[{\"name\":\"newNonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"isAttestationValid\",\"inputs\":[{\"name\":\"uid\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"multiAttest\",\"inputs\":[{\"name\":\"multiRequests\",\"type\":\"tuple[]\",\"internalType\":\"structMultiAttestationRequest[]\",\"components\":[{\"name\":\"schema\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"data\",\"type\":\"tuple[]\",\"internalType\":\"structAttestationRequestData[]\",\"components\":[{\"name\":\"recipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"expirationTime\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revocable\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"refUID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"}],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"multiAttestByDelegation\",\"inputs\":[{\"name\":\"multiDelegatedRequests\",\"type\":\"tuple[]\",\"internalType\":\"structMultiDelegatedAttestationRequest[]\",\"components\":[{\"name\":\"schema\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"data\",\"type\":\"tuple[]\",\"internalType\":\"structAttestationRequestData[]\",\"components\":[{\"name\":\"recipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"expirationTime\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revocable\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"refUID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"signatures\",\"type\":\"tuple[]\",\"internalType\":\"structSignature[]\",\"components\":[{\"name\":\"v\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"r\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"s\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"name\":\"attester\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"deadline\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"}],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"multiRevoke\",\"inputs\":[{\"name\":\"multiRequests\",\"type\":\"tuple[]\",\"internalType\":\"structMultiRevocationRequest[]\",\"components\":[{\"name\":\"schema\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"data\",\"type\":\"tuple[]\",\"internalType\":\"structRevocationRequestData[]\",\"components\":[{\"name\":\"uid\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}]}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"multiRevokeByDelegation\",\"inputs\":[{\"name\":\"multiDelegatedRequests\",\"type\":\"tuple[]\",\"internalType\":\"structMultiDelegatedRevocationRequest[]\",\"components\":[{\"name\":\"schema\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"data\",\"type\":\"tuple[]\",\"internalType\":\"structRevocationRequestData[]\",\"components\":[{\"name\":\"uid\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"signatures\",\"type\":\"tuple[]\",\"internalType\":\"structSignature[]\",\"components\":[{\"name\":\"v\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"r\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"s\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"name\":\"revoker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"deadline\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"multiRevokeOffchain\",\"inputs\":[{\"name\":\"data\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"multiTimestamp\",\"inputs\":[{\"name\":\"data\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"revoke\",\"inputs\":[{\"name\":\"request\",\"type\":\"tuple\",\"internalType\":\"structRevocationRequest\",\"components\":[{\"name\":\"schema\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"data\",\"type\":\"tuple\",\"internalType\":\"structRevocationRequestData\",\"components\":[{\"name\":\"uid\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}]}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"revokeByDelegation\",\"inputs\":[{\"name\":\"delegatedRequest\",\"type\":\"tuple\",\"internalType\":\"structDelegatedRevocationRequest\",\"components\":[{\"name\":\"schema\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"data\",\"type\":\"tuple\",\"internalType\":\"structRevocationRequestData\",\"components\":[{\"name\":\"uid\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"signature\",\"type\":\"tuple\",\"internalType\":\"structSignature\",\"components\":[{\"name\":\"v\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"r\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"s\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"name\":\"revoker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"deadline\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"revokeOffchain\",\"inputs\":[{\"name\":\"data\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"timestamp\",\"inputs\":[{\"name\":\"data\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"Attested\",\"inputs\":[{\"name\":\"recipient\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"attester\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"uid\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"schemaUID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"NonceIncreased\",\"inputs\":[{\"name\":\"oldNonce\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"newNonce\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Revoked\",\"inputs\":[{\"name\":\"recipient\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"attester\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"uid\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"schemaUID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RevokedOffchain\",\"inputs\":[{\"name\":\"revoker\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"data\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"timestamp\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Timestamped\",\"inputs\":[{\"name\":\"data\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"timestamp\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"AccessDenied\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"AlreadyRevoked\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"AlreadyRevokedOffchain\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"AlreadyTimestamped\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"DeadlineExpired\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InsufficientValue\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidAttestation\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidAttestations\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidExpirationTime\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidLength\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidNonce\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidOffset\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidRegistry\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidRevocation\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidRevocations\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidSchema\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidSignature\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidVerifier\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Irrevocable\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotFound\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotPayable\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"WrongSchema\",\"inputs\":[]}]", + Bin: "0x61016060405234801561001157600080fd5b50604080518082018252600381526245415360e81b60208083019182528351808501855260058152640312e332e360dc1b908201529151812060e08190527f6a08c3e203132c561752255a4d52ffae85bb9c5d33cb3291520dea1b843563896101008190524660a081815286517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818801819052818901959095526060810193909352608080840192909252308382018190528751808503909201825260c093840190975280519501949094209093529290915261012091909152516101405260805160a05160c05160e05161010051610120516101405161457e61014b600039600061073701526000612784015260006127d3015260006127ae01526000612707015260006127310152600061275b015261457e6000f3fe60806040526004361061018b5760003560e01c806395411525116100d6578063d45c44351161007f578063ed24911d11610059578063ed24911d146104fd578063f10b5cc814610512578063f17325e71461054157600080fd5b8063d45c443514610467578063e30bb5631461049e578063e71ff365146104dd57600080fd5b8063b469318d116100b0578063b469318d146103ba578063b83010d314610414578063cf190f341461044757600080fd5b80639541152514610367578063a3112a641461037a578063a6d4dbc7146103a757600080fd5b806344adc90e116101385780634d003070116101125780634d003070146102de57806354fd4d50146102fe57806379f7573a1461034757600080fd5b806344adc90e1461029857806346926267146102b85780634cb7e9e5146102cb57600080fd5b806317d7de7c1161016957806317d7de7c146102205780632d0335ab146102425780633c0427151461028557600080fd5b80630eabf6601461019057806312b11a17146101a557806313893f61146101e7575b600080fd5b6101a361019e3660046134c8565b610554565b005b3480156101b157600080fd5b507ffeb2925a02bae3dae48d424a0437a2b6ac939aa9230ddc55a1a76f065d9880765b6040519081526020015b60405180910390f35b3480156101f357600080fd5b506102076102023660046134c8565b6106eb565b60405167ffffffffffffffff90911681526020016101de565b34801561022c57600080fd5b50610235610730565b6040516101de9190613578565b34801561024e57600080fd5b506101d461025d3660046135bd565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b6101d46102933660046135da565b610760565b6102ab6102a63660046134c8565b610863565b6040516101de9190613615565b6101a36102c6366004613659565b6109e4565b6101a36102d93660046134c8565b610a68565b3480156102ea57600080fd5b506102076102f9366004613671565b610b4b565b34801561030a57600080fd5b506102356040518060400160405280600581526020017f312e342e3000000000000000000000000000000000000000000000000000000081525081565b34801561035357600080fd5b506101a3610362366004613671565b610b58565b6102ab6103753660046134c8565b610bef565b34801561038657600080fd5b5061039a610395366004613671565b610e62565b6040516101de9190613771565b6101a36103b5366004613784565b611025565b3480156103c657600080fd5b506102076103d5366004613797565b73ffffffffffffffffffffffffffffffffffffffff919091166000908152603460209081526040808320938352929052205467ffffffffffffffff1690565b34801561042057600080fd5b507fb5d556f07587ec0f08cf386545cc4362c702a001650c2058002615ee5c9d1e756101d4565b34801561045357600080fd5b50610207610462366004613671565b6110ca565b34801561047357600080fd5b50610207610482366004613671565b60009081526033602052604090205467ffffffffffffffff1690565b3480156104aa57600080fd5b506104cd6104b9366004613671565b600090815260326020526040902054151590565b60405190151581526020016101de565b3480156104e957600080fd5b506102076104f83660046134c8565b6110d8565b34801561050957600080fd5b506101d4611110565b34801561051e57600080fd5b5060405173420000000000000000000000000000000000002081526020016101de565b6101d461054f3660046137c3565b61111a565b348160005b818110156106e4577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82018114600086868481811061059a5761059a6137fe565b90506020028101906105ac919061382d565b6105b590613ac3565b60208101518051919250908015806105d257508260400151518114155b15610609576040517f947d5a8400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b818110156106ad576106a56040518060a001604052808660000151815260200185848151811061063e5761063e6137fe565b6020026020010151815260200186604001518481518110610661576106616137fe565b60200260200101518152602001866060015173ffffffffffffffffffffffffffffffffffffffff168152602001866080015167ffffffffffffffff168152506111d8565b60010161060c565b506106c383600001518385606001518a886113e9565b6106cd9088613bed565b9650505050506106dd8160010190565b9050610559565b5050505050565b60004282825b818110156107245761071c3387878481811061070f5761070f6137fe565b9050602002013585611a18565b6001016106f1565b50909150505b92915050565b606061075b7f0000000000000000000000000000000000000000000000000000000000000000611b17565b905090565b600061077361076e83613d22565b611ca5565b604080516001808252818301909252600091816020015b6040805160c081018252600080825260208083018290529282018190526060808301829052608083015260a082015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90920191018161078a5790505090506107f86020840184613d9d565b61080190613dd1565b81600081518110610814576108146137fe565b602090810291909101015261083d83358261083560c0870160a088016135bd565b346001611e2f565b60200151600081518110610853576108536137fe565b6020026020010151915050919050565b60608160008167ffffffffffffffff8111156108815761088161386b565b6040519080825280602002602001820160405280156108b457816020015b606081526020019060019003908161089f5790505b509050600034815b848110156109ce577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff85018114368989848181106108fc576108fc6137fe565b905060200281019061090e9190613ddd565b905061091d6020820182613e11565b9050600003610958576040517f947d5a8400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061097d823561096c6020850185613e11565b61097591613e79565b338887611e2f565b805190915061098c9086613bed565b945080602001518785815181106109a5576109a56137fe565b6020026020010181905250806020015151860195505050506109c78160010190565b90506108bc565b506109d98383612541565b979650505050505050565b604080516001808252818301909252600091816020015b60408051808201909152600080825260208201528152602001906001900390816109fb579050509050610a3636839003830160208401613eed565b81600081518110610a4957610a496137fe565b6020908102919091010152610a63823582333460016113e9565b505050565b348160005b818110156106e4577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8201811436868684818110610aad57610aad6137fe565b9050602002810190610abf9190613ddd565b9050610b2c8135610ad36020840184613f09565b808060200260200160405190810160405280939291908181526020016000905b82821015610b1f57610b1060408302860136819003810190613eed565b81526020019060010190610af3565b50505050503388866113e9565b610b369086613bed565b94505050610b448160010190565b9050610a6d565b60004261072a838261262b565b33600090815260208190526040902054808211610ba1576040517f756688fe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336000908152602081815260409182902084905581518381529081018490527f57b09af877df9068fd60a69d7b21f5576b8b38955812d6ae4ac52942f1e38fb7910160405180910390a15050565b60608160008167ffffffffffffffff811115610c0d57610c0d61386b565b604051908082528060200260200182016040528015610c4057816020015b6060815260200190600190039081610c2b5790505b509050600034815b848110156109ce577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8501811436898984818110610c8857610c886137fe565b9050602002810190610c9a919061382d565b9050366000610cac6020840184613e11565b909250905080801580610ccd5750610cc76040850185613f71565b90508114155b15610d04576040517f947d5a8400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b81811015610de557610ddd6040518060a0016040528087600001358152602001868685818110610d3957610d396137fe565b9050602002810190610d4b9190613d9d565b610d5490613dd1565b8152602001610d666040890189613f71565b85818110610d7657610d766137fe565b905060600201803603810190610d8c9190613fd8565b8152602001610da16080890160608a016135bd565b73ffffffffffffffffffffffffffffffffffffffff168152602001610dcc60a0890160808a01613ff4565b67ffffffffffffffff169052611ca5565b600101610d07565b506000610e0e8535610df78587613e79565b610e076080890160608a016135bd565b8b8a611e2f565b8051909150610e1d9089613bed565b975080602001518a8881518110610e3657610e366137fe565b602002602001018190525080602001515189019850505050505050610e5b8160010190565b9050610c48565b604080516101408101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c0820183905260e0820183905261010082019290925261012081019190915260008281526032602090815260409182902082516101408101845281548152600182015492810192909252600281015467ffffffffffffffff808216948401949094526801000000000000000081048416606084015270010000000000000000000000000000000090049092166080820152600382015460a0820152600482015473ffffffffffffffffffffffffffffffffffffffff90811660c0830152600583015490811660e083015274010000000000000000000000000000000000000000900460ff16151561010082015260068201805491929161012084019190610f9c9061400f565b80601f0160208091040260200160405190810160405280929190818152602001828054610fc89061400f565b80156110155780601f10610fea57610100808354040283529160200191611015565b820191906000526020600020905b815481529060010190602001808311610ff857829003601f168201915b5050505050815250509050919050565b61103c6110373683900383018361405c565b6111d8565b604080516001808252818301909252600091816020015b604080518082019091526000808252602082015281526020019060019003908161105357905050905061108e36839003830160208401613eed565b816000815181106110a1576110a16137fe565b6020908102919091010152610a638235826110c260e0860160c087016135bd565b3460016113e9565b60004261072a338483611a18565b60004282825b81811015610724576111088686838181106110fb576110fb6137fe565b905060200201358461262b565b6001016110de565b600061075b6126ed565b604080516001808252818301909252600091829190816020015b6040805160c081018252600080825260208083018290529282018190526060808301829052608083015260a082015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9092019101816111345790505090506111a26020840184613d9d565b6111ab90613dd1565b816000815181106111be576111be6137fe565b602090810291909101015261083d83358233346001611e2f565b608081015167ffffffffffffffff161580159061120c57504267ffffffffffffffff16816080015167ffffffffffffffff16105b15611243576040517f1ab7da6b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6020808201516040808401516060850151855184518587015173ffffffffffffffffffffffffffffffffffffffff84166000908152978890529487208054969794969495611337957fb5d556f07587ec0f08cf386545cc4362c702a001650c2058002615ee5c9d1e7595949392886112ba836140ca565b909155506080808c015160408051602081019990995273ffffffffffffffffffffffffffffffffffffffff9097169688019690965260608701949094529285019190915260a084015260c083015267ffffffffffffffff1660e0820152610100015b60405160208183030381529060405280519060200120612821565b90506113ad84606001518284602001518560400151866000015160405160200161139993929190928352602083019190915260f81b7fff0000000000000000000000000000000000000000000000000000000000000016604082015260410190565b604051602081830303815290604052612834565b6113e3576040517f8baa579f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050565b6040517fa2ea7c6e0000000000000000000000000000000000000000000000000000000081526004810186905260009081907342000000000000000000000000000000000000209063a2ea7c6e90602401600060405180830381865afa158015611457573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405261149d9190810190614102565b80519091506114d8576040517fbf37b20e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b855160008167ffffffffffffffff8111156114f5576114f561386b565b60405190808252806020026020018201604052801561159457816020015b60408051610140810182526000808252602080830182905292820181905260608083018290526080830182905260a0830182905260c0830182905260e0830182905261010083019190915261012082015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9092019101816115135790505b50905060008267ffffffffffffffff8111156115b2576115b261386b565b6040519080825280602002602001820160405280156115db578160200160208202803683370190505b50905060005b838110156119fa5760008a82815181106115fd576115fd6137fe565b6020908102919091018101518051600090815260329092526040909120805491925090611656576040517fc5723b5100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8c816001015414611693576040517fbf37b20e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600581015473ffffffffffffffffffffffffffffffffffffffff8c81169116146116e9576040517f4ca8886700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600581015474010000000000000000000000000000000000000000900460ff1661173f576040517f157bd4c300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002810154700100000000000000000000000000000000900467ffffffffffffffff1615611799576040517f905e710700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b426002820180547fffffffffffffffff0000000000000000ffffffffffffffffffffffffffffffff811670010000000000000000000000000000000067ffffffffffffffff948516810291821793849055604080516101408101825287548152600188015460208201529386169286169290921791830191909152680100000000000000008304841660608301529091049091166080820152600382015460a0820152600482015473ffffffffffffffffffffffffffffffffffffffff90811660c0830152600583015490811660e083015274010000000000000000000000000000000000000000900460ff16151561010082015260068201805483916101208401916118a59061400f565b80601f01602080910402602001604051908101604052809291908181526020018280546118d19061400f565b801561191e5780601f106118f35761010080835404028352916020019161191e565b820191906000526020600020905b81548152906001019060200180831161190157829003601f168201915b505050505081525050858481518110611939576119396137fe565b6020026020010181905250816020015184848151811061195b5761195b6137fe565b6020026020010181815250508c8b73ffffffffffffffffffffffffffffffffffffffff16868581518110611991576119916137fe565b602002602001015160c0015173ffffffffffffffffffffffffffffffffffffffff167ff930a6e2523c9cc298691873087a740550b8fc85a0680830414c148ed927f61585600001516040516119e891815260200190565b60405180910390a450506001016115e1565b50611a0a84838360018b8b612a03565b9a9950505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff83166000908152603460209081526040808320858452918290529091205467ffffffffffffffff1615611a8c576040517fec9d6eeb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008381526020829052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff861690811790915590519091859173ffffffffffffffffffffffffffffffffffffffff8816917f92a1f7a41a7c585a8b09e25b195e225b1d43248daca46b0faf9e0792777a222991a450505050565b604080516020808252818301909252606091600091906020820181803683370190505090506000805b6020811015611be2576000858260208110611b5d57611b5d6137fe565b1a60f81b90507fff000000000000000000000000000000000000000000000000000000000000008116600003611b935750611be2565b80848481518110611ba657611ba66137fe565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053505060019182019101611b40565b5060008167ffffffffffffffff811115611bfe57611bfe61386b565b6040519080825280601f01601f191660200182016040528015611c28576020820181803683370190505b50905060005b82811015611c9c57838181518110611c4857611c486137fe565b602001015160f81c60f81b828281518110611c6557611c656137fe565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600101611c2e565b50949350505050565b608081015167ffffffffffffffff1615801590611cd957504267ffffffffffffffff16816080015167ffffffffffffffff16105b15611d10576040517f1ab7da6b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6020808201516040808401516060808601518651855186880151868801519488015160808901518051908b012060a08a015173ffffffffffffffffffffffffffffffffffffffff871660009081529b8c9052988b2080549a9b989a9899611337997ffeb2925a02bae3dae48d424a0437a2b6ac939aa9230ddc55a1a76f065d988076999493928c611da0836140ca565b919050558e6080015160405160200161131c9b9a999897969594939291909a8b5273ffffffffffffffffffffffffffffffffffffffff998a1660208c015260408b019890985295909716606089015267ffffffffffffffff938416608089015291151560a088015260c087015260e0860152610100850193909352610120840152166101408201526101600190565b60408051808201909152600081526060602082015284516040805180820190915260008152606060208201528167ffffffffffffffff811115611e7457611e7461386b565b604051908082528060200260200182016040528015611e9d578160200160208202803683370190505b5060208201526040517fa2ea7c6e000000000000000000000000000000000000000000000000000000008152600481018990526000907342000000000000000000000000000000000000209063a2ea7c6e90602401600060405180830381865afa158015611f0f573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052611f559190810190614102565b8051909150611f90576040517fbf37b20e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008367ffffffffffffffff811115611fab57611fab61386b565b60405190808252806020026020018201604052801561204a57816020015b60408051610140810182526000808252602080830182905292820181905260608083018290526080830182905260a0830182905260c0830182905260e0830182905261010083019190915261012082015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff909201910181611fc95790505b50905060008467ffffffffffffffff8111156120685761206861386b565b604051908082528060200260200182016040528015612091578160200160208202803683370190505b50905060005b858110156125205760008b82815181106120b3576120b36137fe565b60200260200101519050600067ffffffffffffffff16816020015167ffffffffffffffff16141580156120fe57504267ffffffffffffffff16816020015167ffffffffffffffff1611155b15612135576040517f08e8b93700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8460400151158015612148575080604001515b1561217f576040517f157bd4c300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006040518061014001604052806000801b81526020018f81526020016121a34290565b67ffffffffffffffff168152602001836020015167ffffffffffffffff168152602001600067ffffffffffffffff16815260200183606001518152602001836000015173ffffffffffffffffffffffffffffffffffffffff1681526020018d73ffffffffffffffffffffffffffffffffffffffff16815260200183604001511515815260200183608001518152509050600080600090505b6122458382612df4565b600081815260326020526040902054909250156122645760010161223b565b81835260008281526032602090815260409182902085518155908501516001820155908401516002820180546060870151608088015167ffffffffffffffff908116700100000000000000000000000000000000027fffffffffffffffff0000000000000000ffffffffffffffffffffffffffffffff92821668010000000000000000027fffffffffffffffffffffffffffffffff000000000000000000000000000000009094169190951617919091171691909117905560a0840151600382015560c084015160048201805473ffffffffffffffffffffffffffffffffffffffff9283167fffffffffffffffffffffffff000000000000000000000000000000000000000090911617905560e0850151600583018054610100880151151574010000000000000000000000000000000000000000027fffffffffffffffffffffff000000000000000000000000000000000000000000909116929093169190911791909117905561012084015184919060068201906123e49082614228565b50505060608401511561243b57606084015160009081526032602052604090205461243b576040517fc5723b5100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8287868151811061244e5761244e6137fe565b60200260200101819052508360a00151868681518110612470576124706137fe565b6020026020010181815250508189602001518681518110612493576124936137fe565b6020026020010181815250508f8e73ffffffffffffffffffffffffffffffffffffffff16856000015173ffffffffffffffffffffffffffffffffffffffff167f8bf46bf4cfd674fa735a3d63ec1c9ad4153f033c290341f3a588b75685141b358560405161250391815260200190565b60405180910390a4505050506125198160010190565b9050612097565b5061253083838360008c8c612a03565b845250919998505050505050505050565b606060008267ffffffffffffffff81111561255e5761255e61386b565b604051908082528060200260200182016040528015612587578160200160208202803683370190505b508451909150600090815b818110156126205760008782815181106125ae576125ae6137fe565b6020026020010151905060008151905060005b8181101561260c578281815181106125db576125db6137fe565b60200260200101518787815181106125f5576125f56137fe565b6020908102919091010152600195860195016125c1565b5050506126198160010190565b9050612592565b509195945050505050565b60008281526033602052604090205467ffffffffffffffff161561267b576040517f2e26794600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008281526033602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff85169081179091559051909184917f5aafceeb1c7ad58e4a84898bdee37c02c0fc46e7d24e6b60e8209449f183459f9190a35050565b60003073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614801561275357507f000000000000000000000000000000000000000000000000000000000000000046145b1561277d57507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b600061072a61282e6126ed565b83612e53565b60008060006128438585612e95565b9092509050600081600481111561285c5761285c614342565b14801561289457508573ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b156128a4576001925050506129fc565b6000808773ffffffffffffffffffffffffffffffffffffffff16631626ba7e60e01b88886040516024016128d9929190614371565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009094169390931790925290516129629190614392565b600060405180830381855afa9150503d806000811461299d576040519150601f19603f3d011682016040523d82523d6000602084013e6129a2565b606091505b50915091508180156129b5575080516020145b80156129f5575080517f1626ba7e00000000000000000000000000000000000000000000000000000000906129f390830160209081019084016143a4565b145b9450505050505b9392505050565b84516000906001819003612a5b57612a538888600081518110612a2857612a286137fe565b602002602001015188600081518110612a4357612a436137fe565b6020026020010151888888612eda565b915050612dea565b602088015173ffffffffffffffffffffffffffffffffffffffff8116612afc5760005b82811015612ae157878181518110612a9857612a986137fe565b6020026020010151600014612ad9576040517f1574f9f300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600101612a7e565b508315612af157612af1856131f9565b600092505050612dea565b6000808273ffffffffffffffffffffffffffffffffffffffff1663ce46e0466040518163ffffffff1660e01b8152600401602060405180830381865afa158015612b4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b6e91906143bd565b905060005b84811015612c2b5760008a8281518110612b8f57612b8f6137fe565b6020026020010151905080600003612ba75750612c23565b82612bde576040517f1574f9f300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b88811115612c18576040517f1101129400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b978890039792909201915b600101612b73565b508715612d06576040517f88e5b2d900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8416906388e5b2d9908490612c88908e908e906004016143da565b60206040518083038185885af1158015612ca6573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190612ccb91906143bd565b612d01576040517fbf2f3a8b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612dd5565b6040517f91db0b7e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8416906391db0b7e908490612d5c908e908e906004016143da565b60206040518083038185885af1158015612d7a573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190612d9f91906143bd565b612dd5576040517fe8bee83900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8515612de457612de4876131f9565b50925050505b9695505050505050565b60208083015160c084015160e0850151604080870151606088015161010089015160a08a01516101208b01519451600099612e3599989796918c9101614493565b60405160208183030381529060405280519060200120905092915050565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201612e35565b6000808251604103612ecb5760208301516040840151606085015160001a612ebf8782858561320c565b94509450505050612ed3565b506000905060025b9250929050565b602086015160009073ffffffffffffffffffffffffffffffffffffffff8116612f4e578515612f35576040517f1574f9f300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8215612f4457612f44846131f9565b6000915050612dea565b8515613039578073ffffffffffffffffffffffffffffffffffffffff1663ce46e0466040518163ffffffff1660e01b8152600401602060405180830381865afa158015612f9f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fc391906143bd565b612ff9576040517f1574f9f300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b83861115613033576040517f1101129400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b85840393505b8415613111576040517fe49617e100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82169063e49617e1908890613093908b90600401613771565b60206040518083038185885af11580156130b1573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906130d691906143bd565b61310c576040517fccf3bb2700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6131de565b6040517fe60c350500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82169063e60c3505908890613165908b90600401613771565b60206040518083038185885af1158015613183573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906131a891906143bd565b6131de576040517fbd8ba84d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b82156131ed576131ed846131f9565b50939695505050505050565b8015613209576132093382613324565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115613243575060009050600361331b565b8460ff16601b1415801561325b57508460ff16601c14155b1561326c575060009050600461331b565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156132c0573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166133145760006001925092505061331b565b9150600090505b94509492505050565b80471015613393576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064015b60405180910390fd5b60008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d80600081146133ed576040519150601f19603f3d011682016040523d82523d6000602084013e6133f2565b606091505b5050905080610a63576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d61792068617665207265766572746564000000000000606482015260840161338a565b60008083601f84011261349557600080fd5b50813567ffffffffffffffff8111156134ad57600080fd5b6020830191508360208260051b8501011115612ed357600080fd5b600080602083850312156134db57600080fd5b823567ffffffffffffffff8111156134f257600080fd5b6134fe85828601613483565b90969095509350505050565b60005b8381101561352557818101518382015260200161350d565b50506000910152565b6000815180845261354681602086016020860161350a565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006129fc602083018461352e565b73ffffffffffffffffffffffffffffffffffffffff8116811461320957600080fd5b80356135b88161358b565b919050565b6000602082840312156135cf57600080fd5b81356129fc8161358b565b6000602082840312156135ec57600080fd5b813567ffffffffffffffff81111561360357600080fd5b820160e081850312156129fc57600080fd5b6020808252825182820181905260009190848201906040850190845b8181101561364d57835183529284019291840191600101613631565b50909695505050505050565b60006060828403121561366b57600080fd5b50919050565b60006020828403121561368357600080fd5b5035919050565b6000610140825184526020830151602085015260408301516136b8604086018267ffffffffffffffff169052565b5060608301516136d4606086018267ffffffffffffffff169052565b5060808301516136f0608086018267ffffffffffffffff169052565b5060a083015160a085015260c083015161372260c086018273ffffffffffffffffffffffffffffffffffffffff169052565b5060e083015161374a60e086018273ffffffffffffffffffffffffffffffffffffffff169052565b506101008381015115159085015261012080840151818601839052612dea8387018261352e565b6020815260006129fc602083018461368a565b6000610100828403121561366b57600080fd5b600080604083850312156137aa57600080fd5b82356137b58161358b565b946020939093013593505050565b6000602082840312156137d557600080fd5b813567ffffffffffffffff8111156137ec57600080fd5b8201604081850312156129fc57600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6183360301811261386157600080fd5b9190910192915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405160a0810167ffffffffffffffff811182821017156138bd576138bd61386b565b60405290565b60405160c0810167ffffffffffffffff811182821017156138bd576138bd61386b565b6040516080810167ffffffffffffffff811182821017156138bd576138bd61386b565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156139505761395061386b565b604052919050565b600067ffffffffffffffff8211156139725761397261386b565b5060051b60200190565b60006040828403121561398e57600080fd5b6040516040810181811067ffffffffffffffff821117156139b1576139b161386b565b604052823581526020928301359281019290925250919050565b6000606082840312156139dd57600080fd5b6040516060810181811067ffffffffffffffff82111715613a0057613a0061386b565b604052905080823560ff81168114613a1757600080fd5b8082525060208301356020820152604083013560408201525092915050565b600082601f830112613a4757600080fd5b81356020613a5c613a5783613958565b613909565b82815260609283028501820192828201919087851115613a7b57600080fd5b8387015b85811015613a9e57613a9189826139cb565b8452928401928101613a7f565b5090979650505050505050565b803567ffffffffffffffff811681146135b857600080fd5b600060a08236031215613ad557600080fd5b613add61389a565b8235815260208084013567ffffffffffffffff80821115613afd57600080fd5b9085019036601f830112613b1057600080fd5b8135613b1e613a5782613958565b81815260069190911b83018401908481019036831115613b3d57600080fd5b938501935b82851015613b6657613b54368661397c565b82528582019150604085019450613b42565b80868801525050506040860135925080831115613b8257600080fd5b5050613b9036828601613a36565b604083015250613ba2606084016135ad565b6060820152613bb360808401613aab565b608082015292915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8181038181111561072a5761072a613bbe565b801515811461320957600080fd5b600067ffffffffffffffff821115613c2857613c2861386b565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600060c08284031215613c6657600080fd5b613c6e6138c3565b90508135613c7b8161358b565b81526020613c8a838201613aab565b818301526040830135613c9c81613c00565b604083015260608381013590830152608083013567ffffffffffffffff811115613cc557600080fd5b8301601f81018513613cd657600080fd5b8035613ce4613a5782613c0e565b8181528684838501011115613cf857600080fd5b818484018583013760008483830101528060808601525050505060a082013560a082015292915050565b600060e08236031215613d3457600080fd5b613d3c61389a565b82358152602083013567ffffffffffffffff811115613d5a57600080fd5b613d6636828601613c54565b602083015250613d7936604085016139cb565b604082015260a0830135613d8c8161358b565b6060820152613bb360c08401613aab565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff4183360301811261386157600080fd5b600061072a3683613c54565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc183360301811261386157600080fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112613e4657600080fd5b83018035915067ffffffffffffffff821115613e6157600080fd5b6020019150600581901b3603821315612ed357600080fd5b6000613e87613a5784613958565b80848252602080830192508560051b850136811115613ea557600080fd5b855b81811015613ee157803567ffffffffffffffff811115613ec75760008081fd5b613ed336828a01613c54565b865250938201938201613ea7565b50919695505050505050565b600060408284031215613eff57600080fd5b6129fc838361397c565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112613f3e57600080fd5b83018035915067ffffffffffffffff821115613f5957600080fd5b6020019150600681901b3603821315612ed357600080fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112613fa657600080fd5b83018035915067ffffffffffffffff821115613fc157600080fd5b6020019150606081023603821315612ed357600080fd5b600060608284031215613fea57600080fd5b6129fc83836139cb565b60006020828403121561400657600080fd5b6129fc82613aab565b600181811c9082168061402357607f821691505b60208210810361366b577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000610100828403121561406f57600080fd5b61407761389a565b82358152614088846020850161397c565b602082015261409a84606085016139cb565b604082015260c08301356140ad8161358b565b60608201526140be60e08401613aab565b60808201529392505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036140fb576140fb613bbe565b5060010190565b6000602080838503121561411557600080fd5b825167ffffffffffffffff8082111561412d57600080fd5b908401906080828703121561414157600080fd5b6141496138e6565b825181528383015161415a8161358b565b81850152604083015161416c81613c00565b604082015260608301518281111561418357600080fd5b80840193505086601f84011261419857600080fd5b825191506141a8613a5783613c0e565b82815287858486010111156141bc57600080fd5b6141cb8386830187870161350a565b60608201529695505050505050565b601f821115610a6357600081815260208120601f850160051c810160208610156142015750805b601f850160051c820191505b818110156142205782815560010161420d565b505050505050565b815167ffffffffffffffff8111156142425761424261386b565b61425681614250845461400f565b846141da565b602080601f8311600181146142a957600084156142735750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555614220565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b828110156142f6578886015182559484019460019091019084016142d7565b508582101561433257878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b82815260406020820152600061438a604083018461352e565b949350505050565b6000825161386181846020870161350a565b6000602082840312156143b657600080fd5b5051919050565b6000602082840312156143cf57600080fd5b81516129fc81613c00565b6000604082016040835280855180835260608501915060608160051b8601019250602080880160005b8381101561444f577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa088870301855261443d86835161368a565b95509382019390820190600101614403565b50508584038187015286518085528782019482019350915060005b828110156144865784518452938101939281019260010161446a565b5091979650505050505050565b89815260007fffffffffffffffffffffffffffffffffffffffff000000000000000000000000808b60601b166020840152808a60601b166034840152507fffffffffffffffff000000000000000000000000000000000000000000000000808960c01b166048840152808860c01b1660508401525085151560f81b6058830152846059830152835161452c81607985016020880161350a565b80830190507fffffffff000000000000000000000000000000000000000000000000000000008460e01b166079820152607d81019150509a995050505050505050505056fea164736f6c6343000813000a", +} + +// EASABI is the input ABI used to generate the binding from. +// Deprecated: Use EASMetaData.ABI instead. +var EASABI = EASMetaData.ABI + +// EASBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use EASMetaData.Bin instead. +var EASBin = EASMetaData.Bin + +// DeployEAS deploys a new Ethereum contract, binding an instance of EAS to it. +func DeployEAS(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *EAS, error) { + parsed, err := EASMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(EASBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &EAS{EASCaller: EASCaller{contract: contract}, EASTransactor: EASTransactor{contract: contract}, EASFilterer: EASFilterer{contract: contract}}, nil +} + +// EAS is an auto generated Go binding around an Ethereum contract. +type EAS struct { + EASCaller // Read-only binding to the contract + EASTransactor // Write-only binding to the contract + EASFilterer // Log filterer for contract events +} + +// EASCaller is an auto generated read-only Go binding around an Ethereum contract. +type EASCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// EASTransactor is an auto generated write-only Go binding around an Ethereum contract. +type EASTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// EASFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type EASFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// EASSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type EASSession struct { + Contract *EAS // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// EASCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type EASCallerSession struct { + Contract *EASCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// EASTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type EASTransactorSession struct { + Contract *EASTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// EASRaw is an auto generated low-level Go binding around an Ethereum contract. +type EASRaw struct { + Contract *EAS // Generic contract binding to access the raw methods on +} + +// EASCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type EASCallerRaw struct { + Contract *EASCaller // Generic read-only contract binding to access the raw methods on +} + +// EASTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type EASTransactorRaw struct { + Contract *EASTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewEAS creates a new instance of EAS, bound to a specific deployed contract. +func NewEAS(address common.Address, backend bind.ContractBackend) (*EAS, error) { + contract, err := bindEAS(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &EAS{EASCaller: EASCaller{contract: contract}, EASTransactor: EASTransactor{contract: contract}, EASFilterer: EASFilterer{contract: contract}}, nil +} + +// NewEASCaller creates a new read-only instance of EAS, bound to a specific deployed contract. +func NewEASCaller(address common.Address, caller bind.ContractCaller) (*EASCaller, error) { + contract, err := bindEAS(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &EASCaller{contract: contract}, nil +} + +// NewEASTransactor creates a new write-only instance of EAS, bound to a specific deployed contract. +func NewEASTransactor(address common.Address, transactor bind.ContractTransactor) (*EASTransactor, error) { + contract, err := bindEAS(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &EASTransactor{contract: contract}, nil +} + +// NewEASFilterer creates a new log filterer instance of EAS, bound to a specific deployed contract. +func NewEASFilterer(address common.Address, filterer bind.ContractFilterer) (*EASFilterer, error) { + contract, err := bindEAS(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &EASFilterer{contract: contract}, nil +} + +// bindEAS binds a generic wrapper to an already deployed contract. +func bindEAS(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(EASABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_EAS *EASRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _EAS.Contract.EASCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_EAS *EASRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EAS.Contract.EASTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_EAS *EASRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _EAS.Contract.EASTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_EAS *EASCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _EAS.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_EAS *EASTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EAS.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_EAS *EASTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _EAS.Contract.contract.Transact(opts, method, params...) +} + +// GetAttestTypeHash is a free data retrieval call binding the contract method 0x12b11a17. +// +// Solidity: function getAttestTypeHash() pure returns(bytes32) +func (_EAS *EASCaller) GetAttestTypeHash(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _EAS.contract.Call(opts, &out, "getAttestTypeHash") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// GetAttestTypeHash is a free data retrieval call binding the contract method 0x12b11a17. +// +// Solidity: function getAttestTypeHash() pure returns(bytes32) +func (_EAS *EASSession) GetAttestTypeHash() ([32]byte, error) { + return _EAS.Contract.GetAttestTypeHash(&_EAS.CallOpts) +} + +// GetAttestTypeHash is a free data retrieval call binding the contract method 0x12b11a17. +// +// Solidity: function getAttestTypeHash() pure returns(bytes32) +func (_EAS *EASCallerSession) GetAttestTypeHash() ([32]byte, error) { + return _EAS.Contract.GetAttestTypeHash(&_EAS.CallOpts) +} + +// GetAttestation is a free data retrieval call binding the contract method 0xa3112a64. +// +// Solidity: function getAttestation(bytes32 uid) view returns((bytes32,bytes32,uint64,uint64,uint64,bytes32,address,address,bool,bytes)) +func (_EAS *EASCaller) GetAttestation(opts *bind.CallOpts, uid [32]byte) (Attestation, error) { + var out []interface{} + err := _EAS.contract.Call(opts, &out, "getAttestation", uid) + + if err != nil { + return *new(Attestation), err + } + + out0 := *abi.ConvertType(out[0], new(Attestation)).(*Attestation) + + return out0, err + +} + +// GetAttestation is a free data retrieval call binding the contract method 0xa3112a64. +// +// Solidity: function getAttestation(bytes32 uid) view returns((bytes32,bytes32,uint64,uint64,uint64,bytes32,address,address,bool,bytes)) +func (_EAS *EASSession) GetAttestation(uid [32]byte) (Attestation, error) { + return _EAS.Contract.GetAttestation(&_EAS.CallOpts, uid) +} + +// GetAttestation is a free data retrieval call binding the contract method 0xa3112a64. +// +// Solidity: function getAttestation(bytes32 uid) view returns((bytes32,bytes32,uint64,uint64,uint64,bytes32,address,address,bool,bytes)) +func (_EAS *EASCallerSession) GetAttestation(uid [32]byte) (Attestation, error) { + return _EAS.Contract.GetAttestation(&_EAS.CallOpts, uid) +} + +// GetDomainSeparator is a free data retrieval call binding the contract method 0xed24911d. +// +// Solidity: function getDomainSeparator() view returns(bytes32) +func (_EAS *EASCaller) GetDomainSeparator(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _EAS.contract.Call(opts, &out, "getDomainSeparator") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// GetDomainSeparator is a free data retrieval call binding the contract method 0xed24911d. +// +// Solidity: function getDomainSeparator() view returns(bytes32) +func (_EAS *EASSession) GetDomainSeparator() ([32]byte, error) { + return _EAS.Contract.GetDomainSeparator(&_EAS.CallOpts) +} + +// GetDomainSeparator is a free data retrieval call binding the contract method 0xed24911d. +// +// Solidity: function getDomainSeparator() view returns(bytes32) +func (_EAS *EASCallerSession) GetDomainSeparator() ([32]byte, error) { + return _EAS.Contract.GetDomainSeparator(&_EAS.CallOpts) +} + +// GetName is a free data retrieval call binding the contract method 0x17d7de7c. +// +// Solidity: function getName() view returns(string) +func (_EAS *EASCaller) GetName(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _EAS.contract.Call(opts, &out, "getName") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// GetName is a free data retrieval call binding the contract method 0x17d7de7c. +// +// Solidity: function getName() view returns(string) +func (_EAS *EASSession) GetName() (string, error) { + return _EAS.Contract.GetName(&_EAS.CallOpts) +} + +// GetName is a free data retrieval call binding the contract method 0x17d7de7c. +// +// Solidity: function getName() view returns(string) +func (_EAS *EASCallerSession) GetName() (string, error) { + return _EAS.Contract.GetName(&_EAS.CallOpts) +} + +// GetNonce is a free data retrieval call binding the contract method 0x2d0335ab. +// +// Solidity: function getNonce(address account) view returns(uint256) +func (_EAS *EASCaller) GetNonce(opts *bind.CallOpts, account common.Address) (*big.Int, error) { + var out []interface{} + err := _EAS.contract.Call(opts, &out, "getNonce", account) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetNonce is a free data retrieval call binding the contract method 0x2d0335ab. +// +// Solidity: function getNonce(address account) view returns(uint256) +func (_EAS *EASSession) GetNonce(account common.Address) (*big.Int, error) { + return _EAS.Contract.GetNonce(&_EAS.CallOpts, account) +} + +// GetNonce is a free data retrieval call binding the contract method 0x2d0335ab. +// +// Solidity: function getNonce(address account) view returns(uint256) +func (_EAS *EASCallerSession) GetNonce(account common.Address) (*big.Int, error) { + return _EAS.Contract.GetNonce(&_EAS.CallOpts, account) +} + +// GetRevokeOffchain is a free data retrieval call binding the contract method 0xb469318d. +// +// Solidity: function getRevokeOffchain(address revoker, bytes32 data) view returns(uint64) +func (_EAS *EASCaller) GetRevokeOffchain(opts *bind.CallOpts, revoker common.Address, data [32]byte) (uint64, error) { + var out []interface{} + err := _EAS.contract.Call(opts, &out, "getRevokeOffchain", revoker, data) + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// GetRevokeOffchain is a free data retrieval call binding the contract method 0xb469318d. +// +// Solidity: function getRevokeOffchain(address revoker, bytes32 data) view returns(uint64) +func (_EAS *EASSession) GetRevokeOffchain(revoker common.Address, data [32]byte) (uint64, error) { + return _EAS.Contract.GetRevokeOffchain(&_EAS.CallOpts, revoker, data) +} + +// GetRevokeOffchain is a free data retrieval call binding the contract method 0xb469318d. +// +// Solidity: function getRevokeOffchain(address revoker, bytes32 data) view returns(uint64) +func (_EAS *EASCallerSession) GetRevokeOffchain(revoker common.Address, data [32]byte) (uint64, error) { + return _EAS.Contract.GetRevokeOffchain(&_EAS.CallOpts, revoker, data) +} + +// GetRevokeTypeHash is a free data retrieval call binding the contract method 0xb83010d3. +// +// Solidity: function getRevokeTypeHash() pure returns(bytes32) +func (_EAS *EASCaller) GetRevokeTypeHash(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _EAS.contract.Call(opts, &out, "getRevokeTypeHash") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// GetRevokeTypeHash is a free data retrieval call binding the contract method 0xb83010d3. +// +// Solidity: function getRevokeTypeHash() pure returns(bytes32) +func (_EAS *EASSession) GetRevokeTypeHash() ([32]byte, error) { + return _EAS.Contract.GetRevokeTypeHash(&_EAS.CallOpts) +} + +// GetRevokeTypeHash is a free data retrieval call binding the contract method 0xb83010d3. +// +// Solidity: function getRevokeTypeHash() pure returns(bytes32) +func (_EAS *EASCallerSession) GetRevokeTypeHash() ([32]byte, error) { + return _EAS.Contract.GetRevokeTypeHash(&_EAS.CallOpts) +} + +// GetSchemaRegistry is a free data retrieval call binding the contract method 0xf10b5cc8. +// +// Solidity: function getSchemaRegistry() pure returns(address) +func (_EAS *EASCaller) GetSchemaRegistry(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _EAS.contract.Call(opts, &out, "getSchemaRegistry") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// GetSchemaRegistry is a free data retrieval call binding the contract method 0xf10b5cc8. +// +// Solidity: function getSchemaRegistry() pure returns(address) +func (_EAS *EASSession) GetSchemaRegistry() (common.Address, error) { + return _EAS.Contract.GetSchemaRegistry(&_EAS.CallOpts) +} + +// GetSchemaRegistry is a free data retrieval call binding the contract method 0xf10b5cc8. +// +// Solidity: function getSchemaRegistry() pure returns(address) +func (_EAS *EASCallerSession) GetSchemaRegistry() (common.Address, error) { + return _EAS.Contract.GetSchemaRegistry(&_EAS.CallOpts) +} + +// GetTimestamp is a free data retrieval call binding the contract method 0xd45c4435. +// +// Solidity: function getTimestamp(bytes32 data) view returns(uint64) +func (_EAS *EASCaller) GetTimestamp(opts *bind.CallOpts, data [32]byte) (uint64, error) { + var out []interface{} + err := _EAS.contract.Call(opts, &out, "getTimestamp", data) + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// GetTimestamp is a free data retrieval call binding the contract method 0xd45c4435. +// +// Solidity: function getTimestamp(bytes32 data) view returns(uint64) +func (_EAS *EASSession) GetTimestamp(data [32]byte) (uint64, error) { + return _EAS.Contract.GetTimestamp(&_EAS.CallOpts, data) +} + +// GetTimestamp is a free data retrieval call binding the contract method 0xd45c4435. +// +// Solidity: function getTimestamp(bytes32 data) view returns(uint64) +func (_EAS *EASCallerSession) GetTimestamp(data [32]byte) (uint64, error) { + return _EAS.Contract.GetTimestamp(&_EAS.CallOpts, data) +} + +// IsAttestationValid is a free data retrieval call binding the contract method 0xe30bb563. +// +// Solidity: function isAttestationValid(bytes32 uid) view returns(bool) +func (_EAS *EASCaller) IsAttestationValid(opts *bind.CallOpts, uid [32]byte) (bool, error) { + var out []interface{} + err := _EAS.contract.Call(opts, &out, "isAttestationValid", uid) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsAttestationValid is a free data retrieval call binding the contract method 0xe30bb563. +// +// Solidity: function isAttestationValid(bytes32 uid) view returns(bool) +func (_EAS *EASSession) IsAttestationValid(uid [32]byte) (bool, error) { + return _EAS.Contract.IsAttestationValid(&_EAS.CallOpts, uid) +} + +// IsAttestationValid is a free data retrieval call binding the contract method 0xe30bb563. +// +// Solidity: function isAttestationValid(bytes32 uid) view returns(bool) +func (_EAS *EASCallerSession) IsAttestationValid(uid [32]byte) (bool, error) { + return _EAS.Contract.IsAttestationValid(&_EAS.CallOpts, uid) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_EAS *EASCaller) Version(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _EAS.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 (_EAS *EASSession) Version() (string, error) { + return _EAS.Contract.Version(&_EAS.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_EAS *EASCallerSession) Version() (string, error) { + return _EAS.Contract.Version(&_EAS.CallOpts) +} + +// Attest is a paid mutator transaction binding the contract method 0xf17325e7. +// +// Solidity: function attest((bytes32,(address,uint64,bool,bytes32,bytes,uint256)) request) payable returns(bytes32) +func (_EAS *EASTransactor) Attest(opts *bind.TransactOpts, request AttestationRequest) (*types.Transaction, error) { + return _EAS.contract.Transact(opts, "attest", request) +} + +// Attest is a paid mutator transaction binding the contract method 0xf17325e7. +// +// Solidity: function attest((bytes32,(address,uint64,bool,bytes32,bytes,uint256)) request) payable returns(bytes32) +func (_EAS *EASSession) Attest(request AttestationRequest) (*types.Transaction, error) { + return _EAS.Contract.Attest(&_EAS.TransactOpts, request) +} + +// Attest is a paid mutator transaction binding the contract method 0xf17325e7. +// +// Solidity: function attest((bytes32,(address,uint64,bool,bytes32,bytes,uint256)) request) payable returns(bytes32) +func (_EAS *EASTransactorSession) Attest(request AttestationRequest) (*types.Transaction, error) { + return _EAS.Contract.Attest(&_EAS.TransactOpts, request) +} + +// AttestByDelegation is a paid mutator transaction binding the contract method 0x3c042715. +// +// Solidity: function attestByDelegation((bytes32,(address,uint64,bool,bytes32,bytes,uint256),(uint8,bytes32,bytes32),address,uint64) delegatedRequest) payable returns(bytes32) +func (_EAS *EASTransactor) AttestByDelegation(opts *bind.TransactOpts, delegatedRequest DelegatedAttestationRequest) (*types.Transaction, error) { + return _EAS.contract.Transact(opts, "attestByDelegation", delegatedRequest) +} + +// AttestByDelegation is a paid mutator transaction binding the contract method 0x3c042715. +// +// Solidity: function attestByDelegation((bytes32,(address,uint64,bool,bytes32,bytes,uint256),(uint8,bytes32,bytes32),address,uint64) delegatedRequest) payable returns(bytes32) +func (_EAS *EASSession) AttestByDelegation(delegatedRequest DelegatedAttestationRequest) (*types.Transaction, error) { + return _EAS.Contract.AttestByDelegation(&_EAS.TransactOpts, delegatedRequest) +} + +// AttestByDelegation is a paid mutator transaction binding the contract method 0x3c042715. +// +// Solidity: function attestByDelegation((bytes32,(address,uint64,bool,bytes32,bytes,uint256),(uint8,bytes32,bytes32),address,uint64) delegatedRequest) payable returns(bytes32) +func (_EAS *EASTransactorSession) AttestByDelegation(delegatedRequest DelegatedAttestationRequest) (*types.Transaction, error) { + return _EAS.Contract.AttestByDelegation(&_EAS.TransactOpts, delegatedRequest) +} + +// IncreaseNonce is a paid mutator transaction binding the contract method 0x79f7573a. +// +// Solidity: function increaseNonce(uint256 newNonce) returns() +func (_EAS *EASTransactor) IncreaseNonce(opts *bind.TransactOpts, newNonce *big.Int) (*types.Transaction, error) { + return _EAS.contract.Transact(opts, "increaseNonce", newNonce) +} + +// IncreaseNonce is a paid mutator transaction binding the contract method 0x79f7573a. +// +// Solidity: function increaseNonce(uint256 newNonce) returns() +func (_EAS *EASSession) IncreaseNonce(newNonce *big.Int) (*types.Transaction, error) { + return _EAS.Contract.IncreaseNonce(&_EAS.TransactOpts, newNonce) +} + +// IncreaseNonce is a paid mutator transaction binding the contract method 0x79f7573a. +// +// Solidity: function increaseNonce(uint256 newNonce) returns() +func (_EAS *EASTransactorSession) IncreaseNonce(newNonce *big.Int) (*types.Transaction, error) { + return _EAS.Contract.IncreaseNonce(&_EAS.TransactOpts, newNonce) +} + +// MultiAttest is a paid mutator transaction binding the contract method 0x44adc90e. +// +// Solidity: function multiAttest((bytes32,(address,uint64,bool,bytes32,bytes,uint256)[])[] multiRequests) payable returns(bytes32[]) +func (_EAS *EASTransactor) MultiAttest(opts *bind.TransactOpts, multiRequests []MultiAttestationRequest) (*types.Transaction, error) { + return _EAS.contract.Transact(opts, "multiAttest", multiRequests) +} + +// MultiAttest is a paid mutator transaction binding the contract method 0x44adc90e. +// +// Solidity: function multiAttest((bytes32,(address,uint64,bool,bytes32,bytes,uint256)[])[] multiRequests) payable returns(bytes32[]) +func (_EAS *EASSession) MultiAttest(multiRequests []MultiAttestationRequest) (*types.Transaction, error) { + return _EAS.Contract.MultiAttest(&_EAS.TransactOpts, multiRequests) +} + +// MultiAttest is a paid mutator transaction binding the contract method 0x44adc90e. +// +// Solidity: function multiAttest((bytes32,(address,uint64,bool,bytes32,bytes,uint256)[])[] multiRequests) payable returns(bytes32[]) +func (_EAS *EASTransactorSession) MultiAttest(multiRequests []MultiAttestationRequest) (*types.Transaction, error) { + return _EAS.Contract.MultiAttest(&_EAS.TransactOpts, multiRequests) +} + +// MultiAttestByDelegation is a paid mutator transaction binding the contract method 0x95411525. +// +// Solidity: function multiAttestByDelegation((bytes32,(address,uint64,bool,bytes32,bytes,uint256)[],(uint8,bytes32,bytes32)[],address,uint64)[] multiDelegatedRequests) payable returns(bytes32[]) +func (_EAS *EASTransactor) MultiAttestByDelegation(opts *bind.TransactOpts, multiDelegatedRequests []MultiDelegatedAttestationRequest) (*types.Transaction, error) { + return _EAS.contract.Transact(opts, "multiAttestByDelegation", multiDelegatedRequests) +} + +// MultiAttestByDelegation is a paid mutator transaction binding the contract method 0x95411525. +// +// Solidity: function multiAttestByDelegation((bytes32,(address,uint64,bool,bytes32,bytes,uint256)[],(uint8,bytes32,bytes32)[],address,uint64)[] multiDelegatedRequests) payable returns(bytes32[]) +func (_EAS *EASSession) MultiAttestByDelegation(multiDelegatedRequests []MultiDelegatedAttestationRequest) (*types.Transaction, error) { + return _EAS.Contract.MultiAttestByDelegation(&_EAS.TransactOpts, multiDelegatedRequests) +} + +// MultiAttestByDelegation is a paid mutator transaction binding the contract method 0x95411525. +// +// Solidity: function multiAttestByDelegation((bytes32,(address,uint64,bool,bytes32,bytes,uint256)[],(uint8,bytes32,bytes32)[],address,uint64)[] multiDelegatedRequests) payable returns(bytes32[]) +func (_EAS *EASTransactorSession) MultiAttestByDelegation(multiDelegatedRequests []MultiDelegatedAttestationRequest) (*types.Transaction, error) { + return _EAS.Contract.MultiAttestByDelegation(&_EAS.TransactOpts, multiDelegatedRequests) +} + +// MultiRevoke is a paid mutator transaction binding the contract method 0x4cb7e9e5. +// +// Solidity: function multiRevoke((bytes32,(bytes32,uint256)[])[] multiRequests) payable returns() +func (_EAS *EASTransactor) MultiRevoke(opts *bind.TransactOpts, multiRequests []MultiRevocationRequest) (*types.Transaction, error) { + return _EAS.contract.Transact(opts, "multiRevoke", multiRequests) +} + +// MultiRevoke is a paid mutator transaction binding the contract method 0x4cb7e9e5. +// +// Solidity: function multiRevoke((bytes32,(bytes32,uint256)[])[] multiRequests) payable returns() +func (_EAS *EASSession) MultiRevoke(multiRequests []MultiRevocationRequest) (*types.Transaction, error) { + return _EAS.Contract.MultiRevoke(&_EAS.TransactOpts, multiRequests) +} + +// MultiRevoke is a paid mutator transaction binding the contract method 0x4cb7e9e5. +// +// Solidity: function multiRevoke((bytes32,(bytes32,uint256)[])[] multiRequests) payable returns() +func (_EAS *EASTransactorSession) MultiRevoke(multiRequests []MultiRevocationRequest) (*types.Transaction, error) { + return _EAS.Contract.MultiRevoke(&_EAS.TransactOpts, multiRequests) +} + +// MultiRevokeByDelegation is a paid mutator transaction binding the contract method 0x0eabf660. +// +// Solidity: function multiRevokeByDelegation((bytes32,(bytes32,uint256)[],(uint8,bytes32,bytes32)[],address,uint64)[] multiDelegatedRequests) payable returns() +func (_EAS *EASTransactor) MultiRevokeByDelegation(opts *bind.TransactOpts, multiDelegatedRequests []MultiDelegatedRevocationRequest) (*types.Transaction, error) { + return _EAS.contract.Transact(opts, "multiRevokeByDelegation", multiDelegatedRequests) +} + +// MultiRevokeByDelegation is a paid mutator transaction binding the contract method 0x0eabf660. +// +// Solidity: function multiRevokeByDelegation((bytes32,(bytes32,uint256)[],(uint8,bytes32,bytes32)[],address,uint64)[] multiDelegatedRequests) payable returns() +func (_EAS *EASSession) MultiRevokeByDelegation(multiDelegatedRequests []MultiDelegatedRevocationRequest) (*types.Transaction, error) { + return _EAS.Contract.MultiRevokeByDelegation(&_EAS.TransactOpts, multiDelegatedRequests) +} + +// MultiRevokeByDelegation is a paid mutator transaction binding the contract method 0x0eabf660. +// +// Solidity: function multiRevokeByDelegation((bytes32,(bytes32,uint256)[],(uint8,bytes32,bytes32)[],address,uint64)[] multiDelegatedRequests) payable returns() +func (_EAS *EASTransactorSession) MultiRevokeByDelegation(multiDelegatedRequests []MultiDelegatedRevocationRequest) (*types.Transaction, error) { + return _EAS.Contract.MultiRevokeByDelegation(&_EAS.TransactOpts, multiDelegatedRequests) +} + +// MultiRevokeOffchain is a paid mutator transaction binding the contract method 0x13893f61. +// +// Solidity: function multiRevokeOffchain(bytes32[] data) returns(uint64) +func (_EAS *EASTransactor) MultiRevokeOffchain(opts *bind.TransactOpts, data [][32]byte) (*types.Transaction, error) { + return _EAS.contract.Transact(opts, "multiRevokeOffchain", data) +} + +// MultiRevokeOffchain is a paid mutator transaction binding the contract method 0x13893f61. +// +// Solidity: function multiRevokeOffchain(bytes32[] data) returns(uint64) +func (_EAS *EASSession) MultiRevokeOffchain(data [][32]byte) (*types.Transaction, error) { + return _EAS.Contract.MultiRevokeOffchain(&_EAS.TransactOpts, data) +} + +// MultiRevokeOffchain is a paid mutator transaction binding the contract method 0x13893f61. +// +// Solidity: function multiRevokeOffchain(bytes32[] data) returns(uint64) +func (_EAS *EASTransactorSession) MultiRevokeOffchain(data [][32]byte) (*types.Transaction, error) { + return _EAS.Contract.MultiRevokeOffchain(&_EAS.TransactOpts, data) +} + +// MultiTimestamp is a paid mutator transaction binding the contract method 0xe71ff365. +// +// Solidity: function multiTimestamp(bytes32[] data) returns(uint64) +func (_EAS *EASTransactor) MultiTimestamp(opts *bind.TransactOpts, data [][32]byte) (*types.Transaction, error) { + return _EAS.contract.Transact(opts, "multiTimestamp", data) +} + +// MultiTimestamp is a paid mutator transaction binding the contract method 0xe71ff365. +// +// Solidity: function multiTimestamp(bytes32[] data) returns(uint64) +func (_EAS *EASSession) MultiTimestamp(data [][32]byte) (*types.Transaction, error) { + return _EAS.Contract.MultiTimestamp(&_EAS.TransactOpts, data) +} + +// MultiTimestamp is a paid mutator transaction binding the contract method 0xe71ff365. +// +// Solidity: function multiTimestamp(bytes32[] data) returns(uint64) +func (_EAS *EASTransactorSession) MultiTimestamp(data [][32]byte) (*types.Transaction, error) { + return _EAS.Contract.MultiTimestamp(&_EAS.TransactOpts, data) +} + +// Revoke is a paid mutator transaction binding the contract method 0x46926267. +// +// Solidity: function revoke((bytes32,(bytes32,uint256)) request) payable returns() +func (_EAS *EASTransactor) Revoke(opts *bind.TransactOpts, request RevocationRequest) (*types.Transaction, error) { + return _EAS.contract.Transact(opts, "revoke", request) +} + +// Revoke is a paid mutator transaction binding the contract method 0x46926267. +// +// Solidity: function revoke((bytes32,(bytes32,uint256)) request) payable returns() +func (_EAS *EASSession) Revoke(request RevocationRequest) (*types.Transaction, error) { + return _EAS.Contract.Revoke(&_EAS.TransactOpts, request) +} + +// Revoke is a paid mutator transaction binding the contract method 0x46926267. +// +// Solidity: function revoke((bytes32,(bytes32,uint256)) request) payable returns() +func (_EAS *EASTransactorSession) Revoke(request RevocationRequest) (*types.Transaction, error) { + return _EAS.Contract.Revoke(&_EAS.TransactOpts, request) +} + +// RevokeByDelegation is a paid mutator transaction binding the contract method 0xa6d4dbc7. +// +// Solidity: function revokeByDelegation((bytes32,(bytes32,uint256),(uint8,bytes32,bytes32),address,uint64) delegatedRequest) payable returns() +func (_EAS *EASTransactor) RevokeByDelegation(opts *bind.TransactOpts, delegatedRequest DelegatedRevocationRequest) (*types.Transaction, error) { + return _EAS.contract.Transact(opts, "revokeByDelegation", delegatedRequest) +} + +// RevokeByDelegation is a paid mutator transaction binding the contract method 0xa6d4dbc7. +// +// Solidity: function revokeByDelegation((bytes32,(bytes32,uint256),(uint8,bytes32,bytes32),address,uint64) delegatedRequest) payable returns() +func (_EAS *EASSession) RevokeByDelegation(delegatedRequest DelegatedRevocationRequest) (*types.Transaction, error) { + return _EAS.Contract.RevokeByDelegation(&_EAS.TransactOpts, delegatedRequest) +} + +// RevokeByDelegation is a paid mutator transaction binding the contract method 0xa6d4dbc7. +// +// Solidity: function revokeByDelegation((bytes32,(bytes32,uint256),(uint8,bytes32,bytes32),address,uint64) delegatedRequest) payable returns() +func (_EAS *EASTransactorSession) RevokeByDelegation(delegatedRequest DelegatedRevocationRequest) (*types.Transaction, error) { + return _EAS.Contract.RevokeByDelegation(&_EAS.TransactOpts, delegatedRequest) +} + +// RevokeOffchain is a paid mutator transaction binding the contract method 0xcf190f34. +// +// Solidity: function revokeOffchain(bytes32 data) returns(uint64) +func (_EAS *EASTransactor) RevokeOffchain(opts *bind.TransactOpts, data [32]byte) (*types.Transaction, error) { + return _EAS.contract.Transact(opts, "revokeOffchain", data) +} + +// RevokeOffchain is a paid mutator transaction binding the contract method 0xcf190f34. +// +// Solidity: function revokeOffchain(bytes32 data) returns(uint64) +func (_EAS *EASSession) RevokeOffchain(data [32]byte) (*types.Transaction, error) { + return _EAS.Contract.RevokeOffchain(&_EAS.TransactOpts, data) +} + +// RevokeOffchain is a paid mutator transaction binding the contract method 0xcf190f34. +// +// Solidity: function revokeOffchain(bytes32 data) returns(uint64) +func (_EAS *EASTransactorSession) RevokeOffchain(data [32]byte) (*types.Transaction, error) { + return _EAS.Contract.RevokeOffchain(&_EAS.TransactOpts, data) +} + +// Timestamp is a paid mutator transaction binding the contract method 0x4d003070. +// +// Solidity: function timestamp(bytes32 data) returns(uint64) +func (_EAS *EASTransactor) Timestamp(opts *bind.TransactOpts, data [32]byte) (*types.Transaction, error) { + return _EAS.contract.Transact(opts, "timestamp", data) +} + +// Timestamp is a paid mutator transaction binding the contract method 0x4d003070. +// +// Solidity: function timestamp(bytes32 data) returns(uint64) +func (_EAS *EASSession) Timestamp(data [32]byte) (*types.Transaction, error) { + return _EAS.Contract.Timestamp(&_EAS.TransactOpts, data) +} + +// Timestamp is a paid mutator transaction binding the contract method 0x4d003070. +// +// Solidity: function timestamp(bytes32 data) returns(uint64) +func (_EAS *EASTransactorSession) Timestamp(data [32]byte) (*types.Transaction, error) { + return _EAS.Contract.Timestamp(&_EAS.TransactOpts, data) +} + +// EASAttestedIterator is returned from FilterAttested and is used to iterate over the raw logs and unpacked data for Attested events raised by the EAS contract. +type EASAttestedIterator struct { + Event *EASAttested // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *EASAttestedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(EASAttested) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(EASAttested) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *EASAttestedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *EASAttestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// EASAttested represents a Attested event raised by the EAS contract. +type EASAttested struct { + Recipient common.Address + Attester common.Address + Uid [32]byte + SchemaUID [32]byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterAttested is a free log retrieval operation binding the contract event 0x8bf46bf4cfd674fa735a3d63ec1c9ad4153f033c290341f3a588b75685141b35. +// +// Solidity: event Attested(address indexed recipient, address indexed attester, bytes32 uid, bytes32 indexed schemaUID) +func (_EAS *EASFilterer) FilterAttested(opts *bind.FilterOpts, recipient []common.Address, attester []common.Address, schemaUID [][32]byte) (*EASAttestedIterator, error) { + + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + var attesterRule []interface{} + for _, attesterItem := range attester { + attesterRule = append(attesterRule, attesterItem) + } + + var schemaUIDRule []interface{} + for _, schemaUIDItem := range schemaUID { + schemaUIDRule = append(schemaUIDRule, schemaUIDItem) + } + + logs, sub, err := _EAS.contract.FilterLogs(opts, "Attested", recipientRule, attesterRule, schemaUIDRule) + if err != nil { + return nil, err + } + return &EASAttestedIterator{contract: _EAS.contract, event: "Attested", logs: logs, sub: sub}, nil +} + +// WatchAttested is a free log subscription operation binding the contract event 0x8bf46bf4cfd674fa735a3d63ec1c9ad4153f033c290341f3a588b75685141b35. +// +// Solidity: event Attested(address indexed recipient, address indexed attester, bytes32 uid, bytes32 indexed schemaUID) +func (_EAS *EASFilterer) WatchAttested(opts *bind.WatchOpts, sink chan<- *EASAttested, recipient []common.Address, attester []common.Address, schemaUID [][32]byte) (event.Subscription, error) { + + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + var attesterRule []interface{} + for _, attesterItem := range attester { + attesterRule = append(attesterRule, attesterItem) + } + + var schemaUIDRule []interface{} + for _, schemaUIDItem := range schemaUID { + schemaUIDRule = append(schemaUIDRule, schemaUIDItem) + } + + logs, sub, err := _EAS.contract.WatchLogs(opts, "Attested", recipientRule, attesterRule, schemaUIDRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(EASAttested) + if err := _EAS.contract.UnpackLog(event, "Attested", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseAttested is a log parse operation binding the contract event 0x8bf46bf4cfd674fa735a3d63ec1c9ad4153f033c290341f3a588b75685141b35. +// +// Solidity: event Attested(address indexed recipient, address indexed attester, bytes32 uid, bytes32 indexed schemaUID) +func (_EAS *EASFilterer) ParseAttested(log types.Log) (*EASAttested, error) { + event := new(EASAttested) + if err := _EAS.contract.UnpackLog(event, "Attested", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// EASNonceIncreasedIterator is returned from FilterNonceIncreased and is used to iterate over the raw logs and unpacked data for NonceIncreased events raised by the EAS contract. +type EASNonceIncreasedIterator struct { + Event *EASNonceIncreased // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *EASNonceIncreasedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(EASNonceIncreased) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(EASNonceIncreased) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *EASNonceIncreasedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *EASNonceIncreasedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// EASNonceIncreased represents a NonceIncreased event raised by the EAS contract. +type EASNonceIncreased struct { + OldNonce *big.Int + NewNonce *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterNonceIncreased is a free log retrieval operation binding the contract event 0x57b09af877df9068fd60a69d7b21f5576b8b38955812d6ae4ac52942f1e38fb7. +// +// Solidity: event NonceIncreased(uint256 oldNonce, uint256 newNonce) +func (_EAS *EASFilterer) FilterNonceIncreased(opts *bind.FilterOpts) (*EASNonceIncreasedIterator, error) { + + logs, sub, err := _EAS.contract.FilterLogs(opts, "NonceIncreased") + if err != nil { + return nil, err + } + return &EASNonceIncreasedIterator{contract: _EAS.contract, event: "NonceIncreased", logs: logs, sub: sub}, nil +} + +// WatchNonceIncreased is a free log subscription operation binding the contract event 0x57b09af877df9068fd60a69d7b21f5576b8b38955812d6ae4ac52942f1e38fb7. +// +// Solidity: event NonceIncreased(uint256 oldNonce, uint256 newNonce) +func (_EAS *EASFilterer) WatchNonceIncreased(opts *bind.WatchOpts, sink chan<- *EASNonceIncreased) (event.Subscription, error) { + + logs, sub, err := _EAS.contract.WatchLogs(opts, "NonceIncreased") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(EASNonceIncreased) + if err := _EAS.contract.UnpackLog(event, "NonceIncreased", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseNonceIncreased is a log parse operation binding the contract event 0x57b09af877df9068fd60a69d7b21f5576b8b38955812d6ae4ac52942f1e38fb7. +// +// Solidity: event NonceIncreased(uint256 oldNonce, uint256 newNonce) +func (_EAS *EASFilterer) ParseNonceIncreased(log types.Log) (*EASNonceIncreased, error) { + event := new(EASNonceIncreased) + if err := _EAS.contract.UnpackLog(event, "NonceIncreased", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// EASRevokedIterator is returned from FilterRevoked and is used to iterate over the raw logs and unpacked data for Revoked events raised by the EAS contract. +type EASRevokedIterator struct { + Event *EASRevoked // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *EASRevokedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(EASRevoked) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(EASRevoked) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *EASRevokedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *EASRevokedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// EASRevoked represents a Revoked event raised by the EAS contract. +type EASRevoked struct { + Recipient common.Address + Attester common.Address + Uid [32]byte + SchemaUID [32]byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterRevoked is a free log retrieval operation binding the contract event 0xf930a6e2523c9cc298691873087a740550b8fc85a0680830414c148ed927f615. +// +// Solidity: event Revoked(address indexed recipient, address indexed attester, bytes32 uid, bytes32 indexed schemaUID) +func (_EAS *EASFilterer) FilterRevoked(opts *bind.FilterOpts, recipient []common.Address, attester []common.Address, schemaUID [][32]byte) (*EASRevokedIterator, error) { + + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + var attesterRule []interface{} + for _, attesterItem := range attester { + attesterRule = append(attesterRule, attesterItem) + } + + var schemaUIDRule []interface{} + for _, schemaUIDItem := range schemaUID { + schemaUIDRule = append(schemaUIDRule, schemaUIDItem) + } + + logs, sub, err := _EAS.contract.FilterLogs(opts, "Revoked", recipientRule, attesterRule, schemaUIDRule) + if err != nil { + return nil, err + } + return &EASRevokedIterator{contract: _EAS.contract, event: "Revoked", logs: logs, sub: sub}, nil +} + +// WatchRevoked is a free log subscription operation binding the contract event 0xf930a6e2523c9cc298691873087a740550b8fc85a0680830414c148ed927f615. +// +// Solidity: event Revoked(address indexed recipient, address indexed attester, bytes32 uid, bytes32 indexed schemaUID) +func (_EAS *EASFilterer) WatchRevoked(opts *bind.WatchOpts, sink chan<- *EASRevoked, recipient []common.Address, attester []common.Address, schemaUID [][32]byte) (event.Subscription, error) { + + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + var attesterRule []interface{} + for _, attesterItem := range attester { + attesterRule = append(attesterRule, attesterItem) + } + + var schemaUIDRule []interface{} + for _, schemaUIDItem := range schemaUID { + schemaUIDRule = append(schemaUIDRule, schemaUIDItem) + } + + logs, sub, err := _EAS.contract.WatchLogs(opts, "Revoked", recipientRule, attesterRule, schemaUIDRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(EASRevoked) + if err := _EAS.contract.UnpackLog(event, "Revoked", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseRevoked is a log parse operation binding the contract event 0xf930a6e2523c9cc298691873087a740550b8fc85a0680830414c148ed927f615. +// +// Solidity: event Revoked(address indexed recipient, address indexed attester, bytes32 uid, bytes32 indexed schemaUID) +func (_EAS *EASFilterer) ParseRevoked(log types.Log) (*EASRevoked, error) { + event := new(EASRevoked) + if err := _EAS.contract.UnpackLog(event, "Revoked", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// EASRevokedOffchainIterator is returned from FilterRevokedOffchain and is used to iterate over the raw logs and unpacked data for RevokedOffchain events raised by the EAS contract. +type EASRevokedOffchainIterator struct { + Event *EASRevokedOffchain // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *EASRevokedOffchainIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(EASRevokedOffchain) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(EASRevokedOffchain) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *EASRevokedOffchainIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *EASRevokedOffchainIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// EASRevokedOffchain represents a RevokedOffchain event raised by the EAS contract. +type EASRevokedOffchain struct { + Revoker common.Address + Data [32]byte + Timestamp uint64 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterRevokedOffchain is a free log retrieval operation binding the contract event 0x92a1f7a41a7c585a8b09e25b195e225b1d43248daca46b0faf9e0792777a2229. +// +// Solidity: event RevokedOffchain(address indexed revoker, bytes32 indexed data, uint64 indexed timestamp) +func (_EAS *EASFilterer) FilterRevokedOffchain(opts *bind.FilterOpts, revoker []common.Address, data [][32]byte, timestamp []uint64) (*EASRevokedOffchainIterator, error) { + + var revokerRule []interface{} + for _, revokerItem := range revoker { + revokerRule = append(revokerRule, revokerItem) + } + var dataRule []interface{} + for _, dataItem := range data { + dataRule = append(dataRule, dataItem) + } + var timestampRule []interface{} + for _, timestampItem := range timestamp { + timestampRule = append(timestampRule, timestampItem) + } + + logs, sub, err := _EAS.contract.FilterLogs(opts, "RevokedOffchain", revokerRule, dataRule, timestampRule) + if err != nil { + return nil, err + } + return &EASRevokedOffchainIterator{contract: _EAS.contract, event: "RevokedOffchain", logs: logs, sub: sub}, nil +} + +// WatchRevokedOffchain is a free log subscription operation binding the contract event 0x92a1f7a41a7c585a8b09e25b195e225b1d43248daca46b0faf9e0792777a2229. +// +// Solidity: event RevokedOffchain(address indexed revoker, bytes32 indexed data, uint64 indexed timestamp) +func (_EAS *EASFilterer) WatchRevokedOffchain(opts *bind.WatchOpts, sink chan<- *EASRevokedOffchain, revoker []common.Address, data [][32]byte, timestamp []uint64) (event.Subscription, error) { + + var revokerRule []interface{} + for _, revokerItem := range revoker { + revokerRule = append(revokerRule, revokerItem) + } + var dataRule []interface{} + for _, dataItem := range data { + dataRule = append(dataRule, dataItem) + } + var timestampRule []interface{} + for _, timestampItem := range timestamp { + timestampRule = append(timestampRule, timestampItem) + } + + logs, sub, err := _EAS.contract.WatchLogs(opts, "RevokedOffchain", revokerRule, dataRule, timestampRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(EASRevokedOffchain) + if err := _EAS.contract.UnpackLog(event, "RevokedOffchain", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseRevokedOffchain is a log parse operation binding the contract event 0x92a1f7a41a7c585a8b09e25b195e225b1d43248daca46b0faf9e0792777a2229. +// +// Solidity: event RevokedOffchain(address indexed revoker, bytes32 indexed data, uint64 indexed timestamp) +func (_EAS *EASFilterer) ParseRevokedOffchain(log types.Log) (*EASRevokedOffchain, error) { + event := new(EASRevokedOffchain) + if err := _EAS.contract.UnpackLog(event, "RevokedOffchain", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// EASTimestampedIterator is returned from FilterTimestamped and is used to iterate over the raw logs and unpacked data for Timestamped events raised by the EAS contract. +type EASTimestampedIterator struct { + Event *EASTimestamped // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *EASTimestampedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(EASTimestamped) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(EASTimestamped) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *EASTimestampedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *EASTimestampedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// EASTimestamped represents a Timestamped event raised by the EAS contract. +type EASTimestamped struct { + Data [32]byte + Timestamp uint64 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterTimestamped is a free log retrieval operation binding the contract event 0x5aafceeb1c7ad58e4a84898bdee37c02c0fc46e7d24e6b60e8209449f183459f. +// +// Solidity: event Timestamped(bytes32 indexed data, uint64 indexed timestamp) +func (_EAS *EASFilterer) FilterTimestamped(opts *bind.FilterOpts, data [][32]byte, timestamp []uint64) (*EASTimestampedIterator, error) { + + var dataRule []interface{} + for _, dataItem := range data { + dataRule = append(dataRule, dataItem) + } + var timestampRule []interface{} + for _, timestampItem := range timestamp { + timestampRule = append(timestampRule, timestampItem) + } + + logs, sub, err := _EAS.contract.FilterLogs(opts, "Timestamped", dataRule, timestampRule) + if err != nil { + return nil, err + } + return &EASTimestampedIterator{contract: _EAS.contract, event: "Timestamped", logs: logs, sub: sub}, nil +} + +// WatchTimestamped is a free log subscription operation binding the contract event 0x5aafceeb1c7ad58e4a84898bdee37c02c0fc46e7d24e6b60e8209449f183459f. +// +// Solidity: event Timestamped(bytes32 indexed data, uint64 indexed timestamp) +func (_EAS *EASFilterer) WatchTimestamped(opts *bind.WatchOpts, sink chan<- *EASTimestamped, data [][32]byte, timestamp []uint64) (event.Subscription, error) { + + var dataRule []interface{} + for _, dataItem := range data { + dataRule = append(dataRule, dataItem) + } + var timestampRule []interface{} + for _, timestampItem := range timestamp { + timestampRule = append(timestampRule, timestampItem) + } + + logs, sub, err := _EAS.contract.WatchLogs(opts, "Timestamped", dataRule, timestampRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(EASTimestamped) + if err := _EAS.contract.UnpackLog(event, "Timestamped", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseTimestamped is a log parse operation binding the contract event 0x5aafceeb1c7ad58e4a84898bdee37c02c0fc46e7d24e6b60e8209449f183459f. +// +// Solidity: event Timestamped(bytes32 indexed data, uint64 indexed timestamp) +func (_EAS *EASFilterer) ParseTimestamped(log types.Log) (*EASTimestamped, error) { + event := new(EASTimestamped) + if err := _EAS.contract.UnpackLog(event, "Timestamped", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/op-e2e2/bindings/entrypoint.go b/op-e2e2/bindings/entrypoint.go new file mode 100644 index 000000000000..e26ceb245460 --- /dev/null +++ b/op-e2e2/bindings/entrypoint.go @@ -0,0 +1,2283 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// EntryPointMemoryUserOp is an auto generated low-level Go binding around an user-defined struct. +type EntryPointMemoryUserOp struct { + Sender common.Address + Nonce *big.Int + CallGasLimit *big.Int + VerificationGasLimit *big.Int + PreVerificationGas *big.Int + Paymaster common.Address + MaxFeePerGas *big.Int + MaxPriorityFeePerGas *big.Int +} + +// EntryPointUserOpInfo is an auto generated low-level Go binding around an user-defined struct. +type EntryPointUserOpInfo struct { + MUserOp EntryPointMemoryUserOp + UserOpHash [32]byte + Prefund *big.Int + ContextOffset *big.Int + PreOpGas *big.Int +} + +// IEntryPointUserOpsPerAggregator is an auto generated low-level Go binding around an user-defined struct. +type IEntryPointUserOpsPerAggregator struct { + UserOps []UserOperation + Aggregator common.Address + Signature []byte +} + +// IStakeManagerDepositInfo is an auto generated low-level Go binding around an user-defined struct. +type IStakeManagerDepositInfo struct { + Deposit *big.Int + Staked bool + Stake *big.Int + UnstakeDelaySec uint32 + WithdrawTime *big.Int +} + +// UserOperation is an auto generated low-level Go binding around an user-defined struct. +type UserOperation struct { + Sender common.Address + Nonce *big.Int + InitCode []byte + CallData []byte + CallGasLimit *big.Int + VerificationGasLimit *big.Int + PreVerificationGas *big.Int + MaxFeePerGas *big.Int + MaxPriorityFeePerGas *big.Int + PaymasterAndData []byte + Signature []byte +} + +// EntryPointMetaData contains all meta data concerning the EntryPoint contract. +var EntryPointMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"preOpGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"paid\",\"type\":\"uint256\"},{\"internalType\":\"uint48\",\"name\":\"validAfter\",\"type\":\"uint48\"},{\"internalType\":\"uint48\",\"name\":\"validUntil\",\"type\":\"uint48\"},{\"internalType\":\"bool\",\"name\":\"targetSuccess\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"targetResult\",\"type\":\"bytes\"}],\"name\":\"ExecutionResult\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"opIndex\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"name\":\"FailedOp\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SenderAddressResult\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"aggregator\",\"type\":\"address\"}],\"name\":\"SignatureValidationFailed\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"preOpGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"prefund\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"sigFailed\",\"type\":\"bool\"},{\"internalType\":\"uint48\",\"name\":\"validAfter\",\"type\":\"uint48\"},{\"internalType\":\"uint48\",\"name\":\"validUntil\",\"type\":\"uint48\"},{\"internalType\":\"bytes\",\"name\":\"paymasterContext\",\"type\":\"bytes\"}],\"internalType\":\"structIEntryPoint.ReturnInfo\",\"name\":\"returnInfo\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"unstakeDelaySec\",\"type\":\"uint256\"}],\"internalType\":\"structIStakeManager.StakeInfo\",\"name\":\"senderInfo\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"unstakeDelaySec\",\"type\":\"uint256\"}],\"internalType\":\"structIStakeManager.StakeInfo\",\"name\":\"factoryInfo\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"unstakeDelaySec\",\"type\":\"uint256\"}],\"internalType\":\"structIStakeManager.StakeInfo\",\"name\":\"paymasterInfo\",\"type\":\"tuple\"}],\"name\":\"ValidationResult\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"preOpGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"prefund\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"sigFailed\",\"type\":\"bool\"},{\"internalType\":\"uint48\",\"name\":\"validAfter\",\"type\":\"uint48\"},{\"internalType\":\"uint48\",\"name\":\"validUntil\",\"type\":\"uint48\"},{\"internalType\":\"bytes\",\"name\":\"paymasterContext\",\"type\":\"bytes\"}],\"internalType\":\"structIEntryPoint.ReturnInfo\",\"name\":\"returnInfo\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"unstakeDelaySec\",\"type\":\"uint256\"}],\"internalType\":\"structIStakeManager.StakeInfo\",\"name\":\"senderInfo\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"unstakeDelaySec\",\"type\":\"uint256\"}],\"internalType\":\"structIStakeManager.StakeInfo\",\"name\":\"factoryInfo\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"unstakeDelaySec\",\"type\":\"uint256\"}],\"internalType\":\"structIStakeManager.StakeInfo\",\"name\":\"paymasterInfo\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"aggregator\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"unstakeDelaySec\",\"type\":\"uint256\"}],\"internalType\":\"structIStakeManager.StakeInfo\",\"name\":\"stakeInfo\",\"type\":\"tuple\"}],\"internalType\":\"structIEntryPoint.AggregatorStakeInfo\",\"name\":\"aggregatorInfo\",\"type\":\"tuple\"}],\"name\":\"ValidationResultWithAggregation\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"userOpHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"factory\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"paymaster\",\"type\":\"address\"}],\"name\":\"AccountDeployed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"BeforeExecution\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"totalDeposit\",\"type\":\"uint256\"}],\"name\":\"Deposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"aggregator\",\"type\":\"address\"}],\"name\":\"SignatureAggregatorChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"totalStaked\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"unstakeDelaySec\",\"type\":\"uint256\"}],\"name\":\"StakeLocked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"withdrawTime\",\"type\":\"uint256\"}],\"name\":\"StakeUnlocked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"withdrawAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"StakeWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"userOpHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"paymaster\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"actualGasCost\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"actualGasUsed\",\"type\":\"uint256\"}],\"name\":\"UserOperationEvent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"userOpHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"revertReason\",\"type\":\"bytes\"}],\"name\":\"UserOperationRevertReason\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"withdrawAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Withdrawn\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"SIG_VALIDATION_FAILED\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"initCode\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"paymasterAndData\",\"type\":\"bytes\"}],\"name\":\"_validateSenderAndPaymaster\",\"outputs\":[],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"unstakeDelaySec\",\"type\":\"uint32\"}],\"name\":\"addStake\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"depositTo\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"deposits\",\"outputs\":[{\"internalType\":\"uint112\",\"name\":\"deposit\",\"type\":\"uint112\"},{\"internalType\":\"bool\",\"name\":\"staked\",\"type\":\"bool\"},{\"internalType\":\"uint112\",\"name\":\"stake\",\"type\":\"uint112\"},{\"internalType\":\"uint32\",\"name\":\"unstakeDelaySec\",\"type\":\"uint32\"},{\"internalType\":\"uint48\",\"name\":\"withdrawTime\",\"type\":\"uint48\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"getDepositInfo\",\"outputs\":[{\"components\":[{\"internalType\":\"uint112\",\"name\":\"deposit\",\"type\":\"uint112\"},{\"internalType\":\"bool\",\"name\":\"staked\",\"type\":\"bool\"},{\"internalType\":\"uint112\",\"name\":\"stake\",\"type\":\"uint112\"},{\"internalType\":\"uint32\",\"name\":\"unstakeDelaySec\",\"type\":\"uint32\"},{\"internalType\":\"uint48\",\"name\":\"withdrawTime\",\"type\":\"uint48\"}],\"internalType\":\"structIStakeManager.DepositInfo\",\"name\":\"info\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint192\",\"name\":\"key\",\"type\":\"uint192\"}],\"name\":\"getNonce\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"initCode\",\"type\":\"bytes\"}],\"name\":\"getSenderAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"initCode\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"callGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"verificationGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"preVerificationGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxPriorityFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"paymasterAndData\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structUserOperation\",\"name\":\"userOp\",\"type\":\"tuple\"}],\"name\":\"getUserOpHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"initCode\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"callGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"verificationGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"preVerificationGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxPriorityFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"paymasterAndData\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structUserOperation[]\",\"name\":\"userOps\",\"type\":\"tuple[]\"},{\"internalType\":\"contractIAggregator\",\"name\":\"aggregator\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structIEntryPoint.UserOpsPerAggregator[]\",\"name\":\"opsPerAggregator\",\"type\":\"tuple[]\"},{\"internalType\":\"addresspayable\",\"name\":\"beneficiary\",\"type\":\"address\"}],\"name\":\"handleAggregatedOps\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"initCode\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"callGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"verificationGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"preVerificationGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxPriorityFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"paymasterAndData\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structUserOperation[]\",\"name\":\"ops\",\"type\":\"tuple[]\"},{\"internalType\":\"addresspayable\",\"name\":\"beneficiary\",\"type\":\"address\"}],\"name\":\"handleOps\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint192\",\"name\":\"key\",\"type\":\"uint192\"}],\"name\":\"incrementNonce\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"},{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"callGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"verificationGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"preVerificationGas\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"paymaster\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"maxFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxPriorityFeePerGas\",\"type\":\"uint256\"}],\"internalType\":\"structEntryPoint.MemoryUserOp\",\"name\":\"mUserOp\",\"type\":\"tuple\"},{\"internalType\":\"bytes32\",\"name\":\"userOpHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"prefund\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"contextOffset\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"preOpGas\",\"type\":\"uint256\"}],\"internalType\":\"structEntryPoint.UserOpInfo\",\"name\":\"opInfo\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"context\",\"type\":\"bytes\"}],\"name\":\"innerHandleOp\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"actualGasCost\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint192\",\"name\":\"\",\"type\":\"uint192\"}],\"name\":\"nonceSequenceNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"initCode\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"callGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"verificationGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"preVerificationGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxPriorityFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"paymasterAndData\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structUserOperation\",\"name\":\"op\",\"type\":\"tuple\"},{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"targetCallData\",\"type\":\"bytes\"}],\"name\":\"simulateHandleOp\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"initCode\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"callGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"verificationGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"preVerificationGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxPriorityFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"paymasterAndData\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structUserOperation\",\"name\":\"userOp\",\"type\":\"tuple\"}],\"name\":\"simulateValidation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unlockStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"withdrawAddress\",\"type\":\"address\"}],\"name\":\"withdrawStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"withdrawAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"withdrawAmount\",\"type\":\"uint256\"}],\"name\":\"withdrawTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", + Bin: "0x60a080604052346200008957600160025561022c8181016001600160401b038111838210176200007357829162005d18833903906000f080156200006757608052604051615c8990816200008f82396080518181816113df01528181613e9501526141b60152f35b6040513d6000823e3d90fd5b634e487b7160e01b600052604160045260246000fd5b600080fdfe60806040526004361015610023575b361561001957600080fd5b610021615531565b005b60003560e01c80630396cb60146101b35780630bd28e3b146101aa5780631b2e01b8146101a15780631d732756146101985780631fad948c1461018f578063205c28781461018657806335567e1a1461017d5780634b1d7cf5146101745780635287ce121461016b57806370a08231146101625780638f41ec5a14610159578063957122ab146101505780639b249f6914610147578063a61935311461013e578063b760faf914610135578063bb9fe6bf1461012c578063c23a5cea14610123578063d6383f941461011a578063ee219423146101115763fc7e286d0361000e5761010c611bcd565b61000e565b5061010c6119b5565b5061010c61184d565b5061010c6116b4565b5061010c611536565b5061010c6114f7565b5061010c6114d6565b5061010c611337565b5061010c611164565b5061010c611129565b5061010c6110a4565b5061010c610f54565b5061010c610bf8565b5061010c610b33565b5061010c610994565b5061010c6108ba565b5061010c6106e7565b5061010c610467565b5061010c610385565b5060207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103595760043563ffffffff8116808203610359576103547fa5ae833d0bb1dcd632d98a8b70973e8516812898e19bf27b70071ebc8dc52c01916102716102413373ffffffffffffffffffffffffffffffffffffffff166000526000602052604060002090565b9161024d811515615697565b61026a610261600185015463ffffffff1690565b63ffffffff1690565b11156156fc565b54926103366dffffffffffffffffffffffffffff946102f461029834888460781c166121d5565b966102a4881515615761565b6102b0818911156157c6565b6102d4816102bc6105ec565b941684906dffffffffffffffffffffffffffff169052565b6001602084015287166dffffffffffffffffffffffffffff166040830152565b63ffffffff83166060820152600060808201526103313373ffffffffffffffffffffffffffffffffffffffff166000526000602052604060002090565b61582b565b6040805194855263ffffffff90911660208501523393918291820190565b0390a2005b600080fd5b6024359077ffffffffffffffffffffffffffffffffffffffffffffffff8216820361035957565b50346103595760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103595760043577ffffffffffffffffffffffffffffffffffffffffffffffff81168103610359576104149033600052600160205260406000209077ffffffffffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b61041e8154612491565b9055005b73ffffffffffffffffffffffffffffffffffffffff81160361035957565b6024359061044d82610422565b565b60c4359061044d82610422565b359061044d82610422565b50346103595760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103595760206104fc6004356104a881610422565b73ffffffffffffffffffffffffffffffffffffffff6104c561035e565b91166000526001835260406000209077ffffffffffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b54604051908152f35b507f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60a0810190811067ffffffffffffffff82111761055157604052565b610559610505565b604052565b610100810190811067ffffffffffffffff82111761055157604052565b67ffffffffffffffff811161055157604052565b6060810190811067ffffffffffffffff82111761055157604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761055157604052565b6040519061044d82610535565b6040519060c0820182811067ffffffffffffffff82111761055157604052565b604051906040820182811067ffffffffffffffff82111761055157604052565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f60209267ffffffffffffffff8111610675575b01160190565b61067d610505565b61066f565b92919261068e82610639565b9161069c60405193846105ab565b829481845281830111610359578281602093846000960137010152565b9181601f840112156103595782359167ffffffffffffffff8311610359576020838186019501011161035957565b5034610359576101c07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103595767ffffffffffffffff60043581811161035957366023820112156103595761074a903690602481600401359101610682565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc36016101808112610359576101006040519161078783610535565b12610359576040516107988161055e565b6107a0610440565b815260443560208201526064356040820152608435606082015260a43560808201526107ca61044f565b60a082015260e43560c08201526101043560e082015281526101243560208201526101443560408201526101643560608201526101843560808201526101a4359182116103595761083e9261082661082e9336906004016106b9565b9290916128b1565b6040519081529081906020820190565b0390f35b9060407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8301126103595760043567ffffffffffffffff9283821161035957806023830112156103595781600401359384116103595760248460051b830101116103595760240191906024356108b781610422565b90565b5034610359576108c936610842565b6108d4929192611e3a565b6108dd83611d2d565b60005b84811061095d57506000927fbb47ee3e183a558b1a2ff0874b079f3fc5478b7454eacf2bfc5af2ff5878f9728480a183915b85831061092d576109238585611ed7565b6100216001600255565b909193600190610953610941878987611dec565b61094b8886611dca565b51908861233f565b0194019190610912565b8061098b610984610972600194869896611dca565b5161097e848a88611dec565b84613448565b9083612f30565b019290926108e0565b50346103595760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610359576004356109d081610422565b6024359060009133835282602052604083206dffffffffffffffffffffffffffff81541692838311610ad557848373ffffffffffffffffffffffffffffffffffffffff829593610a788496610a3f610a2c8798610ad29c6121c0565b6dffffffffffffffffffffffffffff1690565b6dffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffff0000000000000000000000000000825416179055565b6040805173ffffffffffffffffffffffffffffffffffffffff831681526020810185905233917fd1c19fbcd4551a5edfb66d43d2e337c04837afda3482b42bdf569a8fccdae5fb91a2165af1610acc611ea7565b50615ba2565b80f35b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f576974686472617720616d6f756e7420746f6f206c61726765000000000000006044820152fd5b50346103595760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610359576020600435610b7181610422565b73ffffffffffffffffffffffffffffffffffffffff610b8e61035e565b911660005260018252610bc98160406000209077ffffffffffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000006040519260401b16178152f35b503461035957610c0736610842565b610c0f611e3a565b6000805b838210610df657610c249150611d2d565b7fbb47ee3e183a558b1a2ff0874b079f3fc5478b7454eacf2bfc5af2ff5878f972600080a16000805b848110610d5c57505060008093815b818110610c9357610923868660007f575ff3acadd5ab348fe1855e217e0f3678f8d767d7494c9f9fefbee2e17cca4d8180a2611ed7565b610cf7610ca182848a6124cb565b610ccc610cb3610cb36020840161256d565b73ffffffffffffffffffffffffffffffffffffffff1690565b7f575ff3acadd5ab348fe1855e217e0f3678f8d767d7494c9f9fefbee2e17cca4d600080a280612519565b906000915b808310610d1457505050610d0f90612491565b610c5c565b90919497610d4f610d49610d5592610d438c8b610d3c82610d368e8b8d611dec565b92611dca565b519161233f565b906121d5565b99612491565b95612491565b9190610cfc565b610d678186886124cb565b6020610d7f610d768380612519565b9290930161256d565b9173ffffffffffffffffffffffffffffffffffffffff60009316905b828410610db45750505050610daf90612491565b610c4d565b90919294610d4f81610de985610de2610dd0610dee968d611dca565b51610ddc8c8b8a611dec565b85613448565b908b613148565b612491565b929190610d9b565b610e018285876124cb565b90610e0c8280612519565b92610e1c610cb36020830161256d565b9173ffffffffffffffffffffffffffffffffffffffff8316610e416001821415612577565b610e62575b505050610e5c91610e56916121d5565b91612491565b90610c13565b909592610e7b6040999693999895989788810190611fc8565b92908a3b156103595789938b918a5193849283927fe3563a4f00000000000000000000000000000000000000000000000000000000845260049e8f850193610ec294612711565b03815a93600094fa9081610f3b575b50610f255786517f86a9f75000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8a16818a0190815281906020010390fd5b0390fd5b9497509295509093509181610e56610e5c610e46565b80610f48610f4e9261057b565b8061111e565b38610ed1565b50346103595760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103595761083e73ffffffffffffffffffffffffffffffffffffffff600435610fa881610422565b608060409283928351610fba81610535565b60009381858093528260208201528287820152826060820152015216815280602052209061104965ffffffffffff6001835194610ff686610535565b80546dffffffffffffffffffffffffffff8082168852607082901c60ff161515602089015260789190911c1685870152015463ffffffff8116606086015260201c16608084019065ffffffffffff169052565b5191829182919091608065ffffffffffff8160a08401956dffffffffffffffffffffffffffff808251168652602082015115156020870152604082015116604086015263ffffffff6060820151166060860152015116910152565b50346103595760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103595773ffffffffffffffffffffffffffffffffffffffff6004356110f581610422565b16600052600060205260206dffffffffffffffffffffffffffff60406000205416604051908152f35b600091031261035957565b50346103595760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261035957602060405160018152f35b50346103595760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261035957600467ffffffffffffffff8135818111610359576111b590369084016106b9565b9050602435916111c483610422565b604435908111610359576111db90369085016106b9565b92909115908161132d575b506112c6576014821015611236575b610f21836040519182917f08c379a0000000000000000000000000000000000000000000000000000000008352820160409060208152600060208201520190565b6112466112529261124c92612b88565b90612b96565b60601c90565b3b1561125f5738806111f5565b610f21906040519182917f08c379a0000000000000000000000000000000000000000000000000000000008352820160609060208152601b60208201527f41413330207061796d6173746572206e6f74206465706c6f796564000000000060408201520190565b610f21836040519182917f08c379a0000000000000000000000000000000000000000000000000000000008352820160609060208152601960208201527f41413230206163636f756e74206e6f74206465706c6f7965640000000000000060408201520190565b90503b15386111e6565b50346103595760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103595760043567ffffffffffffffff81116103595761138960249136906004016106b9565b906113bf6040519283927f570e1a3600000000000000000000000000000000000000000000000000000000845260048401612d2c565b0360208273ffffffffffffffffffffffffffffffffffffffff92816000857f0000000000000000000000000000000000000000000000000000000000000000165af1918215611471575b600092611441575b50604051917f6ca7b806000000000000000000000000000000000000000000000000000000008352166004820152fd5b61146391925060203d811161146a575b61145b81836105ab565b810190612d17565b9038611411565b503d611451565b611479612183565b611409565b90816101609103126103595790565b60207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc820112610359576004359067ffffffffffffffff8211610359576108b79160040161147e565b50346103595760206114ef6114ea3661148d565b612a0c565b604051908152f35b5060207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103595761002160043561153181610422565b61562b565b5034610359576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126116b1573381528060205260408120600181019063ffffffff825416908115611653576115f06115b5611618936115a76115a2855460ff9060701c1690565b61598f565b65ffffffffffff42166159f4565b84547fffffffffffffffffffffffffffffffffffffffffffff000000000000ffffffff16602082901b69ffffffffffff000000001617909455565b7fffffffffffffffffffffffffffffffffff00ffffffffffffffffffffffffffff8154169055565b60405165ffffffffffff91909116815233907ffa9b3c14cc825c412c9ed81b3ba365a5b459439403f18829e572ed53a4180f0a90602090a280f35b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f6e6f74207374616b6564000000000000000000000000000000000000000000006044820152fd5b80fd5b50346103595760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610359576004356116f081610422565b610ad273ffffffffffffffffffffffffffffffffffffffff6117323373ffffffffffffffffffffffffffffffffffffffff166000526000602052604060002090565b926117ea611755610a2c86546dffffffffffffffffffffffffffff9060781c1690565b94611761861515615a0e565b6117c26001820161179a65ffffffffffff611786835465ffffffffffff9060201c1690565b16611792811515615a73565b421015615ad8565b80547fffffffffffffffffffffffffffffffffffffffffffff00000000000000000000169055565b7fffffff0000000000000000000000000000ffffffffffffffffffffffffffffff8154169055565b6040805173ffffffffffffffffffffffffffffffffffffffff831681526020810186905233917fb7c918e0e249f999e965cafeb6c664271b3f4317d296461500e71da39f0cbda391a2600080809581948294165af1611847611ea7565b50615b3d565b50346103595760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103595767ffffffffffffffff6004358181116103595761189e90369060040161147e565b602435916118ab83610422565b604435908111610359576118c6610f219136906004016106b9565b6118ce611caa565b6118d785612e2b565b6118ea6118e48287613240565b906153ba565b946118fa826000924384526121e2565b96438252819360609573ffffffffffffffffffffffffffffffffffffffff8316611981575b50505050608001519361194e6040611940602084015165ffffffffffff1690565b92015165ffffffffffff1690565b906040519687967f8b7ac980000000000000000000000000000000000000000000000000000000008852600488016127e1565b8395508394965061199b60409492939451809481936127d3565b03925af19060806119aa611ea7565b92919038808061191f565b5034610359576119c43661148d565b6119cc611caa565b6119d582612e2b565b6119df8183613240565b825160a00151919391611a0c9073ffffffffffffffffffffffffffffffffffffffff166154dc565b6154dc565b90611a30611a07855173ffffffffffffffffffffffffffffffffffffffff90511690565b94611a39612b50565b50611a68611a4c60409586810190611fc8565b90600060148310611bc55750611246611a079261124c92612b88565b91611a72916153ba565b805173ffffffffffffffffffffffffffffffffffffffff169073ffffffffffffffffffffffffffffffffffffffff821660018114916080880151978781015191886020820151611ac79065ffffffffffff1690565b91015165ffffffffffff16916060015192611ae06105f9565b9a8b5260208b0152841515898b015265ffffffffffff1660608a015265ffffffffffff16608089015260a088015215159081611bbc575b50611b515750610f2192519485947fe0cff05f00000000000000000000000000000000000000000000000000000000865260048601612cbd565b9190610f2193611b60846154dc565b611b87611b6b610619565b73ffffffffffffffffffffffffffffffffffffffff9096168652565b6020850152519586957ffaecb4e400000000000000000000000000000000000000000000000000000000875260048701612c2b565b90501538611b17565b9150506154dc565b50346103595760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103595773ffffffffffffffffffffffffffffffffffffffff600435611c1e81610422565b16600052600060205260a0604060002065ffffffffffff60018254920154604051926dffffffffffffffffffffffffffff90818116855260ff8160701c161515602086015260781c16604084015263ffffffff8116606084015260201c166080820152f35b60209067ffffffffffffffff8111611c9d575b60051b0190565b611ca5610505565b611c96565b60405190611cb782610535565b604051608083610100830167ffffffffffffffff811184821017611d20575b60405260009283815283602082015283604082015283606082015283838201528360a08201528360c08201528360e082015281528260208201528260408201528260608201520152565b611d28610505565b611cd6565b90611d3782611c83565b611d4460405191826105ab565b8281527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0611d728294611c83565b019060005b828110611d8357505050565b602090611d8e611caa565b82828501015201611d77565b507f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020918151811015611ddf575b60051b010190565b611de7611d9a565b611dd7565b9190811015611e2d575b60051b810135907ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffea181360301821215610359570190565b611e35611d9a565b611df6565b6002805414611e495760028055565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152fd5b3d15611ed2573d90611eb882610639565b91611ec660405193846105ab565b82523d6000602084013e565b606090565b73ffffffffffffffffffffffffffffffffffffffff168015611f6a57600080809381935af1611f04611ea7565b5015611f0c57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f41413931206661696c65642073656e6420746f2062656e6566696369617279006044820152fd5b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f4141393020696e76616c69642062656e656669636961727900000000000000006044820152fd5b9035907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe181360301821215610359570180359067ffffffffffffffff82116103595760200191813603831361035957565b90816020910312610359575190565b601f82602094937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0938186528686013760008582860101520116010190565b60005b83811061207a5750506000910152565b818101518382015260200161206a565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f6020936120c681518092818752878088019101612067565b0116010190565b906120e76080916108b796946101c0808652850191612028565b9360e0815173ffffffffffffffffffffffffffffffffffffffff80825116602087015260208201516040870152604082015160608701526060820151858701528482015160a087015260a08201511660c086015260c081015182860152015161010084015260208101516101208401526040810151610140840152606081015161016084015201516101808201526101a081840391015261208a565b506040513d6000823e3d90fd5b507f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b919082039182116121cd57565b61044d612190565b919082018092116121cd57565b905a918160206121fb6060830151936060810190611fc8565b906122348560405195869485947f1d732756000000000000000000000000000000000000000000000000000000008652600486016120cd565b03816000305af16000918161230f575b50612308575060206000803e7fdeaddead000000000000000000000000000000000000000000000000000000006000511461229b5761229561228a6108b7945a906121c0565b6080840151906121d5565b91614afc565b6040517f220266b600000000000000000000000000000000000000000000000000000000815280610f21600482016080906000815260406020820152600f60408201527f41413935206f7574206f6620676173000000000000000000000000000000000060608201520190565b9250505090565b61233191925060203d8111612338575b61232981836105ab565b810190612019565b9038612244565b503d61231f565b909291925a9380602061235b6060830151946060810190611fc8565b906123948660405195869485947f1d732756000000000000000000000000000000000000000000000000000000008652600486016120cd565b03816000305af160009181612471575b5061246a575060206000803e7fdeaddead00000000000000000000000000000000000000000000000000000000600051146123fc576123f66123eb6108b795965a906121c0565b6080830151906121d5565b92614ddf565b610f21836040519182917f220266b600000000000000000000000000000000000000000000000000000000835260048301608091815260406020820152600f60408201527f41413935206f7574206f6620676173000000000000000000000000000000000060608201520190565b9450505050565b61248a91925060203d81116123385761232981836105ab565b90386123a4565b6001907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146124bf570190565b6124c7612190565b0190565b919081101561250c575b60051b810135907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa181360301821215610359570190565b612514611d9a565b6124d5565b9035907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe181360301821215610359570180359067ffffffffffffffff821161035957602001918160051b3603831361035957565b356108b781610422565b1561257e57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4141393620696e76616c69642061676772656761746f720000000000000000006044820152fd5b90357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18236030181121561035957016020813591019167ffffffffffffffff821161035957813603831361035957565b6108b7916126578161263d8461045c565b73ffffffffffffffffffffffffffffffffffffffff169052565b602082013560208201526126f26126a361268861267760408601866125dc565b610160806040880152860191612028565b61269560608601866125dc565b908583036060870152612028565b6080840135608084015260a084013560a084015260c084013560c084015260e084013560e084015261010080850135908401526101206126e5818601866125dc565b9185840390860152612028565b9161270361014091828101906125dc565b929091818503910152612028565b949391929083604087016040885252606086019360608160051b8801019482600090815b848310612754575050505050508460206108b795968503910152612028565b9091929394977fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa08b820301855288357ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffea1843603018112156127cf57600191846127bd920161262c565b98602090810196950193019190612735565b8280fd5b908092918237016000815290565b9290936108b796959260c0958552602085015265ffffffffffff8092166040850152166060830152151560808201528160a0820152019061208a565b1561282457565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4141393220696e7465726e616c2063616c6c206f6e6c790000000000000000006044820152fd5b9060406108b79260008152816020820152019061208a565b6040906108b793928152816020820152019061208a565b909291925a936128c230331461281d565b8151946040860151955a6113886060830151890101116129e2576108b7966000958051612909575b50505090612903915a9003608084015101943691610682565b91615047565b612938916129349161292f855173ffffffffffffffffffffffffffffffffffffffff1690565b615c12565b1590565b612944575b80806128ea565b61290392919450612953615c24565b908151612967575b5050600193909161293d565b7f1c4fada7374c0a9ee8841fc38afe82932dc0f8e69012e927f061a8bae611a20173ffffffffffffffffffffffffffffffffffffffff6020870151926129d860206129c6835173ffffffffffffffffffffffffffffffffffffffff1690565b9201519560405193849316968361289a565b0390a3388061295b565b7fdeaddead0000000000000000000000000000000000000000000000000000000060005260206000fd5b612a22612a1c6040830183611fc8565b90615c07565b90612a33612a1c6060830183611fc8565b90612ae9612a48612a1c610120840184611fc8565b60405194859360208501956101008201359260e08301359260c08101359260a08201359260808301359273ffffffffffffffffffffffffffffffffffffffff60208201359135168c9693909a9998959261012098959273ffffffffffffffffffffffffffffffffffffffff6101408a019d168952602089015260408801526060870152608086015260a085015260c084015260e08301526101008201520152565b0391612b1b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0938481018352826105ab565b51902060408051602081019283523091810191909152466060820152608092830181529091612b4a90826105ab565b51902090565b604051906040820182811067ffffffffffffffff821117612b7b575b60405260006020838281520152565b612b83610505565b612b6c565b906014116103595790601490565b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000009035818116939260148110612bcb57505050565b60140360031b82901b16169150565b9060c060a06108b793805184526020810151602085015260408101511515604085015265ffffffffffff80606083015116606086015260808201511660808501520151918160a0820152019061208a565b9294612c8c61044d95612c7a610100959998612c68612c54602097610140808c528b0190612bda565b9b878a019060208091805184520151910152565b80516060890152602001516080880152565b805160a08701526020015160c0860152565b73ffffffffffffffffffffffffffffffffffffffff81511660e0850152015191019060208091805184520151910152565b612d0661044d94612cf4612cdf60a0959998969960e0865260e0860190612bda565b98602085019060208091805184520151910152565b80516060840152602001516080830152565b019060208091805184520151910152565b9081602091031261035957516108b781610422565b9160206108b7938181520191612028565b90612d6c73ffffffffffffffffffffffffffffffffffffffff916108b797959694606085526060850191612028565b941660208201526040818503910152612028565b60009060033d11612d8d57565b905060046000803e60005160e01c90565b600060443d106108b7576040517ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc91823d016004833e815167ffffffffffffffff918282113d602484011117612e1a57818401948551938411612e22573d85010160208487010111612e1a57506108b7929101602001906105ab565b949350505050565b50949350505050565b612e386040820182611fc8565b612e50612e448461256d565b93610120810190611fc8565b9290303b1561035957600093612e949160405196879586957f957122ab00000000000000000000000000000000000000000000000000000000875260048701612d3d565b0381305afa9081612f1d575b5061044d576001612eaf612d80565b6308c379a014612ec8575b612ec057565b61044d612183565b612ed0612d9e565b80612edc575b50612eba565b80516000925015612ed657610f21906040519182917f220266b600000000000000000000000000000000000000000000000000000000835260048301612882565b80610f48612f2a9261057b565b38612ea0565b9190612f3b9061317f565b73ffffffffffffffffffffffffffffffffffffffff929183166130da5761306c57612f659061317f565b9116612ffe57612f725750565b604080517f220266b600000000000000000000000000000000000000000000000000000000815260048101929092526024820152602160448201527f41413332207061796d61737465722065787069726564206f72206e6f7420647560648201527f6500000000000000000000000000000000000000000000000000000000000000608482015260a490fd5b610f21826040519182917f220266b600000000000000000000000000000000000000000000000000000000835260048301608091815260406020820152601460408201527f41413334207369676e6174757265206572726f7200000000000000000000000060608201520190565b610f21836040519182917f220266b600000000000000000000000000000000000000000000000000000000835260048301608091815260406020820152601760408201527f414132322065787069726564206f72206e6f742064756500000000000000000060608201520190565b610f21846040519182917f220266b600000000000000000000000000000000000000000000000000000000835260048301608091815260406020820152601460408201527f41413234207369676e6174757265206572726f7200000000000000000000000060608201520190565b9291906131549061317f565b909273ffffffffffffffffffffffffffffffffffffffff808095169116036130da5761306c57612f65905b80156131d25761318e9061535f565b73ffffffffffffffffffffffffffffffffffffffff65ffffffffffff8060408401511642119081156131c2575b5091511691565b90506020830151164210386131bb565b50600090600090565b156131e257565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f41413934206761732076616c756573206f766572666c6f7700000000000000006044820152fd5b916000915a9381519061325382826136b3565b61325c81612a0c565b602084015261329a6effffffffffffffffffffffffffffff60808401516060850151176040850151176101008401359060e0850135171711156131db565b6132a382613775565b6132ae818584613836565b97906132df6129346132d4875173ffffffffffffffffffffffffffffffffffffffff1690565b60208801519061546c565b6133db576132ec43600052565b73ffffffffffffffffffffffffffffffffffffffff61332460a0606097015173ffffffffffffffffffffffffffffffffffffffff1690565b166133c1575b505a810360a0840135106133545760809360c092604087015260608601525a900391013501910152565b6040517f220266b600000000000000000000000000000000000000000000000000000000815280610f21600482016080906000815260406020820152601e60408201527f41413430206f76657220766572696669636174696f6e4761734c696d6974000060608201520190565b909350816133d2929750858461455c565b9590923861332a565b6040517f220266b600000000000000000000000000000000000000000000000000000000815280610f21600482016080906000815260406020820152601a60408201527f4141323520696e76616c6964206163636f756e74206e6f6e636500000000000060608201520190565b9290916000925a825161345b81846136b3565b61346483612a0c565b60208501526134a26effffffffffffffffffffffffffffff60808301516060840151176040840151176101008601359060e0870135171711156131db565b6134ab81613775565b6134b78186868b613ba2565b98906134e86129346134dd865173ffffffffffffffffffffffffffffffffffffffff1690565b60208701519061546c565b6135e0576134f543600052565b73ffffffffffffffffffffffffffffffffffffffff61352d60a0606096015173ffffffffffffffffffffffffffffffffffffffff1690565b166135c5575b505a840360a08601351061355f5750604085015260608401526080919060c0905a900391013501910152565b604080517f220266b600000000000000000000000000000000000000000000000000000000815260048101929092526024820152601e60448201527f41413430206f76657220766572696669636174696f6e4761734c696d697400006064820152608490fd5b909250816135d79298508686856147ef565b96909138613533565b610f21826040519182917f220266b600000000000000000000000000000000000000000000000000000000835260048301608091815260406020820152601a60408201527f4141323520696e76616c6964206163636f756e74206e6f6e636500000000000060608201520190565b1561365557565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f4141393320696e76616c6964207061796d6173746572416e64446174610000006044820152fd5b613725906136dd6136c38261256d565b73ffffffffffffffffffffffffffffffffffffffff168452565b602081013560208401526080810135604084015260a0810135606084015260c0810135608084015260e081013560c084015261010081013560e0840152610120810190611fc8565b90811561376a5761374f61124c6112468460a09461374a601461044d9998101561364e565b612b88565b73ffffffffffffffffffffffffffffffffffffffff16910152565b505060a06000910152565b60a081015173ffffffffffffffffffffffffffffffffffffffff16156137b75760c060035b60ff60408401519116606084015102016080830151019101510290565b60c0600161379a565b6137d86040929594939560608352606083019061262c565b9460208201520152565b9061044d602f60405180947f414132332072657665727465643a20000000000000000000000000000000000060208301526138268151809260208686019101612067565b810103600f8101855201836105ab565b916000926000925a936139046020835193613865855173ffffffffffffffffffffffffffffffffffffffff1690565b9561387d6138766040830183611fc8565b9084613e0d565b60a086015173ffffffffffffffffffffffffffffffffffffffff16906138a243600052565b85809373ffffffffffffffffffffffffffffffffffffffff809416159889613b3a575b60600151908601516040517f3a871cdd0000000000000000000000000000000000000000000000000000000081529788968795869390600485016137c0565b03938a1690f1829181613b1a575b50613b115750600190613923612d80565b6308c379a014613abd575b50613a50575b613941575b50505a900391565b61396b9073ffffffffffffffffffffffffffffffffffffffff166000526000602052604060002090565b613986610a2c82546dffffffffffffffffffffffffffff1690565b8083116139e3576139dc926dffffffffffffffffffffffffffff9103166dffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffff0000000000000000000000000000825416179055565b3880613939565b6040517f220266b600000000000000000000000000000000000000000000000000000000815280610f21600482016080906000815260406020820152601760408201527f41413231206469646e2774207061792070726566756e6400000000000000000060608201520190565b6040517f220266b600000000000000000000000000000000000000000000000000000000815280610f21600482016080906000815260406020820152601660408201527f4141323320726576657274656420286f72204f4f47290000000000000000000060608201520190565b613ac5612d9e565b9081613ad1575061392e565b610f2191613adf91506137e2565b6040519182917f220266b600000000000000000000000000000000000000000000000000000000835260048301612882565b95506139349050565b613b3391925060203d81116123385761232981836105ab565b9038613912565b9450613b80610a2c613b6c8c73ffffffffffffffffffffffffffffffffffffffff166000526000602052604060002090565b546dffffffffffffffffffffffffffff1690565b8b811115613b975750856060835b969150506138c5565b606087918d03613b8e565b90926000936000935a94613beb6020835193613bd2855173ffffffffffffffffffffffffffffffffffffffff1690565b9561387d613be36040830183611fc8565b90848c61412b565b03938a1690f1829181613ded575b50613de45750600190613c0a612d80565b6308c379a014613d8e575b50613d20575b613c29575b5050505a900391565b613c539073ffffffffffffffffffffffffffffffffffffffff166000526000602052604060002090565b91613c6f610a2c84546dffffffffffffffffffffffffffff1690565b90818311613cba575082547fffffffffffffffffffffffffffffffffffff0000000000000000000000000000169190036dffffffffffffffffffffffffffff16179055388080613c20565b604080517f220266b600000000000000000000000000000000000000000000000000000000815260048101929092526024820152601760448201527f41413231206469646e2774207061792070726566756e640000000000000000006064820152608490fd5b610f21846040519182917f220266b600000000000000000000000000000000000000000000000000000000835260048301608091815260406020820152601660408201527f4141323320726576657274656420286f72204f4f47290000000000000000000060608201520190565b613d96612d9e565b9081613da25750613c15565b8691613dae91506137e2565b90610f216040519283927f220266b60000000000000000000000000000000000000000000000000000000084526004840161289a565b9650613c1b9050565b613e0691925060203d81116123385761232981836105ab565b9038613bf9565b909180613e1957505050565b81515173ffffffffffffffffffffffffffffffffffffffff1692833b6140be57606083510151604051907f570e1a3600000000000000000000000000000000000000000000000000000000825260208280613e78878760048401612d2c565b0381600073ffffffffffffffffffffffffffffffffffffffff95867f00000000000000000000000000000000000000000000000000000000000000001690f19182156140b1575b600092614091575b508082169586156140245716809503613fb7573b15613f4a5761124c6112467fd51a9c61267aa6196961883ecf5ff2da6619c37dac0fa92122513fb32c032d2d93613f1193612b88565b602083810151935160a001516040805173ffffffffffffffffffffffffffffffffffffffff9485168152939091169183019190915290a3565b6040517f220266b600000000000000000000000000000000000000000000000000000000815280610f21600482016080906000815260406020820152602060408201527f4141313520696e6974436f6465206d757374206372656174652073656e64657260608201520190565b6040517f220266b600000000000000000000000000000000000000000000000000000000815280610f21600482016080906000815260406020820152602060408201527f4141313420696e6974436f6465206d7573742072657475726e2073656e64657260608201520190565b6040517f220266b600000000000000000000000000000000000000000000000000000000815280610f21600482016080906000815260406020820152601b60408201527f4141313320696e6974436f6465206661696c6564206f72204f4f47000000000060608201520190565b6140aa91925060203d811161146a5761145b81836105ab565b9038613ec7565b6140b9612183565b613ebf565b6040517f220266b600000000000000000000000000000000000000000000000000000000815280610f21600482016080906000815260406020820152601f60408201527f414131302073656e64657220616c726561647920636f6e73747275637465640060608201520190565b9290918161413a575b50505050565b82515173ffffffffffffffffffffffffffffffffffffffff1693843b6143e257606084510151604051907f570e1a3600000000000000000000000000000000000000000000000000000000825260208280614199888860048401612d2c565b0381600073ffffffffffffffffffffffffffffffffffffffff95867f00000000000000000000000000000000000000000000000000000000000000001690f19182156143d5575b6000926143b5575b5080821696871561434757168096036142d9573b15614273575061124c6112467fd51a9c61267aa6196961883ecf5ff2da6619c37dac0fa92122513fb32c032d2d9361423393612b88565b602083810151935160a001516040805173ffffffffffffffffffffffffffffffffffffffff9485168152939091169183019190915290a338808080614134565b604080517f220266b600000000000000000000000000000000000000000000000000000000815260048101929092526024820152602060448201527f4141313520696e6974436f6465206d757374206372656174652073656e6465726064820152608490fd5b610f21826040519182917f220266b600000000000000000000000000000000000000000000000000000000835260048301608091815260406020820152602060408201527f4141313420696e6974436f6465206d7573742072657475726e2073656e64657260608201520190565b610f21846040519182917f220266b600000000000000000000000000000000000000000000000000000000835260048301608091815260406020820152601b60408201527f4141313320696e6974436f6465206661696c6564206f72204f4f47000000000060608201520190565b6143ce91925060203d811161146a5761145b81836105ab565b90386141e8565b6143dd612183565b6141e0565b604080517f220266b600000000000000000000000000000000000000000000000000000000815260048101929092526024820152601f60448201527f414131302073656e64657220616c726561647920636f6e7374727563746564006064820152608490fd5b1561444f57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f4141343120746f6f206c6974746c6520766572696669636174696f6e476173006044820152fd5b919060408382031261035957825167ffffffffffffffff81116103595783019080601f83011215610359578151916144e483610639565b916144f260405193846105ab565b838352602084830101116103595760209261451291848085019101612067565b92015190565b9061044d602f60405180947f414133332072657665727465643a20000000000000000000000000000000000060208301526138268151809260208686019101612067565b93919260609460009460009380519261459b60a08a86015195614580888811614448565b015173ffffffffffffffffffffffffffffffffffffffff1690565b916145c68373ffffffffffffffffffffffffffffffffffffffff166000526000602052604060002090565b946145e2610a2c87546dffffffffffffffffffffffffffff1690565b968588106147825773ffffffffffffffffffffffffffffffffffffffff60208a98946146588a966dffffffffffffffffffffffffffff8b6146919e03166dffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffff0000000000000000000000000000825416179055565b015194604051998a98899788937ff465c77e000000000000000000000000000000000000000000000000000000008552600485016137c0565b0395169103f190818391849361475c575b506147555750506001906146b4612d80565b6308c379a014614733575b506146c657565b6040517f220266b600000000000000000000000000000000000000000000000000000000815280610f21600482016080906000815260406020820152601660408201527f4141333320726576657274656420286f72204f4f47290000000000000000000060608201520190565b61473b612d9e565b908161474757506146bf565b610f2191613adf9150614518565b9450925050565b90925061477b91503d8085833e61477381836105ab565b8101906144ad565b91386146a2565b6040517f220266b600000000000000000000000000000000000000000000000000000000815280610f21600482016080906000815260406020820152601e60408201527f41413331207061796d6173746572206465706f73697420746f6f206c6f77000060608201520190565b91949293909360609560009560009382519061481660a08b84015193614580848611614448565b936148418573ffffffffffffffffffffffffffffffffffffffff166000526000602052604060002090565b61485c610a2c82546dffffffffffffffffffffffffffff1690565b8781106149b7579273ffffffffffffffffffffffffffffffffffffffff60208a989693946146588a966dffffffffffffffffffffffffffff8d6148d69e9c9a03166dffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffff0000000000000000000000000000825416179055565b0395169103f1908183918493614999575b506149915750506001906148f9612d80565b6308c379a014614972575b5061490c5750565b604080517f220266b600000000000000000000000000000000000000000000000000000000815260048101929092526024820152601660448201527f4141333320726576657274656420286f72204f4f4729000000000000000000006064820152608490fd5b61497a612d9e565b90816149865750614904565b613dae925050614518565b955093505050565b9092506149b091503d8085833e61477381836105ab565b91386148e7565b610f218a6040519182917f220266b600000000000000000000000000000000000000000000000000000000835260048301608091815260406020820152601e60408201527f41413331207061796d6173746572206465706f73697420746f6f206c6f77000060608201520190565b60031115614a2f57565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b929190614a7c6040916002865260606020870152606086019061208a565b930152565b939291906003811015614a2f57604091614a7c91865260606020870152606086019061208a565b9061044d603660405180947f4141353020706f73744f702072657665727465643a20000000000000000000006020830152614aec8151809260208686019101612067565b81010360168101855201836105ab565b929190925a93600091805191614b1183615318565b9260a0810195614b35875173ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff93908481169081614ca457505050614b76825173ffffffffffffffffffffffffffffffffffffffff1690565b985b5a90030193840297604084019089825110614c37577f49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f94614bc26020928c614c329551039061553a565b015194896020614c04614be9865173ffffffffffffffffffffffffffffffffffffffff1690565b9a5173ffffffffffffffffffffffffffffffffffffffff1690565b9401519785604051968796169a16988590949392606092608083019683521515602083015260408201520152565b0390a4565b6040517f220266b600000000000000000000000000000000000000000000000000000000815280610f21600482016080906000815260406020820152602060408201527f414135312070726566756e642062656c6f772061637475616c476173436f737460608201520190565b9a918051614cb4575b5050614b78565b6060850151600099509091803b15614ddb579189918983614d07956040518097819682957fa9a234090000000000000000000000000000000000000000000000000000000084528c029060048401614a5e565b0393f19081614dc8575b50614dc3576001614d20612d80565b6308c379a014614da4575b614d37575b3880614cad565b6040517f220266b600000000000000000000000000000000000000000000000000000000815280610f21600482016080906000815260406020820152601260408201527f4141353020706f73744f7020726576657274000000000000000000000000000060608201520190565b614dac612d9e565b80614db75750614d2b565b613adf610f2191614aa8565b614d30565b80610f48614dd59261057b565b38614d11565b8980fd5b9392915a90600092805190614df382615318565b9360a0830196614e17885173ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff95908681169081614f0d57505050614e58845173ffffffffffffffffffffffffffffffffffffffff1690565b915b5a9003019485029860408301908a825110614ea757507f49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f949392614bc2614c32938c60209451039061553a565b604080517f220266b600000000000000000000000000000000000000000000000000000000815260048101929092526024820152602060448201527f414135312070726566756e642062656c6f772061637475616c476173436f73746064820152608490fd5b93918051614f1d575b5050614e5a565b606087015160009a509091803b1561504357918a918a83614f70956040518097819682957fa9a234090000000000000000000000000000000000000000000000000000000084528c029060048401614a5e565b0393f19081615030575b5061502b576001614f89612d80565b6308c379a01461500e575b614fa0575b3880614f16565b610f218b6040519182917f220266b600000000000000000000000000000000000000000000000000000000835260048301608091815260406020820152601260408201527f4141353020706f73744f7020726576657274000000000000000000000000000060608201520190565b615016612d9e565b806150215750614f94565b613dae8d91614aa8565b614f99565b80610f4861503d9261057b565b38614f7a565b8a80fd5b909392915a9480519161505983615318565b9260a081019561507d875173ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff938185169182615165575050506150bd825173ffffffffffffffffffffffffffffffffffffffff1690565b985b5a90030193840297604084019089825110614c37577f49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f946151096020928c614c329551039061553a565b61511288614a25565b015194896020615139614be9865173ffffffffffffffffffffffffffffffffffffffff1690565b940151604080519182529815602082015297880152606087015290821695909116939081906080820190565b9a918151615175575b50506150bf565b8784026151818a614a25565b60028a1461520c576060860151823b15610359576151d493600080948d604051978896879586937fa9a2340900000000000000000000000000000000000000000000000000000000855260048501614a81565b0393f180156151ff575b6151ec575b505b388061516e565b80610f486151f99261057b565b386151e3565b615207612183565b6151de565b6060860151823b156103595761525793600080948d604051978896879586937fa9a2340900000000000000000000000000000000000000000000000000000000855260048501614a81565b0393f19081615305575b50615300576001615270612d80565b6308c379a0146152ed575b156151e5576040517f220266b600000000000000000000000000000000000000000000000000000000815280610f21600482016080906000815260406020820152601260408201527f4141353020706f73744f7020726576657274000000000000000000000000000060608201520190565b6152f5612d9e565b80614db7575061527b565b6151e5565b80610f486153129261057b565b38615261565b60e060c082015191015180821461533c57480180821015615337575090565b905090565b5090565b6040519061534d8261058f565b60006040838281528260208201520152565b615367615340565b5065ffffffffffff808260a01c1680156153b3575b604051926153898461058f565b73ffffffffffffffffffffffffffffffffffffffff8116845260d01c602084015216604082015290565b508061537c565b6153cf6153d5916153c9615340565b5061535f565b9161535f565b9073ffffffffffffffffffffffffffffffffffffffff9182825116928315615461575b65ffffffffffff928391826040816020850151169301511693836040816020840151169201511690808410615459575b50808511615451575b506040519561543f8761058f565b16855216602084015216604082015290565b935038615431565b925038615428565b8151811693506153f8565b73ffffffffffffffffffffffffffffffffffffffff16600052600160205267ffffffffffffffff6154c88260401c60406000209077ffffffffffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b918254926154d584612491565b9055161490565b9073ffffffffffffffffffffffffffffffffffffffff6154fa612b50565b9216600052600060205263ffffffff600160406000206dffffffffffffffffffffffffffff815460781c1685520154166020830152565b61044d3361562b565b73ffffffffffffffffffffffffffffffffffffffff16600052600060205260406000206dffffffffffffffffffffffffffff8082541692830180931161561e575b8083116155c05761044d92166dffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffff0000000000000000000000000000825416179055565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f6465706f736974206f766572666c6f77000000000000000000000000000000006044820152fd5b615626612190565b61557b565b73ffffffffffffffffffffffffffffffffffffffff9061564b348261553a565b168060005260006020527f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c460206dffffffffffffffffffffffffffff60406000205416604051908152a2565b1561569e57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f6d757374207370656369667920756e7374616b652064656c61790000000000006044820152fd5b1561570357565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f63616e6e6f7420646563726561736520756e7374616b652074696d65000000006044820152fd5b1561576857565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f6e6f207374616b652073706563696669656400000000000000000000000000006044820152fd5b156157cd57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f7374616b65206f766572666c6f770000000000000000000000000000000000006044820152fd5b9065ffffffffffff6080600161044d9461588b6dffffffffffffffffffffffffffff86511682906dffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffff0000000000000000000000000000825416179055565b602085015115156eff000000000000000000000000000082549160701b16807fffffffffffffffffffffffffffffffffff00ffffffffffffffffffffffffffff83161783557fffffff000000000000000000000000000000ffffffffffffffffffffffffffff7cffffffffffffffffffffffffffff000000000000000000000000000000604089015160781b16921617178155019263ffffffff6060820151167fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000008554161784550151167fffffffffffffffffffffffffffffffffffffffffffff000000000000ffffffff69ffffffffffff0000000083549260201b169116179055565b1561599657565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f616c726561647920756e7374616b696e670000000000000000000000000000006044820152fd5b91909165ffffffffffff808094169116019182116121cd57565b15615a1557565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f4e6f207374616b6520746f2077697468647261770000000000000000000000006044820152fd5b15615a7a57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f6d7573742063616c6c20756e6c6f636b5374616b6528292066697273740000006044820152fd5b15615adf57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f5374616b65207769746864726177616c206973206e6f742064756500000000006044820152fd5b15615b4457565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f6661696c656420746f207769746864726177207374616b6500000000000000006044820152fd5b15615ba957565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f6661696c656420746f20776974686472617700000000000000000000000000006044820152fd5b816040519182372090565b9060009283809360208451940192f190565b3d610800808211615c4b575b50604051906020818301016040528082526000602083013e90565b905038615c3056fea2646970667358221220a706d8b02d7086d80e9330811f5af84b2614abdc5e9a1f2260126070a31d7cee64736f6c634300081100336080806040523461001657610210908161001c8239f35b600080fdfe6080604052600436101561001257600080fd5b6000803560e01c63570e1a361461002857600080fd5b346100c95760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100c95760043567ffffffffffffffff918282116100c957366023830112156100c95781600401359283116100c95736602484840101116100c9576100c561009e84602485016100fc565b60405173ffffffffffffffffffffffffffffffffffffffff90911681529081906020820190565b0390f35b80fd5b507f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b90806014116101bb5767ffffffffffffffff917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec82018381116101cd575b604051937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f81600b8701160116850190858210908211176101c0575b604052808452602084019036848401116101bb576020946000600c819682946014880187378301015251923560601c5af19060005191156101b557565b60009150565b600080fd5b6101c86100cc565b610178565b6101d56100cc565b61013a56fea26469706673582212201927e80b76ab9b71c952137dd676621a9fdf520c25928815636594036eb1c40364736f6c63430008110033", +} + +// EntryPointABI is the input ABI used to generate the binding from. +// Deprecated: Use EntryPointMetaData.ABI instead. +var EntryPointABI = EntryPointMetaData.ABI + +// EntryPointBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use EntryPointMetaData.Bin instead. +var EntryPointBin = EntryPointMetaData.Bin + +// DeployEntryPoint deploys a new Ethereum contract, binding an instance of EntryPoint to it. +func DeployEntryPoint(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *EntryPoint, error) { + parsed, err := EntryPointMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(EntryPointBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &EntryPoint{EntryPointCaller: EntryPointCaller{contract: contract}, EntryPointTransactor: EntryPointTransactor{contract: contract}, EntryPointFilterer: EntryPointFilterer{contract: contract}}, nil +} + +// EntryPoint is an auto generated Go binding around an Ethereum contract. +type EntryPoint struct { + EntryPointCaller // Read-only binding to the contract + EntryPointTransactor // Write-only binding to the contract + EntryPointFilterer // Log filterer for contract events +} + +// EntryPointCaller is an auto generated read-only Go binding around an Ethereum contract. +type EntryPointCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// EntryPointTransactor is an auto generated write-only Go binding around an Ethereum contract. +type EntryPointTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// EntryPointFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type EntryPointFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// EntryPointSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type EntryPointSession struct { + Contract *EntryPoint // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// EntryPointCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type EntryPointCallerSession struct { + Contract *EntryPointCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// EntryPointTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type EntryPointTransactorSession struct { + Contract *EntryPointTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// EntryPointRaw is an auto generated low-level Go binding around an Ethereum contract. +type EntryPointRaw struct { + Contract *EntryPoint // Generic contract binding to access the raw methods on +} + +// EntryPointCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type EntryPointCallerRaw struct { + Contract *EntryPointCaller // Generic read-only contract binding to access the raw methods on +} + +// EntryPointTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type EntryPointTransactorRaw struct { + Contract *EntryPointTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewEntryPoint creates a new instance of EntryPoint, bound to a specific deployed contract. +func NewEntryPoint(address common.Address, backend bind.ContractBackend) (*EntryPoint, error) { + contract, err := bindEntryPoint(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &EntryPoint{EntryPointCaller: EntryPointCaller{contract: contract}, EntryPointTransactor: EntryPointTransactor{contract: contract}, EntryPointFilterer: EntryPointFilterer{contract: contract}}, nil +} + +// NewEntryPointCaller creates a new read-only instance of EntryPoint, bound to a specific deployed contract. +func NewEntryPointCaller(address common.Address, caller bind.ContractCaller) (*EntryPointCaller, error) { + contract, err := bindEntryPoint(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &EntryPointCaller{contract: contract}, nil +} + +// NewEntryPointTransactor creates a new write-only instance of EntryPoint, bound to a specific deployed contract. +func NewEntryPointTransactor(address common.Address, transactor bind.ContractTransactor) (*EntryPointTransactor, error) { + contract, err := bindEntryPoint(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &EntryPointTransactor{contract: contract}, nil +} + +// NewEntryPointFilterer creates a new log filterer instance of EntryPoint, bound to a specific deployed contract. +func NewEntryPointFilterer(address common.Address, filterer bind.ContractFilterer) (*EntryPointFilterer, error) { + contract, err := bindEntryPoint(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &EntryPointFilterer{contract: contract}, nil +} + +// bindEntryPoint binds a generic wrapper to an already deployed contract. +func bindEntryPoint(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(EntryPointABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_EntryPoint *EntryPointRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _EntryPoint.Contract.EntryPointCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_EntryPoint *EntryPointRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EntryPoint.Contract.EntryPointTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_EntryPoint *EntryPointRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _EntryPoint.Contract.EntryPointTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_EntryPoint *EntryPointCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _EntryPoint.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_EntryPoint *EntryPointTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EntryPoint.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_EntryPoint *EntryPointTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _EntryPoint.Contract.contract.Transact(opts, method, params...) +} + +// SIGVALIDATIONFAILED is a free data retrieval call binding the contract method 0x8f41ec5a. +// +// Solidity: function SIG_VALIDATION_FAILED() view returns(uint256) +func (_EntryPoint *EntryPointCaller) SIGVALIDATIONFAILED(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _EntryPoint.contract.Call(opts, &out, "SIG_VALIDATION_FAILED") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// SIGVALIDATIONFAILED is a free data retrieval call binding the contract method 0x8f41ec5a. +// +// Solidity: function SIG_VALIDATION_FAILED() view returns(uint256) +func (_EntryPoint *EntryPointSession) SIGVALIDATIONFAILED() (*big.Int, error) { + return _EntryPoint.Contract.SIGVALIDATIONFAILED(&_EntryPoint.CallOpts) +} + +// SIGVALIDATIONFAILED is a free data retrieval call binding the contract method 0x8f41ec5a. +// +// Solidity: function SIG_VALIDATION_FAILED() view returns(uint256) +func (_EntryPoint *EntryPointCallerSession) SIGVALIDATIONFAILED() (*big.Int, error) { + return _EntryPoint.Contract.SIGVALIDATIONFAILED(&_EntryPoint.CallOpts) +} + +// ValidateSenderAndPaymaster is a free data retrieval call binding the contract method 0x957122ab. +// +// Solidity: function _validateSenderAndPaymaster(bytes initCode, address sender, bytes paymasterAndData) view returns() +func (_EntryPoint *EntryPointCaller) ValidateSenderAndPaymaster(opts *bind.CallOpts, initCode []byte, sender common.Address, paymasterAndData []byte) error { + var out []interface{} + err := _EntryPoint.contract.Call(opts, &out, "_validateSenderAndPaymaster", initCode, sender, paymasterAndData) + + if err != nil { + return err + } + + return err + +} + +// ValidateSenderAndPaymaster is a free data retrieval call binding the contract method 0x957122ab. +// +// Solidity: function _validateSenderAndPaymaster(bytes initCode, address sender, bytes paymasterAndData) view returns() +func (_EntryPoint *EntryPointSession) ValidateSenderAndPaymaster(initCode []byte, sender common.Address, paymasterAndData []byte) error { + return _EntryPoint.Contract.ValidateSenderAndPaymaster(&_EntryPoint.CallOpts, initCode, sender, paymasterAndData) +} + +// ValidateSenderAndPaymaster is a free data retrieval call binding the contract method 0x957122ab. +// +// Solidity: function _validateSenderAndPaymaster(bytes initCode, address sender, bytes paymasterAndData) view returns() +func (_EntryPoint *EntryPointCallerSession) ValidateSenderAndPaymaster(initCode []byte, sender common.Address, paymasterAndData []byte) error { + return _EntryPoint.Contract.ValidateSenderAndPaymaster(&_EntryPoint.CallOpts, initCode, sender, paymasterAndData) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) view returns(uint256) +func (_EntryPoint *EntryPointCaller) BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) { + var out []interface{} + err := _EntryPoint.contract.Call(opts, &out, "balanceOf", account) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) view returns(uint256) +func (_EntryPoint *EntryPointSession) BalanceOf(account common.Address) (*big.Int, error) { + return _EntryPoint.Contract.BalanceOf(&_EntryPoint.CallOpts, account) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) view returns(uint256) +func (_EntryPoint *EntryPointCallerSession) BalanceOf(account common.Address) (*big.Int, error) { + return _EntryPoint.Contract.BalanceOf(&_EntryPoint.CallOpts, account) +} + +// Deposits is a free data retrieval call binding the contract method 0xfc7e286d. +// +// Solidity: function deposits(address ) view returns(uint112 deposit, bool staked, uint112 stake, uint32 unstakeDelaySec, uint48 withdrawTime) +func (_EntryPoint *EntryPointCaller) Deposits(opts *bind.CallOpts, arg0 common.Address) (struct { + Deposit *big.Int + Staked bool + Stake *big.Int + UnstakeDelaySec uint32 + WithdrawTime *big.Int +}, error) { + var out []interface{} + err := _EntryPoint.contract.Call(opts, &out, "deposits", arg0) + + outstruct := new(struct { + Deposit *big.Int + Staked bool + Stake *big.Int + UnstakeDelaySec uint32 + WithdrawTime *big.Int + }) + if err != nil { + return *outstruct, err + } + + outstruct.Deposit = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + outstruct.Staked = *abi.ConvertType(out[1], new(bool)).(*bool) + outstruct.Stake = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) + outstruct.UnstakeDelaySec = *abi.ConvertType(out[3], new(uint32)).(*uint32) + outstruct.WithdrawTime = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) + + return *outstruct, err + +} + +// Deposits is a free data retrieval call binding the contract method 0xfc7e286d. +// +// Solidity: function deposits(address ) view returns(uint112 deposit, bool staked, uint112 stake, uint32 unstakeDelaySec, uint48 withdrawTime) +func (_EntryPoint *EntryPointSession) Deposits(arg0 common.Address) (struct { + Deposit *big.Int + Staked bool + Stake *big.Int + UnstakeDelaySec uint32 + WithdrawTime *big.Int +}, error) { + return _EntryPoint.Contract.Deposits(&_EntryPoint.CallOpts, arg0) +} + +// Deposits is a free data retrieval call binding the contract method 0xfc7e286d. +// +// Solidity: function deposits(address ) view returns(uint112 deposit, bool staked, uint112 stake, uint32 unstakeDelaySec, uint48 withdrawTime) +func (_EntryPoint *EntryPointCallerSession) Deposits(arg0 common.Address) (struct { + Deposit *big.Int + Staked bool + Stake *big.Int + UnstakeDelaySec uint32 + WithdrawTime *big.Int +}, error) { + return _EntryPoint.Contract.Deposits(&_EntryPoint.CallOpts, arg0) +} + +// GetDepositInfo is a free data retrieval call binding the contract method 0x5287ce12. +// +// Solidity: function getDepositInfo(address account) view returns((uint112,bool,uint112,uint32,uint48) info) +func (_EntryPoint *EntryPointCaller) GetDepositInfo(opts *bind.CallOpts, account common.Address) (IStakeManagerDepositInfo, error) { + var out []interface{} + err := _EntryPoint.contract.Call(opts, &out, "getDepositInfo", account) + + if err != nil { + return *new(IStakeManagerDepositInfo), err + } + + out0 := *abi.ConvertType(out[0], new(IStakeManagerDepositInfo)).(*IStakeManagerDepositInfo) + + return out0, err + +} + +// GetDepositInfo is a free data retrieval call binding the contract method 0x5287ce12. +// +// Solidity: function getDepositInfo(address account) view returns((uint112,bool,uint112,uint32,uint48) info) +func (_EntryPoint *EntryPointSession) GetDepositInfo(account common.Address) (IStakeManagerDepositInfo, error) { + return _EntryPoint.Contract.GetDepositInfo(&_EntryPoint.CallOpts, account) +} + +// GetDepositInfo is a free data retrieval call binding the contract method 0x5287ce12. +// +// Solidity: function getDepositInfo(address account) view returns((uint112,bool,uint112,uint32,uint48) info) +func (_EntryPoint *EntryPointCallerSession) GetDepositInfo(account common.Address) (IStakeManagerDepositInfo, error) { + return _EntryPoint.Contract.GetDepositInfo(&_EntryPoint.CallOpts, account) +} + +// GetNonce is a free data retrieval call binding the contract method 0x35567e1a. +// +// Solidity: function getNonce(address sender, uint192 key) view returns(uint256 nonce) +func (_EntryPoint *EntryPointCaller) GetNonce(opts *bind.CallOpts, sender common.Address, key *big.Int) (*big.Int, error) { + var out []interface{} + err := _EntryPoint.contract.Call(opts, &out, "getNonce", sender, key) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetNonce is a free data retrieval call binding the contract method 0x35567e1a. +// +// Solidity: function getNonce(address sender, uint192 key) view returns(uint256 nonce) +func (_EntryPoint *EntryPointSession) GetNonce(sender common.Address, key *big.Int) (*big.Int, error) { + return _EntryPoint.Contract.GetNonce(&_EntryPoint.CallOpts, sender, key) +} + +// GetNonce is a free data retrieval call binding the contract method 0x35567e1a. +// +// Solidity: function getNonce(address sender, uint192 key) view returns(uint256 nonce) +func (_EntryPoint *EntryPointCallerSession) GetNonce(sender common.Address, key *big.Int) (*big.Int, error) { + return _EntryPoint.Contract.GetNonce(&_EntryPoint.CallOpts, sender, key) +} + +// GetUserOpHash is a free data retrieval call binding the contract method 0xa6193531. +// +// Solidity: function getUserOpHash((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes) userOp) view returns(bytes32) +func (_EntryPoint *EntryPointCaller) GetUserOpHash(opts *bind.CallOpts, userOp UserOperation) ([32]byte, error) { + var out []interface{} + err := _EntryPoint.contract.Call(opts, &out, "getUserOpHash", userOp) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// GetUserOpHash is a free data retrieval call binding the contract method 0xa6193531. +// +// Solidity: function getUserOpHash((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes) userOp) view returns(bytes32) +func (_EntryPoint *EntryPointSession) GetUserOpHash(userOp UserOperation) ([32]byte, error) { + return _EntryPoint.Contract.GetUserOpHash(&_EntryPoint.CallOpts, userOp) +} + +// GetUserOpHash is a free data retrieval call binding the contract method 0xa6193531. +// +// Solidity: function getUserOpHash((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes) userOp) view returns(bytes32) +func (_EntryPoint *EntryPointCallerSession) GetUserOpHash(userOp UserOperation) ([32]byte, error) { + return _EntryPoint.Contract.GetUserOpHash(&_EntryPoint.CallOpts, userOp) +} + +// NonceSequenceNumber is a free data retrieval call binding the contract method 0x1b2e01b8. +// +// Solidity: function nonceSequenceNumber(address , uint192 ) view returns(uint256) +func (_EntryPoint *EntryPointCaller) NonceSequenceNumber(opts *bind.CallOpts, arg0 common.Address, arg1 *big.Int) (*big.Int, error) { + var out []interface{} + err := _EntryPoint.contract.Call(opts, &out, "nonceSequenceNumber", arg0, arg1) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// NonceSequenceNumber is a free data retrieval call binding the contract method 0x1b2e01b8. +// +// Solidity: function nonceSequenceNumber(address , uint192 ) view returns(uint256) +func (_EntryPoint *EntryPointSession) NonceSequenceNumber(arg0 common.Address, arg1 *big.Int) (*big.Int, error) { + return _EntryPoint.Contract.NonceSequenceNumber(&_EntryPoint.CallOpts, arg0, arg1) +} + +// NonceSequenceNumber is a free data retrieval call binding the contract method 0x1b2e01b8. +// +// Solidity: function nonceSequenceNumber(address , uint192 ) view returns(uint256) +func (_EntryPoint *EntryPointCallerSession) NonceSequenceNumber(arg0 common.Address, arg1 *big.Int) (*big.Int, error) { + return _EntryPoint.Contract.NonceSequenceNumber(&_EntryPoint.CallOpts, arg0, arg1) +} + +// AddStake is a paid mutator transaction binding the contract method 0x0396cb60. +// +// Solidity: function addStake(uint32 unstakeDelaySec) payable returns() +func (_EntryPoint *EntryPointTransactor) AddStake(opts *bind.TransactOpts, unstakeDelaySec uint32) (*types.Transaction, error) { + return _EntryPoint.contract.Transact(opts, "addStake", unstakeDelaySec) +} + +// AddStake is a paid mutator transaction binding the contract method 0x0396cb60. +// +// Solidity: function addStake(uint32 unstakeDelaySec) payable returns() +func (_EntryPoint *EntryPointSession) AddStake(unstakeDelaySec uint32) (*types.Transaction, error) { + return _EntryPoint.Contract.AddStake(&_EntryPoint.TransactOpts, unstakeDelaySec) +} + +// AddStake is a paid mutator transaction binding the contract method 0x0396cb60. +// +// Solidity: function addStake(uint32 unstakeDelaySec) payable returns() +func (_EntryPoint *EntryPointTransactorSession) AddStake(unstakeDelaySec uint32) (*types.Transaction, error) { + return _EntryPoint.Contract.AddStake(&_EntryPoint.TransactOpts, unstakeDelaySec) +} + +// DepositTo is a paid mutator transaction binding the contract method 0xb760faf9. +// +// Solidity: function depositTo(address account) payable returns() +func (_EntryPoint *EntryPointTransactor) DepositTo(opts *bind.TransactOpts, account common.Address) (*types.Transaction, error) { + return _EntryPoint.contract.Transact(opts, "depositTo", account) +} + +// DepositTo is a paid mutator transaction binding the contract method 0xb760faf9. +// +// Solidity: function depositTo(address account) payable returns() +func (_EntryPoint *EntryPointSession) DepositTo(account common.Address) (*types.Transaction, error) { + return _EntryPoint.Contract.DepositTo(&_EntryPoint.TransactOpts, account) +} + +// DepositTo is a paid mutator transaction binding the contract method 0xb760faf9. +// +// Solidity: function depositTo(address account) payable returns() +func (_EntryPoint *EntryPointTransactorSession) DepositTo(account common.Address) (*types.Transaction, error) { + return _EntryPoint.Contract.DepositTo(&_EntryPoint.TransactOpts, account) +} + +// GetSenderAddress is a paid mutator transaction binding the contract method 0x9b249f69. +// +// Solidity: function getSenderAddress(bytes initCode) returns() +func (_EntryPoint *EntryPointTransactor) GetSenderAddress(opts *bind.TransactOpts, initCode []byte) (*types.Transaction, error) { + return _EntryPoint.contract.Transact(opts, "getSenderAddress", initCode) +} + +// GetSenderAddress is a paid mutator transaction binding the contract method 0x9b249f69. +// +// Solidity: function getSenderAddress(bytes initCode) returns() +func (_EntryPoint *EntryPointSession) GetSenderAddress(initCode []byte) (*types.Transaction, error) { + return _EntryPoint.Contract.GetSenderAddress(&_EntryPoint.TransactOpts, initCode) +} + +// GetSenderAddress is a paid mutator transaction binding the contract method 0x9b249f69. +// +// Solidity: function getSenderAddress(bytes initCode) returns() +func (_EntryPoint *EntryPointTransactorSession) GetSenderAddress(initCode []byte) (*types.Transaction, error) { + return _EntryPoint.Contract.GetSenderAddress(&_EntryPoint.TransactOpts, initCode) +} + +// HandleAggregatedOps is a paid mutator transaction binding the contract method 0x4b1d7cf5. +// +// Solidity: function handleAggregatedOps(((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],address,bytes)[] opsPerAggregator, address beneficiary) returns() +func (_EntryPoint *EntryPointTransactor) HandleAggregatedOps(opts *bind.TransactOpts, opsPerAggregator []IEntryPointUserOpsPerAggregator, beneficiary common.Address) (*types.Transaction, error) { + return _EntryPoint.contract.Transact(opts, "handleAggregatedOps", opsPerAggregator, beneficiary) +} + +// HandleAggregatedOps is a paid mutator transaction binding the contract method 0x4b1d7cf5. +// +// Solidity: function handleAggregatedOps(((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],address,bytes)[] opsPerAggregator, address beneficiary) returns() +func (_EntryPoint *EntryPointSession) HandleAggregatedOps(opsPerAggregator []IEntryPointUserOpsPerAggregator, beneficiary common.Address) (*types.Transaction, error) { + return _EntryPoint.Contract.HandleAggregatedOps(&_EntryPoint.TransactOpts, opsPerAggregator, beneficiary) +} + +// HandleAggregatedOps is a paid mutator transaction binding the contract method 0x4b1d7cf5. +// +// Solidity: function handleAggregatedOps(((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],address,bytes)[] opsPerAggregator, address beneficiary) returns() +func (_EntryPoint *EntryPointTransactorSession) HandleAggregatedOps(opsPerAggregator []IEntryPointUserOpsPerAggregator, beneficiary common.Address) (*types.Transaction, error) { + return _EntryPoint.Contract.HandleAggregatedOps(&_EntryPoint.TransactOpts, opsPerAggregator, beneficiary) +} + +// HandleOps is a paid mutator transaction binding the contract method 0x1fad948c. +// +// Solidity: function handleOps((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[] ops, address beneficiary) returns() +func (_EntryPoint *EntryPointTransactor) HandleOps(opts *bind.TransactOpts, ops []UserOperation, beneficiary common.Address) (*types.Transaction, error) { + return _EntryPoint.contract.Transact(opts, "handleOps", ops, beneficiary) +} + +// HandleOps is a paid mutator transaction binding the contract method 0x1fad948c. +// +// Solidity: function handleOps((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[] ops, address beneficiary) returns() +func (_EntryPoint *EntryPointSession) HandleOps(ops []UserOperation, beneficiary common.Address) (*types.Transaction, error) { + return _EntryPoint.Contract.HandleOps(&_EntryPoint.TransactOpts, ops, beneficiary) +} + +// HandleOps is a paid mutator transaction binding the contract method 0x1fad948c. +// +// Solidity: function handleOps((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[] ops, address beneficiary) returns() +func (_EntryPoint *EntryPointTransactorSession) HandleOps(ops []UserOperation, beneficiary common.Address) (*types.Transaction, error) { + return _EntryPoint.Contract.HandleOps(&_EntryPoint.TransactOpts, ops, beneficiary) +} + +// IncrementNonce is a paid mutator transaction binding the contract method 0x0bd28e3b. +// +// Solidity: function incrementNonce(uint192 key) returns() +func (_EntryPoint *EntryPointTransactor) IncrementNonce(opts *bind.TransactOpts, key *big.Int) (*types.Transaction, error) { + return _EntryPoint.contract.Transact(opts, "incrementNonce", key) +} + +// IncrementNonce is a paid mutator transaction binding the contract method 0x0bd28e3b. +// +// Solidity: function incrementNonce(uint192 key) returns() +func (_EntryPoint *EntryPointSession) IncrementNonce(key *big.Int) (*types.Transaction, error) { + return _EntryPoint.Contract.IncrementNonce(&_EntryPoint.TransactOpts, key) +} + +// IncrementNonce is a paid mutator transaction binding the contract method 0x0bd28e3b. +// +// Solidity: function incrementNonce(uint192 key) returns() +func (_EntryPoint *EntryPointTransactorSession) IncrementNonce(key *big.Int) (*types.Transaction, error) { + return _EntryPoint.Contract.IncrementNonce(&_EntryPoint.TransactOpts, key) +} + +// InnerHandleOp is a paid mutator transaction binding the contract method 0x1d732756. +// +// Solidity: function innerHandleOp(bytes callData, ((address,uint256,uint256,uint256,uint256,address,uint256,uint256),bytes32,uint256,uint256,uint256) opInfo, bytes context) returns(uint256 actualGasCost) +func (_EntryPoint *EntryPointTransactor) InnerHandleOp(opts *bind.TransactOpts, callData []byte, opInfo EntryPointUserOpInfo, context []byte) (*types.Transaction, error) { + return _EntryPoint.contract.Transact(opts, "innerHandleOp", callData, opInfo, context) +} + +// InnerHandleOp is a paid mutator transaction binding the contract method 0x1d732756. +// +// Solidity: function innerHandleOp(bytes callData, ((address,uint256,uint256,uint256,uint256,address,uint256,uint256),bytes32,uint256,uint256,uint256) opInfo, bytes context) returns(uint256 actualGasCost) +func (_EntryPoint *EntryPointSession) InnerHandleOp(callData []byte, opInfo EntryPointUserOpInfo, context []byte) (*types.Transaction, error) { + return _EntryPoint.Contract.InnerHandleOp(&_EntryPoint.TransactOpts, callData, opInfo, context) +} + +// InnerHandleOp is a paid mutator transaction binding the contract method 0x1d732756. +// +// Solidity: function innerHandleOp(bytes callData, ((address,uint256,uint256,uint256,uint256,address,uint256,uint256),bytes32,uint256,uint256,uint256) opInfo, bytes context) returns(uint256 actualGasCost) +func (_EntryPoint *EntryPointTransactorSession) InnerHandleOp(callData []byte, opInfo EntryPointUserOpInfo, context []byte) (*types.Transaction, error) { + return _EntryPoint.Contract.InnerHandleOp(&_EntryPoint.TransactOpts, callData, opInfo, context) +} + +// SimulateHandleOp is a paid mutator transaction binding the contract method 0xd6383f94. +// +// Solidity: function simulateHandleOp((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes) op, address target, bytes targetCallData) returns() +func (_EntryPoint *EntryPointTransactor) SimulateHandleOp(opts *bind.TransactOpts, op UserOperation, target common.Address, targetCallData []byte) (*types.Transaction, error) { + return _EntryPoint.contract.Transact(opts, "simulateHandleOp", op, target, targetCallData) +} + +// SimulateHandleOp is a paid mutator transaction binding the contract method 0xd6383f94. +// +// Solidity: function simulateHandleOp((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes) op, address target, bytes targetCallData) returns() +func (_EntryPoint *EntryPointSession) SimulateHandleOp(op UserOperation, target common.Address, targetCallData []byte) (*types.Transaction, error) { + return _EntryPoint.Contract.SimulateHandleOp(&_EntryPoint.TransactOpts, op, target, targetCallData) +} + +// SimulateHandleOp is a paid mutator transaction binding the contract method 0xd6383f94. +// +// Solidity: function simulateHandleOp((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes) op, address target, bytes targetCallData) returns() +func (_EntryPoint *EntryPointTransactorSession) SimulateHandleOp(op UserOperation, target common.Address, targetCallData []byte) (*types.Transaction, error) { + return _EntryPoint.Contract.SimulateHandleOp(&_EntryPoint.TransactOpts, op, target, targetCallData) +} + +// SimulateValidation is a paid mutator transaction binding the contract method 0xee219423. +// +// Solidity: function simulateValidation((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes) userOp) returns() +func (_EntryPoint *EntryPointTransactor) SimulateValidation(opts *bind.TransactOpts, userOp UserOperation) (*types.Transaction, error) { + return _EntryPoint.contract.Transact(opts, "simulateValidation", userOp) +} + +// SimulateValidation is a paid mutator transaction binding the contract method 0xee219423. +// +// Solidity: function simulateValidation((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes) userOp) returns() +func (_EntryPoint *EntryPointSession) SimulateValidation(userOp UserOperation) (*types.Transaction, error) { + return _EntryPoint.Contract.SimulateValidation(&_EntryPoint.TransactOpts, userOp) +} + +// SimulateValidation is a paid mutator transaction binding the contract method 0xee219423. +// +// Solidity: function simulateValidation((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes) userOp) returns() +func (_EntryPoint *EntryPointTransactorSession) SimulateValidation(userOp UserOperation) (*types.Transaction, error) { + return _EntryPoint.Contract.SimulateValidation(&_EntryPoint.TransactOpts, userOp) +} + +// UnlockStake is a paid mutator transaction binding the contract method 0xbb9fe6bf. +// +// Solidity: function unlockStake() returns() +func (_EntryPoint *EntryPointTransactor) UnlockStake(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EntryPoint.contract.Transact(opts, "unlockStake") +} + +// UnlockStake is a paid mutator transaction binding the contract method 0xbb9fe6bf. +// +// Solidity: function unlockStake() returns() +func (_EntryPoint *EntryPointSession) UnlockStake() (*types.Transaction, error) { + return _EntryPoint.Contract.UnlockStake(&_EntryPoint.TransactOpts) +} + +// UnlockStake is a paid mutator transaction binding the contract method 0xbb9fe6bf. +// +// Solidity: function unlockStake() returns() +func (_EntryPoint *EntryPointTransactorSession) UnlockStake() (*types.Transaction, error) { + return _EntryPoint.Contract.UnlockStake(&_EntryPoint.TransactOpts) +} + +// WithdrawStake is a paid mutator transaction binding the contract method 0xc23a5cea. +// +// Solidity: function withdrawStake(address withdrawAddress) returns() +func (_EntryPoint *EntryPointTransactor) WithdrawStake(opts *bind.TransactOpts, withdrawAddress common.Address) (*types.Transaction, error) { + return _EntryPoint.contract.Transact(opts, "withdrawStake", withdrawAddress) +} + +// WithdrawStake is a paid mutator transaction binding the contract method 0xc23a5cea. +// +// Solidity: function withdrawStake(address withdrawAddress) returns() +func (_EntryPoint *EntryPointSession) WithdrawStake(withdrawAddress common.Address) (*types.Transaction, error) { + return _EntryPoint.Contract.WithdrawStake(&_EntryPoint.TransactOpts, withdrawAddress) +} + +// WithdrawStake is a paid mutator transaction binding the contract method 0xc23a5cea. +// +// Solidity: function withdrawStake(address withdrawAddress) returns() +func (_EntryPoint *EntryPointTransactorSession) WithdrawStake(withdrawAddress common.Address) (*types.Transaction, error) { + return _EntryPoint.Contract.WithdrawStake(&_EntryPoint.TransactOpts, withdrawAddress) +} + +// WithdrawTo is a paid mutator transaction binding the contract method 0x205c2878. +// +// Solidity: function withdrawTo(address withdrawAddress, uint256 withdrawAmount) returns() +func (_EntryPoint *EntryPointTransactor) WithdrawTo(opts *bind.TransactOpts, withdrawAddress common.Address, withdrawAmount *big.Int) (*types.Transaction, error) { + return _EntryPoint.contract.Transact(opts, "withdrawTo", withdrawAddress, withdrawAmount) +} + +// WithdrawTo is a paid mutator transaction binding the contract method 0x205c2878. +// +// Solidity: function withdrawTo(address withdrawAddress, uint256 withdrawAmount) returns() +func (_EntryPoint *EntryPointSession) WithdrawTo(withdrawAddress common.Address, withdrawAmount *big.Int) (*types.Transaction, error) { + return _EntryPoint.Contract.WithdrawTo(&_EntryPoint.TransactOpts, withdrawAddress, withdrawAmount) +} + +// WithdrawTo is a paid mutator transaction binding the contract method 0x205c2878. +// +// Solidity: function withdrawTo(address withdrawAddress, uint256 withdrawAmount) returns() +func (_EntryPoint *EntryPointTransactorSession) WithdrawTo(withdrawAddress common.Address, withdrawAmount *big.Int) (*types.Transaction, error) { + return _EntryPoint.Contract.WithdrawTo(&_EntryPoint.TransactOpts, withdrawAddress, withdrawAmount) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_EntryPoint *EntryPointTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EntryPoint.contract.RawTransact(opts, nil) // calldata is disallowed for receive function +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_EntryPoint *EntryPointSession) Receive() (*types.Transaction, error) { + return _EntryPoint.Contract.Receive(&_EntryPoint.TransactOpts) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_EntryPoint *EntryPointTransactorSession) Receive() (*types.Transaction, error) { + return _EntryPoint.Contract.Receive(&_EntryPoint.TransactOpts) +} + +// EntryPointAccountDeployedIterator is returned from FilterAccountDeployed and is used to iterate over the raw logs and unpacked data for AccountDeployed events raised by the EntryPoint contract. +type EntryPointAccountDeployedIterator struct { + Event *EntryPointAccountDeployed // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *EntryPointAccountDeployedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(EntryPointAccountDeployed) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(EntryPointAccountDeployed) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *EntryPointAccountDeployedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *EntryPointAccountDeployedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// EntryPointAccountDeployed represents a AccountDeployed event raised by the EntryPoint contract. +type EntryPointAccountDeployed struct { + UserOpHash [32]byte + Sender common.Address + Factory common.Address + Paymaster common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterAccountDeployed is a free log retrieval operation binding the contract event 0xd51a9c61267aa6196961883ecf5ff2da6619c37dac0fa92122513fb32c032d2d. +// +// Solidity: event AccountDeployed(bytes32 indexed userOpHash, address indexed sender, address factory, address paymaster) +func (_EntryPoint *EntryPointFilterer) FilterAccountDeployed(opts *bind.FilterOpts, userOpHash [][32]byte, sender []common.Address) (*EntryPointAccountDeployedIterator, error) { + + var userOpHashRule []interface{} + for _, userOpHashItem := range userOpHash { + userOpHashRule = append(userOpHashRule, userOpHashItem) + } + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _EntryPoint.contract.FilterLogs(opts, "AccountDeployed", userOpHashRule, senderRule) + if err != nil { + return nil, err + } + return &EntryPointAccountDeployedIterator{contract: _EntryPoint.contract, event: "AccountDeployed", logs: logs, sub: sub}, nil +} + +// WatchAccountDeployed is a free log subscription operation binding the contract event 0xd51a9c61267aa6196961883ecf5ff2da6619c37dac0fa92122513fb32c032d2d. +// +// Solidity: event AccountDeployed(bytes32 indexed userOpHash, address indexed sender, address factory, address paymaster) +func (_EntryPoint *EntryPointFilterer) WatchAccountDeployed(opts *bind.WatchOpts, sink chan<- *EntryPointAccountDeployed, userOpHash [][32]byte, sender []common.Address) (event.Subscription, error) { + + var userOpHashRule []interface{} + for _, userOpHashItem := range userOpHash { + userOpHashRule = append(userOpHashRule, userOpHashItem) + } + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _EntryPoint.contract.WatchLogs(opts, "AccountDeployed", userOpHashRule, senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(EntryPointAccountDeployed) + if err := _EntryPoint.contract.UnpackLog(event, "AccountDeployed", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseAccountDeployed is a log parse operation binding the contract event 0xd51a9c61267aa6196961883ecf5ff2da6619c37dac0fa92122513fb32c032d2d. +// +// Solidity: event AccountDeployed(bytes32 indexed userOpHash, address indexed sender, address factory, address paymaster) +func (_EntryPoint *EntryPointFilterer) ParseAccountDeployed(log types.Log) (*EntryPointAccountDeployed, error) { + event := new(EntryPointAccountDeployed) + if err := _EntryPoint.contract.UnpackLog(event, "AccountDeployed", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// EntryPointBeforeExecutionIterator is returned from FilterBeforeExecution and is used to iterate over the raw logs and unpacked data for BeforeExecution events raised by the EntryPoint contract. +type EntryPointBeforeExecutionIterator struct { + Event *EntryPointBeforeExecution // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *EntryPointBeforeExecutionIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(EntryPointBeforeExecution) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(EntryPointBeforeExecution) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *EntryPointBeforeExecutionIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *EntryPointBeforeExecutionIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// EntryPointBeforeExecution represents a BeforeExecution event raised by the EntryPoint contract. +type EntryPointBeforeExecution struct { + Raw types.Log // Blockchain specific contextual infos +} + +// FilterBeforeExecution is a free log retrieval operation binding the contract event 0xbb47ee3e183a558b1a2ff0874b079f3fc5478b7454eacf2bfc5af2ff5878f972. +// +// Solidity: event BeforeExecution() +func (_EntryPoint *EntryPointFilterer) FilterBeforeExecution(opts *bind.FilterOpts) (*EntryPointBeforeExecutionIterator, error) { + + logs, sub, err := _EntryPoint.contract.FilterLogs(opts, "BeforeExecution") + if err != nil { + return nil, err + } + return &EntryPointBeforeExecutionIterator{contract: _EntryPoint.contract, event: "BeforeExecution", logs: logs, sub: sub}, nil +} + +// WatchBeforeExecution is a free log subscription operation binding the contract event 0xbb47ee3e183a558b1a2ff0874b079f3fc5478b7454eacf2bfc5af2ff5878f972. +// +// Solidity: event BeforeExecution() +func (_EntryPoint *EntryPointFilterer) WatchBeforeExecution(opts *bind.WatchOpts, sink chan<- *EntryPointBeforeExecution) (event.Subscription, error) { + + logs, sub, err := _EntryPoint.contract.WatchLogs(opts, "BeforeExecution") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(EntryPointBeforeExecution) + if err := _EntryPoint.contract.UnpackLog(event, "BeforeExecution", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseBeforeExecution is a log parse operation binding the contract event 0xbb47ee3e183a558b1a2ff0874b079f3fc5478b7454eacf2bfc5af2ff5878f972. +// +// Solidity: event BeforeExecution() +func (_EntryPoint *EntryPointFilterer) ParseBeforeExecution(log types.Log) (*EntryPointBeforeExecution, error) { + event := new(EntryPointBeforeExecution) + if err := _EntryPoint.contract.UnpackLog(event, "BeforeExecution", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// EntryPointDepositedIterator is returned from FilterDeposited and is used to iterate over the raw logs and unpacked data for Deposited events raised by the EntryPoint contract. +type EntryPointDepositedIterator struct { + Event *EntryPointDeposited // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *EntryPointDepositedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(EntryPointDeposited) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(EntryPointDeposited) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *EntryPointDepositedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *EntryPointDepositedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// EntryPointDeposited represents a Deposited event raised by the EntryPoint contract. +type EntryPointDeposited struct { + Account common.Address + TotalDeposit *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterDeposited is a free log retrieval operation binding the contract event 0x2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4. +// +// Solidity: event Deposited(address indexed account, uint256 totalDeposit) +func (_EntryPoint *EntryPointFilterer) FilterDeposited(opts *bind.FilterOpts, account []common.Address) (*EntryPointDepositedIterator, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _EntryPoint.contract.FilterLogs(opts, "Deposited", accountRule) + if err != nil { + return nil, err + } + return &EntryPointDepositedIterator{contract: _EntryPoint.contract, event: "Deposited", logs: logs, sub: sub}, nil +} + +// WatchDeposited is a free log subscription operation binding the contract event 0x2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4. +// +// Solidity: event Deposited(address indexed account, uint256 totalDeposit) +func (_EntryPoint *EntryPointFilterer) WatchDeposited(opts *bind.WatchOpts, sink chan<- *EntryPointDeposited, account []common.Address) (event.Subscription, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _EntryPoint.contract.WatchLogs(opts, "Deposited", accountRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(EntryPointDeposited) + if err := _EntryPoint.contract.UnpackLog(event, "Deposited", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseDeposited is a log parse operation binding the contract event 0x2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4. +// +// Solidity: event Deposited(address indexed account, uint256 totalDeposit) +func (_EntryPoint *EntryPointFilterer) ParseDeposited(log types.Log) (*EntryPointDeposited, error) { + event := new(EntryPointDeposited) + if err := _EntryPoint.contract.UnpackLog(event, "Deposited", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// EntryPointSignatureAggregatorChangedIterator is returned from FilterSignatureAggregatorChanged and is used to iterate over the raw logs and unpacked data for SignatureAggregatorChanged events raised by the EntryPoint contract. +type EntryPointSignatureAggregatorChangedIterator struct { + Event *EntryPointSignatureAggregatorChanged // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *EntryPointSignatureAggregatorChangedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(EntryPointSignatureAggregatorChanged) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(EntryPointSignatureAggregatorChanged) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *EntryPointSignatureAggregatorChangedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *EntryPointSignatureAggregatorChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// EntryPointSignatureAggregatorChanged represents a SignatureAggregatorChanged event raised by the EntryPoint contract. +type EntryPointSignatureAggregatorChanged struct { + Aggregator common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSignatureAggregatorChanged is a free log retrieval operation binding the contract event 0x575ff3acadd5ab348fe1855e217e0f3678f8d767d7494c9f9fefbee2e17cca4d. +// +// Solidity: event SignatureAggregatorChanged(address indexed aggregator) +func (_EntryPoint *EntryPointFilterer) FilterSignatureAggregatorChanged(opts *bind.FilterOpts, aggregator []common.Address) (*EntryPointSignatureAggregatorChangedIterator, error) { + + var aggregatorRule []interface{} + for _, aggregatorItem := range aggregator { + aggregatorRule = append(aggregatorRule, aggregatorItem) + } + + logs, sub, err := _EntryPoint.contract.FilterLogs(opts, "SignatureAggregatorChanged", aggregatorRule) + if err != nil { + return nil, err + } + return &EntryPointSignatureAggregatorChangedIterator{contract: _EntryPoint.contract, event: "SignatureAggregatorChanged", logs: logs, sub: sub}, nil +} + +// WatchSignatureAggregatorChanged is a free log subscription operation binding the contract event 0x575ff3acadd5ab348fe1855e217e0f3678f8d767d7494c9f9fefbee2e17cca4d. +// +// Solidity: event SignatureAggregatorChanged(address indexed aggregator) +func (_EntryPoint *EntryPointFilterer) WatchSignatureAggregatorChanged(opts *bind.WatchOpts, sink chan<- *EntryPointSignatureAggregatorChanged, aggregator []common.Address) (event.Subscription, error) { + + var aggregatorRule []interface{} + for _, aggregatorItem := range aggregator { + aggregatorRule = append(aggregatorRule, aggregatorItem) + } + + logs, sub, err := _EntryPoint.contract.WatchLogs(opts, "SignatureAggregatorChanged", aggregatorRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(EntryPointSignatureAggregatorChanged) + if err := _EntryPoint.contract.UnpackLog(event, "SignatureAggregatorChanged", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseSignatureAggregatorChanged is a log parse operation binding the contract event 0x575ff3acadd5ab348fe1855e217e0f3678f8d767d7494c9f9fefbee2e17cca4d. +// +// Solidity: event SignatureAggregatorChanged(address indexed aggregator) +func (_EntryPoint *EntryPointFilterer) ParseSignatureAggregatorChanged(log types.Log) (*EntryPointSignatureAggregatorChanged, error) { + event := new(EntryPointSignatureAggregatorChanged) + if err := _EntryPoint.contract.UnpackLog(event, "SignatureAggregatorChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// EntryPointStakeLockedIterator is returned from FilterStakeLocked and is used to iterate over the raw logs and unpacked data for StakeLocked events raised by the EntryPoint contract. +type EntryPointStakeLockedIterator struct { + Event *EntryPointStakeLocked // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *EntryPointStakeLockedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(EntryPointStakeLocked) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(EntryPointStakeLocked) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *EntryPointStakeLockedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *EntryPointStakeLockedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// EntryPointStakeLocked represents a StakeLocked event raised by the EntryPoint contract. +type EntryPointStakeLocked struct { + Account common.Address + TotalStaked *big.Int + UnstakeDelaySec *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterStakeLocked is a free log retrieval operation binding the contract event 0xa5ae833d0bb1dcd632d98a8b70973e8516812898e19bf27b70071ebc8dc52c01. +// +// Solidity: event StakeLocked(address indexed account, uint256 totalStaked, uint256 unstakeDelaySec) +func (_EntryPoint *EntryPointFilterer) FilterStakeLocked(opts *bind.FilterOpts, account []common.Address) (*EntryPointStakeLockedIterator, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _EntryPoint.contract.FilterLogs(opts, "StakeLocked", accountRule) + if err != nil { + return nil, err + } + return &EntryPointStakeLockedIterator{contract: _EntryPoint.contract, event: "StakeLocked", logs: logs, sub: sub}, nil +} + +// WatchStakeLocked is a free log subscription operation binding the contract event 0xa5ae833d0bb1dcd632d98a8b70973e8516812898e19bf27b70071ebc8dc52c01. +// +// Solidity: event StakeLocked(address indexed account, uint256 totalStaked, uint256 unstakeDelaySec) +func (_EntryPoint *EntryPointFilterer) WatchStakeLocked(opts *bind.WatchOpts, sink chan<- *EntryPointStakeLocked, account []common.Address) (event.Subscription, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _EntryPoint.contract.WatchLogs(opts, "StakeLocked", accountRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(EntryPointStakeLocked) + if err := _EntryPoint.contract.UnpackLog(event, "StakeLocked", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseStakeLocked is a log parse operation binding the contract event 0xa5ae833d0bb1dcd632d98a8b70973e8516812898e19bf27b70071ebc8dc52c01. +// +// Solidity: event StakeLocked(address indexed account, uint256 totalStaked, uint256 unstakeDelaySec) +func (_EntryPoint *EntryPointFilterer) ParseStakeLocked(log types.Log) (*EntryPointStakeLocked, error) { + event := new(EntryPointStakeLocked) + if err := _EntryPoint.contract.UnpackLog(event, "StakeLocked", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// EntryPointStakeUnlockedIterator is returned from FilterStakeUnlocked and is used to iterate over the raw logs and unpacked data for StakeUnlocked events raised by the EntryPoint contract. +type EntryPointStakeUnlockedIterator struct { + Event *EntryPointStakeUnlocked // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *EntryPointStakeUnlockedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(EntryPointStakeUnlocked) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(EntryPointStakeUnlocked) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *EntryPointStakeUnlockedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *EntryPointStakeUnlockedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// EntryPointStakeUnlocked represents a StakeUnlocked event raised by the EntryPoint contract. +type EntryPointStakeUnlocked struct { + Account common.Address + WithdrawTime *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterStakeUnlocked is a free log retrieval operation binding the contract event 0xfa9b3c14cc825c412c9ed81b3ba365a5b459439403f18829e572ed53a4180f0a. +// +// Solidity: event StakeUnlocked(address indexed account, uint256 withdrawTime) +func (_EntryPoint *EntryPointFilterer) FilterStakeUnlocked(opts *bind.FilterOpts, account []common.Address) (*EntryPointStakeUnlockedIterator, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _EntryPoint.contract.FilterLogs(opts, "StakeUnlocked", accountRule) + if err != nil { + return nil, err + } + return &EntryPointStakeUnlockedIterator{contract: _EntryPoint.contract, event: "StakeUnlocked", logs: logs, sub: sub}, nil +} + +// WatchStakeUnlocked is a free log subscription operation binding the contract event 0xfa9b3c14cc825c412c9ed81b3ba365a5b459439403f18829e572ed53a4180f0a. +// +// Solidity: event StakeUnlocked(address indexed account, uint256 withdrawTime) +func (_EntryPoint *EntryPointFilterer) WatchStakeUnlocked(opts *bind.WatchOpts, sink chan<- *EntryPointStakeUnlocked, account []common.Address) (event.Subscription, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _EntryPoint.contract.WatchLogs(opts, "StakeUnlocked", accountRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(EntryPointStakeUnlocked) + if err := _EntryPoint.contract.UnpackLog(event, "StakeUnlocked", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseStakeUnlocked is a log parse operation binding the contract event 0xfa9b3c14cc825c412c9ed81b3ba365a5b459439403f18829e572ed53a4180f0a. +// +// Solidity: event StakeUnlocked(address indexed account, uint256 withdrawTime) +func (_EntryPoint *EntryPointFilterer) ParseStakeUnlocked(log types.Log) (*EntryPointStakeUnlocked, error) { + event := new(EntryPointStakeUnlocked) + if err := _EntryPoint.contract.UnpackLog(event, "StakeUnlocked", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// EntryPointStakeWithdrawnIterator is returned from FilterStakeWithdrawn and is used to iterate over the raw logs and unpacked data for StakeWithdrawn events raised by the EntryPoint contract. +type EntryPointStakeWithdrawnIterator struct { + Event *EntryPointStakeWithdrawn // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *EntryPointStakeWithdrawnIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(EntryPointStakeWithdrawn) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(EntryPointStakeWithdrawn) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *EntryPointStakeWithdrawnIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *EntryPointStakeWithdrawnIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// EntryPointStakeWithdrawn represents a StakeWithdrawn event raised by the EntryPoint contract. +type EntryPointStakeWithdrawn struct { + Account common.Address + WithdrawAddress common.Address + Amount *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterStakeWithdrawn is a free log retrieval operation binding the contract event 0xb7c918e0e249f999e965cafeb6c664271b3f4317d296461500e71da39f0cbda3. +// +// Solidity: event StakeWithdrawn(address indexed account, address withdrawAddress, uint256 amount) +func (_EntryPoint *EntryPointFilterer) FilterStakeWithdrawn(opts *bind.FilterOpts, account []common.Address) (*EntryPointStakeWithdrawnIterator, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _EntryPoint.contract.FilterLogs(opts, "StakeWithdrawn", accountRule) + if err != nil { + return nil, err + } + return &EntryPointStakeWithdrawnIterator{contract: _EntryPoint.contract, event: "StakeWithdrawn", logs: logs, sub: sub}, nil +} + +// WatchStakeWithdrawn is a free log subscription operation binding the contract event 0xb7c918e0e249f999e965cafeb6c664271b3f4317d296461500e71da39f0cbda3. +// +// Solidity: event StakeWithdrawn(address indexed account, address withdrawAddress, uint256 amount) +func (_EntryPoint *EntryPointFilterer) WatchStakeWithdrawn(opts *bind.WatchOpts, sink chan<- *EntryPointStakeWithdrawn, account []common.Address) (event.Subscription, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _EntryPoint.contract.WatchLogs(opts, "StakeWithdrawn", accountRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(EntryPointStakeWithdrawn) + if err := _EntryPoint.contract.UnpackLog(event, "StakeWithdrawn", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseStakeWithdrawn is a log parse operation binding the contract event 0xb7c918e0e249f999e965cafeb6c664271b3f4317d296461500e71da39f0cbda3. +// +// Solidity: event StakeWithdrawn(address indexed account, address withdrawAddress, uint256 amount) +func (_EntryPoint *EntryPointFilterer) ParseStakeWithdrawn(log types.Log) (*EntryPointStakeWithdrawn, error) { + event := new(EntryPointStakeWithdrawn) + if err := _EntryPoint.contract.UnpackLog(event, "StakeWithdrawn", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// EntryPointUserOperationEventIterator is returned from FilterUserOperationEvent and is used to iterate over the raw logs and unpacked data for UserOperationEvent events raised by the EntryPoint contract. +type EntryPointUserOperationEventIterator struct { + Event *EntryPointUserOperationEvent // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *EntryPointUserOperationEventIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(EntryPointUserOperationEvent) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(EntryPointUserOperationEvent) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *EntryPointUserOperationEventIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *EntryPointUserOperationEventIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// EntryPointUserOperationEvent represents a UserOperationEvent event raised by the EntryPoint contract. +type EntryPointUserOperationEvent struct { + UserOpHash [32]byte + Sender common.Address + Paymaster common.Address + Nonce *big.Int + Success bool + ActualGasCost *big.Int + ActualGasUsed *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterUserOperationEvent is a free log retrieval operation binding the contract event 0x49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f. +// +// Solidity: event UserOperationEvent(bytes32 indexed userOpHash, address indexed sender, address indexed paymaster, uint256 nonce, bool success, uint256 actualGasCost, uint256 actualGasUsed) +func (_EntryPoint *EntryPointFilterer) FilterUserOperationEvent(opts *bind.FilterOpts, userOpHash [][32]byte, sender []common.Address, paymaster []common.Address) (*EntryPointUserOperationEventIterator, error) { + + var userOpHashRule []interface{} + for _, userOpHashItem := range userOpHash { + userOpHashRule = append(userOpHashRule, userOpHashItem) + } + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var paymasterRule []interface{} + for _, paymasterItem := range paymaster { + paymasterRule = append(paymasterRule, paymasterItem) + } + + logs, sub, err := _EntryPoint.contract.FilterLogs(opts, "UserOperationEvent", userOpHashRule, senderRule, paymasterRule) + if err != nil { + return nil, err + } + return &EntryPointUserOperationEventIterator{contract: _EntryPoint.contract, event: "UserOperationEvent", logs: logs, sub: sub}, nil +} + +// WatchUserOperationEvent is a free log subscription operation binding the contract event 0x49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f. +// +// Solidity: event UserOperationEvent(bytes32 indexed userOpHash, address indexed sender, address indexed paymaster, uint256 nonce, bool success, uint256 actualGasCost, uint256 actualGasUsed) +func (_EntryPoint *EntryPointFilterer) WatchUserOperationEvent(opts *bind.WatchOpts, sink chan<- *EntryPointUserOperationEvent, userOpHash [][32]byte, sender []common.Address, paymaster []common.Address) (event.Subscription, error) { + + var userOpHashRule []interface{} + for _, userOpHashItem := range userOpHash { + userOpHashRule = append(userOpHashRule, userOpHashItem) + } + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var paymasterRule []interface{} + for _, paymasterItem := range paymaster { + paymasterRule = append(paymasterRule, paymasterItem) + } + + logs, sub, err := _EntryPoint.contract.WatchLogs(opts, "UserOperationEvent", userOpHashRule, senderRule, paymasterRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(EntryPointUserOperationEvent) + if err := _EntryPoint.contract.UnpackLog(event, "UserOperationEvent", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseUserOperationEvent is a log parse operation binding the contract event 0x49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f. +// +// Solidity: event UserOperationEvent(bytes32 indexed userOpHash, address indexed sender, address indexed paymaster, uint256 nonce, bool success, uint256 actualGasCost, uint256 actualGasUsed) +func (_EntryPoint *EntryPointFilterer) ParseUserOperationEvent(log types.Log) (*EntryPointUserOperationEvent, error) { + event := new(EntryPointUserOperationEvent) + if err := _EntryPoint.contract.UnpackLog(event, "UserOperationEvent", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// EntryPointUserOperationRevertReasonIterator is returned from FilterUserOperationRevertReason and is used to iterate over the raw logs and unpacked data for UserOperationRevertReason events raised by the EntryPoint contract. +type EntryPointUserOperationRevertReasonIterator struct { + Event *EntryPointUserOperationRevertReason // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *EntryPointUserOperationRevertReasonIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(EntryPointUserOperationRevertReason) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(EntryPointUserOperationRevertReason) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *EntryPointUserOperationRevertReasonIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *EntryPointUserOperationRevertReasonIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// EntryPointUserOperationRevertReason represents a UserOperationRevertReason event raised by the EntryPoint contract. +type EntryPointUserOperationRevertReason struct { + UserOpHash [32]byte + Sender common.Address + Nonce *big.Int + RevertReason []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterUserOperationRevertReason is a free log retrieval operation binding the contract event 0x1c4fada7374c0a9ee8841fc38afe82932dc0f8e69012e927f061a8bae611a201. +// +// Solidity: event UserOperationRevertReason(bytes32 indexed userOpHash, address indexed sender, uint256 nonce, bytes revertReason) +func (_EntryPoint *EntryPointFilterer) FilterUserOperationRevertReason(opts *bind.FilterOpts, userOpHash [][32]byte, sender []common.Address) (*EntryPointUserOperationRevertReasonIterator, error) { + + var userOpHashRule []interface{} + for _, userOpHashItem := range userOpHash { + userOpHashRule = append(userOpHashRule, userOpHashItem) + } + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _EntryPoint.contract.FilterLogs(opts, "UserOperationRevertReason", userOpHashRule, senderRule) + if err != nil { + return nil, err + } + return &EntryPointUserOperationRevertReasonIterator{contract: _EntryPoint.contract, event: "UserOperationRevertReason", logs: logs, sub: sub}, nil +} + +// WatchUserOperationRevertReason is a free log subscription operation binding the contract event 0x1c4fada7374c0a9ee8841fc38afe82932dc0f8e69012e927f061a8bae611a201. +// +// Solidity: event UserOperationRevertReason(bytes32 indexed userOpHash, address indexed sender, uint256 nonce, bytes revertReason) +func (_EntryPoint *EntryPointFilterer) WatchUserOperationRevertReason(opts *bind.WatchOpts, sink chan<- *EntryPointUserOperationRevertReason, userOpHash [][32]byte, sender []common.Address) (event.Subscription, error) { + + var userOpHashRule []interface{} + for _, userOpHashItem := range userOpHash { + userOpHashRule = append(userOpHashRule, userOpHashItem) + } + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _EntryPoint.contract.WatchLogs(opts, "UserOperationRevertReason", userOpHashRule, senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(EntryPointUserOperationRevertReason) + if err := _EntryPoint.contract.UnpackLog(event, "UserOperationRevertReason", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseUserOperationRevertReason is a log parse operation binding the contract event 0x1c4fada7374c0a9ee8841fc38afe82932dc0f8e69012e927f061a8bae611a201. +// +// Solidity: event UserOperationRevertReason(bytes32 indexed userOpHash, address indexed sender, uint256 nonce, bytes revertReason) +func (_EntryPoint *EntryPointFilterer) ParseUserOperationRevertReason(log types.Log) (*EntryPointUserOperationRevertReason, error) { + event := new(EntryPointUserOperationRevertReason) + if err := _EntryPoint.contract.UnpackLog(event, "UserOperationRevertReason", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// EntryPointWithdrawnIterator is returned from FilterWithdrawn and is used to iterate over the raw logs and unpacked data for Withdrawn events raised by the EntryPoint contract. +type EntryPointWithdrawnIterator struct { + Event *EntryPointWithdrawn // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *EntryPointWithdrawnIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(EntryPointWithdrawn) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(EntryPointWithdrawn) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *EntryPointWithdrawnIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *EntryPointWithdrawnIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// EntryPointWithdrawn represents a Withdrawn event raised by the EntryPoint contract. +type EntryPointWithdrawn struct { + Account common.Address + WithdrawAddress common.Address + Amount *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterWithdrawn is a free log retrieval operation binding the contract event 0xd1c19fbcd4551a5edfb66d43d2e337c04837afda3482b42bdf569a8fccdae5fb. +// +// Solidity: event Withdrawn(address indexed account, address withdrawAddress, uint256 amount) +func (_EntryPoint *EntryPointFilterer) FilterWithdrawn(opts *bind.FilterOpts, account []common.Address) (*EntryPointWithdrawnIterator, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _EntryPoint.contract.FilterLogs(opts, "Withdrawn", accountRule) + if err != nil { + return nil, err + } + return &EntryPointWithdrawnIterator{contract: _EntryPoint.contract, event: "Withdrawn", logs: logs, sub: sub}, nil +} + +// WatchWithdrawn is a free log subscription operation binding the contract event 0xd1c19fbcd4551a5edfb66d43d2e337c04837afda3482b42bdf569a8fccdae5fb. +// +// Solidity: event Withdrawn(address indexed account, address withdrawAddress, uint256 amount) +func (_EntryPoint *EntryPointFilterer) WatchWithdrawn(opts *bind.WatchOpts, sink chan<- *EntryPointWithdrawn, account []common.Address) (event.Subscription, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _EntryPoint.contract.WatchLogs(opts, "Withdrawn", accountRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(EntryPointWithdrawn) + if err := _EntryPoint.contract.UnpackLog(event, "Withdrawn", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseWithdrawn is a log parse operation binding the contract event 0xd1c19fbcd4551a5edfb66d43d2e337c04837afda3482b42bdf569a8fccdae5fb. +// +// Solidity: event Withdrawn(address indexed account, address withdrawAddress, uint256 amount) +func (_EntryPoint *EntryPointFilterer) ParseWithdrawn(log types.Log) (*EntryPointWithdrawn, error) { + event := new(EntryPointWithdrawn) + if err := _EntryPoint.contract.UnpackLog(event, "Withdrawn", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/op-e2e2/bindings/erc20.go b/op-e2e2/bindings/erc20.go new file mode 100644 index 000000000000..8cf32f869c3c --- /dev/null +++ b/op-e2e2/bindings/erc20.go @@ -0,0 +1,820 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// ERC20MetaData contains all meta data concerning the ERC20 contract. +var ERC20MetaData = &bind.MetaData{ + ABI: "[{\"type\":\"function\",\"name\":\"DOMAIN_SEPARATOR\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"allowance\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"approve\",\"inputs\":[{\"name\":\"spender\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"balanceOf\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"decimals\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"name\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"nonces\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"permit\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"spender\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"deadline\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"v\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"r\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"s\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"symbol\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"totalSupply\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"transfer\",\"inputs\":[{\"name\":\"to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferFrom\",\"inputs\":[{\"name\":\"from\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"Approval\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"spender\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Transfer\",\"inputs\":[{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false}]", +} + +// ERC20ABI is the input ABI used to generate the binding from. +// Deprecated: Use ERC20MetaData.ABI instead. +var ERC20ABI = ERC20MetaData.ABI + +// ERC20 is an auto generated Go binding around an Ethereum contract. +type ERC20 struct { + ERC20Caller // Read-only binding to the contract + ERC20Transactor // Write-only binding to the contract + ERC20Filterer // Log filterer for contract events +} + +// ERC20Caller is an auto generated read-only Go binding around an Ethereum contract. +type ERC20Caller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ERC20Transactor is an auto generated write-only Go binding around an Ethereum contract. +type ERC20Transactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ERC20Filterer is an auto generated log filtering Go binding around an Ethereum contract events. +type ERC20Filterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ERC20Session is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type ERC20Session struct { + Contract *ERC20 // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// ERC20CallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type ERC20CallerSession struct { + Contract *ERC20Caller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// ERC20TransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type ERC20TransactorSession struct { + Contract *ERC20Transactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// ERC20Raw is an auto generated low-level Go binding around an Ethereum contract. +type ERC20Raw struct { + Contract *ERC20 // Generic contract binding to access the raw methods on +} + +// ERC20CallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type ERC20CallerRaw struct { + Contract *ERC20Caller // Generic read-only contract binding to access the raw methods on +} + +// ERC20TransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type ERC20TransactorRaw struct { + Contract *ERC20Transactor // Generic write-only contract binding to access the raw methods on +} + +// NewERC20 creates a new instance of ERC20, bound to a specific deployed contract. +func NewERC20(address common.Address, backend bind.ContractBackend) (*ERC20, error) { + contract, err := bindERC20(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &ERC20{ERC20Caller: ERC20Caller{contract: contract}, ERC20Transactor: ERC20Transactor{contract: contract}, ERC20Filterer: ERC20Filterer{contract: contract}}, nil +} + +// NewERC20Caller creates a new read-only instance of ERC20, bound to a specific deployed contract. +func NewERC20Caller(address common.Address, caller bind.ContractCaller) (*ERC20Caller, error) { + contract, err := bindERC20(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &ERC20Caller{contract: contract}, nil +} + +// NewERC20Transactor creates a new write-only instance of ERC20, bound to a specific deployed contract. +func NewERC20Transactor(address common.Address, transactor bind.ContractTransactor) (*ERC20Transactor, error) { + contract, err := bindERC20(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &ERC20Transactor{contract: contract}, nil +} + +// NewERC20Filterer creates a new log filterer instance of ERC20, bound to a specific deployed contract. +func NewERC20Filterer(address common.Address, filterer bind.ContractFilterer) (*ERC20Filterer, error) { + contract, err := bindERC20(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &ERC20Filterer{contract: contract}, nil +} + +// bindERC20 binds a generic wrapper to an already deployed contract. +func bindERC20(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(ERC20ABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_ERC20 *ERC20Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _ERC20.Contract.ERC20Caller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_ERC20 *ERC20Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ERC20.Contract.ERC20Transactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_ERC20 *ERC20Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ERC20.Contract.ERC20Transactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_ERC20 *ERC20CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _ERC20.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_ERC20 *ERC20TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ERC20.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_ERC20 *ERC20TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ERC20.Contract.contract.Transact(opts, method, params...) +} + +// DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. +// +// Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) +func (_ERC20 *ERC20Caller) DOMAINSEPARATOR(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _ERC20.contract.Call(opts, &out, "DOMAIN_SEPARATOR") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. +// +// Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) +func (_ERC20 *ERC20Session) DOMAINSEPARATOR() ([32]byte, error) { + return _ERC20.Contract.DOMAINSEPARATOR(&_ERC20.CallOpts) +} + +// DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. +// +// Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) +func (_ERC20 *ERC20CallerSession) DOMAINSEPARATOR() ([32]byte, error) { + return _ERC20.Contract.DOMAINSEPARATOR(&_ERC20.CallOpts) +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address , address ) view returns(uint256) +func (_ERC20 *ERC20Caller) Allowance(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address) (*big.Int, error) { + var out []interface{} + err := _ERC20.contract.Call(opts, &out, "allowance", arg0, arg1) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address , address ) view returns(uint256) +func (_ERC20 *ERC20Session) Allowance(arg0 common.Address, arg1 common.Address) (*big.Int, error) { + return _ERC20.Contract.Allowance(&_ERC20.CallOpts, arg0, arg1) +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address , address ) view returns(uint256) +func (_ERC20 *ERC20CallerSession) Allowance(arg0 common.Address, arg1 common.Address) (*big.Int, error) { + return _ERC20.Contract.Allowance(&_ERC20.CallOpts, arg0, arg1) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address ) view returns(uint256) +func (_ERC20 *ERC20Caller) BalanceOf(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { + var out []interface{} + err := _ERC20.contract.Call(opts, &out, "balanceOf", arg0) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address ) view returns(uint256) +func (_ERC20 *ERC20Session) BalanceOf(arg0 common.Address) (*big.Int, error) { + return _ERC20.Contract.BalanceOf(&_ERC20.CallOpts, arg0) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address ) view returns(uint256) +func (_ERC20 *ERC20CallerSession) BalanceOf(arg0 common.Address) (*big.Int, error) { + return _ERC20.Contract.BalanceOf(&_ERC20.CallOpts, arg0) +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_ERC20 *ERC20Caller) Decimals(opts *bind.CallOpts) (uint8, error) { + var out []interface{} + err := _ERC20.contract.Call(opts, &out, "decimals") + + if err != nil { + return *new(uint8), err + } + + out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) + + return out0, err + +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_ERC20 *ERC20Session) Decimals() (uint8, error) { + return _ERC20.Contract.Decimals(&_ERC20.CallOpts) +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_ERC20 *ERC20CallerSession) Decimals() (uint8, error) { + return _ERC20.Contract.Decimals(&_ERC20.CallOpts) +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_ERC20 *ERC20Caller) Name(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _ERC20.contract.Call(opts, &out, "name") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_ERC20 *ERC20Session) Name() (string, error) { + return _ERC20.Contract.Name(&_ERC20.CallOpts) +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_ERC20 *ERC20CallerSession) Name() (string, error) { + return _ERC20.Contract.Name(&_ERC20.CallOpts) +} + +// Nonces is a free data retrieval call binding the contract method 0x7ecebe00. +// +// Solidity: function nonces(address ) view returns(uint256) +func (_ERC20 *ERC20Caller) Nonces(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { + var out []interface{} + err := _ERC20.contract.Call(opts, &out, "nonces", arg0) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Nonces is a free data retrieval call binding the contract method 0x7ecebe00. +// +// Solidity: function nonces(address ) view returns(uint256) +func (_ERC20 *ERC20Session) Nonces(arg0 common.Address) (*big.Int, error) { + return _ERC20.Contract.Nonces(&_ERC20.CallOpts, arg0) +} + +// Nonces is a free data retrieval call binding the contract method 0x7ecebe00. +// +// Solidity: function nonces(address ) view returns(uint256) +func (_ERC20 *ERC20CallerSession) Nonces(arg0 common.Address) (*big.Int, error) { + return _ERC20.Contract.Nonces(&_ERC20.CallOpts, arg0) +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_ERC20 *ERC20Caller) Symbol(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _ERC20.contract.Call(opts, &out, "symbol") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_ERC20 *ERC20Session) Symbol() (string, error) { + return _ERC20.Contract.Symbol(&_ERC20.CallOpts) +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_ERC20 *ERC20CallerSession) Symbol() (string, error) { + return _ERC20.Contract.Symbol(&_ERC20.CallOpts) +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_ERC20 *ERC20Caller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _ERC20.contract.Call(opts, &out, "totalSupply") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_ERC20 *ERC20Session) TotalSupply() (*big.Int, error) { + return _ERC20.Contract.TotalSupply(&_ERC20.CallOpts) +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_ERC20 *ERC20CallerSession) TotalSupply() (*big.Int, error) { + return _ERC20.Contract.TotalSupply(&_ERC20.CallOpts) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_ERC20 *ERC20Transactor) Approve(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20.contract.Transact(opts, "approve", spender, amount) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_ERC20 *ERC20Session) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20.Contract.Approve(&_ERC20.TransactOpts, spender, amount) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_ERC20 *ERC20TransactorSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20.Contract.Approve(&_ERC20.TransactOpts, spender, amount) +} + +// Permit is a paid mutator transaction binding the contract method 0xd505accf. +// +// Solidity: function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) returns() +func (_ERC20 *ERC20Transactor) Permit(opts *bind.TransactOpts, owner common.Address, spender common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { + return _ERC20.contract.Transact(opts, "permit", owner, spender, value, deadline, v, r, s) +} + +// Permit is a paid mutator transaction binding the contract method 0xd505accf. +// +// Solidity: function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) returns() +func (_ERC20 *ERC20Session) Permit(owner common.Address, spender common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { + return _ERC20.Contract.Permit(&_ERC20.TransactOpts, owner, spender, value, deadline, v, r, s) +} + +// Permit is a paid mutator transaction binding the contract method 0xd505accf. +// +// Solidity: function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) returns() +func (_ERC20 *ERC20TransactorSession) Permit(owner common.Address, spender common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { + return _ERC20.Contract.Permit(&_ERC20.TransactOpts, owner, spender, value, deadline, v, r, s) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address to, uint256 amount) returns(bool) +func (_ERC20 *ERC20Transactor) Transfer(opts *bind.TransactOpts, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20.contract.Transact(opts, "transfer", to, amount) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address to, uint256 amount) returns(bool) +func (_ERC20 *ERC20Session) Transfer(to common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20.Contract.Transfer(&_ERC20.TransactOpts, to, amount) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address to, uint256 amount) returns(bool) +func (_ERC20 *ERC20TransactorSession) Transfer(to common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20.Contract.Transfer(&_ERC20.TransactOpts, to, amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address from, address to, uint256 amount) returns(bool) +func (_ERC20 *ERC20Transactor) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20.contract.Transact(opts, "transferFrom", from, to, amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address from, address to, uint256 amount) returns(bool) +func (_ERC20 *ERC20Session) TransferFrom(from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20.Contract.TransferFrom(&_ERC20.TransactOpts, from, to, amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address from, address to, uint256 amount) returns(bool) +func (_ERC20 *ERC20TransactorSession) TransferFrom(from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20.Contract.TransferFrom(&_ERC20.TransactOpts, from, to, amount) +} + +// ERC20ApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the ERC20 contract. +type ERC20ApprovalIterator struct { + Event *ERC20Approval // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *ERC20ApprovalIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(ERC20Approval) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(ERC20Approval) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *ERC20ApprovalIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC20ApprovalIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC20Approval represents a Approval event raised by the ERC20 contract. +type ERC20Approval struct { + Owner common.Address + Spender common.Address + Amount *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 amount) +func (_ERC20 *ERC20Filterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*ERC20ApprovalIterator, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var spenderRule []interface{} + for _, spenderItem := range spender { + spenderRule = append(spenderRule, spenderItem) + } + + logs, sub, err := _ERC20.contract.FilterLogs(opts, "Approval", ownerRule, spenderRule) + if err != nil { + return nil, err + } + return &ERC20ApprovalIterator{contract: _ERC20.contract, event: "Approval", logs: logs, sub: sub}, nil +} + +// WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 amount) +func (_ERC20 *ERC20Filterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *ERC20Approval, owner []common.Address, spender []common.Address) (event.Subscription, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var spenderRule []interface{} + for _, spenderItem := range spender { + spenderRule = append(spenderRule, spenderItem) + } + + logs, sub, err := _ERC20.contract.WatchLogs(opts, "Approval", ownerRule, spenderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(ERC20Approval) + if err := _ERC20.contract.UnpackLog(event, "Approval", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 amount) +func (_ERC20 *ERC20Filterer) ParseApproval(log types.Log) (*ERC20Approval, error) { + event := new(ERC20Approval) + if err := _ERC20.contract.UnpackLog(event, "Approval", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// ERC20TransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the ERC20 contract. +type ERC20TransferIterator struct { + Event *ERC20Transfer // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *ERC20TransferIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(ERC20Transfer) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(ERC20Transfer) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *ERC20TransferIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC20TransferIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC20Transfer represents a Transfer event raised by the ERC20 contract. +type ERC20Transfer struct { + From common.Address + To common.Address + Amount *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 amount) +func (_ERC20 *ERC20Filterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*ERC20TransferIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _ERC20.contract.FilterLogs(opts, "Transfer", fromRule, toRule) + if err != nil { + return nil, err + } + return &ERC20TransferIterator{contract: _ERC20.contract, event: "Transfer", logs: logs, sub: sub}, nil +} + +// WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 amount) +func (_ERC20 *ERC20Filterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *ERC20Transfer, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _ERC20.contract.WatchLogs(opts, "Transfer", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(ERC20Transfer) + if err := _ERC20.contract.UnpackLog(event, "Transfer", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 amount) +func (_ERC20 *ERC20Filterer) ParseTransfer(log types.Log) (*ERC20Transfer, error) { + event := new(ERC20Transfer) + if err := _ERC20.contract.UnpackLog(event, "Transfer", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/op-e2e2/bindings/faultdisputegame.go b/op-e2e2/bindings/faultdisputegame.go new file mode 100644 index 000000000000..d43287d3da6a --- /dev/null +++ b/op-e2e2/bindings/faultdisputegame.go @@ -0,0 +1,1877 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// FaultDisputeGameMetaData contains all meta data concerning the FaultDisputeGame contract. +var FaultDisputeGameMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"GameType\",\"name\":\"_gameType\",\"type\":\"uint32\"},{\"internalType\":\"Claim\",\"name\":\"_absolutePrestate\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_maxGameDepth\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_splitDepth\",\"type\":\"uint256\"},{\"internalType\":\"Duration\",\"name\":\"_clockExtension\",\"type\":\"uint64\"},{\"internalType\":\"Duration\",\"name\":\"_maxClockDuration\",\"type\":\"uint64\"},{\"internalType\":\"contractIBigStepper\",\"name\":\"_vm\",\"type\":\"address\"},{\"internalType\":\"contractIDelayedWETH\",\"name\":\"_weth\",\"type\":\"address\"},{\"internalType\":\"contractIAnchorStateRegistry\",\"name\":\"_anchorStateRegistry\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_l2ChainId\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"absolutePrestate\",\"outputs\":[{\"internalType\":\"Claim\",\"name\":\"absolutePrestate_\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_ident\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_execLeafIdx\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_partOffset\",\"type\":\"uint256\"}],\"name\":\"addLocalData\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"anchorStateRegistry\",\"outputs\":[{\"internalType\":\"contractIAnchorStateRegistry\",\"name\":\"registry_\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"Claim\",\"name\":\"_disputed\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_parentIndex\",\"type\":\"uint256\"},{\"internalType\":\"Claim\",\"name\":\"_claim\",\"type\":\"bytes32\"}],\"name\":\"attack\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"version\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"stateRoot\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"messagePasserStorageRoot\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"latestBlockhash\",\"type\":\"bytes32\"}],\"internalType\":\"structTypes.OutputRootProof\",\"name\":\"_outputRootProof\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"_headerRLP\",\"type\":\"bytes\"}],\"name\":\"challengeRootL2Block\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"}],\"name\":\"claimCredit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"claimData\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"parentIndex\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"counteredBy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"claimant\",\"type\":\"address\"},{\"internalType\":\"uint128\",\"name\":\"bond\",\"type\":\"uint128\"},{\"internalType\":\"Claim\",\"name\":\"claim\",\"type\":\"bytes32\"},{\"internalType\":\"Position\",\"name\":\"position\",\"type\":\"uint128\"},{\"internalType\":\"Clock\",\"name\":\"clock\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"claimDataLen\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"len_\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"Hash\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"claims\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"clockExtension\",\"outputs\":[{\"internalType\":\"Duration\",\"name\":\"clockExtension_\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"createdAt\",\"outputs\":[{\"internalType\":\"Timestamp\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"credit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"Claim\",\"name\":\"_disputed\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_parentIndex\",\"type\":\"uint256\"},{\"internalType\":\"Claim\",\"name\":\"_claim\",\"type\":\"bytes32\"}],\"name\":\"defend\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"extraData\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"extraData_\",\"type\":\"bytes\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gameCreator\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"creator_\",\"type\":\"address\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gameData\",\"outputs\":[{\"internalType\":\"GameType\",\"name\":\"gameType_\",\"type\":\"uint32\"},{\"internalType\":\"Claim\",\"name\":\"rootClaim_\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"extraData_\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gameType\",\"outputs\":[{\"internalType\":\"GameType\",\"name\":\"gameType_\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_claimIndex\",\"type\":\"uint256\"}],\"name\":\"getChallengerDuration\",\"outputs\":[{\"internalType\":\"Duration\",\"name\":\"duration_\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_claimIndex\",\"type\":\"uint256\"}],\"name\":\"getNumToResolve\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"numRemainingChildren_\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"Position\",\"name\":\"_position\",\"type\":\"uint128\"}],\"name\":\"getRequiredBond\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"requiredBond_\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l1Head\",\"outputs\":[{\"internalType\":\"Hash\",\"name\":\"l1Head_\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l2BlockNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"l2BlockNumber_\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l2BlockNumberChallenged\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l2BlockNumberChallenger\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l2ChainId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"l2ChainId_\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxClockDuration\",\"outputs\":[{\"internalType\":\"Duration\",\"name\":\"maxClockDuration_\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxGameDepth\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"maxGameDepth_\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"Claim\",\"name\":\"_disputed\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_challengeIndex\",\"type\":\"uint256\"},{\"internalType\":\"Claim\",\"name\":\"_claim\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"_isAttack\",\"type\":\"bool\"}],\"name\":\"move\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"resolutionCheckpoints\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"initialCheckpointComplete\",\"type\":\"bool\"},{\"internalType\":\"uint32\",\"name\":\"subgameIndex\",\"type\":\"uint32\"},{\"internalType\":\"Position\",\"name\":\"leftmostPosition\",\"type\":\"uint128\"},{\"internalType\":\"address\",\"name\":\"counteredBy\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"enumGameStatus\",\"name\":\"status_\",\"type\":\"uint8\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_claimIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_numToResolve\",\"type\":\"uint256\"}],\"name\":\"resolveClaim\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"resolvedAt\",\"outputs\":[{\"internalType\":\"Timestamp\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"resolvedSubgames\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"rootClaim\",\"outputs\":[{\"internalType\":\"Claim\",\"name\":\"rootClaim_\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"splitDepth\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"splitDepth_\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"startingBlockNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"startingBlockNumber_\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"startingOutputRoot\",\"outputs\":[{\"internalType\":\"Hash\",\"name\":\"root\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"l2BlockNumber\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"startingRootHash\",\"outputs\":[{\"internalType\":\"Hash\",\"name\":\"startingRootHash_\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"status\",\"outputs\":[{\"internalType\":\"enumGameStatus\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_claimIndex\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"_isAttack\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"_stateData\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"_proof\",\"type\":\"bytes\"}],\"name\":\"step\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"subgames\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vm\",\"outputs\":[{\"internalType\":\"contractIBigStepper\",\"name\":\"vm_\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"weth\",\"outputs\":[{\"internalType\":\"contractIDelayedWETH\",\"name\":\"weth_\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"parentIndex\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"Claim\",\"name\":\"claim\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"claimant\",\"type\":\"address\"}],\"name\":\"Move\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"enumGameStatus\",\"name\":\"status\",\"type\":\"uint8\"}],\"name\":\"Resolved\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"AlreadyInitialized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AnchorRootNotFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BlockNumberMatches\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BondTransferFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CannotDefendRootClaim\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ClaimAboveSplit\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ClaimAlreadyExists\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ClaimAlreadyResolved\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ClockNotExpired\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ClockTimeExceeded\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ContentLengthMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DuplicateStep\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"EmptyItem\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GameDepthExceeded\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GameNotInProgress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IncorrectBondAmount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidClockExtension\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidDataRemainder\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidDisputedClaimIndex\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidHeader\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidHeaderRLP\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidLocalIdent\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidOutputRootProof\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidParent\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidPrestate\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSplitDepth\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2BlockNumberChallenged\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MaxDepthTooLarge\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NoCreditToClaim\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OutOfOrderResolution\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnexpectedList\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"Claim\",\"name\":\"rootClaim\",\"type\":\"bytes32\"}],\"name\":\"UnexpectedRootClaim\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnexpectedString\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ValidStep\",\"type\":\"error\"}]", +} + +// FaultDisputeGameABI is the input ABI used to generate the binding from. +// Deprecated: Use FaultDisputeGameMetaData.ABI instead. +var FaultDisputeGameABI = FaultDisputeGameMetaData.ABI + +// FaultDisputeGame is an auto generated Go binding around an Ethereum contract. +type FaultDisputeGame struct { + FaultDisputeGameCaller // Read-only binding to the contract + FaultDisputeGameTransactor // Write-only binding to the contract + FaultDisputeGameFilterer // Log filterer for contract events +} + +// FaultDisputeGameCaller is an auto generated read-only Go binding around an Ethereum contract. +type FaultDisputeGameCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// FaultDisputeGameTransactor is an auto generated write-only Go binding around an Ethereum contract. +type FaultDisputeGameTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// FaultDisputeGameFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type FaultDisputeGameFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// FaultDisputeGameSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type FaultDisputeGameSession struct { + Contract *FaultDisputeGame // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// FaultDisputeGameCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type FaultDisputeGameCallerSession struct { + Contract *FaultDisputeGameCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// FaultDisputeGameTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type FaultDisputeGameTransactorSession struct { + Contract *FaultDisputeGameTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// FaultDisputeGameRaw is an auto generated low-level Go binding around an Ethereum contract. +type FaultDisputeGameRaw struct { + Contract *FaultDisputeGame // Generic contract binding to access the raw methods on +} + +// FaultDisputeGameCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type FaultDisputeGameCallerRaw struct { + Contract *FaultDisputeGameCaller // Generic read-only contract binding to access the raw methods on +} + +// FaultDisputeGameTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type FaultDisputeGameTransactorRaw struct { + Contract *FaultDisputeGameTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewFaultDisputeGame creates a new instance of FaultDisputeGame, bound to a specific deployed contract. +func NewFaultDisputeGame(address common.Address, backend bind.ContractBackend) (*FaultDisputeGame, error) { + contract, err := bindFaultDisputeGame(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &FaultDisputeGame{FaultDisputeGameCaller: FaultDisputeGameCaller{contract: contract}, FaultDisputeGameTransactor: FaultDisputeGameTransactor{contract: contract}, FaultDisputeGameFilterer: FaultDisputeGameFilterer{contract: contract}}, nil +} + +// NewFaultDisputeGameCaller creates a new read-only instance of FaultDisputeGame, bound to a specific deployed contract. +func NewFaultDisputeGameCaller(address common.Address, caller bind.ContractCaller) (*FaultDisputeGameCaller, error) { + contract, err := bindFaultDisputeGame(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &FaultDisputeGameCaller{contract: contract}, nil +} + +// NewFaultDisputeGameTransactor creates a new write-only instance of FaultDisputeGame, bound to a specific deployed contract. +func NewFaultDisputeGameTransactor(address common.Address, transactor bind.ContractTransactor) (*FaultDisputeGameTransactor, error) { + contract, err := bindFaultDisputeGame(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &FaultDisputeGameTransactor{contract: contract}, nil +} + +// NewFaultDisputeGameFilterer creates a new log filterer instance of FaultDisputeGame, bound to a specific deployed contract. +func NewFaultDisputeGameFilterer(address common.Address, filterer bind.ContractFilterer) (*FaultDisputeGameFilterer, error) { + contract, err := bindFaultDisputeGame(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &FaultDisputeGameFilterer{contract: contract}, nil +} + +// bindFaultDisputeGame binds a generic wrapper to an already deployed contract. +func bindFaultDisputeGame(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(FaultDisputeGameABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_FaultDisputeGame *FaultDisputeGameRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _FaultDisputeGame.Contract.FaultDisputeGameCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_FaultDisputeGame *FaultDisputeGameRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _FaultDisputeGame.Contract.FaultDisputeGameTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_FaultDisputeGame *FaultDisputeGameRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _FaultDisputeGame.Contract.FaultDisputeGameTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_FaultDisputeGame *FaultDisputeGameCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _FaultDisputeGame.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_FaultDisputeGame *FaultDisputeGameTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _FaultDisputeGame.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_FaultDisputeGame *FaultDisputeGameTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _FaultDisputeGame.Contract.contract.Transact(opts, method, params...) +} + +// AbsolutePrestate is a free data retrieval call binding the contract method 0x8d450a95. +// +// Solidity: function absolutePrestate() view returns(bytes32 absolutePrestate_) +func (_FaultDisputeGame *FaultDisputeGameCaller) AbsolutePrestate(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _FaultDisputeGame.contract.Call(opts, &out, "absolutePrestate") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// AbsolutePrestate is a free data retrieval call binding the contract method 0x8d450a95. +// +// Solidity: function absolutePrestate() view returns(bytes32 absolutePrestate_) +func (_FaultDisputeGame *FaultDisputeGameSession) AbsolutePrestate() ([32]byte, error) { + return _FaultDisputeGame.Contract.AbsolutePrestate(&_FaultDisputeGame.CallOpts) +} + +// AbsolutePrestate is a free data retrieval call binding the contract method 0x8d450a95. +// +// Solidity: function absolutePrestate() view returns(bytes32 absolutePrestate_) +func (_FaultDisputeGame *FaultDisputeGameCallerSession) AbsolutePrestate() ([32]byte, error) { + return _FaultDisputeGame.Contract.AbsolutePrestate(&_FaultDisputeGame.CallOpts) +} + +// AnchorStateRegistry is a free data retrieval call binding the contract method 0x5c0cba33. +// +// Solidity: function anchorStateRegistry() view returns(address registry_) +func (_FaultDisputeGame *FaultDisputeGameCaller) AnchorStateRegistry(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _FaultDisputeGame.contract.Call(opts, &out, "anchorStateRegistry") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// AnchorStateRegistry is a free data retrieval call binding the contract method 0x5c0cba33. +// +// Solidity: function anchorStateRegistry() view returns(address registry_) +func (_FaultDisputeGame *FaultDisputeGameSession) AnchorStateRegistry() (common.Address, error) { + return _FaultDisputeGame.Contract.AnchorStateRegistry(&_FaultDisputeGame.CallOpts) +} + +// AnchorStateRegistry is a free data retrieval call binding the contract method 0x5c0cba33. +// +// Solidity: function anchorStateRegistry() view returns(address registry_) +func (_FaultDisputeGame *FaultDisputeGameCallerSession) AnchorStateRegistry() (common.Address, error) { + return _FaultDisputeGame.Contract.AnchorStateRegistry(&_FaultDisputeGame.CallOpts) +} + +// ClaimData is a free data retrieval call binding the contract method 0xc6f0308c. +// +// Solidity: function claimData(uint256 ) view returns(uint32 parentIndex, address counteredBy, address claimant, uint128 bond, bytes32 claim, uint128 position, uint128 clock) +func (_FaultDisputeGame *FaultDisputeGameCaller) ClaimData(opts *bind.CallOpts, arg0 *big.Int) (struct { + ParentIndex uint32 + CounteredBy common.Address + Claimant common.Address + Bond *big.Int + Claim [32]byte + Position *big.Int + Clock *big.Int +}, error) { + var out []interface{} + err := _FaultDisputeGame.contract.Call(opts, &out, "claimData", arg0) + + outstruct := new(struct { + ParentIndex uint32 + CounteredBy common.Address + Claimant common.Address + Bond *big.Int + Claim [32]byte + Position *big.Int + Clock *big.Int + }) + if err != nil { + return *outstruct, err + } + + outstruct.ParentIndex = *abi.ConvertType(out[0], new(uint32)).(*uint32) + outstruct.CounteredBy = *abi.ConvertType(out[1], new(common.Address)).(*common.Address) + outstruct.Claimant = *abi.ConvertType(out[2], new(common.Address)).(*common.Address) + outstruct.Bond = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) + outstruct.Claim = *abi.ConvertType(out[4], new([32]byte)).(*[32]byte) + outstruct.Position = *abi.ConvertType(out[5], new(*big.Int)).(**big.Int) + outstruct.Clock = *abi.ConvertType(out[6], new(*big.Int)).(**big.Int) + + return *outstruct, err + +} + +// ClaimData is a free data retrieval call binding the contract method 0xc6f0308c. +// +// Solidity: function claimData(uint256 ) view returns(uint32 parentIndex, address counteredBy, address claimant, uint128 bond, bytes32 claim, uint128 position, uint128 clock) +func (_FaultDisputeGame *FaultDisputeGameSession) ClaimData(arg0 *big.Int) (struct { + ParentIndex uint32 + CounteredBy common.Address + Claimant common.Address + Bond *big.Int + Claim [32]byte + Position *big.Int + Clock *big.Int +}, error) { + return _FaultDisputeGame.Contract.ClaimData(&_FaultDisputeGame.CallOpts, arg0) +} + +// ClaimData is a free data retrieval call binding the contract method 0xc6f0308c. +// +// Solidity: function claimData(uint256 ) view returns(uint32 parentIndex, address counteredBy, address claimant, uint128 bond, bytes32 claim, uint128 position, uint128 clock) +func (_FaultDisputeGame *FaultDisputeGameCallerSession) ClaimData(arg0 *big.Int) (struct { + ParentIndex uint32 + CounteredBy common.Address + Claimant common.Address + Bond *big.Int + Claim [32]byte + Position *big.Int + Clock *big.Int +}, error) { + return _FaultDisputeGame.Contract.ClaimData(&_FaultDisputeGame.CallOpts, arg0) +} + +// ClaimDataLen is a free data retrieval call binding the contract method 0x8980e0cc. +// +// Solidity: function claimDataLen() view returns(uint256 len_) +func (_FaultDisputeGame *FaultDisputeGameCaller) ClaimDataLen(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _FaultDisputeGame.contract.Call(opts, &out, "claimDataLen") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// ClaimDataLen is a free data retrieval call binding the contract method 0x8980e0cc. +// +// Solidity: function claimDataLen() view returns(uint256 len_) +func (_FaultDisputeGame *FaultDisputeGameSession) ClaimDataLen() (*big.Int, error) { + return _FaultDisputeGame.Contract.ClaimDataLen(&_FaultDisputeGame.CallOpts) +} + +// ClaimDataLen is a free data retrieval call binding the contract method 0x8980e0cc. +// +// Solidity: function claimDataLen() view returns(uint256 len_) +func (_FaultDisputeGame *FaultDisputeGameCallerSession) ClaimDataLen() (*big.Int, error) { + return _FaultDisputeGame.Contract.ClaimDataLen(&_FaultDisputeGame.CallOpts) +} + +// Claims is a free data retrieval call binding the contract method 0xeff0f592. +// +// Solidity: function claims(bytes32 ) view returns(bool) +func (_FaultDisputeGame *FaultDisputeGameCaller) Claims(opts *bind.CallOpts, arg0 [32]byte) (bool, error) { + var out []interface{} + err := _FaultDisputeGame.contract.Call(opts, &out, "claims", arg0) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// Claims is a free data retrieval call binding the contract method 0xeff0f592. +// +// Solidity: function claims(bytes32 ) view returns(bool) +func (_FaultDisputeGame *FaultDisputeGameSession) Claims(arg0 [32]byte) (bool, error) { + return _FaultDisputeGame.Contract.Claims(&_FaultDisputeGame.CallOpts, arg0) +} + +// Claims is a free data retrieval call binding the contract method 0xeff0f592. +// +// Solidity: function claims(bytes32 ) view returns(bool) +func (_FaultDisputeGame *FaultDisputeGameCallerSession) Claims(arg0 [32]byte) (bool, error) { + return _FaultDisputeGame.Contract.Claims(&_FaultDisputeGame.CallOpts, arg0) +} + +// ClockExtension is a free data retrieval call binding the contract method 0x6b6716c0. +// +// Solidity: function clockExtension() view returns(uint64 clockExtension_) +func (_FaultDisputeGame *FaultDisputeGameCaller) ClockExtension(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _FaultDisputeGame.contract.Call(opts, &out, "clockExtension") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// ClockExtension is a free data retrieval call binding the contract method 0x6b6716c0. +// +// Solidity: function clockExtension() view returns(uint64 clockExtension_) +func (_FaultDisputeGame *FaultDisputeGameSession) ClockExtension() (uint64, error) { + return _FaultDisputeGame.Contract.ClockExtension(&_FaultDisputeGame.CallOpts) +} + +// ClockExtension is a free data retrieval call binding the contract method 0x6b6716c0. +// +// Solidity: function clockExtension() view returns(uint64 clockExtension_) +func (_FaultDisputeGame *FaultDisputeGameCallerSession) ClockExtension() (uint64, error) { + return _FaultDisputeGame.Contract.ClockExtension(&_FaultDisputeGame.CallOpts) +} + +// CreatedAt is a free data retrieval call binding the contract method 0xcf09e0d0. +// +// Solidity: function createdAt() view returns(uint64) +func (_FaultDisputeGame *FaultDisputeGameCaller) CreatedAt(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _FaultDisputeGame.contract.Call(opts, &out, "createdAt") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// CreatedAt is a free data retrieval call binding the contract method 0xcf09e0d0. +// +// Solidity: function createdAt() view returns(uint64) +func (_FaultDisputeGame *FaultDisputeGameSession) CreatedAt() (uint64, error) { + return _FaultDisputeGame.Contract.CreatedAt(&_FaultDisputeGame.CallOpts) +} + +// CreatedAt is a free data retrieval call binding the contract method 0xcf09e0d0. +// +// Solidity: function createdAt() view returns(uint64) +func (_FaultDisputeGame *FaultDisputeGameCallerSession) CreatedAt() (uint64, error) { + return _FaultDisputeGame.Contract.CreatedAt(&_FaultDisputeGame.CallOpts) +} + +// Credit is a free data retrieval call binding the contract method 0xd5d44d80. +// +// Solidity: function credit(address ) view returns(uint256) +func (_FaultDisputeGame *FaultDisputeGameCaller) Credit(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { + var out []interface{} + err := _FaultDisputeGame.contract.Call(opts, &out, "credit", arg0) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Credit is a free data retrieval call binding the contract method 0xd5d44d80. +// +// Solidity: function credit(address ) view returns(uint256) +func (_FaultDisputeGame *FaultDisputeGameSession) Credit(arg0 common.Address) (*big.Int, error) { + return _FaultDisputeGame.Contract.Credit(&_FaultDisputeGame.CallOpts, arg0) +} + +// Credit is a free data retrieval call binding the contract method 0xd5d44d80. +// +// Solidity: function credit(address ) view returns(uint256) +func (_FaultDisputeGame *FaultDisputeGameCallerSession) Credit(arg0 common.Address) (*big.Int, error) { + return _FaultDisputeGame.Contract.Credit(&_FaultDisputeGame.CallOpts, arg0) +} + +// ExtraData is a free data retrieval call binding the contract method 0x609d3334. +// +// Solidity: function extraData() pure returns(bytes extraData_) +func (_FaultDisputeGame *FaultDisputeGameCaller) ExtraData(opts *bind.CallOpts) ([]byte, error) { + var out []interface{} + err := _FaultDisputeGame.contract.Call(opts, &out, "extraData") + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +// ExtraData is a free data retrieval call binding the contract method 0x609d3334. +// +// Solidity: function extraData() pure returns(bytes extraData_) +func (_FaultDisputeGame *FaultDisputeGameSession) ExtraData() ([]byte, error) { + return _FaultDisputeGame.Contract.ExtraData(&_FaultDisputeGame.CallOpts) +} + +// ExtraData is a free data retrieval call binding the contract method 0x609d3334. +// +// Solidity: function extraData() pure returns(bytes extraData_) +func (_FaultDisputeGame *FaultDisputeGameCallerSession) ExtraData() ([]byte, error) { + return _FaultDisputeGame.Contract.ExtraData(&_FaultDisputeGame.CallOpts) +} + +// GameCreator is a free data retrieval call binding the contract method 0x37b1b229. +// +// Solidity: function gameCreator() pure returns(address creator_) +func (_FaultDisputeGame *FaultDisputeGameCaller) GameCreator(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _FaultDisputeGame.contract.Call(opts, &out, "gameCreator") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// GameCreator is a free data retrieval call binding the contract method 0x37b1b229. +// +// Solidity: function gameCreator() pure returns(address creator_) +func (_FaultDisputeGame *FaultDisputeGameSession) GameCreator() (common.Address, error) { + return _FaultDisputeGame.Contract.GameCreator(&_FaultDisputeGame.CallOpts) +} + +// GameCreator is a free data retrieval call binding the contract method 0x37b1b229. +// +// Solidity: function gameCreator() pure returns(address creator_) +func (_FaultDisputeGame *FaultDisputeGameCallerSession) GameCreator() (common.Address, error) { + return _FaultDisputeGame.Contract.GameCreator(&_FaultDisputeGame.CallOpts) +} + +// GameData is a free data retrieval call binding the contract method 0xfa24f743. +// +// Solidity: function gameData() view returns(uint32 gameType_, bytes32 rootClaim_, bytes extraData_) +func (_FaultDisputeGame *FaultDisputeGameCaller) GameData(opts *bind.CallOpts) (struct { + GameType uint32 + RootClaim [32]byte + ExtraData []byte +}, error) { + var out []interface{} + err := _FaultDisputeGame.contract.Call(opts, &out, "gameData") + + outstruct := new(struct { + GameType uint32 + RootClaim [32]byte + ExtraData []byte + }) + if err != nil { + return *outstruct, err + } + + outstruct.GameType = *abi.ConvertType(out[0], new(uint32)).(*uint32) + outstruct.RootClaim = *abi.ConvertType(out[1], new([32]byte)).(*[32]byte) + outstruct.ExtraData = *abi.ConvertType(out[2], new([]byte)).(*[]byte) + + return *outstruct, err + +} + +// GameData is a free data retrieval call binding the contract method 0xfa24f743. +// +// Solidity: function gameData() view returns(uint32 gameType_, bytes32 rootClaim_, bytes extraData_) +func (_FaultDisputeGame *FaultDisputeGameSession) GameData() (struct { + GameType uint32 + RootClaim [32]byte + ExtraData []byte +}, error) { + return _FaultDisputeGame.Contract.GameData(&_FaultDisputeGame.CallOpts) +} + +// GameData is a free data retrieval call binding the contract method 0xfa24f743. +// +// Solidity: function gameData() view returns(uint32 gameType_, bytes32 rootClaim_, bytes extraData_) +func (_FaultDisputeGame *FaultDisputeGameCallerSession) GameData() (struct { + GameType uint32 + RootClaim [32]byte + ExtraData []byte +}, error) { + return _FaultDisputeGame.Contract.GameData(&_FaultDisputeGame.CallOpts) +} + +// GameType is a free data retrieval call binding the contract method 0xbbdc02db. +// +// Solidity: function gameType() view returns(uint32 gameType_) +func (_FaultDisputeGame *FaultDisputeGameCaller) GameType(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _FaultDisputeGame.contract.Call(opts, &out, "gameType") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// GameType is a free data retrieval call binding the contract method 0xbbdc02db. +// +// Solidity: function gameType() view returns(uint32 gameType_) +func (_FaultDisputeGame *FaultDisputeGameSession) GameType() (uint32, error) { + return _FaultDisputeGame.Contract.GameType(&_FaultDisputeGame.CallOpts) +} + +// GameType is a free data retrieval call binding the contract method 0xbbdc02db. +// +// Solidity: function gameType() view returns(uint32 gameType_) +func (_FaultDisputeGame *FaultDisputeGameCallerSession) GameType() (uint32, error) { + return _FaultDisputeGame.Contract.GameType(&_FaultDisputeGame.CallOpts) +} + +// GetChallengerDuration is a free data retrieval call binding the contract method 0xbd8da956. +// +// Solidity: function getChallengerDuration(uint256 _claimIndex) view returns(uint64 duration_) +func (_FaultDisputeGame *FaultDisputeGameCaller) GetChallengerDuration(opts *bind.CallOpts, _claimIndex *big.Int) (uint64, error) { + var out []interface{} + err := _FaultDisputeGame.contract.Call(opts, &out, "getChallengerDuration", _claimIndex) + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// GetChallengerDuration is a free data retrieval call binding the contract method 0xbd8da956. +// +// Solidity: function getChallengerDuration(uint256 _claimIndex) view returns(uint64 duration_) +func (_FaultDisputeGame *FaultDisputeGameSession) GetChallengerDuration(_claimIndex *big.Int) (uint64, error) { + return _FaultDisputeGame.Contract.GetChallengerDuration(&_FaultDisputeGame.CallOpts, _claimIndex) +} + +// GetChallengerDuration is a free data retrieval call binding the contract method 0xbd8da956. +// +// Solidity: function getChallengerDuration(uint256 _claimIndex) view returns(uint64 duration_) +func (_FaultDisputeGame *FaultDisputeGameCallerSession) GetChallengerDuration(_claimIndex *big.Int) (uint64, error) { + return _FaultDisputeGame.Contract.GetChallengerDuration(&_FaultDisputeGame.CallOpts, _claimIndex) +} + +// GetNumToResolve is a free data retrieval call binding the contract method 0x5a5fa2d9. +// +// Solidity: function getNumToResolve(uint256 _claimIndex) view returns(uint256 numRemainingChildren_) +func (_FaultDisputeGame *FaultDisputeGameCaller) GetNumToResolve(opts *bind.CallOpts, _claimIndex *big.Int) (*big.Int, error) { + var out []interface{} + err := _FaultDisputeGame.contract.Call(opts, &out, "getNumToResolve", _claimIndex) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetNumToResolve is a free data retrieval call binding the contract method 0x5a5fa2d9. +// +// Solidity: function getNumToResolve(uint256 _claimIndex) view returns(uint256 numRemainingChildren_) +func (_FaultDisputeGame *FaultDisputeGameSession) GetNumToResolve(_claimIndex *big.Int) (*big.Int, error) { + return _FaultDisputeGame.Contract.GetNumToResolve(&_FaultDisputeGame.CallOpts, _claimIndex) +} + +// GetNumToResolve is a free data retrieval call binding the contract method 0x5a5fa2d9. +// +// Solidity: function getNumToResolve(uint256 _claimIndex) view returns(uint256 numRemainingChildren_) +func (_FaultDisputeGame *FaultDisputeGameCallerSession) GetNumToResolve(_claimIndex *big.Int) (*big.Int, error) { + return _FaultDisputeGame.Contract.GetNumToResolve(&_FaultDisputeGame.CallOpts, _claimIndex) +} + +// GetRequiredBond is a free data retrieval call binding the contract method 0xc395e1ca. +// +// Solidity: function getRequiredBond(uint128 _position) view returns(uint256 requiredBond_) +func (_FaultDisputeGame *FaultDisputeGameCaller) GetRequiredBond(opts *bind.CallOpts, _position *big.Int) (*big.Int, error) { + var out []interface{} + err := _FaultDisputeGame.contract.Call(opts, &out, "getRequiredBond", _position) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetRequiredBond is a free data retrieval call binding the contract method 0xc395e1ca. +// +// Solidity: function getRequiredBond(uint128 _position) view returns(uint256 requiredBond_) +func (_FaultDisputeGame *FaultDisputeGameSession) GetRequiredBond(_position *big.Int) (*big.Int, error) { + return _FaultDisputeGame.Contract.GetRequiredBond(&_FaultDisputeGame.CallOpts, _position) +} + +// GetRequiredBond is a free data retrieval call binding the contract method 0xc395e1ca. +// +// Solidity: function getRequiredBond(uint128 _position) view returns(uint256 requiredBond_) +func (_FaultDisputeGame *FaultDisputeGameCallerSession) GetRequiredBond(_position *big.Int) (*big.Int, error) { + return _FaultDisputeGame.Contract.GetRequiredBond(&_FaultDisputeGame.CallOpts, _position) +} + +// L1Head is a free data retrieval call binding the contract method 0x6361506d. +// +// Solidity: function l1Head() pure returns(bytes32 l1Head_) +func (_FaultDisputeGame *FaultDisputeGameCaller) L1Head(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _FaultDisputeGame.contract.Call(opts, &out, "l1Head") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// L1Head is a free data retrieval call binding the contract method 0x6361506d. +// +// Solidity: function l1Head() pure returns(bytes32 l1Head_) +func (_FaultDisputeGame *FaultDisputeGameSession) L1Head() ([32]byte, error) { + return _FaultDisputeGame.Contract.L1Head(&_FaultDisputeGame.CallOpts) +} + +// L1Head is a free data retrieval call binding the contract method 0x6361506d. +// +// Solidity: function l1Head() pure returns(bytes32 l1Head_) +func (_FaultDisputeGame *FaultDisputeGameCallerSession) L1Head() ([32]byte, error) { + return _FaultDisputeGame.Contract.L1Head(&_FaultDisputeGame.CallOpts) +} + +// L2BlockNumber is a free data retrieval call binding the contract method 0x8b85902b. +// +// Solidity: function l2BlockNumber() pure returns(uint256 l2BlockNumber_) +func (_FaultDisputeGame *FaultDisputeGameCaller) L2BlockNumber(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _FaultDisputeGame.contract.Call(opts, &out, "l2BlockNumber") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// L2BlockNumber is a free data retrieval call binding the contract method 0x8b85902b. +// +// Solidity: function l2BlockNumber() pure returns(uint256 l2BlockNumber_) +func (_FaultDisputeGame *FaultDisputeGameSession) L2BlockNumber() (*big.Int, error) { + return _FaultDisputeGame.Contract.L2BlockNumber(&_FaultDisputeGame.CallOpts) +} + +// L2BlockNumber is a free data retrieval call binding the contract method 0x8b85902b. +// +// Solidity: function l2BlockNumber() pure returns(uint256 l2BlockNumber_) +func (_FaultDisputeGame *FaultDisputeGameCallerSession) L2BlockNumber() (*big.Int, error) { + return _FaultDisputeGame.Contract.L2BlockNumber(&_FaultDisputeGame.CallOpts) +} + +// L2BlockNumberChallenged is a free data retrieval call binding the contract method 0x3e3ac912. +// +// Solidity: function l2BlockNumberChallenged() view returns(bool) +func (_FaultDisputeGame *FaultDisputeGameCaller) L2BlockNumberChallenged(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _FaultDisputeGame.contract.Call(opts, &out, "l2BlockNumberChallenged") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// L2BlockNumberChallenged is a free data retrieval call binding the contract method 0x3e3ac912. +// +// Solidity: function l2BlockNumberChallenged() view returns(bool) +func (_FaultDisputeGame *FaultDisputeGameSession) L2BlockNumberChallenged() (bool, error) { + return _FaultDisputeGame.Contract.L2BlockNumberChallenged(&_FaultDisputeGame.CallOpts) +} + +// L2BlockNumberChallenged is a free data retrieval call binding the contract method 0x3e3ac912. +// +// Solidity: function l2BlockNumberChallenged() view returns(bool) +func (_FaultDisputeGame *FaultDisputeGameCallerSession) L2BlockNumberChallenged() (bool, error) { + return _FaultDisputeGame.Contract.L2BlockNumberChallenged(&_FaultDisputeGame.CallOpts) +} + +// L2BlockNumberChallenger is a free data retrieval call binding the contract method 0x30dbe570. +// +// Solidity: function l2BlockNumberChallenger() view returns(address) +func (_FaultDisputeGame *FaultDisputeGameCaller) L2BlockNumberChallenger(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _FaultDisputeGame.contract.Call(opts, &out, "l2BlockNumberChallenger") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// L2BlockNumberChallenger is a free data retrieval call binding the contract method 0x30dbe570. +// +// Solidity: function l2BlockNumberChallenger() view returns(address) +func (_FaultDisputeGame *FaultDisputeGameSession) L2BlockNumberChallenger() (common.Address, error) { + return _FaultDisputeGame.Contract.L2BlockNumberChallenger(&_FaultDisputeGame.CallOpts) +} + +// L2BlockNumberChallenger is a free data retrieval call binding the contract method 0x30dbe570. +// +// Solidity: function l2BlockNumberChallenger() view returns(address) +func (_FaultDisputeGame *FaultDisputeGameCallerSession) L2BlockNumberChallenger() (common.Address, error) { + return _FaultDisputeGame.Contract.L2BlockNumberChallenger(&_FaultDisputeGame.CallOpts) +} + +// L2ChainId is a free data retrieval call binding the contract method 0xd6ae3cd5. +// +// Solidity: function l2ChainId() view returns(uint256 l2ChainId_) +func (_FaultDisputeGame *FaultDisputeGameCaller) L2ChainId(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _FaultDisputeGame.contract.Call(opts, &out, "l2ChainId") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// L2ChainId is a free data retrieval call binding the contract method 0xd6ae3cd5. +// +// Solidity: function l2ChainId() view returns(uint256 l2ChainId_) +func (_FaultDisputeGame *FaultDisputeGameSession) L2ChainId() (*big.Int, error) { + return _FaultDisputeGame.Contract.L2ChainId(&_FaultDisputeGame.CallOpts) +} + +// L2ChainId is a free data retrieval call binding the contract method 0xd6ae3cd5. +// +// Solidity: function l2ChainId() view returns(uint256 l2ChainId_) +func (_FaultDisputeGame *FaultDisputeGameCallerSession) L2ChainId() (*big.Int, error) { + return _FaultDisputeGame.Contract.L2ChainId(&_FaultDisputeGame.CallOpts) +} + +// MaxClockDuration is a free data retrieval call binding the contract method 0xdabd396d. +// +// Solidity: function maxClockDuration() view returns(uint64 maxClockDuration_) +func (_FaultDisputeGame *FaultDisputeGameCaller) MaxClockDuration(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _FaultDisputeGame.contract.Call(opts, &out, "maxClockDuration") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// MaxClockDuration is a free data retrieval call binding the contract method 0xdabd396d. +// +// Solidity: function maxClockDuration() view returns(uint64 maxClockDuration_) +func (_FaultDisputeGame *FaultDisputeGameSession) MaxClockDuration() (uint64, error) { + return _FaultDisputeGame.Contract.MaxClockDuration(&_FaultDisputeGame.CallOpts) +} + +// MaxClockDuration is a free data retrieval call binding the contract method 0xdabd396d. +// +// Solidity: function maxClockDuration() view returns(uint64 maxClockDuration_) +func (_FaultDisputeGame *FaultDisputeGameCallerSession) MaxClockDuration() (uint64, error) { + return _FaultDisputeGame.Contract.MaxClockDuration(&_FaultDisputeGame.CallOpts) +} + +// MaxGameDepth is a free data retrieval call binding the contract method 0xfa315aa9. +// +// Solidity: function maxGameDepth() view returns(uint256 maxGameDepth_) +func (_FaultDisputeGame *FaultDisputeGameCaller) MaxGameDepth(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _FaultDisputeGame.contract.Call(opts, &out, "maxGameDepth") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// MaxGameDepth is a free data retrieval call binding the contract method 0xfa315aa9. +// +// Solidity: function maxGameDepth() view returns(uint256 maxGameDepth_) +func (_FaultDisputeGame *FaultDisputeGameSession) MaxGameDepth() (*big.Int, error) { + return _FaultDisputeGame.Contract.MaxGameDepth(&_FaultDisputeGame.CallOpts) +} + +// MaxGameDepth is a free data retrieval call binding the contract method 0xfa315aa9. +// +// Solidity: function maxGameDepth() view returns(uint256 maxGameDepth_) +func (_FaultDisputeGame *FaultDisputeGameCallerSession) MaxGameDepth() (*big.Int, error) { + return _FaultDisputeGame.Contract.MaxGameDepth(&_FaultDisputeGame.CallOpts) +} + +// ResolutionCheckpoints is a free data retrieval call binding the contract method 0xa445ece6. +// +// Solidity: function resolutionCheckpoints(uint256 ) view returns(bool initialCheckpointComplete, uint32 subgameIndex, uint128 leftmostPosition, address counteredBy) +func (_FaultDisputeGame *FaultDisputeGameCaller) ResolutionCheckpoints(opts *bind.CallOpts, arg0 *big.Int) (struct { + InitialCheckpointComplete bool + SubgameIndex uint32 + LeftmostPosition *big.Int + CounteredBy common.Address +}, error) { + var out []interface{} + err := _FaultDisputeGame.contract.Call(opts, &out, "resolutionCheckpoints", arg0) + + outstruct := new(struct { + InitialCheckpointComplete bool + SubgameIndex uint32 + LeftmostPosition *big.Int + CounteredBy common.Address + }) + if err != nil { + return *outstruct, err + } + + outstruct.InitialCheckpointComplete = *abi.ConvertType(out[0], new(bool)).(*bool) + outstruct.SubgameIndex = *abi.ConvertType(out[1], new(uint32)).(*uint32) + outstruct.LeftmostPosition = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) + outstruct.CounteredBy = *abi.ConvertType(out[3], new(common.Address)).(*common.Address) + + return *outstruct, err + +} + +// ResolutionCheckpoints is a free data retrieval call binding the contract method 0xa445ece6. +// +// Solidity: function resolutionCheckpoints(uint256 ) view returns(bool initialCheckpointComplete, uint32 subgameIndex, uint128 leftmostPosition, address counteredBy) +func (_FaultDisputeGame *FaultDisputeGameSession) ResolutionCheckpoints(arg0 *big.Int) (struct { + InitialCheckpointComplete bool + SubgameIndex uint32 + LeftmostPosition *big.Int + CounteredBy common.Address +}, error) { + return _FaultDisputeGame.Contract.ResolutionCheckpoints(&_FaultDisputeGame.CallOpts, arg0) +} + +// ResolutionCheckpoints is a free data retrieval call binding the contract method 0xa445ece6. +// +// Solidity: function resolutionCheckpoints(uint256 ) view returns(bool initialCheckpointComplete, uint32 subgameIndex, uint128 leftmostPosition, address counteredBy) +func (_FaultDisputeGame *FaultDisputeGameCallerSession) ResolutionCheckpoints(arg0 *big.Int) (struct { + InitialCheckpointComplete bool + SubgameIndex uint32 + LeftmostPosition *big.Int + CounteredBy common.Address +}, error) { + return _FaultDisputeGame.Contract.ResolutionCheckpoints(&_FaultDisputeGame.CallOpts, arg0) +} + +// ResolvedAt is a free data retrieval call binding the contract method 0x19effeb4. +// +// Solidity: function resolvedAt() view returns(uint64) +func (_FaultDisputeGame *FaultDisputeGameCaller) ResolvedAt(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _FaultDisputeGame.contract.Call(opts, &out, "resolvedAt") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// ResolvedAt is a free data retrieval call binding the contract method 0x19effeb4. +// +// Solidity: function resolvedAt() view returns(uint64) +func (_FaultDisputeGame *FaultDisputeGameSession) ResolvedAt() (uint64, error) { + return _FaultDisputeGame.Contract.ResolvedAt(&_FaultDisputeGame.CallOpts) +} + +// ResolvedAt is a free data retrieval call binding the contract method 0x19effeb4. +// +// Solidity: function resolvedAt() view returns(uint64) +func (_FaultDisputeGame *FaultDisputeGameCallerSession) ResolvedAt() (uint64, error) { + return _FaultDisputeGame.Contract.ResolvedAt(&_FaultDisputeGame.CallOpts) +} + +// ResolvedSubgames is a free data retrieval call binding the contract method 0xfe2bbeb2. +// +// Solidity: function resolvedSubgames(uint256 ) view returns(bool) +func (_FaultDisputeGame *FaultDisputeGameCaller) ResolvedSubgames(opts *bind.CallOpts, arg0 *big.Int) (bool, error) { + var out []interface{} + err := _FaultDisputeGame.contract.Call(opts, &out, "resolvedSubgames", arg0) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// ResolvedSubgames is a free data retrieval call binding the contract method 0xfe2bbeb2. +// +// Solidity: function resolvedSubgames(uint256 ) view returns(bool) +func (_FaultDisputeGame *FaultDisputeGameSession) ResolvedSubgames(arg0 *big.Int) (bool, error) { + return _FaultDisputeGame.Contract.ResolvedSubgames(&_FaultDisputeGame.CallOpts, arg0) +} + +// ResolvedSubgames is a free data retrieval call binding the contract method 0xfe2bbeb2. +// +// Solidity: function resolvedSubgames(uint256 ) view returns(bool) +func (_FaultDisputeGame *FaultDisputeGameCallerSession) ResolvedSubgames(arg0 *big.Int) (bool, error) { + return _FaultDisputeGame.Contract.ResolvedSubgames(&_FaultDisputeGame.CallOpts, arg0) +} + +// RootClaim is a free data retrieval call binding the contract method 0xbcef3b55. +// +// Solidity: function rootClaim() pure returns(bytes32 rootClaim_) +func (_FaultDisputeGame *FaultDisputeGameCaller) RootClaim(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _FaultDisputeGame.contract.Call(opts, &out, "rootClaim") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// RootClaim is a free data retrieval call binding the contract method 0xbcef3b55. +// +// Solidity: function rootClaim() pure returns(bytes32 rootClaim_) +func (_FaultDisputeGame *FaultDisputeGameSession) RootClaim() ([32]byte, error) { + return _FaultDisputeGame.Contract.RootClaim(&_FaultDisputeGame.CallOpts) +} + +// RootClaim is a free data retrieval call binding the contract method 0xbcef3b55. +// +// Solidity: function rootClaim() pure returns(bytes32 rootClaim_) +func (_FaultDisputeGame *FaultDisputeGameCallerSession) RootClaim() ([32]byte, error) { + return _FaultDisputeGame.Contract.RootClaim(&_FaultDisputeGame.CallOpts) +} + +// SplitDepth is a free data retrieval call binding the contract method 0xec5e6308. +// +// Solidity: function splitDepth() view returns(uint256 splitDepth_) +func (_FaultDisputeGame *FaultDisputeGameCaller) SplitDepth(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _FaultDisputeGame.contract.Call(opts, &out, "splitDepth") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// SplitDepth is a free data retrieval call binding the contract method 0xec5e6308. +// +// Solidity: function splitDepth() view returns(uint256 splitDepth_) +func (_FaultDisputeGame *FaultDisputeGameSession) SplitDepth() (*big.Int, error) { + return _FaultDisputeGame.Contract.SplitDepth(&_FaultDisputeGame.CallOpts) +} + +// SplitDepth is a free data retrieval call binding the contract method 0xec5e6308. +// +// Solidity: function splitDepth() view returns(uint256 splitDepth_) +func (_FaultDisputeGame *FaultDisputeGameCallerSession) SplitDepth() (*big.Int, error) { + return _FaultDisputeGame.Contract.SplitDepth(&_FaultDisputeGame.CallOpts) +} + +// StartingBlockNumber is a free data retrieval call binding the contract method 0x70872aa5. +// +// Solidity: function startingBlockNumber() view returns(uint256 startingBlockNumber_) +func (_FaultDisputeGame *FaultDisputeGameCaller) StartingBlockNumber(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _FaultDisputeGame.contract.Call(opts, &out, "startingBlockNumber") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// StartingBlockNumber is a free data retrieval call binding the contract method 0x70872aa5. +// +// Solidity: function startingBlockNumber() view returns(uint256 startingBlockNumber_) +func (_FaultDisputeGame *FaultDisputeGameSession) StartingBlockNumber() (*big.Int, error) { + return _FaultDisputeGame.Contract.StartingBlockNumber(&_FaultDisputeGame.CallOpts) +} + +// StartingBlockNumber is a free data retrieval call binding the contract method 0x70872aa5. +// +// Solidity: function startingBlockNumber() view returns(uint256 startingBlockNumber_) +func (_FaultDisputeGame *FaultDisputeGameCallerSession) StartingBlockNumber() (*big.Int, error) { + return _FaultDisputeGame.Contract.StartingBlockNumber(&_FaultDisputeGame.CallOpts) +} + +// StartingOutputRoot is a free data retrieval call binding the contract method 0x57da950e. +// +// Solidity: function startingOutputRoot() view returns(bytes32 root, uint256 l2BlockNumber) +func (_FaultDisputeGame *FaultDisputeGameCaller) StartingOutputRoot(opts *bind.CallOpts) (struct { + Root [32]byte + L2BlockNumber *big.Int +}, error) { + var out []interface{} + err := _FaultDisputeGame.contract.Call(opts, &out, "startingOutputRoot") + + outstruct := new(struct { + Root [32]byte + L2BlockNumber *big.Int + }) + if err != nil { + return *outstruct, err + } + + outstruct.Root = *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + outstruct.L2BlockNumber = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + + return *outstruct, err + +} + +// StartingOutputRoot is a free data retrieval call binding the contract method 0x57da950e. +// +// Solidity: function startingOutputRoot() view returns(bytes32 root, uint256 l2BlockNumber) +func (_FaultDisputeGame *FaultDisputeGameSession) StartingOutputRoot() (struct { + Root [32]byte + L2BlockNumber *big.Int +}, error) { + return _FaultDisputeGame.Contract.StartingOutputRoot(&_FaultDisputeGame.CallOpts) +} + +// StartingOutputRoot is a free data retrieval call binding the contract method 0x57da950e. +// +// Solidity: function startingOutputRoot() view returns(bytes32 root, uint256 l2BlockNumber) +func (_FaultDisputeGame *FaultDisputeGameCallerSession) StartingOutputRoot() (struct { + Root [32]byte + L2BlockNumber *big.Int +}, error) { + return _FaultDisputeGame.Contract.StartingOutputRoot(&_FaultDisputeGame.CallOpts) +} + +// StartingRootHash is a free data retrieval call binding the contract method 0x25fc2ace. +// +// Solidity: function startingRootHash() view returns(bytes32 startingRootHash_) +func (_FaultDisputeGame *FaultDisputeGameCaller) StartingRootHash(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _FaultDisputeGame.contract.Call(opts, &out, "startingRootHash") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// StartingRootHash is a free data retrieval call binding the contract method 0x25fc2ace. +// +// Solidity: function startingRootHash() view returns(bytes32 startingRootHash_) +func (_FaultDisputeGame *FaultDisputeGameSession) StartingRootHash() ([32]byte, error) { + return _FaultDisputeGame.Contract.StartingRootHash(&_FaultDisputeGame.CallOpts) +} + +// StartingRootHash is a free data retrieval call binding the contract method 0x25fc2ace. +// +// Solidity: function startingRootHash() view returns(bytes32 startingRootHash_) +func (_FaultDisputeGame *FaultDisputeGameCallerSession) StartingRootHash() ([32]byte, error) { + return _FaultDisputeGame.Contract.StartingRootHash(&_FaultDisputeGame.CallOpts) +} + +// Status is a free data retrieval call binding the contract method 0x200d2ed2. +// +// Solidity: function status() view returns(uint8) +func (_FaultDisputeGame *FaultDisputeGameCaller) Status(opts *bind.CallOpts) (uint8, error) { + var out []interface{} + err := _FaultDisputeGame.contract.Call(opts, &out, "status") + + if err != nil { + return *new(uint8), err + } + + out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) + + return out0, err + +} + +// Status is a free data retrieval call binding the contract method 0x200d2ed2. +// +// Solidity: function status() view returns(uint8) +func (_FaultDisputeGame *FaultDisputeGameSession) Status() (uint8, error) { + return _FaultDisputeGame.Contract.Status(&_FaultDisputeGame.CallOpts) +} + +// Status is a free data retrieval call binding the contract method 0x200d2ed2. +// +// Solidity: function status() view returns(uint8) +func (_FaultDisputeGame *FaultDisputeGameCallerSession) Status() (uint8, error) { + return _FaultDisputeGame.Contract.Status(&_FaultDisputeGame.CallOpts) +} + +// Subgames is a free data retrieval call binding the contract method 0x2ad69aeb. +// +// Solidity: function subgames(uint256 , uint256 ) view returns(uint256) +func (_FaultDisputeGame *FaultDisputeGameCaller) Subgames(opts *bind.CallOpts, arg0 *big.Int, arg1 *big.Int) (*big.Int, error) { + var out []interface{} + err := _FaultDisputeGame.contract.Call(opts, &out, "subgames", arg0, arg1) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Subgames is a free data retrieval call binding the contract method 0x2ad69aeb. +// +// Solidity: function subgames(uint256 , uint256 ) view returns(uint256) +func (_FaultDisputeGame *FaultDisputeGameSession) Subgames(arg0 *big.Int, arg1 *big.Int) (*big.Int, error) { + return _FaultDisputeGame.Contract.Subgames(&_FaultDisputeGame.CallOpts, arg0, arg1) +} + +// Subgames is a free data retrieval call binding the contract method 0x2ad69aeb. +// +// Solidity: function subgames(uint256 , uint256 ) view returns(uint256) +func (_FaultDisputeGame *FaultDisputeGameCallerSession) Subgames(arg0 *big.Int, arg1 *big.Int) (*big.Int, error) { + return _FaultDisputeGame.Contract.Subgames(&_FaultDisputeGame.CallOpts, arg0, arg1) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_FaultDisputeGame *FaultDisputeGameCaller) Version(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _FaultDisputeGame.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 (_FaultDisputeGame *FaultDisputeGameSession) Version() (string, error) { + return _FaultDisputeGame.Contract.Version(&_FaultDisputeGame.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_FaultDisputeGame *FaultDisputeGameCallerSession) Version() (string, error) { + return _FaultDisputeGame.Contract.Version(&_FaultDisputeGame.CallOpts) +} + +// Vm is a free data retrieval call binding the contract method 0x3a768463. +// +// Solidity: function vm() view returns(address vm_) +func (_FaultDisputeGame *FaultDisputeGameCaller) Vm(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _FaultDisputeGame.contract.Call(opts, &out, "vm") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Vm is a free data retrieval call binding the contract method 0x3a768463. +// +// Solidity: function vm() view returns(address vm_) +func (_FaultDisputeGame *FaultDisputeGameSession) Vm() (common.Address, error) { + return _FaultDisputeGame.Contract.Vm(&_FaultDisputeGame.CallOpts) +} + +// Vm is a free data retrieval call binding the contract method 0x3a768463. +// +// Solidity: function vm() view returns(address vm_) +func (_FaultDisputeGame *FaultDisputeGameCallerSession) Vm() (common.Address, error) { + return _FaultDisputeGame.Contract.Vm(&_FaultDisputeGame.CallOpts) +} + +// Weth is a free data retrieval call binding the contract method 0x3fc8cef3. +// +// Solidity: function weth() view returns(address weth_) +func (_FaultDisputeGame *FaultDisputeGameCaller) Weth(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _FaultDisputeGame.contract.Call(opts, &out, "weth") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Weth is a free data retrieval call binding the contract method 0x3fc8cef3. +// +// Solidity: function weth() view returns(address weth_) +func (_FaultDisputeGame *FaultDisputeGameSession) Weth() (common.Address, error) { + return _FaultDisputeGame.Contract.Weth(&_FaultDisputeGame.CallOpts) +} + +// Weth is a free data retrieval call binding the contract method 0x3fc8cef3. +// +// Solidity: function weth() view returns(address weth_) +func (_FaultDisputeGame *FaultDisputeGameCallerSession) Weth() (common.Address, error) { + return _FaultDisputeGame.Contract.Weth(&_FaultDisputeGame.CallOpts) +} + +// AddLocalData is a paid mutator transaction binding the contract method 0xf8f43ff6. +// +// Solidity: function addLocalData(uint256 _ident, uint256 _execLeafIdx, uint256 _partOffset) returns() +func (_FaultDisputeGame *FaultDisputeGameTransactor) AddLocalData(opts *bind.TransactOpts, _ident *big.Int, _execLeafIdx *big.Int, _partOffset *big.Int) (*types.Transaction, error) { + return _FaultDisputeGame.contract.Transact(opts, "addLocalData", _ident, _execLeafIdx, _partOffset) +} + +// AddLocalData is a paid mutator transaction binding the contract method 0xf8f43ff6. +// +// Solidity: function addLocalData(uint256 _ident, uint256 _execLeafIdx, uint256 _partOffset) returns() +func (_FaultDisputeGame *FaultDisputeGameSession) AddLocalData(_ident *big.Int, _execLeafIdx *big.Int, _partOffset *big.Int) (*types.Transaction, error) { + return _FaultDisputeGame.Contract.AddLocalData(&_FaultDisputeGame.TransactOpts, _ident, _execLeafIdx, _partOffset) +} + +// AddLocalData is a paid mutator transaction binding the contract method 0xf8f43ff6. +// +// Solidity: function addLocalData(uint256 _ident, uint256 _execLeafIdx, uint256 _partOffset) returns() +func (_FaultDisputeGame *FaultDisputeGameTransactorSession) AddLocalData(_ident *big.Int, _execLeafIdx *big.Int, _partOffset *big.Int) (*types.Transaction, error) { + return _FaultDisputeGame.Contract.AddLocalData(&_FaultDisputeGame.TransactOpts, _ident, _execLeafIdx, _partOffset) +} + +// Attack is a paid mutator transaction binding the contract method 0x472777c6. +// +// Solidity: function attack(bytes32 _disputed, uint256 _parentIndex, bytes32 _claim) payable returns() +func (_FaultDisputeGame *FaultDisputeGameTransactor) Attack(opts *bind.TransactOpts, _disputed [32]byte, _parentIndex *big.Int, _claim [32]byte) (*types.Transaction, error) { + return _FaultDisputeGame.contract.Transact(opts, "attack", _disputed, _parentIndex, _claim) +} + +// Attack is a paid mutator transaction binding the contract method 0x472777c6. +// +// Solidity: function attack(bytes32 _disputed, uint256 _parentIndex, bytes32 _claim) payable returns() +func (_FaultDisputeGame *FaultDisputeGameSession) Attack(_disputed [32]byte, _parentIndex *big.Int, _claim [32]byte) (*types.Transaction, error) { + return _FaultDisputeGame.Contract.Attack(&_FaultDisputeGame.TransactOpts, _disputed, _parentIndex, _claim) +} + +// Attack is a paid mutator transaction binding the contract method 0x472777c6. +// +// Solidity: function attack(bytes32 _disputed, uint256 _parentIndex, bytes32 _claim) payable returns() +func (_FaultDisputeGame *FaultDisputeGameTransactorSession) Attack(_disputed [32]byte, _parentIndex *big.Int, _claim [32]byte) (*types.Transaction, error) { + return _FaultDisputeGame.Contract.Attack(&_FaultDisputeGame.TransactOpts, _disputed, _parentIndex, _claim) +} + +// ChallengeRootL2Block is a paid mutator transaction binding the contract method 0x01935130. +// +// Solidity: function challengeRootL2Block((bytes32,bytes32,bytes32,bytes32) _outputRootProof, bytes _headerRLP) returns() +func (_FaultDisputeGame *FaultDisputeGameTransactor) ChallengeRootL2Block(opts *bind.TransactOpts, _outputRootProof TypesOutputRootProof, _headerRLP []byte) (*types.Transaction, error) { + return _FaultDisputeGame.contract.Transact(opts, "challengeRootL2Block", _outputRootProof, _headerRLP) +} + +// ChallengeRootL2Block is a paid mutator transaction binding the contract method 0x01935130. +// +// Solidity: function challengeRootL2Block((bytes32,bytes32,bytes32,bytes32) _outputRootProof, bytes _headerRLP) returns() +func (_FaultDisputeGame *FaultDisputeGameSession) ChallengeRootL2Block(_outputRootProof TypesOutputRootProof, _headerRLP []byte) (*types.Transaction, error) { + return _FaultDisputeGame.Contract.ChallengeRootL2Block(&_FaultDisputeGame.TransactOpts, _outputRootProof, _headerRLP) +} + +// ChallengeRootL2Block is a paid mutator transaction binding the contract method 0x01935130. +// +// Solidity: function challengeRootL2Block((bytes32,bytes32,bytes32,bytes32) _outputRootProof, bytes _headerRLP) returns() +func (_FaultDisputeGame *FaultDisputeGameTransactorSession) ChallengeRootL2Block(_outputRootProof TypesOutputRootProof, _headerRLP []byte) (*types.Transaction, error) { + return _FaultDisputeGame.Contract.ChallengeRootL2Block(&_FaultDisputeGame.TransactOpts, _outputRootProof, _headerRLP) +} + +// ClaimCredit is a paid mutator transaction binding the contract method 0x60e27464. +// +// Solidity: function claimCredit(address _recipient) returns() +func (_FaultDisputeGame *FaultDisputeGameTransactor) ClaimCredit(opts *bind.TransactOpts, _recipient common.Address) (*types.Transaction, error) { + return _FaultDisputeGame.contract.Transact(opts, "claimCredit", _recipient) +} + +// ClaimCredit is a paid mutator transaction binding the contract method 0x60e27464. +// +// Solidity: function claimCredit(address _recipient) returns() +func (_FaultDisputeGame *FaultDisputeGameSession) ClaimCredit(_recipient common.Address) (*types.Transaction, error) { + return _FaultDisputeGame.Contract.ClaimCredit(&_FaultDisputeGame.TransactOpts, _recipient) +} + +// ClaimCredit is a paid mutator transaction binding the contract method 0x60e27464. +// +// Solidity: function claimCredit(address _recipient) returns() +func (_FaultDisputeGame *FaultDisputeGameTransactorSession) ClaimCredit(_recipient common.Address) (*types.Transaction, error) { + return _FaultDisputeGame.Contract.ClaimCredit(&_FaultDisputeGame.TransactOpts, _recipient) +} + +// Defend is a paid mutator transaction binding the contract method 0x7b0f0adc. +// +// Solidity: function defend(bytes32 _disputed, uint256 _parentIndex, bytes32 _claim) payable returns() +func (_FaultDisputeGame *FaultDisputeGameTransactor) Defend(opts *bind.TransactOpts, _disputed [32]byte, _parentIndex *big.Int, _claim [32]byte) (*types.Transaction, error) { + return _FaultDisputeGame.contract.Transact(opts, "defend", _disputed, _parentIndex, _claim) +} + +// Defend is a paid mutator transaction binding the contract method 0x7b0f0adc. +// +// Solidity: function defend(bytes32 _disputed, uint256 _parentIndex, bytes32 _claim) payable returns() +func (_FaultDisputeGame *FaultDisputeGameSession) Defend(_disputed [32]byte, _parentIndex *big.Int, _claim [32]byte) (*types.Transaction, error) { + return _FaultDisputeGame.Contract.Defend(&_FaultDisputeGame.TransactOpts, _disputed, _parentIndex, _claim) +} + +// Defend is a paid mutator transaction binding the contract method 0x7b0f0adc. +// +// Solidity: function defend(bytes32 _disputed, uint256 _parentIndex, bytes32 _claim) payable returns() +func (_FaultDisputeGame *FaultDisputeGameTransactorSession) Defend(_disputed [32]byte, _parentIndex *big.Int, _claim [32]byte) (*types.Transaction, error) { + return _FaultDisputeGame.Contract.Defend(&_FaultDisputeGame.TransactOpts, _disputed, _parentIndex, _claim) +} + +// Initialize is a paid mutator transaction binding the contract method 0x8129fc1c. +// +// Solidity: function initialize() payable returns() +func (_FaultDisputeGame *FaultDisputeGameTransactor) Initialize(opts *bind.TransactOpts) (*types.Transaction, error) { + return _FaultDisputeGame.contract.Transact(opts, "initialize") +} + +// Initialize is a paid mutator transaction binding the contract method 0x8129fc1c. +// +// Solidity: function initialize() payable returns() +func (_FaultDisputeGame *FaultDisputeGameSession) Initialize() (*types.Transaction, error) { + return _FaultDisputeGame.Contract.Initialize(&_FaultDisputeGame.TransactOpts) +} + +// Initialize is a paid mutator transaction binding the contract method 0x8129fc1c. +// +// Solidity: function initialize() payable returns() +func (_FaultDisputeGame *FaultDisputeGameTransactorSession) Initialize() (*types.Transaction, error) { + return _FaultDisputeGame.Contract.Initialize(&_FaultDisputeGame.TransactOpts) +} + +// Move is a paid mutator transaction binding the contract method 0x6f034409. +// +// Solidity: function move(bytes32 _disputed, uint256 _challengeIndex, bytes32 _claim, bool _isAttack) payable returns() +func (_FaultDisputeGame *FaultDisputeGameTransactor) Move(opts *bind.TransactOpts, _disputed [32]byte, _challengeIndex *big.Int, _claim [32]byte, _isAttack bool) (*types.Transaction, error) { + return _FaultDisputeGame.contract.Transact(opts, "move", _disputed, _challengeIndex, _claim, _isAttack) +} + +// Move is a paid mutator transaction binding the contract method 0x6f034409. +// +// Solidity: function move(bytes32 _disputed, uint256 _challengeIndex, bytes32 _claim, bool _isAttack) payable returns() +func (_FaultDisputeGame *FaultDisputeGameSession) Move(_disputed [32]byte, _challengeIndex *big.Int, _claim [32]byte, _isAttack bool) (*types.Transaction, error) { + return _FaultDisputeGame.Contract.Move(&_FaultDisputeGame.TransactOpts, _disputed, _challengeIndex, _claim, _isAttack) +} + +// Move is a paid mutator transaction binding the contract method 0x6f034409. +// +// Solidity: function move(bytes32 _disputed, uint256 _challengeIndex, bytes32 _claim, bool _isAttack) payable returns() +func (_FaultDisputeGame *FaultDisputeGameTransactorSession) Move(_disputed [32]byte, _challengeIndex *big.Int, _claim [32]byte, _isAttack bool) (*types.Transaction, error) { + return _FaultDisputeGame.Contract.Move(&_FaultDisputeGame.TransactOpts, _disputed, _challengeIndex, _claim, _isAttack) +} + +// Resolve is a paid mutator transaction binding the contract method 0x2810e1d6. +// +// Solidity: function resolve() returns(uint8 status_) +func (_FaultDisputeGame *FaultDisputeGameTransactor) Resolve(opts *bind.TransactOpts) (*types.Transaction, error) { + return _FaultDisputeGame.contract.Transact(opts, "resolve") +} + +// Resolve is a paid mutator transaction binding the contract method 0x2810e1d6. +// +// Solidity: function resolve() returns(uint8 status_) +func (_FaultDisputeGame *FaultDisputeGameSession) Resolve() (*types.Transaction, error) { + return _FaultDisputeGame.Contract.Resolve(&_FaultDisputeGame.TransactOpts) +} + +// Resolve is a paid mutator transaction binding the contract method 0x2810e1d6. +// +// Solidity: function resolve() returns(uint8 status_) +func (_FaultDisputeGame *FaultDisputeGameTransactorSession) Resolve() (*types.Transaction, error) { + return _FaultDisputeGame.Contract.Resolve(&_FaultDisputeGame.TransactOpts) +} + +// ResolveClaim is a paid mutator transaction binding the contract method 0x03c2924d. +// +// Solidity: function resolveClaim(uint256 _claimIndex, uint256 _numToResolve) returns() +func (_FaultDisputeGame *FaultDisputeGameTransactor) ResolveClaim(opts *bind.TransactOpts, _claimIndex *big.Int, _numToResolve *big.Int) (*types.Transaction, error) { + return _FaultDisputeGame.contract.Transact(opts, "resolveClaim", _claimIndex, _numToResolve) +} + +// ResolveClaim is a paid mutator transaction binding the contract method 0x03c2924d. +// +// Solidity: function resolveClaim(uint256 _claimIndex, uint256 _numToResolve) returns() +func (_FaultDisputeGame *FaultDisputeGameSession) ResolveClaim(_claimIndex *big.Int, _numToResolve *big.Int) (*types.Transaction, error) { + return _FaultDisputeGame.Contract.ResolveClaim(&_FaultDisputeGame.TransactOpts, _claimIndex, _numToResolve) +} + +// ResolveClaim is a paid mutator transaction binding the contract method 0x03c2924d. +// +// Solidity: function resolveClaim(uint256 _claimIndex, uint256 _numToResolve) returns() +func (_FaultDisputeGame *FaultDisputeGameTransactorSession) ResolveClaim(_claimIndex *big.Int, _numToResolve *big.Int) (*types.Transaction, error) { + return _FaultDisputeGame.Contract.ResolveClaim(&_FaultDisputeGame.TransactOpts, _claimIndex, _numToResolve) +} + +// Step is a paid mutator transaction binding the contract method 0xd8cc1a3c. +// +// Solidity: function step(uint256 _claimIndex, bool _isAttack, bytes _stateData, bytes _proof) returns() +func (_FaultDisputeGame *FaultDisputeGameTransactor) Step(opts *bind.TransactOpts, _claimIndex *big.Int, _isAttack bool, _stateData []byte, _proof []byte) (*types.Transaction, error) { + return _FaultDisputeGame.contract.Transact(opts, "step", _claimIndex, _isAttack, _stateData, _proof) +} + +// Step is a paid mutator transaction binding the contract method 0xd8cc1a3c. +// +// Solidity: function step(uint256 _claimIndex, bool _isAttack, bytes _stateData, bytes _proof) returns() +func (_FaultDisputeGame *FaultDisputeGameSession) Step(_claimIndex *big.Int, _isAttack bool, _stateData []byte, _proof []byte) (*types.Transaction, error) { + return _FaultDisputeGame.Contract.Step(&_FaultDisputeGame.TransactOpts, _claimIndex, _isAttack, _stateData, _proof) +} + +// Step is a paid mutator transaction binding the contract method 0xd8cc1a3c. +// +// Solidity: function step(uint256 _claimIndex, bool _isAttack, bytes _stateData, bytes _proof) returns() +func (_FaultDisputeGame *FaultDisputeGameTransactorSession) Step(_claimIndex *big.Int, _isAttack bool, _stateData []byte, _proof []byte) (*types.Transaction, error) { + return _FaultDisputeGame.Contract.Step(&_FaultDisputeGame.TransactOpts, _claimIndex, _isAttack, _stateData, _proof) +} + +// FaultDisputeGameMoveIterator is returned from FilterMove and is used to iterate over the raw logs and unpacked data for Move events raised by the FaultDisputeGame contract. +type FaultDisputeGameMoveIterator struct { + Event *FaultDisputeGameMove // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *FaultDisputeGameMoveIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(FaultDisputeGameMove) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(FaultDisputeGameMove) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *FaultDisputeGameMoveIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *FaultDisputeGameMoveIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// FaultDisputeGameMove represents a Move event raised by the FaultDisputeGame contract. +type FaultDisputeGameMove struct { + ParentIndex *big.Int + Claim [32]byte + Claimant common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterMove is a free log retrieval operation binding the contract event 0x9b3245740ec3b155098a55be84957a4da13eaf7f14a8bc6f53126c0b9350f2be. +// +// Solidity: event Move(uint256 indexed parentIndex, bytes32 indexed claim, address indexed claimant) +func (_FaultDisputeGame *FaultDisputeGameFilterer) FilterMove(opts *bind.FilterOpts, parentIndex []*big.Int, claim [][32]byte, claimant []common.Address) (*FaultDisputeGameMoveIterator, error) { + + var parentIndexRule []interface{} + for _, parentIndexItem := range parentIndex { + parentIndexRule = append(parentIndexRule, parentIndexItem) + } + var claimRule []interface{} + for _, claimItem := range claim { + claimRule = append(claimRule, claimItem) + } + var claimantRule []interface{} + for _, claimantItem := range claimant { + claimantRule = append(claimantRule, claimantItem) + } + + logs, sub, err := _FaultDisputeGame.contract.FilterLogs(opts, "Move", parentIndexRule, claimRule, claimantRule) + if err != nil { + return nil, err + } + return &FaultDisputeGameMoveIterator{contract: _FaultDisputeGame.contract, event: "Move", logs: logs, sub: sub}, nil +} + +// WatchMove is a free log subscription operation binding the contract event 0x9b3245740ec3b155098a55be84957a4da13eaf7f14a8bc6f53126c0b9350f2be. +// +// Solidity: event Move(uint256 indexed parentIndex, bytes32 indexed claim, address indexed claimant) +func (_FaultDisputeGame *FaultDisputeGameFilterer) WatchMove(opts *bind.WatchOpts, sink chan<- *FaultDisputeGameMove, parentIndex []*big.Int, claim [][32]byte, claimant []common.Address) (event.Subscription, error) { + + var parentIndexRule []interface{} + for _, parentIndexItem := range parentIndex { + parentIndexRule = append(parentIndexRule, parentIndexItem) + } + var claimRule []interface{} + for _, claimItem := range claim { + claimRule = append(claimRule, claimItem) + } + var claimantRule []interface{} + for _, claimantItem := range claimant { + claimantRule = append(claimantRule, claimantItem) + } + + logs, sub, err := _FaultDisputeGame.contract.WatchLogs(opts, "Move", parentIndexRule, claimRule, claimantRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(FaultDisputeGameMove) + if err := _FaultDisputeGame.contract.UnpackLog(event, "Move", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseMove is a log parse operation binding the contract event 0x9b3245740ec3b155098a55be84957a4da13eaf7f14a8bc6f53126c0b9350f2be. +// +// Solidity: event Move(uint256 indexed parentIndex, bytes32 indexed claim, address indexed claimant) +func (_FaultDisputeGame *FaultDisputeGameFilterer) ParseMove(log types.Log) (*FaultDisputeGameMove, error) { + event := new(FaultDisputeGameMove) + if err := _FaultDisputeGame.contract.UnpackLog(event, "Move", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// FaultDisputeGameResolvedIterator is returned from FilterResolved and is used to iterate over the raw logs and unpacked data for Resolved events raised by the FaultDisputeGame contract. +type FaultDisputeGameResolvedIterator struct { + Event *FaultDisputeGameResolved // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *FaultDisputeGameResolvedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(FaultDisputeGameResolved) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(FaultDisputeGameResolved) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *FaultDisputeGameResolvedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *FaultDisputeGameResolvedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// FaultDisputeGameResolved represents a Resolved event raised by the FaultDisputeGame contract. +type FaultDisputeGameResolved struct { + Status uint8 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterResolved is a free log retrieval operation binding the contract event 0x5e186f09b9c93491f14e277eea7faa5de6a2d4bda75a79af7a3684fbfb42da60. +// +// Solidity: event Resolved(uint8 indexed status) +func (_FaultDisputeGame *FaultDisputeGameFilterer) FilterResolved(opts *bind.FilterOpts, status []uint8) (*FaultDisputeGameResolvedIterator, error) { + + var statusRule []interface{} + for _, statusItem := range status { + statusRule = append(statusRule, statusItem) + } + + logs, sub, err := _FaultDisputeGame.contract.FilterLogs(opts, "Resolved", statusRule) + if err != nil { + return nil, err + } + return &FaultDisputeGameResolvedIterator{contract: _FaultDisputeGame.contract, event: "Resolved", logs: logs, sub: sub}, nil +} + +// WatchResolved is a free log subscription operation binding the contract event 0x5e186f09b9c93491f14e277eea7faa5de6a2d4bda75a79af7a3684fbfb42da60. +// +// Solidity: event Resolved(uint8 indexed status) +func (_FaultDisputeGame *FaultDisputeGameFilterer) WatchResolved(opts *bind.WatchOpts, sink chan<- *FaultDisputeGameResolved, status []uint8) (event.Subscription, error) { + + var statusRule []interface{} + for _, statusItem := range status { + statusRule = append(statusRule, statusItem) + } + + logs, sub, err := _FaultDisputeGame.contract.WatchLogs(opts, "Resolved", statusRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(FaultDisputeGameResolved) + if err := _FaultDisputeGame.contract.UnpackLog(event, "Resolved", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseResolved is a log parse operation binding the contract event 0x5e186f09b9c93491f14e277eea7faa5de6a2d4bda75a79af7a3684fbfb42da60. +// +// Solidity: event Resolved(uint8 indexed status) +func (_FaultDisputeGame *FaultDisputeGameFilterer) ParseResolved(log types.Log) (*FaultDisputeGameResolved, error) { + event := new(FaultDisputeGameResolved) + if err := _FaultDisputeGame.contract.UnpackLog(event, "Resolved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/op-e2e2/bindings/gaspriceoracle.go b/op-e2e2/bindings/gaspriceoracle.go new file mode 100644 index 000000000000..00f3194cb6a4 --- /dev/null +++ b/op-e2e2/bindings/gaspriceoracle.go @@ -0,0 +1,740 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// GasPriceOracleMetaData contains all meta data concerning the GasPriceOracle contract. +var GasPriceOracleMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"function\",\"name\":\"DECIMALS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"baseFee\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"baseFeeScalar\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blobBaseFee\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blobBaseFeeScalar\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"decimals\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"gasPrice\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getL1Fee\",\"inputs\":[{\"name\":\"_data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getL1FeeUpperBound\",\"inputs\":[{\"name\":\"_unsignedTxSize\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getL1GasUsed\",\"inputs\":[{\"name\":\"_data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isEcotone\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isFjord\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"l1BaseFee\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"overhead\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"scalar\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"setEcotone\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setFjord\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"}]", + Bin: "0x608060405234801561001057600080fd5b506117f6806100206000396000f3fe608060405234801561001057600080fd5b50600436106101365760003560e01c80636ef25c3a116100b2578063de26c4a111610081578063f45e65d811610066578063f45e65d81461025b578063f820614014610263578063fe173b971461020d57600080fd5b8063de26c4a114610235578063f1c7a58b1461024857600080fd5b80636ef25c3a1461020d5780638e98b10614610213578063960e3a231461021b578063c59859181461022d57600080fd5b806349948e0e11610109578063519b4bd3116100ee578063519b4bd31461019f57806354fd4d50146101a757806368d5dca6146101f057600080fd5b806349948e0e1461016f5780634ef6e2241461018257600080fd5b80630c18c1621461013b57806322b90ab3146101565780632e0f262514610160578063313ce56714610168575b600080fd5b61014361026b565b6040519081526020015b60405180910390f35b61015e61038c565b005b610143600681565b6006610143565b61014361017d3660046112a1565b610515565b60005461018f9060ff1681565b604051901515815260200161014d565b610143610552565b6101e36040518060400160405280600581526020017f312e332e3000000000000000000000000000000000000000000000000000000081525081565b60405161014d9190611370565b6101f86105b3565b60405163ffffffff909116815260200161014d565b48610143565b61015e610638565b60005461018f90610100900460ff1681565b6101f8610832565b6101436102433660046112a1565b610893565b6101436102563660046113e3565b61098d565b610143610a69565b610143610b5c565b6000805460ff1615610304576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f47617350726963654f7261636c653a206f76657268656164282920697320646560448201527f707265636174656400000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061038791906113fc565b905090565b3373deaddeaddeaddeaddeaddeaddeaddeaddead000114610455576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604160248201527f47617350726963654f7261636c653a206f6e6c7920746865206465706f73697460448201527f6f72206163636f756e742063616e2073657420697345636f746f6e6520666c6160648201527f6700000000000000000000000000000000000000000000000000000000000000608482015260a4016102fb565b60005460ff16156104e8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f47617350726963654f7261636c653a2045636f746f6e6520616c72656164792060448201527f616374697665000000000000000000000000000000000000000000000000000060648201526084016102fb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b60008054610100900460ff16156105355761052f82610bbd565b92915050565b60005460ff16156105495761052f82610bdc565b61052f82610c80565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16635cf249696040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff166368d5dca66040518163ffffffff1660e01b8152600401602060405180830381865afa158015610614573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103879190611415565b3373deaddeaddeaddeaddeaddeaddeaddeaddead0001146106db576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f47617350726963654f7261636c653a206f6e6c7920746865206465706f73697460448201527f6f72206163636f756e742063616e20736574206973466a6f726420666c61670060648201526084016102fb565b60005460ff1661076d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603960248201527f47617350726963654f7261636c653a20466a6f72642063616e206f6e6c79206260448201527f65206163746976617465642061667465722045636f746f6e650000000000000060648201526084016102fb565b600054610100900460ff1615610804576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f47617350726963654f7261636c653a20466a6f726420616c726561647920616360448201527f746976650000000000000000000000000000000000000000000000000000000060648201526084016102fb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663c59859186040518163ffffffff1660e01b8152600401602060405180830381865afa158015610614573d6000803e3d6000fd5b60008054610100900460ff16156108da57620f42406108c56108b484610dd4565b516108c090604461146a565b6110f1565b6108d0906010611482565b61052f91906114bf565b60006108e583611150565b60005490915060ff16156108f95792915050565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610958573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061097c91906113fc565b610986908261146a565b9392505050565b60008054610100900460ff16610a25576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f47617350726963654f7261636c653a206765744c314665655570706572426f7560448201527f6e64206f6e6c7920737570706f72747320466a6f72640000000000000000000060648201526084016102fb565b6000610a3283604461146a565b90506000610a4160ff836114bf565b610a4b908361146a565b610a5690601061146a565b9050610a61816111e0565b949350505050565b6000805460ff1615610afd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f47617350726963654f7261636c653a207363616c61722829206973206465707260448201527f656361746564000000000000000000000000000000000000000000000000000060648201526084016102fb565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663f82061406040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b600061052f610bcb83610dd4565b51610bd790604461146a565b6111e0565b600080610be883611150565b90506000610bf4610552565b610bfc610832565b610c079060106114fa565b63ffffffff16610c179190611482565b90506000610c23610b5c565b610c2b6105b3565b63ffffffff16610c3b9190611482565b90506000610c49828461146a565b610c539085611482565b9050610c616006600a611646565b610c6c906010611482565b610c7690826114bf565b9695505050505050565b600080610c8c83611150565b9050600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa158015610cef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d1391906113fc565b610d1b610552565b73420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d9e91906113fc565b610da8908561146a565b610db29190611482565b610dbc9190611482565b9050610dca6006600a611646565b610a6190826114bf565b6060610f63565b818153600101919050565b600082840393505b838110156109865782810151828201511860001a1590930292600101610dee565b825b60208210610e5b578251610e26601f83610ddb565b52602092909201917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090910190602101610e11565b8115610986578251610e706001840383610ddb565b520160010192915050565b60006001830392505b6101078210610ebc57610eae8360ff16610ea960fd610ea98760081c60e00189610ddb565b610ddb565b935061010682039150610e84565b60078210610ee957610ee28360ff16610ea960078503610ea98760081c60e00189610ddb565b9050610986565b610a618360ff16610ea98560081c8560051b0187610ddb565b610f5b828203610f3f610f2f84600081518060001a8160011a60081b178160021a60101b17915050919050565b639e3779b90260131c611fff1690565b8060021b6040510182815160e01c1860e01b8151188152505050565b600101919050565b6180003860405139618000604051016020830180600d8551820103826002015b81811015611096576000805b50508051604051600082901a600183901a60081b1760029290921a60101b91909117639e3779b9810260111c617ffc16909101805160e081811c878603811890911b90911890915284019081830390848410610feb5750611026565b600184019350611fff8211611020578251600081901a600182901a60081b1760029190911a60101b1781036110205750611026565b50610f8f565b838310611034575050611096565b600183039250858311156110525761104f8787888603610e0f565b96505b611066600985016003850160038501610de6565b9150611073878284610e7b565b96505061108b8461108686848601610f02565b610f02565b915050809350610f83565b50506110a88383848851850103610e0f565b925050506040519150618000820180820391508183526020830160005b838110156110dd5782810151828201526020016110c5565b506000920191825250602001604052919050565b60008061110183620cc394611482565b61112b907ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd763200611652565b905061113b6064620f42406116c6565b81121561052f576109866064620f42406116c6565b80516000908190815b818110156111d35784818151811061117357611173611782565b01602001517fff00000000000000000000000000000000000000000000000000000000000000166000036111b3576111ac60048461146a565b92506111c1565b6111be60108461146a565b92505b806111cb816117b1565b915050611159565b50610a618261044061146a565b6000806111ec836110f1565b905060006111f8610b5c565b6112006105b3565b63ffffffff166112109190611482565b611218610552565b611220610832565b61122b9060106114fa565b63ffffffff1661123b9190611482565b611245919061146a565b905061125360066002611482565b61125e90600a611646565b6112688284611482565b610a6191906114bf565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000602082840312156112b357600080fd5b813567ffffffffffffffff808211156112cb57600080fd5b818401915084601f8301126112df57600080fd5b8135818111156112f1576112f1611272565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561133757611337611272565b8160405282815287602084870101111561135057600080fd5b826020860160208301376000928101602001929092525095945050505050565b600060208083528351808285015260005b8181101561139d57858101830151858201604001528201611381565b818111156113af576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b6000602082840312156113f557600080fd5b5035919050565b60006020828403121561140e57600080fd5b5051919050565b60006020828403121561142757600080fd5b815163ffffffff8116811461098657600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000821982111561147d5761147d61143b565b500190565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156114ba576114ba61143b565b500290565b6000826114f5577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b600063ffffffff8083168185168183048111821515161561151d5761151d61143b565b02949350505050565b600181815b8085111561157f57817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156115655761156561143b565b8085161561157257918102915b93841c939080029061152b565b509250929050565b6000826115965750600161052f565b816115a35750600061052f565b81600181146115b957600281146115c3576115df565b600191505061052f565b60ff8411156115d4576115d461143b565b50506001821b61052f565b5060208310610133831016604e8410600b8410161715611602575081810a61052f565b61160c8383611526565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561163e5761163e61143b565b029392505050565b60006109868383611587565b6000808212827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0384138115161561168c5761168c61143b565b827f80000000000000000000000000000000000000000000000000000000000000000384128116156116c0576116c061143b565b50500190565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000841360008413858304851182821616156117075761170761143b565b7f800000000000000000000000000000000000000000000000000000000000000060008712868205881281841616156117425761174261143b565b6000871292508782058712848416161561175e5761175e61143b565b878505871281841616156117745761177461143b565b505050929093029392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036117e2576117e261143b565b506001019056fea164736f6c634300080f000a", +} + +// GasPriceOracleABI is the input ABI used to generate the binding from. +// Deprecated: Use GasPriceOracleMetaData.ABI instead. +var GasPriceOracleABI = GasPriceOracleMetaData.ABI + +// GasPriceOracleBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use GasPriceOracleMetaData.Bin instead. +var GasPriceOracleBin = GasPriceOracleMetaData.Bin + +// DeployGasPriceOracle deploys a new Ethereum contract, binding an instance of GasPriceOracle to it. +func DeployGasPriceOracle(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *GasPriceOracle, error) { + parsed, err := GasPriceOracleMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(GasPriceOracleBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &GasPriceOracle{GasPriceOracleCaller: GasPriceOracleCaller{contract: contract}, GasPriceOracleTransactor: GasPriceOracleTransactor{contract: contract}, GasPriceOracleFilterer: GasPriceOracleFilterer{contract: contract}}, nil +} + +// GasPriceOracle is an auto generated Go binding around an Ethereum contract. +type GasPriceOracle struct { + GasPriceOracleCaller // Read-only binding to the contract + GasPriceOracleTransactor // Write-only binding to the contract + GasPriceOracleFilterer // Log filterer for contract events +} + +// GasPriceOracleCaller is an auto generated read-only Go binding around an Ethereum contract. +type GasPriceOracleCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// GasPriceOracleTransactor is an auto generated write-only Go binding around an Ethereum contract. +type GasPriceOracleTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// GasPriceOracleFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type GasPriceOracleFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// GasPriceOracleSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type GasPriceOracleSession struct { + Contract *GasPriceOracle // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// GasPriceOracleCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type GasPriceOracleCallerSession struct { + Contract *GasPriceOracleCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// GasPriceOracleTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type GasPriceOracleTransactorSession struct { + Contract *GasPriceOracleTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// GasPriceOracleRaw is an auto generated low-level Go binding around an Ethereum contract. +type GasPriceOracleRaw struct { + Contract *GasPriceOracle // Generic contract binding to access the raw methods on +} + +// GasPriceOracleCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type GasPriceOracleCallerRaw struct { + Contract *GasPriceOracleCaller // Generic read-only contract binding to access the raw methods on +} + +// GasPriceOracleTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type GasPriceOracleTransactorRaw struct { + Contract *GasPriceOracleTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewGasPriceOracle creates a new instance of GasPriceOracle, bound to a specific deployed contract. +func NewGasPriceOracle(address common.Address, backend bind.ContractBackend) (*GasPriceOracle, error) { + contract, err := bindGasPriceOracle(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &GasPriceOracle{GasPriceOracleCaller: GasPriceOracleCaller{contract: contract}, GasPriceOracleTransactor: GasPriceOracleTransactor{contract: contract}, GasPriceOracleFilterer: GasPriceOracleFilterer{contract: contract}}, nil +} + +// NewGasPriceOracleCaller creates a new read-only instance of GasPriceOracle, bound to a specific deployed contract. +func NewGasPriceOracleCaller(address common.Address, caller bind.ContractCaller) (*GasPriceOracleCaller, error) { + contract, err := bindGasPriceOracle(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &GasPriceOracleCaller{contract: contract}, nil +} + +// NewGasPriceOracleTransactor creates a new write-only instance of GasPriceOracle, bound to a specific deployed contract. +func NewGasPriceOracleTransactor(address common.Address, transactor bind.ContractTransactor) (*GasPriceOracleTransactor, error) { + contract, err := bindGasPriceOracle(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &GasPriceOracleTransactor{contract: contract}, nil +} + +// NewGasPriceOracleFilterer creates a new log filterer instance of GasPriceOracle, bound to a specific deployed contract. +func NewGasPriceOracleFilterer(address common.Address, filterer bind.ContractFilterer) (*GasPriceOracleFilterer, error) { + contract, err := bindGasPriceOracle(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &GasPriceOracleFilterer{contract: contract}, nil +} + +// bindGasPriceOracle binds a generic wrapper to an already deployed contract. +func bindGasPriceOracle(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(GasPriceOracleABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_GasPriceOracle *GasPriceOracleRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _GasPriceOracle.Contract.GasPriceOracleCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_GasPriceOracle *GasPriceOracleRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _GasPriceOracle.Contract.GasPriceOracleTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_GasPriceOracle *GasPriceOracleRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _GasPriceOracle.Contract.GasPriceOracleTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_GasPriceOracle *GasPriceOracleCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _GasPriceOracle.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_GasPriceOracle *GasPriceOracleTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _GasPriceOracle.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_GasPriceOracle *GasPriceOracleTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _GasPriceOracle.Contract.contract.Transact(opts, method, params...) +} + +// DECIMALS is a free data retrieval call binding the contract method 0x2e0f2625. +// +// Solidity: function DECIMALS() view returns(uint256) +func (_GasPriceOracle *GasPriceOracleCaller) DECIMALS(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _GasPriceOracle.contract.Call(opts, &out, "DECIMALS") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// DECIMALS is a free data retrieval call binding the contract method 0x2e0f2625. +// +// Solidity: function DECIMALS() view returns(uint256) +func (_GasPriceOracle *GasPriceOracleSession) DECIMALS() (*big.Int, error) { + return _GasPriceOracle.Contract.DECIMALS(&_GasPriceOracle.CallOpts) +} + +// DECIMALS is a free data retrieval call binding the contract method 0x2e0f2625. +// +// Solidity: function DECIMALS() view returns(uint256) +func (_GasPriceOracle *GasPriceOracleCallerSession) DECIMALS() (*big.Int, error) { + return _GasPriceOracle.Contract.DECIMALS(&_GasPriceOracle.CallOpts) +} + +// BaseFee is a free data retrieval call binding the contract method 0x6ef25c3a. +// +// Solidity: function baseFee() view returns(uint256) +func (_GasPriceOracle *GasPriceOracleCaller) BaseFee(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _GasPriceOracle.contract.Call(opts, &out, "baseFee") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// BaseFee is a free data retrieval call binding the contract method 0x6ef25c3a. +// +// Solidity: function baseFee() view returns(uint256) +func (_GasPriceOracle *GasPriceOracleSession) BaseFee() (*big.Int, error) { + return _GasPriceOracle.Contract.BaseFee(&_GasPriceOracle.CallOpts) +} + +// BaseFee is a free data retrieval call binding the contract method 0x6ef25c3a. +// +// Solidity: function baseFee() view returns(uint256) +func (_GasPriceOracle *GasPriceOracleCallerSession) BaseFee() (*big.Int, error) { + return _GasPriceOracle.Contract.BaseFee(&_GasPriceOracle.CallOpts) +} + +// BaseFeeScalar is a free data retrieval call binding the contract method 0xc5985918. +// +// Solidity: function baseFeeScalar() view returns(uint32) +func (_GasPriceOracle *GasPriceOracleCaller) BaseFeeScalar(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _GasPriceOracle.contract.Call(opts, &out, "baseFeeScalar") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// BaseFeeScalar is a free data retrieval call binding the contract method 0xc5985918. +// +// Solidity: function baseFeeScalar() view returns(uint32) +func (_GasPriceOracle *GasPriceOracleSession) BaseFeeScalar() (uint32, error) { + return _GasPriceOracle.Contract.BaseFeeScalar(&_GasPriceOracle.CallOpts) +} + +// BaseFeeScalar is a free data retrieval call binding the contract method 0xc5985918. +// +// Solidity: function baseFeeScalar() view returns(uint32) +func (_GasPriceOracle *GasPriceOracleCallerSession) BaseFeeScalar() (uint32, error) { + return _GasPriceOracle.Contract.BaseFeeScalar(&_GasPriceOracle.CallOpts) +} + +// BlobBaseFee is a free data retrieval call binding the contract method 0xf8206140. +// +// Solidity: function blobBaseFee() view returns(uint256) +func (_GasPriceOracle *GasPriceOracleCaller) BlobBaseFee(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _GasPriceOracle.contract.Call(opts, &out, "blobBaseFee") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// BlobBaseFee is a free data retrieval call binding the contract method 0xf8206140. +// +// Solidity: function blobBaseFee() view returns(uint256) +func (_GasPriceOracle *GasPriceOracleSession) BlobBaseFee() (*big.Int, error) { + return _GasPriceOracle.Contract.BlobBaseFee(&_GasPriceOracle.CallOpts) +} + +// BlobBaseFee is a free data retrieval call binding the contract method 0xf8206140. +// +// Solidity: function blobBaseFee() view returns(uint256) +func (_GasPriceOracle *GasPriceOracleCallerSession) BlobBaseFee() (*big.Int, error) { + return _GasPriceOracle.Contract.BlobBaseFee(&_GasPriceOracle.CallOpts) +} + +// BlobBaseFeeScalar is a free data retrieval call binding the contract method 0x68d5dca6. +// +// Solidity: function blobBaseFeeScalar() view returns(uint32) +func (_GasPriceOracle *GasPriceOracleCaller) BlobBaseFeeScalar(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _GasPriceOracle.contract.Call(opts, &out, "blobBaseFeeScalar") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// BlobBaseFeeScalar is a free data retrieval call binding the contract method 0x68d5dca6. +// +// Solidity: function blobBaseFeeScalar() view returns(uint32) +func (_GasPriceOracle *GasPriceOracleSession) BlobBaseFeeScalar() (uint32, error) { + return _GasPriceOracle.Contract.BlobBaseFeeScalar(&_GasPriceOracle.CallOpts) +} + +// BlobBaseFeeScalar is a free data retrieval call binding the contract method 0x68d5dca6. +// +// Solidity: function blobBaseFeeScalar() view returns(uint32) +func (_GasPriceOracle *GasPriceOracleCallerSession) BlobBaseFeeScalar() (uint32, error) { + return _GasPriceOracle.Contract.BlobBaseFeeScalar(&_GasPriceOracle.CallOpts) +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() pure returns(uint256) +func (_GasPriceOracle *GasPriceOracleCaller) Decimals(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _GasPriceOracle.contract.Call(opts, &out, "decimals") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() pure returns(uint256) +func (_GasPriceOracle *GasPriceOracleSession) Decimals() (*big.Int, error) { + return _GasPriceOracle.Contract.Decimals(&_GasPriceOracle.CallOpts) +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() pure returns(uint256) +func (_GasPriceOracle *GasPriceOracleCallerSession) Decimals() (*big.Int, error) { + return _GasPriceOracle.Contract.Decimals(&_GasPriceOracle.CallOpts) +} + +// GasPrice is a free data retrieval call binding the contract method 0xfe173b97. +// +// Solidity: function gasPrice() view returns(uint256) +func (_GasPriceOracle *GasPriceOracleCaller) GasPrice(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _GasPriceOracle.contract.Call(opts, &out, "gasPrice") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GasPrice is a free data retrieval call binding the contract method 0xfe173b97. +// +// Solidity: function gasPrice() view returns(uint256) +func (_GasPriceOracle *GasPriceOracleSession) GasPrice() (*big.Int, error) { + return _GasPriceOracle.Contract.GasPrice(&_GasPriceOracle.CallOpts) +} + +// GasPrice is a free data retrieval call binding the contract method 0xfe173b97. +// +// Solidity: function gasPrice() view returns(uint256) +func (_GasPriceOracle *GasPriceOracleCallerSession) GasPrice() (*big.Int, error) { + return _GasPriceOracle.Contract.GasPrice(&_GasPriceOracle.CallOpts) +} + +// GetL1Fee is a free data retrieval call binding the contract method 0x49948e0e. +// +// Solidity: function getL1Fee(bytes _data) view returns(uint256) +func (_GasPriceOracle *GasPriceOracleCaller) GetL1Fee(opts *bind.CallOpts, _data []byte) (*big.Int, error) { + var out []interface{} + err := _GasPriceOracle.contract.Call(opts, &out, "getL1Fee", _data) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetL1Fee is a free data retrieval call binding the contract method 0x49948e0e. +// +// Solidity: function getL1Fee(bytes _data) view returns(uint256) +func (_GasPriceOracle *GasPriceOracleSession) GetL1Fee(_data []byte) (*big.Int, error) { + return _GasPriceOracle.Contract.GetL1Fee(&_GasPriceOracle.CallOpts, _data) +} + +// GetL1Fee is a free data retrieval call binding the contract method 0x49948e0e. +// +// Solidity: function getL1Fee(bytes _data) view returns(uint256) +func (_GasPriceOracle *GasPriceOracleCallerSession) GetL1Fee(_data []byte) (*big.Int, error) { + return _GasPriceOracle.Contract.GetL1Fee(&_GasPriceOracle.CallOpts, _data) +} + +// GetL1FeeUpperBound is a free data retrieval call binding the contract method 0xf1c7a58b. +// +// Solidity: function getL1FeeUpperBound(uint256 _unsignedTxSize) view returns(uint256) +func (_GasPriceOracle *GasPriceOracleCaller) GetL1FeeUpperBound(opts *bind.CallOpts, _unsignedTxSize *big.Int) (*big.Int, error) { + var out []interface{} + err := _GasPriceOracle.contract.Call(opts, &out, "getL1FeeUpperBound", _unsignedTxSize) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetL1FeeUpperBound is a free data retrieval call binding the contract method 0xf1c7a58b. +// +// Solidity: function getL1FeeUpperBound(uint256 _unsignedTxSize) view returns(uint256) +func (_GasPriceOracle *GasPriceOracleSession) GetL1FeeUpperBound(_unsignedTxSize *big.Int) (*big.Int, error) { + return _GasPriceOracle.Contract.GetL1FeeUpperBound(&_GasPriceOracle.CallOpts, _unsignedTxSize) +} + +// GetL1FeeUpperBound is a free data retrieval call binding the contract method 0xf1c7a58b. +// +// Solidity: function getL1FeeUpperBound(uint256 _unsignedTxSize) view returns(uint256) +func (_GasPriceOracle *GasPriceOracleCallerSession) GetL1FeeUpperBound(_unsignedTxSize *big.Int) (*big.Int, error) { + return _GasPriceOracle.Contract.GetL1FeeUpperBound(&_GasPriceOracle.CallOpts, _unsignedTxSize) +} + +// GetL1GasUsed is a free data retrieval call binding the contract method 0xde26c4a1. +// +// Solidity: function getL1GasUsed(bytes _data) view returns(uint256) +func (_GasPriceOracle *GasPriceOracleCaller) GetL1GasUsed(opts *bind.CallOpts, _data []byte) (*big.Int, error) { + var out []interface{} + err := _GasPriceOracle.contract.Call(opts, &out, "getL1GasUsed", _data) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetL1GasUsed is a free data retrieval call binding the contract method 0xde26c4a1. +// +// Solidity: function getL1GasUsed(bytes _data) view returns(uint256) +func (_GasPriceOracle *GasPriceOracleSession) GetL1GasUsed(_data []byte) (*big.Int, error) { + return _GasPriceOracle.Contract.GetL1GasUsed(&_GasPriceOracle.CallOpts, _data) +} + +// GetL1GasUsed is a free data retrieval call binding the contract method 0xde26c4a1. +// +// Solidity: function getL1GasUsed(bytes _data) view returns(uint256) +func (_GasPriceOracle *GasPriceOracleCallerSession) GetL1GasUsed(_data []byte) (*big.Int, error) { + return _GasPriceOracle.Contract.GetL1GasUsed(&_GasPriceOracle.CallOpts, _data) +} + +// IsEcotone is a free data retrieval call binding the contract method 0x4ef6e224. +// +// Solidity: function isEcotone() view returns(bool) +func (_GasPriceOracle *GasPriceOracleCaller) IsEcotone(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _GasPriceOracle.contract.Call(opts, &out, "isEcotone") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsEcotone is a free data retrieval call binding the contract method 0x4ef6e224. +// +// Solidity: function isEcotone() view returns(bool) +func (_GasPriceOracle *GasPriceOracleSession) IsEcotone() (bool, error) { + return _GasPriceOracle.Contract.IsEcotone(&_GasPriceOracle.CallOpts) +} + +// IsEcotone is a free data retrieval call binding the contract method 0x4ef6e224. +// +// Solidity: function isEcotone() view returns(bool) +func (_GasPriceOracle *GasPriceOracleCallerSession) IsEcotone() (bool, error) { + return _GasPriceOracle.Contract.IsEcotone(&_GasPriceOracle.CallOpts) +} + +// IsFjord is a free data retrieval call binding the contract method 0x960e3a23. +// +// Solidity: function isFjord() view returns(bool) +func (_GasPriceOracle *GasPriceOracleCaller) IsFjord(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _GasPriceOracle.contract.Call(opts, &out, "isFjord") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsFjord is a free data retrieval call binding the contract method 0x960e3a23. +// +// Solidity: function isFjord() view returns(bool) +func (_GasPriceOracle *GasPriceOracleSession) IsFjord() (bool, error) { + return _GasPriceOracle.Contract.IsFjord(&_GasPriceOracle.CallOpts) +} + +// IsFjord is a free data retrieval call binding the contract method 0x960e3a23. +// +// Solidity: function isFjord() view returns(bool) +func (_GasPriceOracle *GasPriceOracleCallerSession) IsFjord() (bool, error) { + return _GasPriceOracle.Contract.IsFjord(&_GasPriceOracle.CallOpts) +} + +// L1BaseFee is a free data retrieval call binding the contract method 0x519b4bd3. +// +// Solidity: function l1BaseFee() view returns(uint256) +func (_GasPriceOracle *GasPriceOracleCaller) L1BaseFee(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _GasPriceOracle.contract.Call(opts, &out, "l1BaseFee") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// L1BaseFee is a free data retrieval call binding the contract method 0x519b4bd3. +// +// Solidity: function l1BaseFee() view returns(uint256) +func (_GasPriceOracle *GasPriceOracleSession) L1BaseFee() (*big.Int, error) { + return _GasPriceOracle.Contract.L1BaseFee(&_GasPriceOracle.CallOpts) +} + +// L1BaseFee is a free data retrieval call binding the contract method 0x519b4bd3. +// +// Solidity: function l1BaseFee() view returns(uint256) +func (_GasPriceOracle *GasPriceOracleCallerSession) L1BaseFee() (*big.Int, error) { + return _GasPriceOracle.Contract.L1BaseFee(&_GasPriceOracle.CallOpts) +} + +// Overhead is a free data retrieval call binding the contract method 0x0c18c162. +// +// Solidity: function overhead() view returns(uint256) +func (_GasPriceOracle *GasPriceOracleCaller) Overhead(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _GasPriceOracle.contract.Call(opts, &out, "overhead") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Overhead is a free data retrieval call binding the contract method 0x0c18c162. +// +// Solidity: function overhead() view returns(uint256) +func (_GasPriceOracle *GasPriceOracleSession) Overhead() (*big.Int, error) { + return _GasPriceOracle.Contract.Overhead(&_GasPriceOracle.CallOpts) +} + +// Overhead is a free data retrieval call binding the contract method 0x0c18c162. +// +// Solidity: function overhead() view returns(uint256) +func (_GasPriceOracle *GasPriceOracleCallerSession) Overhead() (*big.Int, error) { + return _GasPriceOracle.Contract.Overhead(&_GasPriceOracle.CallOpts) +} + +// Scalar is a free data retrieval call binding the contract method 0xf45e65d8. +// +// Solidity: function scalar() view returns(uint256) +func (_GasPriceOracle *GasPriceOracleCaller) Scalar(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _GasPriceOracle.contract.Call(opts, &out, "scalar") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Scalar is a free data retrieval call binding the contract method 0xf45e65d8. +// +// Solidity: function scalar() view returns(uint256) +func (_GasPriceOracle *GasPriceOracleSession) Scalar() (*big.Int, error) { + return _GasPriceOracle.Contract.Scalar(&_GasPriceOracle.CallOpts) +} + +// Scalar is a free data retrieval call binding the contract method 0xf45e65d8. +// +// Solidity: function scalar() view returns(uint256) +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) +} + +// SetEcotone is a paid mutator transaction binding the contract method 0x22b90ab3. +// +// Solidity: function setEcotone() returns() +func (_GasPriceOracle *GasPriceOracleTransactor) SetEcotone(opts *bind.TransactOpts) (*types.Transaction, error) { + return _GasPriceOracle.contract.Transact(opts, "setEcotone") +} + +// SetEcotone is a paid mutator transaction binding the contract method 0x22b90ab3. +// +// Solidity: function setEcotone() returns() +func (_GasPriceOracle *GasPriceOracleSession) SetEcotone() (*types.Transaction, error) { + return _GasPriceOracle.Contract.SetEcotone(&_GasPriceOracle.TransactOpts) +} + +// SetEcotone is a paid mutator transaction binding the contract method 0x22b90ab3. +// +// Solidity: function setEcotone() returns() +func (_GasPriceOracle *GasPriceOracleTransactorSession) SetEcotone() (*types.Transaction, error) { + return _GasPriceOracle.Contract.SetEcotone(&_GasPriceOracle.TransactOpts) +} + +// SetFjord is a paid mutator transaction binding the contract method 0x8e98b106. +// +// Solidity: function setFjord() returns() +func (_GasPriceOracle *GasPriceOracleTransactor) SetFjord(opts *bind.TransactOpts) (*types.Transaction, error) { + return _GasPriceOracle.contract.Transact(opts, "setFjord") +} + +// SetFjord is a paid mutator transaction binding the contract method 0x8e98b106. +// +// Solidity: function setFjord() returns() +func (_GasPriceOracle *GasPriceOracleSession) SetFjord() (*types.Transaction, error) { + return _GasPriceOracle.Contract.SetFjord(&_GasPriceOracle.TransactOpts) +} + +// SetFjord is a paid mutator transaction binding the contract method 0x8e98b106. +// +// Solidity: function setFjord() returns() +func (_GasPriceOracle *GasPriceOracleTransactorSession) SetFjord() (*types.Transaction, error) { + return _GasPriceOracle.Contract.SetFjord(&_GasPriceOracle.TransactOpts) +} diff --git a/op-e2e2/bindings/governancetoken.go b/op-e2e2/bindings/governancetoken.go new file mode 100644 index 000000000000..56963a953916 --- /dev/null +++ b/op-e2e2/bindings/governancetoken.go @@ -0,0 +1,1715 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// ERC20VotesCheckpoint is an auto generated low-level Go binding around an user-defined struct. +type ERC20VotesCheckpoint struct { + FromBlock uint32 + Votes *big.Int +} + +// GovernanceTokenMetaData contains all meta data concerning the GovernanceToken contract. +var GovernanceTokenMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"fromDelegate\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"toDelegate\",\"type\":\"address\"}],\"name\":\"DelegateChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newBalance\",\"type\":\"uint256\"}],\"name\":\"DelegateVotesChanged\",\"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\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"burnFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"pos\",\"type\":\"uint32\"}],\"name\":\"checkpoints\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"fromBlock\",\"type\":\"uint32\"},{\"internalType\":\"uint224\",\"name\":\"votes\",\"type\":\"uint224\"}],\"internalType\":\"structERC20Votes.Checkpoint\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"}],\"name\":\"delegate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"delegateBySig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"delegates\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"}],\"name\":\"getPastTotalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"}],\"name\":\"getPastVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"getVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"nonces\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"numCheckpoints\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"permit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x6101406040523480156200001257600080fd5b50604051806040016040528060088152602001674f7074696d69736d60c01b81525080604051806040016040528060018152602001603160f81b815250604051806040016040528060088152602001674f7074696d69736d60c01b8152506040518060400160405280600281526020016104f560f41b81525081600390816200009c919062000247565b506004620000ab828262000247565b5050825160209384012082519284019290922060e08390526101008190524660a0818152604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818901819052818301979097526060810194909452608080850193909352308483018190528151808603909301835260c09485019091528151919096012090529290925261012052506200014a90503362000150565b62000313565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680620001cd57607f821691505b602082108103620001ee57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200024257600081815260208120601f850160051c810160208610156200021d5750805b601f850160051c820191505b818110156200023e5782815560010162000229565b5050505b505050565b81516001600160401b03811115620002635762000263620001a2565b6200027b81620002748454620001b8565b84620001f4565b602080601f831160018114620002b357600084156200029a5750858301515b600019600386901b1c1916600185901b1785556200023e565b600085815260208120601f198616915b82811015620002e457888601518255948401946001909101908401620002c3565b5085821015620003035787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60805160a05160c05160e051610100516101205161286a6200036360003960006113f2015260006114410152600061141c015260006113750152600061139f015260006113c9015261286a6000f3fe608060405234801561001057600080fd5b50600436106101c45760003560e01c8063715018a6116100f9578063a457c2d711610097578063d505accf11610071578063d505accf14610416578063dd62ed3e14610429578063f1127ed81461046f578063f2fde38b146104c157600080fd5b8063a457c2d7146103dd578063a9059cbb146103f0578063c3cda5201461040357600080fd5b80638da5cb5b116100d35780638da5cb5b146103915780638e539e8c146103af57806395d89b41146103c25780639ab24eb0146103ca57600080fd5b8063715018a61461036357806379cc67901461036b5780637ecebe001461037e57600080fd5b80633a46b1a811610166578063587cde1e11610140578063587cde1e146102945780635c19a95c146102f25780636fcfff451461030557806370a082311461032d57600080fd5b80633a46b1a81461025957806340c10f191461026c57806342966c681461028157600080fd5b806323b872dd116101a257806323b872dd1461021c578063313ce5671461022f5780633644e5151461023e578063395093511461024657600080fd5b806306fdde03146101c9578063095ea7b3146101e757806318160ddd1461020a575b600080fd5b6101d16104d4565b6040516101de919061249d565b60405180910390f35b6101fa6101f5366004612539565b610566565b60405190151581526020016101de565b6002545b6040519081526020016101de565b6101fa61022a366004612563565b61057e565b604051601281526020016101de565b61020e6105a2565b6101fa610254366004612539565b6105b1565b61020e610267366004612539565b6105fd565b61027f61027a366004612539565b6106a3565b005b61027f61028f36600461259f565b6106b9565b6102cd6102a23660046125b8565b73ffffffffffffffffffffffffffffffffffffffff9081166000908152600760205260409020541690565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101de565b61027f6103003660046125b8565b6106c6565b6103186103133660046125b8565b6106d0565b60405163ffffffff90911681526020016101de565b61020e61033b3660046125b8565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b61027f610705565b61027f610379366004612539565b610719565b61020e61038c3660046125b8565b61072e565b600a5473ffffffffffffffffffffffffffffffffffffffff166102cd565b61020e6103bd36600461259f565b610759565b6101d16107cf565b61020e6103d83660046125b8565b6107de565b6101fa6103eb366004612539565b6108a9565b6101fa6103fe366004612539565b61097a565b61027f6104113660046125e4565b610988565b61027f61042436600461263c565b610aff565b61020e6104373660046126a6565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205490565b61048261047d3660046126d9565b610cbe565b60408051825163ffffffff1681526020928301517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1692810192909252016101de565b61027f6104cf3660046125b8565b610d64565b6060600380546104e390612719565b80601f016020809104026020016040519081016040528092919081815260200182805461050f90612719565b801561055c5780601f106105315761010080835404028352916020019161055c565b820191906000526020600020905b81548152906001019060200180831161053f57829003601f168201915b5050505050905090565b600033610574818585610e18565b5060019392505050565b60003361058c858285610fcb565b6105978585856110a2565b506001949350505050565b60006105ac61135b565b905090565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716845290915281205490919061057490829086906105f8908790612795565b610e18565b600043821061066d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f4552433230566f7465733a20626c6f636b206e6f7420796574206d696e65640060448201526064015b60405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8316600090815260086020526040902061069c908361148f565b9392505050565b6106ab611576565b6106b582826115f7565b5050565b6106c33382611601565b50565b6106c3338261160b565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600860205260408120546106ff906116a9565b92915050565b61070d611576565b6107176000611743565b565b610724823383610fcb565b6106b58282611601565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600560205260408120546106ff565b60004382106107c4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f4552433230566f7465733a20626c6f636b206e6f7420796574206d696e6564006044820152606401610664565b6106ff60098361148f565b6060600480546104e390612719565b73ffffffffffffffffffffffffffffffffffffffff811660009081526008602052604081205480156108815773ffffffffffffffffffffffffffffffffffffffff8316600090815260086020526040902061083a6001836127ad565b8154811061084a5761084a6127c4565b60009182526020909120015464010000000090047bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16610884565b60005b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff169392505050565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff871684529091528120549091908381101561096d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f0000000000000000000000000000000000000000000000000000006064820152608401610664565b6105978286868403610e18565b6000336105748185856110a2565b834211156109f2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f4552433230566f7465733a207369676e617475726520657870697265640000006044820152606401610664565b604080517fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf602082015273ffffffffffffffffffffffffffffffffffffffff8816918101919091526060810186905260808101859052600090610a7990610a719060a001604051602081830303815290604052805190602001206117ba565b858585611823565b9050610a848161184b565b8614610aec576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4552433230566f7465733a20696e76616c6964206e6f6e6365000000000000006044820152606401610664565b610af6818861160b565b50505050505050565b83421115610b69576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e650000006044820152606401610664565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9888888610b988c61184b565b60408051602081019690965273ffffffffffffffffffffffffffffffffffffffff94851690860152929091166060840152608083015260a082015260c0810186905260e0016040516020818303038152906040528051906020012090506000610c00826117ba565b90506000610c1082878787611823565b90508973ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610ca7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e617475726500006044820152606401610664565b610cb28a8a8a610e18565b50505050505050505050565b604080518082019091526000808252602082015273ffffffffffffffffffffffffffffffffffffffff83166000908152600860205260409020805463ffffffff8416908110610d0f57610d0f6127c4565b60009182526020918290206040805180820190915291015463ffffffff8116825264010000000090047bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16918101919091529392505050565b610d6c611576565b73ffffffffffffffffffffffffffffffffffffffff8116610e0f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610664565b6106c381611743565b73ffffffffffffffffffffffffffffffffffffffff8316610eba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610664565b73ffffffffffffffffffffffffffffffffffffffff8216610f5d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401610664565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff8381166000908152600160209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811461109c578181101561108f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610664565b61109c8484848403610e18565b50505050565b73ffffffffffffffffffffffffffffffffffffffff8316611145576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610664565b73ffffffffffffffffffffffffffffffffffffffff82166111e8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610664565b73ffffffffffffffffffffffffffffffffffffffff83166000908152602081905260409020548181101561129e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608401610664565b73ffffffffffffffffffffffffffffffffffffffff8085166000908152602081905260408082208585039055918516815290812080548492906112e2908490612795565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161134891815260200190565b60405180910390a361109c848484611885565b60003073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000161480156113c157507f000000000000000000000000000000000000000000000000000000000000000046145b156113eb57507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b8154600090815b818110156114f35760006114aa8284611890565b9050848682815481106114bf576114bf6127c4565b60009182526020909120015463ffffffff1611156114df578092506114ed565b6114ea816001612795565b91505b50611496565b811561154c57846115056001846127ad565b81548110611515576115156127c4565b60009182526020909120015464010000000090047bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1661154f565b60005b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1695945050505050565b600a5473ffffffffffffffffffffffffffffffffffffffff163314610717576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610664565b6106b582826118ab565b6106b58282611971565b73ffffffffffffffffffffffffffffffffffffffff8281166000818152600760208181526040808420805485845282862054949093528787167fffffffffffffffffffffffff00000000000000000000000000000000000000008416811790915590519190951694919391928592917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a461109c828483611989565b600063ffffffff82111561173f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201527f32206269747300000000000000000000000000000000000000000000000000006064820152608401610664565b5090565b600a805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60006106ff6117c761135b565b836040517f19010000000000000000000000000000000000000000000000000000000000006020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b600080600061183487878787611b2e565b9150915061184181611c46565b5095945050505050565b73ffffffffffffffffffffffffffffffffffffffff811660009081526005602052604090208054600181018255905b50919050565b505050565b611880838383611e9a565b600061189f60028484186127f3565b61069c90848416612795565b6118b58282611ed9565b6002547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1015611963576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f4552433230566f7465733a20746f74616c20737570706c79207269736b73206f60448201527f766572666c6f77696e6720766f746573000000000000000000000000000000006064820152608401610664565b61109c60096120018361200d565b61197b82826121ef565b61109c60096123e38361200d565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119c55750600081115b156118805773ffffffffffffffffffffffffffffffffffffffff831615611a7a5773ffffffffffffffffffffffffffffffffffffffff831660009081526008602052604081208190611a1a906123e38561200d565b915091508473ffffffffffffffffffffffffffffffffffffffff167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7248383604051611a6f929190918252602082015260400190565b60405180910390a250505b73ffffffffffffffffffffffffffffffffffffffff8216156118805773ffffffffffffffffffffffffffffffffffffffff821660009081526008602052604081208190611aca906120018561200d565b915091508373ffffffffffffffffffffffffffffffffffffffff167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7248383604051611b1f929190918252602082015260400190565b60405180910390a25050505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115611b655750600090506003611c3d565b8460ff16601b14158015611b7d57508460ff16601c14155b15611b8e5750600090506004611c3d565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611be2573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff8116611c3657600060019250925050611c3d565b9150600090505b94509492505050565b6000816004811115611c5a57611c5a61282e565b03611c625750565b6001816004811115611c7657611c7661282e565b03611cdd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610664565b6002816004811115611cf157611cf161282e565b03611d58576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610664565b6003816004811115611d6c57611d6c61282e565b03611df9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610664565b6004816004811115611e0d57611e0d61282e565b036106c3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610664565b73ffffffffffffffffffffffffffffffffffffffff83811660009081526007602052604080822054858416835291205461188092918216911683611989565b73ffffffffffffffffffffffffffffffffffffffff8216611f56576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610664565b8060026000828254611f689190612795565b909155505073ffffffffffffffffffffffffffffffffffffffff821660009081526020819052604081208054839290611fa2908490612795565b909155505060405181815273ffffffffffffffffffffffffffffffffffffffff8316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a36106b560008383611885565b600061069c8284612795565b82546000908190801561206d57856120266001836127ad565b81548110612036576120366127c4565b60009182526020909120015464010000000090047bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16612070565b60005b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16925061209e83858763ffffffff16565b91506000811180156120dc575043866120b86001846127ad565b815481106120c8576120c86127c4565b60009182526020909120015463ffffffff16145b15612166576120ea826123ef565b866120f66001846127ad565b81548110612106576121066127c4565b9060005260206000200160000160046101000a8154817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff02191690837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1602179055506121e6565b85604051806040016040528061217b436116a9565b63ffffffff16815260200161218f856123ef565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff90811690915282546001810184556000938452602093849020835194909301519091166401000000000263ffffffff909316929092179101555b50935093915050565b73ffffffffffffffffffffffffffffffffffffffff8216612292576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610664565b73ffffffffffffffffffffffffffffffffffffffff821660009081526020819052604090205481811015612348576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f63650000000000000000000000000000000000000000000000000000000000006064820152608401610664565b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604081208383039055600280548492906123849084906127ad565b909155505060405182815260009073ffffffffffffffffffffffffffffffffffffffff8516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a361188083600084611885565b600061069c82846127ad565b60007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff82111561173f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203260448201527f32342062697473000000000000000000000000000000000000000000000000006064820152608401610664565b600060208083528351808285015260005b818110156124ca578581018301518582016040015282016124ae565b818111156124dc576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461253457600080fd5b919050565b6000806040838503121561254c57600080fd5b61255583612510565b946020939093013593505050565b60008060006060848603121561257857600080fd5b61258184612510565b925061258f60208501612510565b9150604084013590509250925092565b6000602082840312156125b157600080fd5b5035919050565b6000602082840312156125ca57600080fd5b61069c82612510565b803560ff8116811461253457600080fd5b60008060008060008060c087890312156125fd57600080fd5b61260687612510565b95506020870135945060408701359350612622606088016125d3565b92506080870135915060a087013590509295509295509295565b600080600080600080600060e0888a03121561265757600080fd5b61266088612510565b965061266e60208901612510565b9550604088013594506060880135935061268a608089016125d3565b925060a0880135915060c0880135905092959891949750929550565b600080604083850312156126b957600080fd5b6126c283612510565b91506126d060208401612510565b90509250929050565b600080604083850312156126ec57600080fd5b6126f583612510565b9150602083013563ffffffff8116811461270e57600080fd5b809150509250929050565b600181811c9082168061272d57607f821691505b60208210810361187a577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082198211156127a8576127a8612766565b500190565b6000828210156127bf576127bf612766565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082612829577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fdfea164736f6c634300080f000a", +} + +// GovernanceTokenABI is the input ABI used to generate the binding from. +// Deprecated: Use GovernanceTokenMetaData.ABI instead. +var GovernanceTokenABI = GovernanceTokenMetaData.ABI + +// GovernanceTokenBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use GovernanceTokenMetaData.Bin instead. +var GovernanceTokenBin = GovernanceTokenMetaData.Bin + +// DeployGovernanceToken deploys a new Ethereum contract, binding an instance of GovernanceToken to it. +func DeployGovernanceToken(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *GovernanceToken, error) { + parsed, err := GovernanceTokenMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(GovernanceTokenBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &GovernanceToken{GovernanceTokenCaller: GovernanceTokenCaller{contract: contract}, GovernanceTokenTransactor: GovernanceTokenTransactor{contract: contract}, GovernanceTokenFilterer: GovernanceTokenFilterer{contract: contract}}, nil +} + +// GovernanceToken is an auto generated Go binding around an Ethereum contract. +type GovernanceToken struct { + GovernanceTokenCaller // Read-only binding to the contract + GovernanceTokenTransactor // Write-only binding to the contract + GovernanceTokenFilterer // Log filterer for contract events +} + +// GovernanceTokenCaller is an auto generated read-only Go binding around an Ethereum contract. +type GovernanceTokenCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// GovernanceTokenTransactor is an auto generated write-only Go binding around an Ethereum contract. +type GovernanceTokenTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// GovernanceTokenFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type GovernanceTokenFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// GovernanceTokenSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type GovernanceTokenSession struct { + Contract *GovernanceToken // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// GovernanceTokenCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type GovernanceTokenCallerSession struct { + Contract *GovernanceTokenCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// GovernanceTokenTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type GovernanceTokenTransactorSession struct { + Contract *GovernanceTokenTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// GovernanceTokenRaw is an auto generated low-level Go binding around an Ethereum contract. +type GovernanceTokenRaw struct { + Contract *GovernanceToken // Generic contract binding to access the raw methods on +} + +// GovernanceTokenCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type GovernanceTokenCallerRaw struct { + Contract *GovernanceTokenCaller // Generic read-only contract binding to access the raw methods on +} + +// GovernanceTokenTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type GovernanceTokenTransactorRaw struct { + Contract *GovernanceTokenTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewGovernanceToken creates a new instance of GovernanceToken, bound to a specific deployed contract. +func NewGovernanceToken(address common.Address, backend bind.ContractBackend) (*GovernanceToken, error) { + contract, err := bindGovernanceToken(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &GovernanceToken{GovernanceTokenCaller: GovernanceTokenCaller{contract: contract}, GovernanceTokenTransactor: GovernanceTokenTransactor{contract: contract}, GovernanceTokenFilterer: GovernanceTokenFilterer{contract: contract}}, nil +} + +// NewGovernanceTokenCaller creates a new read-only instance of GovernanceToken, bound to a specific deployed contract. +func NewGovernanceTokenCaller(address common.Address, caller bind.ContractCaller) (*GovernanceTokenCaller, error) { + contract, err := bindGovernanceToken(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &GovernanceTokenCaller{contract: contract}, nil +} + +// NewGovernanceTokenTransactor creates a new write-only instance of GovernanceToken, bound to a specific deployed contract. +func NewGovernanceTokenTransactor(address common.Address, transactor bind.ContractTransactor) (*GovernanceTokenTransactor, error) { + contract, err := bindGovernanceToken(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &GovernanceTokenTransactor{contract: contract}, nil +} + +// NewGovernanceTokenFilterer creates a new log filterer instance of GovernanceToken, bound to a specific deployed contract. +func NewGovernanceTokenFilterer(address common.Address, filterer bind.ContractFilterer) (*GovernanceTokenFilterer, error) { + contract, err := bindGovernanceToken(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &GovernanceTokenFilterer{contract: contract}, nil +} + +// bindGovernanceToken binds a generic wrapper to an already deployed contract. +func bindGovernanceToken(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(GovernanceTokenABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_GovernanceToken *GovernanceTokenRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _GovernanceToken.Contract.GovernanceTokenCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_GovernanceToken *GovernanceTokenRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _GovernanceToken.Contract.GovernanceTokenTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_GovernanceToken *GovernanceTokenRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _GovernanceToken.Contract.GovernanceTokenTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_GovernanceToken *GovernanceTokenCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _GovernanceToken.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_GovernanceToken *GovernanceTokenTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _GovernanceToken.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_GovernanceToken *GovernanceTokenTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _GovernanceToken.Contract.contract.Transact(opts, method, params...) +} + +// DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. +// +// Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) +func (_GovernanceToken *GovernanceTokenCaller) DOMAINSEPARATOR(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _GovernanceToken.contract.Call(opts, &out, "DOMAIN_SEPARATOR") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. +// +// Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) +func (_GovernanceToken *GovernanceTokenSession) DOMAINSEPARATOR() ([32]byte, error) { + return _GovernanceToken.Contract.DOMAINSEPARATOR(&_GovernanceToken.CallOpts) +} + +// DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. +// +// Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) +func (_GovernanceToken *GovernanceTokenCallerSession) DOMAINSEPARATOR() ([32]byte, error) { + return _GovernanceToken.Contract.DOMAINSEPARATOR(&_GovernanceToken.CallOpts) +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) view returns(uint256) +func (_GovernanceToken *GovernanceTokenCaller) Allowance(opts *bind.CallOpts, owner common.Address, spender common.Address) (*big.Int, error) { + var out []interface{} + err := _GovernanceToken.contract.Call(opts, &out, "allowance", owner, spender) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) view returns(uint256) +func (_GovernanceToken *GovernanceTokenSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { + return _GovernanceToken.Contract.Allowance(&_GovernanceToken.CallOpts, owner, spender) +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) view returns(uint256) +func (_GovernanceToken *GovernanceTokenCallerSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { + return _GovernanceToken.Contract.Allowance(&_GovernanceToken.CallOpts, owner, spender) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) view returns(uint256) +func (_GovernanceToken *GovernanceTokenCaller) BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) { + var out []interface{} + err := _GovernanceToken.contract.Call(opts, &out, "balanceOf", account) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) view returns(uint256) +func (_GovernanceToken *GovernanceTokenSession) BalanceOf(account common.Address) (*big.Int, error) { + return _GovernanceToken.Contract.BalanceOf(&_GovernanceToken.CallOpts, account) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) view returns(uint256) +func (_GovernanceToken *GovernanceTokenCallerSession) BalanceOf(account common.Address) (*big.Int, error) { + return _GovernanceToken.Contract.BalanceOf(&_GovernanceToken.CallOpts, account) +} + +// Checkpoints is a free data retrieval call binding the contract method 0xf1127ed8. +// +// Solidity: function checkpoints(address account, uint32 pos) view returns((uint32,uint224)) +func (_GovernanceToken *GovernanceTokenCaller) Checkpoints(opts *bind.CallOpts, account common.Address, pos uint32) (ERC20VotesCheckpoint, error) { + var out []interface{} + err := _GovernanceToken.contract.Call(opts, &out, "checkpoints", account, pos) + + if err != nil { + return *new(ERC20VotesCheckpoint), err + } + + out0 := *abi.ConvertType(out[0], new(ERC20VotesCheckpoint)).(*ERC20VotesCheckpoint) + + return out0, err + +} + +// Checkpoints is a free data retrieval call binding the contract method 0xf1127ed8. +// +// Solidity: function checkpoints(address account, uint32 pos) view returns((uint32,uint224)) +func (_GovernanceToken *GovernanceTokenSession) Checkpoints(account common.Address, pos uint32) (ERC20VotesCheckpoint, error) { + return _GovernanceToken.Contract.Checkpoints(&_GovernanceToken.CallOpts, account, pos) +} + +// Checkpoints is a free data retrieval call binding the contract method 0xf1127ed8. +// +// Solidity: function checkpoints(address account, uint32 pos) view returns((uint32,uint224)) +func (_GovernanceToken *GovernanceTokenCallerSession) Checkpoints(account common.Address, pos uint32) (ERC20VotesCheckpoint, error) { + return _GovernanceToken.Contract.Checkpoints(&_GovernanceToken.CallOpts, account, pos) +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_GovernanceToken *GovernanceTokenCaller) Decimals(opts *bind.CallOpts) (uint8, error) { + var out []interface{} + err := _GovernanceToken.contract.Call(opts, &out, "decimals") + + if err != nil { + return *new(uint8), err + } + + out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) + + return out0, err + +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_GovernanceToken *GovernanceTokenSession) Decimals() (uint8, error) { + return _GovernanceToken.Contract.Decimals(&_GovernanceToken.CallOpts) +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_GovernanceToken *GovernanceTokenCallerSession) Decimals() (uint8, error) { + return _GovernanceToken.Contract.Decimals(&_GovernanceToken.CallOpts) +} + +// Delegates is a free data retrieval call binding the contract method 0x587cde1e. +// +// Solidity: function delegates(address account) view returns(address) +func (_GovernanceToken *GovernanceTokenCaller) Delegates(opts *bind.CallOpts, account common.Address) (common.Address, error) { + var out []interface{} + err := _GovernanceToken.contract.Call(opts, &out, "delegates", account) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Delegates is a free data retrieval call binding the contract method 0x587cde1e. +// +// Solidity: function delegates(address account) view returns(address) +func (_GovernanceToken *GovernanceTokenSession) Delegates(account common.Address) (common.Address, error) { + return _GovernanceToken.Contract.Delegates(&_GovernanceToken.CallOpts, account) +} + +// Delegates is a free data retrieval call binding the contract method 0x587cde1e. +// +// Solidity: function delegates(address account) view returns(address) +func (_GovernanceToken *GovernanceTokenCallerSession) Delegates(account common.Address) (common.Address, error) { + return _GovernanceToken.Contract.Delegates(&_GovernanceToken.CallOpts, account) +} + +// GetPastTotalSupply is a free data retrieval call binding the contract method 0x8e539e8c. +// +// Solidity: function getPastTotalSupply(uint256 blockNumber) view returns(uint256) +func (_GovernanceToken *GovernanceTokenCaller) GetPastTotalSupply(opts *bind.CallOpts, blockNumber *big.Int) (*big.Int, error) { + var out []interface{} + err := _GovernanceToken.contract.Call(opts, &out, "getPastTotalSupply", blockNumber) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetPastTotalSupply is a free data retrieval call binding the contract method 0x8e539e8c. +// +// Solidity: function getPastTotalSupply(uint256 blockNumber) view returns(uint256) +func (_GovernanceToken *GovernanceTokenSession) GetPastTotalSupply(blockNumber *big.Int) (*big.Int, error) { + return _GovernanceToken.Contract.GetPastTotalSupply(&_GovernanceToken.CallOpts, blockNumber) +} + +// GetPastTotalSupply is a free data retrieval call binding the contract method 0x8e539e8c. +// +// Solidity: function getPastTotalSupply(uint256 blockNumber) view returns(uint256) +func (_GovernanceToken *GovernanceTokenCallerSession) GetPastTotalSupply(blockNumber *big.Int) (*big.Int, error) { + return _GovernanceToken.Contract.GetPastTotalSupply(&_GovernanceToken.CallOpts, blockNumber) +} + +// GetPastVotes is a free data retrieval call binding the contract method 0x3a46b1a8. +// +// Solidity: function getPastVotes(address account, uint256 blockNumber) view returns(uint256) +func (_GovernanceToken *GovernanceTokenCaller) GetPastVotes(opts *bind.CallOpts, account common.Address, blockNumber *big.Int) (*big.Int, error) { + var out []interface{} + err := _GovernanceToken.contract.Call(opts, &out, "getPastVotes", account, blockNumber) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetPastVotes is a free data retrieval call binding the contract method 0x3a46b1a8. +// +// Solidity: function getPastVotes(address account, uint256 blockNumber) view returns(uint256) +func (_GovernanceToken *GovernanceTokenSession) GetPastVotes(account common.Address, blockNumber *big.Int) (*big.Int, error) { + return _GovernanceToken.Contract.GetPastVotes(&_GovernanceToken.CallOpts, account, blockNumber) +} + +// GetPastVotes is a free data retrieval call binding the contract method 0x3a46b1a8. +// +// Solidity: function getPastVotes(address account, uint256 blockNumber) view returns(uint256) +func (_GovernanceToken *GovernanceTokenCallerSession) GetPastVotes(account common.Address, blockNumber *big.Int) (*big.Int, error) { + return _GovernanceToken.Contract.GetPastVotes(&_GovernanceToken.CallOpts, account, blockNumber) +} + +// GetVotes is a free data retrieval call binding the contract method 0x9ab24eb0. +// +// Solidity: function getVotes(address account) view returns(uint256) +func (_GovernanceToken *GovernanceTokenCaller) GetVotes(opts *bind.CallOpts, account common.Address) (*big.Int, error) { + var out []interface{} + err := _GovernanceToken.contract.Call(opts, &out, "getVotes", account) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetVotes is a free data retrieval call binding the contract method 0x9ab24eb0. +// +// Solidity: function getVotes(address account) view returns(uint256) +func (_GovernanceToken *GovernanceTokenSession) GetVotes(account common.Address) (*big.Int, error) { + return _GovernanceToken.Contract.GetVotes(&_GovernanceToken.CallOpts, account) +} + +// GetVotes is a free data retrieval call binding the contract method 0x9ab24eb0. +// +// Solidity: function getVotes(address account) view returns(uint256) +func (_GovernanceToken *GovernanceTokenCallerSession) GetVotes(account common.Address) (*big.Int, error) { + return _GovernanceToken.Contract.GetVotes(&_GovernanceToken.CallOpts, account) +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_GovernanceToken *GovernanceTokenCaller) Name(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _GovernanceToken.contract.Call(opts, &out, "name") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_GovernanceToken *GovernanceTokenSession) Name() (string, error) { + return _GovernanceToken.Contract.Name(&_GovernanceToken.CallOpts) +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_GovernanceToken *GovernanceTokenCallerSession) Name() (string, error) { + return _GovernanceToken.Contract.Name(&_GovernanceToken.CallOpts) +} + +// Nonces is a free data retrieval call binding the contract method 0x7ecebe00. +// +// Solidity: function nonces(address owner) view returns(uint256) +func (_GovernanceToken *GovernanceTokenCaller) Nonces(opts *bind.CallOpts, owner common.Address) (*big.Int, error) { + var out []interface{} + err := _GovernanceToken.contract.Call(opts, &out, "nonces", owner) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Nonces is a free data retrieval call binding the contract method 0x7ecebe00. +// +// Solidity: function nonces(address owner) view returns(uint256) +func (_GovernanceToken *GovernanceTokenSession) Nonces(owner common.Address) (*big.Int, error) { + return _GovernanceToken.Contract.Nonces(&_GovernanceToken.CallOpts, owner) +} + +// Nonces is a free data retrieval call binding the contract method 0x7ecebe00. +// +// Solidity: function nonces(address owner) view returns(uint256) +func (_GovernanceToken *GovernanceTokenCallerSession) Nonces(owner common.Address) (*big.Int, error) { + return _GovernanceToken.Contract.Nonces(&_GovernanceToken.CallOpts, owner) +} + +// NumCheckpoints is a free data retrieval call binding the contract method 0x6fcfff45. +// +// Solidity: function numCheckpoints(address account) view returns(uint32) +func (_GovernanceToken *GovernanceTokenCaller) NumCheckpoints(opts *bind.CallOpts, account common.Address) (uint32, error) { + var out []interface{} + err := _GovernanceToken.contract.Call(opts, &out, "numCheckpoints", account) + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// NumCheckpoints is a free data retrieval call binding the contract method 0x6fcfff45. +// +// Solidity: function numCheckpoints(address account) view returns(uint32) +func (_GovernanceToken *GovernanceTokenSession) NumCheckpoints(account common.Address) (uint32, error) { + return _GovernanceToken.Contract.NumCheckpoints(&_GovernanceToken.CallOpts, account) +} + +// NumCheckpoints is a free data retrieval call binding the contract method 0x6fcfff45. +// +// Solidity: function numCheckpoints(address account) view returns(uint32) +func (_GovernanceToken *GovernanceTokenCallerSession) NumCheckpoints(account common.Address) (uint32, error) { + return _GovernanceToken.Contract.NumCheckpoints(&_GovernanceToken.CallOpts, account) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_GovernanceToken *GovernanceTokenCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _GovernanceToken.contract.Call(opts, &out, "owner") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_GovernanceToken *GovernanceTokenSession) Owner() (common.Address, error) { + return _GovernanceToken.Contract.Owner(&_GovernanceToken.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_GovernanceToken *GovernanceTokenCallerSession) Owner() (common.Address, error) { + return _GovernanceToken.Contract.Owner(&_GovernanceToken.CallOpts) +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_GovernanceToken *GovernanceTokenCaller) Symbol(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _GovernanceToken.contract.Call(opts, &out, "symbol") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_GovernanceToken *GovernanceTokenSession) Symbol() (string, error) { + return _GovernanceToken.Contract.Symbol(&_GovernanceToken.CallOpts) +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_GovernanceToken *GovernanceTokenCallerSession) Symbol() (string, error) { + return _GovernanceToken.Contract.Symbol(&_GovernanceToken.CallOpts) +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_GovernanceToken *GovernanceTokenCaller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _GovernanceToken.contract.Call(opts, &out, "totalSupply") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_GovernanceToken *GovernanceTokenSession) TotalSupply() (*big.Int, error) { + return _GovernanceToken.Contract.TotalSupply(&_GovernanceToken.CallOpts) +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_GovernanceToken *GovernanceTokenCallerSession) TotalSupply() (*big.Int, error) { + return _GovernanceToken.Contract.TotalSupply(&_GovernanceToken.CallOpts) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_GovernanceToken *GovernanceTokenTransactor) Approve(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _GovernanceToken.contract.Transact(opts, "approve", spender, amount) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_GovernanceToken *GovernanceTokenSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _GovernanceToken.Contract.Approve(&_GovernanceToken.TransactOpts, spender, amount) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_GovernanceToken *GovernanceTokenTransactorSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _GovernanceToken.Contract.Approve(&_GovernanceToken.TransactOpts, spender, amount) +} + +// Burn is a paid mutator transaction binding the contract method 0x42966c68. +// +// Solidity: function burn(uint256 amount) returns() +func (_GovernanceToken *GovernanceTokenTransactor) Burn(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) { + return _GovernanceToken.contract.Transact(opts, "burn", amount) +} + +// Burn is a paid mutator transaction binding the contract method 0x42966c68. +// +// Solidity: function burn(uint256 amount) returns() +func (_GovernanceToken *GovernanceTokenSession) Burn(amount *big.Int) (*types.Transaction, error) { + return _GovernanceToken.Contract.Burn(&_GovernanceToken.TransactOpts, amount) +} + +// Burn is a paid mutator transaction binding the contract method 0x42966c68. +// +// Solidity: function burn(uint256 amount) returns() +func (_GovernanceToken *GovernanceTokenTransactorSession) Burn(amount *big.Int) (*types.Transaction, error) { + return _GovernanceToken.Contract.Burn(&_GovernanceToken.TransactOpts, amount) +} + +// BurnFrom is a paid mutator transaction binding the contract method 0x79cc6790. +// +// Solidity: function burnFrom(address account, uint256 amount) returns() +func (_GovernanceToken *GovernanceTokenTransactor) BurnFrom(opts *bind.TransactOpts, account common.Address, amount *big.Int) (*types.Transaction, error) { + return _GovernanceToken.contract.Transact(opts, "burnFrom", account, amount) +} + +// BurnFrom is a paid mutator transaction binding the contract method 0x79cc6790. +// +// Solidity: function burnFrom(address account, uint256 amount) returns() +func (_GovernanceToken *GovernanceTokenSession) BurnFrom(account common.Address, amount *big.Int) (*types.Transaction, error) { + return _GovernanceToken.Contract.BurnFrom(&_GovernanceToken.TransactOpts, account, amount) +} + +// BurnFrom is a paid mutator transaction binding the contract method 0x79cc6790. +// +// Solidity: function burnFrom(address account, uint256 amount) returns() +func (_GovernanceToken *GovernanceTokenTransactorSession) BurnFrom(account common.Address, amount *big.Int) (*types.Transaction, error) { + return _GovernanceToken.Contract.BurnFrom(&_GovernanceToken.TransactOpts, account, amount) +} + +// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. +// +// Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) +func (_GovernanceToken *GovernanceTokenTransactor) DecreaseAllowance(opts *bind.TransactOpts, spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _GovernanceToken.contract.Transact(opts, "decreaseAllowance", spender, subtractedValue) +} + +// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. +// +// Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) +func (_GovernanceToken *GovernanceTokenSession) DecreaseAllowance(spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _GovernanceToken.Contract.DecreaseAllowance(&_GovernanceToken.TransactOpts, spender, subtractedValue) +} + +// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. +// +// Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) +func (_GovernanceToken *GovernanceTokenTransactorSession) DecreaseAllowance(spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _GovernanceToken.Contract.DecreaseAllowance(&_GovernanceToken.TransactOpts, spender, subtractedValue) +} + +// Delegate is a paid mutator transaction binding the contract method 0x5c19a95c. +// +// Solidity: function delegate(address delegatee) returns() +func (_GovernanceToken *GovernanceTokenTransactor) Delegate(opts *bind.TransactOpts, delegatee common.Address) (*types.Transaction, error) { + return _GovernanceToken.contract.Transact(opts, "delegate", delegatee) +} + +// Delegate is a paid mutator transaction binding the contract method 0x5c19a95c. +// +// Solidity: function delegate(address delegatee) returns() +func (_GovernanceToken *GovernanceTokenSession) Delegate(delegatee common.Address) (*types.Transaction, error) { + return _GovernanceToken.Contract.Delegate(&_GovernanceToken.TransactOpts, delegatee) +} + +// Delegate is a paid mutator transaction binding the contract method 0x5c19a95c. +// +// Solidity: function delegate(address delegatee) returns() +func (_GovernanceToken *GovernanceTokenTransactorSession) Delegate(delegatee common.Address) (*types.Transaction, error) { + return _GovernanceToken.Contract.Delegate(&_GovernanceToken.TransactOpts, delegatee) +} + +// DelegateBySig is a paid mutator transaction binding the contract method 0xc3cda520. +// +// Solidity: function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) returns() +func (_GovernanceToken *GovernanceTokenTransactor) DelegateBySig(opts *bind.TransactOpts, delegatee common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { + return _GovernanceToken.contract.Transact(opts, "delegateBySig", delegatee, nonce, expiry, v, r, s) +} + +// DelegateBySig is a paid mutator transaction binding the contract method 0xc3cda520. +// +// Solidity: function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) returns() +func (_GovernanceToken *GovernanceTokenSession) DelegateBySig(delegatee common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { + return _GovernanceToken.Contract.DelegateBySig(&_GovernanceToken.TransactOpts, delegatee, nonce, expiry, v, r, s) +} + +// DelegateBySig is a paid mutator transaction binding the contract method 0xc3cda520. +// +// Solidity: function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) returns() +func (_GovernanceToken *GovernanceTokenTransactorSession) DelegateBySig(delegatee common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { + return _GovernanceToken.Contract.DelegateBySig(&_GovernanceToken.TransactOpts, delegatee, nonce, expiry, v, r, s) +} + +// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. +// +// Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) +func (_GovernanceToken *GovernanceTokenTransactor) IncreaseAllowance(opts *bind.TransactOpts, spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _GovernanceToken.contract.Transact(opts, "increaseAllowance", spender, addedValue) +} + +// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. +// +// Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) +func (_GovernanceToken *GovernanceTokenSession) IncreaseAllowance(spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _GovernanceToken.Contract.IncreaseAllowance(&_GovernanceToken.TransactOpts, spender, addedValue) +} + +// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. +// +// Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) +func (_GovernanceToken *GovernanceTokenTransactorSession) IncreaseAllowance(spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _GovernanceToken.Contract.IncreaseAllowance(&_GovernanceToken.TransactOpts, spender, addedValue) +} + +// Mint is a paid mutator transaction binding the contract method 0x40c10f19. +// +// Solidity: function mint(address _account, uint256 _amount) returns() +func (_GovernanceToken *GovernanceTokenTransactor) Mint(opts *bind.TransactOpts, _account common.Address, _amount *big.Int) (*types.Transaction, error) { + return _GovernanceToken.contract.Transact(opts, "mint", _account, _amount) +} + +// Mint is a paid mutator transaction binding the contract method 0x40c10f19. +// +// Solidity: function mint(address _account, uint256 _amount) returns() +func (_GovernanceToken *GovernanceTokenSession) Mint(_account common.Address, _amount *big.Int) (*types.Transaction, error) { + return _GovernanceToken.Contract.Mint(&_GovernanceToken.TransactOpts, _account, _amount) +} + +// Mint is a paid mutator transaction binding the contract method 0x40c10f19. +// +// Solidity: function mint(address _account, uint256 _amount) returns() +func (_GovernanceToken *GovernanceTokenTransactorSession) Mint(_account common.Address, _amount *big.Int) (*types.Transaction, error) { + return _GovernanceToken.Contract.Mint(&_GovernanceToken.TransactOpts, _account, _amount) +} + +// Permit is a paid mutator transaction binding the contract method 0xd505accf. +// +// Solidity: function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) returns() +func (_GovernanceToken *GovernanceTokenTransactor) Permit(opts *bind.TransactOpts, owner common.Address, spender common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { + return _GovernanceToken.contract.Transact(opts, "permit", owner, spender, value, deadline, v, r, s) +} + +// Permit is a paid mutator transaction binding the contract method 0xd505accf. +// +// Solidity: function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) returns() +func (_GovernanceToken *GovernanceTokenSession) Permit(owner common.Address, spender common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { + return _GovernanceToken.Contract.Permit(&_GovernanceToken.TransactOpts, owner, spender, value, deadline, v, r, s) +} + +// Permit is a paid mutator transaction binding the contract method 0xd505accf. +// +// Solidity: function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) returns() +func (_GovernanceToken *GovernanceTokenTransactorSession) Permit(owner common.Address, spender common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { + return _GovernanceToken.Contract.Permit(&_GovernanceToken.TransactOpts, owner, spender, value, deadline, v, r, s) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_GovernanceToken *GovernanceTokenTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _GovernanceToken.contract.Transact(opts, "renounceOwnership") +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_GovernanceToken *GovernanceTokenSession) RenounceOwnership() (*types.Transaction, error) { + return _GovernanceToken.Contract.RenounceOwnership(&_GovernanceToken.TransactOpts) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_GovernanceToken *GovernanceTokenTransactorSession) RenounceOwnership() (*types.Transaction, error) { + return _GovernanceToken.Contract.RenounceOwnership(&_GovernanceToken.TransactOpts) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address to, uint256 amount) returns(bool) +func (_GovernanceToken *GovernanceTokenTransactor) Transfer(opts *bind.TransactOpts, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _GovernanceToken.contract.Transact(opts, "transfer", to, amount) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address to, uint256 amount) returns(bool) +func (_GovernanceToken *GovernanceTokenSession) Transfer(to common.Address, amount *big.Int) (*types.Transaction, error) { + return _GovernanceToken.Contract.Transfer(&_GovernanceToken.TransactOpts, to, amount) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address to, uint256 amount) returns(bool) +func (_GovernanceToken *GovernanceTokenTransactorSession) Transfer(to common.Address, amount *big.Int) (*types.Transaction, error) { + return _GovernanceToken.Contract.Transfer(&_GovernanceToken.TransactOpts, to, amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address from, address to, uint256 amount) returns(bool) +func (_GovernanceToken *GovernanceTokenTransactor) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _GovernanceToken.contract.Transact(opts, "transferFrom", from, to, amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address from, address to, uint256 amount) returns(bool) +func (_GovernanceToken *GovernanceTokenSession) TransferFrom(from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _GovernanceToken.Contract.TransferFrom(&_GovernanceToken.TransactOpts, from, to, amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address from, address to, uint256 amount) returns(bool) +func (_GovernanceToken *GovernanceTokenTransactorSession) TransferFrom(from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _GovernanceToken.Contract.TransferFrom(&_GovernanceToken.TransactOpts, from, to, amount) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_GovernanceToken *GovernanceTokenTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { + return _GovernanceToken.contract.Transact(opts, "transferOwnership", newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_GovernanceToken *GovernanceTokenSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _GovernanceToken.Contract.TransferOwnership(&_GovernanceToken.TransactOpts, newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_GovernanceToken *GovernanceTokenTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _GovernanceToken.Contract.TransferOwnership(&_GovernanceToken.TransactOpts, newOwner) +} + +// GovernanceTokenApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the GovernanceToken contract. +type GovernanceTokenApprovalIterator struct { + Event *GovernanceTokenApproval // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *GovernanceTokenApprovalIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(GovernanceTokenApproval) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(GovernanceTokenApproval) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *GovernanceTokenApprovalIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *GovernanceTokenApprovalIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// GovernanceTokenApproval represents a Approval event raised by the GovernanceToken contract. +type GovernanceTokenApproval struct { + Owner common.Address + Spender common.Address + Value *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_GovernanceToken *GovernanceTokenFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*GovernanceTokenApprovalIterator, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var spenderRule []interface{} + for _, spenderItem := range spender { + spenderRule = append(spenderRule, spenderItem) + } + + logs, sub, err := _GovernanceToken.contract.FilterLogs(opts, "Approval", ownerRule, spenderRule) + if err != nil { + return nil, err + } + return &GovernanceTokenApprovalIterator{contract: _GovernanceToken.contract, event: "Approval", logs: logs, sub: sub}, nil +} + +// WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_GovernanceToken *GovernanceTokenFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *GovernanceTokenApproval, owner []common.Address, spender []common.Address) (event.Subscription, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var spenderRule []interface{} + for _, spenderItem := range spender { + spenderRule = append(spenderRule, spenderItem) + } + + logs, sub, err := _GovernanceToken.contract.WatchLogs(opts, "Approval", ownerRule, spenderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(GovernanceTokenApproval) + if err := _GovernanceToken.contract.UnpackLog(event, "Approval", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_GovernanceToken *GovernanceTokenFilterer) ParseApproval(log types.Log) (*GovernanceTokenApproval, error) { + event := new(GovernanceTokenApproval) + if err := _GovernanceToken.contract.UnpackLog(event, "Approval", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// GovernanceTokenDelegateChangedIterator is returned from FilterDelegateChanged and is used to iterate over the raw logs and unpacked data for DelegateChanged events raised by the GovernanceToken contract. +type GovernanceTokenDelegateChangedIterator struct { + Event *GovernanceTokenDelegateChanged // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *GovernanceTokenDelegateChangedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(GovernanceTokenDelegateChanged) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(GovernanceTokenDelegateChanged) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *GovernanceTokenDelegateChangedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *GovernanceTokenDelegateChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// GovernanceTokenDelegateChanged represents a DelegateChanged event raised by the GovernanceToken contract. +type GovernanceTokenDelegateChanged struct { + Delegator common.Address + FromDelegate common.Address + ToDelegate common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterDelegateChanged is a free log retrieval operation binding the contract event 0x3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f. +// +// Solidity: event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate) +func (_GovernanceToken *GovernanceTokenFilterer) FilterDelegateChanged(opts *bind.FilterOpts, delegator []common.Address, fromDelegate []common.Address, toDelegate []common.Address) (*GovernanceTokenDelegateChangedIterator, error) { + + var delegatorRule []interface{} + for _, delegatorItem := range delegator { + delegatorRule = append(delegatorRule, delegatorItem) + } + var fromDelegateRule []interface{} + for _, fromDelegateItem := range fromDelegate { + fromDelegateRule = append(fromDelegateRule, fromDelegateItem) + } + var toDelegateRule []interface{} + for _, toDelegateItem := range toDelegate { + toDelegateRule = append(toDelegateRule, toDelegateItem) + } + + logs, sub, err := _GovernanceToken.contract.FilterLogs(opts, "DelegateChanged", delegatorRule, fromDelegateRule, toDelegateRule) + if err != nil { + return nil, err + } + return &GovernanceTokenDelegateChangedIterator{contract: _GovernanceToken.contract, event: "DelegateChanged", logs: logs, sub: sub}, nil +} + +// WatchDelegateChanged is a free log subscription operation binding the contract event 0x3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f. +// +// Solidity: event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate) +func (_GovernanceToken *GovernanceTokenFilterer) WatchDelegateChanged(opts *bind.WatchOpts, sink chan<- *GovernanceTokenDelegateChanged, delegator []common.Address, fromDelegate []common.Address, toDelegate []common.Address) (event.Subscription, error) { + + var delegatorRule []interface{} + for _, delegatorItem := range delegator { + delegatorRule = append(delegatorRule, delegatorItem) + } + var fromDelegateRule []interface{} + for _, fromDelegateItem := range fromDelegate { + fromDelegateRule = append(fromDelegateRule, fromDelegateItem) + } + var toDelegateRule []interface{} + for _, toDelegateItem := range toDelegate { + toDelegateRule = append(toDelegateRule, toDelegateItem) + } + + logs, sub, err := _GovernanceToken.contract.WatchLogs(opts, "DelegateChanged", delegatorRule, fromDelegateRule, toDelegateRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(GovernanceTokenDelegateChanged) + if err := _GovernanceToken.contract.UnpackLog(event, "DelegateChanged", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseDelegateChanged is a log parse operation binding the contract event 0x3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f. +// +// Solidity: event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate) +func (_GovernanceToken *GovernanceTokenFilterer) ParseDelegateChanged(log types.Log) (*GovernanceTokenDelegateChanged, error) { + event := new(GovernanceTokenDelegateChanged) + if err := _GovernanceToken.contract.UnpackLog(event, "DelegateChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// GovernanceTokenDelegateVotesChangedIterator is returned from FilterDelegateVotesChanged and is used to iterate over the raw logs and unpacked data for DelegateVotesChanged events raised by the GovernanceToken contract. +type GovernanceTokenDelegateVotesChangedIterator struct { + Event *GovernanceTokenDelegateVotesChanged // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *GovernanceTokenDelegateVotesChangedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(GovernanceTokenDelegateVotesChanged) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(GovernanceTokenDelegateVotesChanged) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *GovernanceTokenDelegateVotesChangedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *GovernanceTokenDelegateVotesChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// GovernanceTokenDelegateVotesChanged represents a DelegateVotesChanged event raised by the GovernanceToken contract. +type GovernanceTokenDelegateVotesChanged struct { + Delegate common.Address + PreviousBalance *big.Int + NewBalance *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterDelegateVotesChanged is a free log retrieval operation binding the contract event 0xdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724. +// +// Solidity: event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance) +func (_GovernanceToken *GovernanceTokenFilterer) FilterDelegateVotesChanged(opts *bind.FilterOpts, delegate []common.Address) (*GovernanceTokenDelegateVotesChangedIterator, error) { + + var delegateRule []interface{} + for _, delegateItem := range delegate { + delegateRule = append(delegateRule, delegateItem) + } + + logs, sub, err := _GovernanceToken.contract.FilterLogs(opts, "DelegateVotesChanged", delegateRule) + if err != nil { + return nil, err + } + return &GovernanceTokenDelegateVotesChangedIterator{contract: _GovernanceToken.contract, event: "DelegateVotesChanged", logs: logs, sub: sub}, nil +} + +// WatchDelegateVotesChanged is a free log subscription operation binding the contract event 0xdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724. +// +// Solidity: event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance) +func (_GovernanceToken *GovernanceTokenFilterer) WatchDelegateVotesChanged(opts *bind.WatchOpts, sink chan<- *GovernanceTokenDelegateVotesChanged, delegate []common.Address) (event.Subscription, error) { + + var delegateRule []interface{} + for _, delegateItem := range delegate { + delegateRule = append(delegateRule, delegateItem) + } + + logs, sub, err := _GovernanceToken.contract.WatchLogs(opts, "DelegateVotesChanged", delegateRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(GovernanceTokenDelegateVotesChanged) + if err := _GovernanceToken.contract.UnpackLog(event, "DelegateVotesChanged", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseDelegateVotesChanged is a log parse operation binding the contract event 0xdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724. +// +// Solidity: event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance) +func (_GovernanceToken *GovernanceTokenFilterer) ParseDelegateVotesChanged(log types.Log) (*GovernanceTokenDelegateVotesChanged, error) { + event := new(GovernanceTokenDelegateVotesChanged) + if err := _GovernanceToken.contract.UnpackLog(event, "DelegateVotesChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// GovernanceTokenOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the GovernanceToken contract. +type GovernanceTokenOwnershipTransferredIterator struct { + Event *GovernanceTokenOwnershipTransferred // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *GovernanceTokenOwnershipTransferredIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(GovernanceTokenOwnershipTransferred) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(GovernanceTokenOwnershipTransferred) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *GovernanceTokenOwnershipTransferredIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *GovernanceTokenOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// GovernanceTokenOwnershipTransferred represents a OwnershipTransferred event raised by the GovernanceToken contract. +type GovernanceTokenOwnershipTransferred struct { + PreviousOwner common.Address + NewOwner common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_GovernanceToken *GovernanceTokenFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*GovernanceTokenOwnershipTransferredIterator, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _GovernanceToken.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return &GovernanceTokenOwnershipTransferredIterator{contract: _GovernanceToken.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_GovernanceToken *GovernanceTokenFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *GovernanceTokenOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _GovernanceToken.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(GovernanceTokenOwnershipTransferred) + if err := _GovernanceToken.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_GovernanceToken *GovernanceTokenFilterer) ParseOwnershipTransferred(log types.Log) (*GovernanceTokenOwnershipTransferred, error) { + event := new(GovernanceTokenOwnershipTransferred) + if err := _GovernanceToken.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// GovernanceTokenTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the GovernanceToken contract. +type GovernanceTokenTransferIterator struct { + Event *GovernanceTokenTransfer // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *GovernanceTokenTransferIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(GovernanceTokenTransfer) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(GovernanceTokenTransfer) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *GovernanceTokenTransferIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *GovernanceTokenTransferIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// GovernanceTokenTransfer represents a Transfer event raised by the GovernanceToken contract. +type GovernanceTokenTransfer struct { + From common.Address + To common.Address + Value *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_GovernanceToken *GovernanceTokenFilterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*GovernanceTokenTransferIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _GovernanceToken.contract.FilterLogs(opts, "Transfer", fromRule, toRule) + if err != nil { + return nil, err + } + return &GovernanceTokenTransferIterator{contract: _GovernanceToken.contract, event: "Transfer", logs: logs, sub: sub}, nil +} + +// WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_GovernanceToken *GovernanceTokenFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *GovernanceTokenTransfer, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _GovernanceToken.contract.WatchLogs(opts, "Transfer", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(GovernanceTokenTransfer) + if err := _GovernanceToken.contract.UnpackLog(event, "Transfer", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_GovernanceToken *GovernanceTokenFilterer) ParseTransfer(log types.Log) (*GovernanceTokenTransfer, error) { + event := new(GovernanceTokenTransfer) + if err := _GovernanceToken.contract.UnpackLog(event, "Transfer", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/op-e2e2/bindings/isemver.go b/op-e2e2/bindings/isemver.go new file mode 100644 index 000000000000..66a940654d05 --- /dev/null +++ b/op-e2e2/bindings/isemver.go @@ -0,0 +1,211 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// ISemverMetaData contains all meta data concerning the ISemver contract. +var ISemverMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"}]", +} + +// ISemverABI is the input ABI used to generate the binding from. +// Deprecated: Use ISemverMetaData.ABI instead. +var ISemverABI = ISemverMetaData.ABI + +// ISemver is an auto generated Go binding around an Ethereum contract. +type ISemver struct { + ISemverCaller // Read-only binding to the contract + ISemverTransactor // Write-only binding to the contract + ISemverFilterer // Log filterer for contract events +} + +// ISemverCaller is an auto generated read-only Go binding around an Ethereum contract. +type ISemverCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ISemverTransactor is an auto generated write-only Go binding around an Ethereum contract. +type ISemverTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ISemverFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type ISemverFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ISemverSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type ISemverSession struct { + Contract *ISemver // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// ISemverCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type ISemverCallerSession struct { + Contract *ISemverCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// ISemverTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type ISemverTransactorSession struct { + Contract *ISemverTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// ISemverRaw is an auto generated low-level Go binding around an Ethereum contract. +type ISemverRaw struct { + Contract *ISemver // Generic contract binding to access the raw methods on +} + +// ISemverCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type ISemverCallerRaw struct { + Contract *ISemverCaller // Generic read-only contract binding to access the raw methods on +} + +// ISemverTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type ISemverTransactorRaw struct { + Contract *ISemverTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewISemver creates a new instance of ISemver, bound to a specific deployed contract. +func NewISemver(address common.Address, backend bind.ContractBackend) (*ISemver, error) { + contract, err := bindISemver(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &ISemver{ISemverCaller: ISemverCaller{contract: contract}, ISemverTransactor: ISemverTransactor{contract: contract}, ISemverFilterer: ISemverFilterer{contract: contract}}, nil +} + +// NewISemverCaller creates a new read-only instance of ISemver, bound to a specific deployed contract. +func NewISemverCaller(address common.Address, caller bind.ContractCaller) (*ISemverCaller, error) { + contract, err := bindISemver(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &ISemverCaller{contract: contract}, nil +} + +// NewISemverTransactor creates a new write-only instance of ISemver, bound to a specific deployed contract. +func NewISemverTransactor(address common.Address, transactor bind.ContractTransactor) (*ISemverTransactor, error) { + contract, err := bindISemver(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &ISemverTransactor{contract: contract}, nil +} + +// NewISemverFilterer creates a new log filterer instance of ISemver, bound to a specific deployed contract. +func NewISemverFilterer(address common.Address, filterer bind.ContractFilterer) (*ISemverFilterer, error) { + contract, err := bindISemver(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &ISemverFilterer{contract: contract}, nil +} + +// bindISemver binds a generic wrapper to an already deployed contract. +func bindISemver(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(ISemverABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_ISemver *ISemverRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _ISemver.Contract.ISemverCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_ISemver *ISemverRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ISemver.Contract.ISemverTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_ISemver *ISemverRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ISemver.Contract.ISemverTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_ISemver *ISemverCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _ISemver.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_ISemver *ISemverTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ISemver.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_ISemver *ISemverTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ISemver.Contract.contract.Transact(opts, method, params...) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_ISemver *ISemverCaller) Version(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _ISemver.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 (_ISemver *ISemverSession) Version() (string, error) { + return _ISemver.Contract.Version(&_ISemver.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_ISemver *ISemverCallerSession) Version() (string, error) { + return _ISemver.Contract.Version(&_ISemver.CallOpts) +} diff --git a/op-e2e2/bindings/l1block.go b/op-e2e2/bindings/l1block.go new file mode 100644 index 000000000000..e44c262c7dae --- /dev/null +++ b/op-e2e2/bindings/l1block.go @@ -0,0 +1,961 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// L1BlockMetaData contains all meta data concerning the L1Block contract. +var L1BlockMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"function\",\"name\":\"DEPOSITOR_ACCOUNT\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"baseFeeScalar\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"basefee\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"batcherHash\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blobBaseFee\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blobBaseFeeScalar\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"gasPayingToken\",\"inputs\":[],\"outputs\":[{\"name\":\"addr_\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"decimals_\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"gasPayingTokenName\",\"inputs\":[],\"outputs\":[{\"name\":\"name_\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"gasPayingTokenSymbol\",\"inputs\":[],\"outputs\":[{\"name\":\"symbol_\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"hash\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isCustomGasToken\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"l1FeeOverhead\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"l1FeeScalar\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"number\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"sequenceNumber\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"setGasPayingToken\",\"inputs\":[{\"name\":\"_token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_decimals\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"_name\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_symbol\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setL1BlockValues\",\"inputs\":[{\"name\":\"_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_timestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_basefee\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_hash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_sequenceNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_batcherHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_l1FeeOverhead\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_l1FeeScalar\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setL1BlockValuesEcotone\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"timestamp\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"GasPayingTokenSet\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"decimals\",\"type\":\"uint8\",\"indexed\":true,\"internalType\":\"uint8\"},{\"name\":\"name\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"symbol\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"NotDepositor\",\"inputs\":[]}]", + Bin: "0x608060405234801561001057600080fd5b50610ae8806100206000396000f3fe608060405234801561001057600080fd5b506004361061016c5760003560e01c806371cfaa3f116100cd578063c598591811610081578063e591b28211610066578063e591b28214610331578063e81b2c6d14610371578063f82061401461037a57600080fd5b8063c598591814610309578063d84447151461032957600080fd5b80638b239f73116100b25780638b239f73146102d75780639e8c4966146102e0578063b80777ea146102e957600080fd5b806371cfaa3f146102b05780638381f58a146102c357600080fd5b806354fd4d50116101245780635cf24969116101095780635cf249691461024957806364ca23ef1461025257806368d5dca61461027f57600080fd5b806354fd4d50146101f8578063550fcdc91461024157600080fd5b8063213268491161015557806321326849146101a25780634397dfef146101ba578063440a5e20146101f057600080fd5b8063015d8eb91461017157806309bd5a6014610186575b600080fd5b61018461017f366004610953565b610383565b005b61018f60025481565b6040519081526020015b60405180910390f35b6101aa6104c2565b6040519015158152602001610199565b6101c2610501565b6040805173ffffffffffffffffffffffffffffffffffffffff909316835260ff909116602083015201610199565b610184610515565b6102346040518060400160405280601b81526020017f312e332e302d626574612b637573746f6d2d6761732d746f6b656e000000000081525081565b60405161019991906109c5565b61023461056a565b61018f60015481565b6003546102669067ffffffffffffffff1681565b60405167ffffffffffffffff9091168152602001610199565b60035461029b9068010000000000000000900463ffffffff1681565b60405163ffffffff9091168152602001610199565b6101846102be366004610a38565b610579565b6000546102669067ffffffffffffffff1681565b61018f60055481565b61018f60065481565b6000546102669068010000000000000000900467ffffffffffffffff1681565b60035461029b906c01000000000000000000000000900463ffffffff1681565b61023461062e565b61034c73deaddeaddeaddeaddeaddeaddeaddeaddead000181565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610199565b61018f60045481565b61018f60075481565b3373deaddeaddeaddeaddeaddeaddeaddeaddead00011461042a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603b60248201527f4c31426c6f636b3a206f6e6c7920746865206465706f7369746f72206163636f60448201527f756e742063616e20736574204c3120626c6f636b2076616c7565730000000000606482015260840160405180910390fd5b6000805467ffffffffffffffff98891668010000000000000000027fffffffffffffffffffffffffffffffff00000000000000000000000000000000909116998916999099179890981790975560019490945560029290925560038054919094167fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000009190911617909255600491909155600555600655565b6000806104cd610501565b5073ffffffffffffffffffffffffffffffffffffffff1673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee141592915050565b60008061050c610638565b90939092509050565b3373deaddeaddeaddeaddeaddeaddeaddeaddead00011461053e57633cc50b456000526004601cfd5b60043560801c60035560143560801c600055602435600155604435600755606435600255608435600455565b60606105746106b9565b905090565b3373deaddeaddeaddeaddeaddeaddeaddeaddead0001146105c6576040517f3cc50b4500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6105d28484848461077a565b604080518381526020810183905260ff85169173ffffffffffffffffffffffffffffffffffffffff8716917f10e43c4d58f3ef4edae7c1ca2e7f02d46b2cadbcc046737038527ed8486ffeb0910160405180910390a350505050565b606061057461084c565b6000808061066e61066a60017f04adb1412b2ddc16fcc0d4538d5c8f07cf9c83abecc6b41f6f69037b708fbcec610a9d565b5490565b73ffffffffffffffffffffffffffffffffffffffff811693509050826106ad575073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee92601292509050565b60a081901c9150509091565b606060006106c5610638565b5090507fffffffffffffffffffffffff111111111111111111111111111111111111111273ffffffffffffffffffffffffffffffffffffffff82160161073e57505060408051808201909152600381527f4554480000000000000000000000000000000000000000000000000000000000602082015290565b61077461076f61066a60017fa48b38a4b44951360fbdcbfaaeae5ed6ae92585412e9841b70ec72ed8cd05764610a9d565b610902565b91505090565b6107e06107a860017f04adb1412b2ddc16fcc0d4538d5c8f07cf9c83abecc6b41f6f69037b708fbcec610a9d565b74ff000000000000000000000000000000000000000060a086901b1673ffffffffffffffffffffffffffffffffffffffff8716179055565b61081361080e60017f657c3582c29b3176614e3a33ddd1ec48352696a04e92b3c0566d72010fa8863d610a9d565b839055565b61084661084160017fa48b38a4b44951360fbdcbfaaeae5ed6ae92585412e9841b70ec72ed8cd05764610a9d565b829055565b50505050565b60606000610858610638565b5090507fffffffffffffffffffffffff111111111111111111111111111111111111111273ffffffffffffffffffffffffffffffffffffffff8216016108d157505060408051808201909152600581527f4574686572000000000000000000000000000000000000000000000000000000602082015290565b61077461076f61066a60017f657c3582c29b3176614e3a33ddd1ec48352696a04e92b3c0566d72010fa8863d610a9d565b60405160005b82811a1561091857600101610908565b80825260208201838152600082820152505060408101604052919050565b803567ffffffffffffffff8116811461094e57600080fd5b919050565b600080600080600080600080610100898b03121561097057600080fd5b61097989610936565b975061098760208a01610936565b965060408901359550606089013594506109a360808a01610936565b979a969950949793969560a0850135955060c08501359460e001359350915050565b600060208083528351808285015260005b818110156109f2578581018301518582016040015282016109d6565b81811115610a04576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b60008060008060808587031215610a4e57600080fd5b843573ffffffffffffffffffffffffffffffffffffffff81168114610a7257600080fd5b9350602085013560ff81168114610a8857600080fd5b93969395505050506040820135916060013590565b600082821015610ad6577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b50039056fea164736f6c634300080f000a", +} + +// L1BlockABI is the input ABI used to generate the binding from. +// Deprecated: Use L1BlockMetaData.ABI instead. +var L1BlockABI = L1BlockMetaData.ABI + +// L1BlockBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use L1BlockMetaData.Bin instead. +var L1BlockBin = L1BlockMetaData.Bin + +// DeployL1Block deploys a new Ethereum contract, binding an instance of L1Block to it. +func DeployL1Block(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *L1Block, error) { + parsed, err := L1BlockMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(L1BlockBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &L1Block{L1BlockCaller: L1BlockCaller{contract: contract}, L1BlockTransactor: L1BlockTransactor{contract: contract}, L1BlockFilterer: L1BlockFilterer{contract: contract}}, nil +} + +// L1Block is an auto generated Go binding around an Ethereum contract. +type L1Block struct { + L1BlockCaller // Read-only binding to the contract + L1BlockTransactor // Write-only binding to the contract + L1BlockFilterer // Log filterer for contract events +} + +// L1BlockCaller is an auto generated read-only Go binding around an Ethereum contract. +type L1BlockCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// L1BlockTransactor is an auto generated write-only Go binding around an Ethereum contract. +type L1BlockTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// L1BlockFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type L1BlockFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// L1BlockSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type L1BlockSession struct { + Contract *L1Block // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// L1BlockCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type L1BlockCallerSession struct { + Contract *L1BlockCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// L1BlockTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type L1BlockTransactorSession struct { + Contract *L1BlockTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// L1BlockRaw is an auto generated low-level Go binding around an Ethereum contract. +type L1BlockRaw struct { + Contract *L1Block // Generic contract binding to access the raw methods on +} + +// L1BlockCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type L1BlockCallerRaw struct { + Contract *L1BlockCaller // Generic read-only contract binding to access the raw methods on +} + +// L1BlockTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type L1BlockTransactorRaw struct { + Contract *L1BlockTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewL1Block creates a new instance of L1Block, bound to a specific deployed contract. +func NewL1Block(address common.Address, backend bind.ContractBackend) (*L1Block, error) { + contract, err := bindL1Block(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &L1Block{L1BlockCaller: L1BlockCaller{contract: contract}, L1BlockTransactor: L1BlockTransactor{contract: contract}, L1BlockFilterer: L1BlockFilterer{contract: contract}}, nil +} + +// NewL1BlockCaller creates a new read-only instance of L1Block, bound to a specific deployed contract. +func NewL1BlockCaller(address common.Address, caller bind.ContractCaller) (*L1BlockCaller, error) { + contract, err := bindL1Block(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &L1BlockCaller{contract: contract}, nil +} + +// NewL1BlockTransactor creates a new write-only instance of L1Block, bound to a specific deployed contract. +func NewL1BlockTransactor(address common.Address, transactor bind.ContractTransactor) (*L1BlockTransactor, error) { + contract, err := bindL1Block(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &L1BlockTransactor{contract: contract}, nil +} + +// NewL1BlockFilterer creates a new log filterer instance of L1Block, bound to a specific deployed contract. +func NewL1BlockFilterer(address common.Address, filterer bind.ContractFilterer) (*L1BlockFilterer, error) { + contract, err := bindL1Block(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &L1BlockFilterer{contract: contract}, nil +} + +// bindL1Block binds a generic wrapper to an already deployed contract. +func bindL1Block(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(L1BlockABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_L1Block *L1BlockRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _L1Block.Contract.L1BlockCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_L1Block *L1BlockRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _L1Block.Contract.L1BlockTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_L1Block *L1BlockRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _L1Block.Contract.L1BlockTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_L1Block *L1BlockCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _L1Block.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_L1Block *L1BlockTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _L1Block.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_L1Block *L1BlockTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _L1Block.Contract.contract.Transact(opts, method, params...) +} + +// DEPOSITORACCOUNT is a free data retrieval call binding the contract method 0xe591b282. +// +// Solidity: function DEPOSITOR_ACCOUNT() view returns(address) +func (_L1Block *L1BlockCaller) DEPOSITORACCOUNT(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _L1Block.contract.Call(opts, &out, "DEPOSITOR_ACCOUNT") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// DEPOSITORACCOUNT is a free data retrieval call binding the contract method 0xe591b282. +// +// Solidity: function DEPOSITOR_ACCOUNT() view returns(address) +func (_L1Block *L1BlockSession) DEPOSITORACCOUNT() (common.Address, error) { + return _L1Block.Contract.DEPOSITORACCOUNT(&_L1Block.CallOpts) +} + +// DEPOSITORACCOUNT is a free data retrieval call binding the contract method 0xe591b282. +// +// Solidity: function DEPOSITOR_ACCOUNT() view returns(address) +func (_L1Block *L1BlockCallerSession) DEPOSITORACCOUNT() (common.Address, error) { + return _L1Block.Contract.DEPOSITORACCOUNT(&_L1Block.CallOpts) +} + +// BaseFeeScalar is a free data retrieval call binding the contract method 0xc5985918. +// +// Solidity: function baseFeeScalar() view returns(uint32) +func (_L1Block *L1BlockCaller) BaseFeeScalar(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _L1Block.contract.Call(opts, &out, "baseFeeScalar") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// BaseFeeScalar is a free data retrieval call binding the contract method 0xc5985918. +// +// Solidity: function baseFeeScalar() view returns(uint32) +func (_L1Block *L1BlockSession) BaseFeeScalar() (uint32, error) { + return _L1Block.Contract.BaseFeeScalar(&_L1Block.CallOpts) +} + +// BaseFeeScalar is a free data retrieval call binding the contract method 0xc5985918. +// +// Solidity: function baseFeeScalar() view returns(uint32) +func (_L1Block *L1BlockCallerSession) BaseFeeScalar() (uint32, error) { + return _L1Block.Contract.BaseFeeScalar(&_L1Block.CallOpts) +} + +// Basefee is a free data retrieval call binding the contract method 0x5cf24969. +// +// Solidity: function basefee() view returns(uint256) +func (_L1Block *L1BlockCaller) Basefee(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _L1Block.contract.Call(opts, &out, "basefee") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Basefee is a free data retrieval call binding the contract method 0x5cf24969. +// +// Solidity: function basefee() view returns(uint256) +func (_L1Block *L1BlockSession) Basefee() (*big.Int, error) { + return _L1Block.Contract.Basefee(&_L1Block.CallOpts) +} + +// Basefee is a free data retrieval call binding the contract method 0x5cf24969. +// +// Solidity: function basefee() view returns(uint256) +func (_L1Block *L1BlockCallerSession) Basefee() (*big.Int, error) { + return _L1Block.Contract.Basefee(&_L1Block.CallOpts) +} + +// BatcherHash is a free data retrieval call binding the contract method 0xe81b2c6d. +// +// Solidity: function batcherHash() view returns(bytes32) +func (_L1Block *L1BlockCaller) BatcherHash(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _L1Block.contract.Call(opts, &out, "batcherHash") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// BatcherHash is a free data retrieval call binding the contract method 0xe81b2c6d. +// +// Solidity: function batcherHash() view returns(bytes32) +func (_L1Block *L1BlockSession) BatcherHash() ([32]byte, error) { + return _L1Block.Contract.BatcherHash(&_L1Block.CallOpts) +} + +// BatcherHash is a free data retrieval call binding the contract method 0xe81b2c6d. +// +// Solidity: function batcherHash() view returns(bytes32) +func (_L1Block *L1BlockCallerSession) BatcherHash() ([32]byte, error) { + return _L1Block.Contract.BatcherHash(&_L1Block.CallOpts) +} + +// BlobBaseFee is a free data retrieval call binding the contract method 0xf8206140. +// +// Solidity: function blobBaseFee() view returns(uint256) +func (_L1Block *L1BlockCaller) BlobBaseFee(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _L1Block.contract.Call(opts, &out, "blobBaseFee") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// BlobBaseFee is a free data retrieval call binding the contract method 0xf8206140. +// +// Solidity: function blobBaseFee() view returns(uint256) +func (_L1Block *L1BlockSession) BlobBaseFee() (*big.Int, error) { + return _L1Block.Contract.BlobBaseFee(&_L1Block.CallOpts) +} + +// BlobBaseFee is a free data retrieval call binding the contract method 0xf8206140. +// +// Solidity: function blobBaseFee() view returns(uint256) +func (_L1Block *L1BlockCallerSession) BlobBaseFee() (*big.Int, error) { + return _L1Block.Contract.BlobBaseFee(&_L1Block.CallOpts) +} + +// BlobBaseFeeScalar is a free data retrieval call binding the contract method 0x68d5dca6. +// +// Solidity: function blobBaseFeeScalar() view returns(uint32) +func (_L1Block *L1BlockCaller) BlobBaseFeeScalar(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _L1Block.contract.Call(opts, &out, "blobBaseFeeScalar") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// BlobBaseFeeScalar is a free data retrieval call binding the contract method 0x68d5dca6. +// +// Solidity: function blobBaseFeeScalar() view returns(uint32) +func (_L1Block *L1BlockSession) BlobBaseFeeScalar() (uint32, error) { + return _L1Block.Contract.BlobBaseFeeScalar(&_L1Block.CallOpts) +} + +// BlobBaseFeeScalar is a free data retrieval call binding the contract method 0x68d5dca6. +// +// Solidity: function blobBaseFeeScalar() view returns(uint32) +func (_L1Block *L1BlockCallerSession) BlobBaseFeeScalar() (uint32, error) { + return _L1Block.Contract.BlobBaseFeeScalar(&_L1Block.CallOpts) +} + +// GasPayingToken is a free data retrieval call binding the contract method 0x4397dfef. +// +// Solidity: function gasPayingToken() view returns(address addr_, uint8 decimals_) +func (_L1Block *L1BlockCaller) GasPayingToken(opts *bind.CallOpts) (struct { + Addr common.Address + Decimals uint8 +}, error) { + var out []interface{} + err := _L1Block.contract.Call(opts, &out, "gasPayingToken") + + outstruct := new(struct { + Addr common.Address + Decimals uint8 + }) + if err != nil { + return *outstruct, err + } + + outstruct.Addr = *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + outstruct.Decimals = *abi.ConvertType(out[1], new(uint8)).(*uint8) + + return *outstruct, err + +} + +// GasPayingToken is a free data retrieval call binding the contract method 0x4397dfef. +// +// Solidity: function gasPayingToken() view returns(address addr_, uint8 decimals_) +func (_L1Block *L1BlockSession) GasPayingToken() (struct { + Addr common.Address + Decimals uint8 +}, error) { + return _L1Block.Contract.GasPayingToken(&_L1Block.CallOpts) +} + +// GasPayingToken is a free data retrieval call binding the contract method 0x4397dfef. +// +// Solidity: function gasPayingToken() view returns(address addr_, uint8 decimals_) +func (_L1Block *L1BlockCallerSession) GasPayingToken() (struct { + Addr common.Address + Decimals uint8 +}, error) { + return _L1Block.Contract.GasPayingToken(&_L1Block.CallOpts) +} + +// GasPayingTokenName is a free data retrieval call binding the contract method 0xd8444715. +// +// Solidity: function gasPayingTokenName() view returns(string name_) +func (_L1Block *L1BlockCaller) GasPayingTokenName(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _L1Block.contract.Call(opts, &out, "gasPayingTokenName") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// GasPayingTokenName is a free data retrieval call binding the contract method 0xd8444715. +// +// Solidity: function gasPayingTokenName() view returns(string name_) +func (_L1Block *L1BlockSession) GasPayingTokenName() (string, error) { + return _L1Block.Contract.GasPayingTokenName(&_L1Block.CallOpts) +} + +// GasPayingTokenName is a free data retrieval call binding the contract method 0xd8444715. +// +// Solidity: function gasPayingTokenName() view returns(string name_) +func (_L1Block *L1BlockCallerSession) GasPayingTokenName() (string, error) { + return _L1Block.Contract.GasPayingTokenName(&_L1Block.CallOpts) +} + +// GasPayingTokenSymbol is a free data retrieval call binding the contract method 0x550fcdc9. +// +// Solidity: function gasPayingTokenSymbol() view returns(string symbol_) +func (_L1Block *L1BlockCaller) GasPayingTokenSymbol(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _L1Block.contract.Call(opts, &out, "gasPayingTokenSymbol") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// GasPayingTokenSymbol is a free data retrieval call binding the contract method 0x550fcdc9. +// +// Solidity: function gasPayingTokenSymbol() view returns(string symbol_) +func (_L1Block *L1BlockSession) GasPayingTokenSymbol() (string, error) { + return _L1Block.Contract.GasPayingTokenSymbol(&_L1Block.CallOpts) +} + +// GasPayingTokenSymbol is a free data retrieval call binding the contract method 0x550fcdc9. +// +// Solidity: function gasPayingTokenSymbol() view returns(string symbol_) +func (_L1Block *L1BlockCallerSession) GasPayingTokenSymbol() (string, error) { + return _L1Block.Contract.GasPayingTokenSymbol(&_L1Block.CallOpts) +} + +// Hash is a free data retrieval call binding the contract method 0x09bd5a60. +// +// Solidity: function hash() view returns(bytes32) +func (_L1Block *L1BlockCaller) Hash(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _L1Block.contract.Call(opts, &out, "hash") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// Hash is a free data retrieval call binding the contract method 0x09bd5a60. +// +// Solidity: function hash() view returns(bytes32) +func (_L1Block *L1BlockSession) Hash() ([32]byte, error) { + return _L1Block.Contract.Hash(&_L1Block.CallOpts) +} + +// Hash is a free data retrieval call binding the contract method 0x09bd5a60. +// +// Solidity: function hash() view returns(bytes32) +func (_L1Block *L1BlockCallerSession) Hash() ([32]byte, error) { + return _L1Block.Contract.Hash(&_L1Block.CallOpts) +} + +// IsCustomGasToken is a free data retrieval call binding the contract method 0x21326849. +// +// Solidity: function isCustomGasToken() view returns(bool) +func (_L1Block *L1BlockCaller) IsCustomGasToken(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _L1Block.contract.Call(opts, &out, "isCustomGasToken") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsCustomGasToken is a free data retrieval call binding the contract method 0x21326849. +// +// Solidity: function isCustomGasToken() view returns(bool) +func (_L1Block *L1BlockSession) IsCustomGasToken() (bool, error) { + return _L1Block.Contract.IsCustomGasToken(&_L1Block.CallOpts) +} + +// IsCustomGasToken is a free data retrieval call binding the contract method 0x21326849. +// +// Solidity: function isCustomGasToken() view returns(bool) +func (_L1Block *L1BlockCallerSession) IsCustomGasToken() (bool, error) { + return _L1Block.Contract.IsCustomGasToken(&_L1Block.CallOpts) +} + +// L1FeeOverhead is a free data retrieval call binding the contract method 0x8b239f73. +// +// Solidity: function l1FeeOverhead() view returns(uint256) +func (_L1Block *L1BlockCaller) L1FeeOverhead(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _L1Block.contract.Call(opts, &out, "l1FeeOverhead") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// L1FeeOverhead is a free data retrieval call binding the contract method 0x8b239f73. +// +// Solidity: function l1FeeOverhead() view returns(uint256) +func (_L1Block *L1BlockSession) L1FeeOverhead() (*big.Int, error) { + return _L1Block.Contract.L1FeeOverhead(&_L1Block.CallOpts) +} + +// L1FeeOverhead is a free data retrieval call binding the contract method 0x8b239f73. +// +// Solidity: function l1FeeOverhead() view returns(uint256) +func (_L1Block *L1BlockCallerSession) L1FeeOverhead() (*big.Int, error) { + return _L1Block.Contract.L1FeeOverhead(&_L1Block.CallOpts) +} + +// L1FeeScalar is a free data retrieval call binding the contract method 0x9e8c4966. +// +// Solidity: function l1FeeScalar() view returns(uint256) +func (_L1Block *L1BlockCaller) L1FeeScalar(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _L1Block.contract.Call(opts, &out, "l1FeeScalar") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// L1FeeScalar is a free data retrieval call binding the contract method 0x9e8c4966. +// +// Solidity: function l1FeeScalar() view returns(uint256) +func (_L1Block *L1BlockSession) L1FeeScalar() (*big.Int, error) { + return _L1Block.Contract.L1FeeScalar(&_L1Block.CallOpts) +} + +// L1FeeScalar is a free data retrieval call binding the contract method 0x9e8c4966. +// +// Solidity: function l1FeeScalar() view returns(uint256) +func (_L1Block *L1BlockCallerSession) L1FeeScalar() (*big.Int, error) { + return _L1Block.Contract.L1FeeScalar(&_L1Block.CallOpts) +} + +// Number is a free data retrieval call binding the contract method 0x8381f58a. +// +// Solidity: function number() view returns(uint64) +func (_L1Block *L1BlockCaller) Number(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _L1Block.contract.Call(opts, &out, "number") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// Number is a free data retrieval call binding the contract method 0x8381f58a. +// +// Solidity: function number() view returns(uint64) +func (_L1Block *L1BlockSession) Number() (uint64, error) { + return _L1Block.Contract.Number(&_L1Block.CallOpts) +} + +// Number is a free data retrieval call binding the contract method 0x8381f58a. +// +// Solidity: function number() view returns(uint64) +func (_L1Block *L1BlockCallerSession) Number() (uint64, error) { + return _L1Block.Contract.Number(&_L1Block.CallOpts) +} + +// SequenceNumber is a free data retrieval call binding the contract method 0x64ca23ef. +// +// Solidity: function sequenceNumber() view returns(uint64) +func (_L1Block *L1BlockCaller) SequenceNumber(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _L1Block.contract.Call(opts, &out, "sequenceNumber") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// SequenceNumber is a free data retrieval call binding the contract method 0x64ca23ef. +// +// Solidity: function sequenceNumber() view returns(uint64) +func (_L1Block *L1BlockSession) SequenceNumber() (uint64, error) { + return _L1Block.Contract.SequenceNumber(&_L1Block.CallOpts) +} + +// SequenceNumber is a free data retrieval call binding the contract method 0x64ca23ef. +// +// Solidity: function sequenceNumber() view returns(uint64) +func (_L1Block *L1BlockCallerSession) SequenceNumber() (uint64, error) { + return _L1Block.Contract.SequenceNumber(&_L1Block.CallOpts) +} + +// Timestamp is a free data retrieval call binding the contract method 0xb80777ea. +// +// Solidity: function timestamp() view returns(uint64) +func (_L1Block *L1BlockCaller) Timestamp(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _L1Block.contract.Call(opts, &out, "timestamp") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// Timestamp is a free data retrieval call binding the contract method 0xb80777ea. +// +// Solidity: function timestamp() view returns(uint64) +func (_L1Block *L1BlockSession) Timestamp() (uint64, error) { + return _L1Block.Contract.Timestamp(&_L1Block.CallOpts) +} + +// Timestamp is a free data retrieval call binding the contract method 0xb80777ea. +// +// Solidity: function timestamp() view returns(uint64) +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) +} + +// SetGasPayingToken is a paid mutator transaction binding the contract method 0x71cfaa3f. +// +// Solidity: function setGasPayingToken(address _token, uint8 _decimals, bytes32 _name, bytes32 _symbol) returns() +func (_L1Block *L1BlockTransactor) SetGasPayingToken(opts *bind.TransactOpts, _token common.Address, _decimals uint8, _name [32]byte, _symbol [32]byte) (*types.Transaction, error) { + return _L1Block.contract.Transact(opts, "setGasPayingToken", _token, _decimals, _name, _symbol) +} + +// SetGasPayingToken is a paid mutator transaction binding the contract method 0x71cfaa3f. +// +// Solidity: function setGasPayingToken(address _token, uint8 _decimals, bytes32 _name, bytes32 _symbol) returns() +func (_L1Block *L1BlockSession) SetGasPayingToken(_token common.Address, _decimals uint8, _name [32]byte, _symbol [32]byte) (*types.Transaction, error) { + return _L1Block.Contract.SetGasPayingToken(&_L1Block.TransactOpts, _token, _decimals, _name, _symbol) +} + +// SetGasPayingToken is a paid mutator transaction binding the contract method 0x71cfaa3f. +// +// Solidity: function setGasPayingToken(address _token, uint8 _decimals, bytes32 _name, bytes32 _symbol) returns() +func (_L1Block *L1BlockTransactorSession) SetGasPayingToken(_token common.Address, _decimals uint8, _name [32]byte, _symbol [32]byte) (*types.Transaction, error) { + return _L1Block.Contract.SetGasPayingToken(&_L1Block.TransactOpts, _token, _decimals, _name, _symbol) +} + +// SetL1BlockValues is a paid mutator transaction binding the contract method 0x015d8eb9. +// +// Solidity: function setL1BlockValues(uint64 _number, uint64 _timestamp, uint256 _basefee, bytes32 _hash, uint64 _sequenceNumber, bytes32 _batcherHash, uint256 _l1FeeOverhead, uint256 _l1FeeScalar) returns() +func (_L1Block *L1BlockTransactor) SetL1BlockValues(opts *bind.TransactOpts, _number uint64, _timestamp uint64, _basefee *big.Int, _hash [32]byte, _sequenceNumber uint64, _batcherHash [32]byte, _l1FeeOverhead *big.Int, _l1FeeScalar *big.Int) (*types.Transaction, error) { + return _L1Block.contract.Transact(opts, "setL1BlockValues", _number, _timestamp, _basefee, _hash, _sequenceNumber, _batcherHash, _l1FeeOverhead, _l1FeeScalar) +} + +// SetL1BlockValues is a paid mutator transaction binding the contract method 0x015d8eb9. +// +// Solidity: function setL1BlockValues(uint64 _number, uint64 _timestamp, uint256 _basefee, bytes32 _hash, uint64 _sequenceNumber, bytes32 _batcherHash, uint256 _l1FeeOverhead, uint256 _l1FeeScalar) returns() +func (_L1Block *L1BlockSession) SetL1BlockValues(_number uint64, _timestamp uint64, _basefee *big.Int, _hash [32]byte, _sequenceNumber uint64, _batcherHash [32]byte, _l1FeeOverhead *big.Int, _l1FeeScalar *big.Int) (*types.Transaction, error) { + return _L1Block.Contract.SetL1BlockValues(&_L1Block.TransactOpts, _number, _timestamp, _basefee, _hash, _sequenceNumber, _batcherHash, _l1FeeOverhead, _l1FeeScalar) +} + +// SetL1BlockValues is a paid mutator transaction binding the contract method 0x015d8eb9. +// +// Solidity: function setL1BlockValues(uint64 _number, uint64 _timestamp, uint256 _basefee, bytes32 _hash, uint64 _sequenceNumber, bytes32 _batcherHash, uint256 _l1FeeOverhead, uint256 _l1FeeScalar) returns() +func (_L1Block *L1BlockTransactorSession) SetL1BlockValues(_number uint64, _timestamp uint64, _basefee *big.Int, _hash [32]byte, _sequenceNumber uint64, _batcherHash [32]byte, _l1FeeOverhead *big.Int, _l1FeeScalar *big.Int) (*types.Transaction, error) { + return _L1Block.Contract.SetL1BlockValues(&_L1Block.TransactOpts, _number, _timestamp, _basefee, _hash, _sequenceNumber, _batcherHash, _l1FeeOverhead, _l1FeeScalar) +} + +// SetL1BlockValuesEcotone is a paid mutator transaction binding the contract method 0x440a5e20. +// +// Solidity: function setL1BlockValuesEcotone() returns() +func (_L1Block *L1BlockTransactor) SetL1BlockValuesEcotone(opts *bind.TransactOpts) (*types.Transaction, error) { + return _L1Block.contract.Transact(opts, "setL1BlockValuesEcotone") +} + +// SetL1BlockValuesEcotone is a paid mutator transaction binding the contract method 0x440a5e20. +// +// Solidity: function setL1BlockValuesEcotone() returns() +func (_L1Block *L1BlockSession) SetL1BlockValuesEcotone() (*types.Transaction, error) { + return _L1Block.Contract.SetL1BlockValuesEcotone(&_L1Block.TransactOpts) +} + +// SetL1BlockValuesEcotone is a paid mutator transaction binding the contract method 0x440a5e20. +// +// Solidity: function setL1BlockValuesEcotone() returns() +func (_L1Block *L1BlockTransactorSession) SetL1BlockValuesEcotone() (*types.Transaction, error) { + return _L1Block.Contract.SetL1BlockValuesEcotone(&_L1Block.TransactOpts) +} + +// L1BlockGasPayingTokenSetIterator is returned from FilterGasPayingTokenSet and is used to iterate over the raw logs and unpacked data for GasPayingTokenSet events raised by the L1Block contract. +type L1BlockGasPayingTokenSetIterator struct { + Event *L1BlockGasPayingTokenSet // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *L1BlockGasPayingTokenSetIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(L1BlockGasPayingTokenSet) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(L1BlockGasPayingTokenSet) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *L1BlockGasPayingTokenSetIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *L1BlockGasPayingTokenSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// L1BlockGasPayingTokenSet represents a GasPayingTokenSet event raised by the L1Block contract. +type L1BlockGasPayingTokenSet struct { + Token common.Address + Decimals uint8 + Name [32]byte + Symbol [32]byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterGasPayingTokenSet is a free log retrieval operation binding the contract event 0x10e43c4d58f3ef4edae7c1ca2e7f02d46b2cadbcc046737038527ed8486ffeb0. +// +// Solidity: event GasPayingTokenSet(address indexed token, uint8 indexed decimals, bytes32 name, bytes32 symbol) +func (_L1Block *L1BlockFilterer) FilterGasPayingTokenSet(opts *bind.FilterOpts, token []common.Address, decimals []uint8) (*L1BlockGasPayingTokenSetIterator, error) { + + var tokenRule []interface{} + for _, tokenItem := range token { + tokenRule = append(tokenRule, tokenItem) + } + var decimalsRule []interface{} + for _, decimalsItem := range decimals { + decimalsRule = append(decimalsRule, decimalsItem) + } + + logs, sub, err := _L1Block.contract.FilterLogs(opts, "GasPayingTokenSet", tokenRule, decimalsRule) + if err != nil { + return nil, err + } + return &L1BlockGasPayingTokenSetIterator{contract: _L1Block.contract, event: "GasPayingTokenSet", logs: logs, sub: sub}, nil +} + +// WatchGasPayingTokenSet is a free log subscription operation binding the contract event 0x10e43c4d58f3ef4edae7c1ca2e7f02d46b2cadbcc046737038527ed8486ffeb0. +// +// Solidity: event GasPayingTokenSet(address indexed token, uint8 indexed decimals, bytes32 name, bytes32 symbol) +func (_L1Block *L1BlockFilterer) WatchGasPayingTokenSet(opts *bind.WatchOpts, sink chan<- *L1BlockGasPayingTokenSet, token []common.Address, decimals []uint8) (event.Subscription, error) { + + var tokenRule []interface{} + for _, tokenItem := range token { + tokenRule = append(tokenRule, tokenItem) + } + var decimalsRule []interface{} + for _, decimalsItem := range decimals { + decimalsRule = append(decimalsRule, decimalsItem) + } + + logs, sub, err := _L1Block.contract.WatchLogs(opts, "GasPayingTokenSet", tokenRule, decimalsRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(L1BlockGasPayingTokenSet) + if err := _L1Block.contract.UnpackLog(event, "GasPayingTokenSet", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseGasPayingTokenSet is a log parse operation binding the contract event 0x10e43c4d58f3ef4edae7c1ca2e7f02d46b2cadbcc046737038527ed8486ffeb0. +// +// Solidity: event GasPayingTokenSet(address indexed token, uint8 indexed decimals, bytes32 name, bytes32 symbol) +func (_L1Block *L1BlockFilterer) ParseGasPayingTokenSet(log types.Log) (*L1BlockGasPayingTokenSet, error) { + event := new(L1BlockGasPayingTokenSet) + if err := _L1Block.contract.UnpackLog(event, "GasPayingTokenSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/op-e2e2/bindings/l1blocknumber.go b/op-e2e2/bindings/l1blocknumber.go new file mode 100644 index 000000000000..f7a5628f89a7 --- /dev/null +++ b/op-e2e2/bindings/l1blocknumber.go @@ -0,0 +1,306 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// L1BlockNumberMetaData contains all meta data concerning the L1BlockNumber contract. +var L1BlockNumberMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"fallback\",\"stateMutability\":\"payable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"getL1BlockNumber\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"}]", + Bin: "0x608060405234801561001057600080fd5b50610219806100206000396000f3fe60806040526004361061002d5760003560e01c806354fd4d5014610052578063b9b3efe9146100b157610048565b3661004857600061003c6100d4565b90508060005260206000f35b600061003c6100d4565b34801561005e57600080fd5b5061009b6040518060400160405280600581526020017f312e312e3000000000000000000000000000000000000000000000000000000081525081565b6040516100a89190610168565b60405180910390f35b3480156100bd57600080fd5b506100c66100d4565b6040519081526020016100a8565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638381f58a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610135573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061015991906101db565b67ffffffffffffffff16905090565b600060208083528351808285015260005b8181101561019557858101830151858201604001528201610179565b818111156101a7576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b6000602082840312156101ed57600080fd5b815167ffffffffffffffff8116811461020557600080fd5b939250505056fea164736f6c634300080f000a", +} + +// L1BlockNumberABI is the input ABI used to generate the binding from. +// Deprecated: Use L1BlockNumberMetaData.ABI instead. +var L1BlockNumberABI = L1BlockNumberMetaData.ABI + +// L1BlockNumberBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use L1BlockNumberMetaData.Bin instead. +var L1BlockNumberBin = L1BlockNumberMetaData.Bin + +// DeployL1BlockNumber deploys a new Ethereum contract, binding an instance of L1BlockNumber to it. +func DeployL1BlockNumber(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *L1BlockNumber, error) { + parsed, err := L1BlockNumberMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(L1BlockNumberBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &L1BlockNumber{L1BlockNumberCaller: L1BlockNumberCaller{contract: contract}, L1BlockNumberTransactor: L1BlockNumberTransactor{contract: contract}, L1BlockNumberFilterer: L1BlockNumberFilterer{contract: contract}}, nil +} + +// L1BlockNumber is an auto generated Go binding around an Ethereum contract. +type L1BlockNumber struct { + L1BlockNumberCaller // Read-only binding to the contract + L1BlockNumberTransactor // Write-only binding to the contract + L1BlockNumberFilterer // Log filterer for contract events +} + +// L1BlockNumberCaller is an auto generated read-only Go binding around an Ethereum contract. +type L1BlockNumberCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// L1BlockNumberTransactor is an auto generated write-only Go binding around an Ethereum contract. +type L1BlockNumberTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// L1BlockNumberFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type L1BlockNumberFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// L1BlockNumberSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type L1BlockNumberSession struct { + Contract *L1BlockNumber // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// L1BlockNumberCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type L1BlockNumberCallerSession struct { + Contract *L1BlockNumberCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// L1BlockNumberTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type L1BlockNumberTransactorSession struct { + Contract *L1BlockNumberTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// L1BlockNumberRaw is an auto generated low-level Go binding around an Ethereum contract. +type L1BlockNumberRaw struct { + Contract *L1BlockNumber // Generic contract binding to access the raw methods on +} + +// L1BlockNumberCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type L1BlockNumberCallerRaw struct { + Contract *L1BlockNumberCaller // Generic read-only contract binding to access the raw methods on +} + +// L1BlockNumberTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type L1BlockNumberTransactorRaw struct { + Contract *L1BlockNumberTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewL1BlockNumber creates a new instance of L1BlockNumber, bound to a specific deployed contract. +func NewL1BlockNumber(address common.Address, backend bind.ContractBackend) (*L1BlockNumber, error) { + contract, err := bindL1BlockNumber(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &L1BlockNumber{L1BlockNumberCaller: L1BlockNumberCaller{contract: contract}, L1BlockNumberTransactor: L1BlockNumberTransactor{contract: contract}, L1BlockNumberFilterer: L1BlockNumberFilterer{contract: contract}}, nil +} + +// NewL1BlockNumberCaller creates a new read-only instance of L1BlockNumber, bound to a specific deployed contract. +func NewL1BlockNumberCaller(address common.Address, caller bind.ContractCaller) (*L1BlockNumberCaller, error) { + contract, err := bindL1BlockNumber(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &L1BlockNumberCaller{contract: contract}, nil +} + +// NewL1BlockNumberTransactor creates a new write-only instance of L1BlockNumber, bound to a specific deployed contract. +func NewL1BlockNumberTransactor(address common.Address, transactor bind.ContractTransactor) (*L1BlockNumberTransactor, error) { + contract, err := bindL1BlockNumber(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &L1BlockNumberTransactor{contract: contract}, nil +} + +// NewL1BlockNumberFilterer creates a new log filterer instance of L1BlockNumber, bound to a specific deployed contract. +func NewL1BlockNumberFilterer(address common.Address, filterer bind.ContractFilterer) (*L1BlockNumberFilterer, error) { + contract, err := bindL1BlockNumber(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &L1BlockNumberFilterer{contract: contract}, nil +} + +// bindL1BlockNumber binds a generic wrapper to an already deployed contract. +func bindL1BlockNumber(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(L1BlockNumberABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_L1BlockNumber *L1BlockNumberRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _L1BlockNumber.Contract.L1BlockNumberCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_L1BlockNumber *L1BlockNumberRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _L1BlockNumber.Contract.L1BlockNumberTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_L1BlockNumber *L1BlockNumberRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _L1BlockNumber.Contract.L1BlockNumberTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_L1BlockNumber *L1BlockNumberCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _L1BlockNumber.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_L1BlockNumber *L1BlockNumberTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _L1BlockNumber.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_L1BlockNumber *L1BlockNumberTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _L1BlockNumber.Contract.contract.Transact(opts, method, params...) +} + +// GetL1BlockNumber is a free data retrieval call binding the contract method 0xb9b3efe9. +// +// Solidity: function getL1BlockNumber() view returns(uint256) +func (_L1BlockNumber *L1BlockNumberCaller) GetL1BlockNumber(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _L1BlockNumber.contract.Call(opts, &out, "getL1BlockNumber") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetL1BlockNumber is a free data retrieval call binding the contract method 0xb9b3efe9. +// +// Solidity: function getL1BlockNumber() view returns(uint256) +func (_L1BlockNumber *L1BlockNumberSession) GetL1BlockNumber() (*big.Int, error) { + return _L1BlockNumber.Contract.GetL1BlockNumber(&_L1BlockNumber.CallOpts) +} + +// GetL1BlockNumber is a free data retrieval call binding the contract method 0xb9b3efe9. +// +// Solidity: function getL1BlockNumber() view returns(uint256) +func (_L1BlockNumber *L1BlockNumberCallerSession) GetL1BlockNumber() (*big.Int, error) { + return _L1BlockNumber.Contract.GetL1BlockNumber(&_L1BlockNumber.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_L1BlockNumber *L1BlockNumberCaller) Version(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _L1BlockNumber.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 (_L1BlockNumber *L1BlockNumberSession) Version() (string, error) { + return _L1BlockNumber.Contract.Version(&_L1BlockNumber.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_L1BlockNumber *L1BlockNumberCallerSession) Version() (string, error) { + return _L1BlockNumber.Contract.Version(&_L1BlockNumber.CallOpts) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() payable returns() +func (_L1BlockNumber *L1BlockNumberTransactor) Fallback(opts *bind.TransactOpts, calldata []byte) (*types.Transaction, error) { + return _L1BlockNumber.contract.RawTransact(opts, calldata) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() payable returns() +func (_L1BlockNumber *L1BlockNumberSession) Fallback(calldata []byte) (*types.Transaction, error) { + return _L1BlockNumber.Contract.Fallback(&_L1BlockNumber.TransactOpts, calldata) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() payable returns() +func (_L1BlockNumber *L1BlockNumberTransactorSession) Fallback(calldata []byte) (*types.Transaction, error) { + return _L1BlockNumber.Contract.Fallback(&_L1BlockNumber.TransactOpts, calldata) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_L1BlockNumber *L1BlockNumberTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { + return _L1BlockNumber.contract.RawTransact(opts, nil) // calldata is disallowed for receive function +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_L1BlockNumber *L1BlockNumberSession) Receive() (*types.Transaction, error) { + return _L1BlockNumber.Contract.Receive(&_L1BlockNumber.TransactOpts) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_L1BlockNumber *L1BlockNumberTransactorSession) Receive() (*types.Transaction, error) { + return _L1BlockNumber.Contract.Receive(&_L1BlockNumber.TransactOpts) +} diff --git a/op-e2e2/bindings/l1crossdomainmessenger.go b/op-e2e2/bindings/l1crossdomainmessenger.go new file mode 100644 index 000000000000..d8901d85eccd --- /dev/null +++ b/op-e2e2/bindings/l1crossdomainmessenger.go @@ -0,0 +1,1631 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// L1CrossDomainMessengerMetaData contains all meta data concerning the L1CrossDomainMessenger contract. +var L1CrossDomainMessengerMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"MESSAGE_VERSION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MIN_GAS_CALLDATA_OVERHEAD\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MIN_GAS_DYNAMIC_OVERHEAD_DENOMINATOR\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MIN_GAS_DYNAMIC_OVERHEAD_NUMERATOR\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"OTHER_MESSENGER\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractCrossDomainMessenger\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"PORTAL\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractOptimismPortal\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"RELAY_CALL_OVERHEAD\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"RELAY_CONSTANT_OVERHEAD\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"RELAY_GAS_CHECK_BUFFER\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"RELAY_RESERVED_GAS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"baseGas\",\"inputs\":[{\"name\":\"_message\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"_minGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"failedMessages\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_superchainConfig\",\"type\":\"address\",\"internalType\":\"contractSuperchainConfig\"},{\"name\":\"_portal\",\"type\":\"address\",\"internalType\":\"contractOptimismPortal\"},{\"name\":\"_systemConfig\",\"type\":\"address\",\"internalType\":\"contractSystemConfig\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"messageNonce\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"otherMessenger\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractCrossDomainMessenger\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"paused\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"portal\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractOptimismPortal\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"relayMessage\",\"inputs\":[{\"name\":\"_nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_sender\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_target\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_value\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_minGasLimit\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_message\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"sendMessage\",\"inputs\":[{\"name\":\"_target\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_message\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"_minGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"successfulMessages\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"superchainConfig\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractSuperchainConfig\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"systemConfig\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractSystemConfig\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"xDomainMessageSender\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"FailedRelayedMessage\",\"inputs\":[{\"name\":\"msgHash\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RelayedMessage\",\"inputs\":[{\"name\":\"msgHash\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"SentMessage\",\"inputs\":[{\"name\":\"target\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"sender\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"message\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"},{\"name\":\"messageNonce\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"gasLimit\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"SentMessageExtension1\",\"inputs\":[{\"name\":\"sender\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false}]", + Bin: "0x60806040523480156200001157600080fd5b50620000206000808062000026565b6200028e565b600054600160a81b900460ff16158080156200004f57506000546001600160a01b90910460ff16105b806200008657506200006c30620001c860201b620015b71760201c565b158015620000865750600054600160a01b900460ff166001145b620000ef5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff60a01b1916600160a01b17905580156200011d576000805460ff60a81b1916600160a81b1790555b60fb80546001600160a01b038087166001600160a01b03199283161790925560fc805486841690831617905560fd80549285169290911691909117905562000179734200000000000000000000000000000000000007620001d7565b8015620001c2576000805460ff60a81b19169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b6001600160a01b03163b151590565b600054600160a81b900460ff16620002465760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401620000e6565b60cc546001600160a01b03166200026c5760cc80546001600160a01b03191661dead1790555b60cf80546001600160a01b0319166001600160a01b0392909216919091179055565b6121a3806200029e6000396000f3fe60806040526004361061018b5760003560e01c80636425666b116100d6578063b1b1b2091161007f578063d764ad0b11610059578063d764ad0b1461049b578063db505d80146104ae578063ecc70428146104db57600080fd5b8063b1b1b2091461042b578063b28ade251461045b578063c0c53b8b1461047b57600080fd5b80638cbeeef2116100b05780638cbeeef2146102d05780639fce812c146103d0578063a4e7f8bd146103fb57600080fd5b80636425666b146103775780636e296e45146103a457806383a74074146103b957600080fd5b80633dbb202b1161013857806354fd4d501161011257806354fd4d50146102e65780635644cfdf1461033c5780635c975abb1461035257600080fd5b80633dbb202b146102935780633f827a5a146102a85780634c1d6a69146102d057600080fd5b80632828d7e8116101695780632828d7e81461022457806333d7e2bd1461023957806335e80ab31461026657600080fd5b8063028f85f7146101905780630c568498146101c35780630ff754ea146101d8575b600080fd5b34801561019c57600080fd5b506101a5601081565b60405167ffffffffffffffff90911681526020015b60405180910390f35b3480156101cf57600080fd5b506101a5603f81565b3480156101e457600080fd5b5060fc5473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101ba565b34801561023057600080fd5b506101a5604081565b34801561024557600080fd5b5060fd546101ff9073ffffffffffffffffffffffffffffffffffffffff1681565b34801561027257600080fd5b5060fb546101ff9073ffffffffffffffffffffffffffffffffffffffff1681565b6102a66102a1366004611bdf565b610540565b005b3480156102b457600080fd5b506102bd600181565b60405161ffff90911681526020016101ba565b3480156102dc57600080fd5b506101a5619c4081565b3480156102f257600080fd5b5061032f6040518060400160405280601b81526020017f322e342e302d626574612b637573746f6d2d6761732d746f6b656e000000000081525081565b6040516101ba9190611cb1565b34801561034857600080fd5b506101a561138881565b34801561035e57600080fd5b5061036761083d565b60405190151581526020016101ba565b34801561038357600080fd5b5060fc546101ff9073ffffffffffffffffffffffffffffffffffffffff1681565b3480156103b057600080fd5b506101ff6108d6565b3480156103c557600080fd5b506101a562030d4081565b3480156103dc57600080fd5b5060cf5473ffffffffffffffffffffffffffffffffffffffff166101ff565b34801561040757600080fd5b50610367610416366004611ccb565b60ce6020526000908152604090205460ff1681565b34801561043757600080fd5b50610367610446366004611ccb565b60cb6020526000908152604090205460ff1681565b34801561046757600080fd5b506101a5610476366004611ce4565b6109bd565b34801561048757600080fd5b506102a6610496366004611d38565b610a2b565b6102a66104a9366004611d83565b610ca2565b3480156104ba57600080fd5b5060cf546101ff9073ffffffffffffffffffffffffffffffffffffffff1681565b3480156104e757600080fd5b5061053260cd547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e010000000000000000000000000000000000000000000000000000000000001790565b6040519081526020016101ba565b6105486115d3565b156105e05734156105e0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603d60248201527f43726f7373446f6d61696e4d657373656e6765723a2063616e6e6f742073656e60448201527f642076616c7565207769746820637573746f6d2067617320746f6b656e00000060648201526084015b60405180910390fd5b60cf546107129073ffffffffffffffffffffffffffffffffffffffff166106088585856109bd565b347fd764ad0b0000000000000000000000000000000000000000000000000000000061067460cd547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e010000000000000000000000000000000000000000000000000000000000001790565b338a34898c8c6040516024016106909796959493929190611e52565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152611612565b8373ffffffffffffffffffffffffffffffffffffffff167fcb0f7ffd78f9aee47a248fae8db181db6eee833039123e026dcbff529522e52a33858561079760cd547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e010000000000000000000000000000000000000000000000000000000000001790565b866040516107a9959493929190611eb1565b60405180910390a260405134815233907f8ebb2ec2465bdb2a06a66fc37a0963af8a2a6a1479d81d56fdb8cbb98096d5469060200160405180910390a2505060cd80547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff808216600101167fffff0000000000000000000000000000000000000000000000000000000000009091161790555050565b60fb54604080517f5c975abb000000000000000000000000000000000000000000000000000000008152905160009273ffffffffffffffffffffffffffffffffffffffff1691635c975abb9160048083019260209291908290030181865afa1580156108ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d19190611eff565b905090565b60cc5460009073ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff2153016109a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603560248201527f43726f7373446f6d61696e4d657373656e6765723a2078446f6d61696e4d657360448201527f7361676553656e646572206973206e6f7420736574000000000000000000000060648201526084016105d7565b5060cc5473ffffffffffffffffffffffffffffffffffffffff1690565b6000611388619c4080603f6109d9604063ffffffff8816611f50565b6109e39190611f80565b6109ee601088611f50565b6109fb9062030d40611fce565b610a059190611fce565b610a0f9190611fce565b610a199190611fce565b610a239190611fce565b949350505050565b6000547501000000000000000000000000000000000000000000900460ff1615808015610a76575060005460017401000000000000000000000000000000000000000090910460ff16105b80610aa85750303b158015610aa8575060005474010000000000000000000000000000000000000000900460ff166001145b610b34576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016105d7565b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000001790558015610bba57600080547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff1675010000000000000000000000000000000000000000001790555b60fb805473ffffffffffffffffffffffffffffffffffffffff8087167fffffffffffffffffffffffff00000000000000000000000000000000000000009283161790925560fc805486841690831617905560fd805492851692909116919091179055610c397342000000000000000000000000000000000000076116ab565b8015610c9c57600080547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b610caa61083d565b15610d11576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f43726f7373446f6d61696e4d657373656e6765723a207061757365640000000060448201526064016105d7565b60f087901c60028110610dcc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604d60248201527f43726f7373446f6d61696e4d657373656e6765723a206f6e6c7920766572736960448201527f6f6e2030206f722031206d657373616765732061726520737570706f7274656460648201527f20617420746869732074696d6500000000000000000000000000000000000000608482015260a4016105d7565b8061ffff16600003610ec1576000610e1d878986868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508f92506117e7915050565b600081815260cb602052604090205490915060ff1615610ebf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f43726f7373446f6d61696e4d657373656e6765723a206c65676163792077697460448201527f6864726177616c20616c72656164792072656c6179656400000000000000000060648201526084016105d7565b505b6000610f07898989898989898080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061180692505050565b9050610f11611829565b15610f4957853414610f2557610f25611ffa565b600081815260ce602052604090205460ff1615610f4457610f44611ffa565b61109b565b3415610ffd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152605060248201527f43726f7373446f6d61696e4d657373656e6765723a2076616c7565206d75737460448201527f206265207a65726f20756e6c657373206d6573736167652069732066726f6d2060648201527f612073797374656d206164647265737300000000000000000000000000000000608482015260a4016105d7565b600081815260ce602052604090205460ff1661109b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f43726f7373446f6d61696e4d657373656e6765723a206d65737361676520636160448201527f6e6e6f74206265207265706c617965640000000000000000000000000000000060648201526084016105d7565b6110a487611905565b15611157576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604360248201527f43726f7373446f6d61696e4d657373656e6765723a2063616e6e6f742073656e60448201527f64206d65737361676520746f20626c6f636b65642073797374656d206164647260648201527f6573730000000000000000000000000000000000000000000000000000000000608482015260a4016105d7565b600081815260cb602052604090205460ff16156111f6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f43726f7373446f6d61696e4d657373656e6765723a206d65737361676520686160448201527f7320616c7265616479206265656e2072656c617965640000000000000000000060648201526084016105d7565b61121785611208611388619c40611fce565b67ffffffffffffffff1661194b565b158061123d575060cc5473ffffffffffffffffffffffffffffffffffffffff1661dead14155b1561135657600081815260ce602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555182917f99d0e048484baa1b1540b1367cb128acd7ab2946d1ed91ec10e3c85e4bf51b8f91a27fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff320161134f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f43726f7373446f6d61696e4d657373656e6765723a206661696c656420746f2060448201527f72656c6179206d6573736167650000000000000000000000000000000000000060648201526084016105d7565b50506115ae565b60cc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8a1617905560006113e788619c405a6113aa9190612029565b8988888080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061196992505050565b60cc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001661dead1790559050801561149d57600082815260cb602052604090205460ff161561143a5761143a611ffa565b600082815260cb602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555183917f4641df4a962071e12719d8c8c8e5ac7fc4d97b927346a3d7a335b1f7517e133c91a26115aa565b600082815260ce602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555183917f99d0e048484baa1b1540b1367cb128acd7ab2946d1ed91ec10e3c85e4bf51b8f91a27fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff32016115aa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f43726f7373446f6d61696e4d657373656e6765723a206661696c656420746f2060448201527f72656c6179206d6573736167650000000000000000000000000000000000000060648201526084016105d7565b5050505b50505050505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b6000806115de611983565b5073ffffffffffffffffffffffffffffffffffffffff1673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee141592915050565b60fc546040517fe9e05c4200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169063e9e05c42908490611673908890839089906000908990600401612040565b6000604051808303818588803b15801561168c57600080fd5b505af11580156116a0573d6000803e3d6000fd5b505050505050505050565b6000547501000000000000000000000000000000000000000000900460ff16611756576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016105d7565b60cc5473ffffffffffffffffffffffffffffffffffffffff166117a05760cc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001661dead1790555b60cf80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60006117f585858585611a20565b805190602001209050949350505050565b6000611816878787878787611ab9565b8051906020012090509695505050505050565b60fc5460009073ffffffffffffffffffffffffffffffffffffffff16331480156108d1575060cf5460fc54604080517f9bf62d82000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff9384169390921691639bf62d82916004808201926020929091908290030181865afa1580156118c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118e99190612098565b73ffffffffffffffffffffffffffffffffffffffff1614905090565b600073ffffffffffffffffffffffffffffffffffffffff8216301480611945575060fc5473ffffffffffffffffffffffffffffffffffffffff8381169116145b92915050565b600080603f83619c4001026040850201603f5a021015949350505050565b600080600080845160208601878a8af19695505050505050565b60fd54604080517f4397dfef0000000000000000000000000000000000000000000000000000000081528151600093849373ffffffffffffffffffffffffffffffffffffffff90911692634397dfef92600480830193928290030181865afa1580156119f3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a1791906120b5565b90939092509050565b606084848484604051602401611a3994939291906120f5565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fcbd4ece9000000000000000000000000000000000000000000000000000000001790529050949350505050565b6060868686868686604051602401611ad69695949392919061213f565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fd764ad0b0000000000000000000000000000000000000000000000000000000017905290509695505050505050565b73ffffffffffffffffffffffffffffffffffffffff81168114611b7a57600080fd5b50565b60008083601f840112611b8f57600080fd5b50813567ffffffffffffffff811115611ba757600080fd5b602083019150836020828501011115611bbf57600080fd5b9250929050565b803563ffffffff81168114611bda57600080fd5b919050565b60008060008060608587031215611bf557600080fd5b8435611c0081611b58565b9350602085013567ffffffffffffffff811115611c1c57600080fd5b611c2887828801611b7d565b9094509250611c3b905060408601611bc6565b905092959194509250565b6000815180845260005b81811015611c6c57602081850181015186830182015201611c50565b81811115611c7e576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000611cc46020830184611c46565b9392505050565b600060208284031215611cdd57600080fd5b5035919050565b600080600060408486031215611cf957600080fd5b833567ffffffffffffffff811115611d1057600080fd5b611d1c86828701611b7d565b9094509250611d2f905060208501611bc6565b90509250925092565b600080600060608486031215611d4d57600080fd5b8335611d5881611b58565b92506020840135611d6881611b58565b91506040840135611d7881611b58565b809150509250925092565b600080600080600080600060c0888a031215611d9e57600080fd5b873596506020880135611db081611b58565b95506040880135611dc081611b58565b9450606088013593506080880135925060a088013567ffffffffffffffff811115611dea57600080fd5b611df68a828b01611b7d565b989b979a50959850939692959293505050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b878152600073ffffffffffffffffffffffffffffffffffffffff808916602084015280881660408401525085606083015263ffffffff8516608083015260c060a0830152611ea460c083018486611e09565b9998505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff86168152608060208201526000611ee1608083018688611e09565b905083604083015263ffffffff831660608301529695505050505050565b600060208284031215611f1157600080fd5b81518015158114611cc457600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600067ffffffffffffffff80831681851681830481118215151615611f7757611f77611f21565b02949350505050565b600067ffffffffffffffff80841680611fc2577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b92169190910492915050565b600067ffffffffffffffff808316818516808303821115611ff157611ff1611f21565b01949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b60008282101561203b5761203b611f21565b500390565b73ffffffffffffffffffffffffffffffffffffffff8616815284602082015267ffffffffffffffff84166040820152821515606082015260a06080820152600061208d60a0830184611c46565b979650505050505050565b6000602082840312156120aa57600080fd5b8151611cc481611b58565b600080604083850312156120c857600080fd5b82516120d381611b58565b602084015190925060ff811681146120ea57600080fd5b809150509250929050565b600073ffffffffffffffffffffffffffffffffffffffff80871683528086166020840152506080604083015261212e6080830185611c46565b905082606083015295945050505050565b868152600073ffffffffffffffffffffffffffffffffffffffff808816602084015280871660408401525084606083015283608083015260c060a083015261218a60c0830184611c46565b9897505050505050505056fea164736f6c634300080f000a", +} + +// L1CrossDomainMessengerABI is the input ABI used to generate the binding from. +// Deprecated: Use L1CrossDomainMessengerMetaData.ABI instead. +var L1CrossDomainMessengerABI = L1CrossDomainMessengerMetaData.ABI + +// L1CrossDomainMessengerBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use L1CrossDomainMessengerMetaData.Bin instead. +var L1CrossDomainMessengerBin = L1CrossDomainMessengerMetaData.Bin + +// DeployL1CrossDomainMessenger deploys a new Ethereum contract, binding an instance of L1CrossDomainMessenger to it. +func DeployL1CrossDomainMessenger(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *L1CrossDomainMessenger, error) { + parsed, err := L1CrossDomainMessengerMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(L1CrossDomainMessengerBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &L1CrossDomainMessenger{L1CrossDomainMessengerCaller: L1CrossDomainMessengerCaller{contract: contract}, L1CrossDomainMessengerTransactor: L1CrossDomainMessengerTransactor{contract: contract}, L1CrossDomainMessengerFilterer: L1CrossDomainMessengerFilterer{contract: contract}}, nil +} + +// L1CrossDomainMessenger is an auto generated Go binding around an Ethereum contract. +type L1CrossDomainMessenger struct { + L1CrossDomainMessengerCaller // Read-only binding to the contract + L1CrossDomainMessengerTransactor // Write-only binding to the contract + L1CrossDomainMessengerFilterer // Log filterer for contract events +} + +// L1CrossDomainMessengerCaller is an auto generated read-only Go binding around an Ethereum contract. +type L1CrossDomainMessengerCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// L1CrossDomainMessengerTransactor is an auto generated write-only Go binding around an Ethereum contract. +type L1CrossDomainMessengerTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// L1CrossDomainMessengerFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type L1CrossDomainMessengerFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// L1CrossDomainMessengerSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type L1CrossDomainMessengerSession struct { + Contract *L1CrossDomainMessenger // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// L1CrossDomainMessengerCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type L1CrossDomainMessengerCallerSession struct { + Contract *L1CrossDomainMessengerCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// L1CrossDomainMessengerTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type L1CrossDomainMessengerTransactorSession struct { + Contract *L1CrossDomainMessengerTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// L1CrossDomainMessengerRaw is an auto generated low-level Go binding around an Ethereum contract. +type L1CrossDomainMessengerRaw struct { + Contract *L1CrossDomainMessenger // Generic contract binding to access the raw methods on +} + +// L1CrossDomainMessengerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type L1CrossDomainMessengerCallerRaw struct { + Contract *L1CrossDomainMessengerCaller // Generic read-only contract binding to access the raw methods on +} + +// L1CrossDomainMessengerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type L1CrossDomainMessengerTransactorRaw struct { + Contract *L1CrossDomainMessengerTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewL1CrossDomainMessenger creates a new instance of L1CrossDomainMessenger, bound to a specific deployed contract. +func NewL1CrossDomainMessenger(address common.Address, backend bind.ContractBackend) (*L1CrossDomainMessenger, error) { + contract, err := bindL1CrossDomainMessenger(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &L1CrossDomainMessenger{L1CrossDomainMessengerCaller: L1CrossDomainMessengerCaller{contract: contract}, L1CrossDomainMessengerTransactor: L1CrossDomainMessengerTransactor{contract: contract}, L1CrossDomainMessengerFilterer: L1CrossDomainMessengerFilterer{contract: contract}}, nil +} + +// NewL1CrossDomainMessengerCaller creates a new read-only instance of L1CrossDomainMessenger, bound to a specific deployed contract. +func NewL1CrossDomainMessengerCaller(address common.Address, caller bind.ContractCaller) (*L1CrossDomainMessengerCaller, error) { + contract, err := bindL1CrossDomainMessenger(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &L1CrossDomainMessengerCaller{contract: contract}, nil +} + +// NewL1CrossDomainMessengerTransactor creates a new write-only instance of L1CrossDomainMessenger, bound to a specific deployed contract. +func NewL1CrossDomainMessengerTransactor(address common.Address, transactor bind.ContractTransactor) (*L1CrossDomainMessengerTransactor, error) { + contract, err := bindL1CrossDomainMessenger(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &L1CrossDomainMessengerTransactor{contract: contract}, nil +} + +// NewL1CrossDomainMessengerFilterer creates a new log filterer instance of L1CrossDomainMessenger, bound to a specific deployed contract. +func NewL1CrossDomainMessengerFilterer(address common.Address, filterer bind.ContractFilterer) (*L1CrossDomainMessengerFilterer, error) { + contract, err := bindL1CrossDomainMessenger(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &L1CrossDomainMessengerFilterer{contract: contract}, nil +} + +// bindL1CrossDomainMessenger binds a generic wrapper to an already deployed contract. +func bindL1CrossDomainMessenger(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(L1CrossDomainMessengerABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_L1CrossDomainMessenger *L1CrossDomainMessengerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _L1CrossDomainMessenger.Contract.L1CrossDomainMessengerCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_L1CrossDomainMessenger *L1CrossDomainMessengerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _L1CrossDomainMessenger.Contract.L1CrossDomainMessengerTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_L1CrossDomainMessenger *L1CrossDomainMessengerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _L1CrossDomainMessenger.Contract.L1CrossDomainMessengerTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_L1CrossDomainMessenger *L1CrossDomainMessengerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _L1CrossDomainMessenger.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_L1CrossDomainMessenger *L1CrossDomainMessengerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _L1CrossDomainMessenger.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_L1CrossDomainMessenger *L1CrossDomainMessengerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _L1CrossDomainMessenger.Contract.contract.Transact(opts, method, params...) +} + +// MESSAGEVERSION is a free data retrieval call binding the contract method 0x3f827a5a. +// +// Solidity: function MESSAGE_VERSION() view returns(uint16) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerCaller) MESSAGEVERSION(opts *bind.CallOpts) (uint16, error) { + var out []interface{} + err := _L1CrossDomainMessenger.contract.Call(opts, &out, "MESSAGE_VERSION") + + if err != nil { + return *new(uint16), err + } + + out0 := *abi.ConvertType(out[0], new(uint16)).(*uint16) + + return out0, err + +} + +// MESSAGEVERSION is a free data retrieval call binding the contract method 0x3f827a5a. +// +// Solidity: function MESSAGE_VERSION() view returns(uint16) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerSession) MESSAGEVERSION() (uint16, error) { + return _L1CrossDomainMessenger.Contract.MESSAGEVERSION(&_L1CrossDomainMessenger.CallOpts) +} + +// MESSAGEVERSION is a free data retrieval call binding the contract method 0x3f827a5a. +// +// Solidity: function MESSAGE_VERSION() view returns(uint16) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerCallerSession) MESSAGEVERSION() (uint16, error) { + return _L1CrossDomainMessenger.Contract.MESSAGEVERSION(&_L1CrossDomainMessenger.CallOpts) +} + +// MINGASCALLDATAOVERHEAD is a free data retrieval call binding the contract method 0x028f85f7. +// +// Solidity: function MIN_GAS_CALLDATA_OVERHEAD() view returns(uint64) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerCaller) MINGASCALLDATAOVERHEAD(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _L1CrossDomainMessenger.contract.Call(opts, &out, "MIN_GAS_CALLDATA_OVERHEAD") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// MINGASCALLDATAOVERHEAD is a free data retrieval call binding the contract method 0x028f85f7. +// +// Solidity: function MIN_GAS_CALLDATA_OVERHEAD() view returns(uint64) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerSession) MINGASCALLDATAOVERHEAD() (uint64, error) { + return _L1CrossDomainMessenger.Contract.MINGASCALLDATAOVERHEAD(&_L1CrossDomainMessenger.CallOpts) +} + +// MINGASCALLDATAOVERHEAD is a free data retrieval call binding the contract method 0x028f85f7. +// +// Solidity: function MIN_GAS_CALLDATA_OVERHEAD() view returns(uint64) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerCallerSession) MINGASCALLDATAOVERHEAD() (uint64, error) { + return _L1CrossDomainMessenger.Contract.MINGASCALLDATAOVERHEAD(&_L1CrossDomainMessenger.CallOpts) +} + +// MINGASDYNAMICOVERHEADDENOMINATOR is a free data retrieval call binding the contract method 0x0c568498. +// +// Solidity: function MIN_GAS_DYNAMIC_OVERHEAD_DENOMINATOR() view returns(uint64) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerCaller) MINGASDYNAMICOVERHEADDENOMINATOR(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _L1CrossDomainMessenger.contract.Call(opts, &out, "MIN_GAS_DYNAMIC_OVERHEAD_DENOMINATOR") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// MINGASDYNAMICOVERHEADDENOMINATOR is a free data retrieval call binding the contract method 0x0c568498. +// +// Solidity: function MIN_GAS_DYNAMIC_OVERHEAD_DENOMINATOR() view returns(uint64) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerSession) MINGASDYNAMICOVERHEADDENOMINATOR() (uint64, error) { + return _L1CrossDomainMessenger.Contract.MINGASDYNAMICOVERHEADDENOMINATOR(&_L1CrossDomainMessenger.CallOpts) +} + +// MINGASDYNAMICOVERHEADDENOMINATOR is a free data retrieval call binding the contract method 0x0c568498. +// +// Solidity: function MIN_GAS_DYNAMIC_OVERHEAD_DENOMINATOR() view returns(uint64) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerCallerSession) MINGASDYNAMICOVERHEADDENOMINATOR() (uint64, error) { + return _L1CrossDomainMessenger.Contract.MINGASDYNAMICOVERHEADDENOMINATOR(&_L1CrossDomainMessenger.CallOpts) +} + +// MINGASDYNAMICOVERHEADNUMERATOR is a free data retrieval call binding the contract method 0x2828d7e8. +// +// Solidity: function MIN_GAS_DYNAMIC_OVERHEAD_NUMERATOR() view returns(uint64) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerCaller) MINGASDYNAMICOVERHEADNUMERATOR(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _L1CrossDomainMessenger.contract.Call(opts, &out, "MIN_GAS_DYNAMIC_OVERHEAD_NUMERATOR") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// MINGASDYNAMICOVERHEADNUMERATOR is a free data retrieval call binding the contract method 0x2828d7e8. +// +// Solidity: function MIN_GAS_DYNAMIC_OVERHEAD_NUMERATOR() view returns(uint64) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerSession) MINGASDYNAMICOVERHEADNUMERATOR() (uint64, error) { + return _L1CrossDomainMessenger.Contract.MINGASDYNAMICOVERHEADNUMERATOR(&_L1CrossDomainMessenger.CallOpts) +} + +// MINGASDYNAMICOVERHEADNUMERATOR is a free data retrieval call binding the contract method 0x2828d7e8. +// +// Solidity: function MIN_GAS_DYNAMIC_OVERHEAD_NUMERATOR() view returns(uint64) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerCallerSession) MINGASDYNAMICOVERHEADNUMERATOR() (uint64, error) { + return _L1CrossDomainMessenger.Contract.MINGASDYNAMICOVERHEADNUMERATOR(&_L1CrossDomainMessenger.CallOpts) +} + +// OTHERMESSENGER is a free data retrieval call binding the contract method 0x9fce812c. +// +// Solidity: function OTHER_MESSENGER() view returns(address) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerCaller) OTHERMESSENGER(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _L1CrossDomainMessenger.contract.Call(opts, &out, "OTHER_MESSENGER") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// OTHERMESSENGER is a free data retrieval call binding the contract method 0x9fce812c. +// +// Solidity: function OTHER_MESSENGER() view returns(address) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerSession) OTHERMESSENGER() (common.Address, error) { + return _L1CrossDomainMessenger.Contract.OTHERMESSENGER(&_L1CrossDomainMessenger.CallOpts) +} + +// OTHERMESSENGER is a free data retrieval call binding the contract method 0x9fce812c. +// +// Solidity: function OTHER_MESSENGER() view returns(address) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerCallerSession) OTHERMESSENGER() (common.Address, error) { + return _L1CrossDomainMessenger.Contract.OTHERMESSENGER(&_L1CrossDomainMessenger.CallOpts) +} + +// PORTAL is a free data retrieval call binding the contract method 0x0ff754ea. +// +// Solidity: function PORTAL() view returns(address) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerCaller) PORTAL(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _L1CrossDomainMessenger.contract.Call(opts, &out, "PORTAL") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// PORTAL is a free data retrieval call binding the contract method 0x0ff754ea. +// +// Solidity: function PORTAL() view returns(address) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerSession) PORTAL() (common.Address, error) { + return _L1CrossDomainMessenger.Contract.PORTAL(&_L1CrossDomainMessenger.CallOpts) +} + +// PORTAL is a free data retrieval call binding the contract method 0x0ff754ea. +// +// Solidity: function PORTAL() view returns(address) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerCallerSession) PORTAL() (common.Address, error) { + return _L1CrossDomainMessenger.Contract.PORTAL(&_L1CrossDomainMessenger.CallOpts) +} + +// RELAYCALLOVERHEAD is a free data retrieval call binding the contract method 0x4c1d6a69. +// +// Solidity: function RELAY_CALL_OVERHEAD() view returns(uint64) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerCaller) RELAYCALLOVERHEAD(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _L1CrossDomainMessenger.contract.Call(opts, &out, "RELAY_CALL_OVERHEAD") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// RELAYCALLOVERHEAD is a free data retrieval call binding the contract method 0x4c1d6a69. +// +// Solidity: function RELAY_CALL_OVERHEAD() view returns(uint64) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerSession) RELAYCALLOVERHEAD() (uint64, error) { + return _L1CrossDomainMessenger.Contract.RELAYCALLOVERHEAD(&_L1CrossDomainMessenger.CallOpts) +} + +// RELAYCALLOVERHEAD is a free data retrieval call binding the contract method 0x4c1d6a69. +// +// Solidity: function RELAY_CALL_OVERHEAD() view returns(uint64) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerCallerSession) RELAYCALLOVERHEAD() (uint64, error) { + return _L1CrossDomainMessenger.Contract.RELAYCALLOVERHEAD(&_L1CrossDomainMessenger.CallOpts) +} + +// RELAYCONSTANTOVERHEAD is a free data retrieval call binding the contract method 0x83a74074. +// +// Solidity: function RELAY_CONSTANT_OVERHEAD() view returns(uint64) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerCaller) RELAYCONSTANTOVERHEAD(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _L1CrossDomainMessenger.contract.Call(opts, &out, "RELAY_CONSTANT_OVERHEAD") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// RELAYCONSTANTOVERHEAD is a free data retrieval call binding the contract method 0x83a74074. +// +// Solidity: function RELAY_CONSTANT_OVERHEAD() view returns(uint64) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerSession) RELAYCONSTANTOVERHEAD() (uint64, error) { + return _L1CrossDomainMessenger.Contract.RELAYCONSTANTOVERHEAD(&_L1CrossDomainMessenger.CallOpts) +} + +// RELAYCONSTANTOVERHEAD is a free data retrieval call binding the contract method 0x83a74074. +// +// Solidity: function RELAY_CONSTANT_OVERHEAD() view returns(uint64) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerCallerSession) RELAYCONSTANTOVERHEAD() (uint64, error) { + return _L1CrossDomainMessenger.Contract.RELAYCONSTANTOVERHEAD(&_L1CrossDomainMessenger.CallOpts) +} + +// RELAYGASCHECKBUFFER is a free data retrieval call binding the contract method 0x5644cfdf. +// +// Solidity: function RELAY_GAS_CHECK_BUFFER() view returns(uint64) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerCaller) RELAYGASCHECKBUFFER(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _L1CrossDomainMessenger.contract.Call(opts, &out, "RELAY_GAS_CHECK_BUFFER") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// RELAYGASCHECKBUFFER is a free data retrieval call binding the contract method 0x5644cfdf. +// +// Solidity: function RELAY_GAS_CHECK_BUFFER() view returns(uint64) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerSession) RELAYGASCHECKBUFFER() (uint64, error) { + return _L1CrossDomainMessenger.Contract.RELAYGASCHECKBUFFER(&_L1CrossDomainMessenger.CallOpts) +} + +// RELAYGASCHECKBUFFER is a free data retrieval call binding the contract method 0x5644cfdf. +// +// Solidity: function RELAY_GAS_CHECK_BUFFER() view returns(uint64) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerCallerSession) RELAYGASCHECKBUFFER() (uint64, error) { + return _L1CrossDomainMessenger.Contract.RELAYGASCHECKBUFFER(&_L1CrossDomainMessenger.CallOpts) +} + +// RELAYRESERVEDGAS is a free data retrieval call binding the contract method 0x8cbeeef2. +// +// Solidity: function RELAY_RESERVED_GAS() view returns(uint64) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerCaller) RELAYRESERVEDGAS(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _L1CrossDomainMessenger.contract.Call(opts, &out, "RELAY_RESERVED_GAS") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// RELAYRESERVEDGAS is a free data retrieval call binding the contract method 0x8cbeeef2. +// +// Solidity: function RELAY_RESERVED_GAS() view returns(uint64) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerSession) RELAYRESERVEDGAS() (uint64, error) { + return _L1CrossDomainMessenger.Contract.RELAYRESERVEDGAS(&_L1CrossDomainMessenger.CallOpts) +} + +// RELAYRESERVEDGAS is a free data retrieval call binding the contract method 0x8cbeeef2. +// +// Solidity: function RELAY_RESERVED_GAS() view returns(uint64) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerCallerSession) RELAYRESERVEDGAS() (uint64, error) { + return _L1CrossDomainMessenger.Contract.RELAYRESERVEDGAS(&_L1CrossDomainMessenger.CallOpts) +} + +// BaseGas is a free data retrieval call binding the contract method 0xb28ade25. +// +// Solidity: function baseGas(bytes _message, uint32 _minGasLimit) pure returns(uint64) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerCaller) BaseGas(opts *bind.CallOpts, _message []byte, _minGasLimit uint32) (uint64, error) { + var out []interface{} + err := _L1CrossDomainMessenger.contract.Call(opts, &out, "baseGas", _message, _minGasLimit) + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// BaseGas is a free data retrieval call binding the contract method 0xb28ade25. +// +// Solidity: function baseGas(bytes _message, uint32 _minGasLimit) pure returns(uint64) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerSession) BaseGas(_message []byte, _minGasLimit uint32) (uint64, error) { + return _L1CrossDomainMessenger.Contract.BaseGas(&_L1CrossDomainMessenger.CallOpts, _message, _minGasLimit) +} + +// BaseGas is a free data retrieval call binding the contract method 0xb28ade25. +// +// Solidity: function baseGas(bytes _message, uint32 _minGasLimit) pure returns(uint64) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerCallerSession) BaseGas(_message []byte, _minGasLimit uint32) (uint64, error) { + return _L1CrossDomainMessenger.Contract.BaseGas(&_L1CrossDomainMessenger.CallOpts, _message, _minGasLimit) +} + +// FailedMessages is a free data retrieval call binding the contract method 0xa4e7f8bd. +// +// Solidity: function failedMessages(bytes32 ) view returns(bool) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerCaller) FailedMessages(opts *bind.CallOpts, arg0 [32]byte) (bool, error) { + var out []interface{} + err := _L1CrossDomainMessenger.contract.Call(opts, &out, "failedMessages", arg0) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// FailedMessages is a free data retrieval call binding the contract method 0xa4e7f8bd. +// +// Solidity: function failedMessages(bytes32 ) view returns(bool) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerSession) FailedMessages(arg0 [32]byte) (bool, error) { + return _L1CrossDomainMessenger.Contract.FailedMessages(&_L1CrossDomainMessenger.CallOpts, arg0) +} + +// FailedMessages is a free data retrieval call binding the contract method 0xa4e7f8bd. +// +// Solidity: function failedMessages(bytes32 ) view returns(bool) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerCallerSession) FailedMessages(arg0 [32]byte) (bool, error) { + return _L1CrossDomainMessenger.Contract.FailedMessages(&_L1CrossDomainMessenger.CallOpts, arg0) +} + +// MessageNonce is a free data retrieval call binding the contract method 0xecc70428. +// +// Solidity: function messageNonce() view returns(uint256) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerCaller) MessageNonce(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _L1CrossDomainMessenger.contract.Call(opts, &out, "messageNonce") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// MessageNonce is a free data retrieval call binding the contract method 0xecc70428. +// +// Solidity: function messageNonce() view returns(uint256) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerSession) MessageNonce() (*big.Int, error) { + return _L1CrossDomainMessenger.Contract.MessageNonce(&_L1CrossDomainMessenger.CallOpts) +} + +// MessageNonce is a free data retrieval call binding the contract method 0xecc70428. +// +// Solidity: function messageNonce() view returns(uint256) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerCallerSession) MessageNonce() (*big.Int, error) { + return _L1CrossDomainMessenger.Contract.MessageNonce(&_L1CrossDomainMessenger.CallOpts) +} + +// OtherMessenger is a free data retrieval call binding the contract method 0xdb505d80. +// +// Solidity: function otherMessenger() view returns(address) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerCaller) OtherMessenger(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _L1CrossDomainMessenger.contract.Call(opts, &out, "otherMessenger") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// OtherMessenger is a free data retrieval call binding the contract method 0xdb505d80. +// +// Solidity: function otherMessenger() view returns(address) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerSession) OtherMessenger() (common.Address, error) { + return _L1CrossDomainMessenger.Contract.OtherMessenger(&_L1CrossDomainMessenger.CallOpts) +} + +// OtherMessenger is a free data retrieval call binding the contract method 0xdb505d80. +// +// Solidity: function otherMessenger() view returns(address) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerCallerSession) OtherMessenger() (common.Address, error) { + return _L1CrossDomainMessenger.Contract.OtherMessenger(&_L1CrossDomainMessenger.CallOpts) +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerCaller) Paused(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _L1CrossDomainMessenger.contract.Call(opts, &out, "paused") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerSession) Paused() (bool, error) { + return _L1CrossDomainMessenger.Contract.Paused(&_L1CrossDomainMessenger.CallOpts) +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerCallerSession) Paused() (bool, error) { + return _L1CrossDomainMessenger.Contract.Paused(&_L1CrossDomainMessenger.CallOpts) +} + +// Portal is a free data retrieval call binding the contract method 0x6425666b. +// +// Solidity: function portal() view returns(address) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerCaller) Portal(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _L1CrossDomainMessenger.contract.Call(opts, &out, "portal") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Portal is a free data retrieval call binding the contract method 0x6425666b. +// +// Solidity: function portal() view returns(address) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerSession) Portal() (common.Address, error) { + return _L1CrossDomainMessenger.Contract.Portal(&_L1CrossDomainMessenger.CallOpts) +} + +// Portal is a free data retrieval call binding the contract method 0x6425666b. +// +// Solidity: function portal() view returns(address) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerCallerSession) Portal() (common.Address, error) { + return _L1CrossDomainMessenger.Contract.Portal(&_L1CrossDomainMessenger.CallOpts) +} + +// SuccessfulMessages is a free data retrieval call binding the contract method 0xb1b1b209. +// +// Solidity: function successfulMessages(bytes32 ) view returns(bool) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerCaller) SuccessfulMessages(opts *bind.CallOpts, arg0 [32]byte) (bool, error) { + var out []interface{} + err := _L1CrossDomainMessenger.contract.Call(opts, &out, "successfulMessages", arg0) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// SuccessfulMessages is a free data retrieval call binding the contract method 0xb1b1b209. +// +// Solidity: function successfulMessages(bytes32 ) view returns(bool) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerSession) SuccessfulMessages(arg0 [32]byte) (bool, error) { + return _L1CrossDomainMessenger.Contract.SuccessfulMessages(&_L1CrossDomainMessenger.CallOpts, arg0) +} + +// SuccessfulMessages is a free data retrieval call binding the contract method 0xb1b1b209. +// +// Solidity: function successfulMessages(bytes32 ) view returns(bool) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerCallerSession) SuccessfulMessages(arg0 [32]byte) (bool, error) { + return _L1CrossDomainMessenger.Contract.SuccessfulMessages(&_L1CrossDomainMessenger.CallOpts, arg0) +} + +// SuperchainConfig is a free data retrieval call binding the contract method 0x35e80ab3. +// +// Solidity: function superchainConfig() view returns(address) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerCaller) SuperchainConfig(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _L1CrossDomainMessenger.contract.Call(opts, &out, "superchainConfig") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// SuperchainConfig is a free data retrieval call binding the contract method 0x35e80ab3. +// +// Solidity: function superchainConfig() view returns(address) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerSession) SuperchainConfig() (common.Address, error) { + return _L1CrossDomainMessenger.Contract.SuperchainConfig(&_L1CrossDomainMessenger.CallOpts) +} + +// SuperchainConfig is a free data retrieval call binding the contract method 0x35e80ab3. +// +// Solidity: function superchainConfig() view returns(address) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerCallerSession) SuperchainConfig() (common.Address, error) { + return _L1CrossDomainMessenger.Contract.SuperchainConfig(&_L1CrossDomainMessenger.CallOpts) +} + +// SystemConfig is a free data retrieval call binding the contract method 0x33d7e2bd. +// +// Solidity: function systemConfig() view returns(address) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerCaller) SystemConfig(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _L1CrossDomainMessenger.contract.Call(opts, &out, "systemConfig") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// SystemConfig is a free data retrieval call binding the contract method 0x33d7e2bd. +// +// Solidity: function systemConfig() view returns(address) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerSession) SystemConfig() (common.Address, error) { + return _L1CrossDomainMessenger.Contract.SystemConfig(&_L1CrossDomainMessenger.CallOpts) +} + +// SystemConfig is a free data retrieval call binding the contract method 0x33d7e2bd. +// +// Solidity: function systemConfig() view returns(address) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerCallerSession) SystemConfig() (common.Address, error) { + return _L1CrossDomainMessenger.Contract.SystemConfig(&_L1CrossDomainMessenger.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerCaller) Version(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _L1CrossDomainMessenger.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 (_L1CrossDomainMessenger *L1CrossDomainMessengerSession) Version() (string, error) { + return _L1CrossDomainMessenger.Contract.Version(&_L1CrossDomainMessenger.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerCallerSession) Version() (string, error) { + return _L1CrossDomainMessenger.Contract.Version(&_L1CrossDomainMessenger.CallOpts) +} + +// XDomainMessageSender is a free data retrieval call binding the contract method 0x6e296e45. +// +// Solidity: function xDomainMessageSender() view returns(address) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerCaller) XDomainMessageSender(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _L1CrossDomainMessenger.contract.Call(opts, &out, "xDomainMessageSender") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// XDomainMessageSender is a free data retrieval call binding the contract method 0x6e296e45. +// +// Solidity: function xDomainMessageSender() view returns(address) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerSession) XDomainMessageSender() (common.Address, error) { + return _L1CrossDomainMessenger.Contract.XDomainMessageSender(&_L1CrossDomainMessenger.CallOpts) +} + +// XDomainMessageSender is a free data retrieval call binding the contract method 0x6e296e45. +// +// Solidity: function xDomainMessageSender() view returns(address) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerCallerSession) XDomainMessageSender() (common.Address, error) { + return _L1CrossDomainMessenger.Contract.XDomainMessageSender(&_L1CrossDomainMessenger.CallOpts) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc0c53b8b. +// +// Solidity: function initialize(address _superchainConfig, address _portal, address _systemConfig) returns() +func (_L1CrossDomainMessenger *L1CrossDomainMessengerTransactor) Initialize(opts *bind.TransactOpts, _superchainConfig common.Address, _portal common.Address, _systemConfig common.Address) (*types.Transaction, error) { + return _L1CrossDomainMessenger.contract.Transact(opts, "initialize", _superchainConfig, _portal, _systemConfig) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc0c53b8b. +// +// Solidity: function initialize(address _superchainConfig, address _portal, address _systemConfig) returns() +func (_L1CrossDomainMessenger *L1CrossDomainMessengerSession) Initialize(_superchainConfig common.Address, _portal common.Address, _systemConfig common.Address) (*types.Transaction, error) { + return _L1CrossDomainMessenger.Contract.Initialize(&_L1CrossDomainMessenger.TransactOpts, _superchainConfig, _portal, _systemConfig) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc0c53b8b. +// +// Solidity: function initialize(address _superchainConfig, address _portal, address _systemConfig) returns() +func (_L1CrossDomainMessenger *L1CrossDomainMessengerTransactorSession) Initialize(_superchainConfig common.Address, _portal common.Address, _systemConfig common.Address) (*types.Transaction, error) { + return _L1CrossDomainMessenger.Contract.Initialize(&_L1CrossDomainMessenger.TransactOpts, _superchainConfig, _portal, _systemConfig) +} + +// RelayMessage is a paid mutator transaction binding the contract method 0xd764ad0b. +// +// Solidity: function relayMessage(uint256 _nonce, address _sender, address _target, uint256 _value, uint256 _minGasLimit, bytes _message) payable returns() +func (_L1CrossDomainMessenger *L1CrossDomainMessengerTransactor) RelayMessage(opts *bind.TransactOpts, _nonce *big.Int, _sender common.Address, _target common.Address, _value *big.Int, _minGasLimit *big.Int, _message []byte) (*types.Transaction, error) { + return _L1CrossDomainMessenger.contract.Transact(opts, "relayMessage", _nonce, _sender, _target, _value, _minGasLimit, _message) +} + +// RelayMessage is a paid mutator transaction binding the contract method 0xd764ad0b. +// +// Solidity: function relayMessage(uint256 _nonce, address _sender, address _target, uint256 _value, uint256 _minGasLimit, bytes _message) payable returns() +func (_L1CrossDomainMessenger *L1CrossDomainMessengerSession) RelayMessage(_nonce *big.Int, _sender common.Address, _target common.Address, _value *big.Int, _minGasLimit *big.Int, _message []byte) (*types.Transaction, error) { + return _L1CrossDomainMessenger.Contract.RelayMessage(&_L1CrossDomainMessenger.TransactOpts, _nonce, _sender, _target, _value, _minGasLimit, _message) +} + +// RelayMessage is a paid mutator transaction binding the contract method 0xd764ad0b. +// +// Solidity: function relayMessage(uint256 _nonce, address _sender, address _target, uint256 _value, uint256 _minGasLimit, bytes _message) payable returns() +func (_L1CrossDomainMessenger *L1CrossDomainMessengerTransactorSession) RelayMessage(_nonce *big.Int, _sender common.Address, _target common.Address, _value *big.Int, _minGasLimit *big.Int, _message []byte) (*types.Transaction, error) { + return _L1CrossDomainMessenger.Contract.RelayMessage(&_L1CrossDomainMessenger.TransactOpts, _nonce, _sender, _target, _value, _minGasLimit, _message) +} + +// SendMessage is a paid mutator transaction binding the contract method 0x3dbb202b. +// +// Solidity: function sendMessage(address _target, bytes _message, uint32 _minGasLimit) payable returns() +func (_L1CrossDomainMessenger *L1CrossDomainMessengerTransactor) SendMessage(opts *bind.TransactOpts, _target common.Address, _message []byte, _minGasLimit uint32) (*types.Transaction, error) { + return _L1CrossDomainMessenger.contract.Transact(opts, "sendMessage", _target, _message, _minGasLimit) +} + +// SendMessage is a paid mutator transaction binding the contract method 0x3dbb202b. +// +// Solidity: function sendMessage(address _target, bytes _message, uint32 _minGasLimit) payable returns() +func (_L1CrossDomainMessenger *L1CrossDomainMessengerSession) SendMessage(_target common.Address, _message []byte, _minGasLimit uint32) (*types.Transaction, error) { + return _L1CrossDomainMessenger.Contract.SendMessage(&_L1CrossDomainMessenger.TransactOpts, _target, _message, _minGasLimit) +} + +// SendMessage is a paid mutator transaction binding the contract method 0x3dbb202b. +// +// Solidity: function sendMessage(address _target, bytes _message, uint32 _minGasLimit) payable returns() +func (_L1CrossDomainMessenger *L1CrossDomainMessengerTransactorSession) SendMessage(_target common.Address, _message []byte, _minGasLimit uint32) (*types.Transaction, error) { + return _L1CrossDomainMessenger.Contract.SendMessage(&_L1CrossDomainMessenger.TransactOpts, _target, _message, _minGasLimit) +} + +// L1CrossDomainMessengerFailedRelayedMessageIterator is returned from FilterFailedRelayedMessage and is used to iterate over the raw logs and unpacked data for FailedRelayedMessage events raised by the L1CrossDomainMessenger contract. +type L1CrossDomainMessengerFailedRelayedMessageIterator struct { + Event *L1CrossDomainMessengerFailedRelayedMessage // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *L1CrossDomainMessengerFailedRelayedMessageIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(L1CrossDomainMessengerFailedRelayedMessage) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(L1CrossDomainMessengerFailedRelayedMessage) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *L1CrossDomainMessengerFailedRelayedMessageIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *L1CrossDomainMessengerFailedRelayedMessageIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// L1CrossDomainMessengerFailedRelayedMessage represents a FailedRelayedMessage event raised by the L1CrossDomainMessenger contract. +type L1CrossDomainMessengerFailedRelayedMessage struct { + MsgHash [32]byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterFailedRelayedMessage is a free log retrieval operation binding the contract event 0x99d0e048484baa1b1540b1367cb128acd7ab2946d1ed91ec10e3c85e4bf51b8f. +// +// Solidity: event FailedRelayedMessage(bytes32 indexed msgHash) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerFilterer) FilterFailedRelayedMessage(opts *bind.FilterOpts, msgHash [][32]byte) (*L1CrossDomainMessengerFailedRelayedMessageIterator, error) { + + var msgHashRule []interface{} + for _, msgHashItem := range msgHash { + msgHashRule = append(msgHashRule, msgHashItem) + } + + logs, sub, err := _L1CrossDomainMessenger.contract.FilterLogs(opts, "FailedRelayedMessage", msgHashRule) + if err != nil { + return nil, err + } + return &L1CrossDomainMessengerFailedRelayedMessageIterator{contract: _L1CrossDomainMessenger.contract, event: "FailedRelayedMessage", logs: logs, sub: sub}, nil +} + +// WatchFailedRelayedMessage is a free log subscription operation binding the contract event 0x99d0e048484baa1b1540b1367cb128acd7ab2946d1ed91ec10e3c85e4bf51b8f. +// +// Solidity: event FailedRelayedMessage(bytes32 indexed msgHash) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerFilterer) WatchFailedRelayedMessage(opts *bind.WatchOpts, sink chan<- *L1CrossDomainMessengerFailedRelayedMessage, msgHash [][32]byte) (event.Subscription, error) { + + var msgHashRule []interface{} + for _, msgHashItem := range msgHash { + msgHashRule = append(msgHashRule, msgHashItem) + } + + logs, sub, err := _L1CrossDomainMessenger.contract.WatchLogs(opts, "FailedRelayedMessage", msgHashRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(L1CrossDomainMessengerFailedRelayedMessage) + if err := _L1CrossDomainMessenger.contract.UnpackLog(event, "FailedRelayedMessage", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseFailedRelayedMessage is a log parse operation binding the contract event 0x99d0e048484baa1b1540b1367cb128acd7ab2946d1ed91ec10e3c85e4bf51b8f. +// +// Solidity: event FailedRelayedMessage(bytes32 indexed msgHash) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerFilterer) ParseFailedRelayedMessage(log types.Log) (*L1CrossDomainMessengerFailedRelayedMessage, error) { + event := new(L1CrossDomainMessengerFailedRelayedMessage) + if err := _L1CrossDomainMessenger.contract.UnpackLog(event, "FailedRelayedMessage", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// L1CrossDomainMessengerInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the L1CrossDomainMessenger contract. +type L1CrossDomainMessengerInitializedIterator struct { + Event *L1CrossDomainMessengerInitialized // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *L1CrossDomainMessengerInitializedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(L1CrossDomainMessengerInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(L1CrossDomainMessengerInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *L1CrossDomainMessengerInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *L1CrossDomainMessengerInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// L1CrossDomainMessengerInitialized represents a Initialized event raised by the L1CrossDomainMessenger contract. +type L1CrossDomainMessengerInitialized struct { + Version uint8 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerFilterer) FilterInitialized(opts *bind.FilterOpts) (*L1CrossDomainMessengerInitializedIterator, error) { + + logs, sub, err := _L1CrossDomainMessenger.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &L1CrossDomainMessengerInitializedIterator{contract: _L1CrossDomainMessenger.contract, event: "Initialized", logs: logs, sub: sub}, nil +} + +// WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *L1CrossDomainMessengerInitialized) (event.Subscription, error) { + + logs, sub, err := _L1CrossDomainMessenger.contract.WatchLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(L1CrossDomainMessengerInitialized) + if err := _L1CrossDomainMessenger.contract.UnpackLog(event, "Initialized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerFilterer) ParseInitialized(log types.Log) (*L1CrossDomainMessengerInitialized, error) { + event := new(L1CrossDomainMessengerInitialized) + if err := _L1CrossDomainMessenger.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// L1CrossDomainMessengerRelayedMessageIterator is returned from FilterRelayedMessage and is used to iterate over the raw logs and unpacked data for RelayedMessage events raised by the L1CrossDomainMessenger contract. +type L1CrossDomainMessengerRelayedMessageIterator struct { + Event *L1CrossDomainMessengerRelayedMessage // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *L1CrossDomainMessengerRelayedMessageIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(L1CrossDomainMessengerRelayedMessage) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(L1CrossDomainMessengerRelayedMessage) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *L1CrossDomainMessengerRelayedMessageIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *L1CrossDomainMessengerRelayedMessageIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// L1CrossDomainMessengerRelayedMessage represents a RelayedMessage event raised by the L1CrossDomainMessenger contract. +type L1CrossDomainMessengerRelayedMessage struct { + MsgHash [32]byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterRelayedMessage is a free log retrieval operation binding the contract event 0x4641df4a962071e12719d8c8c8e5ac7fc4d97b927346a3d7a335b1f7517e133c. +// +// Solidity: event RelayedMessage(bytes32 indexed msgHash) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerFilterer) FilterRelayedMessage(opts *bind.FilterOpts, msgHash [][32]byte) (*L1CrossDomainMessengerRelayedMessageIterator, error) { + + var msgHashRule []interface{} + for _, msgHashItem := range msgHash { + msgHashRule = append(msgHashRule, msgHashItem) + } + + logs, sub, err := _L1CrossDomainMessenger.contract.FilterLogs(opts, "RelayedMessage", msgHashRule) + if err != nil { + return nil, err + } + return &L1CrossDomainMessengerRelayedMessageIterator{contract: _L1CrossDomainMessenger.contract, event: "RelayedMessage", logs: logs, sub: sub}, nil +} + +// WatchRelayedMessage is a free log subscription operation binding the contract event 0x4641df4a962071e12719d8c8c8e5ac7fc4d97b927346a3d7a335b1f7517e133c. +// +// Solidity: event RelayedMessage(bytes32 indexed msgHash) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerFilterer) WatchRelayedMessage(opts *bind.WatchOpts, sink chan<- *L1CrossDomainMessengerRelayedMessage, msgHash [][32]byte) (event.Subscription, error) { + + var msgHashRule []interface{} + for _, msgHashItem := range msgHash { + msgHashRule = append(msgHashRule, msgHashItem) + } + + logs, sub, err := _L1CrossDomainMessenger.contract.WatchLogs(opts, "RelayedMessage", msgHashRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(L1CrossDomainMessengerRelayedMessage) + if err := _L1CrossDomainMessenger.contract.UnpackLog(event, "RelayedMessage", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseRelayedMessage is a log parse operation binding the contract event 0x4641df4a962071e12719d8c8c8e5ac7fc4d97b927346a3d7a335b1f7517e133c. +// +// Solidity: event RelayedMessage(bytes32 indexed msgHash) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerFilterer) ParseRelayedMessage(log types.Log) (*L1CrossDomainMessengerRelayedMessage, error) { + event := new(L1CrossDomainMessengerRelayedMessage) + if err := _L1CrossDomainMessenger.contract.UnpackLog(event, "RelayedMessage", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// L1CrossDomainMessengerSentMessageIterator is returned from FilterSentMessage and is used to iterate over the raw logs and unpacked data for SentMessage events raised by the L1CrossDomainMessenger contract. +type L1CrossDomainMessengerSentMessageIterator struct { + Event *L1CrossDomainMessengerSentMessage // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *L1CrossDomainMessengerSentMessageIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(L1CrossDomainMessengerSentMessage) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(L1CrossDomainMessengerSentMessage) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *L1CrossDomainMessengerSentMessageIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *L1CrossDomainMessengerSentMessageIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// L1CrossDomainMessengerSentMessage represents a SentMessage event raised by the L1CrossDomainMessenger contract. +type L1CrossDomainMessengerSentMessage struct { + Target common.Address + Sender common.Address + Message []byte + MessageNonce *big.Int + GasLimit *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSentMessage is a free log retrieval operation binding the contract event 0xcb0f7ffd78f9aee47a248fae8db181db6eee833039123e026dcbff529522e52a. +// +// Solidity: event SentMessage(address indexed target, address sender, bytes message, uint256 messageNonce, uint256 gasLimit) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerFilterer) FilterSentMessage(opts *bind.FilterOpts, target []common.Address) (*L1CrossDomainMessengerSentMessageIterator, error) { + + var targetRule []interface{} + for _, targetItem := range target { + targetRule = append(targetRule, targetItem) + } + + logs, sub, err := _L1CrossDomainMessenger.contract.FilterLogs(opts, "SentMessage", targetRule) + if err != nil { + return nil, err + } + return &L1CrossDomainMessengerSentMessageIterator{contract: _L1CrossDomainMessenger.contract, event: "SentMessage", logs: logs, sub: sub}, nil +} + +// WatchSentMessage is a free log subscription operation binding the contract event 0xcb0f7ffd78f9aee47a248fae8db181db6eee833039123e026dcbff529522e52a. +// +// Solidity: event SentMessage(address indexed target, address sender, bytes message, uint256 messageNonce, uint256 gasLimit) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerFilterer) WatchSentMessage(opts *bind.WatchOpts, sink chan<- *L1CrossDomainMessengerSentMessage, target []common.Address) (event.Subscription, error) { + + var targetRule []interface{} + for _, targetItem := range target { + targetRule = append(targetRule, targetItem) + } + + logs, sub, err := _L1CrossDomainMessenger.contract.WatchLogs(opts, "SentMessage", targetRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(L1CrossDomainMessengerSentMessage) + if err := _L1CrossDomainMessenger.contract.UnpackLog(event, "SentMessage", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseSentMessage is a log parse operation binding the contract event 0xcb0f7ffd78f9aee47a248fae8db181db6eee833039123e026dcbff529522e52a. +// +// Solidity: event SentMessage(address indexed target, address sender, bytes message, uint256 messageNonce, uint256 gasLimit) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerFilterer) ParseSentMessage(log types.Log) (*L1CrossDomainMessengerSentMessage, error) { + event := new(L1CrossDomainMessengerSentMessage) + if err := _L1CrossDomainMessenger.contract.UnpackLog(event, "SentMessage", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// L1CrossDomainMessengerSentMessageExtension1Iterator is returned from FilterSentMessageExtension1 and is used to iterate over the raw logs and unpacked data for SentMessageExtension1 events raised by the L1CrossDomainMessenger contract. +type L1CrossDomainMessengerSentMessageExtension1Iterator struct { + Event *L1CrossDomainMessengerSentMessageExtension1 // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *L1CrossDomainMessengerSentMessageExtension1Iterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(L1CrossDomainMessengerSentMessageExtension1) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(L1CrossDomainMessengerSentMessageExtension1) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *L1CrossDomainMessengerSentMessageExtension1Iterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *L1CrossDomainMessengerSentMessageExtension1Iterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// L1CrossDomainMessengerSentMessageExtension1 represents a SentMessageExtension1 event raised by the L1CrossDomainMessenger contract. +type L1CrossDomainMessengerSentMessageExtension1 struct { + Sender common.Address + Value *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSentMessageExtension1 is a free log retrieval operation binding the contract event 0x8ebb2ec2465bdb2a06a66fc37a0963af8a2a6a1479d81d56fdb8cbb98096d546. +// +// Solidity: event SentMessageExtension1(address indexed sender, uint256 value) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerFilterer) FilterSentMessageExtension1(opts *bind.FilterOpts, sender []common.Address) (*L1CrossDomainMessengerSentMessageExtension1Iterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _L1CrossDomainMessenger.contract.FilterLogs(opts, "SentMessageExtension1", senderRule) + if err != nil { + return nil, err + } + return &L1CrossDomainMessengerSentMessageExtension1Iterator{contract: _L1CrossDomainMessenger.contract, event: "SentMessageExtension1", logs: logs, sub: sub}, nil +} + +// WatchSentMessageExtension1 is a free log subscription operation binding the contract event 0x8ebb2ec2465bdb2a06a66fc37a0963af8a2a6a1479d81d56fdb8cbb98096d546. +// +// Solidity: event SentMessageExtension1(address indexed sender, uint256 value) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerFilterer) WatchSentMessageExtension1(opts *bind.WatchOpts, sink chan<- *L1CrossDomainMessengerSentMessageExtension1, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _L1CrossDomainMessenger.contract.WatchLogs(opts, "SentMessageExtension1", senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(L1CrossDomainMessengerSentMessageExtension1) + if err := _L1CrossDomainMessenger.contract.UnpackLog(event, "SentMessageExtension1", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseSentMessageExtension1 is a log parse operation binding the contract event 0x8ebb2ec2465bdb2a06a66fc37a0963af8a2a6a1479d81d56fdb8cbb98096d546. +// +// Solidity: event SentMessageExtension1(address indexed sender, uint256 value) +func (_L1CrossDomainMessenger *L1CrossDomainMessengerFilterer) ParseSentMessageExtension1(log types.Log) (*L1CrossDomainMessengerSentMessageExtension1, error) { + event := new(L1CrossDomainMessengerSentMessageExtension1) + if err := _L1CrossDomainMessenger.contract.UnpackLog(event, "SentMessageExtension1", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/op-e2e2/bindings/l1erc721bridge.go b/op-e2e2/bindings/l1erc721bridge.go new file mode 100644 index 000000000000..c80d2bb3b95a --- /dev/null +++ b/op-e2e2/bindings/l1erc721bridge.go @@ -0,0 +1,998 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// L1ERC721BridgeMetaData contains all meta data concerning the L1ERC721Bridge contract. +var L1ERC721BridgeMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"MESSENGER\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractCrossDomainMessenger\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"OTHER_BRIDGE\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractStandardBridge\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"bridgeERC721\",\"inputs\":[{\"name\":\"_localToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_remoteToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_tokenId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_minGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"_extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"bridgeERC721To\",\"inputs\":[{\"name\":\"_localToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_remoteToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_tokenId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_minGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"_extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"deposits\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"finalizeBridgeERC721\",\"inputs\":[{\"name\":\"_localToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_remoteToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_from\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_tokenId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_messenger\",\"type\":\"address\",\"internalType\":\"contractCrossDomainMessenger\"},{\"name\":\"_superchainConfig\",\"type\":\"address\",\"internalType\":\"contractSuperchainConfig\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"messenger\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractCrossDomainMessenger\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"otherBridge\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractStandardBridge\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"paused\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"superchainConfig\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractSuperchainConfig\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"ERC721BridgeFinalized\",\"inputs\":[{\"name\":\"localToken\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"remoteToken\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"tokenId\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"extraData\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ERC721BridgeInitiated\",\"inputs\":[{\"name\":\"localToken\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"remoteToken\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"tokenId\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"extraData\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false}]", + Bin: "0x60806040523480156200001157600080fd5b506200001f60008062000025565b62000234565b600054610100900460ff1615808015620000465750600054600160ff909116105b8062000076575062000063306200018a60201b62000b141760201c565b15801562000076575060005460ff166001145b620000df5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff19166001179055801562000103576000805461ff0019166101001790555b603280546001600160a01b0319166001600160a01b0384161790556200013e8373420000000000000000000000000000000000001462000199565b801562000185576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b6001600160a01b03163b151590565b600054610100900460ff16620002065760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401620000d6565b600180546001600160a01b039384166001600160a01b03199182161790915560028054929093169116179055565b6113e980620002446000396000f3fe608060405234801561001057600080fd5b50600436106100d45760003560e01c80635d93a3fc11610081578063927ede2d1161005b578063927ede2d14610231578063aa5574521461024f578063c89701a21461026257600080fd5b80635d93a3fc146101cc578063761f4493146102005780637f46ddb21461021357600080fd5b8063485cc955116100b2578063485cc9551461015857806354fd4d501461016b5780635c975abb146101b457600080fd5b806335e80ab3146100d95780633687011a146101235780633cb747bf14610138575b600080fd5b6032546100f99073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b610136610131366004610fe1565b610282565b005b6001546100f99073ffffffffffffffffffffffffffffffffffffffff1681565b610136610166366004611064565b61032e565b6101a76040518060400160405280600581526020017f322e312e3000000000000000000000000000000000000000000000000000000081525081565b60405161011a9190611108565b6101bc610518565b604051901515815260200161011a565b6101bc6101da366004611122565b603160209081526000938452604080852082529284528284209052825290205460ff1681565b61013661020e366004611163565b6105b1565b60025473ffffffffffffffffffffffffffffffffffffffff166100f9565b60015473ffffffffffffffffffffffffffffffffffffffff166100f9565b61013661025d3660046111fb565b610a58565b6002546100f99073ffffffffffffffffffffffffffffffffffffffff1681565b333b15610316576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f4552433732314272696467653a206163636f756e74206973206e6f742065787460448201527f65726e616c6c79206f776e65640000000000000000000000000000000000000060648201526084015b60405180910390fd5b6103268686333388888888610b30565b505050505050565b600054610100900460ff161580801561034e5750600054600160ff909116105b806103685750303b158015610368575060005460ff166001145b6103f4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a6564000000000000000000000000000000000000606482015260840161030d565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561045257600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b603280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff84161790556104b083734200000000000000000000000000000000000014610e70565b801561051357600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b603254604080517f5c975abb000000000000000000000000000000000000000000000000000000008152905160009273ffffffffffffffffffffffffffffffffffffffff1691635c975abb9160048083019260209291908290030181865afa158015610588573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ac9190611272565b905090565b60015473ffffffffffffffffffffffffffffffffffffffff16331480156106865750600254600154604080517f6e296e45000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff9384169390921691636e296e45916004808201926020929091908290030181865afa15801561064a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061066e9190611294565b73ffffffffffffffffffffffffffffffffffffffff16145b610712576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f4552433732314272696467653a2066756e6374696f6e2063616e206f6e6c792060448201527f62652063616c6c65642066726f6d20746865206f746865722062726964676500606482015260840161030d565b61071a610518565b15610781576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4c314552433732314272696467653a2070617573656400000000000000000000604482015260640161030d565b3073ffffffffffffffffffffffffffffffffffffffff881603610826576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f4c314552433732314272696467653a206c6f63616c20746f6b656e2063616e6e60448201527f6f742062652073656c6600000000000000000000000000000000000000000000606482015260840161030d565b73ffffffffffffffffffffffffffffffffffffffff8088166000908152603160209081526040808320938a1683529281528282208683529052205460ff1615156001146108f5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603960248201527f4c314552433732314272696467653a20546f6b656e204944206973206e6f742060448201527f657363726f77656420696e20746865204c312042726964676500000000000000606482015260840161030d565b73ffffffffffffffffffffffffffffffffffffffff87811660008181526031602090815260408083208b8616845282528083208884529091529081902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055517f42842e0e000000000000000000000000000000000000000000000000000000008152306004820152918616602483015260448201859052906342842e0e90606401600060405180830381600087803b1580156109b557600080fd5b505af11580156109c9573d6000803e3d6000fd5b505050508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167f1f39bf6707b5d608453e0ae4c067b562bcc4c85c0f562ef5d2c774d2e7f131ac87878787604051610a4794939291906112fa565b60405180910390a450505050505050565b73ffffffffffffffffffffffffffffffffffffffff8516610afb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f4552433732314272696467653a206e667420726563697069656e742063616e6e60448201527f6f74206265206164647265737328302900000000000000000000000000000000606482015260840161030d565b610b0b8787338888888888610b30565b50505050505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b73ffffffffffffffffffffffffffffffffffffffff8716610bd3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603160248201527f4c314552433732314272696467653a2072656d6f746520746f6b656e2063616e60448201527f6e6f742062652061646472657373283029000000000000000000000000000000606482015260840161030d565b600063761f449360e01b888a8989898888604051602401610bfa979695949392919061133a565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152918152602080830180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000959095169490941790935273ffffffffffffffffffffffffffffffffffffffff8c81166000818152603186528381208e8416825286528381208b82529095529382902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905590517f23b872dd000000000000000000000000000000000000000000000000000000008152908a166004820152306024820152604481018890529092506323b872dd90606401600060405180830381600087803b158015610d3a57600080fd5b505af1158015610d4e573d6000803e3d6000fd5b50506001546002546040517f3dbb202b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9283169450633dbb202b9350610db1929091169085908990600401611397565b600060405180830381600087803b158015610dcb57600080fd5b505af1158015610ddf573d6000803e3d6000fd5b505050508673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff167fb7460e2a880f256ebef3406116ff3eee0cee51ebccdc2a40698f87ebb2e9c1a589898888604051610e5d94939291906112fa565b60405180910390a4505050505050505050565b600054610100900460ff16610f07576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e67000000000000000000000000000000000000000000606482015260840161030d565b6001805473ffffffffffffffffffffffffffffffffffffffff9384167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560028054929093169116179055565b73ffffffffffffffffffffffffffffffffffffffff81168114610f7c57600080fd5b50565b803563ffffffff81168114610f9357600080fd5b919050565b60008083601f840112610faa57600080fd5b50813567ffffffffffffffff811115610fc257600080fd5b602083019150836020828501011115610fda57600080fd5b9250929050565b60008060008060008060a08789031215610ffa57600080fd5b863561100581610f5a565b9550602087013561101581610f5a565b94506040870135935061102a60608801610f7f565b9250608087013567ffffffffffffffff81111561104657600080fd5b61105289828a01610f98565b979a9699509497509295939492505050565b6000806040838503121561107757600080fd5b823561108281610f5a565b9150602083013561109281610f5a565b809150509250929050565b6000815180845260005b818110156110c3576020818501810151868301820152016110a7565b818111156110d5576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60208152600061111b602083018461109d565b9392505050565b60008060006060848603121561113757600080fd5b833561114281610f5a565b9250602084013561115281610f5a565b929592945050506040919091013590565b600080600080600080600060c0888a03121561117e57600080fd5b873561118981610f5a565b9650602088013561119981610f5a565b955060408801356111a981610f5a565b945060608801356111b981610f5a565b93506080880135925060a088013567ffffffffffffffff8111156111dc57600080fd5b6111e88a828b01610f98565b989b979a50959850939692959293505050565b600080600080600080600060c0888a03121561121657600080fd5b873561122181610f5a565b9650602088013561123181610f5a565b9550604088013561124181610f5a565b94506060880135935061125660808901610f7f565b925060a088013567ffffffffffffffff8111156111dc57600080fd5b60006020828403121561128457600080fd5b8151801515811461111b57600080fd5b6000602082840312156112a657600080fd5b815161111b81610f5a565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b73ffffffffffffffffffffffffffffffffffffffff851681528360208201526060604082015260006113306060830184866112b1565b9695505050505050565b600073ffffffffffffffffffffffffffffffffffffffff808a1683528089166020840152808816604084015280871660608401525084608083015260c060a083015261138a60c0830184866112b1565b9998505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff841681526060602082015260006113c6606083018561109d565b905063ffffffff8316604083015294935050505056fea164736f6c634300080f000a", +} + +// L1ERC721BridgeABI is the input ABI used to generate the binding from. +// Deprecated: Use L1ERC721BridgeMetaData.ABI instead. +var L1ERC721BridgeABI = L1ERC721BridgeMetaData.ABI + +// L1ERC721BridgeBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use L1ERC721BridgeMetaData.Bin instead. +var L1ERC721BridgeBin = L1ERC721BridgeMetaData.Bin + +// DeployL1ERC721Bridge deploys a new Ethereum contract, binding an instance of L1ERC721Bridge to it. +func DeployL1ERC721Bridge(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *L1ERC721Bridge, error) { + parsed, err := L1ERC721BridgeMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(L1ERC721BridgeBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &L1ERC721Bridge{L1ERC721BridgeCaller: L1ERC721BridgeCaller{contract: contract}, L1ERC721BridgeTransactor: L1ERC721BridgeTransactor{contract: contract}, L1ERC721BridgeFilterer: L1ERC721BridgeFilterer{contract: contract}}, nil +} + +// L1ERC721Bridge is an auto generated Go binding around an Ethereum contract. +type L1ERC721Bridge struct { + L1ERC721BridgeCaller // Read-only binding to the contract + L1ERC721BridgeTransactor // Write-only binding to the contract + L1ERC721BridgeFilterer // Log filterer for contract events +} + +// L1ERC721BridgeCaller is an auto generated read-only Go binding around an Ethereum contract. +type L1ERC721BridgeCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// L1ERC721BridgeTransactor is an auto generated write-only Go binding around an Ethereum contract. +type L1ERC721BridgeTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// L1ERC721BridgeFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type L1ERC721BridgeFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// L1ERC721BridgeSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type L1ERC721BridgeSession struct { + Contract *L1ERC721Bridge // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// L1ERC721BridgeCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type L1ERC721BridgeCallerSession struct { + Contract *L1ERC721BridgeCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// L1ERC721BridgeTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type L1ERC721BridgeTransactorSession struct { + Contract *L1ERC721BridgeTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// L1ERC721BridgeRaw is an auto generated low-level Go binding around an Ethereum contract. +type L1ERC721BridgeRaw struct { + Contract *L1ERC721Bridge // Generic contract binding to access the raw methods on +} + +// L1ERC721BridgeCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type L1ERC721BridgeCallerRaw struct { + Contract *L1ERC721BridgeCaller // Generic read-only contract binding to access the raw methods on +} + +// L1ERC721BridgeTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type L1ERC721BridgeTransactorRaw struct { + Contract *L1ERC721BridgeTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewL1ERC721Bridge creates a new instance of L1ERC721Bridge, bound to a specific deployed contract. +func NewL1ERC721Bridge(address common.Address, backend bind.ContractBackend) (*L1ERC721Bridge, error) { + contract, err := bindL1ERC721Bridge(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &L1ERC721Bridge{L1ERC721BridgeCaller: L1ERC721BridgeCaller{contract: contract}, L1ERC721BridgeTransactor: L1ERC721BridgeTransactor{contract: contract}, L1ERC721BridgeFilterer: L1ERC721BridgeFilterer{contract: contract}}, nil +} + +// NewL1ERC721BridgeCaller creates a new read-only instance of L1ERC721Bridge, bound to a specific deployed contract. +func NewL1ERC721BridgeCaller(address common.Address, caller bind.ContractCaller) (*L1ERC721BridgeCaller, error) { + contract, err := bindL1ERC721Bridge(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &L1ERC721BridgeCaller{contract: contract}, nil +} + +// NewL1ERC721BridgeTransactor creates a new write-only instance of L1ERC721Bridge, bound to a specific deployed contract. +func NewL1ERC721BridgeTransactor(address common.Address, transactor bind.ContractTransactor) (*L1ERC721BridgeTransactor, error) { + contract, err := bindL1ERC721Bridge(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &L1ERC721BridgeTransactor{contract: contract}, nil +} + +// NewL1ERC721BridgeFilterer creates a new log filterer instance of L1ERC721Bridge, bound to a specific deployed contract. +func NewL1ERC721BridgeFilterer(address common.Address, filterer bind.ContractFilterer) (*L1ERC721BridgeFilterer, error) { + contract, err := bindL1ERC721Bridge(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &L1ERC721BridgeFilterer{contract: contract}, nil +} + +// bindL1ERC721Bridge binds a generic wrapper to an already deployed contract. +func bindL1ERC721Bridge(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(L1ERC721BridgeABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_L1ERC721Bridge *L1ERC721BridgeRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _L1ERC721Bridge.Contract.L1ERC721BridgeCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_L1ERC721Bridge *L1ERC721BridgeRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _L1ERC721Bridge.Contract.L1ERC721BridgeTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_L1ERC721Bridge *L1ERC721BridgeRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _L1ERC721Bridge.Contract.L1ERC721BridgeTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_L1ERC721Bridge *L1ERC721BridgeCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _L1ERC721Bridge.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_L1ERC721Bridge *L1ERC721BridgeTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _L1ERC721Bridge.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_L1ERC721Bridge *L1ERC721BridgeTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _L1ERC721Bridge.Contract.contract.Transact(opts, method, params...) +} + +// MESSENGER is a free data retrieval call binding the contract method 0x927ede2d. +// +// Solidity: function MESSENGER() view returns(address) +func (_L1ERC721Bridge *L1ERC721BridgeCaller) MESSENGER(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _L1ERC721Bridge.contract.Call(opts, &out, "MESSENGER") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// MESSENGER is a free data retrieval call binding the contract method 0x927ede2d. +// +// Solidity: function MESSENGER() view returns(address) +func (_L1ERC721Bridge *L1ERC721BridgeSession) MESSENGER() (common.Address, error) { + return _L1ERC721Bridge.Contract.MESSENGER(&_L1ERC721Bridge.CallOpts) +} + +// MESSENGER is a free data retrieval call binding the contract method 0x927ede2d. +// +// Solidity: function MESSENGER() view returns(address) +func (_L1ERC721Bridge *L1ERC721BridgeCallerSession) MESSENGER() (common.Address, error) { + return _L1ERC721Bridge.Contract.MESSENGER(&_L1ERC721Bridge.CallOpts) +} + +// OTHERBRIDGE is a free data retrieval call binding the contract method 0x7f46ddb2. +// +// Solidity: function OTHER_BRIDGE() view returns(address) +func (_L1ERC721Bridge *L1ERC721BridgeCaller) OTHERBRIDGE(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _L1ERC721Bridge.contract.Call(opts, &out, "OTHER_BRIDGE") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// OTHERBRIDGE is a free data retrieval call binding the contract method 0x7f46ddb2. +// +// Solidity: function OTHER_BRIDGE() view returns(address) +func (_L1ERC721Bridge *L1ERC721BridgeSession) OTHERBRIDGE() (common.Address, error) { + return _L1ERC721Bridge.Contract.OTHERBRIDGE(&_L1ERC721Bridge.CallOpts) +} + +// OTHERBRIDGE is a free data retrieval call binding the contract method 0x7f46ddb2. +// +// Solidity: function OTHER_BRIDGE() view returns(address) +func (_L1ERC721Bridge *L1ERC721BridgeCallerSession) OTHERBRIDGE() (common.Address, error) { + return _L1ERC721Bridge.Contract.OTHERBRIDGE(&_L1ERC721Bridge.CallOpts) +} + +// Deposits is a free data retrieval call binding the contract method 0x5d93a3fc. +// +// Solidity: function deposits(address , address , uint256 ) view returns(bool) +func (_L1ERC721Bridge *L1ERC721BridgeCaller) Deposits(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address, arg2 *big.Int) (bool, error) { + var out []interface{} + err := _L1ERC721Bridge.contract.Call(opts, &out, "deposits", arg0, arg1, arg2) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// Deposits is a free data retrieval call binding the contract method 0x5d93a3fc. +// +// Solidity: function deposits(address , address , uint256 ) view returns(bool) +func (_L1ERC721Bridge *L1ERC721BridgeSession) Deposits(arg0 common.Address, arg1 common.Address, arg2 *big.Int) (bool, error) { + return _L1ERC721Bridge.Contract.Deposits(&_L1ERC721Bridge.CallOpts, arg0, arg1, arg2) +} + +// Deposits is a free data retrieval call binding the contract method 0x5d93a3fc. +// +// Solidity: function deposits(address , address , uint256 ) view returns(bool) +func (_L1ERC721Bridge *L1ERC721BridgeCallerSession) Deposits(arg0 common.Address, arg1 common.Address, arg2 *big.Int) (bool, error) { + return _L1ERC721Bridge.Contract.Deposits(&_L1ERC721Bridge.CallOpts, arg0, arg1, arg2) +} + +// Messenger is a free data retrieval call binding the contract method 0x3cb747bf. +// +// Solidity: function messenger() view returns(address) +func (_L1ERC721Bridge *L1ERC721BridgeCaller) Messenger(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _L1ERC721Bridge.contract.Call(opts, &out, "messenger") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Messenger is a free data retrieval call binding the contract method 0x3cb747bf. +// +// Solidity: function messenger() view returns(address) +func (_L1ERC721Bridge *L1ERC721BridgeSession) Messenger() (common.Address, error) { + return _L1ERC721Bridge.Contract.Messenger(&_L1ERC721Bridge.CallOpts) +} + +// Messenger is a free data retrieval call binding the contract method 0x3cb747bf. +// +// Solidity: function messenger() view returns(address) +func (_L1ERC721Bridge *L1ERC721BridgeCallerSession) Messenger() (common.Address, error) { + return _L1ERC721Bridge.Contract.Messenger(&_L1ERC721Bridge.CallOpts) +} + +// OtherBridge is a free data retrieval call binding the contract method 0xc89701a2. +// +// Solidity: function otherBridge() view returns(address) +func (_L1ERC721Bridge *L1ERC721BridgeCaller) OtherBridge(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _L1ERC721Bridge.contract.Call(opts, &out, "otherBridge") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// OtherBridge is a free data retrieval call binding the contract method 0xc89701a2. +// +// Solidity: function otherBridge() view returns(address) +func (_L1ERC721Bridge *L1ERC721BridgeSession) OtherBridge() (common.Address, error) { + return _L1ERC721Bridge.Contract.OtherBridge(&_L1ERC721Bridge.CallOpts) +} + +// OtherBridge is a free data retrieval call binding the contract method 0xc89701a2. +// +// Solidity: function otherBridge() view returns(address) +func (_L1ERC721Bridge *L1ERC721BridgeCallerSession) OtherBridge() (common.Address, error) { + return _L1ERC721Bridge.Contract.OtherBridge(&_L1ERC721Bridge.CallOpts) +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool) +func (_L1ERC721Bridge *L1ERC721BridgeCaller) Paused(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _L1ERC721Bridge.contract.Call(opts, &out, "paused") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool) +func (_L1ERC721Bridge *L1ERC721BridgeSession) Paused() (bool, error) { + return _L1ERC721Bridge.Contract.Paused(&_L1ERC721Bridge.CallOpts) +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool) +func (_L1ERC721Bridge *L1ERC721BridgeCallerSession) Paused() (bool, error) { + return _L1ERC721Bridge.Contract.Paused(&_L1ERC721Bridge.CallOpts) +} + +// SuperchainConfig is a free data retrieval call binding the contract method 0x35e80ab3. +// +// Solidity: function superchainConfig() view returns(address) +func (_L1ERC721Bridge *L1ERC721BridgeCaller) SuperchainConfig(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _L1ERC721Bridge.contract.Call(opts, &out, "superchainConfig") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// SuperchainConfig is a free data retrieval call binding the contract method 0x35e80ab3. +// +// Solidity: function superchainConfig() view returns(address) +func (_L1ERC721Bridge *L1ERC721BridgeSession) SuperchainConfig() (common.Address, error) { + return _L1ERC721Bridge.Contract.SuperchainConfig(&_L1ERC721Bridge.CallOpts) +} + +// SuperchainConfig is a free data retrieval call binding the contract method 0x35e80ab3. +// +// Solidity: function superchainConfig() view returns(address) +func (_L1ERC721Bridge *L1ERC721BridgeCallerSession) SuperchainConfig() (common.Address, error) { + return _L1ERC721Bridge.Contract.SuperchainConfig(&_L1ERC721Bridge.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_L1ERC721Bridge *L1ERC721BridgeCaller) Version(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _L1ERC721Bridge.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 (_L1ERC721Bridge *L1ERC721BridgeSession) Version() (string, error) { + return _L1ERC721Bridge.Contract.Version(&_L1ERC721Bridge.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_L1ERC721Bridge *L1ERC721BridgeCallerSession) Version() (string, error) { + return _L1ERC721Bridge.Contract.Version(&_L1ERC721Bridge.CallOpts) +} + +// BridgeERC721 is a paid mutator transaction binding the contract method 0x3687011a. +// +// Solidity: function bridgeERC721(address _localToken, address _remoteToken, uint256 _tokenId, uint32 _minGasLimit, bytes _extraData) returns() +func (_L1ERC721Bridge *L1ERC721BridgeTransactor) BridgeERC721(opts *bind.TransactOpts, _localToken common.Address, _remoteToken common.Address, _tokenId *big.Int, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L1ERC721Bridge.contract.Transact(opts, "bridgeERC721", _localToken, _remoteToken, _tokenId, _minGasLimit, _extraData) +} + +// BridgeERC721 is a paid mutator transaction binding the contract method 0x3687011a. +// +// Solidity: function bridgeERC721(address _localToken, address _remoteToken, uint256 _tokenId, uint32 _minGasLimit, bytes _extraData) returns() +func (_L1ERC721Bridge *L1ERC721BridgeSession) BridgeERC721(_localToken common.Address, _remoteToken common.Address, _tokenId *big.Int, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L1ERC721Bridge.Contract.BridgeERC721(&_L1ERC721Bridge.TransactOpts, _localToken, _remoteToken, _tokenId, _minGasLimit, _extraData) +} + +// BridgeERC721 is a paid mutator transaction binding the contract method 0x3687011a. +// +// Solidity: function bridgeERC721(address _localToken, address _remoteToken, uint256 _tokenId, uint32 _minGasLimit, bytes _extraData) returns() +func (_L1ERC721Bridge *L1ERC721BridgeTransactorSession) BridgeERC721(_localToken common.Address, _remoteToken common.Address, _tokenId *big.Int, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L1ERC721Bridge.Contract.BridgeERC721(&_L1ERC721Bridge.TransactOpts, _localToken, _remoteToken, _tokenId, _minGasLimit, _extraData) +} + +// BridgeERC721To is a paid mutator transaction binding the contract method 0xaa557452. +// +// Solidity: function bridgeERC721To(address _localToken, address _remoteToken, address _to, uint256 _tokenId, uint32 _minGasLimit, bytes _extraData) returns() +func (_L1ERC721Bridge *L1ERC721BridgeTransactor) BridgeERC721To(opts *bind.TransactOpts, _localToken common.Address, _remoteToken common.Address, _to common.Address, _tokenId *big.Int, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L1ERC721Bridge.contract.Transact(opts, "bridgeERC721To", _localToken, _remoteToken, _to, _tokenId, _minGasLimit, _extraData) +} + +// BridgeERC721To is a paid mutator transaction binding the contract method 0xaa557452. +// +// Solidity: function bridgeERC721To(address _localToken, address _remoteToken, address _to, uint256 _tokenId, uint32 _minGasLimit, bytes _extraData) returns() +func (_L1ERC721Bridge *L1ERC721BridgeSession) BridgeERC721To(_localToken common.Address, _remoteToken common.Address, _to common.Address, _tokenId *big.Int, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L1ERC721Bridge.Contract.BridgeERC721To(&_L1ERC721Bridge.TransactOpts, _localToken, _remoteToken, _to, _tokenId, _minGasLimit, _extraData) +} + +// BridgeERC721To is a paid mutator transaction binding the contract method 0xaa557452. +// +// Solidity: function bridgeERC721To(address _localToken, address _remoteToken, address _to, uint256 _tokenId, uint32 _minGasLimit, bytes _extraData) returns() +func (_L1ERC721Bridge *L1ERC721BridgeTransactorSession) BridgeERC721To(_localToken common.Address, _remoteToken common.Address, _to common.Address, _tokenId *big.Int, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L1ERC721Bridge.Contract.BridgeERC721To(&_L1ERC721Bridge.TransactOpts, _localToken, _remoteToken, _to, _tokenId, _minGasLimit, _extraData) +} + +// FinalizeBridgeERC721 is a paid mutator transaction binding the contract method 0x761f4493. +// +// Solidity: function finalizeBridgeERC721(address _localToken, address _remoteToken, address _from, address _to, uint256 _tokenId, bytes _extraData) returns() +func (_L1ERC721Bridge *L1ERC721BridgeTransactor) FinalizeBridgeERC721(opts *bind.TransactOpts, _localToken common.Address, _remoteToken common.Address, _from common.Address, _to common.Address, _tokenId *big.Int, _extraData []byte) (*types.Transaction, error) { + return _L1ERC721Bridge.contract.Transact(opts, "finalizeBridgeERC721", _localToken, _remoteToken, _from, _to, _tokenId, _extraData) +} + +// FinalizeBridgeERC721 is a paid mutator transaction binding the contract method 0x761f4493. +// +// Solidity: function finalizeBridgeERC721(address _localToken, address _remoteToken, address _from, address _to, uint256 _tokenId, bytes _extraData) returns() +func (_L1ERC721Bridge *L1ERC721BridgeSession) FinalizeBridgeERC721(_localToken common.Address, _remoteToken common.Address, _from common.Address, _to common.Address, _tokenId *big.Int, _extraData []byte) (*types.Transaction, error) { + return _L1ERC721Bridge.Contract.FinalizeBridgeERC721(&_L1ERC721Bridge.TransactOpts, _localToken, _remoteToken, _from, _to, _tokenId, _extraData) +} + +// FinalizeBridgeERC721 is a paid mutator transaction binding the contract method 0x761f4493. +// +// Solidity: function finalizeBridgeERC721(address _localToken, address _remoteToken, address _from, address _to, uint256 _tokenId, bytes _extraData) returns() +func (_L1ERC721Bridge *L1ERC721BridgeTransactorSession) FinalizeBridgeERC721(_localToken common.Address, _remoteToken common.Address, _from common.Address, _to common.Address, _tokenId *big.Int, _extraData []byte) (*types.Transaction, error) { + return _L1ERC721Bridge.Contract.FinalizeBridgeERC721(&_L1ERC721Bridge.TransactOpts, _localToken, _remoteToken, _from, _to, _tokenId, _extraData) +} + +// Initialize is a paid mutator transaction binding the contract method 0x485cc955. +// +// Solidity: function initialize(address _messenger, address _superchainConfig) returns() +func (_L1ERC721Bridge *L1ERC721BridgeTransactor) Initialize(opts *bind.TransactOpts, _messenger common.Address, _superchainConfig common.Address) (*types.Transaction, error) { + return _L1ERC721Bridge.contract.Transact(opts, "initialize", _messenger, _superchainConfig) +} + +// Initialize is a paid mutator transaction binding the contract method 0x485cc955. +// +// Solidity: function initialize(address _messenger, address _superchainConfig) returns() +func (_L1ERC721Bridge *L1ERC721BridgeSession) Initialize(_messenger common.Address, _superchainConfig common.Address) (*types.Transaction, error) { + return _L1ERC721Bridge.Contract.Initialize(&_L1ERC721Bridge.TransactOpts, _messenger, _superchainConfig) +} + +// Initialize is a paid mutator transaction binding the contract method 0x485cc955. +// +// Solidity: function initialize(address _messenger, address _superchainConfig) returns() +func (_L1ERC721Bridge *L1ERC721BridgeTransactorSession) Initialize(_messenger common.Address, _superchainConfig common.Address) (*types.Transaction, error) { + return _L1ERC721Bridge.Contract.Initialize(&_L1ERC721Bridge.TransactOpts, _messenger, _superchainConfig) +} + +// L1ERC721BridgeERC721BridgeFinalizedIterator is returned from FilterERC721BridgeFinalized and is used to iterate over the raw logs and unpacked data for ERC721BridgeFinalized events raised by the L1ERC721Bridge contract. +type L1ERC721BridgeERC721BridgeFinalizedIterator struct { + Event *L1ERC721BridgeERC721BridgeFinalized // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *L1ERC721BridgeERC721BridgeFinalizedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(L1ERC721BridgeERC721BridgeFinalized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(L1ERC721BridgeERC721BridgeFinalized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *L1ERC721BridgeERC721BridgeFinalizedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *L1ERC721BridgeERC721BridgeFinalizedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// L1ERC721BridgeERC721BridgeFinalized represents a ERC721BridgeFinalized event raised by the L1ERC721Bridge contract. +type L1ERC721BridgeERC721BridgeFinalized struct { + LocalToken common.Address + RemoteToken common.Address + From common.Address + To common.Address + TokenId *big.Int + ExtraData []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterERC721BridgeFinalized is a free log retrieval operation binding the contract event 0x1f39bf6707b5d608453e0ae4c067b562bcc4c85c0f562ef5d2c774d2e7f131ac. +// +// Solidity: event ERC721BridgeFinalized(address indexed localToken, address indexed remoteToken, address indexed from, address to, uint256 tokenId, bytes extraData) +func (_L1ERC721Bridge *L1ERC721BridgeFilterer) FilterERC721BridgeFinalized(opts *bind.FilterOpts, localToken []common.Address, remoteToken []common.Address, from []common.Address) (*L1ERC721BridgeERC721BridgeFinalizedIterator, error) { + + var localTokenRule []interface{} + for _, localTokenItem := range localToken { + localTokenRule = append(localTokenRule, localTokenItem) + } + var remoteTokenRule []interface{} + for _, remoteTokenItem := range remoteToken { + remoteTokenRule = append(remoteTokenRule, remoteTokenItem) + } + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + + logs, sub, err := _L1ERC721Bridge.contract.FilterLogs(opts, "ERC721BridgeFinalized", localTokenRule, remoteTokenRule, fromRule) + if err != nil { + return nil, err + } + return &L1ERC721BridgeERC721BridgeFinalizedIterator{contract: _L1ERC721Bridge.contract, event: "ERC721BridgeFinalized", logs: logs, sub: sub}, nil +} + +// WatchERC721BridgeFinalized is a free log subscription operation binding the contract event 0x1f39bf6707b5d608453e0ae4c067b562bcc4c85c0f562ef5d2c774d2e7f131ac. +// +// Solidity: event ERC721BridgeFinalized(address indexed localToken, address indexed remoteToken, address indexed from, address to, uint256 tokenId, bytes extraData) +func (_L1ERC721Bridge *L1ERC721BridgeFilterer) WatchERC721BridgeFinalized(opts *bind.WatchOpts, sink chan<- *L1ERC721BridgeERC721BridgeFinalized, localToken []common.Address, remoteToken []common.Address, from []common.Address) (event.Subscription, error) { + + var localTokenRule []interface{} + for _, localTokenItem := range localToken { + localTokenRule = append(localTokenRule, localTokenItem) + } + var remoteTokenRule []interface{} + for _, remoteTokenItem := range remoteToken { + remoteTokenRule = append(remoteTokenRule, remoteTokenItem) + } + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + + logs, sub, err := _L1ERC721Bridge.contract.WatchLogs(opts, "ERC721BridgeFinalized", localTokenRule, remoteTokenRule, fromRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(L1ERC721BridgeERC721BridgeFinalized) + if err := _L1ERC721Bridge.contract.UnpackLog(event, "ERC721BridgeFinalized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseERC721BridgeFinalized is a log parse operation binding the contract event 0x1f39bf6707b5d608453e0ae4c067b562bcc4c85c0f562ef5d2c774d2e7f131ac. +// +// Solidity: event ERC721BridgeFinalized(address indexed localToken, address indexed remoteToken, address indexed from, address to, uint256 tokenId, bytes extraData) +func (_L1ERC721Bridge *L1ERC721BridgeFilterer) ParseERC721BridgeFinalized(log types.Log) (*L1ERC721BridgeERC721BridgeFinalized, error) { + event := new(L1ERC721BridgeERC721BridgeFinalized) + if err := _L1ERC721Bridge.contract.UnpackLog(event, "ERC721BridgeFinalized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// L1ERC721BridgeERC721BridgeInitiatedIterator is returned from FilterERC721BridgeInitiated and is used to iterate over the raw logs and unpacked data for ERC721BridgeInitiated events raised by the L1ERC721Bridge contract. +type L1ERC721BridgeERC721BridgeInitiatedIterator struct { + Event *L1ERC721BridgeERC721BridgeInitiated // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *L1ERC721BridgeERC721BridgeInitiatedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(L1ERC721BridgeERC721BridgeInitiated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(L1ERC721BridgeERC721BridgeInitiated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *L1ERC721BridgeERC721BridgeInitiatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *L1ERC721BridgeERC721BridgeInitiatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// L1ERC721BridgeERC721BridgeInitiated represents a ERC721BridgeInitiated event raised by the L1ERC721Bridge contract. +type L1ERC721BridgeERC721BridgeInitiated struct { + LocalToken common.Address + RemoteToken common.Address + From common.Address + To common.Address + TokenId *big.Int + ExtraData []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterERC721BridgeInitiated is a free log retrieval operation binding the contract event 0xb7460e2a880f256ebef3406116ff3eee0cee51ebccdc2a40698f87ebb2e9c1a5. +// +// Solidity: event ERC721BridgeInitiated(address indexed localToken, address indexed remoteToken, address indexed from, address to, uint256 tokenId, bytes extraData) +func (_L1ERC721Bridge *L1ERC721BridgeFilterer) FilterERC721BridgeInitiated(opts *bind.FilterOpts, localToken []common.Address, remoteToken []common.Address, from []common.Address) (*L1ERC721BridgeERC721BridgeInitiatedIterator, error) { + + var localTokenRule []interface{} + for _, localTokenItem := range localToken { + localTokenRule = append(localTokenRule, localTokenItem) + } + var remoteTokenRule []interface{} + for _, remoteTokenItem := range remoteToken { + remoteTokenRule = append(remoteTokenRule, remoteTokenItem) + } + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + + logs, sub, err := _L1ERC721Bridge.contract.FilterLogs(opts, "ERC721BridgeInitiated", localTokenRule, remoteTokenRule, fromRule) + if err != nil { + return nil, err + } + return &L1ERC721BridgeERC721BridgeInitiatedIterator{contract: _L1ERC721Bridge.contract, event: "ERC721BridgeInitiated", logs: logs, sub: sub}, nil +} + +// WatchERC721BridgeInitiated is a free log subscription operation binding the contract event 0xb7460e2a880f256ebef3406116ff3eee0cee51ebccdc2a40698f87ebb2e9c1a5. +// +// Solidity: event ERC721BridgeInitiated(address indexed localToken, address indexed remoteToken, address indexed from, address to, uint256 tokenId, bytes extraData) +func (_L1ERC721Bridge *L1ERC721BridgeFilterer) WatchERC721BridgeInitiated(opts *bind.WatchOpts, sink chan<- *L1ERC721BridgeERC721BridgeInitiated, localToken []common.Address, remoteToken []common.Address, from []common.Address) (event.Subscription, error) { + + var localTokenRule []interface{} + for _, localTokenItem := range localToken { + localTokenRule = append(localTokenRule, localTokenItem) + } + var remoteTokenRule []interface{} + for _, remoteTokenItem := range remoteToken { + remoteTokenRule = append(remoteTokenRule, remoteTokenItem) + } + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + + logs, sub, err := _L1ERC721Bridge.contract.WatchLogs(opts, "ERC721BridgeInitiated", localTokenRule, remoteTokenRule, fromRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(L1ERC721BridgeERC721BridgeInitiated) + if err := _L1ERC721Bridge.contract.UnpackLog(event, "ERC721BridgeInitiated", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseERC721BridgeInitiated is a log parse operation binding the contract event 0xb7460e2a880f256ebef3406116ff3eee0cee51ebccdc2a40698f87ebb2e9c1a5. +// +// Solidity: event ERC721BridgeInitiated(address indexed localToken, address indexed remoteToken, address indexed from, address to, uint256 tokenId, bytes extraData) +func (_L1ERC721Bridge *L1ERC721BridgeFilterer) ParseERC721BridgeInitiated(log types.Log) (*L1ERC721BridgeERC721BridgeInitiated, error) { + event := new(L1ERC721BridgeERC721BridgeInitiated) + if err := _L1ERC721Bridge.contract.UnpackLog(event, "ERC721BridgeInitiated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// L1ERC721BridgeInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the L1ERC721Bridge contract. +type L1ERC721BridgeInitializedIterator struct { + Event *L1ERC721BridgeInitialized // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *L1ERC721BridgeInitializedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(L1ERC721BridgeInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(L1ERC721BridgeInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *L1ERC721BridgeInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *L1ERC721BridgeInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// L1ERC721BridgeInitialized represents a Initialized event raised by the L1ERC721Bridge contract. +type L1ERC721BridgeInitialized struct { + Version uint8 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_L1ERC721Bridge *L1ERC721BridgeFilterer) FilterInitialized(opts *bind.FilterOpts) (*L1ERC721BridgeInitializedIterator, error) { + + logs, sub, err := _L1ERC721Bridge.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &L1ERC721BridgeInitializedIterator{contract: _L1ERC721Bridge.contract, event: "Initialized", logs: logs, sub: sub}, nil +} + +// WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_L1ERC721Bridge *L1ERC721BridgeFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *L1ERC721BridgeInitialized) (event.Subscription, error) { + + logs, sub, err := _L1ERC721Bridge.contract.WatchLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(L1ERC721BridgeInitialized) + if err := _L1ERC721Bridge.contract.UnpackLog(event, "Initialized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_L1ERC721Bridge *L1ERC721BridgeFilterer) ParseInitialized(log types.Log) (*L1ERC721BridgeInitialized, error) { + event := new(L1ERC721BridgeInitialized) + if err := _L1ERC721Bridge.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/op-e2e2/bindings/l1feevault.go b/op-e2e2/bindings/l1feevault.go new file mode 100644 index 000000000000..a2d470a1dd44 --- /dev/null +++ b/op-e2e2/bindings/l1feevault.go @@ -0,0 +1,672 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// L1FeeVaultMetaData contains all meta data concerning the L1FeeVault contract. +var L1FeeVaultMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_recipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_minWithdrawalAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_withdrawalNetwork\",\"type\":\"uint8\",\"internalType\":\"enumFeeVault.WithdrawalNetwork\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"MIN_WITHDRAWAL_AMOUNT\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"RECIPIENT\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"WITHDRAWAL_NETWORK\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"enumFeeVault.WithdrawalNetwork\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"totalProcessed\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"withdraw\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"Withdrawal\",\"inputs\":[{\"name\":\"value\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"from\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Withdrawal\",\"inputs\":[{\"name\":\"value\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"from\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"withdrawalNetwork\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"enumFeeVault.WithdrawalNetwork\"}],\"anonymous\":false}]", + Bin: "0x60e060405234801561001057600080fd5b506040516108d13803806108d183398101604081905261002f91610079565b6001600160a01b03831660a0526080829052828282806001811115610056576100566100cc565b60c081600181111561006a5761006a6100cc565b815250505050505050506100e2565b60008060006060848603121561008e57600080fd5b83516001600160a01b03811681146100a557600080fd5b602085015160408601519194509250600281106100c157600080fd5b809150509250925092565b634e487b7160e01b600052602160045260246000fd5b60805160a05160c051610790610141600039600081816101760152818161038901526103c40152600081816087015281816102d801528181610367015281816103fd01526105640152600081816101b701526101db01526107906000f3fe6080604052600436106100695760003560e01c806384411d651161004357806384411d6514610140578063d0e12f9014610164578063d3e5792b146101a557600080fd5b80630d9019e1146100755780633ccfd60b146100d357806354fd4d50146100ea57600080fd5b3661007057005b600080fd5b34801561008157600080fd5b506100a97f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b3480156100df57600080fd5b506100e86101d9565b005b3480156100f657600080fd5b506101336040518060400160405280600581526020017f312e342e3100000000000000000000000000000000000000000000000000000081525081565b6040516100ca9190610630565b34801561014c57600080fd5b5061015660005481565b6040519081526020016100ca565b34801561017057600080fd5b506101987f000000000000000000000000000000000000000000000000000000000000000081565b6040516100ca91906106b4565b3480156101b157600080fd5b506101567f000000000000000000000000000000000000000000000000000000000000000081565b7f00000000000000000000000000000000000000000000000000000000000000004710156102b4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604a60248201527f4665655661756c743a207769746864726177616c20616d6f756e74206d75737460448201527f2062652067726561746572207468616e206d696e696d756d207769746864726160648201527f77616c20616d6f756e7400000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b6000479050806000808282546102ca91906106c8565b9091555050604080518281527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166020820152338183015290517fc8a211cc64b6ed1b50595a9fcb1932b6d1e5a6e8ef15b60e5b1f988ea9086bba9181900360600190a17f38e04cbeb8c10f8f568618aa75be0f10b6729b8b4237743b4de20cbcde2839ee817f0000000000000000000000000000000000000000000000000000000000000000337f00000000000000000000000000000000000000000000000000000000000000006040516103b89493929190610707565b60405180910390a160017f000000000000000000000000000000000000000000000000000000000000000060018111156103f4576103f461064a565b0361050d5760007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d8060008114610473576040519150601f19603f3d011682016040523d82523d6000602084013e610478565b606091505b5050905080610509576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f4665655661756c743a206661696c656420746f2073656e642045544820746f2060448201527f4c322066656520726563697069656e740000000000000000000000000000000060648201526084016102ab565b5050565b604080516020810182526000815290517fe11013dd0000000000000000000000000000000000000000000000000000000081527342000000000000000000000000000000000000109163e11013dd918491610590917f0000000000000000000000000000000000000000000000000000000000000000916188b891600401610748565b6000604051808303818588803b1580156105a957600080fd5b505af11580156105bd573d6000803e3d6000fd5b505050505050565b6000815180845260005b818110156105eb576020818501810151868301820152016105cf565b818111156105fd576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60208152600061064360208301846105c5565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600281106106b0577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9052565b602081016106c28284610679565b92915050565b60008219821115610702577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b500190565b84815273ffffffffffffffffffffffffffffffffffffffff8481166020830152831660408201526080810161073f6060830184610679565b95945050505050565b73ffffffffffffffffffffffffffffffffffffffff8416815263ffffffff8316602082015260606040820152600061073f60608301846105c556fea164736f6c634300080f000a", +} + +// L1FeeVaultABI is the input ABI used to generate the binding from. +// Deprecated: Use L1FeeVaultMetaData.ABI instead. +var L1FeeVaultABI = L1FeeVaultMetaData.ABI + +// L1FeeVaultBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use L1FeeVaultMetaData.Bin instead. +var L1FeeVaultBin = L1FeeVaultMetaData.Bin + +// DeployL1FeeVault deploys a new Ethereum contract, binding an instance of L1FeeVault to it. +func DeployL1FeeVault(auth *bind.TransactOpts, backend bind.ContractBackend, _recipient common.Address, _minWithdrawalAmount *big.Int, _withdrawalNetwork uint8) (common.Address, *types.Transaction, *L1FeeVault, error) { + parsed, err := L1FeeVaultMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(L1FeeVaultBin), backend, _recipient, _minWithdrawalAmount, _withdrawalNetwork) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &L1FeeVault{L1FeeVaultCaller: L1FeeVaultCaller{contract: contract}, L1FeeVaultTransactor: L1FeeVaultTransactor{contract: contract}, L1FeeVaultFilterer: L1FeeVaultFilterer{contract: contract}}, nil +} + +// L1FeeVault is an auto generated Go binding around an Ethereum contract. +type L1FeeVault struct { + L1FeeVaultCaller // Read-only binding to the contract + L1FeeVaultTransactor // Write-only binding to the contract + L1FeeVaultFilterer // Log filterer for contract events +} + +// L1FeeVaultCaller is an auto generated read-only Go binding around an Ethereum contract. +type L1FeeVaultCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// L1FeeVaultTransactor is an auto generated write-only Go binding around an Ethereum contract. +type L1FeeVaultTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// L1FeeVaultFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type L1FeeVaultFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// L1FeeVaultSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type L1FeeVaultSession struct { + Contract *L1FeeVault // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// L1FeeVaultCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type L1FeeVaultCallerSession struct { + Contract *L1FeeVaultCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// L1FeeVaultTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type L1FeeVaultTransactorSession struct { + Contract *L1FeeVaultTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// L1FeeVaultRaw is an auto generated low-level Go binding around an Ethereum contract. +type L1FeeVaultRaw struct { + Contract *L1FeeVault // Generic contract binding to access the raw methods on +} + +// L1FeeVaultCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type L1FeeVaultCallerRaw struct { + Contract *L1FeeVaultCaller // Generic read-only contract binding to access the raw methods on +} + +// L1FeeVaultTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type L1FeeVaultTransactorRaw struct { + Contract *L1FeeVaultTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewL1FeeVault creates a new instance of L1FeeVault, bound to a specific deployed contract. +func NewL1FeeVault(address common.Address, backend bind.ContractBackend) (*L1FeeVault, error) { + contract, err := bindL1FeeVault(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &L1FeeVault{L1FeeVaultCaller: L1FeeVaultCaller{contract: contract}, L1FeeVaultTransactor: L1FeeVaultTransactor{contract: contract}, L1FeeVaultFilterer: L1FeeVaultFilterer{contract: contract}}, nil +} + +// NewL1FeeVaultCaller creates a new read-only instance of L1FeeVault, bound to a specific deployed contract. +func NewL1FeeVaultCaller(address common.Address, caller bind.ContractCaller) (*L1FeeVaultCaller, error) { + contract, err := bindL1FeeVault(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &L1FeeVaultCaller{contract: contract}, nil +} + +// NewL1FeeVaultTransactor creates a new write-only instance of L1FeeVault, bound to a specific deployed contract. +func NewL1FeeVaultTransactor(address common.Address, transactor bind.ContractTransactor) (*L1FeeVaultTransactor, error) { + contract, err := bindL1FeeVault(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &L1FeeVaultTransactor{contract: contract}, nil +} + +// NewL1FeeVaultFilterer creates a new log filterer instance of L1FeeVault, bound to a specific deployed contract. +func NewL1FeeVaultFilterer(address common.Address, filterer bind.ContractFilterer) (*L1FeeVaultFilterer, error) { + contract, err := bindL1FeeVault(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &L1FeeVaultFilterer{contract: contract}, nil +} + +// bindL1FeeVault binds a generic wrapper to an already deployed contract. +func bindL1FeeVault(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(L1FeeVaultABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_L1FeeVault *L1FeeVaultRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _L1FeeVault.Contract.L1FeeVaultCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_L1FeeVault *L1FeeVaultRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _L1FeeVault.Contract.L1FeeVaultTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_L1FeeVault *L1FeeVaultRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _L1FeeVault.Contract.L1FeeVaultTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_L1FeeVault *L1FeeVaultCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _L1FeeVault.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_L1FeeVault *L1FeeVaultTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _L1FeeVault.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_L1FeeVault *L1FeeVaultTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _L1FeeVault.Contract.contract.Transact(opts, method, params...) +} + +// MINWITHDRAWALAMOUNT is a free data retrieval call binding the contract method 0xd3e5792b. +// +// Solidity: function MIN_WITHDRAWAL_AMOUNT() view returns(uint256) +func (_L1FeeVault *L1FeeVaultCaller) MINWITHDRAWALAMOUNT(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _L1FeeVault.contract.Call(opts, &out, "MIN_WITHDRAWAL_AMOUNT") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// MINWITHDRAWALAMOUNT is a free data retrieval call binding the contract method 0xd3e5792b. +// +// Solidity: function MIN_WITHDRAWAL_AMOUNT() view returns(uint256) +func (_L1FeeVault *L1FeeVaultSession) MINWITHDRAWALAMOUNT() (*big.Int, error) { + return _L1FeeVault.Contract.MINWITHDRAWALAMOUNT(&_L1FeeVault.CallOpts) +} + +// MINWITHDRAWALAMOUNT is a free data retrieval call binding the contract method 0xd3e5792b. +// +// Solidity: function MIN_WITHDRAWAL_AMOUNT() view returns(uint256) +func (_L1FeeVault *L1FeeVaultCallerSession) MINWITHDRAWALAMOUNT() (*big.Int, error) { + return _L1FeeVault.Contract.MINWITHDRAWALAMOUNT(&_L1FeeVault.CallOpts) +} + +// RECIPIENT is a free data retrieval call binding the contract method 0x0d9019e1. +// +// Solidity: function RECIPIENT() view returns(address) +func (_L1FeeVault *L1FeeVaultCaller) RECIPIENT(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _L1FeeVault.contract.Call(opts, &out, "RECIPIENT") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// RECIPIENT is a free data retrieval call binding the contract method 0x0d9019e1. +// +// Solidity: function RECIPIENT() view returns(address) +func (_L1FeeVault *L1FeeVaultSession) RECIPIENT() (common.Address, error) { + return _L1FeeVault.Contract.RECIPIENT(&_L1FeeVault.CallOpts) +} + +// RECIPIENT is a free data retrieval call binding the contract method 0x0d9019e1. +// +// Solidity: function RECIPIENT() view returns(address) +func (_L1FeeVault *L1FeeVaultCallerSession) RECIPIENT() (common.Address, error) { + return _L1FeeVault.Contract.RECIPIENT(&_L1FeeVault.CallOpts) +} + +// WITHDRAWALNETWORK is a free data retrieval call binding the contract method 0xd0e12f90. +// +// Solidity: function WITHDRAWAL_NETWORK() view returns(uint8) +func (_L1FeeVault *L1FeeVaultCaller) WITHDRAWALNETWORK(opts *bind.CallOpts) (uint8, error) { + var out []interface{} + err := _L1FeeVault.contract.Call(opts, &out, "WITHDRAWAL_NETWORK") + + if err != nil { + return *new(uint8), err + } + + out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) + + return out0, err + +} + +// WITHDRAWALNETWORK is a free data retrieval call binding the contract method 0xd0e12f90. +// +// Solidity: function WITHDRAWAL_NETWORK() view returns(uint8) +func (_L1FeeVault *L1FeeVaultSession) WITHDRAWALNETWORK() (uint8, error) { + return _L1FeeVault.Contract.WITHDRAWALNETWORK(&_L1FeeVault.CallOpts) +} + +// WITHDRAWALNETWORK is a free data retrieval call binding the contract method 0xd0e12f90. +// +// Solidity: function WITHDRAWAL_NETWORK() view returns(uint8) +func (_L1FeeVault *L1FeeVaultCallerSession) WITHDRAWALNETWORK() (uint8, error) { + return _L1FeeVault.Contract.WITHDRAWALNETWORK(&_L1FeeVault.CallOpts) +} + +// TotalProcessed is a free data retrieval call binding the contract method 0x84411d65. +// +// Solidity: function totalProcessed() view returns(uint256) +func (_L1FeeVault *L1FeeVaultCaller) TotalProcessed(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _L1FeeVault.contract.Call(opts, &out, "totalProcessed") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// TotalProcessed is a free data retrieval call binding the contract method 0x84411d65. +// +// Solidity: function totalProcessed() view returns(uint256) +func (_L1FeeVault *L1FeeVaultSession) TotalProcessed() (*big.Int, error) { + return _L1FeeVault.Contract.TotalProcessed(&_L1FeeVault.CallOpts) +} + +// TotalProcessed is a free data retrieval call binding the contract method 0x84411d65. +// +// Solidity: function totalProcessed() view returns(uint256) +func (_L1FeeVault *L1FeeVaultCallerSession) TotalProcessed() (*big.Int, error) { + return _L1FeeVault.Contract.TotalProcessed(&_L1FeeVault.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_L1FeeVault *L1FeeVaultCaller) Version(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _L1FeeVault.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 (_L1FeeVault *L1FeeVaultSession) Version() (string, error) { + return _L1FeeVault.Contract.Version(&_L1FeeVault.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_L1FeeVault *L1FeeVaultCallerSession) Version() (string, error) { + return _L1FeeVault.Contract.Version(&_L1FeeVault.CallOpts) +} + +// Withdraw is a paid mutator transaction binding the contract method 0x3ccfd60b. +// +// Solidity: function withdraw() returns() +func (_L1FeeVault *L1FeeVaultTransactor) Withdraw(opts *bind.TransactOpts) (*types.Transaction, error) { + return _L1FeeVault.contract.Transact(opts, "withdraw") +} + +// Withdraw is a paid mutator transaction binding the contract method 0x3ccfd60b. +// +// Solidity: function withdraw() returns() +func (_L1FeeVault *L1FeeVaultSession) Withdraw() (*types.Transaction, error) { + return _L1FeeVault.Contract.Withdraw(&_L1FeeVault.TransactOpts) +} + +// Withdraw is a paid mutator transaction binding the contract method 0x3ccfd60b. +// +// Solidity: function withdraw() returns() +func (_L1FeeVault *L1FeeVaultTransactorSession) Withdraw() (*types.Transaction, error) { + return _L1FeeVault.Contract.Withdraw(&_L1FeeVault.TransactOpts) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_L1FeeVault *L1FeeVaultTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { + return _L1FeeVault.contract.RawTransact(opts, nil) // calldata is disallowed for receive function +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_L1FeeVault *L1FeeVaultSession) Receive() (*types.Transaction, error) { + return _L1FeeVault.Contract.Receive(&_L1FeeVault.TransactOpts) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_L1FeeVault *L1FeeVaultTransactorSession) Receive() (*types.Transaction, error) { + return _L1FeeVault.Contract.Receive(&_L1FeeVault.TransactOpts) +} + +// L1FeeVaultWithdrawalIterator is returned from FilterWithdrawal and is used to iterate over the raw logs and unpacked data for Withdrawal events raised by the L1FeeVault contract. +type L1FeeVaultWithdrawalIterator struct { + Event *L1FeeVaultWithdrawal // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *L1FeeVaultWithdrawalIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(L1FeeVaultWithdrawal) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(L1FeeVaultWithdrawal) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *L1FeeVaultWithdrawalIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *L1FeeVaultWithdrawalIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// L1FeeVaultWithdrawal represents a Withdrawal event raised by the L1FeeVault contract. +type L1FeeVaultWithdrawal struct { + Value *big.Int + To common.Address + From common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterWithdrawal is a free log retrieval operation binding the contract event 0xc8a211cc64b6ed1b50595a9fcb1932b6d1e5a6e8ef15b60e5b1f988ea9086bba. +// +// Solidity: event Withdrawal(uint256 value, address to, address from) +func (_L1FeeVault *L1FeeVaultFilterer) FilterWithdrawal(opts *bind.FilterOpts) (*L1FeeVaultWithdrawalIterator, error) { + + logs, sub, err := _L1FeeVault.contract.FilterLogs(opts, "Withdrawal") + if err != nil { + return nil, err + } + return &L1FeeVaultWithdrawalIterator{contract: _L1FeeVault.contract, event: "Withdrawal", logs: logs, sub: sub}, nil +} + +// WatchWithdrawal is a free log subscription operation binding the contract event 0xc8a211cc64b6ed1b50595a9fcb1932b6d1e5a6e8ef15b60e5b1f988ea9086bba. +// +// Solidity: event Withdrawal(uint256 value, address to, address from) +func (_L1FeeVault *L1FeeVaultFilterer) WatchWithdrawal(opts *bind.WatchOpts, sink chan<- *L1FeeVaultWithdrawal) (event.Subscription, error) { + + logs, sub, err := _L1FeeVault.contract.WatchLogs(opts, "Withdrawal") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(L1FeeVaultWithdrawal) + if err := _L1FeeVault.contract.UnpackLog(event, "Withdrawal", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseWithdrawal is a log parse operation binding the contract event 0xc8a211cc64b6ed1b50595a9fcb1932b6d1e5a6e8ef15b60e5b1f988ea9086bba. +// +// Solidity: event Withdrawal(uint256 value, address to, address from) +func (_L1FeeVault *L1FeeVaultFilterer) ParseWithdrawal(log types.Log) (*L1FeeVaultWithdrawal, error) { + event := new(L1FeeVaultWithdrawal) + if err := _L1FeeVault.contract.UnpackLog(event, "Withdrawal", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// L1FeeVaultWithdrawal0Iterator is returned from FilterWithdrawal0 and is used to iterate over the raw logs and unpacked data for Withdrawal0 events raised by the L1FeeVault contract. +type L1FeeVaultWithdrawal0Iterator struct { + Event *L1FeeVaultWithdrawal0 // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *L1FeeVaultWithdrawal0Iterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(L1FeeVaultWithdrawal0) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(L1FeeVaultWithdrawal0) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *L1FeeVaultWithdrawal0Iterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *L1FeeVaultWithdrawal0Iterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// L1FeeVaultWithdrawal0 represents a Withdrawal0 event raised by the L1FeeVault contract. +type L1FeeVaultWithdrawal0 struct { + Value *big.Int + To common.Address + From common.Address + WithdrawalNetwork uint8 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterWithdrawal0 is a free log retrieval operation binding the contract event 0x38e04cbeb8c10f8f568618aa75be0f10b6729b8b4237743b4de20cbcde2839ee. +// +// Solidity: event Withdrawal(uint256 value, address to, address from, uint8 withdrawalNetwork) +func (_L1FeeVault *L1FeeVaultFilterer) FilterWithdrawal0(opts *bind.FilterOpts) (*L1FeeVaultWithdrawal0Iterator, error) { + + logs, sub, err := _L1FeeVault.contract.FilterLogs(opts, "Withdrawal0") + if err != nil { + return nil, err + } + return &L1FeeVaultWithdrawal0Iterator{contract: _L1FeeVault.contract, event: "Withdrawal0", logs: logs, sub: sub}, nil +} + +// WatchWithdrawal0 is a free log subscription operation binding the contract event 0x38e04cbeb8c10f8f568618aa75be0f10b6729b8b4237743b4de20cbcde2839ee. +// +// Solidity: event Withdrawal(uint256 value, address to, address from, uint8 withdrawalNetwork) +func (_L1FeeVault *L1FeeVaultFilterer) WatchWithdrawal0(opts *bind.WatchOpts, sink chan<- *L1FeeVaultWithdrawal0) (event.Subscription, error) { + + logs, sub, err := _L1FeeVault.contract.WatchLogs(opts, "Withdrawal0") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(L1FeeVaultWithdrawal0) + if err := _L1FeeVault.contract.UnpackLog(event, "Withdrawal0", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseWithdrawal0 is a log parse operation binding the contract event 0x38e04cbeb8c10f8f568618aa75be0f10b6729b8b4237743b4de20cbcde2839ee. +// +// Solidity: event Withdrawal(uint256 value, address to, address from, uint8 withdrawalNetwork) +func (_L1FeeVault *L1FeeVaultFilterer) ParseWithdrawal0(log types.Log) (*L1FeeVaultWithdrawal0, error) { + event := new(L1FeeVaultWithdrawal0) + if err := _L1FeeVault.contract.UnpackLog(event, "Withdrawal0", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/op-e2e2/bindings/l1standardbridge.go b/op-e2e2/bindings/l1standardbridge.go new file mode 100644 index 000000000000..33708d8ad779 --- /dev/null +++ b/op-e2e2/bindings/l1standardbridge.go @@ -0,0 +1,2220 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// L1StandardBridgeMetaData contains all meta data concerning the L1StandardBridge contract. +var L1StandardBridgeMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"MESSENGER\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractCrossDomainMessenger\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"OTHER_BRIDGE\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractStandardBridge\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"bridgeERC20\",\"inputs\":[{\"name\":\"_localToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_remoteToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_minGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"_extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"bridgeERC20To\",\"inputs\":[{\"name\":\"_localToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_remoteToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_minGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"_extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"bridgeETH\",\"inputs\":[{\"name\":\"_minGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"_extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"bridgeETHTo\",\"inputs\":[{\"name\":\"_to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_minGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"_extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"depositERC20\",\"inputs\":[{\"name\":\"_l1Token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_l2Token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_minGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"_extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"depositERC20To\",\"inputs\":[{\"name\":\"_l1Token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_l2Token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_minGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"_extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"depositETH\",\"inputs\":[{\"name\":\"_minGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"_extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"depositETHTo\",\"inputs\":[{\"name\":\"_to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_minGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"_extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"deposits\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"finalizeBridgeERC20\",\"inputs\":[{\"name\":\"_localToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_remoteToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_from\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"finalizeBridgeETH\",\"inputs\":[{\"name\":\"_from\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"finalizeERC20Withdrawal\",\"inputs\":[{\"name\":\"_l1Token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_l2Token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_from\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"finalizeETHWithdrawal\",\"inputs\":[{\"name\":\"_from\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_messenger\",\"type\":\"address\",\"internalType\":\"contractCrossDomainMessenger\"},{\"name\":\"_superchainConfig\",\"type\":\"address\",\"internalType\":\"contractSuperchainConfig\"},{\"name\":\"_systemConfig\",\"type\":\"address\",\"internalType\":\"contractSystemConfig\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"l2TokenBridge\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"messenger\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractCrossDomainMessenger\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"otherBridge\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractStandardBridge\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"paused\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"superchainConfig\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractSuperchainConfig\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"systemConfig\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractSystemConfig\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"ERC20BridgeFinalized\",\"inputs\":[{\"name\":\"localToken\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"remoteToken\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"extraData\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ERC20BridgeInitiated\",\"inputs\":[{\"name\":\"localToken\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"remoteToken\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"extraData\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ERC20DepositInitiated\",\"inputs\":[{\"name\":\"l1Token\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"l2Token\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"extraData\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ERC20WithdrawalFinalized\",\"inputs\":[{\"name\":\"l1Token\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"l2Token\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"extraData\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ETHBridgeFinalized\",\"inputs\":[{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"extraData\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ETHBridgeInitiated\",\"inputs\":[{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"extraData\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ETHDepositInitiated\",\"inputs\":[{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"extraData\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ETHWithdrawalFinalized\",\"inputs\":[{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"extraData\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false}]", + Bin: "0x60806040523480156200001157600080fd5b50620000206000808062000026565b6200024b565b600054610100900460ff1615808015620000475750600054600160ff909116105b806200007757506200006430620001a160201b620005891760201c565b15801562000077575060005460ff166001145b620000e05760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff19166001179055801562000104576000805461ff0019166101001790555b603280546001600160a01b038086166001600160a01b03199283161790925560338054928516929091169190911790556200015484734200000000000000000000000000000000000010620001b0565b80156200019b576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b6001600160a01b03163b151590565b600054610100900460ff166200021d5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401620000d7565b600380546001600160a01b039384166001600160a01b03199182161790915560048054929093169116179055565b612f21806200025b6000396000f3fe6080604052600436106101845760003560e01c80637f46ddb2116100d65780639a2ac6d51161007f578063c0c53b8b11610059578063c0c53b8b14610529578063c89701a214610549578063e11013dd1461057657600080fd5b80639a2ac6d5146104e3578063a9f9e675146104f6578063b1a1a8821461051657600080fd5b80638f601f66116100b05780638f601f661461047257806391c49bf814610407578063927ede2d146104b857600080fd5b80637f46ddb214610407578063838b252014610432578063870876231461045257600080fd5b806335e80ab31161013857806354fd4d501161011257806354fd4d501461036c57806358a997f6146103c25780635c975abb146103e257600080fd5b806335e80ab3146102f25780633cb747bf1461031f578063540abf731461034c57600080fd5b80631532ec34116101695780631532ec34146102755780631635f5fd1461028857806333d7e2bd1461029b57600080fd5b80630166a07a1461024257806309fc88431461026257600080fd5b3661023d57333b1561021d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f5374616e646172644272696467653a2066756e6374696f6e2063616e206f6e6c60448201527f792062652063616c6c65642066726f6d20616e20454f4100000000000000000060648201526084015b60405180910390fd5b61023b333362030d40604051806020016040528060008152506105a5565b005b600080fd5b34801561024e57600080fd5b5061023b61025d366004612905565b6105b8565b61023b6102703660046129b6565b6109d2565b61023b610283366004612a09565b610aa9565b61023b610296366004612a09565b610abd565b3480156102a757600080fd5b506033546102c89073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b3480156102fe57600080fd5b506032546102c89073ffffffffffffffffffffffffffffffffffffffff1681565b34801561032b57600080fd5b506003546102c89073ffffffffffffffffffffffffffffffffffffffff1681565b34801561035857600080fd5b5061023b610367366004612a7c565b61101b565b34801561037857600080fd5b506103b56040518060400160405280601b81526020017f322e322e302d626574612b637573746f6d2d6761732d746f6b656e000000000081525081565b6040516102e99190612b69565b3480156103ce57600080fd5b5061023b6103dd366004612b7c565b611060565b3480156103ee57600080fd5b506103f7611134565b60405190151581526020016102e9565b34801561041357600080fd5b5060045473ffffffffffffffffffffffffffffffffffffffff166102c8565b34801561043e57600080fd5b5061023b61044d366004612a7c565b6111cd565b34801561045e57600080fd5b5061023b61046d366004612b7c565b611212565b34801561047e57600080fd5b506104aa61048d366004612bff565b600260209081526000928352604080842090915290825290205481565b6040519081526020016102e9565b3480156104c457600080fd5b5060035473ffffffffffffffffffffffffffffffffffffffff166102c8565b61023b6104f1366004612c38565b6112e6565b34801561050257600080fd5b5061023b610511366004612905565b611328565b61023b6105243660046129b6565b611337565b34801561053557600080fd5b5061023b610544366004612c9b565b611408565b34801561055557600080fd5b506004546102c89073ffffffffffffffffffffffffffffffffffffffff1681565b61023b610584366004612c38565b611607565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b6105b2848434858561164a565b50505050565b60035473ffffffffffffffffffffffffffffffffffffffff163314801561068b575060048054600354604080517f6e296e45000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff938416949390921692636e296e459282820192602092908290030181865afa15801561064f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106739190612ce6565b73ffffffffffffffffffffffffffffffffffffffff16145b61073d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604160248201527f5374616e646172644272696467653a2066756e6374696f6e2063616e206f6e6c60448201527f792062652063616c6c65642066726f6d20746865206f7468657220627269646760648201527f6500000000000000000000000000000000000000000000000000000000000000608482015260a401610214565b610745611134565b156107ac576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f5374616e646172644272696467653a20706175736564000000000000000000006044820152606401610214565b6107b5876118a9565b15610903576107c4878761190b565b610876576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604a60248201527f5374616e646172644272696467653a2077726f6e672072656d6f746520746f6b60448201527f656e20666f72204f7074696d69736d204d696e7461626c65204552433230206c60648201527f6f63616c20746f6b656e00000000000000000000000000000000000000000000608482015260a401610214565b6040517f40c10f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8581166004830152602482018590528816906340c10f1990604401600060405180830381600087803b1580156108e657600080fd5b505af11580156108fa573d6000803e3d6000fd5b50505050610985565b73ffffffffffffffffffffffffffffffffffffffff8088166000908152600260209081526040808320938a1683529290522054610941908490612d32565b73ffffffffffffffffffffffffffffffffffffffff8089166000818152600260209081526040808320948c1683529390529190912091909155610985908585611a2b565b6109c9878787878787878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611aff92505050565b50505050505050565b333b15610a61576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f5374616e646172644272696467653a2066756e6374696f6e2063616e206f6e6c60448201527f792062652063616c6c65642066726f6d20616e20454f410000000000000000006064820152608401610214565b610aa43333348686868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061164a92505050565b505050565b610ab68585858585610abd565b5050505050565b60035473ffffffffffffffffffffffffffffffffffffffff1633148015610b90575060048054600354604080517f6e296e45000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff938416949390921692636e296e459282820192602092908290030181865afa158015610b54573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b789190612ce6565b73ffffffffffffffffffffffffffffffffffffffff16145b610c42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604160248201527f5374616e646172644272696467653a2066756e6374696f6e2063616e206f6e6c60448201527f792062652063616c6c65642066726f6d20746865206f7468657220627269646760648201527f6500000000000000000000000000000000000000000000000000000000000000608482015260a401610214565b610c4a611134565b15610cb1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f5374616e646172644272696467653a20706175736564000000000000000000006044820152606401610214565b610cb9611b8d565b15610d46576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f5374616e646172644272696467653a2063616e6e6f742062726964676520455460448201527f48207769746820637573746f6d2067617320746f6b656e0000000000000000006064820152608401610214565b823414610dd5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f5374616e646172644272696467653a20616d6f756e742073656e7420646f657360448201527f206e6f74206d6174636820616d6f756e742072657175697265640000000000006064820152608401610214565b3073ffffffffffffffffffffffffffffffffffffffff851603610e7a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f5374616e646172644272696467653a2063616e6e6f742073656e6420746f207360448201527f656c6600000000000000000000000000000000000000000000000000000000006064820152608401610214565b60035473ffffffffffffffffffffffffffffffffffffffff90811690851603610f25576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f5374616e646172644272696467653a2063616e6e6f742073656e6420746f206d60448201527f657373656e6765720000000000000000000000000000000000000000000000006064820152608401610214565b610f6785858585858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611bcc92505050565b6000610f84855a8660405180602001604052806000815250611c3f565b905080611013576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f5374616e646172644272696467653a20455448207472616e736665722066616960448201527f6c656400000000000000000000000000000000000000000000000000000000006064820152608401610214565b505050505050565b6109c987873388888888888080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611c5992505050565b333b156110ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f5374616e646172644272696467653a2066756e6374696f6e2063616e206f6e6c60448201527f792062652063616c6c65642066726f6d20616e20454f410000000000000000006064820152608401610214565b61101386863333888888888080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611f8492505050565b603254604080517f5c975abb000000000000000000000000000000000000000000000000000000008152905160009273ffffffffffffffffffffffffffffffffffffffff1691635c975abb9160048083019260209291908290030181865afa1580156111a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111c89190612d49565b905090565b6109c987873388888888888080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611f8492505050565b333b156112a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f5374616e646172644272696467653a2066756e6374696f6e2063616e206f6e6c60448201527f792062652063616c6c65642066726f6d20616e20454f410000000000000000006064820152608401610214565b61101386863333888888888080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611c5992505050565b6105b233858585858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506105a592505050565b6109c9878787878787876105b8565b333b156113c6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f5374616e646172644272696467653a2066756e6374696f6e2063616e206f6e6c60448201527f792062652063616c6c65642066726f6d20616e20454f410000000000000000006064820152608401610214565b610aa433338585858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506105a592505050565b600054610100900460ff16158080156114285750600054600160ff909116105b806114425750303b158015611442575060005460ff166001145b6114ce576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610214565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561152c57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b6032805473ffffffffffffffffffffffffffffffffffffffff8086167fffffffffffffffffffffffff000000000000000000000000000000000000000092831617909255603380549285169290911691909117905561159f84734200000000000000000000000000000000000010611f93565b80156105b257600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050565b6105b23385348686868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061164a92505050565b611652611b8d565b156116df576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f5374616e646172644272696467653a2063616e6e6f742062726964676520455460448201527f48207769746820637573746f6d2067617320746f6b656e0000000000000000006064820152608401610214565b82341461176e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603e60248201527f5374616e646172644272696467653a206272696467696e6720455448206d757360448201527f7420696e636c7564652073756666696369656e74204554482076616c756500006064820152608401610214565b61177a8585858461207d565b60035460045460405173ffffffffffffffffffffffffffffffffffffffff92831692633dbb202b9287929116907f1635f5fd00000000000000000000000000000000000000000000000000000000906117dd908b908b9086908a90602401612d6b565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009485161790525160e086901b909216825261187092918890600401612db4565b6000604051808303818588803b15801561188957600080fd5b505af115801561189d573d6000803e3d6000fd5b50505050505050505050565b60006118d5827f1d1d8b63000000000000000000000000000000000000000000000000000000006120f0565b806119055750611905827fec4fc8e3000000000000000000000000000000000000000000000000000000006120f0565b92915050565b6000611937837f1d1d8b63000000000000000000000000000000000000000000000000000000006120f0565b156119e0578273ffffffffffffffffffffffffffffffffffffffff1663c01e1bd66040518163ffffffff1660e01b8152600401602060405180830381865afa158015611987573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119ab9190612ce6565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16149050611905565b8273ffffffffffffffffffffffffffffffffffffffff1663d6c0b2c46040518163ffffffff1660e01b8152600401602060405180830381865afa158015611987573d6000803e3d6000fd5b60405173ffffffffffffffffffffffffffffffffffffffff8316602482015260448101829052610aa49084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152612113565b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167f3ceee06c1e37648fcbb6ed52e17b3e1f275a1f8c7b22a84b2b84732431e046b3868686604051611b7793929190612df9565b60405180910390a461101386868686868661221f565b600080611b986122a7565b5073ffffffffffffffffffffffffffffffffffffffff1673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee141592915050565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f2ac69ee804d9a7a0984249f508dfab7cb2534b465b6ce1580f99a38ba9c5e6318484604051611c2b929190612e37565b60405180910390a36105b284848484612344565b600080600080845160208601878a8af19695505050505050565b611c62876118a9565b15611db057611c71878761190b565b611d23576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604a60248201527f5374616e646172644272696467653a2077726f6e672072656d6f746520746f6b60448201527f656e20666f72204f7074696d69736d204d696e7461626c65204552433230206c60648201527f6f63616c20746f6b656e00000000000000000000000000000000000000000000608482015260a401610214565b6040517f9dc29fac00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff868116600483015260248201859052881690639dc29fac90604401600060405180830381600087803b158015611d9357600080fd5b505af1158015611da7573d6000803e3d6000fd5b50505050611e44565b611dd273ffffffffffffffffffffffffffffffffffffffff88168630866123b1565b73ffffffffffffffffffffffffffffffffffffffff8088166000908152600260209081526040808320938a1683529290522054611e10908490612e50565b73ffffffffffffffffffffffffffffffffffffffff8089166000908152600260209081526040808320938b16835292905220555b611e5287878787878661240f565b60035460045460405173ffffffffffffffffffffffffffffffffffffffff92831692633dbb202b9216907f0166a07a0000000000000000000000000000000000000000000000000000000090611eb6908b908d908c908c908c908b90602401612e68565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009485161790525160e085901b9092168252611f4992918790600401612db4565b600060405180830381600087803b158015611f6357600080fd5b505af1158015611f77573d6000803e3d6000fd5b5050505050505050505050565b6109c987878787878787611c59565b600054610100900460ff1661202a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610214565b6003805473ffffffffffffffffffffffffffffffffffffffff9384167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560048054929093169116179055565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f35d79ab81f2b2017e19afb5c5571778877782d7a8786f5907f93b0f4702f4f2384846040516120dc929190612e37565b60405180910390a36105b28484848461249d565b60006120fb836124fc565b801561210c575061210c8383612560565b9392505050565b6000612175826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661262f9092919063ffffffff16565b805190915015610aa457808060200190518101906121939190612d49565b610aa4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610214565b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fd59c65b35445225835c83f50b6ede06a7be047d22e357073e250d9af537518cd86868660405161229793929190612df9565b60405180910390a4505050505050565b603354604080517f4397dfef0000000000000000000000000000000000000000000000000000000081528151600093849373ffffffffffffffffffffffffffffffffffffffff90911692634397dfef92600480830193928290030181865afa158015612317573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061233b9190612ec3565b90939092509050565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f31b2166ff604fc5672ea5df08a78081d2bc6d746cadce880747f3643d819e83d84846040516123a3929190612e37565b60405180910390a350505050565b60405173ffffffffffffffffffffffffffffffffffffffff808516602483015283166044820152606481018290526105b29085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401611a7d565b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167f718594027abd4eaed59f95162563e0cc6d0e8d5b86b1c7be8b1b0ac3343d039686868660405161248793929190612df9565b60405180910390a4611013868686868686612646565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f2849b43074093a05396b6f2a937dee8565b15a48a7b3d4bffb732a5017380af584846040516123a3929190612e37565b6000612528827f01ffc9a700000000000000000000000000000000000000000000000000000000612560565b80156119055750612559827fffffffff00000000000000000000000000000000000000000000000000000000612560565b1592915050565b604080517fffffffff000000000000000000000000000000000000000000000000000000008316602480830191909152825180830390910181526044909101909152602080820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f01ffc9a700000000000000000000000000000000000000000000000000000000178152825160009392849283928392918391908a617530fa92503d91506000519050828015612618575060208210155b80156126245750600081115b979650505050505050565b606061263e84846000856126be565b949350505050565b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167f7ff126db8024424bbfd9826e8ab82ff59136289ea440b04b39a0df1b03b9cabf86868660405161229793929190612df9565b606082471015612750576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610214565b73ffffffffffffffffffffffffffffffffffffffff85163b6127ce576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610214565b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516127f79190612ef8565b60006040518083038185875af1925050503d8060008114612834576040519150601f19603f3d011682016040523d82523d6000602084013e612839565b606091505b50915091506126248282866060831561285357508161210c565b8251156128635782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102149190612b69565b73ffffffffffffffffffffffffffffffffffffffff811681146128b957600080fd5b50565b60008083601f8401126128ce57600080fd5b50813567ffffffffffffffff8111156128e657600080fd5b6020830191508360208285010111156128fe57600080fd5b9250929050565b600080600080600080600060c0888a03121561292057600080fd5b873561292b81612897565b9650602088013561293b81612897565b9550604088013561294b81612897565b9450606088013561295b81612897565b93506080880135925060a088013567ffffffffffffffff81111561297e57600080fd5b61298a8a828b016128bc565b989b979a50959850939692959293505050565b803563ffffffff811681146129b157600080fd5b919050565b6000806000604084860312156129cb57600080fd5b6129d48461299d565b9250602084013567ffffffffffffffff8111156129f057600080fd5b6129fc868287016128bc565b9497909650939450505050565b600080600080600060808688031215612a2157600080fd5b8535612a2c81612897565b94506020860135612a3c81612897565b935060408601359250606086013567ffffffffffffffff811115612a5f57600080fd5b612a6b888289016128bc565b969995985093965092949392505050565b600080600080600080600060c0888a031215612a9757600080fd5b8735612aa281612897565b96506020880135612ab281612897565b95506040880135612ac281612897565b945060608801359350612ad76080890161299d565b925060a088013567ffffffffffffffff81111561297e57600080fd5b60005b83811015612b0e578181015183820152602001612af6565b838111156105b25750506000910152565b60008151808452612b37816020860160208601612af3565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60208152600061210c6020830184612b1f565b60008060008060008060a08789031215612b9557600080fd5b8635612ba081612897565b95506020870135612bb081612897565b945060408701359350612bc56060880161299d565b9250608087013567ffffffffffffffff811115612be157600080fd5b612bed89828a016128bc565b979a9699509497509295939492505050565b60008060408385031215612c1257600080fd5b8235612c1d81612897565b91506020830135612c2d81612897565b809150509250929050565b60008060008060608587031215612c4e57600080fd5b8435612c5981612897565b9350612c676020860161299d565b9250604085013567ffffffffffffffff811115612c8357600080fd5b612c8f878288016128bc565b95989497509550505050565b600080600060608486031215612cb057600080fd5b8335612cbb81612897565b92506020840135612ccb81612897565b91506040840135612cdb81612897565b809150509250925092565b600060208284031215612cf857600080fd5b815161210c81612897565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082821015612d4457612d44612d03565b500390565b600060208284031215612d5b57600080fd5b8151801515811461210c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff808716835280861660208401525083604083015260806060830152612daa6080830184612b1f565b9695505050505050565b73ffffffffffffffffffffffffffffffffffffffff84168152606060208201526000612de36060830185612b1f565b905063ffffffff83166040830152949350505050565b73ffffffffffffffffffffffffffffffffffffffff84168152826020820152606060408201526000612e2e6060830184612b1f565b95945050505050565b82815260406020820152600061263e6040830184612b1f565b60008219821115612e6357612e63612d03565b500190565b600073ffffffffffffffffffffffffffffffffffffffff80891683528088166020840152808716604084015280861660608401525083608083015260c060a0830152612eb760c0830184612b1f565b98975050505050505050565b60008060408385031215612ed657600080fd5b8251612ee181612897565b602084015190925060ff81168114612c2d57600080fd5b60008251612f0a818460208701612af3565b919091019291505056fea164736f6c634300080f000a", +} + +// L1StandardBridgeABI is the input ABI used to generate the binding from. +// Deprecated: Use L1StandardBridgeMetaData.ABI instead. +var L1StandardBridgeABI = L1StandardBridgeMetaData.ABI + +// L1StandardBridgeBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use L1StandardBridgeMetaData.Bin instead. +var L1StandardBridgeBin = L1StandardBridgeMetaData.Bin + +// DeployL1StandardBridge deploys a new Ethereum contract, binding an instance of L1StandardBridge to it. +func DeployL1StandardBridge(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *L1StandardBridge, error) { + parsed, err := L1StandardBridgeMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(L1StandardBridgeBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &L1StandardBridge{L1StandardBridgeCaller: L1StandardBridgeCaller{contract: contract}, L1StandardBridgeTransactor: L1StandardBridgeTransactor{contract: contract}, L1StandardBridgeFilterer: L1StandardBridgeFilterer{contract: contract}}, nil +} + +// L1StandardBridge is an auto generated Go binding around an Ethereum contract. +type L1StandardBridge struct { + L1StandardBridgeCaller // Read-only binding to the contract + L1StandardBridgeTransactor // Write-only binding to the contract + L1StandardBridgeFilterer // Log filterer for contract events +} + +// L1StandardBridgeCaller is an auto generated read-only Go binding around an Ethereum contract. +type L1StandardBridgeCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// L1StandardBridgeTransactor is an auto generated write-only Go binding around an Ethereum contract. +type L1StandardBridgeTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// L1StandardBridgeFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type L1StandardBridgeFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// L1StandardBridgeSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type L1StandardBridgeSession struct { + Contract *L1StandardBridge // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// L1StandardBridgeCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type L1StandardBridgeCallerSession struct { + Contract *L1StandardBridgeCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// L1StandardBridgeTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type L1StandardBridgeTransactorSession struct { + Contract *L1StandardBridgeTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// L1StandardBridgeRaw is an auto generated low-level Go binding around an Ethereum contract. +type L1StandardBridgeRaw struct { + Contract *L1StandardBridge // Generic contract binding to access the raw methods on +} + +// L1StandardBridgeCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type L1StandardBridgeCallerRaw struct { + Contract *L1StandardBridgeCaller // Generic read-only contract binding to access the raw methods on +} + +// L1StandardBridgeTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type L1StandardBridgeTransactorRaw struct { + Contract *L1StandardBridgeTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewL1StandardBridge creates a new instance of L1StandardBridge, bound to a specific deployed contract. +func NewL1StandardBridge(address common.Address, backend bind.ContractBackend) (*L1StandardBridge, error) { + contract, err := bindL1StandardBridge(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &L1StandardBridge{L1StandardBridgeCaller: L1StandardBridgeCaller{contract: contract}, L1StandardBridgeTransactor: L1StandardBridgeTransactor{contract: contract}, L1StandardBridgeFilterer: L1StandardBridgeFilterer{contract: contract}}, nil +} + +// NewL1StandardBridgeCaller creates a new read-only instance of L1StandardBridge, bound to a specific deployed contract. +func NewL1StandardBridgeCaller(address common.Address, caller bind.ContractCaller) (*L1StandardBridgeCaller, error) { + contract, err := bindL1StandardBridge(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &L1StandardBridgeCaller{contract: contract}, nil +} + +// NewL1StandardBridgeTransactor creates a new write-only instance of L1StandardBridge, bound to a specific deployed contract. +func NewL1StandardBridgeTransactor(address common.Address, transactor bind.ContractTransactor) (*L1StandardBridgeTransactor, error) { + contract, err := bindL1StandardBridge(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &L1StandardBridgeTransactor{contract: contract}, nil +} + +// NewL1StandardBridgeFilterer creates a new log filterer instance of L1StandardBridge, bound to a specific deployed contract. +func NewL1StandardBridgeFilterer(address common.Address, filterer bind.ContractFilterer) (*L1StandardBridgeFilterer, error) { + contract, err := bindL1StandardBridge(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &L1StandardBridgeFilterer{contract: contract}, nil +} + +// bindL1StandardBridge binds a generic wrapper to an already deployed contract. +func bindL1StandardBridge(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(L1StandardBridgeABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_L1StandardBridge *L1StandardBridgeRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _L1StandardBridge.Contract.L1StandardBridgeCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_L1StandardBridge *L1StandardBridgeRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _L1StandardBridge.Contract.L1StandardBridgeTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_L1StandardBridge *L1StandardBridgeRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _L1StandardBridge.Contract.L1StandardBridgeTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_L1StandardBridge *L1StandardBridgeCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _L1StandardBridge.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_L1StandardBridge *L1StandardBridgeTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _L1StandardBridge.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_L1StandardBridge *L1StandardBridgeTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _L1StandardBridge.Contract.contract.Transact(opts, method, params...) +} + +// MESSENGER is a free data retrieval call binding the contract method 0x927ede2d. +// +// Solidity: function MESSENGER() view returns(address) +func (_L1StandardBridge *L1StandardBridgeCaller) MESSENGER(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _L1StandardBridge.contract.Call(opts, &out, "MESSENGER") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// MESSENGER is a free data retrieval call binding the contract method 0x927ede2d. +// +// Solidity: function MESSENGER() view returns(address) +func (_L1StandardBridge *L1StandardBridgeSession) MESSENGER() (common.Address, error) { + return _L1StandardBridge.Contract.MESSENGER(&_L1StandardBridge.CallOpts) +} + +// MESSENGER is a free data retrieval call binding the contract method 0x927ede2d. +// +// Solidity: function MESSENGER() view returns(address) +func (_L1StandardBridge *L1StandardBridgeCallerSession) MESSENGER() (common.Address, error) { + return _L1StandardBridge.Contract.MESSENGER(&_L1StandardBridge.CallOpts) +} + +// OTHERBRIDGE is a free data retrieval call binding the contract method 0x7f46ddb2. +// +// Solidity: function OTHER_BRIDGE() view returns(address) +func (_L1StandardBridge *L1StandardBridgeCaller) OTHERBRIDGE(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _L1StandardBridge.contract.Call(opts, &out, "OTHER_BRIDGE") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// OTHERBRIDGE is a free data retrieval call binding the contract method 0x7f46ddb2. +// +// Solidity: function OTHER_BRIDGE() view returns(address) +func (_L1StandardBridge *L1StandardBridgeSession) OTHERBRIDGE() (common.Address, error) { + return _L1StandardBridge.Contract.OTHERBRIDGE(&_L1StandardBridge.CallOpts) +} + +// OTHERBRIDGE is a free data retrieval call binding the contract method 0x7f46ddb2. +// +// Solidity: function OTHER_BRIDGE() view returns(address) +func (_L1StandardBridge *L1StandardBridgeCallerSession) OTHERBRIDGE() (common.Address, error) { + return _L1StandardBridge.Contract.OTHERBRIDGE(&_L1StandardBridge.CallOpts) +} + +// Deposits is a free data retrieval call binding the contract method 0x8f601f66. +// +// Solidity: function deposits(address , address ) view returns(uint256) +func (_L1StandardBridge *L1StandardBridgeCaller) Deposits(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address) (*big.Int, error) { + var out []interface{} + err := _L1StandardBridge.contract.Call(opts, &out, "deposits", arg0, arg1) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Deposits is a free data retrieval call binding the contract method 0x8f601f66. +// +// Solidity: function deposits(address , address ) view returns(uint256) +func (_L1StandardBridge *L1StandardBridgeSession) Deposits(arg0 common.Address, arg1 common.Address) (*big.Int, error) { + return _L1StandardBridge.Contract.Deposits(&_L1StandardBridge.CallOpts, arg0, arg1) +} + +// Deposits is a free data retrieval call binding the contract method 0x8f601f66. +// +// Solidity: function deposits(address , address ) view returns(uint256) +func (_L1StandardBridge *L1StandardBridgeCallerSession) Deposits(arg0 common.Address, arg1 common.Address) (*big.Int, error) { + return _L1StandardBridge.Contract.Deposits(&_L1StandardBridge.CallOpts, arg0, arg1) +} + +// L2TokenBridge is a free data retrieval call binding the contract method 0x91c49bf8. +// +// Solidity: function l2TokenBridge() view returns(address) +func (_L1StandardBridge *L1StandardBridgeCaller) L2TokenBridge(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _L1StandardBridge.contract.Call(opts, &out, "l2TokenBridge") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// L2TokenBridge is a free data retrieval call binding the contract method 0x91c49bf8. +// +// Solidity: function l2TokenBridge() view returns(address) +func (_L1StandardBridge *L1StandardBridgeSession) L2TokenBridge() (common.Address, error) { + return _L1StandardBridge.Contract.L2TokenBridge(&_L1StandardBridge.CallOpts) +} + +// L2TokenBridge is a free data retrieval call binding the contract method 0x91c49bf8. +// +// Solidity: function l2TokenBridge() view returns(address) +func (_L1StandardBridge *L1StandardBridgeCallerSession) L2TokenBridge() (common.Address, error) { + return _L1StandardBridge.Contract.L2TokenBridge(&_L1StandardBridge.CallOpts) +} + +// Messenger is a free data retrieval call binding the contract method 0x3cb747bf. +// +// Solidity: function messenger() view returns(address) +func (_L1StandardBridge *L1StandardBridgeCaller) Messenger(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _L1StandardBridge.contract.Call(opts, &out, "messenger") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Messenger is a free data retrieval call binding the contract method 0x3cb747bf. +// +// Solidity: function messenger() view returns(address) +func (_L1StandardBridge *L1StandardBridgeSession) Messenger() (common.Address, error) { + return _L1StandardBridge.Contract.Messenger(&_L1StandardBridge.CallOpts) +} + +// Messenger is a free data retrieval call binding the contract method 0x3cb747bf. +// +// Solidity: function messenger() view returns(address) +func (_L1StandardBridge *L1StandardBridgeCallerSession) Messenger() (common.Address, error) { + return _L1StandardBridge.Contract.Messenger(&_L1StandardBridge.CallOpts) +} + +// OtherBridge is a free data retrieval call binding the contract method 0xc89701a2. +// +// Solidity: function otherBridge() view returns(address) +func (_L1StandardBridge *L1StandardBridgeCaller) OtherBridge(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _L1StandardBridge.contract.Call(opts, &out, "otherBridge") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// OtherBridge is a free data retrieval call binding the contract method 0xc89701a2. +// +// Solidity: function otherBridge() view returns(address) +func (_L1StandardBridge *L1StandardBridgeSession) OtherBridge() (common.Address, error) { + return _L1StandardBridge.Contract.OtherBridge(&_L1StandardBridge.CallOpts) +} + +// OtherBridge is a free data retrieval call binding the contract method 0xc89701a2. +// +// Solidity: function otherBridge() view returns(address) +func (_L1StandardBridge *L1StandardBridgeCallerSession) OtherBridge() (common.Address, error) { + return _L1StandardBridge.Contract.OtherBridge(&_L1StandardBridge.CallOpts) +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool) +func (_L1StandardBridge *L1StandardBridgeCaller) Paused(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _L1StandardBridge.contract.Call(opts, &out, "paused") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool) +func (_L1StandardBridge *L1StandardBridgeSession) Paused() (bool, error) { + return _L1StandardBridge.Contract.Paused(&_L1StandardBridge.CallOpts) +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool) +func (_L1StandardBridge *L1StandardBridgeCallerSession) Paused() (bool, error) { + return _L1StandardBridge.Contract.Paused(&_L1StandardBridge.CallOpts) +} + +// SuperchainConfig is a free data retrieval call binding the contract method 0x35e80ab3. +// +// Solidity: function superchainConfig() view returns(address) +func (_L1StandardBridge *L1StandardBridgeCaller) SuperchainConfig(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _L1StandardBridge.contract.Call(opts, &out, "superchainConfig") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// SuperchainConfig is a free data retrieval call binding the contract method 0x35e80ab3. +// +// Solidity: function superchainConfig() view returns(address) +func (_L1StandardBridge *L1StandardBridgeSession) SuperchainConfig() (common.Address, error) { + return _L1StandardBridge.Contract.SuperchainConfig(&_L1StandardBridge.CallOpts) +} + +// SuperchainConfig is a free data retrieval call binding the contract method 0x35e80ab3. +// +// Solidity: function superchainConfig() view returns(address) +func (_L1StandardBridge *L1StandardBridgeCallerSession) SuperchainConfig() (common.Address, error) { + return _L1StandardBridge.Contract.SuperchainConfig(&_L1StandardBridge.CallOpts) +} + +// SystemConfig is a free data retrieval call binding the contract method 0x33d7e2bd. +// +// Solidity: function systemConfig() view returns(address) +func (_L1StandardBridge *L1StandardBridgeCaller) SystemConfig(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _L1StandardBridge.contract.Call(opts, &out, "systemConfig") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// SystemConfig is a free data retrieval call binding the contract method 0x33d7e2bd. +// +// Solidity: function systemConfig() view returns(address) +func (_L1StandardBridge *L1StandardBridgeSession) SystemConfig() (common.Address, error) { + return _L1StandardBridge.Contract.SystemConfig(&_L1StandardBridge.CallOpts) +} + +// SystemConfig is a free data retrieval call binding the contract method 0x33d7e2bd. +// +// Solidity: function systemConfig() view returns(address) +func (_L1StandardBridge *L1StandardBridgeCallerSession) SystemConfig() (common.Address, error) { + return _L1StandardBridge.Contract.SystemConfig(&_L1StandardBridge.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_L1StandardBridge *L1StandardBridgeCaller) Version(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _L1StandardBridge.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 (_L1StandardBridge *L1StandardBridgeSession) Version() (string, error) { + return _L1StandardBridge.Contract.Version(&_L1StandardBridge.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_L1StandardBridge *L1StandardBridgeCallerSession) Version() (string, error) { + return _L1StandardBridge.Contract.Version(&_L1StandardBridge.CallOpts) +} + +// BridgeERC20 is a paid mutator transaction binding the contract method 0x87087623. +// +// Solidity: function bridgeERC20(address _localToken, address _remoteToken, uint256 _amount, uint32 _minGasLimit, bytes _extraData) returns() +func (_L1StandardBridge *L1StandardBridgeTransactor) BridgeERC20(opts *bind.TransactOpts, _localToken common.Address, _remoteToken common.Address, _amount *big.Int, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L1StandardBridge.contract.Transact(opts, "bridgeERC20", _localToken, _remoteToken, _amount, _minGasLimit, _extraData) +} + +// BridgeERC20 is a paid mutator transaction binding the contract method 0x87087623. +// +// Solidity: function bridgeERC20(address _localToken, address _remoteToken, uint256 _amount, uint32 _minGasLimit, bytes _extraData) returns() +func (_L1StandardBridge *L1StandardBridgeSession) BridgeERC20(_localToken common.Address, _remoteToken common.Address, _amount *big.Int, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L1StandardBridge.Contract.BridgeERC20(&_L1StandardBridge.TransactOpts, _localToken, _remoteToken, _amount, _minGasLimit, _extraData) +} + +// BridgeERC20 is a paid mutator transaction binding the contract method 0x87087623. +// +// Solidity: function bridgeERC20(address _localToken, address _remoteToken, uint256 _amount, uint32 _minGasLimit, bytes _extraData) returns() +func (_L1StandardBridge *L1StandardBridgeTransactorSession) BridgeERC20(_localToken common.Address, _remoteToken common.Address, _amount *big.Int, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L1StandardBridge.Contract.BridgeERC20(&_L1StandardBridge.TransactOpts, _localToken, _remoteToken, _amount, _minGasLimit, _extraData) +} + +// BridgeERC20To is a paid mutator transaction binding the contract method 0x540abf73. +// +// Solidity: function bridgeERC20To(address _localToken, address _remoteToken, address _to, uint256 _amount, uint32 _minGasLimit, bytes _extraData) returns() +func (_L1StandardBridge *L1StandardBridgeTransactor) BridgeERC20To(opts *bind.TransactOpts, _localToken common.Address, _remoteToken common.Address, _to common.Address, _amount *big.Int, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L1StandardBridge.contract.Transact(opts, "bridgeERC20To", _localToken, _remoteToken, _to, _amount, _minGasLimit, _extraData) +} + +// BridgeERC20To is a paid mutator transaction binding the contract method 0x540abf73. +// +// Solidity: function bridgeERC20To(address _localToken, address _remoteToken, address _to, uint256 _amount, uint32 _minGasLimit, bytes _extraData) returns() +func (_L1StandardBridge *L1StandardBridgeSession) BridgeERC20To(_localToken common.Address, _remoteToken common.Address, _to common.Address, _amount *big.Int, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L1StandardBridge.Contract.BridgeERC20To(&_L1StandardBridge.TransactOpts, _localToken, _remoteToken, _to, _amount, _minGasLimit, _extraData) +} + +// BridgeERC20To is a paid mutator transaction binding the contract method 0x540abf73. +// +// Solidity: function bridgeERC20To(address _localToken, address _remoteToken, address _to, uint256 _amount, uint32 _minGasLimit, bytes _extraData) returns() +func (_L1StandardBridge *L1StandardBridgeTransactorSession) BridgeERC20To(_localToken common.Address, _remoteToken common.Address, _to common.Address, _amount *big.Int, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L1StandardBridge.Contract.BridgeERC20To(&_L1StandardBridge.TransactOpts, _localToken, _remoteToken, _to, _amount, _minGasLimit, _extraData) +} + +// BridgeETH is a paid mutator transaction binding the contract method 0x09fc8843. +// +// Solidity: function bridgeETH(uint32 _minGasLimit, bytes _extraData) payable returns() +func (_L1StandardBridge *L1StandardBridgeTransactor) BridgeETH(opts *bind.TransactOpts, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L1StandardBridge.contract.Transact(opts, "bridgeETH", _minGasLimit, _extraData) +} + +// BridgeETH is a paid mutator transaction binding the contract method 0x09fc8843. +// +// Solidity: function bridgeETH(uint32 _minGasLimit, bytes _extraData) payable returns() +func (_L1StandardBridge *L1StandardBridgeSession) BridgeETH(_minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L1StandardBridge.Contract.BridgeETH(&_L1StandardBridge.TransactOpts, _minGasLimit, _extraData) +} + +// BridgeETH is a paid mutator transaction binding the contract method 0x09fc8843. +// +// Solidity: function bridgeETH(uint32 _minGasLimit, bytes _extraData) payable returns() +func (_L1StandardBridge *L1StandardBridgeTransactorSession) BridgeETH(_minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L1StandardBridge.Contract.BridgeETH(&_L1StandardBridge.TransactOpts, _minGasLimit, _extraData) +} + +// BridgeETHTo is a paid mutator transaction binding the contract method 0xe11013dd. +// +// Solidity: function bridgeETHTo(address _to, uint32 _minGasLimit, bytes _extraData) payable returns() +func (_L1StandardBridge *L1StandardBridgeTransactor) BridgeETHTo(opts *bind.TransactOpts, _to common.Address, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L1StandardBridge.contract.Transact(opts, "bridgeETHTo", _to, _minGasLimit, _extraData) +} + +// BridgeETHTo is a paid mutator transaction binding the contract method 0xe11013dd. +// +// Solidity: function bridgeETHTo(address _to, uint32 _minGasLimit, bytes _extraData) payable returns() +func (_L1StandardBridge *L1StandardBridgeSession) BridgeETHTo(_to common.Address, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L1StandardBridge.Contract.BridgeETHTo(&_L1StandardBridge.TransactOpts, _to, _minGasLimit, _extraData) +} + +// BridgeETHTo is a paid mutator transaction binding the contract method 0xe11013dd. +// +// Solidity: function bridgeETHTo(address _to, uint32 _minGasLimit, bytes _extraData) payable returns() +func (_L1StandardBridge *L1StandardBridgeTransactorSession) BridgeETHTo(_to common.Address, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L1StandardBridge.Contract.BridgeETHTo(&_L1StandardBridge.TransactOpts, _to, _minGasLimit, _extraData) +} + +// DepositERC20 is a paid mutator transaction binding the contract method 0x58a997f6. +// +// Solidity: function depositERC20(address _l1Token, address _l2Token, uint256 _amount, uint32 _minGasLimit, bytes _extraData) returns() +func (_L1StandardBridge *L1StandardBridgeTransactor) DepositERC20(opts *bind.TransactOpts, _l1Token common.Address, _l2Token common.Address, _amount *big.Int, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L1StandardBridge.contract.Transact(opts, "depositERC20", _l1Token, _l2Token, _amount, _minGasLimit, _extraData) +} + +// DepositERC20 is a paid mutator transaction binding the contract method 0x58a997f6. +// +// Solidity: function depositERC20(address _l1Token, address _l2Token, uint256 _amount, uint32 _minGasLimit, bytes _extraData) returns() +func (_L1StandardBridge *L1StandardBridgeSession) DepositERC20(_l1Token common.Address, _l2Token common.Address, _amount *big.Int, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L1StandardBridge.Contract.DepositERC20(&_L1StandardBridge.TransactOpts, _l1Token, _l2Token, _amount, _minGasLimit, _extraData) +} + +// DepositERC20 is a paid mutator transaction binding the contract method 0x58a997f6. +// +// Solidity: function depositERC20(address _l1Token, address _l2Token, uint256 _amount, uint32 _minGasLimit, bytes _extraData) returns() +func (_L1StandardBridge *L1StandardBridgeTransactorSession) DepositERC20(_l1Token common.Address, _l2Token common.Address, _amount *big.Int, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L1StandardBridge.Contract.DepositERC20(&_L1StandardBridge.TransactOpts, _l1Token, _l2Token, _amount, _minGasLimit, _extraData) +} + +// DepositERC20To is a paid mutator transaction binding the contract method 0x838b2520. +// +// Solidity: function depositERC20To(address _l1Token, address _l2Token, address _to, uint256 _amount, uint32 _minGasLimit, bytes _extraData) returns() +func (_L1StandardBridge *L1StandardBridgeTransactor) DepositERC20To(opts *bind.TransactOpts, _l1Token common.Address, _l2Token common.Address, _to common.Address, _amount *big.Int, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L1StandardBridge.contract.Transact(opts, "depositERC20To", _l1Token, _l2Token, _to, _amount, _minGasLimit, _extraData) +} + +// DepositERC20To is a paid mutator transaction binding the contract method 0x838b2520. +// +// Solidity: function depositERC20To(address _l1Token, address _l2Token, address _to, uint256 _amount, uint32 _minGasLimit, bytes _extraData) returns() +func (_L1StandardBridge *L1StandardBridgeSession) DepositERC20To(_l1Token common.Address, _l2Token common.Address, _to common.Address, _amount *big.Int, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L1StandardBridge.Contract.DepositERC20To(&_L1StandardBridge.TransactOpts, _l1Token, _l2Token, _to, _amount, _minGasLimit, _extraData) +} + +// DepositERC20To is a paid mutator transaction binding the contract method 0x838b2520. +// +// Solidity: function depositERC20To(address _l1Token, address _l2Token, address _to, uint256 _amount, uint32 _minGasLimit, bytes _extraData) returns() +func (_L1StandardBridge *L1StandardBridgeTransactorSession) DepositERC20To(_l1Token common.Address, _l2Token common.Address, _to common.Address, _amount *big.Int, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L1StandardBridge.Contract.DepositERC20To(&_L1StandardBridge.TransactOpts, _l1Token, _l2Token, _to, _amount, _minGasLimit, _extraData) +} + +// DepositETH is a paid mutator transaction binding the contract method 0xb1a1a882. +// +// Solidity: function depositETH(uint32 _minGasLimit, bytes _extraData) payable returns() +func (_L1StandardBridge *L1StandardBridgeTransactor) DepositETH(opts *bind.TransactOpts, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L1StandardBridge.contract.Transact(opts, "depositETH", _minGasLimit, _extraData) +} + +// DepositETH is a paid mutator transaction binding the contract method 0xb1a1a882. +// +// Solidity: function depositETH(uint32 _minGasLimit, bytes _extraData) payable returns() +func (_L1StandardBridge *L1StandardBridgeSession) DepositETH(_minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L1StandardBridge.Contract.DepositETH(&_L1StandardBridge.TransactOpts, _minGasLimit, _extraData) +} + +// DepositETH is a paid mutator transaction binding the contract method 0xb1a1a882. +// +// Solidity: function depositETH(uint32 _minGasLimit, bytes _extraData) payable returns() +func (_L1StandardBridge *L1StandardBridgeTransactorSession) DepositETH(_minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L1StandardBridge.Contract.DepositETH(&_L1StandardBridge.TransactOpts, _minGasLimit, _extraData) +} + +// DepositETHTo is a paid mutator transaction binding the contract method 0x9a2ac6d5. +// +// Solidity: function depositETHTo(address _to, uint32 _minGasLimit, bytes _extraData) payable returns() +func (_L1StandardBridge *L1StandardBridgeTransactor) DepositETHTo(opts *bind.TransactOpts, _to common.Address, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L1StandardBridge.contract.Transact(opts, "depositETHTo", _to, _minGasLimit, _extraData) +} + +// DepositETHTo is a paid mutator transaction binding the contract method 0x9a2ac6d5. +// +// Solidity: function depositETHTo(address _to, uint32 _minGasLimit, bytes _extraData) payable returns() +func (_L1StandardBridge *L1StandardBridgeSession) DepositETHTo(_to common.Address, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L1StandardBridge.Contract.DepositETHTo(&_L1StandardBridge.TransactOpts, _to, _minGasLimit, _extraData) +} + +// DepositETHTo is a paid mutator transaction binding the contract method 0x9a2ac6d5. +// +// Solidity: function depositETHTo(address _to, uint32 _minGasLimit, bytes _extraData) payable returns() +func (_L1StandardBridge *L1StandardBridgeTransactorSession) DepositETHTo(_to common.Address, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L1StandardBridge.Contract.DepositETHTo(&_L1StandardBridge.TransactOpts, _to, _minGasLimit, _extraData) +} + +// FinalizeBridgeERC20 is a paid mutator transaction binding the contract method 0x0166a07a. +// +// Solidity: function finalizeBridgeERC20(address _localToken, address _remoteToken, address _from, address _to, uint256 _amount, bytes _extraData) returns() +func (_L1StandardBridge *L1StandardBridgeTransactor) FinalizeBridgeERC20(opts *bind.TransactOpts, _localToken common.Address, _remoteToken common.Address, _from common.Address, _to common.Address, _amount *big.Int, _extraData []byte) (*types.Transaction, error) { + return _L1StandardBridge.contract.Transact(opts, "finalizeBridgeERC20", _localToken, _remoteToken, _from, _to, _amount, _extraData) +} + +// FinalizeBridgeERC20 is a paid mutator transaction binding the contract method 0x0166a07a. +// +// Solidity: function finalizeBridgeERC20(address _localToken, address _remoteToken, address _from, address _to, uint256 _amount, bytes _extraData) returns() +func (_L1StandardBridge *L1StandardBridgeSession) FinalizeBridgeERC20(_localToken common.Address, _remoteToken common.Address, _from common.Address, _to common.Address, _amount *big.Int, _extraData []byte) (*types.Transaction, error) { + return _L1StandardBridge.Contract.FinalizeBridgeERC20(&_L1StandardBridge.TransactOpts, _localToken, _remoteToken, _from, _to, _amount, _extraData) +} + +// FinalizeBridgeERC20 is a paid mutator transaction binding the contract method 0x0166a07a. +// +// Solidity: function finalizeBridgeERC20(address _localToken, address _remoteToken, address _from, address _to, uint256 _amount, bytes _extraData) returns() +func (_L1StandardBridge *L1StandardBridgeTransactorSession) FinalizeBridgeERC20(_localToken common.Address, _remoteToken common.Address, _from common.Address, _to common.Address, _amount *big.Int, _extraData []byte) (*types.Transaction, error) { + return _L1StandardBridge.Contract.FinalizeBridgeERC20(&_L1StandardBridge.TransactOpts, _localToken, _remoteToken, _from, _to, _amount, _extraData) +} + +// FinalizeBridgeETH is a paid mutator transaction binding the contract method 0x1635f5fd. +// +// Solidity: function finalizeBridgeETH(address _from, address _to, uint256 _amount, bytes _extraData) payable returns() +func (_L1StandardBridge *L1StandardBridgeTransactor) FinalizeBridgeETH(opts *bind.TransactOpts, _from common.Address, _to common.Address, _amount *big.Int, _extraData []byte) (*types.Transaction, error) { + return _L1StandardBridge.contract.Transact(opts, "finalizeBridgeETH", _from, _to, _amount, _extraData) +} + +// FinalizeBridgeETH is a paid mutator transaction binding the contract method 0x1635f5fd. +// +// Solidity: function finalizeBridgeETH(address _from, address _to, uint256 _amount, bytes _extraData) payable returns() +func (_L1StandardBridge *L1StandardBridgeSession) FinalizeBridgeETH(_from common.Address, _to common.Address, _amount *big.Int, _extraData []byte) (*types.Transaction, error) { + return _L1StandardBridge.Contract.FinalizeBridgeETH(&_L1StandardBridge.TransactOpts, _from, _to, _amount, _extraData) +} + +// FinalizeBridgeETH is a paid mutator transaction binding the contract method 0x1635f5fd. +// +// Solidity: function finalizeBridgeETH(address _from, address _to, uint256 _amount, bytes _extraData) payable returns() +func (_L1StandardBridge *L1StandardBridgeTransactorSession) FinalizeBridgeETH(_from common.Address, _to common.Address, _amount *big.Int, _extraData []byte) (*types.Transaction, error) { + return _L1StandardBridge.Contract.FinalizeBridgeETH(&_L1StandardBridge.TransactOpts, _from, _to, _amount, _extraData) +} + +// FinalizeERC20Withdrawal is a paid mutator transaction binding the contract method 0xa9f9e675. +// +// Solidity: function finalizeERC20Withdrawal(address _l1Token, address _l2Token, address _from, address _to, uint256 _amount, bytes _extraData) returns() +func (_L1StandardBridge *L1StandardBridgeTransactor) FinalizeERC20Withdrawal(opts *bind.TransactOpts, _l1Token common.Address, _l2Token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _extraData []byte) (*types.Transaction, error) { + return _L1StandardBridge.contract.Transact(opts, "finalizeERC20Withdrawal", _l1Token, _l2Token, _from, _to, _amount, _extraData) +} + +// FinalizeERC20Withdrawal is a paid mutator transaction binding the contract method 0xa9f9e675. +// +// Solidity: function finalizeERC20Withdrawal(address _l1Token, address _l2Token, address _from, address _to, uint256 _amount, bytes _extraData) returns() +func (_L1StandardBridge *L1StandardBridgeSession) FinalizeERC20Withdrawal(_l1Token common.Address, _l2Token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _extraData []byte) (*types.Transaction, error) { + return _L1StandardBridge.Contract.FinalizeERC20Withdrawal(&_L1StandardBridge.TransactOpts, _l1Token, _l2Token, _from, _to, _amount, _extraData) +} + +// FinalizeERC20Withdrawal is a paid mutator transaction binding the contract method 0xa9f9e675. +// +// Solidity: function finalizeERC20Withdrawal(address _l1Token, address _l2Token, address _from, address _to, uint256 _amount, bytes _extraData) returns() +func (_L1StandardBridge *L1StandardBridgeTransactorSession) FinalizeERC20Withdrawal(_l1Token common.Address, _l2Token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _extraData []byte) (*types.Transaction, error) { + return _L1StandardBridge.Contract.FinalizeERC20Withdrawal(&_L1StandardBridge.TransactOpts, _l1Token, _l2Token, _from, _to, _amount, _extraData) +} + +// FinalizeETHWithdrawal is a paid mutator transaction binding the contract method 0x1532ec34. +// +// Solidity: function finalizeETHWithdrawal(address _from, address _to, uint256 _amount, bytes _extraData) payable returns() +func (_L1StandardBridge *L1StandardBridgeTransactor) FinalizeETHWithdrawal(opts *bind.TransactOpts, _from common.Address, _to common.Address, _amount *big.Int, _extraData []byte) (*types.Transaction, error) { + return _L1StandardBridge.contract.Transact(opts, "finalizeETHWithdrawal", _from, _to, _amount, _extraData) +} + +// FinalizeETHWithdrawal is a paid mutator transaction binding the contract method 0x1532ec34. +// +// Solidity: function finalizeETHWithdrawal(address _from, address _to, uint256 _amount, bytes _extraData) payable returns() +func (_L1StandardBridge *L1StandardBridgeSession) FinalizeETHWithdrawal(_from common.Address, _to common.Address, _amount *big.Int, _extraData []byte) (*types.Transaction, error) { + return _L1StandardBridge.Contract.FinalizeETHWithdrawal(&_L1StandardBridge.TransactOpts, _from, _to, _amount, _extraData) +} + +// FinalizeETHWithdrawal is a paid mutator transaction binding the contract method 0x1532ec34. +// +// Solidity: function finalizeETHWithdrawal(address _from, address _to, uint256 _amount, bytes _extraData) payable returns() +func (_L1StandardBridge *L1StandardBridgeTransactorSession) FinalizeETHWithdrawal(_from common.Address, _to common.Address, _amount *big.Int, _extraData []byte) (*types.Transaction, error) { + return _L1StandardBridge.Contract.FinalizeETHWithdrawal(&_L1StandardBridge.TransactOpts, _from, _to, _amount, _extraData) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc0c53b8b. +// +// Solidity: function initialize(address _messenger, address _superchainConfig, address _systemConfig) returns() +func (_L1StandardBridge *L1StandardBridgeTransactor) Initialize(opts *bind.TransactOpts, _messenger common.Address, _superchainConfig common.Address, _systemConfig common.Address) (*types.Transaction, error) { + return _L1StandardBridge.contract.Transact(opts, "initialize", _messenger, _superchainConfig, _systemConfig) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc0c53b8b. +// +// Solidity: function initialize(address _messenger, address _superchainConfig, address _systemConfig) returns() +func (_L1StandardBridge *L1StandardBridgeSession) Initialize(_messenger common.Address, _superchainConfig common.Address, _systemConfig common.Address) (*types.Transaction, error) { + return _L1StandardBridge.Contract.Initialize(&_L1StandardBridge.TransactOpts, _messenger, _superchainConfig, _systemConfig) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc0c53b8b. +// +// Solidity: function initialize(address _messenger, address _superchainConfig, address _systemConfig) returns() +func (_L1StandardBridge *L1StandardBridgeTransactorSession) Initialize(_messenger common.Address, _superchainConfig common.Address, _systemConfig common.Address) (*types.Transaction, error) { + return _L1StandardBridge.Contract.Initialize(&_L1StandardBridge.TransactOpts, _messenger, _superchainConfig, _systemConfig) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_L1StandardBridge *L1StandardBridgeTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { + return _L1StandardBridge.contract.RawTransact(opts, nil) // calldata is disallowed for receive function +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_L1StandardBridge *L1StandardBridgeSession) Receive() (*types.Transaction, error) { + return _L1StandardBridge.Contract.Receive(&_L1StandardBridge.TransactOpts) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_L1StandardBridge *L1StandardBridgeTransactorSession) Receive() (*types.Transaction, error) { + return _L1StandardBridge.Contract.Receive(&_L1StandardBridge.TransactOpts) +} + +// L1StandardBridgeERC20BridgeFinalizedIterator is returned from FilterERC20BridgeFinalized and is used to iterate over the raw logs and unpacked data for ERC20BridgeFinalized events raised by the L1StandardBridge contract. +type L1StandardBridgeERC20BridgeFinalizedIterator struct { + Event *L1StandardBridgeERC20BridgeFinalized // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *L1StandardBridgeERC20BridgeFinalizedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(L1StandardBridgeERC20BridgeFinalized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(L1StandardBridgeERC20BridgeFinalized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *L1StandardBridgeERC20BridgeFinalizedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *L1StandardBridgeERC20BridgeFinalizedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// L1StandardBridgeERC20BridgeFinalized represents a ERC20BridgeFinalized event raised by the L1StandardBridge contract. +type L1StandardBridgeERC20BridgeFinalized struct { + LocalToken common.Address + RemoteToken common.Address + From common.Address + To common.Address + Amount *big.Int + ExtraData []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterERC20BridgeFinalized is a free log retrieval operation binding the contract event 0xd59c65b35445225835c83f50b6ede06a7be047d22e357073e250d9af537518cd. +// +// Solidity: event ERC20BridgeFinalized(address indexed localToken, address indexed remoteToken, address indexed from, address to, uint256 amount, bytes extraData) +func (_L1StandardBridge *L1StandardBridgeFilterer) FilterERC20BridgeFinalized(opts *bind.FilterOpts, localToken []common.Address, remoteToken []common.Address, from []common.Address) (*L1StandardBridgeERC20BridgeFinalizedIterator, error) { + + var localTokenRule []interface{} + for _, localTokenItem := range localToken { + localTokenRule = append(localTokenRule, localTokenItem) + } + var remoteTokenRule []interface{} + for _, remoteTokenItem := range remoteToken { + remoteTokenRule = append(remoteTokenRule, remoteTokenItem) + } + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + + logs, sub, err := _L1StandardBridge.contract.FilterLogs(opts, "ERC20BridgeFinalized", localTokenRule, remoteTokenRule, fromRule) + if err != nil { + return nil, err + } + return &L1StandardBridgeERC20BridgeFinalizedIterator{contract: _L1StandardBridge.contract, event: "ERC20BridgeFinalized", logs: logs, sub: sub}, nil +} + +// WatchERC20BridgeFinalized is a free log subscription operation binding the contract event 0xd59c65b35445225835c83f50b6ede06a7be047d22e357073e250d9af537518cd. +// +// Solidity: event ERC20BridgeFinalized(address indexed localToken, address indexed remoteToken, address indexed from, address to, uint256 amount, bytes extraData) +func (_L1StandardBridge *L1StandardBridgeFilterer) WatchERC20BridgeFinalized(opts *bind.WatchOpts, sink chan<- *L1StandardBridgeERC20BridgeFinalized, localToken []common.Address, remoteToken []common.Address, from []common.Address) (event.Subscription, error) { + + var localTokenRule []interface{} + for _, localTokenItem := range localToken { + localTokenRule = append(localTokenRule, localTokenItem) + } + var remoteTokenRule []interface{} + for _, remoteTokenItem := range remoteToken { + remoteTokenRule = append(remoteTokenRule, remoteTokenItem) + } + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + + logs, sub, err := _L1StandardBridge.contract.WatchLogs(opts, "ERC20BridgeFinalized", localTokenRule, remoteTokenRule, fromRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(L1StandardBridgeERC20BridgeFinalized) + if err := _L1StandardBridge.contract.UnpackLog(event, "ERC20BridgeFinalized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseERC20BridgeFinalized is a log parse operation binding the contract event 0xd59c65b35445225835c83f50b6ede06a7be047d22e357073e250d9af537518cd. +// +// Solidity: event ERC20BridgeFinalized(address indexed localToken, address indexed remoteToken, address indexed from, address to, uint256 amount, bytes extraData) +func (_L1StandardBridge *L1StandardBridgeFilterer) ParseERC20BridgeFinalized(log types.Log) (*L1StandardBridgeERC20BridgeFinalized, error) { + event := new(L1StandardBridgeERC20BridgeFinalized) + if err := _L1StandardBridge.contract.UnpackLog(event, "ERC20BridgeFinalized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// L1StandardBridgeERC20BridgeInitiatedIterator is returned from FilterERC20BridgeInitiated and is used to iterate over the raw logs and unpacked data for ERC20BridgeInitiated events raised by the L1StandardBridge contract. +type L1StandardBridgeERC20BridgeInitiatedIterator struct { + Event *L1StandardBridgeERC20BridgeInitiated // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *L1StandardBridgeERC20BridgeInitiatedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(L1StandardBridgeERC20BridgeInitiated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(L1StandardBridgeERC20BridgeInitiated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *L1StandardBridgeERC20BridgeInitiatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *L1StandardBridgeERC20BridgeInitiatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// L1StandardBridgeERC20BridgeInitiated represents a ERC20BridgeInitiated event raised by the L1StandardBridge contract. +type L1StandardBridgeERC20BridgeInitiated struct { + LocalToken common.Address + RemoteToken common.Address + From common.Address + To common.Address + Amount *big.Int + ExtraData []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterERC20BridgeInitiated is a free log retrieval operation binding the contract event 0x7ff126db8024424bbfd9826e8ab82ff59136289ea440b04b39a0df1b03b9cabf. +// +// Solidity: event ERC20BridgeInitiated(address indexed localToken, address indexed remoteToken, address indexed from, address to, uint256 amount, bytes extraData) +func (_L1StandardBridge *L1StandardBridgeFilterer) FilterERC20BridgeInitiated(opts *bind.FilterOpts, localToken []common.Address, remoteToken []common.Address, from []common.Address) (*L1StandardBridgeERC20BridgeInitiatedIterator, error) { + + var localTokenRule []interface{} + for _, localTokenItem := range localToken { + localTokenRule = append(localTokenRule, localTokenItem) + } + var remoteTokenRule []interface{} + for _, remoteTokenItem := range remoteToken { + remoteTokenRule = append(remoteTokenRule, remoteTokenItem) + } + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + + logs, sub, err := _L1StandardBridge.contract.FilterLogs(opts, "ERC20BridgeInitiated", localTokenRule, remoteTokenRule, fromRule) + if err != nil { + return nil, err + } + return &L1StandardBridgeERC20BridgeInitiatedIterator{contract: _L1StandardBridge.contract, event: "ERC20BridgeInitiated", logs: logs, sub: sub}, nil +} + +// WatchERC20BridgeInitiated is a free log subscription operation binding the contract event 0x7ff126db8024424bbfd9826e8ab82ff59136289ea440b04b39a0df1b03b9cabf. +// +// Solidity: event ERC20BridgeInitiated(address indexed localToken, address indexed remoteToken, address indexed from, address to, uint256 amount, bytes extraData) +func (_L1StandardBridge *L1StandardBridgeFilterer) WatchERC20BridgeInitiated(opts *bind.WatchOpts, sink chan<- *L1StandardBridgeERC20BridgeInitiated, localToken []common.Address, remoteToken []common.Address, from []common.Address) (event.Subscription, error) { + + var localTokenRule []interface{} + for _, localTokenItem := range localToken { + localTokenRule = append(localTokenRule, localTokenItem) + } + var remoteTokenRule []interface{} + for _, remoteTokenItem := range remoteToken { + remoteTokenRule = append(remoteTokenRule, remoteTokenItem) + } + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + + logs, sub, err := _L1StandardBridge.contract.WatchLogs(opts, "ERC20BridgeInitiated", localTokenRule, remoteTokenRule, fromRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(L1StandardBridgeERC20BridgeInitiated) + if err := _L1StandardBridge.contract.UnpackLog(event, "ERC20BridgeInitiated", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseERC20BridgeInitiated is a log parse operation binding the contract event 0x7ff126db8024424bbfd9826e8ab82ff59136289ea440b04b39a0df1b03b9cabf. +// +// Solidity: event ERC20BridgeInitiated(address indexed localToken, address indexed remoteToken, address indexed from, address to, uint256 amount, bytes extraData) +func (_L1StandardBridge *L1StandardBridgeFilterer) ParseERC20BridgeInitiated(log types.Log) (*L1StandardBridgeERC20BridgeInitiated, error) { + event := new(L1StandardBridgeERC20BridgeInitiated) + if err := _L1StandardBridge.contract.UnpackLog(event, "ERC20BridgeInitiated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// L1StandardBridgeERC20DepositInitiatedIterator is returned from FilterERC20DepositInitiated and is used to iterate over the raw logs and unpacked data for ERC20DepositInitiated events raised by the L1StandardBridge contract. +type L1StandardBridgeERC20DepositInitiatedIterator struct { + Event *L1StandardBridgeERC20DepositInitiated // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *L1StandardBridgeERC20DepositInitiatedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(L1StandardBridgeERC20DepositInitiated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(L1StandardBridgeERC20DepositInitiated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *L1StandardBridgeERC20DepositInitiatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *L1StandardBridgeERC20DepositInitiatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// L1StandardBridgeERC20DepositInitiated represents a ERC20DepositInitiated event raised by the L1StandardBridge contract. +type L1StandardBridgeERC20DepositInitiated struct { + L1Token common.Address + L2Token common.Address + From common.Address + To common.Address + Amount *big.Int + ExtraData []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterERC20DepositInitiated is a free log retrieval operation binding the contract event 0x718594027abd4eaed59f95162563e0cc6d0e8d5b86b1c7be8b1b0ac3343d0396. +// +// Solidity: event ERC20DepositInitiated(address indexed l1Token, address indexed l2Token, address indexed from, address to, uint256 amount, bytes extraData) +func (_L1StandardBridge *L1StandardBridgeFilterer) FilterERC20DepositInitiated(opts *bind.FilterOpts, l1Token []common.Address, l2Token []common.Address, from []common.Address) (*L1StandardBridgeERC20DepositInitiatedIterator, error) { + + var l1TokenRule []interface{} + for _, l1TokenItem := range l1Token { + l1TokenRule = append(l1TokenRule, l1TokenItem) + } + var l2TokenRule []interface{} + for _, l2TokenItem := range l2Token { + l2TokenRule = append(l2TokenRule, l2TokenItem) + } + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + + logs, sub, err := _L1StandardBridge.contract.FilterLogs(opts, "ERC20DepositInitiated", l1TokenRule, l2TokenRule, fromRule) + if err != nil { + return nil, err + } + return &L1StandardBridgeERC20DepositInitiatedIterator{contract: _L1StandardBridge.contract, event: "ERC20DepositInitiated", logs: logs, sub: sub}, nil +} + +// WatchERC20DepositInitiated is a free log subscription operation binding the contract event 0x718594027abd4eaed59f95162563e0cc6d0e8d5b86b1c7be8b1b0ac3343d0396. +// +// Solidity: event ERC20DepositInitiated(address indexed l1Token, address indexed l2Token, address indexed from, address to, uint256 amount, bytes extraData) +func (_L1StandardBridge *L1StandardBridgeFilterer) WatchERC20DepositInitiated(opts *bind.WatchOpts, sink chan<- *L1StandardBridgeERC20DepositInitiated, l1Token []common.Address, l2Token []common.Address, from []common.Address) (event.Subscription, error) { + + var l1TokenRule []interface{} + for _, l1TokenItem := range l1Token { + l1TokenRule = append(l1TokenRule, l1TokenItem) + } + var l2TokenRule []interface{} + for _, l2TokenItem := range l2Token { + l2TokenRule = append(l2TokenRule, l2TokenItem) + } + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + + logs, sub, err := _L1StandardBridge.contract.WatchLogs(opts, "ERC20DepositInitiated", l1TokenRule, l2TokenRule, fromRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(L1StandardBridgeERC20DepositInitiated) + if err := _L1StandardBridge.contract.UnpackLog(event, "ERC20DepositInitiated", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseERC20DepositInitiated is a log parse operation binding the contract event 0x718594027abd4eaed59f95162563e0cc6d0e8d5b86b1c7be8b1b0ac3343d0396. +// +// Solidity: event ERC20DepositInitiated(address indexed l1Token, address indexed l2Token, address indexed from, address to, uint256 amount, bytes extraData) +func (_L1StandardBridge *L1StandardBridgeFilterer) ParseERC20DepositInitiated(log types.Log) (*L1StandardBridgeERC20DepositInitiated, error) { + event := new(L1StandardBridgeERC20DepositInitiated) + if err := _L1StandardBridge.contract.UnpackLog(event, "ERC20DepositInitiated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// L1StandardBridgeERC20WithdrawalFinalizedIterator is returned from FilterERC20WithdrawalFinalized and is used to iterate over the raw logs and unpacked data for ERC20WithdrawalFinalized events raised by the L1StandardBridge contract. +type L1StandardBridgeERC20WithdrawalFinalizedIterator struct { + Event *L1StandardBridgeERC20WithdrawalFinalized // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *L1StandardBridgeERC20WithdrawalFinalizedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(L1StandardBridgeERC20WithdrawalFinalized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(L1StandardBridgeERC20WithdrawalFinalized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *L1StandardBridgeERC20WithdrawalFinalizedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *L1StandardBridgeERC20WithdrawalFinalizedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// L1StandardBridgeERC20WithdrawalFinalized represents a ERC20WithdrawalFinalized event raised by the L1StandardBridge contract. +type L1StandardBridgeERC20WithdrawalFinalized struct { + L1Token common.Address + L2Token common.Address + From common.Address + To common.Address + Amount *big.Int + ExtraData []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterERC20WithdrawalFinalized is a free log retrieval operation binding the contract event 0x3ceee06c1e37648fcbb6ed52e17b3e1f275a1f8c7b22a84b2b84732431e046b3. +// +// Solidity: event ERC20WithdrawalFinalized(address indexed l1Token, address indexed l2Token, address indexed from, address to, uint256 amount, bytes extraData) +func (_L1StandardBridge *L1StandardBridgeFilterer) FilterERC20WithdrawalFinalized(opts *bind.FilterOpts, l1Token []common.Address, l2Token []common.Address, from []common.Address) (*L1StandardBridgeERC20WithdrawalFinalizedIterator, error) { + + var l1TokenRule []interface{} + for _, l1TokenItem := range l1Token { + l1TokenRule = append(l1TokenRule, l1TokenItem) + } + var l2TokenRule []interface{} + for _, l2TokenItem := range l2Token { + l2TokenRule = append(l2TokenRule, l2TokenItem) + } + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + + logs, sub, err := _L1StandardBridge.contract.FilterLogs(opts, "ERC20WithdrawalFinalized", l1TokenRule, l2TokenRule, fromRule) + if err != nil { + return nil, err + } + return &L1StandardBridgeERC20WithdrawalFinalizedIterator{contract: _L1StandardBridge.contract, event: "ERC20WithdrawalFinalized", logs: logs, sub: sub}, nil +} + +// WatchERC20WithdrawalFinalized is a free log subscription operation binding the contract event 0x3ceee06c1e37648fcbb6ed52e17b3e1f275a1f8c7b22a84b2b84732431e046b3. +// +// Solidity: event ERC20WithdrawalFinalized(address indexed l1Token, address indexed l2Token, address indexed from, address to, uint256 amount, bytes extraData) +func (_L1StandardBridge *L1StandardBridgeFilterer) WatchERC20WithdrawalFinalized(opts *bind.WatchOpts, sink chan<- *L1StandardBridgeERC20WithdrawalFinalized, l1Token []common.Address, l2Token []common.Address, from []common.Address) (event.Subscription, error) { + + var l1TokenRule []interface{} + for _, l1TokenItem := range l1Token { + l1TokenRule = append(l1TokenRule, l1TokenItem) + } + var l2TokenRule []interface{} + for _, l2TokenItem := range l2Token { + l2TokenRule = append(l2TokenRule, l2TokenItem) + } + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + + logs, sub, err := _L1StandardBridge.contract.WatchLogs(opts, "ERC20WithdrawalFinalized", l1TokenRule, l2TokenRule, fromRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(L1StandardBridgeERC20WithdrawalFinalized) + if err := _L1StandardBridge.contract.UnpackLog(event, "ERC20WithdrawalFinalized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseERC20WithdrawalFinalized is a log parse operation binding the contract event 0x3ceee06c1e37648fcbb6ed52e17b3e1f275a1f8c7b22a84b2b84732431e046b3. +// +// Solidity: event ERC20WithdrawalFinalized(address indexed l1Token, address indexed l2Token, address indexed from, address to, uint256 amount, bytes extraData) +func (_L1StandardBridge *L1StandardBridgeFilterer) ParseERC20WithdrawalFinalized(log types.Log) (*L1StandardBridgeERC20WithdrawalFinalized, error) { + event := new(L1StandardBridgeERC20WithdrawalFinalized) + if err := _L1StandardBridge.contract.UnpackLog(event, "ERC20WithdrawalFinalized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// L1StandardBridgeETHBridgeFinalizedIterator is returned from FilterETHBridgeFinalized and is used to iterate over the raw logs and unpacked data for ETHBridgeFinalized events raised by the L1StandardBridge contract. +type L1StandardBridgeETHBridgeFinalizedIterator struct { + Event *L1StandardBridgeETHBridgeFinalized // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *L1StandardBridgeETHBridgeFinalizedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(L1StandardBridgeETHBridgeFinalized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(L1StandardBridgeETHBridgeFinalized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *L1StandardBridgeETHBridgeFinalizedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *L1StandardBridgeETHBridgeFinalizedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// L1StandardBridgeETHBridgeFinalized represents a ETHBridgeFinalized event raised by the L1StandardBridge contract. +type L1StandardBridgeETHBridgeFinalized struct { + From common.Address + To common.Address + Amount *big.Int + ExtraData []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterETHBridgeFinalized is a free log retrieval operation binding the contract event 0x31b2166ff604fc5672ea5df08a78081d2bc6d746cadce880747f3643d819e83d. +// +// Solidity: event ETHBridgeFinalized(address indexed from, address indexed to, uint256 amount, bytes extraData) +func (_L1StandardBridge *L1StandardBridgeFilterer) FilterETHBridgeFinalized(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*L1StandardBridgeETHBridgeFinalizedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _L1StandardBridge.contract.FilterLogs(opts, "ETHBridgeFinalized", fromRule, toRule) + if err != nil { + return nil, err + } + return &L1StandardBridgeETHBridgeFinalizedIterator{contract: _L1StandardBridge.contract, event: "ETHBridgeFinalized", logs: logs, sub: sub}, nil +} + +// WatchETHBridgeFinalized is a free log subscription operation binding the contract event 0x31b2166ff604fc5672ea5df08a78081d2bc6d746cadce880747f3643d819e83d. +// +// Solidity: event ETHBridgeFinalized(address indexed from, address indexed to, uint256 amount, bytes extraData) +func (_L1StandardBridge *L1StandardBridgeFilterer) WatchETHBridgeFinalized(opts *bind.WatchOpts, sink chan<- *L1StandardBridgeETHBridgeFinalized, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _L1StandardBridge.contract.WatchLogs(opts, "ETHBridgeFinalized", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(L1StandardBridgeETHBridgeFinalized) + if err := _L1StandardBridge.contract.UnpackLog(event, "ETHBridgeFinalized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseETHBridgeFinalized is a log parse operation binding the contract event 0x31b2166ff604fc5672ea5df08a78081d2bc6d746cadce880747f3643d819e83d. +// +// Solidity: event ETHBridgeFinalized(address indexed from, address indexed to, uint256 amount, bytes extraData) +func (_L1StandardBridge *L1StandardBridgeFilterer) ParseETHBridgeFinalized(log types.Log) (*L1StandardBridgeETHBridgeFinalized, error) { + event := new(L1StandardBridgeETHBridgeFinalized) + if err := _L1StandardBridge.contract.UnpackLog(event, "ETHBridgeFinalized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// L1StandardBridgeETHBridgeInitiatedIterator is returned from FilterETHBridgeInitiated and is used to iterate over the raw logs and unpacked data for ETHBridgeInitiated events raised by the L1StandardBridge contract. +type L1StandardBridgeETHBridgeInitiatedIterator struct { + Event *L1StandardBridgeETHBridgeInitiated // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *L1StandardBridgeETHBridgeInitiatedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(L1StandardBridgeETHBridgeInitiated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(L1StandardBridgeETHBridgeInitiated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *L1StandardBridgeETHBridgeInitiatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *L1StandardBridgeETHBridgeInitiatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// L1StandardBridgeETHBridgeInitiated represents a ETHBridgeInitiated event raised by the L1StandardBridge contract. +type L1StandardBridgeETHBridgeInitiated struct { + From common.Address + To common.Address + Amount *big.Int + ExtraData []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterETHBridgeInitiated is a free log retrieval operation binding the contract event 0x2849b43074093a05396b6f2a937dee8565b15a48a7b3d4bffb732a5017380af5. +// +// Solidity: event ETHBridgeInitiated(address indexed from, address indexed to, uint256 amount, bytes extraData) +func (_L1StandardBridge *L1StandardBridgeFilterer) FilterETHBridgeInitiated(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*L1StandardBridgeETHBridgeInitiatedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _L1StandardBridge.contract.FilterLogs(opts, "ETHBridgeInitiated", fromRule, toRule) + if err != nil { + return nil, err + } + return &L1StandardBridgeETHBridgeInitiatedIterator{contract: _L1StandardBridge.contract, event: "ETHBridgeInitiated", logs: logs, sub: sub}, nil +} + +// WatchETHBridgeInitiated is a free log subscription operation binding the contract event 0x2849b43074093a05396b6f2a937dee8565b15a48a7b3d4bffb732a5017380af5. +// +// Solidity: event ETHBridgeInitiated(address indexed from, address indexed to, uint256 amount, bytes extraData) +func (_L1StandardBridge *L1StandardBridgeFilterer) WatchETHBridgeInitiated(opts *bind.WatchOpts, sink chan<- *L1StandardBridgeETHBridgeInitiated, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _L1StandardBridge.contract.WatchLogs(opts, "ETHBridgeInitiated", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(L1StandardBridgeETHBridgeInitiated) + if err := _L1StandardBridge.contract.UnpackLog(event, "ETHBridgeInitiated", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseETHBridgeInitiated is a log parse operation binding the contract event 0x2849b43074093a05396b6f2a937dee8565b15a48a7b3d4bffb732a5017380af5. +// +// Solidity: event ETHBridgeInitiated(address indexed from, address indexed to, uint256 amount, bytes extraData) +func (_L1StandardBridge *L1StandardBridgeFilterer) ParseETHBridgeInitiated(log types.Log) (*L1StandardBridgeETHBridgeInitiated, error) { + event := new(L1StandardBridgeETHBridgeInitiated) + if err := _L1StandardBridge.contract.UnpackLog(event, "ETHBridgeInitiated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// L1StandardBridgeETHDepositInitiatedIterator is returned from FilterETHDepositInitiated and is used to iterate over the raw logs and unpacked data for ETHDepositInitiated events raised by the L1StandardBridge contract. +type L1StandardBridgeETHDepositInitiatedIterator struct { + Event *L1StandardBridgeETHDepositInitiated // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *L1StandardBridgeETHDepositInitiatedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(L1StandardBridgeETHDepositInitiated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(L1StandardBridgeETHDepositInitiated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *L1StandardBridgeETHDepositInitiatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *L1StandardBridgeETHDepositInitiatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// L1StandardBridgeETHDepositInitiated represents a ETHDepositInitiated event raised by the L1StandardBridge contract. +type L1StandardBridgeETHDepositInitiated struct { + From common.Address + To common.Address + Amount *big.Int + ExtraData []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterETHDepositInitiated is a free log retrieval operation binding the contract event 0x35d79ab81f2b2017e19afb5c5571778877782d7a8786f5907f93b0f4702f4f23. +// +// Solidity: event ETHDepositInitiated(address indexed from, address indexed to, uint256 amount, bytes extraData) +func (_L1StandardBridge *L1StandardBridgeFilterer) FilterETHDepositInitiated(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*L1StandardBridgeETHDepositInitiatedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _L1StandardBridge.contract.FilterLogs(opts, "ETHDepositInitiated", fromRule, toRule) + if err != nil { + return nil, err + } + return &L1StandardBridgeETHDepositInitiatedIterator{contract: _L1StandardBridge.contract, event: "ETHDepositInitiated", logs: logs, sub: sub}, nil +} + +// WatchETHDepositInitiated is a free log subscription operation binding the contract event 0x35d79ab81f2b2017e19afb5c5571778877782d7a8786f5907f93b0f4702f4f23. +// +// Solidity: event ETHDepositInitiated(address indexed from, address indexed to, uint256 amount, bytes extraData) +func (_L1StandardBridge *L1StandardBridgeFilterer) WatchETHDepositInitiated(opts *bind.WatchOpts, sink chan<- *L1StandardBridgeETHDepositInitiated, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _L1StandardBridge.contract.WatchLogs(opts, "ETHDepositInitiated", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(L1StandardBridgeETHDepositInitiated) + if err := _L1StandardBridge.contract.UnpackLog(event, "ETHDepositInitiated", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseETHDepositInitiated is a log parse operation binding the contract event 0x35d79ab81f2b2017e19afb5c5571778877782d7a8786f5907f93b0f4702f4f23. +// +// Solidity: event ETHDepositInitiated(address indexed from, address indexed to, uint256 amount, bytes extraData) +func (_L1StandardBridge *L1StandardBridgeFilterer) ParseETHDepositInitiated(log types.Log) (*L1StandardBridgeETHDepositInitiated, error) { + event := new(L1StandardBridgeETHDepositInitiated) + if err := _L1StandardBridge.contract.UnpackLog(event, "ETHDepositInitiated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// L1StandardBridgeETHWithdrawalFinalizedIterator is returned from FilterETHWithdrawalFinalized and is used to iterate over the raw logs and unpacked data for ETHWithdrawalFinalized events raised by the L1StandardBridge contract. +type L1StandardBridgeETHWithdrawalFinalizedIterator struct { + Event *L1StandardBridgeETHWithdrawalFinalized // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *L1StandardBridgeETHWithdrawalFinalizedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(L1StandardBridgeETHWithdrawalFinalized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(L1StandardBridgeETHWithdrawalFinalized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *L1StandardBridgeETHWithdrawalFinalizedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *L1StandardBridgeETHWithdrawalFinalizedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// L1StandardBridgeETHWithdrawalFinalized represents a ETHWithdrawalFinalized event raised by the L1StandardBridge contract. +type L1StandardBridgeETHWithdrawalFinalized struct { + From common.Address + To common.Address + Amount *big.Int + ExtraData []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterETHWithdrawalFinalized is a free log retrieval operation binding the contract event 0x2ac69ee804d9a7a0984249f508dfab7cb2534b465b6ce1580f99a38ba9c5e631. +// +// Solidity: event ETHWithdrawalFinalized(address indexed from, address indexed to, uint256 amount, bytes extraData) +func (_L1StandardBridge *L1StandardBridgeFilterer) FilterETHWithdrawalFinalized(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*L1StandardBridgeETHWithdrawalFinalizedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _L1StandardBridge.contract.FilterLogs(opts, "ETHWithdrawalFinalized", fromRule, toRule) + if err != nil { + return nil, err + } + return &L1StandardBridgeETHWithdrawalFinalizedIterator{contract: _L1StandardBridge.contract, event: "ETHWithdrawalFinalized", logs: logs, sub: sub}, nil +} + +// WatchETHWithdrawalFinalized is a free log subscription operation binding the contract event 0x2ac69ee804d9a7a0984249f508dfab7cb2534b465b6ce1580f99a38ba9c5e631. +// +// Solidity: event ETHWithdrawalFinalized(address indexed from, address indexed to, uint256 amount, bytes extraData) +func (_L1StandardBridge *L1StandardBridgeFilterer) WatchETHWithdrawalFinalized(opts *bind.WatchOpts, sink chan<- *L1StandardBridgeETHWithdrawalFinalized, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _L1StandardBridge.contract.WatchLogs(opts, "ETHWithdrawalFinalized", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(L1StandardBridgeETHWithdrawalFinalized) + if err := _L1StandardBridge.contract.UnpackLog(event, "ETHWithdrawalFinalized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseETHWithdrawalFinalized is a log parse operation binding the contract event 0x2ac69ee804d9a7a0984249f508dfab7cb2534b465b6ce1580f99a38ba9c5e631. +// +// Solidity: event ETHWithdrawalFinalized(address indexed from, address indexed to, uint256 amount, bytes extraData) +func (_L1StandardBridge *L1StandardBridgeFilterer) ParseETHWithdrawalFinalized(log types.Log) (*L1StandardBridgeETHWithdrawalFinalized, error) { + event := new(L1StandardBridgeETHWithdrawalFinalized) + if err := _L1StandardBridge.contract.UnpackLog(event, "ETHWithdrawalFinalized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// L1StandardBridgeInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the L1StandardBridge contract. +type L1StandardBridgeInitializedIterator struct { + Event *L1StandardBridgeInitialized // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *L1StandardBridgeInitializedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(L1StandardBridgeInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(L1StandardBridgeInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *L1StandardBridgeInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *L1StandardBridgeInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// L1StandardBridgeInitialized represents a Initialized event raised by the L1StandardBridge contract. +type L1StandardBridgeInitialized struct { + Version uint8 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_L1StandardBridge *L1StandardBridgeFilterer) FilterInitialized(opts *bind.FilterOpts) (*L1StandardBridgeInitializedIterator, error) { + + logs, sub, err := _L1StandardBridge.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &L1StandardBridgeInitializedIterator{contract: _L1StandardBridge.contract, event: "Initialized", logs: logs, sub: sub}, nil +} + +// WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_L1StandardBridge *L1StandardBridgeFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *L1StandardBridgeInitialized) (event.Subscription, error) { + + logs, sub, err := _L1StandardBridge.contract.WatchLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(L1StandardBridgeInitialized) + if err := _L1StandardBridge.contract.UnpackLog(event, "Initialized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_L1StandardBridge *L1StandardBridgeFilterer) ParseInitialized(log types.Log) (*L1StandardBridgeInitialized, error) { + event := new(L1StandardBridgeInitialized) + if err := _L1StandardBridge.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/op-e2e2/bindings/l2crossdomainmessenger.go b/op-e2e2/bindings/l2crossdomainmessenger.go new file mode 100644 index 000000000000..f907dc053af6 --- /dev/null +++ b/op-e2e2/bindings/l2crossdomainmessenger.go @@ -0,0 +1,1538 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// L2CrossDomainMessengerMetaData contains all meta data concerning the L2CrossDomainMessenger contract. +var L2CrossDomainMessengerMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"MESSAGE_VERSION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MIN_GAS_CALLDATA_OVERHEAD\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MIN_GAS_DYNAMIC_OVERHEAD_DENOMINATOR\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MIN_GAS_DYNAMIC_OVERHEAD_NUMERATOR\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"OTHER_MESSENGER\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractCrossDomainMessenger\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"RELAY_CALL_OVERHEAD\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"RELAY_CONSTANT_OVERHEAD\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"RELAY_GAS_CHECK_BUFFER\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"RELAY_RESERVED_GAS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"baseGas\",\"inputs\":[{\"name\":\"_message\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"_minGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"failedMessages\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_l1CrossDomainMessenger\",\"type\":\"address\",\"internalType\":\"contractCrossDomainMessenger\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"l1CrossDomainMessenger\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractCrossDomainMessenger\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"messageNonce\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"otherMessenger\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractCrossDomainMessenger\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"paused\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"relayMessage\",\"inputs\":[{\"name\":\"_nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_sender\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_target\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_value\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_minGasLimit\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_message\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"sendMessage\",\"inputs\":[{\"name\":\"_target\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_message\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"_minGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"successfulMessages\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"xDomainMessageSender\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"FailedRelayedMessage\",\"inputs\":[{\"name\":\"msgHash\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RelayedMessage\",\"inputs\":[{\"name\":\"msgHash\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"SentMessage\",\"inputs\":[{\"name\":\"target\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"sender\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"message\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"},{\"name\":\"messageNonce\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"gasLimit\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"SentMessageExtension1\",\"inputs\":[{\"name\":\"sender\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false}]", + Bin: "0x60806040523480156200001157600080fd5b506200001e600062000024565b62000239565b600054600160a81b900460ff16158080156200004d57506000546001600160a01b90910460ff16105b806200008457506200006a306200017360201b620013a21760201c565b158015620000845750600054600160a01b900460ff166001145b620000ed5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff60a01b1916600160a01b17905580156200011b576000805460ff60a81b1916600160a81b1790555b620001268262000182565b80156200016f576000805460ff60a81b19169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050565b6001600160a01b03163b151590565b600054600160a81b900460ff16620001f15760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401620000e4565b60cc546001600160a01b0316620002175760cc80546001600160a01b03191661dead1790555b60cf80546001600160a01b0319166001600160a01b0392909216919091179055565b611e2a80620002496000396000f3fe60806040526004361061016a5760003560e01c806383a74074116100cb578063b1b1b2091161007f578063d764ad0b11610059578063d764ad0b146103c7578063db505d80146103da578063ecc704281461040757600080fd5b8063b1b1b20914610357578063b28ade2514610387578063c4d66de8146103a757600080fd5b80639fce812c116100b05780639fce812c146102fc578063a4e7f8bd14610327578063a7119869146102fc57600080fd5b806383a74074146102e55780638cbeeef21461020957600080fd5b80634c1d6a69116101225780635644cfdf116101075780635644cfdf146102755780635c975abb1461028b5780636e296e45146102ab57600080fd5b80634c1d6a691461020957806354fd4d501461021f57600080fd5b80632828d7e8116101535780632828d7e8146101b75780633dbb202b146101cc5780633f827a5a146101e157600080fd5b8063028f85f71461016f5780630c568498146101a2575b600080fd5b34801561017b57600080fd5b50610184601081565b60405167ffffffffffffffff90911681526020015b60405180910390f35b3480156101ae57600080fd5b50610184603f81565b3480156101c357600080fd5b50610184604081565b6101df6101da3660046118e3565b61046c565b005b3480156101ed57600080fd5b506101f6600181565b60405161ffff9091168152602001610199565b34801561021557600080fd5b50610184619c4081565b34801561022b57600080fd5b506102686040518060400160405280601b81526020017f322e312e302d626574612b637573746f6d2d6761732d746f6b656e000000000081525081565b60405161019991906119b5565b34801561028157600080fd5b5061018461138881565b34801561029757600080fd5b5060005b6040519015158152602001610199565b3480156102b757600080fd5b506102c0610769565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610199565b3480156102f157600080fd5b5061018462030d4081565b34801561030857600080fd5b5060cf5473ffffffffffffffffffffffffffffffffffffffff166102c0565b34801561033357600080fd5b5061029b6103423660046119cf565b60ce6020526000908152604090205460ff1681565b34801561036357600080fd5b5061029b6103723660046119cf565b60cb6020526000908152604090205460ff1681565b34801561039357600080fd5b506101846103a23660046119e8565b610850565b3480156103b357600080fd5b506101df6103c2366004611a3c565b6108be565b6101df6103d5366004611a59565b610abd565b3480156103e657600080fd5b5060cf546102c09073ffffffffffffffffffffffffffffffffffffffff1681565b34801561041357600080fd5b5061045e60cd547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e010000000000000000000000000000000000000000000000000000000000001790565b604051908152602001610199565b6104746113be565b1561050c57341561050c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603d60248201527f43726f7373446f6d61696e4d657373656e6765723a2063616e6e6f742073656e60448201527f642076616c7565207769746820637573746f6d2067617320746f6b656e00000060648201526084015b60405180910390fd5b60cf5461063e9073ffffffffffffffffffffffffffffffffffffffff16610534858585610850565b347fd764ad0b000000000000000000000000000000000000000000000000000000006105a060cd547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e010000000000000000000000000000000000000000000000000000000000001790565b338a34898c8c6040516024016105bc9796959493929190611b28565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526113fd565b8373ffffffffffffffffffffffffffffffffffffffff167fcb0f7ffd78f9aee47a248fae8db181db6eee833039123e026dcbff529522e52a3385856106c360cd547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e010000000000000000000000000000000000000000000000000000000000001790565b866040516106d5959493929190611b87565b60405180910390a260405134815233907f8ebb2ec2465bdb2a06a66fc37a0963af8a2a6a1479d81d56fdb8cbb98096d5469060200160405180910390a2505060cd80547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff808216600101167fffff0000000000000000000000000000000000000000000000000000000000009091161790555050565b60cc5460009073ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff215301610833576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603560248201527f43726f7373446f6d61696e4d657373656e6765723a2078446f6d61696e4d657360448201527f7361676553656e646572206973206e6f742073657400000000000000000000006064820152608401610503565b5060cc5473ffffffffffffffffffffffffffffffffffffffff1690565b6000611388619c4080603f61086c604063ffffffff8816611c04565b6108769190611c34565b610881601088611c04565b61088e9062030d40611c82565b6108989190611c82565b6108a29190611c82565b6108ac9190611c82565b6108b69190611c82565b949350505050565b6000547501000000000000000000000000000000000000000000900460ff1615808015610909575060005460017401000000000000000000000000000000000000000090910460ff16105b8061093b5750303b15801561093b575060005474010000000000000000000000000000000000000000900460ff166001145b6109c7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610503565b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000001790558015610a4d57600080547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff1675010000000000000000000000000000000000000000001790555b610a568261148b565b8015610ab957600080547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050565b60f087901c60028110610b78576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604d60248201527f43726f7373446f6d61696e4d657373656e6765723a206f6e6c7920766572736960448201527f6f6e2030206f722031206d657373616765732061726520737570706f7274656460648201527f20617420746869732074696d6500000000000000000000000000000000000000608482015260a401610503565b8061ffff16600003610c6d576000610bc9878986868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508f92506115c7915050565b600081815260cb602052604090205490915060ff1615610c6b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f43726f7373446f6d61696e4d657373656e6765723a206c65676163792077697460448201527f6864726177616c20616c72656164792072656c617965640000000000000000006064820152608401610503565b505b6000610cb3898989898989898080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506115e692505050565b9050610cfc60cf54337fffffffffffffffffffffffffeeeeffffffffffffffffffffffffffffffffeeef0173ffffffffffffffffffffffffffffffffffffffff90811691161490565b15610d3457853414610d1057610d10611cae565b600081815260ce602052604090205460ff1615610d2f57610d2f611cae565b610e86565b3415610de8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152605060248201527f43726f7373446f6d61696e4d657373656e6765723a2076616c7565206d75737460448201527f206265207a65726f20756e6c657373206d6573736167652069732066726f6d2060648201527f612073797374656d206164647265737300000000000000000000000000000000608482015260a401610503565b600081815260ce602052604090205460ff16610e86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f43726f7373446f6d61696e4d657373656e6765723a206d65737361676520636160448201527f6e6e6f74206265207265706c61796564000000000000000000000000000000006064820152608401610503565b610e8f87611609565b15610f42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604360248201527f43726f7373446f6d61696e4d657373656e6765723a2063616e6e6f742073656e60448201527f64206d65737361676520746f20626c6f636b65642073797374656d206164647260648201527f6573730000000000000000000000000000000000000000000000000000000000608482015260a401610503565b600081815260cb602052604090205460ff1615610fe1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f43726f7373446f6d61696e4d657373656e6765723a206d65737361676520686160448201527f7320616c7265616479206265656e2072656c61796564000000000000000000006064820152608401610503565b61100285610ff3611388619c40611c82565b67ffffffffffffffff1661165e565b1580611028575060cc5473ffffffffffffffffffffffffffffffffffffffff1661dead14155b1561114157600081815260ce602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555182917f99d0e048484baa1b1540b1367cb128acd7ab2946d1ed91ec10e3c85e4bf51b8f91a27fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff320161113a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f43726f7373446f6d61696e4d657373656e6765723a206661696c656420746f2060448201527f72656c6179206d657373616765000000000000000000000000000000000000006064820152608401610503565b5050611399565b60cc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8a1617905560006111d288619c405a6111959190611cdd565b8988888080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061167c92505050565b60cc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001661dead1790559050801561128857600082815260cb602052604090205460ff161561122557611225611cae565b600082815260cb602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555183917f4641df4a962071e12719d8c8c8e5ac7fc4d97b927346a3d7a335b1f7517e133c91a2611395565b600082815260ce602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555183917f99d0e048484baa1b1540b1367cb128acd7ab2946d1ed91ec10e3c85e4bf51b8f91a27fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff3201611395576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f43726f7373446f6d61696e4d657373656e6765723a206661696c656420746f2060448201527f72656c6179206d657373616765000000000000000000000000000000000000006064820152608401610503565b5050505b50505050505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b6000806113c9611696565b5073ffffffffffffffffffffffffffffffffffffffff1673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee141592915050565b6040517fc2b3e5ac0000000000000000000000000000000000000000000000000000000081527342000000000000000000000000000000000000169063c2b3e5ac90849061145390889088908790600401611cf4565b6000604051808303818588803b15801561146c57600080fd5b505af1158015611480573d6000803e3d6000fd5b505050505050505050565b6000547501000000000000000000000000000000000000000000900460ff16611536576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610503565b60cc5473ffffffffffffffffffffffffffffffffffffffff166115805760cc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001661dead1790555b60cf80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60006115d585858585611724565b805190602001209050949350505050565b60006115f68787878787876117bd565b8051906020012090509695505050505050565b600073ffffffffffffffffffffffffffffffffffffffff8216301480611658575073ffffffffffffffffffffffffffffffffffffffff8216734200000000000000000000000000000000000016145b92915050565b600080603f83619c4001026040850201603f5a021015949350505050565b600080600080845160208601878a8af19695505050505050565b60008073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16634397dfef6040518163ffffffff1660e01b81526004016040805180830381865afa1580156116f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061171b9190611d3c565b90939092509050565b60608484848460405160240161173d9493929190611d7c565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fcbd4ece9000000000000000000000000000000000000000000000000000000001790529050949350505050565b60608686868686866040516024016117da96959493929190611dc6565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fd764ad0b0000000000000000000000000000000000000000000000000000000017905290509695505050505050565b73ffffffffffffffffffffffffffffffffffffffff8116811461187e57600080fd5b50565b60008083601f84011261189357600080fd5b50813567ffffffffffffffff8111156118ab57600080fd5b6020830191508360208285010111156118c357600080fd5b9250929050565b803563ffffffff811681146118de57600080fd5b919050565b600080600080606085870312156118f957600080fd5b84356119048161185c565b9350602085013567ffffffffffffffff81111561192057600080fd5b61192c87828801611881565b909450925061193f9050604086016118ca565b905092959194509250565b6000815180845260005b8181101561197057602081850181015186830182015201611954565b81811115611982576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006119c8602083018461194a565b9392505050565b6000602082840312156119e157600080fd5b5035919050565b6000806000604084860312156119fd57600080fd5b833567ffffffffffffffff811115611a1457600080fd5b611a2086828701611881565b9094509250611a339050602085016118ca565b90509250925092565b600060208284031215611a4e57600080fd5b81356119c88161185c565b600080600080600080600060c0888a031215611a7457600080fd5b873596506020880135611a868161185c565b95506040880135611a968161185c565b9450606088013593506080880135925060a088013567ffffffffffffffff811115611ac057600080fd5b611acc8a828b01611881565b989b979a50959850939692959293505050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b878152600073ffffffffffffffffffffffffffffffffffffffff808916602084015280881660408401525085606083015263ffffffff8516608083015260c060a0830152611b7a60c083018486611adf565b9998505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff86168152608060208201526000611bb7608083018688611adf565b905083604083015263ffffffff831660608301529695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600067ffffffffffffffff80831681851681830481118215151615611c2b57611c2b611bd5565b02949350505050565b600067ffffffffffffffff80841680611c76577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b92169190910492915050565b600067ffffffffffffffff808316818516808303821115611ca557611ca5611bd5565b01949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b600082821015611cef57611cef611bd5565b500390565b73ffffffffffffffffffffffffffffffffffffffff8416815267ffffffffffffffff83166020820152606060408201526000611d33606083018461194a565b95945050505050565b60008060408385031215611d4f57600080fd5b8251611d5a8161185c565b602084015190925060ff81168114611d7157600080fd5b809150509250929050565b600073ffffffffffffffffffffffffffffffffffffffff808716835280861660208401525060806040830152611db5608083018561194a565b905082606083015295945050505050565b868152600073ffffffffffffffffffffffffffffffffffffffff808816602084015280871660408401525084606083015283608083015260c060a0830152611e1160c083018461194a565b9897505050505050505056fea164736f6c634300080f000a", +} + +// L2CrossDomainMessengerABI is the input ABI used to generate the binding from. +// Deprecated: Use L2CrossDomainMessengerMetaData.ABI instead. +var L2CrossDomainMessengerABI = L2CrossDomainMessengerMetaData.ABI + +// L2CrossDomainMessengerBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use L2CrossDomainMessengerMetaData.Bin instead. +var L2CrossDomainMessengerBin = L2CrossDomainMessengerMetaData.Bin + +// DeployL2CrossDomainMessenger deploys a new Ethereum contract, binding an instance of L2CrossDomainMessenger to it. +func DeployL2CrossDomainMessenger(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *L2CrossDomainMessenger, error) { + parsed, err := L2CrossDomainMessengerMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(L2CrossDomainMessengerBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &L2CrossDomainMessenger{L2CrossDomainMessengerCaller: L2CrossDomainMessengerCaller{contract: contract}, L2CrossDomainMessengerTransactor: L2CrossDomainMessengerTransactor{contract: contract}, L2CrossDomainMessengerFilterer: L2CrossDomainMessengerFilterer{contract: contract}}, nil +} + +// L2CrossDomainMessenger is an auto generated Go binding around an Ethereum contract. +type L2CrossDomainMessenger struct { + L2CrossDomainMessengerCaller // Read-only binding to the contract + L2CrossDomainMessengerTransactor // Write-only binding to the contract + L2CrossDomainMessengerFilterer // Log filterer for contract events +} + +// L2CrossDomainMessengerCaller is an auto generated read-only Go binding around an Ethereum contract. +type L2CrossDomainMessengerCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// L2CrossDomainMessengerTransactor is an auto generated write-only Go binding around an Ethereum contract. +type L2CrossDomainMessengerTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// L2CrossDomainMessengerFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type L2CrossDomainMessengerFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// L2CrossDomainMessengerSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type L2CrossDomainMessengerSession struct { + Contract *L2CrossDomainMessenger // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// L2CrossDomainMessengerCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type L2CrossDomainMessengerCallerSession struct { + Contract *L2CrossDomainMessengerCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// L2CrossDomainMessengerTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type L2CrossDomainMessengerTransactorSession struct { + Contract *L2CrossDomainMessengerTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// L2CrossDomainMessengerRaw is an auto generated low-level Go binding around an Ethereum contract. +type L2CrossDomainMessengerRaw struct { + Contract *L2CrossDomainMessenger // Generic contract binding to access the raw methods on +} + +// L2CrossDomainMessengerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type L2CrossDomainMessengerCallerRaw struct { + Contract *L2CrossDomainMessengerCaller // Generic read-only contract binding to access the raw methods on +} + +// L2CrossDomainMessengerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type L2CrossDomainMessengerTransactorRaw struct { + Contract *L2CrossDomainMessengerTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewL2CrossDomainMessenger creates a new instance of L2CrossDomainMessenger, bound to a specific deployed contract. +func NewL2CrossDomainMessenger(address common.Address, backend bind.ContractBackend) (*L2CrossDomainMessenger, error) { + contract, err := bindL2CrossDomainMessenger(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &L2CrossDomainMessenger{L2CrossDomainMessengerCaller: L2CrossDomainMessengerCaller{contract: contract}, L2CrossDomainMessengerTransactor: L2CrossDomainMessengerTransactor{contract: contract}, L2CrossDomainMessengerFilterer: L2CrossDomainMessengerFilterer{contract: contract}}, nil +} + +// NewL2CrossDomainMessengerCaller creates a new read-only instance of L2CrossDomainMessenger, bound to a specific deployed contract. +func NewL2CrossDomainMessengerCaller(address common.Address, caller bind.ContractCaller) (*L2CrossDomainMessengerCaller, error) { + contract, err := bindL2CrossDomainMessenger(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &L2CrossDomainMessengerCaller{contract: contract}, nil +} + +// NewL2CrossDomainMessengerTransactor creates a new write-only instance of L2CrossDomainMessenger, bound to a specific deployed contract. +func NewL2CrossDomainMessengerTransactor(address common.Address, transactor bind.ContractTransactor) (*L2CrossDomainMessengerTransactor, error) { + contract, err := bindL2CrossDomainMessenger(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &L2CrossDomainMessengerTransactor{contract: contract}, nil +} + +// NewL2CrossDomainMessengerFilterer creates a new log filterer instance of L2CrossDomainMessenger, bound to a specific deployed contract. +func NewL2CrossDomainMessengerFilterer(address common.Address, filterer bind.ContractFilterer) (*L2CrossDomainMessengerFilterer, error) { + contract, err := bindL2CrossDomainMessenger(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &L2CrossDomainMessengerFilterer{contract: contract}, nil +} + +// bindL2CrossDomainMessenger binds a generic wrapper to an already deployed contract. +func bindL2CrossDomainMessenger(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(L2CrossDomainMessengerABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_L2CrossDomainMessenger *L2CrossDomainMessengerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _L2CrossDomainMessenger.Contract.L2CrossDomainMessengerCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_L2CrossDomainMessenger *L2CrossDomainMessengerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _L2CrossDomainMessenger.Contract.L2CrossDomainMessengerTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_L2CrossDomainMessenger *L2CrossDomainMessengerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _L2CrossDomainMessenger.Contract.L2CrossDomainMessengerTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_L2CrossDomainMessenger *L2CrossDomainMessengerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _L2CrossDomainMessenger.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_L2CrossDomainMessenger *L2CrossDomainMessengerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _L2CrossDomainMessenger.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_L2CrossDomainMessenger *L2CrossDomainMessengerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _L2CrossDomainMessenger.Contract.contract.Transact(opts, method, params...) +} + +// MESSAGEVERSION is a free data retrieval call binding the contract method 0x3f827a5a. +// +// Solidity: function MESSAGE_VERSION() view returns(uint16) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerCaller) MESSAGEVERSION(opts *bind.CallOpts) (uint16, error) { + var out []interface{} + err := _L2CrossDomainMessenger.contract.Call(opts, &out, "MESSAGE_VERSION") + + if err != nil { + return *new(uint16), err + } + + out0 := *abi.ConvertType(out[0], new(uint16)).(*uint16) + + return out0, err + +} + +// MESSAGEVERSION is a free data retrieval call binding the contract method 0x3f827a5a. +// +// Solidity: function MESSAGE_VERSION() view returns(uint16) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerSession) MESSAGEVERSION() (uint16, error) { + return _L2CrossDomainMessenger.Contract.MESSAGEVERSION(&_L2CrossDomainMessenger.CallOpts) +} + +// MESSAGEVERSION is a free data retrieval call binding the contract method 0x3f827a5a. +// +// Solidity: function MESSAGE_VERSION() view returns(uint16) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerCallerSession) MESSAGEVERSION() (uint16, error) { + return _L2CrossDomainMessenger.Contract.MESSAGEVERSION(&_L2CrossDomainMessenger.CallOpts) +} + +// MINGASCALLDATAOVERHEAD is a free data retrieval call binding the contract method 0x028f85f7. +// +// Solidity: function MIN_GAS_CALLDATA_OVERHEAD() view returns(uint64) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerCaller) MINGASCALLDATAOVERHEAD(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _L2CrossDomainMessenger.contract.Call(opts, &out, "MIN_GAS_CALLDATA_OVERHEAD") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// MINGASCALLDATAOVERHEAD is a free data retrieval call binding the contract method 0x028f85f7. +// +// Solidity: function MIN_GAS_CALLDATA_OVERHEAD() view returns(uint64) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerSession) MINGASCALLDATAOVERHEAD() (uint64, error) { + return _L2CrossDomainMessenger.Contract.MINGASCALLDATAOVERHEAD(&_L2CrossDomainMessenger.CallOpts) +} + +// MINGASCALLDATAOVERHEAD is a free data retrieval call binding the contract method 0x028f85f7. +// +// Solidity: function MIN_GAS_CALLDATA_OVERHEAD() view returns(uint64) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerCallerSession) MINGASCALLDATAOVERHEAD() (uint64, error) { + return _L2CrossDomainMessenger.Contract.MINGASCALLDATAOVERHEAD(&_L2CrossDomainMessenger.CallOpts) +} + +// MINGASDYNAMICOVERHEADDENOMINATOR is a free data retrieval call binding the contract method 0x0c568498. +// +// Solidity: function MIN_GAS_DYNAMIC_OVERHEAD_DENOMINATOR() view returns(uint64) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerCaller) MINGASDYNAMICOVERHEADDENOMINATOR(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _L2CrossDomainMessenger.contract.Call(opts, &out, "MIN_GAS_DYNAMIC_OVERHEAD_DENOMINATOR") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// MINGASDYNAMICOVERHEADDENOMINATOR is a free data retrieval call binding the contract method 0x0c568498. +// +// Solidity: function MIN_GAS_DYNAMIC_OVERHEAD_DENOMINATOR() view returns(uint64) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerSession) MINGASDYNAMICOVERHEADDENOMINATOR() (uint64, error) { + return _L2CrossDomainMessenger.Contract.MINGASDYNAMICOVERHEADDENOMINATOR(&_L2CrossDomainMessenger.CallOpts) +} + +// MINGASDYNAMICOVERHEADDENOMINATOR is a free data retrieval call binding the contract method 0x0c568498. +// +// Solidity: function MIN_GAS_DYNAMIC_OVERHEAD_DENOMINATOR() view returns(uint64) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerCallerSession) MINGASDYNAMICOVERHEADDENOMINATOR() (uint64, error) { + return _L2CrossDomainMessenger.Contract.MINGASDYNAMICOVERHEADDENOMINATOR(&_L2CrossDomainMessenger.CallOpts) +} + +// MINGASDYNAMICOVERHEADNUMERATOR is a free data retrieval call binding the contract method 0x2828d7e8. +// +// Solidity: function MIN_GAS_DYNAMIC_OVERHEAD_NUMERATOR() view returns(uint64) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerCaller) MINGASDYNAMICOVERHEADNUMERATOR(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _L2CrossDomainMessenger.contract.Call(opts, &out, "MIN_GAS_DYNAMIC_OVERHEAD_NUMERATOR") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// MINGASDYNAMICOVERHEADNUMERATOR is a free data retrieval call binding the contract method 0x2828d7e8. +// +// Solidity: function MIN_GAS_DYNAMIC_OVERHEAD_NUMERATOR() view returns(uint64) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerSession) MINGASDYNAMICOVERHEADNUMERATOR() (uint64, error) { + return _L2CrossDomainMessenger.Contract.MINGASDYNAMICOVERHEADNUMERATOR(&_L2CrossDomainMessenger.CallOpts) +} + +// MINGASDYNAMICOVERHEADNUMERATOR is a free data retrieval call binding the contract method 0x2828d7e8. +// +// Solidity: function MIN_GAS_DYNAMIC_OVERHEAD_NUMERATOR() view returns(uint64) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerCallerSession) MINGASDYNAMICOVERHEADNUMERATOR() (uint64, error) { + return _L2CrossDomainMessenger.Contract.MINGASDYNAMICOVERHEADNUMERATOR(&_L2CrossDomainMessenger.CallOpts) +} + +// OTHERMESSENGER is a free data retrieval call binding the contract method 0x9fce812c. +// +// Solidity: function OTHER_MESSENGER() view returns(address) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerCaller) OTHERMESSENGER(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _L2CrossDomainMessenger.contract.Call(opts, &out, "OTHER_MESSENGER") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// OTHERMESSENGER is a free data retrieval call binding the contract method 0x9fce812c. +// +// Solidity: function OTHER_MESSENGER() view returns(address) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerSession) OTHERMESSENGER() (common.Address, error) { + return _L2CrossDomainMessenger.Contract.OTHERMESSENGER(&_L2CrossDomainMessenger.CallOpts) +} + +// OTHERMESSENGER is a free data retrieval call binding the contract method 0x9fce812c. +// +// Solidity: function OTHER_MESSENGER() view returns(address) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerCallerSession) OTHERMESSENGER() (common.Address, error) { + return _L2CrossDomainMessenger.Contract.OTHERMESSENGER(&_L2CrossDomainMessenger.CallOpts) +} + +// RELAYCALLOVERHEAD is a free data retrieval call binding the contract method 0x4c1d6a69. +// +// Solidity: function RELAY_CALL_OVERHEAD() view returns(uint64) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerCaller) RELAYCALLOVERHEAD(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _L2CrossDomainMessenger.contract.Call(opts, &out, "RELAY_CALL_OVERHEAD") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// RELAYCALLOVERHEAD is a free data retrieval call binding the contract method 0x4c1d6a69. +// +// Solidity: function RELAY_CALL_OVERHEAD() view returns(uint64) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerSession) RELAYCALLOVERHEAD() (uint64, error) { + return _L2CrossDomainMessenger.Contract.RELAYCALLOVERHEAD(&_L2CrossDomainMessenger.CallOpts) +} + +// RELAYCALLOVERHEAD is a free data retrieval call binding the contract method 0x4c1d6a69. +// +// Solidity: function RELAY_CALL_OVERHEAD() view returns(uint64) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerCallerSession) RELAYCALLOVERHEAD() (uint64, error) { + return _L2CrossDomainMessenger.Contract.RELAYCALLOVERHEAD(&_L2CrossDomainMessenger.CallOpts) +} + +// RELAYCONSTANTOVERHEAD is a free data retrieval call binding the contract method 0x83a74074. +// +// Solidity: function RELAY_CONSTANT_OVERHEAD() view returns(uint64) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerCaller) RELAYCONSTANTOVERHEAD(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _L2CrossDomainMessenger.contract.Call(opts, &out, "RELAY_CONSTANT_OVERHEAD") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// RELAYCONSTANTOVERHEAD is a free data retrieval call binding the contract method 0x83a74074. +// +// Solidity: function RELAY_CONSTANT_OVERHEAD() view returns(uint64) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerSession) RELAYCONSTANTOVERHEAD() (uint64, error) { + return _L2CrossDomainMessenger.Contract.RELAYCONSTANTOVERHEAD(&_L2CrossDomainMessenger.CallOpts) +} + +// RELAYCONSTANTOVERHEAD is a free data retrieval call binding the contract method 0x83a74074. +// +// Solidity: function RELAY_CONSTANT_OVERHEAD() view returns(uint64) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerCallerSession) RELAYCONSTANTOVERHEAD() (uint64, error) { + return _L2CrossDomainMessenger.Contract.RELAYCONSTANTOVERHEAD(&_L2CrossDomainMessenger.CallOpts) +} + +// RELAYGASCHECKBUFFER is a free data retrieval call binding the contract method 0x5644cfdf. +// +// Solidity: function RELAY_GAS_CHECK_BUFFER() view returns(uint64) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerCaller) RELAYGASCHECKBUFFER(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _L2CrossDomainMessenger.contract.Call(opts, &out, "RELAY_GAS_CHECK_BUFFER") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// RELAYGASCHECKBUFFER is a free data retrieval call binding the contract method 0x5644cfdf. +// +// Solidity: function RELAY_GAS_CHECK_BUFFER() view returns(uint64) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerSession) RELAYGASCHECKBUFFER() (uint64, error) { + return _L2CrossDomainMessenger.Contract.RELAYGASCHECKBUFFER(&_L2CrossDomainMessenger.CallOpts) +} + +// RELAYGASCHECKBUFFER is a free data retrieval call binding the contract method 0x5644cfdf. +// +// Solidity: function RELAY_GAS_CHECK_BUFFER() view returns(uint64) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerCallerSession) RELAYGASCHECKBUFFER() (uint64, error) { + return _L2CrossDomainMessenger.Contract.RELAYGASCHECKBUFFER(&_L2CrossDomainMessenger.CallOpts) +} + +// RELAYRESERVEDGAS is a free data retrieval call binding the contract method 0x8cbeeef2. +// +// Solidity: function RELAY_RESERVED_GAS() view returns(uint64) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerCaller) RELAYRESERVEDGAS(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _L2CrossDomainMessenger.contract.Call(opts, &out, "RELAY_RESERVED_GAS") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// RELAYRESERVEDGAS is a free data retrieval call binding the contract method 0x8cbeeef2. +// +// Solidity: function RELAY_RESERVED_GAS() view returns(uint64) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerSession) RELAYRESERVEDGAS() (uint64, error) { + return _L2CrossDomainMessenger.Contract.RELAYRESERVEDGAS(&_L2CrossDomainMessenger.CallOpts) +} + +// RELAYRESERVEDGAS is a free data retrieval call binding the contract method 0x8cbeeef2. +// +// Solidity: function RELAY_RESERVED_GAS() view returns(uint64) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerCallerSession) RELAYRESERVEDGAS() (uint64, error) { + return _L2CrossDomainMessenger.Contract.RELAYRESERVEDGAS(&_L2CrossDomainMessenger.CallOpts) +} + +// BaseGas is a free data retrieval call binding the contract method 0xb28ade25. +// +// Solidity: function baseGas(bytes _message, uint32 _minGasLimit) pure returns(uint64) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerCaller) BaseGas(opts *bind.CallOpts, _message []byte, _minGasLimit uint32) (uint64, error) { + var out []interface{} + err := _L2CrossDomainMessenger.contract.Call(opts, &out, "baseGas", _message, _minGasLimit) + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// BaseGas is a free data retrieval call binding the contract method 0xb28ade25. +// +// Solidity: function baseGas(bytes _message, uint32 _minGasLimit) pure returns(uint64) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerSession) BaseGas(_message []byte, _minGasLimit uint32) (uint64, error) { + return _L2CrossDomainMessenger.Contract.BaseGas(&_L2CrossDomainMessenger.CallOpts, _message, _minGasLimit) +} + +// BaseGas is a free data retrieval call binding the contract method 0xb28ade25. +// +// Solidity: function baseGas(bytes _message, uint32 _minGasLimit) pure returns(uint64) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerCallerSession) BaseGas(_message []byte, _minGasLimit uint32) (uint64, error) { + return _L2CrossDomainMessenger.Contract.BaseGas(&_L2CrossDomainMessenger.CallOpts, _message, _minGasLimit) +} + +// FailedMessages is a free data retrieval call binding the contract method 0xa4e7f8bd. +// +// Solidity: function failedMessages(bytes32 ) view returns(bool) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerCaller) FailedMessages(opts *bind.CallOpts, arg0 [32]byte) (bool, error) { + var out []interface{} + err := _L2CrossDomainMessenger.contract.Call(opts, &out, "failedMessages", arg0) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// FailedMessages is a free data retrieval call binding the contract method 0xa4e7f8bd. +// +// Solidity: function failedMessages(bytes32 ) view returns(bool) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerSession) FailedMessages(arg0 [32]byte) (bool, error) { + return _L2CrossDomainMessenger.Contract.FailedMessages(&_L2CrossDomainMessenger.CallOpts, arg0) +} + +// FailedMessages is a free data retrieval call binding the contract method 0xa4e7f8bd. +// +// Solidity: function failedMessages(bytes32 ) view returns(bool) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerCallerSession) FailedMessages(arg0 [32]byte) (bool, error) { + return _L2CrossDomainMessenger.Contract.FailedMessages(&_L2CrossDomainMessenger.CallOpts, arg0) +} + +// L1CrossDomainMessenger is a free data retrieval call binding the contract method 0xa7119869. +// +// Solidity: function l1CrossDomainMessenger() view returns(address) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerCaller) L1CrossDomainMessenger(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _L2CrossDomainMessenger.contract.Call(opts, &out, "l1CrossDomainMessenger") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// L1CrossDomainMessenger is a free data retrieval call binding the contract method 0xa7119869. +// +// Solidity: function l1CrossDomainMessenger() view returns(address) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerSession) L1CrossDomainMessenger() (common.Address, error) { + return _L2CrossDomainMessenger.Contract.L1CrossDomainMessenger(&_L2CrossDomainMessenger.CallOpts) +} + +// L1CrossDomainMessenger is a free data retrieval call binding the contract method 0xa7119869. +// +// Solidity: function l1CrossDomainMessenger() view returns(address) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerCallerSession) L1CrossDomainMessenger() (common.Address, error) { + return _L2CrossDomainMessenger.Contract.L1CrossDomainMessenger(&_L2CrossDomainMessenger.CallOpts) +} + +// MessageNonce is a free data retrieval call binding the contract method 0xecc70428. +// +// Solidity: function messageNonce() view returns(uint256) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerCaller) MessageNonce(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _L2CrossDomainMessenger.contract.Call(opts, &out, "messageNonce") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// MessageNonce is a free data retrieval call binding the contract method 0xecc70428. +// +// Solidity: function messageNonce() view returns(uint256) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerSession) MessageNonce() (*big.Int, error) { + return _L2CrossDomainMessenger.Contract.MessageNonce(&_L2CrossDomainMessenger.CallOpts) +} + +// MessageNonce is a free data retrieval call binding the contract method 0xecc70428. +// +// Solidity: function messageNonce() view returns(uint256) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerCallerSession) MessageNonce() (*big.Int, error) { + return _L2CrossDomainMessenger.Contract.MessageNonce(&_L2CrossDomainMessenger.CallOpts) +} + +// OtherMessenger is a free data retrieval call binding the contract method 0xdb505d80. +// +// Solidity: function otherMessenger() view returns(address) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerCaller) OtherMessenger(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _L2CrossDomainMessenger.contract.Call(opts, &out, "otherMessenger") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// OtherMessenger is a free data retrieval call binding the contract method 0xdb505d80. +// +// Solidity: function otherMessenger() view returns(address) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerSession) OtherMessenger() (common.Address, error) { + return _L2CrossDomainMessenger.Contract.OtherMessenger(&_L2CrossDomainMessenger.CallOpts) +} + +// OtherMessenger is a free data retrieval call binding the contract method 0xdb505d80. +// +// Solidity: function otherMessenger() view returns(address) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerCallerSession) OtherMessenger() (common.Address, error) { + return _L2CrossDomainMessenger.Contract.OtherMessenger(&_L2CrossDomainMessenger.CallOpts) +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerCaller) Paused(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _L2CrossDomainMessenger.contract.Call(opts, &out, "paused") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerSession) Paused() (bool, error) { + return _L2CrossDomainMessenger.Contract.Paused(&_L2CrossDomainMessenger.CallOpts) +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerCallerSession) Paused() (bool, error) { + return _L2CrossDomainMessenger.Contract.Paused(&_L2CrossDomainMessenger.CallOpts) +} + +// SuccessfulMessages is a free data retrieval call binding the contract method 0xb1b1b209. +// +// Solidity: function successfulMessages(bytes32 ) view returns(bool) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerCaller) SuccessfulMessages(opts *bind.CallOpts, arg0 [32]byte) (bool, error) { + var out []interface{} + err := _L2CrossDomainMessenger.contract.Call(opts, &out, "successfulMessages", arg0) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// SuccessfulMessages is a free data retrieval call binding the contract method 0xb1b1b209. +// +// Solidity: function successfulMessages(bytes32 ) view returns(bool) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerSession) SuccessfulMessages(arg0 [32]byte) (bool, error) { + return _L2CrossDomainMessenger.Contract.SuccessfulMessages(&_L2CrossDomainMessenger.CallOpts, arg0) +} + +// SuccessfulMessages is a free data retrieval call binding the contract method 0xb1b1b209. +// +// Solidity: function successfulMessages(bytes32 ) view returns(bool) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerCallerSession) SuccessfulMessages(arg0 [32]byte) (bool, error) { + return _L2CrossDomainMessenger.Contract.SuccessfulMessages(&_L2CrossDomainMessenger.CallOpts, arg0) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerCaller) Version(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _L2CrossDomainMessenger.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 (_L2CrossDomainMessenger *L2CrossDomainMessengerSession) Version() (string, error) { + return _L2CrossDomainMessenger.Contract.Version(&_L2CrossDomainMessenger.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerCallerSession) Version() (string, error) { + return _L2CrossDomainMessenger.Contract.Version(&_L2CrossDomainMessenger.CallOpts) +} + +// XDomainMessageSender is a free data retrieval call binding the contract method 0x6e296e45. +// +// Solidity: function xDomainMessageSender() view returns(address) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerCaller) XDomainMessageSender(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _L2CrossDomainMessenger.contract.Call(opts, &out, "xDomainMessageSender") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// XDomainMessageSender is a free data retrieval call binding the contract method 0x6e296e45. +// +// Solidity: function xDomainMessageSender() view returns(address) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerSession) XDomainMessageSender() (common.Address, error) { + return _L2CrossDomainMessenger.Contract.XDomainMessageSender(&_L2CrossDomainMessenger.CallOpts) +} + +// XDomainMessageSender is a free data retrieval call binding the contract method 0x6e296e45. +// +// Solidity: function xDomainMessageSender() view returns(address) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerCallerSession) XDomainMessageSender() (common.Address, error) { + return _L2CrossDomainMessenger.Contract.XDomainMessageSender(&_L2CrossDomainMessenger.CallOpts) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. +// +// Solidity: function initialize(address _l1CrossDomainMessenger) returns() +func (_L2CrossDomainMessenger *L2CrossDomainMessengerTransactor) Initialize(opts *bind.TransactOpts, _l1CrossDomainMessenger common.Address) (*types.Transaction, error) { + return _L2CrossDomainMessenger.contract.Transact(opts, "initialize", _l1CrossDomainMessenger) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. +// +// Solidity: function initialize(address _l1CrossDomainMessenger) returns() +func (_L2CrossDomainMessenger *L2CrossDomainMessengerSession) Initialize(_l1CrossDomainMessenger common.Address) (*types.Transaction, error) { + return _L2CrossDomainMessenger.Contract.Initialize(&_L2CrossDomainMessenger.TransactOpts, _l1CrossDomainMessenger) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. +// +// Solidity: function initialize(address _l1CrossDomainMessenger) returns() +func (_L2CrossDomainMessenger *L2CrossDomainMessengerTransactorSession) Initialize(_l1CrossDomainMessenger common.Address) (*types.Transaction, error) { + return _L2CrossDomainMessenger.Contract.Initialize(&_L2CrossDomainMessenger.TransactOpts, _l1CrossDomainMessenger) +} + +// RelayMessage is a paid mutator transaction binding the contract method 0xd764ad0b. +// +// Solidity: function relayMessage(uint256 _nonce, address _sender, address _target, uint256 _value, uint256 _minGasLimit, bytes _message) payable returns() +func (_L2CrossDomainMessenger *L2CrossDomainMessengerTransactor) RelayMessage(opts *bind.TransactOpts, _nonce *big.Int, _sender common.Address, _target common.Address, _value *big.Int, _minGasLimit *big.Int, _message []byte) (*types.Transaction, error) { + return _L2CrossDomainMessenger.contract.Transact(opts, "relayMessage", _nonce, _sender, _target, _value, _minGasLimit, _message) +} + +// RelayMessage is a paid mutator transaction binding the contract method 0xd764ad0b. +// +// Solidity: function relayMessage(uint256 _nonce, address _sender, address _target, uint256 _value, uint256 _minGasLimit, bytes _message) payable returns() +func (_L2CrossDomainMessenger *L2CrossDomainMessengerSession) RelayMessage(_nonce *big.Int, _sender common.Address, _target common.Address, _value *big.Int, _minGasLimit *big.Int, _message []byte) (*types.Transaction, error) { + return _L2CrossDomainMessenger.Contract.RelayMessage(&_L2CrossDomainMessenger.TransactOpts, _nonce, _sender, _target, _value, _minGasLimit, _message) +} + +// RelayMessage is a paid mutator transaction binding the contract method 0xd764ad0b. +// +// Solidity: function relayMessage(uint256 _nonce, address _sender, address _target, uint256 _value, uint256 _minGasLimit, bytes _message) payable returns() +func (_L2CrossDomainMessenger *L2CrossDomainMessengerTransactorSession) RelayMessage(_nonce *big.Int, _sender common.Address, _target common.Address, _value *big.Int, _minGasLimit *big.Int, _message []byte) (*types.Transaction, error) { + return _L2CrossDomainMessenger.Contract.RelayMessage(&_L2CrossDomainMessenger.TransactOpts, _nonce, _sender, _target, _value, _minGasLimit, _message) +} + +// SendMessage is a paid mutator transaction binding the contract method 0x3dbb202b. +// +// Solidity: function sendMessage(address _target, bytes _message, uint32 _minGasLimit) payable returns() +func (_L2CrossDomainMessenger *L2CrossDomainMessengerTransactor) SendMessage(opts *bind.TransactOpts, _target common.Address, _message []byte, _minGasLimit uint32) (*types.Transaction, error) { + return _L2CrossDomainMessenger.contract.Transact(opts, "sendMessage", _target, _message, _minGasLimit) +} + +// SendMessage is a paid mutator transaction binding the contract method 0x3dbb202b. +// +// Solidity: function sendMessage(address _target, bytes _message, uint32 _minGasLimit) payable returns() +func (_L2CrossDomainMessenger *L2CrossDomainMessengerSession) SendMessage(_target common.Address, _message []byte, _minGasLimit uint32) (*types.Transaction, error) { + return _L2CrossDomainMessenger.Contract.SendMessage(&_L2CrossDomainMessenger.TransactOpts, _target, _message, _minGasLimit) +} + +// SendMessage is a paid mutator transaction binding the contract method 0x3dbb202b. +// +// Solidity: function sendMessage(address _target, bytes _message, uint32 _minGasLimit) payable returns() +func (_L2CrossDomainMessenger *L2CrossDomainMessengerTransactorSession) SendMessage(_target common.Address, _message []byte, _minGasLimit uint32) (*types.Transaction, error) { + return _L2CrossDomainMessenger.Contract.SendMessage(&_L2CrossDomainMessenger.TransactOpts, _target, _message, _minGasLimit) +} + +// L2CrossDomainMessengerFailedRelayedMessageIterator is returned from FilterFailedRelayedMessage and is used to iterate over the raw logs and unpacked data for FailedRelayedMessage events raised by the L2CrossDomainMessenger contract. +type L2CrossDomainMessengerFailedRelayedMessageIterator struct { + Event *L2CrossDomainMessengerFailedRelayedMessage // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *L2CrossDomainMessengerFailedRelayedMessageIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(L2CrossDomainMessengerFailedRelayedMessage) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(L2CrossDomainMessengerFailedRelayedMessage) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *L2CrossDomainMessengerFailedRelayedMessageIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *L2CrossDomainMessengerFailedRelayedMessageIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// L2CrossDomainMessengerFailedRelayedMessage represents a FailedRelayedMessage event raised by the L2CrossDomainMessenger contract. +type L2CrossDomainMessengerFailedRelayedMessage struct { + MsgHash [32]byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterFailedRelayedMessage is a free log retrieval operation binding the contract event 0x99d0e048484baa1b1540b1367cb128acd7ab2946d1ed91ec10e3c85e4bf51b8f. +// +// Solidity: event FailedRelayedMessage(bytes32 indexed msgHash) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerFilterer) FilterFailedRelayedMessage(opts *bind.FilterOpts, msgHash [][32]byte) (*L2CrossDomainMessengerFailedRelayedMessageIterator, error) { + + var msgHashRule []interface{} + for _, msgHashItem := range msgHash { + msgHashRule = append(msgHashRule, msgHashItem) + } + + logs, sub, err := _L2CrossDomainMessenger.contract.FilterLogs(opts, "FailedRelayedMessage", msgHashRule) + if err != nil { + return nil, err + } + return &L2CrossDomainMessengerFailedRelayedMessageIterator{contract: _L2CrossDomainMessenger.contract, event: "FailedRelayedMessage", logs: logs, sub: sub}, nil +} + +// WatchFailedRelayedMessage is a free log subscription operation binding the contract event 0x99d0e048484baa1b1540b1367cb128acd7ab2946d1ed91ec10e3c85e4bf51b8f. +// +// Solidity: event FailedRelayedMessage(bytes32 indexed msgHash) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerFilterer) WatchFailedRelayedMessage(opts *bind.WatchOpts, sink chan<- *L2CrossDomainMessengerFailedRelayedMessage, msgHash [][32]byte) (event.Subscription, error) { + + var msgHashRule []interface{} + for _, msgHashItem := range msgHash { + msgHashRule = append(msgHashRule, msgHashItem) + } + + logs, sub, err := _L2CrossDomainMessenger.contract.WatchLogs(opts, "FailedRelayedMessage", msgHashRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(L2CrossDomainMessengerFailedRelayedMessage) + if err := _L2CrossDomainMessenger.contract.UnpackLog(event, "FailedRelayedMessage", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseFailedRelayedMessage is a log parse operation binding the contract event 0x99d0e048484baa1b1540b1367cb128acd7ab2946d1ed91ec10e3c85e4bf51b8f. +// +// Solidity: event FailedRelayedMessage(bytes32 indexed msgHash) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerFilterer) ParseFailedRelayedMessage(log types.Log) (*L2CrossDomainMessengerFailedRelayedMessage, error) { + event := new(L2CrossDomainMessengerFailedRelayedMessage) + if err := _L2CrossDomainMessenger.contract.UnpackLog(event, "FailedRelayedMessage", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// L2CrossDomainMessengerInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the L2CrossDomainMessenger contract. +type L2CrossDomainMessengerInitializedIterator struct { + Event *L2CrossDomainMessengerInitialized // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *L2CrossDomainMessengerInitializedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(L2CrossDomainMessengerInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(L2CrossDomainMessengerInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *L2CrossDomainMessengerInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *L2CrossDomainMessengerInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// L2CrossDomainMessengerInitialized represents a Initialized event raised by the L2CrossDomainMessenger contract. +type L2CrossDomainMessengerInitialized struct { + Version uint8 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerFilterer) FilterInitialized(opts *bind.FilterOpts) (*L2CrossDomainMessengerInitializedIterator, error) { + + logs, sub, err := _L2CrossDomainMessenger.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &L2CrossDomainMessengerInitializedIterator{contract: _L2CrossDomainMessenger.contract, event: "Initialized", logs: logs, sub: sub}, nil +} + +// WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *L2CrossDomainMessengerInitialized) (event.Subscription, error) { + + logs, sub, err := _L2CrossDomainMessenger.contract.WatchLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(L2CrossDomainMessengerInitialized) + if err := _L2CrossDomainMessenger.contract.UnpackLog(event, "Initialized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerFilterer) ParseInitialized(log types.Log) (*L2CrossDomainMessengerInitialized, error) { + event := new(L2CrossDomainMessengerInitialized) + if err := _L2CrossDomainMessenger.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// L2CrossDomainMessengerRelayedMessageIterator is returned from FilterRelayedMessage and is used to iterate over the raw logs and unpacked data for RelayedMessage events raised by the L2CrossDomainMessenger contract. +type L2CrossDomainMessengerRelayedMessageIterator struct { + Event *L2CrossDomainMessengerRelayedMessage // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *L2CrossDomainMessengerRelayedMessageIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(L2CrossDomainMessengerRelayedMessage) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(L2CrossDomainMessengerRelayedMessage) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *L2CrossDomainMessengerRelayedMessageIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *L2CrossDomainMessengerRelayedMessageIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// L2CrossDomainMessengerRelayedMessage represents a RelayedMessage event raised by the L2CrossDomainMessenger contract. +type L2CrossDomainMessengerRelayedMessage struct { + MsgHash [32]byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterRelayedMessage is a free log retrieval operation binding the contract event 0x4641df4a962071e12719d8c8c8e5ac7fc4d97b927346a3d7a335b1f7517e133c. +// +// Solidity: event RelayedMessage(bytes32 indexed msgHash) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerFilterer) FilterRelayedMessage(opts *bind.FilterOpts, msgHash [][32]byte) (*L2CrossDomainMessengerRelayedMessageIterator, error) { + + var msgHashRule []interface{} + for _, msgHashItem := range msgHash { + msgHashRule = append(msgHashRule, msgHashItem) + } + + logs, sub, err := _L2CrossDomainMessenger.contract.FilterLogs(opts, "RelayedMessage", msgHashRule) + if err != nil { + return nil, err + } + return &L2CrossDomainMessengerRelayedMessageIterator{contract: _L2CrossDomainMessenger.contract, event: "RelayedMessage", logs: logs, sub: sub}, nil +} + +// WatchRelayedMessage is a free log subscription operation binding the contract event 0x4641df4a962071e12719d8c8c8e5ac7fc4d97b927346a3d7a335b1f7517e133c. +// +// Solidity: event RelayedMessage(bytes32 indexed msgHash) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerFilterer) WatchRelayedMessage(opts *bind.WatchOpts, sink chan<- *L2CrossDomainMessengerRelayedMessage, msgHash [][32]byte) (event.Subscription, error) { + + var msgHashRule []interface{} + for _, msgHashItem := range msgHash { + msgHashRule = append(msgHashRule, msgHashItem) + } + + logs, sub, err := _L2CrossDomainMessenger.contract.WatchLogs(opts, "RelayedMessage", msgHashRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(L2CrossDomainMessengerRelayedMessage) + if err := _L2CrossDomainMessenger.contract.UnpackLog(event, "RelayedMessage", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseRelayedMessage is a log parse operation binding the contract event 0x4641df4a962071e12719d8c8c8e5ac7fc4d97b927346a3d7a335b1f7517e133c. +// +// Solidity: event RelayedMessage(bytes32 indexed msgHash) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerFilterer) ParseRelayedMessage(log types.Log) (*L2CrossDomainMessengerRelayedMessage, error) { + event := new(L2CrossDomainMessengerRelayedMessage) + if err := _L2CrossDomainMessenger.contract.UnpackLog(event, "RelayedMessage", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// L2CrossDomainMessengerSentMessageIterator is returned from FilterSentMessage and is used to iterate over the raw logs and unpacked data for SentMessage events raised by the L2CrossDomainMessenger contract. +type L2CrossDomainMessengerSentMessageIterator struct { + Event *L2CrossDomainMessengerSentMessage // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *L2CrossDomainMessengerSentMessageIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(L2CrossDomainMessengerSentMessage) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(L2CrossDomainMessengerSentMessage) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *L2CrossDomainMessengerSentMessageIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *L2CrossDomainMessengerSentMessageIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// L2CrossDomainMessengerSentMessage represents a SentMessage event raised by the L2CrossDomainMessenger contract. +type L2CrossDomainMessengerSentMessage struct { + Target common.Address + Sender common.Address + Message []byte + MessageNonce *big.Int + GasLimit *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSentMessage is a free log retrieval operation binding the contract event 0xcb0f7ffd78f9aee47a248fae8db181db6eee833039123e026dcbff529522e52a. +// +// Solidity: event SentMessage(address indexed target, address sender, bytes message, uint256 messageNonce, uint256 gasLimit) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerFilterer) FilterSentMessage(opts *bind.FilterOpts, target []common.Address) (*L2CrossDomainMessengerSentMessageIterator, error) { + + var targetRule []interface{} + for _, targetItem := range target { + targetRule = append(targetRule, targetItem) + } + + logs, sub, err := _L2CrossDomainMessenger.contract.FilterLogs(opts, "SentMessage", targetRule) + if err != nil { + return nil, err + } + return &L2CrossDomainMessengerSentMessageIterator{contract: _L2CrossDomainMessenger.contract, event: "SentMessage", logs: logs, sub: sub}, nil +} + +// WatchSentMessage is a free log subscription operation binding the contract event 0xcb0f7ffd78f9aee47a248fae8db181db6eee833039123e026dcbff529522e52a. +// +// Solidity: event SentMessage(address indexed target, address sender, bytes message, uint256 messageNonce, uint256 gasLimit) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerFilterer) WatchSentMessage(opts *bind.WatchOpts, sink chan<- *L2CrossDomainMessengerSentMessage, target []common.Address) (event.Subscription, error) { + + var targetRule []interface{} + for _, targetItem := range target { + targetRule = append(targetRule, targetItem) + } + + logs, sub, err := _L2CrossDomainMessenger.contract.WatchLogs(opts, "SentMessage", targetRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(L2CrossDomainMessengerSentMessage) + if err := _L2CrossDomainMessenger.contract.UnpackLog(event, "SentMessage", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseSentMessage is a log parse operation binding the contract event 0xcb0f7ffd78f9aee47a248fae8db181db6eee833039123e026dcbff529522e52a. +// +// Solidity: event SentMessage(address indexed target, address sender, bytes message, uint256 messageNonce, uint256 gasLimit) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerFilterer) ParseSentMessage(log types.Log) (*L2CrossDomainMessengerSentMessage, error) { + event := new(L2CrossDomainMessengerSentMessage) + if err := _L2CrossDomainMessenger.contract.UnpackLog(event, "SentMessage", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// L2CrossDomainMessengerSentMessageExtension1Iterator is returned from FilterSentMessageExtension1 and is used to iterate over the raw logs and unpacked data for SentMessageExtension1 events raised by the L2CrossDomainMessenger contract. +type L2CrossDomainMessengerSentMessageExtension1Iterator struct { + Event *L2CrossDomainMessengerSentMessageExtension1 // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *L2CrossDomainMessengerSentMessageExtension1Iterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(L2CrossDomainMessengerSentMessageExtension1) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(L2CrossDomainMessengerSentMessageExtension1) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *L2CrossDomainMessengerSentMessageExtension1Iterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *L2CrossDomainMessengerSentMessageExtension1Iterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// L2CrossDomainMessengerSentMessageExtension1 represents a SentMessageExtension1 event raised by the L2CrossDomainMessenger contract. +type L2CrossDomainMessengerSentMessageExtension1 struct { + Sender common.Address + Value *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSentMessageExtension1 is a free log retrieval operation binding the contract event 0x8ebb2ec2465bdb2a06a66fc37a0963af8a2a6a1479d81d56fdb8cbb98096d546. +// +// Solidity: event SentMessageExtension1(address indexed sender, uint256 value) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerFilterer) FilterSentMessageExtension1(opts *bind.FilterOpts, sender []common.Address) (*L2CrossDomainMessengerSentMessageExtension1Iterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _L2CrossDomainMessenger.contract.FilterLogs(opts, "SentMessageExtension1", senderRule) + if err != nil { + return nil, err + } + return &L2CrossDomainMessengerSentMessageExtension1Iterator{contract: _L2CrossDomainMessenger.contract, event: "SentMessageExtension1", logs: logs, sub: sub}, nil +} + +// WatchSentMessageExtension1 is a free log subscription operation binding the contract event 0x8ebb2ec2465bdb2a06a66fc37a0963af8a2a6a1479d81d56fdb8cbb98096d546. +// +// Solidity: event SentMessageExtension1(address indexed sender, uint256 value) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerFilterer) WatchSentMessageExtension1(opts *bind.WatchOpts, sink chan<- *L2CrossDomainMessengerSentMessageExtension1, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _L2CrossDomainMessenger.contract.WatchLogs(opts, "SentMessageExtension1", senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(L2CrossDomainMessengerSentMessageExtension1) + if err := _L2CrossDomainMessenger.contract.UnpackLog(event, "SentMessageExtension1", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseSentMessageExtension1 is a log parse operation binding the contract event 0x8ebb2ec2465bdb2a06a66fc37a0963af8a2a6a1479d81d56fdb8cbb98096d546. +// +// Solidity: event SentMessageExtension1(address indexed sender, uint256 value) +func (_L2CrossDomainMessenger *L2CrossDomainMessengerFilterer) ParseSentMessageExtension1(log types.Log) (*L2CrossDomainMessengerSentMessageExtension1, error) { + event := new(L2CrossDomainMessengerSentMessageExtension1) + if err := _L2CrossDomainMessenger.contract.UnpackLog(event, "SentMessageExtension1", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/op-e2e2/bindings/l2erc721bridge.go b/op-e2e2/bindings/l2erc721bridge.go new file mode 100644 index 000000000000..cd4ba2f7fab4 --- /dev/null +++ b/op-e2e2/bindings/l2erc721bridge.go @@ -0,0 +1,936 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// L2ERC721BridgeMetaData contains all meta data concerning the L2ERC721Bridge contract. +var L2ERC721BridgeMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"MESSENGER\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractCrossDomainMessenger\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"OTHER_BRIDGE\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractStandardBridge\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"bridgeERC721\",\"inputs\":[{\"name\":\"_localToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_remoteToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_tokenId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_minGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"_extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"bridgeERC721To\",\"inputs\":[{\"name\":\"_localToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_remoteToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_tokenId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_minGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"_extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"finalizeBridgeERC721\",\"inputs\":[{\"name\":\"_localToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_remoteToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_from\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_tokenId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_l1ERC721Bridge\",\"type\":\"address\",\"internalType\":\"addresspayable\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"messenger\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractCrossDomainMessenger\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"otherBridge\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractStandardBridge\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"paused\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"ERC721BridgeFinalized\",\"inputs\":[{\"name\":\"localToken\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"remoteToken\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"tokenId\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"extraData\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ERC721BridgeInitiated\",\"inputs\":[{\"name\":\"localToken\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"remoteToken\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"tokenId\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"extraData\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false}]", + Bin: "0x60806040523480156200001157600080fd5b506200001e600062000024565b62000217565b600054610100900460ff1615808015620000455750600054600160ff909116105b8062000075575062000062306200016d60201b62000a3e1760201c565b15801562000075575060005460ff166001145b620000de5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff19166001179055801562000102576000805461ff0019166101001790555b62000122734200000000000000000000000000000000000007836200017c565b801562000169576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050565b6001600160a01b03163b151590565b600054610100900460ff16620001e95760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401620000d5565b600180546001600160a01b039384166001600160a01b03199182161790915560028054929093169116179055565b61160c80620002276000396000f3fe608060405234801561001057600080fd5b50600436106100be5760003560e01c80637f46ddb211610076578063aa5574521161005b578063aa557452146101c9578063c4d66de8146101dc578063c89701a2146101ef57600080fd5b80637f46ddb21461018d578063927ede2d146101ab57600080fd5b806354fd4d50116100a757806354fd4d50146101225780635c975abb1461016b578063761f44931461017a57600080fd5b80633687011a146100c35780633cb747bf146100d8575b600080fd5b6100d66100d136600461128a565b61020f565b005b6001546100f89073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b61015e6040518060400160405280600581526020017f312e372e3000000000000000000000000000000000000000000000000000000081525081565b6040516101199190611378565b60405160008152602001610119565b6100d661018836600461138b565b6102bb565b60025473ffffffffffffffffffffffffffffffffffffffff166100f8565b60015473ffffffffffffffffffffffffffffffffffffffff166100f8565b6100d66101d7366004611423565b6107d9565b6100d66101ea36600461149a565b610895565b6002546100f89073ffffffffffffffffffffffffffffffffffffffff1681565b333b156102a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f4552433732314272696467653a206163636f756e74206973206e6f742065787460448201527f65726e616c6c79206f776e65640000000000000000000000000000000000000060648201526084015b60405180910390fd5b6102b38686333388888888610a5a565b505050505050565b60015473ffffffffffffffffffffffffffffffffffffffff16331480156103905750600254600154604080517f6e296e45000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff9384169390921691636e296e45916004808201926020929091908290030181865afa158015610354573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061037891906114b7565b73ffffffffffffffffffffffffffffffffffffffff16145b61041c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f4552433732314272696467653a2066756e6374696f6e2063616e206f6e6c792060448201527f62652063616c6c65642066726f6d20746865206f746865722062726964676500606482015260840161029a565b3073ffffffffffffffffffffffffffffffffffffffff8816036104c1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f4c324552433732314272696467653a206c6f63616c20746f6b656e2063616e6e60448201527f6f742062652073656c6600000000000000000000000000000000000000000000606482015260840161029a565b6104eb877f74259ebf00000000000000000000000000000000000000000000000000000000610fc2565b610577576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f4c324552433732314272696467653a206c6f63616c20746f6b656e20696e746560448201527f7266616365206973206e6f7420636f6d706c69616e7400000000000000000000606482015260840161029a565b8673ffffffffffffffffffffffffffffffffffffffff1663d6c0b2c46040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105e691906114b7565b73ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16146106c6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604b60248201527f4c324552433732314272696467653a2077726f6e672072656d6f746520746f6b60448201527f656e20666f72204f7074696d69736d204d696e7461626c65204552433732312060648201527f6c6f63616c20746f6b656e000000000000000000000000000000000000000000608482015260a40161029a565b6040517fa144819400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85811660048301526024820185905288169063a144819490604401600060405180830381600087803b15801561073657600080fd5b505af115801561074a573d6000803e3d6000fd5b505050508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167f1f39bf6707b5d608453e0ae4c067b562bcc4c85c0f562ef5d2c774d2e7f131ac878787876040516107c8949392919061151d565b60405180910390a450505050505050565b73ffffffffffffffffffffffffffffffffffffffff851661087c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f4552433732314272696467653a206e667420726563697069656e742063616e6e60448201527f6f74206265206164647265737328302900000000000000000000000000000000606482015260840161029a565b61088c8787338888888888610a5a565b50505050505050565b600054610100900460ff16158080156108b55750600054600160ff909116105b806108cf5750303b1580156108cf575060005460ff166001145b61095b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a6564000000000000000000000000000000000000606482015260840161029a565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905580156109b957600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b6109d773420000000000000000000000000000000000000783610fe5565b8015610a3a57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b73ffffffffffffffffffffffffffffffffffffffff8716610afd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603160248201527f4c324552433732314272696467653a2072656d6f746520746f6b656e2063616e60448201527f6e6f742062652061646472657373283029000000000000000000000000000000606482015260840161029a565b6040517f6352211e0000000000000000000000000000000000000000000000000000000081526004810185905273ffffffffffffffffffffffffffffffffffffffff891690636352211e90602401602060405180830381865afa158015610b68573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b8c91906114b7565b73ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614610c46576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603e60248201527f4c324552433732314272696467653a205769746864726177616c206973206e6f60448201527f74206265696e6720696e69746961746564206279204e4654206f776e65720000606482015260840161029a565b60008873ffffffffffffffffffffffffffffffffffffffff1663d6c0b2c46040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c93573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cb791906114b7565b90508773ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610d74576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f4c324552433732314272696467653a2072656d6f746520746f6b656e20646f6560448201527f73206e6f74206d6174636820676976656e2076616c7565000000000000000000606482015260840161029a565b6040517f9dc29fac00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8881166004830152602482018790528a1690639dc29fac90604401600060405180830381600087803b158015610de457600080fd5b505af1158015610df8573d6000803e3d6000fd5b50505050600063761f449360e01b828b8a8a8a8989604051602401610e23979695949392919061155d565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009094169390931790925260015460025492517f3dbb202b00000000000000000000000000000000000000000000000000000000815291935073ffffffffffffffffffffffffffffffffffffffff90811692633dbb202b92610f0292919091169085908a906004016115ba565b600060405180830381600087803b158015610f1c57600080fd5b505af1158015610f30573d6000803e3d6000fd5b505050508773ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff168b73ffffffffffffffffffffffffffffffffffffffff167fb7460e2a880f256ebef3406116ff3eee0cee51ebccdc2a40698f87ebb2e9c1a58a8a8989604051610fae949392919061151d565b60405180910390a450505050505050505050565b6000610fcd836110cf565b8015610fde5750610fde8383611134565b9392505050565b600054610100900460ff1661107c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e67000000000000000000000000000000000000000000606482015260840161029a565b6001805473ffffffffffffffffffffffffffffffffffffffff9384167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560028054929093169116179055565b60006110fb827f01ffc9a700000000000000000000000000000000000000000000000000000000611134565b801561112e575061112c827fffffffff00000000000000000000000000000000000000000000000000000000611134565b155b92915050565b604080517fffffffff000000000000000000000000000000000000000000000000000000008316602480830191909152825180830390910181526044909101909152602080820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f01ffc9a700000000000000000000000000000000000000000000000000000000178152825160009392849283928392918391908a617530fa92503d915060005190508280156111ec575060208210155b80156111f85750600081115b979650505050505050565b73ffffffffffffffffffffffffffffffffffffffff8116811461122557600080fd5b50565b803563ffffffff8116811461123c57600080fd5b919050565b60008083601f84011261125357600080fd5b50813567ffffffffffffffff81111561126b57600080fd5b60208301915083602082850101111561128357600080fd5b9250929050565b60008060008060008060a087890312156112a357600080fd5b86356112ae81611203565b955060208701356112be81611203565b9450604087013593506112d360608801611228565b9250608087013567ffffffffffffffff8111156112ef57600080fd5b6112fb89828a01611241565b979a9699509497509295939492505050565b6000815180845260005b8181101561133357602081850181015186830182015201611317565b81811115611345576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610fde602083018461130d565b600080600080600080600060c0888a0312156113a657600080fd5b87356113b181611203565b965060208801356113c181611203565b955060408801356113d181611203565b945060608801356113e181611203565b93506080880135925060a088013567ffffffffffffffff81111561140457600080fd5b6114108a828b01611241565b989b979a50959850939692959293505050565b600080600080600080600060c0888a03121561143e57600080fd5b873561144981611203565b9650602088013561145981611203565b9550604088013561146981611203565b94506060880135935061147e60808901611228565b925060a088013567ffffffffffffffff81111561140457600080fd5b6000602082840312156114ac57600080fd5b8135610fde81611203565b6000602082840312156114c957600080fd5b8151610fde81611203565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b73ffffffffffffffffffffffffffffffffffffffff851681528360208201526060604082015260006115536060830184866114d4565b9695505050505050565b600073ffffffffffffffffffffffffffffffffffffffff808a1683528089166020840152808816604084015280871660608401525084608083015260c060a08301526115ad60c0830184866114d4565b9998505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff841681526060602082015260006115e9606083018561130d565b905063ffffffff8316604083015294935050505056fea164736f6c634300080f000a", +} + +// L2ERC721BridgeABI is the input ABI used to generate the binding from. +// Deprecated: Use L2ERC721BridgeMetaData.ABI instead. +var L2ERC721BridgeABI = L2ERC721BridgeMetaData.ABI + +// L2ERC721BridgeBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use L2ERC721BridgeMetaData.Bin instead. +var L2ERC721BridgeBin = L2ERC721BridgeMetaData.Bin + +// DeployL2ERC721Bridge deploys a new Ethereum contract, binding an instance of L2ERC721Bridge to it. +func DeployL2ERC721Bridge(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *L2ERC721Bridge, error) { + parsed, err := L2ERC721BridgeMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(L2ERC721BridgeBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &L2ERC721Bridge{L2ERC721BridgeCaller: L2ERC721BridgeCaller{contract: contract}, L2ERC721BridgeTransactor: L2ERC721BridgeTransactor{contract: contract}, L2ERC721BridgeFilterer: L2ERC721BridgeFilterer{contract: contract}}, nil +} + +// L2ERC721Bridge is an auto generated Go binding around an Ethereum contract. +type L2ERC721Bridge struct { + L2ERC721BridgeCaller // Read-only binding to the contract + L2ERC721BridgeTransactor // Write-only binding to the contract + L2ERC721BridgeFilterer // Log filterer for contract events +} + +// L2ERC721BridgeCaller is an auto generated read-only Go binding around an Ethereum contract. +type L2ERC721BridgeCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// L2ERC721BridgeTransactor is an auto generated write-only Go binding around an Ethereum contract. +type L2ERC721BridgeTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// L2ERC721BridgeFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type L2ERC721BridgeFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// L2ERC721BridgeSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type L2ERC721BridgeSession struct { + Contract *L2ERC721Bridge // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// L2ERC721BridgeCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type L2ERC721BridgeCallerSession struct { + Contract *L2ERC721BridgeCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// L2ERC721BridgeTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type L2ERC721BridgeTransactorSession struct { + Contract *L2ERC721BridgeTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// L2ERC721BridgeRaw is an auto generated low-level Go binding around an Ethereum contract. +type L2ERC721BridgeRaw struct { + Contract *L2ERC721Bridge // Generic contract binding to access the raw methods on +} + +// L2ERC721BridgeCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type L2ERC721BridgeCallerRaw struct { + Contract *L2ERC721BridgeCaller // Generic read-only contract binding to access the raw methods on +} + +// L2ERC721BridgeTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type L2ERC721BridgeTransactorRaw struct { + Contract *L2ERC721BridgeTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewL2ERC721Bridge creates a new instance of L2ERC721Bridge, bound to a specific deployed contract. +func NewL2ERC721Bridge(address common.Address, backend bind.ContractBackend) (*L2ERC721Bridge, error) { + contract, err := bindL2ERC721Bridge(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &L2ERC721Bridge{L2ERC721BridgeCaller: L2ERC721BridgeCaller{contract: contract}, L2ERC721BridgeTransactor: L2ERC721BridgeTransactor{contract: contract}, L2ERC721BridgeFilterer: L2ERC721BridgeFilterer{contract: contract}}, nil +} + +// NewL2ERC721BridgeCaller creates a new read-only instance of L2ERC721Bridge, bound to a specific deployed contract. +func NewL2ERC721BridgeCaller(address common.Address, caller bind.ContractCaller) (*L2ERC721BridgeCaller, error) { + contract, err := bindL2ERC721Bridge(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &L2ERC721BridgeCaller{contract: contract}, nil +} + +// NewL2ERC721BridgeTransactor creates a new write-only instance of L2ERC721Bridge, bound to a specific deployed contract. +func NewL2ERC721BridgeTransactor(address common.Address, transactor bind.ContractTransactor) (*L2ERC721BridgeTransactor, error) { + contract, err := bindL2ERC721Bridge(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &L2ERC721BridgeTransactor{contract: contract}, nil +} + +// NewL2ERC721BridgeFilterer creates a new log filterer instance of L2ERC721Bridge, bound to a specific deployed contract. +func NewL2ERC721BridgeFilterer(address common.Address, filterer bind.ContractFilterer) (*L2ERC721BridgeFilterer, error) { + contract, err := bindL2ERC721Bridge(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &L2ERC721BridgeFilterer{contract: contract}, nil +} + +// bindL2ERC721Bridge binds a generic wrapper to an already deployed contract. +func bindL2ERC721Bridge(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(L2ERC721BridgeABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_L2ERC721Bridge *L2ERC721BridgeRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _L2ERC721Bridge.Contract.L2ERC721BridgeCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_L2ERC721Bridge *L2ERC721BridgeRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _L2ERC721Bridge.Contract.L2ERC721BridgeTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_L2ERC721Bridge *L2ERC721BridgeRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _L2ERC721Bridge.Contract.L2ERC721BridgeTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_L2ERC721Bridge *L2ERC721BridgeCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _L2ERC721Bridge.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_L2ERC721Bridge *L2ERC721BridgeTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _L2ERC721Bridge.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_L2ERC721Bridge *L2ERC721BridgeTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _L2ERC721Bridge.Contract.contract.Transact(opts, method, params...) +} + +// MESSENGER is a free data retrieval call binding the contract method 0x927ede2d. +// +// Solidity: function MESSENGER() view returns(address) +func (_L2ERC721Bridge *L2ERC721BridgeCaller) MESSENGER(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _L2ERC721Bridge.contract.Call(opts, &out, "MESSENGER") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// MESSENGER is a free data retrieval call binding the contract method 0x927ede2d. +// +// Solidity: function MESSENGER() view returns(address) +func (_L2ERC721Bridge *L2ERC721BridgeSession) MESSENGER() (common.Address, error) { + return _L2ERC721Bridge.Contract.MESSENGER(&_L2ERC721Bridge.CallOpts) +} + +// MESSENGER is a free data retrieval call binding the contract method 0x927ede2d. +// +// Solidity: function MESSENGER() view returns(address) +func (_L2ERC721Bridge *L2ERC721BridgeCallerSession) MESSENGER() (common.Address, error) { + return _L2ERC721Bridge.Contract.MESSENGER(&_L2ERC721Bridge.CallOpts) +} + +// OTHERBRIDGE is a free data retrieval call binding the contract method 0x7f46ddb2. +// +// Solidity: function OTHER_BRIDGE() view returns(address) +func (_L2ERC721Bridge *L2ERC721BridgeCaller) OTHERBRIDGE(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _L2ERC721Bridge.contract.Call(opts, &out, "OTHER_BRIDGE") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// OTHERBRIDGE is a free data retrieval call binding the contract method 0x7f46ddb2. +// +// Solidity: function OTHER_BRIDGE() view returns(address) +func (_L2ERC721Bridge *L2ERC721BridgeSession) OTHERBRIDGE() (common.Address, error) { + return _L2ERC721Bridge.Contract.OTHERBRIDGE(&_L2ERC721Bridge.CallOpts) +} + +// OTHERBRIDGE is a free data retrieval call binding the contract method 0x7f46ddb2. +// +// Solidity: function OTHER_BRIDGE() view returns(address) +func (_L2ERC721Bridge *L2ERC721BridgeCallerSession) OTHERBRIDGE() (common.Address, error) { + return _L2ERC721Bridge.Contract.OTHERBRIDGE(&_L2ERC721Bridge.CallOpts) +} + +// Messenger is a free data retrieval call binding the contract method 0x3cb747bf. +// +// Solidity: function messenger() view returns(address) +func (_L2ERC721Bridge *L2ERC721BridgeCaller) Messenger(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _L2ERC721Bridge.contract.Call(opts, &out, "messenger") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Messenger is a free data retrieval call binding the contract method 0x3cb747bf. +// +// Solidity: function messenger() view returns(address) +func (_L2ERC721Bridge *L2ERC721BridgeSession) Messenger() (common.Address, error) { + return _L2ERC721Bridge.Contract.Messenger(&_L2ERC721Bridge.CallOpts) +} + +// Messenger is a free data retrieval call binding the contract method 0x3cb747bf. +// +// Solidity: function messenger() view returns(address) +func (_L2ERC721Bridge *L2ERC721BridgeCallerSession) Messenger() (common.Address, error) { + return _L2ERC721Bridge.Contract.Messenger(&_L2ERC721Bridge.CallOpts) +} + +// OtherBridge is a free data retrieval call binding the contract method 0xc89701a2. +// +// Solidity: function otherBridge() view returns(address) +func (_L2ERC721Bridge *L2ERC721BridgeCaller) OtherBridge(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _L2ERC721Bridge.contract.Call(opts, &out, "otherBridge") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// OtherBridge is a free data retrieval call binding the contract method 0xc89701a2. +// +// Solidity: function otherBridge() view returns(address) +func (_L2ERC721Bridge *L2ERC721BridgeSession) OtherBridge() (common.Address, error) { + return _L2ERC721Bridge.Contract.OtherBridge(&_L2ERC721Bridge.CallOpts) +} + +// OtherBridge is a free data retrieval call binding the contract method 0xc89701a2. +// +// Solidity: function otherBridge() view returns(address) +func (_L2ERC721Bridge *L2ERC721BridgeCallerSession) OtherBridge() (common.Address, error) { + return _L2ERC721Bridge.Contract.OtherBridge(&_L2ERC721Bridge.CallOpts) +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool) +func (_L2ERC721Bridge *L2ERC721BridgeCaller) Paused(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _L2ERC721Bridge.contract.Call(opts, &out, "paused") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool) +func (_L2ERC721Bridge *L2ERC721BridgeSession) Paused() (bool, error) { + return _L2ERC721Bridge.Contract.Paused(&_L2ERC721Bridge.CallOpts) +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool) +func (_L2ERC721Bridge *L2ERC721BridgeCallerSession) Paused() (bool, error) { + return _L2ERC721Bridge.Contract.Paused(&_L2ERC721Bridge.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_L2ERC721Bridge *L2ERC721BridgeCaller) Version(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _L2ERC721Bridge.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 (_L2ERC721Bridge *L2ERC721BridgeSession) Version() (string, error) { + return _L2ERC721Bridge.Contract.Version(&_L2ERC721Bridge.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_L2ERC721Bridge *L2ERC721BridgeCallerSession) Version() (string, error) { + return _L2ERC721Bridge.Contract.Version(&_L2ERC721Bridge.CallOpts) +} + +// BridgeERC721 is a paid mutator transaction binding the contract method 0x3687011a. +// +// Solidity: function bridgeERC721(address _localToken, address _remoteToken, uint256 _tokenId, uint32 _minGasLimit, bytes _extraData) returns() +func (_L2ERC721Bridge *L2ERC721BridgeTransactor) BridgeERC721(opts *bind.TransactOpts, _localToken common.Address, _remoteToken common.Address, _tokenId *big.Int, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L2ERC721Bridge.contract.Transact(opts, "bridgeERC721", _localToken, _remoteToken, _tokenId, _minGasLimit, _extraData) +} + +// BridgeERC721 is a paid mutator transaction binding the contract method 0x3687011a. +// +// Solidity: function bridgeERC721(address _localToken, address _remoteToken, uint256 _tokenId, uint32 _minGasLimit, bytes _extraData) returns() +func (_L2ERC721Bridge *L2ERC721BridgeSession) BridgeERC721(_localToken common.Address, _remoteToken common.Address, _tokenId *big.Int, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L2ERC721Bridge.Contract.BridgeERC721(&_L2ERC721Bridge.TransactOpts, _localToken, _remoteToken, _tokenId, _minGasLimit, _extraData) +} + +// BridgeERC721 is a paid mutator transaction binding the contract method 0x3687011a. +// +// Solidity: function bridgeERC721(address _localToken, address _remoteToken, uint256 _tokenId, uint32 _minGasLimit, bytes _extraData) returns() +func (_L2ERC721Bridge *L2ERC721BridgeTransactorSession) BridgeERC721(_localToken common.Address, _remoteToken common.Address, _tokenId *big.Int, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L2ERC721Bridge.Contract.BridgeERC721(&_L2ERC721Bridge.TransactOpts, _localToken, _remoteToken, _tokenId, _minGasLimit, _extraData) +} + +// BridgeERC721To is a paid mutator transaction binding the contract method 0xaa557452. +// +// Solidity: function bridgeERC721To(address _localToken, address _remoteToken, address _to, uint256 _tokenId, uint32 _minGasLimit, bytes _extraData) returns() +func (_L2ERC721Bridge *L2ERC721BridgeTransactor) BridgeERC721To(opts *bind.TransactOpts, _localToken common.Address, _remoteToken common.Address, _to common.Address, _tokenId *big.Int, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L2ERC721Bridge.contract.Transact(opts, "bridgeERC721To", _localToken, _remoteToken, _to, _tokenId, _minGasLimit, _extraData) +} + +// BridgeERC721To is a paid mutator transaction binding the contract method 0xaa557452. +// +// Solidity: function bridgeERC721To(address _localToken, address _remoteToken, address _to, uint256 _tokenId, uint32 _minGasLimit, bytes _extraData) returns() +func (_L2ERC721Bridge *L2ERC721BridgeSession) BridgeERC721To(_localToken common.Address, _remoteToken common.Address, _to common.Address, _tokenId *big.Int, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L2ERC721Bridge.Contract.BridgeERC721To(&_L2ERC721Bridge.TransactOpts, _localToken, _remoteToken, _to, _tokenId, _minGasLimit, _extraData) +} + +// BridgeERC721To is a paid mutator transaction binding the contract method 0xaa557452. +// +// Solidity: function bridgeERC721To(address _localToken, address _remoteToken, address _to, uint256 _tokenId, uint32 _minGasLimit, bytes _extraData) returns() +func (_L2ERC721Bridge *L2ERC721BridgeTransactorSession) BridgeERC721To(_localToken common.Address, _remoteToken common.Address, _to common.Address, _tokenId *big.Int, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L2ERC721Bridge.Contract.BridgeERC721To(&_L2ERC721Bridge.TransactOpts, _localToken, _remoteToken, _to, _tokenId, _minGasLimit, _extraData) +} + +// FinalizeBridgeERC721 is a paid mutator transaction binding the contract method 0x761f4493. +// +// Solidity: function finalizeBridgeERC721(address _localToken, address _remoteToken, address _from, address _to, uint256 _tokenId, bytes _extraData) returns() +func (_L2ERC721Bridge *L2ERC721BridgeTransactor) FinalizeBridgeERC721(opts *bind.TransactOpts, _localToken common.Address, _remoteToken common.Address, _from common.Address, _to common.Address, _tokenId *big.Int, _extraData []byte) (*types.Transaction, error) { + return _L2ERC721Bridge.contract.Transact(opts, "finalizeBridgeERC721", _localToken, _remoteToken, _from, _to, _tokenId, _extraData) +} + +// FinalizeBridgeERC721 is a paid mutator transaction binding the contract method 0x761f4493. +// +// Solidity: function finalizeBridgeERC721(address _localToken, address _remoteToken, address _from, address _to, uint256 _tokenId, bytes _extraData) returns() +func (_L2ERC721Bridge *L2ERC721BridgeSession) FinalizeBridgeERC721(_localToken common.Address, _remoteToken common.Address, _from common.Address, _to common.Address, _tokenId *big.Int, _extraData []byte) (*types.Transaction, error) { + return _L2ERC721Bridge.Contract.FinalizeBridgeERC721(&_L2ERC721Bridge.TransactOpts, _localToken, _remoteToken, _from, _to, _tokenId, _extraData) +} + +// FinalizeBridgeERC721 is a paid mutator transaction binding the contract method 0x761f4493. +// +// Solidity: function finalizeBridgeERC721(address _localToken, address _remoteToken, address _from, address _to, uint256 _tokenId, bytes _extraData) returns() +func (_L2ERC721Bridge *L2ERC721BridgeTransactorSession) FinalizeBridgeERC721(_localToken common.Address, _remoteToken common.Address, _from common.Address, _to common.Address, _tokenId *big.Int, _extraData []byte) (*types.Transaction, error) { + return _L2ERC721Bridge.Contract.FinalizeBridgeERC721(&_L2ERC721Bridge.TransactOpts, _localToken, _remoteToken, _from, _to, _tokenId, _extraData) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. +// +// Solidity: function initialize(address _l1ERC721Bridge) returns() +func (_L2ERC721Bridge *L2ERC721BridgeTransactor) Initialize(opts *bind.TransactOpts, _l1ERC721Bridge common.Address) (*types.Transaction, error) { + return _L2ERC721Bridge.contract.Transact(opts, "initialize", _l1ERC721Bridge) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. +// +// Solidity: function initialize(address _l1ERC721Bridge) returns() +func (_L2ERC721Bridge *L2ERC721BridgeSession) Initialize(_l1ERC721Bridge common.Address) (*types.Transaction, error) { + return _L2ERC721Bridge.Contract.Initialize(&_L2ERC721Bridge.TransactOpts, _l1ERC721Bridge) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. +// +// Solidity: function initialize(address _l1ERC721Bridge) returns() +func (_L2ERC721Bridge *L2ERC721BridgeTransactorSession) Initialize(_l1ERC721Bridge common.Address) (*types.Transaction, error) { + return _L2ERC721Bridge.Contract.Initialize(&_L2ERC721Bridge.TransactOpts, _l1ERC721Bridge) +} + +// L2ERC721BridgeERC721BridgeFinalizedIterator is returned from FilterERC721BridgeFinalized and is used to iterate over the raw logs and unpacked data for ERC721BridgeFinalized events raised by the L2ERC721Bridge contract. +type L2ERC721BridgeERC721BridgeFinalizedIterator struct { + Event *L2ERC721BridgeERC721BridgeFinalized // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *L2ERC721BridgeERC721BridgeFinalizedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(L2ERC721BridgeERC721BridgeFinalized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(L2ERC721BridgeERC721BridgeFinalized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *L2ERC721BridgeERC721BridgeFinalizedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *L2ERC721BridgeERC721BridgeFinalizedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// L2ERC721BridgeERC721BridgeFinalized represents a ERC721BridgeFinalized event raised by the L2ERC721Bridge contract. +type L2ERC721BridgeERC721BridgeFinalized struct { + LocalToken common.Address + RemoteToken common.Address + From common.Address + To common.Address + TokenId *big.Int + ExtraData []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterERC721BridgeFinalized is a free log retrieval operation binding the contract event 0x1f39bf6707b5d608453e0ae4c067b562bcc4c85c0f562ef5d2c774d2e7f131ac. +// +// Solidity: event ERC721BridgeFinalized(address indexed localToken, address indexed remoteToken, address indexed from, address to, uint256 tokenId, bytes extraData) +func (_L2ERC721Bridge *L2ERC721BridgeFilterer) FilterERC721BridgeFinalized(opts *bind.FilterOpts, localToken []common.Address, remoteToken []common.Address, from []common.Address) (*L2ERC721BridgeERC721BridgeFinalizedIterator, error) { + + var localTokenRule []interface{} + for _, localTokenItem := range localToken { + localTokenRule = append(localTokenRule, localTokenItem) + } + var remoteTokenRule []interface{} + for _, remoteTokenItem := range remoteToken { + remoteTokenRule = append(remoteTokenRule, remoteTokenItem) + } + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + + logs, sub, err := _L2ERC721Bridge.contract.FilterLogs(opts, "ERC721BridgeFinalized", localTokenRule, remoteTokenRule, fromRule) + if err != nil { + return nil, err + } + return &L2ERC721BridgeERC721BridgeFinalizedIterator{contract: _L2ERC721Bridge.contract, event: "ERC721BridgeFinalized", logs: logs, sub: sub}, nil +} + +// WatchERC721BridgeFinalized is a free log subscription operation binding the contract event 0x1f39bf6707b5d608453e0ae4c067b562bcc4c85c0f562ef5d2c774d2e7f131ac. +// +// Solidity: event ERC721BridgeFinalized(address indexed localToken, address indexed remoteToken, address indexed from, address to, uint256 tokenId, bytes extraData) +func (_L2ERC721Bridge *L2ERC721BridgeFilterer) WatchERC721BridgeFinalized(opts *bind.WatchOpts, sink chan<- *L2ERC721BridgeERC721BridgeFinalized, localToken []common.Address, remoteToken []common.Address, from []common.Address) (event.Subscription, error) { + + var localTokenRule []interface{} + for _, localTokenItem := range localToken { + localTokenRule = append(localTokenRule, localTokenItem) + } + var remoteTokenRule []interface{} + for _, remoteTokenItem := range remoteToken { + remoteTokenRule = append(remoteTokenRule, remoteTokenItem) + } + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + + logs, sub, err := _L2ERC721Bridge.contract.WatchLogs(opts, "ERC721BridgeFinalized", localTokenRule, remoteTokenRule, fromRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(L2ERC721BridgeERC721BridgeFinalized) + if err := _L2ERC721Bridge.contract.UnpackLog(event, "ERC721BridgeFinalized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseERC721BridgeFinalized is a log parse operation binding the contract event 0x1f39bf6707b5d608453e0ae4c067b562bcc4c85c0f562ef5d2c774d2e7f131ac. +// +// Solidity: event ERC721BridgeFinalized(address indexed localToken, address indexed remoteToken, address indexed from, address to, uint256 tokenId, bytes extraData) +func (_L2ERC721Bridge *L2ERC721BridgeFilterer) ParseERC721BridgeFinalized(log types.Log) (*L2ERC721BridgeERC721BridgeFinalized, error) { + event := new(L2ERC721BridgeERC721BridgeFinalized) + if err := _L2ERC721Bridge.contract.UnpackLog(event, "ERC721BridgeFinalized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// L2ERC721BridgeERC721BridgeInitiatedIterator is returned from FilterERC721BridgeInitiated and is used to iterate over the raw logs and unpacked data for ERC721BridgeInitiated events raised by the L2ERC721Bridge contract. +type L2ERC721BridgeERC721BridgeInitiatedIterator struct { + Event *L2ERC721BridgeERC721BridgeInitiated // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *L2ERC721BridgeERC721BridgeInitiatedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(L2ERC721BridgeERC721BridgeInitiated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(L2ERC721BridgeERC721BridgeInitiated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *L2ERC721BridgeERC721BridgeInitiatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *L2ERC721BridgeERC721BridgeInitiatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// L2ERC721BridgeERC721BridgeInitiated represents a ERC721BridgeInitiated event raised by the L2ERC721Bridge contract. +type L2ERC721BridgeERC721BridgeInitiated struct { + LocalToken common.Address + RemoteToken common.Address + From common.Address + To common.Address + TokenId *big.Int + ExtraData []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterERC721BridgeInitiated is a free log retrieval operation binding the contract event 0xb7460e2a880f256ebef3406116ff3eee0cee51ebccdc2a40698f87ebb2e9c1a5. +// +// Solidity: event ERC721BridgeInitiated(address indexed localToken, address indexed remoteToken, address indexed from, address to, uint256 tokenId, bytes extraData) +func (_L2ERC721Bridge *L2ERC721BridgeFilterer) FilterERC721BridgeInitiated(opts *bind.FilterOpts, localToken []common.Address, remoteToken []common.Address, from []common.Address) (*L2ERC721BridgeERC721BridgeInitiatedIterator, error) { + + var localTokenRule []interface{} + for _, localTokenItem := range localToken { + localTokenRule = append(localTokenRule, localTokenItem) + } + var remoteTokenRule []interface{} + for _, remoteTokenItem := range remoteToken { + remoteTokenRule = append(remoteTokenRule, remoteTokenItem) + } + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + + logs, sub, err := _L2ERC721Bridge.contract.FilterLogs(opts, "ERC721BridgeInitiated", localTokenRule, remoteTokenRule, fromRule) + if err != nil { + return nil, err + } + return &L2ERC721BridgeERC721BridgeInitiatedIterator{contract: _L2ERC721Bridge.contract, event: "ERC721BridgeInitiated", logs: logs, sub: sub}, nil +} + +// WatchERC721BridgeInitiated is a free log subscription operation binding the contract event 0xb7460e2a880f256ebef3406116ff3eee0cee51ebccdc2a40698f87ebb2e9c1a5. +// +// Solidity: event ERC721BridgeInitiated(address indexed localToken, address indexed remoteToken, address indexed from, address to, uint256 tokenId, bytes extraData) +func (_L2ERC721Bridge *L2ERC721BridgeFilterer) WatchERC721BridgeInitiated(opts *bind.WatchOpts, sink chan<- *L2ERC721BridgeERC721BridgeInitiated, localToken []common.Address, remoteToken []common.Address, from []common.Address) (event.Subscription, error) { + + var localTokenRule []interface{} + for _, localTokenItem := range localToken { + localTokenRule = append(localTokenRule, localTokenItem) + } + var remoteTokenRule []interface{} + for _, remoteTokenItem := range remoteToken { + remoteTokenRule = append(remoteTokenRule, remoteTokenItem) + } + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + + logs, sub, err := _L2ERC721Bridge.contract.WatchLogs(opts, "ERC721BridgeInitiated", localTokenRule, remoteTokenRule, fromRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(L2ERC721BridgeERC721BridgeInitiated) + if err := _L2ERC721Bridge.contract.UnpackLog(event, "ERC721BridgeInitiated", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseERC721BridgeInitiated is a log parse operation binding the contract event 0xb7460e2a880f256ebef3406116ff3eee0cee51ebccdc2a40698f87ebb2e9c1a5. +// +// Solidity: event ERC721BridgeInitiated(address indexed localToken, address indexed remoteToken, address indexed from, address to, uint256 tokenId, bytes extraData) +func (_L2ERC721Bridge *L2ERC721BridgeFilterer) ParseERC721BridgeInitiated(log types.Log) (*L2ERC721BridgeERC721BridgeInitiated, error) { + event := new(L2ERC721BridgeERC721BridgeInitiated) + if err := _L2ERC721Bridge.contract.UnpackLog(event, "ERC721BridgeInitiated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// L2ERC721BridgeInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the L2ERC721Bridge contract. +type L2ERC721BridgeInitializedIterator struct { + Event *L2ERC721BridgeInitialized // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *L2ERC721BridgeInitializedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(L2ERC721BridgeInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(L2ERC721BridgeInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *L2ERC721BridgeInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *L2ERC721BridgeInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// L2ERC721BridgeInitialized represents a Initialized event raised by the L2ERC721Bridge contract. +type L2ERC721BridgeInitialized struct { + Version uint8 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_L2ERC721Bridge *L2ERC721BridgeFilterer) FilterInitialized(opts *bind.FilterOpts) (*L2ERC721BridgeInitializedIterator, error) { + + logs, sub, err := _L2ERC721Bridge.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &L2ERC721BridgeInitializedIterator{contract: _L2ERC721Bridge.contract, event: "Initialized", logs: logs, sub: sub}, nil +} + +// WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_L2ERC721Bridge *L2ERC721BridgeFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *L2ERC721BridgeInitialized) (event.Subscription, error) { + + logs, sub, err := _L2ERC721Bridge.contract.WatchLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(L2ERC721BridgeInitialized) + if err := _L2ERC721Bridge.contract.UnpackLog(event, "Initialized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_L2ERC721Bridge *L2ERC721BridgeFilterer) ParseInitialized(log types.Log) (*L2ERC721BridgeInitialized, error) { + event := new(L2ERC721BridgeInitialized) + if err := _L2ERC721Bridge.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/op-e2e2/bindings/l2outputoracle.go b/op-e2e2/bindings/l2outputoracle.go new file mode 100644 index 000000000000..1d8934c7c838 --- /dev/null +++ b/op-e2e2/bindings/l2outputoracle.go @@ -0,0 +1,1373 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// TypesOutputProposal is an auto generated low-level Go binding around an user-defined struct. +type TypesOutputProposal struct { + OutputRoot [32]byte + Timestamp *big.Int + L2BlockNumber *big.Int +} + +// L2OutputOracleMetaData contains all meta data concerning the L2OutputOracle contract. +var L2OutputOracleMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"CHALLENGER\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"FINALIZATION_PERIOD_SECONDS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"L2_BLOCK_TIME\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"PROPOSER\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"SUBMISSION_INTERVAL\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"challenger\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"computeL2Timestamp\",\"inputs\":[{\"name\":\"_l2BlockNumber\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"deleteL2Outputs\",\"inputs\":[{\"name\":\"_l2OutputIndex\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"finalizationPeriodSeconds\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getL2Output\",\"inputs\":[{\"name\":\"_l2OutputIndex\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structTypes.OutputProposal\",\"components\":[{\"name\":\"outputRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"timestamp\",\"type\":\"uint128\",\"internalType\":\"uint128\"},{\"name\":\"l2BlockNumber\",\"type\":\"uint128\",\"internalType\":\"uint128\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getL2OutputAfter\",\"inputs\":[{\"name\":\"_l2BlockNumber\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structTypes.OutputProposal\",\"components\":[{\"name\":\"outputRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"timestamp\",\"type\":\"uint128\",\"internalType\":\"uint128\"},{\"name\":\"l2BlockNumber\",\"type\":\"uint128\",\"internalType\":\"uint128\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getL2OutputIndexAfter\",\"inputs\":[{\"name\":\"_l2BlockNumber\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_submissionInterval\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_l2BlockTime\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_startingBlockNumber\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_startingTimestamp\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_proposer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_challenger\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_finalizationPeriodSeconds\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"l2BlockTime\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"latestBlockNumber\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"latestOutputIndex\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"nextBlockNumber\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"nextOutputIndex\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"proposeL2Output\",\"inputs\":[{\"name\":\"_outputRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_l2BlockNumber\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_l1BlockHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_l1BlockNumber\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"proposer\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"startingBlockNumber\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"startingTimestamp\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"submissionInterval\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OutputProposed\",\"inputs\":[{\"name\":\"outputRoot\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"l2OutputIndex\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"l2BlockNumber\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"l1Timestamp\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OutputsDeleted\",\"inputs\":[{\"name\":\"prevNextOutputIndex\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"newNextOutputIndex\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"}],\"anonymous\":false}]", + Bin: "0x60806040523480156200001157600080fd5b50620000256001806000808080806200002b565b62000328565b600054610100900460ff16158080156200004c5750600054600160ff909116105b806200007c575062000069306200031960201b6200135d1760201c565b1580156200007c575060005460ff166001145b620000e55760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff19166001179055801562000109576000805461ff0019166101001790555b60008811620001815760405162461bcd60e51b815260206004820152603a60248201527f4c324f75747075744f7261636c653a207375626d697373696f6e20696e74657260448201527f76616c206d7573742062652067726561746572207468616e20300000000000006064820152608401620000dc565b60008711620001f95760405162461bcd60e51b815260206004820152603460248201527f4c324f75747075744f7261636c653a204c3220626c6f636b2074696d65206d7560448201527f73742062652067726561746572207468616e20300000000000000000000000006064820152608401620000dc565b428511156200027f5760405162461bcd60e51b8152602060048201526044602482018190527f4c324f75747075744f7261636c653a207374617274696e67204c322074696d65908201527f7374616d70206d757374206265206c657373207468616e2063757272656e742060648201526374696d6560e01b608482015260a401620000dc565b6004889055600587905560018690556002859055600780546001600160a01b038087166001600160a01b0319928316179092556006805492861692909116919091179055600882905580156200030f576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050505050565b6001600160a01b03163b151590565b6115d580620003386000396000f3fe60806040526004361061018a5760003560e01c806389c44cbb116100d6578063ce5db8d61161007f578063dcec334811610059578063dcec33481461049b578063e1a41bcf146104b0578063f4daa291146104c657600080fd5b8063ce5db8d614610445578063cf8e5cf01461045b578063d1de856c1461047b57600080fd5b8063a25ae557116100b0578063a25ae55714610391578063a8e4fb90146103ed578063bffa7f0f1461041a57600080fd5b806389c44cbb1461034857806393991af3146103685780639aaab6481461037e57600080fd5b806369f16eec1161013857806370872aa51161011257806370872aa5146102fc5780637f00642014610312578063887862721461033257600080fd5b806369f16eec146102a75780636abcf563146102bc5780636b4d98dd146102d157600080fd5b8063529933df11610169578063529933df146101ea578063534db0e2146101ff57806354fd4d501461025157600080fd5b80622134cc1461018f5780631c89c97d146101b35780634599c788146101d5575b600080fd5b34801561019b57600080fd5b506005545b6040519081526020015b60405180910390f35b3480156101bf57600080fd5b506101d36101ce3660046113a2565b6104db565b005b3480156101e157600080fd5b506101a06108b6565b3480156101f657600080fd5b506004546101a0565b34801561020b57600080fd5b5060065461022c9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101aa565b34801561025d57600080fd5b5061029a6040518060400160405280600581526020017f312e382e3000000000000000000000000000000000000000000000000000000081525081565b6040516101aa9190611405565b3480156102b357600080fd5b506101a0610929565b3480156102c857600080fd5b506003546101a0565b3480156102dd57600080fd5b5060065473ffffffffffffffffffffffffffffffffffffffff1661022c565b34801561030857600080fd5b506101a060015481565b34801561031e57600080fd5b506101a061032d366004611478565b61093b565b34801561033e57600080fd5b506101a060025481565b34801561035457600080fd5b506101d3610363366004611478565b610b4f565b34801561037457600080fd5b506101a060055481565b6101d361038c366004611491565b610de9565b34801561039d57600080fd5b506103b16103ac366004611478565b61124a565b60408051825181526020808401516fffffffffffffffffffffffffffffffff9081169183019190915292820151909216908201526060016101aa565b3480156103f957600080fd5b5060075461022c9073ffffffffffffffffffffffffffffffffffffffff1681565b34801561042657600080fd5b5060075473ffffffffffffffffffffffffffffffffffffffff1661022c565b34801561045157600080fd5b506101a060085481565b34801561046757600080fd5b506103b1610476366004611478565b6112de565b34801561048757600080fd5b506101a0610496366004611478565b611316565b3480156104a757600080fd5b506101a0611346565b3480156104bc57600080fd5b506101a060045481565b3480156104d257600080fd5b506008546101a0565b600054610100900460ff16158080156104fb5750600054600160ff909116105b806105155750303b158015610515575060005460ff166001145b6105a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084015b60405180910390fd5b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561060457600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b60008811610694576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f4c324f75747075744f7261636c653a207375626d697373696f6e20696e74657260448201527f76616c206d7573742062652067726561746572207468616e2030000000000000606482015260840161059d565b60008711610724576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603460248201527f4c324f75747075744f7261636c653a204c3220626c6f636b2074696d65206d7560448201527f73742062652067726561746572207468616e2030000000000000000000000000606482015260840161059d565b428511156107db576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526044602482018190527f4c324f75747075744f7261636c653a207374617274696e67204c322074696d65908201527f7374616d70206d757374206265206c657373207468616e2063757272656e742060648201527f74696d6500000000000000000000000000000000000000000000000000000000608482015260a40161059d565b60048890556005879055600186905560028590556007805473ffffffffffffffffffffffffffffffffffffffff8087167fffffffffffffffffffffffff0000000000000000000000000000000000000000928316179092556006805492861692909116919091179055600882905580156108ac57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050505050565b6003546000901561092057600380546108d1906001906114f2565b815481106108e1576108e1611509565b600091825260209091206002909102016001015470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff16919050565b6001545b905090565b600354600090610924906001906114f2565b60006109456108b6565b8211156109fa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604860248201527f4c324f75747075744f7261636c653a2063616e6e6f7420676574206f7574707560448201527f7420666f72206120626c6f636b207468617420686173206e6f74206265656e2060648201527f70726f706f736564000000000000000000000000000000000000000000000000608482015260a40161059d565b600354610aaf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604660248201527f4c324f75747075744f7261636c653a2063616e6e6f7420676574206f7574707560448201527f74206173206e6f206f7574707574732068617665206265656e2070726f706f7360648201527f6564207965740000000000000000000000000000000000000000000000000000608482015260a40161059d565b6003546000905b80821015610b485760006002610acc8385611538565b610ad69190611550565b90508460038281548110610aec57610aec611509565b600091825260209091206002909102016001015470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff161015610b3e57610b37816001611538565b9250610b42565b8091505b50610ab6565b5092915050565b60065473ffffffffffffffffffffffffffffffffffffffff163314610bf6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603e60248201527f4c324f75747075744f7261636c653a206f6e6c7920746865206368616c6c656e60448201527f67657220616464726573732063616e2064656c657465206f7574707574730000606482015260840161059d565b6003548110610cad576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604360248201527f4c324f75747075744f7261636c653a2063616e6e6f742064656c657465206f7560448201527f747075747320616674657220746865206c6174657374206f757470757420696e60648201527f6465780000000000000000000000000000000000000000000000000000000000608482015260a40161059d565b60085460038281548110610cc357610cc3611509565b6000918252602090912060016002909202010154610cf3906fffffffffffffffffffffffffffffffff16426114f2565b10610da6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604660248201527f4c324f75747075744f7261636c653a2063616e6e6f742064656c657465206f7560448201527f74707574732074686174206861766520616c7265616479206265656e2066696e60648201527f616c697a65640000000000000000000000000000000000000000000000000000608482015260a40161059d565b6000610db160035490565b90508160035581817f4ee37ac2c786ec85e87592d3c5c8a1dd66f8496dda3f125d9ea8ca5f657629b660405160405180910390a35050565b60075473ffffffffffffffffffffffffffffffffffffffff163314610eb6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604160248201527f4c324f75747075744f7261636c653a206f6e6c79207468652070726f706f736560448201527f7220616464726573732063616e2070726f706f7365206e6577206f757470757460648201527f7300000000000000000000000000000000000000000000000000000000000000608482015260a40161059d565b610ebe611346565b8314610f72576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604860248201527f4c324f75747075744f7261636c653a20626c6f636b206e756d626572206d757360448201527f7420626520657175616c20746f206e65787420657870656374656420626c6f6360648201527f6b206e756d626572000000000000000000000000000000000000000000000000608482015260a40161059d565b42610f7c84611316565b10611009576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f4c324f75747075744f7261636c653a2063616e6e6f742070726f706f7365204c60448201527f32206f757470757420696e207468652066757475726500000000000000000000606482015260840161059d565b83611096576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f4c324f75747075744f7261636c653a204c32206f75747075742070726f706f7360448201527f616c2063616e6e6f7420626520746865207a65726f2068617368000000000000606482015260840161059d565b81156111525781814014611152576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604960248201527f4c324f75747075744f7261636c653a20626c6f636b206861736820646f65732060448201527f6e6f74206d61746368207468652068617368206174207468652065787065637460648201527f6564206865696768740000000000000000000000000000000000000000000000608482015260a40161059d565b8261115c60035490565b857fa7aaf2512769da4e444e3de247be2564225c2e7a8f74cfe528e46e17d24868e24260405161118e91815260200190565b60405180910390a45050604080516060810182529283526fffffffffffffffffffffffffffffffff4281166020850190815292811691840191825260038054600181018255600091909152935160029094027fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b810194909455915190518216700100000000000000000000000000000000029116177fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c90910155565b60408051606081018252600080825260208201819052918101919091526003828154811061127a5761127a611509565b600091825260209182902060408051606081018252600290930290910180548352600101546fffffffffffffffffffffffffffffffff8082169484019490945270010000000000000000000000000000000090049092169181019190915292915050565b604080516060810182526000808252602082018190529181019190915260036113068361093b565b8154811061127a5761127a611509565b60006005546001548361132991906114f2565b611333919061158b565b6002546113409190611538565b92915050565b60006004546113536108b6565b6109249190611538565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b803573ffffffffffffffffffffffffffffffffffffffff8116811461139d57600080fd5b919050565b600080600080600080600060e0888a0312156113bd57600080fd5b873596506020880135955060408801359450606088013593506113e260808901611379565b92506113f060a08901611379565b915060c0880135905092959891949750929550565b600060208083528351808285015260005b8181101561143257858101830151858201604001528201611416565b81811115611444576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b60006020828403121561148a57600080fd5b5035919050565b600080600080608085870312156114a757600080fd5b5050823594602084013594506040840135936060013592509050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082821015611504576115046114c3565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000821982111561154b5761154b6114c3565b500190565b600082611586577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156115c3576115c36114c3565b50029056fea164736f6c634300080f000a", +} + +// L2OutputOracleABI is the input ABI used to generate the binding from. +// Deprecated: Use L2OutputOracleMetaData.ABI instead. +var L2OutputOracleABI = L2OutputOracleMetaData.ABI + +// L2OutputOracleBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use L2OutputOracleMetaData.Bin instead. +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) (common.Address, *types.Transaction, *L2OutputOracle, error) { + parsed, err := L2OutputOracleMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(L2OutputOracleBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &L2OutputOracle{L2OutputOracleCaller: L2OutputOracleCaller{contract: contract}, L2OutputOracleTransactor: L2OutputOracleTransactor{contract: contract}, L2OutputOracleFilterer: L2OutputOracleFilterer{contract: contract}}, nil +} + +// L2OutputOracle is an auto generated Go binding around an Ethereum contract. +type L2OutputOracle struct { + L2OutputOracleCaller // Read-only binding to the contract + L2OutputOracleTransactor // Write-only binding to the contract + L2OutputOracleFilterer // Log filterer for contract events +} + +// L2OutputOracleCaller is an auto generated read-only Go binding around an Ethereum contract. +type L2OutputOracleCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// L2OutputOracleTransactor is an auto generated write-only Go binding around an Ethereum contract. +type L2OutputOracleTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// L2OutputOracleFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type L2OutputOracleFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// L2OutputOracleSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type L2OutputOracleSession struct { + Contract *L2OutputOracle // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// L2OutputOracleCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type L2OutputOracleCallerSession struct { + Contract *L2OutputOracleCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// L2OutputOracleTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type L2OutputOracleTransactorSession struct { + Contract *L2OutputOracleTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// L2OutputOracleRaw is an auto generated low-level Go binding around an Ethereum contract. +type L2OutputOracleRaw struct { + Contract *L2OutputOracle // Generic contract binding to access the raw methods on +} + +// L2OutputOracleCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type L2OutputOracleCallerRaw struct { + Contract *L2OutputOracleCaller // Generic read-only contract binding to access the raw methods on +} + +// L2OutputOracleTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type L2OutputOracleTransactorRaw struct { + Contract *L2OutputOracleTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewL2OutputOracle creates a new instance of L2OutputOracle, bound to a specific deployed contract. +func NewL2OutputOracle(address common.Address, backend bind.ContractBackend) (*L2OutputOracle, error) { + contract, err := bindL2OutputOracle(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &L2OutputOracle{L2OutputOracleCaller: L2OutputOracleCaller{contract: contract}, L2OutputOracleTransactor: L2OutputOracleTransactor{contract: contract}, L2OutputOracleFilterer: L2OutputOracleFilterer{contract: contract}}, nil +} + +// NewL2OutputOracleCaller creates a new read-only instance of L2OutputOracle, bound to a specific deployed contract. +func NewL2OutputOracleCaller(address common.Address, caller bind.ContractCaller) (*L2OutputOracleCaller, error) { + contract, err := bindL2OutputOracle(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &L2OutputOracleCaller{contract: contract}, nil +} + +// NewL2OutputOracleTransactor creates a new write-only instance of L2OutputOracle, bound to a specific deployed contract. +func NewL2OutputOracleTransactor(address common.Address, transactor bind.ContractTransactor) (*L2OutputOracleTransactor, error) { + contract, err := bindL2OutputOracle(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &L2OutputOracleTransactor{contract: contract}, nil +} + +// NewL2OutputOracleFilterer creates a new log filterer instance of L2OutputOracle, bound to a specific deployed contract. +func NewL2OutputOracleFilterer(address common.Address, filterer bind.ContractFilterer) (*L2OutputOracleFilterer, error) { + contract, err := bindL2OutputOracle(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &L2OutputOracleFilterer{contract: contract}, nil +} + +// bindL2OutputOracle binds a generic wrapper to an already deployed contract. +func bindL2OutputOracle(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(L2OutputOracleABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_L2OutputOracle *L2OutputOracleRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _L2OutputOracle.Contract.L2OutputOracleCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_L2OutputOracle *L2OutputOracleRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _L2OutputOracle.Contract.L2OutputOracleTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_L2OutputOracle *L2OutputOracleRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _L2OutputOracle.Contract.L2OutputOracleTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_L2OutputOracle *L2OutputOracleCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _L2OutputOracle.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_L2OutputOracle *L2OutputOracleTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _L2OutputOracle.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_L2OutputOracle *L2OutputOracleTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _L2OutputOracle.Contract.contract.Transact(opts, method, params...) +} + +// CHALLENGER is a free data retrieval call binding the contract method 0x6b4d98dd. +// +// Solidity: function CHALLENGER() view returns(address) +func (_L2OutputOracle *L2OutputOracleCaller) CHALLENGER(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _L2OutputOracle.contract.Call(opts, &out, "CHALLENGER") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// CHALLENGER is a free data retrieval call binding the contract method 0x6b4d98dd. +// +// Solidity: function CHALLENGER() view returns(address) +func (_L2OutputOracle *L2OutputOracleSession) CHALLENGER() (common.Address, error) { + return _L2OutputOracle.Contract.CHALLENGER(&_L2OutputOracle.CallOpts) +} + +// CHALLENGER is a free data retrieval call binding the contract method 0x6b4d98dd. +// +// Solidity: function CHALLENGER() view returns(address) +func (_L2OutputOracle *L2OutputOracleCallerSession) CHALLENGER() (common.Address, error) { + return _L2OutputOracle.Contract.CHALLENGER(&_L2OutputOracle.CallOpts) +} + +// FINALIZATIONPERIODSECONDS is a free data retrieval call binding the contract method 0xf4daa291. +// +// Solidity: function FINALIZATION_PERIOD_SECONDS() view returns(uint256) +func (_L2OutputOracle *L2OutputOracleCaller) FINALIZATIONPERIODSECONDS(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _L2OutputOracle.contract.Call(opts, &out, "FINALIZATION_PERIOD_SECONDS") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// FINALIZATIONPERIODSECONDS is a free data retrieval call binding the contract method 0xf4daa291. +// +// Solidity: function FINALIZATION_PERIOD_SECONDS() view returns(uint256) +func (_L2OutputOracle *L2OutputOracleSession) FINALIZATIONPERIODSECONDS() (*big.Int, error) { + return _L2OutputOracle.Contract.FINALIZATIONPERIODSECONDS(&_L2OutputOracle.CallOpts) +} + +// FINALIZATIONPERIODSECONDS is a free data retrieval call binding the contract method 0xf4daa291. +// +// Solidity: function FINALIZATION_PERIOD_SECONDS() view returns(uint256) +func (_L2OutputOracle *L2OutputOracleCallerSession) FINALIZATIONPERIODSECONDS() (*big.Int, error) { + return _L2OutputOracle.Contract.FINALIZATIONPERIODSECONDS(&_L2OutputOracle.CallOpts) +} + +// L2BLOCKTIME is a free data retrieval call binding the contract method 0x002134cc. +// +// Solidity: function L2_BLOCK_TIME() view returns(uint256) +func (_L2OutputOracle *L2OutputOracleCaller) L2BLOCKTIME(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _L2OutputOracle.contract.Call(opts, &out, "L2_BLOCK_TIME") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// L2BLOCKTIME is a free data retrieval call binding the contract method 0x002134cc. +// +// Solidity: function L2_BLOCK_TIME() view returns(uint256) +func (_L2OutputOracle *L2OutputOracleSession) L2BLOCKTIME() (*big.Int, error) { + return _L2OutputOracle.Contract.L2BLOCKTIME(&_L2OutputOracle.CallOpts) +} + +// L2BLOCKTIME is a free data retrieval call binding the contract method 0x002134cc. +// +// Solidity: function L2_BLOCK_TIME() view returns(uint256) +func (_L2OutputOracle *L2OutputOracleCallerSession) L2BLOCKTIME() (*big.Int, error) { + return _L2OutputOracle.Contract.L2BLOCKTIME(&_L2OutputOracle.CallOpts) +} + +// PROPOSER is a free data retrieval call binding the contract method 0xbffa7f0f. +// +// 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, "PROPOSER") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// PROPOSER is a free data retrieval call binding the contract method 0xbffa7f0f. +// +// Solidity: function PROPOSER() view returns(address) +func (_L2OutputOracle *L2OutputOracleSession) PROPOSER() (common.Address, error) { + return _L2OutputOracle.Contract.PROPOSER(&_L2OutputOracle.CallOpts) +} + +// PROPOSER is a free data retrieval call binding the contract method 0xbffa7f0f. +// +// Solidity: function PROPOSER() view returns(address) +func (_L2OutputOracle *L2OutputOracleCallerSession) PROPOSER() (common.Address, error) { + return _L2OutputOracle.Contract.PROPOSER(&_L2OutputOracle.CallOpts) +} + +// SUBMISSIONINTERVAL is a free data retrieval call binding the contract method 0x529933df. +// +// Solidity: function SUBMISSION_INTERVAL() view returns(uint256) +func (_L2OutputOracle *L2OutputOracleCaller) SUBMISSIONINTERVAL(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _L2OutputOracle.contract.Call(opts, &out, "SUBMISSION_INTERVAL") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// SUBMISSIONINTERVAL is a free data retrieval call binding the contract method 0x529933df. +// +// Solidity: function SUBMISSION_INTERVAL() view returns(uint256) +func (_L2OutputOracle *L2OutputOracleSession) SUBMISSIONINTERVAL() (*big.Int, error) { + return _L2OutputOracle.Contract.SUBMISSIONINTERVAL(&_L2OutputOracle.CallOpts) +} + +// SUBMISSIONINTERVAL is a free data retrieval call binding the contract method 0x529933df. +// +// Solidity: function SUBMISSION_INTERVAL() view returns(uint256) +func (_L2OutputOracle *L2OutputOracleCallerSession) SUBMISSIONINTERVAL() (*big.Int, error) { + return _L2OutputOracle.Contract.SUBMISSIONINTERVAL(&_L2OutputOracle.CallOpts) +} + +// Challenger is a free data retrieval call binding the contract method 0x534db0e2. +// +// Solidity: function challenger() view returns(address) +func (_L2OutputOracle *L2OutputOracleCaller) Challenger(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _L2OutputOracle.contract.Call(opts, &out, "challenger") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Challenger is a free data retrieval call binding the contract method 0x534db0e2. +// +// Solidity: function challenger() view returns(address) +func (_L2OutputOracle *L2OutputOracleSession) Challenger() (common.Address, error) { + return _L2OutputOracle.Contract.Challenger(&_L2OutputOracle.CallOpts) +} + +// Challenger is a free data retrieval call binding the contract method 0x534db0e2. +// +// Solidity: function challenger() view returns(address) +func (_L2OutputOracle *L2OutputOracleCallerSession) Challenger() (common.Address, error) { + return _L2OutputOracle.Contract.Challenger(&_L2OutputOracle.CallOpts) +} + +// ComputeL2Timestamp is a free data retrieval call binding the contract method 0xd1de856c. +// +// Solidity: function computeL2Timestamp(uint256 _l2BlockNumber) view returns(uint256) +func (_L2OutputOracle *L2OutputOracleCaller) ComputeL2Timestamp(opts *bind.CallOpts, _l2BlockNumber *big.Int) (*big.Int, error) { + var out []interface{} + err := _L2OutputOracle.contract.Call(opts, &out, "computeL2Timestamp", _l2BlockNumber) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// ComputeL2Timestamp is a free data retrieval call binding the contract method 0xd1de856c. +// +// Solidity: function computeL2Timestamp(uint256 _l2BlockNumber) view returns(uint256) +func (_L2OutputOracle *L2OutputOracleSession) ComputeL2Timestamp(_l2BlockNumber *big.Int) (*big.Int, error) { + return _L2OutputOracle.Contract.ComputeL2Timestamp(&_L2OutputOracle.CallOpts, _l2BlockNumber) +} + +// ComputeL2Timestamp is a free data retrieval call binding the contract method 0xd1de856c. +// +// Solidity: function computeL2Timestamp(uint256 _l2BlockNumber) view returns(uint256) +func (_L2OutputOracle *L2OutputOracleCallerSession) ComputeL2Timestamp(_l2BlockNumber *big.Int) (*big.Int, error) { + return _L2OutputOracle.Contract.ComputeL2Timestamp(&_L2OutputOracle.CallOpts, _l2BlockNumber) +} + +// FinalizationPeriodSeconds is a free data retrieval call binding the contract method 0xce5db8d6. +// +// Solidity: function finalizationPeriodSeconds() view returns(uint256) +func (_L2OutputOracle *L2OutputOracleCaller) FinalizationPeriodSeconds(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _L2OutputOracle.contract.Call(opts, &out, "finalizationPeriodSeconds") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// FinalizationPeriodSeconds is a free data retrieval call binding the contract method 0xce5db8d6. +// +// Solidity: function finalizationPeriodSeconds() view returns(uint256) +func (_L2OutputOracle *L2OutputOracleSession) FinalizationPeriodSeconds() (*big.Int, error) { + return _L2OutputOracle.Contract.FinalizationPeriodSeconds(&_L2OutputOracle.CallOpts) +} + +// FinalizationPeriodSeconds is a free data retrieval call binding the contract method 0xce5db8d6. +// +// Solidity: function finalizationPeriodSeconds() view returns(uint256) +func (_L2OutputOracle *L2OutputOracleCallerSession) FinalizationPeriodSeconds() (*big.Int, error) { + return _L2OutputOracle.Contract.FinalizationPeriodSeconds(&_L2OutputOracle.CallOpts) +} + +// GetL2Output is a free data retrieval call binding the contract method 0xa25ae557. +// +// Solidity: function getL2Output(uint256 _l2OutputIndex) view returns((bytes32,uint128,uint128)) +func (_L2OutputOracle *L2OutputOracleCaller) GetL2Output(opts *bind.CallOpts, _l2OutputIndex *big.Int) (TypesOutputProposal, error) { + var out []interface{} + err := _L2OutputOracle.contract.Call(opts, &out, "getL2Output", _l2OutputIndex) + + if err != nil { + return *new(TypesOutputProposal), err + } + + out0 := *abi.ConvertType(out[0], new(TypesOutputProposal)).(*TypesOutputProposal) + + return out0, err + +} + +// GetL2Output is a free data retrieval call binding the contract method 0xa25ae557. +// +// Solidity: function getL2Output(uint256 _l2OutputIndex) view returns((bytes32,uint128,uint128)) +func (_L2OutputOracle *L2OutputOracleSession) GetL2Output(_l2OutputIndex *big.Int) (TypesOutputProposal, error) { + return _L2OutputOracle.Contract.GetL2Output(&_L2OutputOracle.CallOpts, _l2OutputIndex) +} + +// GetL2Output is a free data retrieval call binding the contract method 0xa25ae557. +// +// Solidity: function getL2Output(uint256 _l2OutputIndex) view returns((bytes32,uint128,uint128)) +func (_L2OutputOracle *L2OutputOracleCallerSession) GetL2Output(_l2OutputIndex *big.Int) (TypesOutputProposal, error) { + return _L2OutputOracle.Contract.GetL2Output(&_L2OutputOracle.CallOpts, _l2OutputIndex) +} + +// GetL2OutputAfter is a free data retrieval call binding the contract method 0xcf8e5cf0. +// +// Solidity: function getL2OutputAfter(uint256 _l2BlockNumber) view returns((bytes32,uint128,uint128)) +func (_L2OutputOracle *L2OutputOracleCaller) GetL2OutputAfter(opts *bind.CallOpts, _l2BlockNumber *big.Int) (TypesOutputProposal, error) { + var out []interface{} + err := _L2OutputOracle.contract.Call(opts, &out, "getL2OutputAfter", _l2BlockNumber) + + if err != nil { + return *new(TypesOutputProposal), err + } + + out0 := *abi.ConvertType(out[0], new(TypesOutputProposal)).(*TypesOutputProposal) + + return out0, err + +} + +// GetL2OutputAfter is a free data retrieval call binding the contract method 0xcf8e5cf0. +// +// Solidity: function getL2OutputAfter(uint256 _l2BlockNumber) view returns((bytes32,uint128,uint128)) +func (_L2OutputOracle *L2OutputOracleSession) GetL2OutputAfter(_l2BlockNumber *big.Int) (TypesOutputProposal, error) { + return _L2OutputOracle.Contract.GetL2OutputAfter(&_L2OutputOracle.CallOpts, _l2BlockNumber) +} + +// GetL2OutputAfter is a free data retrieval call binding the contract method 0xcf8e5cf0. +// +// Solidity: function getL2OutputAfter(uint256 _l2BlockNumber) view returns((bytes32,uint128,uint128)) +func (_L2OutputOracle *L2OutputOracleCallerSession) GetL2OutputAfter(_l2BlockNumber *big.Int) (TypesOutputProposal, error) { + return _L2OutputOracle.Contract.GetL2OutputAfter(&_L2OutputOracle.CallOpts, _l2BlockNumber) +} + +// GetL2OutputIndexAfter is a free data retrieval call binding the contract method 0x7f006420. +// +// Solidity: function getL2OutputIndexAfter(uint256 _l2BlockNumber) view returns(uint256) +func (_L2OutputOracle *L2OutputOracleCaller) GetL2OutputIndexAfter(opts *bind.CallOpts, _l2BlockNumber *big.Int) (*big.Int, error) { + var out []interface{} + err := _L2OutputOracle.contract.Call(opts, &out, "getL2OutputIndexAfter", _l2BlockNumber) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetL2OutputIndexAfter is a free data retrieval call binding the contract method 0x7f006420. +// +// Solidity: function getL2OutputIndexAfter(uint256 _l2BlockNumber) view returns(uint256) +func (_L2OutputOracle *L2OutputOracleSession) GetL2OutputIndexAfter(_l2BlockNumber *big.Int) (*big.Int, error) { + return _L2OutputOracle.Contract.GetL2OutputIndexAfter(&_L2OutputOracle.CallOpts, _l2BlockNumber) +} + +// GetL2OutputIndexAfter is a free data retrieval call binding the contract method 0x7f006420. +// +// Solidity: function getL2OutputIndexAfter(uint256 _l2BlockNumber) view returns(uint256) +func (_L2OutputOracle *L2OutputOracleCallerSession) GetL2OutputIndexAfter(_l2BlockNumber *big.Int) (*big.Int, error) { + return _L2OutputOracle.Contract.GetL2OutputIndexAfter(&_L2OutputOracle.CallOpts, _l2BlockNumber) +} + +// L2BlockTime is a free data retrieval call binding the contract method 0x93991af3. +// +// Solidity: function l2BlockTime() view returns(uint256) +func (_L2OutputOracle *L2OutputOracleCaller) L2BlockTime(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _L2OutputOracle.contract.Call(opts, &out, "l2BlockTime") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// L2BlockTime is a free data retrieval call binding the contract method 0x93991af3. +// +// Solidity: function l2BlockTime() view returns(uint256) +func (_L2OutputOracle *L2OutputOracleSession) L2BlockTime() (*big.Int, error) { + return _L2OutputOracle.Contract.L2BlockTime(&_L2OutputOracle.CallOpts) +} + +// L2BlockTime is a free data retrieval call binding the contract method 0x93991af3. +// +// Solidity: function l2BlockTime() view returns(uint256) +func (_L2OutputOracle *L2OutputOracleCallerSession) L2BlockTime() (*big.Int, error) { + return _L2OutputOracle.Contract.L2BlockTime(&_L2OutputOracle.CallOpts) +} + +// LatestBlockNumber is a free data retrieval call binding the contract method 0x4599c788. +// +// Solidity: function latestBlockNumber() view returns(uint256) +func (_L2OutputOracle *L2OutputOracleCaller) LatestBlockNumber(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _L2OutputOracle.contract.Call(opts, &out, "latestBlockNumber") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// LatestBlockNumber is a free data retrieval call binding the contract method 0x4599c788. +// +// Solidity: function latestBlockNumber() view returns(uint256) +func (_L2OutputOracle *L2OutputOracleSession) LatestBlockNumber() (*big.Int, error) { + return _L2OutputOracle.Contract.LatestBlockNumber(&_L2OutputOracle.CallOpts) +} + +// LatestBlockNumber is a free data retrieval call binding the contract method 0x4599c788. +// +// Solidity: function latestBlockNumber() view returns(uint256) +func (_L2OutputOracle *L2OutputOracleCallerSession) LatestBlockNumber() (*big.Int, error) { + return _L2OutputOracle.Contract.LatestBlockNumber(&_L2OutputOracle.CallOpts) +} + +// LatestOutputIndex is a free data retrieval call binding the contract method 0x69f16eec. +// +// Solidity: function latestOutputIndex() view returns(uint256) +func (_L2OutputOracle *L2OutputOracleCaller) LatestOutputIndex(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _L2OutputOracle.contract.Call(opts, &out, "latestOutputIndex") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// LatestOutputIndex is a free data retrieval call binding the contract method 0x69f16eec. +// +// Solidity: function latestOutputIndex() view returns(uint256) +func (_L2OutputOracle *L2OutputOracleSession) LatestOutputIndex() (*big.Int, error) { + return _L2OutputOracle.Contract.LatestOutputIndex(&_L2OutputOracle.CallOpts) +} + +// LatestOutputIndex is a free data retrieval call binding the contract method 0x69f16eec. +// +// Solidity: function latestOutputIndex() view returns(uint256) +func (_L2OutputOracle *L2OutputOracleCallerSession) LatestOutputIndex() (*big.Int, error) { + return _L2OutputOracle.Contract.LatestOutputIndex(&_L2OutputOracle.CallOpts) +} + +// NextBlockNumber is a free data retrieval call binding the contract method 0xdcec3348. +// +// Solidity: function nextBlockNumber() view returns(uint256) +func (_L2OutputOracle *L2OutputOracleCaller) NextBlockNumber(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _L2OutputOracle.contract.Call(opts, &out, "nextBlockNumber") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// NextBlockNumber is a free data retrieval call binding the contract method 0xdcec3348. +// +// Solidity: function nextBlockNumber() view returns(uint256) +func (_L2OutputOracle *L2OutputOracleSession) NextBlockNumber() (*big.Int, error) { + return _L2OutputOracle.Contract.NextBlockNumber(&_L2OutputOracle.CallOpts) +} + +// NextBlockNumber is a free data retrieval call binding the contract method 0xdcec3348. +// +// Solidity: function nextBlockNumber() view returns(uint256) +func (_L2OutputOracle *L2OutputOracleCallerSession) NextBlockNumber() (*big.Int, error) { + return _L2OutputOracle.Contract.NextBlockNumber(&_L2OutputOracle.CallOpts) +} + +// NextOutputIndex is a free data retrieval call binding the contract method 0x6abcf563. +// +// Solidity: function nextOutputIndex() view returns(uint256) +func (_L2OutputOracle *L2OutputOracleCaller) NextOutputIndex(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _L2OutputOracle.contract.Call(opts, &out, "nextOutputIndex") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// NextOutputIndex is a free data retrieval call binding the contract method 0x6abcf563. +// +// Solidity: function nextOutputIndex() view returns(uint256) +func (_L2OutputOracle *L2OutputOracleSession) NextOutputIndex() (*big.Int, error) { + return _L2OutputOracle.Contract.NextOutputIndex(&_L2OutputOracle.CallOpts) +} + +// NextOutputIndex is a free data retrieval call binding the contract method 0x6abcf563. +// +// Solidity: function nextOutputIndex() view returns(uint256) +func (_L2OutputOracle *L2OutputOracleCallerSession) NextOutputIndex() (*big.Int, error) { + return _L2OutputOracle.Contract.NextOutputIndex(&_L2OutputOracle.CallOpts) +} + +// Proposer is a free data retrieval call binding the contract method 0xa8e4fb90. +// +// 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, "proposer") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Proposer is a free data retrieval call binding the contract method 0xa8e4fb90. +// +// Solidity: function proposer() view returns(address) +func (_L2OutputOracle *L2OutputOracleSession) Proposer() (common.Address, error) { + return _L2OutputOracle.Contract.Proposer(&_L2OutputOracle.CallOpts) +} + +// Proposer is a free data retrieval call binding the contract method 0xa8e4fb90. +// +// Solidity: function proposer() view returns(address) +func (_L2OutputOracle *L2OutputOracleCallerSession) Proposer() (common.Address, error) { + return _L2OutputOracle.Contract.Proposer(&_L2OutputOracle.CallOpts) +} + +// StartingBlockNumber is a free data retrieval call binding the contract method 0x70872aa5. +// +// Solidity: function startingBlockNumber() view returns(uint256) +func (_L2OutputOracle *L2OutputOracleCaller) StartingBlockNumber(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _L2OutputOracle.contract.Call(opts, &out, "startingBlockNumber") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// StartingBlockNumber is a free data retrieval call binding the contract method 0x70872aa5. +// +// Solidity: function startingBlockNumber() view returns(uint256) +func (_L2OutputOracle *L2OutputOracleSession) StartingBlockNumber() (*big.Int, error) { + return _L2OutputOracle.Contract.StartingBlockNumber(&_L2OutputOracle.CallOpts) +} + +// StartingBlockNumber is a free data retrieval call binding the contract method 0x70872aa5. +// +// Solidity: function startingBlockNumber() view returns(uint256) +func (_L2OutputOracle *L2OutputOracleCallerSession) StartingBlockNumber() (*big.Int, error) { + return _L2OutputOracle.Contract.StartingBlockNumber(&_L2OutputOracle.CallOpts) +} + +// StartingTimestamp is a free data retrieval call binding the contract method 0x88786272. +// +// Solidity: function startingTimestamp() view returns(uint256) +func (_L2OutputOracle *L2OutputOracleCaller) StartingTimestamp(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _L2OutputOracle.contract.Call(opts, &out, "startingTimestamp") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// StartingTimestamp is a free data retrieval call binding the contract method 0x88786272. +// +// Solidity: function startingTimestamp() view returns(uint256) +func (_L2OutputOracle *L2OutputOracleSession) StartingTimestamp() (*big.Int, error) { + return _L2OutputOracle.Contract.StartingTimestamp(&_L2OutputOracle.CallOpts) +} + +// StartingTimestamp is a free data retrieval call binding the contract method 0x88786272. +// +// Solidity: function startingTimestamp() view returns(uint256) +func (_L2OutputOracle *L2OutputOracleCallerSession) StartingTimestamp() (*big.Int, error) { + return _L2OutputOracle.Contract.StartingTimestamp(&_L2OutputOracle.CallOpts) +} + +// SubmissionInterval is a free data retrieval call binding the contract method 0xe1a41bcf. +// +// Solidity: function submissionInterval() view returns(uint256) +func (_L2OutputOracle *L2OutputOracleCaller) SubmissionInterval(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _L2OutputOracle.contract.Call(opts, &out, "submissionInterval") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// SubmissionInterval is a free data retrieval call binding the contract method 0xe1a41bcf. +// +// Solidity: function submissionInterval() view returns(uint256) +func (_L2OutputOracle *L2OutputOracleSession) SubmissionInterval() (*big.Int, error) { + return _L2OutputOracle.Contract.SubmissionInterval(&_L2OutputOracle.CallOpts) +} + +// SubmissionInterval is a free data retrieval call binding the contract method 0xe1a41bcf. +// +// Solidity: function submissionInterval() view returns(uint256) +func (_L2OutputOracle *L2OutputOracleCallerSession) SubmissionInterval() (*big.Int, error) { + return _L2OutputOracle.Contract.SubmissionInterval(&_L2OutputOracle.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// 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 + +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_L2OutputOracle *L2OutputOracleSession) Version() (string, error) { + return _L2OutputOracle.Contract.Version(&_L2OutputOracle.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_L2OutputOracle *L2OutputOracleCallerSession) Version() (string, error) { + return _L2OutputOracle.Contract.Version(&_L2OutputOracle.CallOpts) +} + +// DeleteL2Outputs is a paid mutator transaction binding the contract method 0x89c44cbb. +// +// Solidity: function deleteL2Outputs(uint256 _l2OutputIndex) returns() +func (_L2OutputOracle *L2OutputOracleTransactor) DeleteL2Outputs(opts *bind.TransactOpts, _l2OutputIndex *big.Int) (*types.Transaction, error) { + return _L2OutputOracle.contract.Transact(opts, "deleteL2Outputs", _l2OutputIndex) +} + +// DeleteL2Outputs is a paid mutator transaction binding the contract method 0x89c44cbb. +// +// Solidity: function deleteL2Outputs(uint256 _l2OutputIndex) returns() +func (_L2OutputOracle *L2OutputOracleSession) DeleteL2Outputs(_l2OutputIndex *big.Int) (*types.Transaction, error) { + return _L2OutputOracle.Contract.DeleteL2Outputs(&_L2OutputOracle.TransactOpts, _l2OutputIndex) +} + +// DeleteL2Outputs is a paid mutator transaction binding the contract method 0x89c44cbb. +// +// Solidity: function deleteL2Outputs(uint256 _l2OutputIndex) returns() +func (_L2OutputOracle *L2OutputOracleTransactorSession) DeleteL2Outputs(_l2OutputIndex *big.Int) (*types.Transaction, error) { + return _L2OutputOracle.Contract.DeleteL2Outputs(&_L2OutputOracle.TransactOpts, _l2OutputIndex) +} + +// Initialize is a paid mutator transaction binding the contract method 0x1c89c97d. +// +// Solidity: function initialize(uint256 _submissionInterval, uint256 _l2BlockTime, uint256 _startingBlockNumber, uint256 _startingTimestamp, address _proposer, address _challenger, uint256 _finalizationPeriodSeconds) returns() +func (_L2OutputOracle *L2OutputOracleTransactor) Initialize(opts *bind.TransactOpts, _submissionInterval *big.Int, _l2BlockTime *big.Int, _startingBlockNumber *big.Int, _startingTimestamp *big.Int, _proposer common.Address, _challenger common.Address, _finalizationPeriodSeconds *big.Int) (*types.Transaction, error) { + return _L2OutputOracle.contract.Transact(opts, "initialize", _submissionInterval, _l2BlockTime, _startingBlockNumber, _startingTimestamp, _proposer, _challenger, _finalizationPeriodSeconds) +} + +// Initialize is a paid mutator transaction binding the contract method 0x1c89c97d. +// +// Solidity: function initialize(uint256 _submissionInterval, uint256 _l2BlockTime, uint256 _startingBlockNumber, uint256 _startingTimestamp, address _proposer, address _challenger, uint256 _finalizationPeriodSeconds) returns() +func (_L2OutputOracle *L2OutputOracleSession) Initialize(_submissionInterval *big.Int, _l2BlockTime *big.Int, _startingBlockNumber *big.Int, _startingTimestamp *big.Int, _proposer common.Address, _challenger common.Address, _finalizationPeriodSeconds *big.Int) (*types.Transaction, error) { + return _L2OutputOracle.Contract.Initialize(&_L2OutputOracle.TransactOpts, _submissionInterval, _l2BlockTime, _startingBlockNumber, _startingTimestamp, _proposer, _challenger, _finalizationPeriodSeconds) +} + +// Initialize is a paid mutator transaction binding the contract method 0x1c89c97d. +// +// Solidity: function initialize(uint256 _submissionInterval, uint256 _l2BlockTime, uint256 _startingBlockNumber, uint256 _startingTimestamp, address _proposer, address _challenger, uint256 _finalizationPeriodSeconds) returns() +func (_L2OutputOracle *L2OutputOracleTransactorSession) Initialize(_submissionInterval *big.Int, _l2BlockTime *big.Int, _startingBlockNumber *big.Int, _startingTimestamp *big.Int, _proposer common.Address, _challenger common.Address, _finalizationPeriodSeconds *big.Int) (*types.Transaction, error) { + return _L2OutputOracle.Contract.Initialize(&_L2OutputOracle.TransactOpts, _submissionInterval, _l2BlockTime, _startingBlockNumber, _startingTimestamp, _proposer, _challenger, _finalizationPeriodSeconds) +} + +// 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) +} + +// L2OutputOracleInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the L2OutputOracle contract. +type L2OutputOracleInitializedIterator struct { + Event *L2OutputOracleInitialized // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *L2OutputOracleInitializedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(L2OutputOracleInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(L2OutputOracleInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *L2OutputOracleInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *L2OutputOracleInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// L2OutputOracleInitialized represents a Initialized event raised by the L2OutputOracle contract. +type L2OutputOracleInitialized struct { + Version uint8 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_L2OutputOracle *L2OutputOracleFilterer) FilterInitialized(opts *bind.FilterOpts) (*L2OutputOracleInitializedIterator, error) { + + logs, sub, err := _L2OutputOracle.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &L2OutputOracleInitializedIterator{contract: _L2OutputOracle.contract, event: "Initialized", logs: logs, sub: sub}, nil +} + +// WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_L2OutputOracle *L2OutputOracleFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *L2OutputOracleInitialized) (event.Subscription, error) { + + logs, sub, err := _L2OutputOracle.contract.WatchLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(L2OutputOracleInitialized) + if err := _L2OutputOracle.contract.UnpackLog(event, "Initialized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_L2OutputOracle *L2OutputOracleFilterer) ParseInitialized(log types.Log) (*L2OutputOracleInitialized, error) { + event := new(L2OutputOracleInitialized) + if err := _L2OutputOracle.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *L2OutputOracleOutputProposedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(L2OutputOracleOutputProposed) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(L2OutputOracleOutputProposed) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *L2OutputOracleOutputProposedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *L2OutputOracleOutputProposedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// L2OutputOracleOutputProposed represents a OutputProposed event raised by the L2OutputOracle contract. +type L2OutputOracleOutputProposed struct { + OutputRoot [32]byte + L2OutputIndex *big.Int + L2BlockNumber *big.Int + L1Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOutputProposed is a free log retrieval operation binding the contract event 0xa7aaf2512769da4e444e3de247be2564225c2e7a8f74cfe528e46e17d24868e2. +// +// Solidity: event OutputProposed(bytes32 indexed outputRoot, uint256 indexed l2OutputIndex, uint256 indexed l2BlockNumber, uint256 l1Timestamp) +func (_L2OutputOracle *L2OutputOracleFilterer) FilterOutputProposed(opts *bind.FilterOpts, outputRoot [][32]byte, l2OutputIndex []*big.Int, l2BlockNumber []*big.Int) (*L2OutputOracleOutputProposedIterator, error) { + + var outputRootRule []interface{} + for _, outputRootItem := range outputRoot { + outputRootRule = append(outputRootRule, outputRootItem) + } + var l2OutputIndexRule []interface{} + for _, l2OutputIndexItem := range l2OutputIndex { + l2OutputIndexRule = append(l2OutputIndexRule, l2OutputIndexItem) + } + var l2BlockNumberRule []interface{} + for _, l2BlockNumberItem := range l2BlockNumber { + l2BlockNumberRule = append(l2BlockNumberRule, l2BlockNumberItem) + } + + logs, sub, err := _L2OutputOracle.contract.FilterLogs(opts, "OutputProposed", outputRootRule, l2OutputIndexRule, l2BlockNumberRule) + if err != nil { + return nil, err + } + return &L2OutputOracleOutputProposedIterator{contract: _L2OutputOracle.contract, event: "OutputProposed", logs: logs, sub: sub}, nil +} + +// WatchOutputProposed is a free log subscription operation binding the contract event 0xa7aaf2512769da4e444e3de247be2564225c2e7a8f74cfe528e46e17d24868e2. +// +// Solidity: event OutputProposed(bytes32 indexed outputRoot, uint256 indexed l2OutputIndex, uint256 indexed l2BlockNumber, uint256 l1Timestamp) +func (_L2OutputOracle *L2OutputOracleFilterer) WatchOutputProposed(opts *bind.WatchOpts, sink chan<- *L2OutputOracleOutputProposed, outputRoot [][32]byte, l2OutputIndex []*big.Int, l2BlockNumber []*big.Int) (event.Subscription, error) { + + var outputRootRule []interface{} + for _, outputRootItem := range outputRoot { + outputRootRule = append(outputRootRule, outputRootItem) + } + var l2OutputIndexRule []interface{} + for _, l2OutputIndexItem := range l2OutputIndex { + l2OutputIndexRule = append(l2OutputIndexRule, l2OutputIndexItem) + } + var l2BlockNumberRule []interface{} + for _, l2BlockNumberItem := range l2BlockNumber { + l2BlockNumberRule = append(l2BlockNumberRule, l2BlockNumberItem) + } + + logs, sub, err := _L2OutputOracle.contract.WatchLogs(opts, "OutputProposed", outputRootRule, l2OutputIndexRule, l2BlockNumberRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(L2OutputOracleOutputProposed) + if err := _L2OutputOracle.contract.UnpackLog(event, "OutputProposed", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseOutputProposed is a log parse operation binding the contract event 0xa7aaf2512769da4e444e3de247be2564225c2e7a8f74cfe528e46e17d24868e2. +// +// Solidity: event OutputProposed(bytes32 indexed outputRoot, uint256 indexed l2OutputIndex, uint256 indexed l2BlockNumber, uint256 l1Timestamp) +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 + return event, nil +} + +// L2OutputOracleOutputsDeletedIterator is returned from FilterOutputsDeleted and is used to iterate over the raw logs and unpacked data for OutputsDeleted events raised by the L2OutputOracle contract. +type L2OutputOracleOutputsDeletedIterator struct { + Event *L2OutputOracleOutputsDeleted // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *L2OutputOracleOutputsDeletedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(L2OutputOracleOutputsDeleted) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(L2OutputOracleOutputsDeleted) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *L2OutputOracleOutputsDeletedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *L2OutputOracleOutputsDeletedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// L2OutputOracleOutputsDeleted represents a OutputsDeleted event raised by the L2OutputOracle contract. +type L2OutputOracleOutputsDeleted struct { + PrevNextOutputIndex *big.Int + NewNextOutputIndex *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOutputsDeleted is a free log retrieval operation binding the contract event 0x4ee37ac2c786ec85e87592d3c5c8a1dd66f8496dda3f125d9ea8ca5f657629b6. +// +// Solidity: event OutputsDeleted(uint256 indexed prevNextOutputIndex, uint256 indexed newNextOutputIndex) +func (_L2OutputOracle *L2OutputOracleFilterer) FilterOutputsDeleted(opts *bind.FilterOpts, prevNextOutputIndex []*big.Int, newNextOutputIndex []*big.Int) (*L2OutputOracleOutputsDeletedIterator, error) { + + var prevNextOutputIndexRule []interface{} + for _, prevNextOutputIndexItem := range prevNextOutputIndex { + prevNextOutputIndexRule = append(prevNextOutputIndexRule, prevNextOutputIndexItem) + } + var newNextOutputIndexRule []interface{} + for _, newNextOutputIndexItem := range newNextOutputIndex { + newNextOutputIndexRule = append(newNextOutputIndexRule, newNextOutputIndexItem) + } + + logs, sub, err := _L2OutputOracle.contract.FilterLogs(opts, "OutputsDeleted", prevNextOutputIndexRule, newNextOutputIndexRule) + if err != nil { + return nil, err + } + return &L2OutputOracleOutputsDeletedIterator{contract: _L2OutputOracle.contract, event: "OutputsDeleted", logs: logs, sub: sub}, nil +} + +// WatchOutputsDeleted is a free log subscription operation binding the contract event 0x4ee37ac2c786ec85e87592d3c5c8a1dd66f8496dda3f125d9ea8ca5f657629b6. +// +// Solidity: event OutputsDeleted(uint256 indexed prevNextOutputIndex, uint256 indexed newNextOutputIndex) +func (_L2OutputOracle *L2OutputOracleFilterer) WatchOutputsDeleted(opts *bind.WatchOpts, sink chan<- *L2OutputOracleOutputsDeleted, prevNextOutputIndex []*big.Int, newNextOutputIndex []*big.Int) (event.Subscription, error) { + + var prevNextOutputIndexRule []interface{} + for _, prevNextOutputIndexItem := range prevNextOutputIndex { + prevNextOutputIndexRule = append(prevNextOutputIndexRule, prevNextOutputIndexItem) + } + var newNextOutputIndexRule []interface{} + for _, newNextOutputIndexItem := range newNextOutputIndex { + newNextOutputIndexRule = append(newNextOutputIndexRule, newNextOutputIndexItem) + } + + logs, sub, err := _L2OutputOracle.contract.WatchLogs(opts, "OutputsDeleted", prevNextOutputIndexRule, newNextOutputIndexRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(L2OutputOracleOutputsDeleted) + if err := _L2OutputOracle.contract.UnpackLog(event, "OutputsDeleted", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseOutputsDeleted is a log parse operation binding the contract event 0x4ee37ac2c786ec85e87592d3c5c8a1dd66f8496dda3f125d9ea8ca5f657629b6. +// +// Solidity: event OutputsDeleted(uint256 indexed prevNextOutputIndex, uint256 indexed newNextOutputIndex) +func (_L2OutputOracle *L2OutputOracleFilterer) ParseOutputsDeleted(log types.Log) (*L2OutputOracleOutputsDeleted, error) { + event := new(L2OutputOracleOutputsDeleted) + if err := _L2OutputOracle.contract.UnpackLog(event, "OutputsDeleted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/op-e2e2/bindings/l2standardbridge.go b/op-e2e2/bindings/l2standardbridge.go new file mode 100644 index 000000000000..f303cfb1eaba --- /dev/null +++ b/op-e2e2/bindings/l2standardbridge.go @@ -0,0 +1,1785 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// L2StandardBridgeMetaData contains all meta data concerning the L2StandardBridge contract. +var L2StandardBridgeMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"MESSENGER\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractCrossDomainMessenger\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"OTHER_BRIDGE\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractStandardBridge\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"bridgeERC20\",\"inputs\":[{\"name\":\"_localToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_remoteToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_minGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"_extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"bridgeERC20To\",\"inputs\":[{\"name\":\"_localToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_remoteToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_minGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"_extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"bridgeETH\",\"inputs\":[{\"name\":\"_minGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"_extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"bridgeETHTo\",\"inputs\":[{\"name\":\"_to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_minGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"_extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"deposits\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"finalizeBridgeERC20\",\"inputs\":[{\"name\":\"_localToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_remoteToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_from\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"finalizeBridgeETH\",\"inputs\":[{\"name\":\"_from\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"finalizeDeposit\",\"inputs\":[{\"name\":\"_l1Token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_l2Token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_from\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_otherBridge\",\"type\":\"address\",\"internalType\":\"contractStandardBridge\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"l1TokenBridge\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"messenger\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractCrossDomainMessenger\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"otherBridge\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractStandardBridge\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"paused\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"withdraw\",\"inputs\":[{\"name\":\"_l2Token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_minGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"_extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"withdrawTo\",\"inputs\":[{\"name\":\"_l2Token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_minGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"_extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"event\",\"name\":\"DepositFinalized\",\"inputs\":[{\"name\":\"l1Token\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"l2Token\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"extraData\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ERC20BridgeFinalized\",\"inputs\":[{\"name\":\"localToken\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"remoteToken\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"extraData\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ERC20BridgeInitiated\",\"inputs\":[{\"name\":\"localToken\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"remoteToken\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"extraData\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ETHBridgeFinalized\",\"inputs\":[{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"extraData\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ETHBridgeInitiated\",\"inputs\":[{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"extraData\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"WithdrawalInitiated\",\"inputs\":[{\"name\":\"l1Token\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"l2Token\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"extraData\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false}]", + Bin: "0x60806040523480156200001157600080fd5b506200001e600062000024565b62000217565b600054610100900460ff1615808015620000455750600054600160ff909116105b8062000075575062000062306200016d60201b620004811760201c565b15801562000075575060005460ff166001145b620000de5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff19166001179055801562000102576000805461ff0019166101001790555b62000122734200000000000000000000000000000000000007836200017c565b801562000169576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050565b6001600160a01b03163b151590565b600054610100900460ff16620001e95760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401620000d5565b600380546001600160a01b039384166001600160a01b03199182161790915560048054929093169116179055565b612caf80620002276000396000f3fe60806040526004361061012d5760003560e01c8063662a633a116100a5578063927ede2d11610074578063c4d66de811610059578063c4d66de814610421578063c89701a214610441578063e11013dd1461046e57600080fd5b8063927ede2d146103e3578063a3a795481461040e57600080fd5b8063662a633a1461036a5780637f46ddb21461025a578063870876231461037d5780638f601f661461039d57600080fd5b806336c717c1116100fc578063540abf73116100e1578063540abf73146102d857806354fd4d50146102f85780635c975abb1461034e57600080fd5b806336c717c11461025a5780633cb747bf146102ab57600080fd5b80630166a07a1461020157806309fc8843146102215780631635f5fd1461023457806332b7006d1461024757600080fd5b366101fc57333b156101c6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f5374616e646172644272696467653a2066756e6374696f6e2063616e206f6e6c60448201527f792062652063616c6c65642066726f6d20616e20454f4100000000000000000060648201526084015b60405180910390fd5b6101fa73deaddeaddeaddeaddeaddeaddeaddeaddead000033333462030d406040518060200160405280600081525061049d565b005b600080fd5b34801561020d57600080fd5b506101fa61021c36600461266d565b610578565b6101fa61022f36600461271e565b61091a565b6101fa610242366004612771565b6109f1565b6101fa6102553660046127e4565b610ed8565b34801561026657600080fd5b5060045473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b3480156102b757600080fd5b506003546102819073ffffffffffffffffffffffffffffffffffffffff1681565b3480156102e457600080fd5b506101fa6102f3366004612838565b610fb2565b34801561030457600080fd5b506103416040518060400160405280601b81526020017f312e392e302d626574612b637573746f6d2d6761732d746f6b656e000000000081525081565b6040516102a29190612925565b34801561035a57600080fd5b50604051600081526020016102a2565b6101fa61037836600461266d565b610ff7565b34801561038957600080fd5b506101fa610398366004612938565b61106a565b3480156103a957600080fd5b506103d56103b83660046129bb565b600260209081526000928352604080842090915290825290205481565b6040519081526020016102a2565b3480156103ef57600080fd5b5060035473ffffffffffffffffffffffffffffffffffffffff16610281565b6101fa61041c366004612938565b61113e565b34801561042d57600080fd5b506101fa61043c3660046129f4565b611182565b34801561044d57600080fd5b506004546102819073ffffffffffffffffffffffffffffffffffffffff1681565b6101fa61047c366004612a11565b61132b565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b7fffffffffffffffffffffffff215221522152215221522152215221522153000073ffffffffffffffffffffffffffffffffffffffff8716016104ec576104e78585858585611374565b610570565b60008673ffffffffffffffffffffffffffffffffffffffff1663c01e1bd66040518163ffffffff1660e01b8152600401602060405180830381865afa158015610539573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061055d9190612a74565b905061056e878288888888886115d3565b505b505050505050565b60035473ffffffffffffffffffffffffffffffffffffffff163314801561064b575060048054600354604080517f6e296e45000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff938416949390921692636e296e459282820192602092908290030181865afa15801561060f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106339190612a74565b73ffffffffffffffffffffffffffffffffffffffff16145b6106fd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604160248201527f5374616e646172644272696467653a2066756e6374696f6e2063616e206f6e6c60448201527f792062652063616c6c65642066726f6d20746865206f7468657220627269646760648201527f6500000000000000000000000000000000000000000000000000000000000000608482015260a4016101bd565b610706876118fe565b15610854576107158787611960565b6107c7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604a60248201527f5374616e646172644272696467653a2077726f6e672072656d6f746520746f6b60448201527f656e20666f72204f7074696d69736d204d696e7461626c65204552433230206c60648201527f6f63616c20746f6b656e00000000000000000000000000000000000000000000608482015260a4016101bd565b6040517f40c10f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8581166004830152602482018590528816906340c10f1990604401600060405180830381600087803b15801561083757600080fd5b505af115801561084b573d6000803e3d6000fd5b505050506108d6565b73ffffffffffffffffffffffffffffffffffffffff8088166000908152600260209081526040808320938a1683529290522054610892908490612ac0565b73ffffffffffffffffffffffffffffffffffffffff8089166000818152600260209081526040808320948c16835293905291909120919091556108d6908585611a80565b61056e878787878787878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611b5492505050565b333b156109a9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f5374616e646172644272696467653a2066756e6374696f6e2063616e206f6e6c60448201527f792062652063616c6c65642066726f6d20616e20454f4100000000000000000060648201526084016101bd565b6109ec3333348686868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061137492505050565b505050565b60035473ffffffffffffffffffffffffffffffffffffffff1633148015610ac4575060048054600354604080517f6e296e45000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff938416949390921692636e296e459282820192602092908290030181865afa158015610a88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aac9190612a74565b73ffffffffffffffffffffffffffffffffffffffff16145b610b76576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604160248201527f5374616e646172644272696467653a2066756e6374696f6e2063616e206f6e6c60448201527f792062652063616c6c65642066726f6d20746865206f7468657220627269646760648201527f6500000000000000000000000000000000000000000000000000000000000000608482015260a4016101bd565b610b7e611be2565b15610c0b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f5374616e646172644272696467653a2063616e6e6f742062726964676520455460448201527f48207769746820637573746f6d2067617320746f6b656e00000000000000000060648201526084016101bd565b823414610c9a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f5374616e646172644272696467653a20616d6f756e742073656e7420646f657360448201527f206e6f74206d6174636820616d6f756e7420726571756972656400000000000060648201526084016101bd565b3073ffffffffffffffffffffffffffffffffffffffff851603610d3f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f5374616e646172644272696467653a2063616e6e6f742073656e6420746f207360448201527f656c66000000000000000000000000000000000000000000000000000000000060648201526084016101bd565b60035473ffffffffffffffffffffffffffffffffffffffff90811690851603610dea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f5374616e646172644272696467653a2063616e6e6f742073656e6420746f206d60448201527f657373656e67657200000000000000000000000000000000000000000000000060648201526084016101bd565b610e2c85858585858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611c2192505050565b6000610e49855a8660405180602001604052806000815250611cc2565b905080610570576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f5374616e646172644272696467653a20455448207472616e736665722066616960448201527f6c6564000000000000000000000000000000000000000000000000000000000060648201526084016101bd565b333b15610f67576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f5374616e646172644272696467653a2066756e6374696f6e2063616e206f6e6c60448201527f792062652063616c6c65642066726f6d20616e20454f4100000000000000000060648201526084016101bd565b610fab853333878787878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061049d92505050565b5050505050565b61056e87873388888888888080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506115d392505050565b73ffffffffffffffffffffffffffffffffffffffff8716158015611044575073ffffffffffffffffffffffffffffffffffffffff861673deaddeaddeaddeaddeaddeaddeaddeaddead0000145b1561105b5761105685858585856109f1565b61056e565b61056e86888787878787610578565b333b156110f9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f5374616e646172644272696467653a2066756e6374696f6e2063616e206f6e6c60448201527f792062652063616c6c65642066726f6d20616e20454f4100000000000000000060648201526084016101bd565b61057086863333888888888080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506115d392505050565b610570863387878787878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061049d92505050565b600054610100900460ff16158080156111a25750600054600160ff909116105b806111bc5750303b1580156111bc575060005460ff166001145b611248576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016101bd565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905580156112a657600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b6112c473420000000000000000000000000000000000000783611cdc565b801561132757600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050565b61136e3385348686868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061137492505050565b50505050565b61137c611be2565b15611409576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f5374616e646172644272696467653a2063616e6e6f742062726964676520455460448201527f48207769746820637573746f6d2067617320746f6b656e00000000000000000060648201526084016101bd565b823414611498576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603e60248201527f5374616e646172644272696467653a206272696467696e6720455448206d757360448201527f7420696e636c7564652073756666696369656e74204554482076616c7565000060648201526084016101bd565b6114a485858584611dc6565b60035460045460405173ffffffffffffffffffffffffffffffffffffffff92831692633dbb202b9287929116907f1635f5fd0000000000000000000000000000000000000000000000000000000090611507908b908b9086908a90602401612ad7565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009485161790525160e086901b909216825261159a92918890600401612b20565b6000604051808303818588803b1580156115b357600080fd5b505af11580156115c7573d6000803e3d6000fd5b50505050505050505050565b6115dc876118fe565b1561172a576115eb8787611960565b61169d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604a60248201527f5374616e646172644272696467653a2077726f6e672072656d6f746520746f6b60448201527f656e20666f72204f7074696d69736d204d696e7461626c65204552433230206c60648201527f6f63616c20746f6b656e00000000000000000000000000000000000000000000608482015260a4016101bd565b6040517f9dc29fac00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff868116600483015260248201859052881690639dc29fac90604401600060405180830381600087803b15801561170d57600080fd5b505af1158015611721573d6000803e3d6000fd5b505050506117be565b61174c73ffffffffffffffffffffffffffffffffffffffff8816863086611e67565b73ffffffffffffffffffffffffffffffffffffffff8088166000908152600260209081526040808320938a168352929052205461178a908490612b65565b73ffffffffffffffffffffffffffffffffffffffff8089166000908152600260209081526040808320938b16835292905220555b6117cc878787878786611ec5565b60035460045460405173ffffffffffffffffffffffffffffffffffffffff92831692633dbb202b9216907f0166a07a0000000000000000000000000000000000000000000000000000000090611830908b908d908c908c908c908b90602401612b7d565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009485161790525160e085901b90921682526118c392918790600401612b20565b600060405180830381600087803b1580156118dd57600080fd5b505af11580156118f1573d6000803e3d6000fd5b5050505050505050505050565b600061192a827f1d1d8b6300000000000000000000000000000000000000000000000000000000611f53565b8061195a575061195a827fec4fc8e300000000000000000000000000000000000000000000000000000000611f53565b92915050565b600061198c837f1d1d8b6300000000000000000000000000000000000000000000000000000000611f53565b15611a35578273ffffffffffffffffffffffffffffffffffffffff1663c01e1bd66040518163ffffffff1660e01b8152600401602060405180830381865afa1580156119dc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a009190612a74565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614905061195a565b8273ffffffffffffffffffffffffffffffffffffffff1663d6c0b2c46040518163ffffffff1660e01b8152600401602060405180830381865afa1580156119dc573d6000803e3d6000fd5b60405173ffffffffffffffffffffffffffffffffffffffff83166024820152604481018290526109ec9084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152611f76565b8373ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fb0444523268717a02698be47d0803aa7468c00acbed2f8bd93a0459cde61dd89868686604051611bcc93929190612bd8565b60405180910390a4610570868686868686612082565b600080611bed61210a565b5073ffffffffffffffffffffffffffffffffffffffff1673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee141592915050565b8373ffffffffffffffffffffffffffffffffffffffff1673deaddeaddeaddeaddeaddeaddeaddeaddead000073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fb0444523268717a02698be47d0803aa7468c00acbed2f8bd93a0459cde61dd89868686604051611cae93929190612bd8565b60405180910390a461136e84848484612198565b600080600080845160208601878a8af19695505050505050565b600054610100900460ff16611d73576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016101bd565b6003805473ffffffffffffffffffffffffffffffffffffffff9384167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560048054929093169116179055565b8373ffffffffffffffffffffffffffffffffffffffff1673deaddeaddeaddeaddeaddeaddeaddeaddead000073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f73d170910aba9e6d50b102db522b1dbcd796216f5128b445aa2135272886497e868686604051611e5393929190612bd8565b60405180910390a461136e84848484612205565b60405173ffffffffffffffffffffffffffffffffffffffff8085166024830152831660448201526064810182905261136e9085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401611ad2565b8373ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167f73d170910aba9e6d50b102db522b1dbcd796216f5128b445aa2135272886497e868686604051611f3d93929190612bd8565b60405180910390a4610570868686868686612264565b6000611f5e836122dc565b8015611f6f5750611f6f8383612340565b9392505050565b6000611fd8826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661240f9092919063ffffffff16565b8051909150156109ec5780806020019051810190611ff69190612c16565b6109ec576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016101bd565b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fd59c65b35445225835c83f50b6ede06a7be047d22e357073e250d9af537518cd8686866040516120fa93929190612bd8565b60405180910390a4505050505050565b60008073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16634397dfef6040518163ffffffff1660e01b81526004016040805180830381865afa15801561216b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061218f9190612c38565b90939092509050565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f31b2166ff604fc5672ea5df08a78081d2bc6d746cadce880747f3643d819e83d84846040516121f7929190612c6d565b60405180910390a350505050565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f2849b43074093a05396b6f2a937dee8565b15a48a7b3d4bffb732a5017380af584846040516121f7929190612c6d565b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167f7ff126db8024424bbfd9826e8ab82ff59136289ea440b04b39a0df1b03b9cabf8686866040516120fa93929190612bd8565b6000612308827f01ffc9a700000000000000000000000000000000000000000000000000000000612340565b801561195a5750612339827fffffffff00000000000000000000000000000000000000000000000000000000612340565b1592915050565b604080517fffffffff000000000000000000000000000000000000000000000000000000008316602480830191909152825180830390910181526044909101909152602080820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f01ffc9a700000000000000000000000000000000000000000000000000000000178152825160009392849283928392918391908a617530fa92503d915060005190508280156123f8575060208210155b80156124045750600081115b979650505050505050565b606061241e8484600085612426565b949350505050565b6060824710156124b8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016101bd565b73ffffffffffffffffffffffffffffffffffffffff85163b612536576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016101bd565b6000808673ffffffffffffffffffffffffffffffffffffffff16858760405161255f9190612c86565b60006040518083038185875af1925050503d806000811461259c576040519150601f19603f3d011682016040523d82523d6000602084013e6125a1565b606091505b5091509150612404828286606083156125bb575081611f6f565b8251156125cb5782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101bd9190612925565b73ffffffffffffffffffffffffffffffffffffffff8116811461262157600080fd5b50565b60008083601f84011261263657600080fd5b50813567ffffffffffffffff81111561264e57600080fd5b60208301915083602082850101111561266657600080fd5b9250929050565b600080600080600080600060c0888a03121561268857600080fd5b8735612693816125ff565b965060208801356126a3816125ff565b955060408801356126b3816125ff565b945060608801356126c3816125ff565b93506080880135925060a088013567ffffffffffffffff8111156126e657600080fd5b6126f28a828b01612624565b989b979a50959850939692959293505050565b803563ffffffff8116811461271957600080fd5b919050565b60008060006040848603121561273357600080fd5b61273c84612705565b9250602084013567ffffffffffffffff81111561275857600080fd5b61276486828701612624565b9497909650939450505050565b60008060008060006080868803121561278957600080fd5b8535612794816125ff565b945060208601356127a4816125ff565b935060408601359250606086013567ffffffffffffffff8111156127c757600080fd5b6127d388828901612624565b969995985093965092949392505050565b6000806000806000608086880312156127fc57600080fd5b8535612807816125ff565b94506020860135935061281c60408701612705565b9250606086013567ffffffffffffffff8111156127c757600080fd5b600080600080600080600060c0888a03121561285357600080fd5b873561285e816125ff565b9650602088013561286e816125ff565b9550604088013561287e816125ff565b94506060880135935061289360808901612705565b925060a088013567ffffffffffffffff8111156126e657600080fd5b60005b838110156128ca5781810151838201526020016128b2565b8381111561136e5750506000910152565b600081518084526128f38160208601602086016128af565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000611f6f60208301846128db565b60008060008060008060a0878903121561295157600080fd5b863561295c816125ff565b9550602087013561296c816125ff565b94506040870135935061298160608801612705565b9250608087013567ffffffffffffffff81111561299d57600080fd5b6129a989828a01612624565b979a9699509497509295939492505050565b600080604083850312156129ce57600080fd5b82356129d9816125ff565b915060208301356129e9816125ff565b809150509250929050565b600060208284031215612a0657600080fd5b8135611f6f816125ff565b60008060008060608587031215612a2757600080fd5b8435612a32816125ff565b9350612a4060208601612705565b9250604085013567ffffffffffffffff811115612a5c57600080fd5b612a6887828801612624565b95989497509550505050565b600060208284031215612a8657600080fd5b8151611f6f816125ff565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082821015612ad257612ad2612a91565b500390565b600073ffffffffffffffffffffffffffffffffffffffff808716835280861660208401525083604083015260806060830152612b1660808301846128db565b9695505050505050565b73ffffffffffffffffffffffffffffffffffffffff84168152606060208201526000612b4f60608301856128db565b905063ffffffff83166040830152949350505050565b60008219821115612b7857612b78612a91565b500190565b600073ffffffffffffffffffffffffffffffffffffffff80891683528088166020840152808716604084015280861660608401525083608083015260c060a0830152612bcc60c08301846128db565b98975050505050505050565b73ffffffffffffffffffffffffffffffffffffffff84168152826020820152606060408201526000612c0d60608301846128db565b95945050505050565b600060208284031215612c2857600080fd5b81518015158114611f6f57600080fd5b60008060408385031215612c4b57600080fd5b8251612c56816125ff565b602084015190925060ff811681146129e957600080fd5b82815260406020820152600061241e60408301846128db565b60008251612c988184602087016128af565b919091019291505056fea164736f6c634300080f000a", +} + +// L2StandardBridgeABI is the input ABI used to generate the binding from. +// Deprecated: Use L2StandardBridgeMetaData.ABI instead. +var L2StandardBridgeABI = L2StandardBridgeMetaData.ABI + +// L2StandardBridgeBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use L2StandardBridgeMetaData.Bin instead. +var L2StandardBridgeBin = L2StandardBridgeMetaData.Bin + +// DeployL2StandardBridge deploys a new Ethereum contract, binding an instance of L2StandardBridge to it. +func DeployL2StandardBridge(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *L2StandardBridge, error) { + parsed, err := L2StandardBridgeMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(L2StandardBridgeBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &L2StandardBridge{L2StandardBridgeCaller: L2StandardBridgeCaller{contract: contract}, L2StandardBridgeTransactor: L2StandardBridgeTransactor{contract: contract}, L2StandardBridgeFilterer: L2StandardBridgeFilterer{contract: contract}}, nil +} + +// L2StandardBridge is an auto generated Go binding around an Ethereum contract. +type L2StandardBridge struct { + L2StandardBridgeCaller // Read-only binding to the contract + L2StandardBridgeTransactor // Write-only binding to the contract + L2StandardBridgeFilterer // Log filterer for contract events +} + +// L2StandardBridgeCaller is an auto generated read-only Go binding around an Ethereum contract. +type L2StandardBridgeCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// L2StandardBridgeTransactor is an auto generated write-only Go binding around an Ethereum contract. +type L2StandardBridgeTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// L2StandardBridgeFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type L2StandardBridgeFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// L2StandardBridgeSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type L2StandardBridgeSession struct { + Contract *L2StandardBridge // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// L2StandardBridgeCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type L2StandardBridgeCallerSession struct { + Contract *L2StandardBridgeCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// L2StandardBridgeTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type L2StandardBridgeTransactorSession struct { + Contract *L2StandardBridgeTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// L2StandardBridgeRaw is an auto generated low-level Go binding around an Ethereum contract. +type L2StandardBridgeRaw struct { + Contract *L2StandardBridge // Generic contract binding to access the raw methods on +} + +// L2StandardBridgeCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type L2StandardBridgeCallerRaw struct { + Contract *L2StandardBridgeCaller // Generic read-only contract binding to access the raw methods on +} + +// L2StandardBridgeTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type L2StandardBridgeTransactorRaw struct { + Contract *L2StandardBridgeTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewL2StandardBridge creates a new instance of L2StandardBridge, bound to a specific deployed contract. +func NewL2StandardBridge(address common.Address, backend bind.ContractBackend) (*L2StandardBridge, error) { + contract, err := bindL2StandardBridge(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &L2StandardBridge{L2StandardBridgeCaller: L2StandardBridgeCaller{contract: contract}, L2StandardBridgeTransactor: L2StandardBridgeTransactor{contract: contract}, L2StandardBridgeFilterer: L2StandardBridgeFilterer{contract: contract}}, nil +} + +// NewL2StandardBridgeCaller creates a new read-only instance of L2StandardBridge, bound to a specific deployed contract. +func NewL2StandardBridgeCaller(address common.Address, caller bind.ContractCaller) (*L2StandardBridgeCaller, error) { + contract, err := bindL2StandardBridge(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &L2StandardBridgeCaller{contract: contract}, nil +} + +// NewL2StandardBridgeTransactor creates a new write-only instance of L2StandardBridge, bound to a specific deployed contract. +func NewL2StandardBridgeTransactor(address common.Address, transactor bind.ContractTransactor) (*L2StandardBridgeTransactor, error) { + contract, err := bindL2StandardBridge(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &L2StandardBridgeTransactor{contract: contract}, nil +} + +// NewL2StandardBridgeFilterer creates a new log filterer instance of L2StandardBridge, bound to a specific deployed contract. +func NewL2StandardBridgeFilterer(address common.Address, filterer bind.ContractFilterer) (*L2StandardBridgeFilterer, error) { + contract, err := bindL2StandardBridge(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &L2StandardBridgeFilterer{contract: contract}, nil +} + +// bindL2StandardBridge binds a generic wrapper to an already deployed contract. +func bindL2StandardBridge(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(L2StandardBridgeABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_L2StandardBridge *L2StandardBridgeRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _L2StandardBridge.Contract.L2StandardBridgeCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_L2StandardBridge *L2StandardBridgeRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _L2StandardBridge.Contract.L2StandardBridgeTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_L2StandardBridge *L2StandardBridgeRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _L2StandardBridge.Contract.L2StandardBridgeTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_L2StandardBridge *L2StandardBridgeCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _L2StandardBridge.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_L2StandardBridge *L2StandardBridgeTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _L2StandardBridge.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_L2StandardBridge *L2StandardBridgeTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _L2StandardBridge.Contract.contract.Transact(opts, method, params...) +} + +// MESSENGER is a free data retrieval call binding the contract method 0x927ede2d. +// +// Solidity: function MESSENGER() view returns(address) +func (_L2StandardBridge *L2StandardBridgeCaller) MESSENGER(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _L2StandardBridge.contract.Call(opts, &out, "MESSENGER") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// MESSENGER is a free data retrieval call binding the contract method 0x927ede2d. +// +// Solidity: function MESSENGER() view returns(address) +func (_L2StandardBridge *L2StandardBridgeSession) MESSENGER() (common.Address, error) { + return _L2StandardBridge.Contract.MESSENGER(&_L2StandardBridge.CallOpts) +} + +// MESSENGER is a free data retrieval call binding the contract method 0x927ede2d. +// +// Solidity: function MESSENGER() view returns(address) +func (_L2StandardBridge *L2StandardBridgeCallerSession) MESSENGER() (common.Address, error) { + return _L2StandardBridge.Contract.MESSENGER(&_L2StandardBridge.CallOpts) +} + +// OTHERBRIDGE is a free data retrieval call binding the contract method 0x7f46ddb2. +// +// Solidity: function OTHER_BRIDGE() view returns(address) +func (_L2StandardBridge *L2StandardBridgeCaller) OTHERBRIDGE(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _L2StandardBridge.contract.Call(opts, &out, "OTHER_BRIDGE") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// OTHERBRIDGE is a free data retrieval call binding the contract method 0x7f46ddb2. +// +// Solidity: function OTHER_BRIDGE() view returns(address) +func (_L2StandardBridge *L2StandardBridgeSession) OTHERBRIDGE() (common.Address, error) { + return _L2StandardBridge.Contract.OTHERBRIDGE(&_L2StandardBridge.CallOpts) +} + +// OTHERBRIDGE is a free data retrieval call binding the contract method 0x7f46ddb2. +// +// Solidity: function OTHER_BRIDGE() view returns(address) +func (_L2StandardBridge *L2StandardBridgeCallerSession) OTHERBRIDGE() (common.Address, error) { + return _L2StandardBridge.Contract.OTHERBRIDGE(&_L2StandardBridge.CallOpts) +} + +// Deposits is a free data retrieval call binding the contract method 0x8f601f66. +// +// Solidity: function deposits(address , address ) view returns(uint256) +func (_L2StandardBridge *L2StandardBridgeCaller) Deposits(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address) (*big.Int, error) { + var out []interface{} + err := _L2StandardBridge.contract.Call(opts, &out, "deposits", arg0, arg1) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Deposits is a free data retrieval call binding the contract method 0x8f601f66. +// +// Solidity: function deposits(address , address ) view returns(uint256) +func (_L2StandardBridge *L2StandardBridgeSession) Deposits(arg0 common.Address, arg1 common.Address) (*big.Int, error) { + return _L2StandardBridge.Contract.Deposits(&_L2StandardBridge.CallOpts, arg0, arg1) +} + +// Deposits is a free data retrieval call binding the contract method 0x8f601f66. +// +// Solidity: function deposits(address , address ) view returns(uint256) +func (_L2StandardBridge *L2StandardBridgeCallerSession) Deposits(arg0 common.Address, arg1 common.Address) (*big.Int, error) { + return _L2StandardBridge.Contract.Deposits(&_L2StandardBridge.CallOpts, arg0, arg1) +} + +// L1TokenBridge is a free data retrieval call binding the contract method 0x36c717c1. +// +// Solidity: function l1TokenBridge() view returns(address) +func (_L2StandardBridge *L2StandardBridgeCaller) L1TokenBridge(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _L2StandardBridge.contract.Call(opts, &out, "l1TokenBridge") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// L1TokenBridge is a free data retrieval call binding the contract method 0x36c717c1. +// +// Solidity: function l1TokenBridge() view returns(address) +func (_L2StandardBridge *L2StandardBridgeSession) L1TokenBridge() (common.Address, error) { + return _L2StandardBridge.Contract.L1TokenBridge(&_L2StandardBridge.CallOpts) +} + +// L1TokenBridge is a free data retrieval call binding the contract method 0x36c717c1. +// +// Solidity: function l1TokenBridge() view returns(address) +func (_L2StandardBridge *L2StandardBridgeCallerSession) L1TokenBridge() (common.Address, error) { + return _L2StandardBridge.Contract.L1TokenBridge(&_L2StandardBridge.CallOpts) +} + +// Messenger is a free data retrieval call binding the contract method 0x3cb747bf. +// +// Solidity: function messenger() view returns(address) +func (_L2StandardBridge *L2StandardBridgeCaller) Messenger(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _L2StandardBridge.contract.Call(opts, &out, "messenger") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Messenger is a free data retrieval call binding the contract method 0x3cb747bf. +// +// Solidity: function messenger() view returns(address) +func (_L2StandardBridge *L2StandardBridgeSession) Messenger() (common.Address, error) { + return _L2StandardBridge.Contract.Messenger(&_L2StandardBridge.CallOpts) +} + +// Messenger is a free data retrieval call binding the contract method 0x3cb747bf. +// +// Solidity: function messenger() view returns(address) +func (_L2StandardBridge *L2StandardBridgeCallerSession) Messenger() (common.Address, error) { + return _L2StandardBridge.Contract.Messenger(&_L2StandardBridge.CallOpts) +} + +// OtherBridge is a free data retrieval call binding the contract method 0xc89701a2. +// +// Solidity: function otherBridge() view returns(address) +func (_L2StandardBridge *L2StandardBridgeCaller) OtherBridge(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _L2StandardBridge.contract.Call(opts, &out, "otherBridge") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// OtherBridge is a free data retrieval call binding the contract method 0xc89701a2. +// +// Solidity: function otherBridge() view returns(address) +func (_L2StandardBridge *L2StandardBridgeSession) OtherBridge() (common.Address, error) { + return _L2StandardBridge.Contract.OtherBridge(&_L2StandardBridge.CallOpts) +} + +// OtherBridge is a free data retrieval call binding the contract method 0xc89701a2. +// +// Solidity: function otherBridge() view returns(address) +func (_L2StandardBridge *L2StandardBridgeCallerSession) OtherBridge() (common.Address, error) { + return _L2StandardBridge.Contract.OtherBridge(&_L2StandardBridge.CallOpts) +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool) +func (_L2StandardBridge *L2StandardBridgeCaller) Paused(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _L2StandardBridge.contract.Call(opts, &out, "paused") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool) +func (_L2StandardBridge *L2StandardBridgeSession) Paused() (bool, error) { + return _L2StandardBridge.Contract.Paused(&_L2StandardBridge.CallOpts) +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool) +func (_L2StandardBridge *L2StandardBridgeCallerSession) Paused() (bool, error) { + return _L2StandardBridge.Contract.Paused(&_L2StandardBridge.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_L2StandardBridge *L2StandardBridgeCaller) Version(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _L2StandardBridge.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 (_L2StandardBridge *L2StandardBridgeSession) Version() (string, error) { + return _L2StandardBridge.Contract.Version(&_L2StandardBridge.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_L2StandardBridge *L2StandardBridgeCallerSession) Version() (string, error) { + return _L2StandardBridge.Contract.Version(&_L2StandardBridge.CallOpts) +} + +// BridgeERC20 is a paid mutator transaction binding the contract method 0x87087623. +// +// Solidity: function bridgeERC20(address _localToken, address _remoteToken, uint256 _amount, uint32 _minGasLimit, bytes _extraData) returns() +func (_L2StandardBridge *L2StandardBridgeTransactor) BridgeERC20(opts *bind.TransactOpts, _localToken common.Address, _remoteToken common.Address, _amount *big.Int, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L2StandardBridge.contract.Transact(opts, "bridgeERC20", _localToken, _remoteToken, _amount, _minGasLimit, _extraData) +} + +// BridgeERC20 is a paid mutator transaction binding the contract method 0x87087623. +// +// Solidity: function bridgeERC20(address _localToken, address _remoteToken, uint256 _amount, uint32 _minGasLimit, bytes _extraData) returns() +func (_L2StandardBridge *L2StandardBridgeSession) BridgeERC20(_localToken common.Address, _remoteToken common.Address, _amount *big.Int, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L2StandardBridge.Contract.BridgeERC20(&_L2StandardBridge.TransactOpts, _localToken, _remoteToken, _amount, _minGasLimit, _extraData) +} + +// BridgeERC20 is a paid mutator transaction binding the contract method 0x87087623. +// +// Solidity: function bridgeERC20(address _localToken, address _remoteToken, uint256 _amount, uint32 _minGasLimit, bytes _extraData) returns() +func (_L2StandardBridge *L2StandardBridgeTransactorSession) BridgeERC20(_localToken common.Address, _remoteToken common.Address, _amount *big.Int, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L2StandardBridge.Contract.BridgeERC20(&_L2StandardBridge.TransactOpts, _localToken, _remoteToken, _amount, _minGasLimit, _extraData) +} + +// BridgeERC20To is a paid mutator transaction binding the contract method 0x540abf73. +// +// Solidity: function bridgeERC20To(address _localToken, address _remoteToken, address _to, uint256 _amount, uint32 _minGasLimit, bytes _extraData) returns() +func (_L2StandardBridge *L2StandardBridgeTransactor) BridgeERC20To(opts *bind.TransactOpts, _localToken common.Address, _remoteToken common.Address, _to common.Address, _amount *big.Int, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L2StandardBridge.contract.Transact(opts, "bridgeERC20To", _localToken, _remoteToken, _to, _amount, _minGasLimit, _extraData) +} + +// BridgeERC20To is a paid mutator transaction binding the contract method 0x540abf73. +// +// Solidity: function bridgeERC20To(address _localToken, address _remoteToken, address _to, uint256 _amount, uint32 _minGasLimit, bytes _extraData) returns() +func (_L2StandardBridge *L2StandardBridgeSession) BridgeERC20To(_localToken common.Address, _remoteToken common.Address, _to common.Address, _amount *big.Int, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L2StandardBridge.Contract.BridgeERC20To(&_L2StandardBridge.TransactOpts, _localToken, _remoteToken, _to, _amount, _minGasLimit, _extraData) +} + +// BridgeERC20To is a paid mutator transaction binding the contract method 0x540abf73. +// +// Solidity: function bridgeERC20To(address _localToken, address _remoteToken, address _to, uint256 _amount, uint32 _minGasLimit, bytes _extraData) returns() +func (_L2StandardBridge *L2StandardBridgeTransactorSession) BridgeERC20To(_localToken common.Address, _remoteToken common.Address, _to common.Address, _amount *big.Int, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L2StandardBridge.Contract.BridgeERC20To(&_L2StandardBridge.TransactOpts, _localToken, _remoteToken, _to, _amount, _minGasLimit, _extraData) +} + +// BridgeETH is a paid mutator transaction binding the contract method 0x09fc8843. +// +// Solidity: function bridgeETH(uint32 _minGasLimit, bytes _extraData) payable returns() +func (_L2StandardBridge *L2StandardBridgeTransactor) BridgeETH(opts *bind.TransactOpts, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L2StandardBridge.contract.Transact(opts, "bridgeETH", _minGasLimit, _extraData) +} + +// BridgeETH is a paid mutator transaction binding the contract method 0x09fc8843. +// +// Solidity: function bridgeETH(uint32 _minGasLimit, bytes _extraData) payable returns() +func (_L2StandardBridge *L2StandardBridgeSession) BridgeETH(_minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L2StandardBridge.Contract.BridgeETH(&_L2StandardBridge.TransactOpts, _minGasLimit, _extraData) +} + +// BridgeETH is a paid mutator transaction binding the contract method 0x09fc8843. +// +// Solidity: function bridgeETH(uint32 _minGasLimit, bytes _extraData) payable returns() +func (_L2StandardBridge *L2StandardBridgeTransactorSession) BridgeETH(_minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L2StandardBridge.Contract.BridgeETH(&_L2StandardBridge.TransactOpts, _minGasLimit, _extraData) +} + +// BridgeETHTo is a paid mutator transaction binding the contract method 0xe11013dd. +// +// Solidity: function bridgeETHTo(address _to, uint32 _minGasLimit, bytes _extraData) payable returns() +func (_L2StandardBridge *L2StandardBridgeTransactor) BridgeETHTo(opts *bind.TransactOpts, _to common.Address, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L2StandardBridge.contract.Transact(opts, "bridgeETHTo", _to, _minGasLimit, _extraData) +} + +// BridgeETHTo is a paid mutator transaction binding the contract method 0xe11013dd. +// +// Solidity: function bridgeETHTo(address _to, uint32 _minGasLimit, bytes _extraData) payable returns() +func (_L2StandardBridge *L2StandardBridgeSession) BridgeETHTo(_to common.Address, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L2StandardBridge.Contract.BridgeETHTo(&_L2StandardBridge.TransactOpts, _to, _minGasLimit, _extraData) +} + +// BridgeETHTo is a paid mutator transaction binding the contract method 0xe11013dd. +// +// Solidity: function bridgeETHTo(address _to, uint32 _minGasLimit, bytes _extraData) payable returns() +func (_L2StandardBridge *L2StandardBridgeTransactorSession) BridgeETHTo(_to common.Address, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L2StandardBridge.Contract.BridgeETHTo(&_L2StandardBridge.TransactOpts, _to, _minGasLimit, _extraData) +} + +// FinalizeBridgeERC20 is a paid mutator transaction binding the contract method 0x0166a07a. +// +// Solidity: function finalizeBridgeERC20(address _localToken, address _remoteToken, address _from, address _to, uint256 _amount, bytes _extraData) returns() +func (_L2StandardBridge *L2StandardBridgeTransactor) FinalizeBridgeERC20(opts *bind.TransactOpts, _localToken common.Address, _remoteToken common.Address, _from common.Address, _to common.Address, _amount *big.Int, _extraData []byte) (*types.Transaction, error) { + return _L2StandardBridge.contract.Transact(opts, "finalizeBridgeERC20", _localToken, _remoteToken, _from, _to, _amount, _extraData) +} + +// FinalizeBridgeERC20 is a paid mutator transaction binding the contract method 0x0166a07a. +// +// Solidity: function finalizeBridgeERC20(address _localToken, address _remoteToken, address _from, address _to, uint256 _amount, bytes _extraData) returns() +func (_L2StandardBridge *L2StandardBridgeSession) FinalizeBridgeERC20(_localToken common.Address, _remoteToken common.Address, _from common.Address, _to common.Address, _amount *big.Int, _extraData []byte) (*types.Transaction, error) { + return _L2StandardBridge.Contract.FinalizeBridgeERC20(&_L2StandardBridge.TransactOpts, _localToken, _remoteToken, _from, _to, _amount, _extraData) +} + +// FinalizeBridgeERC20 is a paid mutator transaction binding the contract method 0x0166a07a. +// +// Solidity: function finalizeBridgeERC20(address _localToken, address _remoteToken, address _from, address _to, uint256 _amount, bytes _extraData) returns() +func (_L2StandardBridge *L2StandardBridgeTransactorSession) FinalizeBridgeERC20(_localToken common.Address, _remoteToken common.Address, _from common.Address, _to common.Address, _amount *big.Int, _extraData []byte) (*types.Transaction, error) { + return _L2StandardBridge.Contract.FinalizeBridgeERC20(&_L2StandardBridge.TransactOpts, _localToken, _remoteToken, _from, _to, _amount, _extraData) +} + +// FinalizeBridgeETH is a paid mutator transaction binding the contract method 0x1635f5fd. +// +// Solidity: function finalizeBridgeETH(address _from, address _to, uint256 _amount, bytes _extraData) payable returns() +func (_L2StandardBridge *L2StandardBridgeTransactor) FinalizeBridgeETH(opts *bind.TransactOpts, _from common.Address, _to common.Address, _amount *big.Int, _extraData []byte) (*types.Transaction, error) { + return _L2StandardBridge.contract.Transact(opts, "finalizeBridgeETH", _from, _to, _amount, _extraData) +} + +// FinalizeBridgeETH is a paid mutator transaction binding the contract method 0x1635f5fd. +// +// Solidity: function finalizeBridgeETH(address _from, address _to, uint256 _amount, bytes _extraData) payable returns() +func (_L2StandardBridge *L2StandardBridgeSession) FinalizeBridgeETH(_from common.Address, _to common.Address, _amount *big.Int, _extraData []byte) (*types.Transaction, error) { + return _L2StandardBridge.Contract.FinalizeBridgeETH(&_L2StandardBridge.TransactOpts, _from, _to, _amount, _extraData) +} + +// FinalizeBridgeETH is a paid mutator transaction binding the contract method 0x1635f5fd. +// +// Solidity: function finalizeBridgeETH(address _from, address _to, uint256 _amount, bytes _extraData) payable returns() +func (_L2StandardBridge *L2StandardBridgeTransactorSession) FinalizeBridgeETH(_from common.Address, _to common.Address, _amount *big.Int, _extraData []byte) (*types.Transaction, error) { + return _L2StandardBridge.Contract.FinalizeBridgeETH(&_L2StandardBridge.TransactOpts, _from, _to, _amount, _extraData) +} + +// FinalizeDeposit is a paid mutator transaction binding the contract method 0x662a633a. +// +// Solidity: function finalizeDeposit(address _l1Token, address _l2Token, address _from, address _to, uint256 _amount, bytes _extraData) payable returns() +func (_L2StandardBridge *L2StandardBridgeTransactor) FinalizeDeposit(opts *bind.TransactOpts, _l1Token common.Address, _l2Token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _extraData []byte) (*types.Transaction, error) { + return _L2StandardBridge.contract.Transact(opts, "finalizeDeposit", _l1Token, _l2Token, _from, _to, _amount, _extraData) +} + +// FinalizeDeposit is a paid mutator transaction binding the contract method 0x662a633a. +// +// Solidity: function finalizeDeposit(address _l1Token, address _l2Token, address _from, address _to, uint256 _amount, bytes _extraData) payable returns() +func (_L2StandardBridge *L2StandardBridgeSession) FinalizeDeposit(_l1Token common.Address, _l2Token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _extraData []byte) (*types.Transaction, error) { + return _L2StandardBridge.Contract.FinalizeDeposit(&_L2StandardBridge.TransactOpts, _l1Token, _l2Token, _from, _to, _amount, _extraData) +} + +// FinalizeDeposit is a paid mutator transaction binding the contract method 0x662a633a. +// +// Solidity: function finalizeDeposit(address _l1Token, address _l2Token, address _from, address _to, uint256 _amount, bytes _extraData) payable returns() +func (_L2StandardBridge *L2StandardBridgeTransactorSession) FinalizeDeposit(_l1Token common.Address, _l2Token common.Address, _from common.Address, _to common.Address, _amount *big.Int, _extraData []byte) (*types.Transaction, error) { + return _L2StandardBridge.Contract.FinalizeDeposit(&_L2StandardBridge.TransactOpts, _l1Token, _l2Token, _from, _to, _amount, _extraData) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. +// +// Solidity: function initialize(address _otherBridge) returns() +func (_L2StandardBridge *L2StandardBridgeTransactor) Initialize(opts *bind.TransactOpts, _otherBridge common.Address) (*types.Transaction, error) { + return _L2StandardBridge.contract.Transact(opts, "initialize", _otherBridge) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. +// +// Solidity: function initialize(address _otherBridge) returns() +func (_L2StandardBridge *L2StandardBridgeSession) Initialize(_otherBridge common.Address) (*types.Transaction, error) { + return _L2StandardBridge.Contract.Initialize(&_L2StandardBridge.TransactOpts, _otherBridge) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. +// +// Solidity: function initialize(address _otherBridge) returns() +func (_L2StandardBridge *L2StandardBridgeTransactorSession) Initialize(_otherBridge common.Address) (*types.Transaction, error) { + return _L2StandardBridge.Contract.Initialize(&_L2StandardBridge.TransactOpts, _otherBridge) +} + +// Withdraw is a paid mutator transaction binding the contract method 0x32b7006d. +// +// Solidity: function withdraw(address _l2Token, uint256 _amount, uint32 _minGasLimit, bytes _extraData) payable returns() +func (_L2StandardBridge *L2StandardBridgeTransactor) Withdraw(opts *bind.TransactOpts, _l2Token common.Address, _amount *big.Int, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L2StandardBridge.contract.Transact(opts, "withdraw", _l2Token, _amount, _minGasLimit, _extraData) +} + +// Withdraw is a paid mutator transaction binding the contract method 0x32b7006d. +// +// Solidity: function withdraw(address _l2Token, uint256 _amount, uint32 _minGasLimit, bytes _extraData) payable returns() +func (_L2StandardBridge *L2StandardBridgeSession) Withdraw(_l2Token common.Address, _amount *big.Int, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L2StandardBridge.Contract.Withdraw(&_L2StandardBridge.TransactOpts, _l2Token, _amount, _minGasLimit, _extraData) +} + +// Withdraw is a paid mutator transaction binding the contract method 0x32b7006d. +// +// Solidity: function withdraw(address _l2Token, uint256 _amount, uint32 _minGasLimit, bytes _extraData) payable returns() +func (_L2StandardBridge *L2StandardBridgeTransactorSession) Withdraw(_l2Token common.Address, _amount *big.Int, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L2StandardBridge.Contract.Withdraw(&_L2StandardBridge.TransactOpts, _l2Token, _amount, _minGasLimit, _extraData) +} + +// WithdrawTo is a paid mutator transaction binding the contract method 0xa3a79548. +// +// Solidity: function withdrawTo(address _l2Token, address _to, uint256 _amount, uint32 _minGasLimit, bytes _extraData) payable returns() +func (_L2StandardBridge *L2StandardBridgeTransactor) WithdrawTo(opts *bind.TransactOpts, _l2Token common.Address, _to common.Address, _amount *big.Int, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L2StandardBridge.contract.Transact(opts, "withdrawTo", _l2Token, _to, _amount, _minGasLimit, _extraData) +} + +// WithdrawTo is a paid mutator transaction binding the contract method 0xa3a79548. +// +// Solidity: function withdrawTo(address _l2Token, address _to, uint256 _amount, uint32 _minGasLimit, bytes _extraData) payable returns() +func (_L2StandardBridge *L2StandardBridgeSession) WithdrawTo(_l2Token common.Address, _to common.Address, _amount *big.Int, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L2StandardBridge.Contract.WithdrawTo(&_L2StandardBridge.TransactOpts, _l2Token, _to, _amount, _minGasLimit, _extraData) +} + +// WithdrawTo is a paid mutator transaction binding the contract method 0xa3a79548. +// +// Solidity: function withdrawTo(address _l2Token, address _to, uint256 _amount, uint32 _minGasLimit, bytes _extraData) payable returns() +func (_L2StandardBridge *L2StandardBridgeTransactorSession) WithdrawTo(_l2Token common.Address, _to common.Address, _amount *big.Int, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _L2StandardBridge.Contract.WithdrawTo(&_L2StandardBridge.TransactOpts, _l2Token, _to, _amount, _minGasLimit, _extraData) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_L2StandardBridge *L2StandardBridgeTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { + return _L2StandardBridge.contract.RawTransact(opts, nil) // calldata is disallowed for receive function +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_L2StandardBridge *L2StandardBridgeSession) Receive() (*types.Transaction, error) { + return _L2StandardBridge.Contract.Receive(&_L2StandardBridge.TransactOpts) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_L2StandardBridge *L2StandardBridgeTransactorSession) Receive() (*types.Transaction, error) { + return _L2StandardBridge.Contract.Receive(&_L2StandardBridge.TransactOpts) +} + +// L2StandardBridgeDepositFinalizedIterator is returned from FilterDepositFinalized and is used to iterate over the raw logs and unpacked data for DepositFinalized events raised by the L2StandardBridge contract. +type L2StandardBridgeDepositFinalizedIterator struct { + Event *L2StandardBridgeDepositFinalized // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *L2StandardBridgeDepositFinalizedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(L2StandardBridgeDepositFinalized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(L2StandardBridgeDepositFinalized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *L2StandardBridgeDepositFinalizedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *L2StandardBridgeDepositFinalizedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// L2StandardBridgeDepositFinalized represents a DepositFinalized event raised by the L2StandardBridge contract. +type L2StandardBridgeDepositFinalized struct { + L1Token common.Address + L2Token common.Address + From common.Address + To common.Address + Amount *big.Int + ExtraData []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterDepositFinalized is a free log retrieval operation binding the contract event 0xb0444523268717a02698be47d0803aa7468c00acbed2f8bd93a0459cde61dd89. +// +// Solidity: event DepositFinalized(address indexed l1Token, address indexed l2Token, address indexed from, address to, uint256 amount, bytes extraData) +func (_L2StandardBridge *L2StandardBridgeFilterer) FilterDepositFinalized(opts *bind.FilterOpts, l1Token []common.Address, l2Token []common.Address, from []common.Address) (*L2StandardBridgeDepositFinalizedIterator, error) { + + var l1TokenRule []interface{} + for _, l1TokenItem := range l1Token { + l1TokenRule = append(l1TokenRule, l1TokenItem) + } + var l2TokenRule []interface{} + for _, l2TokenItem := range l2Token { + l2TokenRule = append(l2TokenRule, l2TokenItem) + } + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + + logs, sub, err := _L2StandardBridge.contract.FilterLogs(opts, "DepositFinalized", l1TokenRule, l2TokenRule, fromRule) + if err != nil { + return nil, err + } + return &L2StandardBridgeDepositFinalizedIterator{contract: _L2StandardBridge.contract, event: "DepositFinalized", logs: logs, sub: sub}, nil +} + +// WatchDepositFinalized is a free log subscription operation binding the contract event 0xb0444523268717a02698be47d0803aa7468c00acbed2f8bd93a0459cde61dd89. +// +// Solidity: event DepositFinalized(address indexed l1Token, address indexed l2Token, address indexed from, address to, uint256 amount, bytes extraData) +func (_L2StandardBridge *L2StandardBridgeFilterer) WatchDepositFinalized(opts *bind.WatchOpts, sink chan<- *L2StandardBridgeDepositFinalized, l1Token []common.Address, l2Token []common.Address, from []common.Address) (event.Subscription, error) { + + var l1TokenRule []interface{} + for _, l1TokenItem := range l1Token { + l1TokenRule = append(l1TokenRule, l1TokenItem) + } + var l2TokenRule []interface{} + for _, l2TokenItem := range l2Token { + l2TokenRule = append(l2TokenRule, l2TokenItem) + } + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + + logs, sub, err := _L2StandardBridge.contract.WatchLogs(opts, "DepositFinalized", l1TokenRule, l2TokenRule, fromRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(L2StandardBridgeDepositFinalized) + if err := _L2StandardBridge.contract.UnpackLog(event, "DepositFinalized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseDepositFinalized is a log parse operation binding the contract event 0xb0444523268717a02698be47d0803aa7468c00acbed2f8bd93a0459cde61dd89. +// +// Solidity: event DepositFinalized(address indexed l1Token, address indexed l2Token, address indexed from, address to, uint256 amount, bytes extraData) +func (_L2StandardBridge *L2StandardBridgeFilterer) ParseDepositFinalized(log types.Log) (*L2StandardBridgeDepositFinalized, error) { + event := new(L2StandardBridgeDepositFinalized) + if err := _L2StandardBridge.contract.UnpackLog(event, "DepositFinalized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// L2StandardBridgeERC20BridgeFinalizedIterator is returned from FilterERC20BridgeFinalized and is used to iterate over the raw logs and unpacked data for ERC20BridgeFinalized events raised by the L2StandardBridge contract. +type L2StandardBridgeERC20BridgeFinalizedIterator struct { + Event *L2StandardBridgeERC20BridgeFinalized // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *L2StandardBridgeERC20BridgeFinalizedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(L2StandardBridgeERC20BridgeFinalized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(L2StandardBridgeERC20BridgeFinalized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *L2StandardBridgeERC20BridgeFinalizedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *L2StandardBridgeERC20BridgeFinalizedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// L2StandardBridgeERC20BridgeFinalized represents a ERC20BridgeFinalized event raised by the L2StandardBridge contract. +type L2StandardBridgeERC20BridgeFinalized struct { + LocalToken common.Address + RemoteToken common.Address + From common.Address + To common.Address + Amount *big.Int + ExtraData []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterERC20BridgeFinalized is a free log retrieval operation binding the contract event 0xd59c65b35445225835c83f50b6ede06a7be047d22e357073e250d9af537518cd. +// +// Solidity: event ERC20BridgeFinalized(address indexed localToken, address indexed remoteToken, address indexed from, address to, uint256 amount, bytes extraData) +func (_L2StandardBridge *L2StandardBridgeFilterer) FilterERC20BridgeFinalized(opts *bind.FilterOpts, localToken []common.Address, remoteToken []common.Address, from []common.Address) (*L2StandardBridgeERC20BridgeFinalizedIterator, error) { + + var localTokenRule []interface{} + for _, localTokenItem := range localToken { + localTokenRule = append(localTokenRule, localTokenItem) + } + var remoteTokenRule []interface{} + for _, remoteTokenItem := range remoteToken { + remoteTokenRule = append(remoteTokenRule, remoteTokenItem) + } + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + + logs, sub, err := _L2StandardBridge.contract.FilterLogs(opts, "ERC20BridgeFinalized", localTokenRule, remoteTokenRule, fromRule) + if err != nil { + return nil, err + } + return &L2StandardBridgeERC20BridgeFinalizedIterator{contract: _L2StandardBridge.contract, event: "ERC20BridgeFinalized", logs: logs, sub: sub}, nil +} + +// WatchERC20BridgeFinalized is a free log subscription operation binding the contract event 0xd59c65b35445225835c83f50b6ede06a7be047d22e357073e250d9af537518cd. +// +// Solidity: event ERC20BridgeFinalized(address indexed localToken, address indexed remoteToken, address indexed from, address to, uint256 amount, bytes extraData) +func (_L2StandardBridge *L2StandardBridgeFilterer) WatchERC20BridgeFinalized(opts *bind.WatchOpts, sink chan<- *L2StandardBridgeERC20BridgeFinalized, localToken []common.Address, remoteToken []common.Address, from []common.Address) (event.Subscription, error) { + + var localTokenRule []interface{} + for _, localTokenItem := range localToken { + localTokenRule = append(localTokenRule, localTokenItem) + } + var remoteTokenRule []interface{} + for _, remoteTokenItem := range remoteToken { + remoteTokenRule = append(remoteTokenRule, remoteTokenItem) + } + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + + logs, sub, err := _L2StandardBridge.contract.WatchLogs(opts, "ERC20BridgeFinalized", localTokenRule, remoteTokenRule, fromRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(L2StandardBridgeERC20BridgeFinalized) + if err := _L2StandardBridge.contract.UnpackLog(event, "ERC20BridgeFinalized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseERC20BridgeFinalized is a log parse operation binding the contract event 0xd59c65b35445225835c83f50b6ede06a7be047d22e357073e250d9af537518cd. +// +// Solidity: event ERC20BridgeFinalized(address indexed localToken, address indexed remoteToken, address indexed from, address to, uint256 amount, bytes extraData) +func (_L2StandardBridge *L2StandardBridgeFilterer) ParseERC20BridgeFinalized(log types.Log) (*L2StandardBridgeERC20BridgeFinalized, error) { + event := new(L2StandardBridgeERC20BridgeFinalized) + if err := _L2StandardBridge.contract.UnpackLog(event, "ERC20BridgeFinalized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// L2StandardBridgeERC20BridgeInitiatedIterator is returned from FilterERC20BridgeInitiated and is used to iterate over the raw logs and unpacked data for ERC20BridgeInitiated events raised by the L2StandardBridge contract. +type L2StandardBridgeERC20BridgeInitiatedIterator struct { + Event *L2StandardBridgeERC20BridgeInitiated // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *L2StandardBridgeERC20BridgeInitiatedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(L2StandardBridgeERC20BridgeInitiated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(L2StandardBridgeERC20BridgeInitiated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *L2StandardBridgeERC20BridgeInitiatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *L2StandardBridgeERC20BridgeInitiatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// L2StandardBridgeERC20BridgeInitiated represents a ERC20BridgeInitiated event raised by the L2StandardBridge contract. +type L2StandardBridgeERC20BridgeInitiated struct { + LocalToken common.Address + RemoteToken common.Address + From common.Address + To common.Address + Amount *big.Int + ExtraData []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterERC20BridgeInitiated is a free log retrieval operation binding the contract event 0x7ff126db8024424bbfd9826e8ab82ff59136289ea440b04b39a0df1b03b9cabf. +// +// Solidity: event ERC20BridgeInitiated(address indexed localToken, address indexed remoteToken, address indexed from, address to, uint256 amount, bytes extraData) +func (_L2StandardBridge *L2StandardBridgeFilterer) FilterERC20BridgeInitiated(opts *bind.FilterOpts, localToken []common.Address, remoteToken []common.Address, from []common.Address) (*L2StandardBridgeERC20BridgeInitiatedIterator, error) { + + var localTokenRule []interface{} + for _, localTokenItem := range localToken { + localTokenRule = append(localTokenRule, localTokenItem) + } + var remoteTokenRule []interface{} + for _, remoteTokenItem := range remoteToken { + remoteTokenRule = append(remoteTokenRule, remoteTokenItem) + } + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + + logs, sub, err := _L2StandardBridge.contract.FilterLogs(opts, "ERC20BridgeInitiated", localTokenRule, remoteTokenRule, fromRule) + if err != nil { + return nil, err + } + return &L2StandardBridgeERC20BridgeInitiatedIterator{contract: _L2StandardBridge.contract, event: "ERC20BridgeInitiated", logs: logs, sub: sub}, nil +} + +// WatchERC20BridgeInitiated is a free log subscription operation binding the contract event 0x7ff126db8024424bbfd9826e8ab82ff59136289ea440b04b39a0df1b03b9cabf. +// +// Solidity: event ERC20BridgeInitiated(address indexed localToken, address indexed remoteToken, address indexed from, address to, uint256 amount, bytes extraData) +func (_L2StandardBridge *L2StandardBridgeFilterer) WatchERC20BridgeInitiated(opts *bind.WatchOpts, sink chan<- *L2StandardBridgeERC20BridgeInitiated, localToken []common.Address, remoteToken []common.Address, from []common.Address) (event.Subscription, error) { + + var localTokenRule []interface{} + for _, localTokenItem := range localToken { + localTokenRule = append(localTokenRule, localTokenItem) + } + var remoteTokenRule []interface{} + for _, remoteTokenItem := range remoteToken { + remoteTokenRule = append(remoteTokenRule, remoteTokenItem) + } + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + + logs, sub, err := _L2StandardBridge.contract.WatchLogs(opts, "ERC20BridgeInitiated", localTokenRule, remoteTokenRule, fromRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(L2StandardBridgeERC20BridgeInitiated) + if err := _L2StandardBridge.contract.UnpackLog(event, "ERC20BridgeInitiated", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseERC20BridgeInitiated is a log parse operation binding the contract event 0x7ff126db8024424bbfd9826e8ab82ff59136289ea440b04b39a0df1b03b9cabf. +// +// Solidity: event ERC20BridgeInitiated(address indexed localToken, address indexed remoteToken, address indexed from, address to, uint256 amount, bytes extraData) +func (_L2StandardBridge *L2StandardBridgeFilterer) ParseERC20BridgeInitiated(log types.Log) (*L2StandardBridgeERC20BridgeInitiated, error) { + event := new(L2StandardBridgeERC20BridgeInitiated) + if err := _L2StandardBridge.contract.UnpackLog(event, "ERC20BridgeInitiated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// L2StandardBridgeETHBridgeFinalizedIterator is returned from FilterETHBridgeFinalized and is used to iterate over the raw logs and unpacked data for ETHBridgeFinalized events raised by the L2StandardBridge contract. +type L2StandardBridgeETHBridgeFinalizedIterator struct { + Event *L2StandardBridgeETHBridgeFinalized // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *L2StandardBridgeETHBridgeFinalizedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(L2StandardBridgeETHBridgeFinalized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(L2StandardBridgeETHBridgeFinalized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *L2StandardBridgeETHBridgeFinalizedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *L2StandardBridgeETHBridgeFinalizedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// L2StandardBridgeETHBridgeFinalized represents a ETHBridgeFinalized event raised by the L2StandardBridge contract. +type L2StandardBridgeETHBridgeFinalized struct { + From common.Address + To common.Address + Amount *big.Int + ExtraData []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterETHBridgeFinalized is a free log retrieval operation binding the contract event 0x31b2166ff604fc5672ea5df08a78081d2bc6d746cadce880747f3643d819e83d. +// +// Solidity: event ETHBridgeFinalized(address indexed from, address indexed to, uint256 amount, bytes extraData) +func (_L2StandardBridge *L2StandardBridgeFilterer) FilterETHBridgeFinalized(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*L2StandardBridgeETHBridgeFinalizedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _L2StandardBridge.contract.FilterLogs(opts, "ETHBridgeFinalized", fromRule, toRule) + if err != nil { + return nil, err + } + return &L2StandardBridgeETHBridgeFinalizedIterator{contract: _L2StandardBridge.contract, event: "ETHBridgeFinalized", logs: logs, sub: sub}, nil +} + +// WatchETHBridgeFinalized is a free log subscription operation binding the contract event 0x31b2166ff604fc5672ea5df08a78081d2bc6d746cadce880747f3643d819e83d. +// +// Solidity: event ETHBridgeFinalized(address indexed from, address indexed to, uint256 amount, bytes extraData) +func (_L2StandardBridge *L2StandardBridgeFilterer) WatchETHBridgeFinalized(opts *bind.WatchOpts, sink chan<- *L2StandardBridgeETHBridgeFinalized, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _L2StandardBridge.contract.WatchLogs(opts, "ETHBridgeFinalized", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(L2StandardBridgeETHBridgeFinalized) + if err := _L2StandardBridge.contract.UnpackLog(event, "ETHBridgeFinalized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseETHBridgeFinalized is a log parse operation binding the contract event 0x31b2166ff604fc5672ea5df08a78081d2bc6d746cadce880747f3643d819e83d. +// +// Solidity: event ETHBridgeFinalized(address indexed from, address indexed to, uint256 amount, bytes extraData) +func (_L2StandardBridge *L2StandardBridgeFilterer) ParseETHBridgeFinalized(log types.Log) (*L2StandardBridgeETHBridgeFinalized, error) { + event := new(L2StandardBridgeETHBridgeFinalized) + if err := _L2StandardBridge.contract.UnpackLog(event, "ETHBridgeFinalized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// L2StandardBridgeETHBridgeInitiatedIterator is returned from FilterETHBridgeInitiated and is used to iterate over the raw logs and unpacked data for ETHBridgeInitiated events raised by the L2StandardBridge contract. +type L2StandardBridgeETHBridgeInitiatedIterator struct { + Event *L2StandardBridgeETHBridgeInitiated // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *L2StandardBridgeETHBridgeInitiatedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(L2StandardBridgeETHBridgeInitiated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(L2StandardBridgeETHBridgeInitiated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *L2StandardBridgeETHBridgeInitiatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *L2StandardBridgeETHBridgeInitiatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// L2StandardBridgeETHBridgeInitiated represents a ETHBridgeInitiated event raised by the L2StandardBridge contract. +type L2StandardBridgeETHBridgeInitiated struct { + From common.Address + To common.Address + Amount *big.Int + ExtraData []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterETHBridgeInitiated is a free log retrieval operation binding the contract event 0x2849b43074093a05396b6f2a937dee8565b15a48a7b3d4bffb732a5017380af5. +// +// Solidity: event ETHBridgeInitiated(address indexed from, address indexed to, uint256 amount, bytes extraData) +func (_L2StandardBridge *L2StandardBridgeFilterer) FilterETHBridgeInitiated(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*L2StandardBridgeETHBridgeInitiatedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _L2StandardBridge.contract.FilterLogs(opts, "ETHBridgeInitiated", fromRule, toRule) + if err != nil { + return nil, err + } + return &L2StandardBridgeETHBridgeInitiatedIterator{contract: _L2StandardBridge.contract, event: "ETHBridgeInitiated", logs: logs, sub: sub}, nil +} + +// WatchETHBridgeInitiated is a free log subscription operation binding the contract event 0x2849b43074093a05396b6f2a937dee8565b15a48a7b3d4bffb732a5017380af5. +// +// Solidity: event ETHBridgeInitiated(address indexed from, address indexed to, uint256 amount, bytes extraData) +func (_L2StandardBridge *L2StandardBridgeFilterer) WatchETHBridgeInitiated(opts *bind.WatchOpts, sink chan<- *L2StandardBridgeETHBridgeInitiated, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _L2StandardBridge.contract.WatchLogs(opts, "ETHBridgeInitiated", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(L2StandardBridgeETHBridgeInitiated) + if err := _L2StandardBridge.contract.UnpackLog(event, "ETHBridgeInitiated", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseETHBridgeInitiated is a log parse operation binding the contract event 0x2849b43074093a05396b6f2a937dee8565b15a48a7b3d4bffb732a5017380af5. +// +// Solidity: event ETHBridgeInitiated(address indexed from, address indexed to, uint256 amount, bytes extraData) +func (_L2StandardBridge *L2StandardBridgeFilterer) ParseETHBridgeInitiated(log types.Log) (*L2StandardBridgeETHBridgeInitiated, error) { + event := new(L2StandardBridgeETHBridgeInitiated) + if err := _L2StandardBridge.contract.UnpackLog(event, "ETHBridgeInitiated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// L2StandardBridgeInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the L2StandardBridge contract. +type L2StandardBridgeInitializedIterator struct { + Event *L2StandardBridgeInitialized // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *L2StandardBridgeInitializedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(L2StandardBridgeInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(L2StandardBridgeInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *L2StandardBridgeInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *L2StandardBridgeInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// L2StandardBridgeInitialized represents a Initialized event raised by the L2StandardBridge contract. +type L2StandardBridgeInitialized struct { + Version uint8 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_L2StandardBridge *L2StandardBridgeFilterer) FilterInitialized(opts *bind.FilterOpts) (*L2StandardBridgeInitializedIterator, error) { + + logs, sub, err := _L2StandardBridge.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &L2StandardBridgeInitializedIterator{contract: _L2StandardBridge.contract, event: "Initialized", logs: logs, sub: sub}, nil +} + +// WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_L2StandardBridge *L2StandardBridgeFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *L2StandardBridgeInitialized) (event.Subscription, error) { + + logs, sub, err := _L2StandardBridge.contract.WatchLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(L2StandardBridgeInitialized) + if err := _L2StandardBridge.contract.UnpackLog(event, "Initialized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_L2StandardBridge *L2StandardBridgeFilterer) ParseInitialized(log types.Log) (*L2StandardBridgeInitialized, error) { + event := new(L2StandardBridgeInitialized) + if err := _L2StandardBridge.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// L2StandardBridgeWithdrawalInitiatedIterator is returned from FilterWithdrawalInitiated and is used to iterate over the raw logs and unpacked data for WithdrawalInitiated events raised by the L2StandardBridge contract. +type L2StandardBridgeWithdrawalInitiatedIterator struct { + Event *L2StandardBridgeWithdrawalInitiated // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *L2StandardBridgeWithdrawalInitiatedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(L2StandardBridgeWithdrawalInitiated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(L2StandardBridgeWithdrawalInitiated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *L2StandardBridgeWithdrawalInitiatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *L2StandardBridgeWithdrawalInitiatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// L2StandardBridgeWithdrawalInitiated represents a WithdrawalInitiated event raised by the L2StandardBridge contract. +type L2StandardBridgeWithdrawalInitiated struct { + L1Token common.Address + L2Token common.Address + From common.Address + To common.Address + Amount *big.Int + ExtraData []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterWithdrawalInitiated is a free log retrieval operation binding the contract event 0x73d170910aba9e6d50b102db522b1dbcd796216f5128b445aa2135272886497e. +// +// Solidity: event WithdrawalInitiated(address indexed l1Token, address indexed l2Token, address indexed from, address to, uint256 amount, bytes extraData) +func (_L2StandardBridge *L2StandardBridgeFilterer) FilterWithdrawalInitiated(opts *bind.FilterOpts, l1Token []common.Address, l2Token []common.Address, from []common.Address) (*L2StandardBridgeWithdrawalInitiatedIterator, error) { + + var l1TokenRule []interface{} + for _, l1TokenItem := range l1Token { + l1TokenRule = append(l1TokenRule, l1TokenItem) + } + var l2TokenRule []interface{} + for _, l2TokenItem := range l2Token { + l2TokenRule = append(l2TokenRule, l2TokenItem) + } + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + + logs, sub, err := _L2StandardBridge.contract.FilterLogs(opts, "WithdrawalInitiated", l1TokenRule, l2TokenRule, fromRule) + if err != nil { + return nil, err + } + return &L2StandardBridgeWithdrawalInitiatedIterator{contract: _L2StandardBridge.contract, event: "WithdrawalInitiated", logs: logs, sub: sub}, nil +} + +// WatchWithdrawalInitiated is a free log subscription operation binding the contract event 0x73d170910aba9e6d50b102db522b1dbcd796216f5128b445aa2135272886497e. +// +// Solidity: event WithdrawalInitiated(address indexed l1Token, address indexed l2Token, address indexed from, address to, uint256 amount, bytes extraData) +func (_L2StandardBridge *L2StandardBridgeFilterer) WatchWithdrawalInitiated(opts *bind.WatchOpts, sink chan<- *L2StandardBridgeWithdrawalInitiated, l1Token []common.Address, l2Token []common.Address, from []common.Address) (event.Subscription, error) { + + var l1TokenRule []interface{} + for _, l1TokenItem := range l1Token { + l1TokenRule = append(l1TokenRule, l1TokenItem) + } + var l2TokenRule []interface{} + for _, l2TokenItem := range l2Token { + l2TokenRule = append(l2TokenRule, l2TokenItem) + } + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + + logs, sub, err := _L2StandardBridge.contract.WatchLogs(opts, "WithdrawalInitiated", l1TokenRule, l2TokenRule, fromRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(L2StandardBridgeWithdrawalInitiated) + if err := _L2StandardBridge.contract.UnpackLog(event, "WithdrawalInitiated", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseWithdrawalInitiated is a log parse operation binding the contract event 0x73d170910aba9e6d50b102db522b1dbcd796216f5128b445aa2135272886497e. +// +// Solidity: event WithdrawalInitiated(address indexed l1Token, address indexed l2Token, address indexed from, address to, uint256 amount, bytes extraData) +func (_L2StandardBridge *L2StandardBridgeFilterer) ParseWithdrawalInitiated(log types.Log) (*L2StandardBridgeWithdrawalInitiated, error) { + event := new(L2StandardBridgeWithdrawalInitiated) + if err := _L2StandardBridge.contract.UnpackLog(event, "WithdrawalInitiated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/op-e2e2/bindings/l2tol1messagepasser.go b/op-e2e2/bindings/l2tol1messagepasser.go new file mode 100644 index 000000000000..cc419d057adf --- /dev/null +++ b/op-e2e2/bindings/l2tol1messagepasser.go @@ -0,0 +1,699 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// L2ToL1MessagePasserMetaData contains all meta data concerning the L2ToL1MessagePasser contract. +var L2ToL1MessagePasserMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"MESSAGE_VERSION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"burn\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initiateWithdrawal\",\"inputs\":[{\"name\":\"_target\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_gasLimit\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"messageNonce\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"sentMessages\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"MessagePassed\",\"inputs\":[{\"name\":\"nonce\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"sender\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"target\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"gasLimit\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"data\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"},{\"name\":\"withdrawalHash\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"WithdrawerBalanceBurnt\",\"inputs\":[{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"}],\"anonymous\":false}]", + Bin: "0x608060405234801561001057600080fd5b506106d3806100206000396000f3fe6080604052600436106100695760003560e01c806382e3702d1161004357806382e3702d1461012a578063c2b3e5ac1461016a578063ecc704281461017d57600080fd5b80633f827a5a1461009257806344df8e70146100bf57806354fd4d50146100d457600080fd5b3661008d5761008b33620186a0604051806020016040528060008152506101e2565b005b600080fd5b34801561009e57600080fd5b506100a7600181565b60405161ffff90911681526020015b60405180910390f35b3480156100cb57600080fd5b5061008b6103a6565b3480156100e057600080fd5b5061011d6040518060400160405280600581526020017f312e312e3000000000000000000000000000000000000000000000000000000081525081565b6040516100b691906104d1565b34801561013657600080fd5b5061015a6101453660046104eb565b60006020819052908152604090205460ff1681565b60405190151581526020016100b6565b61008b610178366004610533565b6101e2565b34801561018957600080fd5b506101d46001547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e010000000000000000000000000000000000000000000000000000000000001790565b6040519081526020016100b6565b60006102786040518060c0016040528061023c6001547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e010000000000000000000000000000000000000000000000000000000000001790565b815233602082015273ffffffffffffffffffffffffffffffffffffffff871660408201523460608201526080810186905260a0018490526103de565b600081815260208190526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055905073ffffffffffffffffffffffffffffffffffffffff8416336103136001547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e010000000000000000000000000000000000000000000000000000000000001790565b7f02a52367d10742d8032712c1bb8e0144ff1ec5ffda1ed7d70bb05a2744955054348787876040516103489493929190610637565b60405180910390a45050600180547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8082168301167fffff0000000000000000000000000000000000000000000000000000000000009091161790555050565b476103b08161042b565b60405181907f7967de617a5ac1cc7eba2d6f37570a0135afa950d8bb77cdd35f0d0b4e85a16f90600090a250565b80516020808301516040808501516060860151608087015160a0880151935160009761040e979096959101610667565b604051602081830303815290604052805190602001209050919050565b806040516104389061045a565b6040518091039082f0905080158015610455573d6000803e3d6000fd5b505050565b6008806106bf83390190565b6000815180845260005b8181101561048c57602081850181015186830182015201610470565b8181111561049e576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006104e46020830184610466565b9392505050565b6000602082840312156104fd57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60008060006060848603121561054857600080fd5b833573ffffffffffffffffffffffffffffffffffffffff8116811461056c57600080fd5b925060208401359150604084013567ffffffffffffffff8082111561059057600080fd5b818601915086601f8301126105a457600080fd5b8135818111156105b6576105b6610504565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156105fc576105fc610504565b8160405282815289602084870101111561061557600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b8481528360208201526080604082015260006106566080830185610466565b905082606083015295945050505050565b868152600073ffffffffffffffffffffffffffffffffffffffff808816602084015280871660408401525084606083015283608083015260c060a08301526106b260c0830184610466565b9897505050505050505056fe608060405230fffea164736f6c634300080f000a", +} + +// L2ToL1MessagePasserABI is the input ABI used to generate the binding from. +// Deprecated: Use L2ToL1MessagePasserMetaData.ABI instead. +var L2ToL1MessagePasserABI = L2ToL1MessagePasserMetaData.ABI + +// L2ToL1MessagePasserBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use L2ToL1MessagePasserMetaData.Bin instead. +var L2ToL1MessagePasserBin = L2ToL1MessagePasserMetaData.Bin + +// DeployL2ToL1MessagePasser deploys a new Ethereum contract, binding an instance of L2ToL1MessagePasser to it. +func DeployL2ToL1MessagePasser(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *L2ToL1MessagePasser, error) { + parsed, err := L2ToL1MessagePasserMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(L2ToL1MessagePasserBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &L2ToL1MessagePasser{L2ToL1MessagePasserCaller: L2ToL1MessagePasserCaller{contract: contract}, L2ToL1MessagePasserTransactor: L2ToL1MessagePasserTransactor{contract: contract}, L2ToL1MessagePasserFilterer: L2ToL1MessagePasserFilterer{contract: contract}}, nil +} + +// L2ToL1MessagePasser is an auto generated Go binding around an Ethereum contract. +type L2ToL1MessagePasser struct { + L2ToL1MessagePasserCaller // Read-only binding to the contract + L2ToL1MessagePasserTransactor // Write-only binding to the contract + L2ToL1MessagePasserFilterer // Log filterer for contract events +} + +// L2ToL1MessagePasserCaller is an auto generated read-only Go binding around an Ethereum contract. +type L2ToL1MessagePasserCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// L2ToL1MessagePasserTransactor is an auto generated write-only Go binding around an Ethereum contract. +type L2ToL1MessagePasserTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// L2ToL1MessagePasserFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type L2ToL1MessagePasserFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// L2ToL1MessagePasserSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type L2ToL1MessagePasserSession struct { + Contract *L2ToL1MessagePasser // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// L2ToL1MessagePasserCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type L2ToL1MessagePasserCallerSession struct { + Contract *L2ToL1MessagePasserCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// L2ToL1MessagePasserTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type L2ToL1MessagePasserTransactorSession struct { + Contract *L2ToL1MessagePasserTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// L2ToL1MessagePasserRaw is an auto generated low-level Go binding around an Ethereum contract. +type L2ToL1MessagePasserRaw struct { + Contract *L2ToL1MessagePasser // Generic contract binding to access the raw methods on +} + +// L2ToL1MessagePasserCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type L2ToL1MessagePasserCallerRaw struct { + Contract *L2ToL1MessagePasserCaller // Generic read-only contract binding to access the raw methods on +} + +// L2ToL1MessagePasserTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type L2ToL1MessagePasserTransactorRaw struct { + Contract *L2ToL1MessagePasserTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewL2ToL1MessagePasser creates a new instance of L2ToL1MessagePasser, bound to a specific deployed contract. +func NewL2ToL1MessagePasser(address common.Address, backend bind.ContractBackend) (*L2ToL1MessagePasser, error) { + contract, err := bindL2ToL1MessagePasser(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &L2ToL1MessagePasser{L2ToL1MessagePasserCaller: L2ToL1MessagePasserCaller{contract: contract}, L2ToL1MessagePasserTransactor: L2ToL1MessagePasserTransactor{contract: contract}, L2ToL1MessagePasserFilterer: L2ToL1MessagePasserFilterer{contract: contract}}, nil +} + +// NewL2ToL1MessagePasserCaller creates a new read-only instance of L2ToL1MessagePasser, bound to a specific deployed contract. +func NewL2ToL1MessagePasserCaller(address common.Address, caller bind.ContractCaller) (*L2ToL1MessagePasserCaller, error) { + contract, err := bindL2ToL1MessagePasser(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &L2ToL1MessagePasserCaller{contract: contract}, nil +} + +// NewL2ToL1MessagePasserTransactor creates a new write-only instance of L2ToL1MessagePasser, bound to a specific deployed contract. +func NewL2ToL1MessagePasserTransactor(address common.Address, transactor bind.ContractTransactor) (*L2ToL1MessagePasserTransactor, error) { + contract, err := bindL2ToL1MessagePasser(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &L2ToL1MessagePasserTransactor{contract: contract}, nil +} + +// NewL2ToL1MessagePasserFilterer creates a new log filterer instance of L2ToL1MessagePasser, bound to a specific deployed contract. +func NewL2ToL1MessagePasserFilterer(address common.Address, filterer bind.ContractFilterer) (*L2ToL1MessagePasserFilterer, error) { + contract, err := bindL2ToL1MessagePasser(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &L2ToL1MessagePasserFilterer{contract: contract}, nil +} + +// bindL2ToL1MessagePasser binds a generic wrapper to an already deployed contract. +func bindL2ToL1MessagePasser(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(L2ToL1MessagePasserABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_L2ToL1MessagePasser *L2ToL1MessagePasserRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _L2ToL1MessagePasser.Contract.L2ToL1MessagePasserCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_L2ToL1MessagePasser *L2ToL1MessagePasserRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _L2ToL1MessagePasser.Contract.L2ToL1MessagePasserTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_L2ToL1MessagePasser *L2ToL1MessagePasserRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _L2ToL1MessagePasser.Contract.L2ToL1MessagePasserTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_L2ToL1MessagePasser *L2ToL1MessagePasserCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _L2ToL1MessagePasser.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_L2ToL1MessagePasser *L2ToL1MessagePasserTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _L2ToL1MessagePasser.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_L2ToL1MessagePasser *L2ToL1MessagePasserTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _L2ToL1MessagePasser.Contract.contract.Transact(opts, method, params...) +} + +// MESSAGEVERSION is a free data retrieval call binding the contract method 0x3f827a5a. +// +// Solidity: function MESSAGE_VERSION() view returns(uint16) +func (_L2ToL1MessagePasser *L2ToL1MessagePasserCaller) MESSAGEVERSION(opts *bind.CallOpts) (uint16, error) { + var out []interface{} + err := _L2ToL1MessagePasser.contract.Call(opts, &out, "MESSAGE_VERSION") + + if err != nil { + return *new(uint16), err + } + + out0 := *abi.ConvertType(out[0], new(uint16)).(*uint16) + + return out0, err + +} + +// MESSAGEVERSION is a free data retrieval call binding the contract method 0x3f827a5a. +// +// Solidity: function MESSAGE_VERSION() view returns(uint16) +func (_L2ToL1MessagePasser *L2ToL1MessagePasserSession) MESSAGEVERSION() (uint16, error) { + return _L2ToL1MessagePasser.Contract.MESSAGEVERSION(&_L2ToL1MessagePasser.CallOpts) +} + +// MESSAGEVERSION is a free data retrieval call binding the contract method 0x3f827a5a. +// +// Solidity: function MESSAGE_VERSION() view returns(uint16) +func (_L2ToL1MessagePasser *L2ToL1MessagePasserCallerSession) MESSAGEVERSION() (uint16, error) { + return _L2ToL1MessagePasser.Contract.MESSAGEVERSION(&_L2ToL1MessagePasser.CallOpts) +} + +// MessageNonce is a free data retrieval call binding the contract method 0xecc70428. +// +// Solidity: function messageNonce() view returns(uint256) +func (_L2ToL1MessagePasser *L2ToL1MessagePasserCaller) MessageNonce(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _L2ToL1MessagePasser.contract.Call(opts, &out, "messageNonce") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// MessageNonce is a free data retrieval call binding the contract method 0xecc70428. +// +// Solidity: function messageNonce() view returns(uint256) +func (_L2ToL1MessagePasser *L2ToL1MessagePasserSession) MessageNonce() (*big.Int, error) { + return _L2ToL1MessagePasser.Contract.MessageNonce(&_L2ToL1MessagePasser.CallOpts) +} + +// MessageNonce is a free data retrieval call binding the contract method 0xecc70428. +// +// Solidity: function messageNonce() view returns(uint256) +func (_L2ToL1MessagePasser *L2ToL1MessagePasserCallerSession) MessageNonce() (*big.Int, error) { + return _L2ToL1MessagePasser.Contract.MessageNonce(&_L2ToL1MessagePasser.CallOpts) +} + +// SentMessages is a free data retrieval call binding the contract method 0x82e3702d. +// +// Solidity: function sentMessages(bytes32 ) view returns(bool) +func (_L2ToL1MessagePasser *L2ToL1MessagePasserCaller) SentMessages(opts *bind.CallOpts, arg0 [32]byte) (bool, error) { + var out []interface{} + err := _L2ToL1MessagePasser.contract.Call(opts, &out, "sentMessages", arg0) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// SentMessages is a free data retrieval call binding the contract method 0x82e3702d. +// +// Solidity: function sentMessages(bytes32 ) view returns(bool) +func (_L2ToL1MessagePasser *L2ToL1MessagePasserSession) SentMessages(arg0 [32]byte) (bool, error) { + return _L2ToL1MessagePasser.Contract.SentMessages(&_L2ToL1MessagePasser.CallOpts, arg0) +} + +// SentMessages is a free data retrieval call binding the contract method 0x82e3702d. +// +// Solidity: function sentMessages(bytes32 ) view returns(bool) +func (_L2ToL1MessagePasser *L2ToL1MessagePasserCallerSession) SentMessages(arg0 [32]byte) (bool, error) { + 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() +func (_L2ToL1MessagePasser *L2ToL1MessagePasserTransactor) Burn(opts *bind.TransactOpts) (*types.Transaction, error) { + return _L2ToL1MessagePasser.contract.Transact(opts, "burn") +} + +// Burn is a paid mutator transaction binding the contract method 0x44df8e70. +// +// Solidity: function burn() returns() +func (_L2ToL1MessagePasser *L2ToL1MessagePasserSession) Burn() (*types.Transaction, error) { + return _L2ToL1MessagePasser.Contract.Burn(&_L2ToL1MessagePasser.TransactOpts) +} + +// Burn is a paid mutator transaction binding the contract method 0x44df8e70. +// +// Solidity: function burn() returns() +func (_L2ToL1MessagePasser *L2ToL1MessagePasserTransactorSession) Burn() (*types.Transaction, error) { + return _L2ToL1MessagePasser.Contract.Burn(&_L2ToL1MessagePasser.TransactOpts) +} + +// InitiateWithdrawal is a paid mutator transaction binding the contract method 0xc2b3e5ac. +// +// Solidity: function initiateWithdrawal(address _target, uint256 _gasLimit, bytes _data) payable returns() +func (_L2ToL1MessagePasser *L2ToL1MessagePasserTransactor) InitiateWithdrawal(opts *bind.TransactOpts, _target common.Address, _gasLimit *big.Int, _data []byte) (*types.Transaction, error) { + return _L2ToL1MessagePasser.contract.Transact(opts, "initiateWithdrawal", _target, _gasLimit, _data) +} + +// InitiateWithdrawal is a paid mutator transaction binding the contract method 0xc2b3e5ac. +// +// Solidity: function initiateWithdrawal(address _target, uint256 _gasLimit, bytes _data) payable returns() +func (_L2ToL1MessagePasser *L2ToL1MessagePasserSession) InitiateWithdrawal(_target common.Address, _gasLimit *big.Int, _data []byte) (*types.Transaction, error) { + return _L2ToL1MessagePasser.Contract.InitiateWithdrawal(&_L2ToL1MessagePasser.TransactOpts, _target, _gasLimit, _data) +} + +// InitiateWithdrawal is a paid mutator transaction binding the contract method 0xc2b3e5ac. +// +// Solidity: function initiateWithdrawal(address _target, uint256 _gasLimit, bytes _data) payable returns() +func (_L2ToL1MessagePasser *L2ToL1MessagePasserTransactorSession) InitiateWithdrawal(_target common.Address, _gasLimit *big.Int, _data []byte) (*types.Transaction, error) { + return _L2ToL1MessagePasser.Contract.InitiateWithdrawal(&_L2ToL1MessagePasser.TransactOpts, _target, _gasLimit, _data) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_L2ToL1MessagePasser *L2ToL1MessagePasserTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { + return _L2ToL1MessagePasser.contract.RawTransact(opts, nil) // calldata is disallowed for receive function +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_L2ToL1MessagePasser *L2ToL1MessagePasserSession) Receive() (*types.Transaction, error) { + return _L2ToL1MessagePasser.Contract.Receive(&_L2ToL1MessagePasser.TransactOpts) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_L2ToL1MessagePasser *L2ToL1MessagePasserTransactorSession) Receive() (*types.Transaction, error) { + return _L2ToL1MessagePasser.Contract.Receive(&_L2ToL1MessagePasser.TransactOpts) +} + +// L2ToL1MessagePasserMessagePassedIterator is returned from FilterMessagePassed and is used to iterate over the raw logs and unpacked data for MessagePassed events raised by the L2ToL1MessagePasser contract. +type L2ToL1MessagePasserMessagePassedIterator struct { + Event *L2ToL1MessagePasserMessagePassed // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *L2ToL1MessagePasserMessagePassedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(L2ToL1MessagePasserMessagePassed) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(L2ToL1MessagePasserMessagePassed) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *L2ToL1MessagePasserMessagePassedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *L2ToL1MessagePasserMessagePassedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// L2ToL1MessagePasserMessagePassed represents a MessagePassed event raised by the L2ToL1MessagePasser contract. +type L2ToL1MessagePasserMessagePassed struct { + Nonce *big.Int + Sender common.Address + Target common.Address + Value *big.Int + GasLimit *big.Int + Data []byte + WithdrawalHash [32]byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterMessagePassed is a free log retrieval operation binding the contract event 0x02a52367d10742d8032712c1bb8e0144ff1ec5ffda1ed7d70bb05a2744955054. +// +// Solidity: event MessagePassed(uint256 indexed nonce, address indexed sender, address indexed target, uint256 value, uint256 gasLimit, bytes data, bytes32 withdrawalHash) +func (_L2ToL1MessagePasser *L2ToL1MessagePasserFilterer) FilterMessagePassed(opts *bind.FilterOpts, nonce []*big.Int, sender []common.Address, target []common.Address) (*L2ToL1MessagePasserMessagePassedIterator, error) { + + var nonceRule []interface{} + for _, nonceItem := range nonce { + nonceRule = append(nonceRule, nonceItem) + } + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var targetRule []interface{} + for _, targetItem := range target { + targetRule = append(targetRule, targetItem) + } + + logs, sub, err := _L2ToL1MessagePasser.contract.FilterLogs(opts, "MessagePassed", nonceRule, senderRule, targetRule) + if err != nil { + return nil, err + } + return &L2ToL1MessagePasserMessagePassedIterator{contract: _L2ToL1MessagePasser.contract, event: "MessagePassed", logs: logs, sub: sub}, nil +} + +// WatchMessagePassed is a free log subscription operation binding the contract event 0x02a52367d10742d8032712c1bb8e0144ff1ec5ffda1ed7d70bb05a2744955054. +// +// Solidity: event MessagePassed(uint256 indexed nonce, address indexed sender, address indexed target, uint256 value, uint256 gasLimit, bytes data, bytes32 withdrawalHash) +func (_L2ToL1MessagePasser *L2ToL1MessagePasserFilterer) WatchMessagePassed(opts *bind.WatchOpts, sink chan<- *L2ToL1MessagePasserMessagePassed, nonce []*big.Int, sender []common.Address, target []common.Address) (event.Subscription, error) { + + var nonceRule []interface{} + for _, nonceItem := range nonce { + nonceRule = append(nonceRule, nonceItem) + } + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var targetRule []interface{} + for _, targetItem := range target { + targetRule = append(targetRule, targetItem) + } + + logs, sub, err := _L2ToL1MessagePasser.contract.WatchLogs(opts, "MessagePassed", nonceRule, senderRule, targetRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(L2ToL1MessagePasserMessagePassed) + if err := _L2ToL1MessagePasser.contract.UnpackLog(event, "MessagePassed", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseMessagePassed is a log parse operation binding the contract event 0x02a52367d10742d8032712c1bb8e0144ff1ec5ffda1ed7d70bb05a2744955054. +// +// Solidity: event MessagePassed(uint256 indexed nonce, address indexed sender, address indexed target, uint256 value, uint256 gasLimit, bytes data, bytes32 withdrawalHash) +func (_L2ToL1MessagePasser *L2ToL1MessagePasserFilterer) ParseMessagePassed(log types.Log) (*L2ToL1MessagePasserMessagePassed, error) { + event := new(L2ToL1MessagePasserMessagePassed) + if err := _L2ToL1MessagePasser.contract.UnpackLog(event, "MessagePassed", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// L2ToL1MessagePasserWithdrawerBalanceBurntIterator is returned from FilterWithdrawerBalanceBurnt and is used to iterate over the raw logs and unpacked data for WithdrawerBalanceBurnt events raised by the L2ToL1MessagePasser contract. +type L2ToL1MessagePasserWithdrawerBalanceBurntIterator struct { + Event *L2ToL1MessagePasserWithdrawerBalanceBurnt // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *L2ToL1MessagePasserWithdrawerBalanceBurntIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(L2ToL1MessagePasserWithdrawerBalanceBurnt) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(L2ToL1MessagePasserWithdrawerBalanceBurnt) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *L2ToL1MessagePasserWithdrawerBalanceBurntIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *L2ToL1MessagePasserWithdrawerBalanceBurntIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// L2ToL1MessagePasserWithdrawerBalanceBurnt represents a WithdrawerBalanceBurnt event raised by the L2ToL1MessagePasser contract. +type L2ToL1MessagePasserWithdrawerBalanceBurnt struct { + Amount *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterWithdrawerBalanceBurnt is a free log retrieval operation binding the contract event 0x7967de617a5ac1cc7eba2d6f37570a0135afa950d8bb77cdd35f0d0b4e85a16f. +// +// Solidity: event WithdrawerBalanceBurnt(uint256 indexed amount) +func (_L2ToL1MessagePasser *L2ToL1MessagePasserFilterer) FilterWithdrawerBalanceBurnt(opts *bind.FilterOpts, amount []*big.Int) (*L2ToL1MessagePasserWithdrawerBalanceBurntIterator, error) { + + var amountRule []interface{} + for _, amountItem := range amount { + amountRule = append(amountRule, amountItem) + } + + logs, sub, err := _L2ToL1MessagePasser.contract.FilterLogs(opts, "WithdrawerBalanceBurnt", amountRule) + if err != nil { + return nil, err + } + return &L2ToL1MessagePasserWithdrawerBalanceBurntIterator{contract: _L2ToL1MessagePasser.contract, event: "WithdrawerBalanceBurnt", logs: logs, sub: sub}, nil +} + +// WatchWithdrawerBalanceBurnt is a free log subscription operation binding the contract event 0x7967de617a5ac1cc7eba2d6f37570a0135afa950d8bb77cdd35f0d0b4e85a16f. +// +// Solidity: event WithdrawerBalanceBurnt(uint256 indexed amount) +func (_L2ToL1MessagePasser *L2ToL1MessagePasserFilterer) WatchWithdrawerBalanceBurnt(opts *bind.WatchOpts, sink chan<- *L2ToL1MessagePasserWithdrawerBalanceBurnt, amount []*big.Int) (event.Subscription, error) { + + var amountRule []interface{} + for _, amountItem := range amount { + amountRule = append(amountRule, amountItem) + } + + logs, sub, err := _L2ToL1MessagePasser.contract.WatchLogs(opts, "WithdrawerBalanceBurnt", amountRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(L2ToL1MessagePasserWithdrawerBalanceBurnt) + if err := _L2ToL1MessagePasser.contract.UnpackLog(event, "WithdrawerBalanceBurnt", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseWithdrawerBalanceBurnt is a log parse operation binding the contract event 0x7967de617a5ac1cc7eba2d6f37570a0135afa950d8bb77cdd35f0d0b4e85a16f. +// +// Solidity: event WithdrawerBalanceBurnt(uint256 indexed amount) +func (_L2ToL1MessagePasser *L2ToL1MessagePasserFilterer) ParseWithdrawerBalanceBurnt(log types.Log) (*L2ToL1MessagePasserWithdrawerBalanceBurnt, error) { + event := new(L2ToL1MessagePasserWithdrawerBalanceBurnt) + if err := _L2ToL1MessagePasser.contract.UnpackLog(event, "WithdrawerBalanceBurnt", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/op-e2e2/bindings/legacymessagepasser.go b/op-e2e2/bindings/legacymessagepasser.go new file mode 100644 index 000000000000..2c9c072716b3 --- /dev/null +++ b/op-e2e2/bindings/legacymessagepasser.go @@ -0,0 +1,285 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// LegacyMessagePasserMetaData contains all meta data concerning the LegacyMessagePasser contract. +var LegacyMessagePasserMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"function\",\"name\":\"passMessageToL1\",\"inputs\":[{\"name\":\"_message\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"sentMessages\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"}]", + Bin: "0x608060405234801561001057600080fd5b5061035a806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c806354fd4d501461004657806382e3702d14610098578063cafa81dc146100cb575b600080fd5b6100826040518060400160405280600581526020017f312e312e3000000000000000000000000000000000000000000000000000000081525081565b60405161008f919061019b565b60405180910390f35b6100bb6100a63660046101ec565b60006020819052908152604090205460ff1681565b604051901515815260200161008f565b6100de6100d9366004610234565b6100e0565b005b600160008083336040516020016100f8929190610303565b604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001815291815281516020928301208352908201929092520160002080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001691151591909117905550565b60005b8381101561018657818101518382015260200161016e565b83811115610195576000848401525b50505050565b60208152600082518060208401526101ba81604085016020870161016b565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b6000602082840312156101fe57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006020828403121561024657600080fd5b813567ffffffffffffffff8082111561025e57600080fd5b818401915084601f83011261027257600080fd5b81358181111561028457610284610205565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156102ca576102ca610205565b816040528281528760208487010111156102e357600080fd5b826020860160208301376000928101602001929092525095945050505050565b6000835161031581846020880161016b565b60609390931b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016919092019081526014019291505056fea164736f6c634300080f000a", +} + +// LegacyMessagePasserABI is the input ABI used to generate the binding from. +// Deprecated: Use LegacyMessagePasserMetaData.ABI instead. +var LegacyMessagePasserABI = LegacyMessagePasserMetaData.ABI + +// LegacyMessagePasserBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use LegacyMessagePasserMetaData.Bin instead. +var LegacyMessagePasserBin = LegacyMessagePasserMetaData.Bin + +// DeployLegacyMessagePasser deploys a new Ethereum contract, binding an instance of LegacyMessagePasser to it. +func DeployLegacyMessagePasser(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *LegacyMessagePasser, error) { + parsed, err := LegacyMessagePasserMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(LegacyMessagePasserBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &LegacyMessagePasser{LegacyMessagePasserCaller: LegacyMessagePasserCaller{contract: contract}, LegacyMessagePasserTransactor: LegacyMessagePasserTransactor{contract: contract}, LegacyMessagePasserFilterer: LegacyMessagePasserFilterer{contract: contract}}, nil +} + +// LegacyMessagePasser is an auto generated Go binding around an Ethereum contract. +type LegacyMessagePasser struct { + LegacyMessagePasserCaller // Read-only binding to the contract + LegacyMessagePasserTransactor // Write-only binding to the contract + LegacyMessagePasserFilterer // Log filterer for contract events +} + +// LegacyMessagePasserCaller is an auto generated read-only Go binding around an Ethereum contract. +type LegacyMessagePasserCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// LegacyMessagePasserTransactor is an auto generated write-only Go binding around an Ethereum contract. +type LegacyMessagePasserTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// LegacyMessagePasserFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type LegacyMessagePasserFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// LegacyMessagePasserSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type LegacyMessagePasserSession struct { + Contract *LegacyMessagePasser // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// LegacyMessagePasserCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type LegacyMessagePasserCallerSession struct { + Contract *LegacyMessagePasserCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// LegacyMessagePasserTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type LegacyMessagePasserTransactorSession struct { + Contract *LegacyMessagePasserTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// LegacyMessagePasserRaw is an auto generated low-level Go binding around an Ethereum contract. +type LegacyMessagePasserRaw struct { + Contract *LegacyMessagePasser // Generic contract binding to access the raw methods on +} + +// LegacyMessagePasserCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type LegacyMessagePasserCallerRaw struct { + Contract *LegacyMessagePasserCaller // Generic read-only contract binding to access the raw methods on +} + +// LegacyMessagePasserTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type LegacyMessagePasserTransactorRaw struct { + Contract *LegacyMessagePasserTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewLegacyMessagePasser creates a new instance of LegacyMessagePasser, bound to a specific deployed contract. +func NewLegacyMessagePasser(address common.Address, backend bind.ContractBackend) (*LegacyMessagePasser, error) { + contract, err := bindLegacyMessagePasser(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &LegacyMessagePasser{LegacyMessagePasserCaller: LegacyMessagePasserCaller{contract: contract}, LegacyMessagePasserTransactor: LegacyMessagePasserTransactor{contract: contract}, LegacyMessagePasserFilterer: LegacyMessagePasserFilterer{contract: contract}}, nil +} + +// NewLegacyMessagePasserCaller creates a new read-only instance of LegacyMessagePasser, bound to a specific deployed contract. +func NewLegacyMessagePasserCaller(address common.Address, caller bind.ContractCaller) (*LegacyMessagePasserCaller, error) { + contract, err := bindLegacyMessagePasser(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &LegacyMessagePasserCaller{contract: contract}, nil +} + +// NewLegacyMessagePasserTransactor creates a new write-only instance of LegacyMessagePasser, bound to a specific deployed contract. +func NewLegacyMessagePasserTransactor(address common.Address, transactor bind.ContractTransactor) (*LegacyMessagePasserTransactor, error) { + contract, err := bindLegacyMessagePasser(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &LegacyMessagePasserTransactor{contract: contract}, nil +} + +// NewLegacyMessagePasserFilterer creates a new log filterer instance of LegacyMessagePasser, bound to a specific deployed contract. +func NewLegacyMessagePasserFilterer(address common.Address, filterer bind.ContractFilterer) (*LegacyMessagePasserFilterer, error) { + contract, err := bindLegacyMessagePasser(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &LegacyMessagePasserFilterer{contract: contract}, nil +} + +// bindLegacyMessagePasser binds a generic wrapper to an already deployed contract. +func bindLegacyMessagePasser(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(LegacyMessagePasserABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_LegacyMessagePasser *LegacyMessagePasserRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _LegacyMessagePasser.Contract.LegacyMessagePasserCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_LegacyMessagePasser *LegacyMessagePasserRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _LegacyMessagePasser.Contract.LegacyMessagePasserTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_LegacyMessagePasser *LegacyMessagePasserRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _LegacyMessagePasser.Contract.LegacyMessagePasserTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_LegacyMessagePasser *LegacyMessagePasserCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _LegacyMessagePasser.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_LegacyMessagePasser *LegacyMessagePasserTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _LegacyMessagePasser.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_LegacyMessagePasser *LegacyMessagePasserTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _LegacyMessagePasser.Contract.contract.Transact(opts, method, params...) +} + +// SentMessages is a free data retrieval call binding the contract method 0x82e3702d. +// +// Solidity: function sentMessages(bytes32 ) view returns(bool) +func (_LegacyMessagePasser *LegacyMessagePasserCaller) SentMessages(opts *bind.CallOpts, arg0 [32]byte) (bool, error) { + var out []interface{} + err := _LegacyMessagePasser.contract.Call(opts, &out, "sentMessages", arg0) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// SentMessages is a free data retrieval call binding the contract method 0x82e3702d. +// +// Solidity: function sentMessages(bytes32 ) view returns(bool) +func (_LegacyMessagePasser *LegacyMessagePasserSession) SentMessages(arg0 [32]byte) (bool, error) { + return _LegacyMessagePasser.Contract.SentMessages(&_LegacyMessagePasser.CallOpts, arg0) +} + +// SentMessages is a free data retrieval call binding the contract method 0x82e3702d. +// +// Solidity: function sentMessages(bytes32 ) view returns(bool) +func (_LegacyMessagePasser *LegacyMessagePasserCallerSession) SentMessages(arg0 [32]byte) (bool, error) { + return _LegacyMessagePasser.Contract.SentMessages(&_LegacyMessagePasser.CallOpts, arg0) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_LegacyMessagePasser *LegacyMessagePasserCaller) Version(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _LegacyMessagePasser.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 (_LegacyMessagePasser *LegacyMessagePasserSession) Version() (string, error) { + return _LegacyMessagePasser.Contract.Version(&_LegacyMessagePasser.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_LegacyMessagePasser *LegacyMessagePasserCallerSession) Version() (string, error) { + return _LegacyMessagePasser.Contract.Version(&_LegacyMessagePasser.CallOpts) +} + +// PassMessageToL1 is a paid mutator transaction binding the contract method 0xcafa81dc. +// +// Solidity: function passMessageToL1(bytes _message) returns() +func (_LegacyMessagePasser *LegacyMessagePasserTransactor) PassMessageToL1(opts *bind.TransactOpts, _message []byte) (*types.Transaction, error) { + return _LegacyMessagePasser.contract.Transact(opts, "passMessageToL1", _message) +} + +// PassMessageToL1 is a paid mutator transaction binding the contract method 0xcafa81dc. +// +// Solidity: function passMessageToL1(bytes _message) returns() +func (_LegacyMessagePasser *LegacyMessagePasserSession) PassMessageToL1(_message []byte) (*types.Transaction, error) { + return _LegacyMessagePasser.Contract.PassMessageToL1(&_LegacyMessagePasser.TransactOpts, _message) +} + +// PassMessageToL1 is a paid mutator transaction binding the contract method 0xcafa81dc. +// +// Solidity: function passMessageToL1(bytes _message) returns() +func (_LegacyMessagePasser *LegacyMessagePasserTransactorSession) PassMessageToL1(_message []byte) (*types.Transaction, error) { + return _LegacyMessagePasser.Contract.PassMessageToL1(&_LegacyMessagePasser.TransactOpts, _message) +} diff --git a/op-e2e2/bindings/mips.go b/op-e2e2/bindings/mips.go new file mode 100644 index 000000000000..46eaa3505da1 --- /dev/null +++ b/op-e2e2/bindings/mips.go @@ -0,0 +1,316 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// MIPSMetaData contains all meta data concerning the MIPS contract. +var MIPSMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_oracle\",\"type\":\"address\",\"internalType\":\"contractIPreimageOracle\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"BRK_START\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"oracle\",\"inputs\":[],\"outputs\":[{\"name\":\"oracle_\",\"type\":\"address\",\"internalType\":\"contractIPreimageOracle\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"step\",\"inputs\":[{\"name\":\"_stateData\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"_proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"_localContext\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"}]", + Bin: "0x60a060405234801561001057600080fd5b50604051611f89380380611f8983398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b608051611ef86100916000396000818160d901526116430152611ef86000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c8063155633fe1461005157806354fd4d50146100765780637dc0d1d0146100bf578063e14ced3214610103575b600080fd5b61005c634000000081565b60405163ffffffff90911681526020015b60405180910390f35b6100b26040518060400160405280600581526020017f302e312e3000000000000000000000000000000000000000000000000000000081525081565b60405161006d9190611d39565b60405173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016815260200161006d565b610116610111366004611df5565b610124565b60405190815260200161006d565b600061012e611caf565b6080811461013b57600080fd5b6040516106001461014b57600080fd5b6084871461015857600080fd5b6101a4851461016657600080fd5b8635608052602087013560a052604087013560e090811c60c09081526044890135821c82526048890135821c61010052604c890135821c610120526050890135821c61014052605489013590911c61016052605888013560f890811c610180526059890135901c6101a052605a880135901c6101c0526102006101e0819052606288019060005b602081101561021157823560e01c82526004909201916020909101906001016101ed565b5050508061012001511561022f5761022761066f565b915050610666565b6101408101805160010167ffffffffffffffff1690526060810151600090610257908261078b565b9050603f601a82901c16600281148061027657508063ffffffff166003145b156102cb5760006002836303ffffff1663ffffffff16901b846080015163f0000000161790506102c08263ffffffff166002146102b457601f6102b7565b60005b60ff1682610847565b945050505050610666565b6101608301516000908190601f601086901c81169190601587901c16602081106102f7576102f7611e69565b602002015192508063ffffffff8516158061031857508463ffffffff16601c145b1561034f578661016001518263ffffffff166020811061033a5761033a611e69565b6020020151925050601f600b86901c1661040b565b60208563ffffffff1610156103b1578463ffffffff16600c148061037957508463ffffffff16600d145b8061038a57508463ffffffff16600e145b1561039b578561ffff16925061040b565b6103aa8661ffff166010610938565b925061040b565b60288563ffffffff161015806103cd57508463ffffffff166022145b806103de57508463ffffffff166026145b1561040b578661016001518263ffffffff166020811061040057610400611e69565b602002015192508190505b60048563ffffffff1610158015610428575060088563ffffffff16105b8061043957508463ffffffff166001145b156104585761044a858784876109ab565b975050505050505050610666565b63ffffffff60006020878316106104bd576104788861ffff166010610938565b9095019463fffffffc861661048e81600161078b565b915060288863ffffffff16101580156104ae57508763ffffffff16603014155b156104bb57809250600093505b505b60006104cb89888885610bbb565b63ffffffff9081169150603f8a169089161580156104f0575060088163ffffffff1610155b80156105025750601c8163ffffffff16105b156105df578063ffffffff166008148061052257508063ffffffff166009145b15610559576105478163ffffffff1660081461053e5785610541565b60005b89610847565b9b505050505050505050505050610666565b8063ffffffff16600a0361057957610547858963ffffffff8a161561134b565b8063ffffffff16600b0361059a57610547858963ffffffff8a16151561134b565b8063ffffffff16600c036105b1576105478d611431565b60108163ffffffff16101580156105ce5750601c8163ffffffff16105b156105df5761054781898988611968565b8863ffffffff1660381480156105fa575063ffffffff861615155b1561062f5760018b61016001518763ffffffff166020811061061e5761061e611e69565b63ffffffff90921660209290920201525b8363ffffffff1663ffffffff1461064c5761064c84600184611b62565b6106588583600161134b565b9b5050505050505050505050505b95945050505050565b60408051608051815260a051602082015260dc519181019190915260fc51604482015261011c51604882015261013c51604c82015261015c51605082015261017c5160548201526101805161019f5160588301526101a0516101bf5160598401526101d851605a840152600092610200929091606283019190855b602081101561070e57601c86015184526020909501946004909301926001016106ea565b506000835283830384a060009450806001811461072e5760039550610756565b828015610746576001811461074f5760029650610754565b60009650610754565b600196505b505b50505081900390207effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1660f89190911b17919050565b60008061079783611c06565b905060038416156107a757600080fd5b6020810190358460051c8160005b601b81101561080d5760208501943583821c60011680156107dd57600181146107f257610803565b60008481526020839052604090209350610803565b600082815260208590526040902093505b50506001016107b5565b50608051915081811461082857630badf00d60005260206000fd5b5050601f94909416601c0360031b9390931c63ffffffff169392505050565b6000610851611caf565b60809050806060015160040163ffffffff16816080015163ffffffff16146108da576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f6a756d7020696e2064656c617920736c6f74000000000000000000000000000060448201526064015b60405180910390fd5b60608101805160808301805163ffffffff90811690935285831690529085161561093057806008018261016001518663ffffffff166020811061091f5761091f611e69565b63ffffffff90921660209290920201525b61066661066f565b600063ffffffff8381167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80850183169190911c821615159160016020869003821681901b830191861691821b92911b0182610995576000610997565b815b90861663ffffffff16179250505092915050565b60006109b5611caf565b608090506000816060015160040163ffffffff16826080015163ffffffff1614610a3b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f6272616e636820696e2064656c617920736c6f7400000000000000000000000060448201526064016108d1565b8663ffffffff1660041480610a5657508663ffffffff166005145b15610ad25760008261016001518663ffffffff1660208110610a7a57610a7a611e69565b602002015190508063ffffffff168563ffffffff16148015610aa257508763ffffffff166004145b80610aca57508063ffffffff168563ffffffff1614158015610aca57508763ffffffff166005145b915050610b4f565b8663ffffffff16600603610aef5760008460030b13159050610b4f565b8663ffffffff16600703610b0b5760008460030b139050610b4f565b8663ffffffff16600103610b4f57601f601087901c166000819003610b345760008560030b1291505b8063ffffffff16600103610b4d5760008560030b121591505b505b606082018051608084015163ffffffff169091528115610b95576002610b7a8861ffff166010610938565b63ffffffff90811690911b8201600401166080840152610ba7565b60808301805160040163ffffffff1690525b610baf61066f565b98975050505050505050565b6000603f601a86901c16801580610bea575060088163ffffffff1610158015610bea5750600f8163ffffffff16105b1561104057603f86168160088114610c315760098114610c3a57600a8114610c4357600b8114610c4c57600c8114610c5557600d8114610c5e57600e8114610c6757610c6c565b60209150610c6c565b60219150610c6c565b602a9150610c6c565b602b9150610c6c565b60249150610c6c565b60259150610c6c565b602691505b508063ffffffff16600003610c935750505063ffffffff8216601f600686901c161b611343565b8063ffffffff16600203610cb95750505063ffffffff8216601f600686901c161c611343565b8063ffffffff16600303610cef57601f600688901c16610ce563ffffffff8716821c6020839003610938565b9350505050611343565b8063ffffffff16600403610d115750505063ffffffff8216601f84161b611343565b8063ffffffff16600603610d335750505063ffffffff8216601f84161c611343565b8063ffffffff16600703610d6657610d5d8663ffffffff168663ffffffff16901c87602003610938565b92505050611343565b8063ffffffff16600803610d7e578592505050611343565b8063ffffffff16600903610d96578592505050611343565b8063ffffffff16600a03610dae578592505050611343565b8063ffffffff16600b03610dc6578592505050611343565b8063ffffffff16600c03610dde578592505050611343565b8063ffffffff16600f03610df6578592505050611343565b8063ffffffff16601003610e0e578592505050611343565b8063ffffffff16601103610e26578592505050611343565b8063ffffffff16601203610e3e578592505050611343565b8063ffffffff16601303610e56578592505050611343565b8063ffffffff16601803610e6e578592505050611343565b8063ffffffff16601903610e86578592505050611343565b8063ffffffff16601a03610e9e578592505050611343565b8063ffffffff16601b03610eb6578592505050611343565b8063ffffffff16602003610ecf57505050828201611343565b8063ffffffff16602103610ee857505050828201611343565b8063ffffffff16602203610f0157505050818303611343565b8063ffffffff16602303610f1a57505050818303611343565b8063ffffffff16602403610f3357505050828216611343565b8063ffffffff16602503610f4c57505050828217611343565b8063ffffffff16602603610f6557505050828218611343565b8063ffffffff16602703610f7f5750505082821719611343565b8063ffffffff16602a03610fb0578460030b8660030b12610fa1576000610fa4565b60015b60ff1692505050611343565b8063ffffffff16602b03610fd8578463ffffffff168663ffffffff1610610fa1576000610fa4565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f696e76616c696420696e737472756374696f6e0000000000000000000000000060448201526064016108d1565b50610fd8565b8063ffffffff16601c036110c457603f8616600281900361106657505050828202611343565b8063ffffffff166020148061108157508063ffffffff166021145b1561103a578063ffffffff16602003611098579419945b60005b63800000008716156110ba576401fffffffe600197881b16960161109b565b9250611343915050565b8063ffffffff16600f036110e657505065ffffffff0000601083901b16611343565b8063ffffffff166020036111225761111a8560031660080260180363ffffffff168463ffffffff16901c60ff166008610938565b915050611343565b8063ffffffff166021036111575761111a8560021660080260100363ffffffff168463ffffffff16901c61ffff166010610938565b8063ffffffff1660220361118657505063ffffffff60086003851602811681811b198416918316901b17611343565b8063ffffffff1660230361119d5782915050611343565b8063ffffffff166024036111cf578460031660080260180363ffffffff168363ffffffff16901c60ff16915050611343565b8063ffffffff16602503611202578460021660080260100363ffffffff168363ffffffff16901c61ffff16915050611343565b8063ffffffff1660260361123457505063ffffffff60086003851602601803811681811c198416918316901c17611343565b8063ffffffff1660280361126a57505060ff63ffffffff60086003861602601803811682811b9091188316918416901b17611343565b8063ffffffff166029036112a157505061ffff63ffffffff60086002861602601003811682811b9091188316918416901b17611343565b8063ffffffff16602a036112d057505063ffffffff60086003851602811681811c198316918416901c17611343565b8063ffffffff16602b036112e75783915050611343565b8063ffffffff16602e0361131957505063ffffffff60086003851602601803811681811b198316918416901b17611343565b8063ffffffff166030036113305782915050611343565b8063ffffffff16603803610fd857839150505b949350505050565b6000611355611caf565b506080602063ffffffff8616106113c8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f76616c696420726567697374657200000000000000000000000000000000000060448201526064016108d1565b63ffffffff8516158015906113da5750825b1561140e57838161016001518663ffffffff16602081106113fd576113fd611e69565b63ffffffff90921660209290920201525b60808101805163ffffffff8082166060850152600490910116905261066661066f565b600061143b611caf565b506101e051604081015160808083015160a084015160c09094015191936000928392919063ffffffff8616610ffa036114b55781610fff81161561148457610fff811661100003015b8363ffffffff166000036114ab5760e08801805163ffffffff8382011690915295506114af565b8395505b50611927565b8563ffffffff16610fcd036114d05763400000009450611927565b8563ffffffff16611018036114e85760019450611927565b8563ffffffff166110960361151e57600161012088015260ff831661010088015261151161066f565b9998505050505050505050565b8563ffffffff16610fa30361178a5763ffffffff831615611927577ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb63ffffffff8416016117445760006115798363fffffffc16600161078b565b60208901519091508060001a6001036115e857604080516000838152336020528d83526060902091527effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f01000000000000000000000000000000000000000000000000000000000000001790505b6040808a015190517fe03110e10000000000000000000000000000000000000000000000000000000081526004810183905263ffffffff9091166024820152600090819073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063e03110e1906044016040805180830381865afa158015611689573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116ad9190611e98565b915091506003861680600403828110156116c5578092505b50818610156116d2578591505b8260088302610100031c9250826008828460040303021b9250600180600883600403021b036001806008858560040303021b039150811981169050838119871617955050506117298663fffffffc16600186611b62565b60408b018051820163ffffffff169052975061178592505050565b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd63ffffffff84160161177957809450611927565b63ffffffff9450600993505b611927565b8563ffffffff16610fa40361187b5763ffffffff8316600114806117b4575063ffffffff83166002145b806117c5575063ffffffff83166004145b156117d257809450611927565b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa63ffffffff8416016117795760006118128363fffffffc16600161078b565b6020890151909150600384166004038381101561182d578093505b83900360089081029290921c7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600193850293841b0116911b17602088015260006040880152935083611927565b8563ffffffff16610fd703611927578163ffffffff1660030361191b5763ffffffff831615806118b1575063ffffffff83166005145b806118c2575063ffffffff83166003145b156118d05760009450611927565b63ffffffff8316600114806118eb575063ffffffff83166002145b806118fc575063ffffffff83166006145b8061190d575063ffffffff83166004145b156117795760019450611927565b63ffffffff9450601693505b6101608701805163ffffffff808816604090920191909152905185821660e09091015260808801805180831660608b0152600401909116905261151161066f565b6000611972611caf565b506080600063ffffffff8716601003611990575060c0810151611af9565b8663ffffffff166011036119af5763ffffffff861660c0830152611af9565b8663ffffffff166012036119c8575060a0810151611af9565b8663ffffffff166013036119e75763ffffffff861660a0830152611af9565b8663ffffffff16601803611a1b5763ffffffff600387810b9087900b02602081901c821660c08501521660a0830152611af9565b8663ffffffff16601903611a4c5763ffffffff86811681871602602081901c821660c08501521660a0830152611af9565b8663ffffffff16601a03611aa2578460030b8660030b81611a6f57611a6f611ebc565b0763ffffffff1660c0830152600385810b9087900b81611a9157611a91611ebc565b0563ffffffff1660a0830152611af9565b8663ffffffff16601b03611af9578463ffffffff168663ffffffff1681611acb57611acb611ebc565b0663ffffffff90811660c084015285811690871681611aec57611aec611ebc565b0463ffffffff1660a08301525b63ffffffff841615611b3457808261016001518563ffffffff1660208110611b2357611b23611e69565b63ffffffff90921660209290920201525b60808201805163ffffffff80821660608601526004909101169052611b5761066f565b979650505050505050565b6000611b6d83611c06565b90506003841615611b7d57600080fd5b6020810190601f8516601c0360031b83811b913563ffffffff90911b1916178460051c60005b601b811015611bfb5760208401933582821c6001168015611bcb5760018114611be057611bf1565b60008581526020839052604090209450611bf1565b600082815260208690526040902094505b5050600101611ba3565b505060805250505050565b60ff8116610380026101a4810190369061052401811015611ca9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f636865636b207468617420746865726520697320656e6f7567682063616c6c6460448201527f617461000000000000000000000000000000000000000000000000000000000060648201526084016108d1565b50919050565b6040805161018081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081018290526101408101919091526101608101611d15611d1a565b905290565b6040518061040001604052806020906020820280368337509192915050565b600060208083528351808285015260005b81811015611d6657858101830151858201604001528201611d4a565b81811115611d78576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b60008083601f840112611dbe57600080fd5b50813567ffffffffffffffff811115611dd657600080fd5b602083019150836020828501011115611dee57600080fd5b9250929050565b600080600080600060608688031215611e0d57600080fd5b853567ffffffffffffffff80821115611e2557600080fd5b611e3189838a01611dac565b90975095506020880135915080821115611e4a57600080fd5b50611e5788828901611dac565b96999598509660400135949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008060408385031215611eab57600080fd5b505080516020909101519092909150565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fdfea164736f6c634300080f000a", +} + +// MIPSABI is the input ABI used to generate the binding from. +// Deprecated: Use MIPSMetaData.ABI instead. +var MIPSABI = MIPSMetaData.ABI + +// MIPSBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use MIPSMetaData.Bin instead. +var MIPSBin = MIPSMetaData.Bin + +// DeployMIPS deploys a new Ethereum contract, binding an instance of MIPS to it. +func DeployMIPS(auth *bind.TransactOpts, backend bind.ContractBackend, _oracle common.Address) (common.Address, *types.Transaction, *MIPS, error) { + parsed, err := MIPSMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(MIPSBin), backend, _oracle) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &MIPS{MIPSCaller: MIPSCaller{contract: contract}, MIPSTransactor: MIPSTransactor{contract: contract}, MIPSFilterer: MIPSFilterer{contract: contract}}, nil +} + +// MIPS is an auto generated Go binding around an Ethereum contract. +type MIPS struct { + MIPSCaller // Read-only binding to the contract + MIPSTransactor // Write-only binding to the contract + MIPSFilterer // Log filterer for contract events +} + +// MIPSCaller is an auto generated read-only Go binding around an Ethereum contract. +type MIPSCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// MIPSTransactor is an auto generated write-only Go binding around an Ethereum contract. +type MIPSTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// MIPSFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type MIPSFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// MIPSSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type MIPSSession struct { + Contract *MIPS // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// MIPSCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type MIPSCallerSession struct { + Contract *MIPSCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// MIPSTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type MIPSTransactorSession struct { + Contract *MIPSTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// MIPSRaw is an auto generated low-level Go binding around an Ethereum contract. +type MIPSRaw struct { + Contract *MIPS // Generic contract binding to access the raw methods on +} + +// MIPSCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type MIPSCallerRaw struct { + Contract *MIPSCaller // Generic read-only contract binding to access the raw methods on +} + +// MIPSTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type MIPSTransactorRaw struct { + Contract *MIPSTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewMIPS creates a new instance of MIPS, bound to a specific deployed contract. +func NewMIPS(address common.Address, backend bind.ContractBackend) (*MIPS, error) { + contract, err := bindMIPS(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &MIPS{MIPSCaller: MIPSCaller{contract: contract}, MIPSTransactor: MIPSTransactor{contract: contract}, MIPSFilterer: MIPSFilterer{contract: contract}}, nil +} + +// NewMIPSCaller creates a new read-only instance of MIPS, bound to a specific deployed contract. +func NewMIPSCaller(address common.Address, caller bind.ContractCaller) (*MIPSCaller, error) { + contract, err := bindMIPS(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &MIPSCaller{contract: contract}, nil +} + +// NewMIPSTransactor creates a new write-only instance of MIPS, bound to a specific deployed contract. +func NewMIPSTransactor(address common.Address, transactor bind.ContractTransactor) (*MIPSTransactor, error) { + contract, err := bindMIPS(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &MIPSTransactor{contract: contract}, nil +} + +// NewMIPSFilterer creates a new log filterer instance of MIPS, bound to a specific deployed contract. +func NewMIPSFilterer(address common.Address, filterer bind.ContractFilterer) (*MIPSFilterer, error) { + contract, err := bindMIPS(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &MIPSFilterer{contract: contract}, nil +} + +// bindMIPS binds a generic wrapper to an already deployed contract. +func bindMIPS(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(MIPSABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_MIPS *MIPSRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _MIPS.Contract.MIPSCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_MIPS *MIPSRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MIPS.Contract.MIPSTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_MIPS *MIPSRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _MIPS.Contract.MIPSTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_MIPS *MIPSCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _MIPS.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_MIPS *MIPSTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MIPS.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_MIPS *MIPSTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _MIPS.Contract.contract.Transact(opts, method, params...) +} + +// BRKSTART is a free data retrieval call binding the contract method 0x155633fe. +// +// Solidity: function BRK_START() view returns(uint32) +func (_MIPS *MIPSCaller) BRKSTART(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _MIPS.contract.Call(opts, &out, "BRK_START") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// BRKSTART is a free data retrieval call binding the contract method 0x155633fe. +// +// Solidity: function BRK_START() view returns(uint32) +func (_MIPS *MIPSSession) BRKSTART() (uint32, error) { + return _MIPS.Contract.BRKSTART(&_MIPS.CallOpts) +} + +// BRKSTART is a free data retrieval call binding the contract method 0x155633fe. +// +// Solidity: function BRK_START() view returns(uint32) +func (_MIPS *MIPSCallerSession) BRKSTART() (uint32, error) { + return _MIPS.Contract.BRKSTART(&_MIPS.CallOpts) +} + +// Oracle is a free data retrieval call binding the contract method 0x7dc0d1d0. +// +// Solidity: function oracle() view returns(address oracle_) +func (_MIPS *MIPSCaller) Oracle(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _MIPS.contract.Call(opts, &out, "oracle") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Oracle is a free data retrieval call binding the contract method 0x7dc0d1d0. +// +// Solidity: function oracle() view returns(address oracle_) +func (_MIPS *MIPSSession) Oracle() (common.Address, error) { + return _MIPS.Contract.Oracle(&_MIPS.CallOpts) +} + +// Oracle is a free data retrieval call binding the contract method 0x7dc0d1d0. +// +// Solidity: function oracle() view returns(address oracle_) +func (_MIPS *MIPSCallerSession) Oracle() (common.Address, error) { + return _MIPS.Contract.Oracle(&_MIPS.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_MIPS *MIPSCaller) Version(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _MIPS.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 (_MIPS *MIPSSession) Version() (string, error) { + return _MIPS.Contract.Version(&_MIPS.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_MIPS *MIPSCallerSession) Version() (string, error) { + return _MIPS.Contract.Version(&_MIPS.CallOpts) +} + +// Step is a paid mutator transaction binding the contract method 0xe14ced32. +// +// Solidity: function step(bytes _stateData, bytes _proof, bytes32 _localContext) returns(bytes32) +func (_MIPS *MIPSTransactor) Step(opts *bind.TransactOpts, _stateData []byte, _proof []byte, _localContext [32]byte) (*types.Transaction, error) { + return _MIPS.contract.Transact(opts, "step", _stateData, _proof, _localContext) +} + +// Step is a paid mutator transaction binding the contract method 0xe14ced32. +// +// Solidity: function step(bytes _stateData, bytes _proof, bytes32 _localContext) returns(bytes32) +func (_MIPS *MIPSSession) Step(_stateData []byte, _proof []byte, _localContext [32]byte) (*types.Transaction, error) { + return _MIPS.Contract.Step(&_MIPS.TransactOpts, _stateData, _proof, _localContext) +} + +// Step is a paid mutator transaction binding the contract method 0xe14ced32. +// +// Solidity: function step(bytes _stateData, bytes _proof, bytes32 _localContext) returns(bytes32) +func (_MIPS *MIPSTransactorSession) Step(_stateData []byte, _proof []byte, _localContext [32]byte) (*types.Transaction, error) { + return _MIPS.Contract.Step(&_MIPS.TransactOpts, _stateData, _proof, _localContext) +} diff --git a/op-e2e2/bindings/multicall3.go b/op-e2e2/bindings/multicall3.go new file mode 100644 index 000000000000..68cf9c8507b7 --- /dev/null +++ b/op-e2e2/bindings/multicall3.go @@ -0,0 +1,665 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// Multicall3Call is an auto generated low-level Go binding around an user-defined struct. +type Multicall3Call struct { + Target common.Address + CallData []byte +} + +// Multicall3Call3 is an auto generated low-level Go binding around an user-defined struct. +type Multicall3Call3 struct { + Target common.Address + AllowFailure bool + CallData []byte +} + +// Multicall3Call3Value is an auto generated low-level Go binding around an user-defined struct. +type Multicall3Call3Value struct { + Target common.Address + AllowFailure bool + Value *big.Int + CallData []byte +} + +// Multicall3Result is an auto generated low-level Go binding around an user-defined struct. +type Multicall3Result struct { + Success bool + ReturnData []byte +} + +// MultiCall3MetaData contains all meta data concerning the MultiCall3 contract. +var MultiCall3MetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"}],\"internalType\":\"structMulticall3.Call[]\",\"name\":\"calls\",\"type\":\"tuple[]\"}],\"name\":\"aggregate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"},{\"internalType\":\"bytes[]\",\"name\":\"returnData\",\"type\":\"bytes[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"allowFailure\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"}],\"internalType\":\"structMulticall3.Call3[]\",\"name\":\"calls\",\"type\":\"tuple[]\"}],\"name\":\"aggregate3\",\"outputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"returnData\",\"type\":\"bytes\"}],\"internalType\":\"structMulticall3.Result[]\",\"name\":\"returnData\",\"type\":\"tuple[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"allowFailure\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"}],\"internalType\":\"structMulticall3.Call3Value[]\",\"name\":\"calls\",\"type\":\"tuple[]\"}],\"name\":\"aggregate3Value\",\"outputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"returnData\",\"type\":\"bytes\"}],\"internalType\":\"structMulticall3.Result[]\",\"name\":\"returnData\",\"type\":\"tuple[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"}],\"internalType\":\"structMulticall3.Call[]\",\"name\":\"calls\",\"type\":\"tuple[]\"}],\"name\":\"blockAndAggregate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"returnData\",\"type\":\"bytes\"}],\"internalType\":\"structMulticall3.Result[]\",\"name\":\"returnData\",\"type\":\"tuple[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBasefee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"basefee\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"}],\"name\":\"getBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBlockNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getChainId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"chainid\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCurrentBlockCoinbase\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCurrentBlockDifficulty\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"difficulty\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCurrentBlockGasLimit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"gaslimit\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCurrentBlockTimestamp\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"getEthBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLastBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"requireSuccess\",\"type\":\"bool\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"}],\"internalType\":\"structMulticall3.Call[]\",\"name\":\"calls\",\"type\":\"tuple[]\"}],\"name\":\"tryAggregate\",\"outputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"returnData\",\"type\":\"bytes\"}],\"internalType\":\"structMulticall3.Result[]\",\"name\":\"returnData\",\"type\":\"tuple[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"requireSuccess\",\"type\":\"bool\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"}],\"internalType\":\"structMulticall3.Call[]\",\"name\":\"calls\",\"type\":\"tuple[]\"}],\"name\":\"tryBlockAndAggregate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"returnData\",\"type\":\"bytes\"}],\"internalType\":\"structMulticall3.Result[]\",\"name\":\"returnData\",\"type\":\"tuple[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"}]", + Bin: "0x608060405234801561001057600080fd5b50610ee0806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e1461025a578063bce38bd714610275578063c3077fa914610288578063ee82ac5e1461029b57600080fd5b80634d2301cc146101ec57806372425d9d1461022157806382ad56cb1461023457806386d516e81461024757600080fd5b80633408e470116100c65780633408e47014610191578063399542e9146101a45780633e64a696146101c657806342cbb15c146101d957600080fd5b80630f28c97d146100f8578063174dea711461011a578063252dba421461013a57806327e86d6e1461015b575b600080fd5b34801561010457600080fd5b50425b6040519081526020015b60405180910390f35b61012d610128366004610a85565b6102ba565b6040516101119190610bbe565b61014d610148366004610a85565b6104ef565b604051610111929190610bd8565b34801561016757600080fd5b50437fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0140610107565b34801561019d57600080fd5b5046610107565b6101b76101b2366004610c60565b610690565b60405161011193929190610cba565b3480156101d257600080fd5b5048610107565b3480156101e557600080fd5b5043610107565b3480156101f857600080fd5b50610107610207366004610ce2565b73ffffffffffffffffffffffffffffffffffffffff163190565b34801561022d57600080fd5b5044610107565b61012d610242366004610a85565b6106ab565b34801561025357600080fd5b5045610107565b34801561026657600080fd5b50604051418152602001610111565b61012d610283366004610c60565b61085a565b6101b7610296366004610a85565b610a1a565b3480156102a757600080fd5b506101076102b6366004610d18565b4090565b60606000828067ffffffffffffffff8111156102d8576102d8610d31565b60405190808252806020026020018201604052801561031e57816020015b6040805180820190915260008152606060208201528152602001906001900390816102f65790505b5092503660005b8281101561047757600085828151811061034157610341610d60565b6020026020010151905087878381811061035d5761035d610d60565b905060200281019061036f9190610d8f565b6040810135958601959093506103886020850185610ce2565b73ffffffffffffffffffffffffffffffffffffffff16816103ac6060870187610dcd565b6040516103ba929190610e32565b60006040518083038185875af1925050503d80600081146103f7576040519150601f19603f3d011682016040523d82523d6000602084013e6103fc565b606091505b50602080850191909152901515808452908501351761046d577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b5050600101610325565b508234146104e6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4d756c746963616c6c333a2076616c7565206d69736d6174636800000000000060448201526064015b60405180910390fd5b50505092915050565b436060828067ffffffffffffffff81111561050c5761050c610d31565b60405190808252806020026020018201604052801561053f57816020015b606081526020019060019003908161052a5790505b5091503660005b8281101561068657600087878381811061056257610562610d60565b90506020028101906105749190610e42565b92506105836020840184610ce2565b73ffffffffffffffffffffffffffffffffffffffff166105a66020850185610dcd565b6040516105b4929190610e32565b6000604051808303816000865af19150503d80600081146105f1576040519150601f19603f3d011682016040523d82523d6000602084013e6105f6565b606091505b5086848151811061060957610609610d60565b602090810291909101015290508061067d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060448201526064016104dd565b50600101610546565b5050509250929050565b43804060606106a086868661085a565b905093509350939050565b6060818067ffffffffffffffff8111156106c7576106c7610d31565b60405190808252806020026020018201604052801561070d57816020015b6040805180820190915260008152606060208201528152602001906001900390816106e55790505b5091503660005b828110156104e657600084828151811061073057610730610d60565b6020026020010151905086868381811061074c5761074c610d60565b905060200281019061075e9190610e76565b925061076d6020840184610ce2565b73ffffffffffffffffffffffffffffffffffffffff166107906040850185610dcd565b60405161079e929190610e32565b6000604051808303816000865af19150503d80600081146107db576040519150601f19603f3d011682016040523d82523d6000602084013e6107e0565b606091505b506020808401919091529015158083529084013517610851577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b50600101610714565b6060818067ffffffffffffffff81111561087657610876610d31565b6040519080825280602002602001820160405280156108bc57816020015b6040805180820190915260008152606060208201528152602001906001900390816108945790505b5091503660005b82811015610a105760008482815181106108df576108df610d60565b602002602001015190508686838181106108fb576108fb610d60565b905060200281019061090d9190610e42565b925061091c6020840184610ce2565b73ffffffffffffffffffffffffffffffffffffffff1661093f6020850185610dcd565b60405161094d929190610e32565b6000604051808303816000865af19150503d806000811461098a576040519150601f19603f3d011682016040523d82523d6000602084013e61098f565b606091505b506020830152151581528715610a07578051610a07576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060448201526064016104dd565b506001016108c3565b5050509392505050565b6000806060610a2b60018686610690565b919790965090945092505050565b60008083601f840112610a4b57600080fd5b50813567ffffffffffffffff811115610a6357600080fd5b6020830191508360208260051b8501011115610a7e57600080fd5b9250929050565b60008060208385031215610a9857600080fd5b823567ffffffffffffffff811115610aaf57600080fd5b610abb85828601610a39565b90969095509350505050565b6000815180845260005b81811015610aed57602081850181015186830182015201610ad1565b81811115610aff576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015610bb1578583037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001895281518051151584528401516040858501819052610b9d81860183610ac7565b9a86019a9450505090830190600101610b4f565b5090979650505050505050565b602081526000610bd16020830184610b32565b9392505050565b600060408201848352602060408185015281855180845260608601915060608160051b870101935082870160005b82811015610c52577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa0888703018452610c40868351610ac7565b95509284019290840190600101610c06565b509398975050505050505050565b600080600060408486031215610c7557600080fd5b83358015158114610c8557600080fd5b9250602084013567ffffffffffffffff811115610ca157600080fd5b610cad86828701610a39565b9497909650939450505050565b838152826020820152606060408201526000610cd96060830184610b32565b95945050505050565b600060208284031215610cf457600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610bd157600080fd5b600060208284031215610d2a57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81833603018112610dc357600080fd5b9190910192915050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112610e0257600080fd5b83018035915067ffffffffffffffff821115610e1d57600080fd5b602001915036819003821315610a7e57600080fd5b8183823760009101908152919050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc1833603018112610dc357600080fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa1833603018112610dc357600080fdfea2646970667358221220bb2b5c71a328032f97c676ae39a1ec2148d3e5d6f73d95e9b17910152d61f16264736f6c634300080c0033", +} + +// MultiCall3ABI is the input ABI used to generate the binding from. +// Deprecated: Use MultiCall3MetaData.ABI instead. +var MultiCall3ABI = MultiCall3MetaData.ABI + +// MultiCall3Bin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use MultiCall3MetaData.Bin instead. +var MultiCall3Bin = MultiCall3MetaData.Bin + +// DeployMultiCall3 deploys a new Ethereum contract, binding an instance of MultiCall3 to it. +func DeployMultiCall3(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *MultiCall3, error) { + parsed, err := MultiCall3MetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(MultiCall3Bin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &MultiCall3{MultiCall3Caller: MultiCall3Caller{contract: contract}, MultiCall3Transactor: MultiCall3Transactor{contract: contract}, MultiCall3Filterer: MultiCall3Filterer{contract: contract}}, nil +} + +// MultiCall3 is an auto generated Go binding around an Ethereum contract. +type MultiCall3 struct { + MultiCall3Caller // Read-only binding to the contract + MultiCall3Transactor // Write-only binding to the contract + MultiCall3Filterer // Log filterer for contract events +} + +// MultiCall3Caller is an auto generated read-only Go binding around an Ethereum contract. +type MultiCall3Caller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// MultiCall3Transactor is an auto generated write-only Go binding around an Ethereum contract. +type MultiCall3Transactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// MultiCall3Filterer is an auto generated log filtering Go binding around an Ethereum contract events. +type MultiCall3Filterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// MultiCall3Session is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type MultiCall3Session struct { + Contract *MultiCall3 // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// MultiCall3CallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type MultiCall3CallerSession struct { + Contract *MultiCall3Caller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// MultiCall3TransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type MultiCall3TransactorSession struct { + Contract *MultiCall3Transactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// MultiCall3Raw is an auto generated low-level Go binding around an Ethereum contract. +type MultiCall3Raw struct { + Contract *MultiCall3 // Generic contract binding to access the raw methods on +} + +// MultiCall3CallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type MultiCall3CallerRaw struct { + Contract *MultiCall3Caller // Generic read-only contract binding to access the raw methods on +} + +// MultiCall3TransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type MultiCall3TransactorRaw struct { + Contract *MultiCall3Transactor // Generic write-only contract binding to access the raw methods on +} + +// NewMultiCall3 creates a new instance of MultiCall3, bound to a specific deployed contract. +func NewMultiCall3(address common.Address, backend bind.ContractBackend) (*MultiCall3, error) { + contract, err := bindMultiCall3(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &MultiCall3{MultiCall3Caller: MultiCall3Caller{contract: contract}, MultiCall3Transactor: MultiCall3Transactor{contract: contract}, MultiCall3Filterer: MultiCall3Filterer{contract: contract}}, nil +} + +// NewMultiCall3Caller creates a new read-only instance of MultiCall3, bound to a specific deployed contract. +func NewMultiCall3Caller(address common.Address, caller bind.ContractCaller) (*MultiCall3Caller, error) { + contract, err := bindMultiCall3(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &MultiCall3Caller{contract: contract}, nil +} + +// NewMultiCall3Transactor creates a new write-only instance of MultiCall3, bound to a specific deployed contract. +func NewMultiCall3Transactor(address common.Address, transactor bind.ContractTransactor) (*MultiCall3Transactor, error) { + contract, err := bindMultiCall3(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &MultiCall3Transactor{contract: contract}, nil +} + +// NewMultiCall3Filterer creates a new log filterer instance of MultiCall3, bound to a specific deployed contract. +func NewMultiCall3Filterer(address common.Address, filterer bind.ContractFilterer) (*MultiCall3Filterer, error) { + contract, err := bindMultiCall3(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &MultiCall3Filterer{contract: contract}, nil +} + +// bindMultiCall3 binds a generic wrapper to an already deployed contract. +func bindMultiCall3(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(MultiCall3ABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_MultiCall3 *MultiCall3Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _MultiCall3.Contract.MultiCall3Caller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_MultiCall3 *MultiCall3Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MultiCall3.Contract.MultiCall3Transactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_MultiCall3 *MultiCall3Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _MultiCall3.Contract.MultiCall3Transactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_MultiCall3 *MultiCall3CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _MultiCall3.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_MultiCall3 *MultiCall3TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MultiCall3.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_MultiCall3 *MultiCall3TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _MultiCall3.Contract.contract.Transact(opts, method, params...) +} + +// GetBasefee is a free data retrieval call binding the contract method 0x3e64a696. +// +// Solidity: function getBasefee() view returns(uint256 basefee) +func (_MultiCall3 *MultiCall3Caller) GetBasefee(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _MultiCall3.contract.Call(opts, &out, "getBasefee") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetBasefee is a free data retrieval call binding the contract method 0x3e64a696. +// +// Solidity: function getBasefee() view returns(uint256 basefee) +func (_MultiCall3 *MultiCall3Session) GetBasefee() (*big.Int, error) { + return _MultiCall3.Contract.GetBasefee(&_MultiCall3.CallOpts) +} + +// GetBasefee is a free data retrieval call binding the contract method 0x3e64a696. +// +// Solidity: function getBasefee() view returns(uint256 basefee) +func (_MultiCall3 *MultiCall3CallerSession) GetBasefee() (*big.Int, error) { + return _MultiCall3.Contract.GetBasefee(&_MultiCall3.CallOpts) +} + +// GetBlockHash is a free data retrieval call binding the contract method 0xee82ac5e. +// +// Solidity: function getBlockHash(uint256 blockNumber) view returns(bytes32 blockHash) +func (_MultiCall3 *MultiCall3Caller) GetBlockHash(opts *bind.CallOpts, blockNumber *big.Int) ([32]byte, error) { + var out []interface{} + err := _MultiCall3.contract.Call(opts, &out, "getBlockHash", blockNumber) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// GetBlockHash is a free data retrieval call binding the contract method 0xee82ac5e. +// +// Solidity: function getBlockHash(uint256 blockNumber) view returns(bytes32 blockHash) +func (_MultiCall3 *MultiCall3Session) GetBlockHash(blockNumber *big.Int) ([32]byte, error) { + return _MultiCall3.Contract.GetBlockHash(&_MultiCall3.CallOpts, blockNumber) +} + +// GetBlockHash is a free data retrieval call binding the contract method 0xee82ac5e. +// +// Solidity: function getBlockHash(uint256 blockNumber) view returns(bytes32 blockHash) +func (_MultiCall3 *MultiCall3CallerSession) GetBlockHash(blockNumber *big.Int) ([32]byte, error) { + return _MultiCall3.Contract.GetBlockHash(&_MultiCall3.CallOpts, blockNumber) +} + +// GetBlockNumber is a free data retrieval call binding the contract method 0x42cbb15c. +// +// Solidity: function getBlockNumber() view returns(uint256 blockNumber) +func (_MultiCall3 *MultiCall3Caller) GetBlockNumber(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _MultiCall3.contract.Call(opts, &out, "getBlockNumber") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetBlockNumber is a free data retrieval call binding the contract method 0x42cbb15c. +// +// Solidity: function getBlockNumber() view returns(uint256 blockNumber) +func (_MultiCall3 *MultiCall3Session) GetBlockNumber() (*big.Int, error) { + return _MultiCall3.Contract.GetBlockNumber(&_MultiCall3.CallOpts) +} + +// GetBlockNumber is a free data retrieval call binding the contract method 0x42cbb15c. +// +// Solidity: function getBlockNumber() view returns(uint256 blockNumber) +func (_MultiCall3 *MultiCall3CallerSession) GetBlockNumber() (*big.Int, error) { + return _MultiCall3.Contract.GetBlockNumber(&_MultiCall3.CallOpts) +} + +// GetChainId is a free data retrieval call binding the contract method 0x3408e470. +// +// Solidity: function getChainId() view returns(uint256 chainid) +func (_MultiCall3 *MultiCall3Caller) GetChainId(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _MultiCall3.contract.Call(opts, &out, "getChainId") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetChainId is a free data retrieval call binding the contract method 0x3408e470. +// +// Solidity: function getChainId() view returns(uint256 chainid) +func (_MultiCall3 *MultiCall3Session) GetChainId() (*big.Int, error) { + return _MultiCall3.Contract.GetChainId(&_MultiCall3.CallOpts) +} + +// GetChainId is a free data retrieval call binding the contract method 0x3408e470. +// +// Solidity: function getChainId() view returns(uint256 chainid) +func (_MultiCall3 *MultiCall3CallerSession) GetChainId() (*big.Int, error) { + return _MultiCall3.Contract.GetChainId(&_MultiCall3.CallOpts) +} + +// GetCurrentBlockCoinbase is a free data retrieval call binding the contract method 0xa8b0574e. +// +// Solidity: function getCurrentBlockCoinbase() view returns(address coinbase) +func (_MultiCall3 *MultiCall3Caller) GetCurrentBlockCoinbase(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _MultiCall3.contract.Call(opts, &out, "getCurrentBlockCoinbase") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// GetCurrentBlockCoinbase is a free data retrieval call binding the contract method 0xa8b0574e. +// +// Solidity: function getCurrentBlockCoinbase() view returns(address coinbase) +func (_MultiCall3 *MultiCall3Session) GetCurrentBlockCoinbase() (common.Address, error) { + return _MultiCall3.Contract.GetCurrentBlockCoinbase(&_MultiCall3.CallOpts) +} + +// GetCurrentBlockCoinbase is a free data retrieval call binding the contract method 0xa8b0574e. +// +// Solidity: function getCurrentBlockCoinbase() view returns(address coinbase) +func (_MultiCall3 *MultiCall3CallerSession) GetCurrentBlockCoinbase() (common.Address, error) { + return _MultiCall3.Contract.GetCurrentBlockCoinbase(&_MultiCall3.CallOpts) +} + +// GetCurrentBlockDifficulty is a free data retrieval call binding the contract method 0x72425d9d. +// +// Solidity: function getCurrentBlockDifficulty() view returns(uint256 difficulty) +func (_MultiCall3 *MultiCall3Caller) GetCurrentBlockDifficulty(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _MultiCall3.contract.Call(opts, &out, "getCurrentBlockDifficulty") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetCurrentBlockDifficulty is a free data retrieval call binding the contract method 0x72425d9d. +// +// Solidity: function getCurrentBlockDifficulty() view returns(uint256 difficulty) +func (_MultiCall3 *MultiCall3Session) GetCurrentBlockDifficulty() (*big.Int, error) { + return _MultiCall3.Contract.GetCurrentBlockDifficulty(&_MultiCall3.CallOpts) +} + +// GetCurrentBlockDifficulty is a free data retrieval call binding the contract method 0x72425d9d. +// +// Solidity: function getCurrentBlockDifficulty() view returns(uint256 difficulty) +func (_MultiCall3 *MultiCall3CallerSession) GetCurrentBlockDifficulty() (*big.Int, error) { + return _MultiCall3.Contract.GetCurrentBlockDifficulty(&_MultiCall3.CallOpts) +} + +// GetCurrentBlockGasLimit is a free data retrieval call binding the contract method 0x86d516e8. +// +// Solidity: function getCurrentBlockGasLimit() view returns(uint256 gaslimit) +func (_MultiCall3 *MultiCall3Caller) GetCurrentBlockGasLimit(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _MultiCall3.contract.Call(opts, &out, "getCurrentBlockGasLimit") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetCurrentBlockGasLimit is a free data retrieval call binding the contract method 0x86d516e8. +// +// Solidity: function getCurrentBlockGasLimit() view returns(uint256 gaslimit) +func (_MultiCall3 *MultiCall3Session) GetCurrentBlockGasLimit() (*big.Int, error) { + return _MultiCall3.Contract.GetCurrentBlockGasLimit(&_MultiCall3.CallOpts) +} + +// GetCurrentBlockGasLimit is a free data retrieval call binding the contract method 0x86d516e8. +// +// Solidity: function getCurrentBlockGasLimit() view returns(uint256 gaslimit) +func (_MultiCall3 *MultiCall3CallerSession) GetCurrentBlockGasLimit() (*big.Int, error) { + return _MultiCall3.Contract.GetCurrentBlockGasLimit(&_MultiCall3.CallOpts) +} + +// GetCurrentBlockTimestamp is a free data retrieval call binding the contract method 0x0f28c97d. +// +// Solidity: function getCurrentBlockTimestamp() view returns(uint256 timestamp) +func (_MultiCall3 *MultiCall3Caller) GetCurrentBlockTimestamp(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _MultiCall3.contract.Call(opts, &out, "getCurrentBlockTimestamp") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetCurrentBlockTimestamp is a free data retrieval call binding the contract method 0x0f28c97d. +// +// Solidity: function getCurrentBlockTimestamp() view returns(uint256 timestamp) +func (_MultiCall3 *MultiCall3Session) GetCurrentBlockTimestamp() (*big.Int, error) { + return _MultiCall3.Contract.GetCurrentBlockTimestamp(&_MultiCall3.CallOpts) +} + +// GetCurrentBlockTimestamp is a free data retrieval call binding the contract method 0x0f28c97d. +// +// Solidity: function getCurrentBlockTimestamp() view returns(uint256 timestamp) +func (_MultiCall3 *MultiCall3CallerSession) GetCurrentBlockTimestamp() (*big.Int, error) { + return _MultiCall3.Contract.GetCurrentBlockTimestamp(&_MultiCall3.CallOpts) +} + +// GetEthBalance is a free data retrieval call binding the contract method 0x4d2301cc. +// +// Solidity: function getEthBalance(address addr) view returns(uint256 balance) +func (_MultiCall3 *MultiCall3Caller) GetEthBalance(opts *bind.CallOpts, addr common.Address) (*big.Int, error) { + var out []interface{} + err := _MultiCall3.contract.Call(opts, &out, "getEthBalance", addr) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetEthBalance is a free data retrieval call binding the contract method 0x4d2301cc. +// +// Solidity: function getEthBalance(address addr) view returns(uint256 balance) +func (_MultiCall3 *MultiCall3Session) GetEthBalance(addr common.Address) (*big.Int, error) { + return _MultiCall3.Contract.GetEthBalance(&_MultiCall3.CallOpts, addr) +} + +// GetEthBalance is a free data retrieval call binding the contract method 0x4d2301cc. +// +// Solidity: function getEthBalance(address addr) view returns(uint256 balance) +func (_MultiCall3 *MultiCall3CallerSession) GetEthBalance(addr common.Address) (*big.Int, error) { + return _MultiCall3.Contract.GetEthBalance(&_MultiCall3.CallOpts, addr) +} + +// GetLastBlockHash is a free data retrieval call binding the contract method 0x27e86d6e. +// +// Solidity: function getLastBlockHash() view returns(bytes32 blockHash) +func (_MultiCall3 *MultiCall3Caller) GetLastBlockHash(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _MultiCall3.contract.Call(opts, &out, "getLastBlockHash") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// GetLastBlockHash is a free data retrieval call binding the contract method 0x27e86d6e. +// +// Solidity: function getLastBlockHash() view returns(bytes32 blockHash) +func (_MultiCall3 *MultiCall3Session) GetLastBlockHash() ([32]byte, error) { + return _MultiCall3.Contract.GetLastBlockHash(&_MultiCall3.CallOpts) +} + +// GetLastBlockHash is a free data retrieval call binding the contract method 0x27e86d6e. +// +// Solidity: function getLastBlockHash() view returns(bytes32 blockHash) +func (_MultiCall3 *MultiCall3CallerSession) GetLastBlockHash() ([32]byte, error) { + return _MultiCall3.Contract.GetLastBlockHash(&_MultiCall3.CallOpts) +} + +// Aggregate is a paid mutator transaction binding the contract method 0x252dba42. +// +// Solidity: function aggregate((address,bytes)[] calls) payable returns(uint256 blockNumber, bytes[] returnData) +func (_MultiCall3 *MultiCall3Transactor) Aggregate(opts *bind.TransactOpts, calls []Multicall3Call) (*types.Transaction, error) { + return _MultiCall3.contract.Transact(opts, "aggregate", calls) +} + +// Aggregate is a paid mutator transaction binding the contract method 0x252dba42. +// +// Solidity: function aggregate((address,bytes)[] calls) payable returns(uint256 blockNumber, bytes[] returnData) +func (_MultiCall3 *MultiCall3Session) Aggregate(calls []Multicall3Call) (*types.Transaction, error) { + return _MultiCall3.Contract.Aggregate(&_MultiCall3.TransactOpts, calls) +} + +// Aggregate is a paid mutator transaction binding the contract method 0x252dba42. +// +// Solidity: function aggregate((address,bytes)[] calls) payable returns(uint256 blockNumber, bytes[] returnData) +func (_MultiCall3 *MultiCall3TransactorSession) Aggregate(calls []Multicall3Call) (*types.Transaction, error) { + return _MultiCall3.Contract.Aggregate(&_MultiCall3.TransactOpts, calls) +} + +// Aggregate3 is a paid mutator transaction binding the contract method 0x82ad56cb. +// +// Solidity: function aggregate3((address,bool,bytes)[] calls) payable returns((bool,bytes)[] returnData) +func (_MultiCall3 *MultiCall3Transactor) Aggregate3(opts *bind.TransactOpts, calls []Multicall3Call3) (*types.Transaction, error) { + return _MultiCall3.contract.Transact(opts, "aggregate3", calls) +} + +// Aggregate3 is a paid mutator transaction binding the contract method 0x82ad56cb. +// +// Solidity: function aggregate3((address,bool,bytes)[] calls) payable returns((bool,bytes)[] returnData) +func (_MultiCall3 *MultiCall3Session) Aggregate3(calls []Multicall3Call3) (*types.Transaction, error) { + return _MultiCall3.Contract.Aggregate3(&_MultiCall3.TransactOpts, calls) +} + +// Aggregate3 is a paid mutator transaction binding the contract method 0x82ad56cb. +// +// Solidity: function aggregate3((address,bool,bytes)[] calls) payable returns((bool,bytes)[] returnData) +func (_MultiCall3 *MultiCall3TransactorSession) Aggregate3(calls []Multicall3Call3) (*types.Transaction, error) { + return _MultiCall3.Contract.Aggregate3(&_MultiCall3.TransactOpts, calls) +} + +// Aggregate3Value is a paid mutator transaction binding the contract method 0x174dea71. +// +// Solidity: function aggregate3Value((address,bool,uint256,bytes)[] calls) payable returns((bool,bytes)[] returnData) +func (_MultiCall3 *MultiCall3Transactor) Aggregate3Value(opts *bind.TransactOpts, calls []Multicall3Call3Value) (*types.Transaction, error) { + return _MultiCall3.contract.Transact(opts, "aggregate3Value", calls) +} + +// Aggregate3Value is a paid mutator transaction binding the contract method 0x174dea71. +// +// Solidity: function aggregate3Value((address,bool,uint256,bytes)[] calls) payable returns((bool,bytes)[] returnData) +func (_MultiCall3 *MultiCall3Session) Aggregate3Value(calls []Multicall3Call3Value) (*types.Transaction, error) { + return _MultiCall3.Contract.Aggregate3Value(&_MultiCall3.TransactOpts, calls) +} + +// Aggregate3Value is a paid mutator transaction binding the contract method 0x174dea71. +// +// Solidity: function aggregate3Value((address,bool,uint256,bytes)[] calls) payable returns((bool,bytes)[] returnData) +func (_MultiCall3 *MultiCall3TransactorSession) Aggregate3Value(calls []Multicall3Call3Value) (*types.Transaction, error) { + return _MultiCall3.Contract.Aggregate3Value(&_MultiCall3.TransactOpts, calls) +} + +// BlockAndAggregate is a paid mutator transaction binding the contract method 0xc3077fa9. +// +// Solidity: function blockAndAggregate((address,bytes)[] calls) payable returns(uint256 blockNumber, bytes32 blockHash, (bool,bytes)[] returnData) +func (_MultiCall3 *MultiCall3Transactor) BlockAndAggregate(opts *bind.TransactOpts, calls []Multicall3Call) (*types.Transaction, error) { + return _MultiCall3.contract.Transact(opts, "blockAndAggregate", calls) +} + +// BlockAndAggregate is a paid mutator transaction binding the contract method 0xc3077fa9. +// +// Solidity: function blockAndAggregate((address,bytes)[] calls) payable returns(uint256 blockNumber, bytes32 blockHash, (bool,bytes)[] returnData) +func (_MultiCall3 *MultiCall3Session) BlockAndAggregate(calls []Multicall3Call) (*types.Transaction, error) { + return _MultiCall3.Contract.BlockAndAggregate(&_MultiCall3.TransactOpts, calls) +} + +// BlockAndAggregate is a paid mutator transaction binding the contract method 0xc3077fa9. +// +// Solidity: function blockAndAggregate((address,bytes)[] calls) payable returns(uint256 blockNumber, bytes32 blockHash, (bool,bytes)[] returnData) +func (_MultiCall3 *MultiCall3TransactorSession) BlockAndAggregate(calls []Multicall3Call) (*types.Transaction, error) { + return _MultiCall3.Contract.BlockAndAggregate(&_MultiCall3.TransactOpts, calls) +} + +// TryAggregate is a paid mutator transaction binding the contract method 0xbce38bd7. +// +// Solidity: function tryAggregate(bool requireSuccess, (address,bytes)[] calls) payable returns((bool,bytes)[] returnData) +func (_MultiCall3 *MultiCall3Transactor) TryAggregate(opts *bind.TransactOpts, requireSuccess bool, calls []Multicall3Call) (*types.Transaction, error) { + return _MultiCall3.contract.Transact(opts, "tryAggregate", requireSuccess, calls) +} + +// TryAggregate is a paid mutator transaction binding the contract method 0xbce38bd7. +// +// Solidity: function tryAggregate(bool requireSuccess, (address,bytes)[] calls) payable returns((bool,bytes)[] returnData) +func (_MultiCall3 *MultiCall3Session) TryAggregate(requireSuccess bool, calls []Multicall3Call) (*types.Transaction, error) { + return _MultiCall3.Contract.TryAggregate(&_MultiCall3.TransactOpts, requireSuccess, calls) +} + +// TryAggregate is a paid mutator transaction binding the contract method 0xbce38bd7. +// +// Solidity: function tryAggregate(bool requireSuccess, (address,bytes)[] calls) payable returns((bool,bytes)[] returnData) +func (_MultiCall3 *MultiCall3TransactorSession) TryAggregate(requireSuccess bool, calls []Multicall3Call) (*types.Transaction, error) { + return _MultiCall3.Contract.TryAggregate(&_MultiCall3.TransactOpts, requireSuccess, calls) +} + +// TryBlockAndAggregate is a paid mutator transaction binding the contract method 0x399542e9. +// +// Solidity: function tryBlockAndAggregate(bool requireSuccess, (address,bytes)[] calls) payable returns(uint256 blockNumber, bytes32 blockHash, (bool,bytes)[] returnData) +func (_MultiCall3 *MultiCall3Transactor) TryBlockAndAggregate(opts *bind.TransactOpts, requireSuccess bool, calls []Multicall3Call) (*types.Transaction, error) { + return _MultiCall3.contract.Transact(opts, "tryBlockAndAggregate", requireSuccess, calls) +} + +// TryBlockAndAggregate is a paid mutator transaction binding the contract method 0x399542e9. +// +// Solidity: function tryBlockAndAggregate(bool requireSuccess, (address,bytes)[] calls) payable returns(uint256 blockNumber, bytes32 blockHash, (bool,bytes)[] returnData) +func (_MultiCall3 *MultiCall3Session) TryBlockAndAggregate(requireSuccess bool, calls []Multicall3Call) (*types.Transaction, error) { + return _MultiCall3.Contract.TryBlockAndAggregate(&_MultiCall3.TransactOpts, requireSuccess, calls) +} + +// TryBlockAndAggregate is a paid mutator transaction binding the contract method 0x399542e9. +// +// Solidity: function tryBlockAndAggregate(bool requireSuccess, (address,bytes)[] calls) payable returns(uint256 blockNumber, bytes32 blockHash, (bool,bytes)[] returnData) +func (_MultiCall3 *MultiCall3TransactorSession) TryBlockAndAggregate(requireSuccess bool, calls []Multicall3Call) (*types.Transaction, error) { + return _MultiCall3.Contract.TryBlockAndAggregate(&_MultiCall3.TransactOpts, requireSuccess, calls) +} diff --git a/op-e2e2/bindings/multisend_v130.go b/op-e2e2/bindings/multisend_v130.go new file mode 100644 index 000000000000..94d019113d66 --- /dev/null +++ b/op-e2e2/bindings/multisend_v130.go @@ -0,0 +1,223 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// MultiSendV130MetaData contains all meta data concerning the MultiSendV130 contract. +var MultiSendV130MetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"transactions\",\"type\":\"bytes\"}],\"name\":\"multiSend\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}]", + Bin: "0x60a060405234801561001057600080fd5b503073ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff1660601b8152505060805160601c6102756100646000398060e052506102756000f3fe60806040526004361061001e5760003560e01c80638d80ff0a14610023575b600080fd5b6100dc6004803603602081101561003957600080fd5b810190808035906020019064010000000081111561005657600080fd5b82018360208201111561006857600080fd5b8035906020019184600183028401116401000000008311171561008a57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506100de565b005b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff161415610183576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806102106030913960400191505060405180910390fd5b805160205b8181101561020a578083015160f81c6001820184015160601c6015830185015160358401860151605585018701600085600081146101cd57600181146101dd576101e8565b6000808585888a5af191506101e8565b6000808585895af491505b5060008114156101f757600080fd5b8260550187019650505050505050610188565b50505056fe4d756c746953656e642073686f756c64206f6e6c792062652063616c6c6564207669612064656c656761746563616c6ca26469706673582212205c784303626eec02b71940b551976170b500a8a36cc5adcbeb2c19751a76d05464736f6c63430007060033", +} + +// MultiSendV130ABI is the input ABI used to generate the binding from. +// Deprecated: Use MultiSendV130MetaData.ABI instead. +var MultiSendV130ABI = MultiSendV130MetaData.ABI + +// MultiSendV130Bin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use MultiSendV130MetaData.Bin instead. +var MultiSendV130Bin = MultiSendV130MetaData.Bin + +// DeployMultiSendV130 deploys a new Ethereum contract, binding an instance of MultiSendV130 to it. +func DeployMultiSendV130(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *MultiSendV130, error) { + parsed, err := MultiSendV130MetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(MultiSendV130Bin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &MultiSendV130{MultiSendV130Caller: MultiSendV130Caller{contract: contract}, MultiSendV130Transactor: MultiSendV130Transactor{contract: contract}, MultiSendV130Filterer: MultiSendV130Filterer{contract: contract}}, nil +} + +// MultiSendV130 is an auto generated Go binding around an Ethereum contract. +type MultiSendV130 struct { + MultiSendV130Caller // Read-only binding to the contract + MultiSendV130Transactor // Write-only binding to the contract + MultiSendV130Filterer // Log filterer for contract events +} + +// MultiSendV130Caller is an auto generated read-only Go binding around an Ethereum contract. +type MultiSendV130Caller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// MultiSendV130Transactor is an auto generated write-only Go binding around an Ethereum contract. +type MultiSendV130Transactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// MultiSendV130Filterer is an auto generated log filtering Go binding around an Ethereum contract events. +type MultiSendV130Filterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// MultiSendV130Session is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type MultiSendV130Session struct { + Contract *MultiSendV130 // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// MultiSendV130CallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type MultiSendV130CallerSession struct { + Contract *MultiSendV130Caller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// MultiSendV130TransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type MultiSendV130TransactorSession struct { + Contract *MultiSendV130Transactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// MultiSendV130Raw is an auto generated low-level Go binding around an Ethereum contract. +type MultiSendV130Raw struct { + Contract *MultiSendV130 // Generic contract binding to access the raw methods on +} + +// MultiSendV130CallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type MultiSendV130CallerRaw struct { + Contract *MultiSendV130Caller // Generic read-only contract binding to access the raw methods on +} + +// MultiSendV130TransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type MultiSendV130TransactorRaw struct { + Contract *MultiSendV130Transactor // Generic write-only contract binding to access the raw methods on +} + +// NewMultiSendV130 creates a new instance of MultiSendV130, bound to a specific deployed contract. +func NewMultiSendV130(address common.Address, backend bind.ContractBackend) (*MultiSendV130, error) { + contract, err := bindMultiSendV130(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &MultiSendV130{MultiSendV130Caller: MultiSendV130Caller{contract: contract}, MultiSendV130Transactor: MultiSendV130Transactor{contract: contract}, MultiSendV130Filterer: MultiSendV130Filterer{contract: contract}}, nil +} + +// NewMultiSendV130Caller creates a new read-only instance of MultiSendV130, bound to a specific deployed contract. +func NewMultiSendV130Caller(address common.Address, caller bind.ContractCaller) (*MultiSendV130Caller, error) { + contract, err := bindMultiSendV130(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &MultiSendV130Caller{contract: contract}, nil +} + +// NewMultiSendV130Transactor creates a new write-only instance of MultiSendV130, bound to a specific deployed contract. +func NewMultiSendV130Transactor(address common.Address, transactor bind.ContractTransactor) (*MultiSendV130Transactor, error) { + contract, err := bindMultiSendV130(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &MultiSendV130Transactor{contract: contract}, nil +} + +// NewMultiSendV130Filterer creates a new log filterer instance of MultiSendV130, bound to a specific deployed contract. +func NewMultiSendV130Filterer(address common.Address, filterer bind.ContractFilterer) (*MultiSendV130Filterer, error) { + contract, err := bindMultiSendV130(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &MultiSendV130Filterer{contract: contract}, nil +} + +// bindMultiSendV130 binds a generic wrapper to an already deployed contract. +func bindMultiSendV130(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(MultiSendV130ABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_MultiSendV130 *MultiSendV130Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _MultiSendV130.Contract.MultiSendV130Caller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_MultiSendV130 *MultiSendV130Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MultiSendV130.Contract.MultiSendV130Transactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_MultiSendV130 *MultiSendV130Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _MultiSendV130.Contract.MultiSendV130Transactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_MultiSendV130 *MultiSendV130CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _MultiSendV130.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_MultiSendV130 *MultiSendV130TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MultiSendV130.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_MultiSendV130 *MultiSendV130TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _MultiSendV130.Contract.contract.Transact(opts, method, params...) +} + +// MultiSend is a paid mutator transaction binding the contract method 0x8d80ff0a. +// +// Solidity: function multiSend(bytes transactions) payable returns() +func (_MultiSendV130 *MultiSendV130Transactor) MultiSend(opts *bind.TransactOpts, transactions []byte) (*types.Transaction, error) { + return _MultiSendV130.contract.Transact(opts, "multiSend", transactions) +} + +// MultiSend is a paid mutator transaction binding the contract method 0x8d80ff0a. +// +// Solidity: function multiSend(bytes transactions) payable returns() +func (_MultiSendV130 *MultiSendV130Session) MultiSend(transactions []byte) (*types.Transaction, error) { + return _MultiSendV130.Contract.MultiSend(&_MultiSendV130.TransactOpts, transactions) +} + +// MultiSend is a paid mutator transaction binding the contract method 0x8d80ff0a. +// +// Solidity: function multiSend(bytes transactions) payable returns() +func (_MultiSendV130 *MultiSendV130TransactorSession) MultiSend(transactions []byte) (*types.Transaction, error) { + return _MultiSendV130.Contract.MultiSend(&_MultiSendV130.TransactOpts, transactions) +} diff --git a/op-e2e2/bindings/multisendcallonly_v130.go b/op-e2e2/bindings/multisendcallonly_v130.go new file mode 100644 index 000000000000..22c4bb17c37b --- /dev/null +++ b/op-e2e2/bindings/multisendcallonly_v130.go @@ -0,0 +1,223 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// MultiSendCallOnlyV130MetaData contains all meta data concerning the MultiSendCallOnlyV130 contract. +var MultiSendCallOnlyV130MetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"transactions\",\"type\":\"bytes\"}],\"name\":\"multiSend\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}]", + Bin: "0x608060405234801561001057600080fd5b5061019a806100206000396000f3fe60806040526004361061001e5760003560e01c80638d80ff0a14610023575b600080fd5b6100dc6004803603602081101561003957600080fd5b810190808035906020019064010000000081111561005657600080fd5b82018360208201111561006857600080fd5b8035906020019184600183028401116401000000008311171561008a57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506100de565b005b805160205b8181101561015f578083015160f81c6001820184015160601c60158301850151603584018601516055850187016000856000811461012857600181146101385761013d565b6000808585888a5af1915061013d565b600080fd5b50600081141561014c57600080fd5b82605501870196505050505050506100e3565b50505056fea264697066735822122035246402746c96964495cae5b36461fd44dfb89f8e6cf6f6b8d60c0aa89f414864736f6c63430007060033", +} + +// MultiSendCallOnlyV130ABI is the input ABI used to generate the binding from. +// Deprecated: Use MultiSendCallOnlyV130MetaData.ABI instead. +var MultiSendCallOnlyV130ABI = MultiSendCallOnlyV130MetaData.ABI + +// MultiSendCallOnlyV130Bin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use MultiSendCallOnlyV130MetaData.Bin instead. +var MultiSendCallOnlyV130Bin = MultiSendCallOnlyV130MetaData.Bin + +// DeployMultiSendCallOnlyV130 deploys a new Ethereum contract, binding an instance of MultiSendCallOnlyV130 to it. +func DeployMultiSendCallOnlyV130(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *MultiSendCallOnlyV130, error) { + parsed, err := MultiSendCallOnlyV130MetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(MultiSendCallOnlyV130Bin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &MultiSendCallOnlyV130{MultiSendCallOnlyV130Caller: MultiSendCallOnlyV130Caller{contract: contract}, MultiSendCallOnlyV130Transactor: MultiSendCallOnlyV130Transactor{contract: contract}, MultiSendCallOnlyV130Filterer: MultiSendCallOnlyV130Filterer{contract: contract}}, nil +} + +// MultiSendCallOnlyV130 is an auto generated Go binding around an Ethereum contract. +type MultiSendCallOnlyV130 struct { + MultiSendCallOnlyV130Caller // Read-only binding to the contract + MultiSendCallOnlyV130Transactor // Write-only binding to the contract + MultiSendCallOnlyV130Filterer // Log filterer for contract events +} + +// MultiSendCallOnlyV130Caller is an auto generated read-only Go binding around an Ethereum contract. +type MultiSendCallOnlyV130Caller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// MultiSendCallOnlyV130Transactor is an auto generated write-only Go binding around an Ethereum contract. +type MultiSendCallOnlyV130Transactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// MultiSendCallOnlyV130Filterer is an auto generated log filtering Go binding around an Ethereum contract events. +type MultiSendCallOnlyV130Filterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// MultiSendCallOnlyV130Session is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type MultiSendCallOnlyV130Session struct { + Contract *MultiSendCallOnlyV130 // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// MultiSendCallOnlyV130CallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type MultiSendCallOnlyV130CallerSession struct { + Contract *MultiSendCallOnlyV130Caller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// MultiSendCallOnlyV130TransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type MultiSendCallOnlyV130TransactorSession struct { + Contract *MultiSendCallOnlyV130Transactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// MultiSendCallOnlyV130Raw is an auto generated low-level Go binding around an Ethereum contract. +type MultiSendCallOnlyV130Raw struct { + Contract *MultiSendCallOnlyV130 // Generic contract binding to access the raw methods on +} + +// MultiSendCallOnlyV130CallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type MultiSendCallOnlyV130CallerRaw struct { + Contract *MultiSendCallOnlyV130Caller // Generic read-only contract binding to access the raw methods on +} + +// MultiSendCallOnlyV130TransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type MultiSendCallOnlyV130TransactorRaw struct { + Contract *MultiSendCallOnlyV130Transactor // Generic write-only contract binding to access the raw methods on +} + +// NewMultiSendCallOnlyV130 creates a new instance of MultiSendCallOnlyV130, bound to a specific deployed contract. +func NewMultiSendCallOnlyV130(address common.Address, backend bind.ContractBackend) (*MultiSendCallOnlyV130, error) { + contract, err := bindMultiSendCallOnlyV130(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &MultiSendCallOnlyV130{MultiSendCallOnlyV130Caller: MultiSendCallOnlyV130Caller{contract: contract}, MultiSendCallOnlyV130Transactor: MultiSendCallOnlyV130Transactor{contract: contract}, MultiSendCallOnlyV130Filterer: MultiSendCallOnlyV130Filterer{contract: contract}}, nil +} + +// NewMultiSendCallOnlyV130Caller creates a new read-only instance of MultiSendCallOnlyV130, bound to a specific deployed contract. +func NewMultiSendCallOnlyV130Caller(address common.Address, caller bind.ContractCaller) (*MultiSendCallOnlyV130Caller, error) { + contract, err := bindMultiSendCallOnlyV130(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &MultiSendCallOnlyV130Caller{contract: contract}, nil +} + +// NewMultiSendCallOnlyV130Transactor creates a new write-only instance of MultiSendCallOnlyV130, bound to a specific deployed contract. +func NewMultiSendCallOnlyV130Transactor(address common.Address, transactor bind.ContractTransactor) (*MultiSendCallOnlyV130Transactor, error) { + contract, err := bindMultiSendCallOnlyV130(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &MultiSendCallOnlyV130Transactor{contract: contract}, nil +} + +// NewMultiSendCallOnlyV130Filterer creates a new log filterer instance of MultiSendCallOnlyV130, bound to a specific deployed contract. +func NewMultiSendCallOnlyV130Filterer(address common.Address, filterer bind.ContractFilterer) (*MultiSendCallOnlyV130Filterer, error) { + contract, err := bindMultiSendCallOnlyV130(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &MultiSendCallOnlyV130Filterer{contract: contract}, nil +} + +// bindMultiSendCallOnlyV130 binds a generic wrapper to an already deployed contract. +func bindMultiSendCallOnlyV130(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(MultiSendCallOnlyV130ABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_MultiSendCallOnlyV130 *MultiSendCallOnlyV130Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _MultiSendCallOnlyV130.Contract.MultiSendCallOnlyV130Caller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_MultiSendCallOnlyV130 *MultiSendCallOnlyV130Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MultiSendCallOnlyV130.Contract.MultiSendCallOnlyV130Transactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_MultiSendCallOnlyV130 *MultiSendCallOnlyV130Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _MultiSendCallOnlyV130.Contract.MultiSendCallOnlyV130Transactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_MultiSendCallOnlyV130 *MultiSendCallOnlyV130CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _MultiSendCallOnlyV130.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_MultiSendCallOnlyV130 *MultiSendCallOnlyV130TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MultiSendCallOnlyV130.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_MultiSendCallOnlyV130 *MultiSendCallOnlyV130TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _MultiSendCallOnlyV130.Contract.contract.Transact(opts, method, params...) +} + +// MultiSend is a paid mutator transaction binding the contract method 0x8d80ff0a. +// +// Solidity: function multiSend(bytes transactions) payable returns() +func (_MultiSendCallOnlyV130 *MultiSendCallOnlyV130Transactor) MultiSend(opts *bind.TransactOpts, transactions []byte) (*types.Transaction, error) { + return _MultiSendCallOnlyV130.contract.Transact(opts, "multiSend", transactions) +} + +// MultiSend is a paid mutator transaction binding the contract method 0x8d80ff0a. +// +// Solidity: function multiSend(bytes transactions) payable returns() +func (_MultiSendCallOnlyV130 *MultiSendCallOnlyV130Session) MultiSend(transactions []byte) (*types.Transaction, error) { + return _MultiSendCallOnlyV130.Contract.MultiSend(&_MultiSendCallOnlyV130.TransactOpts, transactions) +} + +// MultiSend is a paid mutator transaction binding the contract method 0x8d80ff0a. +// +// Solidity: function multiSend(bytes transactions) payable returns() +func (_MultiSendCallOnlyV130 *MultiSendCallOnlyV130TransactorSession) MultiSend(transactions []byte) (*types.Transaction, error) { + return _MultiSendCallOnlyV130.Contract.MultiSend(&_MultiSendCallOnlyV130.TransactOpts, transactions) +} diff --git a/op-e2e2/bindings/optimismmintableerc20.go b/op-e2e2/bindings/optimismmintableerc20.go new file mode 100644 index 000000000000..62c4827f1be1 --- /dev/null +++ b/op-e2e2/bindings/optimismmintableerc20.go @@ -0,0 +1,1381 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// OptimismMintableERC20MetaData contains all meta data concerning the OptimismMintableERC20 contract. +var OptimismMintableERC20MetaData = &bind.MetaData{ + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_bridge\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_remoteToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_name\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"_symbol\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"_decimals\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"BRIDGE\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"REMOTE_TOKEN\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"allowance\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"spender\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"approve\",\"inputs\":[{\"name\":\"spender\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"balanceOf\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"bridge\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"burn\",\"inputs\":[{\"name\":\"_from\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"decimals\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"decreaseAllowance\",\"inputs\":[{\"name\":\"spender\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"subtractedValue\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"increaseAllowance\",\"inputs\":[{\"name\":\"spender\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"addedValue\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"l1Token\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"l2Bridge\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"mint\",\"inputs\":[{\"name\":\"_to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"name\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"remoteToken\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"supportsInterface\",\"inputs\":[{\"name\":\"_interfaceId\",\"type\":\"bytes4\",\"internalType\":\"bytes4\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"symbol\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"totalSupply\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"transfer\",\"inputs\":[{\"name\":\"to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferFrom\",\"inputs\":[{\"name\":\"from\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"Approval\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"spender\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Burn\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Mint\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Transfer\",\"inputs\":[{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false}]", + Bin: "0x60e06040523480156200001157600080fd5b506040516200178a3803806200178a833981016040819052620000349162000163565b828260036200004483826200029e565b5060046200005382826200029e565b5050506001600160a01b039384166080529390921660a052505060ff1660c0526200036a565b80516001600160a01b03811681146200009157600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b600082601f830112620000be57600080fd5b81516001600160401b0380821115620000db57620000db62000096565b604051601f8301601f19908116603f0116810190828211818310171562000106576200010662000096565b816040528381526020925086838588010111156200012357600080fd5b600091505b8382101562000147578582018301518183018401529082019062000128565b83821115620001595760008385830101525b9695505050505050565b600080600080600060a086880312156200017c57600080fd5b620001878662000079565b9450620001976020870162000079565b60408701519094506001600160401b0380821115620001b557600080fd5b620001c389838a01620000ac565b94506060880151915080821115620001da57600080fd5b50620001e988828901620000ac565b925050608086015160ff811681146200020157600080fd5b809150509295509295909350565b600181811c908216806200022457607f821691505b6020821081036200024557634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200029957600081815260208120601f850160051c81016020861015620002745750805b601f850160051c820191505b81811015620002955782815560010162000280565b5050505b505050565b81516001600160401b03811115620002ba57620002ba62000096565b620002d281620002cb84546200020f565b846200024b565b602080601f8311600181146200030a5760008415620002f15750858301515b600019600386901b1c1916600185901b17855562000295565b600085815260208120601f198616915b828110156200033b578886015182559484019460019091019084016200031a565b50858210156200035a5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60805160a05160c0516113d4620003b6600039600061024401526000818161034b015281816103e001528181610625015261075c0152600081816101a9015261037101526113d46000f3fe608060405234801561001057600080fd5b50600436106101775760003560e01c806370a08231116100d8578063ae1f6aaf1161008c578063dd62ed3e11610066578063dd62ed3e14610395578063e78cea9214610349578063ee9a31a2146103db57600080fd5b8063ae1f6aaf14610349578063c01e1bd61461036f578063d6c0b2c41461036f57600080fd5b80639dc29fac116100bd5780639dc29fac14610310578063a457c2d714610323578063a9059cbb1461033657600080fd5b806370a08231146102d257806395d89b411461030857600080fd5b806323b872dd1161012f5780633950935111610114578063395093511461026e57806340c10f191461028157806354fd4d501461029657600080fd5b806323b872dd1461022a578063313ce5671461023d57600080fd5b806306fdde031161016057806306fdde03146101f0578063095ea7b31461020557806318160ddd1461021857600080fd5b806301ffc9a71461017c578063033964be146101a4575b600080fd5b61018f61018a36600461117d565b610402565b60405190151581526020015b60405180910390f35b6101cb7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161019b565b6101f86104f3565b60405161019b91906111c6565b61018f610213366004611262565b610585565b6002545b60405190815260200161019b565b61018f61023836600461128c565b61059d565b60405160ff7f000000000000000000000000000000000000000000000000000000000000000016815260200161019b565b61018f61027c366004611262565b6105c1565b61029461028f366004611262565b61060d565b005b6101f86040518060400160405280600581526020017f312e332e3000000000000000000000000000000000000000000000000000000081525081565b61021c6102e03660046112c8565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b6101f8610735565b61029461031e366004611262565b610744565b61018f610331366004611262565b61085b565b61018f610344366004611262565b61092c565b7f00000000000000000000000000000000000000000000000000000000000000006101cb565b7f00000000000000000000000000000000000000000000000000000000000000006101cb565b61021c6103a33660046112e3565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205490565b6101cb7f000000000000000000000000000000000000000000000000000000000000000081565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007f1d1d8b63000000000000000000000000000000000000000000000000000000007fec4fc8e3000000000000000000000000000000000000000000000000000000007fffffffff0000000000000000000000000000000000000000000000000000000085168314806104bb57507fffffffff00000000000000000000000000000000000000000000000000000000858116908316145b806104ea57507fffffffff00000000000000000000000000000000000000000000000000000000858116908216145b95945050505050565b60606003805461050290611316565b80601f016020809104026020016040519081016040528092919081815260200182805461052e90611316565b801561057b5780601f106105505761010080835404028352916020019161057b565b820191906000526020600020905b81548152906001019060200180831161055e57829003601f168201915b5050505050905090565b60003361059381858561093a565b5060019392505050565b6000336105ab858285610aee565b6105b6858585610bc5565b506001949350505050565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff871684529091528120549091906105939082908690610608908790611398565b61093a565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146106d7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603460248201527f4f7074696d69736d4d696e7461626c6545524332303a206f6e6c79206272696460448201527f67652063616e206d696e7420616e64206275726e00000000000000000000000060648201526084015b60405180910390fd5b6106e18282610e78565b8173ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968858260405161072991815260200190565b60405180910390a25050565b60606004805461050290611316565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610809576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603460248201527f4f7074696d69736d4d696e7461626c6545524332303a206f6e6c79206272696460448201527f67652063616e206d696e7420616e64206275726e00000000000000000000000060648201526084016106ce565b6108138282610f98565b8173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58260405161072991815260200190565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff871684529091528120549091908381101561091f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f00000000000000000000000000000000000000000000000000000060648201526084016106ce565b6105b6828686840361093a565b600033610593818585610bc5565b73ffffffffffffffffffffffffffffffffffffffff83166109dc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f726573730000000000000000000000000000000000000000000000000000000060648201526084016106ce565b73ffffffffffffffffffffffffffffffffffffffff8216610a7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f737300000000000000000000000000000000000000000000000000000000000060648201526084016106ce565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff8381166000908152600160209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114610bbf5781811015610bb2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016106ce565b610bbf848484840361093a565b50505050565b73ffffffffffffffffffffffffffffffffffffffff8316610c68576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f647265737300000000000000000000000000000000000000000000000000000060648201526084016106ce565b73ffffffffffffffffffffffffffffffffffffffff8216610d0b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f657373000000000000000000000000000000000000000000000000000000000060648201526084016106ce565b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205481811015610dc1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e6365000000000000000000000000000000000000000000000000000060648201526084016106ce565b73ffffffffffffffffffffffffffffffffffffffff808516600090815260208190526040808220858503905591851681529081208054849290610e05908490611398565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610e6b91815260200190565b60405180910390a3610bbf565b73ffffffffffffffffffffffffffffffffffffffff8216610ef5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016106ce565b8060026000828254610f079190611398565b909155505073ffffffffffffffffffffffffffffffffffffffff821660009081526020819052604081208054839290610f41908490611398565b909155505060405181815273ffffffffffffffffffffffffffffffffffffffff8316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b73ffffffffffffffffffffffffffffffffffffffff821661103b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f730000000000000000000000000000000000000000000000000000000000000060648201526084016106ce565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260208190526040902054818110156110f1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f636500000000000000000000000000000000000000000000000000000000000060648201526084016106ce565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260208190526040812083830390556002805484929061112d9084906113b0565b909155505060405182815260009073ffffffffffffffffffffffffffffffffffffffff8516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001610ae1565b60006020828403121561118f57600080fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146111bf57600080fd5b9392505050565b600060208083528351808285015260005b818110156111f3578581018301518582016040015282016111d7565b81811115611205576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461125d57600080fd5b919050565b6000806040838503121561127557600080fd5b61127e83611239565b946020939093013593505050565b6000806000606084860312156112a157600080fd5b6112aa84611239565b92506112b860208501611239565b9150604084013590509250925092565b6000602082840312156112da57600080fd5b6111bf82611239565b600080604083850312156112f657600080fd5b6112ff83611239565b915061130d60208401611239565b90509250929050565b600181811c9082168061132a57607f821691505b602082108103611363577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082198211156113ab576113ab611369565b500190565b6000828210156113c2576113c2611369565b50039056fea164736f6c634300080f000a", +} + +// OptimismMintableERC20ABI is the input ABI used to generate the binding from. +// Deprecated: Use OptimismMintableERC20MetaData.ABI instead. +var OptimismMintableERC20ABI = OptimismMintableERC20MetaData.ABI + +// OptimismMintableERC20Bin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use OptimismMintableERC20MetaData.Bin instead. +var OptimismMintableERC20Bin = OptimismMintableERC20MetaData.Bin + +// DeployOptimismMintableERC20 deploys a new Ethereum contract, binding an instance of OptimismMintableERC20 to it. +func DeployOptimismMintableERC20(auth *bind.TransactOpts, backend bind.ContractBackend, _bridge common.Address, _remoteToken common.Address, _name string, _symbol string, _decimals uint8) (common.Address, *types.Transaction, *OptimismMintableERC20, error) { + parsed, err := OptimismMintableERC20MetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(OptimismMintableERC20Bin), backend, _bridge, _remoteToken, _name, _symbol, _decimals) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &OptimismMintableERC20{OptimismMintableERC20Caller: OptimismMintableERC20Caller{contract: contract}, OptimismMintableERC20Transactor: OptimismMintableERC20Transactor{contract: contract}, OptimismMintableERC20Filterer: OptimismMintableERC20Filterer{contract: contract}}, nil +} + +// OptimismMintableERC20 is an auto generated Go binding around an Ethereum contract. +type OptimismMintableERC20 struct { + OptimismMintableERC20Caller // Read-only binding to the contract + OptimismMintableERC20Transactor // Write-only binding to the contract + OptimismMintableERC20Filterer // Log filterer for contract events +} + +// OptimismMintableERC20Caller is an auto generated read-only Go binding around an Ethereum contract. +type OptimismMintableERC20Caller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// OptimismMintableERC20Transactor is an auto generated write-only Go binding around an Ethereum contract. +type OptimismMintableERC20Transactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// OptimismMintableERC20Filterer is an auto generated log filtering Go binding around an Ethereum contract events. +type OptimismMintableERC20Filterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// OptimismMintableERC20Session is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type OptimismMintableERC20Session struct { + Contract *OptimismMintableERC20 // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// OptimismMintableERC20CallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type OptimismMintableERC20CallerSession struct { + Contract *OptimismMintableERC20Caller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// OptimismMintableERC20TransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type OptimismMintableERC20TransactorSession struct { + Contract *OptimismMintableERC20Transactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// OptimismMintableERC20Raw is an auto generated low-level Go binding around an Ethereum contract. +type OptimismMintableERC20Raw struct { + Contract *OptimismMintableERC20 // Generic contract binding to access the raw methods on +} + +// OptimismMintableERC20CallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type OptimismMintableERC20CallerRaw struct { + Contract *OptimismMintableERC20Caller // Generic read-only contract binding to access the raw methods on +} + +// OptimismMintableERC20TransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type OptimismMintableERC20TransactorRaw struct { + Contract *OptimismMintableERC20Transactor // Generic write-only contract binding to access the raw methods on +} + +// NewOptimismMintableERC20 creates a new instance of OptimismMintableERC20, bound to a specific deployed contract. +func NewOptimismMintableERC20(address common.Address, backend bind.ContractBackend) (*OptimismMintableERC20, error) { + contract, err := bindOptimismMintableERC20(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &OptimismMintableERC20{OptimismMintableERC20Caller: OptimismMintableERC20Caller{contract: contract}, OptimismMintableERC20Transactor: OptimismMintableERC20Transactor{contract: contract}, OptimismMintableERC20Filterer: OptimismMintableERC20Filterer{contract: contract}}, nil +} + +// NewOptimismMintableERC20Caller creates a new read-only instance of OptimismMintableERC20, bound to a specific deployed contract. +func NewOptimismMintableERC20Caller(address common.Address, caller bind.ContractCaller) (*OptimismMintableERC20Caller, error) { + contract, err := bindOptimismMintableERC20(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &OptimismMintableERC20Caller{contract: contract}, nil +} + +// NewOptimismMintableERC20Transactor creates a new write-only instance of OptimismMintableERC20, bound to a specific deployed contract. +func NewOptimismMintableERC20Transactor(address common.Address, transactor bind.ContractTransactor) (*OptimismMintableERC20Transactor, error) { + contract, err := bindOptimismMintableERC20(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &OptimismMintableERC20Transactor{contract: contract}, nil +} + +// NewOptimismMintableERC20Filterer creates a new log filterer instance of OptimismMintableERC20, bound to a specific deployed contract. +func NewOptimismMintableERC20Filterer(address common.Address, filterer bind.ContractFilterer) (*OptimismMintableERC20Filterer, error) { + contract, err := bindOptimismMintableERC20(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &OptimismMintableERC20Filterer{contract: contract}, nil +} + +// bindOptimismMintableERC20 binds a generic wrapper to an already deployed contract. +func bindOptimismMintableERC20(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(OptimismMintableERC20ABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_OptimismMintableERC20 *OptimismMintableERC20Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _OptimismMintableERC20.Contract.OptimismMintableERC20Caller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_OptimismMintableERC20 *OptimismMintableERC20Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OptimismMintableERC20.Contract.OptimismMintableERC20Transactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_OptimismMintableERC20 *OptimismMintableERC20Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _OptimismMintableERC20.Contract.OptimismMintableERC20Transactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_OptimismMintableERC20 *OptimismMintableERC20CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _OptimismMintableERC20.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_OptimismMintableERC20 *OptimismMintableERC20TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OptimismMintableERC20.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_OptimismMintableERC20 *OptimismMintableERC20TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _OptimismMintableERC20.Contract.contract.Transact(opts, method, params...) +} + +// BRIDGE is a free data retrieval call binding the contract method 0xee9a31a2. +// +// Solidity: function BRIDGE() view returns(address) +func (_OptimismMintableERC20 *OptimismMintableERC20Caller) BRIDGE(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _OptimismMintableERC20.contract.Call(opts, &out, "BRIDGE") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// BRIDGE is a free data retrieval call binding the contract method 0xee9a31a2. +// +// Solidity: function BRIDGE() view returns(address) +func (_OptimismMintableERC20 *OptimismMintableERC20Session) BRIDGE() (common.Address, error) { + return _OptimismMintableERC20.Contract.BRIDGE(&_OptimismMintableERC20.CallOpts) +} + +// BRIDGE is a free data retrieval call binding the contract method 0xee9a31a2. +// +// Solidity: function BRIDGE() view returns(address) +func (_OptimismMintableERC20 *OptimismMintableERC20CallerSession) BRIDGE() (common.Address, error) { + return _OptimismMintableERC20.Contract.BRIDGE(&_OptimismMintableERC20.CallOpts) +} + +// REMOTETOKEN is a free data retrieval call binding the contract method 0x033964be. +// +// Solidity: function REMOTE_TOKEN() view returns(address) +func (_OptimismMintableERC20 *OptimismMintableERC20Caller) REMOTETOKEN(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _OptimismMintableERC20.contract.Call(opts, &out, "REMOTE_TOKEN") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// REMOTETOKEN is a free data retrieval call binding the contract method 0x033964be. +// +// Solidity: function REMOTE_TOKEN() view returns(address) +func (_OptimismMintableERC20 *OptimismMintableERC20Session) REMOTETOKEN() (common.Address, error) { + return _OptimismMintableERC20.Contract.REMOTETOKEN(&_OptimismMintableERC20.CallOpts) +} + +// REMOTETOKEN is a free data retrieval call binding the contract method 0x033964be. +// +// Solidity: function REMOTE_TOKEN() view returns(address) +func (_OptimismMintableERC20 *OptimismMintableERC20CallerSession) REMOTETOKEN() (common.Address, error) { + return _OptimismMintableERC20.Contract.REMOTETOKEN(&_OptimismMintableERC20.CallOpts) +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) view returns(uint256) +func (_OptimismMintableERC20 *OptimismMintableERC20Caller) Allowance(opts *bind.CallOpts, owner common.Address, spender common.Address) (*big.Int, error) { + var out []interface{} + err := _OptimismMintableERC20.contract.Call(opts, &out, "allowance", owner, spender) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) view returns(uint256) +func (_OptimismMintableERC20 *OptimismMintableERC20Session) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { + return _OptimismMintableERC20.Contract.Allowance(&_OptimismMintableERC20.CallOpts, owner, spender) +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) view returns(uint256) +func (_OptimismMintableERC20 *OptimismMintableERC20CallerSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { + return _OptimismMintableERC20.Contract.Allowance(&_OptimismMintableERC20.CallOpts, owner, spender) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) view returns(uint256) +func (_OptimismMintableERC20 *OptimismMintableERC20Caller) BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) { + var out []interface{} + err := _OptimismMintableERC20.contract.Call(opts, &out, "balanceOf", account) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) view returns(uint256) +func (_OptimismMintableERC20 *OptimismMintableERC20Session) BalanceOf(account common.Address) (*big.Int, error) { + return _OptimismMintableERC20.Contract.BalanceOf(&_OptimismMintableERC20.CallOpts, account) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) view returns(uint256) +func (_OptimismMintableERC20 *OptimismMintableERC20CallerSession) BalanceOf(account common.Address) (*big.Int, error) { + return _OptimismMintableERC20.Contract.BalanceOf(&_OptimismMintableERC20.CallOpts, account) +} + +// Bridge is a free data retrieval call binding the contract method 0xe78cea92. +// +// Solidity: function bridge() view returns(address) +func (_OptimismMintableERC20 *OptimismMintableERC20Caller) Bridge(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _OptimismMintableERC20.contract.Call(opts, &out, "bridge") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Bridge is a free data retrieval call binding the contract method 0xe78cea92. +// +// Solidity: function bridge() view returns(address) +func (_OptimismMintableERC20 *OptimismMintableERC20Session) Bridge() (common.Address, error) { + return _OptimismMintableERC20.Contract.Bridge(&_OptimismMintableERC20.CallOpts) +} + +// Bridge is a free data retrieval call binding the contract method 0xe78cea92. +// +// Solidity: function bridge() view returns(address) +func (_OptimismMintableERC20 *OptimismMintableERC20CallerSession) Bridge() (common.Address, error) { + return _OptimismMintableERC20.Contract.Bridge(&_OptimismMintableERC20.CallOpts) +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_OptimismMintableERC20 *OptimismMintableERC20Caller) Decimals(opts *bind.CallOpts) (uint8, error) { + var out []interface{} + err := _OptimismMintableERC20.contract.Call(opts, &out, "decimals") + + if err != nil { + return *new(uint8), err + } + + out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) + + return out0, err + +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_OptimismMintableERC20 *OptimismMintableERC20Session) Decimals() (uint8, error) { + return _OptimismMintableERC20.Contract.Decimals(&_OptimismMintableERC20.CallOpts) +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_OptimismMintableERC20 *OptimismMintableERC20CallerSession) Decimals() (uint8, error) { + return _OptimismMintableERC20.Contract.Decimals(&_OptimismMintableERC20.CallOpts) +} + +// L1Token is a free data retrieval call binding the contract method 0xc01e1bd6. +// +// Solidity: function l1Token() view returns(address) +func (_OptimismMintableERC20 *OptimismMintableERC20Caller) L1Token(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _OptimismMintableERC20.contract.Call(opts, &out, "l1Token") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// L1Token is a free data retrieval call binding the contract method 0xc01e1bd6. +// +// Solidity: function l1Token() view returns(address) +func (_OptimismMintableERC20 *OptimismMintableERC20Session) L1Token() (common.Address, error) { + return _OptimismMintableERC20.Contract.L1Token(&_OptimismMintableERC20.CallOpts) +} + +// L1Token is a free data retrieval call binding the contract method 0xc01e1bd6. +// +// Solidity: function l1Token() view returns(address) +func (_OptimismMintableERC20 *OptimismMintableERC20CallerSession) L1Token() (common.Address, error) { + return _OptimismMintableERC20.Contract.L1Token(&_OptimismMintableERC20.CallOpts) +} + +// L2Bridge is a free data retrieval call binding the contract method 0xae1f6aaf. +// +// Solidity: function l2Bridge() view returns(address) +func (_OptimismMintableERC20 *OptimismMintableERC20Caller) L2Bridge(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _OptimismMintableERC20.contract.Call(opts, &out, "l2Bridge") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// L2Bridge is a free data retrieval call binding the contract method 0xae1f6aaf. +// +// Solidity: function l2Bridge() view returns(address) +func (_OptimismMintableERC20 *OptimismMintableERC20Session) L2Bridge() (common.Address, error) { + return _OptimismMintableERC20.Contract.L2Bridge(&_OptimismMintableERC20.CallOpts) +} + +// L2Bridge is a free data retrieval call binding the contract method 0xae1f6aaf. +// +// Solidity: function l2Bridge() view returns(address) +func (_OptimismMintableERC20 *OptimismMintableERC20CallerSession) L2Bridge() (common.Address, error) { + return _OptimismMintableERC20.Contract.L2Bridge(&_OptimismMintableERC20.CallOpts) +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_OptimismMintableERC20 *OptimismMintableERC20Caller) Name(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _OptimismMintableERC20.contract.Call(opts, &out, "name") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_OptimismMintableERC20 *OptimismMintableERC20Session) Name() (string, error) { + return _OptimismMintableERC20.Contract.Name(&_OptimismMintableERC20.CallOpts) +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_OptimismMintableERC20 *OptimismMintableERC20CallerSession) Name() (string, error) { + return _OptimismMintableERC20.Contract.Name(&_OptimismMintableERC20.CallOpts) +} + +// RemoteToken is a free data retrieval call binding the contract method 0xd6c0b2c4. +// +// Solidity: function remoteToken() view returns(address) +func (_OptimismMintableERC20 *OptimismMintableERC20Caller) RemoteToken(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _OptimismMintableERC20.contract.Call(opts, &out, "remoteToken") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// RemoteToken is a free data retrieval call binding the contract method 0xd6c0b2c4. +// +// Solidity: function remoteToken() view returns(address) +func (_OptimismMintableERC20 *OptimismMintableERC20Session) RemoteToken() (common.Address, error) { + return _OptimismMintableERC20.Contract.RemoteToken(&_OptimismMintableERC20.CallOpts) +} + +// RemoteToken is a free data retrieval call binding the contract method 0xd6c0b2c4. +// +// Solidity: function remoteToken() view returns(address) +func (_OptimismMintableERC20 *OptimismMintableERC20CallerSession) RemoteToken() (common.Address, error) { + return _OptimismMintableERC20.Contract.RemoteToken(&_OptimismMintableERC20.CallOpts) +} + +// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. +// +// Solidity: function supportsInterface(bytes4 _interfaceId) pure returns(bool) +func (_OptimismMintableERC20 *OptimismMintableERC20Caller) SupportsInterface(opts *bind.CallOpts, _interfaceId [4]byte) (bool, error) { + var out []interface{} + err := _OptimismMintableERC20.contract.Call(opts, &out, "supportsInterface", _interfaceId) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. +// +// Solidity: function supportsInterface(bytes4 _interfaceId) pure returns(bool) +func (_OptimismMintableERC20 *OptimismMintableERC20Session) SupportsInterface(_interfaceId [4]byte) (bool, error) { + return _OptimismMintableERC20.Contract.SupportsInterface(&_OptimismMintableERC20.CallOpts, _interfaceId) +} + +// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. +// +// Solidity: function supportsInterface(bytes4 _interfaceId) pure returns(bool) +func (_OptimismMintableERC20 *OptimismMintableERC20CallerSession) SupportsInterface(_interfaceId [4]byte) (bool, error) { + return _OptimismMintableERC20.Contract.SupportsInterface(&_OptimismMintableERC20.CallOpts, _interfaceId) +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_OptimismMintableERC20 *OptimismMintableERC20Caller) Symbol(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _OptimismMintableERC20.contract.Call(opts, &out, "symbol") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_OptimismMintableERC20 *OptimismMintableERC20Session) Symbol() (string, error) { + return _OptimismMintableERC20.Contract.Symbol(&_OptimismMintableERC20.CallOpts) +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_OptimismMintableERC20 *OptimismMintableERC20CallerSession) Symbol() (string, error) { + return _OptimismMintableERC20.Contract.Symbol(&_OptimismMintableERC20.CallOpts) +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_OptimismMintableERC20 *OptimismMintableERC20Caller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _OptimismMintableERC20.contract.Call(opts, &out, "totalSupply") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_OptimismMintableERC20 *OptimismMintableERC20Session) TotalSupply() (*big.Int, error) { + return _OptimismMintableERC20.Contract.TotalSupply(&_OptimismMintableERC20.CallOpts) +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_OptimismMintableERC20 *OptimismMintableERC20CallerSession) TotalSupply() (*big.Int, error) { + return _OptimismMintableERC20.Contract.TotalSupply(&_OptimismMintableERC20.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_OptimismMintableERC20 *OptimismMintableERC20Caller) Version(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _OptimismMintableERC20.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 (_OptimismMintableERC20 *OptimismMintableERC20Session) Version() (string, error) { + return _OptimismMintableERC20.Contract.Version(&_OptimismMintableERC20.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_OptimismMintableERC20 *OptimismMintableERC20CallerSession) Version() (string, error) { + return _OptimismMintableERC20.Contract.Version(&_OptimismMintableERC20.CallOpts) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_OptimismMintableERC20 *OptimismMintableERC20Transactor) Approve(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _OptimismMintableERC20.contract.Transact(opts, "approve", spender, amount) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_OptimismMintableERC20 *OptimismMintableERC20Session) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _OptimismMintableERC20.Contract.Approve(&_OptimismMintableERC20.TransactOpts, spender, amount) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_OptimismMintableERC20 *OptimismMintableERC20TransactorSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _OptimismMintableERC20.Contract.Approve(&_OptimismMintableERC20.TransactOpts, spender, amount) +} + +// Burn is a paid mutator transaction binding the contract method 0x9dc29fac. +// +// Solidity: function burn(address _from, uint256 _amount) returns() +func (_OptimismMintableERC20 *OptimismMintableERC20Transactor) Burn(opts *bind.TransactOpts, _from common.Address, _amount *big.Int) (*types.Transaction, error) { + return _OptimismMintableERC20.contract.Transact(opts, "burn", _from, _amount) +} + +// Burn is a paid mutator transaction binding the contract method 0x9dc29fac. +// +// Solidity: function burn(address _from, uint256 _amount) returns() +func (_OptimismMintableERC20 *OptimismMintableERC20Session) Burn(_from common.Address, _amount *big.Int) (*types.Transaction, error) { + return _OptimismMintableERC20.Contract.Burn(&_OptimismMintableERC20.TransactOpts, _from, _amount) +} + +// Burn is a paid mutator transaction binding the contract method 0x9dc29fac. +// +// Solidity: function burn(address _from, uint256 _amount) returns() +func (_OptimismMintableERC20 *OptimismMintableERC20TransactorSession) Burn(_from common.Address, _amount *big.Int) (*types.Transaction, error) { + return _OptimismMintableERC20.Contract.Burn(&_OptimismMintableERC20.TransactOpts, _from, _amount) +} + +// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. +// +// Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) +func (_OptimismMintableERC20 *OptimismMintableERC20Transactor) DecreaseAllowance(opts *bind.TransactOpts, spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _OptimismMintableERC20.contract.Transact(opts, "decreaseAllowance", spender, subtractedValue) +} + +// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. +// +// Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) +func (_OptimismMintableERC20 *OptimismMintableERC20Session) DecreaseAllowance(spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _OptimismMintableERC20.Contract.DecreaseAllowance(&_OptimismMintableERC20.TransactOpts, spender, subtractedValue) +} + +// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. +// +// Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) +func (_OptimismMintableERC20 *OptimismMintableERC20TransactorSession) DecreaseAllowance(spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _OptimismMintableERC20.Contract.DecreaseAllowance(&_OptimismMintableERC20.TransactOpts, spender, subtractedValue) +} + +// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. +// +// Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) +func (_OptimismMintableERC20 *OptimismMintableERC20Transactor) IncreaseAllowance(opts *bind.TransactOpts, spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _OptimismMintableERC20.contract.Transact(opts, "increaseAllowance", spender, addedValue) +} + +// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. +// +// Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) +func (_OptimismMintableERC20 *OptimismMintableERC20Session) IncreaseAllowance(spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _OptimismMintableERC20.Contract.IncreaseAllowance(&_OptimismMintableERC20.TransactOpts, spender, addedValue) +} + +// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. +// +// Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) +func (_OptimismMintableERC20 *OptimismMintableERC20TransactorSession) IncreaseAllowance(spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _OptimismMintableERC20.Contract.IncreaseAllowance(&_OptimismMintableERC20.TransactOpts, spender, addedValue) +} + +// Mint is a paid mutator transaction binding the contract method 0x40c10f19. +// +// Solidity: function mint(address _to, uint256 _amount) returns() +func (_OptimismMintableERC20 *OptimismMintableERC20Transactor) Mint(opts *bind.TransactOpts, _to common.Address, _amount *big.Int) (*types.Transaction, error) { + return _OptimismMintableERC20.contract.Transact(opts, "mint", _to, _amount) +} + +// Mint is a paid mutator transaction binding the contract method 0x40c10f19. +// +// Solidity: function mint(address _to, uint256 _amount) returns() +func (_OptimismMintableERC20 *OptimismMintableERC20Session) Mint(_to common.Address, _amount *big.Int) (*types.Transaction, error) { + return _OptimismMintableERC20.Contract.Mint(&_OptimismMintableERC20.TransactOpts, _to, _amount) +} + +// Mint is a paid mutator transaction binding the contract method 0x40c10f19. +// +// Solidity: function mint(address _to, uint256 _amount) returns() +func (_OptimismMintableERC20 *OptimismMintableERC20TransactorSession) Mint(_to common.Address, _amount *big.Int) (*types.Transaction, error) { + return _OptimismMintableERC20.Contract.Mint(&_OptimismMintableERC20.TransactOpts, _to, _amount) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address to, uint256 amount) returns(bool) +func (_OptimismMintableERC20 *OptimismMintableERC20Transactor) Transfer(opts *bind.TransactOpts, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _OptimismMintableERC20.contract.Transact(opts, "transfer", to, amount) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address to, uint256 amount) returns(bool) +func (_OptimismMintableERC20 *OptimismMintableERC20Session) Transfer(to common.Address, amount *big.Int) (*types.Transaction, error) { + return _OptimismMintableERC20.Contract.Transfer(&_OptimismMintableERC20.TransactOpts, to, amount) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address to, uint256 amount) returns(bool) +func (_OptimismMintableERC20 *OptimismMintableERC20TransactorSession) Transfer(to common.Address, amount *big.Int) (*types.Transaction, error) { + return _OptimismMintableERC20.Contract.Transfer(&_OptimismMintableERC20.TransactOpts, to, amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address from, address to, uint256 amount) returns(bool) +func (_OptimismMintableERC20 *OptimismMintableERC20Transactor) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _OptimismMintableERC20.contract.Transact(opts, "transferFrom", from, to, amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address from, address to, uint256 amount) returns(bool) +func (_OptimismMintableERC20 *OptimismMintableERC20Session) TransferFrom(from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _OptimismMintableERC20.Contract.TransferFrom(&_OptimismMintableERC20.TransactOpts, from, to, amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address from, address to, uint256 amount) returns(bool) +func (_OptimismMintableERC20 *OptimismMintableERC20TransactorSession) TransferFrom(from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _OptimismMintableERC20.Contract.TransferFrom(&_OptimismMintableERC20.TransactOpts, from, to, amount) +} + +// OptimismMintableERC20ApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the OptimismMintableERC20 contract. +type OptimismMintableERC20ApprovalIterator struct { + Event *OptimismMintableERC20Approval // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *OptimismMintableERC20ApprovalIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(OptimismMintableERC20Approval) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(OptimismMintableERC20Approval) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *OptimismMintableERC20ApprovalIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *OptimismMintableERC20ApprovalIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// OptimismMintableERC20Approval represents a Approval event raised by the OptimismMintableERC20 contract. +type OptimismMintableERC20Approval struct { + Owner common.Address + Spender common.Address + Value *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_OptimismMintableERC20 *OptimismMintableERC20Filterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*OptimismMintableERC20ApprovalIterator, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var spenderRule []interface{} + for _, spenderItem := range spender { + spenderRule = append(spenderRule, spenderItem) + } + + logs, sub, err := _OptimismMintableERC20.contract.FilterLogs(opts, "Approval", ownerRule, spenderRule) + if err != nil { + return nil, err + } + return &OptimismMintableERC20ApprovalIterator{contract: _OptimismMintableERC20.contract, event: "Approval", logs: logs, sub: sub}, nil +} + +// WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_OptimismMintableERC20 *OptimismMintableERC20Filterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *OptimismMintableERC20Approval, owner []common.Address, spender []common.Address) (event.Subscription, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var spenderRule []interface{} + for _, spenderItem := range spender { + spenderRule = append(spenderRule, spenderItem) + } + + logs, sub, err := _OptimismMintableERC20.contract.WatchLogs(opts, "Approval", ownerRule, spenderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(OptimismMintableERC20Approval) + if err := _OptimismMintableERC20.contract.UnpackLog(event, "Approval", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_OptimismMintableERC20 *OptimismMintableERC20Filterer) ParseApproval(log types.Log) (*OptimismMintableERC20Approval, error) { + event := new(OptimismMintableERC20Approval) + if err := _OptimismMintableERC20.contract.UnpackLog(event, "Approval", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// OptimismMintableERC20BurnIterator is returned from FilterBurn and is used to iterate over the raw logs and unpacked data for Burn events raised by the OptimismMintableERC20 contract. +type OptimismMintableERC20BurnIterator struct { + Event *OptimismMintableERC20Burn // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *OptimismMintableERC20BurnIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(OptimismMintableERC20Burn) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(OptimismMintableERC20Burn) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *OptimismMintableERC20BurnIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *OptimismMintableERC20BurnIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// OptimismMintableERC20Burn represents a Burn event raised by the OptimismMintableERC20 contract. +type OptimismMintableERC20Burn struct { + Account common.Address + Amount *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterBurn is a free log retrieval operation binding the contract event 0xcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5. +// +// Solidity: event Burn(address indexed account, uint256 amount) +func (_OptimismMintableERC20 *OptimismMintableERC20Filterer) FilterBurn(opts *bind.FilterOpts, account []common.Address) (*OptimismMintableERC20BurnIterator, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _OptimismMintableERC20.contract.FilterLogs(opts, "Burn", accountRule) + if err != nil { + return nil, err + } + return &OptimismMintableERC20BurnIterator{contract: _OptimismMintableERC20.contract, event: "Burn", logs: logs, sub: sub}, nil +} + +// WatchBurn is a free log subscription operation binding the contract event 0xcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5. +// +// Solidity: event Burn(address indexed account, uint256 amount) +func (_OptimismMintableERC20 *OptimismMintableERC20Filterer) WatchBurn(opts *bind.WatchOpts, sink chan<- *OptimismMintableERC20Burn, account []common.Address) (event.Subscription, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _OptimismMintableERC20.contract.WatchLogs(opts, "Burn", accountRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(OptimismMintableERC20Burn) + if err := _OptimismMintableERC20.contract.UnpackLog(event, "Burn", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseBurn is a log parse operation binding the contract event 0xcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5. +// +// Solidity: event Burn(address indexed account, uint256 amount) +func (_OptimismMintableERC20 *OptimismMintableERC20Filterer) ParseBurn(log types.Log) (*OptimismMintableERC20Burn, error) { + event := new(OptimismMintableERC20Burn) + if err := _OptimismMintableERC20.contract.UnpackLog(event, "Burn", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// OptimismMintableERC20MintIterator is returned from FilterMint and is used to iterate over the raw logs and unpacked data for Mint events raised by the OptimismMintableERC20 contract. +type OptimismMintableERC20MintIterator struct { + Event *OptimismMintableERC20Mint // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *OptimismMintableERC20MintIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(OptimismMintableERC20Mint) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(OptimismMintableERC20Mint) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *OptimismMintableERC20MintIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *OptimismMintableERC20MintIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// OptimismMintableERC20Mint represents a Mint event raised by the OptimismMintableERC20 contract. +type OptimismMintableERC20Mint struct { + Account common.Address + Amount *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterMint is a free log retrieval operation binding the contract event 0x0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885. +// +// Solidity: event Mint(address indexed account, uint256 amount) +func (_OptimismMintableERC20 *OptimismMintableERC20Filterer) FilterMint(opts *bind.FilterOpts, account []common.Address) (*OptimismMintableERC20MintIterator, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _OptimismMintableERC20.contract.FilterLogs(opts, "Mint", accountRule) + if err != nil { + return nil, err + } + return &OptimismMintableERC20MintIterator{contract: _OptimismMintableERC20.contract, event: "Mint", logs: logs, sub: sub}, nil +} + +// WatchMint is a free log subscription operation binding the contract event 0x0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885. +// +// Solidity: event Mint(address indexed account, uint256 amount) +func (_OptimismMintableERC20 *OptimismMintableERC20Filterer) WatchMint(opts *bind.WatchOpts, sink chan<- *OptimismMintableERC20Mint, account []common.Address) (event.Subscription, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _OptimismMintableERC20.contract.WatchLogs(opts, "Mint", accountRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(OptimismMintableERC20Mint) + if err := _OptimismMintableERC20.contract.UnpackLog(event, "Mint", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseMint is a log parse operation binding the contract event 0x0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885. +// +// Solidity: event Mint(address indexed account, uint256 amount) +func (_OptimismMintableERC20 *OptimismMintableERC20Filterer) ParseMint(log types.Log) (*OptimismMintableERC20Mint, error) { + event := new(OptimismMintableERC20Mint) + if err := _OptimismMintableERC20.contract.UnpackLog(event, "Mint", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// OptimismMintableERC20TransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the OptimismMintableERC20 contract. +type OptimismMintableERC20TransferIterator struct { + Event *OptimismMintableERC20Transfer // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *OptimismMintableERC20TransferIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(OptimismMintableERC20Transfer) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(OptimismMintableERC20Transfer) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *OptimismMintableERC20TransferIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *OptimismMintableERC20TransferIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// OptimismMintableERC20Transfer represents a Transfer event raised by the OptimismMintableERC20 contract. +type OptimismMintableERC20Transfer struct { + From common.Address + To common.Address + Value *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_OptimismMintableERC20 *OptimismMintableERC20Filterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*OptimismMintableERC20TransferIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _OptimismMintableERC20.contract.FilterLogs(opts, "Transfer", fromRule, toRule) + if err != nil { + return nil, err + } + return &OptimismMintableERC20TransferIterator{contract: _OptimismMintableERC20.contract, event: "Transfer", logs: logs, sub: sub}, nil +} + +// WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_OptimismMintableERC20 *OptimismMintableERC20Filterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *OptimismMintableERC20Transfer, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _OptimismMintableERC20.contract.WatchLogs(opts, "Transfer", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(OptimismMintableERC20Transfer) + if err := _OptimismMintableERC20.contract.UnpackLog(event, "Transfer", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_OptimismMintableERC20 *OptimismMintableERC20Filterer) ParseTransfer(log types.Log) (*OptimismMintableERC20Transfer, error) { + event := new(OptimismMintableERC20Transfer) + if err := _OptimismMintableERC20.contract.UnpackLog(event, "Transfer", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/op-e2e2/bindings/optimismmintableerc20factory.go b/op-e2e2/bindings/optimismmintableerc20factory.go new file mode 100644 index 000000000000..b97fe223cd87 --- /dev/null +++ b/op-e2e2/bindings/optimismmintableerc20factory.go @@ -0,0 +1,820 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// OptimismMintableERC20FactoryMetaData contains all meta data concerning the OptimismMintableERC20Factory contract. +var OptimismMintableERC20FactoryMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"BRIDGE\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"bridge\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"createOptimismMintableERC20\",\"inputs\":[{\"name\":\"_remoteToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_name\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"_symbol\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"createOptimismMintableERC20WithDecimals\",\"inputs\":[{\"name\":\"_remoteToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_name\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"_symbol\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"_decimals\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"createStandardL2Token\",\"inputs\":[{\"name\":\"_remoteToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_name\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"_symbol\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_bridge\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OptimismMintableERC20Created\",\"inputs\":[{\"name\":\"localToken\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"remoteToken\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"deployer\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"StandardL2TokenCreated\",\"inputs\":[{\"name\":\"remoteToken\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"localToken\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false}]", + Bin: "0x608060405234801561001057600080fd5b5061001b6000610020565b610169565b600054610100900460ff16158080156100405750600054600160ff909116105b8061006b57506100593061015a60201b61059d1760201c565b15801561006b575060005460ff166001145b6100d25760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805460ff1916600117905580156100f5576000805461ff0019166101001790555b600180546001600160a01b0319166001600160a01b0384161790558015610156576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050565b6001600160a01b03163b151590565b6120e5806101786000396000f3fe60806040523480156200001157600080fd5b5060043610620000875760003560e01c8063c4d66de81162000062578063c4d66de81462000135578063ce5ac90f146200014e578063e78cea921462000165578063ee9a31a2146200018657600080fd5b806354fd4d50146200008c578063896f93d114620000e15780638cf0629c146200011e575b600080fd5b620000c96040518060400160405280600581526020017f312e392e3000000000000000000000000000000000000000000000000000000081525081565b604051620000d8919062000635565b60405180910390f35b620000f8620000f23660046200075d565b620001a5565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001620000d8565b620000f86200012f366004620007da565b620001bc565b6200014c6200014636600462000871565b620003ba565b005b620000f86200015f3660046200075d565b6200058c565b600154620000f89073ffffffffffffffffffffffffffffffffffffffff1681565b60015473ffffffffffffffffffffffffffffffffffffffff16620000f8565b6000620001b48484846200058c565b949350505050565b600073ffffffffffffffffffffffffffffffffffffffff851662000267576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f4f7074696d69736d4d696e7461626c654552433230466163746f72793a206d7560448201527f73742070726f766964652072656d6f746520746f6b656e20616464726573730060648201526084015b60405180910390fd5b6000858585856040516020016200028294939291906200088f565b604051602081830303815290604052805190602001209050600081600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1688888888604051620002d290620005b9565b620002e2959493929190620008e9565b8190604051809103906000f590508015801562000303573d6000803e3d6000fd5b5090508073ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fceeb8e7d520d7f3b65fc11a262b91066940193b05d4f93df07cfdced0eb551cf60405160405180910390a360405133815273ffffffffffffffffffffffffffffffffffffffff80891691908316907f52fe89dd5930f343d25650b62fd367bae47088bcddffd2a88350a6ecdd620cdb9060200160405180910390a39695505050505050565b600054610100900460ff1615808015620003db5750600054600160ff909116105b80620003f75750303b158015620003f7575060005460ff166001145b62000485576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016200025e565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015620004e457600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff841617905580156200058857600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050565b6000620001b48484846012620001bc565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b61178a806200094f83390190565b6000815180845260005b81811015620005ef57602081850181015186830182015201620005d1565b8181111562000602576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006200064a6020830184620005c7565b9392505050565b803573ffffffffffffffffffffffffffffffffffffffff811681146200067657600080fd5b919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f830112620006bc57600080fd5b813567ffffffffffffffff80821115620006da57620006da6200067b565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019082821181831017156200072357620007236200067b565b816040528381528660208588010111156200073d57600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806000606084860312156200077357600080fd5b6200077e8462000651565b9250602084013567ffffffffffffffff808211156200079c57600080fd5b620007aa87838801620006aa565b93506040860135915080821115620007c157600080fd5b50620007d086828701620006aa565b9150509250925092565b60008060008060808587031215620007f157600080fd5b620007fc8562000651565b9350602085013567ffffffffffffffff808211156200081a57600080fd5b6200082888838901620006aa565b945060408701359150808211156200083f57600080fd5b506200084e87828801620006aa565b925050606085013560ff811681146200086657600080fd5b939692955090935050565b6000602082840312156200088457600080fd5b6200064a8262000651565b73ffffffffffffffffffffffffffffffffffffffff85168152608060208201526000620008c06080830186620005c7565b8281036040840152620008d48186620005c7565b91505060ff8316606083015295945050505050565b600073ffffffffffffffffffffffffffffffffffffffff808816835280871660208401525060a060408301526200092460a0830186620005c7565b8281036060840152620009388186620005c7565b91505060ff83166080830152969550505050505056fe60e06040523480156200001157600080fd5b506040516200178a3803806200178a833981016040819052620000349162000163565b828260036200004483826200029e565b5060046200005382826200029e565b5050506001600160a01b039384166080529390921660a052505060ff1660c0526200036a565b80516001600160a01b03811681146200009157600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b600082601f830112620000be57600080fd5b81516001600160401b0380821115620000db57620000db62000096565b604051601f8301601f19908116603f0116810190828211818310171562000106576200010662000096565b816040528381526020925086838588010111156200012357600080fd5b600091505b8382101562000147578582018301518183018401529082019062000128565b83821115620001595760008385830101525b9695505050505050565b600080600080600060a086880312156200017c57600080fd5b620001878662000079565b9450620001976020870162000079565b60408701519094506001600160401b0380821115620001b557600080fd5b620001c389838a01620000ac565b94506060880151915080821115620001da57600080fd5b50620001e988828901620000ac565b925050608086015160ff811681146200020157600080fd5b809150509295509295909350565b600181811c908216806200022457607f821691505b6020821081036200024557634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200029957600081815260208120601f850160051c81016020861015620002745750805b601f850160051c820191505b81811015620002955782815560010162000280565b5050505b505050565b81516001600160401b03811115620002ba57620002ba62000096565b620002d281620002cb84546200020f565b846200024b565b602080601f8311600181146200030a5760008415620002f15750858301515b600019600386901b1c1916600185901b17855562000295565b600085815260208120601f198616915b828110156200033b578886015182559484019460019091019084016200031a565b50858210156200035a5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60805160a05160c0516113d4620003b6600039600061024401526000818161034b015281816103e001528181610625015261075c0152600081816101a9015261037101526113d46000f3fe608060405234801561001057600080fd5b50600436106101775760003560e01c806370a08231116100d8578063ae1f6aaf1161008c578063dd62ed3e11610066578063dd62ed3e14610395578063e78cea9214610349578063ee9a31a2146103db57600080fd5b8063ae1f6aaf14610349578063c01e1bd61461036f578063d6c0b2c41461036f57600080fd5b80639dc29fac116100bd5780639dc29fac14610310578063a457c2d714610323578063a9059cbb1461033657600080fd5b806370a08231146102d257806395d89b411461030857600080fd5b806323b872dd1161012f5780633950935111610114578063395093511461026e57806340c10f191461028157806354fd4d501461029657600080fd5b806323b872dd1461022a578063313ce5671461023d57600080fd5b806306fdde031161016057806306fdde03146101f0578063095ea7b31461020557806318160ddd1461021857600080fd5b806301ffc9a71461017c578063033964be146101a4575b600080fd5b61018f61018a36600461117d565b610402565b60405190151581526020015b60405180910390f35b6101cb7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161019b565b6101f86104f3565b60405161019b91906111c6565b61018f610213366004611262565b610585565b6002545b60405190815260200161019b565b61018f61023836600461128c565b61059d565b60405160ff7f000000000000000000000000000000000000000000000000000000000000000016815260200161019b565b61018f61027c366004611262565b6105c1565b61029461028f366004611262565b61060d565b005b6101f86040518060400160405280600581526020017f312e332e3000000000000000000000000000000000000000000000000000000081525081565b61021c6102e03660046112c8565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b6101f8610735565b61029461031e366004611262565b610744565b61018f610331366004611262565b61085b565b61018f610344366004611262565b61092c565b7f00000000000000000000000000000000000000000000000000000000000000006101cb565b7f00000000000000000000000000000000000000000000000000000000000000006101cb565b61021c6103a33660046112e3565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205490565b6101cb7f000000000000000000000000000000000000000000000000000000000000000081565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007f1d1d8b63000000000000000000000000000000000000000000000000000000007fec4fc8e3000000000000000000000000000000000000000000000000000000007fffffffff0000000000000000000000000000000000000000000000000000000085168314806104bb57507fffffffff00000000000000000000000000000000000000000000000000000000858116908316145b806104ea57507fffffffff00000000000000000000000000000000000000000000000000000000858116908216145b95945050505050565b60606003805461050290611316565b80601f016020809104026020016040519081016040528092919081815260200182805461052e90611316565b801561057b5780601f106105505761010080835404028352916020019161057b565b820191906000526020600020905b81548152906001019060200180831161055e57829003601f168201915b5050505050905090565b60003361059381858561093a565b5060019392505050565b6000336105ab858285610aee565b6105b6858585610bc5565b506001949350505050565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff871684529091528120549091906105939082908690610608908790611398565b61093a565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146106d7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603460248201527f4f7074696d69736d4d696e7461626c6545524332303a206f6e6c79206272696460448201527f67652063616e206d696e7420616e64206275726e00000000000000000000000060648201526084015b60405180910390fd5b6106e18282610e78565b8173ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968858260405161072991815260200190565b60405180910390a25050565b60606004805461050290611316565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610809576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603460248201527f4f7074696d69736d4d696e7461626c6545524332303a206f6e6c79206272696460448201527f67652063616e206d696e7420616e64206275726e00000000000000000000000060648201526084016106ce565b6108138282610f98565b8173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58260405161072991815260200190565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff871684529091528120549091908381101561091f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f00000000000000000000000000000000000000000000000000000060648201526084016106ce565b6105b6828686840361093a565b600033610593818585610bc5565b73ffffffffffffffffffffffffffffffffffffffff83166109dc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f726573730000000000000000000000000000000000000000000000000000000060648201526084016106ce565b73ffffffffffffffffffffffffffffffffffffffff8216610a7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f737300000000000000000000000000000000000000000000000000000000000060648201526084016106ce565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff8381166000908152600160209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114610bbf5781811015610bb2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016106ce565b610bbf848484840361093a565b50505050565b73ffffffffffffffffffffffffffffffffffffffff8316610c68576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f647265737300000000000000000000000000000000000000000000000000000060648201526084016106ce565b73ffffffffffffffffffffffffffffffffffffffff8216610d0b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f657373000000000000000000000000000000000000000000000000000000000060648201526084016106ce565b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205481811015610dc1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e6365000000000000000000000000000000000000000000000000000060648201526084016106ce565b73ffffffffffffffffffffffffffffffffffffffff808516600090815260208190526040808220858503905591851681529081208054849290610e05908490611398565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610e6b91815260200190565b60405180910390a3610bbf565b73ffffffffffffffffffffffffffffffffffffffff8216610ef5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016106ce565b8060026000828254610f079190611398565b909155505073ffffffffffffffffffffffffffffffffffffffff821660009081526020819052604081208054839290610f41908490611398565b909155505060405181815273ffffffffffffffffffffffffffffffffffffffff8316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b73ffffffffffffffffffffffffffffffffffffffff821661103b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f730000000000000000000000000000000000000000000000000000000000000060648201526084016106ce565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260208190526040902054818110156110f1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f636500000000000000000000000000000000000000000000000000000000000060648201526084016106ce565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260208190526040812083830390556002805484929061112d9084906113b0565b909155505060405182815260009073ffffffffffffffffffffffffffffffffffffffff8516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001610ae1565b60006020828403121561118f57600080fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146111bf57600080fd5b9392505050565b600060208083528351808285015260005b818110156111f3578581018301518582016040015282016111d7565b81811115611205576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461125d57600080fd5b919050565b6000806040838503121561127557600080fd5b61127e83611239565b946020939093013593505050565b6000806000606084860312156112a157600080fd5b6112aa84611239565b92506112b860208501611239565b9150604084013590509250925092565b6000602082840312156112da57600080fd5b6111bf82611239565b600080604083850312156112f657600080fd5b6112ff83611239565b915061130d60208401611239565b90509250929050565b600181811c9082168061132a57607f821691505b602082108103611363577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082198211156113ab576113ab611369565b500190565b6000828210156113c2576113c2611369565b50039056fea164736f6c634300080f000aa164736f6c634300080f000a", +} + +// OptimismMintableERC20FactoryABI is the input ABI used to generate the binding from. +// Deprecated: Use OptimismMintableERC20FactoryMetaData.ABI instead. +var OptimismMintableERC20FactoryABI = OptimismMintableERC20FactoryMetaData.ABI + +// OptimismMintableERC20FactoryBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use OptimismMintableERC20FactoryMetaData.Bin instead. +var OptimismMintableERC20FactoryBin = OptimismMintableERC20FactoryMetaData.Bin + +// DeployOptimismMintableERC20Factory deploys a new Ethereum contract, binding an instance of OptimismMintableERC20Factory to it. +func DeployOptimismMintableERC20Factory(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *OptimismMintableERC20Factory, error) { + parsed, err := OptimismMintableERC20FactoryMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(OptimismMintableERC20FactoryBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &OptimismMintableERC20Factory{OptimismMintableERC20FactoryCaller: OptimismMintableERC20FactoryCaller{contract: contract}, OptimismMintableERC20FactoryTransactor: OptimismMintableERC20FactoryTransactor{contract: contract}, OptimismMintableERC20FactoryFilterer: OptimismMintableERC20FactoryFilterer{contract: contract}}, nil +} + +// OptimismMintableERC20Factory is an auto generated Go binding around an Ethereum contract. +type OptimismMintableERC20Factory struct { + OptimismMintableERC20FactoryCaller // Read-only binding to the contract + OptimismMintableERC20FactoryTransactor // Write-only binding to the contract + OptimismMintableERC20FactoryFilterer // Log filterer for contract events +} + +// OptimismMintableERC20FactoryCaller is an auto generated read-only Go binding around an Ethereum contract. +type OptimismMintableERC20FactoryCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// OptimismMintableERC20FactoryTransactor is an auto generated write-only Go binding around an Ethereum contract. +type OptimismMintableERC20FactoryTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// OptimismMintableERC20FactoryFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type OptimismMintableERC20FactoryFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// OptimismMintableERC20FactorySession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type OptimismMintableERC20FactorySession struct { + Contract *OptimismMintableERC20Factory // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// OptimismMintableERC20FactoryCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type OptimismMintableERC20FactoryCallerSession struct { + Contract *OptimismMintableERC20FactoryCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// OptimismMintableERC20FactoryTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type OptimismMintableERC20FactoryTransactorSession struct { + Contract *OptimismMintableERC20FactoryTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// OptimismMintableERC20FactoryRaw is an auto generated low-level Go binding around an Ethereum contract. +type OptimismMintableERC20FactoryRaw struct { + Contract *OptimismMintableERC20Factory // Generic contract binding to access the raw methods on +} + +// OptimismMintableERC20FactoryCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type OptimismMintableERC20FactoryCallerRaw struct { + Contract *OptimismMintableERC20FactoryCaller // Generic read-only contract binding to access the raw methods on +} + +// OptimismMintableERC20FactoryTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type OptimismMintableERC20FactoryTransactorRaw struct { + Contract *OptimismMintableERC20FactoryTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewOptimismMintableERC20Factory creates a new instance of OptimismMintableERC20Factory, bound to a specific deployed contract. +func NewOptimismMintableERC20Factory(address common.Address, backend bind.ContractBackend) (*OptimismMintableERC20Factory, error) { + contract, err := bindOptimismMintableERC20Factory(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &OptimismMintableERC20Factory{OptimismMintableERC20FactoryCaller: OptimismMintableERC20FactoryCaller{contract: contract}, OptimismMintableERC20FactoryTransactor: OptimismMintableERC20FactoryTransactor{contract: contract}, OptimismMintableERC20FactoryFilterer: OptimismMintableERC20FactoryFilterer{contract: contract}}, nil +} + +// NewOptimismMintableERC20FactoryCaller creates a new read-only instance of OptimismMintableERC20Factory, bound to a specific deployed contract. +func NewOptimismMintableERC20FactoryCaller(address common.Address, caller bind.ContractCaller) (*OptimismMintableERC20FactoryCaller, error) { + contract, err := bindOptimismMintableERC20Factory(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &OptimismMintableERC20FactoryCaller{contract: contract}, nil +} + +// NewOptimismMintableERC20FactoryTransactor creates a new write-only instance of OptimismMintableERC20Factory, bound to a specific deployed contract. +func NewOptimismMintableERC20FactoryTransactor(address common.Address, transactor bind.ContractTransactor) (*OptimismMintableERC20FactoryTransactor, error) { + contract, err := bindOptimismMintableERC20Factory(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &OptimismMintableERC20FactoryTransactor{contract: contract}, nil +} + +// NewOptimismMintableERC20FactoryFilterer creates a new log filterer instance of OptimismMintableERC20Factory, bound to a specific deployed contract. +func NewOptimismMintableERC20FactoryFilterer(address common.Address, filterer bind.ContractFilterer) (*OptimismMintableERC20FactoryFilterer, error) { + contract, err := bindOptimismMintableERC20Factory(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &OptimismMintableERC20FactoryFilterer{contract: contract}, nil +} + +// bindOptimismMintableERC20Factory binds a generic wrapper to an already deployed contract. +func bindOptimismMintableERC20Factory(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(OptimismMintableERC20FactoryABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_OptimismMintableERC20Factory *OptimismMintableERC20FactoryRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _OptimismMintableERC20Factory.Contract.OptimismMintableERC20FactoryCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_OptimismMintableERC20Factory *OptimismMintableERC20FactoryRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OptimismMintableERC20Factory.Contract.OptimismMintableERC20FactoryTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_OptimismMintableERC20Factory *OptimismMintableERC20FactoryRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _OptimismMintableERC20Factory.Contract.OptimismMintableERC20FactoryTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_OptimismMintableERC20Factory *OptimismMintableERC20FactoryCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _OptimismMintableERC20Factory.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_OptimismMintableERC20Factory *OptimismMintableERC20FactoryTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OptimismMintableERC20Factory.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_OptimismMintableERC20Factory *OptimismMintableERC20FactoryTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _OptimismMintableERC20Factory.Contract.contract.Transact(opts, method, params...) +} + +// BRIDGE is a free data retrieval call binding the contract method 0xee9a31a2. +// +// Solidity: function BRIDGE() view returns(address) +func (_OptimismMintableERC20Factory *OptimismMintableERC20FactoryCaller) BRIDGE(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _OptimismMintableERC20Factory.contract.Call(opts, &out, "BRIDGE") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// BRIDGE is a free data retrieval call binding the contract method 0xee9a31a2. +// +// Solidity: function BRIDGE() view returns(address) +func (_OptimismMintableERC20Factory *OptimismMintableERC20FactorySession) BRIDGE() (common.Address, error) { + return _OptimismMintableERC20Factory.Contract.BRIDGE(&_OptimismMintableERC20Factory.CallOpts) +} + +// BRIDGE is a free data retrieval call binding the contract method 0xee9a31a2. +// +// Solidity: function BRIDGE() view returns(address) +func (_OptimismMintableERC20Factory *OptimismMintableERC20FactoryCallerSession) BRIDGE() (common.Address, error) { + return _OptimismMintableERC20Factory.Contract.BRIDGE(&_OptimismMintableERC20Factory.CallOpts) +} + +// Bridge is a free data retrieval call binding the contract method 0xe78cea92. +// +// Solidity: function bridge() view returns(address) +func (_OptimismMintableERC20Factory *OptimismMintableERC20FactoryCaller) Bridge(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _OptimismMintableERC20Factory.contract.Call(opts, &out, "bridge") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Bridge is a free data retrieval call binding the contract method 0xe78cea92. +// +// Solidity: function bridge() view returns(address) +func (_OptimismMintableERC20Factory *OptimismMintableERC20FactorySession) Bridge() (common.Address, error) { + return _OptimismMintableERC20Factory.Contract.Bridge(&_OptimismMintableERC20Factory.CallOpts) +} + +// Bridge is a free data retrieval call binding the contract method 0xe78cea92. +// +// Solidity: function bridge() view returns(address) +func (_OptimismMintableERC20Factory *OptimismMintableERC20FactoryCallerSession) Bridge() (common.Address, error) { + return _OptimismMintableERC20Factory.Contract.Bridge(&_OptimismMintableERC20Factory.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_OptimismMintableERC20Factory *OptimismMintableERC20FactoryCaller) Version(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _OptimismMintableERC20Factory.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 (_OptimismMintableERC20Factory *OptimismMintableERC20FactorySession) Version() (string, error) { + return _OptimismMintableERC20Factory.Contract.Version(&_OptimismMintableERC20Factory.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_OptimismMintableERC20Factory *OptimismMintableERC20FactoryCallerSession) Version() (string, error) { + return _OptimismMintableERC20Factory.Contract.Version(&_OptimismMintableERC20Factory.CallOpts) +} + +// CreateOptimismMintableERC20 is a paid mutator transaction binding the contract method 0xce5ac90f. +// +// Solidity: function createOptimismMintableERC20(address _remoteToken, string _name, string _symbol) returns(address) +func (_OptimismMintableERC20Factory *OptimismMintableERC20FactoryTransactor) CreateOptimismMintableERC20(opts *bind.TransactOpts, _remoteToken common.Address, _name string, _symbol string) (*types.Transaction, error) { + return _OptimismMintableERC20Factory.contract.Transact(opts, "createOptimismMintableERC20", _remoteToken, _name, _symbol) +} + +// CreateOptimismMintableERC20 is a paid mutator transaction binding the contract method 0xce5ac90f. +// +// Solidity: function createOptimismMintableERC20(address _remoteToken, string _name, string _symbol) returns(address) +func (_OptimismMintableERC20Factory *OptimismMintableERC20FactorySession) CreateOptimismMintableERC20(_remoteToken common.Address, _name string, _symbol string) (*types.Transaction, error) { + return _OptimismMintableERC20Factory.Contract.CreateOptimismMintableERC20(&_OptimismMintableERC20Factory.TransactOpts, _remoteToken, _name, _symbol) +} + +// CreateOptimismMintableERC20 is a paid mutator transaction binding the contract method 0xce5ac90f. +// +// Solidity: function createOptimismMintableERC20(address _remoteToken, string _name, string _symbol) returns(address) +func (_OptimismMintableERC20Factory *OptimismMintableERC20FactoryTransactorSession) CreateOptimismMintableERC20(_remoteToken common.Address, _name string, _symbol string) (*types.Transaction, error) { + return _OptimismMintableERC20Factory.Contract.CreateOptimismMintableERC20(&_OptimismMintableERC20Factory.TransactOpts, _remoteToken, _name, _symbol) +} + +// CreateOptimismMintableERC20WithDecimals is a paid mutator transaction binding the contract method 0x8cf0629c. +// +// Solidity: function createOptimismMintableERC20WithDecimals(address _remoteToken, string _name, string _symbol, uint8 _decimals) returns(address) +func (_OptimismMintableERC20Factory *OptimismMintableERC20FactoryTransactor) CreateOptimismMintableERC20WithDecimals(opts *bind.TransactOpts, _remoteToken common.Address, _name string, _symbol string, _decimals uint8) (*types.Transaction, error) { + return _OptimismMintableERC20Factory.contract.Transact(opts, "createOptimismMintableERC20WithDecimals", _remoteToken, _name, _symbol, _decimals) +} + +// CreateOptimismMintableERC20WithDecimals is a paid mutator transaction binding the contract method 0x8cf0629c. +// +// Solidity: function createOptimismMintableERC20WithDecimals(address _remoteToken, string _name, string _symbol, uint8 _decimals) returns(address) +func (_OptimismMintableERC20Factory *OptimismMintableERC20FactorySession) CreateOptimismMintableERC20WithDecimals(_remoteToken common.Address, _name string, _symbol string, _decimals uint8) (*types.Transaction, error) { + return _OptimismMintableERC20Factory.Contract.CreateOptimismMintableERC20WithDecimals(&_OptimismMintableERC20Factory.TransactOpts, _remoteToken, _name, _symbol, _decimals) +} + +// CreateOptimismMintableERC20WithDecimals is a paid mutator transaction binding the contract method 0x8cf0629c. +// +// Solidity: function createOptimismMintableERC20WithDecimals(address _remoteToken, string _name, string _symbol, uint8 _decimals) returns(address) +func (_OptimismMintableERC20Factory *OptimismMintableERC20FactoryTransactorSession) CreateOptimismMintableERC20WithDecimals(_remoteToken common.Address, _name string, _symbol string, _decimals uint8) (*types.Transaction, error) { + return _OptimismMintableERC20Factory.Contract.CreateOptimismMintableERC20WithDecimals(&_OptimismMintableERC20Factory.TransactOpts, _remoteToken, _name, _symbol, _decimals) +} + +// CreateStandardL2Token is a paid mutator transaction binding the contract method 0x896f93d1. +// +// Solidity: function createStandardL2Token(address _remoteToken, string _name, string _symbol) returns(address) +func (_OptimismMintableERC20Factory *OptimismMintableERC20FactoryTransactor) CreateStandardL2Token(opts *bind.TransactOpts, _remoteToken common.Address, _name string, _symbol string) (*types.Transaction, error) { + return _OptimismMintableERC20Factory.contract.Transact(opts, "createStandardL2Token", _remoteToken, _name, _symbol) +} + +// CreateStandardL2Token is a paid mutator transaction binding the contract method 0x896f93d1. +// +// Solidity: function createStandardL2Token(address _remoteToken, string _name, string _symbol) returns(address) +func (_OptimismMintableERC20Factory *OptimismMintableERC20FactorySession) CreateStandardL2Token(_remoteToken common.Address, _name string, _symbol string) (*types.Transaction, error) { + return _OptimismMintableERC20Factory.Contract.CreateStandardL2Token(&_OptimismMintableERC20Factory.TransactOpts, _remoteToken, _name, _symbol) +} + +// CreateStandardL2Token is a paid mutator transaction binding the contract method 0x896f93d1. +// +// Solidity: function createStandardL2Token(address _remoteToken, string _name, string _symbol) returns(address) +func (_OptimismMintableERC20Factory *OptimismMintableERC20FactoryTransactorSession) CreateStandardL2Token(_remoteToken common.Address, _name string, _symbol string) (*types.Transaction, error) { + return _OptimismMintableERC20Factory.Contract.CreateStandardL2Token(&_OptimismMintableERC20Factory.TransactOpts, _remoteToken, _name, _symbol) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. +// +// Solidity: function initialize(address _bridge) returns() +func (_OptimismMintableERC20Factory *OptimismMintableERC20FactoryTransactor) Initialize(opts *bind.TransactOpts, _bridge common.Address) (*types.Transaction, error) { + return _OptimismMintableERC20Factory.contract.Transact(opts, "initialize", _bridge) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. +// +// Solidity: function initialize(address _bridge) returns() +func (_OptimismMintableERC20Factory *OptimismMintableERC20FactorySession) Initialize(_bridge common.Address) (*types.Transaction, error) { + return _OptimismMintableERC20Factory.Contract.Initialize(&_OptimismMintableERC20Factory.TransactOpts, _bridge) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. +// +// Solidity: function initialize(address _bridge) returns() +func (_OptimismMintableERC20Factory *OptimismMintableERC20FactoryTransactorSession) Initialize(_bridge common.Address) (*types.Transaction, error) { + return _OptimismMintableERC20Factory.Contract.Initialize(&_OptimismMintableERC20Factory.TransactOpts, _bridge) +} + +// OptimismMintableERC20FactoryInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the OptimismMintableERC20Factory contract. +type OptimismMintableERC20FactoryInitializedIterator struct { + Event *OptimismMintableERC20FactoryInitialized // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *OptimismMintableERC20FactoryInitializedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(OptimismMintableERC20FactoryInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(OptimismMintableERC20FactoryInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *OptimismMintableERC20FactoryInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *OptimismMintableERC20FactoryInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// OptimismMintableERC20FactoryInitialized represents a Initialized event raised by the OptimismMintableERC20Factory contract. +type OptimismMintableERC20FactoryInitialized struct { + Version uint8 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_OptimismMintableERC20Factory *OptimismMintableERC20FactoryFilterer) FilterInitialized(opts *bind.FilterOpts) (*OptimismMintableERC20FactoryInitializedIterator, error) { + + logs, sub, err := _OptimismMintableERC20Factory.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &OptimismMintableERC20FactoryInitializedIterator{contract: _OptimismMintableERC20Factory.contract, event: "Initialized", logs: logs, sub: sub}, nil +} + +// WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_OptimismMintableERC20Factory *OptimismMintableERC20FactoryFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *OptimismMintableERC20FactoryInitialized) (event.Subscription, error) { + + logs, sub, err := _OptimismMintableERC20Factory.contract.WatchLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(OptimismMintableERC20FactoryInitialized) + if err := _OptimismMintableERC20Factory.contract.UnpackLog(event, "Initialized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_OptimismMintableERC20Factory *OptimismMintableERC20FactoryFilterer) ParseInitialized(log types.Log) (*OptimismMintableERC20FactoryInitialized, error) { + event := new(OptimismMintableERC20FactoryInitialized) + if err := _OptimismMintableERC20Factory.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// OptimismMintableERC20FactoryOptimismMintableERC20CreatedIterator is returned from FilterOptimismMintableERC20Created and is used to iterate over the raw logs and unpacked data for OptimismMintableERC20Created events raised by the OptimismMintableERC20Factory contract. +type OptimismMintableERC20FactoryOptimismMintableERC20CreatedIterator struct { + Event *OptimismMintableERC20FactoryOptimismMintableERC20Created // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *OptimismMintableERC20FactoryOptimismMintableERC20CreatedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(OptimismMintableERC20FactoryOptimismMintableERC20Created) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(OptimismMintableERC20FactoryOptimismMintableERC20Created) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *OptimismMintableERC20FactoryOptimismMintableERC20CreatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *OptimismMintableERC20FactoryOptimismMintableERC20CreatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// OptimismMintableERC20FactoryOptimismMintableERC20Created represents a OptimismMintableERC20Created event raised by the OptimismMintableERC20Factory contract. +type OptimismMintableERC20FactoryOptimismMintableERC20Created struct { + LocalToken common.Address + RemoteToken common.Address + Deployer common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOptimismMintableERC20Created is a free log retrieval operation binding the contract event 0x52fe89dd5930f343d25650b62fd367bae47088bcddffd2a88350a6ecdd620cdb. +// +// Solidity: event OptimismMintableERC20Created(address indexed localToken, address indexed remoteToken, address deployer) +func (_OptimismMintableERC20Factory *OptimismMintableERC20FactoryFilterer) FilterOptimismMintableERC20Created(opts *bind.FilterOpts, localToken []common.Address, remoteToken []common.Address) (*OptimismMintableERC20FactoryOptimismMintableERC20CreatedIterator, error) { + + var localTokenRule []interface{} + for _, localTokenItem := range localToken { + localTokenRule = append(localTokenRule, localTokenItem) + } + var remoteTokenRule []interface{} + for _, remoteTokenItem := range remoteToken { + remoteTokenRule = append(remoteTokenRule, remoteTokenItem) + } + + logs, sub, err := _OptimismMintableERC20Factory.contract.FilterLogs(opts, "OptimismMintableERC20Created", localTokenRule, remoteTokenRule) + if err != nil { + return nil, err + } + return &OptimismMintableERC20FactoryOptimismMintableERC20CreatedIterator{contract: _OptimismMintableERC20Factory.contract, event: "OptimismMintableERC20Created", logs: logs, sub: sub}, nil +} + +// WatchOptimismMintableERC20Created is a free log subscription operation binding the contract event 0x52fe89dd5930f343d25650b62fd367bae47088bcddffd2a88350a6ecdd620cdb. +// +// Solidity: event OptimismMintableERC20Created(address indexed localToken, address indexed remoteToken, address deployer) +func (_OptimismMintableERC20Factory *OptimismMintableERC20FactoryFilterer) WatchOptimismMintableERC20Created(opts *bind.WatchOpts, sink chan<- *OptimismMintableERC20FactoryOptimismMintableERC20Created, localToken []common.Address, remoteToken []common.Address) (event.Subscription, error) { + + var localTokenRule []interface{} + for _, localTokenItem := range localToken { + localTokenRule = append(localTokenRule, localTokenItem) + } + var remoteTokenRule []interface{} + for _, remoteTokenItem := range remoteToken { + remoteTokenRule = append(remoteTokenRule, remoteTokenItem) + } + + logs, sub, err := _OptimismMintableERC20Factory.contract.WatchLogs(opts, "OptimismMintableERC20Created", localTokenRule, remoteTokenRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(OptimismMintableERC20FactoryOptimismMintableERC20Created) + if err := _OptimismMintableERC20Factory.contract.UnpackLog(event, "OptimismMintableERC20Created", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseOptimismMintableERC20Created is a log parse operation binding the contract event 0x52fe89dd5930f343d25650b62fd367bae47088bcddffd2a88350a6ecdd620cdb. +// +// Solidity: event OptimismMintableERC20Created(address indexed localToken, address indexed remoteToken, address deployer) +func (_OptimismMintableERC20Factory *OptimismMintableERC20FactoryFilterer) ParseOptimismMintableERC20Created(log types.Log) (*OptimismMintableERC20FactoryOptimismMintableERC20Created, error) { + event := new(OptimismMintableERC20FactoryOptimismMintableERC20Created) + if err := _OptimismMintableERC20Factory.contract.UnpackLog(event, "OptimismMintableERC20Created", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// OptimismMintableERC20FactoryStandardL2TokenCreatedIterator is returned from FilterStandardL2TokenCreated and is used to iterate over the raw logs and unpacked data for StandardL2TokenCreated events raised by the OptimismMintableERC20Factory contract. +type OptimismMintableERC20FactoryStandardL2TokenCreatedIterator struct { + Event *OptimismMintableERC20FactoryStandardL2TokenCreated // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *OptimismMintableERC20FactoryStandardL2TokenCreatedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(OptimismMintableERC20FactoryStandardL2TokenCreated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(OptimismMintableERC20FactoryStandardL2TokenCreated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *OptimismMintableERC20FactoryStandardL2TokenCreatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *OptimismMintableERC20FactoryStandardL2TokenCreatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// OptimismMintableERC20FactoryStandardL2TokenCreated represents a StandardL2TokenCreated event raised by the OptimismMintableERC20Factory contract. +type OptimismMintableERC20FactoryStandardL2TokenCreated struct { + RemoteToken common.Address + LocalToken common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterStandardL2TokenCreated is a free log retrieval operation binding the contract event 0xceeb8e7d520d7f3b65fc11a262b91066940193b05d4f93df07cfdced0eb551cf. +// +// Solidity: event StandardL2TokenCreated(address indexed remoteToken, address indexed localToken) +func (_OptimismMintableERC20Factory *OptimismMintableERC20FactoryFilterer) FilterStandardL2TokenCreated(opts *bind.FilterOpts, remoteToken []common.Address, localToken []common.Address) (*OptimismMintableERC20FactoryStandardL2TokenCreatedIterator, error) { + + var remoteTokenRule []interface{} + for _, remoteTokenItem := range remoteToken { + remoteTokenRule = append(remoteTokenRule, remoteTokenItem) + } + var localTokenRule []interface{} + for _, localTokenItem := range localToken { + localTokenRule = append(localTokenRule, localTokenItem) + } + + logs, sub, err := _OptimismMintableERC20Factory.contract.FilterLogs(opts, "StandardL2TokenCreated", remoteTokenRule, localTokenRule) + if err != nil { + return nil, err + } + return &OptimismMintableERC20FactoryStandardL2TokenCreatedIterator{contract: _OptimismMintableERC20Factory.contract, event: "StandardL2TokenCreated", logs: logs, sub: sub}, nil +} + +// WatchStandardL2TokenCreated is a free log subscription operation binding the contract event 0xceeb8e7d520d7f3b65fc11a262b91066940193b05d4f93df07cfdced0eb551cf. +// +// Solidity: event StandardL2TokenCreated(address indexed remoteToken, address indexed localToken) +func (_OptimismMintableERC20Factory *OptimismMintableERC20FactoryFilterer) WatchStandardL2TokenCreated(opts *bind.WatchOpts, sink chan<- *OptimismMintableERC20FactoryStandardL2TokenCreated, remoteToken []common.Address, localToken []common.Address) (event.Subscription, error) { + + var remoteTokenRule []interface{} + for _, remoteTokenItem := range remoteToken { + remoteTokenRule = append(remoteTokenRule, remoteTokenItem) + } + var localTokenRule []interface{} + for _, localTokenItem := range localToken { + localTokenRule = append(localTokenRule, localTokenItem) + } + + logs, sub, err := _OptimismMintableERC20Factory.contract.WatchLogs(opts, "StandardL2TokenCreated", remoteTokenRule, localTokenRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(OptimismMintableERC20FactoryStandardL2TokenCreated) + if err := _OptimismMintableERC20Factory.contract.UnpackLog(event, "StandardL2TokenCreated", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseStandardL2TokenCreated is a log parse operation binding the contract event 0xceeb8e7d520d7f3b65fc11a262b91066940193b05d4f93df07cfdced0eb551cf. +// +// Solidity: event StandardL2TokenCreated(address indexed remoteToken, address indexed localToken) +func (_OptimismMintableERC20Factory *OptimismMintableERC20FactoryFilterer) ParseStandardL2TokenCreated(log types.Log) (*OptimismMintableERC20FactoryStandardL2TokenCreated, error) { + event := new(OptimismMintableERC20FactoryStandardL2TokenCreated) + if err := _OptimismMintableERC20Factory.contract.UnpackLog(event, "StandardL2TokenCreated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/op-e2e2/bindings/optimismmintableerc721factory.go b/op-e2e2/bindings/optimismmintableerc721factory.go new file mode 100644 index 000000000000..3870b184f6f1 --- /dev/null +++ b/op-e2e2/bindings/optimismmintableerc721factory.go @@ -0,0 +1,501 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// OptimismMintableERC721FactoryMetaData contains all meta data concerning the OptimismMintableERC721Factory contract. +var OptimismMintableERC721FactoryMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_bridge\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_remoteChainId\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"BRIDGE\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"REMOTE_CHAIN_ID\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"createOptimismMintableERC721\",\"inputs\":[{\"name\":\"_remoteToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_name\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"_symbol\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"isOptimismMintableERC721\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"OptimismMintableERC721Created\",\"inputs\":[{\"name\":\"localToken\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"remoteToken\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"deployer\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false}]", + Bin: "0x60c060405234801561001057600080fd5b5060405161392638038061392683398101604081905261002f91610045565b6001600160a01b0390911660805260a05261007f565b6000806040838503121561005857600080fd5b82516001600160a01b038116811461006f57600080fd5b6020939093015192949293505050565b60805160a0516138746100b26000396000818161010601526102c401526000818161017a01526102a301526138746000f3fe60806040523480156200001157600080fd5b50600436106200006f5760003560e01c80637d1d0c5b11620000565780637d1d0c5b1462000100578063d97df6521462000137578063ee9a31a2146200017457600080fd5b806354fd4d5014620000745780635572acae14620000c9575b600080fd5b620000b16040518060400160405280600581526020017f312e342e3000000000000000000000000000000000000000000000000000000081525081565b604051620000c0919062000435565b60405180910390f35b620000ef620000da3660046200047b565b60006020819052908152604090205460ff1681565b6040519015158152602001620000c0565b620001287f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001620000c0565b6200014e620001483660046200057b565b6200019c565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001620000c0565b6200014e7f000000000000000000000000000000000000000000000000000000000000000081565b600073ffffffffffffffffffffffffffffffffffffffff84166200026d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526044602482018190527f4f7074696d69736d4d696e7461626c65455243373231466163746f72793a204c908201527f3120746f6b656e20616464726573732063616e6e6f742062652061646472657360648201527f7328302900000000000000000000000000000000000000000000000000000000608482015260a40160405180910390fd5b60008484846040516020016200028693929190620005f8565b6040516020818303038152906040528051906020012090506000817f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000888888604051620002f490620003b9565b6200030495949392919062000647565b8190604051809103906000f590508015801562000325573d6000803e3d6000fd5b5073ffffffffffffffffffffffffffffffffffffffff8181166000818152602081815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905590513381529394509189169290917fe72783bb8e0ca31286b85278da59684dd814df9762a52f0837f89edd1483b299910160405180910390a395945050505050565b6131bf80620006a983390190565b6000815180845260005b81811015620003ef57602081850181015186830182015201620003d1565b8181111562000402576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006200044a6020830184620003c7565b9392505050565b803573ffffffffffffffffffffffffffffffffffffffff811681146200047657600080fd5b919050565b6000602082840312156200048e57600080fd5b6200044a8262000451565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f830112620004da57600080fd5b813567ffffffffffffffff80821115620004f857620004f862000499565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190828211818310171562000541576200054162000499565b816040528381528660208588010111156200055b57600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806000606084860312156200059157600080fd5b6200059c8462000451565b9250602084013567ffffffffffffffff80821115620005ba57600080fd5b620005c887838801620004c8565b93506040860135915080821115620005df57600080fd5b50620005ee86828701620004c8565b9150509250925092565b73ffffffffffffffffffffffffffffffffffffffff84168152606060208201526000620006296060830185620003c7565b82810360408401526200063d8185620003c7565b9695505050505050565b600073ffffffffffffffffffffffffffffffffffffffff808816835286602084015280861660408401525060a060608301526200068860a0830185620003c7565b82810360808401526200069c8185620003c7565b9897505050505050505056fe60e06040523480156200001157600080fd5b50604051620031bf380380620031bf83398101604081905262000034916200062d565b8181600062000044838262000756565b50600162000053828262000756565b5050506001600160a01b038516620000d85760405162461bcd60e51b815260206004820152603360248201527f4f7074696d69736d4d696e7461626c654552433732313a20627269646765206360448201527f616e6e6f7420626520616464726573732830290000000000000000000000000060648201526084015b60405180910390fd5b83600003620001505760405162461bcd60e51b815260206004820152603660248201527f4f7074696d69736d4d696e7461626c654552433732313a2072656d6f7465206360448201527f6861696e2069642063616e6e6f74206265207a65726f000000000000000000006064820152608401620000cf565b6001600160a01b038316620001ce5760405162461bcd60e51b815260206004820152603960248201527f4f7074696d69736d4d696e7461626c654552433732313a2072656d6f7465207460448201527f6f6b656e2063616e6e6f742062652061646472657373283029000000000000006064820152608401620000cf565b60808490526001600160a01b0383811660a081905290861660c0526200020290601462000256602090811b62000eed17901c565b62000218856200041660201b620011301760201c565b6040516020016200022b92919062000822565b604051602081830303815290604052600a90816200024a919062000756565b50505050505062000993565b6060600062000267836002620008ac565b62000274906002620008ce565b6001600160401b038111156200028e576200028e62000553565b6040519080825280601f01601f191660200182016040528015620002b9576020820181803683370190505b509050600360fc1b81600081518110620002d757620002d7620008e9565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110620003095762000309620008e9565b60200101906001600160f81b031916908160001a90535060006200032f846002620008ac565b6200033c906001620008ce565b90505b6001811115620003be576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110620003745762000374620008e9565b1a60f81b8282815181106200038d576200038d620008e9565b60200101906001600160f81b031916908160001a90535060049490941c93620003b681620008ff565b90506200033f565b5083156200040f5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401620000cf565b9392505050565b6060816000036200043e5750506040805180820190915260018152600360fc1b602082015290565b8160005b81156200046e5780620004558162000919565b9150620004669050600a836200094b565b915062000442565b6000816001600160401b038111156200048b576200048b62000553565b6040519080825280601f01601f191660200182016040528015620004b6576020820181803683370190505b5090505b84156200052e57620004ce60018362000962565b9150620004dd600a866200097c565b620004ea906030620008ce565b60f81b818381518110620005025762000502620008e9565b60200101906001600160f81b031916908160001a90535062000526600a866200094b565b9450620004ba565b949350505050565b80516001600160a01b03811681146200054e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620005865781810151838201526020016200056c565b8381111562000596576000848401525b50505050565b600082601f830112620005ae57600080fd5b81516001600160401b0380821115620005cb57620005cb62000553565b604051601f8301601f19908116603f01168101908282118183101715620005f657620005f662000553565b816040528381528660208588010111156200061057600080fd5b6200062384602083016020890162000569565b9695505050505050565b600080600080600060a086880312156200064657600080fd5b620006518662000536565b945060208601519350620006686040870162000536565b60608701519093506001600160401b03808211156200068657600080fd5b6200069489838a016200059c565b93506080880151915080821115620006ab57600080fd5b50620006ba888289016200059c565b9150509295509295909350565b600181811c90821680620006dc57607f821691505b602082108103620006fd57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200075157600081815260208120601f850160051c810160208610156200072c5750805b601f850160051c820191505b818110156200074d5782815560010162000738565b5050505b505050565b81516001600160401b0381111562000772576200077262000553565b6200078a81620007838454620006c7565b8462000703565b602080601f831160018114620007c25760008415620007a95750858301515b600019600386901b1c1916600185901b1785556200074d565b600085815260208120601f198616915b82811015620007f357888601518255948401946001909101908401620007d2565b5085821015620008125787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6832ba3432b932bab69d60b91b8152600083516200084881600985016020880162000569565b600160fe1b60099184019182015283516200086b81600a84016020880162000569565b712f746f6b656e5552493f75696e743235363d60701b600a9290910191820152601c01949350505050565b634e487b7160e01b600052601160045260246000fd5b6000816000190483118215151615620008c957620008c962000896565b500290565b60008219821115620008e457620008e462000896565b500190565b634e487b7160e01b600052603260045260246000fd5b60008162000911576200091162000896565b506000190190565b6000600182016200092e576200092e62000896565b5060010190565b634e487b7160e01b600052601260045260246000fd5b6000826200095d576200095d62000935565b500490565b60008282101562000977576200097762000896565b500390565b6000826200098e576200098e62000935565b500690565b60805160a05160c0516127d9620009e6600039600081816103e20152818161047a01528181610b210152610c430152600081816101e001526103bc015260008181610329015261040801526127d96000f3fe608060405234801561001057600080fd5b50600436106101ae5760003560e01c80637d1d0c5b116100ee578063c87b56dd11610097578063e78cea9211610071578063e78cea92146103e0578063e951819614610406578063e985e9c51461042c578063ee9a31a21461047557600080fd5b8063c87b56dd1461039f578063d547cfb7146103b2578063d6c0b2c4146103ba57600080fd5b8063a1448194116100c8578063a144819414610366578063a22cb46514610379578063b88d4fde1461038c57600080fd5b80637d1d0c5b1461032457806395d89b411461034b5780639dc29fac1461035357600080fd5b806323b872dd1161015b5780634f6ccce7116101355780634f6ccce7146102af57806354fd4d50146102c25780636352211e146102fe57806370a082311461031157600080fd5b806323b872dd146102765780632f745c591461028957806342842e0e1461029c57600080fd5b8063081812fc1161018c578063081812fc1461023c578063095ea7b31461024f57806318160ddd1461026457600080fd5b806301ffc9a7146101b3578063033964be146101db57806306fdde0314610227575b600080fd5b6101c66101c1366004612226565b61049c565b60405190151581526020015b60405180910390f35b6102027f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101d2565b61022f6104fa565b6040516101d291906122b9565b61020261024a3660046122cc565b61058c565b61026261025d36600461230e565b6105c0565b005b6008545b6040519081526020016101d2565b610262610284366004612338565b610751565b61026861029736600461230e565b6107f2565b6102626102aa366004612338565b6108c1565b6102686102bd3660046122cc565b6108dc565b61022f6040518060400160405280600581526020017f312e332e3000000000000000000000000000000000000000000000000000000081525081565b61020261030c3660046122cc565b61099a565b61026861031f366004612374565b610a2c565b6102687f000000000000000000000000000000000000000000000000000000000000000081565b61022f610afa565b61026261036136600461230e565b610b09565b61026261037436600461230e565b610c2b565b61026261038736600461238f565b610d42565b61026261039a3660046123fa565b610d51565b61022f6103ad3660046122cc565b610df9565b61022f610e5f565b7f0000000000000000000000000000000000000000000000000000000000000000610202565b7f0000000000000000000000000000000000000000000000000000000000000000610202565b7f0000000000000000000000000000000000000000000000000000000000000000610268565b6101c661043a3660046124f4565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260056020908152604080832093909416825291909152205460ff1690565b6102027f000000000000000000000000000000000000000000000000000000000000000081565b60007f74259ebf000000000000000000000000000000000000000000000000000000007fffffffff0000000000000000000000000000000000000000000000000000000083168114806104f357506104f38361126d565b9392505050565b60606000805461050990612527565b80601f016020809104026020016040519081016040528092919081815260200182805461053590612527565b80156105825780601f1061055757610100808354040283529160200191610582565b820191906000526020600020905b81548152906001019060200180831161056557829003601f168201915b5050505050905090565b6000610597826112c3565b5060009081526004602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b60006105cb8261099a565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361068d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f720000000000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff821614806106b657506106b6813361043a565b610742576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c00006064820152608401610684565b61074c8383611351565b505050565b61075b33826113f1565b6107e7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206e6f7220617070726f7665640000000000000000000000000000000000006064820152608401610684565b61074c8383836114b0565b60006107fd83610a2c565b821061088b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201527f74206f6620626f756e64730000000000000000000000000000000000000000006064820152608401610684565b5073ffffffffffffffffffffffffffffffffffffffff919091166000908152600660209081526040808320938352929052205490565b61074c83838360405180602001604052806000815250610d51565b60006108e760085490565b8210610975576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201527f7574206f6620626f756e647300000000000000000000000000000000000000006064820152608401610684565b600882815481106109885761098861257a565b90600052602060002001549050919050565b60008181526002602052604081205473ffffffffffffffffffffffffffffffffffffffff1680610a26576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610684565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff8216610ad1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f74206120766160448201527f6c6964206f776e657200000000000000000000000000000000000000000000006064820152608401610684565b5073ffffffffffffffffffffffffffffffffffffffff1660009081526003602052604090205490565b60606001805461050990612527565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610bce576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f4f7074696d69736d4d696e7461626c654552433732313a206f6e6c792062726960448201527f6467652063616e2063616c6c20746869732066756e6374696f6e0000000000006064820152608401610684565b610bd781611722565b8173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca582604051610c1f91815260200190565b60405180910390a25050565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610cf0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f4f7074696d69736d4d696e7461626c654552433732313a206f6e6c792062726960448201527f6467652063616e2063616c6c20746869732066756e6374696f6e0000000000006064820152608401610684565b610cfa82826117fb565b8173ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688582604051610c1f91815260200190565b610d4d338383611815565b5050565b610d5b33836113f1565b610de7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206e6f7220617070726f7665640000000000000000000000000000000000006064820152608401610684565b610df384848484611942565b50505050565b6060610e04826112c3565b6000610e0e6119e5565b90506000815111610e2e57604051806020016040528060008152506104f3565b80610e3884611130565b604051602001610e499291906125a9565b6040516020818303038152906040529392505050565b600a8054610e6c90612527565b80601f0160208091040260200160405190810160405280929190818152602001828054610e9890612527565b8015610ee55780601f10610eba57610100808354040283529160200191610ee5565b820191906000526020600020905b815481529060010190602001808311610ec857829003601f168201915b505050505081565b60606000610efc836002612607565b610f07906002612644565b67ffffffffffffffff811115610f1f57610f1f6123cb565b6040519080825280601f01601f191660200182016040528015610f49576020820181803683370190505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110610f8057610f8061257a565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110610fe357610fe361257a565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600061101f846002612607565b61102a906001612644565b90505b60018111156110c7577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061106b5761106b61257a565b1a60f81b8282815181106110815761108161257a565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c936110c08161265c565b905061102d565b5083156104f3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610684565b60608160000361117357505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b811561119d578061118781612691565b91506111969050600a836126f8565b9150611177565b60008167ffffffffffffffff8111156111b8576111b86123cb565b6040519080825280601f01601f1916602001820160405280156111e2576020820181803683370190505b5090505b8415611265576111f760018361270c565b9150611204600a86612723565b61120f906030612644565b60f81b8183815181106112245761122461257a565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535061125e600a866126f8565b94506111e6565b949350505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f780e9d63000000000000000000000000000000000000000000000000000000001480610a265750610a26826119f4565b60008181526002602052604090205473ffffffffffffffffffffffffffffffffffffffff1661134e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610684565b50565b600081815260046020526040902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff841690811790915581906113ab8261099a565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000806113fd8361099a565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148061146b575073ffffffffffffffffffffffffffffffffffffffff80821660009081526005602090815260408083209388168352929052205460ff165b8061126557508373ffffffffffffffffffffffffffffffffffffffff166114918461058c565b73ffffffffffffffffffffffffffffffffffffffff1614949350505050565b8273ffffffffffffffffffffffffffffffffffffffff166114d08261099a565b73ffffffffffffffffffffffffffffffffffffffff1614611573576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201527f6f776e65720000000000000000000000000000000000000000000000000000006064820152608401610684565b73ffffffffffffffffffffffffffffffffffffffff8216611615576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610684565b611620838383611ad7565b61162b600082611351565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260036020526040812080546001929061166190849061270c565b909155505073ffffffffffffffffffffffffffffffffffffffff8216600090815260036020526040812080546001929061169c908490612644565b909155505060008181526002602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff86811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600061172d8261099a565b905061173b81600084611ad7565b611746600083611351565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260036020526040812080546001929061177c90849061270c565b909155505060008281526002602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001690555183919073ffffffffffffffffffffffffffffffffffffffff8416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b610d4d828260405180602001604052806000815250611bdd565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036118aa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610684565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526005602090815260408083209487168084529482529182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b61194d8484846114b0565b61195984848484611c80565b610df3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610684565b6060600a805461050990612527565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f80ac58cd000000000000000000000000000000000000000000000000000000001480611a8757507fffffffff0000000000000000000000000000000000000000000000000000000082167f5b5e139f00000000000000000000000000000000000000000000000000000000145b80610a2657507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610a26565b73ffffffffffffffffffffffffffffffffffffffff8316611b3f57611b3a81600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b611b7c565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611b7c57611b7c8382611e73565b73ffffffffffffffffffffffffffffffffffffffff8216611ba05761074c81611f2a565b8273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161461074c5761074c8282611fd9565b611be7838361202a565b611bf46000848484611c80565b61074c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610684565b600073ffffffffffffffffffffffffffffffffffffffff84163b15611e68576040517f150b7a0200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85169063150b7a0290611cf7903390899088908890600401612737565b6020604051808303816000875af1925050508015611d50575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252611d4d91810190612780565b60015b611e1d573d808015611d7e576040519150601f19603f3d011682016040523d82523d6000602084013e611d83565b606091505b508051600003611e15576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610684565b805181602001fd5b7fffffffff00000000000000000000000000000000000000000000000000000000167f150b7a0200000000000000000000000000000000000000000000000000000000149050611265565b506001949350505050565b60006001611e8084610a2c565b611e8a919061270c565b600083815260076020526040902054909150808214611eea5773ffffffffffffffffffffffffffffffffffffffff841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b50600091825260076020908152604080842084905573ffffffffffffffffffffffffffffffffffffffff9094168352600681528383209183525290812055565b600854600090611f3c9060019061270c565b60008381526009602052604081205460088054939450909284908110611f6457611f6461257a565b906000526020600020015490508060088381548110611f8557611f8561257a565b6000918252602080832090910192909255828152600990915260408082208490558582528120556008805480611fbd57611fbd61279d565b6001900381819060005260206000200160009055905550505050565b6000611fe483610a2c565b73ffffffffffffffffffffffffffffffffffffffff9093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b73ffffffffffffffffffffffffffffffffffffffff82166120a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610684565b60008181526002602052604090205473ffffffffffffffffffffffffffffffffffffffff1615612133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610684565b61213f60008383611ad7565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600360205260408120805460019290612175908490612644565b909155505060008181526002602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b7fffffffff000000000000000000000000000000000000000000000000000000008116811461134e57600080fd5b60006020828403121561223857600080fd5b81356104f3816121f8565b60005b8381101561225e578181015183820152602001612246565b83811115610df35750506000910152565b60008151808452612287816020860160208601612243565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006104f3602083018461226f565b6000602082840312156122de57600080fd5b5035919050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461230957600080fd5b919050565b6000806040838503121561232157600080fd5b61232a836122e5565b946020939093013593505050565b60008060006060848603121561234d57600080fd5b612356846122e5565b9250612364602085016122e5565b9150604084013590509250925092565b60006020828403121561238657600080fd5b6104f3826122e5565b600080604083850312156123a257600080fd5b6123ab836122e5565b9150602083013580151581146123c057600080fd5b809150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000806000806080858703121561241057600080fd5b612419856122e5565b9350612427602086016122e5565b925060408501359150606085013567ffffffffffffffff8082111561244b57600080fd5b818701915087601f83011261245f57600080fd5b813581811115612471576124716123cb565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156124b7576124b76123cb565b816040528281528a60208487010111156124d057600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b6000806040838503121561250757600080fd5b612510836122e5565b915061251e602084016122e5565b90509250929050565b600181811c9082168061253b57607f821691505b602082108103612574577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600083516125bb818460208801612243565b8351908301906125cf818360208801612243565b01949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561263f5761263f6125d8565b500290565b60008219821115612657576126576125d8565b500190565b60008161266b5761266b6125d8565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036126c2576126c26125d8565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082612707576127076126c9565b500490565b60008282101561271e5761271e6125d8565b500390565b600082612732576127326126c9565b500690565b600073ffffffffffffffffffffffffffffffffffffffff808716835280861660208401525083604083015260806060830152612776608083018461226f565b9695505050505050565b60006020828403121561279257600080fd5b81516104f3816121f8565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea164736f6c634300080f000aa164736f6c634300080f000a", +} + +// OptimismMintableERC721FactoryABI is the input ABI used to generate the binding from. +// Deprecated: Use OptimismMintableERC721FactoryMetaData.ABI instead. +var OptimismMintableERC721FactoryABI = OptimismMintableERC721FactoryMetaData.ABI + +// OptimismMintableERC721FactoryBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use OptimismMintableERC721FactoryMetaData.Bin instead. +var OptimismMintableERC721FactoryBin = OptimismMintableERC721FactoryMetaData.Bin + +// DeployOptimismMintableERC721Factory deploys a new Ethereum contract, binding an instance of OptimismMintableERC721Factory to it. +func DeployOptimismMintableERC721Factory(auth *bind.TransactOpts, backend bind.ContractBackend, _bridge common.Address, _remoteChainId *big.Int) (common.Address, *types.Transaction, *OptimismMintableERC721Factory, error) { + parsed, err := OptimismMintableERC721FactoryMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(OptimismMintableERC721FactoryBin), backend, _bridge, _remoteChainId) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &OptimismMintableERC721Factory{OptimismMintableERC721FactoryCaller: OptimismMintableERC721FactoryCaller{contract: contract}, OptimismMintableERC721FactoryTransactor: OptimismMintableERC721FactoryTransactor{contract: contract}, OptimismMintableERC721FactoryFilterer: OptimismMintableERC721FactoryFilterer{contract: contract}}, nil +} + +// OptimismMintableERC721Factory is an auto generated Go binding around an Ethereum contract. +type OptimismMintableERC721Factory struct { + OptimismMintableERC721FactoryCaller // Read-only binding to the contract + OptimismMintableERC721FactoryTransactor // Write-only binding to the contract + OptimismMintableERC721FactoryFilterer // Log filterer for contract events +} + +// OptimismMintableERC721FactoryCaller is an auto generated read-only Go binding around an Ethereum contract. +type OptimismMintableERC721FactoryCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// OptimismMintableERC721FactoryTransactor is an auto generated write-only Go binding around an Ethereum contract. +type OptimismMintableERC721FactoryTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// OptimismMintableERC721FactoryFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type OptimismMintableERC721FactoryFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// OptimismMintableERC721FactorySession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type OptimismMintableERC721FactorySession struct { + Contract *OptimismMintableERC721Factory // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// OptimismMintableERC721FactoryCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type OptimismMintableERC721FactoryCallerSession struct { + Contract *OptimismMintableERC721FactoryCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// OptimismMintableERC721FactoryTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type OptimismMintableERC721FactoryTransactorSession struct { + Contract *OptimismMintableERC721FactoryTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// OptimismMintableERC721FactoryRaw is an auto generated low-level Go binding around an Ethereum contract. +type OptimismMintableERC721FactoryRaw struct { + Contract *OptimismMintableERC721Factory // Generic contract binding to access the raw methods on +} + +// OptimismMintableERC721FactoryCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type OptimismMintableERC721FactoryCallerRaw struct { + Contract *OptimismMintableERC721FactoryCaller // Generic read-only contract binding to access the raw methods on +} + +// OptimismMintableERC721FactoryTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type OptimismMintableERC721FactoryTransactorRaw struct { + Contract *OptimismMintableERC721FactoryTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewOptimismMintableERC721Factory creates a new instance of OptimismMintableERC721Factory, bound to a specific deployed contract. +func NewOptimismMintableERC721Factory(address common.Address, backend bind.ContractBackend) (*OptimismMintableERC721Factory, error) { + contract, err := bindOptimismMintableERC721Factory(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &OptimismMintableERC721Factory{OptimismMintableERC721FactoryCaller: OptimismMintableERC721FactoryCaller{contract: contract}, OptimismMintableERC721FactoryTransactor: OptimismMintableERC721FactoryTransactor{contract: contract}, OptimismMintableERC721FactoryFilterer: OptimismMintableERC721FactoryFilterer{contract: contract}}, nil +} + +// NewOptimismMintableERC721FactoryCaller creates a new read-only instance of OptimismMintableERC721Factory, bound to a specific deployed contract. +func NewOptimismMintableERC721FactoryCaller(address common.Address, caller bind.ContractCaller) (*OptimismMintableERC721FactoryCaller, error) { + contract, err := bindOptimismMintableERC721Factory(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &OptimismMintableERC721FactoryCaller{contract: contract}, nil +} + +// NewOptimismMintableERC721FactoryTransactor creates a new write-only instance of OptimismMintableERC721Factory, bound to a specific deployed contract. +func NewOptimismMintableERC721FactoryTransactor(address common.Address, transactor bind.ContractTransactor) (*OptimismMintableERC721FactoryTransactor, error) { + contract, err := bindOptimismMintableERC721Factory(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &OptimismMintableERC721FactoryTransactor{contract: contract}, nil +} + +// NewOptimismMintableERC721FactoryFilterer creates a new log filterer instance of OptimismMintableERC721Factory, bound to a specific deployed contract. +func NewOptimismMintableERC721FactoryFilterer(address common.Address, filterer bind.ContractFilterer) (*OptimismMintableERC721FactoryFilterer, error) { + contract, err := bindOptimismMintableERC721Factory(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &OptimismMintableERC721FactoryFilterer{contract: contract}, nil +} + +// bindOptimismMintableERC721Factory binds a generic wrapper to an already deployed contract. +func bindOptimismMintableERC721Factory(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(OptimismMintableERC721FactoryABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_OptimismMintableERC721Factory *OptimismMintableERC721FactoryRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _OptimismMintableERC721Factory.Contract.OptimismMintableERC721FactoryCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_OptimismMintableERC721Factory *OptimismMintableERC721FactoryRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OptimismMintableERC721Factory.Contract.OptimismMintableERC721FactoryTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_OptimismMintableERC721Factory *OptimismMintableERC721FactoryRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _OptimismMintableERC721Factory.Contract.OptimismMintableERC721FactoryTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_OptimismMintableERC721Factory *OptimismMintableERC721FactoryCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _OptimismMintableERC721Factory.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_OptimismMintableERC721Factory *OptimismMintableERC721FactoryTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OptimismMintableERC721Factory.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_OptimismMintableERC721Factory *OptimismMintableERC721FactoryTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _OptimismMintableERC721Factory.Contract.contract.Transact(opts, method, params...) +} + +// BRIDGE is a free data retrieval call binding the contract method 0xee9a31a2. +// +// Solidity: function BRIDGE() view returns(address) +func (_OptimismMintableERC721Factory *OptimismMintableERC721FactoryCaller) BRIDGE(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _OptimismMintableERC721Factory.contract.Call(opts, &out, "BRIDGE") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// BRIDGE is a free data retrieval call binding the contract method 0xee9a31a2. +// +// Solidity: function BRIDGE() view returns(address) +func (_OptimismMintableERC721Factory *OptimismMintableERC721FactorySession) BRIDGE() (common.Address, error) { + return _OptimismMintableERC721Factory.Contract.BRIDGE(&_OptimismMintableERC721Factory.CallOpts) +} + +// BRIDGE is a free data retrieval call binding the contract method 0xee9a31a2. +// +// Solidity: function BRIDGE() view returns(address) +func (_OptimismMintableERC721Factory *OptimismMintableERC721FactoryCallerSession) BRIDGE() (common.Address, error) { + return _OptimismMintableERC721Factory.Contract.BRIDGE(&_OptimismMintableERC721Factory.CallOpts) +} + +// REMOTECHAINID is a free data retrieval call binding the contract method 0x7d1d0c5b. +// +// Solidity: function REMOTE_CHAIN_ID() view returns(uint256) +func (_OptimismMintableERC721Factory *OptimismMintableERC721FactoryCaller) REMOTECHAINID(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _OptimismMintableERC721Factory.contract.Call(opts, &out, "REMOTE_CHAIN_ID") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// REMOTECHAINID is a free data retrieval call binding the contract method 0x7d1d0c5b. +// +// Solidity: function REMOTE_CHAIN_ID() view returns(uint256) +func (_OptimismMintableERC721Factory *OptimismMintableERC721FactorySession) REMOTECHAINID() (*big.Int, error) { + return _OptimismMintableERC721Factory.Contract.REMOTECHAINID(&_OptimismMintableERC721Factory.CallOpts) +} + +// REMOTECHAINID is a free data retrieval call binding the contract method 0x7d1d0c5b. +// +// Solidity: function REMOTE_CHAIN_ID() view returns(uint256) +func (_OptimismMintableERC721Factory *OptimismMintableERC721FactoryCallerSession) REMOTECHAINID() (*big.Int, error) { + return _OptimismMintableERC721Factory.Contract.REMOTECHAINID(&_OptimismMintableERC721Factory.CallOpts) +} + +// IsOptimismMintableERC721 is a free data retrieval call binding the contract method 0x5572acae. +// +// Solidity: function isOptimismMintableERC721(address ) view returns(bool) +func (_OptimismMintableERC721Factory *OptimismMintableERC721FactoryCaller) IsOptimismMintableERC721(opts *bind.CallOpts, arg0 common.Address) (bool, error) { + var out []interface{} + err := _OptimismMintableERC721Factory.contract.Call(opts, &out, "isOptimismMintableERC721", arg0) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsOptimismMintableERC721 is a free data retrieval call binding the contract method 0x5572acae. +// +// Solidity: function isOptimismMintableERC721(address ) view returns(bool) +func (_OptimismMintableERC721Factory *OptimismMintableERC721FactorySession) IsOptimismMintableERC721(arg0 common.Address) (bool, error) { + return _OptimismMintableERC721Factory.Contract.IsOptimismMintableERC721(&_OptimismMintableERC721Factory.CallOpts, arg0) +} + +// IsOptimismMintableERC721 is a free data retrieval call binding the contract method 0x5572acae. +// +// Solidity: function isOptimismMintableERC721(address ) view returns(bool) +func (_OptimismMintableERC721Factory *OptimismMintableERC721FactoryCallerSession) IsOptimismMintableERC721(arg0 common.Address) (bool, error) { + return _OptimismMintableERC721Factory.Contract.IsOptimismMintableERC721(&_OptimismMintableERC721Factory.CallOpts, arg0) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_OptimismMintableERC721Factory *OptimismMintableERC721FactoryCaller) Version(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _OptimismMintableERC721Factory.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 (_OptimismMintableERC721Factory *OptimismMintableERC721FactorySession) Version() (string, error) { + return _OptimismMintableERC721Factory.Contract.Version(&_OptimismMintableERC721Factory.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_OptimismMintableERC721Factory *OptimismMintableERC721FactoryCallerSession) Version() (string, error) { + return _OptimismMintableERC721Factory.Contract.Version(&_OptimismMintableERC721Factory.CallOpts) +} + +// CreateOptimismMintableERC721 is a paid mutator transaction binding the contract method 0xd97df652. +// +// Solidity: function createOptimismMintableERC721(address _remoteToken, string _name, string _symbol) returns(address) +func (_OptimismMintableERC721Factory *OptimismMintableERC721FactoryTransactor) CreateOptimismMintableERC721(opts *bind.TransactOpts, _remoteToken common.Address, _name string, _symbol string) (*types.Transaction, error) { + return _OptimismMintableERC721Factory.contract.Transact(opts, "createOptimismMintableERC721", _remoteToken, _name, _symbol) +} + +// CreateOptimismMintableERC721 is a paid mutator transaction binding the contract method 0xd97df652. +// +// Solidity: function createOptimismMintableERC721(address _remoteToken, string _name, string _symbol) returns(address) +func (_OptimismMintableERC721Factory *OptimismMintableERC721FactorySession) CreateOptimismMintableERC721(_remoteToken common.Address, _name string, _symbol string) (*types.Transaction, error) { + return _OptimismMintableERC721Factory.Contract.CreateOptimismMintableERC721(&_OptimismMintableERC721Factory.TransactOpts, _remoteToken, _name, _symbol) +} + +// CreateOptimismMintableERC721 is a paid mutator transaction binding the contract method 0xd97df652. +// +// Solidity: function createOptimismMintableERC721(address _remoteToken, string _name, string _symbol) returns(address) +func (_OptimismMintableERC721Factory *OptimismMintableERC721FactoryTransactorSession) CreateOptimismMintableERC721(_remoteToken common.Address, _name string, _symbol string) (*types.Transaction, error) { + return _OptimismMintableERC721Factory.Contract.CreateOptimismMintableERC721(&_OptimismMintableERC721Factory.TransactOpts, _remoteToken, _name, _symbol) +} + +// OptimismMintableERC721FactoryOptimismMintableERC721CreatedIterator is returned from FilterOptimismMintableERC721Created and is used to iterate over the raw logs and unpacked data for OptimismMintableERC721Created events raised by the OptimismMintableERC721Factory contract. +type OptimismMintableERC721FactoryOptimismMintableERC721CreatedIterator struct { + Event *OptimismMintableERC721FactoryOptimismMintableERC721Created // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *OptimismMintableERC721FactoryOptimismMintableERC721CreatedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(OptimismMintableERC721FactoryOptimismMintableERC721Created) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(OptimismMintableERC721FactoryOptimismMintableERC721Created) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *OptimismMintableERC721FactoryOptimismMintableERC721CreatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *OptimismMintableERC721FactoryOptimismMintableERC721CreatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// OptimismMintableERC721FactoryOptimismMintableERC721Created represents a OptimismMintableERC721Created event raised by the OptimismMintableERC721Factory contract. +type OptimismMintableERC721FactoryOptimismMintableERC721Created struct { + LocalToken common.Address + RemoteToken common.Address + Deployer common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOptimismMintableERC721Created is a free log retrieval operation binding the contract event 0xe72783bb8e0ca31286b85278da59684dd814df9762a52f0837f89edd1483b299. +// +// Solidity: event OptimismMintableERC721Created(address indexed localToken, address indexed remoteToken, address deployer) +func (_OptimismMintableERC721Factory *OptimismMintableERC721FactoryFilterer) FilterOptimismMintableERC721Created(opts *bind.FilterOpts, localToken []common.Address, remoteToken []common.Address) (*OptimismMintableERC721FactoryOptimismMintableERC721CreatedIterator, error) { + + var localTokenRule []interface{} + for _, localTokenItem := range localToken { + localTokenRule = append(localTokenRule, localTokenItem) + } + var remoteTokenRule []interface{} + for _, remoteTokenItem := range remoteToken { + remoteTokenRule = append(remoteTokenRule, remoteTokenItem) + } + + logs, sub, err := _OptimismMintableERC721Factory.contract.FilterLogs(opts, "OptimismMintableERC721Created", localTokenRule, remoteTokenRule) + if err != nil { + return nil, err + } + return &OptimismMintableERC721FactoryOptimismMintableERC721CreatedIterator{contract: _OptimismMintableERC721Factory.contract, event: "OptimismMintableERC721Created", logs: logs, sub: sub}, nil +} + +// WatchOptimismMintableERC721Created is a free log subscription operation binding the contract event 0xe72783bb8e0ca31286b85278da59684dd814df9762a52f0837f89edd1483b299. +// +// Solidity: event OptimismMintableERC721Created(address indexed localToken, address indexed remoteToken, address deployer) +func (_OptimismMintableERC721Factory *OptimismMintableERC721FactoryFilterer) WatchOptimismMintableERC721Created(opts *bind.WatchOpts, sink chan<- *OptimismMintableERC721FactoryOptimismMintableERC721Created, localToken []common.Address, remoteToken []common.Address) (event.Subscription, error) { + + var localTokenRule []interface{} + for _, localTokenItem := range localToken { + localTokenRule = append(localTokenRule, localTokenItem) + } + var remoteTokenRule []interface{} + for _, remoteTokenItem := range remoteToken { + remoteTokenRule = append(remoteTokenRule, remoteTokenItem) + } + + logs, sub, err := _OptimismMintableERC721Factory.contract.WatchLogs(opts, "OptimismMintableERC721Created", localTokenRule, remoteTokenRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(OptimismMintableERC721FactoryOptimismMintableERC721Created) + if err := _OptimismMintableERC721Factory.contract.UnpackLog(event, "OptimismMintableERC721Created", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseOptimismMintableERC721Created is a log parse operation binding the contract event 0xe72783bb8e0ca31286b85278da59684dd814df9762a52f0837f89edd1483b299. +// +// Solidity: event OptimismMintableERC721Created(address indexed localToken, address indexed remoteToken, address deployer) +func (_OptimismMintableERC721Factory *OptimismMintableERC721FactoryFilterer) ParseOptimismMintableERC721Created(log types.Log) (*OptimismMintableERC721FactoryOptimismMintableERC721Created, error) { + event := new(OptimismMintableERC721FactoryOptimismMintableERC721Created) + if err := _OptimismMintableERC721Factory.contract.UnpackLog(event, "OptimismMintableERC721Created", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/op-e2e2/bindings/optimismportal.go b/op-e2e2/bindings/optimismportal.go new file mode 100644 index 000000000000..3fb3ed0cd59a --- /dev/null +++ b/op-e2e2/bindings/optimismportal.go @@ -0,0 +1,1478 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// TypesOutputRootProof is an auto generated low-level Go binding around an user-defined struct. +type TypesOutputRootProof struct { + Version [32]byte + StateRoot [32]byte + MessagePasserStorageRoot [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: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"balance\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"depositERC20Transaction\",\"inputs\":[{\"name\":\"_to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_mint\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_value\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_gasLimit\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_isCreation\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"_data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"depositTransaction\",\"inputs\":[{\"name\":\"_to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_value\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_gasLimit\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_isCreation\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"_data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"donateETH\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"finalizeWithdrawalTransaction\",\"inputs\":[{\"name\":\"_tx\",\"type\":\"tuple\",\"internalType\":\"structTypes.WithdrawalTransaction\",\"components\":[{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"sender\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"target\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"gasLimit\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"finalizedWithdrawals\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"gasPayingToken\",\"inputs\":[],\"outputs\":[{\"name\":\"addr_\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"decimals_\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"guardian\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_l2Oracle\",\"type\":\"address\",\"internalType\":\"contractL2OutputOracle\"},{\"name\":\"_systemConfig\",\"type\":\"address\",\"internalType\":\"contractSystemConfig\"},{\"name\":\"_superchainConfig\",\"type\":\"address\",\"internalType\":\"contractSuperchainConfig\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"isOutputFinalized\",\"inputs\":[{\"name\":\"_l2OutputIndex\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"l2Oracle\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractL2OutputOracle\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"l2Sender\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"minimumGasLimit\",\"inputs\":[{\"name\":\"_byteCount\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"params\",\"inputs\":[],\"outputs\":[{\"name\":\"prevBaseFee\",\"type\":\"uint128\",\"internalType\":\"uint128\"},{\"name\":\"prevBoughtGas\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"prevBlockNum\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"paused\",\"inputs\":[],\"outputs\":[{\"name\":\"paused_\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"proveWithdrawalTransaction\",\"inputs\":[{\"name\":\"_tx\",\"type\":\"tuple\",\"internalType\":\"structTypes.WithdrawalTransaction\",\"components\":[{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"sender\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"target\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"gasLimit\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"_l2OutputIndex\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_outputRootProof\",\"type\":\"tuple\",\"internalType\":\"structTypes.OutputRootProof\",\"components\":[{\"name\":\"version\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"stateRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"messagePasserStorageRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"latestBlockhash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"name\":\"_withdrawalProof\",\"type\":\"bytes[]\",\"internalType\":\"bytes[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"provenWithdrawals\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"outputRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"timestamp\",\"type\":\"uint128\",\"internalType\":\"uint128\"},{\"name\":\"l2OutputIndex\",\"type\":\"uint128\",\"internalType\":\"uint128\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"setGasPayingToken\",\"inputs\":[{\"name\":\"_token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_decimals\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"_name\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_symbol\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"superchainConfig\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractSuperchainConfig\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"systemConfig\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractSystemConfig\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"TransactionDeposited\",\"inputs\":[{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"version\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"opaqueData\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"WithdrawalFinalized\",\"inputs\":[{\"name\":\"withdrawalHash\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"success\",\"type\":\"bool\",\"indexed\":false,\"internalType\":\"bool\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"WithdrawalProven\",\"inputs\":[{\"name\":\"withdrawalHash\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"BadTarget\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"CallPaused\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"GasEstimation\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"LargeCalldata\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NoValue\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NonReentrant\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OnlyCustomGasToken\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OutOfGas\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"SmallGasLimit\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"TransferFailed\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Unauthorized\",\"inputs\":[]}]", + Bin: "0x60806040523480156200001157600080fd5b50620000206000808062000026565b6200028f565b600054610100900460ff1615808015620000475750600054600160ff909116105b806200007757506200006430620001c160201b62001ff31760201c565b15801562000077575060005460ff166001145b620000e05760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff19166001179055801562000104576000805461ff0019166101001790555b603680546001600160a01b03199081166001600160a01b03878116919091179092556037805490911685831617905560358054610100600160a81b03191661010085841602179055603254166200016a57603280546001600160a01b03191661dead1790555b62000174620001d0565b8015620001bb576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b6001600160a01b03163b151590565b600054610100900460ff166200023d5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401620000d7565b600154600160c01b90046001600160401b03166000036200028d5760408051606081018252633b9aca0080825260006020830152436001600160401b031691909201819052600160c01b02176001555b565b615f6d806200029f6000396000f3fe60806040526004361061016e5760003560e01c80638b4c40b0116100cb578063a35d99df1161007f578063cff0ab9611610059578063cff0ab961461049c578063e965084c1461053d578063e9e05c42146105c957600080fd5b8063a35d99df14610420578063b69ef8a814610459578063c0c53b8b1461047c57600080fd5b80639b5f694a116100b05780639b5f694a146103965780639bf62d82146103c3578063a14238e7146103f057600080fd5b80638b4c40b0146101935780638c3152e91461037657600080fd5b80634870496f116101225780635c975abb116101075780635c975abb146103115780636dbffb781461033657806371cfaa3f1461035657600080fd5b80634870496f1461029b57806354fd4d50146102bb57600080fd5b806335e80ab31161015357806335e80ab3146102115780634397dfef14610243578063452a93201461028657600080fd5b8063149f2f221461019a57806333d7e2bd146101ba57600080fd5b36610195576101933334620186a06000604051806020016040528060008152506105d7565b005b600080fd5b3480156101a657600080fd5b506101936101b536600461538d565b61067c565b3480156101c657600080fd5b506037546101e79073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b34801561021d57600080fd5b506035546101e790610100900473ffffffffffffffffffffffffffffffffffffffff1681565b34801561024f57600080fd5b506102586108be565b6040805173ffffffffffffffffffffffffffffffffffffffff909316835260ff909116602083015201610208565b34801561029257600080fd5b506101e761095b565b3480156102a757600080fd5b506101936102b63660046154c1565b6109f3565b3480156102c757600080fd5b506103046040518060400160405280601b81526020017f322e372e302d626574612b637573746f6d2d6761732d746f6b656e000000000081525081565b6040516102089190615613565b34801561031d57600080fd5b50610326610fa0565b6040519015158152602001610208565b34801561034257600080fd5b50610326610351366004615626565b611033565b34801561036257600080fd5b5061019361037136600461564e565b6110ee565b34801561038257600080fd5b50610193610391366004615694565b6112b0565b3480156103a257600080fd5b506036546101e79073ffffffffffffffffffffffffffffffffffffffff1681565b3480156103cf57600080fd5b506032546101e79073ffffffffffffffffffffffffffffffffffffffff1681565b3480156103fc57600080fd5b5061032661040b366004615626565b60336020526000908152604090205460ff1681565b34801561042c57600080fd5b5061044061043b3660046156d1565b611d32565b60405167ffffffffffffffff9091168152602001610208565b34801561046557600080fd5b5061046e611d4b565b604051908152602001610208565b34801561048857600080fd5b506101936104973660046156ec565b611da5565b3480156104a857600080fd5b50600154610504906fffffffffffffffffffffffffffffffff81169067ffffffffffffffff7001000000000000000000000000000000008204811691780100000000000000000000000000000000000000000000000090041683565b604080516fffffffffffffffffffffffffffffffff909416845267ffffffffffffffff9283166020850152911690820152606001610208565b34801561054957600080fd5b5061059b610558366004615626565b603460205260009081526040902080546001909101546fffffffffffffffffffffffffffffffff8082169170010000000000000000000000000000000090041683565b604080519384526fffffffffffffffffffffffffffffffff9283166020850152911690820152606001610208565b6101936105d7366004615737565b8260005a905060006105e76108be565b50905073ffffffffffffffffffffffffffffffffffffffff811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1480159061062357503415155b1561065a576040517ff2365b5b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61066888348989898961200f565b5061067382826121bb565b50505050505050565b8260005a9050600061068c6108be565b5090507fffffffffffffffffffffffff111111111111111111111111111111111111111273ffffffffffffffffffffffffffffffffffffffff8216016106fe576040517f0eaf3c0f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8316906370a0823190602401602060405180830381865afa15801561076b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061078f91906157b4565b90506107b373ffffffffffffffffffffffffffffffffffffffff831633308c612488565b6107bd89826157fc565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8416906370a0823190602401602060405180830381865afa158015610827573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061084b91906157b4565b14610882576040517f90b8ec1800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b88603d600082825461089491906157fc565b909155506108a890508a8a8a8a8a8a61200f565b50506108b482826121bb565b5050505050505050565b603754604080517f4397dfef0000000000000000000000000000000000000000000000000000000081528151600093849373ffffffffffffffffffffffffffffffffffffffff90911692634397dfef92600480830193928290030181865afa15801561092e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109529190615814565b90939092509050565b6000603560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663452a93206040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ee919061584e565b905090565b6109fb610fa0565b15610a32576040517ff480973e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3073ffffffffffffffffffffffffffffffffffffffff16856040015173ffffffffffffffffffffffffffffffffffffffff1603610a9b576040517f13496fda00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6036546040517fa25ae5570000000000000000000000000000000000000000000000000000000081526004810186905260009173ffffffffffffffffffffffffffffffffffffffff169063a25ae55790602401606060405180830381865afa158015610b0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b2f919061588b565b519050610b49610b44368690038601866158f0565b612564565b8114610bdc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4f7074696d69736d506f7274616c3a20696e76616c6964206f7574707574207260448201527f6f6f742070726f6f66000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6000610be7876125c0565b6000818152603460209081526040918290208251606081018452815481526001909101546fffffffffffffffffffffffffffffffff8082169383018490527001000000000000000000000000000000009091041692810192909252919250901580610cfd5750805160365460408084015190517fa25ae5570000000000000000000000000000000000000000000000000000000081526fffffffffffffffffffffffffffffffff909116600482015273ffffffffffffffffffffffffffffffffffffffff9091169063a25ae55790602401606060405180830381865afa158015610cd5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cf9919061588b565b5114155b610d89576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f4f7074696d69736d506f7274616c3a207769746864726177616c20686173682060448201527f68617320616c7265616479206265656e2070726f76656e0000000000000000006064820152608401610bd3565b60408051602081018490526000918101829052606001604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815282825280516020918201209083018190529250610e529101604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152828201909152600182527f0100000000000000000000000000000000000000000000000000000000000000602083015290610e48888a615956565b8a604001356125f0565b610ede576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4f7074696d69736d506f7274616c3a20696e76616c696420776974686472617760448201527f616c20696e636c7573696f6e2070726f6f6600000000000000000000000000006064820152608401610bd3565b604080516060810182528581526fffffffffffffffffffffffffffffffff42811660208084019182528c831684860190815260008981526034835286812095518655925190518416700100000000000000000000000000000000029316929092176001909301929092558b830151908c0151925173ffffffffffffffffffffffffffffffffffffffff918216939091169186917f67a6208cfcc0801d50f6cbe764733f4fddf66ac0b04442061a8a8c0cb6b63f629190a4505050505050505050565b6000603560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561100f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ee91906159da565b6036546040517fa25ae557000000000000000000000000000000000000000000000000000000008152600481018390526000916110e89173ffffffffffffffffffffffffffffffffffffffff9091169063a25ae55790602401606060405180830381865afa1580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd919061588b565b602001516fffffffffffffffffffffffffffffffff16612614565b92915050565b60375473ffffffffffffffffffffffffffffffffffffffff16331461113f576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61114b620138806126ba565b60405173ffffffffffffffffffffffffffffffffffffffff8516602482015260ff8416604482015260648101839052608481018290526000907342000000000000000000000000000000000000159073deaddeaddeaddeaddeaddeaddeaddeaddead0001907fb3813568d9991fc951961fcb4c784893574240a28925604d09fc577c55bb7c3290849081906201388090829060a401604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152918152602080830180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f71cfaa3f000000000000000000000000000000000000000000000000000000001790529051611268969594939291016159f7565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290526112a091615613565b60405180910390a450505050565b565b6112b8610fa0565b156112ef576040517ff480973e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60325473ffffffffffffffffffffffffffffffffffffffff1661dead14611342576040517f9396d15600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061134d826125c0565b60008181526034602090815260408083208151606081018352815481526001909101546fffffffffffffffffffffffffffffffff80821694830185905270010000000000000000000000000000000090910416918101919091529293509003611438576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4f7074696d69736d506f7274616c3a207769746864726177616c20686173206e60448201527f6f74206265656e2070726f76656e2079657400000000000000000000000000006064820152608401610bd3565b603660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663887862726040518163ffffffff1660e01b8152600401602060405180830381865afa1580156114a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c991906157b4565b81602001516fffffffffffffffffffffffffffffffff161015611594576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604b60248201527f4f7074696d69736d506f7274616c3a207769746864726177616c2074696d657360448201527f74616d70206c657373207468616e204c32204f7261636c65207374617274696e60648201527f672074696d657374616d70000000000000000000000000000000000000000000608482015260a401610bd3565b6115b381602001516fffffffffffffffffffffffffffffffff16612614565b611665576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604560248201527f4f7074696d69736d506f7274616c3a2070726f76656e2077697468647261776160448201527f6c2066696e616c697a6174696f6e20706572696f6420686173206e6f7420656c60648201527f6170736564000000000000000000000000000000000000000000000000000000608482015260a401610bd3565b60365460408281015190517fa25ae5570000000000000000000000000000000000000000000000000000000081526fffffffffffffffffffffffffffffffff909116600482015260009173ffffffffffffffffffffffffffffffffffffffff169063a25ae55790602401606060405180830381865afa1580156116ec573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611710919061588b565b82518151919250146117ca576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604960248201527f4f7074696d69736d506f7274616c3a206f757470757420726f6f742070726f7660448201527f656e206973206e6f74207468652073616d652061732063757272656e74206f7560648201527f7470757420726f6f740000000000000000000000000000000000000000000000608482015260a401610bd3565b6117e981602001516fffffffffffffffffffffffffffffffff16612614565b61189b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604360248201527f4f7074696d69736d506f7274616c3a206f75747075742070726f706f73616c2060448201527f66696e616c697a6174696f6e20706572696f6420686173206e6f7420656c617060648201527f7365640000000000000000000000000000000000000000000000000000000000608482015260a401610bd3565b60008381526033602052604090205460ff161561193a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603560248201527f4f7074696d69736d506f7274616c3a207769746864726177616c20686173206160448201527f6c7265616479206265656e2066696e616c697a656400000000000000000000006064820152608401610bd3565b6000838152603360209081526040822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558501516032805473ffffffffffffffffffffffffffffffffffffffff9092167fffffffffffffffffffffffff0000000000000000000000000000000000000000909216919091179055806119c56108be565b5090507fffffffffffffffffffffffff111111111111111111111111111111111111111273ffffffffffffffffffffffffffffffffffffffff821601611a2857611a218660400151876080015188606001518960a00151612716565b9150611c7b565b8073ffffffffffffffffffffffffffffffffffffffff16866040015173ffffffffffffffffffffffffffffffffffffffff1603611a91576040517f13496fda00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606086015115611c52578560600151603d6000828254611ab19190615a5c565b90915550506040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8316906370a0823190602401602060405180830381865afa158015611b23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b4791906157b4565b9050611b7c876040015188606001518473ffffffffffffffffffffffffffffffffffffffff166127749092919063ffffffff16565b6060870151611b8b9082615a5c565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8416906370a0823190602401602060405180830381865afa158015611bf5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c1991906157b4565b14611c50576040517f90b8ec1800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505b60a08601515115611c7657611a218660400151876080015160008960a00151612716565b600191505b603280547fffffffffffffffffffffffff00000000000000000000000000000000000000001661dead17905560405185907fdb5c7652857aa163daadd670e116628fb42e869d8ac4251ef8971d9e5727df1b90611cdd90851515815260200190565b60405180910390a281158015611cf35750326001145b15611d2a576040517feeae4ed300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505050505050565b6000611d3f826010615a73565b6110e890615208615aa3565b600080611d566108be565b5090507fffffffffffffffffffffffff111111111111111111111111111111111111111273ffffffffffffffffffffffffffffffffffffffff821601611d9d574791505090565b5050603d5490565b600054610100900460ff1615808015611dc55750600054600160ff909116105b80611ddf5750303b158015611ddf575060005460ff166001145b611e6b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610bd3565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015611ec957600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b603680547fffffffffffffffffffffffff000000000000000000000000000000000000000090811673ffffffffffffffffffffffffffffffffffffffff8781169190911790925560378054909116858316179055603580547fffffffffffffffffffffff0000000000000000000000000000000000000000ff166101008584160217905560325416611f8257603280547fffffffffffffffffffffffff00000000000000000000000000000000000000001661dead1790555b611f8a6127cf565b8015611fed57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b818015612031575073ffffffffffffffffffffffffffffffffffffffff861615155b15612068576040517f13496fda00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6120728151611d32565b67ffffffffffffffff168367ffffffffffffffff1610156120bf576040517f4929b80800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6201d4c0815111156120fd576040517f73052b0f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3332811461211e575033731111000000000000000000000000000000001111015b600086868686866040516020016121399594939291906159f7565b604051602081830303815290604052905060008873ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fb3813568d9991fc951961fcb4c784893574240a28925604d09fc577c55bb7c32846040516121a99190615613565b60405180910390a45050505050505050565b6001546000906121f1907801000000000000000000000000000000000000000000000000900467ffffffffffffffff1643615a5c565b905060006121fd6128e2565b90506000816020015160ff16826000015163ffffffff1661221e9190615afe565b9050821561235557600154600090612255908390700100000000000000000000000000000000900467ffffffffffffffff16615b66565b90506000836040015160ff168361226c9190615bda565b60015461228c9084906fffffffffffffffffffffffffffffffff16615bda565b6122969190615afe565b6001549091506000906122e7906122c09084906fffffffffffffffffffffffffffffffff16615c96565b866060015163ffffffff168760a001516fffffffffffffffffffffffffffffffff166129a3565b90506001861115612316576123136122c082876040015160ff1660018a61230e9190615a5c565b6129c2565b90505b6fffffffffffffffffffffffffffffffff16780100000000000000000000000000000000000000000000000067ffffffffffffffff4316021760015550505b60018054869190601090612388908490700100000000000000000000000000000000900467ffffffffffffffff16615aa3565b92506101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550816000015163ffffffff16600160000160109054906101000a900467ffffffffffffffff1667ffffffffffffffff161315612415576040517f77ebef4d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600154600090612441906fffffffffffffffffffffffffffffffff1667ffffffffffffffff8816615d0a565b9050600061245348633b9aca00612a17565b61245d9083615d47565b905060005a61246c9088615a5c565b9050808211156108b4576108b46124838284615a5c565b612a2e565b60405173ffffffffffffffffffffffffffffffffffffffff80851660248301528316604482015260648101829052611fed9085907f23b872dd00000000000000000000000000000000000000000000000000000000906084015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152612a57565b600081600001518260200151836040015184606001516040516020016125a3949392919093845260208401929092526040830152606082015260800190565b604051602081830303815290604052805190602001209050919050565b80516020808301516040808501516060860151608087015160a088015193516000976125a3979096959101615d5b565b6000806125fc86612b63565b905061260a81868686612b95565b9695505050505050565b603654604080517ff4daa291000000000000000000000000000000000000000000000000000000008152905160009273ffffffffffffffffffffffffffffffffffffffff169163f4daa2919160048083019260209291908290030181865afa158015612684573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126a891906157b4565b6126b290836157fc565b421192915050565b600180548291906010906126ed908490700100000000000000000000000000000000900467ffffffffffffffff16615aa3565b92506101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555050565b6000806000612726866000612bc5565b90508061275c576308c379a06000526020805278185361666543616c6c3a204e6f7420656e6f756768206761736058526064601cfd5b600080855160208701888b5af1979650505050505050565b60405173ffffffffffffffffffffffffffffffffffffffff83166024820152604481018290526127ca9084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064016124e2565b505050565b600054610100900460ff16612866576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610bd3565b6001547801000000000000000000000000000000000000000000000000900467ffffffffffffffff166000036112ae5760408051606081018252633b9aca00808252600060208301524367ffffffffffffffff169190920181905278010000000000000000000000000000000000000000000000000217600155565b6040805160c08082018352600080835260208301819052828401819052606083018190526080830181905260a083015260375483517fcc731b020000000000000000000000000000000000000000000000000000000081529351929373ffffffffffffffffffffffffffffffffffffffff9091169263cc731b02926004808401939192918290030181865afa15801561297f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ee9190615dc6565b60006129b86129b28585612be3565b83612bf3565b90505b9392505050565b6000670de0b6b3a7640000612a036129da8583615afe565b6129ec90670de0b6b3a7640000615b66565b6129fe85670de0b6b3a7640000615bda565b612c02565b612a0d9086615bda565b6129b89190615afe565b600081831015612a2757816129bb565b5090919050565b6000805a90505b825a612a419083615a5c565b10156127ca57612a5082615e69565b9150612a35565b6000612ab9826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16612c339092919063ffffffff16565b8051909150156127ca5780806020019051810190612ad791906159da565b6127ca576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610bd3565b60608180519060200120604051602001612b7f91815260200190565b6040516020818303038152906040529050919050565b6000612bbc84612ba6878686612c42565b8051602091820120825192909101919091201490565b95945050505050565b600080603f83619c4001026040850201603f5a021015949350505050565b600081831215612a2757816129bb565b6000818312612a2757816129bb565b60006129bb670de0b6b3a764000083612c1a866136c0565b612c249190615bda565b612c2e9190615afe565b613904565b60606129b88484600085613b43565b60606000845111612caf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4d65726b6c65547269653a20656d707479206b657900000000000000000000006044820152606401610bd3565b6000612cba84613cd9565b90506000612cc786613dc5565b9050600084604051602001612cde91815260200190565b60405160208183030381529060405290506000805b8451811015613637576000858281518110612d1057612d10615ea1565b602002602001015190508451831115612dab576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f4d65726b6c65547269653a206b657920696e646578206578636565647320746f60448201527f74616c206b6579206c656e6774680000000000000000000000000000000000006064820152608401610bd3565b82600003612e645780518051602091820120604051612df992612dd392910190815260200190565b604051602081830303815290604052858051602091820120825192909101919091201490565b612e5f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f4d65726b6c65547269653a20696e76616c696420726f6f7420686173680000006044820152606401610bd3565b612fbb565b805151602011612f1a5780518051602091820120604051612e8e92612dd392910190815260200190565b612e5f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f4d65726b6c65547269653a20696e76616c6964206c6172676520696e7465726e60448201527f616c2068617368000000000000000000000000000000000000000000000000006064820152608401610bd3565b805184516020808701919091208251919092012014612fbb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4d65726b6c65547269653a20696e76616c696420696e7465726e616c206e6f6460448201527f65206861736800000000000000000000000000000000000000000000000000006064820152608401610bd3565b612fc7601060016157fc565b816020015151036131a3578451830361313b576130018160200151601081518110612ff457612ff4615ea1565b6020026020010151613e28565b96506000875111613094576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603b60248201527f4d65726b6c65547269653a2076616c7565206c656e677468206d75737420626560448201527f2067726561746572207468616e207a65726f20286272616e63682900000000006064820152608401610bd3565b600186516130a29190615a5c565b8214613130576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f4d65726b6c65547269653a2076616c7565206e6f6465206d757374206265206c60448201527f617374206e6f646520696e2070726f6f6620286272616e6368290000000000006064820152608401610bd3565b5050505050506129bb565b600085848151811061314f5761314f615ea1565b602001015160f81c60f81b60f81c9050600082602001518260ff168151811061317a5761317a615ea1565b6020026020010151905061318d81613f88565b955061319a6001866157fc565b94505050613624565b60028160200151510361359c5760006131bb82613fad565b90506000816000815181106131d2576131d2615ea1565b016020015160f81c905060006131e9600283615ed0565b6131f4906002615ef2565b90506000613205848360ff16613fd1565b905060006132138a89613fd1565b905060006132218383614007565b9050808351146132b3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f4d65726b6c65547269653a20706174682072656d61696e646572206d7573742060448201527f736861726520616c6c206e6962626c65732077697468206b65790000000000006064820152608401610bd3565b60ff8516600214806132c8575060ff85166003145b156134b7578082511461335d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603d60248201527f4d65726b6c65547269653a206b65792072656d61696e646572206d757374206260448201527f65206964656e746963616c20746f20706174682072656d61696e6465720000006064820152608401610bd3565b6133778760200151600181518110612ff457612ff4615ea1565b9c5060008d511161340a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603960248201527f4d65726b6c65547269653a2076616c7565206c656e677468206d75737420626560448201527f2067726561746572207468616e207a65726f20286c65616629000000000000006064820152608401610bd3565b60018c516134189190615a5c565b88146134a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603860248201527f4d65726b6c65547269653a2076616c7565206e6f6465206d757374206265206c60448201527f617374206e6f646520696e2070726f6f6620286c6561662900000000000000006064820152608401610bd3565b5050505050505050505050506129bb565b60ff851615806134ca575060ff85166001145b15613509576134f687602001516001815181106134e9576134e9615ea1565b6020026020010151613f88565b9950613502818a6157fc565b9850613591565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4d65726b6c65547269653a2072656365697665642061206e6f6465207769746860448201527f20616e20756e6b6e6f776e2070726566697800000000000000000000000000006064820152608401610bd3565b505050505050613624565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f4d65726b6c65547269653a20726563656976656420616e20756e70617273656160448201527f626c65206e6f64650000000000000000000000000000000000000000000000006064820152608401610bd3565b508061362f81615e69565b915050612cf3565b506040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f4d65726b6c65547269653a2072616e206f7574206f662070726f6f6620656c6560448201527f6d656e74730000000000000000000000000000000000000000000000000000006064820152608401610bd3565b600080821361372b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f554e444546494e454400000000000000000000000000000000000000000000006044820152606401610bd3565b60006060613738846140bb565b03609f8181039490941b90931c6c465772b2bbbb5f824b15207a3081018102606090811d6d0388eaa27412d5aca026815d636e018202811d6d0df99ac502031bf953eff472fdcc018202811d6d13cdffb29d51d99322bdff5f2211018202811d6d0a0f742023def783a307a986912e018202811d6d01920d8043ca89b5239253284e42018202811d6c0b7a86d7375468fac667a0a527016c29508e458543d8aa4df2abee7883018302821d6d0139601a2efabe717e604cbb4894018302821d6d02247f7a7b6594320649aa03aba1018302821d7fffffffffffffffffffffffffffffffffffffff73c0c716a594e00d54e3c4cbc9018302821d7ffffffffffffffffffffffffffffffffffffffdc7b88c420e53a9890533129f6f01830290911d7fffffffffffffffffffffffffffffffffffffff465fda27eb4d63ded474e5f832019091027ffffffffffffffff5f6af8f7b3396644f18e157960000000000000000000000000105711340daa0d5f769dba1915cef59f0815a5506027d0267a36c0c95b3975ab3ee5b203a7614a3f75373f047d803ae7b6687f2b393909302929092017d57115e47018c7177eebf7cd370a3356a1b7863008a5ae8028c72b88642840160ae1d92915050565b60007ffffffffffffffffffffffffffffffffffffffffffffffffdb731c958f34d94c1821361393557506000919050565b680755bf798b4a1bf1e582126139a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f4558505f4f564552464c4f5700000000000000000000000000000000000000006044820152606401610bd3565b6503782dace9d9604e83901b059150600060606bb17217f7d1cf79abc9e3b39884821b056b80000000000000000000000001901d6bb17217f7d1cf79abc9e3b39881029093037fffffffffffffffffffffffffffffffffffffffdbf3ccf1604d263450f02a550481018102606090811d6d0277594991cfc85f6e2461837cd9018202811d7fffffffffffffffffffffffffffffffffffffe5adedaa1cb095af9e4da10e363c018202811d6db1bbb201f443cf962f1a1d3db4a5018202811d7ffffffffffffffffffffffffffffffffffffd38dc772608b0ae56cce01296c0eb018202811d6e05180bb14799ab47a8a8cb2a527d57016d02d16720577bd19bf614176fe9ea6c10fe68e7fd37d0007b713f765084018402831d9081019084017ffffffffffffffffffffffffffffffffffffffe2c69812cf03b0763fd454a8f7e010290911d6e0587f503bb6ea29d25fcb7401964500190910279d835ebba824c98fb31b83b2ca45c000000000000000000000000010574029d9dc38563c32e5c2f6dc192ee70ef65f9978af30260c3939093039290921c92915050565b606082471015613bd5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610bd3565b73ffffffffffffffffffffffffffffffffffffffff85163b613c53576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610bd3565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051613c7c9190615f15565b60006040518083038185875af1925050503d8060008114613cb9576040519150601f19603f3d011682016040523d82523d6000602084013e613cbe565b606091505b5091509150613cce828286614191565b979650505050505050565b80516060908067ffffffffffffffff811115613cf757613cf7615281565b604051908082528060200260200182016040528015613d3c57816020015b6040805180820190915260608082526020820152815260200190600190039081613d155790505b50915060005b81811015613dbe576040518060400160405280858381518110613d6757613d67615ea1565b60200260200101518152602001613d96868481518110613d8957613d89615ea1565b60200260200101516141e4565b815250838281518110613dab57613dab615ea1565b6020908102919091010152600101613d42565b5050919050565b606080604051905082518060011b603f8101601f1916830160405280835250602084016020830160005b83811015613e1d578060011b82018184015160001a8060041c8253600f811660018301535050600101613def565b509295945050505050565b60606000806000613e38856141f7565b919450925090506000816001811115613e5357613e53615f31565b14613ee0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603960248201527f524c505265616465723a206465636f646564206974656d207479706520666f7260448201527f206279746573206973206e6f7420612064617461206974656d000000000000006064820152608401610bd3565b613eea82846157fc565b855114613f79576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603460248201527f524c505265616465723a2062797465732076616c756520636f6e7461696e732060448201527f616e20696e76616c69642072656d61696e6465720000000000000000000000006064820152608401610bd3565b612bbc85602001518484614c64565b60606020826000015110613fa457613f9f82613e28565b6110e8565b6110e882614cf8565b60606110e8613fcc8360200151600081518110612ff457612ff4615ea1565b613dc5565b606082518210613ff057506040805160208101909152600081526110e8565b6129bb83838486516140029190615a5c565b614d0e565b600080825184511061401a57825161401d565b83515b90505b80821080156140a4575082828151811061403c5761403c615ea1565b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191684838151811061407b5761407b615ea1565b01602001517fff0000000000000000000000000000000000000000000000000000000000000016145b156140b457816001019150614020565b5092915050565b6000808211614126576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f554e444546494e454400000000000000000000000000000000000000000000006044820152606401610bd3565b5060016fffffffffffffffffffffffffffffffff821160071b82811c67ffffffffffffffff1060061b1782811c63ffffffff1060051b1782811c61ffff1060041b1782811c60ff10600390811b90911783811c600f1060021b1783811c909110821b1791821c111790565b606083156141a05750816129bb565b8251156141b05782518084602001fd5b816040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bd39190615613565b60606110e86141f283614ee6565b614fcf565b6000806000808460000151116142b5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604a60248201527f524c505265616465723a206c656e677468206f6620616e20524c50206974656d60448201527f206d7573742062652067726561746572207468616e207a65726f20746f20626560648201527f206465636f6461626c6500000000000000000000000000000000000000000000608482015260a401610bd3565b6020840151805160001a607f81116142da576000600160009450945094505050614c5d565b60b781116144e85760006142ef608083615a5c565b9050808760000151116143aa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604e60248201527f524c505265616465723a206c656e677468206f6620636f6e74656e74206d757360448201527f742062652067726561746572207468616e20737472696e67206c656e6774682060648201527f2873686f727420737472696e6729000000000000000000000000000000000000608482015260a401610bd3565b6001838101517fff0000000000000000000000000000000000000000000000000000000000000016908214158061442357507f80000000000000000000000000000000000000000000000000000000000000007fff00000000000000000000000000000000000000000000000000000000000000821610155b6144d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604d60248201527f524c505265616465723a20696e76616c6964207072656669782c2073696e676c60448201527f652062797465203c203078383020617265206e6f74207072656669786564202860648201527f73686f727420737472696e672900000000000000000000000000000000000000608482015260a401610bd3565b5060019550935060009250614c5d915050565b60bf81116148365760006144fd60b783615a5c565b9050808760000151116145b8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152605160248201527f524c505265616465723a206c656e677468206f6620636f6e74656e74206d757360448201527f74206265203e207468616e206c656e677468206f6620737472696e67206c656e60648201527f67746820286c6f6e6720737472696e6729000000000000000000000000000000608482015260a401610bd3565b60018301517fff00000000000000000000000000000000000000000000000000000000000000166000819003614696576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604a60248201527f524c505265616465723a206c656e677468206f6620636f6e74656e74206d757360448201527f74206e6f74206861766520616e79206c656164696e67207a65726f7320286c6f60648201527f6e6720737472696e672900000000000000000000000000000000000000000000608482015260a401610bd3565b600184015160088302610100031c6037811161475a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604860248201527f524c505265616465723a206c656e677468206f6620636f6e74656e74206d757360448201527f742062652067726561746572207468616e20353520627974657320286c6f6e6760648201527f20737472696e6729000000000000000000000000000000000000000000000000608482015260a401610bd3565b61476481846157fc565b895111614819576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604c60248201527f524c505265616465723a206c656e677468206f6620636f6e74656e74206d757360448201527f742062652067726561746572207468616e20746f74616c206c656e677468202860648201527f6c6f6e6720737472696e67290000000000000000000000000000000000000000608482015260a401610bd3565b6148248360016157fc565b9750955060009450614c5d9350505050565b60f7811161491757600061484b60c083615a5c565b905080876000015111614906576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604a60248201527f524c505265616465723a206c656e677468206f6620636f6e74656e74206d757360448201527f742062652067726561746572207468616e206c697374206c656e67746820287360648201527f686f7274206c6973742900000000000000000000000000000000000000000000608482015260a401610bd3565b600195509350849250614c5d915050565b600061492460f783615a5c565b9050808760000151116149df576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604d60248201527f524c505265616465723a206c656e677468206f6620636f6e74656e74206d757360448201527f74206265203e207468616e206c656e677468206f66206c697374206c656e677460648201527f6820286c6f6e67206c6973742900000000000000000000000000000000000000608482015260a401610bd3565b60018301517fff00000000000000000000000000000000000000000000000000000000000000166000819003614abd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604860248201527f524c505265616465723a206c656e677468206f6620636f6e74656e74206d757360448201527f74206e6f74206861766520616e79206c656164696e67207a65726f7320286c6f60648201527f6e67206c69737429000000000000000000000000000000000000000000000000608482015260a401610bd3565b600184015160088302610100031c60378111614b81576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604660248201527f524c505265616465723a206c656e677468206f6620636f6e74656e74206d757360448201527f742062652067726561746572207468616e20353520627974657320286c6f6e6760648201527f206c697374290000000000000000000000000000000000000000000000000000608482015260a401610bd3565b614b8b81846157fc565b895111614c40576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604a60248201527f524c505265616465723a206c656e677468206f6620636f6e74656e74206d757360448201527f742062652067726561746572207468616e20746f74616c206c656e677468202860648201527f6c6f6e67206c6973742900000000000000000000000000000000000000000000608482015260a401610bd3565b614c4b8360016157fc565b9750955060019450614c5d9350505050565b9193909250565b60608167ffffffffffffffff811115614c7f57614c7f615281565b6040519080825280601f01601f191660200182016040528015614ca9576020820181803683370190505b50905081156129bb576000614cbe84866157fc565b90506020820160005b84811015614cdf578281015182820152602001614cc7565b84811115614cee576000858301525b5050509392505050565b60606110e8826020015160008460000151614c64565b60608182601f011015614d7d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f736c6963655f6f766572666c6f770000000000000000000000000000000000006044820152606401610bd3565b828284011015614de9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f736c6963655f6f766572666c6f770000000000000000000000000000000000006044820152606401610bd3565b81830184511015614e56576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f736c6963655f6f75744f66426f756e64730000000000000000000000000000006044820152606401610bd3565b606082158015614e755760405191506000825260208201604052614edd565b6040519150601f8416801560200281840101858101878315602002848b0101015b81831015614eae578051835260209283019201614e96565b5050858452601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016604052505b50949350505050565b60408051808201909152600080825260208201526000825111614fb1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604a60248201527f524c505265616465723a206c656e677468206f6620616e20524c50206974656d60448201527f206d7573742062652067726561746572207468616e207a65726f20746f20626560648201527f206465636f6461626c6500000000000000000000000000000000000000000000608482015260a401610bd3565b50604080518082019091528151815260209182019181019190915290565b60606000806000614fdf856141f7565b919450925090506001816001811115614ffa57614ffa615f31565b14615087576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603860248201527f524c505265616465723a206465636f646564206974656d207479706520666f7260448201527f206c697374206973206e6f742061206c697374206974656d00000000000000006064820152608401610bd3565b845161509383856157fc565b14615120576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f524c505265616465723a206c697374206974656d2068617320616e20696e766160448201527f6c696420646174612072656d61696e64657200000000000000000000000000006064820152608401610bd3565b604080516020808252610420820190925290816020015b60408051808201909152600080825260208201528152602001906001900390816151375790505093506000835b8651811015615225576000806151aa6040518060400160405280858c6000015161518e9190615a5c565b8152602001858c602001516151a391906157fc565b90526141f7565b5091509150604051806040016040528083836151c691906157fc565b8152602001848b602001516151db91906157fc565b8152508885815181106151f0576151f0615ea1565b60209081029190910101526152066001856157fc565b935061521281836157fc565b61521c90846157fc565b92505050615164565b50845250919392505050565b73ffffffffffffffffffffffffffffffffffffffff8116811461525357600080fd5b50565b803567ffffffffffffffff8116811461526e57600080fd5b919050565b801515811461525357600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156152f7576152f7615281565b604052919050565b600082601f83011261531057600080fd5b813567ffffffffffffffff81111561532a5761532a615281565b61535b60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016152b0565b81815284602083860101111561537057600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060008060c087890312156153a657600080fd5b86356153b181615231565b955060208701359450604087013593506153cd60608801615256565b925060808701356153dd81615273565b915060a087013567ffffffffffffffff8111156153f957600080fd5b61540589828a016152ff565b9150509295509295509295565b600060c0828403121561542457600080fd5b60405160c0810167ffffffffffffffff828210818311171561544857615448615281565b81604052829350843583526020850135915061546382615231565b8160208401526040850135915061547982615231565b816040840152606085013560608401526080850135608084015260a08501359150808211156154a757600080fd5b506154b4858286016152ff565b60a0830152505092915050565b600080600080600085870360e08112156154da57600080fd5b863567ffffffffffffffff808211156154f257600080fd5b6154fe8a838b01615412565b97506020890135965060807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08401121561553757600080fd5b60408901955060c089013592508083111561555157600080fd5b828901925089601f84011261556557600080fd5b823591508082111561557657600080fd5b508860208260051b840101111561558c57600080fd5b959894975092955050506020019190565b60005b838110156155b85781810151838201526020016155a0565b83811115611fed5750506000910152565b600081518084526155e181602086016020860161559d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006129bb60208301846155c9565b60006020828403121561563857600080fd5b5035919050565b60ff8116811461525357600080fd5b6000806000806080858703121561566457600080fd5b843561566f81615231565b9350602085013561567f8161563f565b93969395505050506040820135916060013590565b6000602082840312156156a657600080fd5b813567ffffffffffffffff8111156156bd57600080fd5b6156c984828501615412565b949350505050565b6000602082840312156156e357600080fd5b6129bb82615256565b60008060006060848603121561570157600080fd5b833561570c81615231565b9250602084013561571c81615231565b9150604084013561572c81615231565b809150509250925092565b600080600080600060a0868803121561574f57600080fd5b853561575a81615231565b94506020860135935061576f60408701615256565b9250606086013561577f81615273565b9150608086013567ffffffffffffffff81111561579b57600080fd5b6157a7888289016152ff565b9150509295509295909350565b6000602082840312156157c657600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000821982111561580f5761580f6157cd565b500190565b6000806040838503121561582757600080fd5b825161583281615231565b60208401519092506158438161563f565b809150509250929050565b60006020828403121561586057600080fd5b81516129bb81615231565b80516fffffffffffffffffffffffffffffffff8116811461526e57600080fd5b60006060828403121561589d57600080fd5b6040516060810181811067ffffffffffffffff821117156158c0576158c0615281565b604052825181526158d36020840161586b565b60208201526158e46040840161586b565b60408201529392505050565b60006080828403121561590257600080fd5b6040516080810181811067ffffffffffffffff8211171561592557615925615281565b8060405250823581526020830135602082015260408301356040820152606083013560608201528091505092915050565b600067ffffffffffffffff8084111561597157615971615281565b8360051b60206159828183016152b0565b86815291850191818101903684111561599a57600080fd5b865b848110156159ce578035868111156159b45760008081fd5b6159c036828b016152ff565b84525091830191830161599c565b50979650505050505050565b6000602082840312156159ec57600080fd5b81516129bb81615273565b8581528460208201527fffffffffffffffff0000000000000000000000000000000000000000000000008460c01b16604082015282151560f81b604882015260008251615a4b81604985016020870161559d565b919091016049019695505050505050565b600082821015615a6e57615a6e6157cd565b500390565b600067ffffffffffffffff80831681851681830481118215151615615a9a57615a9a6157cd565b02949350505050565b600067ffffffffffffffff808316818516808303821115615ac657615ac66157cd565b01949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082615b0d57615b0d615acf565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83147f800000000000000000000000000000000000000000000000000000000000000083141615615b6157615b616157cd565b500590565b6000808312837f800000000000000000000000000000000000000000000000000000000000000001831281151615615ba057615ba06157cd565b837f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018313811615615bd457615bd46157cd565b50500390565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600084136000841385830485118282161615615c1b57615c1b6157cd565b7f80000000000000000000000000000000000000000000000000000000000000006000871286820588128184161615615c5657615c566157cd565b60008712925087820587128484161615615c7257615c726157cd565b87850587128184161615615c8857615c886157cd565b505050929093029392505050565b6000808212827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03841381151615615cd057615cd06157cd565b827f8000000000000000000000000000000000000000000000000000000000000000038412811615615d0457615d046157cd565b50500190565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615615d4257615d426157cd565b500290565b600082615d5657615d56615acf565b500490565b868152600073ffffffffffffffffffffffffffffffffffffffff808816602084015280871660408401525084606083015283608083015260c060a0830152615da660c08301846155c9565b98975050505050505050565b805163ffffffff8116811461526e57600080fd5b600060c08284031215615dd857600080fd5b60405160c0810181811067ffffffffffffffff82111715615dfb57615dfb615281565b604052615e0783615db2565b81526020830151615e178161563f565b60208201526040830151615e2a8161563f565b6040820152615e3b60608401615db2565b6060820152615e4c60808401615db2565b6080820152615e5d60a0840161586b565b60a08201529392505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203615e9a57615e9a6157cd565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060ff831680615ee357615ee3615acf565b8060ff84160691505092915050565b600060ff821660ff841680821015615f0c57615f0c6157cd565b90039392505050565b60008251615f2781846020870161559d565b9190910192915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fdfea164736f6c634300080f000a", +} + +// OptimismPortalABI is the input ABI used to generate the binding from. +// Deprecated: Use OptimismPortalMetaData.ABI instead. +var OptimismPortalABI = OptimismPortalMetaData.ABI + +// OptimismPortalBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use OptimismPortalMetaData.Bin instead. +var OptimismPortalBin = OptimismPortalMetaData.Bin + +// DeployOptimismPortal deploys a new Ethereum contract, binding an instance of OptimismPortal to it. +func DeployOptimismPortal(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *OptimismPortal, error) { + parsed, err := OptimismPortalMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(OptimismPortalBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &OptimismPortal{OptimismPortalCaller: OptimismPortalCaller{contract: contract}, OptimismPortalTransactor: OptimismPortalTransactor{contract: contract}, OptimismPortalFilterer: OptimismPortalFilterer{contract: contract}}, nil +} + +// OptimismPortal is an auto generated Go binding around an Ethereum contract. +type OptimismPortal struct { + OptimismPortalCaller // Read-only binding to the contract + OptimismPortalTransactor // Write-only binding to the contract + OptimismPortalFilterer // Log filterer for contract events +} + +// OptimismPortalCaller is an auto generated read-only Go binding around an Ethereum contract. +type OptimismPortalCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// OptimismPortalTransactor is an auto generated write-only Go binding around an Ethereum contract. +type OptimismPortalTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// OptimismPortalFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type OptimismPortalFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// OptimismPortalSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type OptimismPortalSession struct { + Contract *OptimismPortal // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// OptimismPortalCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type OptimismPortalCallerSession struct { + Contract *OptimismPortalCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// OptimismPortalTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type OptimismPortalTransactorSession struct { + Contract *OptimismPortalTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// OptimismPortalRaw is an auto generated low-level Go binding around an Ethereum contract. +type OptimismPortalRaw struct { + Contract *OptimismPortal // Generic contract binding to access the raw methods on +} + +// OptimismPortalCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type OptimismPortalCallerRaw struct { + Contract *OptimismPortalCaller // Generic read-only contract binding to access the raw methods on +} + +// OptimismPortalTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type OptimismPortalTransactorRaw struct { + Contract *OptimismPortalTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewOptimismPortal creates a new instance of OptimismPortal, bound to a specific deployed contract. +func NewOptimismPortal(address common.Address, backend bind.ContractBackend) (*OptimismPortal, error) { + contract, err := bindOptimismPortal(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &OptimismPortal{OptimismPortalCaller: OptimismPortalCaller{contract: contract}, OptimismPortalTransactor: OptimismPortalTransactor{contract: contract}, OptimismPortalFilterer: OptimismPortalFilterer{contract: contract}}, nil +} + +// NewOptimismPortalCaller creates a new read-only instance of OptimismPortal, bound to a specific deployed contract. +func NewOptimismPortalCaller(address common.Address, caller bind.ContractCaller) (*OptimismPortalCaller, error) { + contract, err := bindOptimismPortal(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &OptimismPortalCaller{contract: contract}, nil +} + +// NewOptimismPortalTransactor creates a new write-only instance of OptimismPortal, bound to a specific deployed contract. +func NewOptimismPortalTransactor(address common.Address, transactor bind.ContractTransactor) (*OptimismPortalTransactor, error) { + contract, err := bindOptimismPortal(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &OptimismPortalTransactor{contract: contract}, nil +} + +// NewOptimismPortalFilterer creates a new log filterer instance of OptimismPortal, bound to a specific deployed contract. +func NewOptimismPortalFilterer(address common.Address, filterer bind.ContractFilterer) (*OptimismPortalFilterer, error) { + contract, err := bindOptimismPortal(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &OptimismPortalFilterer{contract: contract}, nil +} + +// bindOptimismPortal binds a generic wrapper to an already deployed contract. +func bindOptimismPortal(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(OptimismPortalABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_OptimismPortal *OptimismPortalRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _OptimismPortal.Contract.OptimismPortalCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_OptimismPortal *OptimismPortalRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OptimismPortal.Contract.OptimismPortalTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_OptimismPortal *OptimismPortalRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _OptimismPortal.Contract.OptimismPortalTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_OptimismPortal *OptimismPortalCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _OptimismPortal.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_OptimismPortal *OptimismPortalTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OptimismPortal.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_OptimismPortal *OptimismPortalTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _OptimismPortal.Contract.contract.Transact(opts, method, params...) +} + +// Balance is a free data retrieval call binding the contract method 0xb69ef8a8. +// +// Solidity: function balance() view returns(uint256) +func (_OptimismPortal *OptimismPortalCaller) Balance(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _OptimismPortal.contract.Call(opts, &out, "balance") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Balance is a free data retrieval call binding the contract method 0xb69ef8a8. +// +// Solidity: function balance() view returns(uint256) +func (_OptimismPortal *OptimismPortalSession) Balance() (*big.Int, error) { + return _OptimismPortal.Contract.Balance(&_OptimismPortal.CallOpts) +} + +// Balance is a free data retrieval call binding the contract method 0xb69ef8a8. +// +// Solidity: function balance() view returns(uint256) +func (_OptimismPortal *OptimismPortalCallerSession) Balance() (*big.Int, error) { + return _OptimismPortal.Contract.Balance(&_OptimismPortal.CallOpts) +} + +// FinalizedWithdrawals is a free data retrieval call binding the contract method 0xa14238e7. +// +// Solidity: function finalizedWithdrawals(bytes32 ) view returns(bool) +func (_OptimismPortal *OptimismPortalCaller) FinalizedWithdrawals(opts *bind.CallOpts, arg0 [32]byte) (bool, error) { + var out []interface{} + err := _OptimismPortal.contract.Call(opts, &out, "finalizedWithdrawals", arg0) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// FinalizedWithdrawals is a free data retrieval call binding the contract method 0xa14238e7. +// +// Solidity: function finalizedWithdrawals(bytes32 ) view returns(bool) +func (_OptimismPortal *OptimismPortalSession) FinalizedWithdrawals(arg0 [32]byte) (bool, error) { + return _OptimismPortal.Contract.FinalizedWithdrawals(&_OptimismPortal.CallOpts, arg0) +} + +// FinalizedWithdrawals is a free data retrieval call binding the contract method 0xa14238e7. +// +// Solidity: function finalizedWithdrawals(bytes32 ) view returns(bool) +func (_OptimismPortal *OptimismPortalCallerSession) FinalizedWithdrawals(arg0 [32]byte) (bool, error) { + return _OptimismPortal.Contract.FinalizedWithdrawals(&_OptimismPortal.CallOpts, arg0) +} + +// GasPayingToken is a free data retrieval call binding the contract method 0x4397dfef. +// +// Solidity: function gasPayingToken() view returns(address addr_, uint8 decimals_) +func (_OptimismPortal *OptimismPortalCaller) GasPayingToken(opts *bind.CallOpts) (struct { + Addr common.Address + Decimals uint8 +}, error) { + var out []interface{} + err := _OptimismPortal.contract.Call(opts, &out, "gasPayingToken") + + outstruct := new(struct { + Addr common.Address + Decimals uint8 + }) + if err != nil { + return *outstruct, err + } + + outstruct.Addr = *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + outstruct.Decimals = *abi.ConvertType(out[1], new(uint8)).(*uint8) + + return *outstruct, err + +} + +// GasPayingToken is a free data retrieval call binding the contract method 0x4397dfef. +// +// Solidity: function gasPayingToken() view returns(address addr_, uint8 decimals_) +func (_OptimismPortal *OptimismPortalSession) GasPayingToken() (struct { + Addr common.Address + Decimals uint8 +}, error) { + return _OptimismPortal.Contract.GasPayingToken(&_OptimismPortal.CallOpts) +} + +// GasPayingToken is a free data retrieval call binding the contract method 0x4397dfef. +// +// Solidity: function gasPayingToken() view returns(address addr_, uint8 decimals_) +func (_OptimismPortal *OptimismPortalCallerSession) GasPayingToken() (struct { + Addr common.Address + Decimals uint8 +}, error) { + return _OptimismPortal.Contract.GasPayingToken(&_OptimismPortal.CallOpts) +} + +// Guardian is a free data retrieval call binding the contract method 0x452a9320. +// +// Solidity: function guardian() view returns(address) +func (_OptimismPortal *OptimismPortalCaller) Guardian(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _OptimismPortal.contract.Call(opts, &out, "guardian") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Guardian is a free data retrieval call binding the contract method 0x452a9320. +// +// Solidity: function guardian() view returns(address) +func (_OptimismPortal *OptimismPortalSession) Guardian() (common.Address, error) { + return _OptimismPortal.Contract.Guardian(&_OptimismPortal.CallOpts) +} + +// Guardian is a free data retrieval call binding the contract method 0x452a9320. +// +// Solidity: function guardian() view returns(address) +func (_OptimismPortal *OptimismPortalCallerSession) Guardian() (common.Address, error) { + return _OptimismPortal.Contract.Guardian(&_OptimismPortal.CallOpts) +} + +// IsOutputFinalized is a free data retrieval call binding the contract method 0x6dbffb78. +// +// Solidity: function isOutputFinalized(uint256 _l2OutputIndex) view returns(bool) +func (_OptimismPortal *OptimismPortalCaller) IsOutputFinalized(opts *bind.CallOpts, _l2OutputIndex *big.Int) (bool, error) { + var out []interface{} + err := _OptimismPortal.contract.Call(opts, &out, "isOutputFinalized", _l2OutputIndex) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsOutputFinalized is a free data retrieval call binding the contract method 0x6dbffb78. +// +// Solidity: function isOutputFinalized(uint256 _l2OutputIndex) view returns(bool) +func (_OptimismPortal *OptimismPortalSession) IsOutputFinalized(_l2OutputIndex *big.Int) (bool, error) { + return _OptimismPortal.Contract.IsOutputFinalized(&_OptimismPortal.CallOpts, _l2OutputIndex) +} + +// IsOutputFinalized is a free data retrieval call binding the contract method 0x6dbffb78. +// +// Solidity: function isOutputFinalized(uint256 _l2OutputIndex) view returns(bool) +func (_OptimismPortal *OptimismPortalCallerSession) IsOutputFinalized(_l2OutputIndex *big.Int) (bool, error) { + return _OptimismPortal.Contract.IsOutputFinalized(&_OptimismPortal.CallOpts, _l2OutputIndex) +} + +// L2Oracle is a free data retrieval call binding the contract method 0x9b5f694a. +// +// Solidity: function l2Oracle() view returns(address) +func (_OptimismPortal *OptimismPortalCaller) L2Oracle(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _OptimismPortal.contract.Call(opts, &out, "l2Oracle") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// L2Oracle is a free data retrieval call binding the contract method 0x9b5f694a. +// +// Solidity: function l2Oracle() view returns(address) +func (_OptimismPortal *OptimismPortalSession) L2Oracle() (common.Address, error) { + return _OptimismPortal.Contract.L2Oracle(&_OptimismPortal.CallOpts) +} + +// L2Oracle is a free data retrieval call binding the contract method 0x9b5f694a. +// +// Solidity: function l2Oracle() view returns(address) +func (_OptimismPortal *OptimismPortalCallerSession) L2Oracle() (common.Address, error) { + return _OptimismPortal.Contract.L2Oracle(&_OptimismPortal.CallOpts) +} + +// L2Sender is a free data retrieval call binding the contract method 0x9bf62d82. +// +// Solidity: function l2Sender() view returns(address) +func (_OptimismPortal *OptimismPortalCaller) L2Sender(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _OptimismPortal.contract.Call(opts, &out, "l2Sender") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// L2Sender is a free data retrieval call binding the contract method 0x9bf62d82. +// +// Solidity: function l2Sender() view returns(address) +func (_OptimismPortal *OptimismPortalSession) L2Sender() (common.Address, error) { + return _OptimismPortal.Contract.L2Sender(&_OptimismPortal.CallOpts) +} + +// L2Sender is a free data retrieval call binding the contract method 0x9bf62d82. +// +// Solidity: function l2Sender() view returns(address) +func (_OptimismPortal *OptimismPortalCallerSession) L2Sender() (common.Address, error) { + return _OptimismPortal.Contract.L2Sender(&_OptimismPortal.CallOpts) +} + +// MinimumGasLimit is a free data retrieval call binding the contract method 0xa35d99df. +// +// Solidity: function minimumGasLimit(uint64 _byteCount) pure returns(uint64) +func (_OptimismPortal *OptimismPortalCaller) MinimumGasLimit(opts *bind.CallOpts, _byteCount uint64) (uint64, error) { + var out []interface{} + err := _OptimismPortal.contract.Call(opts, &out, "minimumGasLimit", _byteCount) + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// MinimumGasLimit is a free data retrieval call binding the contract method 0xa35d99df. +// +// Solidity: function minimumGasLimit(uint64 _byteCount) pure returns(uint64) +func (_OptimismPortal *OptimismPortalSession) MinimumGasLimit(_byteCount uint64) (uint64, error) { + return _OptimismPortal.Contract.MinimumGasLimit(&_OptimismPortal.CallOpts, _byteCount) +} + +// MinimumGasLimit is a free data retrieval call binding the contract method 0xa35d99df. +// +// Solidity: function minimumGasLimit(uint64 _byteCount) pure returns(uint64) +func (_OptimismPortal *OptimismPortalCallerSession) MinimumGasLimit(_byteCount uint64) (uint64, error) { + return _OptimismPortal.Contract.MinimumGasLimit(&_OptimismPortal.CallOpts, _byteCount) +} + +// Params is a free data retrieval call binding the contract method 0xcff0ab96. +// +// Solidity: function params() view returns(uint128 prevBaseFee, uint64 prevBoughtGas, uint64 prevBlockNum) +func (_OptimismPortal *OptimismPortalCaller) Params(opts *bind.CallOpts) (struct { + PrevBaseFee *big.Int + PrevBoughtGas uint64 + PrevBlockNum uint64 +}, error) { + var out []interface{} + err := _OptimismPortal.contract.Call(opts, &out, "params") + + outstruct := new(struct { + PrevBaseFee *big.Int + PrevBoughtGas uint64 + PrevBlockNum uint64 + }) + if err != nil { + return *outstruct, err + } + + outstruct.PrevBaseFee = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + outstruct.PrevBoughtGas = *abi.ConvertType(out[1], new(uint64)).(*uint64) + outstruct.PrevBlockNum = *abi.ConvertType(out[2], new(uint64)).(*uint64) + + return *outstruct, err + +} + +// Params is a free data retrieval call binding the contract method 0xcff0ab96. +// +// Solidity: function params() view returns(uint128 prevBaseFee, uint64 prevBoughtGas, uint64 prevBlockNum) +func (_OptimismPortal *OptimismPortalSession) Params() (struct { + PrevBaseFee *big.Int + PrevBoughtGas uint64 + PrevBlockNum uint64 +}, error) { + return _OptimismPortal.Contract.Params(&_OptimismPortal.CallOpts) +} + +// Params is a free data retrieval call binding the contract method 0xcff0ab96. +// +// Solidity: function params() view returns(uint128 prevBaseFee, uint64 prevBoughtGas, uint64 prevBlockNum) +func (_OptimismPortal *OptimismPortalCallerSession) Params() (struct { + PrevBaseFee *big.Int + PrevBoughtGas uint64 + PrevBlockNum uint64 +}, error) { + return _OptimismPortal.Contract.Params(&_OptimismPortal.CallOpts) +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool paused_) +func (_OptimismPortal *OptimismPortalCaller) Paused(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _OptimismPortal.contract.Call(opts, &out, "paused") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool paused_) +func (_OptimismPortal *OptimismPortalSession) Paused() (bool, error) { + return _OptimismPortal.Contract.Paused(&_OptimismPortal.CallOpts) +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool paused_) +func (_OptimismPortal *OptimismPortalCallerSession) Paused() (bool, error) { + return _OptimismPortal.Contract.Paused(&_OptimismPortal.CallOpts) +} + +// ProvenWithdrawals is a free data retrieval call binding the contract method 0xe965084c. +// +// Solidity: function provenWithdrawals(bytes32 ) view returns(bytes32 outputRoot, uint128 timestamp, uint128 l2OutputIndex) +func (_OptimismPortal *OptimismPortalCaller) ProvenWithdrawals(opts *bind.CallOpts, arg0 [32]byte) (struct { + OutputRoot [32]byte + Timestamp *big.Int + L2OutputIndex *big.Int +}, error) { + var out []interface{} + err := _OptimismPortal.contract.Call(opts, &out, "provenWithdrawals", arg0) + + outstruct := new(struct { + OutputRoot [32]byte + Timestamp *big.Int + L2OutputIndex *big.Int + }) + if err != nil { + return *outstruct, err + } + + outstruct.OutputRoot = *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + outstruct.Timestamp = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + outstruct.L2OutputIndex = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) + + return *outstruct, err + +} + +// ProvenWithdrawals is a free data retrieval call binding the contract method 0xe965084c. +// +// Solidity: function provenWithdrawals(bytes32 ) view returns(bytes32 outputRoot, uint128 timestamp, uint128 l2OutputIndex) +func (_OptimismPortal *OptimismPortalSession) ProvenWithdrawals(arg0 [32]byte) (struct { + OutputRoot [32]byte + Timestamp *big.Int + L2OutputIndex *big.Int +}, error) { + return _OptimismPortal.Contract.ProvenWithdrawals(&_OptimismPortal.CallOpts, arg0) +} + +// ProvenWithdrawals is a free data retrieval call binding the contract method 0xe965084c. +// +// Solidity: function provenWithdrawals(bytes32 ) view returns(bytes32 outputRoot, uint128 timestamp, uint128 l2OutputIndex) +func (_OptimismPortal *OptimismPortalCallerSession) ProvenWithdrawals(arg0 [32]byte) (struct { + OutputRoot [32]byte + Timestamp *big.Int + L2OutputIndex *big.Int +}, error) { + return _OptimismPortal.Contract.ProvenWithdrawals(&_OptimismPortal.CallOpts, arg0) +} + +// SuperchainConfig is a free data retrieval call binding the contract method 0x35e80ab3. +// +// Solidity: function superchainConfig() view returns(address) +func (_OptimismPortal *OptimismPortalCaller) SuperchainConfig(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _OptimismPortal.contract.Call(opts, &out, "superchainConfig") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// SuperchainConfig is a free data retrieval call binding the contract method 0x35e80ab3. +// +// Solidity: function superchainConfig() view returns(address) +func (_OptimismPortal *OptimismPortalSession) SuperchainConfig() (common.Address, error) { + return _OptimismPortal.Contract.SuperchainConfig(&_OptimismPortal.CallOpts) +} + +// SuperchainConfig is a free data retrieval call binding the contract method 0x35e80ab3. +// +// Solidity: function superchainConfig() view returns(address) +func (_OptimismPortal *OptimismPortalCallerSession) SuperchainConfig() (common.Address, error) { + return _OptimismPortal.Contract.SuperchainConfig(&_OptimismPortal.CallOpts) +} + +// SystemConfig is a free data retrieval call binding the contract method 0x33d7e2bd. +// +// Solidity: function systemConfig() view returns(address) +func (_OptimismPortal *OptimismPortalCaller) SystemConfig(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _OptimismPortal.contract.Call(opts, &out, "systemConfig") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// SystemConfig is a free data retrieval call binding the contract method 0x33d7e2bd. +// +// Solidity: function systemConfig() view returns(address) +func (_OptimismPortal *OptimismPortalSession) SystemConfig() (common.Address, error) { + return _OptimismPortal.Contract.SystemConfig(&_OptimismPortal.CallOpts) +} + +// SystemConfig is a free data retrieval call binding the contract method 0x33d7e2bd. +// +// Solidity: function systemConfig() view returns(address) +func (_OptimismPortal *OptimismPortalCallerSession) SystemConfig() (common.Address, error) { + return _OptimismPortal.Contract.SystemConfig(&_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) +} + +// DepositERC20Transaction is a paid mutator transaction binding the contract method 0x149f2f22. +// +// Solidity: function depositERC20Transaction(address _to, uint256 _mint, uint256 _value, uint64 _gasLimit, bool _isCreation, bytes _data) returns() +func (_OptimismPortal *OptimismPortalTransactor) DepositERC20Transaction(opts *bind.TransactOpts, _to common.Address, _mint *big.Int, _value *big.Int, _gasLimit uint64, _isCreation bool, _data []byte) (*types.Transaction, error) { + return _OptimismPortal.contract.Transact(opts, "depositERC20Transaction", _to, _mint, _value, _gasLimit, _isCreation, _data) +} + +// DepositERC20Transaction is a paid mutator transaction binding the contract method 0x149f2f22. +// +// Solidity: function depositERC20Transaction(address _to, uint256 _mint, uint256 _value, uint64 _gasLimit, bool _isCreation, bytes _data) returns() +func (_OptimismPortal *OptimismPortalSession) DepositERC20Transaction(_to common.Address, _mint *big.Int, _value *big.Int, _gasLimit uint64, _isCreation bool, _data []byte) (*types.Transaction, error) { + return _OptimismPortal.Contract.DepositERC20Transaction(&_OptimismPortal.TransactOpts, _to, _mint, _value, _gasLimit, _isCreation, _data) +} + +// DepositERC20Transaction is a paid mutator transaction binding the contract method 0x149f2f22. +// +// Solidity: function depositERC20Transaction(address _to, uint256 _mint, uint256 _value, uint64 _gasLimit, bool _isCreation, bytes _data) returns() +func (_OptimismPortal *OptimismPortalTransactorSession) DepositERC20Transaction(_to common.Address, _mint *big.Int, _value *big.Int, _gasLimit uint64, _isCreation bool, _data []byte) (*types.Transaction, error) { + return _OptimismPortal.Contract.DepositERC20Transaction(&_OptimismPortal.TransactOpts, _to, _mint, _value, _gasLimit, _isCreation, _data) +} + +// 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() +func (_OptimismPortal *OptimismPortalTransactor) DepositTransaction(opts *bind.TransactOpts, _to common.Address, _value *big.Int, _gasLimit uint64, _isCreation bool, _data []byte) (*types.Transaction, error) { + return _OptimismPortal.contract.Transact(opts, "depositTransaction", _to, _value, _gasLimit, _isCreation, _data) +} + +// 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() +func (_OptimismPortal *OptimismPortalSession) DepositTransaction(_to common.Address, _value *big.Int, _gasLimit uint64, _isCreation bool, _data []byte) (*types.Transaction, error) { + return _OptimismPortal.Contract.DepositTransaction(&_OptimismPortal.TransactOpts, _to, _value, _gasLimit, _isCreation, _data) +} + +// 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() +func (_OptimismPortal *OptimismPortalTransactorSession) DepositTransaction(_to common.Address, _value *big.Int, _gasLimit uint64, _isCreation bool, _data []byte) (*types.Transaction, error) { + return _OptimismPortal.Contract.DepositTransaction(&_OptimismPortal.TransactOpts, _to, _value, _gasLimit, _isCreation, _data) +} + +// DonateETH is a paid mutator transaction binding the contract method 0x8b4c40b0. +// +// Solidity: function donateETH() payable returns() +func (_OptimismPortal *OptimismPortalTransactor) DonateETH(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OptimismPortal.contract.Transact(opts, "donateETH") +} + +// DonateETH is a paid mutator transaction binding the contract method 0x8b4c40b0. +// +// Solidity: function donateETH() payable returns() +func (_OptimismPortal *OptimismPortalSession) DonateETH() (*types.Transaction, error) { + return _OptimismPortal.Contract.DonateETH(&_OptimismPortal.TransactOpts) +} + +// DonateETH is a paid mutator transaction binding the contract method 0x8b4c40b0. +// +// Solidity: function donateETH() payable returns() +func (_OptimismPortal *OptimismPortalTransactorSession) DonateETH() (*types.Transaction, error) { + return _OptimismPortal.Contract.DonateETH(&_OptimismPortal.TransactOpts) +} + +// FinalizeWithdrawalTransaction is a paid mutator transaction binding the contract method 0x8c3152e9. +// +// Solidity: function finalizeWithdrawalTransaction((uint256,address,address,uint256,uint256,bytes) _tx) returns() +func (_OptimismPortal *OptimismPortalTransactor) FinalizeWithdrawalTransaction(opts *bind.TransactOpts, _tx TypesWithdrawalTransaction) (*types.Transaction, error) { + return _OptimismPortal.contract.Transact(opts, "finalizeWithdrawalTransaction", _tx) +} + +// FinalizeWithdrawalTransaction is a paid mutator transaction binding the contract method 0x8c3152e9. +// +// Solidity: function finalizeWithdrawalTransaction((uint256,address,address,uint256,uint256,bytes) _tx) returns() +func (_OptimismPortal *OptimismPortalSession) FinalizeWithdrawalTransaction(_tx TypesWithdrawalTransaction) (*types.Transaction, error) { + return _OptimismPortal.Contract.FinalizeWithdrawalTransaction(&_OptimismPortal.TransactOpts, _tx) +} + +// FinalizeWithdrawalTransaction is a paid mutator transaction binding the contract method 0x8c3152e9. +// +// Solidity: function finalizeWithdrawalTransaction((uint256,address,address,uint256,uint256,bytes) _tx) returns() +func (_OptimismPortal *OptimismPortalTransactorSession) FinalizeWithdrawalTransaction(_tx TypesWithdrawalTransaction) (*types.Transaction, error) { + return _OptimismPortal.Contract.FinalizeWithdrawalTransaction(&_OptimismPortal.TransactOpts, _tx) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc0c53b8b. +// +// Solidity: function initialize(address _l2Oracle, address _systemConfig, address _superchainConfig) returns() +func (_OptimismPortal *OptimismPortalTransactor) Initialize(opts *bind.TransactOpts, _l2Oracle common.Address, _systemConfig common.Address, _superchainConfig common.Address) (*types.Transaction, error) { + return _OptimismPortal.contract.Transact(opts, "initialize", _l2Oracle, _systemConfig, _superchainConfig) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc0c53b8b. +// +// Solidity: function initialize(address _l2Oracle, address _systemConfig, address _superchainConfig) returns() +func (_OptimismPortal *OptimismPortalSession) Initialize(_l2Oracle common.Address, _systemConfig common.Address, _superchainConfig common.Address) (*types.Transaction, error) { + return _OptimismPortal.Contract.Initialize(&_OptimismPortal.TransactOpts, _l2Oracle, _systemConfig, _superchainConfig) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc0c53b8b. +// +// Solidity: function initialize(address _l2Oracle, address _systemConfig, address _superchainConfig) returns() +func (_OptimismPortal *OptimismPortalTransactorSession) Initialize(_l2Oracle common.Address, _systemConfig common.Address, _superchainConfig common.Address) (*types.Transaction, error) { + return _OptimismPortal.Contract.Initialize(&_OptimismPortal.TransactOpts, _l2Oracle, _systemConfig, _superchainConfig) +} + +// ProveWithdrawalTransaction is a paid mutator transaction binding the contract method 0x4870496f. +// +// Solidity: function proveWithdrawalTransaction((uint256,address,address,uint256,uint256,bytes) _tx, uint256 _l2OutputIndex, (bytes32,bytes32,bytes32,bytes32) _outputRootProof, bytes[] _withdrawalProof) returns() +func (_OptimismPortal *OptimismPortalTransactor) ProveWithdrawalTransaction(opts *bind.TransactOpts, _tx TypesWithdrawalTransaction, _l2OutputIndex *big.Int, _outputRootProof TypesOutputRootProof, _withdrawalProof [][]byte) (*types.Transaction, error) { + return _OptimismPortal.contract.Transact(opts, "proveWithdrawalTransaction", _tx, _l2OutputIndex, _outputRootProof, _withdrawalProof) +} + +// ProveWithdrawalTransaction is a paid mutator transaction binding the contract method 0x4870496f. +// +// Solidity: function proveWithdrawalTransaction((uint256,address,address,uint256,uint256,bytes) _tx, uint256 _l2OutputIndex, (bytes32,bytes32,bytes32,bytes32) _outputRootProof, bytes[] _withdrawalProof) returns() +func (_OptimismPortal *OptimismPortalSession) ProveWithdrawalTransaction(_tx TypesWithdrawalTransaction, _l2OutputIndex *big.Int, _outputRootProof TypesOutputRootProof, _withdrawalProof [][]byte) (*types.Transaction, error) { + return _OptimismPortal.Contract.ProveWithdrawalTransaction(&_OptimismPortal.TransactOpts, _tx, _l2OutputIndex, _outputRootProof, _withdrawalProof) +} + +// ProveWithdrawalTransaction is a paid mutator transaction binding the contract method 0x4870496f. +// +// Solidity: function proveWithdrawalTransaction((uint256,address,address,uint256,uint256,bytes) _tx, uint256 _l2OutputIndex, (bytes32,bytes32,bytes32,bytes32) _outputRootProof, bytes[] _withdrawalProof) returns() +func (_OptimismPortal *OptimismPortalTransactorSession) ProveWithdrawalTransaction(_tx TypesWithdrawalTransaction, _l2OutputIndex *big.Int, _outputRootProof TypesOutputRootProof, _withdrawalProof [][]byte) (*types.Transaction, error) { + return _OptimismPortal.Contract.ProveWithdrawalTransaction(&_OptimismPortal.TransactOpts, _tx, _l2OutputIndex, _outputRootProof, _withdrawalProof) +} + +// SetGasPayingToken is a paid mutator transaction binding the contract method 0x71cfaa3f. +// +// Solidity: function setGasPayingToken(address _token, uint8 _decimals, bytes32 _name, bytes32 _symbol) returns() +func (_OptimismPortal *OptimismPortalTransactor) SetGasPayingToken(opts *bind.TransactOpts, _token common.Address, _decimals uint8, _name [32]byte, _symbol [32]byte) (*types.Transaction, error) { + return _OptimismPortal.contract.Transact(opts, "setGasPayingToken", _token, _decimals, _name, _symbol) +} + +// SetGasPayingToken is a paid mutator transaction binding the contract method 0x71cfaa3f. +// +// Solidity: function setGasPayingToken(address _token, uint8 _decimals, bytes32 _name, bytes32 _symbol) returns() +func (_OptimismPortal *OptimismPortalSession) SetGasPayingToken(_token common.Address, _decimals uint8, _name [32]byte, _symbol [32]byte) (*types.Transaction, error) { + return _OptimismPortal.Contract.SetGasPayingToken(&_OptimismPortal.TransactOpts, _token, _decimals, _name, _symbol) +} + +// SetGasPayingToken is a paid mutator transaction binding the contract method 0x71cfaa3f. +// +// Solidity: function setGasPayingToken(address _token, uint8 _decimals, bytes32 _name, bytes32 _symbol) returns() +func (_OptimismPortal *OptimismPortalTransactorSession) SetGasPayingToken(_token common.Address, _decimals uint8, _name [32]byte, _symbol [32]byte) (*types.Transaction, error) { + return _OptimismPortal.Contract.SetGasPayingToken(&_OptimismPortal.TransactOpts, _token, _decimals, _name, _symbol) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_OptimismPortal *OptimismPortalTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OptimismPortal.contract.RawTransact(opts, nil) // calldata is disallowed for receive function +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_OptimismPortal *OptimismPortalSession) Receive() (*types.Transaction, error) { + return _OptimismPortal.Contract.Receive(&_OptimismPortal.TransactOpts) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_OptimismPortal *OptimismPortalTransactorSession) Receive() (*types.Transaction, error) { + return _OptimismPortal.Contract.Receive(&_OptimismPortal.TransactOpts) +} + +// OptimismPortalInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the OptimismPortal contract. +type OptimismPortalInitializedIterator struct { + Event *OptimismPortalInitialized // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *OptimismPortalInitializedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(OptimismPortalInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(OptimismPortalInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *OptimismPortalInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *OptimismPortalInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// OptimismPortalInitialized represents a Initialized event raised by the OptimismPortal contract. +type OptimismPortalInitialized struct { + Version uint8 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_OptimismPortal *OptimismPortalFilterer) FilterInitialized(opts *bind.FilterOpts) (*OptimismPortalInitializedIterator, error) { + + logs, sub, err := _OptimismPortal.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &OptimismPortalInitializedIterator{contract: _OptimismPortal.contract, event: "Initialized", logs: logs, sub: sub}, nil +} + +// WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_OptimismPortal *OptimismPortalFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *OptimismPortalInitialized) (event.Subscription, error) { + + logs, sub, err := _OptimismPortal.contract.WatchLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(OptimismPortalInitialized) + if err := _OptimismPortal.contract.UnpackLog(event, "Initialized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_OptimismPortal *OptimismPortalFilterer) ParseInitialized(log types.Log) (*OptimismPortalInitialized, error) { + event := new(OptimismPortalInitialized) + if err := _OptimismPortal.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// OptimismPortalTransactionDepositedIterator is returned from FilterTransactionDeposited and is used to iterate over the raw logs and unpacked data for TransactionDeposited events raised by the OptimismPortal contract. +type OptimismPortalTransactionDepositedIterator struct { + Event *OptimismPortalTransactionDeposited // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *OptimismPortalTransactionDepositedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(OptimismPortalTransactionDeposited) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(OptimismPortalTransactionDeposited) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *OptimismPortalTransactionDepositedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *OptimismPortalTransactionDepositedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// OptimismPortalTransactionDeposited represents a TransactionDeposited event raised by the OptimismPortal contract. +type OptimismPortalTransactionDeposited struct { + From common.Address + To common.Address + Version *big.Int + OpaqueData []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterTransactionDeposited is a free log retrieval operation binding the contract event 0xb3813568d9991fc951961fcb4c784893574240a28925604d09fc577c55bb7c32. +// +// 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 { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + 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, 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 0xb3813568d9991fc951961fcb4c784893574240a28925604d09fc577c55bb7c32. +// +// 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 { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + 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, versionRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(OptimismPortalTransactionDeposited) + if err := _OptimismPortal.contract.UnpackLog(event, "TransactionDeposited", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseTransactionDeposited is a log parse operation binding the contract event 0xb3813568d9991fc951961fcb4c784893574240a28925604d09fc577c55bb7c32. +// +// 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 { + return nil, err + } + event.Raw = log + return event, nil +} + +// OptimismPortalWithdrawalFinalizedIterator is returned from FilterWithdrawalFinalized and is used to iterate over the raw logs and unpacked data for WithdrawalFinalized events raised by the OptimismPortal contract. +type OptimismPortalWithdrawalFinalizedIterator struct { + Event *OptimismPortalWithdrawalFinalized // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *OptimismPortalWithdrawalFinalizedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(OptimismPortalWithdrawalFinalized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(OptimismPortalWithdrawalFinalized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *OptimismPortalWithdrawalFinalizedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *OptimismPortalWithdrawalFinalizedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// OptimismPortalWithdrawalFinalized represents a WithdrawalFinalized event raised by the OptimismPortal contract. +type OptimismPortalWithdrawalFinalized struct { + WithdrawalHash [32]byte + Success bool + Raw types.Log // Blockchain specific contextual infos +} + +// FilterWithdrawalFinalized is a free log retrieval operation binding the contract event 0xdb5c7652857aa163daadd670e116628fb42e869d8ac4251ef8971d9e5727df1b. +// +// Solidity: event WithdrawalFinalized(bytes32 indexed withdrawalHash, bool success) +func (_OptimismPortal *OptimismPortalFilterer) FilterWithdrawalFinalized(opts *bind.FilterOpts, withdrawalHash [][32]byte) (*OptimismPortalWithdrawalFinalizedIterator, error) { + + var withdrawalHashRule []interface{} + for _, withdrawalHashItem := range withdrawalHash { + withdrawalHashRule = append(withdrawalHashRule, withdrawalHashItem) + } + + logs, sub, err := _OptimismPortal.contract.FilterLogs(opts, "WithdrawalFinalized", withdrawalHashRule) + if err != nil { + return nil, err + } + return &OptimismPortalWithdrawalFinalizedIterator{contract: _OptimismPortal.contract, event: "WithdrawalFinalized", logs: logs, sub: sub}, nil +} + +// WatchWithdrawalFinalized is a free log subscription operation binding the contract event 0xdb5c7652857aa163daadd670e116628fb42e869d8ac4251ef8971d9e5727df1b. +// +// Solidity: event WithdrawalFinalized(bytes32 indexed withdrawalHash, bool success) +func (_OptimismPortal *OptimismPortalFilterer) WatchWithdrawalFinalized(opts *bind.WatchOpts, sink chan<- *OptimismPortalWithdrawalFinalized, withdrawalHash [][32]byte) (event.Subscription, error) { + + var withdrawalHashRule []interface{} + for _, withdrawalHashItem := range withdrawalHash { + withdrawalHashRule = append(withdrawalHashRule, withdrawalHashItem) + } + + logs, sub, err := _OptimismPortal.contract.WatchLogs(opts, "WithdrawalFinalized", withdrawalHashRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(OptimismPortalWithdrawalFinalized) + if err := _OptimismPortal.contract.UnpackLog(event, "WithdrawalFinalized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseWithdrawalFinalized is a log parse operation binding the contract event 0xdb5c7652857aa163daadd670e116628fb42e869d8ac4251ef8971d9e5727df1b. +// +// Solidity: event WithdrawalFinalized(bytes32 indexed withdrawalHash, bool success) +func (_OptimismPortal *OptimismPortalFilterer) ParseWithdrawalFinalized(log types.Log) (*OptimismPortalWithdrawalFinalized, error) { + event := new(OptimismPortalWithdrawalFinalized) + if err := _OptimismPortal.contract.UnpackLog(event, "WithdrawalFinalized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// OptimismPortalWithdrawalProvenIterator is returned from FilterWithdrawalProven and is used to iterate over the raw logs and unpacked data for WithdrawalProven events raised by the OptimismPortal contract. +type OptimismPortalWithdrawalProvenIterator struct { + Event *OptimismPortalWithdrawalProven // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *OptimismPortalWithdrawalProvenIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(OptimismPortalWithdrawalProven) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(OptimismPortalWithdrawalProven) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *OptimismPortalWithdrawalProvenIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *OptimismPortalWithdrawalProvenIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// OptimismPortalWithdrawalProven represents a WithdrawalProven event raised by the OptimismPortal contract. +type OptimismPortalWithdrawalProven struct { + WithdrawalHash [32]byte + From common.Address + To common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterWithdrawalProven is a free log retrieval operation binding the contract event 0x67a6208cfcc0801d50f6cbe764733f4fddf66ac0b04442061a8a8c0cb6b63f62. +// +// Solidity: event WithdrawalProven(bytes32 indexed withdrawalHash, address indexed from, address indexed to) +func (_OptimismPortal *OptimismPortalFilterer) FilterWithdrawalProven(opts *bind.FilterOpts, withdrawalHash [][32]byte, from []common.Address, to []common.Address) (*OptimismPortalWithdrawalProvenIterator, error) { + + var withdrawalHashRule []interface{} + for _, withdrawalHashItem := range withdrawalHash { + withdrawalHashRule = append(withdrawalHashRule, withdrawalHashItem) + } + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _OptimismPortal.contract.FilterLogs(opts, "WithdrawalProven", withdrawalHashRule, fromRule, toRule) + if err != nil { + return nil, err + } + return &OptimismPortalWithdrawalProvenIterator{contract: _OptimismPortal.contract, event: "WithdrawalProven", logs: logs, sub: sub}, nil +} + +// WatchWithdrawalProven is a free log subscription operation binding the contract event 0x67a6208cfcc0801d50f6cbe764733f4fddf66ac0b04442061a8a8c0cb6b63f62. +// +// Solidity: event WithdrawalProven(bytes32 indexed withdrawalHash, address indexed from, address indexed to) +func (_OptimismPortal *OptimismPortalFilterer) WatchWithdrawalProven(opts *bind.WatchOpts, sink chan<- *OptimismPortalWithdrawalProven, withdrawalHash [][32]byte, from []common.Address, to []common.Address) (event.Subscription, error) { + + var withdrawalHashRule []interface{} + for _, withdrawalHashItem := range withdrawalHash { + withdrawalHashRule = append(withdrawalHashRule, withdrawalHashItem) + } + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _OptimismPortal.contract.WatchLogs(opts, "WithdrawalProven", withdrawalHashRule, fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(OptimismPortalWithdrawalProven) + if err := _OptimismPortal.contract.UnpackLog(event, "WithdrawalProven", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseWithdrawalProven is a log parse operation binding the contract event 0x67a6208cfcc0801d50f6cbe764733f4fddf66ac0b04442061a8a8c0cb6b63f62. +// +// Solidity: event WithdrawalProven(bytes32 indexed withdrawalHash, address indexed from, address indexed to) +func (_OptimismPortal *OptimismPortalFilterer) ParseWithdrawalProven(log types.Log) (*OptimismPortalWithdrawalProven, error) { + event := new(OptimismPortalWithdrawalProven) + if err := _OptimismPortal.contract.UnpackLog(event, "WithdrawalProven", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/op-e2e2/bindings/permit2.go b/op-e2e2/bindings/permit2.go new file mode 100644 index 000000000000..9a380f0cee8a --- /dev/null +++ b/op-e2e2/bindings/permit2.go @@ -0,0 +1,1413 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// IAllowanceTransferAllowanceTransferDetails is an auto generated low-level Go binding around an user-defined struct. +type IAllowanceTransferAllowanceTransferDetails struct { + From common.Address + To common.Address + Amount *big.Int + Token common.Address +} + +// IAllowanceTransferPermitBatch is an auto generated low-level Go binding around an user-defined struct. +type IAllowanceTransferPermitBatch struct { + Details []IAllowanceTransferPermitDetails + Spender common.Address + SigDeadline *big.Int +} + +// IAllowanceTransferPermitDetails is an auto generated low-level Go binding around an user-defined struct. +type IAllowanceTransferPermitDetails struct { + Token common.Address + Amount *big.Int + Expiration *big.Int + Nonce *big.Int +} + +// IAllowanceTransferPermitSingle is an auto generated low-level Go binding around an user-defined struct. +type IAllowanceTransferPermitSingle struct { + Details IAllowanceTransferPermitDetails + Spender common.Address + SigDeadline *big.Int +} + +// IAllowanceTransferTokenSpenderPair is an auto generated low-level Go binding around an user-defined struct. +type IAllowanceTransferTokenSpenderPair struct { + Token common.Address + Spender common.Address +} + +// ISignatureTransferPermitBatchTransferFrom is an auto generated low-level Go binding around an user-defined struct. +type ISignatureTransferPermitBatchTransferFrom struct { + Permitted []ISignatureTransferTokenPermissions + Nonce *big.Int + Deadline *big.Int +} + +// ISignatureTransferPermitTransferFrom is an auto generated low-level Go binding around an user-defined struct. +type ISignatureTransferPermitTransferFrom struct { + Permitted ISignatureTransferTokenPermissions + Nonce *big.Int + Deadline *big.Int +} + +// ISignatureTransferSignatureTransferDetails is an auto generated low-level Go binding around an user-defined struct. +type ISignatureTransferSignatureTransferDetails struct { + To common.Address + RequestedAmount *big.Int +} + +// ISignatureTransferTokenPermissions is an auto generated low-level Go binding around an user-defined struct. +type ISignatureTransferTokenPermissions struct { + Token common.Address + Amount *big.Int +} + +// Permit2MetaData contains all meta data concerning the Permit2 contract. +var Permit2MetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"AllowanceExpired\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ExcessiveInvalidation\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"InsufficientAllowance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"maxAmount\",\"type\":\"uint256\"}],\"name\":\"InvalidAmount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidContractSignature\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidNonce\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSignature\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSignatureLength\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSigner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LengthMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"signatureDeadline\",\"type\":\"uint256\"}],\"name\":\"SignatureExpired\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint160\",\"name\":\"amount\",\"type\":\"uint160\"},{\"indexed\":false,\"internalType\":\"uint48\",\"name\":\"expiration\",\"type\":\"uint48\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"Lockdown\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint48\",\"name\":\"newNonce\",\"type\":\"uint48\"},{\"indexed\":false,\"internalType\":\"uint48\",\"name\":\"oldNonce\",\"type\":\"uint48\"}],\"name\":\"NonceInvalidation\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint160\",\"name\":\"amount\",\"type\":\"uint160\"},{\"indexed\":false,\"internalType\":\"uint48\",\"name\":\"expiration\",\"type\":\"uint48\"},{\"indexed\":false,\"internalType\":\"uint48\",\"name\":\"nonce\",\"type\":\"uint48\"}],\"name\":\"Permit\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"word\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"mask\",\"type\":\"uint256\"}],\"name\":\"UnorderedNonceInvalidation\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint160\",\"name\":\"amount\",\"type\":\"uint160\"},{\"internalType\":\"uint48\",\"name\":\"expiration\",\"type\":\"uint48\"},{\"internalType\":\"uint48\",\"name\":\"nonce\",\"type\":\"uint48\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint160\",\"name\":\"amount\",\"type\":\"uint160\"},{\"internalType\":\"uint48\",\"name\":\"expiration\",\"type\":\"uint48\"}],\"name\":\"approve\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint48\",\"name\":\"newNonce\",\"type\":\"uint48\"}],\"name\":\"invalidateNonces\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"wordPos\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"mask\",\"type\":\"uint256\"}],\"name\":\"invalidateUnorderedNonces\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"internalType\":\"structIAllowanceTransfer.TokenSpenderPair[]\",\"name\":\"approvals\",\"type\":\"tuple[]\"}],\"name\":\"lockdown\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"nonceBitmap\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint160\",\"name\":\"amount\",\"type\":\"uint160\"},{\"internalType\":\"uint48\",\"name\":\"expiration\",\"type\":\"uint48\"},{\"internalType\":\"uint48\",\"name\":\"nonce\",\"type\":\"uint48\"}],\"internalType\":\"structIAllowanceTransfer.PermitDetails[]\",\"name\":\"details\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"sigDeadline\",\"type\":\"uint256\"}],\"internalType\":\"structIAllowanceTransfer.PermitBatch\",\"name\":\"permitBatch\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"permit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint160\",\"name\":\"amount\",\"type\":\"uint160\"},{\"internalType\":\"uint48\",\"name\":\"expiration\",\"type\":\"uint48\"},{\"internalType\":\"uint48\",\"name\":\"nonce\",\"type\":\"uint48\"}],\"internalType\":\"structIAllowanceTransfer.PermitDetails\",\"name\":\"details\",\"type\":\"tuple\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"sigDeadline\",\"type\":\"uint256\"}],\"internalType\":\"structIAllowanceTransfer.PermitSingle\",\"name\":\"permitSingle\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"permit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structISignatureTransfer.TokenPermissions\",\"name\":\"permitted\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"structISignatureTransfer.PermitTransferFrom\",\"name\":\"permit\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"requestedAmount\",\"type\":\"uint256\"}],\"internalType\":\"structISignatureTransfer.SignatureTransferDetails\",\"name\":\"transferDetails\",\"type\":\"tuple\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"permitTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structISignatureTransfer.TokenPermissions[]\",\"name\":\"permitted\",\"type\":\"tuple[]\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"structISignatureTransfer.PermitBatchTransferFrom\",\"name\":\"permit\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"requestedAmount\",\"type\":\"uint256\"}],\"internalType\":\"structISignatureTransfer.SignatureTransferDetails[]\",\"name\":\"transferDetails\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"permitTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structISignatureTransfer.TokenPermissions\",\"name\":\"permitted\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"structISignatureTransfer.PermitTransferFrom\",\"name\":\"permit\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"requestedAmount\",\"type\":\"uint256\"}],\"internalType\":\"structISignatureTransfer.SignatureTransferDetails\",\"name\":\"transferDetails\",\"type\":\"tuple\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"witness\",\"type\":\"bytes32\"},{\"internalType\":\"string\",\"name\":\"witnessTypeString\",\"type\":\"string\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"permitWitnessTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structISignatureTransfer.TokenPermissions[]\",\"name\":\"permitted\",\"type\":\"tuple[]\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"structISignatureTransfer.PermitBatchTransferFrom\",\"name\":\"permit\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"requestedAmount\",\"type\":\"uint256\"}],\"internalType\":\"structISignatureTransfer.SignatureTransferDetails[]\",\"name\":\"transferDetails\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"witness\",\"type\":\"bytes32\"},{\"internalType\":\"string\",\"name\":\"witnessTypeString\",\"type\":\"string\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"permitWitnessTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint160\",\"name\":\"amount\",\"type\":\"uint160\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"internalType\":\"structIAllowanceTransfer.AllowanceTransferDetails[]\",\"name\":\"transferDetails\",\"type\":\"tuple[]\"}],\"name\":\"transferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint160\",\"name\":\"amount\",\"type\":\"uint160\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"transferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x60c0346100bb574660a052602081017f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86681527f9ac997416e8ff9d2ff6bebeb7149f65cdae5e32e2b90440b566bb3044041d36a60408301524660608301523060808301526080825260a082019180831060018060401b038411176100a557826040525190206080526123c090816100c1823960805181611b47015260a05181611b210152f35b634e487b7160e01b600052604160045260246000fd5b600080fdfe6040608081526004908136101561001557600080fd5b600090813560e01c80630d58b1db1461126c578063137c29fe146110755780632a2d80d114610db75780632b67b57014610bde57806330f28b7a14610ade5780633644e51514610a9d57806336c7851614610a285780633ff9dcb1146109a85780634fe02b441461093f57806365d9723c146107ac57806387517c451461067a578063927da105146105c3578063cc53287f146104a3578063edd9444b1461033a5763fe8ec1a7146100c657600080fd5b346103365760c07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103365767ffffffffffffffff833581811161033257610114903690860161164b565b60243582811161032e5761012b903690870161161a565b6101336114e6565b9160843585811161032a5761014b9036908a016115c1565b98909560a43590811161032657610164913691016115c1565b969095815190610173826113ff565b606b82527f5065726d697442617463685769746e6573735472616e7366657246726f6d285460208301527f6f6b656e5065726d697373696f6e735b5d207065726d69747465642c61646472838301527f657373207370656e6465722c75696e74323536206e6f6e63652c75696e74323560608301527f3620646561646c696e652c000000000000000000000000000000000000000000608083015282519a8b9181610222602085018096611f93565b918237018a8152039961025b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09b8c8101835282611437565b5190209085515161026b81611ebb565b908a5b8181106102f95750506102f6999a6102ed9183516102a081610294602082018095611f66565b03848101835282611437565b519020602089810151858b015195519182019687526040820192909252336060820152608081019190915260a081019390935260643560c08401528260e081015b03908101835282611437565b51902093611cf7565b80f35b8061031161030b610321938c5161175e565b51612054565b61031b828661175e565b52611f0a565b61026e565b8880fd5b8780fd5b8480fd5b8380fd5b5080fd5b5091346103365760807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103365767ffffffffffffffff9080358281116103325761038b903690830161164b565b60243583811161032e576103a2903690840161161a565b9390926103ad6114e6565b9160643590811161049f576103c4913691016115c1565b949093835151976103d489611ebb565b98885b81811061047d5750506102f697988151610425816103f9602082018095611f66565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101835282611437565b5190206020860151828701519083519260208401947ffcf35f5ac6a2c28868dc44c302166470266239195f02b0ee408334829333b7668652840152336060840152608083015260a082015260a081526102ed8161141b565b808b61031b8261049461030b61049a968d5161175e565b9261175e565b6103d7565b8680fd5b5082346105bf57602090817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103325780359067ffffffffffffffff821161032e576104f49136910161161a565b929091845b848110610504578580f35b8061051a610515600193888861196c565b61197c565b61052f84610529848a8a61196c565b0161197c565b3389528385528589209173ffffffffffffffffffffffffffffffffffffffff80911692838b528652868a20911690818a5285528589207fffffffffffffffffffffffff000000000000000000000000000000000000000081541690558551918252848201527f89b1add15eff56b3dfe299ad94e01f2b52fbcb80ae1a3baea6ae8c04cb2b98a4853392a2016104f9565b8280fd5b50346103365760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261033657610676816105ff6114a0565b936106086114c3565b6106106114e6565b73ffffffffffffffffffffffffffffffffffffffff968716835260016020908152848420928816845291825283832090871683528152919020549251938316845260a083901c65ffffffffffff169084015260d09190911c604083015281906060820190565b0390f35b50346103365760807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610336576106b26114a0565b906106bb6114c3565b916106c46114e6565b65ffffffffffff926064358481169081810361032a5779ffffffffffff0000000000000000000000000000000000000000947fda9fa7c1b00402c17d0161b249b1ab8bbec047c5a52207b9c112deffd817036b94338a5260016020527fffffffffffff0000000000000000000000000000000000000000000000000000858b209873ffffffffffffffffffffffffffffffffffffffff809416998a8d5260205283878d209b169a8b8d52602052868c209486156000146107a457504216925b8454921697889360a01b16911617179055815193845260208401523392a480f35b905092610783565b5082346105bf5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126105bf576107e56114a0565b906107ee6114c3565b9265ffffffffffff604435818116939084810361032a57338852602091600183528489209673ffffffffffffffffffffffffffffffffffffffff80911697888b528452858a20981697888a5283528489205460d01c93848711156109175761ffff9085840316116108f05750907f55eb90d810e1700b35a8e7e25395ff7f2b2259abd7415ca2284dfb1c246418f393929133895260018252838920878a528252838920888a5282528389209079ffffffffffffffffffffffffffffffffffffffffffffffffffff7fffffffffffff000000000000000000000000000000000000000000000000000083549260d01b16911617905582519485528401523392a480f35b84517f24d35a26000000000000000000000000000000000000000000000000000000008152fd5b5084517f756688fe000000000000000000000000000000000000000000000000000000008152fd5b503461033657807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610336578060209273ffffffffffffffffffffffffffffffffffffffff61098f6114a0565b1681528084528181206024358252845220549051908152f35b5082346105bf57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126105bf577f3704902f963766a4e561bbaab6e6cdc1b1dd12f6e9e99648da8843b3f46b918d90359160243533855284602052818520848652602052818520818154179055815193845260208401523392a280f35b8234610a9a5760807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610a9a57610a606114a0565b610a686114c3565b610a706114e6565b6064359173ffffffffffffffffffffffffffffffffffffffff8316830361032e576102f6936117a1565b80fd5b503461033657817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261033657602090610ad7611b1e565b9051908152f35b508290346105bf576101007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126105bf57610b1a3661152a565b90807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7c36011261033257610b4c611478565b9160e43567ffffffffffffffff8111610bda576102f694610b6f913691016115c1565b939092610b7c8351612054565b6020840151828501519083519260208401947f939c21a48a8dbe3a9a2404a1d46691e4d39f6583d6ec6b35714604c986d801068652840152336060840152608083015260a082015260a08152610bd18161141b565b51902091611c25565b8580fd5b509134610336576101007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261033657610c186114a0565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc360160c08112610332576080855191610c51836113e3565b1261033257845190610c6282611398565b73ffffffffffffffffffffffffffffffffffffffff91602435838116810361049f578152604435838116810361049f57602082015265ffffffffffff606435818116810361032a5788830152608435908116810361049f576060820152815260a435938285168503610bda576020820194855260c4359087830182815260e43567ffffffffffffffff811161032657610cfe90369084016115c1565b929093804211610d88575050918591610d786102f6999a610d7e95610d238851611fbe565b90898c511690519083519260208401947ff3841cd1ff0085026a6327b620b67997ce40f282c88a8e905a7a5626e310f3d086528401526060830152608082015260808152610d70816113ff565b519020611bd9565b916120c7565b519251169161199d565b602492508a51917fcd21db4f000000000000000000000000000000000000000000000000000000008352820152fd5b5091346103365760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc93818536011261033257610df36114a0565b9260249081359267ffffffffffffffff9788851161032a578590853603011261049f578051978589018981108282111761104a578252848301358181116103265785019036602383011215610326578382013591610e50836115ef565b90610e5d85519283611437565b838252602093878584019160071b83010191368311611046578801905b828210610fe9575050508a526044610e93868801611509565b96838c01978852013594838b0191868352604435908111610fe557610ebb90369087016115c1565b959096804211610fba575050508998995151610ed681611ebb565b908b5b818110610f9757505092889492610d7892610f6497958351610f02816103f98682018095611f66565b5190209073ffffffffffffffffffffffffffffffffffffffff9a8b8b51169151928551948501957faf1b0d30d2cab0380e68f0689007e3254993c596f2fdd0aaa7f4d04f794408638752850152830152608082015260808152610d70816113ff565b51169082515192845b848110610f78578580f35b80610f918585610f8b600195875161175e565b5161199d565b01610f6d565b80610311610fac8e9f9e93610fb2945161175e565b51611fbe565b9b9a9b610ed9565b8551917fcd21db4f000000000000000000000000000000000000000000000000000000008352820152fd5b8a80fd5b6080823603126110465785608091885161100281611398565b61100b85611509565b8152611018838601611509565b838201526110278a8601611607565b8a8201528d611037818701611607565b90820152815201910190610e7a565b8c80fd5b84896041867f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b5082346105bf576101407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126105bf576110b03661152a565b91807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7c360112610332576110e2611478565b67ffffffffffffffff93906101043585811161049f5761110590369086016115c1565b90936101243596871161032a57611125610bd1966102f6983691016115c1565b969095825190611134826113ff565b606482527f5065726d69745769746e6573735472616e7366657246726f6d28546f6b656e5060208301527f65726d697373696f6e73207065726d69747465642c6164647265737320737065848301527f6e6465722c75696e74323536206e6f6e63652c75696e7432353620646561646c60608301527f696e652c0000000000000000000000000000000000000000000000000000000060808301528351948591816111e3602085018096611f93565b918237018b8152039361121c7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe095868101835282611437565b5190209261122a8651612054565b6020878101518589015195519182019687526040820192909252336060820152608081019190915260a081019390935260e43560c08401528260e081016102e1565b5082346105bf576020807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261033257813567ffffffffffffffff92838211610bda5736602383011215610bda5781013592831161032e576024906007368386831b8401011161049f57865b8581106112e5578780f35b80821b83019060807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc83360301126103265761139288876001946060835161132c81611398565b611368608461133c8d8601611509565b9485845261134c60448201611509565b809785015261135d60648201611509565b809885015201611509565b918291015273ffffffffffffffffffffffffffffffffffffffff80808093169516931691166117a1565b016112da565b6080810190811067ffffffffffffffff8211176113b457604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6060810190811067ffffffffffffffff8211176113b457604052565b60a0810190811067ffffffffffffffff8211176113b457604052565b60c0810190811067ffffffffffffffff8211176113b457604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176113b457604052565b60c4359073ffffffffffffffffffffffffffffffffffffffff8216820361149b57565b600080fd5b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361149b57565b6024359073ffffffffffffffffffffffffffffffffffffffff8216820361149b57565b6044359073ffffffffffffffffffffffffffffffffffffffff8216820361149b57565b359073ffffffffffffffffffffffffffffffffffffffff8216820361149b57565b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc01906080821261149b576040805190611563826113e3565b8082941261149b57805181810181811067ffffffffffffffff8211176113b457825260043573ffffffffffffffffffffffffffffffffffffffff8116810361149b578152602435602082015282526044356020830152606435910152565b9181601f8401121561149b5782359167ffffffffffffffff831161149b576020838186019501011161149b57565b67ffffffffffffffff81116113b45760051b60200190565b359065ffffffffffff8216820361149b57565b9181601f8401121561149b5782359167ffffffffffffffff831161149b576020808501948460061b01011161149b57565b91909160608184031261149b576040805191611666836113e3565b8294813567ffffffffffffffff9081811161149b57830182601f8201121561149b578035611693816115ef565b926116a087519485611437565b818452602094858086019360061b8501019381851161149b579086899897969594939201925b8484106116e3575050505050855280820135908501520135910152565b90919293949596978483031261149b578851908982019082821085831117611730578a928992845261171487611509565b81528287013583820152815201930191908897969594936116c6565b602460007f4e487b710000000000000000000000000000000000000000000000000000000081526041600452fd5b80518210156117725760209160051b010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b92919273ffffffffffffffffffffffffffffffffffffffff604060008284168152600160205282828220961695868252602052818120338252602052209485549565ffffffffffff8760a01c16804211611884575082871696838803611812575b5050611810955016926118b5565b565b878484161160001461184f57602488604051907ff96fb0710000000000000000000000000000000000000000000000000000000082526004820152fd5b7fffffffffffffffffffffffff000000000000000000000000000000000000000084846118109a031691161790553880611802565b602490604051907fd81b2f2e0000000000000000000000000000000000000000000000000000000082526004820152fd5b9060006064926020958295604051947f23b872dd0000000000000000000000000000000000000000000000000000000086526004860152602485015260448401525af13d15601f3d116001600051141617161561190e57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5452414e534645525f46524f4d5f4641494c45440000000000000000000000006044820152fd5b91908110156117725760061b0190565b3573ffffffffffffffffffffffffffffffffffffffff8116810361149b5790565b9065ffffffffffff908160608401511673ffffffffffffffffffffffffffffffffffffffff908185511694826020820151169280866040809401511695169560009187835260016020528383208984526020528383209916988983526020528282209184835460d01c03611af5579185611ace94927fc6a377bfc4eb120024a8ac08eef205be16b817020812c73223e81d1bdb9708ec98979694508715600014611ad35779ffffffffffff00000000000000000000000000000000000000009042165b60a01b167fffffffffffff00000000000000000000000000000000000000000000000000006001860160d01b1617179055519384938491604091949373ffffffffffffffffffffffffffffffffffffffff606085019616845265ffffffffffff809216602085015216910152565b0390a4565b5079ffffffffffff000000000000000000000000000000000000000087611a60565b600484517f756688fe000000000000000000000000000000000000000000000000000000008152fd5b467f000000000000000000000000000000000000000000000000000000000000000003611b69577f000000000000000000000000000000000000000000000000000000000000000090565b60405160208101907f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86682527f9ac997416e8ff9d2ff6bebeb7149f65cdae5e32e2b90440b566bb3044041d36a604082015246606082015230608082015260808152611bd3816113ff565b51902090565b611be1611b1e565b906040519060208201927f190100000000000000000000000000000000000000000000000000000000000084526022830152604282015260428152611bd381611398565b9192909360a435936040840151804211611cc65750602084510151808611611c955750918591610d78611c6594611c60602088015186611e47565b611bd9565b73ffffffffffffffffffffffffffffffffffffffff809151511692608435918216820361149b57611810936118b5565b602490604051907f3728b83d0000000000000000000000000000000000000000000000000000000082526004820152fd5b602490604051907fcd21db4f0000000000000000000000000000000000000000000000000000000082526004820152fd5b959093958051519560409283830151804211611e175750848803611dee57611d2e918691610d7860209b611c608d88015186611e47565b60005b868110611d42575050505050505050565b611d4d81835161175e565b5188611d5a83878a61196c565b01359089810151808311611dbe575091818888886001968596611d84575b50505050505001611d31565b611db395611dad9273ffffffffffffffffffffffffffffffffffffffff6105159351169561196c565b916118b5565b803888888883611d78565b6024908651907f3728b83d0000000000000000000000000000000000000000000000000000000082526004820152fd5b600484517fff633a38000000000000000000000000000000000000000000000000000000008152fd5b6024908551907fcd21db4f0000000000000000000000000000000000000000000000000000000082526004820152fd5b9073ffffffffffffffffffffffffffffffffffffffff600160ff83161b9216600052600060205260406000209060081c6000526020526040600020818154188091551615611e9157565b60046040517f756688fe000000000000000000000000000000000000000000000000000000008152fd5b90611ec5826115ef565b611ed26040519182611437565b8281527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0611f0082946115ef565b0190602036910137565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114611f375760010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b805160208092019160005b828110611f7f575050505090565b835185529381019392810192600101611f71565b9081519160005b838110611fab575050016000815290565b8060208092840101518185015201611f9a565b60405160208101917f65626cad6cb96493bf6f5ebea28756c966f023ab9e8a83a7101849d5573b3678835273ffffffffffffffffffffffffffffffffffffffff8082511660408401526020820151166060830152606065ffffffffffff9182604082015116608085015201511660a082015260a0815260c0810181811067ffffffffffffffff8211176113b45760405251902090565b6040516020808201927f618358ac3db8dc274f0cd8829da7e234bd48cd73c4a740aede1adec9846d06a1845273ffffffffffffffffffffffffffffffffffffffff81511660408401520151606082015260608152611bd381611398565b919082604091031261149b576020823592013590565b6000843b61222e5750604182036121ac576120e4828201826120b1565b939092604010156117725760209360009360ff6040608095013560f81c5b60405194855216868401526040830152606082015282805260015afa156121a05773ffffffffffffffffffffffffffffffffffffffff806000511691821561217657160361214c57565b60046040517f815e1d64000000000000000000000000000000000000000000000000000000008152fd5b60046040517f8baa579f000000000000000000000000000000000000000000000000000000008152fd5b6040513d6000823e3d90fd5b60408203612204576121c0918101906120b1565b91601b7f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84169360ff1c019060ff8211611f375760209360009360ff608094612102565b60046040517f4be6321b000000000000000000000000000000000000000000000000000000008152fd5b929391601f928173ffffffffffffffffffffffffffffffffffffffff60646020957fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0604051988997889687947f1626ba7e000000000000000000000000000000000000000000000000000000009e8f8752600487015260406024870152816044870152868601378b85828601015201168101030192165afa9081156123a857829161232a575b507fffffffff000000000000000000000000000000000000000000000000000000009150160361230057565b60046040517fb0669cbc000000000000000000000000000000000000000000000000000000008152fd5b90506020813d82116123a0575b8161234460209383611437565b810103126103365751907fffffffff0000000000000000000000000000000000000000000000000000000082168203610a9a57507fffffffff0000000000000000000000000000000000000000000000000000000090386122d4565b3d9150612337565b6040513d84823e3d90fdfea164736f6c6343000811000a", +} + +// Permit2ABI is the input ABI used to generate the binding from. +// Deprecated: Use Permit2MetaData.ABI instead. +var Permit2ABI = Permit2MetaData.ABI + +// Permit2Bin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use Permit2MetaData.Bin instead. +var Permit2Bin = Permit2MetaData.Bin + +// DeployPermit2 deploys a new Ethereum contract, binding an instance of Permit2 to it. +func DeployPermit2(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Permit2, error) { + parsed, err := Permit2MetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(Permit2Bin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &Permit2{Permit2Caller: Permit2Caller{contract: contract}, Permit2Transactor: Permit2Transactor{contract: contract}, Permit2Filterer: Permit2Filterer{contract: contract}}, nil +} + +// Permit2 is an auto generated Go binding around an Ethereum contract. +type Permit2 struct { + Permit2Caller // Read-only binding to the contract + Permit2Transactor // Write-only binding to the contract + Permit2Filterer // Log filterer for contract events +} + +// Permit2Caller is an auto generated read-only Go binding around an Ethereum contract. +type Permit2Caller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// Permit2Transactor is an auto generated write-only Go binding around an Ethereum contract. +type Permit2Transactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// Permit2Filterer is an auto generated log filtering Go binding around an Ethereum contract events. +type Permit2Filterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// Permit2Session is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type Permit2Session struct { + Contract *Permit2 // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// Permit2CallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type Permit2CallerSession struct { + Contract *Permit2Caller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// Permit2TransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type Permit2TransactorSession struct { + Contract *Permit2Transactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// Permit2Raw is an auto generated low-level Go binding around an Ethereum contract. +type Permit2Raw struct { + Contract *Permit2 // Generic contract binding to access the raw methods on +} + +// Permit2CallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type Permit2CallerRaw struct { + Contract *Permit2Caller // Generic read-only contract binding to access the raw methods on +} + +// Permit2TransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type Permit2TransactorRaw struct { + Contract *Permit2Transactor // Generic write-only contract binding to access the raw methods on +} + +// NewPermit2 creates a new instance of Permit2, bound to a specific deployed contract. +func NewPermit2(address common.Address, backend bind.ContractBackend) (*Permit2, error) { + contract, err := bindPermit2(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &Permit2{Permit2Caller: Permit2Caller{contract: contract}, Permit2Transactor: Permit2Transactor{contract: contract}, Permit2Filterer: Permit2Filterer{contract: contract}}, nil +} + +// NewPermit2Caller creates a new read-only instance of Permit2, bound to a specific deployed contract. +func NewPermit2Caller(address common.Address, caller bind.ContractCaller) (*Permit2Caller, error) { + contract, err := bindPermit2(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &Permit2Caller{contract: contract}, nil +} + +// NewPermit2Transactor creates a new write-only instance of Permit2, bound to a specific deployed contract. +func NewPermit2Transactor(address common.Address, transactor bind.ContractTransactor) (*Permit2Transactor, error) { + contract, err := bindPermit2(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &Permit2Transactor{contract: contract}, nil +} + +// NewPermit2Filterer creates a new log filterer instance of Permit2, bound to a specific deployed contract. +func NewPermit2Filterer(address common.Address, filterer bind.ContractFilterer) (*Permit2Filterer, error) { + contract, err := bindPermit2(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &Permit2Filterer{contract: contract}, nil +} + +// bindPermit2 binds a generic wrapper to an already deployed contract. +func bindPermit2(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(Permit2ABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Permit2 *Permit2Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Permit2.Contract.Permit2Caller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Permit2 *Permit2Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Permit2.Contract.Permit2Transactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Permit2 *Permit2Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Permit2.Contract.Permit2Transactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Permit2 *Permit2CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Permit2.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Permit2 *Permit2TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Permit2.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Permit2 *Permit2TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Permit2.Contract.contract.Transact(opts, method, params...) +} + +// DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. +// +// Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) +func (_Permit2 *Permit2Caller) DOMAINSEPARATOR(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _Permit2.contract.Call(opts, &out, "DOMAIN_SEPARATOR") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. +// +// Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) +func (_Permit2 *Permit2Session) DOMAINSEPARATOR() ([32]byte, error) { + return _Permit2.Contract.DOMAINSEPARATOR(&_Permit2.CallOpts) +} + +// DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. +// +// Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) +func (_Permit2 *Permit2CallerSession) DOMAINSEPARATOR() ([32]byte, error) { + return _Permit2.Contract.DOMAINSEPARATOR(&_Permit2.CallOpts) +} + +// Allowance is a free data retrieval call binding the contract method 0x927da105. +// +// Solidity: function allowance(address , address , address ) view returns(uint160 amount, uint48 expiration, uint48 nonce) +func (_Permit2 *Permit2Caller) Allowance(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address, arg2 common.Address) (struct { + Amount *big.Int + Expiration *big.Int + Nonce *big.Int +}, error) { + var out []interface{} + err := _Permit2.contract.Call(opts, &out, "allowance", arg0, arg1, arg2) + + outstruct := new(struct { + Amount *big.Int + Expiration *big.Int + Nonce *big.Int + }) + if err != nil { + return *outstruct, err + } + + outstruct.Amount = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + outstruct.Expiration = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + outstruct.Nonce = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) + + return *outstruct, err + +} + +// Allowance is a free data retrieval call binding the contract method 0x927da105. +// +// Solidity: function allowance(address , address , address ) view returns(uint160 amount, uint48 expiration, uint48 nonce) +func (_Permit2 *Permit2Session) Allowance(arg0 common.Address, arg1 common.Address, arg2 common.Address) (struct { + Amount *big.Int + Expiration *big.Int + Nonce *big.Int +}, error) { + return _Permit2.Contract.Allowance(&_Permit2.CallOpts, arg0, arg1, arg2) +} + +// Allowance is a free data retrieval call binding the contract method 0x927da105. +// +// Solidity: function allowance(address , address , address ) view returns(uint160 amount, uint48 expiration, uint48 nonce) +func (_Permit2 *Permit2CallerSession) Allowance(arg0 common.Address, arg1 common.Address, arg2 common.Address) (struct { + Amount *big.Int + Expiration *big.Int + Nonce *big.Int +}, error) { + return _Permit2.Contract.Allowance(&_Permit2.CallOpts, arg0, arg1, arg2) +} + +// NonceBitmap is a free data retrieval call binding the contract method 0x4fe02b44. +// +// Solidity: function nonceBitmap(address , uint256 ) view returns(uint256) +func (_Permit2 *Permit2Caller) NonceBitmap(opts *bind.CallOpts, arg0 common.Address, arg1 *big.Int) (*big.Int, error) { + var out []interface{} + err := _Permit2.contract.Call(opts, &out, "nonceBitmap", arg0, arg1) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// NonceBitmap is a free data retrieval call binding the contract method 0x4fe02b44. +// +// Solidity: function nonceBitmap(address , uint256 ) view returns(uint256) +func (_Permit2 *Permit2Session) NonceBitmap(arg0 common.Address, arg1 *big.Int) (*big.Int, error) { + return _Permit2.Contract.NonceBitmap(&_Permit2.CallOpts, arg0, arg1) +} + +// NonceBitmap is a free data retrieval call binding the contract method 0x4fe02b44. +// +// Solidity: function nonceBitmap(address , uint256 ) view returns(uint256) +func (_Permit2 *Permit2CallerSession) NonceBitmap(arg0 common.Address, arg1 *big.Int) (*big.Int, error) { + return _Permit2.Contract.NonceBitmap(&_Permit2.CallOpts, arg0, arg1) +} + +// Approve is a paid mutator transaction binding the contract method 0x87517c45. +// +// Solidity: function approve(address token, address spender, uint160 amount, uint48 expiration) returns() +func (_Permit2 *Permit2Transactor) Approve(opts *bind.TransactOpts, token common.Address, spender common.Address, amount *big.Int, expiration *big.Int) (*types.Transaction, error) { + return _Permit2.contract.Transact(opts, "approve", token, spender, amount, expiration) +} + +// Approve is a paid mutator transaction binding the contract method 0x87517c45. +// +// Solidity: function approve(address token, address spender, uint160 amount, uint48 expiration) returns() +func (_Permit2 *Permit2Session) Approve(token common.Address, spender common.Address, amount *big.Int, expiration *big.Int) (*types.Transaction, error) { + return _Permit2.Contract.Approve(&_Permit2.TransactOpts, token, spender, amount, expiration) +} + +// Approve is a paid mutator transaction binding the contract method 0x87517c45. +// +// Solidity: function approve(address token, address spender, uint160 amount, uint48 expiration) returns() +func (_Permit2 *Permit2TransactorSession) Approve(token common.Address, spender common.Address, amount *big.Int, expiration *big.Int) (*types.Transaction, error) { + return _Permit2.Contract.Approve(&_Permit2.TransactOpts, token, spender, amount, expiration) +} + +// InvalidateNonces is a paid mutator transaction binding the contract method 0x65d9723c. +// +// Solidity: function invalidateNonces(address token, address spender, uint48 newNonce) returns() +func (_Permit2 *Permit2Transactor) InvalidateNonces(opts *bind.TransactOpts, token common.Address, spender common.Address, newNonce *big.Int) (*types.Transaction, error) { + return _Permit2.contract.Transact(opts, "invalidateNonces", token, spender, newNonce) +} + +// InvalidateNonces is a paid mutator transaction binding the contract method 0x65d9723c. +// +// Solidity: function invalidateNonces(address token, address spender, uint48 newNonce) returns() +func (_Permit2 *Permit2Session) InvalidateNonces(token common.Address, spender common.Address, newNonce *big.Int) (*types.Transaction, error) { + return _Permit2.Contract.InvalidateNonces(&_Permit2.TransactOpts, token, spender, newNonce) +} + +// InvalidateNonces is a paid mutator transaction binding the contract method 0x65d9723c. +// +// Solidity: function invalidateNonces(address token, address spender, uint48 newNonce) returns() +func (_Permit2 *Permit2TransactorSession) InvalidateNonces(token common.Address, spender common.Address, newNonce *big.Int) (*types.Transaction, error) { + return _Permit2.Contract.InvalidateNonces(&_Permit2.TransactOpts, token, spender, newNonce) +} + +// InvalidateUnorderedNonces is a paid mutator transaction binding the contract method 0x3ff9dcb1. +// +// Solidity: function invalidateUnorderedNonces(uint256 wordPos, uint256 mask) returns() +func (_Permit2 *Permit2Transactor) InvalidateUnorderedNonces(opts *bind.TransactOpts, wordPos *big.Int, mask *big.Int) (*types.Transaction, error) { + return _Permit2.contract.Transact(opts, "invalidateUnorderedNonces", wordPos, mask) +} + +// InvalidateUnorderedNonces is a paid mutator transaction binding the contract method 0x3ff9dcb1. +// +// Solidity: function invalidateUnorderedNonces(uint256 wordPos, uint256 mask) returns() +func (_Permit2 *Permit2Session) InvalidateUnorderedNonces(wordPos *big.Int, mask *big.Int) (*types.Transaction, error) { + return _Permit2.Contract.InvalidateUnorderedNonces(&_Permit2.TransactOpts, wordPos, mask) +} + +// InvalidateUnorderedNonces is a paid mutator transaction binding the contract method 0x3ff9dcb1. +// +// Solidity: function invalidateUnorderedNonces(uint256 wordPos, uint256 mask) returns() +func (_Permit2 *Permit2TransactorSession) InvalidateUnorderedNonces(wordPos *big.Int, mask *big.Int) (*types.Transaction, error) { + return _Permit2.Contract.InvalidateUnorderedNonces(&_Permit2.TransactOpts, wordPos, mask) +} + +// Lockdown is a paid mutator transaction binding the contract method 0xcc53287f. +// +// Solidity: function lockdown((address,address)[] approvals) returns() +func (_Permit2 *Permit2Transactor) Lockdown(opts *bind.TransactOpts, approvals []IAllowanceTransferTokenSpenderPair) (*types.Transaction, error) { + return _Permit2.contract.Transact(opts, "lockdown", approvals) +} + +// Lockdown is a paid mutator transaction binding the contract method 0xcc53287f. +// +// Solidity: function lockdown((address,address)[] approvals) returns() +func (_Permit2 *Permit2Session) Lockdown(approvals []IAllowanceTransferTokenSpenderPair) (*types.Transaction, error) { + return _Permit2.Contract.Lockdown(&_Permit2.TransactOpts, approvals) +} + +// Lockdown is a paid mutator transaction binding the contract method 0xcc53287f. +// +// Solidity: function lockdown((address,address)[] approvals) returns() +func (_Permit2 *Permit2TransactorSession) Lockdown(approvals []IAllowanceTransferTokenSpenderPair) (*types.Transaction, error) { + return _Permit2.Contract.Lockdown(&_Permit2.TransactOpts, approvals) +} + +// Permit is a paid mutator transaction binding the contract method 0x2a2d80d1. +// +// Solidity: function permit(address owner, ((address,uint160,uint48,uint48)[],address,uint256) permitBatch, bytes signature) returns() +func (_Permit2 *Permit2Transactor) Permit(opts *bind.TransactOpts, owner common.Address, permitBatch IAllowanceTransferPermitBatch, signature []byte) (*types.Transaction, error) { + return _Permit2.contract.Transact(opts, "permit", owner, permitBatch, signature) +} + +// Permit is a paid mutator transaction binding the contract method 0x2a2d80d1. +// +// Solidity: function permit(address owner, ((address,uint160,uint48,uint48)[],address,uint256) permitBatch, bytes signature) returns() +func (_Permit2 *Permit2Session) Permit(owner common.Address, permitBatch IAllowanceTransferPermitBatch, signature []byte) (*types.Transaction, error) { + return _Permit2.Contract.Permit(&_Permit2.TransactOpts, owner, permitBatch, signature) +} + +// Permit is a paid mutator transaction binding the contract method 0x2a2d80d1. +// +// Solidity: function permit(address owner, ((address,uint160,uint48,uint48)[],address,uint256) permitBatch, bytes signature) returns() +func (_Permit2 *Permit2TransactorSession) Permit(owner common.Address, permitBatch IAllowanceTransferPermitBatch, signature []byte) (*types.Transaction, error) { + return _Permit2.Contract.Permit(&_Permit2.TransactOpts, owner, permitBatch, signature) +} + +// Permit0 is a paid mutator transaction binding the contract method 0x2b67b570. +// +// Solidity: function permit(address owner, ((address,uint160,uint48,uint48),address,uint256) permitSingle, bytes signature) returns() +func (_Permit2 *Permit2Transactor) Permit0(opts *bind.TransactOpts, owner common.Address, permitSingle IAllowanceTransferPermitSingle, signature []byte) (*types.Transaction, error) { + return _Permit2.contract.Transact(opts, "permit0", owner, permitSingle, signature) +} + +// Permit0 is a paid mutator transaction binding the contract method 0x2b67b570. +// +// Solidity: function permit(address owner, ((address,uint160,uint48,uint48),address,uint256) permitSingle, bytes signature) returns() +func (_Permit2 *Permit2Session) Permit0(owner common.Address, permitSingle IAllowanceTransferPermitSingle, signature []byte) (*types.Transaction, error) { + return _Permit2.Contract.Permit0(&_Permit2.TransactOpts, owner, permitSingle, signature) +} + +// Permit0 is a paid mutator transaction binding the contract method 0x2b67b570. +// +// Solidity: function permit(address owner, ((address,uint160,uint48,uint48),address,uint256) permitSingle, bytes signature) returns() +func (_Permit2 *Permit2TransactorSession) Permit0(owner common.Address, permitSingle IAllowanceTransferPermitSingle, signature []byte) (*types.Transaction, error) { + return _Permit2.Contract.Permit0(&_Permit2.TransactOpts, owner, permitSingle, signature) +} + +// PermitTransferFrom is a paid mutator transaction binding the contract method 0x30f28b7a. +// +// Solidity: function permitTransferFrom(((address,uint256),uint256,uint256) permit, (address,uint256) transferDetails, address owner, bytes signature) returns() +func (_Permit2 *Permit2Transactor) PermitTransferFrom(opts *bind.TransactOpts, permit ISignatureTransferPermitTransferFrom, transferDetails ISignatureTransferSignatureTransferDetails, owner common.Address, signature []byte) (*types.Transaction, error) { + return _Permit2.contract.Transact(opts, "permitTransferFrom", permit, transferDetails, owner, signature) +} + +// PermitTransferFrom is a paid mutator transaction binding the contract method 0x30f28b7a. +// +// Solidity: function permitTransferFrom(((address,uint256),uint256,uint256) permit, (address,uint256) transferDetails, address owner, bytes signature) returns() +func (_Permit2 *Permit2Session) PermitTransferFrom(permit ISignatureTransferPermitTransferFrom, transferDetails ISignatureTransferSignatureTransferDetails, owner common.Address, signature []byte) (*types.Transaction, error) { + return _Permit2.Contract.PermitTransferFrom(&_Permit2.TransactOpts, permit, transferDetails, owner, signature) +} + +// PermitTransferFrom is a paid mutator transaction binding the contract method 0x30f28b7a. +// +// Solidity: function permitTransferFrom(((address,uint256),uint256,uint256) permit, (address,uint256) transferDetails, address owner, bytes signature) returns() +func (_Permit2 *Permit2TransactorSession) PermitTransferFrom(permit ISignatureTransferPermitTransferFrom, transferDetails ISignatureTransferSignatureTransferDetails, owner common.Address, signature []byte) (*types.Transaction, error) { + return _Permit2.Contract.PermitTransferFrom(&_Permit2.TransactOpts, permit, transferDetails, owner, signature) +} + +// PermitTransferFrom0 is a paid mutator transaction binding the contract method 0xedd9444b. +// +// Solidity: function permitTransferFrom(((address,uint256)[],uint256,uint256) permit, (address,uint256)[] transferDetails, address owner, bytes signature) returns() +func (_Permit2 *Permit2Transactor) PermitTransferFrom0(opts *bind.TransactOpts, permit ISignatureTransferPermitBatchTransferFrom, transferDetails []ISignatureTransferSignatureTransferDetails, owner common.Address, signature []byte) (*types.Transaction, error) { + return _Permit2.contract.Transact(opts, "permitTransferFrom0", permit, transferDetails, owner, signature) +} + +// PermitTransferFrom0 is a paid mutator transaction binding the contract method 0xedd9444b. +// +// Solidity: function permitTransferFrom(((address,uint256)[],uint256,uint256) permit, (address,uint256)[] transferDetails, address owner, bytes signature) returns() +func (_Permit2 *Permit2Session) PermitTransferFrom0(permit ISignatureTransferPermitBatchTransferFrom, transferDetails []ISignatureTransferSignatureTransferDetails, owner common.Address, signature []byte) (*types.Transaction, error) { + return _Permit2.Contract.PermitTransferFrom0(&_Permit2.TransactOpts, permit, transferDetails, owner, signature) +} + +// PermitTransferFrom0 is a paid mutator transaction binding the contract method 0xedd9444b. +// +// Solidity: function permitTransferFrom(((address,uint256)[],uint256,uint256) permit, (address,uint256)[] transferDetails, address owner, bytes signature) returns() +func (_Permit2 *Permit2TransactorSession) PermitTransferFrom0(permit ISignatureTransferPermitBatchTransferFrom, transferDetails []ISignatureTransferSignatureTransferDetails, owner common.Address, signature []byte) (*types.Transaction, error) { + return _Permit2.Contract.PermitTransferFrom0(&_Permit2.TransactOpts, permit, transferDetails, owner, signature) +} + +// PermitWitnessTransferFrom is a paid mutator transaction binding the contract method 0x137c29fe. +// +// Solidity: function permitWitnessTransferFrom(((address,uint256),uint256,uint256) permit, (address,uint256) transferDetails, address owner, bytes32 witness, string witnessTypeString, bytes signature) returns() +func (_Permit2 *Permit2Transactor) PermitWitnessTransferFrom(opts *bind.TransactOpts, permit ISignatureTransferPermitTransferFrom, transferDetails ISignatureTransferSignatureTransferDetails, owner common.Address, witness [32]byte, witnessTypeString string, signature []byte) (*types.Transaction, error) { + return _Permit2.contract.Transact(opts, "permitWitnessTransferFrom", permit, transferDetails, owner, witness, witnessTypeString, signature) +} + +// PermitWitnessTransferFrom is a paid mutator transaction binding the contract method 0x137c29fe. +// +// Solidity: function permitWitnessTransferFrom(((address,uint256),uint256,uint256) permit, (address,uint256) transferDetails, address owner, bytes32 witness, string witnessTypeString, bytes signature) returns() +func (_Permit2 *Permit2Session) PermitWitnessTransferFrom(permit ISignatureTransferPermitTransferFrom, transferDetails ISignatureTransferSignatureTransferDetails, owner common.Address, witness [32]byte, witnessTypeString string, signature []byte) (*types.Transaction, error) { + return _Permit2.Contract.PermitWitnessTransferFrom(&_Permit2.TransactOpts, permit, transferDetails, owner, witness, witnessTypeString, signature) +} + +// PermitWitnessTransferFrom is a paid mutator transaction binding the contract method 0x137c29fe. +// +// Solidity: function permitWitnessTransferFrom(((address,uint256),uint256,uint256) permit, (address,uint256) transferDetails, address owner, bytes32 witness, string witnessTypeString, bytes signature) returns() +func (_Permit2 *Permit2TransactorSession) PermitWitnessTransferFrom(permit ISignatureTransferPermitTransferFrom, transferDetails ISignatureTransferSignatureTransferDetails, owner common.Address, witness [32]byte, witnessTypeString string, signature []byte) (*types.Transaction, error) { + return _Permit2.Contract.PermitWitnessTransferFrom(&_Permit2.TransactOpts, permit, transferDetails, owner, witness, witnessTypeString, signature) +} + +// PermitWitnessTransferFrom0 is a paid mutator transaction binding the contract method 0xfe8ec1a7. +// +// Solidity: function permitWitnessTransferFrom(((address,uint256)[],uint256,uint256) permit, (address,uint256)[] transferDetails, address owner, bytes32 witness, string witnessTypeString, bytes signature) returns() +func (_Permit2 *Permit2Transactor) PermitWitnessTransferFrom0(opts *bind.TransactOpts, permit ISignatureTransferPermitBatchTransferFrom, transferDetails []ISignatureTransferSignatureTransferDetails, owner common.Address, witness [32]byte, witnessTypeString string, signature []byte) (*types.Transaction, error) { + return _Permit2.contract.Transact(opts, "permitWitnessTransferFrom0", permit, transferDetails, owner, witness, witnessTypeString, signature) +} + +// PermitWitnessTransferFrom0 is a paid mutator transaction binding the contract method 0xfe8ec1a7. +// +// Solidity: function permitWitnessTransferFrom(((address,uint256)[],uint256,uint256) permit, (address,uint256)[] transferDetails, address owner, bytes32 witness, string witnessTypeString, bytes signature) returns() +func (_Permit2 *Permit2Session) PermitWitnessTransferFrom0(permit ISignatureTransferPermitBatchTransferFrom, transferDetails []ISignatureTransferSignatureTransferDetails, owner common.Address, witness [32]byte, witnessTypeString string, signature []byte) (*types.Transaction, error) { + return _Permit2.Contract.PermitWitnessTransferFrom0(&_Permit2.TransactOpts, permit, transferDetails, owner, witness, witnessTypeString, signature) +} + +// PermitWitnessTransferFrom0 is a paid mutator transaction binding the contract method 0xfe8ec1a7. +// +// Solidity: function permitWitnessTransferFrom(((address,uint256)[],uint256,uint256) permit, (address,uint256)[] transferDetails, address owner, bytes32 witness, string witnessTypeString, bytes signature) returns() +func (_Permit2 *Permit2TransactorSession) PermitWitnessTransferFrom0(permit ISignatureTransferPermitBatchTransferFrom, transferDetails []ISignatureTransferSignatureTransferDetails, owner common.Address, witness [32]byte, witnessTypeString string, signature []byte) (*types.Transaction, error) { + return _Permit2.Contract.PermitWitnessTransferFrom0(&_Permit2.TransactOpts, permit, transferDetails, owner, witness, witnessTypeString, signature) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x0d58b1db. +// +// Solidity: function transferFrom((address,address,uint160,address)[] transferDetails) returns() +func (_Permit2 *Permit2Transactor) TransferFrom(opts *bind.TransactOpts, transferDetails []IAllowanceTransferAllowanceTransferDetails) (*types.Transaction, error) { + return _Permit2.contract.Transact(opts, "transferFrom", transferDetails) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x0d58b1db. +// +// Solidity: function transferFrom((address,address,uint160,address)[] transferDetails) returns() +func (_Permit2 *Permit2Session) TransferFrom(transferDetails []IAllowanceTransferAllowanceTransferDetails) (*types.Transaction, error) { + return _Permit2.Contract.TransferFrom(&_Permit2.TransactOpts, transferDetails) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x0d58b1db. +// +// Solidity: function transferFrom((address,address,uint160,address)[] transferDetails) returns() +func (_Permit2 *Permit2TransactorSession) TransferFrom(transferDetails []IAllowanceTransferAllowanceTransferDetails) (*types.Transaction, error) { + return _Permit2.Contract.TransferFrom(&_Permit2.TransactOpts, transferDetails) +} + +// TransferFrom0 is a paid mutator transaction binding the contract method 0x36c78516. +// +// Solidity: function transferFrom(address from, address to, uint160 amount, address token) returns() +func (_Permit2 *Permit2Transactor) TransferFrom0(opts *bind.TransactOpts, from common.Address, to common.Address, amount *big.Int, token common.Address) (*types.Transaction, error) { + return _Permit2.contract.Transact(opts, "transferFrom0", from, to, amount, token) +} + +// TransferFrom0 is a paid mutator transaction binding the contract method 0x36c78516. +// +// Solidity: function transferFrom(address from, address to, uint160 amount, address token) returns() +func (_Permit2 *Permit2Session) TransferFrom0(from common.Address, to common.Address, amount *big.Int, token common.Address) (*types.Transaction, error) { + return _Permit2.Contract.TransferFrom0(&_Permit2.TransactOpts, from, to, amount, token) +} + +// TransferFrom0 is a paid mutator transaction binding the contract method 0x36c78516. +// +// Solidity: function transferFrom(address from, address to, uint160 amount, address token) returns() +func (_Permit2 *Permit2TransactorSession) TransferFrom0(from common.Address, to common.Address, amount *big.Int, token common.Address) (*types.Transaction, error) { + return _Permit2.Contract.TransferFrom0(&_Permit2.TransactOpts, from, to, amount, token) +} + +// Permit2ApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the Permit2 contract. +type Permit2ApprovalIterator struct { + Event *Permit2Approval // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *Permit2ApprovalIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(Permit2Approval) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(Permit2Approval) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *Permit2ApprovalIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *Permit2ApprovalIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// Permit2Approval represents a Approval event raised by the Permit2 contract. +type Permit2Approval struct { + Owner common.Address + Token common.Address + Spender common.Address + Amount *big.Int + Expiration *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterApproval is a free log retrieval operation binding the contract event 0xda9fa7c1b00402c17d0161b249b1ab8bbec047c5a52207b9c112deffd817036b. +// +// Solidity: event Approval(address indexed owner, address indexed token, address indexed spender, uint160 amount, uint48 expiration) +func (_Permit2 *Permit2Filterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, token []common.Address, spender []common.Address) (*Permit2ApprovalIterator, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var tokenRule []interface{} + for _, tokenItem := range token { + tokenRule = append(tokenRule, tokenItem) + } + var spenderRule []interface{} + for _, spenderItem := range spender { + spenderRule = append(spenderRule, spenderItem) + } + + logs, sub, err := _Permit2.contract.FilterLogs(opts, "Approval", ownerRule, tokenRule, spenderRule) + if err != nil { + return nil, err + } + return &Permit2ApprovalIterator{contract: _Permit2.contract, event: "Approval", logs: logs, sub: sub}, nil +} + +// WatchApproval is a free log subscription operation binding the contract event 0xda9fa7c1b00402c17d0161b249b1ab8bbec047c5a52207b9c112deffd817036b. +// +// Solidity: event Approval(address indexed owner, address indexed token, address indexed spender, uint160 amount, uint48 expiration) +func (_Permit2 *Permit2Filterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *Permit2Approval, owner []common.Address, token []common.Address, spender []common.Address) (event.Subscription, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var tokenRule []interface{} + for _, tokenItem := range token { + tokenRule = append(tokenRule, tokenItem) + } + var spenderRule []interface{} + for _, spenderItem := range spender { + spenderRule = append(spenderRule, spenderItem) + } + + logs, sub, err := _Permit2.contract.WatchLogs(opts, "Approval", ownerRule, tokenRule, spenderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(Permit2Approval) + if err := _Permit2.contract.UnpackLog(event, "Approval", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseApproval is a log parse operation binding the contract event 0xda9fa7c1b00402c17d0161b249b1ab8bbec047c5a52207b9c112deffd817036b. +// +// Solidity: event Approval(address indexed owner, address indexed token, address indexed spender, uint160 amount, uint48 expiration) +func (_Permit2 *Permit2Filterer) ParseApproval(log types.Log) (*Permit2Approval, error) { + event := new(Permit2Approval) + if err := _Permit2.contract.UnpackLog(event, "Approval", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// Permit2LockdownIterator is returned from FilterLockdown and is used to iterate over the raw logs and unpacked data for Lockdown events raised by the Permit2 contract. +type Permit2LockdownIterator struct { + Event *Permit2Lockdown // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *Permit2LockdownIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(Permit2Lockdown) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(Permit2Lockdown) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *Permit2LockdownIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *Permit2LockdownIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// Permit2Lockdown represents a Lockdown event raised by the Permit2 contract. +type Permit2Lockdown struct { + Owner common.Address + Token common.Address + Spender common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterLockdown is a free log retrieval operation binding the contract event 0x89b1add15eff56b3dfe299ad94e01f2b52fbcb80ae1a3baea6ae8c04cb2b98a4. +// +// Solidity: event Lockdown(address indexed owner, address token, address spender) +func (_Permit2 *Permit2Filterer) FilterLockdown(opts *bind.FilterOpts, owner []common.Address) (*Permit2LockdownIterator, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + + logs, sub, err := _Permit2.contract.FilterLogs(opts, "Lockdown", ownerRule) + if err != nil { + return nil, err + } + return &Permit2LockdownIterator{contract: _Permit2.contract, event: "Lockdown", logs: logs, sub: sub}, nil +} + +// WatchLockdown is a free log subscription operation binding the contract event 0x89b1add15eff56b3dfe299ad94e01f2b52fbcb80ae1a3baea6ae8c04cb2b98a4. +// +// Solidity: event Lockdown(address indexed owner, address token, address spender) +func (_Permit2 *Permit2Filterer) WatchLockdown(opts *bind.WatchOpts, sink chan<- *Permit2Lockdown, owner []common.Address) (event.Subscription, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + + logs, sub, err := _Permit2.contract.WatchLogs(opts, "Lockdown", ownerRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(Permit2Lockdown) + if err := _Permit2.contract.UnpackLog(event, "Lockdown", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseLockdown is a log parse operation binding the contract event 0x89b1add15eff56b3dfe299ad94e01f2b52fbcb80ae1a3baea6ae8c04cb2b98a4. +// +// Solidity: event Lockdown(address indexed owner, address token, address spender) +func (_Permit2 *Permit2Filterer) ParseLockdown(log types.Log) (*Permit2Lockdown, error) { + event := new(Permit2Lockdown) + if err := _Permit2.contract.UnpackLog(event, "Lockdown", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// Permit2NonceInvalidationIterator is returned from FilterNonceInvalidation and is used to iterate over the raw logs and unpacked data for NonceInvalidation events raised by the Permit2 contract. +type Permit2NonceInvalidationIterator struct { + Event *Permit2NonceInvalidation // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *Permit2NonceInvalidationIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(Permit2NonceInvalidation) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(Permit2NonceInvalidation) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *Permit2NonceInvalidationIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *Permit2NonceInvalidationIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// Permit2NonceInvalidation represents a NonceInvalidation event raised by the Permit2 contract. +type Permit2NonceInvalidation struct { + Owner common.Address + Token common.Address + Spender common.Address + NewNonce *big.Int + OldNonce *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterNonceInvalidation is a free log retrieval operation binding the contract event 0x55eb90d810e1700b35a8e7e25395ff7f2b2259abd7415ca2284dfb1c246418f3. +// +// Solidity: event NonceInvalidation(address indexed owner, address indexed token, address indexed spender, uint48 newNonce, uint48 oldNonce) +func (_Permit2 *Permit2Filterer) FilterNonceInvalidation(opts *bind.FilterOpts, owner []common.Address, token []common.Address, spender []common.Address) (*Permit2NonceInvalidationIterator, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var tokenRule []interface{} + for _, tokenItem := range token { + tokenRule = append(tokenRule, tokenItem) + } + var spenderRule []interface{} + for _, spenderItem := range spender { + spenderRule = append(spenderRule, spenderItem) + } + + logs, sub, err := _Permit2.contract.FilterLogs(opts, "NonceInvalidation", ownerRule, tokenRule, spenderRule) + if err != nil { + return nil, err + } + return &Permit2NonceInvalidationIterator{contract: _Permit2.contract, event: "NonceInvalidation", logs: logs, sub: sub}, nil +} + +// WatchNonceInvalidation is a free log subscription operation binding the contract event 0x55eb90d810e1700b35a8e7e25395ff7f2b2259abd7415ca2284dfb1c246418f3. +// +// Solidity: event NonceInvalidation(address indexed owner, address indexed token, address indexed spender, uint48 newNonce, uint48 oldNonce) +func (_Permit2 *Permit2Filterer) WatchNonceInvalidation(opts *bind.WatchOpts, sink chan<- *Permit2NonceInvalidation, owner []common.Address, token []common.Address, spender []common.Address) (event.Subscription, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var tokenRule []interface{} + for _, tokenItem := range token { + tokenRule = append(tokenRule, tokenItem) + } + var spenderRule []interface{} + for _, spenderItem := range spender { + spenderRule = append(spenderRule, spenderItem) + } + + logs, sub, err := _Permit2.contract.WatchLogs(opts, "NonceInvalidation", ownerRule, tokenRule, spenderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(Permit2NonceInvalidation) + if err := _Permit2.contract.UnpackLog(event, "NonceInvalidation", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseNonceInvalidation is a log parse operation binding the contract event 0x55eb90d810e1700b35a8e7e25395ff7f2b2259abd7415ca2284dfb1c246418f3. +// +// Solidity: event NonceInvalidation(address indexed owner, address indexed token, address indexed spender, uint48 newNonce, uint48 oldNonce) +func (_Permit2 *Permit2Filterer) ParseNonceInvalidation(log types.Log) (*Permit2NonceInvalidation, error) { + event := new(Permit2NonceInvalidation) + if err := _Permit2.contract.UnpackLog(event, "NonceInvalidation", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// Permit2PermitIterator is returned from FilterPermit and is used to iterate over the raw logs and unpacked data for Permit events raised by the Permit2 contract. +type Permit2PermitIterator struct { + Event *Permit2Permit // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *Permit2PermitIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(Permit2Permit) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(Permit2Permit) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *Permit2PermitIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *Permit2PermitIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// Permit2Permit represents a Permit event raised by the Permit2 contract. +type Permit2Permit struct { + Owner common.Address + Token common.Address + Spender common.Address + Amount *big.Int + Expiration *big.Int + Nonce *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterPermit is a free log retrieval operation binding the contract event 0xc6a377bfc4eb120024a8ac08eef205be16b817020812c73223e81d1bdb9708ec. +// +// Solidity: event Permit(address indexed owner, address indexed token, address indexed spender, uint160 amount, uint48 expiration, uint48 nonce) +func (_Permit2 *Permit2Filterer) FilterPermit(opts *bind.FilterOpts, owner []common.Address, token []common.Address, spender []common.Address) (*Permit2PermitIterator, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var tokenRule []interface{} + for _, tokenItem := range token { + tokenRule = append(tokenRule, tokenItem) + } + var spenderRule []interface{} + for _, spenderItem := range spender { + spenderRule = append(spenderRule, spenderItem) + } + + logs, sub, err := _Permit2.contract.FilterLogs(opts, "Permit", ownerRule, tokenRule, spenderRule) + if err != nil { + return nil, err + } + return &Permit2PermitIterator{contract: _Permit2.contract, event: "Permit", logs: logs, sub: sub}, nil +} + +// WatchPermit is a free log subscription operation binding the contract event 0xc6a377bfc4eb120024a8ac08eef205be16b817020812c73223e81d1bdb9708ec. +// +// Solidity: event Permit(address indexed owner, address indexed token, address indexed spender, uint160 amount, uint48 expiration, uint48 nonce) +func (_Permit2 *Permit2Filterer) WatchPermit(opts *bind.WatchOpts, sink chan<- *Permit2Permit, owner []common.Address, token []common.Address, spender []common.Address) (event.Subscription, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var tokenRule []interface{} + for _, tokenItem := range token { + tokenRule = append(tokenRule, tokenItem) + } + var spenderRule []interface{} + for _, spenderItem := range spender { + spenderRule = append(spenderRule, spenderItem) + } + + logs, sub, err := _Permit2.contract.WatchLogs(opts, "Permit", ownerRule, tokenRule, spenderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(Permit2Permit) + if err := _Permit2.contract.UnpackLog(event, "Permit", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParsePermit is a log parse operation binding the contract event 0xc6a377bfc4eb120024a8ac08eef205be16b817020812c73223e81d1bdb9708ec. +// +// Solidity: event Permit(address indexed owner, address indexed token, address indexed spender, uint160 amount, uint48 expiration, uint48 nonce) +func (_Permit2 *Permit2Filterer) ParsePermit(log types.Log) (*Permit2Permit, error) { + event := new(Permit2Permit) + if err := _Permit2.contract.UnpackLog(event, "Permit", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// Permit2UnorderedNonceInvalidationIterator is returned from FilterUnorderedNonceInvalidation and is used to iterate over the raw logs and unpacked data for UnorderedNonceInvalidation events raised by the Permit2 contract. +type Permit2UnorderedNonceInvalidationIterator struct { + Event *Permit2UnorderedNonceInvalidation // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *Permit2UnorderedNonceInvalidationIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(Permit2UnorderedNonceInvalidation) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(Permit2UnorderedNonceInvalidation) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *Permit2UnorderedNonceInvalidationIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *Permit2UnorderedNonceInvalidationIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// Permit2UnorderedNonceInvalidation represents a UnorderedNonceInvalidation event raised by the Permit2 contract. +type Permit2UnorderedNonceInvalidation struct { + Owner common.Address + Word *big.Int + Mask *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterUnorderedNonceInvalidation is a free log retrieval operation binding the contract event 0x3704902f963766a4e561bbaab6e6cdc1b1dd12f6e9e99648da8843b3f46b918d. +// +// Solidity: event UnorderedNonceInvalidation(address indexed owner, uint256 word, uint256 mask) +func (_Permit2 *Permit2Filterer) FilterUnorderedNonceInvalidation(opts *bind.FilterOpts, owner []common.Address) (*Permit2UnorderedNonceInvalidationIterator, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + + logs, sub, err := _Permit2.contract.FilterLogs(opts, "UnorderedNonceInvalidation", ownerRule) + if err != nil { + return nil, err + } + return &Permit2UnorderedNonceInvalidationIterator{contract: _Permit2.contract, event: "UnorderedNonceInvalidation", logs: logs, sub: sub}, nil +} + +// WatchUnorderedNonceInvalidation is a free log subscription operation binding the contract event 0x3704902f963766a4e561bbaab6e6cdc1b1dd12f6e9e99648da8843b3f46b918d. +// +// Solidity: event UnorderedNonceInvalidation(address indexed owner, uint256 word, uint256 mask) +func (_Permit2 *Permit2Filterer) WatchUnorderedNonceInvalidation(opts *bind.WatchOpts, sink chan<- *Permit2UnorderedNonceInvalidation, owner []common.Address) (event.Subscription, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + + logs, sub, err := _Permit2.contract.WatchLogs(opts, "UnorderedNonceInvalidation", ownerRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(Permit2UnorderedNonceInvalidation) + if err := _Permit2.contract.UnpackLog(event, "UnorderedNonceInvalidation", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseUnorderedNonceInvalidation is a log parse operation binding the contract event 0x3704902f963766a4e561bbaab6e6cdc1b1dd12f6e9e99648da8843b3f46b918d. +// +// Solidity: event UnorderedNonceInvalidation(address indexed owner, uint256 word, uint256 mask) +func (_Permit2 *Permit2Filterer) ParseUnorderedNonceInvalidation(log types.Log) (*Permit2UnorderedNonceInvalidation, error) { + event := new(Permit2UnorderedNonceInvalidation) + if err := _Permit2.contract.UnpackLog(event, "UnorderedNonceInvalidation", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/op-e2e2/bindings/preimageoracle.go b/op-e2e2/bindings/preimageoracle.go new file mode 100644 index 000000000000..12e34f4a9a30 --- /dev/null +++ b/op-e2e2/bindings/preimageoracle.go @@ -0,0 +1,1072 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// LibKeccakStateMatrix is an auto generated low-level Go binding around an user-defined struct. +type LibKeccakStateMatrix struct { + State [25]uint64 +} + +// PreimageOracleLeaf is an auto generated low-level Go binding around an user-defined struct. +type PreimageOracleLeaf struct { + Input []byte + Index *big.Int + StateCommitment [32]byte +} + +// PreimageOracleMetaData contains all meta data concerning the PreimageOracle contract. +var PreimageOracleMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_minProposalSize\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_challengePeriod\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"KECCAK_TREE_DEPTH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MAX_LEAF_COUNT\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MIN_BOND_SIZE\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"addLeavesLPP\",\"inputs\":[{\"name\":\"_uuid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_inputStartBlock\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_input\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"_stateCommitments\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"},{\"name\":\"_finalize\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"challengeFirstLPP\",\"inputs\":[{\"name\":\"_claimant\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_uuid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_postState\",\"type\":\"tuple\",\"internalType\":\"structPreimageOracle.Leaf\",\"components\":[{\"name\":\"input\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"index\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"stateCommitment\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"name\":\"_postStateProof\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"challengeLPP\",\"inputs\":[{\"name\":\"_claimant\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_uuid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_stateMatrix\",\"type\":\"tuple\",\"internalType\":\"structLibKeccak.StateMatrix\",\"components\":[{\"name\":\"state\",\"type\":\"uint64[25]\",\"internalType\":\"uint64[25]\"}]},{\"name\":\"_preState\",\"type\":\"tuple\",\"internalType\":\"structPreimageOracle.Leaf\",\"components\":[{\"name\":\"input\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"index\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"stateCommitment\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"name\":\"_preStateProof\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"},{\"name\":\"_postState\",\"type\":\"tuple\",\"internalType\":\"structPreimageOracle.Leaf\",\"components\":[{\"name\":\"input\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"index\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"stateCommitment\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"name\":\"_postStateProof\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"challengePeriod\",\"inputs\":[],\"outputs\":[{\"name\":\"challengePeriod_\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTreeRootLPP\",\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_uuid\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"treeRoot_\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initLPP\",\"inputs\":[{\"name\":\"_uuid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_partOffset\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"_claimedSize\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"loadBlobPreimagePart\",\"inputs\":[{\"name\":\"_z\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_y\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_commitment\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"_proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"_partOffset\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"loadKeccak256PreimagePart\",\"inputs\":[{\"name\":\"_partOffset\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_preimage\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"loadLocalData\",\"inputs\":[{\"name\":\"_ident\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_localContext\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_word\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_size\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_partOffset\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"key_\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"loadPrecompilePreimagePart\",\"inputs\":[{\"name\":\"_partOffset\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_precompile\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_input\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"loadSha256PreimagePart\",\"inputs\":[{\"name\":\"_partOffset\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_preimage\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"minProposalSize\",\"inputs\":[],\"outputs\":[{\"name\":\"minProposalSize_\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"preimageLengths\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"preimagePartOk\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"preimageParts\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"proposalBlocks\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"proposalBlocksLen\",\"inputs\":[{\"name\":\"_claimant\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_uuid\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"len_\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"proposalBonds\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"proposalBranches\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"proposalCount\",\"inputs\":[],\"outputs\":[{\"name\":\"count_\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"proposalMetadata\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"LPPMetaData\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"proposalParts\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"proposals\",\"inputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"claimant\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"uuid\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"readPreimage\",\"inputs\":[{\"name\":\"_key\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_offset\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"dat_\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"datLen_\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"squeezeLPP\",\"inputs\":[{\"name\":\"_claimant\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_uuid\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_stateMatrix\",\"type\":\"tuple\",\"internalType\":\"structLibKeccak.StateMatrix\",\"components\":[{\"name\":\"state\",\"type\":\"uint64[25]\",\"internalType\":\"uint64[25]\"}]},{\"name\":\"_preState\",\"type\":\"tuple\",\"internalType\":\"structPreimageOracle.Leaf\",\"components\":[{\"name\":\"input\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"index\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"stateCommitment\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"name\":\"_preStateProof\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"},{\"name\":\"_postState\",\"type\":\"tuple\",\"internalType\":\"structPreimageOracle.Leaf\",\"components\":[{\"name\":\"input\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"index\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"stateCommitment\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"name\":\"_postStateProof\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"zeroHashes\",\"inputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"error\",\"name\":\"ActiveProposal\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"AlreadyFinalized\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"BadProposal\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"BondTransferFailed\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InsufficientBond\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidInputSize\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidPreimage\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidProof\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotEOA\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotInitialized\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"PartOffsetOOB\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"PostStateMatches\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"StatesNotContiguous\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"TreeSizeOverflow\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"WrongStartingBlock\",\"inputs\":[]}]", + Bin: "0x60c06040523480156200001157600080fd5b50604051620039f9380380620039f98339810160408190526200003491620000f3565b60a0829052608081905260005b6200004f600160106200012e565b811015620000ea57600381601081106200006d576200006d62000148565b01546003826010811062000085576200008562000148565b0154604080516020810193909352820152606001604051602081830303815290604052805190602001206003826001620000c091906200015e565b60108110620000d357620000d362000148565b015580620000e18162000179565b91505062000041565b50505062000195565b600080604083850312156200010757600080fd5b505080516020909101519092909150565b634e487b7160e01b600052601160045260246000fd5b60008282101562000143576200014362000118565b500390565b634e487b7160e01b600052603260045260246000fd5b6000821982111562000174576200017462000118565b500190565b6000600182016200018e576200018e62000118565b5060010190565b60805160a051613830620001c9600039600081816105ae0152611d5101526000818161068e01526115b901526138306000f3fe6080604052600436106101cd5760003560e01c80638dc4be11116100f7578063dd24f9bf11610095578063ec5efcbc11610064578063ec5efcbc1461065f578063f3f480d91461067f578063faf37bc7146106b2578063fef2b4ed146106c557600080fd5b8063dd24f9bf1461059f578063ddcd58de146105d2578063e03110e11461060a578063e15926111461063f57600080fd5b8063b2e67ba8116100d1578063b2e67ba814610512578063b4801e611461054a578063d18534b51461056a578063da35c6641461058a57600080fd5b80638dc4be11146104835780639d53a648146104a35780639d7e8769146104f257600080fd5b806354fd4d501161016f5780637917de1d1161013e5780637917de1d146103bf5780637ac54767146103df5780638542cf50146103ff578063882856ef1461044a57600080fd5b806354fd4d50146102dd57806361238bde146103335780636551927b1461036b5780637051472e146103a357600080fd5b80632055b36b116101ab5780632055b36b146102735780633909af5c146102885780634d52b4c9146102a857806352f0f3ad146102bd57600080fd5b8063013cf08b146101d25780630359a5631461022357806304697c7814610251575b600080fd5b3480156101de57600080fd5b506101f26101ed366004612d2f565b6106f2565b6040805173ffffffffffffffffffffffffffffffffffffffff90931683526020830191909152015b60405180910390f35b34801561022f57600080fd5b5061024361023e366004612d71565b610737565b60405190815260200161021a565b34801561025d57600080fd5b5061027161026c366004612de4565b61086f565b005b34801561027f57600080fd5b50610243601081565b34801561029457600080fd5b506102716102a3366004613008565b6109a5565b3480156102b457600080fd5b50610243610bfc565b3480156102c957600080fd5b506102436102d83660046130f4565b610c17565b3480156102e957600080fd5b506103266040518060400160405280600581526020017f302e322e3000000000000000000000000000000000000000000000000000000081525081565b60405161021a919061315b565b34801561033f57600080fd5b5061024361034e3660046131ac565b600160209081526000928352604080842090915290825290205481565b34801561037757600080fd5b50610243610386366004612d71565b601560209081526000928352604080842090915290825290205481565b3480156103af57600080fd5b506102436703782dace9d9000081565b3480156103cb57600080fd5b506102716103da3660046131ce565b610cec565b3480156103eb57600080fd5b506102436103fa366004612d2f565b6111ef565b34801561040b57600080fd5b5061043a61041a3660046131ac565b600260209081526000928352604080842090915290825290205460ff1681565b604051901515815260200161021a565b34801561045657600080fd5b5061046a61046536600461326a565b611206565b60405167ffffffffffffffff909116815260200161021a565b34801561048f57600080fd5b5061027161049e36600461329d565b611260565b3480156104af57600080fd5b506102436104be366004612d71565b73ffffffffffffffffffffffffffffffffffffffff9091166000908152601860209081526040808320938352929052205490565b3480156104fe57600080fd5b5061027161050d3660046132e9565b61135b565b34801561051e57600080fd5b5061024361052d366004612d71565b601760209081526000928352604080842090915290825290205481565b34801561055657600080fd5b5061024361056536600461326a565b611512565b34801561057657600080fd5b50610271610585366004613008565b611544565b34801561059657600080fd5b50601354610243565b3480156105ab57600080fd5b507f0000000000000000000000000000000000000000000000000000000000000000610243565b3480156105de57600080fd5b506102436105ed366004612d71565b601660209081526000928352604080842090915290825290205481565b34801561061657600080fd5b5061062a6106253660046131ac565b611906565b6040805192835260208301919091520161021a565b34801561064b57600080fd5b5061027161065a36600461329d565b6119f7565b34801561066b57600080fd5b5061027161067a366004613375565b611aff565b34801561068b57600080fd5b507f0000000000000000000000000000000000000000000000000000000000000000610243565b6102716106c036600461340e565b611c85565b3480156106d157600080fd5b506102436106e0366004612d2f565b60006020819052908152604090205481565b6013818154811061070257600080fd5b60009182526020909120600290910201805460019091015473ffffffffffffffffffffffffffffffffffffffff909116915082565b73ffffffffffffffffffffffffffffffffffffffff82166000908152601560209081526040808320848452909152812054819061077a9060601c63ffffffff1690565b63ffffffff16905060005b6010811015610867578160011660010361080d5773ffffffffffffffffffffffffffffffffffffffff85166000908152601460209081526040808320878452909152902081601081106107da576107da61344a565b0154604080516020810192909252810184905260600160405160208183030381529060405280519060200120925061084e565b82600382601081106108215761082161344a565b01546040805160208101939093528201526060016040516020818303038152906040528051906020012092505b60019190911c908061085f816134a8565b915050610785565b505092915050565b600080600080608060146030823785878260140137601480870182207effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f06000000000000000000000000000000000000000000000000000000000000001794506000908190889084018b5afa94503d60010191506008820189106108fc5763fe2549876000526004601cfd5b60c082901b81526008018481533d6000600183013e88017ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8015160008481526002602090815260408083208c8452825280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600190811790915587845282528083209b83529a81528a82209290925593845283905296909120959095555050505050565b60006109b18a8a610737565b90506109d486868360208b01356109cf6109ca8d6134e0565b611ef0565b611f30565b80156109f257506109f283838360208801356109cf6109ca8a6134e0565b610a28576040517f09bde33900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b866040013588604051602001610a3e91906135af565b6040516020818303038152906040528051906020012014610a8b576040517f1968a90200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b836020013587602001356001610aa191906135ed565b14610ad8576040517f9a3b119900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610b2088610ae68680613605565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611f9192505050565b610b29886120ec565b836040013588604051602001610b3f91906135af565b6040516020818303038152906040528051906020012003610b8c576040517f9843145b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8a1660009081526015602090815260408083208c8452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000166001179055610bf08a8a33612894565b50505050505050505050565b6001610c0a6010600261378c565b610c149190613798565b81565b6000610c23868661294d565b9050610c308360086135ed565b821180610c3d5750602083115b15610c74576040517ffe25498700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000602081815260c085901b82526008959095528251828252600286526040808320858452875280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660019081179091558484528752808320948352938652838220558181529384905292205592915050565b60608115610d0557610cfe86866129fa565b9050610d3f565b85858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509293505050505b3360009081526014602090815260408083208b845290915280822081516102008101928390529160109082845b815481526020019060010190808311610d6c57505050505090506000601560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008b81526020019081526020016000205490506000610ded8260601c63ffffffff1690565b63ffffffff169050333214610e2e576040517fba092d1600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610e3e8260801c63ffffffff1690565b63ffffffff16600003610e7d576040517f87138d5c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610e878260c01c90565b67ffffffffffffffff1615610ec8576040517f475a253500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b898114610f01576040517f60f95d5a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f0e89898d8886612a73565b83516020850160888204881415608883061715610f33576307b1daf16000526004601cfd5b60405160c8810160405260005b83811015610fe3578083018051835260208101516020840152604081015160408401526060810151606084015260808101516080840152508460888301526088810460051b8b013560a883015260c882206001860195508560005b610200811015610fd8576001821615610fb85782818b0152610fd8565b8981015160009081526020938452604090209260019290921c9101610f9b565b505050608801610f40565b50505050600160106002610ff7919061378c565b6110019190613798565b81111561103a576040517f6229572300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6110af61104d8360401c63ffffffff1690565b61105d9063ffffffff168a6135ed565b60401b7fffffffffffffffffffffffffffffffffffffffff00000000ffffffffffffffff606084901b167fffffffffffffffffffffffffffffffff0000000000000000ffffffffffffffff8516171790565b9150841561113c5777ffffffffffffffffffffffffffffffffffffffffffffffff82164260c01b1791506110e98260801c63ffffffff1690565b63ffffffff166110ff8360401c63ffffffff1690565b63ffffffff161461113c576040517f7b1dafd100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3360009081526014602090815260408083208e8452909152902061116290846010612ca5565b503360008181526018602090815260408083208f8452825280832080546001810182559084528284206004820401805460039092166008026101000a67ffffffffffffffff818102199093164390931602919091179055838352601582528083208f8452909152812084905560609190911b81523690601437366014016000a05050505050505050505050565b600381601081106111ff57600080fd5b0154905081565b6018602052826000526040600020602052816000526040600020818154811061122e57600080fd5b906000526020600020906004918282040191900660080292509250509054906101000a900467ffffffffffffffff1681565b60443560008060088301861061127e5763fe2549876000526004601cfd5b60c083901b60805260888386823786600882030151915060206000858360025afa9050806112ab57600080fd5b50600080517effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f0400000000000000000000000000000000000000000000000000000000000000178082526002602090815260408084208a8552825280842080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660019081179091558385528252808420998452988152888320939093558152908190529490942055505050565b600080603087600037602060006030600060025afa806113835763f91129696000526004601cfd5b6000517effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f010000000000000000000000000000000000000000000000000000000000000017608081815260a08c905260c08b905260308a60e037603088609083013760008060c083600a5afa925082611405576309bde3396000526004601cfd5b6028861061141b5763fe2549876000526004601cfd5b6000602882015278200000000000000000000000000000000000000000000000008152600881018b905285810151935060308a8237603081019b909b52505060509098207effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f0500000000000000000000000000000000000000000000000000000000000000176000818152600260209081526040808320868452825280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600190811790915584845282528083209583529481528482209a909a559081528089529190912096909655505050505050565b6014602052826000526040600020602052816000526040600020816010811061153a57600080fd5b0154925083915050565b73ffffffffffffffffffffffffffffffffffffffff891660009081526015602090815260408083208b845290915290205467ffffffffffffffff8116156115b7576040517fc334f06900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006115e28260c01c90565b6115f69067ffffffffffffffff1642613798565b1161162d576040517f55d4cbf900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006116398b8b610737565b905061165287878360208c01356109cf6109ca8e6134e0565b8015611670575061167084848360208901356109cf6109ca8b6134e0565b6116a6576040517f09bde33900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8760400135896040516020016116bc91906135af565b6040516020818303038152906040528051906020012014611709576040517f1968a90200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b84602001358860200135600161171f91906135ed565b141580611751575060016117398360601c63ffffffff1690565b61174391906137af565b63ffffffff16856020013514155b15611788576040517f9a3b119900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61179689610ae68780613605565b61179f896120ec565b60006117aa8a612bc6565b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f020000000000000000000000000000000000000000000000000000000000000017905060006118018460a01c63ffffffff1690565b67ffffffffffffffff169050600160026000848152602001908152602001600020600083815260200190815260200160002060006101000a81548160ff021916908315150217905550601760008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008d815260200190815260200160002054600160008481526020019081526020016000206000838152602001908152602001600020819055506118d38460801c63ffffffff1690565b600083815260208190526040902063ffffffff9190911690556118f78d8d81612894565b50505050505050505050505050565b6000828152600260209081526040808320848452909152812054819060ff1661198f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f7072652d696d616765206d757374206578697374000000000000000000000000604482015260640160405180910390fd5b50600083815260208181526040909120546119ab8160086135ed565b6119b68560206135ed565b106119d457836119c78260086135ed565b6119d19190613798565b91505b506000938452600160209081526040808620948652939052919092205492909150565b604435600080600883018610611a155763fe2549876000526004601cfd5b60c083901b6080526088838682378087017ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80151908490207effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f02000000000000000000000000000000000000000000000000000000000000001760008181526002602090815260408083208b8452825280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600190811790915584845282528083209a83529981528982209390935590815290819052959095209190915550505050565b6000611b0b8686610737565b9050611b2483838360208801356109cf6109ca8a6134e0565b611b5a576040517f09bde33900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b602084013515611b96576040517f9a3b119900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611b9e612ce3565b611bac81610ae68780613605565b611bb5816120ec565b846040013581604051602001611bcb91906135af565b6040516020818303038152906040528051906020012003611c18576040517f9843145b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff87166000908152601560209081526040808320898452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000166001179055611c7c878733612894565b50505050505050565b6703782dace9d90000341015611cc7576040517fe92c469f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b333214611d00576040517fba092d1600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611d0b8160086137d4565b63ffffffff168263ffffffff1610611d4f576040517ffe25498700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000008163ffffffff161015611daf576040517f7b1dafd100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336000818152601560209081526040808320878452825280832080547fffffffffffffffff0000000000000000ffffffffffffffffffffffffffffffff1660a09790971b7fffffffffffffffffffffffff00000000ffffffffffffffffffffffffffffffff169690961760809590951b949094179094558251808401845282815280850186815260138054600181018255908452915160029092027f66de8ffda797e3de9c05e8fc57b3bf0ec28a930d40b0d285d93c06501cf6a0908101805473ffffffffffffffffffffffffffffffffffffffff9094167fffffffffffffffffffffffff000000000000000000000000000000000000000090941693909317909255517f66de8ffda797e3de9c05e8fc57b3bf0ec28a930d40b0d285d93c06501cf6a0919091015590815260168352818120938152929091529020349055565b6000816000015182602001518360400151604051602001611f13939291906137fc565b604051602081830303815290604052805190602001209050919050565b60008160005b6010811015611f84578060051b880135600186831c1660018114611f695760008481526020839052604090209350611f7a565b600082815260208590526040902093505b5050600101611f36565b5090931495945050505050565b6088815114611f9f57600080fd5b6020810160208301612020565b8260031b8201518060001a8160011a60081b178160021a60101b8260031a60181b17178160041a60201b8260051a60281b178260061a60301b8360071a60381b171717905061201a81612005868560059190911b015190565b1867ffffffffffffffff16600586901b840152565b50505050565b61202c60008383611fac565b61203860018383611fac565b61204460028383611fac565b61205060038383611fac565b61205c60048383611fac565b61206860058383611fac565b61207460068383611fac565b61208060078383611fac565b61208c60088383611fac565b61209860098383611fac565b6120a4600a8383611fac565b6120b0600b8383611fac565b6120bc600c8383611fac565b6120c8600d8383611fac565b6120d4600e8383611fac565b6120e0600f8383611fac565b61201a60108383611fac565b6040805178010000000000008082800000000000808a8000000080008000602082015279808b00000000800000018000000080008081800000000000800991810191909152788a00000000000000880000000080008009000000008000000a60608201527b8000808b800000000000008b8000000000008089800000000000800360808201527f80000000000080028000000000000080000000000000800a800000008000000a60a08201527f800000008000808180000000000080800000000080000001800000008000800860c082015260009060e00160405160208183030381529060405290506020820160208201612774565b6102808101516101e082015161014083015160a0840151845118189118186102a082015161020083015161016084015160c0850151602086015118189118186102c083015161022084015161018085015160e0860151604087015118189118186102e08401516102408501516101a0860151610100870151606088015118189118186103008501516102608601516101c0870151610120880151608089015118189118188084603f1c61229f8660011b67ffffffffffffffff1690565b18188584603f1c6122ba8660011b67ffffffffffffffff1690565b18188584603f1c6122d58660011b67ffffffffffffffff1690565b181895508483603f1c6122f28560011b67ffffffffffffffff1690565b181894508387603f1c61230f8960011b67ffffffffffffffff1690565b60208b01518b51861867ffffffffffffffff168c5291189190911897508118600181901b603f9190911c18935060c08801518118601481901c602c9190911b1867ffffffffffffffff1660208901526101208801518718602c81901c60149190911b1867ffffffffffffffff1660c08901526102c08801518618600381901c603d9190911b1867ffffffffffffffff166101208901526101c08801518718601981901c60279190911b1867ffffffffffffffff166102c08901526102808801518218602e81901c60129190911b1867ffffffffffffffff166101c089015260408801518618600281901c603e9190911b1867ffffffffffffffff166102808901526101808801518618601581901c602b9190911b1867ffffffffffffffff1660408901526101a08801518518602781901c60199190911b1867ffffffffffffffff166101808901526102608801518718603881901c60089190911b1867ffffffffffffffff166101a08901526102e08801518518600881901c60389190911b1867ffffffffffffffff166102608901526101e08801518218601781901c60299190911b1867ffffffffffffffff166102e089015260808801518718602581901c601b9190911b1867ffffffffffffffff166101e08901526103008801518718603281901c600e9190911b1867ffffffffffffffff1660808901526102a08801518118603e81901c60029190911b1867ffffffffffffffff166103008901526101008801518518600981901c60379190911b1867ffffffffffffffff166102a08901526102008801518118601381901c602d9190911b1867ffffffffffffffff1661010089015260a08801518218601c81901c60249190911b1867ffffffffffffffff1661020089015260608801518518602481901c601c9190911b1867ffffffffffffffff1660a08901526102408801518518602b81901c60159190911b1867ffffffffffffffff1660608901526102208801518618603181901c600f9190911b1867ffffffffffffffff166102408901526101608801518118603681901c600a9190911b1867ffffffffffffffff166102208901525060e08701518518603a81901c60069190911b1867ffffffffffffffff166101608801526101408701518118603d81901c60039190911b1867ffffffffffffffff1660e0880152505067ffffffffffffffff81166101408601525b5050505050565b600582811b8201805160018501831b8401805160028701851b8601805160038901871b8801805160048b0190981b8901805167ffffffffffffffff861985168918811690995283198a16861889169096528819861683188816909352841986168818871690528419831684189095169052919391929190611c7c565b61270e600082612687565b612719600582612687565b612724600a82612687565b61272f600f82612687565b61273a601482612687565b50565b612746816121e2565b61274f81612703565b600383901b820151815160c09190911c9061201a90821867ffffffffffffffff168352565b6127806000828461273d565b61278c6001828461273d565b6127986002828461273d565b6127a46003828461273d565b6127b06004828461273d565b6127bc6005828461273d565b6127c86006828461273d565b6127d46007828461273d565b6127e06008828461273d565b6127ec6009828461273d565b6127f8600a828461273d565b612804600b828461273d565b612810600c828461273d565b61281c600d828461273d565b612828600e828461273d565b612834600f828461273d565b6128406010828461273d565b61284c6011828461273d565b6128586012828461273d565b6128646013828461273d565b6128706014828461273d565b61287c6015828461273d565b6128886016828461273d565b61201a6017828461273d565b73ffffffffffffffffffffffffffffffffffffffff83811660009081526016602090815260408083208684529091528082208054908390559051909284169083908381818185875af1925050503d806000811461290d576040519150601f19603f3d011682016040523d82523d6000602084013e612912565b606091505b5050905080612680576040517f83e6cc6b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f01000000000000000000000000000000000000000000000000000000000000007effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8316176129f3818360408051600093845233602052918152606090922091527effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f01000000000000000000000000000000000000000000000000000000000000001790565b9392505050565b6060604051905081602082018181018286833760888306808015612a435760888290038501848101848103803687375060806001820353506001845160001a1784538652612a5a565b608836843760018353608060878401536088850186525b5050505050601f19603f82510116810160405292915050565b6000612a858260a01c63ffffffff1690565b67ffffffffffffffff1690506000612aa38360801c63ffffffff1690565b63ffffffff1690506000612abd8460401c63ffffffff1690565b63ffffffff169050600883108015612ad3575080155b15612b075760c082901b6000908152883560085283513382526017602090815260408084208a855290915290912055612bbc565b60088310158015612b25575080612b1f600885613798565b93508310155b8015612b395750612b3687826135ed565b83105b15612bbc576000612b4a8285613798565b905087612b588260206135ed565b10158015612b64575085155b15612b9b576040517ffe25498700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3360009081526017602090815260408083208a845290915290209089013590555b5050505050505050565b6000612c49565b66ff00ff00ff00ff8160081c1667ff00ff00ff00ff00612bf78360081b67ffffffffffffffff1690565b1617905065ffff0000ffff8160101c1667ffff0000ffff0000612c248360101b67ffffffffffffffff1690565b1617905060008160201c612c428360201b67ffffffffffffffff1690565b1792915050565b60808201516020830190612c6190612bcd565b612bcd565b6040820151612c6f90612bcd565b60401b17612c87612c5c60018460059190911b015190565b825160809190911b90612c9990612bcd565b60c01b17179392505050565b8260108101928215612cd3579160200282015b82811115612cd3578251825591602001919060010190612cb8565b50612cdf929150612cfb565b5090565b6040518060200160405280612cf6612d10565b905290565b5b80821115612cdf5760008155600101612cfc565b6040518061032001604052806019906020820280368337509192915050565b600060208284031215612d4157600080fd5b5035919050565b803573ffffffffffffffffffffffffffffffffffffffff81168114612d6c57600080fd5b919050565b60008060408385031215612d8457600080fd5b612d8d83612d48565b946020939093013593505050565b60008083601f840112612dad57600080fd5b50813567ffffffffffffffff811115612dc557600080fd5b602083019150836020828501011115612ddd57600080fd5b9250929050565b60008060008060608587031215612dfa57600080fd5b84359350612e0a60208601612d48565b9250604085013567ffffffffffffffff811115612e2657600080fd5b612e3287828801612d9b565b95989497509550505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051610320810167ffffffffffffffff81118282101715612e9157612e91612e3e565b60405290565b6040516060810167ffffffffffffffff81118282101715612e9157612e91612e3e565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715612f0157612f01612e3e565b604052919050565b6000610320808385031215612f1d57600080fd5b604051602080820167ffffffffffffffff8382108183111715612f4257612f42612e3e565b8160405283955087601f880112612f5857600080fd5b612f60612e6d565b9487019491508188861115612f7457600080fd5b875b86811015612f9c5780358381168114612f8f5760008081fd5b8452928401928401612f76565b50909352509295945050505050565b600060608284031215612fbd57600080fd5b50919050565b60008083601f840112612fd557600080fd5b50813567ffffffffffffffff811115612fed57600080fd5b6020830191508360208260051b8501011115612ddd57600080fd5b60008060008060008060008060006103e08a8c03121561302757600080fd5b6130308a612d48565b985060208a013597506130468b60408c01612f09565b96506103608a013567ffffffffffffffff8082111561306457600080fd5b6130708d838e01612fab565b97506103808c013591508082111561308757600080fd5b6130938d838e01612fc3565b90975095506103a08c01359150808211156130ad57600080fd5b6130b98d838e01612fab565b94506103c08c01359150808211156130d057600080fd5b506130dd8c828d01612fc3565b915080935050809150509295985092959850929598565b600080600080600060a0868803121561310c57600080fd5b505083359560208501359550604085013594606081013594506080013592509050565b60005b8381101561314a578181015183820152602001613132565b8381111561201a5750506000910152565b602081526000825180602084015261317a81604085016020870161312f565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b600080604083850312156131bf57600080fd5b50508035926020909101359150565b600080600080600080600060a0888a0312156131e957600080fd5b8735965060208801359550604088013567ffffffffffffffff8082111561320f57600080fd5b61321b8b838c01612d9b565b909750955060608a013591508082111561323457600080fd5b506132418a828b01612fc3565b9094509250506080880135801515811461325a57600080fd5b8091505092959891949750929550565b60008060006060848603121561327f57600080fd5b61328884612d48565b95602085013595506040909401359392505050565b6000806000604084860312156132b257600080fd5b83359250602084013567ffffffffffffffff8111156132d057600080fd5b6132dc86828701612d9b565b9497909650939450505050565b600080600080600080600060a0888a03121561330457600080fd5b8735965060208801359550604088013567ffffffffffffffff8082111561332a57600080fd5b6133368b838c01612d9b565b909750955060608a013591508082111561334f57600080fd5b5061335c8a828b01612d9b565b989b979a50959894979596608090950135949350505050565b60008060008060006080868803121561338d57600080fd5b61339686612d48565b945060208601359350604086013567ffffffffffffffff808211156133ba57600080fd5b6133c689838a01612fab565b945060608801359150808211156133dc57600080fd5b506133e988828901612fc3565b969995985093965092949392505050565b803563ffffffff81168114612d6c57600080fd5b60008060006060848603121561342357600080fd5b83359250613433602085016133fa565b9150613441604085016133fa565b90509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036134d9576134d9613479565b5060010190565b6000606082360312156134f257600080fd5b6134fa612e97565b823567ffffffffffffffff8082111561351257600080fd5b9084019036601f83011261352557600080fd5b813560208282111561353957613539612e3e565b613569817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f85011601612eba565b9250818352368183860101111561357f57600080fd5b81818501828501376000918301810191909152908352848101359083015250604092830135928101929092525090565b81516103208201908260005b60198110156135e457825167ffffffffffffffff168252602092830192909101906001016135bb565b50505092915050565b6000821982111561360057613600613479565b500190565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261363a57600080fd5b83018035915067ffffffffffffffff82111561365557600080fd5b602001915036819003821315612ddd57600080fd5b600181815b808511156136c357817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156136a9576136a9613479565b808516156136b657918102915b93841c939080029061366f565b509250929050565b6000826136da57506001613786565b816136e757506000613786565b81600181146136fd576002811461370757613723565b6001915050613786565b60ff84111561371857613718613479565b50506001821b613786565b5060208310610133831016604e8410600b8410161715613746575081810a613786565b613750838361366a565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561378257613782613479565b0290505b92915050565b60006129f383836136cb565b6000828210156137aa576137aa613479565b500390565b600063ffffffff838116908316818110156137cc576137cc613479565b039392505050565b600063ffffffff8083168185168083038211156137f3576137f3613479565b01949350505050565b6000845161380e81846020890161312f565b9190910192835250602082015260400191905056fea164736f6c634300080f000a", +} + +// PreimageOracleABI is the input ABI used to generate the binding from. +// Deprecated: Use PreimageOracleMetaData.ABI instead. +var PreimageOracleABI = PreimageOracleMetaData.ABI + +// PreimageOracleBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use PreimageOracleMetaData.Bin instead. +var PreimageOracleBin = PreimageOracleMetaData.Bin + +// DeployPreimageOracle deploys a new Ethereum contract, binding an instance of PreimageOracle to it. +func DeployPreimageOracle(auth *bind.TransactOpts, backend bind.ContractBackend, _minProposalSize *big.Int, _challengePeriod *big.Int) (common.Address, *types.Transaction, *PreimageOracle, error) { + parsed, err := PreimageOracleMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(PreimageOracleBin), backend, _minProposalSize, _challengePeriod) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &PreimageOracle{PreimageOracleCaller: PreimageOracleCaller{contract: contract}, PreimageOracleTransactor: PreimageOracleTransactor{contract: contract}, PreimageOracleFilterer: PreimageOracleFilterer{contract: contract}}, nil +} + +// PreimageOracle is an auto generated Go binding around an Ethereum contract. +type PreimageOracle struct { + PreimageOracleCaller // Read-only binding to the contract + PreimageOracleTransactor // Write-only binding to the contract + PreimageOracleFilterer // Log filterer for contract events +} + +// PreimageOracleCaller is an auto generated read-only Go binding around an Ethereum contract. +type PreimageOracleCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// PreimageOracleTransactor is an auto generated write-only Go binding around an Ethereum contract. +type PreimageOracleTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// PreimageOracleFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type PreimageOracleFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// PreimageOracleSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type PreimageOracleSession struct { + Contract *PreimageOracle // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// PreimageOracleCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type PreimageOracleCallerSession struct { + Contract *PreimageOracleCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// PreimageOracleTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type PreimageOracleTransactorSession struct { + Contract *PreimageOracleTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// PreimageOracleRaw is an auto generated low-level Go binding around an Ethereum contract. +type PreimageOracleRaw struct { + Contract *PreimageOracle // Generic contract binding to access the raw methods on +} + +// PreimageOracleCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type PreimageOracleCallerRaw struct { + Contract *PreimageOracleCaller // Generic read-only contract binding to access the raw methods on +} + +// PreimageOracleTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type PreimageOracleTransactorRaw struct { + Contract *PreimageOracleTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewPreimageOracle creates a new instance of PreimageOracle, bound to a specific deployed contract. +func NewPreimageOracle(address common.Address, backend bind.ContractBackend) (*PreimageOracle, error) { + contract, err := bindPreimageOracle(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &PreimageOracle{PreimageOracleCaller: PreimageOracleCaller{contract: contract}, PreimageOracleTransactor: PreimageOracleTransactor{contract: contract}, PreimageOracleFilterer: PreimageOracleFilterer{contract: contract}}, nil +} + +// NewPreimageOracleCaller creates a new read-only instance of PreimageOracle, bound to a specific deployed contract. +func NewPreimageOracleCaller(address common.Address, caller bind.ContractCaller) (*PreimageOracleCaller, error) { + contract, err := bindPreimageOracle(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &PreimageOracleCaller{contract: contract}, nil +} + +// NewPreimageOracleTransactor creates a new write-only instance of PreimageOracle, bound to a specific deployed contract. +func NewPreimageOracleTransactor(address common.Address, transactor bind.ContractTransactor) (*PreimageOracleTransactor, error) { + contract, err := bindPreimageOracle(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &PreimageOracleTransactor{contract: contract}, nil +} + +// NewPreimageOracleFilterer creates a new log filterer instance of PreimageOracle, bound to a specific deployed contract. +func NewPreimageOracleFilterer(address common.Address, filterer bind.ContractFilterer) (*PreimageOracleFilterer, error) { + contract, err := bindPreimageOracle(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &PreimageOracleFilterer{contract: contract}, nil +} + +// bindPreimageOracle binds a generic wrapper to an already deployed contract. +func bindPreimageOracle(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(PreimageOracleABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_PreimageOracle *PreimageOracleRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _PreimageOracle.Contract.PreimageOracleCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_PreimageOracle *PreimageOracleRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _PreimageOracle.Contract.PreimageOracleTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_PreimageOracle *PreimageOracleRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _PreimageOracle.Contract.PreimageOracleTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_PreimageOracle *PreimageOracleCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _PreimageOracle.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_PreimageOracle *PreimageOracleTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _PreimageOracle.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_PreimageOracle *PreimageOracleTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _PreimageOracle.Contract.contract.Transact(opts, method, params...) +} + +// KECCAKTREEDEPTH is a free data retrieval call binding the contract method 0x2055b36b. +// +// Solidity: function KECCAK_TREE_DEPTH() view returns(uint256) +func (_PreimageOracle *PreimageOracleCaller) KECCAKTREEDEPTH(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _PreimageOracle.contract.Call(opts, &out, "KECCAK_TREE_DEPTH") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// KECCAKTREEDEPTH is a free data retrieval call binding the contract method 0x2055b36b. +// +// Solidity: function KECCAK_TREE_DEPTH() view returns(uint256) +func (_PreimageOracle *PreimageOracleSession) KECCAKTREEDEPTH() (*big.Int, error) { + return _PreimageOracle.Contract.KECCAKTREEDEPTH(&_PreimageOracle.CallOpts) +} + +// KECCAKTREEDEPTH is a free data retrieval call binding the contract method 0x2055b36b. +// +// Solidity: function KECCAK_TREE_DEPTH() view returns(uint256) +func (_PreimageOracle *PreimageOracleCallerSession) KECCAKTREEDEPTH() (*big.Int, error) { + return _PreimageOracle.Contract.KECCAKTREEDEPTH(&_PreimageOracle.CallOpts) +} + +// MAXLEAFCOUNT is a free data retrieval call binding the contract method 0x4d52b4c9. +// +// Solidity: function MAX_LEAF_COUNT() view returns(uint256) +func (_PreimageOracle *PreimageOracleCaller) MAXLEAFCOUNT(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _PreimageOracle.contract.Call(opts, &out, "MAX_LEAF_COUNT") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// MAXLEAFCOUNT is a free data retrieval call binding the contract method 0x4d52b4c9. +// +// Solidity: function MAX_LEAF_COUNT() view returns(uint256) +func (_PreimageOracle *PreimageOracleSession) MAXLEAFCOUNT() (*big.Int, error) { + return _PreimageOracle.Contract.MAXLEAFCOUNT(&_PreimageOracle.CallOpts) +} + +// MAXLEAFCOUNT is a free data retrieval call binding the contract method 0x4d52b4c9. +// +// Solidity: function MAX_LEAF_COUNT() view returns(uint256) +func (_PreimageOracle *PreimageOracleCallerSession) MAXLEAFCOUNT() (*big.Int, error) { + return _PreimageOracle.Contract.MAXLEAFCOUNT(&_PreimageOracle.CallOpts) +} + +// MINBONDSIZE is a free data retrieval call binding the contract method 0x7051472e. +// +// Solidity: function MIN_BOND_SIZE() view returns(uint256) +func (_PreimageOracle *PreimageOracleCaller) MINBONDSIZE(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _PreimageOracle.contract.Call(opts, &out, "MIN_BOND_SIZE") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// MINBONDSIZE is a free data retrieval call binding the contract method 0x7051472e. +// +// Solidity: function MIN_BOND_SIZE() view returns(uint256) +func (_PreimageOracle *PreimageOracleSession) MINBONDSIZE() (*big.Int, error) { + return _PreimageOracle.Contract.MINBONDSIZE(&_PreimageOracle.CallOpts) +} + +// MINBONDSIZE is a free data retrieval call binding the contract method 0x7051472e. +// +// Solidity: function MIN_BOND_SIZE() view returns(uint256) +func (_PreimageOracle *PreimageOracleCallerSession) MINBONDSIZE() (*big.Int, error) { + return _PreimageOracle.Contract.MINBONDSIZE(&_PreimageOracle.CallOpts) +} + +// ChallengePeriod is a free data retrieval call binding the contract method 0xf3f480d9. +// +// Solidity: function challengePeriod() view returns(uint256 challengePeriod_) +func (_PreimageOracle *PreimageOracleCaller) ChallengePeriod(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _PreimageOracle.contract.Call(opts, &out, "challengePeriod") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// ChallengePeriod is a free data retrieval call binding the contract method 0xf3f480d9. +// +// Solidity: function challengePeriod() view returns(uint256 challengePeriod_) +func (_PreimageOracle *PreimageOracleSession) ChallengePeriod() (*big.Int, error) { + return _PreimageOracle.Contract.ChallengePeriod(&_PreimageOracle.CallOpts) +} + +// ChallengePeriod is a free data retrieval call binding the contract method 0xf3f480d9. +// +// Solidity: function challengePeriod() view returns(uint256 challengePeriod_) +func (_PreimageOracle *PreimageOracleCallerSession) ChallengePeriod() (*big.Int, error) { + return _PreimageOracle.Contract.ChallengePeriod(&_PreimageOracle.CallOpts) +} + +// GetTreeRootLPP is a free data retrieval call binding the contract method 0x0359a563. +// +// Solidity: function getTreeRootLPP(address _owner, uint256 _uuid) view returns(bytes32 treeRoot_) +func (_PreimageOracle *PreimageOracleCaller) GetTreeRootLPP(opts *bind.CallOpts, _owner common.Address, _uuid *big.Int) ([32]byte, error) { + var out []interface{} + err := _PreimageOracle.contract.Call(opts, &out, "getTreeRootLPP", _owner, _uuid) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// GetTreeRootLPP is a free data retrieval call binding the contract method 0x0359a563. +// +// Solidity: function getTreeRootLPP(address _owner, uint256 _uuid) view returns(bytes32 treeRoot_) +func (_PreimageOracle *PreimageOracleSession) GetTreeRootLPP(_owner common.Address, _uuid *big.Int) ([32]byte, error) { + return _PreimageOracle.Contract.GetTreeRootLPP(&_PreimageOracle.CallOpts, _owner, _uuid) +} + +// GetTreeRootLPP is a free data retrieval call binding the contract method 0x0359a563. +// +// Solidity: function getTreeRootLPP(address _owner, uint256 _uuid) view returns(bytes32 treeRoot_) +func (_PreimageOracle *PreimageOracleCallerSession) GetTreeRootLPP(_owner common.Address, _uuid *big.Int) ([32]byte, error) { + return _PreimageOracle.Contract.GetTreeRootLPP(&_PreimageOracle.CallOpts, _owner, _uuid) +} + +// MinProposalSize is a free data retrieval call binding the contract method 0xdd24f9bf. +// +// Solidity: function minProposalSize() view returns(uint256 minProposalSize_) +func (_PreimageOracle *PreimageOracleCaller) MinProposalSize(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _PreimageOracle.contract.Call(opts, &out, "minProposalSize") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// MinProposalSize is a free data retrieval call binding the contract method 0xdd24f9bf. +// +// Solidity: function minProposalSize() view returns(uint256 minProposalSize_) +func (_PreimageOracle *PreimageOracleSession) MinProposalSize() (*big.Int, error) { + return _PreimageOracle.Contract.MinProposalSize(&_PreimageOracle.CallOpts) +} + +// MinProposalSize is a free data retrieval call binding the contract method 0xdd24f9bf. +// +// Solidity: function minProposalSize() view returns(uint256 minProposalSize_) +func (_PreimageOracle *PreimageOracleCallerSession) MinProposalSize() (*big.Int, error) { + return _PreimageOracle.Contract.MinProposalSize(&_PreimageOracle.CallOpts) +} + +// PreimageLengths is a free data retrieval call binding the contract method 0xfef2b4ed. +// +// Solidity: function preimageLengths(bytes32 ) view returns(uint256) +func (_PreimageOracle *PreimageOracleCaller) PreimageLengths(opts *bind.CallOpts, arg0 [32]byte) (*big.Int, error) { + var out []interface{} + err := _PreimageOracle.contract.Call(opts, &out, "preimageLengths", arg0) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// PreimageLengths is a free data retrieval call binding the contract method 0xfef2b4ed. +// +// Solidity: function preimageLengths(bytes32 ) view returns(uint256) +func (_PreimageOracle *PreimageOracleSession) PreimageLengths(arg0 [32]byte) (*big.Int, error) { + return _PreimageOracle.Contract.PreimageLengths(&_PreimageOracle.CallOpts, arg0) +} + +// PreimageLengths is a free data retrieval call binding the contract method 0xfef2b4ed. +// +// Solidity: function preimageLengths(bytes32 ) view returns(uint256) +func (_PreimageOracle *PreimageOracleCallerSession) PreimageLengths(arg0 [32]byte) (*big.Int, error) { + return _PreimageOracle.Contract.PreimageLengths(&_PreimageOracle.CallOpts, arg0) +} + +// PreimagePartOk is a free data retrieval call binding the contract method 0x8542cf50. +// +// Solidity: function preimagePartOk(bytes32 , uint256 ) view returns(bool) +func (_PreimageOracle *PreimageOracleCaller) PreimagePartOk(opts *bind.CallOpts, arg0 [32]byte, arg1 *big.Int) (bool, error) { + var out []interface{} + err := _PreimageOracle.contract.Call(opts, &out, "preimagePartOk", arg0, arg1) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// PreimagePartOk is a free data retrieval call binding the contract method 0x8542cf50. +// +// Solidity: function preimagePartOk(bytes32 , uint256 ) view returns(bool) +func (_PreimageOracle *PreimageOracleSession) PreimagePartOk(arg0 [32]byte, arg1 *big.Int) (bool, error) { + return _PreimageOracle.Contract.PreimagePartOk(&_PreimageOracle.CallOpts, arg0, arg1) +} + +// PreimagePartOk is a free data retrieval call binding the contract method 0x8542cf50. +// +// Solidity: function preimagePartOk(bytes32 , uint256 ) view returns(bool) +func (_PreimageOracle *PreimageOracleCallerSession) PreimagePartOk(arg0 [32]byte, arg1 *big.Int) (bool, error) { + return _PreimageOracle.Contract.PreimagePartOk(&_PreimageOracle.CallOpts, arg0, arg1) +} + +// PreimageParts is a free data retrieval call binding the contract method 0x61238bde. +// +// Solidity: function preimageParts(bytes32 , uint256 ) view returns(bytes32) +func (_PreimageOracle *PreimageOracleCaller) PreimageParts(opts *bind.CallOpts, arg0 [32]byte, arg1 *big.Int) ([32]byte, error) { + var out []interface{} + err := _PreimageOracle.contract.Call(opts, &out, "preimageParts", arg0, arg1) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// PreimageParts is a free data retrieval call binding the contract method 0x61238bde. +// +// Solidity: function preimageParts(bytes32 , uint256 ) view returns(bytes32) +func (_PreimageOracle *PreimageOracleSession) PreimageParts(arg0 [32]byte, arg1 *big.Int) ([32]byte, error) { + return _PreimageOracle.Contract.PreimageParts(&_PreimageOracle.CallOpts, arg0, arg1) +} + +// PreimageParts is a free data retrieval call binding the contract method 0x61238bde. +// +// Solidity: function preimageParts(bytes32 , uint256 ) view returns(bytes32) +func (_PreimageOracle *PreimageOracleCallerSession) PreimageParts(arg0 [32]byte, arg1 *big.Int) ([32]byte, error) { + return _PreimageOracle.Contract.PreimageParts(&_PreimageOracle.CallOpts, arg0, arg1) +} + +// ProposalBlocks is a free data retrieval call binding the contract method 0x882856ef. +// +// Solidity: function proposalBlocks(address , uint256 , uint256 ) view returns(uint64) +func (_PreimageOracle *PreimageOracleCaller) ProposalBlocks(opts *bind.CallOpts, arg0 common.Address, arg1 *big.Int, arg2 *big.Int) (uint64, error) { + var out []interface{} + err := _PreimageOracle.contract.Call(opts, &out, "proposalBlocks", arg0, arg1, arg2) + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// ProposalBlocks is a free data retrieval call binding the contract method 0x882856ef. +// +// Solidity: function proposalBlocks(address , uint256 , uint256 ) view returns(uint64) +func (_PreimageOracle *PreimageOracleSession) ProposalBlocks(arg0 common.Address, arg1 *big.Int, arg2 *big.Int) (uint64, error) { + return _PreimageOracle.Contract.ProposalBlocks(&_PreimageOracle.CallOpts, arg0, arg1, arg2) +} + +// ProposalBlocks is a free data retrieval call binding the contract method 0x882856ef. +// +// Solidity: function proposalBlocks(address , uint256 , uint256 ) view returns(uint64) +func (_PreimageOracle *PreimageOracleCallerSession) ProposalBlocks(arg0 common.Address, arg1 *big.Int, arg2 *big.Int) (uint64, error) { + return _PreimageOracle.Contract.ProposalBlocks(&_PreimageOracle.CallOpts, arg0, arg1, arg2) +} + +// ProposalBlocksLen is a free data retrieval call binding the contract method 0x9d53a648. +// +// Solidity: function proposalBlocksLen(address _claimant, uint256 _uuid) view returns(uint256 len_) +func (_PreimageOracle *PreimageOracleCaller) ProposalBlocksLen(opts *bind.CallOpts, _claimant common.Address, _uuid *big.Int) (*big.Int, error) { + var out []interface{} + err := _PreimageOracle.contract.Call(opts, &out, "proposalBlocksLen", _claimant, _uuid) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// ProposalBlocksLen is a free data retrieval call binding the contract method 0x9d53a648. +// +// Solidity: function proposalBlocksLen(address _claimant, uint256 _uuid) view returns(uint256 len_) +func (_PreimageOracle *PreimageOracleSession) ProposalBlocksLen(_claimant common.Address, _uuid *big.Int) (*big.Int, error) { + return _PreimageOracle.Contract.ProposalBlocksLen(&_PreimageOracle.CallOpts, _claimant, _uuid) +} + +// ProposalBlocksLen is a free data retrieval call binding the contract method 0x9d53a648. +// +// Solidity: function proposalBlocksLen(address _claimant, uint256 _uuid) view returns(uint256 len_) +func (_PreimageOracle *PreimageOracleCallerSession) ProposalBlocksLen(_claimant common.Address, _uuid *big.Int) (*big.Int, error) { + return _PreimageOracle.Contract.ProposalBlocksLen(&_PreimageOracle.CallOpts, _claimant, _uuid) +} + +// ProposalBonds is a free data retrieval call binding the contract method 0xddcd58de. +// +// Solidity: function proposalBonds(address , uint256 ) view returns(uint256) +func (_PreimageOracle *PreimageOracleCaller) ProposalBonds(opts *bind.CallOpts, arg0 common.Address, arg1 *big.Int) (*big.Int, error) { + var out []interface{} + err := _PreimageOracle.contract.Call(opts, &out, "proposalBonds", arg0, arg1) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// ProposalBonds is a free data retrieval call binding the contract method 0xddcd58de. +// +// Solidity: function proposalBonds(address , uint256 ) view returns(uint256) +func (_PreimageOracle *PreimageOracleSession) ProposalBonds(arg0 common.Address, arg1 *big.Int) (*big.Int, error) { + return _PreimageOracle.Contract.ProposalBonds(&_PreimageOracle.CallOpts, arg0, arg1) +} + +// ProposalBonds is a free data retrieval call binding the contract method 0xddcd58de. +// +// Solidity: function proposalBonds(address , uint256 ) view returns(uint256) +func (_PreimageOracle *PreimageOracleCallerSession) ProposalBonds(arg0 common.Address, arg1 *big.Int) (*big.Int, error) { + return _PreimageOracle.Contract.ProposalBonds(&_PreimageOracle.CallOpts, arg0, arg1) +} + +// ProposalBranches is a free data retrieval call binding the contract method 0xb4801e61. +// +// Solidity: function proposalBranches(address , uint256 , uint256 ) view returns(bytes32) +func (_PreimageOracle *PreimageOracleCaller) ProposalBranches(opts *bind.CallOpts, arg0 common.Address, arg1 *big.Int, arg2 *big.Int) ([32]byte, error) { + var out []interface{} + err := _PreimageOracle.contract.Call(opts, &out, "proposalBranches", arg0, arg1, arg2) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// ProposalBranches is a free data retrieval call binding the contract method 0xb4801e61. +// +// Solidity: function proposalBranches(address , uint256 , uint256 ) view returns(bytes32) +func (_PreimageOracle *PreimageOracleSession) ProposalBranches(arg0 common.Address, arg1 *big.Int, arg2 *big.Int) ([32]byte, error) { + return _PreimageOracle.Contract.ProposalBranches(&_PreimageOracle.CallOpts, arg0, arg1, arg2) +} + +// ProposalBranches is a free data retrieval call binding the contract method 0xb4801e61. +// +// Solidity: function proposalBranches(address , uint256 , uint256 ) view returns(bytes32) +func (_PreimageOracle *PreimageOracleCallerSession) ProposalBranches(arg0 common.Address, arg1 *big.Int, arg2 *big.Int) ([32]byte, error) { + return _PreimageOracle.Contract.ProposalBranches(&_PreimageOracle.CallOpts, arg0, arg1, arg2) +} + +// ProposalCount is a free data retrieval call binding the contract method 0xda35c664. +// +// Solidity: function proposalCount() view returns(uint256 count_) +func (_PreimageOracle *PreimageOracleCaller) ProposalCount(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _PreimageOracle.contract.Call(opts, &out, "proposalCount") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// ProposalCount is a free data retrieval call binding the contract method 0xda35c664. +// +// Solidity: function proposalCount() view returns(uint256 count_) +func (_PreimageOracle *PreimageOracleSession) ProposalCount() (*big.Int, error) { + return _PreimageOracle.Contract.ProposalCount(&_PreimageOracle.CallOpts) +} + +// ProposalCount is a free data retrieval call binding the contract method 0xda35c664. +// +// Solidity: function proposalCount() view returns(uint256 count_) +func (_PreimageOracle *PreimageOracleCallerSession) ProposalCount() (*big.Int, error) { + return _PreimageOracle.Contract.ProposalCount(&_PreimageOracle.CallOpts) +} + +// ProposalMetadata is a free data retrieval call binding the contract method 0x6551927b. +// +// Solidity: function proposalMetadata(address , uint256 ) view returns(bytes32) +func (_PreimageOracle *PreimageOracleCaller) ProposalMetadata(opts *bind.CallOpts, arg0 common.Address, arg1 *big.Int) ([32]byte, error) { + var out []interface{} + err := _PreimageOracle.contract.Call(opts, &out, "proposalMetadata", arg0, arg1) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// ProposalMetadata is a free data retrieval call binding the contract method 0x6551927b. +// +// Solidity: function proposalMetadata(address , uint256 ) view returns(bytes32) +func (_PreimageOracle *PreimageOracleSession) ProposalMetadata(arg0 common.Address, arg1 *big.Int) ([32]byte, error) { + return _PreimageOracle.Contract.ProposalMetadata(&_PreimageOracle.CallOpts, arg0, arg1) +} + +// ProposalMetadata is a free data retrieval call binding the contract method 0x6551927b. +// +// Solidity: function proposalMetadata(address , uint256 ) view returns(bytes32) +func (_PreimageOracle *PreimageOracleCallerSession) ProposalMetadata(arg0 common.Address, arg1 *big.Int) ([32]byte, error) { + return _PreimageOracle.Contract.ProposalMetadata(&_PreimageOracle.CallOpts, arg0, arg1) +} + +// ProposalParts is a free data retrieval call binding the contract method 0xb2e67ba8. +// +// Solidity: function proposalParts(address , uint256 ) view returns(bytes32) +func (_PreimageOracle *PreimageOracleCaller) ProposalParts(opts *bind.CallOpts, arg0 common.Address, arg1 *big.Int) ([32]byte, error) { + var out []interface{} + err := _PreimageOracle.contract.Call(opts, &out, "proposalParts", arg0, arg1) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// ProposalParts is a free data retrieval call binding the contract method 0xb2e67ba8. +// +// Solidity: function proposalParts(address , uint256 ) view returns(bytes32) +func (_PreimageOracle *PreimageOracleSession) ProposalParts(arg0 common.Address, arg1 *big.Int) ([32]byte, error) { + return _PreimageOracle.Contract.ProposalParts(&_PreimageOracle.CallOpts, arg0, arg1) +} + +// ProposalParts is a free data retrieval call binding the contract method 0xb2e67ba8. +// +// Solidity: function proposalParts(address , uint256 ) view returns(bytes32) +func (_PreimageOracle *PreimageOracleCallerSession) ProposalParts(arg0 common.Address, arg1 *big.Int) ([32]byte, error) { + return _PreimageOracle.Contract.ProposalParts(&_PreimageOracle.CallOpts, arg0, arg1) +} + +// Proposals is a free data retrieval call binding the contract method 0x013cf08b. +// +// Solidity: function proposals(uint256 ) view returns(address claimant, uint256 uuid) +func (_PreimageOracle *PreimageOracleCaller) Proposals(opts *bind.CallOpts, arg0 *big.Int) (struct { + Claimant common.Address + Uuid *big.Int +}, error) { + var out []interface{} + err := _PreimageOracle.contract.Call(opts, &out, "proposals", arg0) + + outstruct := new(struct { + Claimant common.Address + Uuid *big.Int + }) + if err != nil { + return *outstruct, err + } + + outstruct.Claimant = *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + outstruct.Uuid = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + + return *outstruct, err + +} + +// Proposals is a free data retrieval call binding the contract method 0x013cf08b. +// +// Solidity: function proposals(uint256 ) view returns(address claimant, uint256 uuid) +func (_PreimageOracle *PreimageOracleSession) Proposals(arg0 *big.Int) (struct { + Claimant common.Address + Uuid *big.Int +}, error) { + return _PreimageOracle.Contract.Proposals(&_PreimageOracle.CallOpts, arg0) +} + +// Proposals is a free data retrieval call binding the contract method 0x013cf08b. +// +// Solidity: function proposals(uint256 ) view returns(address claimant, uint256 uuid) +func (_PreimageOracle *PreimageOracleCallerSession) Proposals(arg0 *big.Int) (struct { + Claimant common.Address + Uuid *big.Int +}, error) { + return _PreimageOracle.Contract.Proposals(&_PreimageOracle.CallOpts, arg0) +} + +// ReadPreimage is a free data retrieval call binding the contract method 0xe03110e1. +// +// Solidity: function readPreimage(bytes32 _key, uint256 _offset) view returns(bytes32 dat_, uint256 datLen_) +func (_PreimageOracle *PreimageOracleCaller) ReadPreimage(opts *bind.CallOpts, _key [32]byte, _offset *big.Int) (struct { + Dat [32]byte + DatLen *big.Int +}, error) { + var out []interface{} + err := _PreimageOracle.contract.Call(opts, &out, "readPreimage", _key, _offset) + + outstruct := new(struct { + Dat [32]byte + DatLen *big.Int + }) + if err != nil { + return *outstruct, err + } + + outstruct.Dat = *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + outstruct.DatLen = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + + return *outstruct, err + +} + +// ReadPreimage is a free data retrieval call binding the contract method 0xe03110e1. +// +// Solidity: function readPreimage(bytes32 _key, uint256 _offset) view returns(bytes32 dat_, uint256 datLen_) +func (_PreimageOracle *PreimageOracleSession) ReadPreimage(_key [32]byte, _offset *big.Int) (struct { + Dat [32]byte + DatLen *big.Int +}, error) { + return _PreimageOracle.Contract.ReadPreimage(&_PreimageOracle.CallOpts, _key, _offset) +} + +// ReadPreimage is a free data retrieval call binding the contract method 0xe03110e1. +// +// Solidity: function readPreimage(bytes32 _key, uint256 _offset) view returns(bytes32 dat_, uint256 datLen_) +func (_PreimageOracle *PreimageOracleCallerSession) ReadPreimage(_key [32]byte, _offset *big.Int) (struct { + Dat [32]byte + DatLen *big.Int +}, error) { + return _PreimageOracle.Contract.ReadPreimage(&_PreimageOracle.CallOpts, _key, _offset) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_PreimageOracle *PreimageOracleCaller) Version(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _PreimageOracle.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 (_PreimageOracle *PreimageOracleSession) Version() (string, error) { + return _PreimageOracle.Contract.Version(&_PreimageOracle.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_PreimageOracle *PreimageOracleCallerSession) Version() (string, error) { + return _PreimageOracle.Contract.Version(&_PreimageOracle.CallOpts) +} + +// ZeroHashes is a free data retrieval call binding the contract method 0x7ac54767. +// +// Solidity: function zeroHashes(uint256 ) view returns(bytes32) +func (_PreimageOracle *PreimageOracleCaller) ZeroHashes(opts *bind.CallOpts, arg0 *big.Int) ([32]byte, error) { + var out []interface{} + err := _PreimageOracle.contract.Call(opts, &out, "zeroHashes", arg0) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// ZeroHashes is a free data retrieval call binding the contract method 0x7ac54767. +// +// Solidity: function zeroHashes(uint256 ) view returns(bytes32) +func (_PreimageOracle *PreimageOracleSession) ZeroHashes(arg0 *big.Int) ([32]byte, error) { + return _PreimageOracle.Contract.ZeroHashes(&_PreimageOracle.CallOpts, arg0) +} + +// ZeroHashes is a free data retrieval call binding the contract method 0x7ac54767. +// +// Solidity: function zeroHashes(uint256 ) view returns(bytes32) +func (_PreimageOracle *PreimageOracleCallerSession) ZeroHashes(arg0 *big.Int) ([32]byte, error) { + return _PreimageOracle.Contract.ZeroHashes(&_PreimageOracle.CallOpts, arg0) +} + +// AddLeavesLPP is a paid mutator transaction binding the contract method 0x7917de1d. +// +// Solidity: function addLeavesLPP(uint256 _uuid, uint256 _inputStartBlock, bytes _input, bytes32[] _stateCommitments, bool _finalize) returns() +func (_PreimageOracle *PreimageOracleTransactor) AddLeavesLPP(opts *bind.TransactOpts, _uuid *big.Int, _inputStartBlock *big.Int, _input []byte, _stateCommitments [][32]byte, _finalize bool) (*types.Transaction, error) { + return _PreimageOracle.contract.Transact(opts, "addLeavesLPP", _uuid, _inputStartBlock, _input, _stateCommitments, _finalize) +} + +// AddLeavesLPP is a paid mutator transaction binding the contract method 0x7917de1d. +// +// Solidity: function addLeavesLPP(uint256 _uuid, uint256 _inputStartBlock, bytes _input, bytes32[] _stateCommitments, bool _finalize) returns() +func (_PreimageOracle *PreimageOracleSession) AddLeavesLPP(_uuid *big.Int, _inputStartBlock *big.Int, _input []byte, _stateCommitments [][32]byte, _finalize bool) (*types.Transaction, error) { + return _PreimageOracle.Contract.AddLeavesLPP(&_PreimageOracle.TransactOpts, _uuid, _inputStartBlock, _input, _stateCommitments, _finalize) +} + +// AddLeavesLPP is a paid mutator transaction binding the contract method 0x7917de1d. +// +// Solidity: function addLeavesLPP(uint256 _uuid, uint256 _inputStartBlock, bytes _input, bytes32[] _stateCommitments, bool _finalize) returns() +func (_PreimageOracle *PreimageOracleTransactorSession) AddLeavesLPP(_uuid *big.Int, _inputStartBlock *big.Int, _input []byte, _stateCommitments [][32]byte, _finalize bool) (*types.Transaction, error) { + return _PreimageOracle.Contract.AddLeavesLPP(&_PreimageOracle.TransactOpts, _uuid, _inputStartBlock, _input, _stateCommitments, _finalize) +} + +// ChallengeFirstLPP is a paid mutator transaction binding the contract method 0xec5efcbc. +// +// Solidity: function challengeFirstLPP(address _claimant, uint256 _uuid, (bytes,uint256,bytes32) _postState, bytes32[] _postStateProof) returns() +func (_PreimageOracle *PreimageOracleTransactor) ChallengeFirstLPP(opts *bind.TransactOpts, _claimant common.Address, _uuid *big.Int, _postState PreimageOracleLeaf, _postStateProof [][32]byte) (*types.Transaction, error) { + return _PreimageOracle.contract.Transact(opts, "challengeFirstLPP", _claimant, _uuid, _postState, _postStateProof) +} + +// ChallengeFirstLPP is a paid mutator transaction binding the contract method 0xec5efcbc. +// +// Solidity: function challengeFirstLPP(address _claimant, uint256 _uuid, (bytes,uint256,bytes32) _postState, bytes32[] _postStateProof) returns() +func (_PreimageOracle *PreimageOracleSession) ChallengeFirstLPP(_claimant common.Address, _uuid *big.Int, _postState PreimageOracleLeaf, _postStateProof [][32]byte) (*types.Transaction, error) { + return _PreimageOracle.Contract.ChallengeFirstLPP(&_PreimageOracle.TransactOpts, _claimant, _uuid, _postState, _postStateProof) +} + +// ChallengeFirstLPP is a paid mutator transaction binding the contract method 0xec5efcbc. +// +// Solidity: function challengeFirstLPP(address _claimant, uint256 _uuid, (bytes,uint256,bytes32) _postState, bytes32[] _postStateProof) returns() +func (_PreimageOracle *PreimageOracleTransactorSession) ChallengeFirstLPP(_claimant common.Address, _uuid *big.Int, _postState PreimageOracleLeaf, _postStateProof [][32]byte) (*types.Transaction, error) { + return _PreimageOracle.Contract.ChallengeFirstLPP(&_PreimageOracle.TransactOpts, _claimant, _uuid, _postState, _postStateProof) +} + +// ChallengeLPP is a paid mutator transaction binding the contract method 0x3909af5c. +// +// Solidity: function challengeLPP(address _claimant, uint256 _uuid, (uint64[25]) _stateMatrix, (bytes,uint256,bytes32) _preState, bytes32[] _preStateProof, (bytes,uint256,bytes32) _postState, bytes32[] _postStateProof) returns() +func (_PreimageOracle *PreimageOracleTransactor) ChallengeLPP(opts *bind.TransactOpts, _claimant common.Address, _uuid *big.Int, _stateMatrix LibKeccakStateMatrix, _preState PreimageOracleLeaf, _preStateProof [][32]byte, _postState PreimageOracleLeaf, _postStateProof [][32]byte) (*types.Transaction, error) { + return _PreimageOracle.contract.Transact(opts, "challengeLPP", _claimant, _uuid, _stateMatrix, _preState, _preStateProof, _postState, _postStateProof) +} + +// ChallengeLPP is a paid mutator transaction binding the contract method 0x3909af5c. +// +// Solidity: function challengeLPP(address _claimant, uint256 _uuid, (uint64[25]) _stateMatrix, (bytes,uint256,bytes32) _preState, bytes32[] _preStateProof, (bytes,uint256,bytes32) _postState, bytes32[] _postStateProof) returns() +func (_PreimageOracle *PreimageOracleSession) ChallengeLPP(_claimant common.Address, _uuid *big.Int, _stateMatrix LibKeccakStateMatrix, _preState PreimageOracleLeaf, _preStateProof [][32]byte, _postState PreimageOracleLeaf, _postStateProof [][32]byte) (*types.Transaction, error) { + return _PreimageOracle.Contract.ChallengeLPP(&_PreimageOracle.TransactOpts, _claimant, _uuid, _stateMatrix, _preState, _preStateProof, _postState, _postStateProof) +} + +// ChallengeLPP is a paid mutator transaction binding the contract method 0x3909af5c. +// +// Solidity: function challengeLPP(address _claimant, uint256 _uuid, (uint64[25]) _stateMatrix, (bytes,uint256,bytes32) _preState, bytes32[] _preStateProof, (bytes,uint256,bytes32) _postState, bytes32[] _postStateProof) returns() +func (_PreimageOracle *PreimageOracleTransactorSession) ChallengeLPP(_claimant common.Address, _uuid *big.Int, _stateMatrix LibKeccakStateMatrix, _preState PreimageOracleLeaf, _preStateProof [][32]byte, _postState PreimageOracleLeaf, _postStateProof [][32]byte) (*types.Transaction, error) { + return _PreimageOracle.Contract.ChallengeLPP(&_PreimageOracle.TransactOpts, _claimant, _uuid, _stateMatrix, _preState, _preStateProof, _postState, _postStateProof) +} + +// InitLPP is a paid mutator transaction binding the contract method 0xfaf37bc7. +// +// Solidity: function initLPP(uint256 _uuid, uint32 _partOffset, uint32 _claimedSize) payable returns() +func (_PreimageOracle *PreimageOracleTransactor) InitLPP(opts *bind.TransactOpts, _uuid *big.Int, _partOffset uint32, _claimedSize uint32) (*types.Transaction, error) { + return _PreimageOracle.contract.Transact(opts, "initLPP", _uuid, _partOffset, _claimedSize) +} + +// InitLPP is a paid mutator transaction binding the contract method 0xfaf37bc7. +// +// Solidity: function initLPP(uint256 _uuid, uint32 _partOffset, uint32 _claimedSize) payable returns() +func (_PreimageOracle *PreimageOracleSession) InitLPP(_uuid *big.Int, _partOffset uint32, _claimedSize uint32) (*types.Transaction, error) { + return _PreimageOracle.Contract.InitLPP(&_PreimageOracle.TransactOpts, _uuid, _partOffset, _claimedSize) +} + +// InitLPP is a paid mutator transaction binding the contract method 0xfaf37bc7. +// +// Solidity: function initLPP(uint256 _uuid, uint32 _partOffset, uint32 _claimedSize) payable returns() +func (_PreimageOracle *PreimageOracleTransactorSession) InitLPP(_uuid *big.Int, _partOffset uint32, _claimedSize uint32) (*types.Transaction, error) { + return _PreimageOracle.Contract.InitLPP(&_PreimageOracle.TransactOpts, _uuid, _partOffset, _claimedSize) +} + +// LoadBlobPreimagePart is a paid mutator transaction binding the contract method 0x9d7e8769. +// +// Solidity: function loadBlobPreimagePart(uint256 _z, uint256 _y, bytes _commitment, bytes _proof, uint256 _partOffset) returns() +func (_PreimageOracle *PreimageOracleTransactor) LoadBlobPreimagePart(opts *bind.TransactOpts, _z *big.Int, _y *big.Int, _commitment []byte, _proof []byte, _partOffset *big.Int) (*types.Transaction, error) { + return _PreimageOracle.contract.Transact(opts, "loadBlobPreimagePart", _z, _y, _commitment, _proof, _partOffset) +} + +// LoadBlobPreimagePart is a paid mutator transaction binding the contract method 0x9d7e8769. +// +// Solidity: function loadBlobPreimagePart(uint256 _z, uint256 _y, bytes _commitment, bytes _proof, uint256 _partOffset) returns() +func (_PreimageOracle *PreimageOracleSession) LoadBlobPreimagePart(_z *big.Int, _y *big.Int, _commitment []byte, _proof []byte, _partOffset *big.Int) (*types.Transaction, error) { + return _PreimageOracle.Contract.LoadBlobPreimagePart(&_PreimageOracle.TransactOpts, _z, _y, _commitment, _proof, _partOffset) +} + +// LoadBlobPreimagePart is a paid mutator transaction binding the contract method 0x9d7e8769. +// +// Solidity: function loadBlobPreimagePart(uint256 _z, uint256 _y, bytes _commitment, bytes _proof, uint256 _partOffset) returns() +func (_PreimageOracle *PreimageOracleTransactorSession) LoadBlobPreimagePart(_z *big.Int, _y *big.Int, _commitment []byte, _proof []byte, _partOffset *big.Int) (*types.Transaction, error) { + return _PreimageOracle.Contract.LoadBlobPreimagePart(&_PreimageOracle.TransactOpts, _z, _y, _commitment, _proof, _partOffset) +} + +// LoadKeccak256PreimagePart is a paid mutator transaction binding the contract method 0xe1592611. +// +// Solidity: function loadKeccak256PreimagePart(uint256 _partOffset, bytes _preimage) returns() +func (_PreimageOracle *PreimageOracleTransactor) LoadKeccak256PreimagePart(opts *bind.TransactOpts, _partOffset *big.Int, _preimage []byte) (*types.Transaction, error) { + return _PreimageOracle.contract.Transact(opts, "loadKeccak256PreimagePart", _partOffset, _preimage) +} + +// LoadKeccak256PreimagePart is a paid mutator transaction binding the contract method 0xe1592611. +// +// Solidity: function loadKeccak256PreimagePart(uint256 _partOffset, bytes _preimage) returns() +func (_PreimageOracle *PreimageOracleSession) LoadKeccak256PreimagePart(_partOffset *big.Int, _preimage []byte) (*types.Transaction, error) { + return _PreimageOracle.Contract.LoadKeccak256PreimagePart(&_PreimageOracle.TransactOpts, _partOffset, _preimage) +} + +// LoadKeccak256PreimagePart is a paid mutator transaction binding the contract method 0xe1592611. +// +// Solidity: function loadKeccak256PreimagePart(uint256 _partOffset, bytes _preimage) returns() +func (_PreimageOracle *PreimageOracleTransactorSession) LoadKeccak256PreimagePart(_partOffset *big.Int, _preimage []byte) (*types.Transaction, error) { + return _PreimageOracle.Contract.LoadKeccak256PreimagePart(&_PreimageOracle.TransactOpts, _partOffset, _preimage) +} + +// LoadLocalData is a paid mutator transaction binding the contract method 0x52f0f3ad. +// +// Solidity: function loadLocalData(uint256 _ident, bytes32 _localContext, bytes32 _word, uint256 _size, uint256 _partOffset) returns(bytes32 key_) +func (_PreimageOracle *PreimageOracleTransactor) LoadLocalData(opts *bind.TransactOpts, _ident *big.Int, _localContext [32]byte, _word [32]byte, _size *big.Int, _partOffset *big.Int) (*types.Transaction, error) { + return _PreimageOracle.contract.Transact(opts, "loadLocalData", _ident, _localContext, _word, _size, _partOffset) +} + +// LoadLocalData is a paid mutator transaction binding the contract method 0x52f0f3ad. +// +// Solidity: function loadLocalData(uint256 _ident, bytes32 _localContext, bytes32 _word, uint256 _size, uint256 _partOffset) returns(bytes32 key_) +func (_PreimageOracle *PreimageOracleSession) LoadLocalData(_ident *big.Int, _localContext [32]byte, _word [32]byte, _size *big.Int, _partOffset *big.Int) (*types.Transaction, error) { + return _PreimageOracle.Contract.LoadLocalData(&_PreimageOracle.TransactOpts, _ident, _localContext, _word, _size, _partOffset) +} + +// LoadLocalData is a paid mutator transaction binding the contract method 0x52f0f3ad. +// +// Solidity: function loadLocalData(uint256 _ident, bytes32 _localContext, bytes32 _word, uint256 _size, uint256 _partOffset) returns(bytes32 key_) +func (_PreimageOracle *PreimageOracleTransactorSession) LoadLocalData(_ident *big.Int, _localContext [32]byte, _word [32]byte, _size *big.Int, _partOffset *big.Int) (*types.Transaction, error) { + return _PreimageOracle.Contract.LoadLocalData(&_PreimageOracle.TransactOpts, _ident, _localContext, _word, _size, _partOffset) +} + +// LoadPrecompilePreimagePart is a paid mutator transaction binding the contract method 0x04697c78. +// +// Solidity: function loadPrecompilePreimagePart(uint256 _partOffset, address _precompile, bytes _input) returns() +func (_PreimageOracle *PreimageOracleTransactor) LoadPrecompilePreimagePart(opts *bind.TransactOpts, _partOffset *big.Int, _precompile common.Address, _input []byte) (*types.Transaction, error) { + return _PreimageOracle.contract.Transact(opts, "loadPrecompilePreimagePart", _partOffset, _precompile, _input) +} + +// LoadPrecompilePreimagePart is a paid mutator transaction binding the contract method 0x04697c78. +// +// Solidity: function loadPrecompilePreimagePart(uint256 _partOffset, address _precompile, bytes _input) returns() +func (_PreimageOracle *PreimageOracleSession) LoadPrecompilePreimagePart(_partOffset *big.Int, _precompile common.Address, _input []byte) (*types.Transaction, error) { + return _PreimageOracle.Contract.LoadPrecompilePreimagePart(&_PreimageOracle.TransactOpts, _partOffset, _precompile, _input) +} + +// LoadPrecompilePreimagePart is a paid mutator transaction binding the contract method 0x04697c78. +// +// Solidity: function loadPrecompilePreimagePart(uint256 _partOffset, address _precompile, bytes _input) returns() +func (_PreimageOracle *PreimageOracleTransactorSession) LoadPrecompilePreimagePart(_partOffset *big.Int, _precompile common.Address, _input []byte) (*types.Transaction, error) { + return _PreimageOracle.Contract.LoadPrecompilePreimagePart(&_PreimageOracle.TransactOpts, _partOffset, _precompile, _input) +} + +// LoadSha256PreimagePart is a paid mutator transaction binding the contract method 0x8dc4be11. +// +// Solidity: function loadSha256PreimagePart(uint256 _partOffset, bytes _preimage) returns() +func (_PreimageOracle *PreimageOracleTransactor) LoadSha256PreimagePart(opts *bind.TransactOpts, _partOffset *big.Int, _preimage []byte) (*types.Transaction, error) { + return _PreimageOracle.contract.Transact(opts, "loadSha256PreimagePart", _partOffset, _preimage) +} + +// LoadSha256PreimagePart is a paid mutator transaction binding the contract method 0x8dc4be11. +// +// Solidity: function loadSha256PreimagePart(uint256 _partOffset, bytes _preimage) returns() +func (_PreimageOracle *PreimageOracleSession) LoadSha256PreimagePart(_partOffset *big.Int, _preimage []byte) (*types.Transaction, error) { + return _PreimageOracle.Contract.LoadSha256PreimagePart(&_PreimageOracle.TransactOpts, _partOffset, _preimage) +} + +// LoadSha256PreimagePart is a paid mutator transaction binding the contract method 0x8dc4be11. +// +// Solidity: function loadSha256PreimagePart(uint256 _partOffset, bytes _preimage) returns() +func (_PreimageOracle *PreimageOracleTransactorSession) LoadSha256PreimagePart(_partOffset *big.Int, _preimage []byte) (*types.Transaction, error) { + return _PreimageOracle.Contract.LoadSha256PreimagePart(&_PreimageOracle.TransactOpts, _partOffset, _preimage) +} + +// SqueezeLPP is a paid mutator transaction binding the contract method 0xd18534b5. +// +// Solidity: function squeezeLPP(address _claimant, uint256 _uuid, (uint64[25]) _stateMatrix, (bytes,uint256,bytes32) _preState, bytes32[] _preStateProof, (bytes,uint256,bytes32) _postState, bytes32[] _postStateProof) returns() +func (_PreimageOracle *PreimageOracleTransactor) SqueezeLPP(opts *bind.TransactOpts, _claimant common.Address, _uuid *big.Int, _stateMatrix LibKeccakStateMatrix, _preState PreimageOracleLeaf, _preStateProof [][32]byte, _postState PreimageOracleLeaf, _postStateProof [][32]byte) (*types.Transaction, error) { + return _PreimageOracle.contract.Transact(opts, "squeezeLPP", _claimant, _uuid, _stateMatrix, _preState, _preStateProof, _postState, _postStateProof) +} + +// SqueezeLPP is a paid mutator transaction binding the contract method 0xd18534b5. +// +// Solidity: function squeezeLPP(address _claimant, uint256 _uuid, (uint64[25]) _stateMatrix, (bytes,uint256,bytes32) _preState, bytes32[] _preStateProof, (bytes,uint256,bytes32) _postState, bytes32[] _postStateProof) returns() +func (_PreimageOracle *PreimageOracleSession) SqueezeLPP(_claimant common.Address, _uuid *big.Int, _stateMatrix LibKeccakStateMatrix, _preState PreimageOracleLeaf, _preStateProof [][32]byte, _postState PreimageOracleLeaf, _postStateProof [][32]byte) (*types.Transaction, error) { + return _PreimageOracle.Contract.SqueezeLPP(&_PreimageOracle.TransactOpts, _claimant, _uuid, _stateMatrix, _preState, _preStateProof, _postState, _postStateProof) +} + +// SqueezeLPP is a paid mutator transaction binding the contract method 0xd18534b5. +// +// Solidity: function squeezeLPP(address _claimant, uint256 _uuid, (uint64[25]) _stateMatrix, (bytes,uint256,bytes32) _preState, bytes32[] _preStateProof, (bytes,uint256,bytes32) _postState, bytes32[] _postStateProof) returns() +func (_PreimageOracle *PreimageOracleTransactorSession) SqueezeLPP(_claimant common.Address, _uuid *big.Int, _stateMatrix LibKeccakStateMatrix, _preState PreimageOracleLeaf, _preStateProof [][32]byte, _postState PreimageOracleLeaf, _postStateProof [][32]byte) (*types.Transaction, error) { + return _PreimageOracle.Contract.SqueezeLPP(&_PreimageOracle.TransactOpts, _claimant, _uuid, _stateMatrix, _preState, _preStateProof, _postState, _postStateProof) +} diff --git a/op-e2e2/bindings/protocolversions.go b/op-e2e2/bindings/protocolversions.go new file mode 100644 index 000000000000..c63e46f16cbb --- /dev/null +++ b/op-e2e2/bindings/protocolversions.go @@ -0,0 +1,965 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// ProtocolVersionsMetaData contains all meta data concerning the ProtocolVersions contract. +var ProtocolVersionsMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"RECOMMENDED_SLOT\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"REQUIRED_SLOT\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"VERSION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_required\",\"type\":\"uint256\",\"internalType\":\"ProtocolVersion\"},{\"name\":\"_recommended\",\"type\":\"uint256\",\"internalType\":\"ProtocolVersion\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"recommended\",\"inputs\":[],\"outputs\":[{\"name\":\"out_\",\"type\":\"uint256\",\"internalType\":\"ProtocolVersion\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"required\",\"inputs\":[],\"outputs\":[{\"name\":\"out_\",\"type\":\"uint256\",\"internalType\":\"ProtocolVersion\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"setRecommended\",\"inputs\":[{\"name\":\"_recommended\",\"type\":\"uint256\",\"internalType\":\"ProtocolVersion\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setRequired\",\"inputs\":[{\"name\":\"_required\",\"type\":\"uint256\",\"internalType\":\"ProtocolVersion\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"ConfigUpdate\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"updateType\",\"type\":\"uint8\",\"indexed\":true,\"internalType\":\"enumProtocolVersions.UpdateType\"},{\"name\":\"data\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false}]", + Bin: "0x60806040523480156200001157600080fd5b506200002261dead60008062000028565b6200051c565b600054610100900460ff1615808015620000495750600054600160ff909116105b8062000079575062000066306200017e60201b6200053f1760201c565b15801562000079575060005460ff166001145b620000e25760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff19166001179055801562000106576000805461ff0019166101001790555b620001106200018d565b6200011b84620001f5565b620001268362000274565b620001318262000324565b801562000178576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b6001600160a01b03163b151590565b600054610100900460ff16620001e95760405162461bcd60e51b815260206004820152602b602482015260008051602062000f4f83398151915260448201526a6e697469616c697a696e6760a81b6064820152608401620000d9565b620001f362000385565b565b620001ff620003ec565b6001600160a01b038116620002665760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401620000d9565b620002718162000448565b50565b620002ba620002a560017f4aaefe95bd84fd3f32700cf3b7566bc944b73138e41958b5785826df2aecace16200049e565b60001b826200049a60201b6200055b1760201c565b600081604051602001620002d091815260200190565b60408051601f19818403018152919052905060005b60007f1d2b0bda21d56b8bd12d4f94ebacffdfb35f5e226f84b461103bb8beab6353be83604051620003189190620004c4565b60405180910390a35050565b62000355620002a560017fe314dfc40f0025322aacc0ba8ef420b62fb3b702cf01e0cdf3d829117ac2ff1b6200049e565b6000816040516020016200036b91815260200190565b60408051601f1981840301815291905290506001620002e5565b600054610100900460ff16620003e15760405162461bcd60e51b815260206004820152602b602482015260008051602062000f4f83398151915260448201526a6e697469616c697a696e6760a81b6064820152608401620000d9565b620001f33362000448565b6033546001600160a01b03163314620001f35760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401620000d9565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b9055565b600082821015620004bf57634e487b7160e01b600052601160045260246000fd5b500390565b600060208083528351808285015260005b81811015620004f357858101830151858201604001528201620004d5565b8181111562000506576000604083870101525b50601f01601f1916929092016040019392505050565b610a23806200052c6000396000f3fe608060405234801561001057600080fd5b50600436106100d45760003560e01c80638da5cb5b11610081578063f2fde38b1161005b578063f2fde38b146101b8578063f7d12760146101cb578063ffa1ad74146101d357600080fd5b80638da5cb5b14610180578063d798b1ac146101a8578063dc8452cd146101b057600080fd5b80635fd579af116100b25780635fd579af14610152578063715018a6146101655780637a1ac61e1461016d57600080fd5b80630457d6f2146100d9578063206a8300146100ee57806354fd4d5014610109575b600080fd5b6100ec6100e73660046108c3565b6101db565b005b6100f66101ef565b6040519081526020015b60405180910390f35b6101456040518060400160405280600581526020017f312e302e3000000000000000000000000000000000000000000000000000000081525081565b6040516101009190610947565b6100ec6101603660046108c3565b61021d565b6100ec61022e565b6100ec61017b36600461098a565b610242565b60335460405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610100565b6100f66103f7565b6100f6610430565b6100ec6101c63660046109bd565b610460565b6100f6610514565b6100f6600081565b6101e361055f565b6101ec816105e0565b50565b61021a60017f4aaefe95bd84fd3f32700cf3b7566bc944b73138e41958b5785826df2aecace16109d8565b81565b61022561055f565b6101ec81610698565b61023661055f565b6102406000610712565b565b600054610100900460ff16158080156102625750600054600160ff909116105b8061027c5750303b15801561027c575060005460ff166001145b61030d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084015b60405180910390fd5b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561036b57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b610373610789565b61037c84610460565b610385836105e0565b61038e82610698565b80156103f157600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b600061042b61042760017fe314dfc40f0025322aacc0ba8ef420b62fb3b702cf01e0cdf3d829117ac2ff1b6109d8565b5490565b905090565b600061042b61042760017f4aaefe95bd84fd3f32700cf3b7566bc944b73138e41958b5785826df2aecace16109d8565b61046861055f565b73ffffffffffffffffffffffffffffffffffffffff811661050b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610304565b6101ec81610712565b61021a60017fe314dfc40f0025322aacc0ba8ef420b62fb3b702cf01e0cdf3d829117ac2ff1b6109d8565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b9055565b60335473ffffffffffffffffffffffffffffffffffffffff163314610240576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610304565b61061361060e60017f4aaefe95bd84fd3f32700cf3b7566bc944b73138e41958b5785826df2aecace16109d8565b829055565b60008160405160200161062891815260200190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152919052905060005b60007f1d2b0bda21d56b8bd12d4f94ebacffdfb35f5e226f84b461103bb8beab6353be8360405161068c9190610947565b60405180910390a35050565b6106c661060e60017fe314dfc40f0025322aacc0ba8ef420b62fb3b702cf01e0cdf3d829117ac2ff1b6109d8565b6000816040516020016106db91815260200190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190529050600161065b565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff16610820576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610304565b610240600054610100900460ff166108ba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610304565b61024033610712565b6000602082840312156108d557600080fd5b5035919050565b6000815180845260005b81811015610902576020818501810151868301820152016108e6565b81811115610914576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60208152600061095a60208301846108dc565b9392505050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461098557600080fd5b919050565b60008060006060848603121561099f57600080fd5b6109a884610961565b95602085013595506040909401359392505050565b6000602082840312156109cf57600080fd5b61095a82610961565b600082821015610a11577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b50039056fea164736f6c634300080f000a496e697469616c697a61626c653a20636f6e7472616374206973206e6f742069", +} + +// ProtocolVersionsABI is the input ABI used to generate the binding from. +// Deprecated: Use ProtocolVersionsMetaData.ABI instead. +var ProtocolVersionsABI = ProtocolVersionsMetaData.ABI + +// ProtocolVersionsBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use ProtocolVersionsMetaData.Bin instead. +var ProtocolVersionsBin = ProtocolVersionsMetaData.Bin + +// DeployProtocolVersions deploys a new Ethereum contract, binding an instance of ProtocolVersions to it. +func DeployProtocolVersions(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *ProtocolVersions, error) { + parsed, err := ProtocolVersionsMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(ProtocolVersionsBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &ProtocolVersions{ProtocolVersionsCaller: ProtocolVersionsCaller{contract: contract}, ProtocolVersionsTransactor: ProtocolVersionsTransactor{contract: contract}, ProtocolVersionsFilterer: ProtocolVersionsFilterer{contract: contract}}, nil +} + +// ProtocolVersions is an auto generated Go binding around an Ethereum contract. +type ProtocolVersions struct { + ProtocolVersionsCaller // Read-only binding to the contract + ProtocolVersionsTransactor // Write-only binding to the contract + ProtocolVersionsFilterer // Log filterer for contract events +} + +// ProtocolVersionsCaller is an auto generated read-only Go binding around an Ethereum contract. +type ProtocolVersionsCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ProtocolVersionsTransactor is an auto generated write-only Go binding around an Ethereum contract. +type ProtocolVersionsTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ProtocolVersionsFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type ProtocolVersionsFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ProtocolVersionsSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type ProtocolVersionsSession struct { + Contract *ProtocolVersions // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// ProtocolVersionsCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type ProtocolVersionsCallerSession struct { + Contract *ProtocolVersionsCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// ProtocolVersionsTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type ProtocolVersionsTransactorSession struct { + Contract *ProtocolVersionsTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// ProtocolVersionsRaw is an auto generated low-level Go binding around an Ethereum contract. +type ProtocolVersionsRaw struct { + Contract *ProtocolVersions // Generic contract binding to access the raw methods on +} + +// ProtocolVersionsCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type ProtocolVersionsCallerRaw struct { + Contract *ProtocolVersionsCaller // Generic read-only contract binding to access the raw methods on +} + +// ProtocolVersionsTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type ProtocolVersionsTransactorRaw struct { + Contract *ProtocolVersionsTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewProtocolVersions creates a new instance of ProtocolVersions, bound to a specific deployed contract. +func NewProtocolVersions(address common.Address, backend bind.ContractBackend) (*ProtocolVersions, error) { + contract, err := bindProtocolVersions(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &ProtocolVersions{ProtocolVersionsCaller: ProtocolVersionsCaller{contract: contract}, ProtocolVersionsTransactor: ProtocolVersionsTransactor{contract: contract}, ProtocolVersionsFilterer: ProtocolVersionsFilterer{contract: contract}}, nil +} + +// NewProtocolVersionsCaller creates a new read-only instance of ProtocolVersions, bound to a specific deployed contract. +func NewProtocolVersionsCaller(address common.Address, caller bind.ContractCaller) (*ProtocolVersionsCaller, error) { + contract, err := bindProtocolVersions(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &ProtocolVersionsCaller{contract: contract}, nil +} + +// NewProtocolVersionsTransactor creates a new write-only instance of ProtocolVersions, bound to a specific deployed contract. +func NewProtocolVersionsTransactor(address common.Address, transactor bind.ContractTransactor) (*ProtocolVersionsTransactor, error) { + contract, err := bindProtocolVersions(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &ProtocolVersionsTransactor{contract: contract}, nil +} + +// NewProtocolVersionsFilterer creates a new log filterer instance of ProtocolVersions, bound to a specific deployed contract. +func NewProtocolVersionsFilterer(address common.Address, filterer bind.ContractFilterer) (*ProtocolVersionsFilterer, error) { + contract, err := bindProtocolVersions(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &ProtocolVersionsFilterer{contract: contract}, nil +} + +// bindProtocolVersions binds a generic wrapper to an already deployed contract. +func bindProtocolVersions(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(ProtocolVersionsABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_ProtocolVersions *ProtocolVersionsRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _ProtocolVersions.Contract.ProtocolVersionsCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_ProtocolVersions *ProtocolVersionsRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ProtocolVersions.Contract.ProtocolVersionsTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_ProtocolVersions *ProtocolVersionsRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ProtocolVersions.Contract.ProtocolVersionsTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_ProtocolVersions *ProtocolVersionsCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _ProtocolVersions.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_ProtocolVersions *ProtocolVersionsTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ProtocolVersions.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_ProtocolVersions *ProtocolVersionsTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ProtocolVersions.Contract.contract.Transact(opts, method, params...) +} + +// RECOMMENDEDSLOT is a free data retrieval call binding the contract method 0xf7d12760. +// +// Solidity: function RECOMMENDED_SLOT() view returns(bytes32) +func (_ProtocolVersions *ProtocolVersionsCaller) RECOMMENDEDSLOT(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _ProtocolVersions.contract.Call(opts, &out, "RECOMMENDED_SLOT") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// RECOMMENDEDSLOT is a free data retrieval call binding the contract method 0xf7d12760. +// +// Solidity: function RECOMMENDED_SLOT() view returns(bytes32) +func (_ProtocolVersions *ProtocolVersionsSession) RECOMMENDEDSLOT() ([32]byte, error) { + return _ProtocolVersions.Contract.RECOMMENDEDSLOT(&_ProtocolVersions.CallOpts) +} + +// RECOMMENDEDSLOT is a free data retrieval call binding the contract method 0xf7d12760. +// +// Solidity: function RECOMMENDED_SLOT() view returns(bytes32) +func (_ProtocolVersions *ProtocolVersionsCallerSession) RECOMMENDEDSLOT() ([32]byte, error) { + return _ProtocolVersions.Contract.RECOMMENDEDSLOT(&_ProtocolVersions.CallOpts) +} + +// REQUIREDSLOT is a free data retrieval call binding the contract method 0x206a8300. +// +// Solidity: function REQUIRED_SLOT() view returns(bytes32) +func (_ProtocolVersions *ProtocolVersionsCaller) REQUIREDSLOT(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _ProtocolVersions.contract.Call(opts, &out, "REQUIRED_SLOT") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// REQUIREDSLOT is a free data retrieval call binding the contract method 0x206a8300. +// +// Solidity: function REQUIRED_SLOT() view returns(bytes32) +func (_ProtocolVersions *ProtocolVersionsSession) REQUIREDSLOT() ([32]byte, error) { + return _ProtocolVersions.Contract.REQUIREDSLOT(&_ProtocolVersions.CallOpts) +} + +// REQUIREDSLOT is a free data retrieval call binding the contract method 0x206a8300. +// +// Solidity: function REQUIRED_SLOT() view returns(bytes32) +func (_ProtocolVersions *ProtocolVersionsCallerSession) REQUIREDSLOT() ([32]byte, error) { + return _ProtocolVersions.Contract.REQUIREDSLOT(&_ProtocolVersions.CallOpts) +} + +// VERSION is a free data retrieval call binding the contract method 0xffa1ad74. +// +// Solidity: function VERSION() view returns(uint256) +func (_ProtocolVersions *ProtocolVersionsCaller) VERSION(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _ProtocolVersions.contract.Call(opts, &out, "VERSION") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// VERSION is a free data retrieval call binding the contract method 0xffa1ad74. +// +// Solidity: function VERSION() view returns(uint256) +func (_ProtocolVersions *ProtocolVersionsSession) VERSION() (*big.Int, error) { + return _ProtocolVersions.Contract.VERSION(&_ProtocolVersions.CallOpts) +} + +// VERSION is a free data retrieval call binding the contract method 0xffa1ad74. +// +// Solidity: function VERSION() view returns(uint256) +func (_ProtocolVersions *ProtocolVersionsCallerSession) VERSION() (*big.Int, error) { + return _ProtocolVersions.Contract.VERSION(&_ProtocolVersions.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_ProtocolVersions *ProtocolVersionsCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _ProtocolVersions.contract.Call(opts, &out, "owner") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_ProtocolVersions *ProtocolVersionsSession) Owner() (common.Address, error) { + return _ProtocolVersions.Contract.Owner(&_ProtocolVersions.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_ProtocolVersions *ProtocolVersionsCallerSession) Owner() (common.Address, error) { + return _ProtocolVersions.Contract.Owner(&_ProtocolVersions.CallOpts) +} + +// Recommended is a free data retrieval call binding the contract method 0xd798b1ac. +// +// Solidity: function recommended() view returns(uint256 out_) +func (_ProtocolVersions *ProtocolVersionsCaller) Recommended(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _ProtocolVersions.contract.Call(opts, &out, "recommended") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Recommended is a free data retrieval call binding the contract method 0xd798b1ac. +// +// Solidity: function recommended() view returns(uint256 out_) +func (_ProtocolVersions *ProtocolVersionsSession) Recommended() (*big.Int, error) { + return _ProtocolVersions.Contract.Recommended(&_ProtocolVersions.CallOpts) +} + +// Recommended is a free data retrieval call binding the contract method 0xd798b1ac. +// +// Solidity: function recommended() view returns(uint256 out_) +func (_ProtocolVersions *ProtocolVersionsCallerSession) Recommended() (*big.Int, error) { + return _ProtocolVersions.Contract.Recommended(&_ProtocolVersions.CallOpts) +} + +// Required is a free data retrieval call binding the contract method 0xdc8452cd. +// +// Solidity: function required() view returns(uint256 out_) +func (_ProtocolVersions *ProtocolVersionsCaller) Required(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _ProtocolVersions.contract.Call(opts, &out, "required") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Required is a free data retrieval call binding the contract method 0xdc8452cd. +// +// Solidity: function required() view returns(uint256 out_) +func (_ProtocolVersions *ProtocolVersionsSession) Required() (*big.Int, error) { + return _ProtocolVersions.Contract.Required(&_ProtocolVersions.CallOpts) +} + +// Required is a free data retrieval call binding the contract method 0xdc8452cd. +// +// Solidity: function required() view returns(uint256 out_) +func (_ProtocolVersions *ProtocolVersionsCallerSession) Required() (*big.Int, error) { + return _ProtocolVersions.Contract.Required(&_ProtocolVersions.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_ProtocolVersions *ProtocolVersionsCaller) Version(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _ProtocolVersions.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 (_ProtocolVersions *ProtocolVersionsSession) Version() (string, error) { + return _ProtocolVersions.Contract.Version(&_ProtocolVersions.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_ProtocolVersions *ProtocolVersionsCallerSession) Version() (string, error) { + return _ProtocolVersions.Contract.Version(&_ProtocolVersions.CallOpts) +} + +// Initialize is a paid mutator transaction binding the contract method 0x7a1ac61e. +// +// Solidity: function initialize(address _owner, uint256 _required, uint256 _recommended) returns() +func (_ProtocolVersions *ProtocolVersionsTransactor) Initialize(opts *bind.TransactOpts, _owner common.Address, _required *big.Int, _recommended *big.Int) (*types.Transaction, error) { + return _ProtocolVersions.contract.Transact(opts, "initialize", _owner, _required, _recommended) +} + +// Initialize is a paid mutator transaction binding the contract method 0x7a1ac61e. +// +// Solidity: function initialize(address _owner, uint256 _required, uint256 _recommended) returns() +func (_ProtocolVersions *ProtocolVersionsSession) Initialize(_owner common.Address, _required *big.Int, _recommended *big.Int) (*types.Transaction, error) { + return _ProtocolVersions.Contract.Initialize(&_ProtocolVersions.TransactOpts, _owner, _required, _recommended) +} + +// Initialize is a paid mutator transaction binding the contract method 0x7a1ac61e. +// +// Solidity: function initialize(address _owner, uint256 _required, uint256 _recommended) returns() +func (_ProtocolVersions *ProtocolVersionsTransactorSession) Initialize(_owner common.Address, _required *big.Int, _recommended *big.Int) (*types.Transaction, error) { + return _ProtocolVersions.Contract.Initialize(&_ProtocolVersions.TransactOpts, _owner, _required, _recommended) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_ProtocolVersions *ProtocolVersionsTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ProtocolVersions.contract.Transact(opts, "renounceOwnership") +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_ProtocolVersions *ProtocolVersionsSession) RenounceOwnership() (*types.Transaction, error) { + return _ProtocolVersions.Contract.RenounceOwnership(&_ProtocolVersions.TransactOpts) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_ProtocolVersions *ProtocolVersionsTransactorSession) RenounceOwnership() (*types.Transaction, error) { + return _ProtocolVersions.Contract.RenounceOwnership(&_ProtocolVersions.TransactOpts) +} + +// SetRecommended is a paid mutator transaction binding the contract method 0x5fd579af. +// +// Solidity: function setRecommended(uint256 _recommended) returns() +func (_ProtocolVersions *ProtocolVersionsTransactor) SetRecommended(opts *bind.TransactOpts, _recommended *big.Int) (*types.Transaction, error) { + return _ProtocolVersions.contract.Transact(opts, "setRecommended", _recommended) +} + +// SetRecommended is a paid mutator transaction binding the contract method 0x5fd579af. +// +// Solidity: function setRecommended(uint256 _recommended) returns() +func (_ProtocolVersions *ProtocolVersionsSession) SetRecommended(_recommended *big.Int) (*types.Transaction, error) { + return _ProtocolVersions.Contract.SetRecommended(&_ProtocolVersions.TransactOpts, _recommended) +} + +// SetRecommended is a paid mutator transaction binding the contract method 0x5fd579af. +// +// Solidity: function setRecommended(uint256 _recommended) returns() +func (_ProtocolVersions *ProtocolVersionsTransactorSession) SetRecommended(_recommended *big.Int) (*types.Transaction, error) { + return _ProtocolVersions.Contract.SetRecommended(&_ProtocolVersions.TransactOpts, _recommended) +} + +// SetRequired is a paid mutator transaction binding the contract method 0x0457d6f2. +// +// Solidity: function setRequired(uint256 _required) returns() +func (_ProtocolVersions *ProtocolVersionsTransactor) SetRequired(opts *bind.TransactOpts, _required *big.Int) (*types.Transaction, error) { + return _ProtocolVersions.contract.Transact(opts, "setRequired", _required) +} + +// SetRequired is a paid mutator transaction binding the contract method 0x0457d6f2. +// +// Solidity: function setRequired(uint256 _required) returns() +func (_ProtocolVersions *ProtocolVersionsSession) SetRequired(_required *big.Int) (*types.Transaction, error) { + return _ProtocolVersions.Contract.SetRequired(&_ProtocolVersions.TransactOpts, _required) +} + +// SetRequired is a paid mutator transaction binding the contract method 0x0457d6f2. +// +// Solidity: function setRequired(uint256 _required) returns() +func (_ProtocolVersions *ProtocolVersionsTransactorSession) SetRequired(_required *big.Int) (*types.Transaction, error) { + return _ProtocolVersions.Contract.SetRequired(&_ProtocolVersions.TransactOpts, _required) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_ProtocolVersions *ProtocolVersionsTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { + return _ProtocolVersions.contract.Transact(opts, "transferOwnership", newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_ProtocolVersions *ProtocolVersionsSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _ProtocolVersions.Contract.TransferOwnership(&_ProtocolVersions.TransactOpts, newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_ProtocolVersions *ProtocolVersionsTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _ProtocolVersions.Contract.TransferOwnership(&_ProtocolVersions.TransactOpts, newOwner) +} + +// ProtocolVersionsConfigUpdateIterator is returned from FilterConfigUpdate and is used to iterate over the raw logs and unpacked data for ConfigUpdate events raised by the ProtocolVersions contract. +type ProtocolVersionsConfigUpdateIterator struct { + Event *ProtocolVersionsConfigUpdate // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *ProtocolVersionsConfigUpdateIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(ProtocolVersionsConfigUpdate) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(ProtocolVersionsConfigUpdate) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *ProtocolVersionsConfigUpdateIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ProtocolVersionsConfigUpdateIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ProtocolVersionsConfigUpdate represents a ConfigUpdate event raised by the ProtocolVersions contract. +type ProtocolVersionsConfigUpdate struct { + Version *big.Int + UpdateType uint8 + Data []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterConfigUpdate is a free log retrieval operation binding the contract event 0x1d2b0bda21d56b8bd12d4f94ebacffdfb35f5e226f84b461103bb8beab6353be. +// +// Solidity: event ConfigUpdate(uint256 indexed version, uint8 indexed updateType, bytes data) +func (_ProtocolVersions *ProtocolVersionsFilterer) FilterConfigUpdate(opts *bind.FilterOpts, version []*big.Int, updateType []uint8) (*ProtocolVersionsConfigUpdateIterator, error) { + + var versionRule []interface{} + for _, versionItem := range version { + versionRule = append(versionRule, versionItem) + } + var updateTypeRule []interface{} + for _, updateTypeItem := range updateType { + updateTypeRule = append(updateTypeRule, updateTypeItem) + } + + logs, sub, err := _ProtocolVersions.contract.FilterLogs(opts, "ConfigUpdate", versionRule, updateTypeRule) + if err != nil { + return nil, err + } + return &ProtocolVersionsConfigUpdateIterator{contract: _ProtocolVersions.contract, event: "ConfigUpdate", logs: logs, sub: sub}, nil +} + +// WatchConfigUpdate is a free log subscription operation binding the contract event 0x1d2b0bda21d56b8bd12d4f94ebacffdfb35f5e226f84b461103bb8beab6353be. +// +// Solidity: event ConfigUpdate(uint256 indexed version, uint8 indexed updateType, bytes data) +func (_ProtocolVersions *ProtocolVersionsFilterer) WatchConfigUpdate(opts *bind.WatchOpts, sink chan<- *ProtocolVersionsConfigUpdate, version []*big.Int, updateType []uint8) (event.Subscription, error) { + + var versionRule []interface{} + for _, versionItem := range version { + versionRule = append(versionRule, versionItem) + } + var updateTypeRule []interface{} + for _, updateTypeItem := range updateType { + updateTypeRule = append(updateTypeRule, updateTypeItem) + } + + logs, sub, err := _ProtocolVersions.contract.WatchLogs(opts, "ConfigUpdate", versionRule, updateTypeRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(ProtocolVersionsConfigUpdate) + if err := _ProtocolVersions.contract.UnpackLog(event, "ConfigUpdate", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseConfigUpdate is a log parse operation binding the contract event 0x1d2b0bda21d56b8bd12d4f94ebacffdfb35f5e226f84b461103bb8beab6353be. +// +// Solidity: event ConfigUpdate(uint256 indexed version, uint8 indexed updateType, bytes data) +func (_ProtocolVersions *ProtocolVersionsFilterer) ParseConfigUpdate(log types.Log) (*ProtocolVersionsConfigUpdate, error) { + event := new(ProtocolVersionsConfigUpdate) + if err := _ProtocolVersions.contract.UnpackLog(event, "ConfigUpdate", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// ProtocolVersionsInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the ProtocolVersions contract. +type ProtocolVersionsInitializedIterator struct { + Event *ProtocolVersionsInitialized // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *ProtocolVersionsInitializedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(ProtocolVersionsInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(ProtocolVersionsInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *ProtocolVersionsInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ProtocolVersionsInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ProtocolVersionsInitialized represents a Initialized event raised by the ProtocolVersions contract. +type ProtocolVersionsInitialized struct { + Version uint8 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_ProtocolVersions *ProtocolVersionsFilterer) FilterInitialized(opts *bind.FilterOpts) (*ProtocolVersionsInitializedIterator, error) { + + logs, sub, err := _ProtocolVersions.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &ProtocolVersionsInitializedIterator{contract: _ProtocolVersions.contract, event: "Initialized", logs: logs, sub: sub}, nil +} + +// WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_ProtocolVersions *ProtocolVersionsFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *ProtocolVersionsInitialized) (event.Subscription, error) { + + logs, sub, err := _ProtocolVersions.contract.WatchLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(ProtocolVersionsInitialized) + if err := _ProtocolVersions.contract.UnpackLog(event, "Initialized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_ProtocolVersions *ProtocolVersionsFilterer) ParseInitialized(log types.Log) (*ProtocolVersionsInitialized, error) { + event := new(ProtocolVersionsInitialized) + if err := _ProtocolVersions.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// ProtocolVersionsOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the ProtocolVersions contract. +type ProtocolVersionsOwnershipTransferredIterator struct { + Event *ProtocolVersionsOwnershipTransferred // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *ProtocolVersionsOwnershipTransferredIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(ProtocolVersionsOwnershipTransferred) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(ProtocolVersionsOwnershipTransferred) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *ProtocolVersionsOwnershipTransferredIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ProtocolVersionsOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ProtocolVersionsOwnershipTransferred represents a OwnershipTransferred event raised by the ProtocolVersions contract. +type ProtocolVersionsOwnershipTransferred struct { + PreviousOwner common.Address + NewOwner common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_ProtocolVersions *ProtocolVersionsFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*ProtocolVersionsOwnershipTransferredIterator, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _ProtocolVersions.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return &ProtocolVersionsOwnershipTransferredIterator{contract: _ProtocolVersions.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_ProtocolVersions *ProtocolVersionsFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *ProtocolVersionsOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _ProtocolVersions.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(ProtocolVersionsOwnershipTransferred) + if err := _ProtocolVersions.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_ProtocolVersions *ProtocolVersionsFilterer) ParseOwnershipTransferred(log types.Log) (*ProtocolVersionsOwnershipTransferred, error) { + event := new(ProtocolVersionsOwnershipTransferred) + if err := _ProtocolVersions.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/op-e2e2/bindings/proxy.go b/op-e2e2/bindings/proxy.go new file mode 100644 index 000000000000..a484a8144db3 --- /dev/null +++ b/op-e2e2/bindings/proxy.go @@ -0,0 +1,628 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// ProxyMetaData contains all meta data concerning the Proxy contract. +var ProxyMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_admin\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"fallback\",\"stateMutability\":\"payable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"admin\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"changeAdmin\",\"inputs\":[{\"name\":\"_admin\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"implementation\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"upgradeTo\",\"inputs\":[{\"name\":\"_implementation\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"upgradeToAndCall\",\"inputs\":[{\"name\":\"_implementation\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"payable\"},{\"type\":\"event\",\"name\":\"AdminChanged\",\"inputs\":[{\"name\":\"previousAdmin\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"newAdmin\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Upgraded\",\"inputs\":[{\"name\":\"implementation\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false}]", + Bin: "0x608060405234801561001057600080fd5b5060405161091f38038061091f83398101604081905261002f916100b5565b6100388161003e565b506100e5565b60006100566000805160206108ff8339815191525490565b6000805160206108ff833981519152838155604080516001600160a01b0380851682528616602082015292935090917f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f910160405180910390a1505050565b6000602082840312156100c757600080fd5b81516001600160a01b03811681146100de57600080fd5b9392505050565b61080b806100f46000396000f3fe60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146100be5780638f283970146100f8578063f851a440146101185761006d565b80633659cfe6146100755780634f1ef286146100955761006d565b3661006d5761006b61012d565b005b61006b61012d565b34801561008157600080fd5b5061006b6100903660046106dd565b610224565b6100a86100a33660046106f8565b610296565b6040516100b5919061077b565b60405180910390f35b3480156100ca57600080fd5b506100d3610419565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100b5565b34801561010457600080fd5b5061006b6101133660046106dd565b6104b0565b34801561012457600080fd5b506100d3610517565b60006101577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b905073ffffffffffffffffffffffffffffffffffffffff8116610201576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f50726f78793a20696d706c656d656e746174696f6e206e6f7420696e6974696160448201527f6c697a656400000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b3660008037600080366000845af43d6000803e8061021e573d6000fd5b503d6000f35b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061027d575033155b1561028e5761028b816105a3565b50565b61028b61012d565b60606102c07fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806102f7575033155b1561040a57610305846105a3565b6000808573ffffffffffffffffffffffffffffffffffffffff16858560405161032f9291906107ee565b600060405180830381855af49150503d806000811461036a576040519150601f19603f3d011682016040523d82523d6000602084013e61036f565b606091505b509150915081610401576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603960248201527f50726f78793a2064656c656761746563616c6c20746f206e657720696d706c6560448201527f6d656e746174696f6e20636f6e7472616374206661696c65640000000000000060648201526084016101f8565b91506104129050565b61041261012d565b9392505050565b60006104437fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061047a575033155b156104a557507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6104ad61012d565b90565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610509575033155b1561028e5761028b8161060c565b60006105417fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610578575033155b156104a557507fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc81815560405173ffffffffffffffffffffffffffffffffffffffff8316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a25050565b60006106367fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61038381556040805173ffffffffffffffffffffffffffffffffffffffff80851682528616602082015292935090917f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f910160405180910390a1505050565b803573ffffffffffffffffffffffffffffffffffffffff811681146106d857600080fd5b919050565b6000602082840312156106ef57600080fd5b610412826106b4565b60008060006040848603121561070d57600080fd5b610716846106b4565b9250602084013567ffffffffffffffff8082111561073357600080fd5b818601915086601f83011261074757600080fd5b81358181111561075657600080fd5b87602082850101111561076857600080fd5b6020830194508093505050509250925092565b600060208083528351808285015260005b818110156107a85785810183015185820160400152820161078c565b818111156107ba576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b818382376000910190815291905056fea164736f6c634300080f000ab53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103", +} + +// ProxyABI is the input ABI used to generate the binding from. +// Deprecated: Use ProxyMetaData.ABI instead. +var ProxyABI = ProxyMetaData.ABI + +// ProxyBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use ProxyMetaData.Bin instead. +var ProxyBin = ProxyMetaData.Bin + +// DeployProxy deploys a new Ethereum contract, binding an instance of Proxy to it. +func DeployProxy(auth *bind.TransactOpts, backend bind.ContractBackend, _admin common.Address) (common.Address, *types.Transaction, *Proxy, error) { + parsed, err := ProxyMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(ProxyBin), backend, _admin) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &Proxy{ProxyCaller: ProxyCaller{contract: contract}, ProxyTransactor: ProxyTransactor{contract: contract}, ProxyFilterer: ProxyFilterer{contract: contract}}, nil +} + +// Proxy is an auto generated Go binding around an Ethereum contract. +type Proxy struct { + ProxyCaller // Read-only binding to the contract + ProxyTransactor // Write-only binding to the contract + ProxyFilterer // Log filterer for contract events +} + +// ProxyCaller is an auto generated read-only Go binding around an Ethereum contract. +type ProxyCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ProxyTransactor is an auto generated write-only Go binding around an Ethereum contract. +type ProxyTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ProxyFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type ProxyFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ProxySession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type ProxySession struct { + Contract *Proxy // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// ProxyCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type ProxyCallerSession struct { + Contract *ProxyCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// ProxyTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type ProxyTransactorSession struct { + Contract *ProxyTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// ProxyRaw is an auto generated low-level Go binding around an Ethereum contract. +type ProxyRaw struct { + Contract *Proxy // Generic contract binding to access the raw methods on +} + +// ProxyCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type ProxyCallerRaw struct { + Contract *ProxyCaller // Generic read-only contract binding to access the raw methods on +} + +// ProxyTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type ProxyTransactorRaw struct { + Contract *ProxyTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewProxy creates a new instance of Proxy, bound to a specific deployed contract. +func NewProxy(address common.Address, backend bind.ContractBackend) (*Proxy, error) { + contract, err := bindProxy(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &Proxy{ProxyCaller: ProxyCaller{contract: contract}, ProxyTransactor: ProxyTransactor{contract: contract}, ProxyFilterer: ProxyFilterer{contract: contract}}, nil +} + +// NewProxyCaller creates a new read-only instance of Proxy, bound to a specific deployed contract. +func NewProxyCaller(address common.Address, caller bind.ContractCaller) (*ProxyCaller, error) { + contract, err := bindProxy(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &ProxyCaller{contract: contract}, nil +} + +// NewProxyTransactor creates a new write-only instance of Proxy, bound to a specific deployed contract. +func NewProxyTransactor(address common.Address, transactor bind.ContractTransactor) (*ProxyTransactor, error) { + contract, err := bindProxy(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &ProxyTransactor{contract: contract}, nil +} + +// NewProxyFilterer creates a new log filterer instance of Proxy, bound to a specific deployed contract. +func NewProxyFilterer(address common.Address, filterer bind.ContractFilterer) (*ProxyFilterer, error) { + contract, err := bindProxy(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &ProxyFilterer{contract: contract}, nil +} + +// bindProxy binds a generic wrapper to an already deployed contract. +func bindProxy(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(ProxyABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Proxy *ProxyRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Proxy.Contract.ProxyCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Proxy *ProxyRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Proxy.Contract.ProxyTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Proxy *ProxyRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Proxy.Contract.ProxyTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Proxy *ProxyCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Proxy.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Proxy *ProxyTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Proxy.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Proxy *ProxyTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Proxy.Contract.contract.Transact(opts, method, params...) +} + +// Admin is a paid mutator transaction binding the contract method 0xf851a440. +// +// Solidity: function admin() returns(address) +func (_Proxy *ProxyTransactor) Admin(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Proxy.contract.Transact(opts, "admin") +} + +// Admin is a paid mutator transaction binding the contract method 0xf851a440. +// +// Solidity: function admin() returns(address) +func (_Proxy *ProxySession) Admin() (*types.Transaction, error) { + return _Proxy.Contract.Admin(&_Proxy.TransactOpts) +} + +// Admin is a paid mutator transaction binding the contract method 0xf851a440. +// +// Solidity: function admin() returns(address) +func (_Proxy *ProxyTransactorSession) Admin() (*types.Transaction, error) { + return _Proxy.Contract.Admin(&_Proxy.TransactOpts) +} + +// ChangeAdmin is a paid mutator transaction binding the contract method 0x8f283970. +// +// Solidity: function changeAdmin(address _admin) returns() +func (_Proxy *ProxyTransactor) ChangeAdmin(opts *bind.TransactOpts, _admin common.Address) (*types.Transaction, error) { + return _Proxy.contract.Transact(opts, "changeAdmin", _admin) +} + +// ChangeAdmin is a paid mutator transaction binding the contract method 0x8f283970. +// +// Solidity: function changeAdmin(address _admin) returns() +func (_Proxy *ProxySession) ChangeAdmin(_admin common.Address) (*types.Transaction, error) { + return _Proxy.Contract.ChangeAdmin(&_Proxy.TransactOpts, _admin) +} + +// ChangeAdmin is a paid mutator transaction binding the contract method 0x8f283970. +// +// Solidity: function changeAdmin(address _admin) returns() +func (_Proxy *ProxyTransactorSession) ChangeAdmin(_admin common.Address) (*types.Transaction, error) { + return _Proxy.Contract.ChangeAdmin(&_Proxy.TransactOpts, _admin) +} + +// Implementation is a paid mutator transaction binding the contract method 0x5c60da1b. +// +// Solidity: function implementation() returns(address) +func (_Proxy *ProxyTransactor) Implementation(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Proxy.contract.Transact(opts, "implementation") +} + +// Implementation is a paid mutator transaction binding the contract method 0x5c60da1b. +// +// Solidity: function implementation() returns(address) +func (_Proxy *ProxySession) Implementation() (*types.Transaction, error) { + return _Proxy.Contract.Implementation(&_Proxy.TransactOpts) +} + +// Implementation is a paid mutator transaction binding the contract method 0x5c60da1b. +// +// Solidity: function implementation() returns(address) +func (_Proxy *ProxyTransactorSession) Implementation() (*types.Transaction, error) { + return _Proxy.Contract.Implementation(&_Proxy.TransactOpts) +} + +// UpgradeTo is a paid mutator transaction binding the contract method 0x3659cfe6. +// +// Solidity: function upgradeTo(address _implementation) returns() +func (_Proxy *ProxyTransactor) UpgradeTo(opts *bind.TransactOpts, _implementation common.Address) (*types.Transaction, error) { + return _Proxy.contract.Transact(opts, "upgradeTo", _implementation) +} + +// UpgradeTo is a paid mutator transaction binding the contract method 0x3659cfe6. +// +// Solidity: function upgradeTo(address _implementation) returns() +func (_Proxy *ProxySession) UpgradeTo(_implementation common.Address) (*types.Transaction, error) { + return _Proxy.Contract.UpgradeTo(&_Proxy.TransactOpts, _implementation) +} + +// UpgradeTo is a paid mutator transaction binding the contract method 0x3659cfe6. +// +// Solidity: function upgradeTo(address _implementation) returns() +func (_Proxy *ProxyTransactorSession) UpgradeTo(_implementation common.Address) (*types.Transaction, error) { + return _Proxy.Contract.UpgradeTo(&_Proxy.TransactOpts, _implementation) +} + +// UpgradeToAndCall is a paid mutator transaction binding the contract method 0x4f1ef286. +// +// Solidity: function upgradeToAndCall(address _implementation, bytes _data) payable returns(bytes) +func (_Proxy *ProxyTransactor) UpgradeToAndCall(opts *bind.TransactOpts, _implementation common.Address, _data []byte) (*types.Transaction, error) { + return _Proxy.contract.Transact(opts, "upgradeToAndCall", _implementation, _data) +} + +// UpgradeToAndCall is a paid mutator transaction binding the contract method 0x4f1ef286. +// +// Solidity: function upgradeToAndCall(address _implementation, bytes _data) payable returns(bytes) +func (_Proxy *ProxySession) UpgradeToAndCall(_implementation common.Address, _data []byte) (*types.Transaction, error) { + return _Proxy.Contract.UpgradeToAndCall(&_Proxy.TransactOpts, _implementation, _data) +} + +// UpgradeToAndCall is a paid mutator transaction binding the contract method 0x4f1ef286. +// +// Solidity: function upgradeToAndCall(address _implementation, bytes _data) payable returns(bytes) +func (_Proxy *ProxyTransactorSession) UpgradeToAndCall(_implementation common.Address, _data []byte) (*types.Transaction, error) { + return _Proxy.Contract.UpgradeToAndCall(&_Proxy.TransactOpts, _implementation, _data) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() payable returns() +func (_Proxy *ProxyTransactor) Fallback(opts *bind.TransactOpts, calldata []byte) (*types.Transaction, error) { + return _Proxy.contract.RawTransact(opts, calldata) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() payable returns() +func (_Proxy *ProxySession) Fallback(calldata []byte) (*types.Transaction, error) { + return _Proxy.Contract.Fallback(&_Proxy.TransactOpts, calldata) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() payable returns() +func (_Proxy *ProxyTransactorSession) Fallback(calldata []byte) (*types.Transaction, error) { + return _Proxy.Contract.Fallback(&_Proxy.TransactOpts, calldata) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_Proxy *ProxyTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Proxy.contract.RawTransact(opts, nil) // calldata is disallowed for receive function +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_Proxy *ProxySession) Receive() (*types.Transaction, error) { + return _Proxy.Contract.Receive(&_Proxy.TransactOpts) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_Proxy *ProxyTransactorSession) Receive() (*types.Transaction, error) { + return _Proxy.Contract.Receive(&_Proxy.TransactOpts) +} + +// ProxyAdminChangedIterator is returned from FilterAdminChanged and is used to iterate over the raw logs and unpacked data for AdminChanged events raised by the Proxy contract. +type ProxyAdminChangedIterator struct { + Event *ProxyAdminChanged // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *ProxyAdminChangedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(ProxyAdminChanged) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(ProxyAdminChanged) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *ProxyAdminChangedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ProxyAdminChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ProxyAdminChanged represents a AdminChanged event raised by the Proxy contract. +type ProxyAdminChanged struct { + PreviousAdmin common.Address + NewAdmin common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterAdminChanged is a free log retrieval operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. +// +// Solidity: event AdminChanged(address previousAdmin, address newAdmin) +func (_Proxy *ProxyFilterer) FilterAdminChanged(opts *bind.FilterOpts) (*ProxyAdminChangedIterator, error) { + + logs, sub, err := _Proxy.contract.FilterLogs(opts, "AdminChanged") + if err != nil { + return nil, err + } + return &ProxyAdminChangedIterator{contract: _Proxy.contract, event: "AdminChanged", logs: logs, sub: sub}, nil +} + +// WatchAdminChanged is a free log subscription operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. +// +// Solidity: event AdminChanged(address previousAdmin, address newAdmin) +func (_Proxy *ProxyFilterer) WatchAdminChanged(opts *bind.WatchOpts, sink chan<- *ProxyAdminChanged) (event.Subscription, error) { + + logs, sub, err := _Proxy.contract.WatchLogs(opts, "AdminChanged") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(ProxyAdminChanged) + if err := _Proxy.contract.UnpackLog(event, "AdminChanged", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseAdminChanged is a log parse operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. +// +// Solidity: event AdminChanged(address previousAdmin, address newAdmin) +func (_Proxy *ProxyFilterer) ParseAdminChanged(log types.Log) (*ProxyAdminChanged, error) { + event := new(ProxyAdminChanged) + if err := _Proxy.contract.UnpackLog(event, "AdminChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// ProxyUpgradedIterator is returned from FilterUpgraded and is used to iterate over the raw logs and unpacked data for Upgraded events raised by the Proxy contract. +type ProxyUpgradedIterator struct { + Event *ProxyUpgraded // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *ProxyUpgradedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(ProxyUpgraded) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(ProxyUpgraded) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *ProxyUpgradedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ProxyUpgradedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ProxyUpgraded represents a Upgraded event raised by the Proxy contract. +type ProxyUpgraded struct { + Implementation common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterUpgraded is a free log retrieval operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. +// +// Solidity: event Upgraded(address indexed implementation) +func (_Proxy *ProxyFilterer) FilterUpgraded(opts *bind.FilterOpts, implementation []common.Address) (*ProxyUpgradedIterator, error) { + + var implementationRule []interface{} + for _, implementationItem := range implementation { + implementationRule = append(implementationRule, implementationItem) + } + + logs, sub, err := _Proxy.contract.FilterLogs(opts, "Upgraded", implementationRule) + if err != nil { + return nil, err + } + return &ProxyUpgradedIterator{contract: _Proxy.contract, event: "Upgraded", logs: logs, sub: sub}, nil +} + +// WatchUpgraded is a free log subscription operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. +// +// Solidity: event Upgraded(address indexed implementation) +func (_Proxy *ProxyFilterer) WatchUpgraded(opts *bind.WatchOpts, sink chan<- *ProxyUpgraded, implementation []common.Address) (event.Subscription, error) { + + var implementationRule []interface{} + for _, implementationItem := range implementation { + implementationRule = append(implementationRule, implementationItem) + } + + logs, sub, err := _Proxy.contract.WatchLogs(opts, "Upgraded", implementationRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(ProxyUpgraded) + if err := _Proxy.contract.UnpackLog(event, "Upgraded", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseUpgraded is a log parse operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. +// +// Solidity: event Upgraded(address indexed implementation) +func (_Proxy *ProxyFilterer) ParseUpgraded(log types.Log) (*ProxyUpgraded, error) { + event := new(ProxyUpgraded) + if err := _Proxy.contract.UnpackLog(event, "Upgraded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/op-e2e2/bindings/proxyadmin.go b/op-e2e2/bindings/proxyadmin.go new file mode 100644 index 000000000000..405a2b91d051 --- /dev/null +++ b/op-e2e2/bindings/proxyadmin.go @@ -0,0 +1,782 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// ProxyAdminMetaData contains all meta data concerning the ProxyAdmin contract. +var ProxyAdminMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"addressManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractAddressManager\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"changeProxyAdmin\",\"inputs\":[{\"name\":\"_proxy\",\"type\":\"address\",\"internalType\":\"addresspayable\"},{\"name\":\"_newAdmin\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"getProxyAdmin\",\"inputs\":[{\"name\":\"_proxy\",\"type\":\"address\",\"internalType\":\"addresspayable\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getProxyImplementation\",\"inputs\":[{\"name\":\"_proxy\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"implementationName\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isUpgrading\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"proxyType\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"enumProxyAdmin.ProxyType\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setAddress\",\"inputs\":[{\"name\":\"_name\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"_address\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setAddressManager\",\"inputs\":[{\"name\":\"_address\",\"type\":\"address\",\"internalType\":\"contractAddressManager\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setImplementationName\",\"inputs\":[{\"name\":\"_address\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_name\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setProxyType\",\"inputs\":[{\"name\":\"_address\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_type\",\"type\":\"uint8\",\"internalType\":\"enumProxyAdmin.ProxyType\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setUpgrading\",\"inputs\":[{\"name\":\"_upgrading\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"upgrade\",\"inputs\":[{\"name\":\"_proxy\",\"type\":\"address\",\"internalType\":\"addresspayable\"},{\"name\":\"_implementation\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"upgradeAndCall\",\"inputs\":[{\"name\":\"_proxy\",\"type\":\"address\",\"internalType\":\"addresspayable\"},{\"name\":\"_implementation\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false}]", + Bin: "0x60806040523480156200001157600080fd5b5060405162001a5f38038062001a5f8339810160408190526200003491620000a1565b6200003f3362000051565b6200004a8162000051565b50620000d3565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600060208284031215620000b457600080fd5b81516001600160a01b0381168114620000cc57600080fd5b9392505050565b61197c80620000e36000396000f3fe60806040526004361061010e5760003560e01c8063860f7cda116100a557806399a88ec411610074578063b794726211610059578063b794726214610329578063f2fde38b14610364578063f3b7dead1461038457600080fd5b806399a88ec4146102e95780639b2ea4bd1461030957600080fd5b8063860f7cda1461026b5780638d52d4a01461028b5780638da5cb5b146102ab5780639623609d146102d657600080fd5b80633ab76e9f116100e15780633ab76e9f146101cc5780636bd9f516146101f9578063715018a6146102365780637eff275e1461024b57600080fd5b80630652b57a1461011357806307c8f7b014610135578063204e1c7a14610155578063238181ae1461019f575b600080fd5b34801561011f57600080fd5b5061013361012e3660046111f9565b6103a4565b005b34801561014157600080fd5b50610133610150366004611216565b6103f3565b34801561016157600080fd5b506101756101703660046111f9565b610445565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b3480156101ab57600080fd5b506101bf6101ba3660046111f9565b61066b565b60405161019691906112ae565b3480156101d857600080fd5b506003546101759073ffffffffffffffffffffffffffffffffffffffff1681565b34801561020557600080fd5b506102296102143660046111f9565b60016020526000908152604090205460ff1681565b60405161019691906112f0565b34801561024257600080fd5b50610133610705565b34801561025757600080fd5b50610133610266366004611331565b610719565b34801561027757600080fd5b5061013361028636600461148c565b6108cc565b34801561029757600080fd5b506101336102a63660046114dc565b610903565b3480156102b757600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff16610175565b6101336102e436600461150e565b610977565b3480156102f557600080fd5b50610133610304366004611331565b610b8e565b34801561031557600080fd5b50610133610324366004611584565b610e1e565b34801561033557600080fd5b5060035474010000000000000000000000000000000000000000900460ff166040519015158152602001610196565b34801561037057600080fd5b5061013361037f3660046111f9565b610eb4565b34801561039057600080fd5b5061017561039f3660046111f9565b610f6b565b6103ac6110e1565b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6103fb6110e1565b6003805491151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff909216919091179055565b73ffffffffffffffffffffffffffffffffffffffff811660009081526001602052604081205460ff1681816002811115610481576104816112c1565b036104fc578273ffffffffffffffffffffffffffffffffffffffff16635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104f591906115cb565b9392505050565b6001816002811115610510576105106112c1565b03610560578273ffffffffffffffffffffffffffffffffffffffff1663aaf10f426040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104d1573d6000803e3d6000fd5b6002816002811115610574576105746112c1565b036105fe5760035473ffffffffffffffffffffffffffffffffffffffff8481166000908152600260205260409081902090517fbf40fac1000000000000000000000000000000000000000000000000000000008152919092169163bf40fac1916105e19190600401611635565b602060405180830381865afa1580156104d1573d6000803e3d6000fd5b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f50726f787941646d696e3a20756e6b6e6f776e2070726f78792074797065000060448201526064015b60405180910390fd5b50919050565b60026020526000908152604090208054610684906115e8565b80601f01602080910402602001604051908101604052809291908181526020018280546106b0906115e8565b80156106fd5780601f106106d2576101008083540402835291602001916106fd565b820191906000526020600020905b8154815290600101906020018083116106e057829003601f168201915b505050505081565b61070d6110e1565b6107176000611162565b565b6107216110e1565b73ffffffffffffffffffffffffffffffffffffffff821660009081526001602052604081205460ff169081600281111561075d5761075d6112c1565b036107e9576040517f8f28397000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8381166004830152841690638f283970906024015b600060405180830381600087803b1580156107cc57600080fd5b505af11580156107e0573d6000803e3d6000fd5b50505050505050565b60018160028111156107fd576107fd6112c1565b03610856576040517f13af403500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301528416906313af4035906024016107b2565b600281600281111561086a5761086a6112c1565b036105fe576003546040517ff2fde38b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84811660048301529091169063f2fde38b906024016107b2565b505050565b6108d46110e1565b73ffffffffffffffffffffffffffffffffffffffff821660009081526002602052604090206108c78282611724565b61090b6110e1565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600160208190526040909120805483927fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff009091169083600281111561096e5761096e6112c1565b02179055505050565b61097f6110e1565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602052604081205460ff16908160028111156109bb576109bb6112c1565b03610a81576040517f4f1ef28600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff851690634f1ef286903490610a16908790879060040161183e565b60006040518083038185885af1158015610a34573d6000803e3d6000fd5b50505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052610a7b9190810190611875565b50610b88565b610a8b8484610b8e565b60008473ffffffffffffffffffffffffffffffffffffffff163484604051610ab391906118ec565b60006040518083038185875af1925050503d8060008114610af0576040519150601f19603f3d011682016040523d82523d6000602084013e610af5565b606091505b5050905080610b86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f50726f787941646d696e3a2063616c6c20746f2070726f78792061667465722060448201527f75706772616465206661696c6564000000000000000000000000000000000000606482015260840161065c565b505b50505050565b610b966110e1565b73ffffffffffffffffffffffffffffffffffffffff821660009081526001602052604081205460ff1690816002811115610bd257610bd26112c1565b03610c2b576040517f3659cfe600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8381166004830152841690633659cfe6906024016107b2565b6001816002811115610c3f57610c3f6112c1565b03610cbe576040517f9b0b0fda0000000000000000000000000000000000000000000000000000000081527f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc600482015273ffffffffffffffffffffffffffffffffffffffff8381166024830152841690639b0b0fda906044016107b2565b6002816002811115610cd257610cd26112c1565b03610e165773ffffffffffffffffffffffffffffffffffffffff831660009081526002602052604081208054610d07906115e8565b80601f0160208091040260200160405190810160405280929190818152602001828054610d33906115e8565b8015610d805780601f10610d5557610100808354040283529160200191610d80565b820191906000526020600020905b815481529060010190602001808311610d6357829003601f168201915b50506003546040517f9b2ea4bd00000000000000000000000000000000000000000000000000000000815294955073ffffffffffffffffffffffffffffffffffffffff1693639b2ea4bd9350610dde92508591508790600401611908565b600060405180830381600087803b158015610df857600080fd5b505af1158015610e0c573d6000803e3d6000fd5b5050505050505050565b6108c7611940565b610e266110e1565b6003546040517f9b2ea4bd00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911690639b2ea4bd90610e7e9085908590600401611908565b600060405180830381600087803b158015610e9857600080fd5b505af1158015610eac573d6000803e3d6000fd5b505050505050565b610ebc6110e1565b73ffffffffffffffffffffffffffffffffffffffff8116610f5f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161065c565b610f6881611162565b50565b73ffffffffffffffffffffffffffffffffffffffff811660009081526001602052604081205460ff1681816002811115610fa757610fa76112c1565b03610ff7578273ffffffffffffffffffffffffffffffffffffffff1663f851a4406040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104d1573d6000803e3d6000fd5b600181600281111561100b5761100b6112c1565b0361105b578273ffffffffffffffffffffffffffffffffffffffff1663893d20e86040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104d1573d6000803e3d6000fd5b600281600281111561106f5761106f6112c1565b036105fe57600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104d1573d6000803e3d6000fd5b60005473ffffffffffffffffffffffffffffffffffffffff163314610717576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161065c565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b73ffffffffffffffffffffffffffffffffffffffff81168114610f6857600080fd5b60006020828403121561120b57600080fd5b81356104f5816111d7565b60006020828403121561122857600080fd5b813580151581146104f557600080fd5b60005b8381101561125357818101518382015260200161123b565b83811115610b885750506000910152565b6000815180845261127c816020860160208601611238565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006104f56020830184611264565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b602081016003831061132b577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b91905290565b6000806040838503121561134457600080fd5b823561134f816111d7565b9150602083013561135f816111d7565b809150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156113e0576113e061136a565b604052919050565b600067ffffffffffffffff8211156114025761140261136a565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600061144161143c846113e8565b611399565b905082815283838301111561145557600080fd5b828260208301376000602084830101529392505050565b600082601f83011261147d57600080fd5b6104f58383356020850161142e565b6000806040838503121561149f57600080fd5b82356114aa816111d7565b9150602083013567ffffffffffffffff8111156114c657600080fd5b6114d28582860161146c565b9150509250929050565b600080604083850312156114ef57600080fd5b82356114fa816111d7565b915060208301356003811061135f57600080fd5b60008060006060848603121561152357600080fd5b833561152e816111d7565b9250602084013561153e816111d7565b9150604084013567ffffffffffffffff81111561155a57600080fd5b8401601f8101861361156b57600080fd5b61157a8682356020840161142e565b9150509250925092565b6000806040838503121561159757600080fd5b823567ffffffffffffffff8111156115ae57600080fd5b6115ba8582860161146c565b925050602083013561135f816111d7565b6000602082840312156115dd57600080fd5b81516104f5816111d7565b600181811c908216806115fc57607f821691505b602082108103610665577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000602080835260008454611649816115e8565b8084870152604060018084166000811461166a57600181146116a2576116d0565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008516838a01528284151560051b8a010195506116d0565b896000528660002060005b858110156116c85781548b82018601529083019088016116ad565b8a0184019650505b509398975050505050505050565b601f8211156108c757600081815260208120601f850160051c810160208610156117055750805b601f850160051c820191505b81811015610eac57828155600101611711565b815167ffffffffffffffff81111561173e5761173e61136a565b6117528161174c84546115e8565b846116de565b602080601f8311600181146117a5576000841561176f5750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555610eac565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b828110156117f2578886015182559484019460019091019084016117d3565b508582101561182e57878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b73ffffffffffffffffffffffffffffffffffffffff8316815260406020820152600061186d6040830184611264565b949350505050565b60006020828403121561188757600080fd5b815167ffffffffffffffff81111561189e57600080fd5b8201601f810184136118af57600080fd5b80516118bd61143c826113e8565b8181528560208385010111156118d257600080fd5b6118e3826020830160208601611238565b95945050505050565b600082516118fe818460208701611238565b9190910192915050565b60408152600061191b6040830185611264565b905073ffffffffffffffffffffffffffffffffffffffff831660208301529392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fdfea164736f6c634300080f000a", +} + +// ProxyAdminABI is the input ABI used to generate the binding from. +// Deprecated: Use ProxyAdminMetaData.ABI instead. +var ProxyAdminABI = ProxyAdminMetaData.ABI + +// ProxyAdminBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use ProxyAdminMetaData.Bin instead. +var ProxyAdminBin = ProxyAdminMetaData.Bin + +// DeployProxyAdmin deploys a new Ethereum contract, binding an instance of ProxyAdmin to it. +func DeployProxyAdmin(auth *bind.TransactOpts, backend bind.ContractBackend, _owner common.Address) (common.Address, *types.Transaction, *ProxyAdmin, error) { + parsed, err := ProxyAdminMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(ProxyAdminBin), backend, _owner) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &ProxyAdmin{ProxyAdminCaller: ProxyAdminCaller{contract: contract}, ProxyAdminTransactor: ProxyAdminTransactor{contract: contract}, ProxyAdminFilterer: ProxyAdminFilterer{contract: contract}}, nil +} + +// ProxyAdmin is an auto generated Go binding around an Ethereum contract. +type ProxyAdmin struct { + ProxyAdminCaller // Read-only binding to the contract + ProxyAdminTransactor // Write-only binding to the contract + ProxyAdminFilterer // Log filterer for contract events +} + +// ProxyAdminCaller is an auto generated read-only Go binding around an Ethereum contract. +type ProxyAdminCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ProxyAdminTransactor is an auto generated write-only Go binding around an Ethereum contract. +type ProxyAdminTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ProxyAdminFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type ProxyAdminFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ProxyAdminSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type ProxyAdminSession struct { + Contract *ProxyAdmin // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// ProxyAdminCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type ProxyAdminCallerSession struct { + Contract *ProxyAdminCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// ProxyAdminTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type ProxyAdminTransactorSession struct { + Contract *ProxyAdminTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// ProxyAdminRaw is an auto generated low-level Go binding around an Ethereum contract. +type ProxyAdminRaw struct { + Contract *ProxyAdmin // Generic contract binding to access the raw methods on +} + +// ProxyAdminCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type ProxyAdminCallerRaw struct { + Contract *ProxyAdminCaller // Generic read-only contract binding to access the raw methods on +} + +// ProxyAdminTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type ProxyAdminTransactorRaw struct { + Contract *ProxyAdminTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewProxyAdmin creates a new instance of ProxyAdmin, bound to a specific deployed contract. +func NewProxyAdmin(address common.Address, backend bind.ContractBackend) (*ProxyAdmin, error) { + contract, err := bindProxyAdmin(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &ProxyAdmin{ProxyAdminCaller: ProxyAdminCaller{contract: contract}, ProxyAdminTransactor: ProxyAdminTransactor{contract: contract}, ProxyAdminFilterer: ProxyAdminFilterer{contract: contract}}, nil +} + +// NewProxyAdminCaller creates a new read-only instance of ProxyAdmin, bound to a specific deployed contract. +func NewProxyAdminCaller(address common.Address, caller bind.ContractCaller) (*ProxyAdminCaller, error) { + contract, err := bindProxyAdmin(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &ProxyAdminCaller{contract: contract}, nil +} + +// NewProxyAdminTransactor creates a new write-only instance of ProxyAdmin, bound to a specific deployed contract. +func NewProxyAdminTransactor(address common.Address, transactor bind.ContractTransactor) (*ProxyAdminTransactor, error) { + contract, err := bindProxyAdmin(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &ProxyAdminTransactor{contract: contract}, nil +} + +// NewProxyAdminFilterer creates a new log filterer instance of ProxyAdmin, bound to a specific deployed contract. +func NewProxyAdminFilterer(address common.Address, filterer bind.ContractFilterer) (*ProxyAdminFilterer, error) { + contract, err := bindProxyAdmin(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &ProxyAdminFilterer{contract: contract}, nil +} + +// bindProxyAdmin binds a generic wrapper to an already deployed contract. +func bindProxyAdmin(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(ProxyAdminABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_ProxyAdmin *ProxyAdminRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _ProxyAdmin.Contract.ProxyAdminCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_ProxyAdmin *ProxyAdminRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ProxyAdmin.Contract.ProxyAdminTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_ProxyAdmin *ProxyAdminRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ProxyAdmin.Contract.ProxyAdminTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_ProxyAdmin *ProxyAdminCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _ProxyAdmin.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_ProxyAdmin *ProxyAdminTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ProxyAdmin.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_ProxyAdmin *ProxyAdminTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ProxyAdmin.Contract.contract.Transact(opts, method, params...) +} + +// AddressManager is a free data retrieval call binding the contract method 0x3ab76e9f. +// +// Solidity: function addressManager() view returns(address) +func (_ProxyAdmin *ProxyAdminCaller) AddressManager(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _ProxyAdmin.contract.Call(opts, &out, "addressManager") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// AddressManager is a free data retrieval call binding the contract method 0x3ab76e9f. +// +// Solidity: function addressManager() view returns(address) +func (_ProxyAdmin *ProxyAdminSession) AddressManager() (common.Address, error) { + return _ProxyAdmin.Contract.AddressManager(&_ProxyAdmin.CallOpts) +} + +// AddressManager is a free data retrieval call binding the contract method 0x3ab76e9f. +// +// Solidity: function addressManager() view returns(address) +func (_ProxyAdmin *ProxyAdminCallerSession) AddressManager() (common.Address, error) { + return _ProxyAdmin.Contract.AddressManager(&_ProxyAdmin.CallOpts) +} + +// GetProxyAdmin is a free data retrieval call binding the contract method 0xf3b7dead. +// +// Solidity: function getProxyAdmin(address _proxy) view returns(address) +func (_ProxyAdmin *ProxyAdminCaller) GetProxyAdmin(opts *bind.CallOpts, _proxy common.Address) (common.Address, error) { + var out []interface{} + err := _ProxyAdmin.contract.Call(opts, &out, "getProxyAdmin", _proxy) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// GetProxyAdmin is a free data retrieval call binding the contract method 0xf3b7dead. +// +// Solidity: function getProxyAdmin(address _proxy) view returns(address) +func (_ProxyAdmin *ProxyAdminSession) GetProxyAdmin(_proxy common.Address) (common.Address, error) { + return _ProxyAdmin.Contract.GetProxyAdmin(&_ProxyAdmin.CallOpts, _proxy) +} + +// GetProxyAdmin is a free data retrieval call binding the contract method 0xf3b7dead. +// +// Solidity: function getProxyAdmin(address _proxy) view returns(address) +func (_ProxyAdmin *ProxyAdminCallerSession) GetProxyAdmin(_proxy common.Address) (common.Address, error) { + return _ProxyAdmin.Contract.GetProxyAdmin(&_ProxyAdmin.CallOpts, _proxy) +} + +// GetProxyImplementation is a free data retrieval call binding the contract method 0x204e1c7a. +// +// Solidity: function getProxyImplementation(address _proxy) view returns(address) +func (_ProxyAdmin *ProxyAdminCaller) GetProxyImplementation(opts *bind.CallOpts, _proxy common.Address) (common.Address, error) { + var out []interface{} + err := _ProxyAdmin.contract.Call(opts, &out, "getProxyImplementation", _proxy) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// GetProxyImplementation is a free data retrieval call binding the contract method 0x204e1c7a. +// +// Solidity: function getProxyImplementation(address _proxy) view returns(address) +func (_ProxyAdmin *ProxyAdminSession) GetProxyImplementation(_proxy common.Address) (common.Address, error) { + return _ProxyAdmin.Contract.GetProxyImplementation(&_ProxyAdmin.CallOpts, _proxy) +} + +// GetProxyImplementation is a free data retrieval call binding the contract method 0x204e1c7a. +// +// Solidity: function getProxyImplementation(address _proxy) view returns(address) +func (_ProxyAdmin *ProxyAdminCallerSession) GetProxyImplementation(_proxy common.Address) (common.Address, error) { + return _ProxyAdmin.Contract.GetProxyImplementation(&_ProxyAdmin.CallOpts, _proxy) +} + +// ImplementationName is a free data retrieval call binding the contract method 0x238181ae. +// +// Solidity: function implementationName(address ) view returns(string) +func (_ProxyAdmin *ProxyAdminCaller) ImplementationName(opts *bind.CallOpts, arg0 common.Address) (string, error) { + var out []interface{} + err := _ProxyAdmin.contract.Call(opts, &out, "implementationName", arg0) + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// ImplementationName is a free data retrieval call binding the contract method 0x238181ae. +// +// Solidity: function implementationName(address ) view returns(string) +func (_ProxyAdmin *ProxyAdminSession) ImplementationName(arg0 common.Address) (string, error) { + return _ProxyAdmin.Contract.ImplementationName(&_ProxyAdmin.CallOpts, arg0) +} + +// ImplementationName is a free data retrieval call binding the contract method 0x238181ae. +// +// Solidity: function implementationName(address ) view returns(string) +func (_ProxyAdmin *ProxyAdminCallerSession) ImplementationName(arg0 common.Address) (string, error) { + return _ProxyAdmin.Contract.ImplementationName(&_ProxyAdmin.CallOpts, arg0) +} + +// IsUpgrading is a free data retrieval call binding the contract method 0xb7947262. +// +// Solidity: function isUpgrading() view returns(bool) +func (_ProxyAdmin *ProxyAdminCaller) IsUpgrading(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _ProxyAdmin.contract.Call(opts, &out, "isUpgrading") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsUpgrading is a free data retrieval call binding the contract method 0xb7947262. +// +// Solidity: function isUpgrading() view returns(bool) +func (_ProxyAdmin *ProxyAdminSession) IsUpgrading() (bool, error) { + return _ProxyAdmin.Contract.IsUpgrading(&_ProxyAdmin.CallOpts) +} + +// IsUpgrading is a free data retrieval call binding the contract method 0xb7947262. +// +// Solidity: function isUpgrading() view returns(bool) +func (_ProxyAdmin *ProxyAdminCallerSession) IsUpgrading() (bool, error) { + return _ProxyAdmin.Contract.IsUpgrading(&_ProxyAdmin.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_ProxyAdmin *ProxyAdminCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _ProxyAdmin.contract.Call(opts, &out, "owner") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_ProxyAdmin *ProxyAdminSession) Owner() (common.Address, error) { + return _ProxyAdmin.Contract.Owner(&_ProxyAdmin.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_ProxyAdmin *ProxyAdminCallerSession) Owner() (common.Address, error) { + return _ProxyAdmin.Contract.Owner(&_ProxyAdmin.CallOpts) +} + +// ProxyType is a free data retrieval call binding the contract method 0x6bd9f516. +// +// Solidity: function proxyType(address ) view returns(uint8) +func (_ProxyAdmin *ProxyAdminCaller) ProxyType(opts *bind.CallOpts, arg0 common.Address) (uint8, error) { + var out []interface{} + err := _ProxyAdmin.contract.Call(opts, &out, "proxyType", arg0) + + if err != nil { + return *new(uint8), err + } + + out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) + + return out0, err + +} + +// ProxyType is a free data retrieval call binding the contract method 0x6bd9f516. +// +// Solidity: function proxyType(address ) view returns(uint8) +func (_ProxyAdmin *ProxyAdminSession) ProxyType(arg0 common.Address) (uint8, error) { + return _ProxyAdmin.Contract.ProxyType(&_ProxyAdmin.CallOpts, arg0) +} + +// ProxyType is a free data retrieval call binding the contract method 0x6bd9f516. +// +// Solidity: function proxyType(address ) view returns(uint8) +func (_ProxyAdmin *ProxyAdminCallerSession) ProxyType(arg0 common.Address) (uint8, error) { + return _ProxyAdmin.Contract.ProxyType(&_ProxyAdmin.CallOpts, arg0) +} + +// ChangeProxyAdmin is a paid mutator transaction binding the contract method 0x7eff275e. +// +// Solidity: function changeProxyAdmin(address _proxy, address _newAdmin) returns() +func (_ProxyAdmin *ProxyAdminTransactor) ChangeProxyAdmin(opts *bind.TransactOpts, _proxy common.Address, _newAdmin common.Address) (*types.Transaction, error) { + return _ProxyAdmin.contract.Transact(opts, "changeProxyAdmin", _proxy, _newAdmin) +} + +// ChangeProxyAdmin is a paid mutator transaction binding the contract method 0x7eff275e. +// +// Solidity: function changeProxyAdmin(address _proxy, address _newAdmin) returns() +func (_ProxyAdmin *ProxyAdminSession) ChangeProxyAdmin(_proxy common.Address, _newAdmin common.Address) (*types.Transaction, error) { + return _ProxyAdmin.Contract.ChangeProxyAdmin(&_ProxyAdmin.TransactOpts, _proxy, _newAdmin) +} + +// ChangeProxyAdmin is a paid mutator transaction binding the contract method 0x7eff275e. +// +// Solidity: function changeProxyAdmin(address _proxy, address _newAdmin) returns() +func (_ProxyAdmin *ProxyAdminTransactorSession) ChangeProxyAdmin(_proxy common.Address, _newAdmin common.Address) (*types.Transaction, error) { + return _ProxyAdmin.Contract.ChangeProxyAdmin(&_ProxyAdmin.TransactOpts, _proxy, _newAdmin) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_ProxyAdmin *ProxyAdminTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ProxyAdmin.contract.Transact(opts, "renounceOwnership") +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_ProxyAdmin *ProxyAdminSession) RenounceOwnership() (*types.Transaction, error) { + return _ProxyAdmin.Contract.RenounceOwnership(&_ProxyAdmin.TransactOpts) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_ProxyAdmin *ProxyAdminTransactorSession) RenounceOwnership() (*types.Transaction, error) { + return _ProxyAdmin.Contract.RenounceOwnership(&_ProxyAdmin.TransactOpts) +} + +// SetAddress is a paid mutator transaction binding the contract method 0x9b2ea4bd. +// +// Solidity: function setAddress(string _name, address _address) returns() +func (_ProxyAdmin *ProxyAdminTransactor) SetAddress(opts *bind.TransactOpts, _name string, _address common.Address) (*types.Transaction, error) { + return _ProxyAdmin.contract.Transact(opts, "setAddress", _name, _address) +} + +// SetAddress is a paid mutator transaction binding the contract method 0x9b2ea4bd. +// +// Solidity: function setAddress(string _name, address _address) returns() +func (_ProxyAdmin *ProxyAdminSession) SetAddress(_name string, _address common.Address) (*types.Transaction, error) { + return _ProxyAdmin.Contract.SetAddress(&_ProxyAdmin.TransactOpts, _name, _address) +} + +// SetAddress is a paid mutator transaction binding the contract method 0x9b2ea4bd. +// +// Solidity: function setAddress(string _name, address _address) returns() +func (_ProxyAdmin *ProxyAdminTransactorSession) SetAddress(_name string, _address common.Address) (*types.Transaction, error) { + return _ProxyAdmin.Contract.SetAddress(&_ProxyAdmin.TransactOpts, _name, _address) +} + +// SetAddressManager is a paid mutator transaction binding the contract method 0x0652b57a. +// +// Solidity: function setAddressManager(address _address) returns() +func (_ProxyAdmin *ProxyAdminTransactor) SetAddressManager(opts *bind.TransactOpts, _address common.Address) (*types.Transaction, error) { + return _ProxyAdmin.contract.Transact(opts, "setAddressManager", _address) +} + +// SetAddressManager is a paid mutator transaction binding the contract method 0x0652b57a. +// +// Solidity: function setAddressManager(address _address) returns() +func (_ProxyAdmin *ProxyAdminSession) SetAddressManager(_address common.Address) (*types.Transaction, error) { + return _ProxyAdmin.Contract.SetAddressManager(&_ProxyAdmin.TransactOpts, _address) +} + +// SetAddressManager is a paid mutator transaction binding the contract method 0x0652b57a. +// +// Solidity: function setAddressManager(address _address) returns() +func (_ProxyAdmin *ProxyAdminTransactorSession) SetAddressManager(_address common.Address) (*types.Transaction, error) { + return _ProxyAdmin.Contract.SetAddressManager(&_ProxyAdmin.TransactOpts, _address) +} + +// SetImplementationName is a paid mutator transaction binding the contract method 0x860f7cda. +// +// Solidity: function setImplementationName(address _address, string _name) returns() +func (_ProxyAdmin *ProxyAdminTransactor) SetImplementationName(opts *bind.TransactOpts, _address common.Address, _name string) (*types.Transaction, error) { + return _ProxyAdmin.contract.Transact(opts, "setImplementationName", _address, _name) +} + +// SetImplementationName is a paid mutator transaction binding the contract method 0x860f7cda. +// +// Solidity: function setImplementationName(address _address, string _name) returns() +func (_ProxyAdmin *ProxyAdminSession) SetImplementationName(_address common.Address, _name string) (*types.Transaction, error) { + return _ProxyAdmin.Contract.SetImplementationName(&_ProxyAdmin.TransactOpts, _address, _name) +} + +// SetImplementationName is a paid mutator transaction binding the contract method 0x860f7cda. +// +// Solidity: function setImplementationName(address _address, string _name) returns() +func (_ProxyAdmin *ProxyAdminTransactorSession) SetImplementationName(_address common.Address, _name string) (*types.Transaction, error) { + return _ProxyAdmin.Contract.SetImplementationName(&_ProxyAdmin.TransactOpts, _address, _name) +} + +// SetProxyType is a paid mutator transaction binding the contract method 0x8d52d4a0. +// +// Solidity: function setProxyType(address _address, uint8 _type) returns() +func (_ProxyAdmin *ProxyAdminTransactor) SetProxyType(opts *bind.TransactOpts, _address common.Address, _type uint8) (*types.Transaction, error) { + return _ProxyAdmin.contract.Transact(opts, "setProxyType", _address, _type) +} + +// SetProxyType is a paid mutator transaction binding the contract method 0x8d52d4a0. +// +// Solidity: function setProxyType(address _address, uint8 _type) returns() +func (_ProxyAdmin *ProxyAdminSession) SetProxyType(_address common.Address, _type uint8) (*types.Transaction, error) { + return _ProxyAdmin.Contract.SetProxyType(&_ProxyAdmin.TransactOpts, _address, _type) +} + +// SetProxyType is a paid mutator transaction binding the contract method 0x8d52d4a0. +// +// Solidity: function setProxyType(address _address, uint8 _type) returns() +func (_ProxyAdmin *ProxyAdminTransactorSession) SetProxyType(_address common.Address, _type uint8) (*types.Transaction, error) { + return _ProxyAdmin.Contract.SetProxyType(&_ProxyAdmin.TransactOpts, _address, _type) +} + +// SetUpgrading is a paid mutator transaction binding the contract method 0x07c8f7b0. +// +// Solidity: function setUpgrading(bool _upgrading) returns() +func (_ProxyAdmin *ProxyAdminTransactor) SetUpgrading(opts *bind.TransactOpts, _upgrading bool) (*types.Transaction, error) { + return _ProxyAdmin.contract.Transact(opts, "setUpgrading", _upgrading) +} + +// SetUpgrading is a paid mutator transaction binding the contract method 0x07c8f7b0. +// +// Solidity: function setUpgrading(bool _upgrading) returns() +func (_ProxyAdmin *ProxyAdminSession) SetUpgrading(_upgrading bool) (*types.Transaction, error) { + return _ProxyAdmin.Contract.SetUpgrading(&_ProxyAdmin.TransactOpts, _upgrading) +} + +// SetUpgrading is a paid mutator transaction binding the contract method 0x07c8f7b0. +// +// Solidity: function setUpgrading(bool _upgrading) returns() +func (_ProxyAdmin *ProxyAdminTransactorSession) SetUpgrading(_upgrading bool) (*types.Transaction, error) { + return _ProxyAdmin.Contract.SetUpgrading(&_ProxyAdmin.TransactOpts, _upgrading) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_ProxyAdmin *ProxyAdminTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { + return _ProxyAdmin.contract.Transact(opts, "transferOwnership", newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_ProxyAdmin *ProxyAdminSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _ProxyAdmin.Contract.TransferOwnership(&_ProxyAdmin.TransactOpts, newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_ProxyAdmin *ProxyAdminTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _ProxyAdmin.Contract.TransferOwnership(&_ProxyAdmin.TransactOpts, newOwner) +} + +// Upgrade is a paid mutator transaction binding the contract method 0x99a88ec4. +// +// Solidity: function upgrade(address _proxy, address _implementation) returns() +func (_ProxyAdmin *ProxyAdminTransactor) Upgrade(opts *bind.TransactOpts, _proxy common.Address, _implementation common.Address) (*types.Transaction, error) { + return _ProxyAdmin.contract.Transact(opts, "upgrade", _proxy, _implementation) +} + +// Upgrade is a paid mutator transaction binding the contract method 0x99a88ec4. +// +// Solidity: function upgrade(address _proxy, address _implementation) returns() +func (_ProxyAdmin *ProxyAdminSession) Upgrade(_proxy common.Address, _implementation common.Address) (*types.Transaction, error) { + return _ProxyAdmin.Contract.Upgrade(&_ProxyAdmin.TransactOpts, _proxy, _implementation) +} + +// Upgrade is a paid mutator transaction binding the contract method 0x99a88ec4. +// +// Solidity: function upgrade(address _proxy, address _implementation) returns() +func (_ProxyAdmin *ProxyAdminTransactorSession) Upgrade(_proxy common.Address, _implementation common.Address) (*types.Transaction, error) { + return _ProxyAdmin.Contract.Upgrade(&_ProxyAdmin.TransactOpts, _proxy, _implementation) +} + +// UpgradeAndCall is a paid mutator transaction binding the contract method 0x9623609d. +// +// Solidity: function upgradeAndCall(address _proxy, address _implementation, bytes _data) payable returns() +func (_ProxyAdmin *ProxyAdminTransactor) UpgradeAndCall(opts *bind.TransactOpts, _proxy common.Address, _implementation common.Address, _data []byte) (*types.Transaction, error) { + return _ProxyAdmin.contract.Transact(opts, "upgradeAndCall", _proxy, _implementation, _data) +} + +// UpgradeAndCall is a paid mutator transaction binding the contract method 0x9623609d. +// +// Solidity: function upgradeAndCall(address _proxy, address _implementation, bytes _data) payable returns() +func (_ProxyAdmin *ProxyAdminSession) UpgradeAndCall(_proxy common.Address, _implementation common.Address, _data []byte) (*types.Transaction, error) { + return _ProxyAdmin.Contract.UpgradeAndCall(&_ProxyAdmin.TransactOpts, _proxy, _implementation, _data) +} + +// UpgradeAndCall is a paid mutator transaction binding the contract method 0x9623609d. +// +// Solidity: function upgradeAndCall(address _proxy, address _implementation, bytes _data) payable returns() +func (_ProxyAdmin *ProxyAdminTransactorSession) UpgradeAndCall(_proxy common.Address, _implementation common.Address, _data []byte) (*types.Transaction, error) { + return _ProxyAdmin.Contract.UpgradeAndCall(&_ProxyAdmin.TransactOpts, _proxy, _implementation, _data) +} + +// ProxyAdminOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the ProxyAdmin contract. +type ProxyAdminOwnershipTransferredIterator struct { + Event *ProxyAdminOwnershipTransferred // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *ProxyAdminOwnershipTransferredIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(ProxyAdminOwnershipTransferred) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(ProxyAdminOwnershipTransferred) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *ProxyAdminOwnershipTransferredIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ProxyAdminOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ProxyAdminOwnershipTransferred represents a OwnershipTransferred event raised by the ProxyAdmin contract. +type ProxyAdminOwnershipTransferred struct { + PreviousOwner common.Address + NewOwner common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_ProxyAdmin *ProxyAdminFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*ProxyAdminOwnershipTransferredIterator, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _ProxyAdmin.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return &ProxyAdminOwnershipTransferredIterator{contract: _ProxyAdmin.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_ProxyAdmin *ProxyAdminFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *ProxyAdminOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _ProxyAdmin.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(ProxyAdminOwnershipTransferred) + if err := _ProxyAdmin.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_ProxyAdmin *ProxyAdminFilterer) ParseOwnershipTransferred(log types.Log) (*ProxyAdminOwnershipTransferred, error) { + event := new(ProxyAdminOwnershipTransferred) + if err := _ProxyAdmin.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/op-e2e2/bindings/safe.go b/op-e2e2/bindings/safe.go new file mode 100644 index 000000000000..571d7db4c84f --- /dev/null +++ b/op-e2e2/bindings/safe.go @@ -0,0 +1,3210 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// SafeMetaData contains all meta data concerning the Safe contract. +var SafeMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"fallback\",\"stateMutability\":\"nonpayable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"VERSION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"addOwnerWithThreshold\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_threshold\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"approveHash\",\"inputs\":[{\"name\":\"hashToApprove\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"approvedHashes\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"changeThreshold\",\"inputs\":[{\"name\":\"_threshold\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"checkNSignatures\",\"inputs\":[{\"name\":\"dataHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"signatures\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"requiredSignatures\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"checkSignatures\",\"inputs\":[{\"name\":\"dataHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"signatures\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"disableModule\",\"inputs\":[{\"name\":\"prevModule\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"module\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"domainSeparator\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"enableModule\",\"inputs\":[{\"name\":\"module\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"encodeTransactionData\",\"inputs\":[{\"name\":\"to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"operation\",\"type\":\"uint8\",\"internalType\":\"enumEnum.Operation\"},{\"name\":\"safeTxGas\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"baseGas\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"gasPrice\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"gasToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"refundReceiver\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"execTransaction\",\"inputs\":[{\"name\":\"to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"operation\",\"type\":\"uint8\",\"internalType\":\"enumEnum.Operation\"},{\"name\":\"safeTxGas\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"baseGas\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"gasPrice\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"gasToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"refundReceiver\",\"type\":\"address\",\"internalType\":\"addresspayable\"},{\"name\":\"signatures\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"success\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"execTransactionFromModule\",\"inputs\":[{\"name\":\"to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"operation\",\"type\":\"uint8\",\"internalType\":\"enumEnum.Operation\"}],\"outputs\":[{\"name\":\"success\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"execTransactionFromModuleReturnData\",\"inputs\":[{\"name\":\"to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"operation\",\"type\":\"uint8\",\"internalType\":\"enumEnum.Operation\"}],\"outputs\":[{\"name\":\"success\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"returnData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"getChainId\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getModulesPaginated\",\"inputs\":[{\"name\":\"start\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"pageSize\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"array\",\"type\":\"address[]\",\"internalType\":\"address[]\"},{\"name\":\"next\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOwners\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getStorageAt\",\"inputs\":[{\"name\":\"offset\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"length\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getThreshold\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTransactionHash\",\"inputs\":[{\"name\":\"to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"operation\",\"type\":\"uint8\",\"internalType\":\"enumEnum.Operation\"},{\"name\":\"safeTxGas\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"baseGas\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"gasPrice\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"gasToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"refundReceiver\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isModuleEnabled\",\"inputs\":[{\"name\":\"module\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isOwner\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"nonce\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"removeOwner\",\"inputs\":[{\"name\":\"prevOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_threshold\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setFallbackHandler\",\"inputs\":[{\"name\":\"handler\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setGuard\",\"inputs\":[{\"name\":\"guard\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setup\",\"inputs\":[{\"name\":\"_owners\",\"type\":\"address[]\",\"internalType\":\"address[]\"},{\"name\":\"_threshold\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"fallbackHandler\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"paymentToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"payment\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"paymentReceiver\",\"type\":\"address\",\"internalType\":\"addresspayable\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"signedMessages\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"simulateAndRevert\",\"inputs\":[{\"name\":\"targetContract\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"calldataPayload\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"swapOwner\",\"inputs\":[{\"name\":\"prevOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"oldOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"AddedOwner\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ApproveHash\",\"inputs\":[{\"name\":\"approvedHash\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"owner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ChangedFallbackHandler\",\"inputs\":[{\"name\":\"handler\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ChangedGuard\",\"inputs\":[{\"name\":\"guard\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ChangedThreshold\",\"inputs\":[{\"name\":\"threshold\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"DisabledModule\",\"inputs\":[{\"name\":\"module\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"EnabledModule\",\"inputs\":[{\"name\":\"module\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ExecutionFailure\",\"inputs\":[{\"name\":\"txHash\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"payment\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ExecutionFromModuleFailure\",\"inputs\":[{\"name\":\"module\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ExecutionFromModuleSuccess\",\"inputs\":[{\"name\":\"module\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ExecutionSuccess\",\"inputs\":[{\"name\":\"txHash\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"payment\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RemovedOwner\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"SafeReceived\",\"inputs\":[{\"name\":\"sender\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"SafeSetup\",\"inputs\":[{\"name\":\"initiator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"owners\",\"type\":\"address[]\",\"indexed\":false,\"internalType\":\"address[]\"},{\"name\":\"threshold\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"initializer\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"fallbackHandler\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"SignMsg\",\"inputs\":[{\"name\":\"msgHash\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"}],\"anonymous\":false}]", + Bin: "0x608060405234801561001057600080fd5b506001600455614201806100256000396000f3fe6080604052600436106101d15760003560e01c8063affed0e0116100f7578063e19a9dd911610095578063f08a032311610064578063f08a0323146105f5578063f698da2514610615578063f8dc5dd91461067c578063ffa1ad741461069c5761020d565b8063e19a9dd914610580578063e318b52b146105a0578063e75235b8146105c0578063e86637db146105d55761020d565b8063cc2f8452116100d1578063cc2f8452146104f2578063d4d9bdcd14610520578063d8d11f7814610540578063e009cfde146105605761020d565b8063affed0e01461049c578063b4faba09146104b2578063b63e800d146104d25761020d565b80635624b25b1161016f5780636a7612021161013e5780636a7612021461040f5780637d83297414610422578063934f3a111461045a578063a0e67e2b1461047a5761020d565b80635624b25b146103755780635ae6bd37146103a2578063610b5925146103cf578063694e80c3146103ef5761020d565b80632f54bf6e116101ab5780632f54bf6e146102ea5780633408e4701461030a578063468721a7146103275780635229073f146103475761020d565b80630d582f131461027357806312fb68e0146102955780632d9ad53d146102b55761020d565b3661020d5760405134815233907f3d0ce9bfc3ed7d6862dbb28b2dea94561fe714a1b4d019aa8af39730d1ad7c3d9060200160405180910390a2005b34801561021957600080fd5b507f6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d580548061024457005b36600080373360601b365260008060143601600080855af190503d6000803e8061026d573d6000fd5b503d6000f35b34801561027f57600080fd5b5061029361028e366004613568565b6106e5565b005b3480156102a157600080fd5b506102936102b036600461366e565b610933565b3480156102c157600080fd5b506102d56102d03660046136e3565b610ff7565b60405190151581526020015b60405180910390f35b3480156102f657600080fd5b506102d56103053660046136e3565b61104c565b34801561031657600080fd5b50465b6040519081526020016102e1565b34801561033357600080fd5b506102d561034236600461370f565b61109e565b34801561035357600080fd5b5061036761036236600461370f565b6111d4565b6040516102e19291906137e4565b34801561038157600080fd5b506103956103903660046137ff565b61120a565b6040516102e19190613821565b3480156103ae57600080fd5b506103196103bd366004613834565b60076020526000908152604090205481565b3480156103db57600080fd5b506102936103ea3660046136e3565b611290565b3480156103fb57600080fd5b5061029361040a366004613834565b611479565b6102d561041d366004613896565b611593565b34801561042e57600080fd5b5061031961043d366004613568565b600860209081526000928352604080842090915290825290205481565b34801561046657600080fd5b5061029361047536600461396f565b61198f565b34801561048657600080fd5b5061048f611a0b565b6040516102e19190613a2d565b3480156104a857600080fd5b5061031960055481565b3480156104be57600080fd5b506102936104cd366004613a40565b611b23565b3480156104de57600080fd5b506102936104ed366004613a90565b611b46565b3480156104fe57600080fd5b5061051261050d366004613568565b611c62565b6040516102e1929190613b85565b34801561052c57600080fd5b5061029361053b366004613834565b611ed0565b34801561054c57600080fd5b5061031961055b366004613bbd565b611fa4565b34801561056c57600080fd5b5061029361057b366004613c7e565b611fd1565b34801561058c57600080fd5b5061029361059b3660046136e3565b6121a3565b3480156105ac57600080fd5b506102936105bb366004613cb7565b612344565b3480156105cc57600080fd5b50600454610319565b3480156105e157600080fd5b506103956105f0366004613bbd565b6126bc565b34801561060157600080fd5b506102936106103660046136e3565b612855565b34801561062157600080fd5b5061031960007f47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a794692184660408051602081019390935282015230606082015260800160405160208183030381529060405280519060200120905090565b34801561068857600080fd5b50610293610697366004613d02565b6128aa565b3480156106a857600080fd5b506103956040518060400160405280600581526020017f312e342e3000000000000000000000000000000000000000000000000000000081525081565b6106ed612b34565b73ffffffffffffffffffffffffffffffffffffffff821615801590610729575073ffffffffffffffffffffffffffffffffffffffff8216600114155b801561074b575073ffffffffffffffffffffffffffffffffffffffff82163014155b6107b6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f475332303300000000000000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8281166000908152600260205260409020541615610845576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f475332303400000000000000000000000000000000000000000000000000000060448201526064016107ad565b60026020527fe90b7bceb6e7df5418fb78d8ee546e97c83a08bbccc01a0644d599ccd2a7c2e0805473ffffffffffffffffffffffffffffffffffffffff8481166000818152604081208054939094167fffffffffffffffffffffffff0000000000000000000000000000000000000000938416179093556001835283549091161790915560038054916108d783613d72565b909155505060405173ffffffffffffffffffffffffffffffffffffffff8316907f9465fa0c962cc76958e6373a993326400c1c94f8be2fe3a952adfa7f60b2ea2690600090a2806004541461092f5761092f81611479565b5050565b61093e816041612b9f565b825110156109a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f475330323000000000000000000000000000000000000000000000000000000060448201526064016107ad565b6000808060008060005b86811015610feb576041818102890160208101516040820151919092015160ff16955090935091506000849003610cf857885160208a01208a14610a52576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f475330323700000000000000000000000000000000000000000000000000000060448201526064016107ad565b9193508391610a62876041612b9f565b821015610acb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f475330323100000000000000000000000000000000000000000000000000000060448201526064016107ad565b8751610ad8836020612bdb565b1115610b40576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f475330323200000000000000000000000000000000000000000000000000000060448201526064016107ad565b602082890181015189519091610b63908390610b5d908790612bdb565b90612bdb565b1115610bcb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f475330323300000000000000000000000000000000000000000000000000000060448201526064016107ad565b6040517f20c13b0b000000000000000000000000000000000000000000000000000000008082528a85016020019173ffffffffffffffffffffffffffffffffffffffff8916906320c13b0b90610c27908f908690600401613daa565b602060405180830381865afa158015610c44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c689190613dcf565b7fffffffff000000000000000000000000000000000000000000000000000000001614610cf1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f475330323400000000000000000000000000000000000000000000000000000060448201526064016107ad565b5050610eeb565b8360ff16600103610dc65791935083913373ffffffffffffffffffffffffffffffffffffffff84161480610d5b575073ffffffffffffffffffffffffffffffffffffffff851660009081526008602090815260408083208d845290915290205415155b610dc1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f475330323500000000000000000000000000000000000000000000000000000060448201526064016107ad565b610eeb565b601e8460ff161115610e8b576040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c81018b9052600190605c0160405160208183030381529060405280519060200120600486610e2b9190613e11565b6040805160008152602081018083529390935260ff90911690820152606081018590526080810184905260a0016020604051602081039080840390855afa158015610e7a573d6000803e3d6000fd5b505050602060405103519450610eeb565b6040805160008152602081018083528c905260ff861691810191909152606081018490526080810183905260019060a0016020604051602081039080840390855afa158015610ede573d6000803e3d6000fd5b5050506020604051035194505b8573ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16118015610f4c575073ffffffffffffffffffffffffffffffffffffffff8581166000908152600260205260409020541615155b8015610f6f575073ffffffffffffffffffffffffffffffffffffffff8516600114155b610fd5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f475330323600000000000000000000000000000000000000000000000000000060448201526064016107ad565b8495508080610fe390613d72565b9150506109b2565b50505050505050505050565b6000600173ffffffffffffffffffffffffffffffffffffffff831614801590611046575073ffffffffffffffffffffffffffffffffffffffff8281166000908152600160205260409020541615155b92915050565b600073ffffffffffffffffffffffffffffffffffffffff821660011480159061104657505073ffffffffffffffffffffffffffffffffffffffff90811660009081526002602052604090205416151590565b6000336001148015906110d557503360009081526001602052604090205473ffffffffffffffffffffffffffffffffffffffff1615155b61113b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f475331303400000000000000000000000000000000000000000000000000000060448201526064016107ad565b611168858585857fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff612bf7565b905080156111a05760405133907f6895c13664aa4f67288b25d7a21d7aaa34916e355fb9b6fae0a139a9085becb890600090a26111cc565b60405133907facd2c8702804128fdb0db2bb49f6d127dd0181c13fd45dbfe16de0930e2bd37590600090a25b949350505050565b600060606111e48686868661109e565b915060405160203d0181016040523d81523d6000602083013e8091505094509492505050565b60606000611219836020613e34565b67ffffffffffffffff81111561123157611231613594565b6040519080825280601f01601f19166020018201604052801561125b576020820181803683370190505b50905060005b8381101561128857848101546020808302840101528061128081613d72565b915050611261565b509392505050565b611298612b34565b73ffffffffffffffffffffffffffffffffffffffff8116158015906112d4575073ffffffffffffffffffffffffffffffffffffffff8116600114155b61133a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f475331303100000000000000000000000000000000000000000000000000000060448201526064016107ad565b73ffffffffffffffffffffffffffffffffffffffff81811660009081526001602052604090205416156113c9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f475331303200000000000000000000000000000000000000000000000000000060448201526064016107ad565b600160208190527fcc69885fda6bcc1a4ace058b4a62bf5e179ea78fd58a1ccd71c22cc9b688792f805473ffffffffffffffffffffffffffffffffffffffff848116600081815260408082208054949095167fffffffffffffffffffffffff000000000000000000000000000000000000000094851617909455948552835490911681179092555190917fecdf3a3effea5783a3c4c2140e677577666428d44ed9d474a0b3a4c9943f844091a250565b611481612b34565b6003548111156114ed576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f475332303100000000000000000000000000000000000000000000000000000060448201526064016107ad565b6001811015611558576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f475332303200000000000000000000000000000000000000000000000000000060448201526064016107ad565b60048190556040518181527f610f7ff2b304ae8903c3de74c60c6ab1f7d6226b3f52c5161905bb5ad4039c939060200160405180910390a150565b60008060006115ad8e8e8e8e8e8e8e8e8e8e6005546126bc565b6005805491925060006115bf83613d72565b90915550508051602082012091506115d882828661198f565b5060006116037f4a204f620c8c5ccdca3fd54d003badd85ba500436a431f0cbda4f558c93c34c85490565b905073ffffffffffffffffffffffffffffffffffffffff8116156116a3578073ffffffffffffffffffffffffffffffffffffffff166375f0bb528f8f8f8f8f8f8f8f8f8f8f336040518d63ffffffff1660e01b81526004016116709c9b9a99989796959493929190613edb565b600060405180830381600087803b15801561168a57600080fd5b505af115801561169e573d6000803e3d6000fd5b505050505b6116cf6116b28a6109c4613ff1565b603f6116bf8c6040613e34565b6116c99190614009565b90612c3e565b6116db906101f4613ff1565b5a1015611744576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f475330313000000000000000000000000000000000000000000000000000000060448201526064016107ad565b60005a90506117b58f8f8f8f8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050508e8c6000146117a2578e612bf7565b6109c45a6117b09190614044565b612bf7565b93506117c25a8290612c55565b905083806117cf57508915155b806117d957508715155b61183f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f475330313300000000000000000000000000000000000000000000000000000060448201526064016107ad565b6000881561185757611854828b8b8b8b612c70565b90505b841561189c57837f442e715f626346e8c54381002da614f62bee8d27386535b2521ec8540898556e8260405161188f91815260200190565b60405180910390a26118d7565b837f23428b18acfb3ea64b08dc0c1d296ea9c09702c09083ca5272e64d115b687d23826040516118ce91815260200190565b60405180910390a25b505073ffffffffffffffffffffffffffffffffffffffff81161561197e576040517f9327136800000000000000000000000000000000000000000000000000000000815260048101839052831515602482015273ffffffffffffffffffffffffffffffffffffffff821690639327136890604401600060405180830381600087803b15801561196557600080fd5b505af1158015611979573d6000803e3d6000fd5b505050505b50509b9a5050505050505050505050565b600454806119f9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f475330303100000000000000000000000000000000000000000000000000000060448201526064016107ad565b611a0584848484610933565b50505050565b6060600060035467ffffffffffffffff811115611a2a57611a2a613594565b604051908082528060200260200182016040528015611a53578160200160208202803683370190505b506001600090815260026020527fe90b7bceb6e7df5418fb78d8ee546e97c83a08bbccc01a0644d599ccd2a7c2e0549192509073ffffffffffffffffffffffffffffffffffffffff165b73ffffffffffffffffffffffffffffffffffffffff8116600114611b1b5780838381518110611ace57611ace61405b565b73ffffffffffffffffffffffffffffffffffffffff928316602091820292909201810191909152918116600090815260029092526040909120541681611b1381613d72565b925050611a9d565b509092915050565b600080825160208401855af480600052503d6020523d600060403e60403d016000fd5b611b848a8a808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152508c9250612e01915050565b73ffffffffffffffffffffffffffffffffffffffff841615611ba957611ba9846131ce565b611be98787878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061327192505050565b8115611c0057611bfe82600060018685612c70565b505b3373ffffffffffffffffffffffffffffffffffffffff167f141df868a6331af528e38c83b7aa03edc19be66e37ae67f9285bf4f8e3c6a1a88b8b8b8b89604051611c4e95949392919061408a565b60405180910390a250505050505050505050565b6060600073ffffffffffffffffffffffffffffffffffffffff841660011480611c8f5750611c8f84610ff7565b611cf5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f475331303500000000000000000000000000000000000000000000000000000060448201526064016107ad565b60008311611d5f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f475331303600000000000000000000000000000000000000000000000000000060448201526064016107ad565b8267ffffffffffffffff811115611d7857611d78613594565b604051908082528060200260200182016040528015611da1578160200160208202803683370190505b5073ffffffffffffffffffffffffffffffffffffffff808616600090815260016020526040812054929450911691505b73ffffffffffffffffffffffffffffffffffffffff821615801590611e0d575073ffffffffffffffffffffffffffffffffffffffff8216600114155b8015611e1857508381105b15611e805781838281518110611e3057611e3061405b565b73ffffffffffffffffffffffffffffffffffffffff928316602091820292909201810191909152928116600090815260019093526040909220549091169080611e7881613d72565b915050611dd1565b73ffffffffffffffffffffffffffffffffffffffff8216600114611ec55782611eaa600183614044565b81518110611eba57611eba61405b565b602002602001015191505b808352509250929050565b3360009081526002602052604090205473ffffffffffffffffffffffffffffffffffffffff16611f5c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f475330333000000000000000000000000000000000000000000000000000000060448201526064016107ad565b336000818152600860209081526040808320858452909152808220600190555183917ff2a0eb156472d1440255b0d7c1e19cc07115d1051fe605b0dce69acfec884d9c91a350565b6000611fb98c8c8c8c8c8c8c8c8c8c8c6126bc565b8051906020012090509b9a5050505050505050505050565b611fd9612b34565b73ffffffffffffffffffffffffffffffffffffffff811615801590612015575073ffffffffffffffffffffffffffffffffffffffff8116600114155b61207b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f475331303100000000000000000000000000000000000000000000000000000060448201526064016107ad565b73ffffffffffffffffffffffffffffffffffffffff82811660009081526001602052604090205481169082161461210e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f475331303300000000000000000000000000000000000000000000000000000060448201526064016107ad565b73ffffffffffffffffffffffffffffffffffffffff818116600081815260016020526040808220805487861684528284208054919096167fffffffffffffffffffffffff0000000000000000000000000000000000000000918216179095558383528054909416909355915190917faab4fa2b463f581b2b32cb3b7e3b704b9ce37cc209b5fb4d77e593ace405427691a25050565b6121ab612b34565b73ffffffffffffffffffffffffffffffffffffffff8116156122db576040517f01ffc9a70000000000000000000000000000000000000000000000000000000081527fe6d7a83a00000000000000000000000000000000000000000000000000000000600482015273ffffffffffffffffffffffffffffffffffffffff8216906301ffc9a790602401602060405180830381865afa158015612251573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122759190614110565b6122db576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f475333303000000000000000000000000000000000000000000000000000000060448201526064016107ad565b7f4a204f620c8c5ccdca3fd54d003badd85ba500436a431f0cbda4f558c93c34c881815560405173ffffffffffffffffffffffffffffffffffffffff8316907f1151116914515bc0891ff9047a6cb32cf902546f83066499bcf8ba33d2353fa290600090a25050565b61234c612b34565b73ffffffffffffffffffffffffffffffffffffffff811615801590612388575073ffffffffffffffffffffffffffffffffffffffff8116600114155b80156123aa575073ffffffffffffffffffffffffffffffffffffffff81163014155b612410576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f475332303300000000000000000000000000000000000000000000000000000060448201526064016107ad565b73ffffffffffffffffffffffffffffffffffffffff818116600090815260026020526040902054161561249f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f475332303400000000000000000000000000000000000000000000000000000060448201526064016107ad565b73ffffffffffffffffffffffffffffffffffffffff8216158015906124db575073ffffffffffffffffffffffffffffffffffffffff8216600114155b612541576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f475332303300000000000000000000000000000000000000000000000000000060448201526064016107ad565b73ffffffffffffffffffffffffffffffffffffffff8381166000908152600260205260409020548116908316146125d4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f475332303500000000000000000000000000000000000000000000000000000060448201526064016107ad565b73ffffffffffffffffffffffffffffffffffffffff828116600081815260026020526040808220805486861680855283852080549288167fffffffffffffffffffffffff00000000000000000000000000000000000000009384161790559589168452828420805482169096179095558383528054909416909355915190917ff8d49fc529812e9a7c5c50e69c20f0dccc0db8fa95c98bc58cc9a4f1c1299eaf91a260405173ffffffffffffffffffffffffffffffffffffffff8216907f9465fa0c962cc76958e6373a993326400c1c94f8be2fe3a952adfa7f60b2ea2690600090a2505050565b606060007fbb8310d486368db6bd6f849402fdd73ad53d316b5a4b2644ad6efe0f941286d860001b8d8d8d8d6040516126f6929190614132565b60405190819003812061271c949392918e908e908e908e908e908e908e90602001614142565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152919052805160209091012090507f19000000000000000000000000000000000000000000000000000000000000007f01000000000000000000000000000000000000000000000000000000000000006127f060007f47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a794692184660408051602081019390935282015230606082015260800160405160208183030381529060405280519060200120905090565b6040517fff0000000000000000000000000000000000000000000000000000000000000093841660208201529290911660218301526022820152604281018290526062016040516020818303038152906040529150509b9a5050505050505050505050565b61285d612b34565b612866816131ce565b60405173ffffffffffffffffffffffffffffffffffffffff8216907f5ac6c46c93c8d0e53714ba3b53db3e7c046da994313d7ed0d192028bc7c228b090600090a250565b6128b2612b34565b8060016003546128c29190614044565b101561292a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f475332303100000000000000000000000000000000000000000000000000000060448201526064016107ad565b73ffffffffffffffffffffffffffffffffffffffff821615801590612966575073ffffffffffffffffffffffffffffffffffffffff8216600114155b6129cc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f475332303300000000000000000000000000000000000000000000000000000060448201526064016107ad565b73ffffffffffffffffffffffffffffffffffffffff838116600090815260026020526040902054811690831614612a5f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f475332303500000000000000000000000000000000000000000000000000000060448201526064016107ad565b73ffffffffffffffffffffffffffffffffffffffff828116600081815260026020526040808220805488861684529183208054929095167fffffffffffffffffffffffff00000000000000000000000000000000000000009283161790945591815282549091169091556003805491612ad7836141bf565b909155505060405173ffffffffffffffffffffffffffffffffffffffff8316907ff8d49fc529812e9a7c5c50e69c20f0dccc0db8fa95c98bc58cc9a4f1c1299eaf90600090a28060045414612b2f57612b2f81611479565b505050565b333014612b9d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f475330333100000000000000000000000000000000000000000000000000000060448201526064016107ad565b565b600082600003612bb157506000611046565b6000612bbd8385613e34565b905082612bca8583614009565b14612bd457600080fd5b9392505050565b600080612be88385613ff1565b905083811015612bd457600080fd5b60006001836001811115612c0d57612c0d613e71565b03612c25576000808551602087018986f49050612c35565b600080855160208701888a87f190505b95945050505050565b600081831015612c4e5781612bd4565b5090919050565b600082821115612c6457600080fd5b60006111cc8385614044565b60008073ffffffffffffffffffffffffffffffffffffffff831615612c955782612c97565b325b905073ffffffffffffffffffffffffffffffffffffffff8416612d7657612cd63a8610612cc4573a612cc6565b855b612cd08989612bdb565b90612b9f565b60405190925073ffffffffffffffffffffffffffffffffffffffff82169083156108fc029084906000818181858888f19350505050612d71576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f475330313100000000000000000000000000000000000000000000000000000060448201526064016107ad565b612df7565b612d8485612cd08989612bdb565b9150612d91848284613469565b612df7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f475330313200000000000000000000000000000000000000000000000000000060448201526064016107ad565b5095945050505050565b60045415612e6b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f475332303000000000000000000000000000000000000000000000000000000060448201526064016107ad565b8151811115612ed6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f475332303100000000000000000000000000000000000000000000000000000060448201526064016107ad565b6001811015612f41576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f475332303200000000000000000000000000000000000000000000000000000060448201526064016107ad565b600160005b8351811015613176576000848281518110612f6357612f6361405b565b60200260200101519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614158015612fc1575073ffffffffffffffffffffffffffffffffffffffff8116600114155b8015612fe3575073ffffffffffffffffffffffffffffffffffffffff81163014155b801561301b57508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b613081576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f475332303300000000000000000000000000000000000000000000000000000060448201526064016107ad565b73ffffffffffffffffffffffffffffffffffffffff8181166000908152600260205260409020541615613110576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f475332303400000000000000000000000000000000000000000000000000000060448201526064016107ad565b73ffffffffffffffffffffffffffffffffffffffff928316600090815260026020526040902080547fffffffffffffffffffffffff000000000000000000000000000000000000000016938216939093179092558061316e81613d72565b915050612f46565b5073ffffffffffffffffffffffffffffffffffffffff16600090815260026020526040902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001660011790559051600355600455565b3073ffffffffffffffffffffffffffffffffffffffff82160361324d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f475334303000000000000000000000000000000000000000000000000000000060448201526064016107ad565b7f6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d555565b600160008190526020527fcc69885fda6bcc1a4ace058b4a62bf5e179ea78fd58a1ccd71c22cc9b688792f5473ffffffffffffffffffffffffffffffffffffffff161561331a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f475331303000000000000000000000000000000000000000000000000000000060448201526064016107ad565b6001600081905260208190527fcc69885fda6bcc1a4ace058b4a62bf5e179ea78fd58a1ccd71c22cc9b688792f80547fffffffffffffffffffffffff000000000000000000000000000000000000000016909117905573ffffffffffffffffffffffffffffffffffffffff82161561092f57813b6133f4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f475330303200000000000000000000000000000000000000000000000000000060448201526064016107ad565b6134038260008360015a612bf7565b61092f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f475330303000000000000000000000000000000000000000000000000000000060448201526064016107ad565b6040805173ffffffffffffffffffffffffffffffffffffffff841660248201526044808201849052825180830390910181526064909101909152602080820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001781528251600093929184919082896127105a03f13d8015613516576020811461351e5760009350613529565b819350613529565b600051158215171593505b5050509392505050565b73ffffffffffffffffffffffffffffffffffffffff8116811461355557600080fd5b50565b803561356381613533565b919050565b6000806040838503121561357b57600080fd5b823561358681613533565b946020939093013593505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f8301126135d457600080fd5b813567ffffffffffffffff808211156135ef576135ef613594565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190828211818310171561363557613635613594565b8160405283815286602085880101111561364e57600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806000806080858703121561368457600080fd5b84359350602085013567ffffffffffffffff808211156136a357600080fd5b6136af888389016135c3565b945060408701359150808211156136c557600080fd5b506136d2878288016135c3565b949793965093946060013593505050565b6000602082840312156136f557600080fd5b8135612bd481613533565b80356002811061356357600080fd5b6000806000806080858703121561372557600080fd5b843561373081613533565b935060208501359250604085013567ffffffffffffffff81111561375357600080fd5b61375f878288016135c3565b92505061376e60608601613700565b905092959194509250565b6000815180845260005b8181101561379f57602081850181015186830182015201613783565b818111156137b1576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b82151581526040602082015260006111cc6040830184613779565b6000806040838503121561381257600080fd5b50508035926020909101359150565b602081526000612bd46020830184613779565b60006020828403121561384657600080fd5b5035919050565b60008083601f84011261385f57600080fd5b50813567ffffffffffffffff81111561387757600080fd5b60208301915083602082850101111561388f57600080fd5b9250929050565b60008060008060008060008060008060006101408c8e0312156138b857600080fd5b6138c18c613558565b9a5060208c0135995067ffffffffffffffff8060408e013511156138e457600080fd5b6138f48e60408f01358f0161384d565b909a50985061390560608e01613700565b975060808d0135965060a08d0135955060c08d0135945061392860e08e01613558565b93506139376101008e01613558565b9250806101208e0135111561394b57600080fd5b5061395d8d6101208e01358e016135c3565b90509295989b509295989b9093969950565b60008060006060848603121561398457600080fd5b83359250602084013567ffffffffffffffff808211156139a357600080fd5b6139af878388016135c3565b935060408601359150808211156139c557600080fd5b506139d2868287016135c3565b9150509250925092565b600081518084526020808501945080840160005b83811015613a2257815173ffffffffffffffffffffffffffffffffffffffff16875295820195908201906001016139f0565b509495945050505050565b602081526000612bd460208301846139dc565b60008060408385031215613a5357600080fd5b8235613a5e81613533565b9150602083013567ffffffffffffffff811115613a7a57600080fd5b613a86858286016135c3565b9150509250929050565b6000806000806000806000806000806101008b8d031215613ab057600080fd5b8a3567ffffffffffffffff80821115613ac857600080fd5b818d0191508d601f830112613adc57600080fd5b813581811115613aeb57600080fd5b8e60208260051b8501011115613b0057600080fd5b60208381019d50909b508d01359950613b1b60408e01613558565b985060608d0135915080821115613b3157600080fd5b50613b3e8d828e0161384d565b9097509550613b51905060808c01613558565b9350613b5f60a08c01613558565b925060c08b01359150613b7460e08c01613558565b90509295989b9194979a5092959850565b604081526000613b9860408301856139dc565b905073ffffffffffffffffffffffffffffffffffffffff831660208301529392505050565b60008060008060008060008060008060006101408c8e031215613bdf57600080fd5b8b35613bea81613533565b9a5060208c0135995060408c013567ffffffffffffffff811115613c0d57600080fd5b613c198e828f0161384d565b909a509850613c2c905060608d01613700565b965060808c0135955060a08c0135945060c08c0135935060e08c0135613c5181613533565b92506101008c0135613c6281613533565b809250506101208c013590509295989b509295989b9093969950565b60008060408385031215613c9157600080fd5b8235613c9c81613533565b91506020830135613cac81613533565b809150509250929050565b600080600060608486031215613ccc57600080fd5b8335613cd781613533565b92506020840135613ce781613533565b91506040840135613cf781613533565b809150509250925092565b600080600060608486031215613d1757600080fd5b8335613d2281613533565b92506020840135613d3281613533565b929592945050506040919091013590565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203613da357613da3613d43565b5060010190565b604081526000613dbd6040830185613779565b8281036020840152612c358185613779565b600060208284031215613de157600080fd5b81517fffffffff0000000000000000000000000000000000000000000000000000000081168114612bd457600080fd5b600060ff821660ff841680821015613e2b57613e2b613d43565b90039392505050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613e6c57613e6c613d43565b500290565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60028110613ed7577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9052565b600061016073ffffffffffffffffffffffffffffffffffffffff8f1683528d60208401528060408401528b81840152506101808b8d828501376000818d850101527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8d01168301613f51606085018d613ea0565b8a60808501528960a08501528860c0850152613f8560e085018973ffffffffffffffffffffffffffffffffffffffff169052565b73ffffffffffffffffffffffffffffffffffffffff87166101008501528184820301610120850152613fb982820187613779565b92505050613fe061014083018473ffffffffffffffffffffffffffffffffffffffff169052565b9d9c50505050505050505050505050565b6000821982111561400457614004613d43565b500190565b60008261403f577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60008282101561405657614056613d43565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6080808252810185905260008660a08301825b888110156140da5782356140b081613533565b73ffffffffffffffffffffffffffffffffffffffff1682526020928301929091019060010161409d565b506020840196909652505073ffffffffffffffffffffffffffffffffffffffff9283166040820152911660609091015292915050565b60006020828403121561412257600080fd5b81518015158114612bd457600080fd5b8183823760009101908152919050565b6000610160820190508c825273ffffffffffffffffffffffffffffffffffffffff808d1660208401528b60408401528a6060840152614184608084018b613ea0565b60a083019890985260c082019690965260e0810194909452918516610100840152909316610120820152610140019190915295945050505050565b6000816141ce576141ce613d43565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019056fea164736f6c634300080f000a", +} + +// SafeABI is the input ABI used to generate the binding from. +// Deprecated: Use SafeMetaData.ABI instead. +var SafeABI = SafeMetaData.ABI + +// SafeBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use SafeMetaData.Bin instead. +var SafeBin = SafeMetaData.Bin + +// DeploySafe deploys a new Ethereum contract, binding an instance of Safe to it. +func DeploySafe(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Safe, error) { + parsed, err := SafeMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(SafeBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &Safe{SafeCaller: SafeCaller{contract: contract}, SafeTransactor: SafeTransactor{contract: contract}, SafeFilterer: SafeFilterer{contract: contract}}, nil +} + +// Safe is an auto generated Go binding around an Ethereum contract. +type Safe struct { + SafeCaller // Read-only binding to the contract + SafeTransactor // Write-only binding to the contract + SafeFilterer // Log filterer for contract events +} + +// SafeCaller is an auto generated read-only Go binding around an Ethereum contract. +type SafeCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SafeTransactor is an auto generated write-only Go binding around an Ethereum contract. +type SafeTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SafeFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type SafeFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SafeSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type SafeSession struct { + Contract *Safe // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// SafeCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type SafeCallerSession struct { + Contract *SafeCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// SafeTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type SafeTransactorSession struct { + Contract *SafeTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// SafeRaw is an auto generated low-level Go binding around an Ethereum contract. +type SafeRaw struct { + Contract *Safe // Generic contract binding to access the raw methods on +} + +// SafeCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type SafeCallerRaw struct { + Contract *SafeCaller // Generic read-only contract binding to access the raw methods on +} + +// SafeTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type SafeTransactorRaw struct { + Contract *SafeTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewSafe creates a new instance of Safe, bound to a specific deployed contract. +func NewSafe(address common.Address, backend bind.ContractBackend) (*Safe, error) { + contract, err := bindSafe(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &Safe{SafeCaller: SafeCaller{contract: contract}, SafeTransactor: SafeTransactor{contract: contract}, SafeFilterer: SafeFilterer{contract: contract}}, nil +} + +// NewSafeCaller creates a new read-only instance of Safe, bound to a specific deployed contract. +func NewSafeCaller(address common.Address, caller bind.ContractCaller) (*SafeCaller, error) { + contract, err := bindSafe(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &SafeCaller{contract: contract}, nil +} + +// NewSafeTransactor creates a new write-only instance of Safe, bound to a specific deployed contract. +func NewSafeTransactor(address common.Address, transactor bind.ContractTransactor) (*SafeTransactor, error) { + contract, err := bindSafe(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &SafeTransactor{contract: contract}, nil +} + +// NewSafeFilterer creates a new log filterer instance of Safe, bound to a specific deployed contract. +func NewSafeFilterer(address common.Address, filterer bind.ContractFilterer) (*SafeFilterer, error) { + contract, err := bindSafe(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &SafeFilterer{contract: contract}, nil +} + +// bindSafe binds a generic wrapper to an already deployed contract. +func bindSafe(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(SafeABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Safe *SafeRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Safe.Contract.SafeCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Safe *SafeRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Safe.Contract.SafeTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Safe *SafeRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Safe.Contract.SafeTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Safe *SafeCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Safe.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Safe *SafeTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Safe.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Safe *SafeTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Safe.Contract.contract.Transact(opts, method, params...) +} + +// VERSION is a free data retrieval call binding the contract method 0xffa1ad74. +// +// Solidity: function VERSION() view returns(string) +func (_Safe *SafeCaller) VERSION(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _Safe.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 0xffa1ad74. +// +// Solidity: function VERSION() view returns(string) +func (_Safe *SafeSession) VERSION() (string, error) { + return _Safe.Contract.VERSION(&_Safe.CallOpts) +} + +// VERSION is a free data retrieval call binding the contract method 0xffa1ad74. +// +// Solidity: function VERSION() view returns(string) +func (_Safe *SafeCallerSession) VERSION() (string, error) { + return _Safe.Contract.VERSION(&_Safe.CallOpts) +} + +// ApprovedHashes is a free data retrieval call binding the contract method 0x7d832974. +// +// Solidity: function approvedHashes(address , bytes32 ) view returns(uint256) +func (_Safe *SafeCaller) ApprovedHashes(opts *bind.CallOpts, arg0 common.Address, arg1 [32]byte) (*big.Int, error) { + var out []interface{} + err := _Safe.contract.Call(opts, &out, "approvedHashes", arg0, arg1) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// ApprovedHashes is a free data retrieval call binding the contract method 0x7d832974. +// +// Solidity: function approvedHashes(address , bytes32 ) view returns(uint256) +func (_Safe *SafeSession) ApprovedHashes(arg0 common.Address, arg1 [32]byte) (*big.Int, error) { + return _Safe.Contract.ApprovedHashes(&_Safe.CallOpts, arg0, arg1) +} + +// ApprovedHashes is a free data retrieval call binding the contract method 0x7d832974. +// +// Solidity: function approvedHashes(address , bytes32 ) view returns(uint256) +func (_Safe *SafeCallerSession) ApprovedHashes(arg0 common.Address, arg1 [32]byte) (*big.Int, error) { + return _Safe.Contract.ApprovedHashes(&_Safe.CallOpts, arg0, arg1) +} + +// CheckNSignatures is a free data retrieval call binding the contract method 0x12fb68e0. +// +// Solidity: function checkNSignatures(bytes32 dataHash, bytes data, bytes signatures, uint256 requiredSignatures) view returns() +func (_Safe *SafeCaller) CheckNSignatures(opts *bind.CallOpts, dataHash [32]byte, data []byte, signatures []byte, requiredSignatures *big.Int) error { + var out []interface{} + err := _Safe.contract.Call(opts, &out, "checkNSignatures", dataHash, data, signatures, requiredSignatures) + + if err != nil { + return err + } + + return err + +} + +// CheckNSignatures is a free data retrieval call binding the contract method 0x12fb68e0. +// +// Solidity: function checkNSignatures(bytes32 dataHash, bytes data, bytes signatures, uint256 requiredSignatures) view returns() +func (_Safe *SafeSession) CheckNSignatures(dataHash [32]byte, data []byte, signatures []byte, requiredSignatures *big.Int) error { + return _Safe.Contract.CheckNSignatures(&_Safe.CallOpts, dataHash, data, signatures, requiredSignatures) +} + +// CheckNSignatures is a free data retrieval call binding the contract method 0x12fb68e0. +// +// Solidity: function checkNSignatures(bytes32 dataHash, bytes data, bytes signatures, uint256 requiredSignatures) view returns() +func (_Safe *SafeCallerSession) CheckNSignatures(dataHash [32]byte, data []byte, signatures []byte, requiredSignatures *big.Int) error { + return _Safe.Contract.CheckNSignatures(&_Safe.CallOpts, dataHash, data, signatures, requiredSignatures) +} + +// CheckSignatures is a free data retrieval call binding the contract method 0x934f3a11. +// +// Solidity: function checkSignatures(bytes32 dataHash, bytes data, bytes signatures) view returns() +func (_Safe *SafeCaller) CheckSignatures(opts *bind.CallOpts, dataHash [32]byte, data []byte, signatures []byte) error { + var out []interface{} + err := _Safe.contract.Call(opts, &out, "checkSignatures", dataHash, data, signatures) + + if err != nil { + return err + } + + return err + +} + +// CheckSignatures is a free data retrieval call binding the contract method 0x934f3a11. +// +// Solidity: function checkSignatures(bytes32 dataHash, bytes data, bytes signatures) view returns() +func (_Safe *SafeSession) CheckSignatures(dataHash [32]byte, data []byte, signatures []byte) error { + return _Safe.Contract.CheckSignatures(&_Safe.CallOpts, dataHash, data, signatures) +} + +// CheckSignatures is a free data retrieval call binding the contract method 0x934f3a11. +// +// Solidity: function checkSignatures(bytes32 dataHash, bytes data, bytes signatures) view returns() +func (_Safe *SafeCallerSession) CheckSignatures(dataHash [32]byte, data []byte, signatures []byte) error { + return _Safe.Contract.CheckSignatures(&_Safe.CallOpts, dataHash, data, signatures) +} + +// DomainSeparator is a free data retrieval call binding the contract method 0xf698da25. +// +// Solidity: function domainSeparator() view returns(bytes32) +func (_Safe *SafeCaller) DomainSeparator(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _Safe.contract.Call(opts, &out, "domainSeparator") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// DomainSeparator is a free data retrieval call binding the contract method 0xf698da25. +// +// Solidity: function domainSeparator() view returns(bytes32) +func (_Safe *SafeSession) DomainSeparator() ([32]byte, error) { + return _Safe.Contract.DomainSeparator(&_Safe.CallOpts) +} + +// DomainSeparator is a free data retrieval call binding the contract method 0xf698da25. +// +// Solidity: function domainSeparator() view returns(bytes32) +func (_Safe *SafeCallerSession) DomainSeparator() ([32]byte, error) { + return _Safe.Contract.DomainSeparator(&_Safe.CallOpts) +} + +// EncodeTransactionData is a free data retrieval call binding the contract method 0xe86637db. +// +// Solidity: function encodeTransactionData(address to, uint256 value, bytes data, uint8 operation, uint256 safeTxGas, uint256 baseGas, uint256 gasPrice, address gasToken, address refundReceiver, uint256 _nonce) view returns(bytes) +func (_Safe *SafeCaller) EncodeTransactionData(opts *bind.CallOpts, to common.Address, value *big.Int, data []byte, operation uint8, safeTxGas *big.Int, baseGas *big.Int, gasPrice *big.Int, gasToken common.Address, refundReceiver common.Address, _nonce *big.Int) ([]byte, error) { + var out []interface{} + err := _Safe.contract.Call(opts, &out, "encodeTransactionData", to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +// EncodeTransactionData is a free data retrieval call binding the contract method 0xe86637db. +// +// Solidity: function encodeTransactionData(address to, uint256 value, bytes data, uint8 operation, uint256 safeTxGas, uint256 baseGas, uint256 gasPrice, address gasToken, address refundReceiver, uint256 _nonce) view returns(bytes) +func (_Safe *SafeSession) EncodeTransactionData(to common.Address, value *big.Int, data []byte, operation uint8, safeTxGas *big.Int, baseGas *big.Int, gasPrice *big.Int, gasToken common.Address, refundReceiver common.Address, _nonce *big.Int) ([]byte, error) { + return _Safe.Contract.EncodeTransactionData(&_Safe.CallOpts, to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce) +} + +// EncodeTransactionData is a free data retrieval call binding the contract method 0xe86637db. +// +// Solidity: function encodeTransactionData(address to, uint256 value, bytes data, uint8 operation, uint256 safeTxGas, uint256 baseGas, uint256 gasPrice, address gasToken, address refundReceiver, uint256 _nonce) view returns(bytes) +func (_Safe *SafeCallerSession) EncodeTransactionData(to common.Address, value *big.Int, data []byte, operation uint8, safeTxGas *big.Int, baseGas *big.Int, gasPrice *big.Int, gasToken common.Address, refundReceiver common.Address, _nonce *big.Int) ([]byte, error) { + return _Safe.Contract.EncodeTransactionData(&_Safe.CallOpts, to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce) +} + +// GetChainId is a free data retrieval call binding the contract method 0x3408e470. +// +// Solidity: function getChainId() view returns(uint256) +func (_Safe *SafeCaller) GetChainId(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _Safe.contract.Call(opts, &out, "getChainId") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetChainId is a free data retrieval call binding the contract method 0x3408e470. +// +// Solidity: function getChainId() view returns(uint256) +func (_Safe *SafeSession) GetChainId() (*big.Int, error) { + return _Safe.Contract.GetChainId(&_Safe.CallOpts) +} + +// GetChainId is a free data retrieval call binding the contract method 0x3408e470. +// +// Solidity: function getChainId() view returns(uint256) +func (_Safe *SafeCallerSession) GetChainId() (*big.Int, error) { + return _Safe.Contract.GetChainId(&_Safe.CallOpts) +} + +// GetModulesPaginated is a free data retrieval call binding the contract method 0xcc2f8452. +// +// Solidity: function getModulesPaginated(address start, uint256 pageSize) view returns(address[] array, address next) +func (_Safe *SafeCaller) GetModulesPaginated(opts *bind.CallOpts, start common.Address, pageSize *big.Int) (struct { + Array []common.Address + Next common.Address +}, error) { + var out []interface{} + err := _Safe.contract.Call(opts, &out, "getModulesPaginated", start, pageSize) + + outstruct := new(struct { + Array []common.Address + Next common.Address + }) + if err != nil { + return *outstruct, err + } + + outstruct.Array = *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + outstruct.Next = *abi.ConvertType(out[1], new(common.Address)).(*common.Address) + + return *outstruct, err + +} + +// GetModulesPaginated is a free data retrieval call binding the contract method 0xcc2f8452. +// +// Solidity: function getModulesPaginated(address start, uint256 pageSize) view returns(address[] array, address next) +func (_Safe *SafeSession) GetModulesPaginated(start common.Address, pageSize *big.Int) (struct { + Array []common.Address + Next common.Address +}, error) { + return _Safe.Contract.GetModulesPaginated(&_Safe.CallOpts, start, pageSize) +} + +// GetModulesPaginated is a free data retrieval call binding the contract method 0xcc2f8452. +// +// Solidity: function getModulesPaginated(address start, uint256 pageSize) view returns(address[] array, address next) +func (_Safe *SafeCallerSession) GetModulesPaginated(start common.Address, pageSize *big.Int) (struct { + Array []common.Address + Next common.Address +}, error) { + return _Safe.Contract.GetModulesPaginated(&_Safe.CallOpts, start, pageSize) +} + +// GetOwners is a free data retrieval call binding the contract method 0xa0e67e2b. +// +// Solidity: function getOwners() view returns(address[]) +func (_Safe *SafeCaller) GetOwners(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _Safe.contract.Call(opts, &out, "getOwners") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +// GetOwners is a free data retrieval call binding the contract method 0xa0e67e2b. +// +// Solidity: function getOwners() view returns(address[]) +func (_Safe *SafeSession) GetOwners() ([]common.Address, error) { + return _Safe.Contract.GetOwners(&_Safe.CallOpts) +} + +// GetOwners is a free data retrieval call binding the contract method 0xa0e67e2b. +// +// Solidity: function getOwners() view returns(address[]) +func (_Safe *SafeCallerSession) GetOwners() ([]common.Address, error) { + return _Safe.Contract.GetOwners(&_Safe.CallOpts) +} + +// GetStorageAt is a free data retrieval call binding the contract method 0x5624b25b. +// +// Solidity: function getStorageAt(uint256 offset, uint256 length) view returns(bytes) +func (_Safe *SafeCaller) GetStorageAt(opts *bind.CallOpts, offset *big.Int, length *big.Int) ([]byte, error) { + var out []interface{} + err := _Safe.contract.Call(opts, &out, "getStorageAt", offset, length) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +// GetStorageAt is a free data retrieval call binding the contract method 0x5624b25b. +// +// Solidity: function getStorageAt(uint256 offset, uint256 length) view returns(bytes) +func (_Safe *SafeSession) GetStorageAt(offset *big.Int, length *big.Int) ([]byte, error) { + return _Safe.Contract.GetStorageAt(&_Safe.CallOpts, offset, length) +} + +// GetStorageAt is a free data retrieval call binding the contract method 0x5624b25b. +// +// Solidity: function getStorageAt(uint256 offset, uint256 length) view returns(bytes) +func (_Safe *SafeCallerSession) GetStorageAt(offset *big.Int, length *big.Int) ([]byte, error) { + return _Safe.Contract.GetStorageAt(&_Safe.CallOpts, offset, length) +} + +// GetThreshold is a free data retrieval call binding the contract method 0xe75235b8. +// +// Solidity: function getThreshold() view returns(uint256) +func (_Safe *SafeCaller) GetThreshold(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _Safe.contract.Call(opts, &out, "getThreshold") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetThreshold is a free data retrieval call binding the contract method 0xe75235b8. +// +// Solidity: function getThreshold() view returns(uint256) +func (_Safe *SafeSession) GetThreshold() (*big.Int, error) { + return _Safe.Contract.GetThreshold(&_Safe.CallOpts) +} + +// GetThreshold is a free data retrieval call binding the contract method 0xe75235b8. +// +// Solidity: function getThreshold() view returns(uint256) +func (_Safe *SafeCallerSession) GetThreshold() (*big.Int, error) { + return _Safe.Contract.GetThreshold(&_Safe.CallOpts) +} + +// GetTransactionHash is a free data retrieval call binding the contract method 0xd8d11f78. +// +// Solidity: function getTransactionHash(address to, uint256 value, bytes data, uint8 operation, uint256 safeTxGas, uint256 baseGas, uint256 gasPrice, address gasToken, address refundReceiver, uint256 _nonce) view returns(bytes32) +func (_Safe *SafeCaller) GetTransactionHash(opts *bind.CallOpts, to common.Address, value *big.Int, data []byte, operation uint8, safeTxGas *big.Int, baseGas *big.Int, gasPrice *big.Int, gasToken common.Address, refundReceiver common.Address, _nonce *big.Int) ([32]byte, error) { + var out []interface{} + err := _Safe.contract.Call(opts, &out, "getTransactionHash", to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// GetTransactionHash is a free data retrieval call binding the contract method 0xd8d11f78. +// +// Solidity: function getTransactionHash(address to, uint256 value, bytes data, uint8 operation, uint256 safeTxGas, uint256 baseGas, uint256 gasPrice, address gasToken, address refundReceiver, uint256 _nonce) view returns(bytes32) +func (_Safe *SafeSession) GetTransactionHash(to common.Address, value *big.Int, data []byte, operation uint8, safeTxGas *big.Int, baseGas *big.Int, gasPrice *big.Int, gasToken common.Address, refundReceiver common.Address, _nonce *big.Int) ([32]byte, error) { + return _Safe.Contract.GetTransactionHash(&_Safe.CallOpts, to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce) +} + +// GetTransactionHash is a free data retrieval call binding the contract method 0xd8d11f78. +// +// Solidity: function getTransactionHash(address to, uint256 value, bytes data, uint8 operation, uint256 safeTxGas, uint256 baseGas, uint256 gasPrice, address gasToken, address refundReceiver, uint256 _nonce) view returns(bytes32) +func (_Safe *SafeCallerSession) GetTransactionHash(to common.Address, value *big.Int, data []byte, operation uint8, safeTxGas *big.Int, baseGas *big.Int, gasPrice *big.Int, gasToken common.Address, refundReceiver common.Address, _nonce *big.Int) ([32]byte, error) { + return _Safe.Contract.GetTransactionHash(&_Safe.CallOpts, to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce) +} + +// IsModuleEnabled is a free data retrieval call binding the contract method 0x2d9ad53d. +// +// Solidity: function isModuleEnabled(address module) view returns(bool) +func (_Safe *SafeCaller) IsModuleEnabled(opts *bind.CallOpts, module common.Address) (bool, error) { + var out []interface{} + err := _Safe.contract.Call(opts, &out, "isModuleEnabled", module) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsModuleEnabled is a free data retrieval call binding the contract method 0x2d9ad53d. +// +// Solidity: function isModuleEnabled(address module) view returns(bool) +func (_Safe *SafeSession) IsModuleEnabled(module common.Address) (bool, error) { + return _Safe.Contract.IsModuleEnabled(&_Safe.CallOpts, module) +} + +// IsModuleEnabled is a free data retrieval call binding the contract method 0x2d9ad53d. +// +// Solidity: function isModuleEnabled(address module) view returns(bool) +func (_Safe *SafeCallerSession) IsModuleEnabled(module common.Address) (bool, error) { + return _Safe.Contract.IsModuleEnabled(&_Safe.CallOpts, module) +} + +// IsOwner is a free data retrieval call binding the contract method 0x2f54bf6e. +// +// Solidity: function isOwner(address owner) view returns(bool) +func (_Safe *SafeCaller) IsOwner(opts *bind.CallOpts, owner common.Address) (bool, error) { + var out []interface{} + err := _Safe.contract.Call(opts, &out, "isOwner", owner) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsOwner is a free data retrieval call binding the contract method 0x2f54bf6e. +// +// Solidity: function isOwner(address owner) view returns(bool) +func (_Safe *SafeSession) IsOwner(owner common.Address) (bool, error) { + return _Safe.Contract.IsOwner(&_Safe.CallOpts, owner) +} + +// IsOwner is a free data retrieval call binding the contract method 0x2f54bf6e. +// +// Solidity: function isOwner(address owner) view returns(bool) +func (_Safe *SafeCallerSession) IsOwner(owner common.Address) (bool, error) { + return _Safe.Contract.IsOwner(&_Safe.CallOpts, owner) +} + +// Nonce is a free data retrieval call binding the contract method 0xaffed0e0. +// +// Solidity: function nonce() view returns(uint256) +func (_Safe *SafeCaller) Nonce(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _Safe.contract.Call(opts, &out, "nonce") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Nonce is a free data retrieval call binding the contract method 0xaffed0e0. +// +// Solidity: function nonce() view returns(uint256) +func (_Safe *SafeSession) Nonce() (*big.Int, error) { + return _Safe.Contract.Nonce(&_Safe.CallOpts) +} + +// Nonce is a free data retrieval call binding the contract method 0xaffed0e0. +// +// Solidity: function nonce() view returns(uint256) +func (_Safe *SafeCallerSession) Nonce() (*big.Int, error) { + return _Safe.Contract.Nonce(&_Safe.CallOpts) +} + +// SignedMessages is a free data retrieval call binding the contract method 0x5ae6bd37. +// +// Solidity: function signedMessages(bytes32 ) view returns(uint256) +func (_Safe *SafeCaller) SignedMessages(opts *bind.CallOpts, arg0 [32]byte) (*big.Int, error) { + var out []interface{} + err := _Safe.contract.Call(opts, &out, "signedMessages", arg0) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// SignedMessages is a free data retrieval call binding the contract method 0x5ae6bd37. +// +// Solidity: function signedMessages(bytes32 ) view returns(uint256) +func (_Safe *SafeSession) SignedMessages(arg0 [32]byte) (*big.Int, error) { + return _Safe.Contract.SignedMessages(&_Safe.CallOpts, arg0) +} + +// SignedMessages is a free data retrieval call binding the contract method 0x5ae6bd37. +// +// Solidity: function signedMessages(bytes32 ) view returns(uint256) +func (_Safe *SafeCallerSession) SignedMessages(arg0 [32]byte) (*big.Int, error) { + return _Safe.Contract.SignedMessages(&_Safe.CallOpts, arg0) +} + +// AddOwnerWithThreshold is a paid mutator transaction binding the contract method 0x0d582f13. +// +// Solidity: function addOwnerWithThreshold(address owner, uint256 _threshold) returns() +func (_Safe *SafeTransactor) AddOwnerWithThreshold(opts *bind.TransactOpts, owner common.Address, _threshold *big.Int) (*types.Transaction, error) { + return _Safe.contract.Transact(opts, "addOwnerWithThreshold", owner, _threshold) +} + +// AddOwnerWithThreshold is a paid mutator transaction binding the contract method 0x0d582f13. +// +// Solidity: function addOwnerWithThreshold(address owner, uint256 _threshold) returns() +func (_Safe *SafeSession) AddOwnerWithThreshold(owner common.Address, _threshold *big.Int) (*types.Transaction, error) { + return _Safe.Contract.AddOwnerWithThreshold(&_Safe.TransactOpts, owner, _threshold) +} + +// AddOwnerWithThreshold is a paid mutator transaction binding the contract method 0x0d582f13. +// +// Solidity: function addOwnerWithThreshold(address owner, uint256 _threshold) returns() +func (_Safe *SafeTransactorSession) AddOwnerWithThreshold(owner common.Address, _threshold *big.Int) (*types.Transaction, error) { + return _Safe.Contract.AddOwnerWithThreshold(&_Safe.TransactOpts, owner, _threshold) +} + +// ApproveHash is a paid mutator transaction binding the contract method 0xd4d9bdcd. +// +// Solidity: function approveHash(bytes32 hashToApprove) returns() +func (_Safe *SafeTransactor) ApproveHash(opts *bind.TransactOpts, hashToApprove [32]byte) (*types.Transaction, error) { + return _Safe.contract.Transact(opts, "approveHash", hashToApprove) +} + +// ApproveHash is a paid mutator transaction binding the contract method 0xd4d9bdcd. +// +// Solidity: function approveHash(bytes32 hashToApprove) returns() +func (_Safe *SafeSession) ApproveHash(hashToApprove [32]byte) (*types.Transaction, error) { + return _Safe.Contract.ApproveHash(&_Safe.TransactOpts, hashToApprove) +} + +// ApproveHash is a paid mutator transaction binding the contract method 0xd4d9bdcd. +// +// Solidity: function approveHash(bytes32 hashToApprove) returns() +func (_Safe *SafeTransactorSession) ApproveHash(hashToApprove [32]byte) (*types.Transaction, error) { + return _Safe.Contract.ApproveHash(&_Safe.TransactOpts, hashToApprove) +} + +// ChangeThreshold is a paid mutator transaction binding the contract method 0x694e80c3. +// +// Solidity: function changeThreshold(uint256 _threshold) returns() +func (_Safe *SafeTransactor) ChangeThreshold(opts *bind.TransactOpts, _threshold *big.Int) (*types.Transaction, error) { + return _Safe.contract.Transact(opts, "changeThreshold", _threshold) +} + +// ChangeThreshold is a paid mutator transaction binding the contract method 0x694e80c3. +// +// Solidity: function changeThreshold(uint256 _threshold) returns() +func (_Safe *SafeSession) ChangeThreshold(_threshold *big.Int) (*types.Transaction, error) { + return _Safe.Contract.ChangeThreshold(&_Safe.TransactOpts, _threshold) +} + +// ChangeThreshold is a paid mutator transaction binding the contract method 0x694e80c3. +// +// Solidity: function changeThreshold(uint256 _threshold) returns() +func (_Safe *SafeTransactorSession) ChangeThreshold(_threshold *big.Int) (*types.Transaction, error) { + return _Safe.Contract.ChangeThreshold(&_Safe.TransactOpts, _threshold) +} + +// DisableModule is a paid mutator transaction binding the contract method 0xe009cfde. +// +// Solidity: function disableModule(address prevModule, address module) returns() +func (_Safe *SafeTransactor) DisableModule(opts *bind.TransactOpts, prevModule common.Address, module common.Address) (*types.Transaction, error) { + return _Safe.contract.Transact(opts, "disableModule", prevModule, module) +} + +// DisableModule is a paid mutator transaction binding the contract method 0xe009cfde. +// +// Solidity: function disableModule(address prevModule, address module) returns() +func (_Safe *SafeSession) DisableModule(prevModule common.Address, module common.Address) (*types.Transaction, error) { + return _Safe.Contract.DisableModule(&_Safe.TransactOpts, prevModule, module) +} + +// DisableModule is a paid mutator transaction binding the contract method 0xe009cfde. +// +// Solidity: function disableModule(address prevModule, address module) returns() +func (_Safe *SafeTransactorSession) DisableModule(prevModule common.Address, module common.Address) (*types.Transaction, error) { + return _Safe.Contract.DisableModule(&_Safe.TransactOpts, prevModule, module) +} + +// EnableModule is a paid mutator transaction binding the contract method 0x610b5925. +// +// Solidity: function enableModule(address module) returns() +func (_Safe *SafeTransactor) EnableModule(opts *bind.TransactOpts, module common.Address) (*types.Transaction, error) { + return _Safe.contract.Transact(opts, "enableModule", module) +} + +// EnableModule is a paid mutator transaction binding the contract method 0x610b5925. +// +// Solidity: function enableModule(address module) returns() +func (_Safe *SafeSession) EnableModule(module common.Address) (*types.Transaction, error) { + return _Safe.Contract.EnableModule(&_Safe.TransactOpts, module) +} + +// EnableModule is a paid mutator transaction binding the contract method 0x610b5925. +// +// Solidity: function enableModule(address module) returns() +func (_Safe *SafeTransactorSession) EnableModule(module common.Address) (*types.Transaction, error) { + return _Safe.Contract.EnableModule(&_Safe.TransactOpts, module) +} + +// ExecTransaction is a paid mutator transaction binding the contract method 0x6a761202. +// +// Solidity: function execTransaction(address to, uint256 value, bytes data, uint8 operation, uint256 safeTxGas, uint256 baseGas, uint256 gasPrice, address gasToken, address refundReceiver, bytes signatures) payable returns(bool success) +func (_Safe *SafeTransactor) ExecTransaction(opts *bind.TransactOpts, to common.Address, value *big.Int, data []byte, operation uint8, safeTxGas *big.Int, baseGas *big.Int, gasPrice *big.Int, gasToken common.Address, refundReceiver common.Address, signatures []byte) (*types.Transaction, error) { + return _Safe.contract.Transact(opts, "execTransaction", to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, signatures) +} + +// ExecTransaction is a paid mutator transaction binding the contract method 0x6a761202. +// +// Solidity: function execTransaction(address to, uint256 value, bytes data, uint8 operation, uint256 safeTxGas, uint256 baseGas, uint256 gasPrice, address gasToken, address refundReceiver, bytes signatures) payable returns(bool success) +func (_Safe *SafeSession) ExecTransaction(to common.Address, value *big.Int, data []byte, operation uint8, safeTxGas *big.Int, baseGas *big.Int, gasPrice *big.Int, gasToken common.Address, refundReceiver common.Address, signatures []byte) (*types.Transaction, error) { + return _Safe.Contract.ExecTransaction(&_Safe.TransactOpts, to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, signatures) +} + +// ExecTransaction is a paid mutator transaction binding the contract method 0x6a761202. +// +// Solidity: function execTransaction(address to, uint256 value, bytes data, uint8 operation, uint256 safeTxGas, uint256 baseGas, uint256 gasPrice, address gasToken, address refundReceiver, bytes signatures) payable returns(bool success) +func (_Safe *SafeTransactorSession) ExecTransaction(to common.Address, value *big.Int, data []byte, operation uint8, safeTxGas *big.Int, baseGas *big.Int, gasPrice *big.Int, gasToken common.Address, refundReceiver common.Address, signatures []byte) (*types.Transaction, error) { + return _Safe.Contract.ExecTransaction(&_Safe.TransactOpts, to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, signatures) +} + +// ExecTransactionFromModule is a paid mutator transaction binding the contract method 0x468721a7. +// +// Solidity: function execTransactionFromModule(address to, uint256 value, bytes data, uint8 operation) returns(bool success) +func (_Safe *SafeTransactor) ExecTransactionFromModule(opts *bind.TransactOpts, to common.Address, value *big.Int, data []byte, operation uint8) (*types.Transaction, error) { + return _Safe.contract.Transact(opts, "execTransactionFromModule", to, value, data, operation) +} + +// ExecTransactionFromModule is a paid mutator transaction binding the contract method 0x468721a7. +// +// Solidity: function execTransactionFromModule(address to, uint256 value, bytes data, uint8 operation) returns(bool success) +func (_Safe *SafeSession) ExecTransactionFromModule(to common.Address, value *big.Int, data []byte, operation uint8) (*types.Transaction, error) { + return _Safe.Contract.ExecTransactionFromModule(&_Safe.TransactOpts, to, value, data, operation) +} + +// ExecTransactionFromModule is a paid mutator transaction binding the contract method 0x468721a7. +// +// Solidity: function execTransactionFromModule(address to, uint256 value, bytes data, uint8 operation) returns(bool success) +func (_Safe *SafeTransactorSession) ExecTransactionFromModule(to common.Address, value *big.Int, data []byte, operation uint8) (*types.Transaction, error) { + return _Safe.Contract.ExecTransactionFromModule(&_Safe.TransactOpts, to, value, data, operation) +} + +// ExecTransactionFromModuleReturnData is a paid mutator transaction binding the contract method 0x5229073f. +// +// Solidity: function execTransactionFromModuleReturnData(address to, uint256 value, bytes data, uint8 operation) returns(bool success, bytes returnData) +func (_Safe *SafeTransactor) ExecTransactionFromModuleReturnData(opts *bind.TransactOpts, to common.Address, value *big.Int, data []byte, operation uint8) (*types.Transaction, error) { + return _Safe.contract.Transact(opts, "execTransactionFromModuleReturnData", to, value, data, operation) +} + +// ExecTransactionFromModuleReturnData is a paid mutator transaction binding the contract method 0x5229073f. +// +// Solidity: function execTransactionFromModuleReturnData(address to, uint256 value, bytes data, uint8 operation) returns(bool success, bytes returnData) +func (_Safe *SafeSession) ExecTransactionFromModuleReturnData(to common.Address, value *big.Int, data []byte, operation uint8) (*types.Transaction, error) { + return _Safe.Contract.ExecTransactionFromModuleReturnData(&_Safe.TransactOpts, to, value, data, operation) +} + +// ExecTransactionFromModuleReturnData is a paid mutator transaction binding the contract method 0x5229073f. +// +// Solidity: function execTransactionFromModuleReturnData(address to, uint256 value, bytes data, uint8 operation) returns(bool success, bytes returnData) +func (_Safe *SafeTransactorSession) ExecTransactionFromModuleReturnData(to common.Address, value *big.Int, data []byte, operation uint8) (*types.Transaction, error) { + return _Safe.Contract.ExecTransactionFromModuleReturnData(&_Safe.TransactOpts, to, value, data, operation) +} + +// RemoveOwner is a paid mutator transaction binding the contract method 0xf8dc5dd9. +// +// Solidity: function removeOwner(address prevOwner, address owner, uint256 _threshold) returns() +func (_Safe *SafeTransactor) RemoveOwner(opts *bind.TransactOpts, prevOwner common.Address, owner common.Address, _threshold *big.Int) (*types.Transaction, error) { + return _Safe.contract.Transact(opts, "removeOwner", prevOwner, owner, _threshold) +} + +// RemoveOwner is a paid mutator transaction binding the contract method 0xf8dc5dd9. +// +// Solidity: function removeOwner(address prevOwner, address owner, uint256 _threshold) returns() +func (_Safe *SafeSession) RemoveOwner(prevOwner common.Address, owner common.Address, _threshold *big.Int) (*types.Transaction, error) { + return _Safe.Contract.RemoveOwner(&_Safe.TransactOpts, prevOwner, owner, _threshold) +} + +// RemoveOwner is a paid mutator transaction binding the contract method 0xf8dc5dd9. +// +// Solidity: function removeOwner(address prevOwner, address owner, uint256 _threshold) returns() +func (_Safe *SafeTransactorSession) RemoveOwner(prevOwner common.Address, owner common.Address, _threshold *big.Int) (*types.Transaction, error) { + return _Safe.Contract.RemoveOwner(&_Safe.TransactOpts, prevOwner, owner, _threshold) +} + +// SetFallbackHandler is a paid mutator transaction binding the contract method 0xf08a0323. +// +// Solidity: function setFallbackHandler(address handler) returns() +func (_Safe *SafeTransactor) SetFallbackHandler(opts *bind.TransactOpts, handler common.Address) (*types.Transaction, error) { + return _Safe.contract.Transact(opts, "setFallbackHandler", handler) +} + +// SetFallbackHandler is a paid mutator transaction binding the contract method 0xf08a0323. +// +// Solidity: function setFallbackHandler(address handler) returns() +func (_Safe *SafeSession) SetFallbackHandler(handler common.Address) (*types.Transaction, error) { + return _Safe.Contract.SetFallbackHandler(&_Safe.TransactOpts, handler) +} + +// SetFallbackHandler is a paid mutator transaction binding the contract method 0xf08a0323. +// +// Solidity: function setFallbackHandler(address handler) returns() +func (_Safe *SafeTransactorSession) SetFallbackHandler(handler common.Address) (*types.Transaction, error) { + return _Safe.Contract.SetFallbackHandler(&_Safe.TransactOpts, handler) +} + +// SetGuard is a paid mutator transaction binding the contract method 0xe19a9dd9. +// +// Solidity: function setGuard(address guard) returns() +func (_Safe *SafeTransactor) SetGuard(opts *bind.TransactOpts, guard common.Address) (*types.Transaction, error) { + return _Safe.contract.Transact(opts, "setGuard", guard) +} + +// SetGuard is a paid mutator transaction binding the contract method 0xe19a9dd9. +// +// Solidity: function setGuard(address guard) returns() +func (_Safe *SafeSession) SetGuard(guard common.Address) (*types.Transaction, error) { + return _Safe.Contract.SetGuard(&_Safe.TransactOpts, guard) +} + +// SetGuard is a paid mutator transaction binding the contract method 0xe19a9dd9. +// +// Solidity: function setGuard(address guard) returns() +func (_Safe *SafeTransactorSession) SetGuard(guard common.Address) (*types.Transaction, error) { + return _Safe.Contract.SetGuard(&_Safe.TransactOpts, guard) +} + +// Setup is a paid mutator transaction binding the contract method 0xb63e800d. +// +// Solidity: function setup(address[] _owners, uint256 _threshold, address to, bytes data, address fallbackHandler, address paymentToken, uint256 payment, address paymentReceiver) returns() +func (_Safe *SafeTransactor) Setup(opts *bind.TransactOpts, _owners []common.Address, _threshold *big.Int, to common.Address, data []byte, fallbackHandler common.Address, paymentToken common.Address, payment *big.Int, paymentReceiver common.Address) (*types.Transaction, error) { + return _Safe.contract.Transact(opts, "setup", _owners, _threshold, to, data, fallbackHandler, paymentToken, payment, paymentReceiver) +} + +// Setup is a paid mutator transaction binding the contract method 0xb63e800d. +// +// Solidity: function setup(address[] _owners, uint256 _threshold, address to, bytes data, address fallbackHandler, address paymentToken, uint256 payment, address paymentReceiver) returns() +func (_Safe *SafeSession) Setup(_owners []common.Address, _threshold *big.Int, to common.Address, data []byte, fallbackHandler common.Address, paymentToken common.Address, payment *big.Int, paymentReceiver common.Address) (*types.Transaction, error) { + return _Safe.Contract.Setup(&_Safe.TransactOpts, _owners, _threshold, to, data, fallbackHandler, paymentToken, payment, paymentReceiver) +} + +// Setup is a paid mutator transaction binding the contract method 0xb63e800d. +// +// Solidity: function setup(address[] _owners, uint256 _threshold, address to, bytes data, address fallbackHandler, address paymentToken, uint256 payment, address paymentReceiver) returns() +func (_Safe *SafeTransactorSession) Setup(_owners []common.Address, _threshold *big.Int, to common.Address, data []byte, fallbackHandler common.Address, paymentToken common.Address, payment *big.Int, paymentReceiver common.Address) (*types.Transaction, error) { + return _Safe.Contract.Setup(&_Safe.TransactOpts, _owners, _threshold, to, data, fallbackHandler, paymentToken, payment, paymentReceiver) +} + +// SimulateAndRevert is a paid mutator transaction binding the contract method 0xb4faba09. +// +// Solidity: function simulateAndRevert(address targetContract, bytes calldataPayload) returns() +func (_Safe *SafeTransactor) SimulateAndRevert(opts *bind.TransactOpts, targetContract common.Address, calldataPayload []byte) (*types.Transaction, error) { + return _Safe.contract.Transact(opts, "simulateAndRevert", targetContract, calldataPayload) +} + +// SimulateAndRevert is a paid mutator transaction binding the contract method 0xb4faba09. +// +// Solidity: function simulateAndRevert(address targetContract, bytes calldataPayload) returns() +func (_Safe *SafeSession) SimulateAndRevert(targetContract common.Address, calldataPayload []byte) (*types.Transaction, error) { + return _Safe.Contract.SimulateAndRevert(&_Safe.TransactOpts, targetContract, calldataPayload) +} + +// SimulateAndRevert is a paid mutator transaction binding the contract method 0xb4faba09. +// +// Solidity: function simulateAndRevert(address targetContract, bytes calldataPayload) returns() +func (_Safe *SafeTransactorSession) SimulateAndRevert(targetContract common.Address, calldataPayload []byte) (*types.Transaction, error) { + return _Safe.Contract.SimulateAndRevert(&_Safe.TransactOpts, targetContract, calldataPayload) +} + +// SwapOwner is a paid mutator transaction binding the contract method 0xe318b52b. +// +// Solidity: function swapOwner(address prevOwner, address oldOwner, address newOwner) returns() +func (_Safe *SafeTransactor) SwapOwner(opts *bind.TransactOpts, prevOwner common.Address, oldOwner common.Address, newOwner common.Address) (*types.Transaction, error) { + return _Safe.contract.Transact(opts, "swapOwner", prevOwner, oldOwner, newOwner) +} + +// SwapOwner is a paid mutator transaction binding the contract method 0xe318b52b. +// +// Solidity: function swapOwner(address prevOwner, address oldOwner, address newOwner) returns() +func (_Safe *SafeSession) SwapOwner(prevOwner common.Address, oldOwner common.Address, newOwner common.Address) (*types.Transaction, error) { + return _Safe.Contract.SwapOwner(&_Safe.TransactOpts, prevOwner, oldOwner, newOwner) +} + +// SwapOwner is a paid mutator transaction binding the contract method 0xe318b52b. +// +// Solidity: function swapOwner(address prevOwner, address oldOwner, address newOwner) returns() +func (_Safe *SafeTransactorSession) SwapOwner(prevOwner common.Address, oldOwner common.Address, newOwner common.Address) (*types.Transaction, error) { + return _Safe.Contract.SwapOwner(&_Safe.TransactOpts, prevOwner, oldOwner, newOwner) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() returns() +func (_Safe *SafeTransactor) Fallback(opts *bind.TransactOpts, calldata []byte) (*types.Transaction, error) { + return _Safe.contract.RawTransact(opts, calldata) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() returns() +func (_Safe *SafeSession) Fallback(calldata []byte) (*types.Transaction, error) { + return _Safe.Contract.Fallback(&_Safe.TransactOpts, calldata) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() returns() +func (_Safe *SafeTransactorSession) Fallback(calldata []byte) (*types.Transaction, error) { + return _Safe.Contract.Fallback(&_Safe.TransactOpts, calldata) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_Safe *SafeTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Safe.contract.RawTransact(opts, nil) // calldata is disallowed for receive function +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_Safe *SafeSession) Receive() (*types.Transaction, error) { + return _Safe.Contract.Receive(&_Safe.TransactOpts) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_Safe *SafeTransactorSession) Receive() (*types.Transaction, error) { + return _Safe.Contract.Receive(&_Safe.TransactOpts) +} + +// SafeAddedOwnerIterator is returned from FilterAddedOwner and is used to iterate over the raw logs and unpacked data for AddedOwner events raised by the Safe contract. +type SafeAddedOwnerIterator struct { + Event *SafeAddedOwner // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeAddedOwnerIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeAddedOwner) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeAddedOwner) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeAddedOwnerIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeAddedOwnerIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeAddedOwner represents a AddedOwner event raised by the Safe contract. +type SafeAddedOwner struct { + Owner common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterAddedOwner is a free log retrieval operation binding the contract event 0x9465fa0c962cc76958e6373a993326400c1c94f8be2fe3a952adfa7f60b2ea26. +// +// Solidity: event AddedOwner(address indexed owner) +func (_Safe *SafeFilterer) FilterAddedOwner(opts *bind.FilterOpts, owner []common.Address) (*SafeAddedOwnerIterator, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + + logs, sub, err := _Safe.contract.FilterLogs(opts, "AddedOwner", ownerRule) + if err != nil { + return nil, err + } + return &SafeAddedOwnerIterator{contract: _Safe.contract, event: "AddedOwner", logs: logs, sub: sub}, nil +} + +// WatchAddedOwner is a free log subscription operation binding the contract event 0x9465fa0c962cc76958e6373a993326400c1c94f8be2fe3a952adfa7f60b2ea26. +// +// Solidity: event AddedOwner(address indexed owner) +func (_Safe *SafeFilterer) WatchAddedOwner(opts *bind.WatchOpts, sink chan<- *SafeAddedOwner, owner []common.Address) (event.Subscription, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + + logs, sub, err := _Safe.contract.WatchLogs(opts, "AddedOwner", ownerRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeAddedOwner) + if err := _Safe.contract.UnpackLog(event, "AddedOwner", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseAddedOwner is a log parse operation binding the contract event 0x9465fa0c962cc76958e6373a993326400c1c94f8be2fe3a952adfa7f60b2ea26. +// +// Solidity: event AddedOwner(address indexed owner) +func (_Safe *SafeFilterer) ParseAddedOwner(log types.Log) (*SafeAddedOwner, error) { + event := new(SafeAddedOwner) + if err := _Safe.contract.UnpackLog(event, "AddedOwner", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SafeApproveHashIterator is returned from FilterApproveHash and is used to iterate over the raw logs and unpacked data for ApproveHash events raised by the Safe contract. +type SafeApproveHashIterator struct { + Event *SafeApproveHash // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeApproveHashIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeApproveHash) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeApproveHash) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeApproveHashIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeApproveHashIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeApproveHash represents a ApproveHash event raised by the Safe contract. +type SafeApproveHash struct { + ApprovedHash [32]byte + Owner common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterApproveHash is a free log retrieval operation binding the contract event 0xf2a0eb156472d1440255b0d7c1e19cc07115d1051fe605b0dce69acfec884d9c. +// +// Solidity: event ApproveHash(bytes32 indexed approvedHash, address indexed owner) +func (_Safe *SafeFilterer) FilterApproveHash(opts *bind.FilterOpts, approvedHash [][32]byte, owner []common.Address) (*SafeApproveHashIterator, error) { + + var approvedHashRule []interface{} + for _, approvedHashItem := range approvedHash { + approvedHashRule = append(approvedHashRule, approvedHashItem) + } + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + + logs, sub, err := _Safe.contract.FilterLogs(opts, "ApproveHash", approvedHashRule, ownerRule) + if err != nil { + return nil, err + } + return &SafeApproveHashIterator{contract: _Safe.contract, event: "ApproveHash", logs: logs, sub: sub}, nil +} + +// WatchApproveHash is a free log subscription operation binding the contract event 0xf2a0eb156472d1440255b0d7c1e19cc07115d1051fe605b0dce69acfec884d9c. +// +// Solidity: event ApproveHash(bytes32 indexed approvedHash, address indexed owner) +func (_Safe *SafeFilterer) WatchApproveHash(opts *bind.WatchOpts, sink chan<- *SafeApproveHash, approvedHash [][32]byte, owner []common.Address) (event.Subscription, error) { + + var approvedHashRule []interface{} + for _, approvedHashItem := range approvedHash { + approvedHashRule = append(approvedHashRule, approvedHashItem) + } + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + + logs, sub, err := _Safe.contract.WatchLogs(opts, "ApproveHash", approvedHashRule, ownerRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeApproveHash) + if err := _Safe.contract.UnpackLog(event, "ApproveHash", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseApproveHash is a log parse operation binding the contract event 0xf2a0eb156472d1440255b0d7c1e19cc07115d1051fe605b0dce69acfec884d9c. +// +// Solidity: event ApproveHash(bytes32 indexed approvedHash, address indexed owner) +func (_Safe *SafeFilterer) ParseApproveHash(log types.Log) (*SafeApproveHash, error) { + event := new(SafeApproveHash) + if err := _Safe.contract.UnpackLog(event, "ApproveHash", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SafeChangedFallbackHandlerIterator is returned from FilterChangedFallbackHandler and is used to iterate over the raw logs and unpacked data for ChangedFallbackHandler events raised by the Safe contract. +type SafeChangedFallbackHandlerIterator struct { + Event *SafeChangedFallbackHandler // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeChangedFallbackHandlerIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeChangedFallbackHandler) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeChangedFallbackHandler) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeChangedFallbackHandlerIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeChangedFallbackHandlerIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeChangedFallbackHandler represents a ChangedFallbackHandler event raised by the Safe contract. +type SafeChangedFallbackHandler struct { + Handler common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterChangedFallbackHandler is a free log retrieval operation binding the contract event 0x5ac6c46c93c8d0e53714ba3b53db3e7c046da994313d7ed0d192028bc7c228b0. +// +// Solidity: event ChangedFallbackHandler(address indexed handler) +func (_Safe *SafeFilterer) FilterChangedFallbackHandler(opts *bind.FilterOpts, handler []common.Address) (*SafeChangedFallbackHandlerIterator, error) { + + var handlerRule []interface{} + for _, handlerItem := range handler { + handlerRule = append(handlerRule, handlerItem) + } + + logs, sub, err := _Safe.contract.FilterLogs(opts, "ChangedFallbackHandler", handlerRule) + if err != nil { + return nil, err + } + return &SafeChangedFallbackHandlerIterator{contract: _Safe.contract, event: "ChangedFallbackHandler", logs: logs, sub: sub}, nil +} + +// WatchChangedFallbackHandler is a free log subscription operation binding the contract event 0x5ac6c46c93c8d0e53714ba3b53db3e7c046da994313d7ed0d192028bc7c228b0. +// +// Solidity: event ChangedFallbackHandler(address indexed handler) +func (_Safe *SafeFilterer) WatchChangedFallbackHandler(opts *bind.WatchOpts, sink chan<- *SafeChangedFallbackHandler, handler []common.Address) (event.Subscription, error) { + + var handlerRule []interface{} + for _, handlerItem := range handler { + handlerRule = append(handlerRule, handlerItem) + } + + logs, sub, err := _Safe.contract.WatchLogs(opts, "ChangedFallbackHandler", handlerRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeChangedFallbackHandler) + if err := _Safe.contract.UnpackLog(event, "ChangedFallbackHandler", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseChangedFallbackHandler is a log parse operation binding the contract event 0x5ac6c46c93c8d0e53714ba3b53db3e7c046da994313d7ed0d192028bc7c228b0. +// +// Solidity: event ChangedFallbackHandler(address indexed handler) +func (_Safe *SafeFilterer) ParseChangedFallbackHandler(log types.Log) (*SafeChangedFallbackHandler, error) { + event := new(SafeChangedFallbackHandler) + if err := _Safe.contract.UnpackLog(event, "ChangedFallbackHandler", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SafeChangedGuardIterator is returned from FilterChangedGuard and is used to iterate over the raw logs and unpacked data for ChangedGuard events raised by the Safe contract. +type SafeChangedGuardIterator struct { + Event *SafeChangedGuard // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeChangedGuardIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeChangedGuard) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeChangedGuard) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeChangedGuardIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeChangedGuardIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeChangedGuard represents a ChangedGuard event raised by the Safe contract. +type SafeChangedGuard struct { + Guard common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterChangedGuard is a free log retrieval operation binding the contract event 0x1151116914515bc0891ff9047a6cb32cf902546f83066499bcf8ba33d2353fa2. +// +// Solidity: event ChangedGuard(address indexed guard) +func (_Safe *SafeFilterer) FilterChangedGuard(opts *bind.FilterOpts, guard []common.Address) (*SafeChangedGuardIterator, error) { + + var guardRule []interface{} + for _, guardItem := range guard { + guardRule = append(guardRule, guardItem) + } + + logs, sub, err := _Safe.contract.FilterLogs(opts, "ChangedGuard", guardRule) + if err != nil { + return nil, err + } + return &SafeChangedGuardIterator{contract: _Safe.contract, event: "ChangedGuard", logs: logs, sub: sub}, nil +} + +// WatchChangedGuard is a free log subscription operation binding the contract event 0x1151116914515bc0891ff9047a6cb32cf902546f83066499bcf8ba33d2353fa2. +// +// Solidity: event ChangedGuard(address indexed guard) +func (_Safe *SafeFilterer) WatchChangedGuard(opts *bind.WatchOpts, sink chan<- *SafeChangedGuard, guard []common.Address) (event.Subscription, error) { + + var guardRule []interface{} + for _, guardItem := range guard { + guardRule = append(guardRule, guardItem) + } + + logs, sub, err := _Safe.contract.WatchLogs(opts, "ChangedGuard", guardRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeChangedGuard) + if err := _Safe.contract.UnpackLog(event, "ChangedGuard", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseChangedGuard is a log parse operation binding the contract event 0x1151116914515bc0891ff9047a6cb32cf902546f83066499bcf8ba33d2353fa2. +// +// Solidity: event ChangedGuard(address indexed guard) +func (_Safe *SafeFilterer) ParseChangedGuard(log types.Log) (*SafeChangedGuard, error) { + event := new(SafeChangedGuard) + if err := _Safe.contract.UnpackLog(event, "ChangedGuard", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SafeChangedThresholdIterator is returned from FilterChangedThreshold and is used to iterate over the raw logs and unpacked data for ChangedThreshold events raised by the Safe contract. +type SafeChangedThresholdIterator struct { + Event *SafeChangedThreshold // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeChangedThresholdIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeChangedThreshold) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeChangedThreshold) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeChangedThresholdIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeChangedThresholdIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeChangedThreshold represents a ChangedThreshold event raised by the Safe contract. +type SafeChangedThreshold struct { + Threshold *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterChangedThreshold is a free log retrieval operation binding the contract event 0x610f7ff2b304ae8903c3de74c60c6ab1f7d6226b3f52c5161905bb5ad4039c93. +// +// Solidity: event ChangedThreshold(uint256 threshold) +func (_Safe *SafeFilterer) FilterChangedThreshold(opts *bind.FilterOpts) (*SafeChangedThresholdIterator, error) { + + logs, sub, err := _Safe.contract.FilterLogs(opts, "ChangedThreshold") + if err != nil { + return nil, err + } + return &SafeChangedThresholdIterator{contract: _Safe.contract, event: "ChangedThreshold", logs: logs, sub: sub}, nil +} + +// WatchChangedThreshold is a free log subscription operation binding the contract event 0x610f7ff2b304ae8903c3de74c60c6ab1f7d6226b3f52c5161905bb5ad4039c93. +// +// Solidity: event ChangedThreshold(uint256 threshold) +func (_Safe *SafeFilterer) WatchChangedThreshold(opts *bind.WatchOpts, sink chan<- *SafeChangedThreshold) (event.Subscription, error) { + + logs, sub, err := _Safe.contract.WatchLogs(opts, "ChangedThreshold") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeChangedThreshold) + if err := _Safe.contract.UnpackLog(event, "ChangedThreshold", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseChangedThreshold is a log parse operation binding the contract event 0x610f7ff2b304ae8903c3de74c60c6ab1f7d6226b3f52c5161905bb5ad4039c93. +// +// Solidity: event ChangedThreshold(uint256 threshold) +func (_Safe *SafeFilterer) ParseChangedThreshold(log types.Log) (*SafeChangedThreshold, error) { + event := new(SafeChangedThreshold) + if err := _Safe.contract.UnpackLog(event, "ChangedThreshold", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SafeDisabledModuleIterator is returned from FilterDisabledModule and is used to iterate over the raw logs and unpacked data for DisabledModule events raised by the Safe contract. +type SafeDisabledModuleIterator struct { + Event *SafeDisabledModule // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeDisabledModuleIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeDisabledModule) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeDisabledModule) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeDisabledModuleIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeDisabledModuleIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeDisabledModule represents a DisabledModule event raised by the Safe contract. +type SafeDisabledModule struct { + Module common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterDisabledModule is a free log retrieval operation binding the contract event 0xaab4fa2b463f581b2b32cb3b7e3b704b9ce37cc209b5fb4d77e593ace4054276. +// +// Solidity: event DisabledModule(address indexed module) +func (_Safe *SafeFilterer) FilterDisabledModule(opts *bind.FilterOpts, module []common.Address) (*SafeDisabledModuleIterator, error) { + + var moduleRule []interface{} + for _, moduleItem := range module { + moduleRule = append(moduleRule, moduleItem) + } + + logs, sub, err := _Safe.contract.FilterLogs(opts, "DisabledModule", moduleRule) + if err != nil { + return nil, err + } + return &SafeDisabledModuleIterator{contract: _Safe.contract, event: "DisabledModule", logs: logs, sub: sub}, nil +} + +// WatchDisabledModule is a free log subscription operation binding the contract event 0xaab4fa2b463f581b2b32cb3b7e3b704b9ce37cc209b5fb4d77e593ace4054276. +// +// Solidity: event DisabledModule(address indexed module) +func (_Safe *SafeFilterer) WatchDisabledModule(opts *bind.WatchOpts, sink chan<- *SafeDisabledModule, module []common.Address) (event.Subscription, error) { + + var moduleRule []interface{} + for _, moduleItem := range module { + moduleRule = append(moduleRule, moduleItem) + } + + logs, sub, err := _Safe.contract.WatchLogs(opts, "DisabledModule", moduleRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeDisabledModule) + if err := _Safe.contract.UnpackLog(event, "DisabledModule", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseDisabledModule is a log parse operation binding the contract event 0xaab4fa2b463f581b2b32cb3b7e3b704b9ce37cc209b5fb4d77e593ace4054276. +// +// Solidity: event DisabledModule(address indexed module) +func (_Safe *SafeFilterer) ParseDisabledModule(log types.Log) (*SafeDisabledModule, error) { + event := new(SafeDisabledModule) + if err := _Safe.contract.UnpackLog(event, "DisabledModule", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SafeEnabledModuleIterator is returned from FilterEnabledModule and is used to iterate over the raw logs and unpacked data for EnabledModule events raised by the Safe contract. +type SafeEnabledModuleIterator struct { + Event *SafeEnabledModule // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeEnabledModuleIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeEnabledModule) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeEnabledModule) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeEnabledModuleIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeEnabledModuleIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeEnabledModule represents a EnabledModule event raised by the Safe contract. +type SafeEnabledModule struct { + Module common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterEnabledModule is a free log retrieval operation binding the contract event 0xecdf3a3effea5783a3c4c2140e677577666428d44ed9d474a0b3a4c9943f8440. +// +// Solidity: event EnabledModule(address indexed module) +func (_Safe *SafeFilterer) FilterEnabledModule(opts *bind.FilterOpts, module []common.Address) (*SafeEnabledModuleIterator, error) { + + var moduleRule []interface{} + for _, moduleItem := range module { + moduleRule = append(moduleRule, moduleItem) + } + + logs, sub, err := _Safe.contract.FilterLogs(opts, "EnabledModule", moduleRule) + if err != nil { + return nil, err + } + return &SafeEnabledModuleIterator{contract: _Safe.contract, event: "EnabledModule", logs: logs, sub: sub}, nil +} + +// WatchEnabledModule is a free log subscription operation binding the contract event 0xecdf3a3effea5783a3c4c2140e677577666428d44ed9d474a0b3a4c9943f8440. +// +// Solidity: event EnabledModule(address indexed module) +func (_Safe *SafeFilterer) WatchEnabledModule(opts *bind.WatchOpts, sink chan<- *SafeEnabledModule, module []common.Address) (event.Subscription, error) { + + var moduleRule []interface{} + for _, moduleItem := range module { + moduleRule = append(moduleRule, moduleItem) + } + + logs, sub, err := _Safe.contract.WatchLogs(opts, "EnabledModule", moduleRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeEnabledModule) + if err := _Safe.contract.UnpackLog(event, "EnabledModule", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseEnabledModule is a log parse operation binding the contract event 0xecdf3a3effea5783a3c4c2140e677577666428d44ed9d474a0b3a4c9943f8440. +// +// Solidity: event EnabledModule(address indexed module) +func (_Safe *SafeFilterer) ParseEnabledModule(log types.Log) (*SafeEnabledModule, error) { + event := new(SafeEnabledModule) + if err := _Safe.contract.UnpackLog(event, "EnabledModule", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SafeExecutionFailureIterator is returned from FilterExecutionFailure and is used to iterate over the raw logs and unpacked data for ExecutionFailure events raised by the Safe contract. +type SafeExecutionFailureIterator struct { + Event *SafeExecutionFailure // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeExecutionFailureIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeExecutionFailure) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeExecutionFailure) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeExecutionFailureIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeExecutionFailureIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeExecutionFailure represents a ExecutionFailure event raised by the Safe contract. +type SafeExecutionFailure struct { + TxHash [32]byte + Payment *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterExecutionFailure is a free log retrieval operation binding the contract event 0x23428b18acfb3ea64b08dc0c1d296ea9c09702c09083ca5272e64d115b687d23. +// +// Solidity: event ExecutionFailure(bytes32 indexed txHash, uint256 payment) +func (_Safe *SafeFilterer) FilterExecutionFailure(opts *bind.FilterOpts, txHash [][32]byte) (*SafeExecutionFailureIterator, error) { + + var txHashRule []interface{} + for _, txHashItem := range txHash { + txHashRule = append(txHashRule, txHashItem) + } + + logs, sub, err := _Safe.contract.FilterLogs(opts, "ExecutionFailure", txHashRule) + if err != nil { + return nil, err + } + return &SafeExecutionFailureIterator{contract: _Safe.contract, event: "ExecutionFailure", logs: logs, sub: sub}, nil +} + +// WatchExecutionFailure is a free log subscription operation binding the contract event 0x23428b18acfb3ea64b08dc0c1d296ea9c09702c09083ca5272e64d115b687d23. +// +// Solidity: event ExecutionFailure(bytes32 indexed txHash, uint256 payment) +func (_Safe *SafeFilterer) WatchExecutionFailure(opts *bind.WatchOpts, sink chan<- *SafeExecutionFailure, txHash [][32]byte) (event.Subscription, error) { + + var txHashRule []interface{} + for _, txHashItem := range txHash { + txHashRule = append(txHashRule, txHashItem) + } + + logs, sub, err := _Safe.contract.WatchLogs(opts, "ExecutionFailure", txHashRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeExecutionFailure) + if err := _Safe.contract.UnpackLog(event, "ExecutionFailure", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseExecutionFailure is a log parse operation binding the contract event 0x23428b18acfb3ea64b08dc0c1d296ea9c09702c09083ca5272e64d115b687d23. +// +// Solidity: event ExecutionFailure(bytes32 indexed txHash, uint256 payment) +func (_Safe *SafeFilterer) ParseExecutionFailure(log types.Log) (*SafeExecutionFailure, error) { + event := new(SafeExecutionFailure) + if err := _Safe.contract.UnpackLog(event, "ExecutionFailure", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SafeExecutionFromModuleFailureIterator is returned from FilterExecutionFromModuleFailure and is used to iterate over the raw logs and unpacked data for ExecutionFromModuleFailure events raised by the Safe contract. +type SafeExecutionFromModuleFailureIterator struct { + Event *SafeExecutionFromModuleFailure // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeExecutionFromModuleFailureIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeExecutionFromModuleFailure) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeExecutionFromModuleFailure) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeExecutionFromModuleFailureIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeExecutionFromModuleFailureIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeExecutionFromModuleFailure represents a ExecutionFromModuleFailure event raised by the Safe contract. +type SafeExecutionFromModuleFailure struct { + Module common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterExecutionFromModuleFailure is a free log retrieval operation binding the contract event 0xacd2c8702804128fdb0db2bb49f6d127dd0181c13fd45dbfe16de0930e2bd375. +// +// Solidity: event ExecutionFromModuleFailure(address indexed module) +func (_Safe *SafeFilterer) FilterExecutionFromModuleFailure(opts *bind.FilterOpts, module []common.Address) (*SafeExecutionFromModuleFailureIterator, error) { + + var moduleRule []interface{} + for _, moduleItem := range module { + moduleRule = append(moduleRule, moduleItem) + } + + logs, sub, err := _Safe.contract.FilterLogs(opts, "ExecutionFromModuleFailure", moduleRule) + if err != nil { + return nil, err + } + return &SafeExecutionFromModuleFailureIterator{contract: _Safe.contract, event: "ExecutionFromModuleFailure", logs: logs, sub: sub}, nil +} + +// WatchExecutionFromModuleFailure is a free log subscription operation binding the contract event 0xacd2c8702804128fdb0db2bb49f6d127dd0181c13fd45dbfe16de0930e2bd375. +// +// Solidity: event ExecutionFromModuleFailure(address indexed module) +func (_Safe *SafeFilterer) WatchExecutionFromModuleFailure(opts *bind.WatchOpts, sink chan<- *SafeExecutionFromModuleFailure, module []common.Address) (event.Subscription, error) { + + var moduleRule []interface{} + for _, moduleItem := range module { + moduleRule = append(moduleRule, moduleItem) + } + + logs, sub, err := _Safe.contract.WatchLogs(opts, "ExecutionFromModuleFailure", moduleRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeExecutionFromModuleFailure) + if err := _Safe.contract.UnpackLog(event, "ExecutionFromModuleFailure", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseExecutionFromModuleFailure is a log parse operation binding the contract event 0xacd2c8702804128fdb0db2bb49f6d127dd0181c13fd45dbfe16de0930e2bd375. +// +// Solidity: event ExecutionFromModuleFailure(address indexed module) +func (_Safe *SafeFilterer) ParseExecutionFromModuleFailure(log types.Log) (*SafeExecutionFromModuleFailure, error) { + event := new(SafeExecutionFromModuleFailure) + if err := _Safe.contract.UnpackLog(event, "ExecutionFromModuleFailure", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SafeExecutionFromModuleSuccessIterator is returned from FilterExecutionFromModuleSuccess and is used to iterate over the raw logs and unpacked data for ExecutionFromModuleSuccess events raised by the Safe contract. +type SafeExecutionFromModuleSuccessIterator struct { + Event *SafeExecutionFromModuleSuccess // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeExecutionFromModuleSuccessIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeExecutionFromModuleSuccess) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeExecutionFromModuleSuccess) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeExecutionFromModuleSuccessIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeExecutionFromModuleSuccessIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeExecutionFromModuleSuccess represents a ExecutionFromModuleSuccess event raised by the Safe contract. +type SafeExecutionFromModuleSuccess struct { + Module common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterExecutionFromModuleSuccess is a free log retrieval operation binding the contract event 0x6895c13664aa4f67288b25d7a21d7aaa34916e355fb9b6fae0a139a9085becb8. +// +// Solidity: event ExecutionFromModuleSuccess(address indexed module) +func (_Safe *SafeFilterer) FilterExecutionFromModuleSuccess(opts *bind.FilterOpts, module []common.Address) (*SafeExecutionFromModuleSuccessIterator, error) { + + var moduleRule []interface{} + for _, moduleItem := range module { + moduleRule = append(moduleRule, moduleItem) + } + + logs, sub, err := _Safe.contract.FilterLogs(opts, "ExecutionFromModuleSuccess", moduleRule) + if err != nil { + return nil, err + } + return &SafeExecutionFromModuleSuccessIterator{contract: _Safe.contract, event: "ExecutionFromModuleSuccess", logs: logs, sub: sub}, nil +} + +// WatchExecutionFromModuleSuccess is a free log subscription operation binding the contract event 0x6895c13664aa4f67288b25d7a21d7aaa34916e355fb9b6fae0a139a9085becb8. +// +// Solidity: event ExecutionFromModuleSuccess(address indexed module) +func (_Safe *SafeFilterer) WatchExecutionFromModuleSuccess(opts *bind.WatchOpts, sink chan<- *SafeExecutionFromModuleSuccess, module []common.Address) (event.Subscription, error) { + + var moduleRule []interface{} + for _, moduleItem := range module { + moduleRule = append(moduleRule, moduleItem) + } + + logs, sub, err := _Safe.contract.WatchLogs(opts, "ExecutionFromModuleSuccess", moduleRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeExecutionFromModuleSuccess) + if err := _Safe.contract.UnpackLog(event, "ExecutionFromModuleSuccess", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseExecutionFromModuleSuccess is a log parse operation binding the contract event 0x6895c13664aa4f67288b25d7a21d7aaa34916e355fb9b6fae0a139a9085becb8. +// +// Solidity: event ExecutionFromModuleSuccess(address indexed module) +func (_Safe *SafeFilterer) ParseExecutionFromModuleSuccess(log types.Log) (*SafeExecutionFromModuleSuccess, error) { + event := new(SafeExecutionFromModuleSuccess) + if err := _Safe.contract.UnpackLog(event, "ExecutionFromModuleSuccess", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SafeExecutionSuccessIterator is returned from FilterExecutionSuccess and is used to iterate over the raw logs and unpacked data for ExecutionSuccess events raised by the Safe contract. +type SafeExecutionSuccessIterator struct { + Event *SafeExecutionSuccess // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeExecutionSuccessIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeExecutionSuccess) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeExecutionSuccess) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeExecutionSuccessIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeExecutionSuccessIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeExecutionSuccess represents a ExecutionSuccess event raised by the Safe contract. +type SafeExecutionSuccess struct { + TxHash [32]byte + Payment *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterExecutionSuccess is a free log retrieval operation binding the contract event 0x442e715f626346e8c54381002da614f62bee8d27386535b2521ec8540898556e. +// +// Solidity: event ExecutionSuccess(bytes32 indexed txHash, uint256 payment) +func (_Safe *SafeFilterer) FilterExecutionSuccess(opts *bind.FilterOpts, txHash [][32]byte) (*SafeExecutionSuccessIterator, error) { + + var txHashRule []interface{} + for _, txHashItem := range txHash { + txHashRule = append(txHashRule, txHashItem) + } + + logs, sub, err := _Safe.contract.FilterLogs(opts, "ExecutionSuccess", txHashRule) + if err != nil { + return nil, err + } + return &SafeExecutionSuccessIterator{contract: _Safe.contract, event: "ExecutionSuccess", logs: logs, sub: sub}, nil +} + +// WatchExecutionSuccess is a free log subscription operation binding the contract event 0x442e715f626346e8c54381002da614f62bee8d27386535b2521ec8540898556e. +// +// Solidity: event ExecutionSuccess(bytes32 indexed txHash, uint256 payment) +func (_Safe *SafeFilterer) WatchExecutionSuccess(opts *bind.WatchOpts, sink chan<- *SafeExecutionSuccess, txHash [][32]byte) (event.Subscription, error) { + + var txHashRule []interface{} + for _, txHashItem := range txHash { + txHashRule = append(txHashRule, txHashItem) + } + + logs, sub, err := _Safe.contract.WatchLogs(opts, "ExecutionSuccess", txHashRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeExecutionSuccess) + if err := _Safe.contract.UnpackLog(event, "ExecutionSuccess", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseExecutionSuccess is a log parse operation binding the contract event 0x442e715f626346e8c54381002da614f62bee8d27386535b2521ec8540898556e. +// +// Solidity: event ExecutionSuccess(bytes32 indexed txHash, uint256 payment) +func (_Safe *SafeFilterer) ParseExecutionSuccess(log types.Log) (*SafeExecutionSuccess, error) { + event := new(SafeExecutionSuccess) + if err := _Safe.contract.UnpackLog(event, "ExecutionSuccess", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SafeRemovedOwnerIterator is returned from FilterRemovedOwner and is used to iterate over the raw logs and unpacked data for RemovedOwner events raised by the Safe contract. +type SafeRemovedOwnerIterator struct { + Event *SafeRemovedOwner // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeRemovedOwnerIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeRemovedOwner) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeRemovedOwner) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeRemovedOwnerIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeRemovedOwnerIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeRemovedOwner represents a RemovedOwner event raised by the Safe contract. +type SafeRemovedOwner struct { + Owner common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterRemovedOwner is a free log retrieval operation binding the contract event 0xf8d49fc529812e9a7c5c50e69c20f0dccc0db8fa95c98bc58cc9a4f1c1299eaf. +// +// Solidity: event RemovedOwner(address indexed owner) +func (_Safe *SafeFilterer) FilterRemovedOwner(opts *bind.FilterOpts, owner []common.Address) (*SafeRemovedOwnerIterator, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + + logs, sub, err := _Safe.contract.FilterLogs(opts, "RemovedOwner", ownerRule) + if err != nil { + return nil, err + } + return &SafeRemovedOwnerIterator{contract: _Safe.contract, event: "RemovedOwner", logs: logs, sub: sub}, nil +} + +// WatchRemovedOwner is a free log subscription operation binding the contract event 0xf8d49fc529812e9a7c5c50e69c20f0dccc0db8fa95c98bc58cc9a4f1c1299eaf. +// +// Solidity: event RemovedOwner(address indexed owner) +func (_Safe *SafeFilterer) WatchRemovedOwner(opts *bind.WatchOpts, sink chan<- *SafeRemovedOwner, owner []common.Address) (event.Subscription, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + + logs, sub, err := _Safe.contract.WatchLogs(opts, "RemovedOwner", ownerRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeRemovedOwner) + if err := _Safe.contract.UnpackLog(event, "RemovedOwner", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseRemovedOwner is a log parse operation binding the contract event 0xf8d49fc529812e9a7c5c50e69c20f0dccc0db8fa95c98bc58cc9a4f1c1299eaf. +// +// Solidity: event RemovedOwner(address indexed owner) +func (_Safe *SafeFilterer) ParseRemovedOwner(log types.Log) (*SafeRemovedOwner, error) { + event := new(SafeRemovedOwner) + if err := _Safe.contract.UnpackLog(event, "RemovedOwner", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SafeSafeReceivedIterator is returned from FilterSafeReceived and is used to iterate over the raw logs and unpacked data for SafeReceived events raised by the Safe contract. +type SafeSafeReceivedIterator struct { + Event *SafeSafeReceived // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeSafeReceivedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeSafeReceived) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeSafeReceived) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeSafeReceivedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeSafeReceivedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeSafeReceived represents a SafeReceived event raised by the Safe contract. +type SafeSafeReceived struct { + Sender common.Address + Value *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSafeReceived is a free log retrieval operation binding the contract event 0x3d0ce9bfc3ed7d6862dbb28b2dea94561fe714a1b4d019aa8af39730d1ad7c3d. +// +// Solidity: event SafeReceived(address indexed sender, uint256 value) +func (_Safe *SafeFilterer) FilterSafeReceived(opts *bind.FilterOpts, sender []common.Address) (*SafeSafeReceivedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _Safe.contract.FilterLogs(opts, "SafeReceived", senderRule) + if err != nil { + return nil, err + } + return &SafeSafeReceivedIterator{contract: _Safe.contract, event: "SafeReceived", logs: logs, sub: sub}, nil +} + +// WatchSafeReceived is a free log subscription operation binding the contract event 0x3d0ce9bfc3ed7d6862dbb28b2dea94561fe714a1b4d019aa8af39730d1ad7c3d. +// +// Solidity: event SafeReceived(address indexed sender, uint256 value) +func (_Safe *SafeFilterer) WatchSafeReceived(opts *bind.WatchOpts, sink chan<- *SafeSafeReceived, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _Safe.contract.WatchLogs(opts, "SafeReceived", senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeSafeReceived) + if err := _Safe.contract.UnpackLog(event, "SafeReceived", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseSafeReceived is a log parse operation binding the contract event 0x3d0ce9bfc3ed7d6862dbb28b2dea94561fe714a1b4d019aa8af39730d1ad7c3d. +// +// Solidity: event SafeReceived(address indexed sender, uint256 value) +func (_Safe *SafeFilterer) ParseSafeReceived(log types.Log) (*SafeSafeReceived, error) { + event := new(SafeSafeReceived) + if err := _Safe.contract.UnpackLog(event, "SafeReceived", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SafeSafeSetupIterator is returned from FilterSafeSetup and is used to iterate over the raw logs and unpacked data for SafeSetup events raised by the Safe contract. +type SafeSafeSetupIterator struct { + Event *SafeSafeSetup // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeSafeSetupIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeSafeSetup) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeSafeSetup) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeSafeSetupIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeSafeSetupIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeSafeSetup represents a SafeSetup event raised by the Safe contract. +type SafeSafeSetup struct { + Initiator common.Address + Owners []common.Address + Threshold *big.Int + Initializer common.Address + FallbackHandler common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSafeSetup is a free log retrieval operation binding the contract event 0x141df868a6331af528e38c83b7aa03edc19be66e37ae67f9285bf4f8e3c6a1a8. +// +// Solidity: event SafeSetup(address indexed initiator, address[] owners, uint256 threshold, address initializer, address fallbackHandler) +func (_Safe *SafeFilterer) FilterSafeSetup(opts *bind.FilterOpts, initiator []common.Address) (*SafeSafeSetupIterator, error) { + + var initiatorRule []interface{} + for _, initiatorItem := range initiator { + initiatorRule = append(initiatorRule, initiatorItem) + } + + logs, sub, err := _Safe.contract.FilterLogs(opts, "SafeSetup", initiatorRule) + if err != nil { + return nil, err + } + return &SafeSafeSetupIterator{contract: _Safe.contract, event: "SafeSetup", logs: logs, sub: sub}, nil +} + +// WatchSafeSetup is a free log subscription operation binding the contract event 0x141df868a6331af528e38c83b7aa03edc19be66e37ae67f9285bf4f8e3c6a1a8. +// +// Solidity: event SafeSetup(address indexed initiator, address[] owners, uint256 threshold, address initializer, address fallbackHandler) +func (_Safe *SafeFilterer) WatchSafeSetup(opts *bind.WatchOpts, sink chan<- *SafeSafeSetup, initiator []common.Address) (event.Subscription, error) { + + var initiatorRule []interface{} + for _, initiatorItem := range initiator { + initiatorRule = append(initiatorRule, initiatorItem) + } + + logs, sub, err := _Safe.contract.WatchLogs(opts, "SafeSetup", initiatorRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeSafeSetup) + if err := _Safe.contract.UnpackLog(event, "SafeSetup", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseSafeSetup is a log parse operation binding the contract event 0x141df868a6331af528e38c83b7aa03edc19be66e37ae67f9285bf4f8e3c6a1a8. +// +// Solidity: event SafeSetup(address indexed initiator, address[] owners, uint256 threshold, address initializer, address fallbackHandler) +func (_Safe *SafeFilterer) ParseSafeSetup(log types.Log) (*SafeSafeSetup, error) { + event := new(SafeSafeSetup) + if err := _Safe.contract.UnpackLog(event, "SafeSetup", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SafeSignMsgIterator is returned from FilterSignMsg and is used to iterate over the raw logs and unpacked data for SignMsg events raised by the Safe contract. +type SafeSignMsgIterator struct { + Event *SafeSignMsg // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeSignMsgIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeSignMsg) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeSignMsg) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeSignMsgIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeSignMsgIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeSignMsg represents a SignMsg event raised by the Safe contract. +type SafeSignMsg struct { + MsgHash [32]byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSignMsg is a free log retrieval operation binding the contract event 0xe7f4675038f4f6034dfcbbb24c4dc08e4ebf10eb9d257d3d02c0f38d122ac6e4. +// +// Solidity: event SignMsg(bytes32 indexed msgHash) +func (_Safe *SafeFilterer) FilterSignMsg(opts *bind.FilterOpts, msgHash [][32]byte) (*SafeSignMsgIterator, error) { + + var msgHashRule []interface{} + for _, msgHashItem := range msgHash { + msgHashRule = append(msgHashRule, msgHashItem) + } + + logs, sub, err := _Safe.contract.FilterLogs(opts, "SignMsg", msgHashRule) + if err != nil { + return nil, err + } + return &SafeSignMsgIterator{contract: _Safe.contract, event: "SignMsg", logs: logs, sub: sub}, nil +} + +// WatchSignMsg is a free log subscription operation binding the contract event 0xe7f4675038f4f6034dfcbbb24c4dc08e4ebf10eb9d257d3d02c0f38d122ac6e4. +// +// Solidity: event SignMsg(bytes32 indexed msgHash) +func (_Safe *SafeFilterer) WatchSignMsg(opts *bind.WatchOpts, sink chan<- *SafeSignMsg, msgHash [][32]byte) (event.Subscription, error) { + + var msgHashRule []interface{} + for _, msgHashItem := range msgHash { + msgHashRule = append(msgHashRule, msgHashItem) + } + + logs, sub, err := _Safe.contract.WatchLogs(opts, "SignMsg", msgHashRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeSignMsg) + if err := _Safe.contract.UnpackLog(event, "SignMsg", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseSignMsg is a log parse operation binding the contract event 0xe7f4675038f4f6034dfcbbb24c4dc08e4ebf10eb9d257d3d02c0f38d122ac6e4. +// +// Solidity: event SignMsg(bytes32 indexed msgHash) +func (_Safe *SafeFilterer) ParseSignMsg(log types.Log) (*SafeSignMsg, error) { + event := new(SafeSignMsg) + if err := _Safe.contract.UnpackLog(event, "SignMsg", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/op-e2e2/bindings/safe_v130.go b/op-e2e2/bindings/safe_v130.go new file mode 100644 index 000000000000..29a162a41235 --- /dev/null +++ b/op-e2e2/bindings/safe_v130.go @@ -0,0 +1,3151 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// SafeV130MetaData contains all meta data concerning the SafeV130 contract. +var SafeV130MetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"AddedOwner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"approvedHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"ApproveHash\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"handler\",\"type\":\"address\"}],\"name\":\"ChangedFallbackHandler\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"guard\",\"type\":\"address\"}],\"name\":\"ChangedGuard\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"threshold\",\"type\":\"uint256\"}],\"name\":\"ChangedThreshold\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"module\",\"type\":\"address\"}],\"name\":\"DisabledModule\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"module\",\"type\":\"address\"}],\"name\":\"EnabledModule\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"txHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"payment\",\"type\":\"uint256\"}],\"name\":\"ExecutionFailure\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"module\",\"type\":\"address\"}],\"name\":\"ExecutionFromModuleFailure\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"module\",\"type\":\"address\"}],\"name\":\"ExecutionFromModuleSuccess\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"txHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"payment\",\"type\":\"uint256\"}],\"name\":\"ExecutionSuccess\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"RemovedOwner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"SafeReceived\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"initiator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"owners\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"threshold\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"initializer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"fallbackHandler\",\"type\":\"address\"}],\"name\":\"SafeSetup\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"msgHash\",\"type\":\"bytes32\"}],\"name\":\"SignMsg\",\"type\":\"event\"},{\"stateMutability\":\"nonpayable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"VERSION\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_threshold\",\"type\":\"uint256\"}],\"name\":\"addOwnerWithThreshold\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"hashToApprove\",\"type\":\"bytes32\"}],\"name\":\"approveHash\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"approvedHashes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_threshold\",\"type\":\"uint256\"}],\"name\":\"changeThreshold\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"dataHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"signatures\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"requiredSignatures\",\"type\":\"uint256\"}],\"name\":\"checkNSignatures\",\"outputs\":[],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"dataHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"signatures\",\"type\":\"bytes\"}],\"name\":\"checkSignatures\",\"outputs\":[],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"prevModule\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"module\",\"type\":\"address\"}],\"name\":\"disableModule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"domainSeparator\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"module\",\"type\":\"address\"}],\"name\":\"enableModule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"enumEnum.Operation\",\"name\":\"operation\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"safeTxGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"baseGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"gasPrice\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"gasToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"refundReceiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_nonce\",\"type\":\"uint256\"}],\"name\":\"encodeTransactionData\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"enumEnum.Operation\",\"name\":\"operation\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"safeTxGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"baseGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"gasPrice\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"gasToken\",\"type\":\"address\"},{\"internalType\":\"addresspayable\",\"name\":\"refundReceiver\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"signatures\",\"type\":\"bytes\"}],\"name\":\"execTransaction\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"enumEnum.Operation\",\"name\":\"operation\",\"type\":\"uint8\"}],\"name\":\"execTransactionFromModule\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"enumEnum.Operation\",\"name\":\"operation\",\"type\":\"uint8\"}],\"name\":\"execTransactionFromModuleReturnData\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"returnData\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getChainId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"start\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"pageSize\",\"type\":\"uint256\"}],\"name\":\"getModulesPaginated\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"array\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"next\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getOwners\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"offset\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"length\",\"type\":\"uint256\"}],\"name\":\"getStorageAt\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"enumEnum.Operation\",\"name\":\"operation\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"safeTxGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"baseGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"gasPrice\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"gasToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"refundReceiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_nonce\",\"type\":\"uint256\"}],\"name\":\"getTransactionHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"module\",\"type\":\"address\"}],\"name\":\"isModuleEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"isOwner\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nonce\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"prevOwner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_threshold\",\"type\":\"uint256\"}],\"name\":\"removeOwner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"enumEnum.Operation\",\"name\":\"operation\",\"type\":\"uint8\"}],\"name\":\"requiredTxGas\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"handler\",\"type\":\"address\"}],\"name\":\"setFallbackHandler\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"guard\",\"type\":\"address\"}],\"name\":\"setGuard\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_owners\",\"type\":\"address[]\"},{\"internalType\":\"uint256\",\"name\":\"_threshold\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"fallbackHandler\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"paymentToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"payment\",\"type\":\"uint256\"},{\"internalType\":\"addresspayable\",\"name\":\"paymentReceiver\",\"type\":\"address\"}],\"name\":\"setup\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"signedMessages\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"targetContract\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"calldataPayload\",\"type\":\"bytes\"}],\"name\":\"simulateAndRevert\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"prevOwner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"oldOwner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"swapOwner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", + Bin: "0x608060405234801561001057600080fd5b5060016004819055506159ae80620000296000396000f3fe6080604052600436106101dc5760003560e01c8063affed0e011610102578063e19a9dd911610095578063f08a032311610064578063f08a032314611647578063f698da2514611698578063f8dc5dd9146116c3578063ffa1ad741461173e57610231565b8063e19a9dd91461139b578063e318b52b146113ec578063e75235b81461147d578063e86637db146114a857610231565b8063cc2f8452116100d1578063cc2f8452146110e8578063d4d9bdcd146111b5578063d8d11f78146111f0578063e009cfde1461132a57610231565b8063affed0e014610d94578063b4faba0914610dbf578063b63e800d14610ea7578063c4ca3a9c1461101757610231565b80635624b25b1161017a5780636a761202116101495780636a761202146109945780637d83297414610b50578063934f3a1114610bbf578063a0e67e2b14610d2857610231565b80635624b25b146107fb5780635ae6bd37146108b9578063610b592514610908578063694e80c31461095957610231565b80632f54bf6e116101b65780632f54bf6e146104d35780633408e4701461053a578063468721a7146105655780635229073f1461067a57610231565b80630d582f131461029e57806312fb68e0146102f95780632d9ad53d1461046c57610231565b36610231573373ffffffffffffffffffffffffffffffffffffffff167f3d0ce9bfc3ed7d6862dbb28b2dea94561fe714a1b4d019aa8af39730d1ad7c3d346040518082815260200191505060405180910390a2005b34801561023d57600080fd5b5060007f6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d560001b905080548061027257600080f35b36600080373360601b365260008060143601600080855af13d6000803e80610299573d6000fd5b3d6000f35b3480156102aa57600080fd5b506102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506117ce565b005b34801561030557600080fd5b5061046a6004803603608081101561031c57600080fd5b81019080803590602001909291908035906020019064010000000081111561034357600080fd5b82018360208201111561035557600080fd5b8035906020019184600183028401116401000000008311171561037757600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156103da57600080fd5b8201836020820111156103ec57600080fd5b8035906020019184600183028401116401000000008311171561040e57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190929190505050611bbe565b005b34801561047857600080fd5b506104bb6004803603602081101561048f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612440565b60405180821515815260200191505060405180910390f35b3480156104df57600080fd5b50610522600480360360208110156104f657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612512565b60405180821515815260200191505060405180910390f35b34801561054657600080fd5b5061054f6125e4565b6040518082815260200191505060405180910390f35b34801561057157600080fd5b506106626004803603608081101561058857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156105cf57600080fd5b8201836020820111156105e157600080fd5b8035906020019184600183028401116401000000008311171561060357600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803560ff1690602001909291905050506125f1565b60405180821515815260200191505060405180910390f35b34801561068657600080fd5b506107776004803603608081101561069d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156106e457600080fd5b8201836020820111156106f657600080fd5b8035906020019184600183028401116401000000008311171561071857600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803560ff1690602001909291905050506127d7565b60405180831515815260200180602001828103825283818151815260200191508051906020019080838360005b838110156107bf5780820151818401526020810190506107a4565b50505050905090810190601f1680156107ec5780820380516001836020036101000a031916815260200191505b50935050505060405180910390f35b34801561080757600080fd5b5061083e6004803603604081101561081e57600080fd5b81019080803590602001909291908035906020019092919050505061280d565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561087e578082015181840152602081019050610863565b50505050905090810190601f1680156108ab5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156108c557600080fd5b506108f2600480360360208110156108dc57600080fd5b8101908080359060200190929190505050612894565b6040518082815260200191505060405180910390f35b34801561091457600080fd5b506109576004803603602081101561092b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506128ac565b005b34801561096557600080fd5b506109926004803603602081101561097c57600080fd5b8101908080359060200190929190505050612c3e565b005b610b3860048036036101408110156109ab57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156109f257600080fd5b820183602082011115610a0457600080fd5b80359060200191846001830284011164010000000083111715610a2657600080fd5b9091929391929390803560ff169060200190929190803590602001909291908035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190640100000000811115610ab257600080fd5b820183602082011115610ac457600080fd5b80359060200191846001830284011164010000000083111715610ae657600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050612d78565b60405180821515815260200191505060405180910390f35b348015610b5c57600080fd5b50610ba960048036036040811015610b7357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506132b5565b6040518082815260200191505060405180910390f35b348015610bcb57600080fd5b50610d2660048036036060811015610be257600080fd5b810190808035906020019092919080359060200190640100000000811115610c0957600080fd5b820183602082011115610c1b57600080fd5b80359060200191846001830284011164010000000083111715610c3d57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190640100000000811115610ca057600080fd5b820183602082011115610cb257600080fd5b80359060200191846001830284011164010000000083111715610cd457600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506132da565b005b348015610d3457600080fd5b50610d3d613369565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610d80578082015181840152602081019050610d65565b505050509050019250505060405180910390f35b348015610da057600080fd5b50610da9613512565b6040518082815260200191505060405180910390f35b348015610dcb57600080fd5b50610ea560048036036040811015610de257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190640100000000811115610e1f57600080fd5b820183602082011115610e3157600080fd5b80359060200191846001830284011164010000000083111715610e5357600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050613518565b005b348015610eb357600080fd5b506110156004803603610100811015610ecb57600080fd5b8101908080359060200190640100000000811115610ee857600080fd5b820183602082011115610efa57600080fd5b80359060200191846020830284011164010000000083111715610f1c57600080fd5b909192939192939080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190640100000000811115610f6757600080fd5b820183602082011115610f7957600080fd5b80359060200191846001830284011164010000000083111715610f9b57600080fd5b9091929391929390803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061353a565b005b34801561102357600080fd5b506110d26004803603608081101561103a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561108157600080fd5b82018360208201111561109357600080fd5b803590602001918460018302840111640100000000831117156110b557600080fd5b9091929391929390803560ff1690602001909291905050506136f8565b6040518082815260200191505060405180910390f35b3480156110f457600080fd5b506111416004803603604081101561110b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050613820565b60405180806020018373ffffffffffffffffffffffffffffffffffffffff168152602001828103825284818151815260200191508051906020019060200280838360005b838110156111a0578082015181840152602081019050611185565b50505050905001935050505060405180910390f35b3480156111c157600080fd5b506111ee600480360360208110156111d857600080fd5b8101908080359060200190929190505050613a12565b005b3480156111fc57600080fd5b50611314600480360361014081101561121457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561125b57600080fd5b82018360208201111561126d57600080fd5b8035906020019184600183028401116401000000008311171561128f57600080fd5b9091929391929390803560ff169060200190929190803590602001909291908035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050613bb1565b6040518082815260200191505060405180910390f35b34801561133657600080fd5b506113996004803603604081101561134d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613bde565b005b3480156113a757600080fd5b506113ea600480360360208110156113be57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613f6f565b005b3480156113f857600080fd5b5061147b6004803603606081101561140f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613ff3565b005b34801561148957600080fd5b50611492614665565b6040518082815260200191505060405180910390f35b3480156114b457600080fd5b506115cc60048036036101408110156114cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561151357600080fd5b82018360208201111561152557600080fd5b8035906020019184600183028401116401000000008311171561154757600080fd5b9091929391929390803560ff169060200190929190803590602001909291908035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061466f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561160c5780820151818401526020810190506115f1565b50505050905090810190601f1680156116395780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561165357600080fd5b506116966004803603602081101561166a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050614817565b005b3480156116a457600080fd5b506116ad614878565b6040518082815260200191505060405180910390f35b3480156116cf57600080fd5b5061173c600480360360608110156116e657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506148f6565b005b34801561174a57600080fd5b50611753614d29565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611793578082015181840152602081019050611778565b50505050905090810190601f1680156117c05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6117d6614d62565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141580156118405750600173ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561187857503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b6118ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303300000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146119eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303400000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60026000600173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508160026000600173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506003600081548092919060010191905055507f9465fa0c962cc76958e6373a993326400c1c94f8be2fe3a952adfa7f60b2ea2682604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a18060045414611bba57611bb981612c3e565b5b5050565b611bd2604182614e0590919063ffffffff16565b82511015611c48576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330323000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000808060008060005b8681101561243457611c648882614e3f565b80945081955082965050505060008460ff16141561206d578260001c9450611c96604188614e0590919063ffffffff16565b8260001c1015611d0e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330323100000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b8751611d2760208460001c614e6e90919063ffffffff16565b1115611d9b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330323200000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60006020838a01015190508851611dd182611dc360208760001c614e6e90919063ffffffff16565b614e6e90919063ffffffff16565b1115611e45576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330323300000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60606020848b010190506320c13b0b60e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168773ffffffffffffffffffffffffffffffffffffffff166320c13b0b8d846040518363ffffffff1660e01b8152600401808060200180602001838103835285818151815260200191508051906020019080838360005b83811015611ee7578082015181840152602081019050611ecc565b50505050905090810190601f168015611f145780820380516001836020036101000a031916815260200191505b50838103825284818151815260200191508051906020019080838360005b83811015611f4d578082015181840152602081019050611f32565b50505050905090810190601f168015611f7a5780820380516001836020036101000a031916815260200191505b5094505050505060206040518083038186803b158015611f9957600080fd5b505afa158015611fad573d6000803e3d6000fd5b505050506040513d6020811015611fc357600080fd5b81019080805190602001909291905050507bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614612066576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330323400000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b50506122b2565b60018460ff161415612181578260001c94508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061210a57506000600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008c81526020019081526020016000205414155b61217c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330323500000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6122b1565b601e8460ff1611156122495760018a60405160200180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c018281526020019150506040516020818303038152906040528051906020012060048603858560405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015612238573d6000803e3d6000fd5b5050506020604051035194506122b0565b60018a85858560405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa1580156122a3573d6000803e3d6000fd5b5050506020604051035194505b5b5b8573ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161180156123795750600073ffffffffffffffffffffffffffffffffffffffff16600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b80156123b25750600173ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b612424576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330323600000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b8495508080600101915050611c52565b50505050505050505050565b60008173ffffffffffffffffffffffffffffffffffffffff16600173ffffffffffffffffffffffffffffffffffffffff161415801561250b5750600073ffffffffffffffffffffffffffffffffffffffff16600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b9050919050565b6000600173ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141580156125dd5750600073ffffffffffffffffffffffffffffffffffffffff16600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b9050919050565b6000804690508091505090565b6000600173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141580156126bc5750600073ffffffffffffffffffffffffffffffffffffffff16600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b61272e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475331303400000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b61273b858585855a614e8d565b9050801561278b573373ffffffffffffffffffffffffffffffffffffffff167f6895c13664aa4f67288b25d7a21d7aaa34916e355fb9b6fae0a139a9085becb860405160405180910390a26127cf565b3373ffffffffffffffffffffffffffffffffffffffff167facd2c8702804128fdb0db2bb49f6d127dd0181c13fd45dbfe16de0930e2bd37560405160405180910390a25b949350505050565b600060606127e7868686866125f1565b915060405160203d0181016040523d81523d6000602083013e8091505094509492505050565b606060006020830267ffffffffffffffff8111801561282b57600080fd5b506040519080825280601f01601f19166020018201604052801561285e5781602001600182028036833780820191505090505b50905060005b8381101561288957808501548060208302602085010152508080600101915050612864565b508091505092915050565b60076020528060005260406000206000915090505481565b6128b4614d62565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415801561291e5750600173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b612990576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475331303100000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612a91576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475331303200000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60016000600173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508060016000600173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fecdf3a3effea5783a3c4c2140e677577666428d44ed9d474a0b3a4c9943f844081604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b612c46614d62565b600354811115612cbe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303100000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001811015612d35576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303200000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b806004819055507f610f7ff2b304ae8903c3de74c60c6ab1f7d6226b3f52c5161905bb5ad4039c936004546040518082815260200191505060405180910390a150565b6000806000612d928e8e8e8e8e8e8e8e8e8e60055461466f565b905060056000815480929190600101919050555080805190602001209150612dbb8282866132da565b506000612dc6614ed9565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614612fac578073ffffffffffffffffffffffffffffffffffffffff166375f0bb528f8f8f8f8f8f8f8f8f8f8f336040518d63ffffffff1660e01b8152600401808d73ffffffffffffffffffffffffffffffffffffffff1681526020018c8152602001806020018a6001811115612e6957fe5b81526020018981526020018881526020018781526020018673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff168152602001806020018473ffffffffffffffffffffffffffffffffffffffff16815260200183810383528d8d82818152602001925080828437600081840152601f19601f820116905080830192505050838103825285818151815260200191508051906020019080838360005b83811015612f3b578082015181840152602081019050612f20565b50505050905090810190601f168015612f685780820380516001836020036101000a031916815260200191505b509e505050505050505050505050505050600060405180830381600087803b158015612f9357600080fd5b505af1158015612fa7573d6000803e3d6000fd5b505050505b6101f4612fd36109c48b01603f60408d0281612fc457fe5b04614f0a90919063ffffffff16565b015a1015613049576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330313000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005a90506130b28f8f8f8f8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050508e60008d146130a7578e6130ad565b6109c45a035b614e8d565b93506130c75a82614f2490919063ffffffff16565b905083806130d6575060008a14155b806130e2575060008814155b613154576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330313300000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008089111561316e5761316b828b8b8b8b614f44565b90505b84156131b8577f442e715f626346e8c54381002da614f62bee8d27386535b2521ec8540898556e8482604051808381526020018281526020019250505060405180910390a16131f8565b7f23428b18acfb3ea64b08dc0c1d296ea9c09702c09083ca5272e64d115b687d238482604051808381526020018281526020019250505060405180910390a15b5050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146132a4578073ffffffffffffffffffffffffffffffffffffffff16639327136883856040518363ffffffff1660e01b815260040180838152602001821515815260200192505050600060405180830381600087803b15801561328b57600080fd5b505af115801561329f573d6000803e3d6000fd5b505050505b50509b9a5050505050505050505050565b6008602052816000526040600020602052806000526040600020600091509150505481565b6000600454905060008111613357576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330303100000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b61336384848484611bbe565b50505050565b6060600060035467ffffffffffffffff8111801561338657600080fd5b506040519080825280602002602001820160405280156133b55781602001602082028036833780820191505090505b50905060008060026000600173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505b600173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614613509578083838151811061346057fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050818060010192505061341f565b82935050505090565b60055481565b600080825160208401855af4806000523d6020523d600060403e60403d016000fd5b6135858a8a80806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050508961514a565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16146135c3576135c28461564a565b5b6136118787878080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050615679565b600082111561362b5761362982600060018685614f44565b505b3373ffffffffffffffffffffffffffffffffffffffff167f141df868a6331af528e38c83b7aa03edc19be66e37ae67f9285bf4f8e3c6a1a88b8b8b8b8960405180806020018581526020018473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281038252878782818152602001925060200280828437600081840152601f19601f820116905080830192505050965050505050505060405180910390a250505050505050505050565b6000805a905061374f878787878080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050865a614e8d565b61375857600080fd5b60005a8203905080604051602001808281526020019150506040516020818303038152906040526040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156137e55780820151818401526020810190506137ca565b50505050905090810190601f1680156138125780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b606060008267ffffffffffffffff8111801561383b57600080fd5b5060405190808252806020026020018201604052801561386a5781602001602082028036833780820191505090505b509150600080600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415801561393d5750600173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b801561394857508482105b15613a03578084838151811061395a57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600160008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081806001019250506138d3565b80925081845250509250929050565b600073ffffffffffffffffffffffffffffffffffffffff16600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415613b14576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330333000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000838152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff16817ff2a0eb156472d1440255b0d7c1e19cc07115d1051fe605b0dce69acfec884d9c60405160405180910390a350565b6000613bc68c8c8c8c8c8c8c8c8c8c8c61466f565b8051906020012090509b9a5050505050505050505050565b613be6614d62565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614158015613c505750600173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b613cc2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475331303100000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614613dc2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475331303300000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600160008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507faab4fa2b463f581b2b32cb3b7e3b704b9ce37cc209b5fb4d77e593ace405427681604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a15050565b613f77614d62565b60007f4a204f620c8c5ccdca3fd54d003badd85ba500436a431f0cbda4f558c93c34c860001b90508181557f1151116914515bc0891ff9047a6cb32cf902546f83066499bcf8ba33d2353fa282604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a15050565b613ffb614d62565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141580156140655750600173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b801561409d57503073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b61410f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303300000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614614210576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303400000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561427a5750600173ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b6142ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303300000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff16600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146143ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303500000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507ff8d49fc529812e9a7c5c50e69c20f0dccc0db8fa95c98bc58cc9a4f1c1299eaf82604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a17f9465fa0c962cc76958e6373a993326400c1c94f8be2fe3a952adfa7f60b2ea2681604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1505050565b6000600454905090565b606060007fbb8310d486368db6bd6f849402fdd73ad53d316b5a4b2644ad6efe0f941286d860001b8d8d8d8d60405180838380828437808301925050509250505060405180910390208c8c8c8c8c8c8c604051602001808c81526020018b73ffffffffffffffffffffffffffffffffffffffff1681526020018a815260200189815260200188600181111561470057fe5b81526020018781526020018681526020018581526020018473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019b505050505050505050505050604051602081830303815290604052805190602001209050601960f81b600160f81b61478c614878565b8360405160200180857effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168152600101847effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526001018381526020018281526020019450505050506040516020818303038152906040529150509b9a5050505050505050505050565b61481f614d62565b6148288161564a565b7f5ac6c46c93c8d0e53714ba3b53db3e7c046da994313d7ed0d192028bc7c228b081604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b60007f47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a7946921860001b6148a66125e4565b30604051602001808481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff168152602001935050505060405160208183030381529060405280519060200120905090565b6148fe614d62565b806001600354031015614979576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303100000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141580156149e35750600173ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b614a55576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303300000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff16600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614614b55576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303500000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600360008154809291906001900391905055507ff8d49fc529812e9a7c5c50e69c20f0dccc0db8fa95c98bc58cc9a4f1c1299eaf82604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a18060045414614d2457614d2381612c3e565b5b505050565b6040518060400160405280600581526020017f312e332e3000000000000000000000000000000000000000000000000000000081525081565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614614e03576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330333100000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b565b600080831415614e185760009050614e39565b6000828402905082848281614e2957fe5b0414614e3457600080fd5b809150505b92915050565b60008060008360410260208101860151925060408101860151915060ff60418201870151169350509250925092565b600080828401905083811015614e8357600080fd5b8091505092915050565b6000600180811115614e9b57fe5b836001811115614ea757fe5b1415614ec0576000808551602087018986f49050614ed0565b600080855160208701888a87f190505b95945050505050565b6000807f4a204f620c8c5ccdca3fd54d003badd85ba500436a431f0cbda4f558c93c34c860001b9050805491505090565b600081831015614f1a5781614f1c565b825b905092915050565b600082821115614f3357600080fd5b600082840390508091505092915050565b600080600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614614f815782614f83565b325b9050600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141561509b57614fed3a8610614fca573a614fcc565b855b614fdf888a614e6e90919063ffffffff16565b614e0590919063ffffffff16565b91508073ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050615096576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330313100000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b615140565b6150c0856150b2888a614e6e90919063ffffffff16565b614e0590919063ffffffff16565b91506150cd8482846158b4565b61513f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330313200000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b5b5095945050505050565b6000600454146151c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b8151811115615239576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303100000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60018110156152b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303200000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60006001905060005b83518110156155b65760008482815181106152d057fe5b60200260200101519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141580156153445750600173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b801561537c57503073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b80156153b457508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b615426576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303300000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614615527576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303400000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508092505080806001019150506152b9565b506001600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550825160038190555081600481905550505050565b60007f6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d560001b90508181555050565b600073ffffffffffffffffffffffffffffffffffffffff1660016000600173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461577b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475331303000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001806000600173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16146158b05761583d8260008360015a614e8d565b6158af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330303000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b5b5050565b60008063a9059cbb8484604051602401808373ffffffffffffffffffffffffffffffffffffffff168152602001828152602001925050506040516020818303038152906040529060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050509050602060008251602084016000896127105a03f13d6000811461595b5760208114615963576000935061596e565b81935061596e565b600051158215171593505b505050939250505056fea26469706673582212203874bcf92e1722cc7bfa0cef1a0985cf0dc3485ba0663db3747ccdf1605df53464736f6c63430007060033", +} + +// SafeV130ABI is the input ABI used to generate the binding from. +// Deprecated: Use SafeV130MetaData.ABI instead. +var SafeV130ABI = SafeV130MetaData.ABI + +// SafeV130Bin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use SafeV130MetaData.Bin instead. +var SafeV130Bin = SafeV130MetaData.Bin + +// DeploySafeV130 deploys a new Ethereum contract, binding an instance of SafeV130 to it. +func DeploySafeV130(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *SafeV130, error) { + parsed, err := SafeV130MetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(SafeV130Bin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &SafeV130{SafeV130Caller: SafeV130Caller{contract: contract}, SafeV130Transactor: SafeV130Transactor{contract: contract}, SafeV130Filterer: SafeV130Filterer{contract: contract}}, nil +} + +// SafeV130 is an auto generated Go binding around an Ethereum contract. +type SafeV130 struct { + SafeV130Caller // Read-only binding to the contract + SafeV130Transactor // Write-only binding to the contract + SafeV130Filterer // Log filterer for contract events +} + +// SafeV130Caller is an auto generated read-only Go binding around an Ethereum contract. +type SafeV130Caller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SafeV130Transactor is an auto generated write-only Go binding around an Ethereum contract. +type SafeV130Transactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SafeV130Filterer is an auto generated log filtering Go binding around an Ethereum contract events. +type SafeV130Filterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SafeV130Session is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type SafeV130Session struct { + Contract *SafeV130 // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// SafeV130CallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type SafeV130CallerSession struct { + Contract *SafeV130Caller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// SafeV130TransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type SafeV130TransactorSession struct { + Contract *SafeV130Transactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// SafeV130Raw is an auto generated low-level Go binding around an Ethereum contract. +type SafeV130Raw struct { + Contract *SafeV130 // Generic contract binding to access the raw methods on +} + +// SafeV130CallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type SafeV130CallerRaw struct { + Contract *SafeV130Caller // Generic read-only contract binding to access the raw methods on +} + +// SafeV130TransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type SafeV130TransactorRaw struct { + Contract *SafeV130Transactor // Generic write-only contract binding to access the raw methods on +} + +// NewSafeV130 creates a new instance of SafeV130, bound to a specific deployed contract. +func NewSafeV130(address common.Address, backend bind.ContractBackend) (*SafeV130, error) { + contract, err := bindSafeV130(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &SafeV130{SafeV130Caller: SafeV130Caller{contract: contract}, SafeV130Transactor: SafeV130Transactor{contract: contract}, SafeV130Filterer: SafeV130Filterer{contract: contract}}, nil +} + +// NewSafeV130Caller creates a new read-only instance of SafeV130, bound to a specific deployed contract. +func NewSafeV130Caller(address common.Address, caller bind.ContractCaller) (*SafeV130Caller, error) { + contract, err := bindSafeV130(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &SafeV130Caller{contract: contract}, nil +} + +// NewSafeV130Transactor creates a new write-only instance of SafeV130, bound to a specific deployed contract. +func NewSafeV130Transactor(address common.Address, transactor bind.ContractTransactor) (*SafeV130Transactor, error) { + contract, err := bindSafeV130(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &SafeV130Transactor{contract: contract}, nil +} + +// NewSafeV130Filterer creates a new log filterer instance of SafeV130, bound to a specific deployed contract. +func NewSafeV130Filterer(address common.Address, filterer bind.ContractFilterer) (*SafeV130Filterer, error) { + contract, err := bindSafeV130(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &SafeV130Filterer{contract: contract}, nil +} + +// bindSafeV130 binds a generic wrapper to an already deployed contract. +func bindSafeV130(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(SafeV130ABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_SafeV130 *SafeV130Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _SafeV130.Contract.SafeV130Caller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_SafeV130 *SafeV130Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SafeV130.Contract.SafeV130Transactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_SafeV130 *SafeV130Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _SafeV130.Contract.SafeV130Transactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_SafeV130 *SafeV130CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _SafeV130.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_SafeV130 *SafeV130TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SafeV130.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_SafeV130 *SafeV130TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _SafeV130.Contract.contract.Transact(opts, method, params...) +} + +// VERSION is a free data retrieval call binding the contract method 0xffa1ad74. +// +// Solidity: function VERSION() view returns(string) +func (_SafeV130 *SafeV130Caller) VERSION(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _SafeV130.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 0xffa1ad74. +// +// Solidity: function VERSION() view returns(string) +func (_SafeV130 *SafeV130Session) VERSION() (string, error) { + return _SafeV130.Contract.VERSION(&_SafeV130.CallOpts) +} + +// VERSION is a free data retrieval call binding the contract method 0xffa1ad74. +// +// Solidity: function VERSION() view returns(string) +func (_SafeV130 *SafeV130CallerSession) VERSION() (string, error) { + return _SafeV130.Contract.VERSION(&_SafeV130.CallOpts) +} + +// ApprovedHashes is a free data retrieval call binding the contract method 0x7d832974. +// +// Solidity: function approvedHashes(address , bytes32 ) view returns(uint256) +func (_SafeV130 *SafeV130Caller) ApprovedHashes(opts *bind.CallOpts, arg0 common.Address, arg1 [32]byte) (*big.Int, error) { + var out []interface{} + err := _SafeV130.contract.Call(opts, &out, "approvedHashes", arg0, arg1) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// ApprovedHashes is a free data retrieval call binding the contract method 0x7d832974. +// +// Solidity: function approvedHashes(address , bytes32 ) view returns(uint256) +func (_SafeV130 *SafeV130Session) ApprovedHashes(arg0 common.Address, arg1 [32]byte) (*big.Int, error) { + return _SafeV130.Contract.ApprovedHashes(&_SafeV130.CallOpts, arg0, arg1) +} + +// ApprovedHashes is a free data retrieval call binding the contract method 0x7d832974. +// +// Solidity: function approvedHashes(address , bytes32 ) view returns(uint256) +func (_SafeV130 *SafeV130CallerSession) ApprovedHashes(arg0 common.Address, arg1 [32]byte) (*big.Int, error) { + return _SafeV130.Contract.ApprovedHashes(&_SafeV130.CallOpts, arg0, arg1) +} + +// CheckNSignatures is a free data retrieval call binding the contract method 0x12fb68e0. +// +// Solidity: function checkNSignatures(bytes32 dataHash, bytes data, bytes signatures, uint256 requiredSignatures) view returns() +func (_SafeV130 *SafeV130Caller) CheckNSignatures(opts *bind.CallOpts, dataHash [32]byte, data []byte, signatures []byte, requiredSignatures *big.Int) error { + var out []interface{} + err := _SafeV130.contract.Call(opts, &out, "checkNSignatures", dataHash, data, signatures, requiredSignatures) + + if err != nil { + return err + } + + return err + +} + +// CheckNSignatures is a free data retrieval call binding the contract method 0x12fb68e0. +// +// Solidity: function checkNSignatures(bytes32 dataHash, bytes data, bytes signatures, uint256 requiredSignatures) view returns() +func (_SafeV130 *SafeV130Session) CheckNSignatures(dataHash [32]byte, data []byte, signatures []byte, requiredSignatures *big.Int) error { + return _SafeV130.Contract.CheckNSignatures(&_SafeV130.CallOpts, dataHash, data, signatures, requiredSignatures) +} + +// CheckNSignatures is a free data retrieval call binding the contract method 0x12fb68e0. +// +// Solidity: function checkNSignatures(bytes32 dataHash, bytes data, bytes signatures, uint256 requiredSignatures) view returns() +func (_SafeV130 *SafeV130CallerSession) CheckNSignatures(dataHash [32]byte, data []byte, signatures []byte, requiredSignatures *big.Int) error { + return _SafeV130.Contract.CheckNSignatures(&_SafeV130.CallOpts, dataHash, data, signatures, requiredSignatures) +} + +// CheckSignatures is a free data retrieval call binding the contract method 0x934f3a11. +// +// Solidity: function checkSignatures(bytes32 dataHash, bytes data, bytes signatures) view returns() +func (_SafeV130 *SafeV130Caller) CheckSignatures(opts *bind.CallOpts, dataHash [32]byte, data []byte, signatures []byte) error { + var out []interface{} + err := _SafeV130.contract.Call(opts, &out, "checkSignatures", dataHash, data, signatures) + + if err != nil { + return err + } + + return err + +} + +// CheckSignatures is a free data retrieval call binding the contract method 0x934f3a11. +// +// Solidity: function checkSignatures(bytes32 dataHash, bytes data, bytes signatures) view returns() +func (_SafeV130 *SafeV130Session) CheckSignatures(dataHash [32]byte, data []byte, signatures []byte) error { + return _SafeV130.Contract.CheckSignatures(&_SafeV130.CallOpts, dataHash, data, signatures) +} + +// CheckSignatures is a free data retrieval call binding the contract method 0x934f3a11. +// +// Solidity: function checkSignatures(bytes32 dataHash, bytes data, bytes signatures) view returns() +func (_SafeV130 *SafeV130CallerSession) CheckSignatures(dataHash [32]byte, data []byte, signatures []byte) error { + return _SafeV130.Contract.CheckSignatures(&_SafeV130.CallOpts, dataHash, data, signatures) +} + +// DomainSeparator is a free data retrieval call binding the contract method 0xf698da25. +// +// Solidity: function domainSeparator() view returns(bytes32) +func (_SafeV130 *SafeV130Caller) DomainSeparator(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _SafeV130.contract.Call(opts, &out, "domainSeparator") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// DomainSeparator is a free data retrieval call binding the contract method 0xf698da25. +// +// Solidity: function domainSeparator() view returns(bytes32) +func (_SafeV130 *SafeV130Session) DomainSeparator() ([32]byte, error) { + return _SafeV130.Contract.DomainSeparator(&_SafeV130.CallOpts) +} + +// DomainSeparator is a free data retrieval call binding the contract method 0xf698da25. +// +// Solidity: function domainSeparator() view returns(bytes32) +func (_SafeV130 *SafeV130CallerSession) DomainSeparator() ([32]byte, error) { + return _SafeV130.Contract.DomainSeparator(&_SafeV130.CallOpts) +} + +// EncodeTransactionData is a free data retrieval call binding the contract method 0xe86637db. +// +// Solidity: function encodeTransactionData(address to, uint256 value, bytes data, uint8 operation, uint256 safeTxGas, uint256 baseGas, uint256 gasPrice, address gasToken, address refundReceiver, uint256 _nonce) view returns(bytes) +func (_SafeV130 *SafeV130Caller) EncodeTransactionData(opts *bind.CallOpts, to common.Address, value *big.Int, data []byte, operation uint8, safeTxGas *big.Int, baseGas *big.Int, gasPrice *big.Int, gasToken common.Address, refundReceiver common.Address, _nonce *big.Int) ([]byte, error) { + var out []interface{} + err := _SafeV130.contract.Call(opts, &out, "encodeTransactionData", to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +// EncodeTransactionData is a free data retrieval call binding the contract method 0xe86637db. +// +// Solidity: function encodeTransactionData(address to, uint256 value, bytes data, uint8 operation, uint256 safeTxGas, uint256 baseGas, uint256 gasPrice, address gasToken, address refundReceiver, uint256 _nonce) view returns(bytes) +func (_SafeV130 *SafeV130Session) EncodeTransactionData(to common.Address, value *big.Int, data []byte, operation uint8, safeTxGas *big.Int, baseGas *big.Int, gasPrice *big.Int, gasToken common.Address, refundReceiver common.Address, _nonce *big.Int) ([]byte, error) { + return _SafeV130.Contract.EncodeTransactionData(&_SafeV130.CallOpts, to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce) +} + +// EncodeTransactionData is a free data retrieval call binding the contract method 0xe86637db. +// +// Solidity: function encodeTransactionData(address to, uint256 value, bytes data, uint8 operation, uint256 safeTxGas, uint256 baseGas, uint256 gasPrice, address gasToken, address refundReceiver, uint256 _nonce) view returns(bytes) +func (_SafeV130 *SafeV130CallerSession) EncodeTransactionData(to common.Address, value *big.Int, data []byte, operation uint8, safeTxGas *big.Int, baseGas *big.Int, gasPrice *big.Int, gasToken common.Address, refundReceiver common.Address, _nonce *big.Int) ([]byte, error) { + return _SafeV130.Contract.EncodeTransactionData(&_SafeV130.CallOpts, to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce) +} + +// GetChainId is a free data retrieval call binding the contract method 0x3408e470. +// +// Solidity: function getChainId() view returns(uint256) +func (_SafeV130 *SafeV130Caller) GetChainId(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _SafeV130.contract.Call(opts, &out, "getChainId") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetChainId is a free data retrieval call binding the contract method 0x3408e470. +// +// Solidity: function getChainId() view returns(uint256) +func (_SafeV130 *SafeV130Session) GetChainId() (*big.Int, error) { + return _SafeV130.Contract.GetChainId(&_SafeV130.CallOpts) +} + +// GetChainId is a free data retrieval call binding the contract method 0x3408e470. +// +// Solidity: function getChainId() view returns(uint256) +func (_SafeV130 *SafeV130CallerSession) GetChainId() (*big.Int, error) { + return _SafeV130.Contract.GetChainId(&_SafeV130.CallOpts) +} + +// GetModulesPaginated is a free data retrieval call binding the contract method 0xcc2f8452. +// +// Solidity: function getModulesPaginated(address start, uint256 pageSize) view returns(address[] array, address next) +func (_SafeV130 *SafeV130Caller) GetModulesPaginated(opts *bind.CallOpts, start common.Address, pageSize *big.Int) (struct { + Array []common.Address + Next common.Address +}, error) { + var out []interface{} + err := _SafeV130.contract.Call(opts, &out, "getModulesPaginated", start, pageSize) + + outstruct := new(struct { + Array []common.Address + Next common.Address + }) + if err != nil { + return *outstruct, err + } + + outstruct.Array = *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + outstruct.Next = *abi.ConvertType(out[1], new(common.Address)).(*common.Address) + + return *outstruct, err + +} + +// GetModulesPaginated is a free data retrieval call binding the contract method 0xcc2f8452. +// +// Solidity: function getModulesPaginated(address start, uint256 pageSize) view returns(address[] array, address next) +func (_SafeV130 *SafeV130Session) GetModulesPaginated(start common.Address, pageSize *big.Int) (struct { + Array []common.Address + Next common.Address +}, error) { + return _SafeV130.Contract.GetModulesPaginated(&_SafeV130.CallOpts, start, pageSize) +} + +// GetModulesPaginated is a free data retrieval call binding the contract method 0xcc2f8452. +// +// Solidity: function getModulesPaginated(address start, uint256 pageSize) view returns(address[] array, address next) +func (_SafeV130 *SafeV130CallerSession) GetModulesPaginated(start common.Address, pageSize *big.Int) (struct { + Array []common.Address + Next common.Address +}, error) { + return _SafeV130.Contract.GetModulesPaginated(&_SafeV130.CallOpts, start, pageSize) +} + +// GetOwners is a free data retrieval call binding the contract method 0xa0e67e2b. +// +// Solidity: function getOwners() view returns(address[]) +func (_SafeV130 *SafeV130Caller) GetOwners(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _SafeV130.contract.Call(opts, &out, "getOwners") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +// GetOwners is a free data retrieval call binding the contract method 0xa0e67e2b. +// +// Solidity: function getOwners() view returns(address[]) +func (_SafeV130 *SafeV130Session) GetOwners() ([]common.Address, error) { + return _SafeV130.Contract.GetOwners(&_SafeV130.CallOpts) +} + +// GetOwners is a free data retrieval call binding the contract method 0xa0e67e2b. +// +// Solidity: function getOwners() view returns(address[]) +func (_SafeV130 *SafeV130CallerSession) GetOwners() ([]common.Address, error) { + return _SafeV130.Contract.GetOwners(&_SafeV130.CallOpts) +} + +// GetStorageAt is a free data retrieval call binding the contract method 0x5624b25b. +// +// Solidity: function getStorageAt(uint256 offset, uint256 length) view returns(bytes) +func (_SafeV130 *SafeV130Caller) GetStorageAt(opts *bind.CallOpts, offset *big.Int, length *big.Int) ([]byte, error) { + var out []interface{} + err := _SafeV130.contract.Call(opts, &out, "getStorageAt", offset, length) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +// GetStorageAt is a free data retrieval call binding the contract method 0x5624b25b. +// +// Solidity: function getStorageAt(uint256 offset, uint256 length) view returns(bytes) +func (_SafeV130 *SafeV130Session) GetStorageAt(offset *big.Int, length *big.Int) ([]byte, error) { + return _SafeV130.Contract.GetStorageAt(&_SafeV130.CallOpts, offset, length) +} + +// GetStorageAt is a free data retrieval call binding the contract method 0x5624b25b. +// +// Solidity: function getStorageAt(uint256 offset, uint256 length) view returns(bytes) +func (_SafeV130 *SafeV130CallerSession) GetStorageAt(offset *big.Int, length *big.Int) ([]byte, error) { + return _SafeV130.Contract.GetStorageAt(&_SafeV130.CallOpts, offset, length) +} + +// GetThreshold is a free data retrieval call binding the contract method 0xe75235b8. +// +// Solidity: function getThreshold() view returns(uint256) +func (_SafeV130 *SafeV130Caller) GetThreshold(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _SafeV130.contract.Call(opts, &out, "getThreshold") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetThreshold is a free data retrieval call binding the contract method 0xe75235b8. +// +// Solidity: function getThreshold() view returns(uint256) +func (_SafeV130 *SafeV130Session) GetThreshold() (*big.Int, error) { + return _SafeV130.Contract.GetThreshold(&_SafeV130.CallOpts) +} + +// GetThreshold is a free data retrieval call binding the contract method 0xe75235b8. +// +// Solidity: function getThreshold() view returns(uint256) +func (_SafeV130 *SafeV130CallerSession) GetThreshold() (*big.Int, error) { + return _SafeV130.Contract.GetThreshold(&_SafeV130.CallOpts) +} + +// GetTransactionHash is a free data retrieval call binding the contract method 0xd8d11f78. +// +// Solidity: function getTransactionHash(address to, uint256 value, bytes data, uint8 operation, uint256 safeTxGas, uint256 baseGas, uint256 gasPrice, address gasToken, address refundReceiver, uint256 _nonce) view returns(bytes32) +func (_SafeV130 *SafeV130Caller) GetTransactionHash(opts *bind.CallOpts, to common.Address, value *big.Int, data []byte, operation uint8, safeTxGas *big.Int, baseGas *big.Int, gasPrice *big.Int, gasToken common.Address, refundReceiver common.Address, _nonce *big.Int) ([32]byte, error) { + var out []interface{} + err := _SafeV130.contract.Call(opts, &out, "getTransactionHash", to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// GetTransactionHash is a free data retrieval call binding the contract method 0xd8d11f78. +// +// Solidity: function getTransactionHash(address to, uint256 value, bytes data, uint8 operation, uint256 safeTxGas, uint256 baseGas, uint256 gasPrice, address gasToken, address refundReceiver, uint256 _nonce) view returns(bytes32) +func (_SafeV130 *SafeV130Session) GetTransactionHash(to common.Address, value *big.Int, data []byte, operation uint8, safeTxGas *big.Int, baseGas *big.Int, gasPrice *big.Int, gasToken common.Address, refundReceiver common.Address, _nonce *big.Int) ([32]byte, error) { + return _SafeV130.Contract.GetTransactionHash(&_SafeV130.CallOpts, to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce) +} + +// GetTransactionHash is a free data retrieval call binding the contract method 0xd8d11f78. +// +// Solidity: function getTransactionHash(address to, uint256 value, bytes data, uint8 operation, uint256 safeTxGas, uint256 baseGas, uint256 gasPrice, address gasToken, address refundReceiver, uint256 _nonce) view returns(bytes32) +func (_SafeV130 *SafeV130CallerSession) GetTransactionHash(to common.Address, value *big.Int, data []byte, operation uint8, safeTxGas *big.Int, baseGas *big.Int, gasPrice *big.Int, gasToken common.Address, refundReceiver common.Address, _nonce *big.Int) ([32]byte, error) { + return _SafeV130.Contract.GetTransactionHash(&_SafeV130.CallOpts, to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce) +} + +// IsModuleEnabled is a free data retrieval call binding the contract method 0x2d9ad53d. +// +// Solidity: function isModuleEnabled(address module) view returns(bool) +func (_SafeV130 *SafeV130Caller) IsModuleEnabled(opts *bind.CallOpts, module common.Address) (bool, error) { + var out []interface{} + err := _SafeV130.contract.Call(opts, &out, "isModuleEnabled", module) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsModuleEnabled is a free data retrieval call binding the contract method 0x2d9ad53d. +// +// Solidity: function isModuleEnabled(address module) view returns(bool) +func (_SafeV130 *SafeV130Session) IsModuleEnabled(module common.Address) (bool, error) { + return _SafeV130.Contract.IsModuleEnabled(&_SafeV130.CallOpts, module) +} + +// IsModuleEnabled is a free data retrieval call binding the contract method 0x2d9ad53d. +// +// Solidity: function isModuleEnabled(address module) view returns(bool) +func (_SafeV130 *SafeV130CallerSession) IsModuleEnabled(module common.Address) (bool, error) { + return _SafeV130.Contract.IsModuleEnabled(&_SafeV130.CallOpts, module) +} + +// IsOwner is a free data retrieval call binding the contract method 0x2f54bf6e. +// +// Solidity: function isOwner(address owner) view returns(bool) +func (_SafeV130 *SafeV130Caller) IsOwner(opts *bind.CallOpts, owner common.Address) (bool, error) { + var out []interface{} + err := _SafeV130.contract.Call(opts, &out, "isOwner", owner) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsOwner is a free data retrieval call binding the contract method 0x2f54bf6e. +// +// Solidity: function isOwner(address owner) view returns(bool) +func (_SafeV130 *SafeV130Session) IsOwner(owner common.Address) (bool, error) { + return _SafeV130.Contract.IsOwner(&_SafeV130.CallOpts, owner) +} + +// IsOwner is a free data retrieval call binding the contract method 0x2f54bf6e. +// +// Solidity: function isOwner(address owner) view returns(bool) +func (_SafeV130 *SafeV130CallerSession) IsOwner(owner common.Address) (bool, error) { + return _SafeV130.Contract.IsOwner(&_SafeV130.CallOpts, owner) +} + +// Nonce is a free data retrieval call binding the contract method 0xaffed0e0. +// +// Solidity: function nonce() view returns(uint256) +func (_SafeV130 *SafeV130Caller) Nonce(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _SafeV130.contract.Call(opts, &out, "nonce") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Nonce is a free data retrieval call binding the contract method 0xaffed0e0. +// +// Solidity: function nonce() view returns(uint256) +func (_SafeV130 *SafeV130Session) Nonce() (*big.Int, error) { + return _SafeV130.Contract.Nonce(&_SafeV130.CallOpts) +} + +// Nonce is a free data retrieval call binding the contract method 0xaffed0e0. +// +// Solidity: function nonce() view returns(uint256) +func (_SafeV130 *SafeV130CallerSession) Nonce() (*big.Int, error) { + return _SafeV130.Contract.Nonce(&_SafeV130.CallOpts) +} + +// SignedMessages is a free data retrieval call binding the contract method 0x5ae6bd37. +// +// Solidity: function signedMessages(bytes32 ) view returns(uint256) +func (_SafeV130 *SafeV130Caller) SignedMessages(opts *bind.CallOpts, arg0 [32]byte) (*big.Int, error) { + var out []interface{} + err := _SafeV130.contract.Call(opts, &out, "signedMessages", arg0) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// SignedMessages is a free data retrieval call binding the contract method 0x5ae6bd37. +// +// Solidity: function signedMessages(bytes32 ) view returns(uint256) +func (_SafeV130 *SafeV130Session) SignedMessages(arg0 [32]byte) (*big.Int, error) { + return _SafeV130.Contract.SignedMessages(&_SafeV130.CallOpts, arg0) +} + +// SignedMessages is a free data retrieval call binding the contract method 0x5ae6bd37. +// +// Solidity: function signedMessages(bytes32 ) view returns(uint256) +func (_SafeV130 *SafeV130CallerSession) SignedMessages(arg0 [32]byte) (*big.Int, error) { + return _SafeV130.Contract.SignedMessages(&_SafeV130.CallOpts, arg0) +} + +// AddOwnerWithThreshold is a paid mutator transaction binding the contract method 0x0d582f13. +// +// Solidity: function addOwnerWithThreshold(address owner, uint256 _threshold) returns() +func (_SafeV130 *SafeV130Transactor) AddOwnerWithThreshold(opts *bind.TransactOpts, owner common.Address, _threshold *big.Int) (*types.Transaction, error) { + return _SafeV130.contract.Transact(opts, "addOwnerWithThreshold", owner, _threshold) +} + +// AddOwnerWithThreshold is a paid mutator transaction binding the contract method 0x0d582f13. +// +// Solidity: function addOwnerWithThreshold(address owner, uint256 _threshold) returns() +func (_SafeV130 *SafeV130Session) AddOwnerWithThreshold(owner common.Address, _threshold *big.Int) (*types.Transaction, error) { + return _SafeV130.Contract.AddOwnerWithThreshold(&_SafeV130.TransactOpts, owner, _threshold) +} + +// AddOwnerWithThreshold is a paid mutator transaction binding the contract method 0x0d582f13. +// +// Solidity: function addOwnerWithThreshold(address owner, uint256 _threshold) returns() +func (_SafeV130 *SafeV130TransactorSession) AddOwnerWithThreshold(owner common.Address, _threshold *big.Int) (*types.Transaction, error) { + return _SafeV130.Contract.AddOwnerWithThreshold(&_SafeV130.TransactOpts, owner, _threshold) +} + +// ApproveHash is a paid mutator transaction binding the contract method 0xd4d9bdcd. +// +// Solidity: function approveHash(bytes32 hashToApprove) returns() +func (_SafeV130 *SafeV130Transactor) ApproveHash(opts *bind.TransactOpts, hashToApprove [32]byte) (*types.Transaction, error) { + return _SafeV130.contract.Transact(opts, "approveHash", hashToApprove) +} + +// ApproveHash is a paid mutator transaction binding the contract method 0xd4d9bdcd. +// +// Solidity: function approveHash(bytes32 hashToApprove) returns() +func (_SafeV130 *SafeV130Session) ApproveHash(hashToApprove [32]byte) (*types.Transaction, error) { + return _SafeV130.Contract.ApproveHash(&_SafeV130.TransactOpts, hashToApprove) +} + +// ApproveHash is a paid mutator transaction binding the contract method 0xd4d9bdcd. +// +// Solidity: function approveHash(bytes32 hashToApprove) returns() +func (_SafeV130 *SafeV130TransactorSession) ApproveHash(hashToApprove [32]byte) (*types.Transaction, error) { + return _SafeV130.Contract.ApproveHash(&_SafeV130.TransactOpts, hashToApprove) +} + +// ChangeThreshold is a paid mutator transaction binding the contract method 0x694e80c3. +// +// Solidity: function changeThreshold(uint256 _threshold) returns() +func (_SafeV130 *SafeV130Transactor) ChangeThreshold(opts *bind.TransactOpts, _threshold *big.Int) (*types.Transaction, error) { + return _SafeV130.contract.Transact(opts, "changeThreshold", _threshold) +} + +// ChangeThreshold is a paid mutator transaction binding the contract method 0x694e80c3. +// +// Solidity: function changeThreshold(uint256 _threshold) returns() +func (_SafeV130 *SafeV130Session) ChangeThreshold(_threshold *big.Int) (*types.Transaction, error) { + return _SafeV130.Contract.ChangeThreshold(&_SafeV130.TransactOpts, _threshold) +} + +// ChangeThreshold is a paid mutator transaction binding the contract method 0x694e80c3. +// +// Solidity: function changeThreshold(uint256 _threshold) returns() +func (_SafeV130 *SafeV130TransactorSession) ChangeThreshold(_threshold *big.Int) (*types.Transaction, error) { + return _SafeV130.Contract.ChangeThreshold(&_SafeV130.TransactOpts, _threshold) +} + +// DisableModule is a paid mutator transaction binding the contract method 0xe009cfde. +// +// Solidity: function disableModule(address prevModule, address module) returns() +func (_SafeV130 *SafeV130Transactor) DisableModule(opts *bind.TransactOpts, prevModule common.Address, module common.Address) (*types.Transaction, error) { + return _SafeV130.contract.Transact(opts, "disableModule", prevModule, module) +} + +// DisableModule is a paid mutator transaction binding the contract method 0xe009cfde. +// +// Solidity: function disableModule(address prevModule, address module) returns() +func (_SafeV130 *SafeV130Session) DisableModule(prevModule common.Address, module common.Address) (*types.Transaction, error) { + return _SafeV130.Contract.DisableModule(&_SafeV130.TransactOpts, prevModule, module) +} + +// DisableModule is a paid mutator transaction binding the contract method 0xe009cfde. +// +// Solidity: function disableModule(address prevModule, address module) returns() +func (_SafeV130 *SafeV130TransactorSession) DisableModule(prevModule common.Address, module common.Address) (*types.Transaction, error) { + return _SafeV130.Contract.DisableModule(&_SafeV130.TransactOpts, prevModule, module) +} + +// EnableModule is a paid mutator transaction binding the contract method 0x610b5925. +// +// Solidity: function enableModule(address module) returns() +func (_SafeV130 *SafeV130Transactor) EnableModule(opts *bind.TransactOpts, module common.Address) (*types.Transaction, error) { + return _SafeV130.contract.Transact(opts, "enableModule", module) +} + +// EnableModule is a paid mutator transaction binding the contract method 0x610b5925. +// +// Solidity: function enableModule(address module) returns() +func (_SafeV130 *SafeV130Session) EnableModule(module common.Address) (*types.Transaction, error) { + return _SafeV130.Contract.EnableModule(&_SafeV130.TransactOpts, module) +} + +// EnableModule is a paid mutator transaction binding the contract method 0x610b5925. +// +// Solidity: function enableModule(address module) returns() +func (_SafeV130 *SafeV130TransactorSession) EnableModule(module common.Address) (*types.Transaction, error) { + return _SafeV130.Contract.EnableModule(&_SafeV130.TransactOpts, module) +} + +// ExecTransaction is a paid mutator transaction binding the contract method 0x6a761202. +// +// Solidity: function execTransaction(address to, uint256 value, bytes data, uint8 operation, uint256 safeTxGas, uint256 baseGas, uint256 gasPrice, address gasToken, address refundReceiver, bytes signatures) payable returns(bool success) +func (_SafeV130 *SafeV130Transactor) ExecTransaction(opts *bind.TransactOpts, to common.Address, value *big.Int, data []byte, operation uint8, safeTxGas *big.Int, baseGas *big.Int, gasPrice *big.Int, gasToken common.Address, refundReceiver common.Address, signatures []byte) (*types.Transaction, error) { + return _SafeV130.contract.Transact(opts, "execTransaction", to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, signatures) +} + +// ExecTransaction is a paid mutator transaction binding the contract method 0x6a761202. +// +// Solidity: function execTransaction(address to, uint256 value, bytes data, uint8 operation, uint256 safeTxGas, uint256 baseGas, uint256 gasPrice, address gasToken, address refundReceiver, bytes signatures) payable returns(bool success) +func (_SafeV130 *SafeV130Session) ExecTransaction(to common.Address, value *big.Int, data []byte, operation uint8, safeTxGas *big.Int, baseGas *big.Int, gasPrice *big.Int, gasToken common.Address, refundReceiver common.Address, signatures []byte) (*types.Transaction, error) { + return _SafeV130.Contract.ExecTransaction(&_SafeV130.TransactOpts, to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, signatures) +} + +// ExecTransaction is a paid mutator transaction binding the contract method 0x6a761202. +// +// Solidity: function execTransaction(address to, uint256 value, bytes data, uint8 operation, uint256 safeTxGas, uint256 baseGas, uint256 gasPrice, address gasToken, address refundReceiver, bytes signatures) payable returns(bool success) +func (_SafeV130 *SafeV130TransactorSession) ExecTransaction(to common.Address, value *big.Int, data []byte, operation uint8, safeTxGas *big.Int, baseGas *big.Int, gasPrice *big.Int, gasToken common.Address, refundReceiver common.Address, signatures []byte) (*types.Transaction, error) { + return _SafeV130.Contract.ExecTransaction(&_SafeV130.TransactOpts, to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, signatures) +} + +// ExecTransactionFromModule is a paid mutator transaction binding the contract method 0x468721a7. +// +// Solidity: function execTransactionFromModule(address to, uint256 value, bytes data, uint8 operation) returns(bool success) +func (_SafeV130 *SafeV130Transactor) ExecTransactionFromModule(opts *bind.TransactOpts, to common.Address, value *big.Int, data []byte, operation uint8) (*types.Transaction, error) { + return _SafeV130.contract.Transact(opts, "execTransactionFromModule", to, value, data, operation) +} + +// ExecTransactionFromModule is a paid mutator transaction binding the contract method 0x468721a7. +// +// Solidity: function execTransactionFromModule(address to, uint256 value, bytes data, uint8 operation) returns(bool success) +func (_SafeV130 *SafeV130Session) ExecTransactionFromModule(to common.Address, value *big.Int, data []byte, operation uint8) (*types.Transaction, error) { + return _SafeV130.Contract.ExecTransactionFromModule(&_SafeV130.TransactOpts, to, value, data, operation) +} + +// ExecTransactionFromModule is a paid mutator transaction binding the contract method 0x468721a7. +// +// Solidity: function execTransactionFromModule(address to, uint256 value, bytes data, uint8 operation) returns(bool success) +func (_SafeV130 *SafeV130TransactorSession) ExecTransactionFromModule(to common.Address, value *big.Int, data []byte, operation uint8) (*types.Transaction, error) { + return _SafeV130.Contract.ExecTransactionFromModule(&_SafeV130.TransactOpts, to, value, data, operation) +} + +// ExecTransactionFromModuleReturnData is a paid mutator transaction binding the contract method 0x5229073f. +// +// Solidity: function execTransactionFromModuleReturnData(address to, uint256 value, bytes data, uint8 operation) returns(bool success, bytes returnData) +func (_SafeV130 *SafeV130Transactor) ExecTransactionFromModuleReturnData(opts *bind.TransactOpts, to common.Address, value *big.Int, data []byte, operation uint8) (*types.Transaction, error) { + return _SafeV130.contract.Transact(opts, "execTransactionFromModuleReturnData", to, value, data, operation) +} + +// ExecTransactionFromModuleReturnData is a paid mutator transaction binding the contract method 0x5229073f. +// +// Solidity: function execTransactionFromModuleReturnData(address to, uint256 value, bytes data, uint8 operation) returns(bool success, bytes returnData) +func (_SafeV130 *SafeV130Session) ExecTransactionFromModuleReturnData(to common.Address, value *big.Int, data []byte, operation uint8) (*types.Transaction, error) { + return _SafeV130.Contract.ExecTransactionFromModuleReturnData(&_SafeV130.TransactOpts, to, value, data, operation) +} + +// ExecTransactionFromModuleReturnData is a paid mutator transaction binding the contract method 0x5229073f. +// +// Solidity: function execTransactionFromModuleReturnData(address to, uint256 value, bytes data, uint8 operation) returns(bool success, bytes returnData) +func (_SafeV130 *SafeV130TransactorSession) ExecTransactionFromModuleReturnData(to common.Address, value *big.Int, data []byte, operation uint8) (*types.Transaction, error) { + return _SafeV130.Contract.ExecTransactionFromModuleReturnData(&_SafeV130.TransactOpts, to, value, data, operation) +} + +// RemoveOwner is a paid mutator transaction binding the contract method 0xf8dc5dd9. +// +// Solidity: function removeOwner(address prevOwner, address owner, uint256 _threshold) returns() +func (_SafeV130 *SafeV130Transactor) RemoveOwner(opts *bind.TransactOpts, prevOwner common.Address, owner common.Address, _threshold *big.Int) (*types.Transaction, error) { + return _SafeV130.contract.Transact(opts, "removeOwner", prevOwner, owner, _threshold) +} + +// RemoveOwner is a paid mutator transaction binding the contract method 0xf8dc5dd9. +// +// Solidity: function removeOwner(address prevOwner, address owner, uint256 _threshold) returns() +func (_SafeV130 *SafeV130Session) RemoveOwner(prevOwner common.Address, owner common.Address, _threshold *big.Int) (*types.Transaction, error) { + return _SafeV130.Contract.RemoveOwner(&_SafeV130.TransactOpts, prevOwner, owner, _threshold) +} + +// RemoveOwner is a paid mutator transaction binding the contract method 0xf8dc5dd9. +// +// Solidity: function removeOwner(address prevOwner, address owner, uint256 _threshold) returns() +func (_SafeV130 *SafeV130TransactorSession) RemoveOwner(prevOwner common.Address, owner common.Address, _threshold *big.Int) (*types.Transaction, error) { + return _SafeV130.Contract.RemoveOwner(&_SafeV130.TransactOpts, prevOwner, owner, _threshold) +} + +// RequiredTxGas is a paid mutator transaction binding the contract method 0xc4ca3a9c. +// +// Solidity: function requiredTxGas(address to, uint256 value, bytes data, uint8 operation) returns(uint256) +func (_SafeV130 *SafeV130Transactor) RequiredTxGas(opts *bind.TransactOpts, to common.Address, value *big.Int, data []byte, operation uint8) (*types.Transaction, error) { + return _SafeV130.contract.Transact(opts, "requiredTxGas", to, value, data, operation) +} + +// RequiredTxGas is a paid mutator transaction binding the contract method 0xc4ca3a9c. +// +// Solidity: function requiredTxGas(address to, uint256 value, bytes data, uint8 operation) returns(uint256) +func (_SafeV130 *SafeV130Session) RequiredTxGas(to common.Address, value *big.Int, data []byte, operation uint8) (*types.Transaction, error) { + return _SafeV130.Contract.RequiredTxGas(&_SafeV130.TransactOpts, to, value, data, operation) +} + +// RequiredTxGas is a paid mutator transaction binding the contract method 0xc4ca3a9c. +// +// Solidity: function requiredTxGas(address to, uint256 value, bytes data, uint8 operation) returns(uint256) +func (_SafeV130 *SafeV130TransactorSession) RequiredTxGas(to common.Address, value *big.Int, data []byte, operation uint8) (*types.Transaction, error) { + return _SafeV130.Contract.RequiredTxGas(&_SafeV130.TransactOpts, to, value, data, operation) +} + +// SetFallbackHandler is a paid mutator transaction binding the contract method 0xf08a0323. +// +// Solidity: function setFallbackHandler(address handler) returns() +func (_SafeV130 *SafeV130Transactor) SetFallbackHandler(opts *bind.TransactOpts, handler common.Address) (*types.Transaction, error) { + return _SafeV130.contract.Transact(opts, "setFallbackHandler", handler) +} + +// SetFallbackHandler is a paid mutator transaction binding the contract method 0xf08a0323. +// +// Solidity: function setFallbackHandler(address handler) returns() +func (_SafeV130 *SafeV130Session) SetFallbackHandler(handler common.Address) (*types.Transaction, error) { + return _SafeV130.Contract.SetFallbackHandler(&_SafeV130.TransactOpts, handler) +} + +// SetFallbackHandler is a paid mutator transaction binding the contract method 0xf08a0323. +// +// Solidity: function setFallbackHandler(address handler) returns() +func (_SafeV130 *SafeV130TransactorSession) SetFallbackHandler(handler common.Address) (*types.Transaction, error) { + return _SafeV130.Contract.SetFallbackHandler(&_SafeV130.TransactOpts, handler) +} + +// SetGuard is a paid mutator transaction binding the contract method 0xe19a9dd9. +// +// Solidity: function setGuard(address guard) returns() +func (_SafeV130 *SafeV130Transactor) SetGuard(opts *bind.TransactOpts, guard common.Address) (*types.Transaction, error) { + return _SafeV130.contract.Transact(opts, "setGuard", guard) +} + +// SetGuard is a paid mutator transaction binding the contract method 0xe19a9dd9. +// +// Solidity: function setGuard(address guard) returns() +func (_SafeV130 *SafeV130Session) SetGuard(guard common.Address) (*types.Transaction, error) { + return _SafeV130.Contract.SetGuard(&_SafeV130.TransactOpts, guard) +} + +// SetGuard is a paid mutator transaction binding the contract method 0xe19a9dd9. +// +// Solidity: function setGuard(address guard) returns() +func (_SafeV130 *SafeV130TransactorSession) SetGuard(guard common.Address) (*types.Transaction, error) { + return _SafeV130.Contract.SetGuard(&_SafeV130.TransactOpts, guard) +} + +// Setup is a paid mutator transaction binding the contract method 0xb63e800d. +// +// Solidity: function setup(address[] _owners, uint256 _threshold, address to, bytes data, address fallbackHandler, address paymentToken, uint256 payment, address paymentReceiver) returns() +func (_SafeV130 *SafeV130Transactor) Setup(opts *bind.TransactOpts, _owners []common.Address, _threshold *big.Int, to common.Address, data []byte, fallbackHandler common.Address, paymentToken common.Address, payment *big.Int, paymentReceiver common.Address) (*types.Transaction, error) { + return _SafeV130.contract.Transact(opts, "setup", _owners, _threshold, to, data, fallbackHandler, paymentToken, payment, paymentReceiver) +} + +// Setup is a paid mutator transaction binding the contract method 0xb63e800d. +// +// Solidity: function setup(address[] _owners, uint256 _threshold, address to, bytes data, address fallbackHandler, address paymentToken, uint256 payment, address paymentReceiver) returns() +func (_SafeV130 *SafeV130Session) Setup(_owners []common.Address, _threshold *big.Int, to common.Address, data []byte, fallbackHandler common.Address, paymentToken common.Address, payment *big.Int, paymentReceiver common.Address) (*types.Transaction, error) { + return _SafeV130.Contract.Setup(&_SafeV130.TransactOpts, _owners, _threshold, to, data, fallbackHandler, paymentToken, payment, paymentReceiver) +} + +// Setup is a paid mutator transaction binding the contract method 0xb63e800d. +// +// Solidity: function setup(address[] _owners, uint256 _threshold, address to, bytes data, address fallbackHandler, address paymentToken, uint256 payment, address paymentReceiver) returns() +func (_SafeV130 *SafeV130TransactorSession) Setup(_owners []common.Address, _threshold *big.Int, to common.Address, data []byte, fallbackHandler common.Address, paymentToken common.Address, payment *big.Int, paymentReceiver common.Address) (*types.Transaction, error) { + return _SafeV130.Contract.Setup(&_SafeV130.TransactOpts, _owners, _threshold, to, data, fallbackHandler, paymentToken, payment, paymentReceiver) +} + +// SimulateAndRevert is a paid mutator transaction binding the contract method 0xb4faba09. +// +// Solidity: function simulateAndRevert(address targetContract, bytes calldataPayload) returns() +func (_SafeV130 *SafeV130Transactor) SimulateAndRevert(opts *bind.TransactOpts, targetContract common.Address, calldataPayload []byte) (*types.Transaction, error) { + return _SafeV130.contract.Transact(opts, "simulateAndRevert", targetContract, calldataPayload) +} + +// SimulateAndRevert is a paid mutator transaction binding the contract method 0xb4faba09. +// +// Solidity: function simulateAndRevert(address targetContract, bytes calldataPayload) returns() +func (_SafeV130 *SafeV130Session) SimulateAndRevert(targetContract common.Address, calldataPayload []byte) (*types.Transaction, error) { + return _SafeV130.Contract.SimulateAndRevert(&_SafeV130.TransactOpts, targetContract, calldataPayload) +} + +// SimulateAndRevert is a paid mutator transaction binding the contract method 0xb4faba09. +// +// Solidity: function simulateAndRevert(address targetContract, bytes calldataPayload) returns() +func (_SafeV130 *SafeV130TransactorSession) SimulateAndRevert(targetContract common.Address, calldataPayload []byte) (*types.Transaction, error) { + return _SafeV130.Contract.SimulateAndRevert(&_SafeV130.TransactOpts, targetContract, calldataPayload) +} + +// SwapOwner is a paid mutator transaction binding the contract method 0xe318b52b. +// +// Solidity: function swapOwner(address prevOwner, address oldOwner, address newOwner) returns() +func (_SafeV130 *SafeV130Transactor) SwapOwner(opts *bind.TransactOpts, prevOwner common.Address, oldOwner common.Address, newOwner common.Address) (*types.Transaction, error) { + return _SafeV130.contract.Transact(opts, "swapOwner", prevOwner, oldOwner, newOwner) +} + +// SwapOwner is a paid mutator transaction binding the contract method 0xe318b52b. +// +// Solidity: function swapOwner(address prevOwner, address oldOwner, address newOwner) returns() +func (_SafeV130 *SafeV130Session) SwapOwner(prevOwner common.Address, oldOwner common.Address, newOwner common.Address) (*types.Transaction, error) { + return _SafeV130.Contract.SwapOwner(&_SafeV130.TransactOpts, prevOwner, oldOwner, newOwner) +} + +// SwapOwner is a paid mutator transaction binding the contract method 0xe318b52b. +// +// Solidity: function swapOwner(address prevOwner, address oldOwner, address newOwner) returns() +func (_SafeV130 *SafeV130TransactorSession) SwapOwner(prevOwner common.Address, oldOwner common.Address, newOwner common.Address) (*types.Transaction, error) { + return _SafeV130.Contract.SwapOwner(&_SafeV130.TransactOpts, prevOwner, oldOwner, newOwner) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() returns() +func (_SafeV130 *SafeV130Transactor) Fallback(opts *bind.TransactOpts, calldata []byte) (*types.Transaction, error) { + return _SafeV130.contract.RawTransact(opts, calldata) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() returns() +func (_SafeV130 *SafeV130Session) Fallback(calldata []byte) (*types.Transaction, error) { + return _SafeV130.Contract.Fallback(&_SafeV130.TransactOpts, calldata) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() returns() +func (_SafeV130 *SafeV130TransactorSession) Fallback(calldata []byte) (*types.Transaction, error) { + return _SafeV130.Contract.Fallback(&_SafeV130.TransactOpts, calldata) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_SafeV130 *SafeV130Transactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SafeV130.contract.RawTransact(opts, nil) // calldata is disallowed for receive function +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_SafeV130 *SafeV130Session) Receive() (*types.Transaction, error) { + return _SafeV130.Contract.Receive(&_SafeV130.TransactOpts) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_SafeV130 *SafeV130TransactorSession) Receive() (*types.Transaction, error) { + return _SafeV130.Contract.Receive(&_SafeV130.TransactOpts) +} + +// SafeV130AddedOwnerIterator is returned from FilterAddedOwner and is used to iterate over the raw logs and unpacked data for AddedOwner events raised by the SafeV130 contract. +type SafeV130AddedOwnerIterator struct { + Event *SafeV130AddedOwner // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeV130AddedOwnerIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeV130AddedOwner) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeV130AddedOwner) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeV130AddedOwnerIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeV130AddedOwnerIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeV130AddedOwner represents a AddedOwner event raised by the SafeV130 contract. +type SafeV130AddedOwner struct { + Owner common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterAddedOwner is a free log retrieval operation binding the contract event 0x9465fa0c962cc76958e6373a993326400c1c94f8be2fe3a952adfa7f60b2ea26. +// +// Solidity: event AddedOwner(address owner) +func (_SafeV130 *SafeV130Filterer) FilterAddedOwner(opts *bind.FilterOpts) (*SafeV130AddedOwnerIterator, error) { + + logs, sub, err := _SafeV130.contract.FilterLogs(opts, "AddedOwner") + if err != nil { + return nil, err + } + return &SafeV130AddedOwnerIterator{contract: _SafeV130.contract, event: "AddedOwner", logs: logs, sub: sub}, nil +} + +// WatchAddedOwner is a free log subscription operation binding the contract event 0x9465fa0c962cc76958e6373a993326400c1c94f8be2fe3a952adfa7f60b2ea26. +// +// Solidity: event AddedOwner(address owner) +func (_SafeV130 *SafeV130Filterer) WatchAddedOwner(opts *bind.WatchOpts, sink chan<- *SafeV130AddedOwner) (event.Subscription, error) { + + logs, sub, err := _SafeV130.contract.WatchLogs(opts, "AddedOwner") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeV130AddedOwner) + if err := _SafeV130.contract.UnpackLog(event, "AddedOwner", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseAddedOwner is a log parse operation binding the contract event 0x9465fa0c962cc76958e6373a993326400c1c94f8be2fe3a952adfa7f60b2ea26. +// +// Solidity: event AddedOwner(address owner) +func (_SafeV130 *SafeV130Filterer) ParseAddedOwner(log types.Log) (*SafeV130AddedOwner, error) { + event := new(SafeV130AddedOwner) + if err := _SafeV130.contract.UnpackLog(event, "AddedOwner", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SafeV130ApproveHashIterator is returned from FilterApproveHash and is used to iterate over the raw logs and unpacked data for ApproveHash events raised by the SafeV130 contract. +type SafeV130ApproveHashIterator struct { + Event *SafeV130ApproveHash // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeV130ApproveHashIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeV130ApproveHash) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeV130ApproveHash) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeV130ApproveHashIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeV130ApproveHashIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeV130ApproveHash represents a ApproveHash event raised by the SafeV130 contract. +type SafeV130ApproveHash struct { + ApprovedHash [32]byte + Owner common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterApproveHash is a free log retrieval operation binding the contract event 0xf2a0eb156472d1440255b0d7c1e19cc07115d1051fe605b0dce69acfec884d9c. +// +// Solidity: event ApproveHash(bytes32 indexed approvedHash, address indexed owner) +func (_SafeV130 *SafeV130Filterer) FilterApproveHash(opts *bind.FilterOpts, approvedHash [][32]byte, owner []common.Address) (*SafeV130ApproveHashIterator, error) { + + var approvedHashRule []interface{} + for _, approvedHashItem := range approvedHash { + approvedHashRule = append(approvedHashRule, approvedHashItem) + } + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + + logs, sub, err := _SafeV130.contract.FilterLogs(opts, "ApproveHash", approvedHashRule, ownerRule) + if err != nil { + return nil, err + } + return &SafeV130ApproveHashIterator{contract: _SafeV130.contract, event: "ApproveHash", logs: logs, sub: sub}, nil +} + +// WatchApproveHash is a free log subscription operation binding the contract event 0xf2a0eb156472d1440255b0d7c1e19cc07115d1051fe605b0dce69acfec884d9c. +// +// Solidity: event ApproveHash(bytes32 indexed approvedHash, address indexed owner) +func (_SafeV130 *SafeV130Filterer) WatchApproveHash(opts *bind.WatchOpts, sink chan<- *SafeV130ApproveHash, approvedHash [][32]byte, owner []common.Address) (event.Subscription, error) { + + var approvedHashRule []interface{} + for _, approvedHashItem := range approvedHash { + approvedHashRule = append(approvedHashRule, approvedHashItem) + } + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + + logs, sub, err := _SafeV130.contract.WatchLogs(opts, "ApproveHash", approvedHashRule, ownerRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeV130ApproveHash) + if err := _SafeV130.contract.UnpackLog(event, "ApproveHash", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseApproveHash is a log parse operation binding the contract event 0xf2a0eb156472d1440255b0d7c1e19cc07115d1051fe605b0dce69acfec884d9c. +// +// Solidity: event ApproveHash(bytes32 indexed approvedHash, address indexed owner) +func (_SafeV130 *SafeV130Filterer) ParseApproveHash(log types.Log) (*SafeV130ApproveHash, error) { + event := new(SafeV130ApproveHash) + if err := _SafeV130.contract.UnpackLog(event, "ApproveHash", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SafeV130ChangedFallbackHandlerIterator is returned from FilterChangedFallbackHandler and is used to iterate over the raw logs and unpacked data for ChangedFallbackHandler events raised by the SafeV130 contract. +type SafeV130ChangedFallbackHandlerIterator struct { + Event *SafeV130ChangedFallbackHandler // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeV130ChangedFallbackHandlerIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeV130ChangedFallbackHandler) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeV130ChangedFallbackHandler) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeV130ChangedFallbackHandlerIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeV130ChangedFallbackHandlerIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeV130ChangedFallbackHandler represents a ChangedFallbackHandler event raised by the SafeV130 contract. +type SafeV130ChangedFallbackHandler struct { + Handler common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterChangedFallbackHandler is a free log retrieval operation binding the contract event 0x5ac6c46c93c8d0e53714ba3b53db3e7c046da994313d7ed0d192028bc7c228b0. +// +// Solidity: event ChangedFallbackHandler(address handler) +func (_SafeV130 *SafeV130Filterer) FilterChangedFallbackHandler(opts *bind.FilterOpts) (*SafeV130ChangedFallbackHandlerIterator, error) { + + logs, sub, err := _SafeV130.contract.FilterLogs(opts, "ChangedFallbackHandler") + if err != nil { + return nil, err + } + return &SafeV130ChangedFallbackHandlerIterator{contract: _SafeV130.contract, event: "ChangedFallbackHandler", logs: logs, sub: sub}, nil +} + +// WatchChangedFallbackHandler is a free log subscription operation binding the contract event 0x5ac6c46c93c8d0e53714ba3b53db3e7c046da994313d7ed0d192028bc7c228b0. +// +// Solidity: event ChangedFallbackHandler(address handler) +func (_SafeV130 *SafeV130Filterer) WatchChangedFallbackHandler(opts *bind.WatchOpts, sink chan<- *SafeV130ChangedFallbackHandler) (event.Subscription, error) { + + logs, sub, err := _SafeV130.contract.WatchLogs(opts, "ChangedFallbackHandler") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeV130ChangedFallbackHandler) + if err := _SafeV130.contract.UnpackLog(event, "ChangedFallbackHandler", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseChangedFallbackHandler is a log parse operation binding the contract event 0x5ac6c46c93c8d0e53714ba3b53db3e7c046da994313d7ed0d192028bc7c228b0. +// +// Solidity: event ChangedFallbackHandler(address handler) +func (_SafeV130 *SafeV130Filterer) ParseChangedFallbackHandler(log types.Log) (*SafeV130ChangedFallbackHandler, error) { + event := new(SafeV130ChangedFallbackHandler) + if err := _SafeV130.contract.UnpackLog(event, "ChangedFallbackHandler", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SafeV130ChangedGuardIterator is returned from FilterChangedGuard and is used to iterate over the raw logs and unpacked data for ChangedGuard events raised by the SafeV130 contract. +type SafeV130ChangedGuardIterator struct { + Event *SafeV130ChangedGuard // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeV130ChangedGuardIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeV130ChangedGuard) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeV130ChangedGuard) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeV130ChangedGuardIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeV130ChangedGuardIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeV130ChangedGuard represents a ChangedGuard event raised by the SafeV130 contract. +type SafeV130ChangedGuard struct { + Guard common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterChangedGuard is a free log retrieval operation binding the contract event 0x1151116914515bc0891ff9047a6cb32cf902546f83066499bcf8ba33d2353fa2. +// +// Solidity: event ChangedGuard(address guard) +func (_SafeV130 *SafeV130Filterer) FilterChangedGuard(opts *bind.FilterOpts) (*SafeV130ChangedGuardIterator, error) { + + logs, sub, err := _SafeV130.contract.FilterLogs(opts, "ChangedGuard") + if err != nil { + return nil, err + } + return &SafeV130ChangedGuardIterator{contract: _SafeV130.contract, event: "ChangedGuard", logs: logs, sub: sub}, nil +} + +// WatchChangedGuard is a free log subscription operation binding the contract event 0x1151116914515bc0891ff9047a6cb32cf902546f83066499bcf8ba33d2353fa2. +// +// Solidity: event ChangedGuard(address guard) +func (_SafeV130 *SafeV130Filterer) WatchChangedGuard(opts *bind.WatchOpts, sink chan<- *SafeV130ChangedGuard) (event.Subscription, error) { + + logs, sub, err := _SafeV130.contract.WatchLogs(opts, "ChangedGuard") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeV130ChangedGuard) + if err := _SafeV130.contract.UnpackLog(event, "ChangedGuard", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseChangedGuard is a log parse operation binding the contract event 0x1151116914515bc0891ff9047a6cb32cf902546f83066499bcf8ba33d2353fa2. +// +// Solidity: event ChangedGuard(address guard) +func (_SafeV130 *SafeV130Filterer) ParseChangedGuard(log types.Log) (*SafeV130ChangedGuard, error) { + event := new(SafeV130ChangedGuard) + if err := _SafeV130.contract.UnpackLog(event, "ChangedGuard", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SafeV130ChangedThresholdIterator is returned from FilterChangedThreshold and is used to iterate over the raw logs and unpacked data for ChangedThreshold events raised by the SafeV130 contract. +type SafeV130ChangedThresholdIterator struct { + Event *SafeV130ChangedThreshold // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeV130ChangedThresholdIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeV130ChangedThreshold) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeV130ChangedThreshold) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeV130ChangedThresholdIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeV130ChangedThresholdIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeV130ChangedThreshold represents a ChangedThreshold event raised by the SafeV130 contract. +type SafeV130ChangedThreshold struct { + Threshold *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterChangedThreshold is a free log retrieval operation binding the contract event 0x610f7ff2b304ae8903c3de74c60c6ab1f7d6226b3f52c5161905bb5ad4039c93. +// +// Solidity: event ChangedThreshold(uint256 threshold) +func (_SafeV130 *SafeV130Filterer) FilterChangedThreshold(opts *bind.FilterOpts) (*SafeV130ChangedThresholdIterator, error) { + + logs, sub, err := _SafeV130.contract.FilterLogs(opts, "ChangedThreshold") + if err != nil { + return nil, err + } + return &SafeV130ChangedThresholdIterator{contract: _SafeV130.contract, event: "ChangedThreshold", logs: logs, sub: sub}, nil +} + +// WatchChangedThreshold is a free log subscription operation binding the contract event 0x610f7ff2b304ae8903c3de74c60c6ab1f7d6226b3f52c5161905bb5ad4039c93. +// +// Solidity: event ChangedThreshold(uint256 threshold) +func (_SafeV130 *SafeV130Filterer) WatchChangedThreshold(opts *bind.WatchOpts, sink chan<- *SafeV130ChangedThreshold) (event.Subscription, error) { + + logs, sub, err := _SafeV130.contract.WatchLogs(opts, "ChangedThreshold") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeV130ChangedThreshold) + if err := _SafeV130.contract.UnpackLog(event, "ChangedThreshold", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseChangedThreshold is a log parse operation binding the contract event 0x610f7ff2b304ae8903c3de74c60c6ab1f7d6226b3f52c5161905bb5ad4039c93. +// +// Solidity: event ChangedThreshold(uint256 threshold) +func (_SafeV130 *SafeV130Filterer) ParseChangedThreshold(log types.Log) (*SafeV130ChangedThreshold, error) { + event := new(SafeV130ChangedThreshold) + if err := _SafeV130.contract.UnpackLog(event, "ChangedThreshold", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SafeV130DisabledModuleIterator is returned from FilterDisabledModule and is used to iterate over the raw logs and unpacked data for DisabledModule events raised by the SafeV130 contract. +type SafeV130DisabledModuleIterator struct { + Event *SafeV130DisabledModule // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeV130DisabledModuleIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeV130DisabledModule) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeV130DisabledModule) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeV130DisabledModuleIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeV130DisabledModuleIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeV130DisabledModule represents a DisabledModule event raised by the SafeV130 contract. +type SafeV130DisabledModule struct { + Module common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterDisabledModule is a free log retrieval operation binding the contract event 0xaab4fa2b463f581b2b32cb3b7e3b704b9ce37cc209b5fb4d77e593ace4054276. +// +// Solidity: event DisabledModule(address module) +func (_SafeV130 *SafeV130Filterer) FilterDisabledModule(opts *bind.FilterOpts) (*SafeV130DisabledModuleIterator, error) { + + logs, sub, err := _SafeV130.contract.FilterLogs(opts, "DisabledModule") + if err != nil { + return nil, err + } + return &SafeV130DisabledModuleIterator{contract: _SafeV130.contract, event: "DisabledModule", logs: logs, sub: sub}, nil +} + +// WatchDisabledModule is a free log subscription operation binding the contract event 0xaab4fa2b463f581b2b32cb3b7e3b704b9ce37cc209b5fb4d77e593ace4054276. +// +// Solidity: event DisabledModule(address module) +func (_SafeV130 *SafeV130Filterer) WatchDisabledModule(opts *bind.WatchOpts, sink chan<- *SafeV130DisabledModule) (event.Subscription, error) { + + logs, sub, err := _SafeV130.contract.WatchLogs(opts, "DisabledModule") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeV130DisabledModule) + if err := _SafeV130.contract.UnpackLog(event, "DisabledModule", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseDisabledModule is a log parse operation binding the contract event 0xaab4fa2b463f581b2b32cb3b7e3b704b9ce37cc209b5fb4d77e593ace4054276. +// +// Solidity: event DisabledModule(address module) +func (_SafeV130 *SafeV130Filterer) ParseDisabledModule(log types.Log) (*SafeV130DisabledModule, error) { + event := new(SafeV130DisabledModule) + if err := _SafeV130.contract.UnpackLog(event, "DisabledModule", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SafeV130EnabledModuleIterator is returned from FilterEnabledModule and is used to iterate over the raw logs and unpacked data for EnabledModule events raised by the SafeV130 contract. +type SafeV130EnabledModuleIterator struct { + Event *SafeV130EnabledModule // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeV130EnabledModuleIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeV130EnabledModule) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeV130EnabledModule) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeV130EnabledModuleIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeV130EnabledModuleIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeV130EnabledModule represents a EnabledModule event raised by the SafeV130 contract. +type SafeV130EnabledModule struct { + Module common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterEnabledModule is a free log retrieval operation binding the contract event 0xecdf3a3effea5783a3c4c2140e677577666428d44ed9d474a0b3a4c9943f8440. +// +// Solidity: event EnabledModule(address module) +func (_SafeV130 *SafeV130Filterer) FilterEnabledModule(opts *bind.FilterOpts) (*SafeV130EnabledModuleIterator, error) { + + logs, sub, err := _SafeV130.contract.FilterLogs(opts, "EnabledModule") + if err != nil { + return nil, err + } + return &SafeV130EnabledModuleIterator{contract: _SafeV130.contract, event: "EnabledModule", logs: logs, sub: sub}, nil +} + +// WatchEnabledModule is a free log subscription operation binding the contract event 0xecdf3a3effea5783a3c4c2140e677577666428d44ed9d474a0b3a4c9943f8440. +// +// Solidity: event EnabledModule(address module) +func (_SafeV130 *SafeV130Filterer) WatchEnabledModule(opts *bind.WatchOpts, sink chan<- *SafeV130EnabledModule) (event.Subscription, error) { + + logs, sub, err := _SafeV130.contract.WatchLogs(opts, "EnabledModule") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeV130EnabledModule) + if err := _SafeV130.contract.UnpackLog(event, "EnabledModule", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseEnabledModule is a log parse operation binding the contract event 0xecdf3a3effea5783a3c4c2140e677577666428d44ed9d474a0b3a4c9943f8440. +// +// Solidity: event EnabledModule(address module) +func (_SafeV130 *SafeV130Filterer) ParseEnabledModule(log types.Log) (*SafeV130EnabledModule, error) { + event := new(SafeV130EnabledModule) + if err := _SafeV130.contract.UnpackLog(event, "EnabledModule", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SafeV130ExecutionFailureIterator is returned from FilterExecutionFailure and is used to iterate over the raw logs and unpacked data for ExecutionFailure events raised by the SafeV130 contract. +type SafeV130ExecutionFailureIterator struct { + Event *SafeV130ExecutionFailure // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeV130ExecutionFailureIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeV130ExecutionFailure) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeV130ExecutionFailure) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeV130ExecutionFailureIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeV130ExecutionFailureIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeV130ExecutionFailure represents a ExecutionFailure event raised by the SafeV130 contract. +type SafeV130ExecutionFailure struct { + TxHash [32]byte + Payment *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterExecutionFailure is a free log retrieval operation binding the contract event 0x23428b18acfb3ea64b08dc0c1d296ea9c09702c09083ca5272e64d115b687d23. +// +// Solidity: event ExecutionFailure(bytes32 txHash, uint256 payment) +func (_SafeV130 *SafeV130Filterer) FilterExecutionFailure(opts *bind.FilterOpts) (*SafeV130ExecutionFailureIterator, error) { + + logs, sub, err := _SafeV130.contract.FilterLogs(opts, "ExecutionFailure") + if err != nil { + return nil, err + } + return &SafeV130ExecutionFailureIterator{contract: _SafeV130.contract, event: "ExecutionFailure", logs: logs, sub: sub}, nil +} + +// WatchExecutionFailure is a free log subscription operation binding the contract event 0x23428b18acfb3ea64b08dc0c1d296ea9c09702c09083ca5272e64d115b687d23. +// +// Solidity: event ExecutionFailure(bytes32 txHash, uint256 payment) +func (_SafeV130 *SafeV130Filterer) WatchExecutionFailure(opts *bind.WatchOpts, sink chan<- *SafeV130ExecutionFailure) (event.Subscription, error) { + + logs, sub, err := _SafeV130.contract.WatchLogs(opts, "ExecutionFailure") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeV130ExecutionFailure) + if err := _SafeV130.contract.UnpackLog(event, "ExecutionFailure", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseExecutionFailure is a log parse operation binding the contract event 0x23428b18acfb3ea64b08dc0c1d296ea9c09702c09083ca5272e64d115b687d23. +// +// Solidity: event ExecutionFailure(bytes32 txHash, uint256 payment) +func (_SafeV130 *SafeV130Filterer) ParseExecutionFailure(log types.Log) (*SafeV130ExecutionFailure, error) { + event := new(SafeV130ExecutionFailure) + if err := _SafeV130.contract.UnpackLog(event, "ExecutionFailure", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SafeV130ExecutionFromModuleFailureIterator is returned from FilterExecutionFromModuleFailure and is used to iterate over the raw logs and unpacked data for ExecutionFromModuleFailure events raised by the SafeV130 contract. +type SafeV130ExecutionFromModuleFailureIterator struct { + Event *SafeV130ExecutionFromModuleFailure // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeV130ExecutionFromModuleFailureIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeV130ExecutionFromModuleFailure) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeV130ExecutionFromModuleFailure) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeV130ExecutionFromModuleFailureIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeV130ExecutionFromModuleFailureIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeV130ExecutionFromModuleFailure represents a ExecutionFromModuleFailure event raised by the SafeV130 contract. +type SafeV130ExecutionFromModuleFailure struct { + Module common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterExecutionFromModuleFailure is a free log retrieval operation binding the contract event 0xacd2c8702804128fdb0db2bb49f6d127dd0181c13fd45dbfe16de0930e2bd375. +// +// Solidity: event ExecutionFromModuleFailure(address indexed module) +func (_SafeV130 *SafeV130Filterer) FilterExecutionFromModuleFailure(opts *bind.FilterOpts, module []common.Address) (*SafeV130ExecutionFromModuleFailureIterator, error) { + + var moduleRule []interface{} + for _, moduleItem := range module { + moduleRule = append(moduleRule, moduleItem) + } + + logs, sub, err := _SafeV130.contract.FilterLogs(opts, "ExecutionFromModuleFailure", moduleRule) + if err != nil { + return nil, err + } + return &SafeV130ExecutionFromModuleFailureIterator{contract: _SafeV130.contract, event: "ExecutionFromModuleFailure", logs: logs, sub: sub}, nil +} + +// WatchExecutionFromModuleFailure is a free log subscription operation binding the contract event 0xacd2c8702804128fdb0db2bb49f6d127dd0181c13fd45dbfe16de0930e2bd375. +// +// Solidity: event ExecutionFromModuleFailure(address indexed module) +func (_SafeV130 *SafeV130Filterer) WatchExecutionFromModuleFailure(opts *bind.WatchOpts, sink chan<- *SafeV130ExecutionFromModuleFailure, module []common.Address) (event.Subscription, error) { + + var moduleRule []interface{} + for _, moduleItem := range module { + moduleRule = append(moduleRule, moduleItem) + } + + logs, sub, err := _SafeV130.contract.WatchLogs(opts, "ExecutionFromModuleFailure", moduleRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeV130ExecutionFromModuleFailure) + if err := _SafeV130.contract.UnpackLog(event, "ExecutionFromModuleFailure", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseExecutionFromModuleFailure is a log parse operation binding the contract event 0xacd2c8702804128fdb0db2bb49f6d127dd0181c13fd45dbfe16de0930e2bd375. +// +// Solidity: event ExecutionFromModuleFailure(address indexed module) +func (_SafeV130 *SafeV130Filterer) ParseExecutionFromModuleFailure(log types.Log) (*SafeV130ExecutionFromModuleFailure, error) { + event := new(SafeV130ExecutionFromModuleFailure) + if err := _SafeV130.contract.UnpackLog(event, "ExecutionFromModuleFailure", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SafeV130ExecutionFromModuleSuccessIterator is returned from FilterExecutionFromModuleSuccess and is used to iterate over the raw logs and unpacked data for ExecutionFromModuleSuccess events raised by the SafeV130 contract. +type SafeV130ExecutionFromModuleSuccessIterator struct { + Event *SafeV130ExecutionFromModuleSuccess // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeV130ExecutionFromModuleSuccessIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeV130ExecutionFromModuleSuccess) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeV130ExecutionFromModuleSuccess) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeV130ExecutionFromModuleSuccessIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeV130ExecutionFromModuleSuccessIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeV130ExecutionFromModuleSuccess represents a ExecutionFromModuleSuccess event raised by the SafeV130 contract. +type SafeV130ExecutionFromModuleSuccess struct { + Module common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterExecutionFromModuleSuccess is a free log retrieval operation binding the contract event 0x6895c13664aa4f67288b25d7a21d7aaa34916e355fb9b6fae0a139a9085becb8. +// +// Solidity: event ExecutionFromModuleSuccess(address indexed module) +func (_SafeV130 *SafeV130Filterer) FilterExecutionFromModuleSuccess(opts *bind.FilterOpts, module []common.Address) (*SafeV130ExecutionFromModuleSuccessIterator, error) { + + var moduleRule []interface{} + for _, moduleItem := range module { + moduleRule = append(moduleRule, moduleItem) + } + + logs, sub, err := _SafeV130.contract.FilterLogs(opts, "ExecutionFromModuleSuccess", moduleRule) + if err != nil { + return nil, err + } + return &SafeV130ExecutionFromModuleSuccessIterator{contract: _SafeV130.contract, event: "ExecutionFromModuleSuccess", logs: logs, sub: sub}, nil +} + +// WatchExecutionFromModuleSuccess is a free log subscription operation binding the contract event 0x6895c13664aa4f67288b25d7a21d7aaa34916e355fb9b6fae0a139a9085becb8. +// +// Solidity: event ExecutionFromModuleSuccess(address indexed module) +func (_SafeV130 *SafeV130Filterer) WatchExecutionFromModuleSuccess(opts *bind.WatchOpts, sink chan<- *SafeV130ExecutionFromModuleSuccess, module []common.Address) (event.Subscription, error) { + + var moduleRule []interface{} + for _, moduleItem := range module { + moduleRule = append(moduleRule, moduleItem) + } + + logs, sub, err := _SafeV130.contract.WatchLogs(opts, "ExecutionFromModuleSuccess", moduleRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeV130ExecutionFromModuleSuccess) + if err := _SafeV130.contract.UnpackLog(event, "ExecutionFromModuleSuccess", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseExecutionFromModuleSuccess is a log parse operation binding the contract event 0x6895c13664aa4f67288b25d7a21d7aaa34916e355fb9b6fae0a139a9085becb8. +// +// Solidity: event ExecutionFromModuleSuccess(address indexed module) +func (_SafeV130 *SafeV130Filterer) ParseExecutionFromModuleSuccess(log types.Log) (*SafeV130ExecutionFromModuleSuccess, error) { + event := new(SafeV130ExecutionFromModuleSuccess) + if err := _SafeV130.contract.UnpackLog(event, "ExecutionFromModuleSuccess", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SafeV130ExecutionSuccessIterator is returned from FilterExecutionSuccess and is used to iterate over the raw logs and unpacked data for ExecutionSuccess events raised by the SafeV130 contract. +type SafeV130ExecutionSuccessIterator struct { + Event *SafeV130ExecutionSuccess // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeV130ExecutionSuccessIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeV130ExecutionSuccess) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeV130ExecutionSuccess) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeV130ExecutionSuccessIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeV130ExecutionSuccessIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeV130ExecutionSuccess represents a ExecutionSuccess event raised by the SafeV130 contract. +type SafeV130ExecutionSuccess struct { + TxHash [32]byte + Payment *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterExecutionSuccess is a free log retrieval operation binding the contract event 0x442e715f626346e8c54381002da614f62bee8d27386535b2521ec8540898556e. +// +// Solidity: event ExecutionSuccess(bytes32 txHash, uint256 payment) +func (_SafeV130 *SafeV130Filterer) FilterExecutionSuccess(opts *bind.FilterOpts) (*SafeV130ExecutionSuccessIterator, error) { + + logs, sub, err := _SafeV130.contract.FilterLogs(opts, "ExecutionSuccess") + if err != nil { + return nil, err + } + return &SafeV130ExecutionSuccessIterator{contract: _SafeV130.contract, event: "ExecutionSuccess", logs: logs, sub: sub}, nil +} + +// WatchExecutionSuccess is a free log subscription operation binding the contract event 0x442e715f626346e8c54381002da614f62bee8d27386535b2521ec8540898556e. +// +// Solidity: event ExecutionSuccess(bytes32 txHash, uint256 payment) +func (_SafeV130 *SafeV130Filterer) WatchExecutionSuccess(opts *bind.WatchOpts, sink chan<- *SafeV130ExecutionSuccess) (event.Subscription, error) { + + logs, sub, err := _SafeV130.contract.WatchLogs(opts, "ExecutionSuccess") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeV130ExecutionSuccess) + if err := _SafeV130.contract.UnpackLog(event, "ExecutionSuccess", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseExecutionSuccess is a log parse operation binding the contract event 0x442e715f626346e8c54381002da614f62bee8d27386535b2521ec8540898556e. +// +// Solidity: event ExecutionSuccess(bytes32 txHash, uint256 payment) +func (_SafeV130 *SafeV130Filterer) ParseExecutionSuccess(log types.Log) (*SafeV130ExecutionSuccess, error) { + event := new(SafeV130ExecutionSuccess) + if err := _SafeV130.contract.UnpackLog(event, "ExecutionSuccess", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SafeV130RemovedOwnerIterator is returned from FilterRemovedOwner and is used to iterate over the raw logs and unpacked data for RemovedOwner events raised by the SafeV130 contract. +type SafeV130RemovedOwnerIterator struct { + Event *SafeV130RemovedOwner // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeV130RemovedOwnerIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeV130RemovedOwner) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeV130RemovedOwner) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeV130RemovedOwnerIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeV130RemovedOwnerIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeV130RemovedOwner represents a RemovedOwner event raised by the SafeV130 contract. +type SafeV130RemovedOwner struct { + Owner common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterRemovedOwner is a free log retrieval operation binding the contract event 0xf8d49fc529812e9a7c5c50e69c20f0dccc0db8fa95c98bc58cc9a4f1c1299eaf. +// +// Solidity: event RemovedOwner(address owner) +func (_SafeV130 *SafeV130Filterer) FilterRemovedOwner(opts *bind.FilterOpts) (*SafeV130RemovedOwnerIterator, error) { + + logs, sub, err := _SafeV130.contract.FilterLogs(opts, "RemovedOwner") + if err != nil { + return nil, err + } + return &SafeV130RemovedOwnerIterator{contract: _SafeV130.contract, event: "RemovedOwner", logs: logs, sub: sub}, nil +} + +// WatchRemovedOwner is a free log subscription operation binding the contract event 0xf8d49fc529812e9a7c5c50e69c20f0dccc0db8fa95c98bc58cc9a4f1c1299eaf. +// +// Solidity: event RemovedOwner(address owner) +func (_SafeV130 *SafeV130Filterer) WatchRemovedOwner(opts *bind.WatchOpts, sink chan<- *SafeV130RemovedOwner) (event.Subscription, error) { + + logs, sub, err := _SafeV130.contract.WatchLogs(opts, "RemovedOwner") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeV130RemovedOwner) + if err := _SafeV130.contract.UnpackLog(event, "RemovedOwner", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseRemovedOwner is a log parse operation binding the contract event 0xf8d49fc529812e9a7c5c50e69c20f0dccc0db8fa95c98bc58cc9a4f1c1299eaf. +// +// Solidity: event RemovedOwner(address owner) +func (_SafeV130 *SafeV130Filterer) ParseRemovedOwner(log types.Log) (*SafeV130RemovedOwner, error) { + event := new(SafeV130RemovedOwner) + if err := _SafeV130.contract.UnpackLog(event, "RemovedOwner", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SafeV130SafeReceivedIterator is returned from FilterSafeReceived and is used to iterate over the raw logs and unpacked data for SafeReceived events raised by the SafeV130 contract. +type SafeV130SafeReceivedIterator struct { + Event *SafeV130SafeReceived // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeV130SafeReceivedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeV130SafeReceived) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeV130SafeReceived) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeV130SafeReceivedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeV130SafeReceivedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeV130SafeReceived represents a SafeReceived event raised by the SafeV130 contract. +type SafeV130SafeReceived struct { + Sender common.Address + Value *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSafeReceived is a free log retrieval operation binding the contract event 0x3d0ce9bfc3ed7d6862dbb28b2dea94561fe714a1b4d019aa8af39730d1ad7c3d. +// +// Solidity: event SafeReceived(address indexed sender, uint256 value) +func (_SafeV130 *SafeV130Filterer) FilterSafeReceived(opts *bind.FilterOpts, sender []common.Address) (*SafeV130SafeReceivedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _SafeV130.contract.FilterLogs(opts, "SafeReceived", senderRule) + if err != nil { + return nil, err + } + return &SafeV130SafeReceivedIterator{contract: _SafeV130.contract, event: "SafeReceived", logs: logs, sub: sub}, nil +} + +// WatchSafeReceived is a free log subscription operation binding the contract event 0x3d0ce9bfc3ed7d6862dbb28b2dea94561fe714a1b4d019aa8af39730d1ad7c3d. +// +// Solidity: event SafeReceived(address indexed sender, uint256 value) +func (_SafeV130 *SafeV130Filterer) WatchSafeReceived(opts *bind.WatchOpts, sink chan<- *SafeV130SafeReceived, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _SafeV130.contract.WatchLogs(opts, "SafeReceived", senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeV130SafeReceived) + if err := _SafeV130.contract.UnpackLog(event, "SafeReceived", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseSafeReceived is a log parse operation binding the contract event 0x3d0ce9bfc3ed7d6862dbb28b2dea94561fe714a1b4d019aa8af39730d1ad7c3d. +// +// Solidity: event SafeReceived(address indexed sender, uint256 value) +func (_SafeV130 *SafeV130Filterer) ParseSafeReceived(log types.Log) (*SafeV130SafeReceived, error) { + event := new(SafeV130SafeReceived) + if err := _SafeV130.contract.UnpackLog(event, "SafeReceived", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SafeV130SafeSetupIterator is returned from FilterSafeSetup and is used to iterate over the raw logs and unpacked data for SafeSetup events raised by the SafeV130 contract. +type SafeV130SafeSetupIterator struct { + Event *SafeV130SafeSetup // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeV130SafeSetupIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeV130SafeSetup) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeV130SafeSetup) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeV130SafeSetupIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeV130SafeSetupIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeV130SafeSetup represents a SafeSetup event raised by the SafeV130 contract. +type SafeV130SafeSetup struct { + Initiator common.Address + Owners []common.Address + Threshold *big.Int + Initializer common.Address + FallbackHandler common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSafeSetup is a free log retrieval operation binding the contract event 0x141df868a6331af528e38c83b7aa03edc19be66e37ae67f9285bf4f8e3c6a1a8. +// +// Solidity: event SafeSetup(address indexed initiator, address[] owners, uint256 threshold, address initializer, address fallbackHandler) +func (_SafeV130 *SafeV130Filterer) FilterSafeSetup(opts *bind.FilterOpts, initiator []common.Address) (*SafeV130SafeSetupIterator, error) { + + var initiatorRule []interface{} + for _, initiatorItem := range initiator { + initiatorRule = append(initiatorRule, initiatorItem) + } + + logs, sub, err := _SafeV130.contract.FilterLogs(opts, "SafeSetup", initiatorRule) + if err != nil { + return nil, err + } + return &SafeV130SafeSetupIterator{contract: _SafeV130.contract, event: "SafeSetup", logs: logs, sub: sub}, nil +} + +// WatchSafeSetup is a free log subscription operation binding the contract event 0x141df868a6331af528e38c83b7aa03edc19be66e37ae67f9285bf4f8e3c6a1a8. +// +// Solidity: event SafeSetup(address indexed initiator, address[] owners, uint256 threshold, address initializer, address fallbackHandler) +func (_SafeV130 *SafeV130Filterer) WatchSafeSetup(opts *bind.WatchOpts, sink chan<- *SafeV130SafeSetup, initiator []common.Address) (event.Subscription, error) { + + var initiatorRule []interface{} + for _, initiatorItem := range initiator { + initiatorRule = append(initiatorRule, initiatorItem) + } + + logs, sub, err := _SafeV130.contract.WatchLogs(opts, "SafeSetup", initiatorRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeV130SafeSetup) + if err := _SafeV130.contract.UnpackLog(event, "SafeSetup", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseSafeSetup is a log parse operation binding the contract event 0x141df868a6331af528e38c83b7aa03edc19be66e37ae67f9285bf4f8e3c6a1a8. +// +// Solidity: event SafeSetup(address indexed initiator, address[] owners, uint256 threshold, address initializer, address fallbackHandler) +func (_SafeV130 *SafeV130Filterer) ParseSafeSetup(log types.Log) (*SafeV130SafeSetup, error) { + event := new(SafeV130SafeSetup) + if err := _SafeV130.contract.UnpackLog(event, "SafeSetup", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SafeV130SignMsgIterator is returned from FilterSignMsg and is used to iterate over the raw logs and unpacked data for SignMsg events raised by the SafeV130 contract. +type SafeV130SignMsgIterator struct { + Event *SafeV130SignMsg // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeV130SignMsgIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeV130SignMsg) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeV130SignMsg) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeV130SignMsgIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeV130SignMsgIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeV130SignMsg represents a SignMsg event raised by the SafeV130 contract. +type SafeV130SignMsg struct { + MsgHash [32]byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSignMsg is a free log retrieval operation binding the contract event 0xe7f4675038f4f6034dfcbbb24c4dc08e4ebf10eb9d257d3d02c0f38d122ac6e4. +// +// Solidity: event SignMsg(bytes32 indexed msgHash) +func (_SafeV130 *SafeV130Filterer) FilterSignMsg(opts *bind.FilterOpts, msgHash [][32]byte) (*SafeV130SignMsgIterator, error) { + + var msgHashRule []interface{} + for _, msgHashItem := range msgHash { + msgHashRule = append(msgHashRule, msgHashItem) + } + + logs, sub, err := _SafeV130.contract.FilterLogs(opts, "SignMsg", msgHashRule) + if err != nil { + return nil, err + } + return &SafeV130SignMsgIterator{contract: _SafeV130.contract, event: "SignMsg", logs: logs, sub: sub}, nil +} + +// WatchSignMsg is a free log subscription operation binding the contract event 0xe7f4675038f4f6034dfcbbb24c4dc08e4ebf10eb9d257d3d02c0f38d122ac6e4. +// +// Solidity: event SignMsg(bytes32 indexed msgHash) +func (_SafeV130 *SafeV130Filterer) WatchSignMsg(opts *bind.WatchOpts, sink chan<- *SafeV130SignMsg, msgHash [][32]byte) (event.Subscription, error) { + + var msgHashRule []interface{} + for _, msgHashItem := range msgHash { + msgHashRule = append(msgHashRule, msgHashItem) + } + + logs, sub, err := _SafeV130.contract.WatchLogs(opts, "SignMsg", msgHashRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeV130SignMsg) + if err := _SafeV130.contract.UnpackLog(event, "SignMsg", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseSignMsg is a log parse operation binding the contract event 0xe7f4675038f4f6034dfcbbb24c4dc08e4ebf10eb9d257d3d02c0f38d122ac6e4. +// +// Solidity: event SignMsg(bytes32 indexed msgHash) +func (_SafeV130 *SafeV130Filterer) ParseSignMsg(log types.Log) (*SafeV130SignMsg, error) { + event := new(SafeV130SignMsg) + if err := _SafeV130.contract.UnpackLog(event, "SignMsg", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/op-e2e2/bindings/safel2_v130.go b/op-e2e2/bindings/safel2_v130.go new file mode 100644 index 000000000000..c56dd37fa775 --- /dev/null +++ b/op-e2e2/bindings/safel2_v130.go @@ -0,0 +1,3433 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// SafeL2V130MetaData contains all meta data concerning the SafeL2V130 contract. +var SafeL2V130MetaData = &bind.MetaData{ + ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"AddedOwner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"approvedHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"ApproveHash\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"handler\",\"type\":\"address\"}],\"name\":\"ChangedFallbackHandler\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"guard\",\"type\":\"address\"}],\"name\":\"ChangedGuard\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"threshold\",\"type\":\"uint256\"}],\"name\":\"ChangedThreshold\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"module\",\"type\":\"address\"}],\"name\":\"DisabledModule\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"module\",\"type\":\"address\"}],\"name\":\"EnabledModule\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"txHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"payment\",\"type\":\"uint256\"}],\"name\":\"ExecutionFailure\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"module\",\"type\":\"address\"}],\"name\":\"ExecutionFromModuleFailure\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"module\",\"type\":\"address\"}],\"name\":\"ExecutionFromModuleSuccess\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"txHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"payment\",\"type\":\"uint256\"}],\"name\":\"ExecutionSuccess\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"RemovedOwner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"module\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"enumEnum.Operation\",\"name\":\"operation\",\"type\":\"uint8\"}],\"name\":\"SafeModuleTransaction\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"enumEnum.Operation\",\"name\":\"operation\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"safeTxGas\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"baseGas\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"gasPrice\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"gasToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"addresspayable\",\"name\":\"refundReceiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"signatures\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"additionalInfo\",\"type\":\"bytes\"}],\"name\":\"SafeMultiSigTransaction\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"SafeReceived\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"initiator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"owners\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"threshold\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"initializer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"fallbackHandler\",\"type\":\"address\"}],\"name\":\"SafeSetup\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"msgHash\",\"type\":\"bytes32\"}],\"name\":\"SignMsg\",\"type\":\"event\"},{\"stateMutability\":\"nonpayable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"VERSION\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_threshold\",\"type\":\"uint256\"}],\"name\":\"addOwnerWithThreshold\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"hashToApprove\",\"type\":\"bytes32\"}],\"name\":\"approveHash\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"approvedHashes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_threshold\",\"type\":\"uint256\"}],\"name\":\"changeThreshold\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"dataHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"signatures\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"requiredSignatures\",\"type\":\"uint256\"}],\"name\":\"checkNSignatures\",\"outputs\":[],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"dataHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"signatures\",\"type\":\"bytes\"}],\"name\":\"checkSignatures\",\"outputs\":[],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"prevModule\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"module\",\"type\":\"address\"}],\"name\":\"disableModule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"domainSeparator\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"module\",\"type\":\"address\"}],\"name\":\"enableModule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"enumEnum.Operation\",\"name\":\"operation\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"safeTxGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"baseGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"gasPrice\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"gasToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"refundReceiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_nonce\",\"type\":\"uint256\"}],\"name\":\"encodeTransactionData\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"enumEnum.Operation\",\"name\":\"operation\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"safeTxGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"baseGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"gasPrice\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"gasToken\",\"type\":\"address\"},{\"internalType\":\"addresspayable\",\"name\":\"refundReceiver\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"signatures\",\"type\":\"bytes\"}],\"name\":\"execTransaction\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"enumEnum.Operation\",\"name\":\"operation\",\"type\":\"uint8\"}],\"name\":\"execTransactionFromModule\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"enumEnum.Operation\",\"name\":\"operation\",\"type\":\"uint8\"}],\"name\":\"execTransactionFromModuleReturnData\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"returnData\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getChainId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"start\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"pageSize\",\"type\":\"uint256\"}],\"name\":\"getModulesPaginated\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"array\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"next\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getOwners\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"offset\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"length\",\"type\":\"uint256\"}],\"name\":\"getStorageAt\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"enumEnum.Operation\",\"name\":\"operation\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"safeTxGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"baseGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"gasPrice\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"gasToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"refundReceiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_nonce\",\"type\":\"uint256\"}],\"name\":\"getTransactionHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"module\",\"type\":\"address\"}],\"name\":\"isModuleEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"isOwner\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nonce\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"prevOwner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_threshold\",\"type\":\"uint256\"}],\"name\":\"removeOwner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"enumEnum.Operation\",\"name\":\"operation\",\"type\":\"uint8\"}],\"name\":\"requiredTxGas\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"handler\",\"type\":\"address\"}],\"name\":\"setFallbackHandler\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"guard\",\"type\":\"address\"}],\"name\":\"setGuard\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_owners\",\"type\":\"address[]\"},{\"internalType\":\"uint256\",\"name\":\"_threshold\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"fallbackHandler\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"paymentToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"payment\",\"type\":\"uint256\"},{\"internalType\":\"addresspayable\",\"name\":\"paymentReceiver\",\"type\":\"address\"}],\"name\":\"setup\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"signedMessages\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"targetContract\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"calldataPayload\",\"type\":\"bytes\"}],\"name\":\"simulateAndRevert\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"prevOwner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"oldOwner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"swapOwner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", + Bin: "0x608060405234801561001057600080fd5b506001600481905550615cf880620000296000396000f3fe6080604052600436106101dc5760003560e01c8063affed0e011610102578063e19a9dd911610095578063f08a032311610064578063f08a032314611647578063f698da2514611698578063f8dc5dd9146116c3578063ffa1ad741461173e57610231565b8063e19a9dd91461139b578063e318b52b146113ec578063e75235b81461147d578063e86637db146114a857610231565b8063cc2f8452116100d1578063cc2f8452146110e8578063d4d9bdcd146111b5578063d8d11f78146111f0578063e009cfde1461132a57610231565b8063affed0e014610d94578063b4faba0914610dbf578063b63e800d14610ea7578063c4ca3a9c1461101757610231565b80635624b25b1161017a5780636a761202116101495780636a761202146109945780637d83297414610b50578063934f3a1114610bbf578063a0e67e2b14610d2857610231565b80635624b25b146107fb5780635ae6bd37146108b9578063610b592514610908578063694e80c31461095957610231565b80632f54bf6e116101b65780632f54bf6e146104d35780633408e4701461053a578063468721a7146105655780635229073f1461067a57610231565b80630d582f131461029e57806312fb68e0146102f95780632d9ad53d1461046c57610231565b36610231573373ffffffffffffffffffffffffffffffffffffffff167f3d0ce9bfc3ed7d6862dbb28b2dea94561fe714a1b4d019aa8af39730d1ad7c3d346040518082815260200191505060405180910390a2005b34801561023d57600080fd5b5060007f6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d560001b905080548061027257600080f35b36600080373360601b365260008060143601600080855af13d6000803e80610299573d6000fd5b3d6000f35b3480156102aa57600080fd5b506102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506117ce565b005b34801561030557600080fd5b5061046a6004803603608081101561031c57600080fd5b81019080803590602001909291908035906020019064010000000081111561034357600080fd5b82018360208201111561035557600080fd5b8035906020019184600183028401116401000000008311171561037757600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156103da57600080fd5b8201836020820111156103ec57600080fd5b8035906020019184600183028401116401000000008311171561040e57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190929190505050611bbe565b005b34801561047857600080fd5b506104bb6004803603602081101561048f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612440565b60405180821515815260200191505060405180910390f35b3480156104df57600080fd5b50610522600480360360208110156104f657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612512565b60405180821515815260200191505060405180910390f35b34801561054657600080fd5b5061054f6125e4565b6040518082815260200191505060405180910390f35b34801561057157600080fd5b506106626004803603608081101561058857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156105cf57600080fd5b8201836020820111156105e157600080fd5b8035906020019184600183028401116401000000008311171561060357600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803560ff1690602001909291905050506125f1565b60405180821515815260200191505060405180910390f35b34801561068657600080fd5b506107776004803603608081101561069d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156106e457600080fd5b8201836020820111156106f657600080fd5b8035906020019184600183028401116401000000008311171561071857600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803560ff1690602001909291905050506126fc565b60405180831515815260200180602001828103825283818151815260200191508051906020019080838360005b838110156107bf5780820151818401526020810190506107a4565b50505050905090810190601f1680156107ec5780820380516001836020036101000a031916815260200191505b50935050505060405180910390f35b34801561080757600080fd5b5061083e6004803603604081101561081e57600080fd5b810190808035906020019092919080359060200190929190505050612732565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561087e578082015181840152602081019050610863565b50505050905090810190601f1680156108ab5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156108c557600080fd5b506108f2600480360360208110156108dc57600080fd5b81019080803590602001909291905050506127b9565b6040518082815260200191505060405180910390f35b34801561091457600080fd5b506109576004803603602081101561092b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506127d1565b005b34801561096557600080fd5b506109926004803603602081101561097c57600080fd5b8101908080359060200190929190505050612b63565b005b610b3860048036036101408110156109ab57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156109f257600080fd5b820183602082011115610a0457600080fd5b80359060200191846001830284011164010000000083111715610a2657600080fd5b9091929391929390803560ff169060200190929190803590602001909291908035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190640100000000811115610ab257600080fd5b820183602082011115610ac457600080fd5b80359060200191846001830284011164010000000083111715610ae657600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050612c9d565b60405180821515815260200191505060405180910390f35b348015610b5c57600080fd5b50610ba960048036036040811015610b7357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612edc565b6040518082815260200191505060405180910390f35b348015610bcb57600080fd5b50610d2660048036036060811015610be257600080fd5b810190808035906020019092919080359060200190640100000000811115610c0957600080fd5b820183602082011115610c1b57600080fd5b80359060200191846001830284011164010000000083111715610c3d57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190640100000000811115610ca057600080fd5b820183602082011115610cb257600080fd5b80359060200191846001830284011164010000000083111715610cd457600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050612f01565b005b348015610d3457600080fd5b50610d3d612f90565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610d80578082015181840152602081019050610d65565b505050509050019250505060405180910390f35b348015610da057600080fd5b50610da9613139565b6040518082815260200191505060405180910390f35b348015610dcb57600080fd5b50610ea560048036036040811015610de257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190640100000000811115610e1f57600080fd5b820183602082011115610e3157600080fd5b80359060200191846001830284011164010000000083111715610e5357600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929050505061313f565b005b348015610eb357600080fd5b506110156004803603610100811015610ecb57600080fd5b8101908080359060200190640100000000811115610ee857600080fd5b820183602082011115610efa57600080fd5b80359060200191846020830284011164010000000083111715610f1c57600080fd5b909192939192939080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190640100000000811115610f6757600080fd5b820183602082011115610f7957600080fd5b80359060200191846001830284011164010000000083111715610f9b57600080fd5b9091929391929390803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613161565b005b34801561102357600080fd5b506110d26004803603608081101561103a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561108157600080fd5b82018360208201111561109357600080fd5b803590602001918460018302840111640100000000831117156110b557600080fd5b9091929391929390803560ff16906020019092919050505061331f565b6040518082815260200191505060405180910390f35b3480156110f457600080fd5b506111416004803603604081101561110b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050613447565b60405180806020018373ffffffffffffffffffffffffffffffffffffffff168152602001828103825284818151815260200191508051906020019060200280838360005b838110156111a0578082015181840152602081019050611185565b50505050905001935050505060405180910390f35b3480156111c157600080fd5b506111ee600480360360208110156111d857600080fd5b8101908080359060200190929190505050613639565b005b3480156111fc57600080fd5b50611314600480360361014081101561121457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561125b57600080fd5b82018360208201111561126d57600080fd5b8035906020019184600183028401116401000000008311171561128f57600080fd5b9091929391929390803560ff169060200190929190803590602001909291908035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506137d8565b6040518082815260200191505060405180910390f35b34801561133657600080fd5b506113996004803603604081101561134d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613805565b005b3480156113a757600080fd5b506113ea600480360360208110156113be57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613b96565b005b3480156113f857600080fd5b5061147b6004803603606081101561140f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613c1a565b005b34801561148957600080fd5b5061149261428c565b6040518082815260200191505060405180910390f35b3480156114b457600080fd5b506115cc60048036036101408110156114cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561151357600080fd5b82018360208201111561152557600080fd5b8035906020019184600183028401116401000000008311171561154757600080fd5b9091929391929390803560ff169060200190929190803590602001909291908035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050614296565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561160c5780820151818401526020810190506115f1565b50505050905090810190601f1680156116395780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561165357600080fd5b506116966004803603602081101561166a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061443e565b005b3480156116a457600080fd5b506116ad61449f565b6040518082815260200191505060405180910390f35b3480156116cf57600080fd5b5061173c600480360360608110156116e657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061451d565b005b34801561174a57600080fd5b50611753614950565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611793578082015181840152602081019050611778565b50505050905090810190601f1680156117c05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6117d6614989565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141580156118405750600173ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561187857503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b6118ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303300000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146119eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303400000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60026000600173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508160026000600173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506003600081548092919060010191905055507f9465fa0c962cc76958e6373a993326400c1c94f8be2fe3a952adfa7f60b2ea2682604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a18060045414611bba57611bb981612b63565b5b5050565b611bd2604182614a2c90919063ffffffff16565b82511015611c48576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330323000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000808060008060005b8681101561243457611c648882614a66565b80945081955082965050505060008460ff16141561206d578260001c9450611c96604188614a2c90919063ffffffff16565b8260001c1015611d0e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330323100000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b8751611d2760208460001c614a9590919063ffffffff16565b1115611d9b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330323200000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60006020838a01015190508851611dd182611dc360208760001c614a9590919063ffffffff16565b614a9590919063ffffffff16565b1115611e45576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330323300000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60606020848b010190506320c13b0b60e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168773ffffffffffffffffffffffffffffffffffffffff166320c13b0b8d846040518363ffffffff1660e01b8152600401808060200180602001838103835285818151815260200191508051906020019080838360005b83811015611ee7578082015181840152602081019050611ecc565b50505050905090810190601f168015611f145780820380516001836020036101000a031916815260200191505b50838103825284818151815260200191508051906020019080838360005b83811015611f4d578082015181840152602081019050611f32565b50505050905090810190601f168015611f7a5780820380516001836020036101000a031916815260200191505b5094505050505060206040518083038186803b158015611f9957600080fd5b505afa158015611fad573d6000803e3d6000fd5b505050506040513d6020811015611fc357600080fd5b81019080805190602001909291905050507bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614612066576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330323400000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b50506122b2565b60018460ff161415612181578260001c94508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061210a57506000600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008c81526020019081526020016000205414155b61217c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330323500000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6122b1565b601e8460ff1611156122495760018a60405160200180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c018281526020019150506040516020818303038152906040528051906020012060048603858560405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015612238573d6000803e3d6000fd5b5050506020604051035194506122b0565b60018a85858560405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa1580156122a3573d6000803e3d6000fd5b5050506020604051035194505b5b5b8573ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161180156123795750600073ffffffffffffffffffffffffffffffffffffffff16600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b80156123b25750600173ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b612424576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330323600000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b8495508080600101915050611c52565b50505050505050505050565b60008173ffffffffffffffffffffffffffffffffffffffff16600173ffffffffffffffffffffffffffffffffffffffff161415801561250b5750600073ffffffffffffffffffffffffffffffffffffffff16600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b9050919050565b6000600173ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141580156125dd5750600073ffffffffffffffffffffffffffffffffffffffff16600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b9050919050565b6000804690508091505090565b60007fb648d3644f584ed1c2232d53c46d87e693586486ad0d1175f8656013110b714e3386868686604051808673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018060200183600181111561266b57fe5b8152602001828103825284818151815260200191508051906020019080838360005b838110156126a857808201518184015260208101905061268d565b50505050905090810190601f1680156126d55780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a16126f285858585614ab4565b9050949350505050565b6000606061270c868686866125f1565b915060405160203d0181016040523d81523d6000602083013e8091505094509492505050565b606060006020830267ffffffffffffffff8111801561275057600080fd5b506040519080825280601f01601f1916602001820160405280156127835781602001600182028036833780820191505090505b50905060005b838110156127ae57808501548060208302602085010152508080600101915050612789565b508091505092915050565b60076020528060005260406000206000915090505481565b6127d9614989565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141580156128435750600173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b6128b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475331303100000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146129b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475331303200000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60016000600173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508060016000600173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fecdf3a3effea5783a3c4c2140e677577666428d44ed9d474a0b3a4c9943f844081604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b612b6b614989565b600354811115612be3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303100000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001811015612c5a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303200000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b806004819055507f610f7ff2b304ae8903c3de74c60c6ab1f7d6226b3f52c5161905bb5ad4039c936004546040518082815260200191505060405180910390a150565b6000606060055433600454604051602001808481526020018373ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405160208183030381529060405290507f66753cd2356569ee081232e3be8909b950e0a76c1f8460c3a5e3c2be32b11bed8d8d8d8d8d8d8d8d8d8d8d8c604051808d73ffffffffffffffffffffffffffffffffffffffff1681526020018c8152602001806020018a6001811115612d5057fe5b81526020018981526020018881526020018781526020018673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff168152602001806020018060200184810384528e8e82818152602001925080828437600081840152601f19601f820116905080830192505050848103835286818151815260200191508051906020019080838360005b83811015612e0a578082015181840152602081019050612def565b50505050905090810190601f168015612e375780820380516001836020036101000a031916815260200191505b50848103825285818151815260200191508051906020019080838360005b83811015612e70578082015181840152602081019050612e55565b50505050905090810190601f168015612e9d5780820380516001836020036101000a031916815260200191505b509f5050505050505050505050505050505060405180910390a1612eca8d8d8d8d8d8d8d8d8d8d8d614c9a565b9150509b9a5050505050505050505050565b6008602052816000526040600020602052806000526040600020600091509150505481565b6000600454905060008111612f7e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330303100000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b612f8a84848484611bbe565b50505050565b6060600060035467ffffffffffffffff81118015612fad57600080fd5b50604051908082528060200260200182016040528015612fdc5781602001602082028036833780820191505090505b50905060008060026000600173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505b600173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614613130578083838151811061308757fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508180600101925050613046565b82935050505090565b60055481565b600080825160208401855af4806000523d6020523d600060403e60403d016000fd5b6131ac8a8a80806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050896151d7565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16146131ea576131e9846156d7565b5b6132388787878080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050615706565b60008211156132525761325082600060018685615941565b505b3373ffffffffffffffffffffffffffffffffffffffff167f141df868a6331af528e38c83b7aa03edc19be66e37ae67f9285bf4f8e3c6a1a88b8b8b8b8960405180806020018581526020018473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281038252878782818152602001925060200280828437600081840152601f19601f820116905080830192505050965050505050505060405180910390a250505050505050505050565b6000805a9050613376878787878080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050865a615b47565b61337f57600080fd5b60005a8203905080604051602001808281526020019150506040516020818303038152906040526040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561340c5780820151818401526020810190506133f1565b50505050905090810190601f1680156134395780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b606060008267ffffffffffffffff8111801561346257600080fd5b506040519080825280602002602001820160405280156134915781602001602082028036833780820191505090505b509150600080600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141580156135645750600173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b801561356f57508482105b1561362a578084838151811061358157fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600160008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081806001019250506134fa565b80925081845250509250929050565b600073ffffffffffffffffffffffffffffffffffffffff16600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561373b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330333000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000838152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff16817ff2a0eb156472d1440255b0d7c1e19cc07115d1051fe605b0dce69acfec884d9c60405160405180910390a350565b60006137ed8c8c8c8c8c8c8c8c8c8c8c614296565b8051906020012090509b9a5050505050505050505050565b61380d614989565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141580156138775750600173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b6138e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475331303100000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146139e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475331303300000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600160008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507faab4fa2b463f581b2b32cb3b7e3b704b9ce37cc209b5fb4d77e593ace405427681604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a15050565b613b9e614989565b60007f4a204f620c8c5ccdca3fd54d003badd85ba500436a431f0cbda4f558c93c34c860001b90508181557f1151116914515bc0891ff9047a6cb32cf902546f83066499bcf8ba33d2353fa282604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a15050565b613c22614989565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614158015613c8c5750600173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b8015613cc457503073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b613d36576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303300000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614613e37576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303400000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614158015613ea15750600173ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b613f13576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303300000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff16600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614614013576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303500000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507ff8d49fc529812e9a7c5c50e69c20f0dccc0db8fa95c98bc58cc9a4f1c1299eaf82604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a17f9465fa0c962cc76958e6373a993326400c1c94f8be2fe3a952adfa7f60b2ea2681604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1505050565b6000600454905090565b606060007fbb8310d486368db6bd6f849402fdd73ad53d316b5a4b2644ad6efe0f941286d860001b8d8d8d8d60405180838380828437808301925050509250505060405180910390208c8c8c8c8c8c8c604051602001808c81526020018b73ffffffffffffffffffffffffffffffffffffffff1681526020018a815260200189815260200188600181111561432757fe5b81526020018781526020018681526020018581526020018473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019b505050505050505050505050604051602081830303815290604052805190602001209050601960f81b600160f81b6143b361449f565b8360405160200180857effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168152600101847effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526001018381526020018281526020019450505050506040516020818303038152906040529150509b9a5050505050505050505050565b614446614989565b61444f816156d7565b7f5ac6c46c93c8d0e53714ba3b53db3e7c046da994313d7ed0d192028bc7c228b081604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b60007f47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a7946921860001b6144cd6125e4565b30604051602001808481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff168152602001935050505060405160208183030381529060405280519060200120905090565b614525614989565b8060016003540310156145a0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303100000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561460a5750600173ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b61467c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303300000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff16600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461477c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303500000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600360008154809291906001900391905055507ff8d49fc529812e9a7c5c50e69c20f0dccc0db8fa95c98bc58cc9a4f1c1299eaf82604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1806004541461494b5761494a81612b63565b5b505050565b6040518060400160405280600581526020017f312e332e3000000000000000000000000000000000000000000000000000000081525081565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614614a2a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330333100000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b565b600080831415614a3f5760009050614a60565b6000828402905082848281614a5057fe5b0414614a5b57600080fd5b809150505b92915050565b60008060008360410260208101860151925060408101860151915060ff60418201870151169350509250925092565b600080828401905083811015614aaa57600080fd5b8091505092915050565b6000600173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614158015614b7f5750600073ffffffffffffffffffffffffffffffffffffffff16600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b614bf1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475331303400000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b614bfe858585855a615b47565b90508015614c4e573373ffffffffffffffffffffffffffffffffffffffff167f6895c13664aa4f67288b25d7a21d7aaa34916e355fb9b6fae0a139a9085becb860405160405180910390a2614c92565b3373ffffffffffffffffffffffffffffffffffffffff167facd2c8702804128fdb0db2bb49f6d127dd0181c13fd45dbfe16de0930e2bd37560405160405180910390a25b949350505050565b6000806000614cb48e8e8e8e8e8e8e8e8e8e600554614296565b905060056000815480929190600101919050555080805190602001209150614cdd828286612f01565b506000614ce8615b93565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614614ece578073ffffffffffffffffffffffffffffffffffffffff166375f0bb528f8f8f8f8f8f8f8f8f8f8f336040518d63ffffffff1660e01b8152600401808d73ffffffffffffffffffffffffffffffffffffffff1681526020018c8152602001806020018a6001811115614d8b57fe5b81526020018981526020018881526020018781526020018673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff168152602001806020018473ffffffffffffffffffffffffffffffffffffffff16815260200183810383528d8d82818152602001925080828437600081840152601f19601f820116905080830192505050838103825285818151815260200191508051906020019080838360005b83811015614e5d578082015181840152602081019050614e42565b50505050905090810190601f168015614e8a5780820380516001836020036101000a031916815260200191505b509e505050505050505050505050505050600060405180830381600087803b158015614eb557600080fd5b505af1158015614ec9573d6000803e3d6000fd5b505050505b6101f4614ef56109c48b01603f60408d0281614ee657fe5b04615bc490919063ffffffff16565b015a1015614f6b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330313000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005a9050614fd48f8f8f8f8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050508e60008d14614fc9578e614fcf565b6109c45a035b615b47565b9350614fe95a82615bde90919063ffffffff16565b90508380614ff8575060008a14155b80615004575060008814155b615076576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330313300000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000808911156150905761508d828b8b8b8b615941565b90505b84156150da577f442e715f626346e8c54381002da614f62bee8d27386535b2521ec8540898556e8482604051808381526020018281526020019250505060405180910390a161511a565b7f23428b18acfb3ea64b08dc0c1d296ea9c09702c09083ca5272e64d115b687d238482604051808381526020018281526020019250505060405180910390a15b5050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146151c6578073ffffffffffffffffffffffffffffffffffffffff16639327136883856040518363ffffffff1660e01b815260040180838152602001821515815260200192505050600060405180830381600087803b1580156151ad57600080fd5b505af11580156151c1573d6000803e3d6000fd5b505050505b50509b9a5050505050505050505050565b60006004541461524f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b81518111156152c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303100000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600181101561533d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303200000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60006001905060005b835181101561564357600084828151811061535d57fe5b60200260200101519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141580156153d15750600173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b801561540957503073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b801561544157508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b6154b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303300000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146155b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303400000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550809250508080600101915050615346565b506001600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550825160038190555081600481905550505050565b60007f6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d560001b90508181555050565b600073ffffffffffffffffffffffffffffffffffffffff1660016000600173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614615808576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475331303000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001806000600173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161461593d576158ca8260008360015a615b47565b61593c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330303000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b5b5050565b600080600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161461597e5782615980565b325b9050600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415615a98576159ea3a86106159c7573a6159c9565b855b6159dc888a614a9590919063ffffffff16565b614a2c90919063ffffffff16565b91508073ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050615a93576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330313100000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b615b3d565b615abd85615aaf888a614a9590919063ffffffff16565b614a2c90919063ffffffff16565b9150615aca848284615bfe565b615b3c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330313200000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b5b5095945050505050565b6000600180811115615b5557fe5b836001811115615b6157fe5b1415615b7a576000808551602087018986f49050615b8a565b600080855160208701888a87f190505b95945050505050565b6000807f4a204f620c8c5ccdca3fd54d003badd85ba500436a431f0cbda4f558c93c34c860001b9050805491505090565b600081831015615bd45781615bd6565b825b905092915050565b600082821115615bed57600080fd5b600082840390508091505092915050565b60008063a9059cbb8484604051602401808373ffffffffffffffffffffffffffffffffffffffff168152602001828152602001925050506040516020818303038152906040529060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050509050602060008251602084016000896127105a03f13d60008114615ca55760208114615cad5760009350615cb8565b819350615cb8565b600051158215171593505b505050939250505056fea2646970667358221220047fac33099ca576d1c4f1ac6a8abdb0396e42ad6a397d2cb2f4dc1624cc0c5b64736f6c63430007060033", +} + +// SafeL2V130ABI is the input ABI used to generate the binding from. +// Deprecated: Use SafeL2V130MetaData.ABI instead. +var SafeL2V130ABI = SafeL2V130MetaData.ABI + +// SafeL2V130Bin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use SafeL2V130MetaData.Bin instead. +var SafeL2V130Bin = SafeL2V130MetaData.Bin + +// DeploySafeL2V130 deploys a new Ethereum contract, binding an instance of SafeL2V130 to it. +func DeploySafeL2V130(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *SafeL2V130, error) { + parsed, err := SafeL2V130MetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(SafeL2V130Bin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &SafeL2V130{SafeL2V130Caller: SafeL2V130Caller{contract: contract}, SafeL2V130Transactor: SafeL2V130Transactor{contract: contract}, SafeL2V130Filterer: SafeL2V130Filterer{contract: contract}}, nil +} + +// SafeL2V130 is an auto generated Go binding around an Ethereum contract. +type SafeL2V130 struct { + SafeL2V130Caller // Read-only binding to the contract + SafeL2V130Transactor // Write-only binding to the contract + SafeL2V130Filterer // Log filterer for contract events +} + +// SafeL2V130Caller is an auto generated read-only Go binding around an Ethereum contract. +type SafeL2V130Caller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SafeL2V130Transactor is an auto generated write-only Go binding around an Ethereum contract. +type SafeL2V130Transactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SafeL2V130Filterer is an auto generated log filtering Go binding around an Ethereum contract events. +type SafeL2V130Filterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SafeL2V130Session is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type SafeL2V130Session struct { + Contract *SafeL2V130 // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// SafeL2V130CallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type SafeL2V130CallerSession struct { + Contract *SafeL2V130Caller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// SafeL2V130TransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type SafeL2V130TransactorSession struct { + Contract *SafeL2V130Transactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// SafeL2V130Raw is an auto generated low-level Go binding around an Ethereum contract. +type SafeL2V130Raw struct { + Contract *SafeL2V130 // Generic contract binding to access the raw methods on +} + +// SafeL2V130CallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type SafeL2V130CallerRaw struct { + Contract *SafeL2V130Caller // Generic read-only contract binding to access the raw methods on +} + +// SafeL2V130TransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type SafeL2V130TransactorRaw struct { + Contract *SafeL2V130Transactor // Generic write-only contract binding to access the raw methods on +} + +// NewSafeL2V130 creates a new instance of SafeL2V130, bound to a specific deployed contract. +func NewSafeL2V130(address common.Address, backend bind.ContractBackend) (*SafeL2V130, error) { + contract, err := bindSafeL2V130(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &SafeL2V130{SafeL2V130Caller: SafeL2V130Caller{contract: contract}, SafeL2V130Transactor: SafeL2V130Transactor{contract: contract}, SafeL2V130Filterer: SafeL2V130Filterer{contract: contract}}, nil +} + +// NewSafeL2V130Caller creates a new read-only instance of SafeL2V130, bound to a specific deployed contract. +func NewSafeL2V130Caller(address common.Address, caller bind.ContractCaller) (*SafeL2V130Caller, error) { + contract, err := bindSafeL2V130(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &SafeL2V130Caller{contract: contract}, nil +} + +// NewSafeL2V130Transactor creates a new write-only instance of SafeL2V130, bound to a specific deployed contract. +func NewSafeL2V130Transactor(address common.Address, transactor bind.ContractTransactor) (*SafeL2V130Transactor, error) { + contract, err := bindSafeL2V130(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &SafeL2V130Transactor{contract: contract}, nil +} + +// NewSafeL2V130Filterer creates a new log filterer instance of SafeL2V130, bound to a specific deployed contract. +func NewSafeL2V130Filterer(address common.Address, filterer bind.ContractFilterer) (*SafeL2V130Filterer, error) { + contract, err := bindSafeL2V130(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &SafeL2V130Filterer{contract: contract}, nil +} + +// bindSafeL2V130 binds a generic wrapper to an already deployed contract. +func bindSafeL2V130(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(SafeL2V130ABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_SafeL2V130 *SafeL2V130Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _SafeL2V130.Contract.SafeL2V130Caller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_SafeL2V130 *SafeL2V130Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SafeL2V130.Contract.SafeL2V130Transactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_SafeL2V130 *SafeL2V130Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _SafeL2V130.Contract.SafeL2V130Transactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_SafeL2V130 *SafeL2V130CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _SafeL2V130.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_SafeL2V130 *SafeL2V130TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SafeL2V130.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_SafeL2V130 *SafeL2V130TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _SafeL2V130.Contract.contract.Transact(opts, method, params...) +} + +// VERSION is a free data retrieval call binding the contract method 0xffa1ad74. +// +// Solidity: function VERSION() view returns(string) +func (_SafeL2V130 *SafeL2V130Caller) VERSION(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _SafeL2V130.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 0xffa1ad74. +// +// Solidity: function VERSION() view returns(string) +func (_SafeL2V130 *SafeL2V130Session) VERSION() (string, error) { + return _SafeL2V130.Contract.VERSION(&_SafeL2V130.CallOpts) +} + +// VERSION is a free data retrieval call binding the contract method 0xffa1ad74. +// +// Solidity: function VERSION() view returns(string) +func (_SafeL2V130 *SafeL2V130CallerSession) VERSION() (string, error) { + return _SafeL2V130.Contract.VERSION(&_SafeL2V130.CallOpts) +} + +// ApprovedHashes is a free data retrieval call binding the contract method 0x7d832974. +// +// Solidity: function approvedHashes(address , bytes32 ) view returns(uint256) +func (_SafeL2V130 *SafeL2V130Caller) ApprovedHashes(opts *bind.CallOpts, arg0 common.Address, arg1 [32]byte) (*big.Int, error) { + var out []interface{} + err := _SafeL2V130.contract.Call(opts, &out, "approvedHashes", arg0, arg1) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// ApprovedHashes is a free data retrieval call binding the contract method 0x7d832974. +// +// Solidity: function approvedHashes(address , bytes32 ) view returns(uint256) +func (_SafeL2V130 *SafeL2V130Session) ApprovedHashes(arg0 common.Address, arg1 [32]byte) (*big.Int, error) { + return _SafeL2V130.Contract.ApprovedHashes(&_SafeL2V130.CallOpts, arg0, arg1) +} + +// ApprovedHashes is a free data retrieval call binding the contract method 0x7d832974. +// +// Solidity: function approvedHashes(address , bytes32 ) view returns(uint256) +func (_SafeL2V130 *SafeL2V130CallerSession) ApprovedHashes(arg0 common.Address, arg1 [32]byte) (*big.Int, error) { + return _SafeL2V130.Contract.ApprovedHashes(&_SafeL2V130.CallOpts, arg0, arg1) +} + +// CheckNSignatures is a free data retrieval call binding the contract method 0x12fb68e0. +// +// Solidity: function checkNSignatures(bytes32 dataHash, bytes data, bytes signatures, uint256 requiredSignatures) view returns() +func (_SafeL2V130 *SafeL2V130Caller) CheckNSignatures(opts *bind.CallOpts, dataHash [32]byte, data []byte, signatures []byte, requiredSignatures *big.Int) error { + var out []interface{} + err := _SafeL2V130.contract.Call(opts, &out, "checkNSignatures", dataHash, data, signatures, requiredSignatures) + + if err != nil { + return err + } + + return err + +} + +// CheckNSignatures is a free data retrieval call binding the contract method 0x12fb68e0. +// +// Solidity: function checkNSignatures(bytes32 dataHash, bytes data, bytes signatures, uint256 requiredSignatures) view returns() +func (_SafeL2V130 *SafeL2V130Session) CheckNSignatures(dataHash [32]byte, data []byte, signatures []byte, requiredSignatures *big.Int) error { + return _SafeL2V130.Contract.CheckNSignatures(&_SafeL2V130.CallOpts, dataHash, data, signatures, requiredSignatures) +} + +// CheckNSignatures is a free data retrieval call binding the contract method 0x12fb68e0. +// +// Solidity: function checkNSignatures(bytes32 dataHash, bytes data, bytes signatures, uint256 requiredSignatures) view returns() +func (_SafeL2V130 *SafeL2V130CallerSession) CheckNSignatures(dataHash [32]byte, data []byte, signatures []byte, requiredSignatures *big.Int) error { + return _SafeL2V130.Contract.CheckNSignatures(&_SafeL2V130.CallOpts, dataHash, data, signatures, requiredSignatures) +} + +// CheckSignatures is a free data retrieval call binding the contract method 0x934f3a11. +// +// Solidity: function checkSignatures(bytes32 dataHash, bytes data, bytes signatures) view returns() +func (_SafeL2V130 *SafeL2V130Caller) CheckSignatures(opts *bind.CallOpts, dataHash [32]byte, data []byte, signatures []byte) error { + var out []interface{} + err := _SafeL2V130.contract.Call(opts, &out, "checkSignatures", dataHash, data, signatures) + + if err != nil { + return err + } + + return err + +} + +// CheckSignatures is a free data retrieval call binding the contract method 0x934f3a11. +// +// Solidity: function checkSignatures(bytes32 dataHash, bytes data, bytes signatures) view returns() +func (_SafeL2V130 *SafeL2V130Session) CheckSignatures(dataHash [32]byte, data []byte, signatures []byte) error { + return _SafeL2V130.Contract.CheckSignatures(&_SafeL2V130.CallOpts, dataHash, data, signatures) +} + +// CheckSignatures is a free data retrieval call binding the contract method 0x934f3a11. +// +// Solidity: function checkSignatures(bytes32 dataHash, bytes data, bytes signatures) view returns() +func (_SafeL2V130 *SafeL2V130CallerSession) CheckSignatures(dataHash [32]byte, data []byte, signatures []byte) error { + return _SafeL2V130.Contract.CheckSignatures(&_SafeL2V130.CallOpts, dataHash, data, signatures) +} + +// DomainSeparator is a free data retrieval call binding the contract method 0xf698da25. +// +// Solidity: function domainSeparator() view returns(bytes32) +func (_SafeL2V130 *SafeL2V130Caller) DomainSeparator(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _SafeL2V130.contract.Call(opts, &out, "domainSeparator") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// DomainSeparator is a free data retrieval call binding the contract method 0xf698da25. +// +// Solidity: function domainSeparator() view returns(bytes32) +func (_SafeL2V130 *SafeL2V130Session) DomainSeparator() ([32]byte, error) { + return _SafeL2V130.Contract.DomainSeparator(&_SafeL2V130.CallOpts) +} + +// DomainSeparator is a free data retrieval call binding the contract method 0xf698da25. +// +// Solidity: function domainSeparator() view returns(bytes32) +func (_SafeL2V130 *SafeL2V130CallerSession) DomainSeparator() ([32]byte, error) { + return _SafeL2V130.Contract.DomainSeparator(&_SafeL2V130.CallOpts) +} + +// EncodeTransactionData is a free data retrieval call binding the contract method 0xe86637db. +// +// Solidity: function encodeTransactionData(address to, uint256 value, bytes data, uint8 operation, uint256 safeTxGas, uint256 baseGas, uint256 gasPrice, address gasToken, address refundReceiver, uint256 _nonce) view returns(bytes) +func (_SafeL2V130 *SafeL2V130Caller) EncodeTransactionData(opts *bind.CallOpts, to common.Address, value *big.Int, data []byte, operation uint8, safeTxGas *big.Int, baseGas *big.Int, gasPrice *big.Int, gasToken common.Address, refundReceiver common.Address, _nonce *big.Int) ([]byte, error) { + var out []interface{} + err := _SafeL2V130.contract.Call(opts, &out, "encodeTransactionData", to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +// EncodeTransactionData is a free data retrieval call binding the contract method 0xe86637db. +// +// Solidity: function encodeTransactionData(address to, uint256 value, bytes data, uint8 operation, uint256 safeTxGas, uint256 baseGas, uint256 gasPrice, address gasToken, address refundReceiver, uint256 _nonce) view returns(bytes) +func (_SafeL2V130 *SafeL2V130Session) EncodeTransactionData(to common.Address, value *big.Int, data []byte, operation uint8, safeTxGas *big.Int, baseGas *big.Int, gasPrice *big.Int, gasToken common.Address, refundReceiver common.Address, _nonce *big.Int) ([]byte, error) { + return _SafeL2V130.Contract.EncodeTransactionData(&_SafeL2V130.CallOpts, to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce) +} + +// EncodeTransactionData is a free data retrieval call binding the contract method 0xe86637db. +// +// Solidity: function encodeTransactionData(address to, uint256 value, bytes data, uint8 operation, uint256 safeTxGas, uint256 baseGas, uint256 gasPrice, address gasToken, address refundReceiver, uint256 _nonce) view returns(bytes) +func (_SafeL2V130 *SafeL2V130CallerSession) EncodeTransactionData(to common.Address, value *big.Int, data []byte, operation uint8, safeTxGas *big.Int, baseGas *big.Int, gasPrice *big.Int, gasToken common.Address, refundReceiver common.Address, _nonce *big.Int) ([]byte, error) { + return _SafeL2V130.Contract.EncodeTransactionData(&_SafeL2V130.CallOpts, to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce) +} + +// GetChainId is a free data retrieval call binding the contract method 0x3408e470. +// +// Solidity: function getChainId() view returns(uint256) +func (_SafeL2V130 *SafeL2V130Caller) GetChainId(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _SafeL2V130.contract.Call(opts, &out, "getChainId") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetChainId is a free data retrieval call binding the contract method 0x3408e470. +// +// Solidity: function getChainId() view returns(uint256) +func (_SafeL2V130 *SafeL2V130Session) GetChainId() (*big.Int, error) { + return _SafeL2V130.Contract.GetChainId(&_SafeL2V130.CallOpts) +} + +// GetChainId is a free data retrieval call binding the contract method 0x3408e470. +// +// Solidity: function getChainId() view returns(uint256) +func (_SafeL2V130 *SafeL2V130CallerSession) GetChainId() (*big.Int, error) { + return _SafeL2V130.Contract.GetChainId(&_SafeL2V130.CallOpts) +} + +// GetModulesPaginated is a free data retrieval call binding the contract method 0xcc2f8452. +// +// Solidity: function getModulesPaginated(address start, uint256 pageSize) view returns(address[] array, address next) +func (_SafeL2V130 *SafeL2V130Caller) GetModulesPaginated(opts *bind.CallOpts, start common.Address, pageSize *big.Int) (struct { + Array []common.Address + Next common.Address +}, error) { + var out []interface{} + err := _SafeL2V130.contract.Call(opts, &out, "getModulesPaginated", start, pageSize) + + outstruct := new(struct { + Array []common.Address + Next common.Address + }) + if err != nil { + return *outstruct, err + } + + outstruct.Array = *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + outstruct.Next = *abi.ConvertType(out[1], new(common.Address)).(*common.Address) + + return *outstruct, err + +} + +// GetModulesPaginated is a free data retrieval call binding the contract method 0xcc2f8452. +// +// Solidity: function getModulesPaginated(address start, uint256 pageSize) view returns(address[] array, address next) +func (_SafeL2V130 *SafeL2V130Session) GetModulesPaginated(start common.Address, pageSize *big.Int) (struct { + Array []common.Address + Next common.Address +}, error) { + return _SafeL2V130.Contract.GetModulesPaginated(&_SafeL2V130.CallOpts, start, pageSize) +} + +// GetModulesPaginated is a free data retrieval call binding the contract method 0xcc2f8452. +// +// Solidity: function getModulesPaginated(address start, uint256 pageSize) view returns(address[] array, address next) +func (_SafeL2V130 *SafeL2V130CallerSession) GetModulesPaginated(start common.Address, pageSize *big.Int) (struct { + Array []common.Address + Next common.Address +}, error) { + return _SafeL2V130.Contract.GetModulesPaginated(&_SafeL2V130.CallOpts, start, pageSize) +} + +// GetOwners is a free data retrieval call binding the contract method 0xa0e67e2b. +// +// Solidity: function getOwners() view returns(address[]) +func (_SafeL2V130 *SafeL2V130Caller) GetOwners(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _SafeL2V130.contract.Call(opts, &out, "getOwners") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +// GetOwners is a free data retrieval call binding the contract method 0xa0e67e2b. +// +// Solidity: function getOwners() view returns(address[]) +func (_SafeL2V130 *SafeL2V130Session) GetOwners() ([]common.Address, error) { + return _SafeL2V130.Contract.GetOwners(&_SafeL2V130.CallOpts) +} + +// GetOwners is a free data retrieval call binding the contract method 0xa0e67e2b. +// +// Solidity: function getOwners() view returns(address[]) +func (_SafeL2V130 *SafeL2V130CallerSession) GetOwners() ([]common.Address, error) { + return _SafeL2V130.Contract.GetOwners(&_SafeL2V130.CallOpts) +} + +// GetStorageAt is a free data retrieval call binding the contract method 0x5624b25b. +// +// Solidity: function getStorageAt(uint256 offset, uint256 length) view returns(bytes) +func (_SafeL2V130 *SafeL2V130Caller) GetStorageAt(opts *bind.CallOpts, offset *big.Int, length *big.Int) ([]byte, error) { + var out []interface{} + err := _SafeL2V130.contract.Call(opts, &out, "getStorageAt", offset, length) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +// GetStorageAt is a free data retrieval call binding the contract method 0x5624b25b. +// +// Solidity: function getStorageAt(uint256 offset, uint256 length) view returns(bytes) +func (_SafeL2V130 *SafeL2V130Session) GetStorageAt(offset *big.Int, length *big.Int) ([]byte, error) { + return _SafeL2V130.Contract.GetStorageAt(&_SafeL2V130.CallOpts, offset, length) +} + +// GetStorageAt is a free data retrieval call binding the contract method 0x5624b25b. +// +// Solidity: function getStorageAt(uint256 offset, uint256 length) view returns(bytes) +func (_SafeL2V130 *SafeL2V130CallerSession) GetStorageAt(offset *big.Int, length *big.Int) ([]byte, error) { + return _SafeL2V130.Contract.GetStorageAt(&_SafeL2V130.CallOpts, offset, length) +} + +// GetThreshold is a free data retrieval call binding the contract method 0xe75235b8. +// +// Solidity: function getThreshold() view returns(uint256) +func (_SafeL2V130 *SafeL2V130Caller) GetThreshold(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _SafeL2V130.contract.Call(opts, &out, "getThreshold") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetThreshold is a free data retrieval call binding the contract method 0xe75235b8. +// +// Solidity: function getThreshold() view returns(uint256) +func (_SafeL2V130 *SafeL2V130Session) GetThreshold() (*big.Int, error) { + return _SafeL2V130.Contract.GetThreshold(&_SafeL2V130.CallOpts) +} + +// GetThreshold is a free data retrieval call binding the contract method 0xe75235b8. +// +// Solidity: function getThreshold() view returns(uint256) +func (_SafeL2V130 *SafeL2V130CallerSession) GetThreshold() (*big.Int, error) { + return _SafeL2V130.Contract.GetThreshold(&_SafeL2V130.CallOpts) +} + +// GetTransactionHash is a free data retrieval call binding the contract method 0xd8d11f78. +// +// Solidity: function getTransactionHash(address to, uint256 value, bytes data, uint8 operation, uint256 safeTxGas, uint256 baseGas, uint256 gasPrice, address gasToken, address refundReceiver, uint256 _nonce) view returns(bytes32) +func (_SafeL2V130 *SafeL2V130Caller) GetTransactionHash(opts *bind.CallOpts, to common.Address, value *big.Int, data []byte, operation uint8, safeTxGas *big.Int, baseGas *big.Int, gasPrice *big.Int, gasToken common.Address, refundReceiver common.Address, _nonce *big.Int) ([32]byte, error) { + var out []interface{} + err := _SafeL2V130.contract.Call(opts, &out, "getTransactionHash", to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// GetTransactionHash is a free data retrieval call binding the contract method 0xd8d11f78. +// +// Solidity: function getTransactionHash(address to, uint256 value, bytes data, uint8 operation, uint256 safeTxGas, uint256 baseGas, uint256 gasPrice, address gasToken, address refundReceiver, uint256 _nonce) view returns(bytes32) +func (_SafeL2V130 *SafeL2V130Session) GetTransactionHash(to common.Address, value *big.Int, data []byte, operation uint8, safeTxGas *big.Int, baseGas *big.Int, gasPrice *big.Int, gasToken common.Address, refundReceiver common.Address, _nonce *big.Int) ([32]byte, error) { + return _SafeL2V130.Contract.GetTransactionHash(&_SafeL2V130.CallOpts, to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce) +} + +// GetTransactionHash is a free data retrieval call binding the contract method 0xd8d11f78. +// +// Solidity: function getTransactionHash(address to, uint256 value, bytes data, uint8 operation, uint256 safeTxGas, uint256 baseGas, uint256 gasPrice, address gasToken, address refundReceiver, uint256 _nonce) view returns(bytes32) +func (_SafeL2V130 *SafeL2V130CallerSession) GetTransactionHash(to common.Address, value *big.Int, data []byte, operation uint8, safeTxGas *big.Int, baseGas *big.Int, gasPrice *big.Int, gasToken common.Address, refundReceiver common.Address, _nonce *big.Int) ([32]byte, error) { + return _SafeL2V130.Contract.GetTransactionHash(&_SafeL2V130.CallOpts, to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce) +} + +// IsModuleEnabled is a free data retrieval call binding the contract method 0x2d9ad53d. +// +// Solidity: function isModuleEnabled(address module) view returns(bool) +func (_SafeL2V130 *SafeL2V130Caller) IsModuleEnabled(opts *bind.CallOpts, module common.Address) (bool, error) { + var out []interface{} + err := _SafeL2V130.contract.Call(opts, &out, "isModuleEnabled", module) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsModuleEnabled is a free data retrieval call binding the contract method 0x2d9ad53d. +// +// Solidity: function isModuleEnabled(address module) view returns(bool) +func (_SafeL2V130 *SafeL2V130Session) IsModuleEnabled(module common.Address) (bool, error) { + return _SafeL2V130.Contract.IsModuleEnabled(&_SafeL2V130.CallOpts, module) +} + +// IsModuleEnabled is a free data retrieval call binding the contract method 0x2d9ad53d. +// +// Solidity: function isModuleEnabled(address module) view returns(bool) +func (_SafeL2V130 *SafeL2V130CallerSession) IsModuleEnabled(module common.Address) (bool, error) { + return _SafeL2V130.Contract.IsModuleEnabled(&_SafeL2V130.CallOpts, module) +} + +// IsOwner is a free data retrieval call binding the contract method 0x2f54bf6e. +// +// Solidity: function isOwner(address owner) view returns(bool) +func (_SafeL2V130 *SafeL2V130Caller) IsOwner(opts *bind.CallOpts, owner common.Address) (bool, error) { + var out []interface{} + err := _SafeL2V130.contract.Call(opts, &out, "isOwner", owner) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsOwner is a free data retrieval call binding the contract method 0x2f54bf6e. +// +// Solidity: function isOwner(address owner) view returns(bool) +func (_SafeL2V130 *SafeL2V130Session) IsOwner(owner common.Address) (bool, error) { + return _SafeL2V130.Contract.IsOwner(&_SafeL2V130.CallOpts, owner) +} + +// IsOwner is a free data retrieval call binding the contract method 0x2f54bf6e. +// +// Solidity: function isOwner(address owner) view returns(bool) +func (_SafeL2V130 *SafeL2V130CallerSession) IsOwner(owner common.Address) (bool, error) { + return _SafeL2V130.Contract.IsOwner(&_SafeL2V130.CallOpts, owner) +} + +// Nonce is a free data retrieval call binding the contract method 0xaffed0e0. +// +// Solidity: function nonce() view returns(uint256) +func (_SafeL2V130 *SafeL2V130Caller) Nonce(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _SafeL2V130.contract.Call(opts, &out, "nonce") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Nonce is a free data retrieval call binding the contract method 0xaffed0e0. +// +// Solidity: function nonce() view returns(uint256) +func (_SafeL2V130 *SafeL2V130Session) Nonce() (*big.Int, error) { + return _SafeL2V130.Contract.Nonce(&_SafeL2V130.CallOpts) +} + +// Nonce is a free data retrieval call binding the contract method 0xaffed0e0. +// +// Solidity: function nonce() view returns(uint256) +func (_SafeL2V130 *SafeL2V130CallerSession) Nonce() (*big.Int, error) { + return _SafeL2V130.Contract.Nonce(&_SafeL2V130.CallOpts) +} + +// SignedMessages is a free data retrieval call binding the contract method 0x5ae6bd37. +// +// Solidity: function signedMessages(bytes32 ) view returns(uint256) +func (_SafeL2V130 *SafeL2V130Caller) SignedMessages(opts *bind.CallOpts, arg0 [32]byte) (*big.Int, error) { + var out []interface{} + err := _SafeL2V130.contract.Call(opts, &out, "signedMessages", arg0) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// SignedMessages is a free data retrieval call binding the contract method 0x5ae6bd37. +// +// Solidity: function signedMessages(bytes32 ) view returns(uint256) +func (_SafeL2V130 *SafeL2V130Session) SignedMessages(arg0 [32]byte) (*big.Int, error) { + return _SafeL2V130.Contract.SignedMessages(&_SafeL2V130.CallOpts, arg0) +} + +// SignedMessages is a free data retrieval call binding the contract method 0x5ae6bd37. +// +// Solidity: function signedMessages(bytes32 ) view returns(uint256) +func (_SafeL2V130 *SafeL2V130CallerSession) SignedMessages(arg0 [32]byte) (*big.Int, error) { + return _SafeL2V130.Contract.SignedMessages(&_SafeL2V130.CallOpts, arg0) +} + +// AddOwnerWithThreshold is a paid mutator transaction binding the contract method 0x0d582f13. +// +// Solidity: function addOwnerWithThreshold(address owner, uint256 _threshold) returns() +func (_SafeL2V130 *SafeL2V130Transactor) AddOwnerWithThreshold(opts *bind.TransactOpts, owner common.Address, _threshold *big.Int) (*types.Transaction, error) { + return _SafeL2V130.contract.Transact(opts, "addOwnerWithThreshold", owner, _threshold) +} + +// AddOwnerWithThreshold is a paid mutator transaction binding the contract method 0x0d582f13. +// +// Solidity: function addOwnerWithThreshold(address owner, uint256 _threshold) returns() +func (_SafeL2V130 *SafeL2V130Session) AddOwnerWithThreshold(owner common.Address, _threshold *big.Int) (*types.Transaction, error) { + return _SafeL2V130.Contract.AddOwnerWithThreshold(&_SafeL2V130.TransactOpts, owner, _threshold) +} + +// AddOwnerWithThreshold is a paid mutator transaction binding the contract method 0x0d582f13. +// +// Solidity: function addOwnerWithThreshold(address owner, uint256 _threshold) returns() +func (_SafeL2V130 *SafeL2V130TransactorSession) AddOwnerWithThreshold(owner common.Address, _threshold *big.Int) (*types.Transaction, error) { + return _SafeL2V130.Contract.AddOwnerWithThreshold(&_SafeL2V130.TransactOpts, owner, _threshold) +} + +// ApproveHash is a paid mutator transaction binding the contract method 0xd4d9bdcd. +// +// Solidity: function approveHash(bytes32 hashToApprove) returns() +func (_SafeL2V130 *SafeL2V130Transactor) ApproveHash(opts *bind.TransactOpts, hashToApprove [32]byte) (*types.Transaction, error) { + return _SafeL2V130.contract.Transact(opts, "approveHash", hashToApprove) +} + +// ApproveHash is a paid mutator transaction binding the contract method 0xd4d9bdcd. +// +// Solidity: function approveHash(bytes32 hashToApprove) returns() +func (_SafeL2V130 *SafeL2V130Session) ApproveHash(hashToApprove [32]byte) (*types.Transaction, error) { + return _SafeL2V130.Contract.ApproveHash(&_SafeL2V130.TransactOpts, hashToApprove) +} + +// ApproveHash is a paid mutator transaction binding the contract method 0xd4d9bdcd. +// +// Solidity: function approveHash(bytes32 hashToApprove) returns() +func (_SafeL2V130 *SafeL2V130TransactorSession) ApproveHash(hashToApprove [32]byte) (*types.Transaction, error) { + return _SafeL2V130.Contract.ApproveHash(&_SafeL2V130.TransactOpts, hashToApprove) +} + +// ChangeThreshold is a paid mutator transaction binding the contract method 0x694e80c3. +// +// Solidity: function changeThreshold(uint256 _threshold) returns() +func (_SafeL2V130 *SafeL2V130Transactor) ChangeThreshold(opts *bind.TransactOpts, _threshold *big.Int) (*types.Transaction, error) { + return _SafeL2V130.contract.Transact(opts, "changeThreshold", _threshold) +} + +// ChangeThreshold is a paid mutator transaction binding the contract method 0x694e80c3. +// +// Solidity: function changeThreshold(uint256 _threshold) returns() +func (_SafeL2V130 *SafeL2V130Session) ChangeThreshold(_threshold *big.Int) (*types.Transaction, error) { + return _SafeL2V130.Contract.ChangeThreshold(&_SafeL2V130.TransactOpts, _threshold) +} + +// ChangeThreshold is a paid mutator transaction binding the contract method 0x694e80c3. +// +// Solidity: function changeThreshold(uint256 _threshold) returns() +func (_SafeL2V130 *SafeL2V130TransactorSession) ChangeThreshold(_threshold *big.Int) (*types.Transaction, error) { + return _SafeL2V130.Contract.ChangeThreshold(&_SafeL2V130.TransactOpts, _threshold) +} + +// DisableModule is a paid mutator transaction binding the contract method 0xe009cfde. +// +// Solidity: function disableModule(address prevModule, address module) returns() +func (_SafeL2V130 *SafeL2V130Transactor) DisableModule(opts *bind.TransactOpts, prevModule common.Address, module common.Address) (*types.Transaction, error) { + return _SafeL2V130.contract.Transact(opts, "disableModule", prevModule, module) +} + +// DisableModule is a paid mutator transaction binding the contract method 0xe009cfde. +// +// Solidity: function disableModule(address prevModule, address module) returns() +func (_SafeL2V130 *SafeL2V130Session) DisableModule(prevModule common.Address, module common.Address) (*types.Transaction, error) { + return _SafeL2V130.Contract.DisableModule(&_SafeL2V130.TransactOpts, prevModule, module) +} + +// DisableModule is a paid mutator transaction binding the contract method 0xe009cfde. +// +// Solidity: function disableModule(address prevModule, address module) returns() +func (_SafeL2V130 *SafeL2V130TransactorSession) DisableModule(prevModule common.Address, module common.Address) (*types.Transaction, error) { + return _SafeL2V130.Contract.DisableModule(&_SafeL2V130.TransactOpts, prevModule, module) +} + +// EnableModule is a paid mutator transaction binding the contract method 0x610b5925. +// +// Solidity: function enableModule(address module) returns() +func (_SafeL2V130 *SafeL2V130Transactor) EnableModule(opts *bind.TransactOpts, module common.Address) (*types.Transaction, error) { + return _SafeL2V130.contract.Transact(opts, "enableModule", module) +} + +// EnableModule is a paid mutator transaction binding the contract method 0x610b5925. +// +// Solidity: function enableModule(address module) returns() +func (_SafeL2V130 *SafeL2V130Session) EnableModule(module common.Address) (*types.Transaction, error) { + return _SafeL2V130.Contract.EnableModule(&_SafeL2V130.TransactOpts, module) +} + +// EnableModule is a paid mutator transaction binding the contract method 0x610b5925. +// +// Solidity: function enableModule(address module) returns() +func (_SafeL2V130 *SafeL2V130TransactorSession) EnableModule(module common.Address) (*types.Transaction, error) { + return _SafeL2V130.Contract.EnableModule(&_SafeL2V130.TransactOpts, module) +} + +// ExecTransaction is a paid mutator transaction binding the contract method 0x6a761202. +// +// Solidity: function execTransaction(address to, uint256 value, bytes data, uint8 operation, uint256 safeTxGas, uint256 baseGas, uint256 gasPrice, address gasToken, address refundReceiver, bytes signatures) payable returns(bool) +func (_SafeL2V130 *SafeL2V130Transactor) ExecTransaction(opts *bind.TransactOpts, to common.Address, value *big.Int, data []byte, operation uint8, safeTxGas *big.Int, baseGas *big.Int, gasPrice *big.Int, gasToken common.Address, refundReceiver common.Address, signatures []byte) (*types.Transaction, error) { + return _SafeL2V130.contract.Transact(opts, "execTransaction", to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, signatures) +} + +// ExecTransaction is a paid mutator transaction binding the contract method 0x6a761202. +// +// Solidity: function execTransaction(address to, uint256 value, bytes data, uint8 operation, uint256 safeTxGas, uint256 baseGas, uint256 gasPrice, address gasToken, address refundReceiver, bytes signatures) payable returns(bool) +func (_SafeL2V130 *SafeL2V130Session) ExecTransaction(to common.Address, value *big.Int, data []byte, operation uint8, safeTxGas *big.Int, baseGas *big.Int, gasPrice *big.Int, gasToken common.Address, refundReceiver common.Address, signatures []byte) (*types.Transaction, error) { + return _SafeL2V130.Contract.ExecTransaction(&_SafeL2V130.TransactOpts, to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, signatures) +} + +// ExecTransaction is a paid mutator transaction binding the contract method 0x6a761202. +// +// Solidity: function execTransaction(address to, uint256 value, bytes data, uint8 operation, uint256 safeTxGas, uint256 baseGas, uint256 gasPrice, address gasToken, address refundReceiver, bytes signatures) payable returns(bool) +func (_SafeL2V130 *SafeL2V130TransactorSession) ExecTransaction(to common.Address, value *big.Int, data []byte, operation uint8, safeTxGas *big.Int, baseGas *big.Int, gasPrice *big.Int, gasToken common.Address, refundReceiver common.Address, signatures []byte) (*types.Transaction, error) { + return _SafeL2V130.Contract.ExecTransaction(&_SafeL2V130.TransactOpts, to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, signatures) +} + +// ExecTransactionFromModule is a paid mutator transaction binding the contract method 0x468721a7. +// +// Solidity: function execTransactionFromModule(address to, uint256 value, bytes data, uint8 operation) returns(bool success) +func (_SafeL2V130 *SafeL2V130Transactor) ExecTransactionFromModule(opts *bind.TransactOpts, to common.Address, value *big.Int, data []byte, operation uint8) (*types.Transaction, error) { + return _SafeL2V130.contract.Transact(opts, "execTransactionFromModule", to, value, data, operation) +} + +// ExecTransactionFromModule is a paid mutator transaction binding the contract method 0x468721a7. +// +// Solidity: function execTransactionFromModule(address to, uint256 value, bytes data, uint8 operation) returns(bool success) +func (_SafeL2V130 *SafeL2V130Session) ExecTransactionFromModule(to common.Address, value *big.Int, data []byte, operation uint8) (*types.Transaction, error) { + return _SafeL2V130.Contract.ExecTransactionFromModule(&_SafeL2V130.TransactOpts, to, value, data, operation) +} + +// ExecTransactionFromModule is a paid mutator transaction binding the contract method 0x468721a7. +// +// Solidity: function execTransactionFromModule(address to, uint256 value, bytes data, uint8 operation) returns(bool success) +func (_SafeL2V130 *SafeL2V130TransactorSession) ExecTransactionFromModule(to common.Address, value *big.Int, data []byte, operation uint8) (*types.Transaction, error) { + return _SafeL2V130.Contract.ExecTransactionFromModule(&_SafeL2V130.TransactOpts, to, value, data, operation) +} + +// ExecTransactionFromModuleReturnData is a paid mutator transaction binding the contract method 0x5229073f. +// +// Solidity: function execTransactionFromModuleReturnData(address to, uint256 value, bytes data, uint8 operation) returns(bool success, bytes returnData) +func (_SafeL2V130 *SafeL2V130Transactor) ExecTransactionFromModuleReturnData(opts *bind.TransactOpts, to common.Address, value *big.Int, data []byte, operation uint8) (*types.Transaction, error) { + return _SafeL2V130.contract.Transact(opts, "execTransactionFromModuleReturnData", to, value, data, operation) +} + +// ExecTransactionFromModuleReturnData is a paid mutator transaction binding the contract method 0x5229073f. +// +// Solidity: function execTransactionFromModuleReturnData(address to, uint256 value, bytes data, uint8 operation) returns(bool success, bytes returnData) +func (_SafeL2V130 *SafeL2V130Session) ExecTransactionFromModuleReturnData(to common.Address, value *big.Int, data []byte, operation uint8) (*types.Transaction, error) { + return _SafeL2V130.Contract.ExecTransactionFromModuleReturnData(&_SafeL2V130.TransactOpts, to, value, data, operation) +} + +// ExecTransactionFromModuleReturnData is a paid mutator transaction binding the contract method 0x5229073f. +// +// Solidity: function execTransactionFromModuleReturnData(address to, uint256 value, bytes data, uint8 operation) returns(bool success, bytes returnData) +func (_SafeL2V130 *SafeL2V130TransactorSession) ExecTransactionFromModuleReturnData(to common.Address, value *big.Int, data []byte, operation uint8) (*types.Transaction, error) { + return _SafeL2V130.Contract.ExecTransactionFromModuleReturnData(&_SafeL2V130.TransactOpts, to, value, data, operation) +} + +// RemoveOwner is a paid mutator transaction binding the contract method 0xf8dc5dd9. +// +// Solidity: function removeOwner(address prevOwner, address owner, uint256 _threshold) returns() +func (_SafeL2V130 *SafeL2V130Transactor) RemoveOwner(opts *bind.TransactOpts, prevOwner common.Address, owner common.Address, _threshold *big.Int) (*types.Transaction, error) { + return _SafeL2V130.contract.Transact(opts, "removeOwner", prevOwner, owner, _threshold) +} + +// RemoveOwner is a paid mutator transaction binding the contract method 0xf8dc5dd9. +// +// Solidity: function removeOwner(address prevOwner, address owner, uint256 _threshold) returns() +func (_SafeL2V130 *SafeL2V130Session) RemoveOwner(prevOwner common.Address, owner common.Address, _threshold *big.Int) (*types.Transaction, error) { + return _SafeL2V130.Contract.RemoveOwner(&_SafeL2V130.TransactOpts, prevOwner, owner, _threshold) +} + +// RemoveOwner is a paid mutator transaction binding the contract method 0xf8dc5dd9. +// +// Solidity: function removeOwner(address prevOwner, address owner, uint256 _threshold) returns() +func (_SafeL2V130 *SafeL2V130TransactorSession) RemoveOwner(prevOwner common.Address, owner common.Address, _threshold *big.Int) (*types.Transaction, error) { + return _SafeL2V130.Contract.RemoveOwner(&_SafeL2V130.TransactOpts, prevOwner, owner, _threshold) +} + +// RequiredTxGas is a paid mutator transaction binding the contract method 0xc4ca3a9c. +// +// Solidity: function requiredTxGas(address to, uint256 value, bytes data, uint8 operation) returns(uint256) +func (_SafeL2V130 *SafeL2V130Transactor) RequiredTxGas(opts *bind.TransactOpts, to common.Address, value *big.Int, data []byte, operation uint8) (*types.Transaction, error) { + return _SafeL2V130.contract.Transact(opts, "requiredTxGas", to, value, data, operation) +} + +// RequiredTxGas is a paid mutator transaction binding the contract method 0xc4ca3a9c. +// +// Solidity: function requiredTxGas(address to, uint256 value, bytes data, uint8 operation) returns(uint256) +func (_SafeL2V130 *SafeL2V130Session) RequiredTxGas(to common.Address, value *big.Int, data []byte, operation uint8) (*types.Transaction, error) { + return _SafeL2V130.Contract.RequiredTxGas(&_SafeL2V130.TransactOpts, to, value, data, operation) +} + +// RequiredTxGas is a paid mutator transaction binding the contract method 0xc4ca3a9c. +// +// Solidity: function requiredTxGas(address to, uint256 value, bytes data, uint8 operation) returns(uint256) +func (_SafeL2V130 *SafeL2V130TransactorSession) RequiredTxGas(to common.Address, value *big.Int, data []byte, operation uint8) (*types.Transaction, error) { + return _SafeL2V130.Contract.RequiredTxGas(&_SafeL2V130.TransactOpts, to, value, data, operation) +} + +// SetFallbackHandler is a paid mutator transaction binding the contract method 0xf08a0323. +// +// Solidity: function setFallbackHandler(address handler) returns() +func (_SafeL2V130 *SafeL2V130Transactor) SetFallbackHandler(opts *bind.TransactOpts, handler common.Address) (*types.Transaction, error) { + return _SafeL2V130.contract.Transact(opts, "setFallbackHandler", handler) +} + +// SetFallbackHandler is a paid mutator transaction binding the contract method 0xf08a0323. +// +// Solidity: function setFallbackHandler(address handler) returns() +func (_SafeL2V130 *SafeL2V130Session) SetFallbackHandler(handler common.Address) (*types.Transaction, error) { + return _SafeL2V130.Contract.SetFallbackHandler(&_SafeL2V130.TransactOpts, handler) +} + +// SetFallbackHandler is a paid mutator transaction binding the contract method 0xf08a0323. +// +// Solidity: function setFallbackHandler(address handler) returns() +func (_SafeL2V130 *SafeL2V130TransactorSession) SetFallbackHandler(handler common.Address) (*types.Transaction, error) { + return _SafeL2V130.Contract.SetFallbackHandler(&_SafeL2V130.TransactOpts, handler) +} + +// SetGuard is a paid mutator transaction binding the contract method 0xe19a9dd9. +// +// Solidity: function setGuard(address guard) returns() +func (_SafeL2V130 *SafeL2V130Transactor) SetGuard(opts *bind.TransactOpts, guard common.Address) (*types.Transaction, error) { + return _SafeL2V130.contract.Transact(opts, "setGuard", guard) +} + +// SetGuard is a paid mutator transaction binding the contract method 0xe19a9dd9. +// +// Solidity: function setGuard(address guard) returns() +func (_SafeL2V130 *SafeL2V130Session) SetGuard(guard common.Address) (*types.Transaction, error) { + return _SafeL2V130.Contract.SetGuard(&_SafeL2V130.TransactOpts, guard) +} + +// SetGuard is a paid mutator transaction binding the contract method 0xe19a9dd9. +// +// Solidity: function setGuard(address guard) returns() +func (_SafeL2V130 *SafeL2V130TransactorSession) SetGuard(guard common.Address) (*types.Transaction, error) { + return _SafeL2V130.Contract.SetGuard(&_SafeL2V130.TransactOpts, guard) +} + +// Setup is a paid mutator transaction binding the contract method 0xb63e800d. +// +// Solidity: function setup(address[] _owners, uint256 _threshold, address to, bytes data, address fallbackHandler, address paymentToken, uint256 payment, address paymentReceiver) returns() +func (_SafeL2V130 *SafeL2V130Transactor) Setup(opts *bind.TransactOpts, _owners []common.Address, _threshold *big.Int, to common.Address, data []byte, fallbackHandler common.Address, paymentToken common.Address, payment *big.Int, paymentReceiver common.Address) (*types.Transaction, error) { + return _SafeL2V130.contract.Transact(opts, "setup", _owners, _threshold, to, data, fallbackHandler, paymentToken, payment, paymentReceiver) +} + +// Setup is a paid mutator transaction binding the contract method 0xb63e800d. +// +// Solidity: function setup(address[] _owners, uint256 _threshold, address to, bytes data, address fallbackHandler, address paymentToken, uint256 payment, address paymentReceiver) returns() +func (_SafeL2V130 *SafeL2V130Session) Setup(_owners []common.Address, _threshold *big.Int, to common.Address, data []byte, fallbackHandler common.Address, paymentToken common.Address, payment *big.Int, paymentReceiver common.Address) (*types.Transaction, error) { + return _SafeL2V130.Contract.Setup(&_SafeL2V130.TransactOpts, _owners, _threshold, to, data, fallbackHandler, paymentToken, payment, paymentReceiver) +} + +// Setup is a paid mutator transaction binding the contract method 0xb63e800d. +// +// Solidity: function setup(address[] _owners, uint256 _threshold, address to, bytes data, address fallbackHandler, address paymentToken, uint256 payment, address paymentReceiver) returns() +func (_SafeL2V130 *SafeL2V130TransactorSession) Setup(_owners []common.Address, _threshold *big.Int, to common.Address, data []byte, fallbackHandler common.Address, paymentToken common.Address, payment *big.Int, paymentReceiver common.Address) (*types.Transaction, error) { + return _SafeL2V130.Contract.Setup(&_SafeL2V130.TransactOpts, _owners, _threshold, to, data, fallbackHandler, paymentToken, payment, paymentReceiver) +} + +// SimulateAndRevert is a paid mutator transaction binding the contract method 0xb4faba09. +// +// Solidity: function simulateAndRevert(address targetContract, bytes calldataPayload) returns() +func (_SafeL2V130 *SafeL2V130Transactor) SimulateAndRevert(opts *bind.TransactOpts, targetContract common.Address, calldataPayload []byte) (*types.Transaction, error) { + return _SafeL2V130.contract.Transact(opts, "simulateAndRevert", targetContract, calldataPayload) +} + +// SimulateAndRevert is a paid mutator transaction binding the contract method 0xb4faba09. +// +// Solidity: function simulateAndRevert(address targetContract, bytes calldataPayload) returns() +func (_SafeL2V130 *SafeL2V130Session) SimulateAndRevert(targetContract common.Address, calldataPayload []byte) (*types.Transaction, error) { + return _SafeL2V130.Contract.SimulateAndRevert(&_SafeL2V130.TransactOpts, targetContract, calldataPayload) +} + +// SimulateAndRevert is a paid mutator transaction binding the contract method 0xb4faba09. +// +// Solidity: function simulateAndRevert(address targetContract, bytes calldataPayload) returns() +func (_SafeL2V130 *SafeL2V130TransactorSession) SimulateAndRevert(targetContract common.Address, calldataPayload []byte) (*types.Transaction, error) { + return _SafeL2V130.Contract.SimulateAndRevert(&_SafeL2V130.TransactOpts, targetContract, calldataPayload) +} + +// SwapOwner is a paid mutator transaction binding the contract method 0xe318b52b. +// +// Solidity: function swapOwner(address prevOwner, address oldOwner, address newOwner) returns() +func (_SafeL2V130 *SafeL2V130Transactor) SwapOwner(opts *bind.TransactOpts, prevOwner common.Address, oldOwner common.Address, newOwner common.Address) (*types.Transaction, error) { + return _SafeL2V130.contract.Transact(opts, "swapOwner", prevOwner, oldOwner, newOwner) +} + +// SwapOwner is a paid mutator transaction binding the contract method 0xe318b52b. +// +// Solidity: function swapOwner(address prevOwner, address oldOwner, address newOwner) returns() +func (_SafeL2V130 *SafeL2V130Session) SwapOwner(prevOwner common.Address, oldOwner common.Address, newOwner common.Address) (*types.Transaction, error) { + return _SafeL2V130.Contract.SwapOwner(&_SafeL2V130.TransactOpts, prevOwner, oldOwner, newOwner) +} + +// SwapOwner is a paid mutator transaction binding the contract method 0xe318b52b. +// +// Solidity: function swapOwner(address prevOwner, address oldOwner, address newOwner) returns() +func (_SafeL2V130 *SafeL2V130TransactorSession) SwapOwner(prevOwner common.Address, oldOwner common.Address, newOwner common.Address) (*types.Transaction, error) { + return _SafeL2V130.Contract.SwapOwner(&_SafeL2V130.TransactOpts, prevOwner, oldOwner, newOwner) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() returns() +func (_SafeL2V130 *SafeL2V130Transactor) Fallback(opts *bind.TransactOpts, calldata []byte) (*types.Transaction, error) { + return _SafeL2V130.contract.RawTransact(opts, calldata) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() returns() +func (_SafeL2V130 *SafeL2V130Session) Fallback(calldata []byte) (*types.Transaction, error) { + return _SafeL2V130.Contract.Fallback(&_SafeL2V130.TransactOpts, calldata) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() returns() +func (_SafeL2V130 *SafeL2V130TransactorSession) Fallback(calldata []byte) (*types.Transaction, error) { + return _SafeL2V130.Contract.Fallback(&_SafeL2V130.TransactOpts, calldata) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_SafeL2V130 *SafeL2V130Transactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SafeL2V130.contract.RawTransact(opts, nil) // calldata is disallowed for receive function +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_SafeL2V130 *SafeL2V130Session) Receive() (*types.Transaction, error) { + return _SafeL2V130.Contract.Receive(&_SafeL2V130.TransactOpts) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_SafeL2V130 *SafeL2V130TransactorSession) Receive() (*types.Transaction, error) { + return _SafeL2V130.Contract.Receive(&_SafeL2V130.TransactOpts) +} + +// SafeL2V130AddedOwnerIterator is returned from FilterAddedOwner and is used to iterate over the raw logs and unpacked data for AddedOwner events raised by the SafeL2V130 contract. +type SafeL2V130AddedOwnerIterator struct { + Event *SafeL2V130AddedOwner // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeL2V130AddedOwnerIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeL2V130AddedOwner) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeL2V130AddedOwner) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeL2V130AddedOwnerIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeL2V130AddedOwnerIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeL2V130AddedOwner represents a AddedOwner event raised by the SafeL2V130 contract. +type SafeL2V130AddedOwner struct { + Owner common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterAddedOwner is a free log retrieval operation binding the contract event 0x9465fa0c962cc76958e6373a993326400c1c94f8be2fe3a952adfa7f60b2ea26. +// +// Solidity: event AddedOwner(address owner) +func (_SafeL2V130 *SafeL2V130Filterer) FilterAddedOwner(opts *bind.FilterOpts) (*SafeL2V130AddedOwnerIterator, error) { + + logs, sub, err := _SafeL2V130.contract.FilterLogs(opts, "AddedOwner") + if err != nil { + return nil, err + } + return &SafeL2V130AddedOwnerIterator{contract: _SafeL2V130.contract, event: "AddedOwner", logs: logs, sub: sub}, nil +} + +// WatchAddedOwner is a free log subscription operation binding the contract event 0x9465fa0c962cc76958e6373a993326400c1c94f8be2fe3a952adfa7f60b2ea26. +// +// Solidity: event AddedOwner(address owner) +func (_SafeL2V130 *SafeL2V130Filterer) WatchAddedOwner(opts *bind.WatchOpts, sink chan<- *SafeL2V130AddedOwner) (event.Subscription, error) { + + logs, sub, err := _SafeL2V130.contract.WatchLogs(opts, "AddedOwner") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeL2V130AddedOwner) + if err := _SafeL2V130.contract.UnpackLog(event, "AddedOwner", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseAddedOwner is a log parse operation binding the contract event 0x9465fa0c962cc76958e6373a993326400c1c94f8be2fe3a952adfa7f60b2ea26. +// +// Solidity: event AddedOwner(address owner) +func (_SafeL2V130 *SafeL2V130Filterer) ParseAddedOwner(log types.Log) (*SafeL2V130AddedOwner, error) { + event := new(SafeL2V130AddedOwner) + if err := _SafeL2V130.contract.UnpackLog(event, "AddedOwner", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SafeL2V130ApproveHashIterator is returned from FilterApproveHash and is used to iterate over the raw logs and unpacked data for ApproveHash events raised by the SafeL2V130 contract. +type SafeL2V130ApproveHashIterator struct { + Event *SafeL2V130ApproveHash // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeL2V130ApproveHashIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeL2V130ApproveHash) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeL2V130ApproveHash) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeL2V130ApproveHashIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeL2V130ApproveHashIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeL2V130ApproveHash represents a ApproveHash event raised by the SafeL2V130 contract. +type SafeL2V130ApproveHash struct { + ApprovedHash [32]byte + Owner common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterApproveHash is a free log retrieval operation binding the contract event 0xf2a0eb156472d1440255b0d7c1e19cc07115d1051fe605b0dce69acfec884d9c. +// +// Solidity: event ApproveHash(bytes32 indexed approvedHash, address indexed owner) +func (_SafeL2V130 *SafeL2V130Filterer) FilterApproveHash(opts *bind.FilterOpts, approvedHash [][32]byte, owner []common.Address) (*SafeL2V130ApproveHashIterator, error) { + + var approvedHashRule []interface{} + for _, approvedHashItem := range approvedHash { + approvedHashRule = append(approvedHashRule, approvedHashItem) + } + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + + logs, sub, err := _SafeL2V130.contract.FilterLogs(opts, "ApproveHash", approvedHashRule, ownerRule) + if err != nil { + return nil, err + } + return &SafeL2V130ApproveHashIterator{contract: _SafeL2V130.contract, event: "ApproveHash", logs: logs, sub: sub}, nil +} + +// WatchApproveHash is a free log subscription operation binding the contract event 0xf2a0eb156472d1440255b0d7c1e19cc07115d1051fe605b0dce69acfec884d9c. +// +// Solidity: event ApproveHash(bytes32 indexed approvedHash, address indexed owner) +func (_SafeL2V130 *SafeL2V130Filterer) WatchApproveHash(opts *bind.WatchOpts, sink chan<- *SafeL2V130ApproveHash, approvedHash [][32]byte, owner []common.Address) (event.Subscription, error) { + + var approvedHashRule []interface{} + for _, approvedHashItem := range approvedHash { + approvedHashRule = append(approvedHashRule, approvedHashItem) + } + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + + logs, sub, err := _SafeL2V130.contract.WatchLogs(opts, "ApproveHash", approvedHashRule, ownerRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeL2V130ApproveHash) + if err := _SafeL2V130.contract.UnpackLog(event, "ApproveHash", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseApproveHash is a log parse operation binding the contract event 0xf2a0eb156472d1440255b0d7c1e19cc07115d1051fe605b0dce69acfec884d9c. +// +// Solidity: event ApproveHash(bytes32 indexed approvedHash, address indexed owner) +func (_SafeL2V130 *SafeL2V130Filterer) ParseApproveHash(log types.Log) (*SafeL2V130ApproveHash, error) { + event := new(SafeL2V130ApproveHash) + if err := _SafeL2V130.contract.UnpackLog(event, "ApproveHash", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SafeL2V130ChangedFallbackHandlerIterator is returned from FilterChangedFallbackHandler and is used to iterate over the raw logs and unpacked data for ChangedFallbackHandler events raised by the SafeL2V130 contract. +type SafeL2V130ChangedFallbackHandlerIterator struct { + Event *SafeL2V130ChangedFallbackHandler // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeL2V130ChangedFallbackHandlerIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeL2V130ChangedFallbackHandler) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeL2V130ChangedFallbackHandler) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeL2V130ChangedFallbackHandlerIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeL2V130ChangedFallbackHandlerIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeL2V130ChangedFallbackHandler represents a ChangedFallbackHandler event raised by the SafeL2V130 contract. +type SafeL2V130ChangedFallbackHandler struct { + Handler common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterChangedFallbackHandler is a free log retrieval operation binding the contract event 0x5ac6c46c93c8d0e53714ba3b53db3e7c046da994313d7ed0d192028bc7c228b0. +// +// Solidity: event ChangedFallbackHandler(address handler) +func (_SafeL2V130 *SafeL2V130Filterer) FilterChangedFallbackHandler(opts *bind.FilterOpts) (*SafeL2V130ChangedFallbackHandlerIterator, error) { + + logs, sub, err := _SafeL2V130.contract.FilterLogs(opts, "ChangedFallbackHandler") + if err != nil { + return nil, err + } + return &SafeL2V130ChangedFallbackHandlerIterator{contract: _SafeL2V130.contract, event: "ChangedFallbackHandler", logs: logs, sub: sub}, nil +} + +// WatchChangedFallbackHandler is a free log subscription operation binding the contract event 0x5ac6c46c93c8d0e53714ba3b53db3e7c046da994313d7ed0d192028bc7c228b0. +// +// Solidity: event ChangedFallbackHandler(address handler) +func (_SafeL2V130 *SafeL2V130Filterer) WatchChangedFallbackHandler(opts *bind.WatchOpts, sink chan<- *SafeL2V130ChangedFallbackHandler) (event.Subscription, error) { + + logs, sub, err := _SafeL2V130.contract.WatchLogs(opts, "ChangedFallbackHandler") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeL2V130ChangedFallbackHandler) + if err := _SafeL2V130.contract.UnpackLog(event, "ChangedFallbackHandler", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseChangedFallbackHandler is a log parse operation binding the contract event 0x5ac6c46c93c8d0e53714ba3b53db3e7c046da994313d7ed0d192028bc7c228b0. +// +// Solidity: event ChangedFallbackHandler(address handler) +func (_SafeL2V130 *SafeL2V130Filterer) ParseChangedFallbackHandler(log types.Log) (*SafeL2V130ChangedFallbackHandler, error) { + event := new(SafeL2V130ChangedFallbackHandler) + if err := _SafeL2V130.contract.UnpackLog(event, "ChangedFallbackHandler", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SafeL2V130ChangedGuardIterator is returned from FilterChangedGuard and is used to iterate over the raw logs and unpacked data for ChangedGuard events raised by the SafeL2V130 contract. +type SafeL2V130ChangedGuardIterator struct { + Event *SafeL2V130ChangedGuard // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeL2V130ChangedGuardIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeL2V130ChangedGuard) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeL2V130ChangedGuard) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeL2V130ChangedGuardIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeL2V130ChangedGuardIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeL2V130ChangedGuard represents a ChangedGuard event raised by the SafeL2V130 contract. +type SafeL2V130ChangedGuard struct { + Guard common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterChangedGuard is a free log retrieval operation binding the contract event 0x1151116914515bc0891ff9047a6cb32cf902546f83066499bcf8ba33d2353fa2. +// +// Solidity: event ChangedGuard(address guard) +func (_SafeL2V130 *SafeL2V130Filterer) FilterChangedGuard(opts *bind.FilterOpts) (*SafeL2V130ChangedGuardIterator, error) { + + logs, sub, err := _SafeL2V130.contract.FilterLogs(opts, "ChangedGuard") + if err != nil { + return nil, err + } + return &SafeL2V130ChangedGuardIterator{contract: _SafeL2V130.contract, event: "ChangedGuard", logs: logs, sub: sub}, nil +} + +// WatchChangedGuard is a free log subscription operation binding the contract event 0x1151116914515bc0891ff9047a6cb32cf902546f83066499bcf8ba33d2353fa2. +// +// Solidity: event ChangedGuard(address guard) +func (_SafeL2V130 *SafeL2V130Filterer) WatchChangedGuard(opts *bind.WatchOpts, sink chan<- *SafeL2V130ChangedGuard) (event.Subscription, error) { + + logs, sub, err := _SafeL2V130.contract.WatchLogs(opts, "ChangedGuard") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeL2V130ChangedGuard) + if err := _SafeL2V130.contract.UnpackLog(event, "ChangedGuard", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseChangedGuard is a log parse operation binding the contract event 0x1151116914515bc0891ff9047a6cb32cf902546f83066499bcf8ba33d2353fa2. +// +// Solidity: event ChangedGuard(address guard) +func (_SafeL2V130 *SafeL2V130Filterer) ParseChangedGuard(log types.Log) (*SafeL2V130ChangedGuard, error) { + event := new(SafeL2V130ChangedGuard) + if err := _SafeL2V130.contract.UnpackLog(event, "ChangedGuard", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SafeL2V130ChangedThresholdIterator is returned from FilterChangedThreshold and is used to iterate over the raw logs and unpacked data for ChangedThreshold events raised by the SafeL2V130 contract. +type SafeL2V130ChangedThresholdIterator struct { + Event *SafeL2V130ChangedThreshold // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeL2V130ChangedThresholdIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeL2V130ChangedThreshold) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeL2V130ChangedThreshold) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeL2V130ChangedThresholdIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeL2V130ChangedThresholdIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeL2V130ChangedThreshold represents a ChangedThreshold event raised by the SafeL2V130 contract. +type SafeL2V130ChangedThreshold struct { + Threshold *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterChangedThreshold is a free log retrieval operation binding the contract event 0x610f7ff2b304ae8903c3de74c60c6ab1f7d6226b3f52c5161905bb5ad4039c93. +// +// Solidity: event ChangedThreshold(uint256 threshold) +func (_SafeL2V130 *SafeL2V130Filterer) FilterChangedThreshold(opts *bind.FilterOpts) (*SafeL2V130ChangedThresholdIterator, error) { + + logs, sub, err := _SafeL2V130.contract.FilterLogs(opts, "ChangedThreshold") + if err != nil { + return nil, err + } + return &SafeL2V130ChangedThresholdIterator{contract: _SafeL2V130.contract, event: "ChangedThreshold", logs: logs, sub: sub}, nil +} + +// WatchChangedThreshold is a free log subscription operation binding the contract event 0x610f7ff2b304ae8903c3de74c60c6ab1f7d6226b3f52c5161905bb5ad4039c93. +// +// Solidity: event ChangedThreshold(uint256 threshold) +func (_SafeL2V130 *SafeL2V130Filterer) WatchChangedThreshold(opts *bind.WatchOpts, sink chan<- *SafeL2V130ChangedThreshold) (event.Subscription, error) { + + logs, sub, err := _SafeL2V130.contract.WatchLogs(opts, "ChangedThreshold") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeL2V130ChangedThreshold) + if err := _SafeL2V130.contract.UnpackLog(event, "ChangedThreshold", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseChangedThreshold is a log parse operation binding the contract event 0x610f7ff2b304ae8903c3de74c60c6ab1f7d6226b3f52c5161905bb5ad4039c93. +// +// Solidity: event ChangedThreshold(uint256 threshold) +func (_SafeL2V130 *SafeL2V130Filterer) ParseChangedThreshold(log types.Log) (*SafeL2V130ChangedThreshold, error) { + event := new(SafeL2V130ChangedThreshold) + if err := _SafeL2V130.contract.UnpackLog(event, "ChangedThreshold", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SafeL2V130DisabledModuleIterator is returned from FilterDisabledModule and is used to iterate over the raw logs and unpacked data for DisabledModule events raised by the SafeL2V130 contract. +type SafeL2V130DisabledModuleIterator struct { + Event *SafeL2V130DisabledModule // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeL2V130DisabledModuleIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeL2V130DisabledModule) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeL2V130DisabledModule) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeL2V130DisabledModuleIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeL2V130DisabledModuleIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeL2V130DisabledModule represents a DisabledModule event raised by the SafeL2V130 contract. +type SafeL2V130DisabledModule struct { + Module common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterDisabledModule is a free log retrieval operation binding the contract event 0xaab4fa2b463f581b2b32cb3b7e3b704b9ce37cc209b5fb4d77e593ace4054276. +// +// Solidity: event DisabledModule(address module) +func (_SafeL2V130 *SafeL2V130Filterer) FilterDisabledModule(opts *bind.FilterOpts) (*SafeL2V130DisabledModuleIterator, error) { + + logs, sub, err := _SafeL2V130.contract.FilterLogs(opts, "DisabledModule") + if err != nil { + return nil, err + } + return &SafeL2V130DisabledModuleIterator{contract: _SafeL2V130.contract, event: "DisabledModule", logs: logs, sub: sub}, nil +} + +// WatchDisabledModule is a free log subscription operation binding the contract event 0xaab4fa2b463f581b2b32cb3b7e3b704b9ce37cc209b5fb4d77e593ace4054276. +// +// Solidity: event DisabledModule(address module) +func (_SafeL2V130 *SafeL2V130Filterer) WatchDisabledModule(opts *bind.WatchOpts, sink chan<- *SafeL2V130DisabledModule) (event.Subscription, error) { + + logs, sub, err := _SafeL2V130.contract.WatchLogs(opts, "DisabledModule") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeL2V130DisabledModule) + if err := _SafeL2V130.contract.UnpackLog(event, "DisabledModule", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseDisabledModule is a log parse operation binding the contract event 0xaab4fa2b463f581b2b32cb3b7e3b704b9ce37cc209b5fb4d77e593ace4054276. +// +// Solidity: event DisabledModule(address module) +func (_SafeL2V130 *SafeL2V130Filterer) ParseDisabledModule(log types.Log) (*SafeL2V130DisabledModule, error) { + event := new(SafeL2V130DisabledModule) + if err := _SafeL2V130.contract.UnpackLog(event, "DisabledModule", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SafeL2V130EnabledModuleIterator is returned from FilterEnabledModule and is used to iterate over the raw logs and unpacked data for EnabledModule events raised by the SafeL2V130 contract. +type SafeL2V130EnabledModuleIterator struct { + Event *SafeL2V130EnabledModule // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeL2V130EnabledModuleIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeL2V130EnabledModule) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeL2V130EnabledModule) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeL2V130EnabledModuleIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeL2V130EnabledModuleIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeL2V130EnabledModule represents a EnabledModule event raised by the SafeL2V130 contract. +type SafeL2V130EnabledModule struct { + Module common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterEnabledModule is a free log retrieval operation binding the contract event 0xecdf3a3effea5783a3c4c2140e677577666428d44ed9d474a0b3a4c9943f8440. +// +// Solidity: event EnabledModule(address module) +func (_SafeL2V130 *SafeL2V130Filterer) FilterEnabledModule(opts *bind.FilterOpts) (*SafeL2V130EnabledModuleIterator, error) { + + logs, sub, err := _SafeL2V130.contract.FilterLogs(opts, "EnabledModule") + if err != nil { + return nil, err + } + return &SafeL2V130EnabledModuleIterator{contract: _SafeL2V130.contract, event: "EnabledModule", logs: logs, sub: sub}, nil +} + +// WatchEnabledModule is a free log subscription operation binding the contract event 0xecdf3a3effea5783a3c4c2140e677577666428d44ed9d474a0b3a4c9943f8440. +// +// Solidity: event EnabledModule(address module) +func (_SafeL2V130 *SafeL2V130Filterer) WatchEnabledModule(opts *bind.WatchOpts, sink chan<- *SafeL2V130EnabledModule) (event.Subscription, error) { + + logs, sub, err := _SafeL2V130.contract.WatchLogs(opts, "EnabledModule") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeL2V130EnabledModule) + if err := _SafeL2V130.contract.UnpackLog(event, "EnabledModule", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseEnabledModule is a log parse operation binding the contract event 0xecdf3a3effea5783a3c4c2140e677577666428d44ed9d474a0b3a4c9943f8440. +// +// Solidity: event EnabledModule(address module) +func (_SafeL2V130 *SafeL2V130Filterer) ParseEnabledModule(log types.Log) (*SafeL2V130EnabledModule, error) { + event := new(SafeL2V130EnabledModule) + if err := _SafeL2V130.contract.UnpackLog(event, "EnabledModule", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SafeL2V130ExecutionFailureIterator is returned from FilterExecutionFailure and is used to iterate over the raw logs and unpacked data for ExecutionFailure events raised by the SafeL2V130 contract. +type SafeL2V130ExecutionFailureIterator struct { + Event *SafeL2V130ExecutionFailure // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeL2V130ExecutionFailureIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeL2V130ExecutionFailure) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeL2V130ExecutionFailure) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeL2V130ExecutionFailureIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeL2V130ExecutionFailureIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeL2V130ExecutionFailure represents a ExecutionFailure event raised by the SafeL2V130 contract. +type SafeL2V130ExecutionFailure struct { + TxHash [32]byte + Payment *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterExecutionFailure is a free log retrieval operation binding the contract event 0x23428b18acfb3ea64b08dc0c1d296ea9c09702c09083ca5272e64d115b687d23. +// +// Solidity: event ExecutionFailure(bytes32 txHash, uint256 payment) +func (_SafeL2V130 *SafeL2V130Filterer) FilterExecutionFailure(opts *bind.FilterOpts) (*SafeL2V130ExecutionFailureIterator, error) { + + logs, sub, err := _SafeL2V130.contract.FilterLogs(opts, "ExecutionFailure") + if err != nil { + return nil, err + } + return &SafeL2V130ExecutionFailureIterator{contract: _SafeL2V130.contract, event: "ExecutionFailure", logs: logs, sub: sub}, nil +} + +// WatchExecutionFailure is a free log subscription operation binding the contract event 0x23428b18acfb3ea64b08dc0c1d296ea9c09702c09083ca5272e64d115b687d23. +// +// Solidity: event ExecutionFailure(bytes32 txHash, uint256 payment) +func (_SafeL2V130 *SafeL2V130Filterer) WatchExecutionFailure(opts *bind.WatchOpts, sink chan<- *SafeL2V130ExecutionFailure) (event.Subscription, error) { + + logs, sub, err := _SafeL2V130.contract.WatchLogs(opts, "ExecutionFailure") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeL2V130ExecutionFailure) + if err := _SafeL2V130.contract.UnpackLog(event, "ExecutionFailure", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseExecutionFailure is a log parse operation binding the contract event 0x23428b18acfb3ea64b08dc0c1d296ea9c09702c09083ca5272e64d115b687d23. +// +// Solidity: event ExecutionFailure(bytes32 txHash, uint256 payment) +func (_SafeL2V130 *SafeL2V130Filterer) ParseExecutionFailure(log types.Log) (*SafeL2V130ExecutionFailure, error) { + event := new(SafeL2V130ExecutionFailure) + if err := _SafeL2V130.contract.UnpackLog(event, "ExecutionFailure", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SafeL2V130ExecutionFromModuleFailureIterator is returned from FilterExecutionFromModuleFailure and is used to iterate over the raw logs and unpacked data for ExecutionFromModuleFailure events raised by the SafeL2V130 contract. +type SafeL2V130ExecutionFromModuleFailureIterator struct { + Event *SafeL2V130ExecutionFromModuleFailure // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeL2V130ExecutionFromModuleFailureIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeL2V130ExecutionFromModuleFailure) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeL2V130ExecutionFromModuleFailure) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeL2V130ExecutionFromModuleFailureIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeL2V130ExecutionFromModuleFailureIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeL2V130ExecutionFromModuleFailure represents a ExecutionFromModuleFailure event raised by the SafeL2V130 contract. +type SafeL2V130ExecutionFromModuleFailure struct { + Module common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterExecutionFromModuleFailure is a free log retrieval operation binding the contract event 0xacd2c8702804128fdb0db2bb49f6d127dd0181c13fd45dbfe16de0930e2bd375. +// +// Solidity: event ExecutionFromModuleFailure(address indexed module) +func (_SafeL2V130 *SafeL2V130Filterer) FilterExecutionFromModuleFailure(opts *bind.FilterOpts, module []common.Address) (*SafeL2V130ExecutionFromModuleFailureIterator, error) { + + var moduleRule []interface{} + for _, moduleItem := range module { + moduleRule = append(moduleRule, moduleItem) + } + + logs, sub, err := _SafeL2V130.contract.FilterLogs(opts, "ExecutionFromModuleFailure", moduleRule) + if err != nil { + return nil, err + } + return &SafeL2V130ExecutionFromModuleFailureIterator{contract: _SafeL2V130.contract, event: "ExecutionFromModuleFailure", logs: logs, sub: sub}, nil +} + +// WatchExecutionFromModuleFailure is a free log subscription operation binding the contract event 0xacd2c8702804128fdb0db2bb49f6d127dd0181c13fd45dbfe16de0930e2bd375. +// +// Solidity: event ExecutionFromModuleFailure(address indexed module) +func (_SafeL2V130 *SafeL2V130Filterer) WatchExecutionFromModuleFailure(opts *bind.WatchOpts, sink chan<- *SafeL2V130ExecutionFromModuleFailure, module []common.Address) (event.Subscription, error) { + + var moduleRule []interface{} + for _, moduleItem := range module { + moduleRule = append(moduleRule, moduleItem) + } + + logs, sub, err := _SafeL2V130.contract.WatchLogs(opts, "ExecutionFromModuleFailure", moduleRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeL2V130ExecutionFromModuleFailure) + if err := _SafeL2V130.contract.UnpackLog(event, "ExecutionFromModuleFailure", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseExecutionFromModuleFailure is a log parse operation binding the contract event 0xacd2c8702804128fdb0db2bb49f6d127dd0181c13fd45dbfe16de0930e2bd375. +// +// Solidity: event ExecutionFromModuleFailure(address indexed module) +func (_SafeL2V130 *SafeL2V130Filterer) ParseExecutionFromModuleFailure(log types.Log) (*SafeL2V130ExecutionFromModuleFailure, error) { + event := new(SafeL2V130ExecutionFromModuleFailure) + if err := _SafeL2V130.contract.UnpackLog(event, "ExecutionFromModuleFailure", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SafeL2V130ExecutionFromModuleSuccessIterator is returned from FilterExecutionFromModuleSuccess and is used to iterate over the raw logs and unpacked data for ExecutionFromModuleSuccess events raised by the SafeL2V130 contract. +type SafeL2V130ExecutionFromModuleSuccessIterator struct { + Event *SafeL2V130ExecutionFromModuleSuccess // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeL2V130ExecutionFromModuleSuccessIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeL2V130ExecutionFromModuleSuccess) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeL2V130ExecutionFromModuleSuccess) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeL2V130ExecutionFromModuleSuccessIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeL2V130ExecutionFromModuleSuccessIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeL2V130ExecutionFromModuleSuccess represents a ExecutionFromModuleSuccess event raised by the SafeL2V130 contract. +type SafeL2V130ExecutionFromModuleSuccess struct { + Module common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterExecutionFromModuleSuccess is a free log retrieval operation binding the contract event 0x6895c13664aa4f67288b25d7a21d7aaa34916e355fb9b6fae0a139a9085becb8. +// +// Solidity: event ExecutionFromModuleSuccess(address indexed module) +func (_SafeL2V130 *SafeL2V130Filterer) FilterExecutionFromModuleSuccess(opts *bind.FilterOpts, module []common.Address) (*SafeL2V130ExecutionFromModuleSuccessIterator, error) { + + var moduleRule []interface{} + for _, moduleItem := range module { + moduleRule = append(moduleRule, moduleItem) + } + + logs, sub, err := _SafeL2V130.contract.FilterLogs(opts, "ExecutionFromModuleSuccess", moduleRule) + if err != nil { + return nil, err + } + return &SafeL2V130ExecutionFromModuleSuccessIterator{contract: _SafeL2V130.contract, event: "ExecutionFromModuleSuccess", logs: logs, sub: sub}, nil +} + +// WatchExecutionFromModuleSuccess is a free log subscription operation binding the contract event 0x6895c13664aa4f67288b25d7a21d7aaa34916e355fb9b6fae0a139a9085becb8. +// +// Solidity: event ExecutionFromModuleSuccess(address indexed module) +func (_SafeL2V130 *SafeL2V130Filterer) WatchExecutionFromModuleSuccess(opts *bind.WatchOpts, sink chan<- *SafeL2V130ExecutionFromModuleSuccess, module []common.Address) (event.Subscription, error) { + + var moduleRule []interface{} + for _, moduleItem := range module { + moduleRule = append(moduleRule, moduleItem) + } + + logs, sub, err := _SafeL2V130.contract.WatchLogs(opts, "ExecutionFromModuleSuccess", moduleRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeL2V130ExecutionFromModuleSuccess) + if err := _SafeL2V130.contract.UnpackLog(event, "ExecutionFromModuleSuccess", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseExecutionFromModuleSuccess is a log parse operation binding the contract event 0x6895c13664aa4f67288b25d7a21d7aaa34916e355fb9b6fae0a139a9085becb8. +// +// Solidity: event ExecutionFromModuleSuccess(address indexed module) +func (_SafeL2V130 *SafeL2V130Filterer) ParseExecutionFromModuleSuccess(log types.Log) (*SafeL2V130ExecutionFromModuleSuccess, error) { + event := new(SafeL2V130ExecutionFromModuleSuccess) + if err := _SafeL2V130.contract.UnpackLog(event, "ExecutionFromModuleSuccess", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SafeL2V130ExecutionSuccessIterator is returned from FilterExecutionSuccess and is used to iterate over the raw logs and unpacked data for ExecutionSuccess events raised by the SafeL2V130 contract. +type SafeL2V130ExecutionSuccessIterator struct { + Event *SafeL2V130ExecutionSuccess // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeL2V130ExecutionSuccessIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeL2V130ExecutionSuccess) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeL2V130ExecutionSuccess) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeL2V130ExecutionSuccessIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeL2V130ExecutionSuccessIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeL2V130ExecutionSuccess represents a ExecutionSuccess event raised by the SafeL2V130 contract. +type SafeL2V130ExecutionSuccess struct { + TxHash [32]byte + Payment *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterExecutionSuccess is a free log retrieval operation binding the contract event 0x442e715f626346e8c54381002da614f62bee8d27386535b2521ec8540898556e. +// +// Solidity: event ExecutionSuccess(bytes32 txHash, uint256 payment) +func (_SafeL2V130 *SafeL2V130Filterer) FilterExecutionSuccess(opts *bind.FilterOpts) (*SafeL2V130ExecutionSuccessIterator, error) { + + logs, sub, err := _SafeL2V130.contract.FilterLogs(opts, "ExecutionSuccess") + if err != nil { + return nil, err + } + return &SafeL2V130ExecutionSuccessIterator{contract: _SafeL2V130.contract, event: "ExecutionSuccess", logs: logs, sub: sub}, nil +} + +// WatchExecutionSuccess is a free log subscription operation binding the contract event 0x442e715f626346e8c54381002da614f62bee8d27386535b2521ec8540898556e. +// +// Solidity: event ExecutionSuccess(bytes32 txHash, uint256 payment) +func (_SafeL2V130 *SafeL2V130Filterer) WatchExecutionSuccess(opts *bind.WatchOpts, sink chan<- *SafeL2V130ExecutionSuccess) (event.Subscription, error) { + + logs, sub, err := _SafeL2V130.contract.WatchLogs(opts, "ExecutionSuccess") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeL2V130ExecutionSuccess) + if err := _SafeL2V130.contract.UnpackLog(event, "ExecutionSuccess", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseExecutionSuccess is a log parse operation binding the contract event 0x442e715f626346e8c54381002da614f62bee8d27386535b2521ec8540898556e. +// +// Solidity: event ExecutionSuccess(bytes32 txHash, uint256 payment) +func (_SafeL2V130 *SafeL2V130Filterer) ParseExecutionSuccess(log types.Log) (*SafeL2V130ExecutionSuccess, error) { + event := new(SafeL2V130ExecutionSuccess) + if err := _SafeL2V130.contract.UnpackLog(event, "ExecutionSuccess", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SafeL2V130RemovedOwnerIterator is returned from FilterRemovedOwner and is used to iterate over the raw logs and unpacked data for RemovedOwner events raised by the SafeL2V130 contract. +type SafeL2V130RemovedOwnerIterator struct { + Event *SafeL2V130RemovedOwner // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeL2V130RemovedOwnerIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeL2V130RemovedOwner) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeL2V130RemovedOwner) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeL2V130RemovedOwnerIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeL2V130RemovedOwnerIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeL2V130RemovedOwner represents a RemovedOwner event raised by the SafeL2V130 contract. +type SafeL2V130RemovedOwner struct { + Owner common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterRemovedOwner is a free log retrieval operation binding the contract event 0xf8d49fc529812e9a7c5c50e69c20f0dccc0db8fa95c98bc58cc9a4f1c1299eaf. +// +// Solidity: event RemovedOwner(address owner) +func (_SafeL2V130 *SafeL2V130Filterer) FilterRemovedOwner(opts *bind.FilterOpts) (*SafeL2V130RemovedOwnerIterator, error) { + + logs, sub, err := _SafeL2V130.contract.FilterLogs(opts, "RemovedOwner") + if err != nil { + return nil, err + } + return &SafeL2V130RemovedOwnerIterator{contract: _SafeL2V130.contract, event: "RemovedOwner", logs: logs, sub: sub}, nil +} + +// WatchRemovedOwner is a free log subscription operation binding the contract event 0xf8d49fc529812e9a7c5c50e69c20f0dccc0db8fa95c98bc58cc9a4f1c1299eaf. +// +// Solidity: event RemovedOwner(address owner) +func (_SafeL2V130 *SafeL2V130Filterer) WatchRemovedOwner(opts *bind.WatchOpts, sink chan<- *SafeL2V130RemovedOwner) (event.Subscription, error) { + + logs, sub, err := _SafeL2V130.contract.WatchLogs(opts, "RemovedOwner") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeL2V130RemovedOwner) + if err := _SafeL2V130.contract.UnpackLog(event, "RemovedOwner", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseRemovedOwner is a log parse operation binding the contract event 0xf8d49fc529812e9a7c5c50e69c20f0dccc0db8fa95c98bc58cc9a4f1c1299eaf. +// +// Solidity: event RemovedOwner(address owner) +func (_SafeL2V130 *SafeL2V130Filterer) ParseRemovedOwner(log types.Log) (*SafeL2V130RemovedOwner, error) { + event := new(SafeL2V130RemovedOwner) + if err := _SafeL2V130.contract.UnpackLog(event, "RemovedOwner", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SafeL2V130SafeModuleTransactionIterator is returned from FilterSafeModuleTransaction and is used to iterate over the raw logs and unpacked data for SafeModuleTransaction events raised by the SafeL2V130 contract. +type SafeL2V130SafeModuleTransactionIterator struct { + Event *SafeL2V130SafeModuleTransaction // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeL2V130SafeModuleTransactionIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeL2V130SafeModuleTransaction) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeL2V130SafeModuleTransaction) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeL2V130SafeModuleTransactionIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeL2V130SafeModuleTransactionIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeL2V130SafeModuleTransaction represents a SafeModuleTransaction event raised by the SafeL2V130 contract. +type SafeL2V130SafeModuleTransaction struct { + Module common.Address + To common.Address + Value *big.Int + Data []byte + Operation uint8 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSafeModuleTransaction is a free log retrieval operation binding the contract event 0xb648d3644f584ed1c2232d53c46d87e693586486ad0d1175f8656013110b714e. +// +// Solidity: event SafeModuleTransaction(address module, address to, uint256 value, bytes data, uint8 operation) +func (_SafeL2V130 *SafeL2V130Filterer) FilterSafeModuleTransaction(opts *bind.FilterOpts) (*SafeL2V130SafeModuleTransactionIterator, error) { + + logs, sub, err := _SafeL2V130.contract.FilterLogs(opts, "SafeModuleTransaction") + if err != nil { + return nil, err + } + return &SafeL2V130SafeModuleTransactionIterator{contract: _SafeL2V130.contract, event: "SafeModuleTransaction", logs: logs, sub: sub}, nil +} + +// WatchSafeModuleTransaction is a free log subscription operation binding the contract event 0xb648d3644f584ed1c2232d53c46d87e693586486ad0d1175f8656013110b714e. +// +// Solidity: event SafeModuleTransaction(address module, address to, uint256 value, bytes data, uint8 operation) +func (_SafeL2V130 *SafeL2V130Filterer) WatchSafeModuleTransaction(opts *bind.WatchOpts, sink chan<- *SafeL2V130SafeModuleTransaction) (event.Subscription, error) { + + logs, sub, err := _SafeL2V130.contract.WatchLogs(opts, "SafeModuleTransaction") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeL2V130SafeModuleTransaction) + if err := _SafeL2V130.contract.UnpackLog(event, "SafeModuleTransaction", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseSafeModuleTransaction is a log parse operation binding the contract event 0xb648d3644f584ed1c2232d53c46d87e693586486ad0d1175f8656013110b714e. +// +// Solidity: event SafeModuleTransaction(address module, address to, uint256 value, bytes data, uint8 operation) +func (_SafeL2V130 *SafeL2V130Filterer) ParseSafeModuleTransaction(log types.Log) (*SafeL2V130SafeModuleTransaction, error) { + event := new(SafeL2V130SafeModuleTransaction) + if err := _SafeL2V130.contract.UnpackLog(event, "SafeModuleTransaction", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SafeL2V130SafeMultiSigTransactionIterator is returned from FilterSafeMultiSigTransaction and is used to iterate over the raw logs and unpacked data for SafeMultiSigTransaction events raised by the SafeL2V130 contract. +type SafeL2V130SafeMultiSigTransactionIterator struct { + Event *SafeL2V130SafeMultiSigTransaction // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeL2V130SafeMultiSigTransactionIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeL2V130SafeMultiSigTransaction) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeL2V130SafeMultiSigTransaction) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeL2V130SafeMultiSigTransactionIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeL2V130SafeMultiSigTransactionIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeL2V130SafeMultiSigTransaction represents a SafeMultiSigTransaction event raised by the SafeL2V130 contract. +type SafeL2V130SafeMultiSigTransaction struct { + To common.Address + Value *big.Int + Data []byte + Operation uint8 + SafeTxGas *big.Int + BaseGas *big.Int + GasPrice *big.Int + GasToken common.Address + RefundReceiver common.Address + Signatures []byte + AdditionalInfo []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSafeMultiSigTransaction is a free log retrieval operation binding the contract event 0x66753cd2356569ee081232e3be8909b950e0a76c1f8460c3a5e3c2be32b11bed. +// +// Solidity: event SafeMultiSigTransaction(address to, uint256 value, bytes data, uint8 operation, uint256 safeTxGas, uint256 baseGas, uint256 gasPrice, address gasToken, address refundReceiver, bytes signatures, bytes additionalInfo) +func (_SafeL2V130 *SafeL2V130Filterer) FilterSafeMultiSigTransaction(opts *bind.FilterOpts) (*SafeL2V130SafeMultiSigTransactionIterator, error) { + + logs, sub, err := _SafeL2V130.contract.FilterLogs(opts, "SafeMultiSigTransaction") + if err != nil { + return nil, err + } + return &SafeL2V130SafeMultiSigTransactionIterator{contract: _SafeL2V130.contract, event: "SafeMultiSigTransaction", logs: logs, sub: sub}, nil +} + +// WatchSafeMultiSigTransaction is a free log subscription operation binding the contract event 0x66753cd2356569ee081232e3be8909b950e0a76c1f8460c3a5e3c2be32b11bed. +// +// Solidity: event SafeMultiSigTransaction(address to, uint256 value, bytes data, uint8 operation, uint256 safeTxGas, uint256 baseGas, uint256 gasPrice, address gasToken, address refundReceiver, bytes signatures, bytes additionalInfo) +func (_SafeL2V130 *SafeL2V130Filterer) WatchSafeMultiSigTransaction(opts *bind.WatchOpts, sink chan<- *SafeL2V130SafeMultiSigTransaction) (event.Subscription, error) { + + logs, sub, err := _SafeL2V130.contract.WatchLogs(opts, "SafeMultiSigTransaction") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeL2V130SafeMultiSigTransaction) + if err := _SafeL2V130.contract.UnpackLog(event, "SafeMultiSigTransaction", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseSafeMultiSigTransaction is a log parse operation binding the contract event 0x66753cd2356569ee081232e3be8909b950e0a76c1f8460c3a5e3c2be32b11bed. +// +// Solidity: event SafeMultiSigTransaction(address to, uint256 value, bytes data, uint8 operation, uint256 safeTxGas, uint256 baseGas, uint256 gasPrice, address gasToken, address refundReceiver, bytes signatures, bytes additionalInfo) +func (_SafeL2V130 *SafeL2V130Filterer) ParseSafeMultiSigTransaction(log types.Log) (*SafeL2V130SafeMultiSigTransaction, error) { + event := new(SafeL2V130SafeMultiSigTransaction) + if err := _SafeL2V130.contract.UnpackLog(event, "SafeMultiSigTransaction", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SafeL2V130SafeReceivedIterator is returned from FilterSafeReceived and is used to iterate over the raw logs and unpacked data for SafeReceived events raised by the SafeL2V130 contract. +type SafeL2V130SafeReceivedIterator struct { + Event *SafeL2V130SafeReceived // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeL2V130SafeReceivedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeL2V130SafeReceived) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeL2V130SafeReceived) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeL2V130SafeReceivedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeL2V130SafeReceivedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeL2V130SafeReceived represents a SafeReceived event raised by the SafeL2V130 contract. +type SafeL2V130SafeReceived struct { + Sender common.Address + Value *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSafeReceived is a free log retrieval operation binding the contract event 0x3d0ce9bfc3ed7d6862dbb28b2dea94561fe714a1b4d019aa8af39730d1ad7c3d. +// +// Solidity: event SafeReceived(address indexed sender, uint256 value) +func (_SafeL2V130 *SafeL2V130Filterer) FilterSafeReceived(opts *bind.FilterOpts, sender []common.Address) (*SafeL2V130SafeReceivedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _SafeL2V130.contract.FilterLogs(opts, "SafeReceived", senderRule) + if err != nil { + return nil, err + } + return &SafeL2V130SafeReceivedIterator{contract: _SafeL2V130.contract, event: "SafeReceived", logs: logs, sub: sub}, nil +} + +// WatchSafeReceived is a free log subscription operation binding the contract event 0x3d0ce9bfc3ed7d6862dbb28b2dea94561fe714a1b4d019aa8af39730d1ad7c3d. +// +// Solidity: event SafeReceived(address indexed sender, uint256 value) +func (_SafeL2V130 *SafeL2V130Filterer) WatchSafeReceived(opts *bind.WatchOpts, sink chan<- *SafeL2V130SafeReceived, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _SafeL2V130.contract.WatchLogs(opts, "SafeReceived", senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeL2V130SafeReceived) + if err := _SafeL2V130.contract.UnpackLog(event, "SafeReceived", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseSafeReceived is a log parse operation binding the contract event 0x3d0ce9bfc3ed7d6862dbb28b2dea94561fe714a1b4d019aa8af39730d1ad7c3d. +// +// Solidity: event SafeReceived(address indexed sender, uint256 value) +func (_SafeL2V130 *SafeL2V130Filterer) ParseSafeReceived(log types.Log) (*SafeL2V130SafeReceived, error) { + event := new(SafeL2V130SafeReceived) + if err := _SafeL2V130.contract.UnpackLog(event, "SafeReceived", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SafeL2V130SafeSetupIterator is returned from FilterSafeSetup and is used to iterate over the raw logs and unpacked data for SafeSetup events raised by the SafeL2V130 contract. +type SafeL2V130SafeSetupIterator struct { + Event *SafeL2V130SafeSetup // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeL2V130SafeSetupIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeL2V130SafeSetup) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeL2V130SafeSetup) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeL2V130SafeSetupIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeL2V130SafeSetupIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeL2V130SafeSetup represents a SafeSetup event raised by the SafeL2V130 contract. +type SafeL2V130SafeSetup struct { + Initiator common.Address + Owners []common.Address + Threshold *big.Int + Initializer common.Address + FallbackHandler common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSafeSetup is a free log retrieval operation binding the contract event 0x141df868a6331af528e38c83b7aa03edc19be66e37ae67f9285bf4f8e3c6a1a8. +// +// Solidity: event SafeSetup(address indexed initiator, address[] owners, uint256 threshold, address initializer, address fallbackHandler) +func (_SafeL2V130 *SafeL2V130Filterer) FilterSafeSetup(opts *bind.FilterOpts, initiator []common.Address) (*SafeL2V130SafeSetupIterator, error) { + + var initiatorRule []interface{} + for _, initiatorItem := range initiator { + initiatorRule = append(initiatorRule, initiatorItem) + } + + logs, sub, err := _SafeL2V130.contract.FilterLogs(opts, "SafeSetup", initiatorRule) + if err != nil { + return nil, err + } + return &SafeL2V130SafeSetupIterator{contract: _SafeL2V130.contract, event: "SafeSetup", logs: logs, sub: sub}, nil +} + +// WatchSafeSetup is a free log subscription operation binding the contract event 0x141df868a6331af528e38c83b7aa03edc19be66e37ae67f9285bf4f8e3c6a1a8. +// +// Solidity: event SafeSetup(address indexed initiator, address[] owners, uint256 threshold, address initializer, address fallbackHandler) +func (_SafeL2V130 *SafeL2V130Filterer) WatchSafeSetup(opts *bind.WatchOpts, sink chan<- *SafeL2V130SafeSetup, initiator []common.Address) (event.Subscription, error) { + + var initiatorRule []interface{} + for _, initiatorItem := range initiator { + initiatorRule = append(initiatorRule, initiatorItem) + } + + logs, sub, err := _SafeL2V130.contract.WatchLogs(opts, "SafeSetup", initiatorRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeL2V130SafeSetup) + if err := _SafeL2V130.contract.UnpackLog(event, "SafeSetup", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseSafeSetup is a log parse operation binding the contract event 0x141df868a6331af528e38c83b7aa03edc19be66e37ae67f9285bf4f8e3c6a1a8. +// +// Solidity: event SafeSetup(address indexed initiator, address[] owners, uint256 threshold, address initializer, address fallbackHandler) +func (_SafeL2V130 *SafeL2V130Filterer) ParseSafeSetup(log types.Log) (*SafeL2V130SafeSetup, error) { + event := new(SafeL2V130SafeSetup) + if err := _SafeL2V130.contract.UnpackLog(event, "SafeSetup", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SafeL2V130SignMsgIterator is returned from FilterSignMsg and is used to iterate over the raw logs and unpacked data for SignMsg events raised by the SafeL2V130 contract. +type SafeL2V130SignMsgIterator struct { + Event *SafeL2V130SignMsg // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeL2V130SignMsgIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeL2V130SignMsg) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeL2V130SignMsg) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeL2V130SignMsgIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeL2V130SignMsgIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeL2V130SignMsg represents a SignMsg event raised by the SafeL2V130 contract. +type SafeL2V130SignMsg struct { + MsgHash [32]byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSignMsg is a free log retrieval operation binding the contract event 0xe7f4675038f4f6034dfcbbb24c4dc08e4ebf10eb9d257d3d02c0f38d122ac6e4. +// +// Solidity: event SignMsg(bytes32 indexed msgHash) +func (_SafeL2V130 *SafeL2V130Filterer) FilterSignMsg(opts *bind.FilterOpts, msgHash [][32]byte) (*SafeL2V130SignMsgIterator, error) { + + var msgHashRule []interface{} + for _, msgHashItem := range msgHash { + msgHashRule = append(msgHashRule, msgHashItem) + } + + logs, sub, err := _SafeL2V130.contract.FilterLogs(opts, "SignMsg", msgHashRule) + if err != nil { + return nil, err + } + return &SafeL2V130SignMsgIterator{contract: _SafeL2V130.contract, event: "SignMsg", logs: logs, sub: sub}, nil +} + +// WatchSignMsg is a free log subscription operation binding the contract event 0xe7f4675038f4f6034dfcbbb24c4dc08e4ebf10eb9d257d3d02c0f38d122ac6e4. +// +// Solidity: event SignMsg(bytes32 indexed msgHash) +func (_SafeL2V130 *SafeL2V130Filterer) WatchSignMsg(opts *bind.WatchOpts, sink chan<- *SafeL2V130SignMsg, msgHash [][32]byte) (event.Subscription, error) { + + var msgHashRule []interface{} + for _, msgHashItem := range msgHash { + msgHashRule = append(msgHashRule, msgHashItem) + } + + logs, sub, err := _SafeL2V130.contract.WatchLogs(opts, "SignMsg", msgHashRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeL2V130SignMsg) + if err := _SafeL2V130.contract.UnpackLog(event, "SignMsg", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseSignMsg is a log parse operation binding the contract event 0xe7f4675038f4f6034dfcbbb24c4dc08e4ebf10eb9d257d3d02c0f38d122ac6e4. +// +// Solidity: event SignMsg(bytes32 indexed msgHash) +func (_SafeL2V130 *SafeL2V130Filterer) ParseSignMsg(log types.Log) (*SafeL2V130SignMsg, error) { + event := new(SafeL2V130SignMsg) + if err := _SafeL2V130.contract.UnpackLog(event, "SignMsg", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/op-e2e2/bindings/safeproxyfactory.go b/op-e2e2/bindings/safeproxyfactory.go new file mode 100644 index 000000000000..e9ce776ade14 --- /dev/null +++ b/op-e2e2/bindings/safeproxyfactory.go @@ -0,0 +1,472 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// SafeProxyFactoryMetaData contains all meta data concerning the SafeProxyFactory contract. +var SafeProxyFactoryMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"function\",\"name\":\"createChainSpecificProxyWithNonce\",\"inputs\":[{\"name\":\"_singleton\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"initializer\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"saltNonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"proxy\",\"type\":\"address\",\"internalType\":\"contractSafeProxy\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"createProxyWithCallback\",\"inputs\":[{\"name\":\"_singleton\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"initializer\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"saltNonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"callback\",\"type\":\"address\",\"internalType\":\"contractIProxyCreationCallback\"}],\"outputs\":[{\"name\":\"proxy\",\"type\":\"address\",\"internalType\":\"contractSafeProxy\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"createProxyWithNonce\",\"inputs\":[{\"name\":\"_singleton\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"initializer\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"saltNonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"proxy\",\"type\":\"address\",\"internalType\":\"contractSafeProxy\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"getChainId\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"proxyCreationCode\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"pure\"},{\"type\":\"event\",\"name\":\"ProxyCreation\",\"inputs\":[{\"name\":\"proxy\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"contractSafeProxy\"},{\"name\":\"singleton\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false}]", + Bin: "0x608060405234801561001057600080fd5b50610913806100206000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c806353e5d9351161005057806353e5d935146100b7578063d18af54d146100cc578063ec9e80bb146100df57600080fd5b80631688f0b91461006c5780633408e470146100a9575b600080fd5b61007f61007a3660046105d2565b6100f2565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6040514681526020016100a0565b6100bf610194565b6040516100a091906106a5565b61007f6100da3660046106bf565b6101dc565b61007f6100ed3660046105d2565b6102f8565b600080838051906020012083604051602001610118929190918252602082015260400190565b60405160208183030381529060405280519060200120905061013b85858361032a565b60405173ffffffffffffffffffffffffffffffffffffffff8781168252919350908316907f4f51faf6c4561ff95f067657e43439f0f856d97c04d9ec9070a6199ad418e2359060200160405180910390a2509392505050565b6060604051806020016101a6906104c6565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe082820381018352601f90910116604052919050565b600080838360405160200161022092919091825260601b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016602082015260340190565b6040516020818303038152906040528051906020012060001c90506102468686836100f2565b915073ffffffffffffffffffffffffffffffffffffffff8316156102ef576040517f1e52b51800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff841690631e52b518906102bc9085908a908a908a9060040161072b565b600060405180830381600087803b1580156102d657600080fd5b505af11580156102ea573d6000803e3d6000fd5b505050505b50949350505050565b60008083805190602001208361030b4690565b6040805160208101949094528301919091526060820152608001610118565b6000833b610399576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f53696e676c65746f6e20636f6e7472616374206e6f74206465706c6f7965640060448201526064015b60405180910390fd5b6000604051806020016103ab906104c6565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe082820381018352601f909101166040819052610403919073ffffffffffffffffffffffffffffffffffffffff881690602001610775565b6040516020818303038152906040529050828151826020016000f5915073ffffffffffffffffffffffffffffffffffffffff821661049d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f437265617465322063616c6c206661696c6564000000000000000000000000006044820152606401610390565b8351156104be5760008060008651602088016000875af1036104be57600080fd5b509392505050565b61016f8061079883390190565b73ffffffffffffffffffffffffffffffffffffffff811681146104f557600080fd5b50565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f83011261053857600080fd5b813567ffffffffffffffff80821115610553576105536104f8565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715610599576105996104f8565b816040528381528660208588010111156105b257600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806000606084860312156105e757600080fd5b83356105f2816104d3565b9250602084013567ffffffffffffffff81111561060e57600080fd5b61061a86828701610527565b925050604084013590509250925092565b60005b8381101561064657818101518382015260200161062e565b83811115610655576000848401525b50505050565b6000815180845261067381602086016020860161062b565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006106b8602083018461065b565b9392505050565b600080600080608085870312156106d557600080fd5b84356106e0816104d3565b9350602085013567ffffffffffffffff8111156106fc57600080fd5b61070887828801610527565b935050604085013591506060850135610720816104d3565b939692955090935050565b600073ffffffffffffffffffffffffffffffffffffffff808716835280861660208401525060806040830152610764608083018561065b565b905082606083015295945050505050565b6000835161078781846020880161062b565b919091019182525060200191905056fe608060405234801561001057600080fd5b5060405161016f38038061016f83398101604081905261002f916100b9565b6001600160a01b0381166100945760405162461bcd60e51b815260206004820152602260248201527f496e76616c69642073696e676c65746f6e20616464726573732070726f766964604482015261195960f21b606482015260840160405180910390fd5b600080546001600160a01b0319166001600160a01b03929092169190911790556100e9565b6000602082840312156100cb57600080fd5b81516001600160a01b03811681146100e257600080fd5b9392505050565b6078806100f76000396000f3fe6080604052600073ffffffffffffffffffffffffffffffffffffffff8154167fa619486e00000000000000000000000000000000000000000000000000000000823503604d57808252602082f35b3682833781823684845af490503d82833e806066573d82fd5b503d81f3fea164736f6c634300080f000aa164736f6c634300080f000a", +} + +// SafeProxyFactoryABI is the input ABI used to generate the binding from. +// Deprecated: Use SafeProxyFactoryMetaData.ABI instead. +var SafeProxyFactoryABI = SafeProxyFactoryMetaData.ABI + +// SafeProxyFactoryBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use SafeProxyFactoryMetaData.Bin instead. +var SafeProxyFactoryBin = SafeProxyFactoryMetaData.Bin + +// DeploySafeProxyFactory deploys a new Ethereum contract, binding an instance of SafeProxyFactory to it. +func DeploySafeProxyFactory(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *SafeProxyFactory, error) { + parsed, err := SafeProxyFactoryMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(SafeProxyFactoryBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &SafeProxyFactory{SafeProxyFactoryCaller: SafeProxyFactoryCaller{contract: contract}, SafeProxyFactoryTransactor: SafeProxyFactoryTransactor{contract: contract}, SafeProxyFactoryFilterer: SafeProxyFactoryFilterer{contract: contract}}, nil +} + +// SafeProxyFactory is an auto generated Go binding around an Ethereum contract. +type SafeProxyFactory struct { + SafeProxyFactoryCaller // Read-only binding to the contract + SafeProxyFactoryTransactor // Write-only binding to the contract + SafeProxyFactoryFilterer // Log filterer for contract events +} + +// SafeProxyFactoryCaller is an auto generated read-only Go binding around an Ethereum contract. +type SafeProxyFactoryCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SafeProxyFactoryTransactor is an auto generated write-only Go binding around an Ethereum contract. +type SafeProxyFactoryTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SafeProxyFactoryFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type SafeProxyFactoryFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SafeProxyFactorySession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type SafeProxyFactorySession struct { + Contract *SafeProxyFactory // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// SafeProxyFactoryCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type SafeProxyFactoryCallerSession struct { + Contract *SafeProxyFactoryCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// SafeProxyFactoryTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type SafeProxyFactoryTransactorSession struct { + Contract *SafeProxyFactoryTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// SafeProxyFactoryRaw is an auto generated low-level Go binding around an Ethereum contract. +type SafeProxyFactoryRaw struct { + Contract *SafeProxyFactory // Generic contract binding to access the raw methods on +} + +// SafeProxyFactoryCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type SafeProxyFactoryCallerRaw struct { + Contract *SafeProxyFactoryCaller // Generic read-only contract binding to access the raw methods on +} + +// SafeProxyFactoryTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type SafeProxyFactoryTransactorRaw struct { + Contract *SafeProxyFactoryTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewSafeProxyFactory creates a new instance of SafeProxyFactory, bound to a specific deployed contract. +func NewSafeProxyFactory(address common.Address, backend bind.ContractBackend) (*SafeProxyFactory, error) { + contract, err := bindSafeProxyFactory(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &SafeProxyFactory{SafeProxyFactoryCaller: SafeProxyFactoryCaller{contract: contract}, SafeProxyFactoryTransactor: SafeProxyFactoryTransactor{contract: contract}, SafeProxyFactoryFilterer: SafeProxyFactoryFilterer{contract: contract}}, nil +} + +// NewSafeProxyFactoryCaller creates a new read-only instance of SafeProxyFactory, bound to a specific deployed contract. +func NewSafeProxyFactoryCaller(address common.Address, caller bind.ContractCaller) (*SafeProxyFactoryCaller, error) { + contract, err := bindSafeProxyFactory(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &SafeProxyFactoryCaller{contract: contract}, nil +} + +// NewSafeProxyFactoryTransactor creates a new write-only instance of SafeProxyFactory, bound to a specific deployed contract. +func NewSafeProxyFactoryTransactor(address common.Address, transactor bind.ContractTransactor) (*SafeProxyFactoryTransactor, error) { + contract, err := bindSafeProxyFactory(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &SafeProxyFactoryTransactor{contract: contract}, nil +} + +// NewSafeProxyFactoryFilterer creates a new log filterer instance of SafeProxyFactory, bound to a specific deployed contract. +func NewSafeProxyFactoryFilterer(address common.Address, filterer bind.ContractFilterer) (*SafeProxyFactoryFilterer, error) { + contract, err := bindSafeProxyFactory(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &SafeProxyFactoryFilterer{contract: contract}, nil +} + +// bindSafeProxyFactory binds a generic wrapper to an already deployed contract. +func bindSafeProxyFactory(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(SafeProxyFactoryABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_SafeProxyFactory *SafeProxyFactoryRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _SafeProxyFactory.Contract.SafeProxyFactoryCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_SafeProxyFactory *SafeProxyFactoryRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SafeProxyFactory.Contract.SafeProxyFactoryTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_SafeProxyFactory *SafeProxyFactoryRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _SafeProxyFactory.Contract.SafeProxyFactoryTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_SafeProxyFactory *SafeProxyFactoryCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _SafeProxyFactory.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_SafeProxyFactory *SafeProxyFactoryTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SafeProxyFactory.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_SafeProxyFactory *SafeProxyFactoryTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _SafeProxyFactory.Contract.contract.Transact(opts, method, params...) +} + +// GetChainId is a free data retrieval call binding the contract method 0x3408e470. +// +// Solidity: function getChainId() view returns(uint256) +func (_SafeProxyFactory *SafeProxyFactoryCaller) GetChainId(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _SafeProxyFactory.contract.Call(opts, &out, "getChainId") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetChainId is a free data retrieval call binding the contract method 0x3408e470. +// +// Solidity: function getChainId() view returns(uint256) +func (_SafeProxyFactory *SafeProxyFactorySession) GetChainId() (*big.Int, error) { + return _SafeProxyFactory.Contract.GetChainId(&_SafeProxyFactory.CallOpts) +} + +// GetChainId is a free data retrieval call binding the contract method 0x3408e470. +// +// Solidity: function getChainId() view returns(uint256) +func (_SafeProxyFactory *SafeProxyFactoryCallerSession) GetChainId() (*big.Int, error) { + return _SafeProxyFactory.Contract.GetChainId(&_SafeProxyFactory.CallOpts) +} + +// ProxyCreationCode is a free data retrieval call binding the contract method 0x53e5d935. +// +// Solidity: function proxyCreationCode() pure returns(bytes) +func (_SafeProxyFactory *SafeProxyFactoryCaller) ProxyCreationCode(opts *bind.CallOpts) ([]byte, error) { + var out []interface{} + err := _SafeProxyFactory.contract.Call(opts, &out, "proxyCreationCode") + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +// ProxyCreationCode is a free data retrieval call binding the contract method 0x53e5d935. +// +// Solidity: function proxyCreationCode() pure returns(bytes) +func (_SafeProxyFactory *SafeProxyFactorySession) ProxyCreationCode() ([]byte, error) { + return _SafeProxyFactory.Contract.ProxyCreationCode(&_SafeProxyFactory.CallOpts) +} + +// ProxyCreationCode is a free data retrieval call binding the contract method 0x53e5d935. +// +// Solidity: function proxyCreationCode() pure returns(bytes) +func (_SafeProxyFactory *SafeProxyFactoryCallerSession) ProxyCreationCode() ([]byte, error) { + return _SafeProxyFactory.Contract.ProxyCreationCode(&_SafeProxyFactory.CallOpts) +} + +// CreateChainSpecificProxyWithNonce is a paid mutator transaction binding the contract method 0xec9e80bb. +// +// Solidity: function createChainSpecificProxyWithNonce(address _singleton, bytes initializer, uint256 saltNonce) returns(address proxy) +func (_SafeProxyFactory *SafeProxyFactoryTransactor) CreateChainSpecificProxyWithNonce(opts *bind.TransactOpts, _singleton common.Address, initializer []byte, saltNonce *big.Int) (*types.Transaction, error) { + return _SafeProxyFactory.contract.Transact(opts, "createChainSpecificProxyWithNonce", _singleton, initializer, saltNonce) +} + +// CreateChainSpecificProxyWithNonce is a paid mutator transaction binding the contract method 0xec9e80bb. +// +// Solidity: function createChainSpecificProxyWithNonce(address _singleton, bytes initializer, uint256 saltNonce) returns(address proxy) +func (_SafeProxyFactory *SafeProxyFactorySession) CreateChainSpecificProxyWithNonce(_singleton common.Address, initializer []byte, saltNonce *big.Int) (*types.Transaction, error) { + return _SafeProxyFactory.Contract.CreateChainSpecificProxyWithNonce(&_SafeProxyFactory.TransactOpts, _singleton, initializer, saltNonce) +} + +// CreateChainSpecificProxyWithNonce is a paid mutator transaction binding the contract method 0xec9e80bb. +// +// Solidity: function createChainSpecificProxyWithNonce(address _singleton, bytes initializer, uint256 saltNonce) returns(address proxy) +func (_SafeProxyFactory *SafeProxyFactoryTransactorSession) CreateChainSpecificProxyWithNonce(_singleton common.Address, initializer []byte, saltNonce *big.Int) (*types.Transaction, error) { + return _SafeProxyFactory.Contract.CreateChainSpecificProxyWithNonce(&_SafeProxyFactory.TransactOpts, _singleton, initializer, saltNonce) +} + +// CreateProxyWithCallback is a paid mutator transaction binding the contract method 0xd18af54d. +// +// Solidity: function createProxyWithCallback(address _singleton, bytes initializer, uint256 saltNonce, address callback) returns(address proxy) +func (_SafeProxyFactory *SafeProxyFactoryTransactor) CreateProxyWithCallback(opts *bind.TransactOpts, _singleton common.Address, initializer []byte, saltNonce *big.Int, callback common.Address) (*types.Transaction, error) { + return _SafeProxyFactory.contract.Transact(opts, "createProxyWithCallback", _singleton, initializer, saltNonce, callback) +} + +// CreateProxyWithCallback is a paid mutator transaction binding the contract method 0xd18af54d. +// +// Solidity: function createProxyWithCallback(address _singleton, bytes initializer, uint256 saltNonce, address callback) returns(address proxy) +func (_SafeProxyFactory *SafeProxyFactorySession) CreateProxyWithCallback(_singleton common.Address, initializer []byte, saltNonce *big.Int, callback common.Address) (*types.Transaction, error) { + return _SafeProxyFactory.Contract.CreateProxyWithCallback(&_SafeProxyFactory.TransactOpts, _singleton, initializer, saltNonce, callback) +} + +// CreateProxyWithCallback is a paid mutator transaction binding the contract method 0xd18af54d. +// +// Solidity: function createProxyWithCallback(address _singleton, bytes initializer, uint256 saltNonce, address callback) returns(address proxy) +func (_SafeProxyFactory *SafeProxyFactoryTransactorSession) CreateProxyWithCallback(_singleton common.Address, initializer []byte, saltNonce *big.Int, callback common.Address) (*types.Transaction, error) { + return _SafeProxyFactory.Contract.CreateProxyWithCallback(&_SafeProxyFactory.TransactOpts, _singleton, initializer, saltNonce, callback) +} + +// CreateProxyWithNonce is a paid mutator transaction binding the contract method 0x1688f0b9. +// +// Solidity: function createProxyWithNonce(address _singleton, bytes initializer, uint256 saltNonce) returns(address proxy) +func (_SafeProxyFactory *SafeProxyFactoryTransactor) CreateProxyWithNonce(opts *bind.TransactOpts, _singleton common.Address, initializer []byte, saltNonce *big.Int) (*types.Transaction, error) { + return _SafeProxyFactory.contract.Transact(opts, "createProxyWithNonce", _singleton, initializer, saltNonce) +} + +// CreateProxyWithNonce is a paid mutator transaction binding the contract method 0x1688f0b9. +// +// Solidity: function createProxyWithNonce(address _singleton, bytes initializer, uint256 saltNonce) returns(address proxy) +func (_SafeProxyFactory *SafeProxyFactorySession) CreateProxyWithNonce(_singleton common.Address, initializer []byte, saltNonce *big.Int) (*types.Transaction, error) { + return _SafeProxyFactory.Contract.CreateProxyWithNonce(&_SafeProxyFactory.TransactOpts, _singleton, initializer, saltNonce) +} + +// CreateProxyWithNonce is a paid mutator transaction binding the contract method 0x1688f0b9. +// +// Solidity: function createProxyWithNonce(address _singleton, bytes initializer, uint256 saltNonce) returns(address proxy) +func (_SafeProxyFactory *SafeProxyFactoryTransactorSession) CreateProxyWithNonce(_singleton common.Address, initializer []byte, saltNonce *big.Int) (*types.Transaction, error) { + return _SafeProxyFactory.Contract.CreateProxyWithNonce(&_SafeProxyFactory.TransactOpts, _singleton, initializer, saltNonce) +} + +// SafeProxyFactoryProxyCreationIterator is returned from FilterProxyCreation and is used to iterate over the raw logs and unpacked data for ProxyCreation events raised by the SafeProxyFactory contract. +type SafeProxyFactoryProxyCreationIterator struct { + Event *SafeProxyFactoryProxyCreation // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SafeProxyFactoryProxyCreationIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SafeProxyFactoryProxyCreation) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SafeProxyFactoryProxyCreation) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SafeProxyFactoryProxyCreationIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SafeProxyFactoryProxyCreationIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SafeProxyFactoryProxyCreation represents a ProxyCreation event raised by the SafeProxyFactory contract. +type SafeProxyFactoryProxyCreation struct { + Proxy common.Address + Singleton common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterProxyCreation is a free log retrieval operation binding the contract event 0x4f51faf6c4561ff95f067657e43439f0f856d97c04d9ec9070a6199ad418e235. +// +// Solidity: event ProxyCreation(address indexed proxy, address singleton) +func (_SafeProxyFactory *SafeProxyFactoryFilterer) FilterProxyCreation(opts *bind.FilterOpts, proxy []common.Address) (*SafeProxyFactoryProxyCreationIterator, error) { + + var proxyRule []interface{} + for _, proxyItem := range proxy { + proxyRule = append(proxyRule, proxyItem) + } + + logs, sub, err := _SafeProxyFactory.contract.FilterLogs(opts, "ProxyCreation", proxyRule) + if err != nil { + return nil, err + } + return &SafeProxyFactoryProxyCreationIterator{contract: _SafeProxyFactory.contract, event: "ProxyCreation", logs: logs, sub: sub}, nil +} + +// WatchProxyCreation is a free log subscription operation binding the contract event 0x4f51faf6c4561ff95f067657e43439f0f856d97c04d9ec9070a6199ad418e235. +// +// Solidity: event ProxyCreation(address indexed proxy, address singleton) +func (_SafeProxyFactory *SafeProxyFactoryFilterer) WatchProxyCreation(opts *bind.WatchOpts, sink chan<- *SafeProxyFactoryProxyCreation, proxy []common.Address) (event.Subscription, error) { + + var proxyRule []interface{} + for _, proxyItem := range proxy { + proxyRule = append(proxyRule, proxyItem) + } + + logs, sub, err := _SafeProxyFactory.contract.WatchLogs(opts, "ProxyCreation", proxyRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SafeProxyFactoryProxyCreation) + if err := _SafeProxyFactory.contract.UnpackLog(event, "ProxyCreation", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseProxyCreation is a log parse operation binding the contract event 0x4f51faf6c4561ff95f067657e43439f0f856d97c04d9ec9070a6199ad418e235. +// +// Solidity: event ProxyCreation(address indexed proxy, address singleton) +func (_SafeProxyFactory *SafeProxyFactoryFilterer) ParseProxyCreation(log types.Log) (*SafeProxyFactoryProxyCreation, error) { + event := new(SafeProxyFactoryProxyCreation) + if err := _SafeProxyFactory.contract.UnpackLog(event, "ProxyCreation", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/op-e2e2/bindings/safesingletonfactory.go b/op-e2e2/bindings/safesingletonfactory.go new file mode 100644 index 000000000000..d0f16ee4ab06 --- /dev/null +++ b/op-e2e2/bindings/safesingletonfactory.go @@ -0,0 +1,223 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// SafeSingletonFactoryMetaData contains all meta data concerning the SafeSingletonFactory contract. +var SafeSingletonFactoryMetaData = &bind.MetaData{ + ABI: "[{\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"fallback\",\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"salt\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"creationCode\",\"type\":\"bytes\"}]}]", + Bin: "0x604580600e600039806000f350fe7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf3", +} + +// SafeSingletonFactoryABI is the input ABI used to generate the binding from. +// Deprecated: Use SafeSingletonFactoryMetaData.ABI instead. +var SafeSingletonFactoryABI = SafeSingletonFactoryMetaData.ABI + +// SafeSingletonFactoryBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use SafeSingletonFactoryMetaData.Bin instead. +var SafeSingletonFactoryBin = SafeSingletonFactoryMetaData.Bin + +// DeploySafeSingletonFactory deploys a new Ethereum contract, binding an instance of SafeSingletonFactory to it. +func DeploySafeSingletonFactory(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *SafeSingletonFactory, error) { + parsed, err := SafeSingletonFactoryMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(SafeSingletonFactoryBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &SafeSingletonFactory{SafeSingletonFactoryCaller: SafeSingletonFactoryCaller{contract: contract}, SafeSingletonFactoryTransactor: SafeSingletonFactoryTransactor{contract: contract}, SafeSingletonFactoryFilterer: SafeSingletonFactoryFilterer{contract: contract}}, nil +} + +// SafeSingletonFactory is an auto generated Go binding around an Ethereum contract. +type SafeSingletonFactory struct { + SafeSingletonFactoryCaller // Read-only binding to the contract + SafeSingletonFactoryTransactor // Write-only binding to the contract + SafeSingletonFactoryFilterer // Log filterer for contract events +} + +// SafeSingletonFactoryCaller is an auto generated read-only Go binding around an Ethereum contract. +type SafeSingletonFactoryCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SafeSingletonFactoryTransactor is an auto generated write-only Go binding around an Ethereum contract. +type SafeSingletonFactoryTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SafeSingletonFactoryFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type SafeSingletonFactoryFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SafeSingletonFactorySession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type SafeSingletonFactorySession struct { + Contract *SafeSingletonFactory // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// SafeSingletonFactoryCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type SafeSingletonFactoryCallerSession struct { + Contract *SafeSingletonFactoryCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// SafeSingletonFactoryTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type SafeSingletonFactoryTransactorSession struct { + Contract *SafeSingletonFactoryTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// SafeSingletonFactoryRaw is an auto generated low-level Go binding around an Ethereum contract. +type SafeSingletonFactoryRaw struct { + Contract *SafeSingletonFactory // Generic contract binding to access the raw methods on +} + +// SafeSingletonFactoryCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type SafeSingletonFactoryCallerRaw struct { + Contract *SafeSingletonFactoryCaller // Generic read-only contract binding to access the raw methods on +} + +// SafeSingletonFactoryTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type SafeSingletonFactoryTransactorRaw struct { + Contract *SafeSingletonFactoryTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewSafeSingletonFactory creates a new instance of SafeSingletonFactory, bound to a specific deployed contract. +func NewSafeSingletonFactory(address common.Address, backend bind.ContractBackend) (*SafeSingletonFactory, error) { + contract, err := bindSafeSingletonFactory(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &SafeSingletonFactory{SafeSingletonFactoryCaller: SafeSingletonFactoryCaller{contract: contract}, SafeSingletonFactoryTransactor: SafeSingletonFactoryTransactor{contract: contract}, SafeSingletonFactoryFilterer: SafeSingletonFactoryFilterer{contract: contract}}, nil +} + +// NewSafeSingletonFactoryCaller creates a new read-only instance of SafeSingletonFactory, bound to a specific deployed contract. +func NewSafeSingletonFactoryCaller(address common.Address, caller bind.ContractCaller) (*SafeSingletonFactoryCaller, error) { + contract, err := bindSafeSingletonFactory(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &SafeSingletonFactoryCaller{contract: contract}, nil +} + +// NewSafeSingletonFactoryTransactor creates a new write-only instance of SafeSingletonFactory, bound to a specific deployed contract. +func NewSafeSingletonFactoryTransactor(address common.Address, transactor bind.ContractTransactor) (*SafeSingletonFactoryTransactor, error) { + contract, err := bindSafeSingletonFactory(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &SafeSingletonFactoryTransactor{contract: contract}, nil +} + +// NewSafeSingletonFactoryFilterer creates a new log filterer instance of SafeSingletonFactory, bound to a specific deployed contract. +func NewSafeSingletonFactoryFilterer(address common.Address, filterer bind.ContractFilterer) (*SafeSingletonFactoryFilterer, error) { + contract, err := bindSafeSingletonFactory(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &SafeSingletonFactoryFilterer{contract: contract}, nil +} + +// bindSafeSingletonFactory binds a generic wrapper to an already deployed contract. +func bindSafeSingletonFactory(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(SafeSingletonFactoryABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_SafeSingletonFactory *SafeSingletonFactoryRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _SafeSingletonFactory.Contract.SafeSingletonFactoryCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_SafeSingletonFactory *SafeSingletonFactoryRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SafeSingletonFactory.Contract.SafeSingletonFactoryTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_SafeSingletonFactory *SafeSingletonFactoryRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _SafeSingletonFactory.Contract.SafeSingletonFactoryTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_SafeSingletonFactory *SafeSingletonFactoryCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _SafeSingletonFactory.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_SafeSingletonFactory *SafeSingletonFactoryTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SafeSingletonFactory.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_SafeSingletonFactory *SafeSingletonFactoryTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _SafeSingletonFactory.Contract.contract.Transact(opts, method, params...) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() payable returns() +func (_SafeSingletonFactory *SafeSingletonFactoryTransactor) Fallback(opts *bind.TransactOpts, calldata []byte) (*types.Transaction, error) { + return _SafeSingletonFactory.contract.RawTransact(opts, calldata) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() payable returns() +func (_SafeSingletonFactory *SafeSingletonFactorySession) Fallback(calldata []byte) (*types.Transaction, error) { + return _SafeSingletonFactory.Contract.Fallback(&_SafeSingletonFactory.TransactOpts, calldata) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() payable returns() +func (_SafeSingletonFactory *SafeSingletonFactoryTransactorSession) Fallback(calldata []byte) (*types.Transaction, error) { + return _SafeSingletonFactory.Contract.Fallback(&_SafeSingletonFactory.TransactOpts, calldata) +} diff --git a/op-e2e2/bindings/schemaregistry.go b/op-e2e2/bindings/schemaregistry.go new file mode 100644 index 000000000000..6fe4407948e2 --- /dev/null +++ b/op-e2e2/bindings/schemaregistry.go @@ -0,0 +1,447 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// SchemaRecord is an auto generated low-level Go binding around an user-defined struct. +type SchemaRecord struct { + Uid [32]byte + Resolver common.Address + Revocable bool + Schema string +} + +// SchemaRegistryMetaData contains all meta data concerning the SchemaRegistry contract. +var SchemaRegistryMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"function\",\"name\":\"getSchema\",\"inputs\":[{\"name\":\"uid\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structSchemaRecord\",\"components\":[{\"name\":\"uid\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"resolver\",\"type\":\"address\",\"internalType\":\"contractISchemaResolver\"},{\"name\":\"revocable\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"schema\",\"type\":\"string\",\"internalType\":\"string\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"register\",\"inputs\":[{\"name\":\"schema\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"resolver\",\"type\":\"address\",\"internalType\":\"contractISchemaResolver\"},{\"name\":\"revocable\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"Registered\",\"inputs\":[{\"name\":\"uid\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"registerer\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"schema\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structSchemaRecord\",\"components\":[{\"name\":\"uid\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"resolver\",\"type\":\"address\",\"internalType\":\"contractISchemaResolver\"},{\"name\":\"revocable\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"schema\",\"type\":\"string\",\"internalType\":\"string\"}]}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"AlreadyExists\",\"inputs\":[]}]", + Bin: "0x608060405234801561001057600080fd5b506107fe806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c806354fd4d501461004657806360d7a27814610098578063a2ea7c6e146100b9575b600080fd5b6100826040518060400160405280600581526020017f312e332e3000000000000000000000000000000000000000000000000000000081525081565b60405161008f9190610473565b60405180910390f35b6100ab6100a636600461048d565b6100d9565b60405190815260200161008f565b6100cc6100c736600461053f565b61029d565b60405161008f9190610558565b60008060405180608001604052806000801b81526020018573ffffffffffffffffffffffffffffffffffffffff168152602001841515815260200187878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509390945250929350915061015b9050826103c5565b600081815260208190526040902054909150156101a4576040517f23369fa600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80825260008181526020818152604091829020845181559084015160018201805493860151151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00000000000000000000000000000000000000000090941673ffffffffffffffffffffffffffffffffffffffff9092169190911792909217909155606083015183919060028201906102409082610682565b509050503373ffffffffffffffffffffffffffffffffffffffff16817fd0b86852e21f9e5fa4bc3b0cff9757ffe243d50c4b43968a42202153d651ea5e8460405161028b9190610558565b60405180910390a39695505050505050565b604080516080810182526000808252602082018190529181019190915260608082015260008281526020818152604091829020825160808101845281548152600182015473ffffffffffffffffffffffffffffffffffffffff8116938201939093527401000000000000000000000000000000000000000090920460ff1615159282019290925260028201805491929160608401919061033c906105e0565b80601f0160208091040260200160405190810160405280929190818152602001828054610368906105e0565b80156103b55780601f1061038a576101008083540402835291602001916103b5565b820191906000526020600020905b81548152906001019060200180831161039857829003601f168201915b5050505050815250509050919050565b60008160600151826020015183604001516040516020016103e89392919061079c565b604051602081830303815290604052805190602001209050919050565b60005b83811015610420578181015183820152602001610408565b50506000910152565b60008151808452610441816020860160208601610405565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006104866020830184610429565b9392505050565b600080600080606085870312156104a357600080fd5b843567ffffffffffffffff808211156104bb57600080fd5b818701915087601f8301126104cf57600080fd5b8135818111156104de57600080fd5b8860208285010111156104f057600080fd5b6020928301965094505085013573ffffffffffffffffffffffffffffffffffffffff8116811461051f57600080fd5b91506040850135801515811461053457600080fd5b939692955090935050565b60006020828403121561055157600080fd5b5035919050565b602081528151602082015273ffffffffffffffffffffffffffffffffffffffff6020830151166040820152604082015115156060820152600060608301516080808401526105a960a0840182610429565b949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600181811c908216806105f457607f821691505b60208210810361062d577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b601f82111561067d57600081815260208120601f850160051c8101602086101561065a5750805b601f850160051c820191505b8181101561067957828155600101610666565b5050505b505050565b815167ffffffffffffffff81111561069c5761069c6105b1565b6106b0816106aa84546105e0565b84610633565b602080601f83116001811461070357600084156106cd5750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555610679565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b8281101561075057888601518255948401946001909101908401610731565b508582101561078c57878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b600084516107ae818460208901610405565b60609490941b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000169190930190815290151560f81b60148201526015019291505056fea164736f6c6343000813000a", +} + +// SchemaRegistryABI is the input ABI used to generate the binding from. +// Deprecated: Use SchemaRegistryMetaData.ABI instead. +var SchemaRegistryABI = SchemaRegistryMetaData.ABI + +// SchemaRegistryBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use SchemaRegistryMetaData.Bin instead. +var SchemaRegistryBin = SchemaRegistryMetaData.Bin + +// DeploySchemaRegistry deploys a new Ethereum contract, binding an instance of SchemaRegistry to it. +func DeploySchemaRegistry(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *SchemaRegistry, error) { + parsed, err := SchemaRegistryMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(SchemaRegistryBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &SchemaRegistry{SchemaRegistryCaller: SchemaRegistryCaller{contract: contract}, SchemaRegistryTransactor: SchemaRegistryTransactor{contract: contract}, SchemaRegistryFilterer: SchemaRegistryFilterer{contract: contract}}, nil +} + +// SchemaRegistry is an auto generated Go binding around an Ethereum contract. +type SchemaRegistry struct { + SchemaRegistryCaller // Read-only binding to the contract + SchemaRegistryTransactor // Write-only binding to the contract + SchemaRegistryFilterer // Log filterer for contract events +} + +// SchemaRegistryCaller is an auto generated read-only Go binding around an Ethereum contract. +type SchemaRegistryCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SchemaRegistryTransactor is an auto generated write-only Go binding around an Ethereum contract. +type SchemaRegistryTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SchemaRegistryFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type SchemaRegistryFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SchemaRegistrySession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type SchemaRegistrySession struct { + Contract *SchemaRegistry // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// SchemaRegistryCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type SchemaRegistryCallerSession struct { + Contract *SchemaRegistryCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// SchemaRegistryTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type SchemaRegistryTransactorSession struct { + Contract *SchemaRegistryTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// SchemaRegistryRaw is an auto generated low-level Go binding around an Ethereum contract. +type SchemaRegistryRaw struct { + Contract *SchemaRegistry // Generic contract binding to access the raw methods on +} + +// SchemaRegistryCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type SchemaRegistryCallerRaw struct { + Contract *SchemaRegistryCaller // Generic read-only contract binding to access the raw methods on +} + +// SchemaRegistryTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type SchemaRegistryTransactorRaw struct { + Contract *SchemaRegistryTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewSchemaRegistry creates a new instance of SchemaRegistry, bound to a specific deployed contract. +func NewSchemaRegistry(address common.Address, backend bind.ContractBackend) (*SchemaRegistry, error) { + contract, err := bindSchemaRegistry(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &SchemaRegistry{SchemaRegistryCaller: SchemaRegistryCaller{contract: contract}, SchemaRegistryTransactor: SchemaRegistryTransactor{contract: contract}, SchemaRegistryFilterer: SchemaRegistryFilterer{contract: contract}}, nil +} + +// NewSchemaRegistryCaller creates a new read-only instance of SchemaRegistry, bound to a specific deployed contract. +func NewSchemaRegistryCaller(address common.Address, caller bind.ContractCaller) (*SchemaRegistryCaller, error) { + contract, err := bindSchemaRegistry(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &SchemaRegistryCaller{contract: contract}, nil +} + +// NewSchemaRegistryTransactor creates a new write-only instance of SchemaRegistry, bound to a specific deployed contract. +func NewSchemaRegistryTransactor(address common.Address, transactor bind.ContractTransactor) (*SchemaRegistryTransactor, error) { + contract, err := bindSchemaRegistry(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &SchemaRegistryTransactor{contract: contract}, nil +} + +// NewSchemaRegistryFilterer creates a new log filterer instance of SchemaRegistry, bound to a specific deployed contract. +func NewSchemaRegistryFilterer(address common.Address, filterer bind.ContractFilterer) (*SchemaRegistryFilterer, error) { + contract, err := bindSchemaRegistry(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &SchemaRegistryFilterer{contract: contract}, nil +} + +// bindSchemaRegistry binds a generic wrapper to an already deployed contract. +func bindSchemaRegistry(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(SchemaRegistryABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_SchemaRegistry *SchemaRegistryRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _SchemaRegistry.Contract.SchemaRegistryCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_SchemaRegistry *SchemaRegistryRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SchemaRegistry.Contract.SchemaRegistryTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_SchemaRegistry *SchemaRegistryRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _SchemaRegistry.Contract.SchemaRegistryTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_SchemaRegistry *SchemaRegistryCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _SchemaRegistry.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_SchemaRegistry *SchemaRegistryTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SchemaRegistry.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_SchemaRegistry *SchemaRegistryTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _SchemaRegistry.Contract.contract.Transact(opts, method, params...) +} + +// GetSchema is a free data retrieval call binding the contract method 0xa2ea7c6e. +// +// Solidity: function getSchema(bytes32 uid) view returns((bytes32,address,bool,string)) +func (_SchemaRegistry *SchemaRegistryCaller) GetSchema(opts *bind.CallOpts, uid [32]byte) (SchemaRecord, error) { + var out []interface{} + err := _SchemaRegistry.contract.Call(opts, &out, "getSchema", uid) + + if err != nil { + return *new(SchemaRecord), err + } + + out0 := *abi.ConvertType(out[0], new(SchemaRecord)).(*SchemaRecord) + + return out0, err + +} + +// GetSchema is a free data retrieval call binding the contract method 0xa2ea7c6e. +// +// Solidity: function getSchema(bytes32 uid) view returns((bytes32,address,bool,string)) +func (_SchemaRegistry *SchemaRegistrySession) GetSchema(uid [32]byte) (SchemaRecord, error) { + return _SchemaRegistry.Contract.GetSchema(&_SchemaRegistry.CallOpts, uid) +} + +// GetSchema is a free data retrieval call binding the contract method 0xa2ea7c6e. +// +// Solidity: function getSchema(bytes32 uid) view returns((bytes32,address,bool,string)) +func (_SchemaRegistry *SchemaRegistryCallerSession) GetSchema(uid [32]byte) (SchemaRecord, error) { + return _SchemaRegistry.Contract.GetSchema(&_SchemaRegistry.CallOpts, uid) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_SchemaRegistry *SchemaRegistryCaller) Version(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _SchemaRegistry.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 (_SchemaRegistry *SchemaRegistrySession) Version() (string, error) { + return _SchemaRegistry.Contract.Version(&_SchemaRegistry.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_SchemaRegistry *SchemaRegistryCallerSession) Version() (string, error) { + return _SchemaRegistry.Contract.Version(&_SchemaRegistry.CallOpts) +} + +// Register is a paid mutator transaction binding the contract method 0x60d7a278. +// +// Solidity: function register(string schema, address resolver, bool revocable) returns(bytes32) +func (_SchemaRegistry *SchemaRegistryTransactor) Register(opts *bind.TransactOpts, schema string, resolver common.Address, revocable bool) (*types.Transaction, error) { + return _SchemaRegistry.contract.Transact(opts, "register", schema, resolver, revocable) +} + +// Register is a paid mutator transaction binding the contract method 0x60d7a278. +// +// Solidity: function register(string schema, address resolver, bool revocable) returns(bytes32) +func (_SchemaRegistry *SchemaRegistrySession) Register(schema string, resolver common.Address, revocable bool) (*types.Transaction, error) { + return _SchemaRegistry.Contract.Register(&_SchemaRegistry.TransactOpts, schema, resolver, revocable) +} + +// Register is a paid mutator transaction binding the contract method 0x60d7a278. +// +// Solidity: function register(string schema, address resolver, bool revocable) returns(bytes32) +func (_SchemaRegistry *SchemaRegistryTransactorSession) Register(schema string, resolver common.Address, revocable bool) (*types.Transaction, error) { + return _SchemaRegistry.Contract.Register(&_SchemaRegistry.TransactOpts, schema, resolver, revocable) +} + +// SchemaRegistryRegisteredIterator is returned from FilterRegistered and is used to iterate over the raw logs and unpacked data for Registered events raised by the SchemaRegistry contract. +type SchemaRegistryRegisteredIterator struct { + Event *SchemaRegistryRegistered // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SchemaRegistryRegisteredIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SchemaRegistryRegistered) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SchemaRegistryRegistered) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SchemaRegistryRegisteredIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SchemaRegistryRegisteredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SchemaRegistryRegistered represents a Registered event raised by the SchemaRegistry contract. +type SchemaRegistryRegistered struct { + Uid [32]byte + Registerer common.Address + Schema SchemaRecord + Raw types.Log // Blockchain specific contextual infos +} + +// FilterRegistered is a free log retrieval operation binding the contract event 0xd0b86852e21f9e5fa4bc3b0cff9757ffe243d50c4b43968a42202153d651ea5e. +// +// Solidity: event Registered(bytes32 indexed uid, address indexed registerer, (bytes32,address,bool,string) schema) +func (_SchemaRegistry *SchemaRegistryFilterer) FilterRegistered(opts *bind.FilterOpts, uid [][32]byte, registerer []common.Address) (*SchemaRegistryRegisteredIterator, error) { + + var uidRule []interface{} + for _, uidItem := range uid { + uidRule = append(uidRule, uidItem) + } + var registererRule []interface{} + for _, registererItem := range registerer { + registererRule = append(registererRule, registererItem) + } + + logs, sub, err := _SchemaRegistry.contract.FilterLogs(opts, "Registered", uidRule, registererRule) + if err != nil { + return nil, err + } + return &SchemaRegistryRegisteredIterator{contract: _SchemaRegistry.contract, event: "Registered", logs: logs, sub: sub}, nil +} + +// WatchRegistered is a free log subscription operation binding the contract event 0xd0b86852e21f9e5fa4bc3b0cff9757ffe243d50c4b43968a42202153d651ea5e. +// +// Solidity: event Registered(bytes32 indexed uid, address indexed registerer, (bytes32,address,bool,string) schema) +func (_SchemaRegistry *SchemaRegistryFilterer) WatchRegistered(opts *bind.WatchOpts, sink chan<- *SchemaRegistryRegistered, uid [][32]byte, registerer []common.Address) (event.Subscription, error) { + + var uidRule []interface{} + for _, uidItem := range uid { + uidRule = append(uidRule, uidItem) + } + var registererRule []interface{} + for _, registererItem := range registerer { + registererRule = append(registererRule, registererItem) + } + + logs, sub, err := _SchemaRegistry.contract.WatchLogs(opts, "Registered", uidRule, registererRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SchemaRegistryRegistered) + if err := _SchemaRegistry.contract.UnpackLog(event, "Registered", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseRegistered is a log parse operation binding the contract event 0xd0b86852e21f9e5fa4bc3b0cff9757ffe243d50c4b43968a42202153d651ea5e. +// +// Solidity: event Registered(bytes32 indexed uid, address indexed registerer, (bytes32,address,bool,string) schema) +func (_SchemaRegistry *SchemaRegistryFilterer) ParseRegistered(log types.Log) (*SchemaRegistryRegistered, error) { + event := new(SchemaRegistryRegistered) + if err := _SchemaRegistry.contract.UnpackLog(event, "Registered", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/op-e2e2/bindings/sendercreator.go b/op-e2e2/bindings/sendercreator.go new file mode 100644 index 000000000000..2d2c332856ed --- /dev/null +++ b/op-e2e2/bindings/sendercreator.go @@ -0,0 +1,223 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// SenderCreatorMetaData contains all meta data concerning the SenderCreator contract. +var SenderCreatorMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"initCode\",\"type\":\"bytes\"}],\"name\":\"createSender\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x6080806040523461001657610210908161001c8239f35b600080fdfe6080604052600436101561001257600080fd5b6000803560e01c63570e1a361461002857600080fd5b346100c95760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100c95760043567ffffffffffffffff918282116100c957366023830112156100c95781600401359283116100c95736602484840101116100c9576100c561009e84602485016100fc565b60405173ffffffffffffffffffffffffffffffffffffffff90911681529081906020820190565b0390f35b80fd5b507f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b90806014116101bb5767ffffffffffffffff917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec82018381116101cd575b604051937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f81600b8701160116850190858210908211176101c0575b604052808452602084019036848401116101bb576020946000600c819682946014880187378301015251923560601c5af19060005191156101b557565b60009150565b600080fd5b6101c86100cc565b610178565b6101d56100cc565b61013a56fea26469706673582212201927e80b76ab9b71c952137dd676621a9fdf520c25928815636594036eb1c40364736f6c63430008110033", +} + +// SenderCreatorABI is the input ABI used to generate the binding from. +// Deprecated: Use SenderCreatorMetaData.ABI instead. +var SenderCreatorABI = SenderCreatorMetaData.ABI + +// SenderCreatorBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use SenderCreatorMetaData.Bin instead. +var SenderCreatorBin = SenderCreatorMetaData.Bin + +// DeploySenderCreator deploys a new Ethereum contract, binding an instance of SenderCreator to it. +func DeploySenderCreator(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *SenderCreator, error) { + parsed, err := SenderCreatorMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(SenderCreatorBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &SenderCreator{SenderCreatorCaller: SenderCreatorCaller{contract: contract}, SenderCreatorTransactor: SenderCreatorTransactor{contract: contract}, SenderCreatorFilterer: SenderCreatorFilterer{contract: contract}}, nil +} + +// SenderCreator is an auto generated Go binding around an Ethereum contract. +type SenderCreator struct { + SenderCreatorCaller // Read-only binding to the contract + SenderCreatorTransactor // Write-only binding to the contract + SenderCreatorFilterer // Log filterer for contract events +} + +// SenderCreatorCaller is an auto generated read-only Go binding around an Ethereum contract. +type SenderCreatorCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SenderCreatorTransactor is an auto generated write-only Go binding around an Ethereum contract. +type SenderCreatorTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SenderCreatorFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type SenderCreatorFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SenderCreatorSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type SenderCreatorSession struct { + Contract *SenderCreator // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// SenderCreatorCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type SenderCreatorCallerSession struct { + Contract *SenderCreatorCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// SenderCreatorTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type SenderCreatorTransactorSession struct { + Contract *SenderCreatorTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// SenderCreatorRaw is an auto generated low-level Go binding around an Ethereum contract. +type SenderCreatorRaw struct { + Contract *SenderCreator // Generic contract binding to access the raw methods on +} + +// SenderCreatorCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type SenderCreatorCallerRaw struct { + Contract *SenderCreatorCaller // Generic read-only contract binding to access the raw methods on +} + +// SenderCreatorTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type SenderCreatorTransactorRaw struct { + Contract *SenderCreatorTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewSenderCreator creates a new instance of SenderCreator, bound to a specific deployed contract. +func NewSenderCreator(address common.Address, backend bind.ContractBackend) (*SenderCreator, error) { + contract, err := bindSenderCreator(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &SenderCreator{SenderCreatorCaller: SenderCreatorCaller{contract: contract}, SenderCreatorTransactor: SenderCreatorTransactor{contract: contract}, SenderCreatorFilterer: SenderCreatorFilterer{contract: contract}}, nil +} + +// NewSenderCreatorCaller creates a new read-only instance of SenderCreator, bound to a specific deployed contract. +func NewSenderCreatorCaller(address common.Address, caller bind.ContractCaller) (*SenderCreatorCaller, error) { + contract, err := bindSenderCreator(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &SenderCreatorCaller{contract: contract}, nil +} + +// NewSenderCreatorTransactor creates a new write-only instance of SenderCreator, bound to a specific deployed contract. +func NewSenderCreatorTransactor(address common.Address, transactor bind.ContractTransactor) (*SenderCreatorTransactor, error) { + contract, err := bindSenderCreator(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &SenderCreatorTransactor{contract: contract}, nil +} + +// NewSenderCreatorFilterer creates a new log filterer instance of SenderCreator, bound to a specific deployed contract. +func NewSenderCreatorFilterer(address common.Address, filterer bind.ContractFilterer) (*SenderCreatorFilterer, error) { + contract, err := bindSenderCreator(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &SenderCreatorFilterer{contract: contract}, nil +} + +// bindSenderCreator binds a generic wrapper to an already deployed contract. +func bindSenderCreator(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(SenderCreatorABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_SenderCreator *SenderCreatorRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _SenderCreator.Contract.SenderCreatorCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_SenderCreator *SenderCreatorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SenderCreator.Contract.SenderCreatorTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_SenderCreator *SenderCreatorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _SenderCreator.Contract.SenderCreatorTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_SenderCreator *SenderCreatorCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _SenderCreator.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_SenderCreator *SenderCreatorTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SenderCreator.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_SenderCreator *SenderCreatorTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _SenderCreator.Contract.contract.Transact(opts, method, params...) +} + +// CreateSender is a paid mutator transaction binding the contract method 0x570e1a36. +// +// Solidity: function createSender(bytes initCode) returns(address sender) +func (_SenderCreator *SenderCreatorTransactor) CreateSender(opts *bind.TransactOpts, initCode []byte) (*types.Transaction, error) { + return _SenderCreator.contract.Transact(opts, "createSender", initCode) +} + +// CreateSender is a paid mutator transaction binding the contract method 0x570e1a36. +// +// Solidity: function createSender(bytes initCode) returns(address sender) +func (_SenderCreator *SenderCreatorSession) CreateSender(initCode []byte) (*types.Transaction, error) { + return _SenderCreator.Contract.CreateSender(&_SenderCreator.TransactOpts, initCode) +} + +// CreateSender is a paid mutator transaction binding the contract method 0x570e1a36. +// +// Solidity: function createSender(bytes initCode) returns(address sender) +func (_SenderCreator *SenderCreatorTransactorSession) CreateSender(initCode []byte) (*types.Transaction, error) { + return _SenderCreator.Contract.CreateSender(&_SenderCreator.TransactOpts, initCode) +} diff --git a/op-e2e2/bindings/sequencerfeevault.go b/op-e2e2/bindings/sequencerfeevault.go new file mode 100644 index 000000000000..443fa3af97a7 --- /dev/null +++ b/op-e2e2/bindings/sequencerfeevault.go @@ -0,0 +1,703 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// SequencerFeeVaultMetaData contains all meta data concerning the SequencerFeeVault contract. +var SequencerFeeVaultMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_recipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_minWithdrawalAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_withdrawalNetwork\",\"type\":\"uint8\",\"internalType\":\"enumFeeVault.WithdrawalNetwork\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"MIN_WITHDRAWAL_AMOUNT\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"RECIPIENT\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"WITHDRAWAL_NETWORK\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"enumFeeVault.WithdrawalNetwork\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"l1FeeWallet\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"totalProcessed\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"withdraw\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"Withdrawal\",\"inputs\":[{\"name\":\"value\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"from\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Withdrawal\",\"inputs\":[{\"name\":\"value\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"from\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"withdrawalNetwork\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"enumFeeVault.WithdrawalNetwork\"}],\"anonymous\":false}]", + Bin: "0x60e060405234801561001057600080fd5b5060405161091638038061091683398101604081905261002f91610079565b6001600160a01b03831660a0526080829052828282806001811115610056576100566100cc565b60c081600181111561006a5761006a6100cc565b815250505050505050506100e2565b60008060006060848603121561008e57600080fd5b83516001600160a01b03811681146100a557600080fd5b602085015160408601519194509250600281106100c157600080fd5b809150509250925092565b634e487b7160e01b600052602160045260246000fd5b60805160a05160c0516107ce61014860003960008181610181015281816103c701526104020152600081816092015281816101f301528181610316015281816103a50152818161043b01526105a20152600081816101c2015261021901526107ce6000f3fe6080604052600436106100745760003560e01c806384411d651161004e57806384411d651461014b578063d0e12f901461016f578063d3e5792b146101b0578063d4ff9218146101e457600080fd5b80630d9019e1146100805780633ccfd60b146100de57806354fd4d50146100f557600080fd5b3661007b57005b600080fd5b34801561008c57600080fd5b506100b47f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b3480156100ea57600080fd5b506100f3610217565b005b34801561010157600080fd5b5061013e6040518060400160405280600581526020017f312e342e3100000000000000000000000000000000000000000000000000000081525081565b6040516100d5919061066e565b34801561015757600080fd5b5061016160005481565b6040519081526020016100d5565b34801561017b57600080fd5b506101a37f000000000000000000000000000000000000000000000000000000000000000081565b6040516100d591906106f2565b3480156101bc57600080fd5b506101617f000000000000000000000000000000000000000000000000000000000000000081565b3480156101f057600080fd5b507f00000000000000000000000000000000000000000000000000000000000000006100b4565b7f00000000000000000000000000000000000000000000000000000000000000004710156102f2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604a60248201527f4665655661756c743a207769746864726177616c20616d6f756e74206d75737460448201527f2062652067726561746572207468616e206d696e696d756d207769746864726160648201527f77616c20616d6f756e7400000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b6000479050806000808282546103089190610706565b9091555050604080518281527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166020820152338183015290517fc8a211cc64b6ed1b50595a9fcb1932b6d1e5a6e8ef15b60e5b1f988ea9086bba9181900360600190a17f38e04cbeb8c10f8f568618aa75be0f10b6729b8b4237743b4de20cbcde2839ee817f0000000000000000000000000000000000000000000000000000000000000000337f00000000000000000000000000000000000000000000000000000000000000006040516103f69493929190610745565b60405180910390a160017f0000000000000000000000000000000000000000000000000000000000000000600181111561043257610432610688565b0361054b5760007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d80600081146104b1576040519150601f19603f3d011682016040523d82523d6000602084013e6104b6565b606091505b5050905080610547576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f4665655661756c743a206661696c656420746f2073656e642045544820746f2060448201527f4c322066656520726563697069656e740000000000000000000000000000000060648201526084016102e9565b5050565b604080516020810182526000815290517fe11013dd0000000000000000000000000000000000000000000000000000000081527342000000000000000000000000000000000000109163e11013dd9184916105ce917f0000000000000000000000000000000000000000000000000000000000000000916188b891600401610786565b6000604051808303818588803b1580156105e757600080fd5b505af11580156105fb573d6000803e3d6000fd5b505050505050565b6000815180845260005b818110156106295760208185018101518683018201520161060d565b8181111561063b576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006106816020830184610603565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600281106106ee577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9052565b6020810161070082846106b7565b92915050565b60008219821115610740577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b500190565b84815273ffffffffffffffffffffffffffffffffffffffff8481166020830152831660408201526080810161077d60608301846106b7565b95945050505050565b73ffffffffffffffffffffffffffffffffffffffff8416815263ffffffff8316602082015260606040820152600061077d606083018461060356fea164736f6c634300080f000a", +} + +// SequencerFeeVaultABI is the input ABI used to generate the binding from. +// Deprecated: Use SequencerFeeVaultMetaData.ABI instead. +var SequencerFeeVaultABI = SequencerFeeVaultMetaData.ABI + +// SequencerFeeVaultBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use SequencerFeeVaultMetaData.Bin instead. +var SequencerFeeVaultBin = SequencerFeeVaultMetaData.Bin + +// DeploySequencerFeeVault deploys a new Ethereum contract, binding an instance of SequencerFeeVault to it. +func DeploySequencerFeeVault(auth *bind.TransactOpts, backend bind.ContractBackend, _recipient common.Address, _minWithdrawalAmount *big.Int, _withdrawalNetwork uint8) (common.Address, *types.Transaction, *SequencerFeeVault, error) { + parsed, err := SequencerFeeVaultMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(SequencerFeeVaultBin), backend, _recipient, _minWithdrawalAmount, _withdrawalNetwork) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &SequencerFeeVault{SequencerFeeVaultCaller: SequencerFeeVaultCaller{contract: contract}, SequencerFeeVaultTransactor: SequencerFeeVaultTransactor{contract: contract}, SequencerFeeVaultFilterer: SequencerFeeVaultFilterer{contract: contract}}, nil +} + +// SequencerFeeVault is an auto generated Go binding around an Ethereum contract. +type SequencerFeeVault struct { + SequencerFeeVaultCaller // Read-only binding to the contract + SequencerFeeVaultTransactor // Write-only binding to the contract + SequencerFeeVaultFilterer // Log filterer for contract events +} + +// SequencerFeeVaultCaller is an auto generated read-only Go binding around an Ethereum contract. +type SequencerFeeVaultCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SequencerFeeVaultTransactor is an auto generated write-only Go binding around an Ethereum contract. +type SequencerFeeVaultTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SequencerFeeVaultFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type SequencerFeeVaultFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SequencerFeeVaultSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type SequencerFeeVaultSession struct { + Contract *SequencerFeeVault // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// SequencerFeeVaultCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type SequencerFeeVaultCallerSession struct { + Contract *SequencerFeeVaultCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// SequencerFeeVaultTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type SequencerFeeVaultTransactorSession struct { + Contract *SequencerFeeVaultTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// SequencerFeeVaultRaw is an auto generated low-level Go binding around an Ethereum contract. +type SequencerFeeVaultRaw struct { + Contract *SequencerFeeVault // Generic contract binding to access the raw methods on +} + +// SequencerFeeVaultCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type SequencerFeeVaultCallerRaw struct { + Contract *SequencerFeeVaultCaller // Generic read-only contract binding to access the raw methods on +} + +// SequencerFeeVaultTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type SequencerFeeVaultTransactorRaw struct { + Contract *SequencerFeeVaultTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewSequencerFeeVault creates a new instance of SequencerFeeVault, bound to a specific deployed contract. +func NewSequencerFeeVault(address common.Address, backend bind.ContractBackend) (*SequencerFeeVault, error) { + contract, err := bindSequencerFeeVault(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &SequencerFeeVault{SequencerFeeVaultCaller: SequencerFeeVaultCaller{contract: contract}, SequencerFeeVaultTransactor: SequencerFeeVaultTransactor{contract: contract}, SequencerFeeVaultFilterer: SequencerFeeVaultFilterer{contract: contract}}, nil +} + +// NewSequencerFeeVaultCaller creates a new read-only instance of SequencerFeeVault, bound to a specific deployed contract. +func NewSequencerFeeVaultCaller(address common.Address, caller bind.ContractCaller) (*SequencerFeeVaultCaller, error) { + contract, err := bindSequencerFeeVault(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &SequencerFeeVaultCaller{contract: contract}, nil +} + +// NewSequencerFeeVaultTransactor creates a new write-only instance of SequencerFeeVault, bound to a specific deployed contract. +func NewSequencerFeeVaultTransactor(address common.Address, transactor bind.ContractTransactor) (*SequencerFeeVaultTransactor, error) { + contract, err := bindSequencerFeeVault(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &SequencerFeeVaultTransactor{contract: contract}, nil +} + +// NewSequencerFeeVaultFilterer creates a new log filterer instance of SequencerFeeVault, bound to a specific deployed contract. +func NewSequencerFeeVaultFilterer(address common.Address, filterer bind.ContractFilterer) (*SequencerFeeVaultFilterer, error) { + contract, err := bindSequencerFeeVault(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &SequencerFeeVaultFilterer{contract: contract}, nil +} + +// bindSequencerFeeVault binds a generic wrapper to an already deployed contract. +func bindSequencerFeeVault(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(SequencerFeeVaultABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_SequencerFeeVault *SequencerFeeVaultRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _SequencerFeeVault.Contract.SequencerFeeVaultCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_SequencerFeeVault *SequencerFeeVaultRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SequencerFeeVault.Contract.SequencerFeeVaultTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_SequencerFeeVault *SequencerFeeVaultRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _SequencerFeeVault.Contract.SequencerFeeVaultTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_SequencerFeeVault *SequencerFeeVaultCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _SequencerFeeVault.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_SequencerFeeVault *SequencerFeeVaultTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SequencerFeeVault.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_SequencerFeeVault *SequencerFeeVaultTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _SequencerFeeVault.Contract.contract.Transact(opts, method, params...) +} + +// MINWITHDRAWALAMOUNT is a free data retrieval call binding the contract method 0xd3e5792b. +// +// Solidity: function MIN_WITHDRAWAL_AMOUNT() view returns(uint256) +func (_SequencerFeeVault *SequencerFeeVaultCaller) MINWITHDRAWALAMOUNT(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _SequencerFeeVault.contract.Call(opts, &out, "MIN_WITHDRAWAL_AMOUNT") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// MINWITHDRAWALAMOUNT is a free data retrieval call binding the contract method 0xd3e5792b. +// +// Solidity: function MIN_WITHDRAWAL_AMOUNT() view returns(uint256) +func (_SequencerFeeVault *SequencerFeeVaultSession) MINWITHDRAWALAMOUNT() (*big.Int, error) { + return _SequencerFeeVault.Contract.MINWITHDRAWALAMOUNT(&_SequencerFeeVault.CallOpts) +} + +// MINWITHDRAWALAMOUNT is a free data retrieval call binding the contract method 0xd3e5792b. +// +// Solidity: function MIN_WITHDRAWAL_AMOUNT() view returns(uint256) +func (_SequencerFeeVault *SequencerFeeVaultCallerSession) MINWITHDRAWALAMOUNT() (*big.Int, error) { + return _SequencerFeeVault.Contract.MINWITHDRAWALAMOUNT(&_SequencerFeeVault.CallOpts) +} + +// RECIPIENT is a free data retrieval call binding the contract method 0x0d9019e1. +// +// Solidity: function RECIPIENT() view returns(address) +func (_SequencerFeeVault *SequencerFeeVaultCaller) RECIPIENT(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _SequencerFeeVault.contract.Call(opts, &out, "RECIPIENT") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// RECIPIENT is a free data retrieval call binding the contract method 0x0d9019e1. +// +// Solidity: function RECIPIENT() view returns(address) +func (_SequencerFeeVault *SequencerFeeVaultSession) RECIPIENT() (common.Address, error) { + return _SequencerFeeVault.Contract.RECIPIENT(&_SequencerFeeVault.CallOpts) +} + +// RECIPIENT is a free data retrieval call binding the contract method 0x0d9019e1. +// +// Solidity: function RECIPIENT() view returns(address) +func (_SequencerFeeVault *SequencerFeeVaultCallerSession) RECIPIENT() (common.Address, error) { + return _SequencerFeeVault.Contract.RECIPIENT(&_SequencerFeeVault.CallOpts) +} + +// WITHDRAWALNETWORK is a free data retrieval call binding the contract method 0xd0e12f90. +// +// Solidity: function WITHDRAWAL_NETWORK() view returns(uint8) +func (_SequencerFeeVault *SequencerFeeVaultCaller) WITHDRAWALNETWORK(opts *bind.CallOpts) (uint8, error) { + var out []interface{} + err := _SequencerFeeVault.contract.Call(opts, &out, "WITHDRAWAL_NETWORK") + + if err != nil { + return *new(uint8), err + } + + out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) + + return out0, err + +} + +// WITHDRAWALNETWORK is a free data retrieval call binding the contract method 0xd0e12f90. +// +// Solidity: function WITHDRAWAL_NETWORK() view returns(uint8) +func (_SequencerFeeVault *SequencerFeeVaultSession) WITHDRAWALNETWORK() (uint8, error) { + return _SequencerFeeVault.Contract.WITHDRAWALNETWORK(&_SequencerFeeVault.CallOpts) +} + +// WITHDRAWALNETWORK is a free data retrieval call binding the contract method 0xd0e12f90. +// +// Solidity: function WITHDRAWAL_NETWORK() view returns(uint8) +func (_SequencerFeeVault *SequencerFeeVaultCallerSession) WITHDRAWALNETWORK() (uint8, error) { + return _SequencerFeeVault.Contract.WITHDRAWALNETWORK(&_SequencerFeeVault.CallOpts) +} + +// L1FeeWallet is a free data retrieval call binding the contract method 0xd4ff9218. +// +// Solidity: function l1FeeWallet() view returns(address) +func (_SequencerFeeVault *SequencerFeeVaultCaller) L1FeeWallet(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _SequencerFeeVault.contract.Call(opts, &out, "l1FeeWallet") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// L1FeeWallet is a free data retrieval call binding the contract method 0xd4ff9218. +// +// Solidity: function l1FeeWallet() view returns(address) +func (_SequencerFeeVault *SequencerFeeVaultSession) L1FeeWallet() (common.Address, error) { + return _SequencerFeeVault.Contract.L1FeeWallet(&_SequencerFeeVault.CallOpts) +} + +// L1FeeWallet is a free data retrieval call binding the contract method 0xd4ff9218. +// +// Solidity: function l1FeeWallet() view returns(address) +func (_SequencerFeeVault *SequencerFeeVaultCallerSession) L1FeeWallet() (common.Address, error) { + return _SequencerFeeVault.Contract.L1FeeWallet(&_SequencerFeeVault.CallOpts) +} + +// TotalProcessed is a free data retrieval call binding the contract method 0x84411d65. +// +// Solidity: function totalProcessed() view returns(uint256) +func (_SequencerFeeVault *SequencerFeeVaultCaller) TotalProcessed(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _SequencerFeeVault.contract.Call(opts, &out, "totalProcessed") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// TotalProcessed is a free data retrieval call binding the contract method 0x84411d65. +// +// Solidity: function totalProcessed() view returns(uint256) +func (_SequencerFeeVault *SequencerFeeVaultSession) TotalProcessed() (*big.Int, error) { + return _SequencerFeeVault.Contract.TotalProcessed(&_SequencerFeeVault.CallOpts) +} + +// TotalProcessed is a free data retrieval call binding the contract method 0x84411d65. +// +// Solidity: function totalProcessed() view returns(uint256) +func (_SequencerFeeVault *SequencerFeeVaultCallerSession) TotalProcessed() (*big.Int, error) { + return _SequencerFeeVault.Contract.TotalProcessed(&_SequencerFeeVault.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_SequencerFeeVault *SequencerFeeVaultCaller) Version(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _SequencerFeeVault.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 (_SequencerFeeVault *SequencerFeeVaultSession) Version() (string, error) { + return _SequencerFeeVault.Contract.Version(&_SequencerFeeVault.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_SequencerFeeVault *SequencerFeeVaultCallerSession) Version() (string, error) { + return _SequencerFeeVault.Contract.Version(&_SequencerFeeVault.CallOpts) +} + +// Withdraw is a paid mutator transaction binding the contract method 0x3ccfd60b. +// +// Solidity: function withdraw() returns() +func (_SequencerFeeVault *SequencerFeeVaultTransactor) Withdraw(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SequencerFeeVault.contract.Transact(opts, "withdraw") +} + +// Withdraw is a paid mutator transaction binding the contract method 0x3ccfd60b. +// +// Solidity: function withdraw() returns() +func (_SequencerFeeVault *SequencerFeeVaultSession) Withdraw() (*types.Transaction, error) { + return _SequencerFeeVault.Contract.Withdraw(&_SequencerFeeVault.TransactOpts) +} + +// Withdraw is a paid mutator transaction binding the contract method 0x3ccfd60b. +// +// Solidity: function withdraw() returns() +func (_SequencerFeeVault *SequencerFeeVaultTransactorSession) Withdraw() (*types.Transaction, error) { + return _SequencerFeeVault.Contract.Withdraw(&_SequencerFeeVault.TransactOpts) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_SequencerFeeVault *SequencerFeeVaultTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SequencerFeeVault.contract.RawTransact(opts, nil) // calldata is disallowed for receive function +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_SequencerFeeVault *SequencerFeeVaultSession) Receive() (*types.Transaction, error) { + return _SequencerFeeVault.Contract.Receive(&_SequencerFeeVault.TransactOpts) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_SequencerFeeVault *SequencerFeeVaultTransactorSession) Receive() (*types.Transaction, error) { + return _SequencerFeeVault.Contract.Receive(&_SequencerFeeVault.TransactOpts) +} + +// SequencerFeeVaultWithdrawalIterator is returned from FilterWithdrawal and is used to iterate over the raw logs and unpacked data for Withdrawal events raised by the SequencerFeeVault contract. +type SequencerFeeVaultWithdrawalIterator struct { + Event *SequencerFeeVaultWithdrawal // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SequencerFeeVaultWithdrawalIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SequencerFeeVaultWithdrawal) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SequencerFeeVaultWithdrawal) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SequencerFeeVaultWithdrawalIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SequencerFeeVaultWithdrawalIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SequencerFeeVaultWithdrawal represents a Withdrawal event raised by the SequencerFeeVault contract. +type SequencerFeeVaultWithdrawal struct { + Value *big.Int + To common.Address + From common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterWithdrawal is a free log retrieval operation binding the contract event 0xc8a211cc64b6ed1b50595a9fcb1932b6d1e5a6e8ef15b60e5b1f988ea9086bba. +// +// Solidity: event Withdrawal(uint256 value, address to, address from) +func (_SequencerFeeVault *SequencerFeeVaultFilterer) FilterWithdrawal(opts *bind.FilterOpts) (*SequencerFeeVaultWithdrawalIterator, error) { + + logs, sub, err := _SequencerFeeVault.contract.FilterLogs(opts, "Withdrawal") + if err != nil { + return nil, err + } + return &SequencerFeeVaultWithdrawalIterator{contract: _SequencerFeeVault.contract, event: "Withdrawal", logs: logs, sub: sub}, nil +} + +// WatchWithdrawal is a free log subscription operation binding the contract event 0xc8a211cc64b6ed1b50595a9fcb1932b6d1e5a6e8ef15b60e5b1f988ea9086bba. +// +// Solidity: event Withdrawal(uint256 value, address to, address from) +func (_SequencerFeeVault *SequencerFeeVaultFilterer) WatchWithdrawal(opts *bind.WatchOpts, sink chan<- *SequencerFeeVaultWithdrawal) (event.Subscription, error) { + + logs, sub, err := _SequencerFeeVault.contract.WatchLogs(opts, "Withdrawal") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SequencerFeeVaultWithdrawal) + if err := _SequencerFeeVault.contract.UnpackLog(event, "Withdrawal", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseWithdrawal is a log parse operation binding the contract event 0xc8a211cc64b6ed1b50595a9fcb1932b6d1e5a6e8ef15b60e5b1f988ea9086bba. +// +// Solidity: event Withdrawal(uint256 value, address to, address from) +func (_SequencerFeeVault *SequencerFeeVaultFilterer) ParseWithdrawal(log types.Log) (*SequencerFeeVaultWithdrawal, error) { + event := new(SequencerFeeVaultWithdrawal) + if err := _SequencerFeeVault.contract.UnpackLog(event, "Withdrawal", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SequencerFeeVaultWithdrawal0Iterator is returned from FilterWithdrawal0 and is used to iterate over the raw logs and unpacked data for Withdrawal0 events raised by the SequencerFeeVault contract. +type SequencerFeeVaultWithdrawal0Iterator struct { + Event *SequencerFeeVaultWithdrawal0 // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SequencerFeeVaultWithdrawal0Iterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SequencerFeeVaultWithdrawal0) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SequencerFeeVaultWithdrawal0) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SequencerFeeVaultWithdrawal0Iterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SequencerFeeVaultWithdrawal0Iterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SequencerFeeVaultWithdrawal0 represents a Withdrawal0 event raised by the SequencerFeeVault contract. +type SequencerFeeVaultWithdrawal0 struct { + Value *big.Int + To common.Address + From common.Address + WithdrawalNetwork uint8 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterWithdrawal0 is a free log retrieval operation binding the contract event 0x38e04cbeb8c10f8f568618aa75be0f10b6729b8b4237743b4de20cbcde2839ee. +// +// Solidity: event Withdrawal(uint256 value, address to, address from, uint8 withdrawalNetwork) +func (_SequencerFeeVault *SequencerFeeVaultFilterer) FilterWithdrawal0(opts *bind.FilterOpts) (*SequencerFeeVaultWithdrawal0Iterator, error) { + + logs, sub, err := _SequencerFeeVault.contract.FilterLogs(opts, "Withdrawal0") + if err != nil { + return nil, err + } + return &SequencerFeeVaultWithdrawal0Iterator{contract: _SequencerFeeVault.contract, event: "Withdrawal0", logs: logs, sub: sub}, nil +} + +// WatchWithdrawal0 is a free log subscription operation binding the contract event 0x38e04cbeb8c10f8f568618aa75be0f10b6729b8b4237743b4de20cbcde2839ee. +// +// Solidity: event Withdrawal(uint256 value, address to, address from, uint8 withdrawalNetwork) +func (_SequencerFeeVault *SequencerFeeVaultFilterer) WatchWithdrawal0(opts *bind.WatchOpts, sink chan<- *SequencerFeeVaultWithdrawal0) (event.Subscription, error) { + + logs, sub, err := _SequencerFeeVault.contract.WatchLogs(opts, "Withdrawal0") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SequencerFeeVaultWithdrawal0) + if err := _SequencerFeeVault.contract.UnpackLog(event, "Withdrawal0", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseWithdrawal0 is a log parse operation binding the contract event 0x38e04cbeb8c10f8f568618aa75be0f10b6729b8b4237743b4de20cbcde2839ee. +// +// Solidity: event Withdrawal(uint256 value, address to, address from, uint8 withdrawalNetwork) +func (_SequencerFeeVault *SequencerFeeVaultFilterer) ParseWithdrawal0(log types.Log) (*SequencerFeeVaultWithdrawal0, error) { + event := new(SequencerFeeVaultWithdrawal0) + if err := _SequencerFeeVault.contract.UnpackLog(event, "Withdrawal0", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/op-e2e2/bindings/standardbridge.go b/op-e2e2/bindings/standardbridge.go new file mode 100644 index 000000000000..eb5866bb7254 --- /dev/null +++ b/op-e2e2/bindings/standardbridge.go @@ -0,0 +1,1287 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// StandardBridgeMetaData contains all meta data concerning the StandardBridge contract. +var StandardBridgeMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"MESSENGER\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractCrossDomainMessenger\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"OTHER_BRIDGE\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractStandardBridge\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"bridgeERC20\",\"inputs\":[{\"name\":\"_localToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_remoteToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_minGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"_extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"bridgeERC20To\",\"inputs\":[{\"name\":\"_localToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_remoteToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_minGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"_extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"bridgeETH\",\"inputs\":[{\"name\":\"_minGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"_extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"bridgeETHTo\",\"inputs\":[{\"name\":\"_to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_minGasLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"_extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"deposits\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"finalizeBridgeERC20\",\"inputs\":[{\"name\":\"_localToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_remoteToken\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_from\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"finalizeBridgeETH\",\"inputs\":[{\"name\":\"_from\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"messenger\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractCrossDomainMessenger\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"otherBridge\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractStandardBridge\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"paused\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"ERC20BridgeFinalized\",\"inputs\":[{\"name\":\"localToken\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"remoteToken\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"extraData\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ERC20BridgeInitiated\",\"inputs\":[{\"name\":\"localToken\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"remoteToken\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"extraData\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ETHBridgeFinalized\",\"inputs\":[{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"extraData\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ETHBridgeInitiated\",\"inputs\":[{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"extraData\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false}]", +} + +// StandardBridgeABI is the input ABI used to generate the binding from. +// Deprecated: Use StandardBridgeMetaData.ABI instead. +var StandardBridgeABI = StandardBridgeMetaData.ABI + +// StandardBridge is an auto generated Go binding around an Ethereum contract. +type StandardBridge struct { + StandardBridgeCaller // Read-only binding to the contract + StandardBridgeTransactor // Write-only binding to the contract + StandardBridgeFilterer // Log filterer for contract events +} + +// StandardBridgeCaller is an auto generated read-only Go binding around an Ethereum contract. +type StandardBridgeCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// StandardBridgeTransactor is an auto generated write-only Go binding around an Ethereum contract. +type StandardBridgeTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// StandardBridgeFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type StandardBridgeFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// StandardBridgeSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type StandardBridgeSession struct { + Contract *StandardBridge // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// StandardBridgeCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type StandardBridgeCallerSession struct { + Contract *StandardBridgeCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// StandardBridgeTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type StandardBridgeTransactorSession struct { + Contract *StandardBridgeTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// StandardBridgeRaw is an auto generated low-level Go binding around an Ethereum contract. +type StandardBridgeRaw struct { + Contract *StandardBridge // Generic contract binding to access the raw methods on +} + +// StandardBridgeCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type StandardBridgeCallerRaw struct { + Contract *StandardBridgeCaller // Generic read-only contract binding to access the raw methods on +} + +// StandardBridgeTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type StandardBridgeTransactorRaw struct { + Contract *StandardBridgeTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewStandardBridge creates a new instance of StandardBridge, bound to a specific deployed contract. +func NewStandardBridge(address common.Address, backend bind.ContractBackend) (*StandardBridge, error) { + contract, err := bindStandardBridge(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &StandardBridge{StandardBridgeCaller: StandardBridgeCaller{contract: contract}, StandardBridgeTransactor: StandardBridgeTransactor{contract: contract}, StandardBridgeFilterer: StandardBridgeFilterer{contract: contract}}, nil +} + +// NewStandardBridgeCaller creates a new read-only instance of StandardBridge, bound to a specific deployed contract. +func NewStandardBridgeCaller(address common.Address, caller bind.ContractCaller) (*StandardBridgeCaller, error) { + contract, err := bindStandardBridge(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &StandardBridgeCaller{contract: contract}, nil +} + +// NewStandardBridgeTransactor creates a new write-only instance of StandardBridge, bound to a specific deployed contract. +func NewStandardBridgeTransactor(address common.Address, transactor bind.ContractTransactor) (*StandardBridgeTransactor, error) { + contract, err := bindStandardBridge(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &StandardBridgeTransactor{contract: contract}, nil +} + +// NewStandardBridgeFilterer creates a new log filterer instance of StandardBridge, bound to a specific deployed contract. +func NewStandardBridgeFilterer(address common.Address, filterer bind.ContractFilterer) (*StandardBridgeFilterer, error) { + contract, err := bindStandardBridge(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &StandardBridgeFilterer{contract: contract}, nil +} + +// bindStandardBridge binds a generic wrapper to an already deployed contract. +func bindStandardBridge(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(StandardBridgeABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_StandardBridge *StandardBridgeRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _StandardBridge.Contract.StandardBridgeCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_StandardBridge *StandardBridgeRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _StandardBridge.Contract.StandardBridgeTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_StandardBridge *StandardBridgeRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _StandardBridge.Contract.StandardBridgeTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_StandardBridge *StandardBridgeCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _StandardBridge.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_StandardBridge *StandardBridgeTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _StandardBridge.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_StandardBridge *StandardBridgeTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _StandardBridge.Contract.contract.Transact(opts, method, params...) +} + +// MESSENGER is a free data retrieval call binding the contract method 0x927ede2d. +// +// Solidity: function MESSENGER() view returns(address) +func (_StandardBridge *StandardBridgeCaller) MESSENGER(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _StandardBridge.contract.Call(opts, &out, "MESSENGER") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// MESSENGER is a free data retrieval call binding the contract method 0x927ede2d. +// +// Solidity: function MESSENGER() view returns(address) +func (_StandardBridge *StandardBridgeSession) MESSENGER() (common.Address, error) { + return _StandardBridge.Contract.MESSENGER(&_StandardBridge.CallOpts) +} + +// MESSENGER is a free data retrieval call binding the contract method 0x927ede2d. +// +// Solidity: function MESSENGER() view returns(address) +func (_StandardBridge *StandardBridgeCallerSession) MESSENGER() (common.Address, error) { + return _StandardBridge.Contract.MESSENGER(&_StandardBridge.CallOpts) +} + +// OTHERBRIDGE is a free data retrieval call binding the contract method 0x7f46ddb2. +// +// Solidity: function OTHER_BRIDGE() view returns(address) +func (_StandardBridge *StandardBridgeCaller) OTHERBRIDGE(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _StandardBridge.contract.Call(opts, &out, "OTHER_BRIDGE") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// OTHERBRIDGE is a free data retrieval call binding the contract method 0x7f46ddb2. +// +// Solidity: function OTHER_BRIDGE() view returns(address) +func (_StandardBridge *StandardBridgeSession) OTHERBRIDGE() (common.Address, error) { + return _StandardBridge.Contract.OTHERBRIDGE(&_StandardBridge.CallOpts) +} + +// OTHERBRIDGE is a free data retrieval call binding the contract method 0x7f46ddb2. +// +// Solidity: function OTHER_BRIDGE() view returns(address) +func (_StandardBridge *StandardBridgeCallerSession) OTHERBRIDGE() (common.Address, error) { + return _StandardBridge.Contract.OTHERBRIDGE(&_StandardBridge.CallOpts) +} + +// Deposits is a free data retrieval call binding the contract method 0x8f601f66. +// +// Solidity: function deposits(address , address ) view returns(uint256) +func (_StandardBridge *StandardBridgeCaller) Deposits(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address) (*big.Int, error) { + var out []interface{} + err := _StandardBridge.contract.Call(opts, &out, "deposits", arg0, arg1) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Deposits is a free data retrieval call binding the contract method 0x8f601f66. +// +// Solidity: function deposits(address , address ) view returns(uint256) +func (_StandardBridge *StandardBridgeSession) Deposits(arg0 common.Address, arg1 common.Address) (*big.Int, error) { + return _StandardBridge.Contract.Deposits(&_StandardBridge.CallOpts, arg0, arg1) +} + +// Deposits is a free data retrieval call binding the contract method 0x8f601f66. +// +// Solidity: function deposits(address , address ) view returns(uint256) +func (_StandardBridge *StandardBridgeCallerSession) Deposits(arg0 common.Address, arg1 common.Address) (*big.Int, error) { + return _StandardBridge.Contract.Deposits(&_StandardBridge.CallOpts, arg0, arg1) +} + +// Messenger is a free data retrieval call binding the contract method 0x3cb747bf. +// +// Solidity: function messenger() view returns(address) +func (_StandardBridge *StandardBridgeCaller) Messenger(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _StandardBridge.contract.Call(opts, &out, "messenger") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Messenger is a free data retrieval call binding the contract method 0x3cb747bf. +// +// Solidity: function messenger() view returns(address) +func (_StandardBridge *StandardBridgeSession) Messenger() (common.Address, error) { + return _StandardBridge.Contract.Messenger(&_StandardBridge.CallOpts) +} + +// Messenger is a free data retrieval call binding the contract method 0x3cb747bf. +// +// Solidity: function messenger() view returns(address) +func (_StandardBridge *StandardBridgeCallerSession) Messenger() (common.Address, error) { + return _StandardBridge.Contract.Messenger(&_StandardBridge.CallOpts) +} + +// OtherBridge is a free data retrieval call binding the contract method 0xc89701a2. +// +// Solidity: function otherBridge() view returns(address) +func (_StandardBridge *StandardBridgeCaller) OtherBridge(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _StandardBridge.contract.Call(opts, &out, "otherBridge") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// OtherBridge is a free data retrieval call binding the contract method 0xc89701a2. +// +// Solidity: function otherBridge() view returns(address) +func (_StandardBridge *StandardBridgeSession) OtherBridge() (common.Address, error) { + return _StandardBridge.Contract.OtherBridge(&_StandardBridge.CallOpts) +} + +// OtherBridge is a free data retrieval call binding the contract method 0xc89701a2. +// +// Solidity: function otherBridge() view returns(address) +func (_StandardBridge *StandardBridgeCallerSession) OtherBridge() (common.Address, error) { + return _StandardBridge.Contract.OtherBridge(&_StandardBridge.CallOpts) +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool) +func (_StandardBridge *StandardBridgeCaller) Paused(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _StandardBridge.contract.Call(opts, &out, "paused") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool) +func (_StandardBridge *StandardBridgeSession) Paused() (bool, error) { + return _StandardBridge.Contract.Paused(&_StandardBridge.CallOpts) +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool) +func (_StandardBridge *StandardBridgeCallerSession) Paused() (bool, error) { + return _StandardBridge.Contract.Paused(&_StandardBridge.CallOpts) +} + +// BridgeERC20 is a paid mutator transaction binding the contract method 0x87087623. +// +// Solidity: function bridgeERC20(address _localToken, address _remoteToken, uint256 _amount, uint32 _minGasLimit, bytes _extraData) returns() +func (_StandardBridge *StandardBridgeTransactor) BridgeERC20(opts *bind.TransactOpts, _localToken common.Address, _remoteToken common.Address, _amount *big.Int, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _StandardBridge.contract.Transact(opts, "bridgeERC20", _localToken, _remoteToken, _amount, _minGasLimit, _extraData) +} + +// BridgeERC20 is a paid mutator transaction binding the contract method 0x87087623. +// +// Solidity: function bridgeERC20(address _localToken, address _remoteToken, uint256 _amount, uint32 _minGasLimit, bytes _extraData) returns() +func (_StandardBridge *StandardBridgeSession) BridgeERC20(_localToken common.Address, _remoteToken common.Address, _amount *big.Int, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _StandardBridge.Contract.BridgeERC20(&_StandardBridge.TransactOpts, _localToken, _remoteToken, _amount, _minGasLimit, _extraData) +} + +// BridgeERC20 is a paid mutator transaction binding the contract method 0x87087623. +// +// Solidity: function bridgeERC20(address _localToken, address _remoteToken, uint256 _amount, uint32 _minGasLimit, bytes _extraData) returns() +func (_StandardBridge *StandardBridgeTransactorSession) BridgeERC20(_localToken common.Address, _remoteToken common.Address, _amount *big.Int, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _StandardBridge.Contract.BridgeERC20(&_StandardBridge.TransactOpts, _localToken, _remoteToken, _amount, _minGasLimit, _extraData) +} + +// BridgeERC20To is a paid mutator transaction binding the contract method 0x540abf73. +// +// Solidity: function bridgeERC20To(address _localToken, address _remoteToken, address _to, uint256 _amount, uint32 _minGasLimit, bytes _extraData) returns() +func (_StandardBridge *StandardBridgeTransactor) BridgeERC20To(opts *bind.TransactOpts, _localToken common.Address, _remoteToken common.Address, _to common.Address, _amount *big.Int, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _StandardBridge.contract.Transact(opts, "bridgeERC20To", _localToken, _remoteToken, _to, _amount, _minGasLimit, _extraData) +} + +// BridgeERC20To is a paid mutator transaction binding the contract method 0x540abf73. +// +// Solidity: function bridgeERC20To(address _localToken, address _remoteToken, address _to, uint256 _amount, uint32 _minGasLimit, bytes _extraData) returns() +func (_StandardBridge *StandardBridgeSession) BridgeERC20To(_localToken common.Address, _remoteToken common.Address, _to common.Address, _amount *big.Int, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _StandardBridge.Contract.BridgeERC20To(&_StandardBridge.TransactOpts, _localToken, _remoteToken, _to, _amount, _minGasLimit, _extraData) +} + +// BridgeERC20To is a paid mutator transaction binding the contract method 0x540abf73. +// +// Solidity: function bridgeERC20To(address _localToken, address _remoteToken, address _to, uint256 _amount, uint32 _minGasLimit, bytes _extraData) returns() +func (_StandardBridge *StandardBridgeTransactorSession) BridgeERC20To(_localToken common.Address, _remoteToken common.Address, _to common.Address, _amount *big.Int, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _StandardBridge.Contract.BridgeERC20To(&_StandardBridge.TransactOpts, _localToken, _remoteToken, _to, _amount, _minGasLimit, _extraData) +} + +// BridgeETH is a paid mutator transaction binding the contract method 0x09fc8843. +// +// Solidity: function bridgeETH(uint32 _minGasLimit, bytes _extraData) payable returns() +func (_StandardBridge *StandardBridgeTransactor) BridgeETH(opts *bind.TransactOpts, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _StandardBridge.contract.Transact(opts, "bridgeETH", _minGasLimit, _extraData) +} + +// BridgeETH is a paid mutator transaction binding the contract method 0x09fc8843. +// +// Solidity: function bridgeETH(uint32 _minGasLimit, bytes _extraData) payable returns() +func (_StandardBridge *StandardBridgeSession) BridgeETH(_minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _StandardBridge.Contract.BridgeETH(&_StandardBridge.TransactOpts, _minGasLimit, _extraData) +} + +// BridgeETH is a paid mutator transaction binding the contract method 0x09fc8843. +// +// Solidity: function bridgeETH(uint32 _minGasLimit, bytes _extraData) payable returns() +func (_StandardBridge *StandardBridgeTransactorSession) BridgeETH(_minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _StandardBridge.Contract.BridgeETH(&_StandardBridge.TransactOpts, _minGasLimit, _extraData) +} + +// BridgeETHTo is a paid mutator transaction binding the contract method 0xe11013dd. +// +// Solidity: function bridgeETHTo(address _to, uint32 _minGasLimit, bytes _extraData) payable returns() +func (_StandardBridge *StandardBridgeTransactor) BridgeETHTo(opts *bind.TransactOpts, _to common.Address, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _StandardBridge.contract.Transact(opts, "bridgeETHTo", _to, _minGasLimit, _extraData) +} + +// BridgeETHTo is a paid mutator transaction binding the contract method 0xe11013dd. +// +// Solidity: function bridgeETHTo(address _to, uint32 _minGasLimit, bytes _extraData) payable returns() +func (_StandardBridge *StandardBridgeSession) BridgeETHTo(_to common.Address, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _StandardBridge.Contract.BridgeETHTo(&_StandardBridge.TransactOpts, _to, _minGasLimit, _extraData) +} + +// BridgeETHTo is a paid mutator transaction binding the contract method 0xe11013dd. +// +// Solidity: function bridgeETHTo(address _to, uint32 _minGasLimit, bytes _extraData) payable returns() +func (_StandardBridge *StandardBridgeTransactorSession) BridgeETHTo(_to common.Address, _minGasLimit uint32, _extraData []byte) (*types.Transaction, error) { + return _StandardBridge.Contract.BridgeETHTo(&_StandardBridge.TransactOpts, _to, _minGasLimit, _extraData) +} + +// FinalizeBridgeERC20 is a paid mutator transaction binding the contract method 0x0166a07a. +// +// Solidity: function finalizeBridgeERC20(address _localToken, address _remoteToken, address _from, address _to, uint256 _amount, bytes _extraData) returns() +func (_StandardBridge *StandardBridgeTransactor) FinalizeBridgeERC20(opts *bind.TransactOpts, _localToken common.Address, _remoteToken common.Address, _from common.Address, _to common.Address, _amount *big.Int, _extraData []byte) (*types.Transaction, error) { + return _StandardBridge.contract.Transact(opts, "finalizeBridgeERC20", _localToken, _remoteToken, _from, _to, _amount, _extraData) +} + +// FinalizeBridgeERC20 is a paid mutator transaction binding the contract method 0x0166a07a. +// +// Solidity: function finalizeBridgeERC20(address _localToken, address _remoteToken, address _from, address _to, uint256 _amount, bytes _extraData) returns() +func (_StandardBridge *StandardBridgeSession) FinalizeBridgeERC20(_localToken common.Address, _remoteToken common.Address, _from common.Address, _to common.Address, _amount *big.Int, _extraData []byte) (*types.Transaction, error) { + return _StandardBridge.Contract.FinalizeBridgeERC20(&_StandardBridge.TransactOpts, _localToken, _remoteToken, _from, _to, _amount, _extraData) +} + +// FinalizeBridgeERC20 is a paid mutator transaction binding the contract method 0x0166a07a. +// +// Solidity: function finalizeBridgeERC20(address _localToken, address _remoteToken, address _from, address _to, uint256 _amount, bytes _extraData) returns() +func (_StandardBridge *StandardBridgeTransactorSession) FinalizeBridgeERC20(_localToken common.Address, _remoteToken common.Address, _from common.Address, _to common.Address, _amount *big.Int, _extraData []byte) (*types.Transaction, error) { + return _StandardBridge.Contract.FinalizeBridgeERC20(&_StandardBridge.TransactOpts, _localToken, _remoteToken, _from, _to, _amount, _extraData) +} + +// FinalizeBridgeETH is a paid mutator transaction binding the contract method 0x1635f5fd. +// +// Solidity: function finalizeBridgeETH(address _from, address _to, uint256 _amount, bytes _extraData) payable returns() +func (_StandardBridge *StandardBridgeTransactor) FinalizeBridgeETH(opts *bind.TransactOpts, _from common.Address, _to common.Address, _amount *big.Int, _extraData []byte) (*types.Transaction, error) { + return _StandardBridge.contract.Transact(opts, "finalizeBridgeETH", _from, _to, _amount, _extraData) +} + +// FinalizeBridgeETH is a paid mutator transaction binding the contract method 0x1635f5fd. +// +// Solidity: function finalizeBridgeETH(address _from, address _to, uint256 _amount, bytes _extraData) payable returns() +func (_StandardBridge *StandardBridgeSession) FinalizeBridgeETH(_from common.Address, _to common.Address, _amount *big.Int, _extraData []byte) (*types.Transaction, error) { + return _StandardBridge.Contract.FinalizeBridgeETH(&_StandardBridge.TransactOpts, _from, _to, _amount, _extraData) +} + +// FinalizeBridgeETH is a paid mutator transaction binding the contract method 0x1635f5fd. +// +// Solidity: function finalizeBridgeETH(address _from, address _to, uint256 _amount, bytes _extraData) payable returns() +func (_StandardBridge *StandardBridgeTransactorSession) FinalizeBridgeETH(_from common.Address, _to common.Address, _amount *big.Int, _extraData []byte) (*types.Transaction, error) { + return _StandardBridge.Contract.FinalizeBridgeETH(&_StandardBridge.TransactOpts, _from, _to, _amount, _extraData) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_StandardBridge *StandardBridgeTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { + return _StandardBridge.contract.RawTransact(opts, nil) // calldata is disallowed for receive function +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_StandardBridge *StandardBridgeSession) Receive() (*types.Transaction, error) { + return _StandardBridge.Contract.Receive(&_StandardBridge.TransactOpts) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_StandardBridge *StandardBridgeTransactorSession) Receive() (*types.Transaction, error) { + return _StandardBridge.Contract.Receive(&_StandardBridge.TransactOpts) +} + +// StandardBridgeERC20BridgeFinalizedIterator is returned from FilterERC20BridgeFinalized and is used to iterate over the raw logs and unpacked data for ERC20BridgeFinalized events raised by the StandardBridge contract. +type StandardBridgeERC20BridgeFinalizedIterator struct { + Event *StandardBridgeERC20BridgeFinalized // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *StandardBridgeERC20BridgeFinalizedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(StandardBridgeERC20BridgeFinalized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(StandardBridgeERC20BridgeFinalized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *StandardBridgeERC20BridgeFinalizedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *StandardBridgeERC20BridgeFinalizedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// StandardBridgeERC20BridgeFinalized represents a ERC20BridgeFinalized event raised by the StandardBridge contract. +type StandardBridgeERC20BridgeFinalized struct { + LocalToken common.Address + RemoteToken common.Address + From common.Address + To common.Address + Amount *big.Int + ExtraData []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterERC20BridgeFinalized is a free log retrieval operation binding the contract event 0xd59c65b35445225835c83f50b6ede06a7be047d22e357073e250d9af537518cd. +// +// Solidity: event ERC20BridgeFinalized(address indexed localToken, address indexed remoteToken, address indexed from, address to, uint256 amount, bytes extraData) +func (_StandardBridge *StandardBridgeFilterer) FilterERC20BridgeFinalized(opts *bind.FilterOpts, localToken []common.Address, remoteToken []common.Address, from []common.Address) (*StandardBridgeERC20BridgeFinalizedIterator, error) { + + var localTokenRule []interface{} + for _, localTokenItem := range localToken { + localTokenRule = append(localTokenRule, localTokenItem) + } + var remoteTokenRule []interface{} + for _, remoteTokenItem := range remoteToken { + remoteTokenRule = append(remoteTokenRule, remoteTokenItem) + } + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + + logs, sub, err := _StandardBridge.contract.FilterLogs(opts, "ERC20BridgeFinalized", localTokenRule, remoteTokenRule, fromRule) + if err != nil { + return nil, err + } + return &StandardBridgeERC20BridgeFinalizedIterator{contract: _StandardBridge.contract, event: "ERC20BridgeFinalized", logs: logs, sub: sub}, nil +} + +// WatchERC20BridgeFinalized is a free log subscription operation binding the contract event 0xd59c65b35445225835c83f50b6ede06a7be047d22e357073e250d9af537518cd. +// +// Solidity: event ERC20BridgeFinalized(address indexed localToken, address indexed remoteToken, address indexed from, address to, uint256 amount, bytes extraData) +func (_StandardBridge *StandardBridgeFilterer) WatchERC20BridgeFinalized(opts *bind.WatchOpts, sink chan<- *StandardBridgeERC20BridgeFinalized, localToken []common.Address, remoteToken []common.Address, from []common.Address) (event.Subscription, error) { + + var localTokenRule []interface{} + for _, localTokenItem := range localToken { + localTokenRule = append(localTokenRule, localTokenItem) + } + var remoteTokenRule []interface{} + for _, remoteTokenItem := range remoteToken { + remoteTokenRule = append(remoteTokenRule, remoteTokenItem) + } + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + + logs, sub, err := _StandardBridge.contract.WatchLogs(opts, "ERC20BridgeFinalized", localTokenRule, remoteTokenRule, fromRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(StandardBridgeERC20BridgeFinalized) + if err := _StandardBridge.contract.UnpackLog(event, "ERC20BridgeFinalized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseERC20BridgeFinalized is a log parse operation binding the contract event 0xd59c65b35445225835c83f50b6ede06a7be047d22e357073e250d9af537518cd. +// +// Solidity: event ERC20BridgeFinalized(address indexed localToken, address indexed remoteToken, address indexed from, address to, uint256 amount, bytes extraData) +func (_StandardBridge *StandardBridgeFilterer) ParseERC20BridgeFinalized(log types.Log) (*StandardBridgeERC20BridgeFinalized, error) { + event := new(StandardBridgeERC20BridgeFinalized) + if err := _StandardBridge.contract.UnpackLog(event, "ERC20BridgeFinalized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// StandardBridgeERC20BridgeInitiatedIterator is returned from FilterERC20BridgeInitiated and is used to iterate over the raw logs and unpacked data for ERC20BridgeInitiated events raised by the StandardBridge contract. +type StandardBridgeERC20BridgeInitiatedIterator struct { + Event *StandardBridgeERC20BridgeInitiated // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *StandardBridgeERC20BridgeInitiatedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(StandardBridgeERC20BridgeInitiated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(StandardBridgeERC20BridgeInitiated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *StandardBridgeERC20BridgeInitiatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *StandardBridgeERC20BridgeInitiatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// StandardBridgeERC20BridgeInitiated represents a ERC20BridgeInitiated event raised by the StandardBridge contract. +type StandardBridgeERC20BridgeInitiated struct { + LocalToken common.Address + RemoteToken common.Address + From common.Address + To common.Address + Amount *big.Int + ExtraData []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterERC20BridgeInitiated is a free log retrieval operation binding the contract event 0x7ff126db8024424bbfd9826e8ab82ff59136289ea440b04b39a0df1b03b9cabf. +// +// Solidity: event ERC20BridgeInitiated(address indexed localToken, address indexed remoteToken, address indexed from, address to, uint256 amount, bytes extraData) +func (_StandardBridge *StandardBridgeFilterer) FilterERC20BridgeInitiated(opts *bind.FilterOpts, localToken []common.Address, remoteToken []common.Address, from []common.Address) (*StandardBridgeERC20BridgeInitiatedIterator, error) { + + var localTokenRule []interface{} + for _, localTokenItem := range localToken { + localTokenRule = append(localTokenRule, localTokenItem) + } + var remoteTokenRule []interface{} + for _, remoteTokenItem := range remoteToken { + remoteTokenRule = append(remoteTokenRule, remoteTokenItem) + } + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + + logs, sub, err := _StandardBridge.contract.FilterLogs(opts, "ERC20BridgeInitiated", localTokenRule, remoteTokenRule, fromRule) + if err != nil { + return nil, err + } + return &StandardBridgeERC20BridgeInitiatedIterator{contract: _StandardBridge.contract, event: "ERC20BridgeInitiated", logs: logs, sub: sub}, nil +} + +// WatchERC20BridgeInitiated is a free log subscription operation binding the contract event 0x7ff126db8024424bbfd9826e8ab82ff59136289ea440b04b39a0df1b03b9cabf. +// +// Solidity: event ERC20BridgeInitiated(address indexed localToken, address indexed remoteToken, address indexed from, address to, uint256 amount, bytes extraData) +func (_StandardBridge *StandardBridgeFilterer) WatchERC20BridgeInitiated(opts *bind.WatchOpts, sink chan<- *StandardBridgeERC20BridgeInitiated, localToken []common.Address, remoteToken []common.Address, from []common.Address) (event.Subscription, error) { + + var localTokenRule []interface{} + for _, localTokenItem := range localToken { + localTokenRule = append(localTokenRule, localTokenItem) + } + var remoteTokenRule []interface{} + for _, remoteTokenItem := range remoteToken { + remoteTokenRule = append(remoteTokenRule, remoteTokenItem) + } + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + + logs, sub, err := _StandardBridge.contract.WatchLogs(opts, "ERC20BridgeInitiated", localTokenRule, remoteTokenRule, fromRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(StandardBridgeERC20BridgeInitiated) + if err := _StandardBridge.contract.UnpackLog(event, "ERC20BridgeInitiated", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseERC20BridgeInitiated is a log parse operation binding the contract event 0x7ff126db8024424bbfd9826e8ab82ff59136289ea440b04b39a0df1b03b9cabf. +// +// Solidity: event ERC20BridgeInitiated(address indexed localToken, address indexed remoteToken, address indexed from, address to, uint256 amount, bytes extraData) +func (_StandardBridge *StandardBridgeFilterer) ParseERC20BridgeInitiated(log types.Log) (*StandardBridgeERC20BridgeInitiated, error) { + event := new(StandardBridgeERC20BridgeInitiated) + if err := _StandardBridge.contract.UnpackLog(event, "ERC20BridgeInitiated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// StandardBridgeETHBridgeFinalizedIterator is returned from FilterETHBridgeFinalized and is used to iterate over the raw logs and unpacked data for ETHBridgeFinalized events raised by the StandardBridge contract. +type StandardBridgeETHBridgeFinalizedIterator struct { + Event *StandardBridgeETHBridgeFinalized // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *StandardBridgeETHBridgeFinalizedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(StandardBridgeETHBridgeFinalized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(StandardBridgeETHBridgeFinalized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *StandardBridgeETHBridgeFinalizedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *StandardBridgeETHBridgeFinalizedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// StandardBridgeETHBridgeFinalized represents a ETHBridgeFinalized event raised by the StandardBridge contract. +type StandardBridgeETHBridgeFinalized struct { + From common.Address + To common.Address + Amount *big.Int + ExtraData []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterETHBridgeFinalized is a free log retrieval operation binding the contract event 0x31b2166ff604fc5672ea5df08a78081d2bc6d746cadce880747f3643d819e83d. +// +// Solidity: event ETHBridgeFinalized(address indexed from, address indexed to, uint256 amount, bytes extraData) +func (_StandardBridge *StandardBridgeFilterer) FilterETHBridgeFinalized(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*StandardBridgeETHBridgeFinalizedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _StandardBridge.contract.FilterLogs(opts, "ETHBridgeFinalized", fromRule, toRule) + if err != nil { + return nil, err + } + return &StandardBridgeETHBridgeFinalizedIterator{contract: _StandardBridge.contract, event: "ETHBridgeFinalized", logs: logs, sub: sub}, nil +} + +// WatchETHBridgeFinalized is a free log subscription operation binding the contract event 0x31b2166ff604fc5672ea5df08a78081d2bc6d746cadce880747f3643d819e83d. +// +// Solidity: event ETHBridgeFinalized(address indexed from, address indexed to, uint256 amount, bytes extraData) +func (_StandardBridge *StandardBridgeFilterer) WatchETHBridgeFinalized(opts *bind.WatchOpts, sink chan<- *StandardBridgeETHBridgeFinalized, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _StandardBridge.contract.WatchLogs(opts, "ETHBridgeFinalized", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(StandardBridgeETHBridgeFinalized) + if err := _StandardBridge.contract.UnpackLog(event, "ETHBridgeFinalized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseETHBridgeFinalized is a log parse operation binding the contract event 0x31b2166ff604fc5672ea5df08a78081d2bc6d746cadce880747f3643d819e83d. +// +// Solidity: event ETHBridgeFinalized(address indexed from, address indexed to, uint256 amount, bytes extraData) +func (_StandardBridge *StandardBridgeFilterer) ParseETHBridgeFinalized(log types.Log) (*StandardBridgeETHBridgeFinalized, error) { + event := new(StandardBridgeETHBridgeFinalized) + if err := _StandardBridge.contract.UnpackLog(event, "ETHBridgeFinalized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// StandardBridgeETHBridgeInitiatedIterator is returned from FilterETHBridgeInitiated and is used to iterate over the raw logs and unpacked data for ETHBridgeInitiated events raised by the StandardBridge contract. +type StandardBridgeETHBridgeInitiatedIterator struct { + Event *StandardBridgeETHBridgeInitiated // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *StandardBridgeETHBridgeInitiatedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(StandardBridgeETHBridgeInitiated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(StandardBridgeETHBridgeInitiated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *StandardBridgeETHBridgeInitiatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *StandardBridgeETHBridgeInitiatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// StandardBridgeETHBridgeInitiated represents a ETHBridgeInitiated event raised by the StandardBridge contract. +type StandardBridgeETHBridgeInitiated struct { + From common.Address + To common.Address + Amount *big.Int + ExtraData []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterETHBridgeInitiated is a free log retrieval operation binding the contract event 0x2849b43074093a05396b6f2a937dee8565b15a48a7b3d4bffb732a5017380af5. +// +// Solidity: event ETHBridgeInitiated(address indexed from, address indexed to, uint256 amount, bytes extraData) +func (_StandardBridge *StandardBridgeFilterer) FilterETHBridgeInitiated(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*StandardBridgeETHBridgeInitiatedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _StandardBridge.contract.FilterLogs(opts, "ETHBridgeInitiated", fromRule, toRule) + if err != nil { + return nil, err + } + return &StandardBridgeETHBridgeInitiatedIterator{contract: _StandardBridge.contract, event: "ETHBridgeInitiated", logs: logs, sub: sub}, nil +} + +// WatchETHBridgeInitiated is a free log subscription operation binding the contract event 0x2849b43074093a05396b6f2a937dee8565b15a48a7b3d4bffb732a5017380af5. +// +// Solidity: event ETHBridgeInitiated(address indexed from, address indexed to, uint256 amount, bytes extraData) +func (_StandardBridge *StandardBridgeFilterer) WatchETHBridgeInitiated(opts *bind.WatchOpts, sink chan<- *StandardBridgeETHBridgeInitiated, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _StandardBridge.contract.WatchLogs(opts, "ETHBridgeInitiated", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(StandardBridgeETHBridgeInitiated) + if err := _StandardBridge.contract.UnpackLog(event, "ETHBridgeInitiated", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseETHBridgeInitiated is a log parse operation binding the contract event 0x2849b43074093a05396b6f2a937dee8565b15a48a7b3d4bffb732a5017380af5. +// +// Solidity: event ETHBridgeInitiated(address indexed from, address indexed to, uint256 amount, bytes extraData) +func (_StandardBridge *StandardBridgeFilterer) ParseETHBridgeInitiated(log types.Log) (*StandardBridgeETHBridgeInitiated, error) { + event := new(StandardBridgeETHBridgeInitiated) + if err := _StandardBridge.contract.UnpackLog(event, "ETHBridgeInitiated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// StandardBridgeInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the StandardBridge contract. +type StandardBridgeInitializedIterator struct { + Event *StandardBridgeInitialized // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *StandardBridgeInitializedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(StandardBridgeInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(StandardBridgeInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *StandardBridgeInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *StandardBridgeInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// StandardBridgeInitialized represents a Initialized event raised by the StandardBridge contract. +type StandardBridgeInitialized struct { + Version uint8 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_StandardBridge *StandardBridgeFilterer) FilterInitialized(opts *bind.FilterOpts) (*StandardBridgeInitializedIterator, error) { + + logs, sub, err := _StandardBridge.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &StandardBridgeInitializedIterator{contract: _StandardBridge.contract, event: "Initialized", logs: logs, sub: sub}, nil +} + +// WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_StandardBridge *StandardBridgeFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *StandardBridgeInitialized) (event.Subscription, error) { + + logs, sub, err := _StandardBridge.contract.WatchLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(StandardBridgeInitialized) + if err := _StandardBridge.contract.UnpackLog(event, "Initialized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_StandardBridge *StandardBridgeFilterer) ParseInitialized(log types.Log) (*StandardBridgeInitialized, error) { + event := new(StandardBridgeInitialized) + if err := _StandardBridge.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/op-e2e2/bindings/storagesetter.go b/op-e2e2/bindings/storagesetter.go new file mode 100644 index 000000000000..72f36d8cfd2d --- /dev/null +++ b/op-e2e2/bindings/storagesetter.go @@ -0,0 +1,468 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// StorageSetterSlot is an auto generated low-level Go binding around an user-defined struct. +type StorageSetterSlot struct { + Key [32]byte + Value [32]byte +} + +// StorageSetterMetaData contains all meta data concerning the StorageSetter contract. +var StorageSetterMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"function\",\"name\":\"getAddress\",\"inputs\":[{\"name\":\"_slot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"addr_\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getBool\",\"inputs\":[{\"name\":\"_slot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"value_\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getBytes32\",\"inputs\":[{\"name\":\"_slot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"value_\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getUint\",\"inputs\":[{\"name\":\"_slot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"value_\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"setAddress\",\"inputs\":[{\"name\":\"_slot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_address\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setBool\",\"inputs\":[{\"name\":\"_slot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_value\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setBytes32\",\"inputs\":[{\"name\":\"slots\",\"type\":\"tuple[]\",\"internalType\":\"structStorageSetter.Slot[]\",\"components\":[{\"name\":\"key\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"value\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setBytes32\",\"inputs\":[{\"name\":\"_slot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_value\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setUint\",\"inputs\":[{\"name\":\"_slot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_value\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"}]", + Bin: "0x608060405234801561001057600080fd5b5061046a806100206000396000f3fe608060405234801561001057600080fd5b50600436106100be5760003560e01c8063a6ed563e11610076578063bd02d0f51161005b578063bd02d0f51461018e578063ca446dd9146101b8578063e2a4853a1461011557600080fd5b8063a6ed563e1461018e578063abfdcced146101aa57600080fd5b80634e91db08116100a75780634e91db081461011557806354fd4d50146101275780637ae1cfca1461017057600080fd5b80630528afe2146100c357806321f8a721146100d8575b600080fd5b6100d66100d1366004610239565b6101c6565b005b6100eb6100e63660046102ae565b610229565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100d66101233660046102c7565b9055565b6101636040518060400160405280600581526020017f312e322e3000000000000000000000000000000000000000000000000000000081525081565b60405161010c91906102e9565b61017e6100e63660046102ae565b604051901515815260200161010c565b61019c6100e63660046102ae565b60405190815260200161010c565b6100d661012336600461035c565b6100d6610123366004610391565b8060005b81811015610223576102118484838181106101e7576101e76103cf565b90506040020160000135858584818110610203576102036103cf565b905060400201602001359055565b8061021b816103fe565b9150506101ca565b50505050565b6000610233825490565b92915050565b6000806020838503121561024c57600080fd5b823567ffffffffffffffff8082111561026457600080fd5b818501915085601f83011261027857600080fd5b81358181111561028757600080fd5b8660208260061b850101111561029c57600080fd5b60209290920196919550909350505050565b6000602082840312156102c057600080fd5b5035919050565b600080604083850312156102da57600080fd5b50508035926020909101359150565b600060208083528351808285015260005b81811015610316578581018301518582016040015282016102fa565b81811115610328576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b6000806040838503121561036f57600080fd5b823591506020830135801515811461038657600080fd5b809150509250929050565b600080604083850312156103a457600080fd5b82359150602083013573ffffffffffffffffffffffffffffffffffffffff8116811461038657600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610456577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b506001019056fea164736f6c634300080f000a", +} + +// StorageSetterABI is the input ABI used to generate the binding from. +// Deprecated: Use StorageSetterMetaData.ABI instead. +var StorageSetterABI = StorageSetterMetaData.ABI + +// StorageSetterBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use StorageSetterMetaData.Bin instead. +var StorageSetterBin = StorageSetterMetaData.Bin + +// DeployStorageSetter deploys a new Ethereum contract, binding an instance of StorageSetter to it. +func DeployStorageSetter(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *StorageSetter, error) { + parsed, err := StorageSetterMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(StorageSetterBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &StorageSetter{StorageSetterCaller: StorageSetterCaller{contract: contract}, StorageSetterTransactor: StorageSetterTransactor{contract: contract}, StorageSetterFilterer: StorageSetterFilterer{contract: contract}}, nil +} + +// StorageSetter is an auto generated Go binding around an Ethereum contract. +type StorageSetter struct { + StorageSetterCaller // Read-only binding to the contract + StorageSetterTransactor // Write-only binding to the contract + StorageSetterFilterer // Log filterer for contract events +} + +// StorageSetterCaller is an auto generated read-only Go binding around an Ethereum contract. +type StorageSetterCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// StorageSetterTransactor is an auto generated write-only Go binding around an Ethereum contract. +type StorageSetterTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// StorageSetterFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type StorageSetterFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// StorageSetterSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type StorageSetterSession struct { + Contract *StorageSetter // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// StorageSetterCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type StorageSetterCallerSession struct { + Contract *StorageSetterCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// StorageSetterTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type StorageSetterTransactorSession struct { + Contract *StorageSetterTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// StorageSetterRaw is an auto generated low-level Go binding around an Ethereum contract. +type StorageSetterRaw struct { + Contract *StorageSetter // Generic contract binding to access the raw methods on +} + +// StorageSetterCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type StorageSetterCallerRaw struct { + Contract *StorageSetterCaller // Generic read-only contract binding to access the raw methods on +} + +// StorageSetterTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type StorageSetterTransactorRaw struct { + Contract *StorageSetterTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewStorageSetter creates a new instance of StorageSetter, bound to a specific deployed contract. +func NewStorageSetter(address common.Address, backend bind.ContractBackend) (*StorageSetter, error) { + contract, err := bindStorageSetter(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &StorageSetter{StorageSetterCaller: StorageSetterCaller{contract: contract}, StorageSetterTransactor: StorageSetterTransactor{contract: contract}, StorageSetterFilterer: StorageSetterFilterer{contract: contract}}, nil +} + +// NewStorageSetterCaller creates a new read-only instance of StorageSetter, bound to a specific deployed contract. +func NewStorageSetterCaller(address common.Address, caller bind.ContractCaller) (*StorageSetterCaller, error) { + contract, err := bindStorageSetter(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &StorageSetterCaller{contract: contract}, nil +} + +// NewStorageSetterTransactor creates a new write-only instance of StorageSetter, bound to a specific deployed contract. +func NewStorageSetterTransactor(address common.Address, transactor bind.ContractTransactor) (*StorageSetterTransactor, error) { + contract, err := bindStorageSetter(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &StorageSetterTransactor{contract: contract}, nil +} + +// NewStorageSetterFilterer creates a new log filterer instance of StorageSetter, bound to a specific deployed contract. +func NewStorageSetterFilterer(address common.Address, filterer bind.ContractFilterer) (*StorageSetterFilterer, error) { + contract, err := bindStorageSetter(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &StorageSetterFilterer{contract: contract}, nil +} + +// bindStorageSetter binds a generic wrapper to an already deployed contract. +func bindStorageSetter(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(StorageSetterABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_StorageSetter *StorageSetterRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _StorageSetter.Contract.StorageSetterCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_StorageSetter *StorageSetterRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _StorageSetter.Contract.StorageSetterTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_StorageSetter *StorageSetterRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _StorageSetter.Contract.StorageSetterTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_StorageSetter *StorageSetterCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _StorageSetter.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_StorageSetter *StorageSetterTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _StorageSetter.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_StorageSetter *StorageSetterTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _StorageSetter.Contract.contract.Transact(opts, method, params...) +} + +// GetAddress is a free data retrieval call binding the contract method 0x21f8a721. +// +// Solidity: function getAddress(bytes32 _slot) view returns(address addr_) +func (_StorageSetter *StorageSetterCaller) GetAddress(opts *bind.CallOpts, _slot [32]byte) (common.Address, error) { + var out []interface{} + err := _StorageSetter.contract.Call(opts, &out, "getAddress", _slot) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// GetAddress is a free data retrieval call binding the contract method 0x21f8a721. +// +// Solidity: function getAddress(bytes32 _slot) view returns(address addr_) +func (_StorageSetter *StorageSetterSession) GetAddress(_slot [32]byte) (common.Address, error) { + return _StorageSetter.Contract.GetAddress(&_StorageSetter.CallOpts, _slot) +} + +// GetAddress is a free data retrieval call binding the contract method 0x21f8a721. +// +// Solidity: function getAddress(bytes32 _slot) view returns(address addr_) +func (_StorageSetter *StorageSetterCallerSession) GetAddress(_slot [32]byte) (common.Address, error) { + return _StorageSetter.Contract.GetAddress(&_StorageSetter.CallOpts, _slot) +} + +// GetBool is a free data retrieval call binding the contract method 0x7ae1cfca. +// +// Solidity: function getBool(bytes32 _slot) view returns(bool value_) +func (_StorageSetter *StorageSetterCaller) GetBool(opts *bind.CallOpts, _slot [32]byte) (bool, error) { + var out []interface{} + err := _StorageSetter.contract.Call(opts, &out, "getBool", _slot) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// GetBool is a free data retrieval call binding the contract method 0x7ae1cfca. +// +// Solidity: function getBool(bytes32 _slot) view returns(bool value_) +func (_StorageSetter *StorageSetterSession) GetBool(_slot [32]byte) (bool, error) { + return _StorageSetter.Contract.GetBool(&_StorageSetter.CallOpts, _slot) +} + +// GetBool is a free data retrieval call binding the contract method 0x7ae1cfca. +// +// Solidity: function getBool(bytes32 _slot) view returns(bool value_) +func (_StorageSetter *StorageSetterCallerSession) GetBool(_slot [32]byte) (bool, error) { + return _StorageSetter.Contract.GetBool(&_StorageSetter.CallOpts, _slot) +} + +// GetBytes32 is a free data retrieval call binding the contract method 0xa6ed563e. +// +// Solidity: function getBytes32(bytes32 _slot) view returns(bytes32 value_) +func (_StorageSetter *StorageSetterCaller) GetBytes32(opts *bind.CallOpts, _slot [32]byte) ([32]byte, error) { + var out []interface{} + err := _StorageSetter.contract.Call(opts, &out, "getBytes32", _slot) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// GetBytes32 is a free data retrieval call binding the contract method 0xa6ed563e. +// +// Solidity: function getBytes32(bytes32 _slot) view returns(bytes32 value_) +func (_StorageSetter *StorageSetterSession) GetBytes32(_slot [32]byte) ([32]byte, error) { + return _StorageSetter.Contract.GetBytes32(&_StorageSetter.CallOpts, _slot) +} + +// GetBytes32 is a free data retrieval call binding the contract method 0xa6ed563e. +// +// Solidity: function getBytes32(bytes32 _slot) view returns(bytes32 value_) +func (_StorageSetter *StorageSetterCallerSession) GetBytes32(_slot [32]byte) ([32]byte, error) { + return _StorageSetter.Contract.GetBytes32(&_StorageSetter.CallOpts, _slot) +} + +// GetUint is a free data retrieval call binding the contract method 0xbd02d0f5. +// +// Solidity: function getUint(bytes32 _slot) view returns(uint256 value_) +func (_StorageSetter *StorageSetterCaller) GetUint(opts *bind.CallOpts, _slot [32]byte) (*big.Int, error) { + var out []interface{} + err := _StorageSetter.contract.Call(opts, &out, "getUint", _slot) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetUint is a free data retrieval call binding the contract method 0xbd02d0f5. +// +// Solidity: function getUint(bytes32 _slot) view returns(uint256 value_) +func (_StorageSetter *StorageSetterSession) GetUint(_slot [32]byte) (*big.Int, error) { + return _StorageSetter.Contract.GetUint(&_StorageSetter.CallOpts, _slot) +} + +// GetUint is a free data retrieval call binding the contract method 0xbd02d0f5. +// +// Solidity: function getUint(bytes32 _slot) view returns(uint256 value_) +func (_StorageSetter *StorageSetterCallerSession) GetUint(_slot [32]byte) (*big.Int, error) { + return _StorageSetter.Contract.GetUint(&_StorageSetter.CallOpts, _slot) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_StorageSetter *StorageSetterCaller) Version(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _StorageSetter.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 (_StorageSetter *StorageSetterSession) Version() (string, error) { + return _StorageSetter.Contract.Version(&_StorageSetter.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_StorageSetter *StorageSetterCallerSession) Version() (string, error) { + return _StorageSetter.Contract.Version(&_StorageSetter.CallOpts) +} + +// SetAddress is a paid mutator transaction binding the contract method 0xca446dd9. +// +// Solidity: function setAddress(bytes32 _slot, address _address) returns() +func (_StorageSetter *StorageSetterTransactor) SetAddress(opts *bind.TransactOpts, _slot [32]byte, _address common.Address) (*types.Transaction, error) { + return _StorageSetter.contract.Transact(opts, "setAddress", _slot, _address) +} + +// SetAddress is a paid mutator transaction binding the contract method 0xca446dd9. +// +// Solidity: function setAddress(bytes32 _slot, address _address) returns() +func (_StorageSetter *StorageSetterSession) SetAddress(_slot [32]byte, _address common.Address) (*types.Transaction, error) { + return _StorageSetter.Contract.SetAddress(&_StorageSetter.TransactOpts, _slot, _address) +} + +// SetAddress is a paid mutator transaction binding the contract method 0xca446dd9. +// +// Solidity: function setAddress(bytes32 _slot, address _address) returns() +func (_StorageSetter *StorageSetterTransactorSession) SetAddress(_slot [32]byte, _address common.Address) (*types.Transaction, error) { + return _StorageSetter.Contract.SetAddress(&_StorageSetter.TransactOpts, _slot, _address) +} + +// SetBool is a paid mutator transaction binding the contract method 0xabfdcced. +// +// Solidity: function setBool(bytes32 _slot, bool _value) returns() +func (_StorageSetter *StorageSetterTransactor) SetBool(opts *bind.TransactOpts, _slot [32]byte, _value bool) (*types.Transaction, error) { + return _StorageSetter.contract.Transact(opts, "setBool", _slot, _value) +} + +// SetBool is a paid mutator transaction binding the contract method 0xabfdcced. +// +// Solidity: function setBool(bytes32 _slot, bool _value) returns() +func (_StorageSetter *StorageSetterSession) SetBool(_slot [32]byte, _value bool) (*types.Transaction, error) { + return _StorageSetter.Contract.SetBool(&_StorageSetter.TransactOpts, _slot, _value) +} + +// SetBool is a paid mutator transaction binding the contract method 0xabfdcced. +// +// Solidity: function setBool(bytes32 _slot, bool _value) returns() +func (_StorageSetter *StorageSetterTransactorSession) SetBool(_slot [32]byte, _value bool) (*types.Transaction, error) { + return _StorageSetter.Contract.SetBool(&_StorageSetter.TransactOpts, _slot, _value) +} + +// SetBytes32 is a paid mutator transaction binding the contract method 0x0528afe2. +// +// Solidity: function setBytes32((bytes32,bytes32)[] slots) returns() +func (_StorageSetter *StorageSetterTransactor) SetBytes32(opts *bind.TransactOpts, slots []StorageSetterSlot) (*types.Transaction, error) { + return _StorageSetter.contract.Transact(opts, "setBytes32", slots) +} + +// SetBytes32 is a paid mutator transaction binding the contract method 0x0528afe2. +// +// Solidity: function setBytes32((bytes32,bytes32)[] slots) returns() +func (_StorageSetter *StorageSetterSession) SetBytes32(slots []StorageSetterSlot) (*types.Transaction, error) { + return _StorageSetter.Contract.SetBytes32(&_StorageSetter.TransactOpts, slots) +} + +// SetBytes32 is a paid mutator transaction binding the contract method 0x0528afe2. +// +// Solidity: function setBytes32((bytes32,bytes32)[] slots) returns() +func (_StorageSetter *StorageSetterTransactorSession) SetBytes32(slots []StorageSetterSlot) (*types.Transaction, error) { + return _StorageSetter.Contract.SetBytes32(&_StorageSetter.TransactOpts, slots) +} + +// SetBytes320 is a paid mutator transaction binding the contract method 0x4e91db08. +// +// Solidity: function setBytes32(bytes32 _slot, bytes32 _value) returns() +func (_StorageSetter *StorageSetterTransactor) SetBytes320(opts *bind.TransactOpts, _slot [32]byte, _value [32]byte) (*types.Transaction, error) { + return _StorageSetter.contract.Transact(opts, "setBytes320", _slot, _value) +} + +// SetBytes320 is a paid mutator transaction binding the contract method 0x4e91db08. +// +// Solidity: function setBytes32(bytes32 _slot, bytes32 _value) returns() +func (_StorageSetter *StorageSetterSession) SetBytes320(_slot [32]byte, _value [32]byte) (*types.Transaction, error) { + return _StorageSetter.Contract.SetBytes320(&_StorageSetter.TransactOpts, _slot, _value) +} + +// SetBytes320 is a paid mutator transaction binding the contract method 0x4e91db08. +// +// Solidity: function setBytes32(bytes32 _slot, bytes32 _value) returns() +func (_StorageSetter *StorageSetterTransactorSession) SetBytes320(_slot [32]byte, _value [32]byte) (*types.Transaction, error) { + return _StorageSetter.Contract.SetBytes320(&_StorageSetter.TransactOpts, _slot, _value) +} + +// SetUint is a paid mutator transaction binding the contract method 0xe2a4853a. +// +// Solidity: function setUint(bytes32 _slot, uint256 _value) returns() +func (_StorageSetter *StorageSetterTransactor) SetUint(opts *bind.TransactOpts, _slot [32]byte, _value *big.Int) (*types.Transaction, error) { + return _StorageSetter.contract.Transact(opts, "setUint", _slot, _value) +} + +// SetUint is a paid mutator transaction binding the contract method 0xe2a4853a. +// +// Solidity: function setUint(bytes32 _slot, uint256 _value) returns() +func (_StorageSetter *StorageSetterSession) SetUint(_slot [32]byte, _value *big.Int) (*types.Transaction, error) { + return _StorageSetter.Contract.SetUint(&_StorageSetter.TransactOpts, _slot, _value) +} + +// SetUint is a paid mutator transaction binding the contract method 0xe2a4853a. +// +// Solidity: function setUint(bytes32 _slot, uint256 _value) returns() +func (_StorageSetter *StorageSetterTransactorSession) SetUint(_slot [32]byte, _value *big.Int) (*types.Transaction, error) { + return _StorageSetter.Contract.SetUint(&_StorageSetter.TransactOpts, _slot, _value) +} diff --git a/op-e2e2/bindings/superchainconfig.go b/op-e2e2/bindings/superchainconfig.go new file mode 100644 index 000000000000..d71a17956eb5 --- /dev/null +++ b/op-e2e2/bindings/superchainconfig.go @@ -0,0 +1,966 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// SuperchainConfigMetaData contains all meta data concerning the SuperchainConfig contract. +var SuperchainConfigMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"GUARDIAN_SLOT\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"PAUSED_SLOT\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"guardian\",\"inputs\":[],\"outputs\":[{\"name\":\"guardian_\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_guardian\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_paused\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"pause\",\"inputs\":[{\"name\":\"_identifier\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"paused\",\"inputs\":[],\"outputs\":[{\"name\":\"paused_\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"unpause\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"ConfigUpdate\",\"inputs\":[{\"name\":\"updateType\",\"type\":\"uint8\",\"indexed\":true,\"internalType\":\"enumSuperchainConfig.UpdateType\"},{\"name\":\"data\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Paused\",\"inputs\":[{\"name\":\"identifier\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Unpaused\",\"inputs\":[],\"anonymous\":false}]", + Bin: "0x60806040523480156200001157600080fd5b506200001f60008062000025565b62000361565b600054610100900460ff1615808015620000465750600054600160ff909116105b8062000076575062000063306200019460201b620005fd1760201c565b15801562000076575060005460ff166001145b620000de5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805460ff19166001179055801562000102576000805461ff0019166101001790555b6200010d83620001a3565b81156200014857604080518082019091526012815271125b9a5d1a585b1a5e995c881c185d5cd95960721b6020820152620001489062000248565b80156200018f576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b6001600160a01b03163b151590565b620001e9620001d460017fd30e835d3f35624761057ff5b27d558f97bd5be034621e62240e5c0b784abe69620002cf565b60001b82620002cb60201b620006191760201c565b6000604080516001600160a01b03841660208201527f7b743789cff01dafdeae47739925425aab5dfd02d0c8229e4a508bcd2b9f42bb910160408051601f19818403018152908290526200023d9162000345565b60405180910390a250565b6200028f6200027960017f54176ff9944c4784e5857ec4e5ef560a462c483bf534eda43f91bb01a470b1b7620002cf565b60001b6001620002cb60201b620006191760201c565b7fc32e6d5d6d1de257f64eac19ddb1f700ba13527983849c9486b1ab007ea2838181604051620002c0919062000345565b60405180910390a150565b9055565b600082821015620002f057634e487b7160e01b600052601160045260246000fd5b500390565b6000815180845260005b818110156200031d57602081850181015186830182015201620002ff565b8181111562000330576000602083870101525b50601f01601f19169290920160200192915050565b6020815260006200035a6020830184620002f5565b9392505050565b61096b80620003716000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c80635c975abb1161005b5780635c975abb146101255780636da663551461013d5780637fbf7b6a14610150578063c23a451a1461016657600080fd5b80633f4ba83a1461008d578063400ada7514610097578063452a9320146100aa57806354fd4d50146100dc575b600080fd5b61009561016e565b005b6100956100a5366004610746565b610294565b6100b261046d565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6101186040518060400160405280600581526020017f312e312e3000000000000000000000000000000000000000000000000000000081525081565b6040516100d39190610808565b61012d6104a6565b60405190151581526020016100d3565b61009561014b366004610851565b6104d6565b6101586105a4565b6040519081526020016100d3565b6101586105d2565b61017661046d565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610235576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f5375706572636861696e436f6e6669673a206f6e6c7920677561726469616e2060448201527f63616e20756e706175736500000000000000000000000000000000000000000060648201526084015b60405180910390fd5b61026961026360017f54176ff9944c4784e5857ec4e5ef560a462c483bf534eda43f91bb01a470b1b7610920565b60009055565b6040517fa45f47fdea8a1efdd9029a5691c7f759c32b7c698632b563573e155625d1693390600090a1565b600054610100900460ff16158080156102b45750600054600160ff909116105b806102ce5750303b1580156102ce575060005460ff166001145b61035a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a6564000000000000000000000000000000000000606482015260840161022c565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905580156103b857600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b6103c18361061d565b8115610405576104056040518060400160405280601281526020017f496e697469616c697a65722070617573656400000000000000000000000000008152506106d8565b801561046857600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b60006104a161049d60017fd30e835d3f35624761057ff5b27d558f97bd5be034621e62240e5c0b784abe69610920565b5490565b905090565b60006104a161049d60017f54176ff9944c4784e5857ec4e5ef560a462c483bf534eda43f91bb01a470b1b7610920565b6104de61046d565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610598576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f5375706572636861696e436f6e6669673a206f6e6c7920677561726469616e2060448201527f63616e2070617573650000000000000000000000000000000000000000000000606482015260840161022c565b6105a1816106d8565b50565b6105cf60017f54176ff9944c4784e5857ec4e5ef560a462c483bf534eda43f91bb01a470b1b7610920565b81565b6105cf60017fd30e835d3f35624761057ff5b27d558f97bd5be034621e62240e5c0b784abe69610920565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b9055565b61065061064b60017fd30e835d3f35624761057ff5b27d558f97bd5be034621e62240e5c0b784abe69610920565b829055565b60006040805173ffffffffffffffffffffffffffffffffffffffff841660208201527f7b743789cff01dafdeae47739925425aab5dfd02d0c8229e4a508bcd2b9f42bb9101604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290526106cd91610808565b60405180910390a250565b61070c61070660017f54176ff9944c4784e5857ec4e5ef560a462c483bf534eda43f91bb01a470b1b7610920565b60019055565b7fc32e6d5d6d1de257f64eac19ddb1f700ba13527983849c9486b1ab007ea283818160405161073b9190610808565b60405180910390a150565b6000806040838503121561075957600080fd5b823573ffffffffffffffffffffffffffffffffffffffff8116811461077d57600080fd5b91506020830135801515811461079257600080fd5b809150509250929050565b6000815180845260005b818110156107c3576020818501810151868301820152016107a7565b818111156107d5576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60208152600061081b602083018461079d565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006020828403121561086357600080fd5b813567ffffffffffffffff8082111561087b57600080fd5b818401915084601f83011261088f57600080fd5b8135818111156108a1576108a1610822565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156108e7576108e7610822565b8160405282815287602084870101111561090057600080fd5b826020860160208301376000928101602001929092525095945050505050565b600082821015610959577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b50039056fea164736f6c634300080f000a", +} + +// SuperchainConfigABI is the input ABI used to generate the binding from. +// Deprecated: Use SuperchainConfigMetaData.ABI instead. +var SuperchainConfigABI = SuperchainConfigMetaData.ABI + +// SuperchainConfigBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use SuperchainConfigMetaData.Bin instead. +var SuperchainConfigBin = SuperchainConfigMetaData.Bin + +// DeploySuperchainConfig deploys a new Ethereum contract, binding an instance of SuperchainConfig to it. +func DeploySuperchainConfig(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *SuperchainConfig, error) { + parsed, err := SuperchainConfigMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(SuperchainConfigBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &SuperchainConfig{SuperchainConfigCaller: SuperchainConfigCaller{contract: contract}, SuperchainConfigTransactor: SuperchainConfigTransactor{contract: contract}, SuperchainConfigFilterer: SuperchainConfigFilterer{contract: contract}}, nil +} + +// SuperchainConfig is an auto generated Go binding around an Ethereum contract. +type SuperchainConfig struct { + SuperchainConfigCaller // Read-only binding to the contract + SuperchainConfigTransactor // Write-only binding to the contract + SuperchainConfigFilterer // Log filterer for contract events +} + +// SuperchainConfigCaller is an auto generated read-only Go binding around an Ethereum contract. +type SuperchainConfigCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SuperchainConfigTransactor is an auto generated write-only Go binding around an Ethereum contract. +type SuperchainConfigTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SuperchainConfigFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type SuperchainConfigFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SuperchainConfigSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type SuperchainConfigSession struct { + Contract *SuperchainConfig // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// SuperchainConfigCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type SuperchainConfigCallerSession struct { + Contract *SuperchainConfigCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// SuperchainConfigTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type SuperchainConfigTransactorSession struct { + Contract *SuperchainConfigTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// SuperchainConfigRaw is an auto generated low-level Go binding around an Ethereum contract. +type SuperchainConfigRaw struct { + Contract *SuperchainConfig // Generic contract binding to access the raw methods on +} + +// SuperchainConfigCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type SuperchainConfigCallerRaw struct { + Contract *SuperchainConfigCaller // Generic read-only contract binding to access the raw methods on +} + +// SuperchainConfigTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type SuperchainConfigTransactorRaw struct { + Contract *SuperchainConfigTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewSuperchainConfig creates a new instance of SuperchainConfig, bound to a specific deployed contract. +func NewSuperchainConfig(address common.Address, backend bind.ContractBackend) (*SuperchainConfig, error) { + contract, err := bindSuperchainConfig(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &SuperchainConfig{SuperchainConfigCaller: SuperchainConfigCaller{contract: contract}, SuperchainConfigTransactor: SuperchainConfigTransactor{contract: contract}, SuperchainConfigFilterer: SuperchainConfigFilterer{contract: contract}}, nil +} + +// NewSuperchainConfigCaller creates a new read-only instance of SuperchainConfig, bound to a specific deployed contract. +func NewSuperchainConfigCaller(address common.Address, caller bind.ContractCaller) (*SuperchainConfigCaller, error) { + contract, err := bindSuperchainConfig(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &SuperchainConfigCaller{contract: contract}, nil +} + +// NewSuperchainConfigTransactor creates a new write-only instance of SuperchainConfig, bound to a specific deployed contract. +func NewSuperchainConfigTransactor(address common.Address, transactor bind.ContractTransactor) (*SuperchainConfigTransactor, error) { + contract, err := bindSuperchainConfig(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &SuperchainConfigTransactor{contract: contract}, nil +} + +// NewSuperchainConfigFilterer creates a new log filterer instance of SuperchainConfig, bound to a specific deployed contract. +func NewSuperchainConfigFilterer(address common.Address, filterer bind.ContractFilterer) (*SuperchainConfigFilterer, error) { + contract, err := bindSuperchainConfig(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &SuperchainConfigFilterer{contract: contract}, nil +} + +// bindSuperchainConfig binds a generic wrapper to an already deployed contract. +func bindSuperchainConfig(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(SuperchainConfigABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_SuperchainConfig *SuperchainConfigRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _SuperchainConfig.Contract.SuperchainConfigCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_SuperchainConfig *SuperchainConfigRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SuperchainConfig.Contract.SuperchainConfigTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_SuperchainConfig *SuperchainConfigRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _SuperchainConfig.Contract.SuperchainConfigTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_SuperchainConfig *SuperchainConfigCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _SuperchainConfig.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_SuperchainConfig *SuperchainConfigTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SuperchainConfig.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_SuperchainConfig *SuperchainConfigTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _SuperchainConfig.Contract.contract.Transact(opts, method, params...) +} + +// GUARDIANSLOT is a free data retrieval call binding the contract method 0xc23a451a. +// +// Solidity: function GUARDIAN_SLOT() view returns(bytes32) +func (_SuperchainConfig *SuperchainConfigCaller) GUARDIANSLOT(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _SuperchainConfig.contract.Call(opts, &out, "GUARDIAN_SLOT") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// GUARDIANSLOT is a free data retrieval call binding the contract method 0xc23a451a. +// +// Solidity: function GUARDIAN_SLOT() view returns(bytes32) +func (_SuperchainConfig *SuperchainConfigSession) GUARDIANSLOT() ([32]byte, error) { + return _SuperchainConfig.Contract.GUARDIANSLOT(&_SuperchainConfig.CallOpts) +} + +// GUARDIANSLOT is a free data retrieval call binding the contract method 0xc23a451a. +// +// Solidity: function GUARDIAN_SLOT() view returns(bytes32) +func (_SuperchainConfig *SuperchainConfigCallerSession) GUARDIANSLOT() ([32]byte, error) { + return _SuperchainConfig.Contract.GUARDIANSLOT(&_SuperchainConfig.CallOpts) +} + +// PAUSEDSLOT is a free data retrieval call binding the contract method 0x7fbf7b6a. +// +// Solidity: function PAUSED_SLOT() view returns(bytes32) +func (_SuperchainConfig *SuperchainConfigCaller) PAUSEDSLOT(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _SuperchainConfig.contract.Call(opts, &out, "PAUSED_SLOT") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// PAUSEDSLOT is a free data retrieval call binding the contract method 0x7fbf7b6a. +// +// Solidity: function PAUSED_SLOT() view returns(bytes32) +func (_SuperchainConfig *SuperchainConfigSession) PAUSEDSLOT() ([32]byte, error) { + return _SuperchainConfig.Contract.PAUSEDSLOT(&_SuperchainConfig.CallOpts) +} + +// PAUSEDSLOT is a free data retrieval call binding the contract method 0x7fbf7b6a. +// +// Solidity: function PAUSED_SLOT() view returns(bytes32) +func (_SuperchainConfig *SuperchainConfigCallerSession) PAUSEDSLOT() ([32]byte, error) { + return _SuperchainConfig.Contract.PAUSEDSLOT(&_SuperchainConfig.CallOpts) +} + +// Guardian is a free data retrieval call binding the contract method 0x452a9320. +// +// Solidity: function guardian() view returns(address guardian_) +func (_SuperchainConfig *SuperchainConfigCaller) Guardian(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _SuperchainConfig.contract.Call(opts, &out, "guardian") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Guardian is a free data retrieval call binding the contract method 0x452a9320. +// +// Solidity: function guardian() view returns(address guardian_) +func (_SuperchainConfig *SuperchainConfigSession) Guardian() (common.Address, error) { + return _SuperchainConfig.Contract.Guardian(&_SuperchainConfig.CallOpts) +} + +// Guardian is a free data retrieval call binding the contract method 0x452a9320. +// +// Solidity: function guardian() view returns(address guardian_) +func (_SuperchainConfig *SuperchainConfigCallerSession) Guardian() (common.Address, error) { + return _SuperchainConfig.Contract.Guardian(&_SuperchainConfig.CallOpts) +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool paused_) +func (_SuperchainConfig *SuperchainConfigCaller) Paused(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _SuperchainConfig.contract.Call(opts, &out, "paused") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool paused_) +func (_SuperchainConfig *SuperchainConfigSession) Paused() (bool, error) { + return _SuperchainConfig.Contract.Paused(&_SuperchainConfig.CallOpts) +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool paused_) +func (_SuperchainConfig *SuperchainConfigCallerSession) Paused() (bool, error) { + return _SuperchainConfig.Contract.Paused(&_SuperchainConfig.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_SuperchainConfig *SuperchainConfigCaller) Version(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _SuperchainConfig.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 (_SuperchainConfig *SuperchainConfigSession) Version() (string, error) { + return _SuperchainConfig.Contract.Version(&_SuperchainConfig.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_SuperchainConfig *SuperchainConfigCallerSession) Version() (string, error) { + return _SuperchainConfig.Contract.Version(&_SuperchainConfig.CallOpts) +} + +// Initialize is a paid mutator transaction binding the contract method 0x400ada75. +// +// Solidity: function initialize(address _guardian, bool _paused) returns() +func (_SuperchainConfig *SuperchainConfigTransactor) Initialize(opts *bind.TransactOpts, _guardian common.Address, _paused bool) (*types.Transaction, error) { + return _SuperchainConfig.contract.Transact(opts, "initialize", _guardian, _paused) +} + +// Initialize is a paid mutator transaction binding the contract method 0x400ada75. +// +// Solidity: function initialize(address _guardian, bool _paused) returns() +func (_SuperchainConfig *SuperchainConfigSession) Initialize(_guardian common.Address, _paused bool) (*types.Transaction, error) { + return _SuperchainConfig.Contract.Initialize(&_SuperchainConfig.TransactOpts, _guardian, _paused) +} + +// Initialize is a paid mutator transaction binding the contract method 0x400ada75. +// +// Solidity: function initialize(address _guardian, bool _paused) returns() +func (_SuperchainConfig *SuperchainConfigTransactorSession) Initialize(_guardian common.Address, _paused bool) (*types.Transaction, error) { + return _SuperchainConfig.Contract.Initialize(&_SuperchainConfig.TransactOpts, _guardian, _paused) +} + +// Pause is a paid mutator transaction binding the contract method 0x6da66355. +// +// Solidity: function pause(string _identifier) returns() +func (_SuperchainConfig *SuperchainConfigTransactor) Pause(opts *bind.TransactOpts, _identifier string) (*types.Transaction, error) { + return _SuperchainConfig.contract.Transact(opts, "pause", _identifier) +} + +// Pause is a paid mutator transaction binding the contract method 0x6da66355. +// +// Solidity: function pause(string _identifier) returns() +func (_SuperchainConfig *SuperchainConfigSession) Pause(_identifier string) (*types.Transaction, error) { + return _SuperchainConfig.Contract.Pause(&_SuperchainConfig.TransactOpts, _identifier) +} + +// Pause is a paid mutator transaction binding the contract method 0x6da66355. +// +// Solidity: function pause(string _identifier) returns() +func (_SuperchainConfig *SuperchainConfigTransactorSession) Pause(_identifier string) (*types.Transaction, error) { + return _SuperchainConfig.Contract.Pause(&_SuperchainConfig.TransactOpts, _identifier) +} + +// Unpause is a paid mutator transaction binding the contract method 0x3f4ba83a. +// +// Solidity: function unpause() returns() +func (_SuperchainConfig *SuperchainConfigTransactor) Unpause(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SuperchainConfig.contract.Transact(opts, "unpause") +} + +// Unpause is a paid mutator transaction binding the contract method 0x3f4ba83a. +// +// Solidity: function unpause() returns() +func (_SuperchainConfig *SuperchainConfigSession) Unpause() (*types.Transaction, error) { + return _SuperchainConfig.Contract.Unpause(&_SuperchainConfig.TransactOpts) +} + +// Unpause is a paid mutator transaction binding the contract method 0x3f4ba83a. +// +// Solidity: function unpause() returns() +func (_SuperchainConfig *SuperchainConfigTransactorSession) Unpause() (*types.Transaction, error) { + return _SuperchainConfig.Contract.Unpause(&_SuperchainConfig.TransactOpts) +} + +// SuperchainConfigConfigUpdateIterator is returned from FilterConfigUpdate and is used to iterate over the raw logs and unpacked data for ConfigUpdate events raised by the SuperchainConfig contract. +type SuperchainConfigConfigUpdateIterator struct { + Event *SuperchainConfigConfigUpdate // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SuperchainConfigConfigUpdateIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SuperchainConfigConfigUpdate) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SuperchainConfigConfigUpdate) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SuperchainConfigConfigUpdateIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SuperchainConfigConfigUpdateIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SuperchainConfigConfigUpdate represents a ConfigUpdate event raised by the SuperchainConfig contract. +type SuperchainConfigConfigUpdate struct { + UpdateType uint8 + Data []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterConfigUpdate is a free log retrieval operation binding the contract event 0x7b743789cff01dafdeae47739925425aab5dfd02d0c8229e4a508bcd2b9f42bb. +// +// Solidity: event ConfigUpdate(uint8 indexed updateType, bytes data) +func (_SuperchainConfig *SuperchainConfigFilterer) FilterConfigUpdate(opts *bind.FilterOpts, updateType []uint8) (*SuperchainConfigConfigUpdateIterator, error) { + + var updateTypeRule []interface{} + for _, updateTypeItem := range updateType { + updateTypeRule = append(updateTypeRule, updateTypeItem) + } + + logs, sub, err := _SuperchainConfig.contract.FilterLogs(opts, "ConfigUpdate", updateTypeRule) + if err != nil { + return nil, err + } + return &SuperchainConfigConfigUpdateIterator{contract: _SuperchainConfig.contract, event: "ConfigUpdate", logs: logs, sub: sub}, nil +} + +// WatchConfigUpdate is a free log subscription operation binding the contract event 0x7b743789cff01dafdeae47739925425aab5dfd02d0c8229e4a508bcd2b9f42bb. +// +// Solidity: event ConfigUpdate(uint8 indexed updateType, bytes data) +func (_SuperchainConfig *SuperchainConfigFilterer) WatchConfigUpdate(opts *bind.WatchOpts, sink chan<- *SuperchainConfigConfigUpdate, updateType []uint8) (event.Subscription, error) { + + var updateTypeRule []interface{} + for _, updateTypeItem := range updateType { + updateTypeRule = append(updateTypeRule, updateTypeItem) + } + + logs, sub, err := _SuperchainConfig.contract.WatchLogs(opts, "ConfigUpdate", updateTypeRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SuperchainConfigConfigUpdate) + if err := _SuperchainConfig.contract.UnpackLog(event, "ConfigUpdate", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseConfigUpdate is a log parse operation binding the contract event 0x7b743789cff01dafdeae47739925425aab5dfd02d0c8229e4a508bcd2b9f42bb. +// +// Solidity: event ConfigUpdate(uint8 indexed updateType, bytes data) +func (_SuperchainConfig *SuperchainConfigFilterer) ParseConfigUpdate(log types.Log) (*SuperchainConfigConfigUpdate, error) { + event := new(SuperchainConfigConfigUpdate) + if err := _SuperchainConfig.contract.UnpackLog(event, "ConfigUpdate", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SuperchainConfigInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the SuperchainConfig contract. +type SuperchainConfigInitializedIterator struct { + Event *SuperchainConfigInitialized // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SuperchainConfigInitializedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SuperchainConfigInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SuperchainConfigInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SuperchainConfigInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SuperchainConfigInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SuperchainConfigInitialized represents a Initialized event raised by the SuperchainConfig contract. +type SuperchainConfigInitialized struct { + Version uint8 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_SuperchainConfig *SuperchainConfigFilterer) FilterInitialized(opts *bind.FilterOpts) (*SuperchainConfigInitializedIterator, error) { + + logs, sub, err := _SuperchainConfig.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &SuperchainConfigInitializedIterator{contract: _SuperchainConfig.contract, event: "Initialized", logs: logs, sub: sub}, nil +} + +// WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_SuperchainConfig *SuperchainConfigFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *SuperchainConfigInitialized) (event.Subscription, error) { + + logs, sub, err := _SuperchainConfig.contract.WatchLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SuperchainConfigInitialized) + if err := _SuperchainConfig.contract.UnpackLog(event, "Initialized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_SuperchainConfig *SuperchainConfigFilterer) ParseInitialized(log types.Log) (*SuperchainConfigInitialized, error) { + event := new(SuperchainConfigInitialized) + if err := _SuperchainConfig.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SuperchainConfigPausedIterator is returned from FilterPaused and is used to iterate over the raw logs and unpacked data for Paused events raised by the SuperchainConfig contract. +type SuperchainConfigPausedIterator struct { + Event *SuperchainConfigPaused // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SuperchainConfigPausedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SuperchainConfigPaused) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SuperchainConfigPaused) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SuperchainConfigPausedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SuperchainConfigPausedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SuperchainConfigPaused represents a Paused event raised by the SuperchainConfig contract. +type SuperchainConfigPaused struct { + Identifier string + Raw types.Log // Blockchain specific contextual infos +} + +// FilterPaused is a free log retrieval operation binding the contract event 0xc32e6d5d6d1de257f64eac19ddb1f700ba13527983849c9486b1ab007ea28381. +// +// Solidity: event Paused(string identifier) +func (_SuperchainConfig *SuperchainConfigFilterer) FilterPaused(opts *bind.FilterOpts) (*SuperchainConfigPausedIterator, error) { + + logs, sub, err := _SuperchainConfig.contract.FilterLogs(opts, "Paused") + if err != nil { + return nil, err + } + return &SuperchainConfigPausedIterator{contract: _SuperchainConfig.contract, event: "Paused", logs: logs, sub: sub}, nil +} + +// WatchPaused is a free log subscription operation binding the contract event 0xc32e6d5d6d1de257f64eac19ddb1f700ba13527983849c9486b1ab007ea28381. +// +// Solidity: event Paused(string identifier) +func (_SuperchainConfig *SuperchainConfigFilterer) WatchPaused(opts *bind.WatchOpts, sink chan<- *SuperchainConfigPaused) (event.Subscription, error) { + + logs, sub, err := _SuperchainConfig.contract.WatchLogs(opts, "Paused") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SuperchainConfigPaused) + if err := _SuperchainConfig.contract.UnpackLog(event, "Paused", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParsePaused is a log parse operation binding the contract event 0xc32e6d5d6d1de257f64eac19ddb1f700ba13527983849c9486b1ab007ea28381. +// +// Solidity: event Paused(string identifier) +func (_SuperchainConfig *SuperchainConfigFilterer) ParsePaused(log types.Log) (*SuperchainConfigPaused, error) { + event := new(SuperchainConfigPaused) + if err := _SuperchainConfig.contract.UnpackLog(event, "Paused", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SuperchainConfigUnpausedIterator is returned from FilterUnpaused and is used to iterate over the raw logs and unpacked data for Unpaused events raised by the SuperchainConfig contract. +type SuperchainConfigUnpausedIterator struct { + Event *SuperchainConfigUnpaused // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SuperchainConfigUnpausedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SuperchainConfigUnpaused) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SuperchainConfigUnpaused) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SuperchainConfigUnpausedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SuperchainConfigUnpausedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SuperchainConfigUnpaused represents a Unpaused event raised by the SuperchainConfig contract. +type SuperchainConfigUnpaused struct { + Raw types.Log // Blockchain specific contextual infos +} + +// FilterUnpaused is a free log retrieval operation binding the contract event 0xa45f47fdea8a1efdd9029a5691c7f759c32b7c698632b563573e155625d16933. +// +// Solidity: event Unpaused() +func (_SuperchainConfig *SuperchainConfigFilterer) FilterUnpaused(opts *bind.FilterOpts) (*SuperchainConfigUnpausedIterator, error) { + + logs, sub, err := _SuperchainConfig.contract.FilterLogs(opts, "Unpaused") + if err != nil { + return nil, err + } + return &SuperchainConfigUnpausedIterator{contract: _SuperchainConfig.contract, event: "Unpaused", logs: logs, sub: sub}, nil +} + +// WatchUnpaused is a free log subscription operation binding the contract event 0xa45f47fdea8a1efdd9029a5691c7f759c32b7c698632b563573e155625d16933. +// +// Solidity: event Unpaused() +func (_SuperchainConfig *SuperchainConfigFilterer) WatchUnpaused(opts *bind.WatchOpts, sink chan<- *SuperchainConfigUnpaused) (event.Subscription, error) { + + logs, sub, err := _SuperchainConfig.contract.WatchLogs(opts, "Unpaused") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SuperchainConfigUnpaused) + if err := _SuperchainConfig.contract.UnpackLog(event, "Unpaused", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseUnpaused is a log parse operation binding the contract event 0xa45f47fdea8a1efdd9029a5691c7f759c32b7c698632b563573e155625d16933. +// +// Solidity: event Unpaused() +func (_SuperchainConfig *SuperchainConfigFilterer) ParseUnpaused(log types.Log) (*SuperchainConfigUnpaused, error) { + event := new(SuperchainConfigUnpaused) + if err := _SuperchainConfig.contract.UnpackLog(event, "Unpaused", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/op-e2e2/bindings/systemconfig.go b/op-e2e2/bindings/systemconfig.go new file mode 100644 index 000000000000..28b7ff6beace --- /dev/null +++ b/op-e2e2/bindings/systemconfig.go @@ -0,0 +1,1878 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// ResourceMeteringResourceConfig is an auto generated low-level Go binding around an user-defined struct. +type ResourceMeteringResourceConfig struct { + MaxResourceLimit uint32 + ElasticityMultiplier uint8 + BaseFeeMaxChangeDenominator uint8 + MinimumBaseFee uint32 + SystemTxMaxGas uint32 + MaximumBaseFee *big.Int +} + +// SystemConfigAddresses is an auto generated low-level Go binding around an user-defined struct. +type SystemConfigAddresses struct { + L1CrossDomainMessenger common.Address + L1ERC721Bridge common.Address + L1StandardBridge common.Address + DisputeGameFactory common.Address + OptimismPortal common.Address + OptimismMintableERC20Factory common.Address + GasPayingToken common.Address +} + +// SystemConfigMetaData contains all meta data concerning the SystemConfig contract. +var SystemConfigMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"BATCH_INBOX_SLOT\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"DISPUTE_GAME_FACTORY_SLOT\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"L1_CROSS_DOMAIN_MESSENGER_SLOT\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"L1_ERC_721_BRIDGE_SLOT\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"L1_STANDARD_BRIDGE_SLOT\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"OPTIMISM_MINTABLE_ERC20_FACTORY_SLOT\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"OPTIMISM_PORTAL_SLOT\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"START_BLOCK_SLOT\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"UNSAFE_BLOCK_SIGNER_SLOT\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"VERSION\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"basefeeScalar\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"batchInbox\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"addr_\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"batcherHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"blobbasefeeScalar\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"disputeGameFactory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"addr_\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gasLimit\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gasPayingToken\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"addr_\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"decimals_\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gasPayingTokenName\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"name_\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gasPayingTokenSymbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"symbol_\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"_basefeeScalar\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"_blobbasefeeScalar\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"_batcherHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"_gasLimit\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"_unsafeBlockSigner\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"maxResourceLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"elasticityMultiplier\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"baseFeeMaxChangeDenominator\",\"type\":\"uint8\"},{\"internalType\":\"uint32\",\"name\":\"minimumBaseFee\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"systemTxMaxGas\",\"type\":\"uint32\"},{\"internalType\":\"uint128\",\"name\":\"maximumBaseFee\",\"type\":\"uint128\"}],\"internalType\":\"structResourceMetering.ResourceConfig\",\"name\":\"_config\",\"type\":\"tuple\"},{\"internalType\":\"address\",\"name\":\"_batchInbox\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"l1CrossDomainMessenger\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"l1ERC721Bridge\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"l1StandardBridge\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"disputeGameFactory\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"optimismPortal\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"optimismMintableERC20Factory\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"gasPayingToken\",\"type\":\"address\"}],\"internalType\":\"structSystemConfig.Addresses\",\"name\":\"_addresses\",\"type\":\"tuple\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isCustomGasToken\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l1CrossDomainMessenger\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"addr_\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l1ERC721Bridge\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"addr_\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l1StandardBridge\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"addr_\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maximumGasLimit\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minimumGasLimit\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"optimismMintableERC20Factory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"addr_\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"optimismPortal\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"addr_\",\"type\":\"address\"}],\"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\":\"resourceConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"maxResourceLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"elasticityMultiplier\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"baseFeeMaxChangeDenominator\",\"type\":\"uint8\"},{\"internalType\":\"uint32\",\"name\":\"minimumBaseFee\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"systemTxMaxGas\",\"type\":\"uint32\"},{\"internalType\":\"uint128\",\"name\":\"maximumBaseFee\",\"type\":\"uint128\"}],\"internalType\":\"structResourceMetering.ResourceConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"scalar\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_batcherHash\",\"type\":\"bytes32\"}],\"name\":\"setBatcherHash\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_overhead\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_scalar\",\"type\":\"uint256\"}],\"name\":\"setGasConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_basefeeScalar\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"_blobbasefeeScalar\",\"type\":\"uint32\"}],\"name\":\"setGasConfigEcotone\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"_gasLimit\",\"type\":\"uint64\"}],\"name\":\"setGasLimit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_unsafeBlockSigner\",\"type\":\"address\"}],\"name\":\"setUnsafeBlockSigner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"startBlock\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"startBlock_\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unsafeBlockSigner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"addr_\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"version\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"enumSystemConfig.UpdateType\",\"name\":\"updateType\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"ConfigUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"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\"}]", +} + +// SystemConfigABI is the input ABI used to generate the binding from. +// Deprecated: Use SystemConfigMetaData.ABI instead. +var SystemConfigABI = SystemConfigMetaData.ABI + +// SystemConfig is an auto generated Go binding around an Ethereum contract. +type SystemConfig struct { + SystemConfigCaller // Read-only binding to the contract + SystemConfigTransactor // Write-only binding to the contract + SystemConfigFilterer // Log filterer for contract events +} + +// SystemConfigCaller is an auto generated read-only Go binding around an Ethereum contract. +type SystemConfigCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SystemConfigTransactor is an auto generated write-only Go binding around an Ethereum contract. +type SystemConfigTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SystemConfigFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type SystemConfigFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SystemConfigSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type SystemConfigSession struct { + Contract *SystemConfig // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// SystemConfigCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type SystemConfigCallerSession struct { + Contract *SystemConfigCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// SystemConfigTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type SystemConfigTransactorSession struct { + Contract *SystemConfigTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// SystemConfigRaw is an auto generated low-level Go binding around an Ethereum contract. +type SystemConfigRaw struct { + Contract *SystemConfig // Generic contract binding to access the raw methods on +} + +// SystemConfigCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type SystemConfigCallerRaw struct { + Contract *SystemConfigCaller // Generic read-only contract binding to access the raw methods on +} + +// SystemConfigTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type SystemConfigTransactorRaw struct { + Contract *SystemConfigTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewSystemConfig creates a new instance of SystemConfig, bound to a specific deployed contract. +func NewSystemConfig(address common.Address, backend bind.ContractBackend) (*SystemConfig, error) { + contract, err := bindSystemConfig(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &SystemConfig{SystemConfigCaller: SystemConfigCaller{contract: contract}, SystemConfigTransactor: SystemConfigTransactor{contract: contract}, SystemConfigFilterer: SystemConfigFilterer{contract: contract}}, nil +} + +// NewSystemConfigCaller creates a new read-only instance of SystemConfig, bound to a specific deployed contract. +func NewSystemConfigCaller(address common.Address, caller bind.ContractCaller) (*SystemConfigCaller, error) { + contract, err := bindSystemConfig(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &SystemConfigCaller{contract: contract}, nil +} + +// NewSystemConfigTransactor creates a new write-only instance of SystemConfig, bound to a specific deployed contract. +func NewSystemConfigTransactor(address common.Address, transactor bind.ContractTransactor) (*SystemConfigTransactor, error) { + contract, err := bindSystemConfig(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &SystemConfigTransactor{contract: contract}, nil +} + +// NewSystemConfigFilterer creates a new log filterer instance of SystemConfig, bound to a specific deployed contract. +func NewSystemConfigFilterer(address common.Address, filterer bind.ContractFilterer) (*SystemConfigFilterer, error) { + contract, err := bindSystemConfig(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &SystemConfigFilterer{contract: contract}, nil +} + +// bindSystemConfig binds a generic wrapper to an already deployed contract. +func bindSystemConfig(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(SystemConfigABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_SystemConfig *SystemConfigRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _SystemConfig.Contract.SystemConfigCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_SystemConfig *SystemConfigRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SystemConfig.Contract.SystemConfigTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_SystemConfig *SystemConfigRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _SystemConfig.Contract.SystemConfigTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_SystemConfig *SystemConfigCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _SystemConfig.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_SystemConfig *SystemConfigTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SystemConfig.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_SystemConfig *SystemConfigTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _SystemConfig.Contract.contract.Transact(opts, method, params...) +} + +// BATCHINBOXSLOT is a free data retrieval call binding the contract method 0xbc49ce5f. +// +// Solidity: function BATCH_INBOX_SLOT() view returns(bytes32) +func (_SystemConfig *SystemConfigCaller) BATCHINBOXSLOT(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _SystemConfig.contract.Call(opts, &out, "BATCH_INBOX_SLOT") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// BATCHINBOXSLOT is a free data retrieval call binding the contract method 0xbc49ce5f. +// +// Solidity: function BATCH_INBOX_SLOT() view returns(bytes32) +func (_SystemConfig *SystemConfigSession) BATCHINBOXSLOT() ([32]byte, error) { + return _SystemConfig.Contract.BATCHINBOXSLOT(&_SystemConfig.CallOpts) +} + +// BATCHINBOXSLOT is a free data retrieval call binding the contract method 0xbc49ce5f. +// +// Solidity: function BATCH_INBOX_SLOT() view returns(bytes32) +func (_SystemConfig *SystemConfigCallerSession) BATCHINBOXSLOT() ([32]byte, error) { + return _SystemConfig.Contract.BATCHINBOXSLOT(&_SystemConfig.CallOpts) +} + +// DISPUTEGAMEFACTORYSLOT is a free data retrieval call binding the contract method 0xe2a3285c. +// +// Solidity: function DISPUTE_GAME_FACTORY_SLOT() view returns(bytes32) +func (_SystemConfig *SystemConfigCaller) DISPUTEGAMEFACTORYSLOT(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _SystemConfig.contract.Call(opts, &out, "DISPUTE_GAME_FACTORY_SLOT") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// DISPUTEGAMEFACTORYSLOT is a free data retrieval call binding the contract method 0xe2a3285c. +// +// Solidity: function DISPUTE_GAME_FACTORY_SLOT() view returns(bytes32) +func (_SystemConfig *SystemConfigSession) DISPUTEGAMEFACTORYSLOT() ([32]byte, error) { + return _SystemConfig.Contract.DISPUTEGAMEFACTORYSLOT(&_SystemConfig.CallOpts) +} + +// DISPUTEGAMEFACTORYSLOT is a free data retrieval call binding the contract method 0xe2a3285c. +// +// Solidity: function DISPUTE_GAME_FACTORY_SLOT() view returns(bytes32) +func (_SystemConfig *SystemConfigCallerSession) DISPUTEGAMEFACTORYSLOT() ([32]byte, error) { + return _SystemConfig.Contract.DISPUTEGAMEFACTORYSLOT(&_SystemConfig.CallOpts) +} + +// L1CROSSDOMAINMESSENGERSLOT is a free data retrieval call binding the contract method 0x5d73369c. +// +// Solidity: function L1_CROSS_DOMAIN_MESSENGER_SLOT() view returns(bytes32) +func (_SystemConfig *SystemConfigCaller) L1CROSSDOMAINMESSENGERSLOT(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _SystemConfig.contract.Call(opts, &out, "L1_CROSS_DOMAIN_MESSENGER_SLOT") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// L1CROSSDOMAINMESSENGERSLOT is a free data retrieval call binding the contract method 0x5d73369c. +// +// Solidity: function L1_CROSS_DOMAIN_MESSENGER_SLOT() view returns(bytes32) +func (_SystemConfig *SystemConfigSession) L1CROSSDOMAINMESSENGERSLOT() ([32]byte, error) { + return _SystemConfig.Contract.L1CROSSDOMAINMESSENGERSLOT(&_SystemConfig.CallOpts) +} + +// L1CROSSDOMAINMESSENGERSLOT is a free data retrieval call binding the contract method 0x5d73369c. +// +// Solidity: function L1_CROSS_DOMAIN_MESSENGER_SLOT() view returns(bytes32) +func (_SystemConfig *SystemConfigCallerSession) L1CROSSDOMAINMESSENGERSLOT() ([32]byte, error) { + return _SystemConfig.Contract.L1CROSSDOMAINMESSENGERSLOT(&_SystemConfig.CallOpts) +} + +// L1ERC721BRIDGESLOT is a free data retrieval call binding the contract method 0x19f5cea8. +// +// Solidity: function L1_ERC_721_BRIDGE_SLOT() view returns(bytes32) +func (_SystemConfig *SystemConfigCaller) L1ERC721BRIDGESLOT(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _SystemConfig.contract.Call(opts, &out, "L1_ERC_721_BRIDGE_SLOT") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// L1ERC721BRIDGESLOT is a free data retrieval call binding the contract method 0x19f5cea8. +// +// Solidity: function L1_ERC_721_BRIDGE_SLOT() view returns(bytes32) +func (_SystemConfig *SystemConfigSession) L1ERC721BRIDGESLOT() ([32]byte, error) { + return _SystemConfig.Contract.L1ERC721BRIDGESLOT(&_SystemConfig.CallOpts) +} + +// L1ERC721BRIDGESLOT is a free data retrieval call binding the contract method 0x19f5cea8. +// +// Solidity: function L1_ERC_721_BRIDGE_SLOT() view returns(bytes32) +func (_SystemConfig *SystemConfigCallerSession) L1ERC721BRIDGESLOT() ([32]byte, error) { + return _SystemConfig.Contract.L1ERC721BRIDGESLOT(&_SystemConfig.CallOpts) +} + +// L1STANDARDBRIDGESLOT is a free data retrieval call binding the contract method 0xf8c68de0. +// +// Solidity: function L1_STANDARD_BRIDGE_SLOT() view returns(bytes32) +func (_SystemConfig *SystemConfigCaller) L1STANDARDBRIDGESLOT(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _SystemConfig.contract.Call(opts, &out, "L1_STANDARD_BRIDGE_SLOT") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// L1STANDARDBRIDGESLOT is a free data retrieval call binding the contract method 0xf8c68de0. +// +// Solidity: function L1_STANDARD_BRIDGE_SLOT() view returns(bytes32) +func (_SystemConfig *SystemConfigSession) L1STANDARDBRIDGESLOT() ([32]byte, error) { + return _SystemConfig.Contract.L1STANDARDBRIDGESLOT(&_SystemConfig.CallOpts) +} + +// L1STANDARDBRIDGESLOT is a free data retrieval call binding the contract method 0xf8c68de0. +// +// Solidity: function L1_STANDARD_BRIDGE_SLOT() view returns(bytes32) +func (_SystemConfig *SystemConfigCallerSession) L1STANDARDBRIDGESLOT() ([32]byte, error) { + return _SystemConfig.Contract.L1STANDARDBRIDGESLOT(&_SystemConfig.CallOpts) +} + +// OPTIMISMMINTABLEERC20FACTORYSLOT is a free data retrieval call binding the contract method 0x06c92657. +// +// Solidity: function OPTIMISM_MINTABLE_ERC20_FACTORY_SLOT() view returns(bytes32) +func (_SystemConfig *SystemConfigCaller) OPTIMISMMINTABLEERC20FACTORYSLOT(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _SystemConfig.contract.Call(opts, &out, "OPTIMISM_MINTABLE_ERC20_FACTORY_SLOT") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// OPTIMISMMINTABLEERC20FACTORYSLOT is a free data retrieval call binding the contract method 0x06c92657. +// +// Solidity: function OPTIMISM_MINTABLE_ERC20_FACTORY_SLOT() view returns(bytes32) +func (_SystemConfig *SystemConfigSession) OPTIMISMMINTABLEERC20FACTORYSLOT() ([32]byte, error) { + return _SystemConfig.Contract.OPTIMISMMINTABLEERC20FACTORYSLOT(&_SystemConfig.CallOpts) +} + +// OPTIMISMMINTABLEERC20FACTORYSLOT is a free data retrieval call binding the contract method 0x06c92657. +// +// Solidity: function OPTIMISM_MINTABLE_ERC20_FACTORY_SLOT() view returns(bytes32) +func (_SystemConfig *SystemConfigCallerSession) OPTIMISMMINTABLEERC20FACTORYSLOT() ([32]byte, error) { + return _SystemConfig.Contract.OPTIMISMMINTABLEERC20FACTORYSLOT(&_SystemConfig.CallOpts) +} + +// OPTIMISMPORTALSLOT is a free data retrieval call binding the contract method 0xfd32aa0f. +// +// Solidity: function OPTIMISM_PORTAL_SLOT() view returns(bytes32) +func (_SystemConfig *SystemConfigCaller) OPTIMISMPORTALSLOT(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _SystemConfig.contract.Call(opts, &out, "OPTIMISM_PORTAL_SLOT") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// OPTIMISMPORTALSLOT is a free data retrieval call binding the contract method 0xfd32aa0f. +// +// Solidity: function OPTIMISM_PORTAL_SLOT() view returns(bytes32) +func (_SystemConfig *SystemConfigSession) OPTIMISMPORTALSLOT() ([32]byte, error) { + return _SystemConfig.Contract.OPTIMISMPORTALSLOT(&_SystemConfig.CallOpts) +} + +// OPTIMISMPORTALSLOT is a free data retrieval call binding the contract method 0xfd32aa0f. +// +// Solidity: function OPTIMISM_PORTAL_SLOT() view returns(bytes32) +func (_SystemConfig *SystemConfigCallerSession) OPTIMISMPORTALSLOT() ([32]byte, error) { + return _SystemConfig.Contract.OPTIMISMPORTALSLOT(&_SystemConfig.CallOpts) +} + +// STARTBLOCKSLOT is a free data retrieval call binding the contract method 0xe0e2016d. +// +// Solidity: function START_BLOCK_SLOT() view returns(bytes32) +func (_SystemConfig *SystemConfigCaller) STARTBLOCKSLOT(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _SystemConfig.contract.Call(opts, &out, "START_BLOCK_SLOT") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// STARTBLOCKSLOT is a free data retrieval call binding the contract method 0xe0e2016d. +// +// Solidity: function START_BLOCK_SLOT() view returns(bytes32) +func (_SystemConfig *SystemConfigSession) STARTBLOCKSLOT() ([32]byte, error) { + return _SystemConfig.Contract.STARTBLOCKSLOT(&_SystemConfig.CallOpts) +} + +// STARTBLOCKSLOT is a free data retrieval call binding the contract method 0xe0e2016d. +// +// Solidity: function START_BLOCK_SLOT() view returns(bytes32) +func (_SystemConfig *SystemConfigCallerSession) STARTBLOCKSLOT() ([32]byte, error) { + return _SystemConfig.Contract.STARTBLOCKSLOT(&_SystemConfig.CallOpts) +} + +// UNSAFEBLOCKSIGNERSLOT is a free data retrieval call binding the contract method 0x4f16540b. +// +// Solidity: function UNSAFE_BLOCK_SIGNER_SLOT() view returns(bytes32) +func (_SystemConfig *SystemConfigCaller) UNSAFEBLOCKSIGNERSLOT(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _SystemConfig.contract.Call(opts, &out, "UNSAFE_BLOCK_SIGNER_SLOT") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// UNSAFEBLOCKSIGNERSLOT is a free data retrieval call binding the contract method 0x4f16540b. +// +// Solidity: function UNSAFE_BLOCK_SIGNER_SLOT() view returns(bytes32) +func (_SystemConfig *SystemConfigSession) UNSAFEBLOCKSIGNERSLOT() ([32]byte, error) { + return _SystemConfig.Contract.UNSAFEBLOCKSIGNERSLOT(&_SystemConfig.CallOpts) +} + +// UNSAFEBLOCKSIGNERSLOT is a free data retrieval call binding the contract method 0x4f16540b. +// +// Solidity: function UNSAFE_BLOCK_SIGNER_SLOT() view returns(bytes32) +func (_SystemConfig *SystemConfigCallerSession) UNSAFEBLOCKSIGNERSLOT() ([32]byte, error) { + return _SystemConfig.Contract.UNSAFEBLOCKSIGNERSLOT(&_SystemConfig.CallOpts) +} + +// VERSION is a free data retrieval call binding the contract method 0xffa1ad74. +// +// Solidity: function VERSION() view returns(uint256) +func (_SystemConfig *SystemConfigCaller) VERSION(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _SystemConfig.contract.Call(opts, &out, "VERSION") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// VERSION is a free data retrieval call binding the contract method 0xffa1ad74. +// +// Solidity: function VERSION() view returns(uint256) +func (_SystemConfig *SystemConfigSession) VERSION() (*big.Int, error) { + return _SystemConfig.Contract.VERSION(&_SystemConfig.CallOpts) +} + +// VERSION is a free data retrieval call binding the contract method 0xffa1ad74. +// +// Solidity: function VERSION() view returns(uint256) +func (_SystemConfig *SystemConfigCallerSession) VERSION() (*big.Int, error) { + return _SystemConfig.Contract.VERSION(&_SystemConfig.CallOpts) +} + +// BasefeeScalar is a free data retrieval call binding the contract method 0xbfb14fb7. +// +// Solidity: function basefeeScalar() view returns(uint32) +func (_SystemConfig *SystemConfigCaller) BasefeeScalar(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _SystemConfig.contract.Call(opts, &out, "basefeeScalar") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// BasefeeScalar is a free data retrieval call binding the contract method 0xbfb14fb7. +// +// Solidity: function basefeeScalar() view returns(uint32) +func (_SystemConfig *SystemConfigSession) BasefeeScalar() (uint32, error) { + return _SystemConfig.Contract.BasefeeScalar(&_SystemConfig.CallOpts) +} + +// BasefeeScalar is a free data retrieval call binding the contract method 0xbfb14fb7. +// +// Solidity: function basefeeScalar() view returns(uint32) +func (_SystemConfig *SystemConfigCallerSession) BasefeeScalar() (uint32, error) { + return _SystemConfig.Contract.BasefeeScalar(&_SystemConfig.CallOpts) +} + +// BatchInbox is a free data retrieval call binding the contract method 0xdac6e63a. +// +// Solidity: function batchInbox() view returns(address addr_) +func (_SystemConfig *SystemConfigCaller) BatchInbox(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _SystemConfig.contract.Call(opts, &out, "batchInbox") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// BatchInbox is a free data retrieval call binding the contract method 0xdac6e63a. +// +// Solidity: function batchInbox() view returns(address addr_) +func (_SystemConfig *SystemConfigSession) BatchInbox() (common.Address, error) { + return _SystemConfig.Contract.BatchInbox(&_SystemConfig.CallOpts) +} + +// BatchInbox is a free data retrieval call binding the contract method 0xdac6e63a. +// +// Solidity: function batchInbox() view returns(address addr_) +func (_SystemConfig *SystemConfigCallerSession) BatchInbox() (common.Address, error) { + return _SystemConfig.Contract.BatchInbox(&_SystemConfig.CallOpts) +} + +// BatcherHash is a free data retrieval call binding the contract method 0xe81b2c6d. +// +// Solidity: function batcherHash() view returns(bytes32) +func (_SystemConfig *SystemConfigCaller) BatcherHash(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _SystemConfig.contract.Call(opts, &out, "batcherHash") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// BatcherHash is a free data retrieval call binding the contract method 0xe81b2c6d. +// +// Solidity: function batcherHash() view returns(bytes32) +func (_SystemConfig *SystemConfigSession) BatcherHash() ([32]byte, error) { + return _SystemConfig.Contract.BatcherHash(&_SystemConfig.CallOpts) +} + +// BatcherHash is a free data retrieval call binding the contract method 0xe81b2c6d. +// +// Solidity: function batcherHash() view returns(bytes32) +func (_SystemConfig *SystemConfigCallerSession) BatcherHash() ([32]byte, error) { + return _SystemConfig.Contract.BatcherHash(&_SystemConfig.CallOpts) +} + +// BlobbasefeeScalar is a free data retrieval call binding the contract method 0xec707517. +// +// Solidity: function blobbasefeeScalar() view returns(uint32) +func (_SystemConfig *SystemConfigCaller) BlobbasefeeScalar(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _SystemConfig.contract.Call(opts, &out, "blobbasefeeScalar") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// BlobbasefeeScalar is a free data retrieval call binding the contract method 0xec707517. +// +// Solidity: function blobbasefeeScalar() view returns(uint32) +func (_SystemConfig *SystemConfigSession) BlobbasefeeScalar() (uint32, error) { + return _SystemConfig.Contract.BlobbasefeeScalar(&_SystemConfig.CallOpts) +} + +// BlobbasefeeScalar is a free data retrieval call binding the contract method 0xec707517. +// +// Solidity: function blobbasefeeScalar() view returns(uint32) +func (_SystemConfig *SystemConfigCallerSession) BlobbasefeeScalar() (uint32, error) { + return _SystemConfig.Contract.BlobbasefeeScalar(&_SystemConfig.CallOpts) +} + +// DisputeGameFactory is a free data retrieval call binding the contract method 0xf2b4e617. +// +// Solidity: function disputeGameFactory() view returns(address addr_) +func (_SystemConfig *SystemConfigCaller) DisputeGameFactory(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _SystemConfig.contract.Call(opts, &out, "disputeGameFactory") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// DisputeGameFactory is a free data retrieval call binding the contract method 0xf2b4e617. +// +// Solidity: function disputeGameFactory() view returns(address addr_) +func (_SystemConfig *SystemConfigSession) DisputeGameFactory() (common.Address, error) { + return _SystemConfig.Contract.DisputeGameFactory(&_SystemConfig.CallOpts) +} + +// DisputeGameFactory is a free data retrieval call binding the contract method 0xf2b4e617. +// +// Solidity: function disputeGameFactory() view returns(address addr_) +func (_SystemConfig *SystemConfigCallerSession) DisputeGameFactory() (common.Address, error) { + return _SystemConfig.Contract.DisputeGameFactory(&_SystemConfig.CallOpts) +} + +// GasLimit is a free data retrieval call binding the contract method 0xf68016b7. +// +// Solidity: function gasLimit() view returns(uint64) +func (_SystemConfig *SystemConfigCaller) GasLimit(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _SystemConfig.contract.Call(opts, &out, "gasLimit") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// GasLimit is a free data retrieval call binding the contract method 0xf68016b7. +// +// Solidity: function gasLimit() view returns(uint64) +func (_SystemConfig *SystemConfigSession) GasLimit() (uint64, error) { + return _SystemConfig.Contract.GasLimit(&_SystemConfig.CallOpts) +} + +// GasLimit is a free data retrieval call binding the contract method 0xf68016b7. +// +// Solidity: function gasLimit() view returns(uint64) +func (_SystemConfig *SystemConfigCallerSession) GasLimit() (uint64, error) { + return _SystemConfig.Contract.GasLimit(&_SystemConfig.CallOpts) +} + +// GasPayingToken is a free data retrieval call binding the contract method 0x4397dfef. +// +// Solidity: function gasPayingToken() view returns(address addr_, uint8 decimals_) +func (_SystemConfig *SystemConfigCaller) GasPayingToken(opts *bind.CallOpts) (struct { + Addr common.Address + Decimals uint8 +}, error) { + var out []interface{} + err := _SystemConfig.contract.Call(opts, &out, "gasPayingToken") + + outstruct := new(struct { + Addr common.Address + Decimals uint8 + }) + if err != nil { + return *outstruct, err + } + + outstruct.Addr = *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + outstruct.Decimals = *abi.ConvertType(out[1], new(uint8)).(*uint8) + + return *outstruct, err + +} + +// GasPayingToken is a free data retrieval call binding the contract method 0x4397dfef. +// +// Solidity: function gasPayingToken() view returns(address addr_, uint8 decimals_) +func (_SystemConfig *SystemConfigSession) GasPayingToken() (struct { + Addr common.Address + Decimals uint8 +}, error) { + return _SystemConfig.Contract.GasPayingToken(&_SystemConfig.CallOpts) +} + +// GasPayingToken is a free data retrieval call binding the contract method 0x4397dfef. +// +// Solidity: function gasPayingToken() view returns(address addr_, uint8 decimals_) +func (_SystemConfig *SystemConfigCallerSession) GasPayingToken() (struct { + Addr common.Address + Decimals uint8 +}, error) { + return _SystemConfig.Contract.GasPayingToken(&_SystemConfig.CallOpts) +} + +// GasPayingTokenName is a free data retrieval call binding the contract method 0xd8444715. +// +// Solidity: function gasPayingTokenName() view returns(string name_) +func (_SystemConfig *SystemConfigCaller) GasPayingTokenName(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _SystemConfig.contract.Call(opts, &out, "gasPayingTokenName") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// GasPayingTokenName is a free data retrieval call binding the contract method 0xd8444715. +// +// Solidity: function gasPayingTokenName() view returns(string name_) +func (_SystemConfig *SystemConfigSession) GasPayingTokenName() (string, error) { + return _SystemConfig.Contract.GasPayingTokenName(&_SystemConfig.CallOpts) +} + +// GasPayingTokenName is a free data retrieval call binding the contract method 0xd8444715. +// +// Solidity: function gasPayingTokenName() view returns(string name_) +func (_SystemConfig *SystemConfigCallerSession) GasPayingTokenName() (string, error) { + return _SystemConfig.Contract.GasPayingTokenName(&_SystemConfig.CallOpts) +} + +// GasPayingTokenSymbol is a free data retrieval call binding the contract method 0x550fcdc9. +// +// Solidity: function gasPayingTokenSymbol() view returns(string symbol_) +func (_SystemConfig *SystemConfigCaller) GasPayingTokenSymbol(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _SystemConfig.contract.Call(opts, &out, "gasPayingTokenSymbol") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// GasPayingTokenSymbol is a free data retrieval call binding the contract method 0x550fcdc9. +// +// Solidity: function gasPayingTokenSymbol() view returns(string symbol_) +func (_SystemConfig *SystemConfigSession) GasPayingTokenSymbol() (string, error) { + return _SystemConfig.Contract.GasPayingTokenSymbol(&_SystemConfig.CallOpts) +} + +// GasPayingTokenSymbol is a free data retrieval call binding the contract method 0x550fcdc9. +// +// Solidity: function gasPayingTokenSymbol() view returns(string symbol_) +func (_SystemConfig *SystemConfigCallerSession) GasPayingTokenSymbol() (string, error) { + return _SystemConfig.Contract.GasPayingTokenSymbol(&_SystemConfig.CallOpts) +} + +// IsCustomGasToken is a free data retrieval call binding the contract method 0x21326849. +// +// Solidity: function isCustomGasToken() view returns(bool) +func (_SystemConfig *SystemConfigCaller) IsCustomGasToken(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _SystemConfig.contract.Call(opts, &out, "isCustomGasToken") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsCustomGasToken is a free data retrieval call binding the contract method 0x21326849. +// +// Solidity: function isCustomGasToken() view returns(bool) +func (_SystemConfig *SystemConfigSession) IsCustomGasToken() (bool, error) { + return _SystemConfig.Contract.IsCustomGasToken(&_SystemConfig.CallOpts) +} + +// IsCustomGasToken is a free data retrieval call binding the contract method 0x21326849. +// +// Solidity: function isCustomGasToken() view returns(bool) +func (_SystemConfig *SystemConfigCallerSession) IsCustomGasToken() (bool, error) { + return _SystemConfig.Contract.IsCustomGasToken(&_SystemConfig.CallOpts) +} + +// L1CrossDomainMessenger is a free data retrieval call binding the contract method 0xa7119869. +// +// Solidity: function l1CrossDomainMessenger() view returns(address addr_) +func (_SystemConfig *SystemConfigCaller) L1CrossDomainMessenger(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _SystemConfig.contract.Call(opts, &out, "l1CrossDomainMessenger") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// L1CrossDomainMessenger is a free data retrieval call binding the contract method 0xa7119869. +// +// Solidity: function l1CrossDomainMessenger() view returns(address addr_) +func (_SystemConfig *SystemConfigSession) L1CrossDomainMessenger() (common.Address, error) { + return _SystemConfig.Contract.L1CrossDomainMessenger(&_SystemConfig.CallOpts) +} + +// L1CrossDomainMessenger is a free data retrieval call binding the contract method 0xa7119869. +// +// Solidity: function l1CrossDomainMessenger() view returns(address addr_) +func (_SystemConfig *SystemConfigCallerSession) L1CrossDomainMessenger() (common.Address, error) { + return _SystemConfig.Contract.L1CrossDomainMessenger(&_SystemConfig.CallOpts) +} + +// L1ERC721Bridge is a free data retrieval call binding the contract method 0xc4e8ddfa. +// +// Solidity: function l1ERC721Bridge() view returns(address addr_) +func (_SystemConfig *SystemConfigCaller) L1ERC721Bridge(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _SystemConfig.contract.Call(opts, &out, "l1ERC721Bridge") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// L1ERC721Bridge is a free data retrieval call binding the contract method 0xc4e8ddfa. +// +// Solidity: function l1ERC721Bridge() view returns(address addr_) +func (_SystemConfig *SystemConfigSession) L1ERC721Bridge() (common.Address, error) { + return _SystemConfig.Contract.L1ERC721Bridge(&_SystemConfig.CallOpts) +} + +// L1ERC721Bridge is a free data retrieval call binding the contract method 0xc4e8ddfa. +// +// Solidity: function l1ERC721Bridge() view returns(address addr_) +func (_SystemConfig *SystemConfigCallerSession) L1ERC721Bridge() (common.Address, error) { + return _SystemConfig.Contract.L1ERC721Bridge(&_SystemConfig.CallOpts) +} + +// L1StandardBridge is a free data retrieval call binding the contract method 0x078f29cf. +// +// Solidity: function l1StandardBridge() view returns(address addr_) +func (_SystemConfig *SystemConfigCaller) L1StandardBridge(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _SystemConfig.contract.Call(opts, &out, "l1StandardBridge") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// L1StandardBridge is a free data retrieval call binding the contract method 0x078f29cf. +// +// Solidity: function l1StandardBridge() view returns(address addr_) +func (_SystemConfig *SystemConfigSession) L1StandardBridge() (common.Address, error) { + return _SystemConfig.Contract.L1StandardBridge(&_SystemConfig.CallOpts) +} + +// L1StandardBridge is a free data retrieval call binding the contract method 0x078f29cf. +// +// Solidity: function l1StandardBridge() view returns(address addr_) +func (_SystemConfig *SystemConfigCallerSession) L1StandardBridge() (common.Address, error) { + return _SystemConfig.Contract.L1StandardBridge(&_SystemConfig.CallOpts) +} + +// MaximumGasLimit is a free data retrieval call binding the contract method 0x0ae14b1b. +// +// Solidity: function maximumGasLimit() pure returns(uint64) +func (_SystemConfig *SystemConfigCaller) MaximumGasLimit(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _SystemConfig.contract.Call(opts, &out, "maximumGasLimit") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// MaximumGasLimit is a free data retrieval call binding the contract method 0x0ae14b1b. +// +// Solidity: function maximumGasLimit() pure returns(uint64) +func (_SystemConfig *SystemConfigSession) MaximumGasLimit() (uint64, error) { + return _SystemConfig.Contract.MaximumGasLimit(&_SystemConfig.CallOpts) +} + +// MaximumGasLimit is a free data retrieval call binding the contract method 0x0ae14b1b. +// +// Solidity: function maximumGasLimit() pure returns(uint64) +func (_SystemConfig *SystemConfigCallerSession) MaximumGasLimit() (uint64, error) { + return _SystemConfig.Contract.MaximumGasLimit(&_SystemConfig.CallOpts) +} + +// MinimumGasLimit is a free data retrieval call binding the contract method 0x4add321d. +// +// Solidity: function minimumGasLimit() view returns(uint64) +func (_SystemConfig *SystemConfigCaller) MinimumGasLimit(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _SystemConfig.contract.Call(opts, &out, "minimumGasLimit") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// MinimumGasLimit is a free data retrieval call binding the contract method 0x4add321d. +// +// Solidity: function minimumGasLimit() view returns(uint64) +func (_SystemConfig *SystemConfigSession) MinimumGasLimit() (uint64, error) { + return _SystemConfig.Contract.MinimumGasLimit(&_SystemConfig.CallOpts) +} + +// MinimumGasLimit is a free data retrieval call binding the contract method 0x4add321d. +// +// Solidity: function minimumGasLimit() view returns(uint64) +func (_SystemConfig *SystemConfigCallerSession) MinimumGasLimit() (uint64, error) { + return _SystemConfig.Contract.MinimumGasLimit(&_SystemConfig.CallOpts) +} + +// OptimismMintableERC20Factory is a free data retrieval call binding the contract method 0x9b7d7f0a. +// +// Solidity: function optimismMintableERC20Factory() view returns(address addr_) +func (_SystemConfig *SystemConfigCaller) OptimismMintableERC20Factory(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _SystemConfig.contract.Call(opts, &out, "optimismMintableERC20Factory") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// OptimismMintableERC20Factory is a free data retrieval call binding the contract method 0x9b7d7f0a. +// +// Solidity: function optimismMintableERC20Factory() view returns(address addr_) +func (_SystemConfig *SystemConfigSession) OptimismMintableERC20Factory() (common.Address, error) { + return _SystemConfig.Contract.OptimismMintableERC20Factory(&_SystemConfig.CallOpts) +} + +// OptimismMintableERC20Factory is a free data retrieval call binding the contract method 0x9b7d7f0a. +// +// Solidity: function optimismMintableERC20Factory() view returns(address addr_) +func (_SystemConfig *SystemConfigCallerSession) OptimismMintableERC20Factory() (common.Address, error) { + return _SystemConfig.Contract.OptimismMintableERC20Factory(&_SystemConfig.CallOpts) +} + +// OptimismPortal is a free data retrieval call binding the contract method 0x0a49cb03. +// +// Solidity: function optimismPortal() view returns(address addr_) +func (_SystemConfig *SystemConfigCaller) OptimismPortal(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _SystemConfig.contract.Call(opts, &out, "optimismPortal") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// OptimismPortal is a free data retrieval call binding the contract method 0x0a49cb03. +// +// Solidity: function optimismPortal() view returns(address addr_) +func (_SystemConfig *SystemConfigSession) OptimismPortal() (common.Address, error) { + return _SystemConfig.Contract.OptimismPortal(&_SystemConfig.CallOpts) +} + +// OptimismPortal is a free data retrieval call binding the contract method 0x0a49cb03. +// +// Solidity: function optimismPortal() view returns(address addr_) +func (_SystemConfig *SystemConfigCallerSession) OptimismPortal() (common.Address, error) { + return _SystemConfig.Contract.OptimismPortal(&_SystemConfig.CallOpts) +} + +// Overhead is a free data retrieval call binding the contract method 0x0c18c162. +// +// Solidity: function overhead() view returns(uint256) +func (_SystemConfig *SystemConfigCaller) Overhead(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _SystemConfig.contract.Call(opts, &out, "overhead") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Overhead is a free data retrieval call binding the contract method 0x0c18c162. +// +// Solidity: function overhead() view returns(uint256) +func (_SystemConfig *SystemConfigSession) Overhead() (*big.Int, error) { + return _SystemConfig.Contract.Overhead(&_SystemConfig.CallOpts) +} + +// Overhead is a free data retrieval call binding the contract method 0x0c18c162. +// +// Solidity: function overhead() view returns(uint256) +func (_SystemConfig *SystemConfigCallerSession) Overhead() (*big.Int, error) { + return _SystemConfig.Contract.Overhead(&_SystemConfig.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_SystemConfig *SystemConfigCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _SystemConfig.contract.Call(opts, &out, "owner") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_SystemConfig *SystemConfigSession) Owner() (common.Address, error) { + return _SystemConfig.Contract.Owner(&_SystemConfig.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_SystemConfig *SystemConfigCallerSession) Owner() (common.Address, error) { + return _SystemConfig.Contract.Owner(&_SystemConfig.CallOpts) +} + +// ResourceConfig is a free data retrieval call binding the contract method 0xcc731b02. +// +// Solidity: function resourceConfig() view returns((uint32,uint8,uint8,uint32,uint32,uint128)) +func (_SystemConfig *SystemConfigCaller) ResourceConfig(opts *bind.CallOpts) (ResourceMeteringResourceConfig, error) { + var out []interface{} + err := _SystemConfig.contract.Call(opts, &out, "resourceConfig") + + if err != nil { + return *new(ResourceMeteringResourceConfig), err + } + + out0 := *abi.ConvertType(out[0], new(ResourceMeteringResourceConfig)).(*ResourceMeteringResourceConfig) + + return out0, err + +} + +// ResourceConfig is a free data retrieval call binding the contract method 0xcc731b02. +// +// Solidity: function resourceConfig() view returns((uint32,uint8,uint8,uint32,uint32,uint128)) +func (_SystemConfig *SystemConfigSession) ResourceConfig() (ResourceMeteringResourceConfig, error) { + return _SystemConfig.Contract.ResourceConfig(&_SystemConfig.CallOpts) +} + +// ResourceConfig is a free data retrieval call binding the contract method 0xcc731b02. +// +// Solidity: function resourceConfig() view returns((uint32,uint8,uint8,uint32,uint32,uint128)) +func (_SystemConfig *SystemConfigCallerSession) ResourceConfig() (ResourceMeteringResourceConfig, error) { + return _SystemConfig.Contract.ResourceConfig(&_SystemConfig.CallOpts) +} + +// Scalar is a free data retrieval call binding the contract method 0xf45e65d8. +// +// Solidity: function scalar() view returns(uint256) +func (_SystemConfig *SystemConfigCaller) Scalar(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _SystemConfig.contract.Call(opts, &out, "scalar") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Scalar is a free data retrieval call binding the contract method 0xf45e65d8. +// +// Solidity: function scalar() view returns(uint256) +func (_SystemConfig *SystemConfigSession) Scalar() (*big.Int, error) { + return _SystemConfig.Contract.Scalar(&_SystemConfig.CallOpts) +} + +// Scalar is a free data retrieval call binding the contract method 0xf45e65d8. +// +// Solidity: function scalar() view returns(uint256) +func (_SystemConfig *SystemConfigCallerSession) Scalar() (*big.Int, error) { + return _SystemConfig.Contract.Scalar(&_SystemConfig.CallOpts) +} + +// StartBlock is a free data retrieval call binding the contract method 0x48cd4cb1. +// +// Solidity: function startBlock() view returns(uint256 startBlock_) +func (_SystemConfig *SystemConfigCaller) StartBlock(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _SystemConfig.contract.Call(opts, &out, "startBlock") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// StartBlock is a free data retrieval call binding the contract method 0x48cd4cb1. +// +// Solidity: function startBlock() view returns(uint256 startBlock_) +func (_SystemConfig *SystemConfigSession) StartBlock() (*big.Int, error) { + return _SystemConfig.Contract.StartBlock(&_SystemConfig.CallOpts) +} + +// StartBlock is a free data retrieval call binding the contract method 0x48cd4cb1. +// +// Solidity: function startBlock() view returns(uint256 startBlock_) +func (_SystemConfig *SystemConfigCallerSession) StartBlock() (*big.Int, error) { + return _SystemConfig.Contract.StartBlock(&_SystemConfig.CallOpts) +} + +// UnsafeBlockSigner is a free data retrieval call binding the contract method 0x1fd19ee1. +// +// Solidity: function unsafeBlockSigner() view returns(address addr_) +func (_SystemConfig *SystemConfigCaller) UnsafeBlockSigner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _SystemConfig.contract.Call(opts, &out, "unsafeBlockSigner") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// UnsafeBlockSigner is a free data retrieval call binding the contract method 0x1fd19ee1. +// +// Solidity: function unsafeBlockSigner() view returns(address addr_) +func (_SystemConfig *SystemConfigSession) UnsafeBlockSigner() (common.Address, error) { + return _SystemConfig.Contract.UnsafeBlockSigner(&_SystemConfig.CallOpts) +} + +// UnsafeBlockSigner is a free data retrieval call binding the contract method 0x1fd19ee1. +// +// Solidity: function unsafeBlockSigner() view returns(address addr_) +func (_SystemConfig *SystemConfigCallerSession) UnsafeBlockSigner() (common.Address, error) { + return _SystemConfig.Contract.UnsafeBlockSigner(&_SystemConfig.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_SystemConfig *SystemConfigCaller) Version(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _SystemConfig.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 (_SystemConfig *SystemConfigSession) Version() (string, error) { + return _SystemConfig.Contract.Version(&_SystemConfig.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_SystemConfig *SystemConfigCallerSession) Version() (string, error) { + return _SystemConfig.Contract.Version(&_SystemConfig.CallOpts) +} + +// Initialize is a paid mutator transaction binding the contract method 0xdb9040fa. +// +// Solidity: function initialize(address _owner, uint32 _basefeeScalar, uint32 _blobbasefeeScalar, bytes32 _batcherHash, uint64 _gasLimit, address _unsafeBlockSigner, (uint32,uint8,uint8,uint32,uint32,uint128) _config, address _batchInbox, (address,address,address,address,address,address,address) _addresses) returns() +func (_SystemConfig *SystemConfigTransactor) Initialize(opts *bind.TransactOpts, _owner common.Address, _basefeeScalar uint32, _blobbasefeeScalar uint32, _batcherHash [32]byte, _gasLimit uint64, _unsafeBlockSigner common.Address, _config ResourceMeteringResourceConfig, _batchInbox common.Address, _addresses SystemConfigAddresses) (*types.Transaction, error) { + return _SystemConfig.contract.Transact(opts, "initialize", _owner, _basefeeScalar, _blobbasefeeScalar, _batcherHash, _gasLimit, _unsafeBlockSigner, _config, _batchInbox, _addresses) +} + +// Initialize is a paid mutator transaction binding the contract method 0xdb9040fa. +// +// Solidity: function initialize(address _owner, uint32 _basefeeScalar, uint32 _blobbasefeeScalar, bytes32 _batcherHash, uint64 _gasLimit, address _unsafeBlockSigner, (uint32,uint8,uint8,uint32,uint32,uint128) _config, address _batchInbox, (address,address,address,address,address,address,address) _addresses) returns() +func (_SystemConfig *SystemConfigSession) Initialize(_owner common.Address, _basefeeScalar uint32, _blobbasefeeScalar uint32, _batcherHash [32]byte, _gasLimit uint64, _unsafeBlockSigner common.Address, _config ResourceMeteringResourceConfig, _batchInbox common.Address, _addresses SystemConfigAddresses) (*types.Transaction, error) { + return _SystemConfig.Contract.Initialize(&_SystemConfig.TransactOpts, _owner, _basefeeScalar, _blobbasefeeScalar, _batcherHash, _gasLimit, _unsafeBlockSigner, _config, _batchInbox, _addresses) +} + +// Initialize is a paid mutator transaction binding the contract method 0xdb9040fa. +// +// Solidity: function initialize(address _owner, uint32 _basefeeScalar, uint32 _blobbasefeeScalar, bytes32 _batcherHash, uint64 _gasLimit, address _unsafeBlockSigner, (uint32,uint8,uint8,uint32,uint32,uint128) _config, address _batchInbox, (address,address,address,address,address,address,address) _addresses) returns() +func (_SystemConfig *SystemConfigTransactorSession) Initialize(_owner common.Address, _basefeeScalar uint32, _blobbasefeeScalar uint32, _batcherHash [32]byte, _gasLimit uint64, _unsafeBlockSigner common.Address, _config ResourceMeteringResourceConfig, _batchInbox common.Address, _addresses SystemConfigAddresses) (*types.Transaction, error) { + return _SystemConfig.Contract.Initialize(&_SystemConfig.TransactOpts, _owner, _basefeeScalar, _blobbasefeeScalar, _batcherHash, _gasLimit, _unsafeBlockSigner, _config, _batchInbox, _addresses) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_SystemConfig *SystemConfigTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SystemConfig.contract.Transact(opts, "renounceOwnership") +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_SystemConfig *SystemConfigSession) RenounceOwnership() (*types.Transaction, error) { + return _SystemConfig.Contract.RenounceOwnership(&_SystemConfig.TransactOpts) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_SystemConfig *SystemConfigTransactorSession) RenounceOwnership() (*types.Transaction, error) { + return _SystemConfig.Contract.RenounceOwnership(&_SystemConfig.TransactOpts) +} + +// SetBatcherHash is a paid mutator transaction binding the contract method 0xc9b26f61. +// +// Solidity: function setBatcherHash(bytes32 _batcherHash) returns() +func (_SystemConfig *SystemConfigTransactor) SetBatcherHash(opts *bind.TransactOpts, _batcherHash [32]byte) (*types.Transaction, error) { + return _SystemConfig.contract.Transact(opts, "setBatcherHash", _batcherHash) +} + +// SetBatcherHash is a paid mutator transaction binding the contract method 0xc9b26f61. +// +// Solidity: function setBatcherHash(bytes32 _batcherHash) returns() +func (_SystemConfig *SystemConfigSession) SetBatcherHash(_batcherHash [32]byte) (*types.Transaction, error) { + return _SystemConfig.Contract.SetBatcherHash(&_SystemConfig.TransactOpts, _batcherHash) +} + +// SetBatcherHash is a paid mutator transaction binding the contract method 0xc9b26f61. +// +// Solidity: function setBatcherHash(bytes32 _batcherHash) returns() +func (_SystemConfig *SystemConfigTransactorSession) SetBatcherHash(_batcherHash [32]byte) (*types.Transaction, error) { + return _SystemConfig.Contract.SetBatcherHash(&_SystemConfig.TransactOpts, _batcherHash) +} + +// SetGasConfig is a paid mutator transaction binding the contract method 0x935f029e. +// +// Solidity: function setGasConfig(uint256 _overhead, uint256 _scalar) returns() +func (_SystemConfig *SystemConfigTransactor) SetGasConfig(opts *bind.TransactOpts, _overhead *big.Int, _scalar *big.Int) (*types.Transaction, error) { + return _SystemConfig.contract.Transact(opts, "setGasConfig", _overhead, _scalar) +} + +// SetGasConfig is a paid mutator transaction binding the contract method 0x935f029e. +// +// Solidity: function setGasConfig(uint256 _overhead, uint256 _scalar) returns() +func (_SystemConfig *SystemConfigSession) SetGasConfig(_overhead *big.Int, _scalar *big.Int) (*types.Transaction, error) { + return _SystemConfig.Contract.SetGasConfig(&_SystemConfig.TransactOpts, _overhead, _scalar) +} + +// SetGasConfig is a paid mutator transaction binding the contract method 0x935f029e. +// +// Solidity: function setGasConfig(uint256 _overhead, uint256 _scalar) returns() +func (_SystemConfig *SystemConfigTransactorSession) SetGasConfig(_overhead *big.Int, _scalar *big.Int) (*types.Transaction, error) { + return _SystemConfig.Contract.SetGasConfig(&_SystemConfig.TransactOpts, _overhead, _scalar) +} + +// SetGasConfigEcotone is a paid mutator transaction binding the contract method 0x21d7fde5. +// +// Solidity: function setGasConfigEcotone(uint32 _basefeeScalar, uint32 _blobbasefeeScalar) returns() +func (_SystemConfig *SystemConfigTransactor) SetGasConfigEcotone(opts *bind.TransactOpts, _basefeeScalar uint32, _blobbasefeeScalar uint32) (*types.Transaction, error) { + return _SystemConfig.contract.Transact(opts, "setGasConfigEcotone", _basefeeScalar, _blobbasefeeScalar) +} + +// SetGasConfigEcotone is a paid mutator transaction binding the contract method 0x21d7fde5. +// +// Solidity: function setGasConfigEcotone(uint32 _basefeeScalar, uint32 _blobbasefeeScalar) returns() +func (_SystemConfig *SystemConfigSession) SetGasConfigEcotone(_basefeeScalar uint32, _blobbasefeeScalar uint32) (*types.Transaction, error) { + return _SystemConfig.Contract.SetGasConfigEcotone(&_SystemConfig.TransactOpts, _basefeeScalar, _blobbasefeeScalar) +} + +// SetGasConfigEcotone is a paid mutator transaction binding the contract method 0x21d7fde5. +// +// Solidity: function setGasConfigEcotone(uint32 _basefeeScalar, uint32 _blobbasefeeScalar) returns() +func (_SystemConfig *SystemConfigTransactorSession) SetGasConfigEcotone(_basefeeScalar uint32, _blobbasefeeScalar uint32) (*types.Transaction, error) { + return _SystemConfig.Contract.SetGasConfigEcotone(&_SystemConfig.TransactOpts, _basefeeScalar, _blobbasefeeScalar) +} + +// SetGasLimit is a paid mutator transaction binding the contract method 0xb40a817c. +// +// Solidity: function setGasLimit(uint64 _gasLimit) returns() +func (_SystemConfig *SystemConfigTransactor) SetGasLimit(opts *bind.TransactOpts, _gasLimit uint64) (*types.Transaction, error) { + return _SystemConfig.contract.Transact(opts, "setGasLimit", _gasLimit) +} + +// SetGasLimit is a paid mutator transaction binding the contract method 0xb40a817c. +// +// Solidity: function setGasLimit(uint64 _gasLimit) returns() +func (_SystemConfig *SystemConfigSession) SetGasLimit(_gasLimit uint64) (*types.Transaction, error) { + return _SystemConfig.Contract.SetGasLimit(&_SystemConfig.TransactOpts, _gasLimit) +} + +// SetGasLimit is a paid mutator transaction binding the contract method 0xb40a817c. +// +// Solidity: function setGasLimit(uint64 _gasLimit) returns() +func (_SystemConfig *SystemConfigTransactorSession) SetGasLimit(_gasLimit uint64) (*types.Transaction, error) { + return _SystemConfig.Contract.SetGasLimit(&_SystemConfig.TransactOpts, _gasLimit) +} + +// SetUnsafeBlockSigner is a paid mutator transaction binding the contract method 0x18d13918. +// +// Solidity: function setUnsafeBlockSigner(address _unsafeBlockSigner) returns() +func (_SystemConfig *SystemConfigTransactor) SetUnsafeBlockSigner(opts *bind.TransactOpts, _unsafeBlockSigner common.Address) (*types.Transaction, error) { + return _SystemConfig.contract.Transact(opts, "setUnsafeBlockSigner", _unsafeBlockSigner) +} + +// SetUnsafeBlockSigner is a paid mutator transaction binding the contract method 0x18d13918. +// +// Solidity: function setUnsafeBlockSigner(address _unsafeBlockSigner) returns() +func (_SystemConfig *SystemConfigSession) SetUnsafeBlockSigner(_unsafeBlockSigner common.Address) (*types.Transaction, error) { + return _SystemConfig.Contract.SetUnsafeBlockSigner(&_SystemConfig.TransactOpts, _unsafeBlockSigner) +} + +// SetUnsafeBlockSigner is a paid mutator transaction binding the contract method 0x18d13918. +// +// Solidity: function setUnsafeBlockSigner(address _unsafeBlockSigner) returns() +func (_SystemConfig *SystemConfigTransactorSession) SetUnsafeBlockSigner(_unsafeBlockSigner common.Address) (*types.Transaction, error) { + return _SystemConfig.Contract.SetUnsafeBlockSigner(&_SystemConfig.TransactOpts, _unsafeBlockSigner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_SystemConfig *SystemConfigTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { + return _SystemConfig.contract.Transact(opts, "transferOwnership", newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_SystemConfig *SystemConfigSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _SystemConfig.Contract.TransferOwnership(&_SystemConfig.TransactOpts, newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_SystemConfig *SystemConfigTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _SystemConfig.Contract.TransferOwnership(&_SystemConfig.TransactOpts, newOwner) +} + +// SystemConfigConfigUpdateIterator is returned from FilterConfigUpdate and is used to iterate over the raw logs and unpacked data for ConfigUpdate events raised by the SystemConfig contract. +type SystemConfigConfigUpdateIterator struct { + Event *SystemConfigConfigUpdate // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SystemConfigConfigUpdateIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SystemConfigConfigUpdate) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SystemConfigConfigUpdate) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SystemConfigConfigUpdateIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SystemConfigConfigUpdateIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SystemConfigConfigUpdate represents a ConfigUpdate event raised by the SystemConfig contract. +type SystemConfigConfigUpdate struct { + Version *big.Int + UpdateType uint8 + Data []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterConfigUpdate is a free log retrieval operation binding the contract event 0x1d2b0bda21d56b8bd12d4f94ebacffdfb35f5e226f84b461103bb8beab6353be. +// +// Solidity: event ConfigUpdate(uint256 indexed version, uint8 indexed updateType, bytes data) +func (_SystemConfig *SystemConfigFilterer) FilterConfigUpdate(opts *bind.FilterOpts, version []*big.Int, updateType []uint8) (*SystemConfigConfigUpdateIterator, error) { + + var versionRule []interface{} + for _, versionItem := range version { + versionRule = append(versionRule, versionItem) + } + var updateTypeRule []interface{} + for _, updateTypeItem := range updateType { + updateTypeRule = append(updateTypeRule, updateTypeItem) + } + + logs, sub, err := _SystemConfig.contract.FilterLogs(opts, "ConfigUpdate", versionRule, updateTypeRule) + if err != nil { + return nil, err + } + return &SystemConfigConfigUpdateIterator{contract: _SystemConfig.contract, event: "ConfigUpdate", logs: logs, sub: sub}, nil +} + +// WatchConfigUpdate is a free log subscription operation binding the contract event 0x1d2b0bda21d56b8bd12d4f94ebacffdfb35f5e226f84b461103bb8beab6353be. +// +// Solidity: event ConfigUpdate(uint256 indexed version, uint8 indexed updateType, bytes data) +func (_SystemConfig *SystemConfigFilterer) WatchConfigUpdate(opts *bind.WatchOpts, sink chan<- *SystemConfigConfigUpdate, version []*big.Int, updateType []uint8) (event.Subscription, error) { + + var versionRule []interface{} + for _, versionItem := range version { + versionRule = append(versionRule, versionItem) + } + var updateTypeRule []interface{} + for _, updateTypeItem := range updateType { + updateTypeRule = append(updateTypeRule, updateTypeItem) + } + + logs, sub, err := _SystemConfig.contract.WatchLogs(opts, "ConfigUpdate", versionRule, updateTypeRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SystemConfigConfigUpdate) + if err := _SystemConfig.contract.UnpackLog(event, "ConfigUpdate", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseConfigUpdate is a log parse operation binding the contract event 0x1d2b0bda21d56b8bd12d4f94ebacffdfb35f5e226f84b461103bb8beab6353be. +// +// Solidity: event ConfigUpdate(uint256 indexed version, uint8 indexed updateType, bytes data) +func (_SystemConfig *SystemConfigFilterer) ParseConfigUpdate(log types.Log) (*SystemConfigConfigUpdate, error) { + event := new(SystemConfigConfigUpdate) + if err := _SystemConfig.contract.UnpackLog(event, "ConfigUpdate", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SystemConfigInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the SystemConfig contract. +type SystemConfigInitializedIterator struct { + Event *SystemConfigInitialized // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SystemConfigInitializedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SystemConfigInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SystemConfigInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SystemConfigInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SystemConfigInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SystemConfigInitialized represents a Initialized event raised by the SystemConfig contract. +type SystemConfigInitialized struct { + Version uint8 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_SystemConfig *SystemConfigFilterer) FilterInitialized(opts *bind.FilterOpts) (*SystemConfigInitializedIterator, error) { + + logs, sub, err := _SystemConfig.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &SystemConfigInitializedIterator{contract: _SystemConfig.contract, event: "Initialized", logs: logs, sub: sub}, nil +} + +// WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_SystemConfig *SystemConfigFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *SystemConfigInitialized) (event.Subscription, error) { + + logs, sub, err := _SystemConfig.contract.WatchLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SystemConfigInitialized) + if err := _SystemConfig.contract.UnpackLog(event, "Initialized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_SystemConfig *SystemConfigFilterer) ParseInitialized(log types.Log) (*SystemConfigInitialized, error) { + event := new(SystemConfigInitialized) + if err := _SystemConfig.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SystemConfigOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the SystemConfig contract. +type SystemConfigOwnershipTransferredIterator struct { + Event *SystemConfigOwnershipTransferred // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *SystemConfigOwnershipTransferredIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SystemConfigOwnershipTransferred) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SystemConfigOwnershipTransferred) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SystemConfigOwnershipTransferredIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SystemConfigOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SystemConfigOwnershipTransferred represents a OwnershipTransferred event raised by the SystemConfig contract. +type SystemConfigOwnershipTransferred struct { + PreviousOwner common.Address + NewOwner common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_SystemConfig *SystemConfigFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*SystemConfigOwnershipTransferredIterator, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _SystemConfig.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return &SystemConfigOwnershipTransferredIterator{contract: _SystemConfig.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_SystemConfig *SystemConfigFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *SystemConfigOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _SystemConfig.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SystemConfigOwnershipTransferred) + if err := _SystemConfig.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_SystemConfig *SystemConfigFilterer) ParseOwnershipTransferred(log types.Log) (*SystemConfigOwnershipTransferred, error) { + event := new(SystemConfigOwnershipTransferred) + if err := _SystemConfig.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/op-e2e2/bindings/weth.go b/op-e2e2/bindings/weth.go new file mode 100644 index 000000000000..7b2eb50b7951 --- /dev/null +++ b/op-e2e2/bindings/weth.go @@ -0,0 +1,1133 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// WETHMetaData contains all meta data concerning the WETH contract. +var WETHMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"fallback\",\"stateMutability\":\"payable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"allowance\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"approve\",\"inputs\":[{\"name\":\"guy\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"wad\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"balanceOf\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"decimals\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"deposit\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"name\",\"inputs\":[],\"outputs\":[{\"name\":\"name_\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"symbol\",\"inputs\":[],\"outputs\":[{\"name\":\"symbol_\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"totalSupply\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"transfer\",\"inputs\":[{\"name\":\"dst\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"wad\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferFrom\",\"inputs\":[{\"name\":\"src\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"dst\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"wad\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdraw\",\"inputs\":[{\"name\":\"wad\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"Approval\",\"inputs\":[{\"name\":\"src\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"guy\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"wad\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Deposit\",\"inputs\":[{\"name\":\"dst\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"wad\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Transfer\",\"inputs\":[{\"name\":\"src\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"dst\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"wad\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Withdrawal\",\"inputs\":[{\"name\":\"src\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"wad\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false}]", + Bin: "0x608060405234801561001057600080fd5b50610add806100206000396000f3fe6080604052600436106100c05760003560e01c8063313ce56711610074578063a9059cbb1161004e578063a9059cbb146101f8578063d0e30db0146100cf578063dd62ed3e14610218576100cf565b8063313ce5671461018f57806370a08231146101b657806395d89b41146101e3576100cf565b806318160ddd116100a557806318160ddd1461013257806323b872dd1461014f5780632e1a7d4d1461016f576100cf565b806306fdde03146100d7578063095ea7b314610102576100cf565b366100cf576100cd610250565b005b6100cd610250565b3480156100e357600080fd5b506100ec6102ab565b6040516100f991906107a7565b60405180910390f35b34801561010e57600080fd5b5061012261011d366004610821565b610376565b60405190151581526020016100f9565b34801561013e57600080fd5b50475b6040519081526020016100f9565b34801561015b57600080fd5b5061012261016a36600461084b565b6103ef565b34801561017b57600080fd5b506100cd61018a366004610887565b610606565b34801561019b57600080fd5b506101a4601281565b60405160ff90911681526020016100f9565b3480156101c257600080fd5b506101416101d13660046108a0565b60006020819052908152604090205481565b3480156101ef57600080fd5b506100ec6106ac565b34801561020457600080fd5b50610122610213366004610821565b610763565b34801561022457600080fd5b506101416102333660046108bb565b600160209081526000928352604080842090915290825290205481565b336000908152602081905260408120805434929061026f90849061091d565b909155505060405134815233907fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9060200160405180910390a2565b606073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663d84447156040518163ffffffff1660e01b8152600401600060405180830381865afa15801561030c573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526103529190810190610964565b6040516020016103629190610a2f565b604051602081830303815290604052905090565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906103de9086815260200190565b60405180910390a350600192915050565b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604081205482111561042157600080fd5b73ffffffffffffffffffffffffffffffffffffffff84163314801590610497575073ffffffffffffffffffffffffffffffffffffffff841660009081526001602090815260408083203384529091529020547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14155b1561051f5773ffffffffffffffffffffffffffffffffffffffff841660009081526001602090815260408083203384529091529020548211156104d957600080fd5b73ffffffffffffffffffffffffffffffffffffffff8416600090815260016020908152604080832033845290915281208054849290610519908490610a74565b90915550505b73ffffffffffffffffffffffffffffffffffffffff841660009081526020819052604081208054849290610554908490610a74565b909155505073ffffffffffffffffffffffffffffffffffffffff83166000908152602081905260408120805484929061058e90849061091d565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516105f491815260200190565b60405180910390a35060019392505050565b3360009081526020819052604090205481111561062257600080fd5b3360009081526020819052604081208054839290610641908490610a74565b9091555050604051339082156108fc029083906000818181858888f19350505050158015610673573d6000803e3d6000fd5b5060405181815233907f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b659060200160405180910390a250565b606073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff1663550fcdc96040518163ffffffff1660e01b8152600401600060405180830381865afa15801561070d573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526107539190810190610964565b6040516020016103629190610a8b565b60006107703384846103ef565b9392505050565b60005b8381101561079257818101518382015260200161077a565b838111156107a1576000848401525b50505050565b60208152600082518060208401526107c6816040850160208701610777565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461081c57600080fd5b919050565b6000806040838503121561083457600080fd5b61083d836107f8565b946020939093013593505050565b60008060006060848603121561086057600080fd5b610869846107f8565b9250610877602085016107f8565b9150604084013590509250925092565b60006020828403121561089957600080fd5b5035919050565b6000602082840312156108b257600080fd5b610770826107f8565b600080604083850312156108ce57600080fd5b6108d7836107f8565b91506108e5602084016107f8565b90509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008219821115610930576109306108ee565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006020828403121561097657600080fd5b815167ffffffffffffffff8082111561098e57600080fd5b818401915084601f8301126109a257600080fd5b8151818111156109b4576109b4610935565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156109fa576109fa610935565b81604052828152876020848701011115610a1357600080fd5b610a24836020830160208801610777565b979650505050505050565b7f5772617070656420000000000000000000000000000000000000000000000000815260008251610a67816008850160208701610777565b9190910160080192915050565b600082821015610a8657610a866108ee565b500390565b7f5700000000000000000000000000000000000000000000000000000000000000815260008251610ac3816001850160208701610777565b919091016001019291505056fea164736f6c634300080f000a", +} + +// WETHABI is the input ABI used to generate the binding from. +// Deprecated: Use WETHMetaData.ABI instead. +var WETHABI = WETHMetaData.ABI + +// WETHBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use WETHMetaData.Bin instead. +var WETHBin = WETHMetaData.Bin + +// DeployWETH deploys a new Ethereum contract, binding an instance of WETH to it. +func DeployWETH(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *WETH, error) { + parsed, err := WETHMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(WETHBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &WETH{WETHCaller: WETHCaller{contract: contract}, WETHTransactor: WETHTransactor{contract: contract}, WETHFilterer: WETHFilterer{contract: contract}}, nil +} + +// WETH is an auto generated Go binding around an Ethereum contract. +type WETH struct { + WETHCaller // Read-only binding to the contract + WETHTransactor // Write-only binding to the contract + WETHFilterer // Log filterer for contract events +} + +// WETHCaller is an auto generated read-only Go binding around an Ethereum contract. +type WETHCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// WETHTransactor is an auto generated write-only Go binding around an Ethereum contract. +type WETHTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// WETHFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type WETHFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// WETHSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type WETHSession struct { + Contract *WETH // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// WETHCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type WETHCallerSession struct { + Contract *WETHCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// WETHTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type WETHTransactorSession struct { + Contract *WETHTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// WETHRaw is an auto generated low-level Go binding around an Ethereum contract. +type WETHRaw struct { + Contract *WETH // Generic contract binding to access the raw methods on +} + +// WETHCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type WETHCallerRaw struct { + Contract *WETHCaller // Generic read-only contract binding to access the raw methods on +} + +// WETHTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type WETHTransactorRaw struct { + Contract *WETHTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewWETH creates a new instance of WETH, bound to a specific deployed contract. +func NewWETH(address common.Address, backend bind.ContractBackend) (*WETH, error) { + contract, err := bindWETH(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &WETH{WETHCaller: WETHCaller{contract: contract}, WETHTransactor: WETHTransactor{contract: contract}, WETHFilterer: WETHFilterer{contract: contract}}, nil +} + +// NewWETHCaller creates a new read-only instance of WETH, bound to a specific deployed contract. +func NewWETHCaller(address common.Address, caller bind.ContractCaller) (*WETHCaller, error) { + contract, err := bindWETH(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &WETHCaller{contract: contract}, nil +} + +// NewWETHTransactor creates a new write-only instance of WETH, bound to a specific deployed contract. +func NewWETHTransactor(address common.Address, transactor bind.ContractTransactor) (*WETHTransactor, error) { + contract, err := bindWETH(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &WETHTransactor{contract: contract}, nil +} + +// NewWETHFilterer creates a new log filterer instance of WETH, bound to a specific deployed contract. +func NewWETHFilterer(address common.Address, filterer bind.ContractFilterer) (*WETHFilterer, error) { + contract, err := bindWETH(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &WETHFilterer{contract: contract}, nil +} + +// bindWETH binds a generic wrapper to an already deployed contract. +func bindWETH(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(WETHABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_WETH *WETHRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _WETH.Contract.WETHCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_WETH *WETHRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _WETH.Contract.WETHTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_WETH *WETHRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _WETH.Contract.WETHTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_WETH *WETHCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _WETH.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_WETH *WETHTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _WETH.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_WETH *WETHTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _WETH.Contract.contract.Transact(opts, method, params...) +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address , address ) view returns(uint256) +func (_WETH *WETHCaller) Allowance(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address) (*big.Int, error) { + var out []interface{} + err := _WETH.contract.Call(opts, &out, "allowance", arg0, arg1) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address , address ) view returns(uint256) +func (_WETH *WETHSession) Allowance(arg0 common.Address, arg1 common.Address) (*big.Int, error) { + return _WETH.Contract.Allowance(&_WETH.CallOpts, arg0, arg1) +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address , address ) view returns(uint256) +func (_WETH *WETHCallerSession) Allowance(arg0 common.Address, arg1 common.Address) (*big.Int, error) { + return _WETH.Contract.Allowance(&_WETH.CallOpts, arg0, arg1) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address ) view returns(uint256) +func (_WETH *WETHCaller) BalanceOf(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { + var out []interface{} + err := _WETH.contract.Call(opts, &out, "balanceOf", arg0) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address ) view returns(uint256) +func (_WETH *WETHSession) BalanceOf(arg0 common.Address) (*big.Int, error) { + return _WETH.Contract.BalanceOf(&_WETH.CallOpts, arg0) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address ) view returns(uint256) +func (_WETH *WETHCallerSession) BalanceOf(arg0 common.Address) (*big.Int, error) { + return _WETH.Contract.BalanceOf(&_WETH.CallOpts, arg0) +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_WETH *WETHCaller) Decimals(opts *bind.CallOpts) (uint8, error) { + var out []interface{} + err := _WETH.contract.Call(opts, &out, "decimals") + + if err != nil { + return *new(uint8), err + } + + out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) + + return out0, err + +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_WETH *WETHSession) Decimals() (uint8, error) { + return _WETH.Contract.Decimals(&_WETH.CallOpts) +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_WETH *WETHCallerSession) Decimals() (uint8, error) { + return _WETH.Contract.Decimals(&_WETH.CallOpts) +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string name_) +func (_WETH *WETHCaller) Name(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _WETH.contract.Call(opts, &out, "name") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string name_) +func (_WETH *WETHSession) Name() (string, error) { + return _WETH.Contract.Name(&_WETH.CallOpts) +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string name_) +func (_WETH *WETHCallerSession) Name() (string, error) { + return _WETH.Contract.Name(&_WETH.CallOpts) +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string symbol_) +func (_WETH *WETHCaller) Symbol(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _WETH.contract.Call(opts, &out, "symbol") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string symbol_) +func (_WETH *WETHSession) Symbol() (string, error) { + return _WETH.Contract.Symbol(&_WETH.CallOpts) +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string symbol_) +func (_WETH *WETHCallerSession) Symbol() (string, error) { + return _WETH.Contract.Symbol(&_WETH.CallOpts) +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_WETH *WETHCaller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _WETH.contract.Call(opts, &out, "totalSupply") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_WETH *WETHSession) TotalSupply() (*big.Int, error) { + return _WETH.Contract.TotalSupply(&_WETH.CallOpts) +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_WETH *WETHCallerSession) TotalSupply() (*big.Int, error) { + return _WETH.Contract.TotalSupply(&_WETH.CallOpts) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address guy, uint256 wad) returns(bool) +func (_WETH *WETHTransactor) Approve(opts *bind.TransactOpts, guy common.Address, wad *big.Int) (*types.Transaction, error) { + return _WETH.contract.Transact(opts, "approve", guy, wad) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address guy, uint256 wad) returns(bool) +func (_WETH *WETHSession) Approve(guy common.Address, wad *big.Int) (*types.Transaction, error) { + return _WETH.Contract.Approve(&_WETH.TransactOpts, guy, wad) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address guy, uint256 wad) returns(bool) +func (_WETH *WETHTransactorSession) Approve(guy common.Address, wad *big.Int) (*types.Transaction, error) { + return _WETH.Contract.Approve(&_WETH.TransactOpts, guy, wad) +} + +// Deposit is a paid mutator transaction binding the contract method 0xd0e30db0. +// +// Solidity: function deposit() payable returns() +func (_WETH *WETHTransactor) Deposit(opts *bind.TransactOpts) (*types.Transaction, error) { + return _WETH.contract.Transact(opts, "deposit") +} + +// Deposit is a paid mutator transaction binding the contract method 0xd0e30db0. +// +// Solidity: function deposit() payable returns() +func (_WETH *WETHSession) Deposit() (*types.Transaction, error) { + return _WETH.Contract.Deposit(&_WETH.TransactOpts) +} + +// Deposit is a paid mutator transaction binding the contract method 0xd0e30db0. +// +// Solidity: function deposit() payable returns() +func (_WETH *WETHTransactorSession) Deposit() (*types.Transaction, error) { + return _WETH.Contract.Deposit(&_WETH.TransactOpts) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address dst, uint256 wad) returns(bool) +func (_WETH *WETHTransactor) Transfer(opts *bind.TransactOpts, dst common.Address, wad *big.Int) (*types.Transaction, error) { + return _WETH.contract.Transact(opts, "transfer", dst, wad) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address dst, uint256 wad) returns(bool) +func (_WETH *WETHSession) Transfer(dst common.Address, wad *big.Int) (*types.Transaction, error) { + return _WETH.Contract.Transfer(&_WETH.TransactOpts, dst, wad) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address dst, uint256 wad) returns(bool) +func (_WETH *WETHTransactorSession) Transfer(dst common.Address, wad *big.Int) (*types.Transaction, error) { + return _WETH.Contract.Transfer(&_WETH.TransactOpts, dst, wad) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address src, address dst, uint256 wad) returns(bool) +func (_WETH *WETHTransactor) TransferFrom(opts *bind.TransactOpts, src common.Address, dst common.Address, wad *big.Int) (*types.Transaction, error) { + return _WETH.contract.Transact(opts, "transferFrom", src, dst, wad) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address src, address dst, uint256 wad) returns(bool) +func (_WETH *WETHSession) TransferFrom(src common.Address, dst common.Address, wad *big.Int) (*types.Transaction, error) { + return _WETH.Contract.TransferFrom(&_WETH.TransactOpts, src, dst, wad) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address src, address dst, uint256 wad) returns(bool) +func (_WETH *WETHTransactorSession) TransferFrom(src common.Address, dst common.Address, wad *big.Int) (*types.Transaction, error) { + return _WETH.Contract.TransferFrom(&_WETH.TransactOpts, src, dst, wad) +} + +// Withdraw is a paid mutator transaction binding the contract method 0x2e1a7d4d. +// +// Solidity: function withdraw(uint256 wad) returns() +func (_WETH *WETHTransactor) Withdraw(opts *bind.TransactOpts, wad *big.Int) (*types.Transaction, error) { + return _WETH.contract.Transact(opts, "withdraw", wad) +} + +// Withdraw is a paid mutator transaction binding the contract method 0x2e1a7d4d. +// +// Solidity: function withdraw(uint256 wad) returns() +func (_WETH *WETHSession) Withdraw(wad *big.Int) (*types.Transaction, error) { + return _WETH.Contract.Withdraw(&_WETH.TransactOpts, wad) +} + +// Withdraw is a paid mutator transaction binding the contract method 0x2e1a7d4d. +// +// Solidity: function withdraw(uint256 wad) returns() +func (_WETH *WETHTransactorSession) Withdraw(wad *big.Int) (*types.Transaction, error) { + return _WETH.Contract.Withdraw(&_WETH.TransactOpts, wad) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() payable returns() +func (_WETH *WETHTransactor) Fallback(opts *bind.TransactOpts, calldata []byte) (*types.Transaction, error) { + return _WETH.contract.RawTransact(opts, calldata) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() payable returns() +func (_WETH *WETHSession) Fallback(calldata []byte) (*types.Transaction, error) { + return _WETH.Contract.Fallback(&_WETH.TransactOpts, calldata) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() payable returns() +func (_WETH *WETHTransactorSession) Fallback(calldata []byte) (*types.Transaction, error) { + return _WETH.Contract.Fallback(&_WETH.TransactOpts, calldata) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_WETH *WETHTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { + return _WETH.contract.RawTransact(opts, nil) // calldata is disallowed for receive function +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_WETH *WETHSession) Receive() (*types.Transaction, error) { + return _WETH.Contract.Receive(&_WETH.TransactOpts) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_WETH *WETHTransactorSession) Receive() (*types.Transaction, error) { + return _WETH.Contract.Receive(&_WETH.TransactOpts) +} + +// WETHApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the WETH contract. +type WETHApprovalIterator struct { + Event *WETHApproval // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *WETHApprovalIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(WETHApproval) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(WETHApproval) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *WETHApprovalIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *WETHApprovalIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// WETHApproval represents a Approval event raised by the WETH contract. +type WETHApproval struct { + Src common.Address + Guy common.Address + Wad *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed src, address indexed guy, uint256 wad) +func (_WETH *WETHFilterer) FilterApproval(opts *bind.FilterOpts, src []common.Address, guy []common.Address) (*WETHApprovalIterator, error) { + + var srcRule []interface{} + for _, srcItem := range src { + srcRule = append(srcRule, srcItem) + } + var guyRule []interface{} + for _, guyItem := range guy { + guyRule = append(guyRule, guyItem) + } + + logs, sub, err := _WETH.contract.FilterLogs(opts, "Approval", srcRule, guyRule) + if err != nil { + return nil, err + } + return &WETHApprovalIterator{contract: _WETH.contract, event: "Approval", logs: logs, sub: sub}, nil +} + +// WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed src, address indexed guy, uint256 wad) +func (_WETH *WETHFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *WETHApproval, src []common.Address, guy []common.Address) (event.Subscription, error) { + + var srcRule []interface{} + for _, srcItem := range src { + srcRule = append(srcRule, srcItem) + } + var guyRule []interface{} + for _, guyItem := range guy { + guyRule = append(guyRule, guyItem) + } + + logs, sub, err := _WETH.contract.WatchLogs(opts, "Approval", srcRule, guyRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(WETHApproval) + if err := _WETH.contract.UnpackLog(event, "Approval", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed src, address indexed guy, uint256 wad) +func (_WETH *WETHFilterer) ParseApproval(log types.Log) (*WETHApproval, error) { + event := new(WETHApproval) + if err := _WETH.contract.UnpackLog(event, "Approval", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// WETHDepositIterator is returned from FilterDeposit and is used to iterate over the raw logs and unpacked data for Deposit events raised by the WETH contract. +type WETHDepositIterator struct { + Event *WETHDeposit // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *WETHDepositIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(WETHDeposit) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(WETHDeposit) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *WETHDepositIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *WETHDepositIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// WETHDeposit represents a Deposit event raised by the WETH contract. +type WETHDeposit struct { + Dst common.Address + Wad *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterDeposit is a free log retrieval operation binding the contract event 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c. +// +// Solidity: event Deposit(address indexed dst, uint256 wad) +func (_WETH *WETHFilterer) FilterDeposit(opts *bind.FilterOpts, dst []common.Address) (*WETHDepositIterator, error) { + + var dstRule []interface{} + for _, dstItem := range dst { + dstRule = append(dstRule, dstItem) + } + + logs, sub, err := _WETH.contract.FilterLogs(opts, "Deposit", dstRule) + if err != nil { + return nil, err + } + return &WETHDepositIterator{contract: _WETH.contract, event: "Deposit", logs: logs, sub: sub}, nil +} + +// WatchDeposit is a free log subscription operation binding the contract event 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c. +// +// Solidity: event Deposit(address indexed dst, uint256 wad) +func (_WETH *WETHFilterer) WatchDeposit(opts *bind.WatchOpts, sink chan<- *WETHDeposit, dst []common.Address) (event.Subscription, error) { + + var dstRule []interface{} + for _, dstItem := range dst { + dstRule = append(dstRule, dstItem) + } + + logs, sub, err := _WETH.contract.WatchLogs(opts, "Deposit", dstRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(WETHDeposit) + if err := _WETH.contract.UnpackLog(event, "Deposit", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseDeposit is a log parse operation binding the contract event 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c. +// +// Solidity: event Deposit(address indexed dst, uint256 wad) +func (_WETH *WETHFilterer) ParseDeposit(log types.Log) (*WETHDeposit, error) { + event := new(WETHDeposit) + if err := _WETH.contract.UnpackLog(event, "Deposit", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// WETHTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the WETH contract. +type WETHTransferIterator struct { + Event *WETHTransfer // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *WETHTransferIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(WETHTransfer) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(WETHTransfer) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *WETHTransferIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *WETHTransferIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// WETHTransfer represents a Transfer event raised by the WETH contract. +type WETHTransfer struct { + Src common.Address + Dst common.Address + Wad *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed src, address indexed dst, uint256 wad) +func (_WETH *WETHFilterer) FilterTransfer(opts *bind.FilterOpts, src []common.Address, dst []common.Address) (*WETHTransferIterator, error) { + + var srcRule []interface{} + for _, srcItem := range src { + srcRule = append(srcRule, srcItem) + } + var dstRule []interface{} + for _, dstItem := range dst { + dstRule = append(dstRule, dstItem) + } + + logs, sub, err := _WETH.contract.FilterLogs(opts, "Transfer", srcRule, dstRule) + if err != nil { + return nil, err + } + return &WETHTransferIterator{contract: _WETH.contract, event: "Transfer", logs: logs, sub: sub}, nil +} + +// WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed src, address indexed dst, uint256 wad) +func (_WETH *WETHFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *WETHTransfer, src []common.Address, dst []common.Address) (event.Subscription, error) { + + var srcRule []interface{} + for _, srcItem := range src { + srcRule = append(srcRule, srcItem) + } + var dstRule []interface{} + for _, dstItem := range dst { + dstRule = append(dstRule, dstItem) + } + + logs, sub, err := _WETH.contract.WatchLogs(opts, "Transfer", srcRule, dstRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(WETHTransfer) + if err := _WETH.contract.UnpackLog(event, "Transfer", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed src, address indexed dst, uint256 wad) +func (_WETH *WETHFilterer) ParseTransfer(log types.Log) (*WETHTransfer, error) { + event := new(WETHTransfer) + if err := _WETH.contract.UnpackLog(event, "Transfer", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// WETHWithdrawalIterator is returned from FilterWithdrawal and is used to iterate over the raw logs and unpacked data for Withdrawal events raised by the WETH contract. +type WETHWithdrawalIterator struct { + Event *WETHWithdrawal // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *WETHWithdrawalIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(WETHWithdrawal) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(WETHWithdrawal) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *WETHWithdrawalIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *WETHWithdrawalIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// WETHWithdrawal represents a Withdrawal event raised by the WETH contract. +type WETHWithdrawal struct { + Src common.Address + Wad *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterWithdrawal is a free log retrieval operation binding the contract event 0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65. +// +// Solidity: event Withdrawal(address indexed src, uint256 wad) +func (_WETH *WETHFilterer) FilterWithdrawal(opts *bind.FilterOpts, src []common.Address) (*WETHWithdrawalIterator, error) { + + var srcRule []interface{} + for _, srcItem := range src { + srcRule = append(srcRule, srcItem) + } + + logs, sub, err := _WETH.contract.FilterLogs(opts, "Withdrawal", srcRule) + if err != nil { + return nil, err + } + return &WETHWithdrawalIterator{contract: _WETH.contract, event: "Withdrawal", logs: logs, sub: sub}, nil +} + +// WatchWithdrawal is a free log subscription operation binding the contract event 0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65. +// +// Solidity: event Withdrawal(address indexed src, uint256 wad) +func (_WETH *WETHFilterer) WatchWithdrawal(opts *bind.WatchOpts, sink chan<- *WETHWithdrawal, src []common.Address) (event.Subscription, error) { + + var srcRule []interface{} + for _, srcItem := range src { + srcRule = append(srcRule, srcItem) + } + + logs, sub, err := _WETH.contract.WatchLogs(opts, "Withdrawal", srcRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(WETHWithdrawal) + if err := _WETH.contract.UnpackLog(event, "Withdrawal", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseWithdrawal is a log parse operation binding the contract event 0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65. +// +// Solidity: event Withdrawal(address indexed src, uint256 wad) +func (_WETH *WETHFilterer) ParseWithdrawal(log types.Log) (*WETHWithdrawal, error) { + event := new(WETHWithdrawal) + if err := _WETH.contract.UnpackLog(event, "Withdrawal", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/op-e2e2/bindings/weth9.go b/op-e2e2/bindings/weth9.go new file mode 100644 index 000000000000..043b4fcce7dd --- /dev/null +++ b/op-e2e2/bindings/weth9.go @@ -0,0 +1,1112 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// WETH9MetaData contains all meta data concerning the WETH9 contract. +var WETH9MetaData = &bind.MetaData{ + ABI: "[{\"type\":\"fallback\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"allowance\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"approve\",\"inputs\":[{\"name\":\"guy\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"wad\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"balanceOf\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"decimals\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"deposit\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"name\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"symbol\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"totalSupply\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"transfer\",\"inputs\":[{\"name\":\"dst\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"wad\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferFrom\",\"inputs\":[{\"name\":\"src\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"dst\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"wad\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdraw\",\"inputs\":[{\"name\":\"wad\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"Approval\",\"inputs\":[{\"name\":\"src\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"guy\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"wad\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Deposit\",\"inputs\":[{\"name\":\"dst\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"wad\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Transfer\",\"inputs\":[{\"name\":\"src\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"dst\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"wad\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Withdrawal\",\"inputs\":[{\"name\":\"src\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"wad\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false}]", + Bin: "0x60c0604052600d60808190526c2bb930b83832b21022ba3432b960991b60a090815261002e916000919061007a565b50604080518082019091526004808252630ae8aa8960e31b602090920191825261005a9160019161007a565b506002805460ff1916601217905534801561007457600080fd5b50610115565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106100bb57805160ff19168380011785556100e8565b828001600101855582156100e8579182015b828111156100e85782518255916020019190600101906100cd565b506100f49291506100f8565b5090565b61011291905b808211156100f457600081556001016100fe565b90565b6107f9806101246000396000f3fe6080604052600436106100bc5760003560e01c8063313ce56711610074578063a9059cbb1161004e578063a9059cbb146102cb578063d0e30db0146100bc578063dd62ed3e14610311576100bc565b8063313ce5671461024b57806370a082311461027657806395d89b41146102b6576100bc565b806318160ddd116100a557806318160ddd146101aa57806323b872dd146101d15780632e1a7d4d14610221576100bc565b806306fdde03146100c6578063095ea7b314610150575b6100c4610359565b005b3480156100d257600080fd5b506100db6103a8565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101155781810151838201526020016100fd565b50505050905090810190601f1680156101425780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015c57600080fd5b506101966004803603604081101561017357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610454565b604080519115158252519081900360200190f35b3480156101b657600080fd5b506101bf6104c7565b60408051918252519081900360200190f35b3480156101dd57600080fd5b50610196600480360360608110156101f457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135811691602081013590911690604001356104cb565b34801561022d57600080fd5b506100c46004803603602081101561024457600080fd5b503561066b565b34801561025757600080fd5b50610260610700565b6040805160ff9092168252519081900360200190f35b34801561028257600080fd5b506101bf6004803603602081101561029957600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610709565b3480156102c257600080fd5b506100db61071b565b3480156102d757600080fd5b50610196600480360360408110156102ee57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610793565b34801561031d57600080fd5b506101bf6004803603604081101561033457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160200135166107a7565b33600081815260036020908152604091829020805434908101909155825190815291517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9281900390910190a2565b6000805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f8101849004840282018401909252818152929183018282801561044c5780601f106104215761010080835404028352916020019161044c565b820191906000526020600020905b81548152906001019060200180831161042f57829003601f168201915b505050505081565b33600081815260046020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b4790565b73ffffffffffffffffffffffffffffffffffffffff83166000908152600360205260408120548211156104fd57600080fd5b73ffffffffffffffffffffffffffffffffffffffff84163314801590610573575073ffffffffffffffffffffffffffffffffffffffff841660009081526004602090815260408083203384529091529020547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14155b156105ed5773ffffffffffffffffffffffffffffffffffffffff841660009081526004602090815260408083203384529091529020548211156105b557600080fd5b73ffffffffffffffffffffffffffffffffffffffff841660009081526004602090815260408083203384529091529020805483900390555b73ffffffffffffffffffffffffffffffffffffffff808516600081815260036020908152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060019392505050565b3360009081526003602052604090205481111561068757600080fd5b33600081815260036020526040808220805485900390555183156108fc0291849190818181858888f193505050501580156106c6573d6000803e3d6000fd5b5060408051828152905133917f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65919081900360200190a250565b60025460ff1681565b60036020526000908152604090205481565b60018054604080516020600284861615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f8101849004840282018401909252818152929183018282801561044c5780601f106104215761010080835404028352916020019161044c565b60006107a03384846104cb565b9392505050565b60046020908152600092835260408084209091529082529020548156fea265627a7a72315820d9a21886186e04516cbdaa611a54950fabc4d47164691bf70de28f6c54060de964736f6c63430005110032", +} + +// WETH9ABI is the input ABI used to generate the binding from. +// Deprecated: Use WETH9MetaData.ABI instead. +var WETH9ABI = WETH9MetaData.ABI + +// WETH9Bin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use WETH9MetaData.Bin instead. +var WETH9Bin = WETH9MetaData.Bin + +// DeployWETH9 deploys a new Ethereum contract, binding an instance of WETH9 to it. +func DeployWETH9(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *WETH9, error) { + parsed, err := WETH9MetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(WETH9Bin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &WETH9{WETH9Caller: WETH9Caller{contract: contract}, WETH9Transactor: WETH9Transactor{contract: contract}, WETH9Filterer: WETH9Filterer{contract: contract}}, nil +} + +// WETH9 is an auto generated Go binding around an Ethereum contract. +type WETH9 struct { + WETH9Caller // Read-only binding to the contract + WETH9Transactor // Write-only binding to the contract + WETH9Filterer // Log filterer for contract events +} + +// WETH9Caller is an auto generated read-only Go binding around an Ethereum contract. +type WETH9Caller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// WETH9Transactor is an auto generated write-only Go binding around an Ethereum contract. +type WETH9Transactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// WETH9Filterer is an auto generated log filtering Go binding around an Ethereum contract events. +type WETH9Filterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// WETH9Session is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type WETH9Session struct { + Contract *WETH9 // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// WETH9CallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type WETH9CallerSession struct { + Contract *WETH9Caller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// WETH9TransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type WETH9TransactorSession struct { + Contract *WETH9Transactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// WETH9Raw is an auto generated low-level Go binding around an Ethereum contract. +type WETH9Raw struct { + Contract *WETH9 // Generic contract binding to access the raw methods on +} + +// WETH9CallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type WETH9CallerRaw struct { + Contract *WETH9Caller // Generic read-only contract binding to access the raw methods on +} + +// WETH9TransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type WETH9TransactorRaw struct { + Contract *WETH9Transactor // Generic write-only contract binding to access the raw methods on +} + +// NewWETH9 creates a new instance of WETH9, bound to a specific deployed contract. +func NewWETH9(address common.Address, backend bind.ContractBackend) (*WETH9, error) { + contract, err := bindWETH9(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &WETH9{WETH9Caller: WETH9Caller{contract: contract}, WETH9Transactor: WETH9Transactor{contract: contract}, WETH9Filterer: WETH9Filterer{contract: contract}}, nil +} + +// NewWETH9Caller creates a new read-only instance of WETH9, bound to a specific deployed contract. +func NewWETH9Caller(address common.Address, caller bind.ContractCaller) (*WETH9Caller, error) { + contract, err := bindWETH9(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &WETH9Caller{contract: contract}, nil +} + +// NewWETH9Transactor creates a new write-only instance of WETH9, bound to a specific deployed contract. +func NewWETH9Transactor(address common.Address, transactor bind.ContractTransactor) (*WETH9Transactor, error) { + contract, err := bindWETH9(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &WETH9Transactor{contract: contract}, nil +} + +// NewWETH9Filterer creates a new log filterer instance of WETH9, bound to a specific deployed contract. +func NewWETH9Filterer(address common.Address, filterer bind.ContractFilterer) (*WETH9Filterer, error) { + contract, err := bindWETH9(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &WETH9Filterer{contract: contract}, nil +} + +// bindWETH9 binds a generic wrapper to an already deployed contract. +func bindWETH9(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(WETH9ABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_WETH9 *WETH9Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _WETH9.Contract.WETH9Caller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_WETH9 *WETH9Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _WETH9.Contract.WETH9Transactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_WETH9 *WETH9Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _WETH9.Contract.WETH9Transactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_WETH9 *WETH9CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _WETH9.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_WETH9 *WETH9TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _WETH9.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_WETH9 *WETH9TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _WETH9.Contract.contract.Transact(opts, method, params...) +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address , address ) view returns(uint256) +func (_WETH9 *WETH9Caller) Allowance(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address) (*big.Int, error) { + var out []interface{} + err := _WETH9.contract.Call(opts, &out, "allowance", arg0, arg1) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address , address ) view returns(uint256) +func (_WETH9 *WETH9Session) Allowance(arg0 common.Address, arg1 common.Address) (*big.Int, error) { + return _WETH9.Contract.Allowance(&_WETH9.CallOpts, arg0, arg1) +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address , address ) view returns(uint256) +func (_WETH9 *WETH9CallerSession) Allowance(arg0 common.Address, arg1 common.Address) (*big.Int, error) { + return _WETH9.Contract.Allowance(&_WETH9.CallOpts, arg0, arg1) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address ) view returns(uint256) +func (_WETH9 *WETH9Caller) BalanceOf(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { + var out []interface{} + err := _WETH9.contract.Call(opts, &out, "balanceOf", arg0) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address ) view returns(uint256) +func (_WETH9 *WETH9Session) BalanceOf(arg0 common.Address) (*big.Int, error) { + return _WETH9.Contract.BalanceOf(&_WETH9.CallOpts, arg0) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address ) view returns(uint256) +func (_WETH9 *WETH9CallerSession) BalanceOf(arg0 common.Address) (*big.Int, error) { + return _WETH9.Contract.BalanceOf(&_WETH9.CallOpts, arg0) +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_WETH9 *WETH9Caller) Decimals(opts *bind.CallOpts) (uint8, error) { + var out []interface{} + err := _WETH9.contract.Call(opts, &out, "decimals") + + if err != nil { + return *new(uint8), err + } + + out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) + + return out0, err + +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_WETH9 *WETH9Session) Decimals() (uint8, error) { + return _WETH9.Contract.Decimals(&_WETH9.CallOpts) +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_WETH9 *WETH9CallerSession) Decimals() (uint8, error) { + return _WETH9.Contract.Decimals(&_WETH9.CallOpts) +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_WETH9 *WETH9Caller) Name(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _WETH9.contract.Call(opts, &out, "name") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_WETH9 *WETH9Session) Name() (string, error) { + return _WETH9.Contract.Name(&_WETH9.CallOpts) +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_WETH9 *WETH9CallerSession) Name() (string, error) { + return _WETH9.Contract.Name(&_WETH9.CallOpts) +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_WETH9 *WETH9Caller) Symbol(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _WETH9.contract.Call(opts, &out, "symbol") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_WETH9 *WETH9Session) Symbol() (string, error) { + return _WETH9.Contract.Symbol(&_WETH9.CallOpts) +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_WETH9 *WETH9CallerSession) Symbol() (string, error) { + return _WETH9.Contract.Symbol(&_WETH9.CallOpts) +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_WETH9 *WETH9Caller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _WETH9.contract.Call(opts, &out, "totalSupply") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_WETH9 *WETH9Session) TotalSupply() (*big.Int, error) { + return _WETH9.Contract.TotalSupply(&_WETH9.CallOpts) +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_WETH9 *WETH9CallerSession) TotalSupply() (*big.Int, error) { + return _WETH9.Contract.TotalSupply(&_WETH9.CallOpts) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address guy, uint256 wad) returns(bool) +func (_WETH9 *WETH9Transactor) Approve(opts *bind.TransactOpts, guy common.Address, wad *big.Int) (*types.Transaction, error) { + return _WETH9.contract.Transact(opts, "approve", guy, wad) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address guy, uint256 wad) returns(bool) +func (_WETH9 *WETH9Session) Approve(guy common.Address, wad *big.Int) (*types.Transaction, error) { + return _WETH9.Contract.Approve(&_WETH9.TransactOpts, guy, wad) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address guy, uint256 wad) returns(bool) +func (_WETH9 *WETH9TransactorSession) Approve(guy common.Address, wad *big.Int) (*types.Transaction, error) { + return _WETH9.Contract.Approve(&_WETH9.TransactOpts, guy, wad) +} + +// Deposit is a paid mutator transaction binding the contract method 0xd0e30db0. +// +// Solidity: function deposit() payable returns() +func (_WETH9 *WETH9Transactor) Deposit(opts *bind.TransactOpts) (*types.Transaction, error) { + return _WETH9.contract.Transact(opts, "deposit") +} + +// Deposit is a paid mutator transaction binding the contract method 0xd0e30db0. +// +// Solidity: function deposit() payable returns() +func (_WETH9 *WETH9Session) Deposit() (*types.Transaction, error) { + return _WETH9.Contract.Deposit(&_WETH9.TransactOpts) +} + +// Deposit is a paid mutator transaction binding the contract method 0xd0e30db0. +// +// Solidity: function deposit() payable returns() +func (_WETH9 *WETH9TransactorSession) Deposit() (*types.Transaction, error) { + return _WETH9.Contract.Deposit(&_WETH9.TransactOpts) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address dst, uint256 wad) returns(bool) +func (_WETH9 *WETH9Transactor) Transfer(opts *bind.TransactOpts, dst common.Address, wad *big.Int) (*types.Transaction, error) { + return _WETH9.contract.Transact(opts, "transfer", dst, wad) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address dst, uint256 wad) returns(bool) +func (_WETH9 *WETH9Session) Transfer(dst common.Address, wad *big.Int) (*types.Transaction, error) { + return _WETH9.Contract.Transfer(&_WETH9.TransactOpts, dst, wad) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address dst, uint256 wad) returns(bool) +func (_WETH9 *WETH9TransactorSession) Transfer(dst common.Address, wad *big.Int) (*types.Transaction, error) { + return _WETH9.Contract.Transfer(&_WETH9.TransactOpts, dst, wad) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address src, address dst, uint256 wad) returns(bool) +func (_WETH9 *WETH9Transactor) TransferFrom(opts *bind.TransactOpts, src common.Address, dst common.Address, wad *big.Int) (*types.Transaction, error) { + return _WETH9.contract.Transact(opts, "transferFrom", src, dst, wad) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address src, address dst, uint256 wad) returns(bool) +func (_WETH9 *WETH9Session) TransferFrom(src common.Address, dst common.Address, wad *big.Int) (*types.Transaction, error) { + return _WETH9.Contract.TransferFrom(&_WETH9.TransactOpts, src, dst, wad) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address src, address dst, uint256 wad) returns(bool) +func (_WETH9 *WETH9TransactorSession) TransferFrom(src common.Address, dst common.Address, wad *big.Int) (*types.Transaction, error) { + return _WETH9.Contract.TransferFrom(&_WETH9.TransactOpts, src, dst, wad) +} + +// Withdraw is a paid mutator transaction binding the contract method 0x2e1a7d4d. +// +// Solidity: function withdraw(uint256 wad) returns() +func (_WETH9 *WETH9Transactor) Withdraw(opts *bind.TransactOpts, wad *big.Int) (*types.Transaction, error) { + return _WETH9.contract.Transact(opts, "withdraw", wad) +} + +// Withdraw is a paid mutator transaction binding the contract method 0x2e1a7d4d. +// +// Solidity: function withdraw(uint256 wad) returns() +func (_WETH9 *WETH9Session) Withdraw(wad *big.Int) (*types.Transaction, error) { + return _WETH9.Contract.Withdraw(&_WETH9.TransactOpts, wad) +} + +// Withdraw is a paid mutator transaction binding the contract method 0x2e1a7d4d. +// +// Solidity: function withdraw(uint256 wad) returns() +func (_WETH9 *WETH9TransactorSession) Withdraw(wad *big.Int) (*types.Transaction, error) { + return _WETH9.Contract.Withdraw(&_WETH9.TransactOpts, wad) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() payable returns() +func (_WETH9 *WETH9Transactor) Fallback(opts *bind.TransactOpts, calldata []byte) (*types.Transaction, error) { + return _WETH9.contract.RawTransact(opts, calldata) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() payable returns() +func (_WETH9 *WETH9Session) Fallback(calldata []byte) (*types.Transaction, error) { + return _WETH9.Contract.Fallback(&_WETH9.TransactOpts, calldata) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() payable returns() +func (_WETH9 *WETH9TransactorSession) Fallback(calldata []byte) (*types.Transaction, error) { + return _WETH9.Contract.Fallback(&_WETH9.TransactOpts, calldata) +} + +// WETH9ApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the WETH9 contract. +type WETH9ApprovalIterator struct { + Event *WETH9Approval // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *WETH9ApprovalIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(WETH9Approval) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(WETH9Approval) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *WETH9ApprovalIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *WETH9ApprovalIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// WETH9Approval represents a Approval event raised by the WETH9 contract. +type WETH9Approval struct { + Src common.Address + Guy common.Address + Wad *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed src, address indexed guy, uint256 wad) +func (_WETH9 *WETH9Filterer) FilterApproval(opts *bind.FilterOpts, src []common.Address, guy []common.Address) (*WETH9ApprovalIterator, error) { + + var srcRule []interface{} + for _, srcItem := range src { + srcRule = append(srcRule, srcItem) + } + var guyRule []interface{} + for _, guyItem := range guy { + guyRule = append(guyRule, guyItem) + } + + logs, sub, err := _WETH9.contract.FilterLogs(opts, "Approval", srcRule, guyRule) + if err != nil { + return nil, err + } + return &WETH9ApprovalIterator{contract: _WETH9.contract, event: "Approval", logs: logs, sub: sub}, nil +} + +// WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed src, address indexed guy, uint256 wad) +func (_WETH9 *WETH9Filterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *WETH9Approval, src []common.Address, guy []common.Address) (event.Subscription, error) { + + var srcRule []interface{} + for _, srcItem := range src { + srcRule = append(srcRule, srcItem) + } + var guyRule []interface{} + for _, guyItem := range guy { + guyRule = append(guyRule, guyItem) + } + + logs, sub, err := _WETH9.contract.WatchLogs(opts, "Approval", srcRule, guyRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(WETH9Approval) + if err := _WETH9.contract.UnpackLog(event, "Approval", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed src, address indexed guy, uint256 wad) +func (_WETH9 *WETH9Filterer) ParseApproval(log types.Log) (*WETH9Approval, error) { + event := new(WETH9Approval) + if err := _WETH9.contract.UnpackLog(event, "Approval", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// WETH9DepositIterator is returned from FilterDeposit and is used to iterate over the raw logs and unpacked data for Deposit events raised by the WETH9 contract. +type WETH9DepositIterator struct { + Event *WETH9Deposit // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *WETH9DepositIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(WETH9Deposit) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(WETH9Deposit) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *WETH9DepositIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *WETH9DepositIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// WETH9Deposit represents a Deposit event raised by the WETH9 contract. +type WETH9Deposit struct { + Dst common.Address + Wad *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterDeposit is a free log retrieval operation binding the contract event 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c. +// +// Solidity: event Deposit(address indexed dst, uint256 wad) +func (_WETH9 *WETH9Filterer) FilterDeposit(opts *bind.FilterOpts, dst []common.Address) (*WETH9DepositIterator, error) { + + var dstRule []interface{} + for _, dstItem := range dst { + dstRule = append(dstRule, dstItem) + } + + logs, sub, err := _WETH9.contract.FilterLogs(opts, "Deposit", dstRule) + if err != nil { + return nil, err + } + return &WETH9DepositIterator{contract: _WETH9.contract, event: "Deposit", logs: logs, sub: sub}, nil +} + +// WatchDeposit is a free log subscription operation binding the contract event 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c. +// +// Solidity: event Deposit(address indexed dst, uint256 wad) +func (_WETH9 *WETH9Filterer) WatchDeposit(opts *bind.WatchOpts, sink chan<- *WETH9Deposit, dst []common.Address) (event.Subscription, error) { + + var dstRule []interface{} + for _, dstItem := range dst { + dstRule = append(dstRule, dstItem) + } + + logs, sub, err := _WETH9.contract.WatchLogs(opts, "Deposit", dstRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(WETH9Deposit) + if err := _WETH9.contract.UnpackLog(event, "Deposit", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseDeposit is a log parse operation binding the contract event 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c. +// +// Solidity: event Deposit(address indexed dst, uint256 wad) +func (_WETH9 *WETH9Filterer) ParseDeposit(log types.Log) (*WETH9Deposit, error) { + event := new(WETH9Deposit) + if err := _WETH9.contract.UnpackLog(event, "Deposit", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// WETH9TransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the WETH9 contract. +type WETH9TransferIterator struct { + Event *WETH9Transfer // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *WETH9TransferIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(WETH9Transfer) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(WETH9Transfer) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *WETH9TransferIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *WETH9TransferIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// WETH9Transfer represents a Transfer event raised by the WETH9 contract. +type WETH9Transfer struct { + Src common.Address + Dst common.Address + Wad *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed src, address indexed dst, uint256 wad) +func (_WETH9 *WETH9Filterer) FilterTransfer(opts *bind.FilterOpts, src []common.Address, dst []common.Address) (*WETH9TransferIterator, error) { + + var srcRule []interface{} + for _, srcItem := range src { + srcRule = append(srcRule, srcItem) + } + var dstRule []interface{} + for _, dstItem := range dst { + dstRule = append(dstRule, dstItem) + } + + logs, sub, err := _WETH9.contract.FilterLogs(opts, "Transfer", srcRule, dstRule) + if err != nil { + return nil, err + } + return &WETH9TransferIterator{contract: _WETH9.contract, event: "Transfer", logs: logs, sub: sub}, nil +} + +// WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed src, address indexed dst, uint256 wad) +func (_WETH9 *WETH9Filterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *WETH9Transfer, src []common.Address, dst []common.Address) (event.Subscription, error) { + + var srcRule []interface{} + for _, srcItem := range src { + srcRule = append(srcRule, srcItem) + } + var dstRule []interface{} + for _, dstItem := range dst { + dstRule = append(dstRule, dstItem) + } + + logs, sub, err := _WETH9.contract.WatchLogs(opts, "Transfer", srcRule, dstRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(WETH9Transfer) + if err := _WETH9.contract.UnpackLog(event, "Transfer", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed src, address indexed dst, uint256 wad) +func (_WETH9 *WETH9Filterer) ParseTransfer(log types.Log) (*WETH9Transfer, error) { + event := new(WETH9Transfer) + if err := _WETH9.contract.UnpackLog(event, "Transfer", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// WETH9WithdrawalIterator is returned from FilterWithdrawal and is used to iterate over the raw logs and unpacked data for Withdrawal events raised by the WETH9 contract. +type WETH9WithdrawalIterator struct { + Event *WETH9Withdrawal // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *WETH9WithdrawalIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(WETH9Withdrawal) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(WETH9Withdrawal) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *WETH9WithdrawalIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *WETH9WithdrawalIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// WETH9Withdrawal represents a Withdrawal event raised by the WETH9 contract. +type WETH9Withdrawal struct { + Src common.Address + Wad *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterWithdrawal is a free log retrieval operation binding the contract event 0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65. +// +// Solidity: event Withdrawal(address indexed src, uint256 wad) +func (_WETH9 *WETH9Filterer) FilterWithdrawal(opts *bind.FilterOpts, src []common.Address) (*WETH9WithdrawalIterator, error) { + + var srcRule []interface{} + for _, srcItem := range src { + srcRule = append(srcRule, srcItem) + } + + logs, sub, err := _WETH9.contract.FilterLogs(opts, "Withdrawal", srcRule) + if err != nil { + return nil, err + } + return &WETH9WithdrawalIterator{contract: _WETH9.contract, event: "Withdrawal", logs: logs, sub: sub}, nil +} + +// WatchWithdrawal is a free log subscription operation binding the contract event 0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65. +// +// Solidity: event Withdrawal(address indexed src, uint256 wad) +func (_WETH9 *WETH9Filterer) WatchWithdrawal(opts *bind.WatchOpts, sink chan<- *WETH9Withdrawal, src []common.Address) (event.Subscription, error) { + + var srcRule []interface{} + for _, srcItem := range src { + srcRule = append(srcRule, srcItem) + } + + logs, sub, err := _WETH9.contract.WatchLogs(opts, "Withdrawal", srcRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(WETH9Withdrawal) + if err := _WETH9.contract.UnpackLog(event, "Withdrawal", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseWithdrawal is a log parse operation binding the contract event 0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65. +// +// Solidity: event Withdrawal(address indexed src, uint256 wad) +func (_WETH9 *WETH9Filterer) ParseWithdrawal(log types.Log) (*WETH9Withdrawal, error) { + event := new(WETH9Withdrawal) + if err := _WETH9.contract.UnpackLog(event, "Withdrawal", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/op-e2e2/bindingspreview/optimismportal2.go b/op-e2e2/bindingspreview/optimismportal2.go new file mode 100644 index 000000000000..5223dcec05d6 --- /dev/null +++ b/op-e2e2/bindingspreview/optimismportal2.go @@ -0,0 +1,1633 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindingspreview + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "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/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// TypesOutputRootProof is an auto generated low-level Go binding around an user-defined struct. +type TypesOutputRootProof struct { + Version [32]byte + StateRoot [32]byte + MessagePasserStorageRoot [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 +} + +// OptimismPortal2MetaData contains all meta data concerning the OptimismPortal2 contract. +var OptimismPortal2MetaData = &bind.MetaData{ + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_proofMaturityDelaySeconds\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_disputeGameFinalityDelaySeconds\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"blacklistDisputeGame\",\"inputs\":[{\"name\":\"_disputeGame\",\"type\":\"address\",\"internalType\":\"contractIDisputeGame\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"checkWithdrawal\",\"inputs\":[{\"name\":\"_withdrawalHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_proofSubmitter\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"depositTransaction\",\"inputs\":[{\"name\":\"_to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_value\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_gasLimit\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_isCreation\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"_data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"disputeGameBlacklist\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIDisputeGame\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"disputeGameFactory\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractDisputeGameFactory\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"disputeGameFinalityDelaySeconds\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"donateETH\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"finalizeWithdrawalTransaction\",\"inputs\":[{\"name\":\"_tx\",\"type\":\"tuple\",\"internalType\":\"structTypes.WithdrawalTransaction\",\"components\":[{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"sender\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"target\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"gasLimit\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"finalizeWithdrawalTransactionExternalProof\",\"inputs\":[{\"name\":\"_tx\",\"type\":\"tuple\",\"internalType\":\"structTypes.WithdrawalTransaction\",\"components\":[{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"sender\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"target\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"gasLimit\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"_proofSubmitter\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"finalizedWithdrawals\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"guardian\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_disputeGameFactory\",\"type\":\"address\",\"internalType\":\"contractDisputeGameFactory\"},{\"name\":\"_systemConfig\",\"type\":\"address\",\"internalType\":\"contractSystemConfig\"},{\"name\":\"_superchainConfig\",\"type\":\"address\",\"internalType\":\"contractSuperchainConfig\"},{\"name\":\"_initialRespectedGameType\",\"type\":\"uint32\",\"internalType\":\"GameType\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"l2Sender\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"minimumGasLimit\",\"inputs\":[{\"name\":\"_byteCount\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"numProofSubmitters\",\"inputs\":[{\"name\":\"_withdrawalHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"params\",\"inputs\":[],\"outputs\":[{\"name\":\"prevBaseFee\",\"type\":\"uint128\",\"internalType\":\"uint128\"},{\"name\":\"prevBoughtGas\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"prevBlockNum\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"paused\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"proofMaturityDelaySeconds\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"proofSubmitters\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"proveWithdrawalTransaction\",\"inputs\":[{\"name\":\"_tx\",\"type\":\"tuple\",\"internalType\":\"structTypes.WithdrawalTransaction\",\"components\":[{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"sender\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"target\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"gasLimit\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"_disputeGameIndex\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_outputRootProof\",\"type\":\"tuple\",\"internalType\":\"structTypes.OutputRootProof\",\"components\":[{\"name\":\"version\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"stateRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"messagePasserStorageRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"latestBlockhash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"name\":\"_withdrawalProof\",\"type\":\"bytes[]\",\"internalType\":\"bytes[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"provenWithdrawals\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"disputeGameProxy\",\"type\":\"address\",\"internalType\":\"contractIDisputeGame\"},{\"name\":\"timestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"respectedGameType\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"GameType\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"respectedGameTypeUpdatedAt\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"setRespectedGameType\",\"inputs\":[{\"name\":\"_gameType\",\"type\":\"uint32\",\"internalType\":\"GameType\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"superchainConfig\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractSuperchainConfig\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"systemConfig\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractSystemConfig\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"TransactionDeposited\",\"inputs\":[{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"version\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"opaqueData\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"WithdrawalFinalized\",\"inputs\":[{\"name\":\"withdrawalHash\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"success\",\"type\":\"bool\",\"indexed\":false,\"internalType\":\"bool\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"WithdrawalProven\",\"inputs\":[{\"name\":\"withdrawalHash\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"BadTarget\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"CallPaused\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"GasEstimation\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"LargeCalldata\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OutOfGas\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"SmallGasLimit\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Unauthorized\",\"inputs\":[]}]", + Bin: "0x60c06040523480156200001157600080fd5b5060405162005cbd38038062005cbd8339810160408190526200003491620002f2565b608082905260a08190526200004d600080808062000055565b505062000317565b600054610100900460ff1615808015620000765750600054600160ff909116105b80620000a6575062000093306200022460201b620020d41760201c565b158015620000a6575060005460ff166001145b6200010f5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff19166001179055801562000133576000805461ff0019166101001790555b603880546001600160a01b03199081166001600160a01b03888116919091179092556037805490911686831617905560358054610100600160a81b0319166101008684160217905560325416620001cc576032805461dead6001600160a01b0319909116179055603b80546001600160601b031916640100000000426001600160401b03160263ffffffff19161763ffffffff84161790555b620001d662000233565b80156200021d576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b6001600160a01b03163b151590565b600054610100900460ff16620002a05760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840162000106565b600154600160c01b90046001600160401b0316600003620002f05760408051606081018252633b9aca0080825260006020830152436001600160401b031691909201819052600160c01b02176001555b565b600080604083850312156200030657600080fd5b505080516020909101519092909150565b60805160a0516159726200034b600039600081816104c30152611a4601526000818161063a015261168401526159726000f3fe6080604052600436106101b05760003560e01c80637fc48504116100ec578063a35d99df1161008a578063bf653a5c11610064578063bf653a5c1461062b578063cff0ab961461065e578063e9e05c42146106ff578063f2b4e6171461071257600080fd5b8063a35d99df14610544578063a3860f4814610564578063bb2c727e1461058457600080fd5b80638e819e54116100c65780638e819e5414610494578063952b2797146104b45780639bf62d82146104e7578063a14238e71461051457600080fd5b80637fc48504146104545780638b4c40b0146101d55780638c3152e91461047457600080fd5b80634870496f1161015957806354fd4d501161013357806354fd4d50146103a95780635c975abb146103ff57806371c1566e146104145780637d6be8dc1461043457600080fd5b80634870496f1461030c5780634fd0434c1461032c578063513747ab1461036e57600080fd5b806343ca1c501161018a57806343ca1c5014610297578063452a9320146102b757806345884d32146102cc57600080fd5b806333d7e2bd146101dc57806335e80ab3146102335780633c9f397c1461026557600080fd5b366101d7576101d53334620186a060006040518060200160405280600081525061073f565b005b600080fd5b3480156101e857600080fd5b506037546102099073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b34801561023f57600080fd5b5060355461020990610100900473ffffffffffffffffffffffffffffffffffffffff1681565b34801561027157600080fd5b50603b546102829063ffffffff1681565b60405163ffffffff909116815260200161022a565b3480156102a357600080fd5b506101d56102b2366004614e15565b6108fc565b3480156102c357600080fd5b50610209610b5a565b3480156102d857600080fd5b506102fc6102e7366004614e67565b603a6020526000908152604090205460ff1681565b604051901515815260200161022a565b34801561031857600080fd5b506101d5610327366004614e84565b610bf2565b34801561033857600080fd5b50603b5461035590640100000000900467ffffffffffffffff1681565b60405167ffffffffffffffff909116815260200161022a565b34801561037a57600080fd5b5061039b610389366004614f60565b6000908152603c602052604090205490565b60405190815260200161022a565b3480156103b557600080fd5b506103f26040518060400160405280600581526020017f332e382e3000000000000000000000000000000000000000000000000000000081525081565b60405161022a9190614fef565b34801561040b57600080fd5b506102fc6112d6565b34801561042057600080fd5b506101d561042f366004615002565b611369565b34801561044057600080fd5b506101d561044f366004614e67565b611bfa565b34801561046057600080fd5b506101d561046f366004615039565b611cb5565b34801561048057600080fd5b506101d561048f366004615056565b611d6f565b3480156104a057600080fd5b506101d56104af366004615093565b611dbb565b3480156104c057600080fd5b507f000000000000000000000000000000000000000000000000000000000000000061039b565b3480156104f357600080fd5b506032546102099073ffffffffffffffffffffffffffffffffffffffff1681565b34801561052057600080fd5b506102fc61052f366004614f60565b60336020526000908152604090205460ff1681565b34801561055057600080fd5b5061035561055f366004615105565b612070565b34801561057057600080fd5b5061020961057f366004615122565b61208f565b34801561059057600080fd5b506105f661059f366004615002565b603960209081526000928352604080842090915290825290205473ffffffffffffffffffffffffffffffffffffffff81169074010000000000000000000000000000000000000000900467ffffffffffffffff1682565b6040805173ffffffffffffffffffffffffffffffffffffffff909316835267ffffffffffffffff90911660208301520161022a565b34801561063757600080fd5b507f000000000000000000000000000000000000000000000000000000000000000061039b565b34801561066a57600080fd5b506001546106c6906fffffffffffffffffffffffffffffffff81169067ffffffffffffffff7001000000000000000000000000000000008204811691780100000000000000000000000000000000000000000000000090041683565b604080516fffffffffffffffffffffffffffffffff909416845267ffffffffffffffff928316602085015291169082015260600161022a565b6101d561070d366004615152565b61073f565b34801561071e57600080fd5b506038546102099073ffffffffffffffffffffffffffffffffffffffff1681565b8260005a9050838015610767575073ffffffffffffffffffffffffffffffffffffffff871615155b1561079e576040517f13496fda00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6107a88351612070565b67ffffffffffffffff168567ffffffffffffffff1610156107f5576040517f4929b80800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6201d4c083511115610833576040517f73052b0f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33328114610854575033731111000000000000000000000000000000001111015b6000348888888860405160200161086f9594939291906151d1565b604051602081830303815290604052905060008973ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fb3813568d9991fc951961fcb4c784893574240a28925604d09fc577c55bb7c32846040516108df9190614fef565b60405180910390a450506108f382826120f0565b50505050505050565b6109046112d6565b1561093b576040517ff480973e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60325473ffffffffffffffffffffffffffffffffffffffff1661dead146109e9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f4f7074696d69736d506f7274616c3a2063616e206f6e6c79207472696767657260448201527f206f6e65207769746864726177616c20706572207472616e73616374696f6e0060648201526084015b60405180910390fd5b60006109f4836123c7565b9050610a008183611369565b600081815260336020908152604080832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055908501516032805473ffffffffffffffffffffffffffffffffffffffff9092167fffffffffffffffffffffffff00000000000000000000000000000000000000009092169190911790558401516080850151606086015160a0870151610aa293929190612414565b603280547fffffffffffffffffffffffff00000000000000000000000000000000000000001661dead17905560405190915082907fdb5c7652857aa163daadd670e116628fb42e869d8ac4251ef8971d9e5727df1b90610b0790841515815260200190565b60405180910390a280158015610b1d5750326001145b15610b54576040517feeae4ed300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050565b6000603560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663452a93206040518163ffffffff1660e01b8152600401602060405180830381865afa158015610bc9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bed9190615236565b905090565b610bfa6112d6565b15610c31576040517ff480973e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3073ffffffffffffffffffffffffffffffffffffffff16856040015173ffffffffffffffffffffffffffffffffffffffff1603610cf0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f4f7074696d69736d506f7274616c3a20796f752063616e6e6f742073656e642060448201527f6d6573736167657320746f2074686520706f7274616c20636f6e74726163740060648201526084016109e0565b6038546040517fbb8aa1fc00000000000000000000000000000000000000000000000000000000815260048101869052600091829173ffffffffffffffffffffffffffffffffffffffff9091169063bb8aa1fc90602401606060405180830381865afa158015610d64573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d889190615253565b925050915060008173ffffffffffffffffffffffffffffffffffffffff1663bcef3b556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610dda573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dfe91906152a0565b603b5490915063ffffffff848116911614610e9b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f4f7074696d69736d506f7274616c3a20696e76616c69642067616d652074797060448201527f650000000000000000000000000000000000000000000000000000000000000060648201526084016109e0565b610eb2610ead368890038801886152b9565b612472565b8114610f40576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4f7074696d69736d506f7274616c3a20696e76616c6964206f7574707574207260448201527f6f6f742070726f6f66000000000000000000000000000000000000000000000060648201526084016109e0565b6000610f4b896123c7565b905060018373ffffffffffffffffffffffffffffffffffffffff1663200d2ed26040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fbe919061534e565b6002811115610fcf57610fcf61531f565b0361105c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f4f7074696d69736d506f7274616c3a2063616e6e6f742070726f76652061676160448201527f696e737420696e76616c696420646973707574652067616d657300000000000060648201526084016109e0565b60408051602081018390526000918101829052606001604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152828252805160209182012090830181905292506111259101604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152828201909152600182527f010000000000000000000000000000000000000000000000000000000000000060208301529061111b898b61536f565b8b604001356124b1565b6111b1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4f7074696d69736d506f7274616c3a20696e76616c696420776974686472617760448201527f616c20696e636c7573696f6e2070726f6f66000000000000000000000000000060648201526084016109e0565b60408051808201825273ffffffffffffffffffffffffffffffffffffffff808716825267ffffffffffffffff4281166020808501918252600088815260398252868120338252825286812095518654935190941674010000000000000000000000000000000000000000027fffffffff0000000000000000000000000000000000000000000000000000000090931693851693909317919091179093558d840151928e01519351928216939091169185917f67a6208cfcc0801d50f6cbe764733f4fddf66ac0b04442061a8a8c0cb6b63f6291a4506000908152603c602090815260408220805460018101825590835291200180547fffffffffffffffffffffffff000000000000000000000000000000000000000016331790555050505050505050565b6000603560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611345573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bed91906153f3565b600082815260396020908152604080832073ffffffffffffffffffffffffffffffffffffffff85811685529083528184208251808401845290549182168082527401000000000000000000000000000000000000000090920467ffffffffffffffff1681850152818552603a90935292205490919060ff161561146e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603160248201527f4f7074696d69736d506f7274616c3a20646973707574652067616d652068617360448201527f206265656e20626c61636b6c697374656400000000000000000000000000000060648201526084016109e0565b816020015167ffffffffffffffff16600003611532576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604d60248201527f4f7074696d69736d506f7274616c3a207769746864726177616c20686173206e60448201527f6f74206265656e2070726f76656e2062792070726f6f66207375626d6974746560648201527f7220616464726573732079657400000000000000000000000000000000000000608482015260a4016109e0565b60006115b38273ffffffffffffffffffffffffffffffffffffffff1663cf09e0d06040518163ffffffff1660e01b8152600401602060405180830381865afa158015611582573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115a69190615410565b67ffffffffffffffff1690565b90508067ffffffffffffffff16836020015167ffffffffffffffff1611611682576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604e60248201527f4f7074696d69736d506f7274616c3a207769746864726177616c2074696d657360448201527f74616d70206c657373207468616e20646973707574652067616d65206372656160648201527f74696f6e2074696d657374616d70000000000000000000000000000000000000608482015260a4016109e0565b7f0000000000000000000000000000000000000000000000000000000000000000836020015167ffffffffffffffff16426116bd919061545c565b1161174a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603560248201527f4f7074696d69736d506f7274616c3a2070726f76656e2077697468647261776160448201527f6c20686173206e6f74206d61747572656420796574000000000000000000000060648201526084016109e0565b60028273ffffffffffffffffffffffffffffffffffffffff1663200d2ed26040518163ffffffff1660e01b8152600401602060405180830381865afa158015611797573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117bb919061534e565b60028111156117cc576117cc61531f565b14611859576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f4f7074696d69736d506f7274616c3a206f75747075742070726f706f73616c2060448201527f686173206e6f74206265656e2076616c6964617465640000000000000000000060648201526084016109e0565b603b5463ffffffff1663ffffffff166118e38373ffffffffffffffffffffffffffffffffffffffff1663bbdc02db6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156118b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118da9190615473565b63ffffffff1690565b63ffffffff1614611976576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f4f7074696d69736d506f7274616c3a20696e76616c69642067616d652074797060448201527f650000000000000000000000000000000000000000000000000000000000000060648201526084016109e0565b603b5467ffffffffffffffff64010000000090910481169082161015611a44576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604b60248201527f4f7074696d69736d506f7274616c3a20646973707574652067616d652063726560448201527f61746564206265666f7265207265737065637465642067616d6520747970652060648201527f7761732075706461746564000000000000000000000000000000000000000000608482015260a4016109e0565b7f0000000000000000000000000000000000000000000000000000000000000000611ab38373ffffffffffffffffffffffffffffffffffffffff166319effeb46040518163ffffffff1660e01b8152600401602060405180830381865afa158015611582573d6000803e3d6000fd5b611ac79067ffffffffffffffff164261545c565b11611b54576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f4f7074696d69736d506f7274616c3a206f75747075742070726f706f73616c2060448201527f696e206169722d6761700000000000000000000000000000000000000000000060648201526084016109e0565b60008581526033602052604090205460ff1615611bf3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603560248201527f4f7074696d69736d506f7274616c3a207769746864726177616c20686173206160448201527f6c7265616479206265656e2066696e616c697a6564000000000000000000000060648201526084016109e0565b5050505050565b611c02610b5a565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611c66576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff166000908152603a6020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b611cbd610b5a565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611d21576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b603b805463ffffffff929092167fffffffffffffffffffffffffffffffffffffffff000000000000000000000000909216919091176401000000004267ffffffffffffffff1602179055565b565b611d776112d6565b15611dae576040517ff480973e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611db881336108fc565b50565b600054610100900460ff1615808015611ddb5750600054600160ff909116105b80611df55750303b158015611df5575060005460ff166001145b611e81576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016109e0565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015611edf57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b603880547fffffffffffffffffffffffff000000000000000000000000000000000000000090811673ffffffffffffffffffffffffffffffffffffffff8881169190911790925560378054909116868316179055603580547fffffffffffffffffffffff0000000000000000000000000000000000000000ff166101008684160217905560325416611fff576032805461dead7fffffffffffffffffffffffff0000000000000000000000000000000000000000909116179055603b80547fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166401000000004267ffffffffffffffff16027fffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000161763ffffffff84161790555b6120076124d5565b8015611bf357600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050505050565b600061207d826010615490565b612089906152086154c0565b92915050565b603c60205281600052604060002081815481106120ab57600080fd5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff169150829050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b600154600090612126907801000000000000000000000000000000000000000000000000900467ffffffffffffffff164361545c565b905060006121326125e8565b90506000816020015160ff16826000015163ffffffff16612153919061551b565b9050821561228a5760015460009061218a908390700100000000000000000000000000000000900467ffffffffffffffff16615583565b90506000836040015160ff16836121a191906155f7565b6001546121c19084906fffffffffffffffffffffffffffffffff166155f7565b6121cb919061551b565b60015490915060009061221c906121f59084906fffffffffffffffffffffffffffffffff166156b3565b866060015163ffffffff168760a001516fffffffffffffffffffffffffffffffff166126a9565b9050600186111561224b576122486121f582876040015160ff1660018a612243919061545c565b6126c8565b90505b6fffffffffffffffffffffffffffffffff16780100000000000000000000000000000000000000000000000067ffffffffffffffff4316021760015550505b600180548691906010906122bd908490700100000000000000000000000000000000900467ffffffffffffffff166154c0565b92506101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550816000015163ffffffff16600160000160109054906101000a900467ffffffffffffffff1667ffffffffffffffff16131561234a576040517f77ebef4d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600154600090612376906fffffffffffffffffffffffffffffffff1667ffffffffffffffff8816615727565b9050600061238848633b9aca0061271d565b6123929083615764565b905060005a6123a1908861545c565b9050808211156123bd576123bd6123b8828461545c565b612734565b5050505050505050565b80516020808301516040808501516060860151608087015160a088015193516000976123f7979096959101615778565b604051602081830303815290604052805190602001209050919050565b6000806000612424866000612762565b90508061245a576308c379a06000526020805278185361666543616c6c3a204e6f7420656e6f756768206761736058526064601cfd5b600080855160208701888b5af1979650505050505050565b600081600001518260200151836040015184606001516040516020016123f7949392919093845260208401929092526040830152606082015260800190565b6000806124bd86612780565b90506124cb818686866127b2565b9695505050505050565b600054610100900460ff1661256c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016109e0565b6001547801000000000000000000000000000000000000000000000000900467ffffffffffffffff16600003611d6d5760408051606081018252633b9aca00808252600060208301524367ffffffffffffffff169190920181905278010000000000000000000000000000000000000000000000000217600155565b6040805160c08082018352600080835260208301819052828401819052606083018190526080830181905260a083015260375483517fcc731b020000000000000000000000000000000000000000000000000000000081529351929373ffffffffffffffffffffffffffffffffffffffff9091169263cc731b02926004808401939192918290030181865afa158015612685573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bed91906157e5565b60006126be6126b885856127e2565b836127f2565b90505b9392505050565b6000670de0b6b3a76400006127096126e0858361551b565b6126f290670de0b6b3a7640000615583565b61270485670de0b6b3a76400006155f7565b612801565b61271390866155f7565b6126be919061551b565b60008183101561272d57816126c1565b5090919050565b6000805a90505b825a612747908361545c565b101561275d57612756826158a1565b915061273b565b505050565b600080603f83619c4001026040850201603f5a021015949350505050565b6060818051906020012060405160200161279c91815260200190565b6040516020818303038152906040529050919050565b60006127d9846127c3878686612832565b8051602091820120825192909101919091201490565b95945050505050565b60008183121561272d57816126c1565b600081831261272d57816126c1565b60006126c1670de0b6b3a764000083612819866132b0565b61282391906155f7565b61282d919061551b565b6134f4565b6060600084511161289f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4d65726b6c65547269653a20656d707479206b6579000000000000000000000060448201526064016109e0565b60006128aa84613733565b905060006128b78661381f565b90506000846040516020016128ce91815260200190565b60405160208183030381529060405290506000805b8451811015613227576000858281518110612900576129006158d9565b60200260200101519050845183111561299b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f4d65726b6c65547269653a206b657920696e646578206578636565647320746f60448201527f74616c206b6579206c656e67746800000000000000000000000000000000000060648201526084016109e0565b82600003612a5457805180516020918201206040516129e9926129c392910190815260200190565b604051602081830303815290604052858051602091820120825192909101919091201490565b612a4f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f4d65726b6c65547269653a20696e76616c696420726f6f74206861736800000060448201526064016109e0565b612bab565b805151602011612b0a5780518051602091820120604051612a7e926129c392910190815260200190565b612a4f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f4d65726b6c65547269653a20696e76616c6964206c6172676520696e7465726e60448201527f616c20686173680000000000000000000000000000000000000000000000000060648201526084016109e0565b805184516020808701919091208251919092012014612bab576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4d65726b6c65547269653a20696e76616c696420696e7465726e616c206e6f6460448201527f652068617368000000000000000000000000000000000000000000000000000060648201526084016109e0565b612bb760106001615908565b81602001515103612d935784518303612d2b57612bf18160200151601081518110612be457612be46158d9565b6020026020010151613882565b96506000875111612c84576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603b60248201527f4d65726b6c65547269653a2076616c7565206c656e677468206d75737420626560448201527f2067726561746572207468616e207a65726f20286272616e636829000000000060648201526084016109e0565b60018651612c92919061545c565b8214612d20576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f4d65726b6c65547269653a2076616c7565206e6f6465206d757374206265206c60448201527f617374206e6f646520696e2070726f6f6620286272616e63682900000000000060648201526084016109e0565b5050505050506126c1565b6000858481518110612d3f57612d3f6158d9565b602001015160f81c60f81b60f81c9050600082602001518260ff1681518110612d6a57612d6a6158d9565b60200260200101519050612d7d816139e2565b9550612d8a600186615908565b94505050613214565b60028160200151510361318c576000612dab82613a07565b9050600081600081518110612dc257612dc26158d9565b016020015160f81c90506000612dd9600283615920565b612de4906002615942565b90506000612df5848360ff16613a2b565b90506000612e038a89613a2b565b90506000612e118383613a61565b905080835114612ea3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f4d65726b6c65547269653a20706174682072656d61696e646572206d7573742060448201527f736861726520616c6c206e6962626c65732077697468206b657900000000000060648201526084016109e0565b60ff851660021480612eb8575060ff85166003145b156130a75780825114612f4d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603d60248201527f4d65726b6c65547269653a206b65792072656d61696e646572206d757374206260448201527f65206964656e746963616c20746f20706174682072656d61696e64657200000060648201526084016109e0565b612f678760200151600181518110612be457612be46158d9565b9c5060008d5111612ffa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603960248201527f4d65726b6c65547269653a2076616c7565206c656e677468206d75737420626560448201527f2067726561746572207468616e207a65726f20286c656166290000000000000060648201526084016109e0565b60018c51613008919061545c565b8814613096576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603860248201527f4d65726b6c65547269653a2076616c7565206e6f6465206d757374206265206c60448201527f617374206e6f646520696e2070726f6f6620286c65616629000000000000000060648201526084016109e0565b5050505050505050505050506126c1565b60ff851615806130ba575060ff85166001145b156130f9576130e687602001516001815181106130d9576130d96158d9565b60200260200101516139e2565b99506130f2818a615908565b9850613181565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4d65726b6c65547269653a2072656365697665642061206e6f6465207769746860448201527f20616e20756e6b6e6f776e20707265666978000000000000000000000000000060648201526084016109e0565b505050505050613214565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f4d65726b6c65547269653a20726563656976656420616e20756e70617273656160448201527f626c65206e6f646500000000000000000000000000000000000000000000000060648201526084016109e0565b508061321f816158a1565b9150506128e3565b506040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f4d65726b6c65547269653a2072616e206f7574206f662070726f6f6620656c6560448201527f6d656e747300000000000000000000000000000000000000000000000000000060648201526084016109e0565b600080821361331b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f554e444546494e4544000000000000000000000000000000000000000000000060448201526064016109e0565b6000606061332884613b15565b03609f8181039490941b90931c6c465772b2bbbb5f824b15207a3081018102606090811d6d0388eaa27412d5aca026815d636e018202811d6d0df99ac502031bf953eff472fdcc018202811d6d13cdffb29d51d99322bdff5f2211018202811d6d0a0f742023def783a307a986912e018202811d6d01920d8043ca89b5239253284e42018202811d6c0b7a86d7375468fac667a0a527016c29508e458543d8aa4df2abee7883018302821d6d0139601a2efabe717e604cbb4894018302821d6d02247f7a7b6594320649aa03aba1018302821d7fffffffffffffffffffffffffffffffffffffff73c0c716a594e00d54e3c4cbc9018302821d7ffffffffffffffffffffffffffffffffffffffdc7b88c420e53a9890533129f6f01830290911d7fffffffffffffffffffffffffffffffffffffff465fda27eb4d63ded474e5f832019091027ffffffffffffffff5f6af8f7b3396644f18e157960000000000000000000000000105711340daa0d5f769dba1915cef59f0815a5506027d0267a36c0c95b3975ab3ee5b203a7614a3f75373f047d803ae7b6687f2b393909302929092017d57115e47018c7177eebf7cd370a3356a1b7863008a5ae8028c72b88642840160ae1d92915050565b60007ffffffffffffffffffffffffffffffffffffffffffffffffdb731c958f34d94c1821361352557506000919050565b680755bf798b4a1bf1e58212613597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f4558505f4f564552464c4f57000000000000000000000000000000000000000060448201526064016109e0565b6503782dace9d9604e83901b059150600060606bb17217f7d1cf79abc9e3b39884821b056b80000000000000000000000001901d6bb17217f7d1cf79abc9e3b39881029093037fffffffffffffffffffffffffffffffffffffffdbf3ccf1604d263450f02a550481018102606090811d6d0277594991cfc85f6e2461837cd9018202811d7fffffffffffffffffffffffffffffffffffffe5adedaa1cb095af9e4da10e363c018202811d6db1bbb201f443cf962f1a1d3db4a5018202811d7ffffffffffffffffffffffffffffffffffffd38dc772608b0ae56cce01296c0eb018202811d6e05180bb14799ab47a8a8cb2a527d57016d02d16720577bd19bf614176fe9ea6c10fe68e7fd37d0007b713f765084018402831d9081019084017ffffffffffffffffffffffffffffffffffffffe2c69812cf03b0763fd454a8f7e010290911d6e0587f503bb6ea29d25fcb7401964500190910279d835ebba824c98fb31b83b2ca45c000000000000000000000000010574029d9dc38563c32e5c2f6dc192ee70ef65f9978af30260c3939093039290921c92915050565b80516060908067ffffffffffffffff81111561375157613751614c38565b60405190808252806020026020018201604052801561379657816020015b604080518082019091526060808252602082015281526020019060019003908161376f5790505b50915060005b818110156138185760405180604001604052808583815181106137c1576137c16158d9565b602002602001015181526020016137f08684815181106137e3576137e36158d9565b6020026020010151613beb565b815250838281518110613805576138056158d9565b602090810291909101015260010161379c565b5050919050565b606080604051905082518060011b603f8101601f1916830160405280835250602084016020830160005b83811015613877578060011b82018184015160001a8060041c8253600f811660018301535050600101613849565b509295945050505050565b6060600080600061389285613bfe565b9194509250905060008160018111156138ad576138ad61531f565b1461393a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603960248201527f524c505265616465723a206465636f646564206974656d207479706520666f7260448201527f206279746573206973206e6f7420612064617461206974656d0000000000000060648201526084016109e0565b6139448284615908565b8551146139d3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603460248201527f524c505265616465723a2062797465732076616c756520636f6e7461696e732060448201527f616e20696e76616c69642072656d61696e64657200000000000000000000000060648201526084016109e0565b6127d98560200151848461466b565b606060208260000151106139fe576139f982613882565b612089565b612089826146ff565b6060612089613a268360200151600081518110612be457612be46158d9565b61381f565b606082518210613a4a5750604080516020810190915260008152612089565b6126c18383848651613a5c919061545c565b614715565b6000808251845110613a74578251613a77565b83515b90505b8082108015613afe5750828281518110613a9657613a966158d9565b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916848381518110613ad557613ad56158d9565b01602001517fff0000000000000000000000000000000000000000000000000000000000000016145b15613b0e57816001019150613a7a565b5092915050565b6000808211613b80576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f554e444546494e4544000000000000000000000000000000000000000000000060448201526064016109e0565b5060016fffffffffffffffffffffffffffffffff821160071b82811c67ffffffffffffffff1060061b1782811c63ffffffff1060051b1782811c61ffff1060041b1782811c60ff10600390811b90911783811c600f1060021b1783811c909110821b1791821c111790565b6060612089613bf9836148ed565b6149d6565b600080600080846000015111613cbc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604a60248201527f524c505265616465723a206c656e677468206f6620616e20524c50206974656d60448201527f206d7573742062652067726561746572207468616e207a65726f20746f20626560648201527f206465636f6461626c6500000000000000000000000000000000000000000000608482015260a4016109e0565b6020840151805160001a607f8111613ce1576000600160009450945094505050614664565b60b78111613eef576000613cf660808361545c565b905080876000015111613db1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604e60248201527f524c505265616465723a206c656e677468206f6620636f6e74656e74206d757360448201527f742062652067726561746572207468616e20737472696e67206c656e6774682060648201527f2873686f727420737472696e6729000000000000000000000000000000000000608482015260a4016109e0565b6001838101517fff00000000000000000000000000000000000000000000000000000000000000169082141580613e2a57507f80000000000000000000000000000000000000000000000000000000000000007fff00000000000000000000000000000000000000000000000000000000000000821610155b613edc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604d60248201527f524c505265616465723a20696e76616c6964207072656669782c2073696e676c60448201527f652062797465203c203078383020617265206e6f74207072656669786564202860648201527f73686f727420737472696e672900000000000000000000000000000000000000608482015260a4016109e0565b5060019550935060009250614664915050565b60bf811161423d576000613f0460b78361545c565b905080876000015111613fbf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152605160248201527f524c505265616465723a206c656e677468206f6620636f6e74656e74206d757360448201527f74206265203e207468616e206c656e677468206f6620737472696e67206c656e60648201527f67746820286c6f6e6720737472696e6729000000000000000000000000000000608482015260a4016109e0565b60018301517fff0000000000000000000000000000000000000000000000000000000000000016600081900361409d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604a60248201527f524c505265616465723a206c656e677468206f6620636f6e74656e74206d757360448201527f74206e6f74206861766520616e79206c656164696e67207a65726f7320286c6f60648201527f6e6720737472696e672900000000000000000000000000000000000000000000608482015260a4016109e0565b600184015160088302610100031c60378111614161576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604860248201527f524c505265616465723a206c656e677468206f6620636f6e74656e74206d757360448201527f742062652067726561746572207468616e20353520627974657320286c6f6e6760648201527f20737472696e6729000000000000000000000000000000000000000000000000608482015260a4016109e0565b61416b8184615908565b895111614220576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604c60248201527f524c505265616465723a206c656e677468206f6620636f6e74656e74206d757360448201527f742062652067726561746572207468616e20746f74616c206c656e677468202860648201527f6c6f6e6720737472696e67290000000000000000000000000000000000000000608482015260a4016109e0565b61422b836001615908565b97509550600094506146649350505050565b60f7811161431e57600061425260c08361545c565b90508087600001511161430d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604a60248201527f524c505265616465723a206c656e677468206f6620636f6e74656e74206d757360448201527f742062652067726561746572207468616e206c697374206c656e67746820287360648201527f686f7274206c6973742900000000000000000000000000000000000000000000608482015260a4016109e0565b600195509350849250614664915050565b600061432b60f78361545c565b9050808760000151116143e6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604d60248201527f524c505265616465723a206c656e677468206f6620636f6e74656e74206d757360448201527f74206265203e207468616e206c656e677468206f66206c697374206c656e677460648201527f6820286c6f6e67206c6973742900000000000000000000000000000000000000608482015260a4016109e0565b60018301517fff000000000000000000000000000000000000000000000000000000000000001660008190036144c4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604860248201527f524c505265616465723a206c656e677468206f6620636f6e74656e74206d757360448201527f74206e6f74206861766520616e79206c656164696e67207a65726f7320286c6f60648201527f6e67206c69737429000000000000000000000000000000000000000000000000608482015260a4016109e0565b600184015160088302610100031c60378111614588576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604660248201527f524c505265616465723a206c656e677468206f6620636f6e74656e74206d757360448201527f742062652067726561746572207468616e20353520627974657320286c6f6e6760648201527f206c697374290000000000000000000000000000000000000000000000000000608482015260a4016109e0565b6145928184615908565b895111614647576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604a60248201527f524c505265616465723a206c656e677468206f6620636f6e74656e74206d757360448201527f742062652067726561746572207468616e20746f74616c206c656e677468202860648201527f6c6f6e67206c6973742900000000000000000000000000000000000000000000608482015260a4016109e0565b614652836001615908565b97509550600194506146649350505050565b9193909250565b60608167ffffffffffffffff81111561468657614686614c38565b6040519080825280601f01601f1916602001820160405280156146b0576020820181803683370190505b50905081156126c15760006146c58486615908565b90506020820160005b848110156146e65782810151828201526020016146ce565b848111156146f5576000858301525b5050509392505050565b606061208982602001516000846000015161466b565b60608182601f011015614784576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f736c6963655f6f766572666c6f7700000000000000000000000000000000000060448201526064016109e0565b8282840110156147f0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f736c6963655f6f766572666c6f7700000000000000000000000000000000000060448201526064016109e0565b8183018451101561485d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f736c6963655f6f75744f66426f756e647300000000000000000000000000000060448201526064016109e0565b60608215801561487c57604051915060008252602082016040526148e4565b6040519150601f8416801560200281840101858101878315602002848b0101015b818310156148b557805183526020928301920161489d565b5050858452601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016604052505b50949350505050565b604080518082019091526000808252602082015260008251116149b8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604a60248201527f524c505265616465723a206c656e677468206f6620616e20524c50206974656d60448201527f206d7573742062652067726561746572207468616e207a65726f20746f20626560648201527f206465636f6461626c6500000000000000000000000000000000000000000000608482015260a4016109e0565b50604080518082019091528151815260209182019181019190915290565b606060008060006149e685613bfe565b919450925090506001816001811115614a0157614a0161531f565b14614a8e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603860248201527f524c505265616465723a206465636f646564206974656d207479706520666f7260448201527f206c697374206973206e6f742061206c697374206974656d000000000000000060648201526084016109e0565b8451614a9a8385615908565b14614b27576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f524c505265616465723a206c697374206974656d2068617320616e20696e766160448201527f6c696420646174612072656d61696e646572000000000000000000000000000060648201526084016109e0565b604080516020808252610420820190925290816020015b6040805180820190915260008082526020820152815260200190600190039081614b3e5790505093506000835b8651811015614c2c57600080614bb16040518060400160405280858c60000151614b95919061545c565b8152602001858c60200151614baa9190615908565b9052613bfe565b509150915060405180604001604052808383614bcd9190615908565b8152602001848b60200151614be29190615908565b815250888581518110614bf757614bf76158d9565b6020908102919091010152614c0d600185615908565b9350614c198183615908565b614c239084615908565b92505050614b6b565b50845250919392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715614cae57614cae614c38565b604052919050565b73ffffffffffffffffffffffffffffffffffffffff81168114611db857600080fd5b600082601f830112614ce957600080fd5b813567ffffffffffffffff811115614d0357614d03614c38565b614d3460207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601614c67565b818152846020838601011115614d4957600080fd5b816020850160208301376000918101602001919091529392505050565b600060c08284031215614d7857600080fd5b60405160c0810167ffffffffffffffff8282108183111715614d9c57614d9c614c38565b816040528293508435835260208501359150614db782614cb6565b81602084015260408501359150614dcd82614cb6565b816040840152606085013560608401526080850135608084015260a0850135915080821115614dfb57600080fd5b50614e0885828601614cd8565b60a0830152505092915050565b60008060408385031215614e2857600080fd5b823567ffffffffffffffff811115614e3f57600080fd5b614e4b85828601614d66565b9250506020830135614e5c81614cb6565b809150509250929050565b600060208284031215614e7957600080fd5b81356126c181614cb6565b600080600080600085870360e0811215614e9d57600080fd5b863567ffffffffffffffff80821115614eb557600080fd5b614ec18a838b01614d66565b97506020890135965060807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc084011215614efa57600080fd5b60408901955060c0890135925080831115614f1457600080fd5b828901925089601f840112614f2857600080fd5b8235915080821115614f3957600080fd5b508860208260051b8401011115614f4f57600080fd5b959894975092955050506020019190565b600060208284031215614f7257600080fd5b5035919050565b60005b83811015614f94578181015183820152602001614f7c565b83811115610b545750506000910152565b60008151808452614fbd816020860160208601614f79565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006126c16020830184614fa5565b6000806040838503121561501557600080fd5b823591506020830135614e5c81614cb6565b63ffffffff81168114611db857600080fd5b60006020828403121561504b57600080fd5b81356126c181615027565b60006020828403121561506857600080fd5b813567ffffffffffffffff81111561507f57600080fd5b61508b84828501614d66565b949350505050565b600080600080608085870312156150a957600080fd5b84356150b481614cb6565b935060208501356150c481614cb6565b925060408501356150d481614cb6565b915060608501356150e481615027565b939692955090935050565b67ffffffffffffffff81168114611db857600080fd5b60006020828403121561511757600080fd5b81356126c1816150ef565b6000806040838503121561513557600080fd5b50508035926020909101359150565b8015158114611db857600080fd5b600080600080600060a0868803121561516a57600080fd5b853561517581614cb6565b945060208601359350604086013561518c816150ef565b9250606086013561519c81615144565b9150608086013567ffffffffffffffff8111156151b857600080fd5b6151c488828901614cd8565b9150509295509295909350565b8581528460208201527fffffffffffffffff0000000000000000000000000000000000000000000000008460c01b16604082015282151560f81b604882015260008251615225816049850160208701614f79565b919091016049019695505050505050565b60006020828403121561524857600080fd5b81516126c181614cb6565b60008060006060848603121561526857600080fd5b835161527381615027565b6020850151909350615284816150ef565b604085015190925061529581614cb6565b809150509250925092565b6000602082840312156152b257600080fd5b5051919050565b6000608082840312156152cb57600080fd5b6040516080810181811067ffffffffffffffff821117156152ee576152ee614c38565b8060405250823581526020830135602082015260408301356040820152606083013560608201528091505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60006020828403121561536057600080fd5b8151600381106126c157600080fd5b600067ffffffffffffffff8084111561538a5761538a614c38565b8360051b602061539b818301614c67565b8681529185019181810190368411156153b357600080fd5b865b848110156153e7578035868111156153cd5760008081fd5b6153d936828b01614cd8565b8452509183019183016153b5565b50979650505050505050565b60006020828403121561540557600080fd5b81516126c181615144565b60006020828403121561542257600080fd5b81516126c1816150ef565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008282101561546e5761546e61542d565b500390565b60006020828403121561548557600080fd5b81516126c181615027565b600067ffffffffffffffff808316818516818304811182151516156154b7576154b761542d565b02949350505050565b600067ffffffffffffffff8083168185168083038211156154e3576154e361542d565b01949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60008261552a5761552a6154ec565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83147f80000000000000000000000000000000000000000000000000000000000000008314161561557e5761557e61542d565b500590565b6000808312837f8000000000000000000000000000000000000000000000000000000000000000018312811516156155bd576155bd61542d565b837f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0183138116156155f1576155f161542d565b50500390565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000841360008413858304851182821616156156385761563861542d565b7f800000000000000000000000000000000000000000000000000000000000000060008712868205881281841616156156735761567361542d565b6000871292508782058712848416161561568f5761568f61542d565b878505871281841616156156a5576156a561542d565b505050929093029392505050565b6000808212827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038413811516156156ed576156ed61542d565b827f80000000000000000000000000000000000000000000000000000000000000000384128116156157215761572161542d565b50500190565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561575f5761575f61542d565b500290565b600082615773576157736154ec565b500490565b868152600073ffffffffffffffffffffffffffffffffffffffff808816602084015280871660408401525084606083015283608083015260c060a08301526157c360c0830184614fa5565b98975050505050505050565b805160ff811681146157e057600080fd5b919050565b600060c082840312156157f757600080fd5b60405160c0810181811067ffffffffffffffff8211171561581a5761581a614c38565b604052825161582881615027565b8152615836602084016157cf565b6020820152615847604084016157cf565b6040820152606083015161585a81615027565b6060820152608083015161586d81615027565b608082015260a08301516fffffffffffffffffffffffffffffffff8116811461589557600080fd5b60a08201529392505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036158d2576158d261542d565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000821982111561591b5761591b61542d565b500190565b600060ff831680615933576159336154ec565b8060ff84160691505092915050565b600060ff821660ff84168082101561595c5761595c61542d565b9003939250505056fea164736f6c634300080f000a", +} + +// OptimismPortal2ABI is the input ABI used to generate the binding from. +// Deprecated: Use OptimismPortal2MetaData.ABI instead. +var OptimismPortal2ABI = OptimismPortal2MetaData.ABI + +// OptimismPortal2Bin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use OptimismPortal2MetaData.Bin instead. +var OptimismPortal2Bin = OptimismPortal2MetaData.Bin + +// DeployOptimismPortal2 deploys a new Ethereum contract, binding an instance of OptimismPortal2 to it. +func DeployOptimismPortal2(auth *bind.TransactOpts, backend bind.ContractBackend, _proofMaturityDelaySeconds *big.Int, _disputeGameFinalityDelaySeconds *big.Int) (common.Address, *types.Transaction, *OptimismPortal2, error) { + parsed, err := OptimismPortal2MetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(OptimismPortal2Bin), backend, _proofMaturityDelaySeconds, _disputeGameFinalityDelaySeconds) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &OptimismPortal2{OptimismPortal2Caller: OptimismPortal2Caller{contract: contract}, OptimismPortal2Transactor: OptimismPortal2Transactor{contract: contract}, OptimismPortal2Filterer: OptimismPortal2Filterer{contract: contract}}, nil +} + +// OptimismPortal2 is an auto generated Go binding around an Ethereum contract. +type OptimismPortal2 struct { + OptimismPortal2Caller // Read-only binding to the contract + OptimismPortal2Transactor // Write-only binding to the contract + OptimismPortal2Filterer // Log filterer for contract events +} + +// OptimismPortal2Caller is an auto generated read-only Go binding around an Ethereum contract. +type OptimismPortal2Caller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// OptimismPortal2Transactor is an auto generated write-only Go binding around an Ethereum contract. +type OptimismPortal2Transactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// OptimismPortal2Filterer is an auto generated log filtering Go binding around an Ethereum contract events. +type OptimismPortal2Filterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// OptimismPortal2Session is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type OptimismPortal2Session struct { + Contract *OptimismPortal2 // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// OptimismPortal2CallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type OptimismPortal2CallerSession struct { + Contract *OptimismPortal2Caller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// OptimismPortal2TransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type OptimismPortal2TransactorSession struct { + Contract *OptimismPortal2Transactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// OptimismPortal2Raw is an auto generated low-level Go binding around an Ethereum contract. +type OptimismPortal2Raw struct { + Contract *OptimismPortal2 // Generic contract binding to access the raw methods on +} + +// OptimismPortal2CallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type OptimismPortal2CallerRaw struct { + Contract *OptimismPortal2Caller // Generic read-only contract binding to access the raw methods on +} + +// OptimismPortal2TransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type OptimismPortal2TransactorRaw struct { + Contract *OptimismPortal2Transactor // Generic write-only contract binding to access the raw methods on +} + +// NewOptimismPortal2 creates a new instance of OptimismPortal2, bound to a specific deployed contract. +func NewOptimismPortal2(address common.Address, backend bind.ContractBackend) (*OptimismPortal2, error) { + contract, err := bindOptimismPortal2(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &OptimismPortal2{OptimismPortal2Caller: OptimismPortal2Caller{contract: contract}, OptimismPortal2Transactor: OptimismPortal2Transactor{contract: contract}, OptimismPortal2Filterer: OptimismPortal2Filterer{contract: contract}}, nil +} + +// NewOptimismPortal2Caller creates a new read-only instance of OptimismPortal2, bound to a specific deployed contract. +func NewOptimismPortal2Caller(address common.Address, caller bind.ContractCaller) (*OptimismPortal2Caller, error) { + contract, err := bindOptimismPortal2(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &OptimismPortal2Caller{contract: contract}, nil +} + +// NewOptimismPortal2Transactor creates a new write-only instance of OptimismPortal2, bound to a specific deployed contract. +func NewOptimismPortal2Transactor(address common.Address, transactor bind.ContractTransactor) (*OptimismPortal2Transactor, error) { + contract, err := bindOptimismPortal2(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &OptimismPortal2Transactor{contract: contract}, nil +} + +// NewOptimismPortal2Filterer creates a new log filterer instance of OptimismPortal2, bound to a specific deployed contract. +func NewOptimismPortal2Filterer(address common.Address, filterer bind.ContractFilterer) (*OptimismPortal2Filterer, error) { + contract, err := bindOptimismPortal2(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &OptimismPortal2Filterer{contract: contract}, nil +} + +// bindOptimismPortal2 binds a generic wrapper to an already deployed contract. +func bindOptimismPortal2(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(OptimismPortal2ABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_OptimismPortal2 *OptimismPortal2Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _OptimismPortal2.Contract.OptimismPortal2Caller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_OptimismPortal2 *OptimismPortal2Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OptimismPortal2.Contract.OptimismPortal2Transactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_OptimismPortal2 *OptimismPortal2Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _OptimismPortal2.Contract.OptimismPortal2Transactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_OptimismPortal2 *OptimismPortal2CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _OptimismPortal2.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_OptimismPortal2 *OptimismPortal2TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OptimismPortal2.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_OptimismPortal2 *OptimismPortal2TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _OptimismPortal2.Contract.contract.Transact(opts, method, params...) +} + +// CheckWithdrawal is a free data retrieval call binding the contract method 0x71c1566e. +// +// Solidity: function checkWithdrawal(bytes32 _withdrawalHash, address _proofSubmitter) view returns() +func (_OptimismPortal2 *OptimismPortal2Caller) CheckWithdrawal(opts *bind.CallOpts, _withdrawalHash [32]byte, _proofSubmitter common.Address) error { + var out []interface{} + err := _OptimismPortal2.contract.Call(opts, &out, "checkWithdrawal", _withdrawalHash, _proofSubmitter) + + if err != nil { + return err + } + + return err + +} + +// CheckWithdrawal is a free data retrieval call binding the contract method 0x71c1566e. +// +// Solidity: function checkWithdrawal(bytes32 _withdrawalHash, address _proofSubmitter) view returns() +func (_OptimismPortal2 *OptimismPortal2Session) CheckWithdrawal(_withdrawalHash [32]byte, _proofSubmitter common.Address) error { + return _OptimismPortal2.Contract.CheckWithdrawal(&_OptimismPortal2.CallOpts, _withdrawalHash, _proofSubmitter) +} + +// CheckWithdrawal is a free data retrieval call binding the contract method 0x71c1566e. +// +// Solidity: function checkWithdrawal(bytes32 _withdrawalHash, address _proofSubmitter) view returns() +func (_OptimismPortal2 *OptimismPortal2CallerSession) CheckWithdrawal(_withdrawalHash [32]byte, _proofSubmitter common.Address) error { + return _OptimismPortal2.Contract.CheckWithdrawal(&_OptimismPortal2.CallOpts, _withdrawalHash, _proofSubmitter) +} + +// DisputeGameBlacklist is a free data retrieval call binding the contract method 0x45884d32. +// +// Solidity: function disputeGameBlacklist(address ) view returns(bool) +func (_OptimismPortal2 *OptimismPortal2Caller) DisputeGameBlacklist(opts *bind.CallOpts, arg0 common.Address) (bool, error) { + var out []interface{} + err := _OptimismPortal2.contract.Call(opts, &out, "disputeGameBlacklist", arg0) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// DisputeGameBlacklist is a free data retrieval call binding the contract method 0x45884d32. +// +// Solidity: function disputeGameBlacklist(address ) view returns(bool) +func (_OptimismPortal2 *OptimismPortal2Session) DisputeGameBlacklist(arg0 common.Address) (bool, error) { + return _OptimismPortal2.Contract.DisputeGameBlacklist(&_OptimismPortal2.CallOpts, arg0) +} + +// DisputeGameBlacklist is a free data retrieval call binding the contract method 0x45884d32. +// +// Solidity: function disputeGameBlacklist(address ) view returns(bool) +func (_OptimismPortal2 *OptimismPortal2CallerSession) DisputeGameBlacklist(arg0 common.Address) (bool, error) { + return _OptimismPortal2.Contract.DisputeGameBlacklist(&_OptimismPortal2.CallOpts, arg0) +} + +// DisputeGameFactory is a free data retrieval call binding the contract method 0xf2b4e617. +// +// Solidity: function disputeGameFactory() view returns(address) +func (_OptimismPortal2 *OptimismPortal2Caller) DisputeGameFactory(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _OptimismPortal2.contract.Call(opts, &out, "disputeGameFactory") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// DisputeGameFactory is a free data retrieval call binding the contract method 0xf2b4e617. +// +// Solidity: function disputeGameFactory() view returns(address) +func (_OptimismPortal2 *OptimismPortal2Session) DisputeGameFactory() (common.Address, error) { + return _OptimismPortal2.Contract.DisputeGameFactory(&_OptimismPortal2.CallOpts) +} + +// DisputeGameFactory is a free data retrieval call binding the contract method 0xf2b4e617. +// +// Solidity: function disputeGameFactory() view returns(address) +func (_OptimismPortal2 *OptimismPortal2CallerSession) DisputeGameFactory() (common.Address, error) { + return _OptimismPortal2.Contract.DisputeGameFactory(&_OptimismPortal2.CallOpts) +} + +// DisputeGameFinalityDelaySeconds is a free data retrieval call binding the contract method 0x952b2797. +// +// Solidity: function disputeGameFinalityDelaySeconds() view returns(uint256) +func (_OptimismPortal2 *OptimismPortal2Caller) DisputeGameFinalityDelaySeconds(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _OptimismPortal2.contract.Call(opts, &out, "disputeGameFinalityDelaySeconds") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// DisputeGameFinalityDelaySeconds is a free data retrieval call binding the contract method 0x952b2797. +// +// Solidity: function disputeGameFinalityDelaySeconds() view returns(uint256) +func (_OptimismPortal2 *OptimismPortal2Session) DisputeGameFinalityDelaySeconds() (*big.Int, error) { + return _OptimismPortal2.Contract.DisputeGameFinalityDelaySeconds(&_OptimismPortal2.CallOpts) +} + +// DisputeGameFinalityDelaySeconds is a free data retrieval call binding the contract method 0x952b2797. +// +// Solidity: function disputeGameFinalityDelaySeconds() view returns(uint256) +func (_OptimismPortal2 *OptimismPortal2CallerSession) DisputeGameFinalityDelaySeconds() (*big.Int, error) { + return _OptimismPortal2.Contract.DisputeGameFinalityDelaySeconds(&_OptimismPortal2.CallOpts) +} + +// FinalizedWithdrawals is a free data retrieval call binding the contract method 0xa14238e7. +// +// Solidity: function finalizedWithdrawals(bytes32 ) view returns(bool) +func (_OptimismPortal2 *OptimismPortal2Caller) FinalizedWithdrawals(opts *bind.CallOpts, arg0 [32]byte) (bool, error) { + var out []interface{} + err := _OptimismPortal2.contract.Call(opts, &out, "finalizedWithdrawals", arg0) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// FinalizedWithdrawals is a free data retrieval call binding the contract method 0xa14238e7. +// +// Solidity: function finalizedWithdrawals(bytes32 ) view returns(bool) +func (_OptimismPortal2 *OptimismPortal2Session) FinalizedWithdrawals(arg0 [32]byte) (bool, error) { + return _OptimismPortal2.Contract.FinalizedWithdrawals(&_OptimismPortal2.CallOpts, arg0) +} + +// FinalizedWithdrawals is a free data retrieval call binding the contract method 0xa14238e7. +// +// Solidity: function finalizedWithdrawals(bytes32 ) view returns(bool) +func (_OptimismPortal2 *OptimismPortal2CallerSession) FinalizedWithdrawals(arg0 [32]byte) (bool, error) { + return _OptimismPortal2.Contract.FinalizedWithdrawals(&_OptimismPortal2.CallOpts, arg0) +} + +// Guardian is a free data retrieval call binding the contract method 0x452a9320. +// +// Solidity: function guardian() view returns(address) +func (_OptimismPortal2 *OptimismPortal2Caller) Guardian(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _OptimismPortal2.contract.Call(opts, &out, "guardian") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Guardian is a free data retrieval call binding the contract method 0x452a9320. +// +// Solidity: function guardian() view returns(address) +func (_OptimismPortal2 *OptimismPortal2Session) Guardian() (common.Address, error) { + return _OptimismPortal2.Contract.Guardian(&_OptimismPortal2.CallOpts) +} + +// Guardian is a free data retrieval call binding the contract method 0x452a9320. +// +// Solidity: function guardian() view returns(address) +func (_OptimismPortal2 *OptimismPortal2CallerSession) Guardian() (common.Address, error) { + return _OptimismPortal2.Contract.Guardian(&_OptimismPortal2.CallOpts) +} + +// L2Sender is a free data retrieval call binding the contract method 0x9bf62d82. +// +// Solidity: function l2Sender() view returns(address) +func (_OptimismPortal2 *OptimismPortal2Caller) L2Sender(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _OptimismPortal2.contract.Call(opts, &out, "l2Sender") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// L2Sender is a free data retrieval call binding the contract method 0x9bf62d82. +// +// Solidity: function l2Sender() view returns(address) +func (_OptimismPortal2 *OptimismPortal2Session) L2Sender() (common.Address, error) { + return _OptimismPortal2.Contract.L2Sender(&_OptimismPortal2.CallOpts) +} + +// L2Sender is a free data retrieval call binding the contract method 0x9bf62d82. +// +// Solidity: function l2Sender() view returns(address) +func (_OptimismPortal2 *OptimismPortal2CallerSession) L2Sender() (common.Address, error) { + return _OptimismPortal2.Contract.L2Sender(&_OptimismPortal2.CallOpts) +} + +// MinimumGasLimit is a free data retrieval call binding the contract method 0xa35d99df. +// +// Solidity: function minimumGasLimit(uint64 _byteCount) pure returns(uint64) +func (_OptimismPortal2 *OptimismPortal2Caller) MinimumGasLimit(opts *bind.CallOpts, _byteCount uint64) (uint64, error) { + var out []interface{} + err := _OptimismPortal2.contract.Call(opts, &out, "minimumGasLimit", _byteCount) + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// MinimumGasLimit is a free data retrieval call binding the contract method 0xa35d99df. +// +// Solidity: function minimumGasLimit(uint64 _byteCount) pure returns(uint64) +func (_OptimismPortal2 *OptimismPortal2Session) MinimumGasLimit(_byteCount uint64) (uint64, error) { + return _OptimismPortal2.Contract.MinimumGasLimit(&_OptimismPortal2.CallOpts, _byteCount) +} + +// MinimumGasLimit is a free data retrieval call binding the contract method 0xa35d99df. +// +// Solidity: function minimumGasLimit(uint64 _byteCount) pure returns(uint64) +func (_OptimismPortal2 *OptimismPortal2CallerSession) MinimumGasLimit(_byteCount uint64) (uint64, error) { + return _OptimismPortal2.Contract.MinimumGasLimit(&_OptimismPortal2.CallOpts, _byteCount) +} + +// NumProofSubmitters is a free data retrieval call binding the contract method 0x513747ab. +// +// Solidity: function numProofSubmitters(bytes32 _withdrawalHash) view returns(uint256) +func (_OptimismPortal2 *OptimismPortal2Caller) NumProofSubmitters(opts *bind.CallOpts, _withdrawalHash [32]byte) (*big.Int, error) { + var out []interface{} + err := _OptimismPortal2.contract.Call(opts, &out, "numProofSubmitters", _withdrawalHash) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// NumProofSubmitters is a free data retrieval call binding the contract method 0x513747ab. +// +// Solidity: function numProofSubmitters(bytes32 _withdrawalHash) view returns(uint256) +func (_OptimismPortal2 *OptimismPortal2Session) NumProofSubmitters(_withdrawalHash [32]byte) (*big.Int, error) { + return _OptimismPortal2.Contract.NumProofSubmitters(&_OptimismPortal2.CallOpts, _withdrawalHash) +} + +// NumProofSubmitters is a free data retrieval call binding the contract method 0x513747ab. +// +// Solidity: function numProofSubmitters(bytes32 _withdrawalHash) view returns(uint256) +func (_OptimismPortal2 *OptimismPortal2CallerSession) NumProofSubmitters(_withdrawalHash [32]byte) (*big.Int, error) { + return _OptimismPortal2.Contract.NumProofSubmitters(&_OptimismPortal2.CallOpts, _withdrawalHash) +} + +// Params is a free data retrieval call binding the contract method 0xcff0ab96. +// +// Solidity: function params() view returns(uint128 prevBaseFee, uint64 prevBoughtGas, uint64 prevBlockNum) +func (_OptimismPortal2 *OptimismPortal2Caller) Params(opts *bind.CallOpts) (struct { + PrevBaseFee *big.Int + PrevBoughtGas uint64 + PrevBlockNum uint64 +}, error) { + var out []interface{} + err := _OptimismPortal2.contract.Call(opts, &out, "params") + + outstruct := new(struct { + PrevBaseFee *big.Int + PrevBoughtGas uint64 + PrevBlockNum uint64 + }) + if err != nil { + return *outstruct, err + } + + outstruct.PrevBaseFee = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + outstruct.PrevBoughtGas = *abi.ConvertType(out[1], new(uint64)).(*uint64) + outstruct.PrevBlockNum = *abi.ConvertType(out[2], new(uint64)).(*uint64) + + return *outstruct, err + +} + +// Params is a free data retrieval call binding the contract method 0xcff0ab96. +// +// Solidity: function params() view returns(uint128 prevBaseFee, uint64 prevBoughtGas, uint64 prevBlockNum) +func (_OptimismPortal2 *OptimismPortal2Session) Params() (struct { + PrevBaseFee *big.Int + PrevBoughtGas uint64 + PrevBlockNum uint64 +}, error) { + return _OptimismPortal2.Contract.Params(&_OptimismPortal2.CallOpts) +} + +// Params is a free data retrieval call binding the contract method 0xcff0ab96. +// +// Solidity: function params() view returns(uint128 prevBaseFee, uint64 prevBoughtGas, uint64 prevBlockNum) +func (_OptimismPortal2 *OptimismPortal2CallerSession) Params() (struct { + PrevBaseFee *big.Int + PrevBoughtGas uint64 + PrevBlockNum uint64 +}, error) { + return _OptimismPortal2.Contract.Params(&_OptimismPortal2.CallOpts) +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool) +func (_OptimismPortal2 *OptimismPortal2Caller) Paused(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _OptimismPortal2.contract.Call(opts, &out, "paused") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool) +func (_OptimismPortal2 *OptimismPortal2Session) Paused() (bool, error) { + return _OptimismPortal2.Contract.Paused(&_OptimismPortal2.CallOpts) +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool) +func (_OptimismPortal2 *OptimismPortal2CallerSession) Paused() (bool, error) { + return _OptimismPortal2.Contract.Paused(&_OptimismPortal2.CallOpts) +} + +// ProofMaturityDelaySeconds is a free data retrieval call binding the contract method 0xbf653a5c. +// +// Solidity: function proofMaturityDelaySeconds() view returns(uint256) +func (_OptimismPortal2 *OptimismPortal2Caller) ProofMaturityDelaySeconds(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _OptimismPortal2.contract.Call(opts, &out, "proofMaturityDelaySeconds") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// ProofMaturityDelaySeconds is a free data retrieval call binding the contract method 0xbf653a5c. +// +// Solidity: function proofMaturityDelaySeconds() view returns(uint256) +func (_OptimismPortal2 *OptimismPortal2Session) ProofMaturityDelaySeconds() (*big.Int, error) { + return _OptimismPortal2.Contract.ProofMaturityDelaySeconds(&_OptimismPortal2.CallOpts) +} + +// ProofMaturityDelaySeconds is a free data retrieval call binding the contract method 0xbf653a5c. +// +// Solidity: function proofMaturityDelaySeconds() view returns(uint256) +func (_OptimismPortal2 *OptimismPortal2CallerSession) ProofMaturityDelaySeconds() (*big.Int, error) { + return _OptimismPortal2.Contract.ProofMaturityDelaySeconds(&_OptimismPortal2.CallOpts) +} + +// ProofSubmitters is a free data retrieval call binding the contract method 0xa3860f48. +// +// Solidity: function proofSubmitters(bytes32 , uint256 ) view returns(address) +func (_OptimismPortal2 *OptimismPortal2Caller) ProofSubmitters(opts *bind.CallOpts, arg0 [32]byte, arg1 *big.Int) (common.Address, error) { + var out []interface{} + err := _OptimismPortal2.contract.Call(opts, &out, "proofSubmitters", arg0, arg1) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// ProofSubmitters is a free data retrieval call binding the contract method 0xa3860f48. +// +// Solidity: function proofSubmitters(bytes32 , uint256 ) view returns(address) +func (_OptimismPortal2 *OptimismPortal2Session) ProofSubmitters(arg0 [32]byte, arg1 *big.Int) (common.Address, error) { + return _OptimismPortal2.Contract.ProofSubmitters(&_OptimismPortal2.CallOpts, arg0, arg1) +} + +// ProofSubmitters is a free data retrieval call binding the contract method 0xa3860f48. +// +// Solidity: function proofSubmitters(bytes32 , uint256 ) view returns(address) +func (_OptimismPortal2 *OptimismPortal2CallerSession) ProofSubmitters(arg0 [32]byte, arg1 *big.Int) (common.Address, error) { + return _OptimismPortal2.Contract.ProofSubmitters(&_OptimismPortal2.CallOpts, arg0, arg1) +} + +// ProvenWithdrawals is a free data retrieval call binding the contract method 0xbb2c727e. +// +// Solidity: function provenWithdrawals(bytes32 , address ) view returns(address disputeGameProxy, uint64 timestamp) +func (_OptimismPortal2 *OptimismPortal2Caller) ProvenWithdrawals(opts *bind.CallOpts, arg0 [32]byte, arg1 common.Address) (struct { + DisputeGameProxy common.Address + Timestamp uint64 +}, error) { + var out []interface{} + err := _OptimismPortal2.contract.Call(opts, &out, "provenWithdrawals", arg0, arg1) + + outstruct := new(struct { + DisputeGameProxy common.Address + Timestamp uint64 + }) + if err != nil { + return *outstruct, err + } + + outstruct.DisputeGameProxy = *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + outstruct.Timestamp = *abi.ConvertType(out[1], new(uint64)).(*uint64) + + return *outstruct, err + +} + +// ProvenWithdrawals is a free data retrieval call binding the contract method 0xbb2c727e. +// +// Solidity: function provenWithdrawals(bytes32 , address ) view returns(address disputeGameProxy, uint64 timestamp) +func (_OptimismPortal2 *OptimismPortal2Session) ProvenWithdrawals(arg0 [32]byte, arg1 common.Address) (struct { + DisputeGameProxy common.Address + Timestamp uint64 +}, error) { + return _OptimismPortal2.Contract.ProvenWithdrawals(&_OptimismPortal2.CallOpts, arg0, arg1) +} + +// ProvenWithdrawals is a free data retrieval call binding the contract method 0xbb2c727e. +// +// Solidity: function provenWithdrawals(bytes32 , address ) view returns(address disputeGameProxy, uint64 timestamp) +func (_OptimismPortal2 *OptimismPortal2CallerSession) ProvenWithdrawals(arg0 [32]byte, arg1 common.Address) (struct { + DisputeGameProxy common.Address + Timestamp uint64 +}, error) { + return _OptimismPortal2.Contract.ProvenWithdrawals(&_OptimismPortal2.CallOpts, arg0, arg1) +} + +// RespectedGameType is a free data retrieval call binding the contract method 0x3c9f397c. +// +// Solidity: function respectedGameType() view returns(uint32) +func (_OptimismPortal2 *OptimismPortal2Caller) RespectedGameType(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _OptimismPortal2.contract.Call(opts, &out, "respectedGameType") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// RespectedGameType is a free data retrieval call binding the contract method 0x3c9f397c. +// +// Solidity: function respectedGameType() view returns(uint32) +func (_OptimismPortal2 *OptimismPortal2Session) RespectedGameType() (uint32, error) { + return _OptimismPortal2.Contract.RespectedGameType(&_OptimismPortal2.CallOpts) +} + +// RespectedGameType is a free data retrieval call binding the contract method 0x3c9f397c. +// +// Solidity: function respectedGameType() view returns(uint32) +func (_OptimismPortal2 *OptimismPortal2CallerSession) RespectedGameType() (uint32, error) { + return _OptimismPortal2.Contract.RespectedGameType(&_OptimismPortal2.CallOpts) +} + +// RespectedGameTypeUpdatedAt is a free data retrieval call binding the contract method 0x4fd0434c. +// +// Solidity: function respectedGameTypeUpdatedAt() view returns(uint64) +func (_OptimismPortal2 *OptimismPortal2Caller) RespectedGameTypeUpdatedAt(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _OptimismPortal2.contract.Call(opts, &out, "respectedGameTypeUpdatedAt") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// RespectedGameTypeUpdatedAt is a free data retrieval call binding the contract method 0x4fd0434c. +// +// Solidity: function respectedGameTypeUpdatedAt() view returns(uint64) +func (_OptimismPortal2 *OptimismPortal2Session) RespectedGameTypeUpdatedAt() (uint64, error) { + return _OptimismPortal2.Contract.RespectedGameTypeUpdatedAt(&_OptimismPortal2.CallOpts) +} + +// RespectedGameTypeUpdatedAt is a free data retrieval call binding the contract method 0x4fd0434c. +// +// Solidity: function respectedGameTypeUpdatedAt() view returns(uint64) +func (_OptimismPortal2 *OptimismPortal2CallerSession) RespectedGameTypeUpdatedAt() (uint64, error) { + return _OptimismPortal2.Contract.RespectedGameTypeUpdatedAt(&_OptimismPortal2.CallOpts) +} + +// SuperchainConfig is a free data retrieval call binding the contract method 0x35e80ab3. +// +// Solidity: function superchainConfig() view returns(address) +func (_OptimismPortal2 *OptimismPortal2Caller) SuperchainConfig(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _OptimismPortal2.contract.Call(opts, &out, "superchainConfig") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// SuperchainConfig is a free data retrieval call binding the contract method 0x35e80ab3. +// +// Solidity: function superchainConfig() view returns(address) +func (_OptimismPortal2 *OptimismPortal2Session) SuperchainConfig() (common.Address, error) { + return _OptimismPortal2.Contract.SuperchainConfig(&_OptimismPortal2.CallOpts) +} + +// SuperchainConfig is a free data retrieval call binding the contract method 0x35e80ab3. +// +// Solidity: function superchainConfig() view returns(address) +func (_OptimismPortal2 *OptimismPortal2CallerSession) SuperchainConfig() (common.Address, error) { + return _OptimismPortal2.Contract.SuperchainConfig(&_OptimismPortal2.CallOpts) +} + +// SystemConfig is a free data retrieval call binding the contract method 0x33d7e2bd. +// +// Solidity: function systemConfig() view returns(address) +func (_OptimismPortal2 *OptimismPortal2Caller) SystemConfig(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _OptimismPortal2.contract.Call(opts, &out, "systemConfig") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// SystemConfig is a free data retrieval call binding the contract method 0x33d7e2bd. +// +// Solidity: function systemConfig() view returns(address) +func (_OptimismPortal2 *OptimismPortal2Session) SystemConfig() (common.Address, error) { + return _OptimismPortal2.Contract.SystemConfig(&_OptimismPortal2.CallOpts) +} + +// SystemConfig is a free data retrieval call binding the contract method 0x33d7e2bd. +// +// Solidity: function systemConfig() view returns(address) +func (_OptimismPortal2 *OptimismPortal2CallerSession) SystemConfig() (common.Address, error) { + return _OptimismPortal2.Contract.SystemConfig(&_OptimismPortal2.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_OptimismPortal2 *OptimismPortal2Caller) Version(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _OptimismPortal2.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 (_OptimismPortal2 *OptimismPortal2Session) Version() (string, error) { + return _OptimismPortal2.Contract.Version(&_OptimismPortal2.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(string) +func (_OptimismPortal2 *OptimismPortal2CallerSession) Version() (string, error) { + return _OptimismPortal2.Contract.Version(&_OptimismPortal2.CallOpts) +} + +// BlacklistDisputeGame is a paid mutator transaction binding the contract method 0x7d6be8dc. +// +// Solidity: function blacklistDisputeGame(address _disputeGame) returns() +func (_OptimismPortal2 *OptimismPortal2Transactor) BlacklistDisputeGame(opts *bind.TransactOpts, _disputeGame common.Address) (*types.Transaction, error) { + return _OptimismPortal2.contract.Transact(opts, "blacklistDisputeGame", _disputeGame) +} + +// BlacklistDisputeGame is a paid mutator transaction binding the contract method 0x7d6be8dc. +// +// Solidity: function blacklistDisputeGame(address _disputeGame) returns() +func (_OptimismPortal2 *OptimismPortal2Session) BlacklistDisputeGame(_disputeGame common.Address) (*types.Transaction, error) { + return _OptimismPortal2.Contract.BlacklistDisputeGame(&_OptimismPortal2.TransactOpts, _disputeGame) +} + +// BlacklistDisputeGame is a paid mutator transaction binding the contract method 0x7d6be8dc. +// +// Solidity: function blacklistDisputeGame(address _disputeGame) returns() +func (_OptimismPortal2 *OptimismPortal2TransactorSession) BlacklistDisputeGame(_disputeGame common.Address) (*types.Transaction, error) { + return _OptimismPortal2.Contract.BlacklistDisputeGame(&_OptimismPortal2.TransactOpts, _disputeGame) +} + +// 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() +func (_OptimismPortal2 *OptimismPortal2Transactor) DepositTransaction(opts *bind.TransactOpts, _to common.Address, _value *big.Int, _gasLimit uint64, _isCreation bool, _data []byte) (*types.Transaction, error) { + return _OptimismPortal2.contract.Transact(opts, "depositTransaction", _to, _value, _gasLimit, _isCreation, _data) +} + +// 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() +func (_OptimismPortal2 *OptimismPortal2Session) DepositTransaction(_to common.Address, _value *big.Int, _gasLimit uint64, _isCreation bool, _data []byte) (*types.Transaction, error) { + return _OptimismPortal2.Contract.DepositTransaction(&_OptimismPortal2.TransactOpts, _to, _value, _gasLimit, _isCreation, _data) +} + +// 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() +func (_OptimismPortal2 *OptimismPortal2TransactorSession) DepositTransaction(_to common.Address, _value *big.Int, _gasLimit uint64, _isCreation bool, _data []byte) (*types.Transaction, error) { + return _OptimismPortal2.Contract.DepositTransaction(&_OptimismPortal2.TransactOpts, _to, _value, _gasLimit, _isCreation, _data) +} + +// DonateETH is a paid mutator transaction binding the contract method 0x8b4c40b0. +// +// Solidity: function donateETH() payable returns() +func (_OptimismPortal2 *OptimismPortal2Transactor) DonateETH(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OptimismPortal2.contract.Transact(opts, "donateETH") +} + +// DonateETH is a paid mutator transaction binding the contract method 0x8b4c40b0. +// +// Solidity: function donateETH() payable returns() +func (_OptimismPortal2 *OptimismPortal2Session) DonateETH() (*types.Transaction, error) { + return _OptimismPortal2.Contract.DonateETH(&_OptimismPortal2.TransactOpts) +} + +// DonateETH is a paid mutator transaction binding the contract method 0x8b4c40b0. +// +// Solidity: function donateETH() payable returns() +func (_OptimismPortal2 *OptimismPortal2TransactorSession) DonateETH() (*types.Transaction, error) { + return _OptimismPortal2.Contract.DonateETH(&_OptimismPortal2.TransactOpts) +} + +// FinalizeWithdrawalTransaction is a paid mutator transaction binding the contract method 0x8c3152e9. +// +// Solidity: function finalizeWithdrawalTransaction((uint256,address,address,uint256,uint256,bytes) _tx) returns() +func (_OptimismPortal2 *OptimismPortal2Transactor) FinalizeWithdrawalTransaction(opts *bind.TransactOpts, _tx TypesWithdrawalTransaction) (*types.Transaction, error) { + return _OptimismPortal2.contract.Transact(opts, "finalizeWithdrawalTransaction", _tx) +} + +// FinalizeWithdrawalTransaction is a paid mutator transaction binding the contract method 0x8c3152e9. +// +// Solidity: function finalizeWithdrawalTransaction((uint256,address,address,uint256,uint256,bytes) _tx) returns() +func (_OptimismPortal2 *OptimismPortal2Session) FinalizeWithdrawalTransaction(_tx TypesWithdrawalTransaction) (*types.Transaction, error) { + return _OptimismPortal2.Contract.FinalizeWithdrawalTransaction(&_OptimismPortal2.TransactOpts, _tx) +} + +// FinalizeWithdrawalTransaction is a paid mutator transaction binding the contract method 0x8c3152e9. +// +// Solidity: function finalizeWithdrawalTransaction((uint256,address,address,uint256,uint256,bytes) _tx) returns() +func (_OptimismPortal2 *OptimismPortal2TransactorSession) FinalizeWithdrawalTransaction(_tx TypesWithdrawalTransaction) (*types.Transaction, error) { + return _OptimismPortal2.Contract.FinalizeWithdrawalTransaction(&_OptimismPortal2.TransactOpts, _tx) +} + +// FinalizeWithdrawalTransactionExternalProof is a paid mutator transaction binding the contract method 0x43ca1c50. +// +// Solidity: function finalizeWithdrawalTransactionExternalProof((uint256,address,address,uint256,uint256,bytes) _tx, address _proofSubmitter) returns() +func (_OptimismPortal2 *OptimismPortal2Transactor) FinalizeWithdrawalTransactionExternalProof(opts *bind.TransactOpts, _tx TypesWithdrawalTransaction, _proofSubmitter common.Address) (*types.Transaction, error) { + return _OptimismPortal2.contract.Transact(opts, "finalizeWithdrawalTransactionExternalProof", _tx, _proofSubmitter) +} + +// FinalizeWithdrawalTransactionExternalProof is a paid mutator transaction binding the contract method 0x43ca1c50. +// +// Solidity: function finalizeWithdrawalTransactionExternalProof((uint256,address,address,uint256,uint256,bytes) _tx, address _proofSubmitter) returns() +func (_OptimismPortal2 *OptimismPortal2Session) FinalizeWithdrawalTransactionExternalProof(_tx TypesWithdrawalTransaction, _proofSubmitter common.Address) (*types.Transaction, error) { + return _OptimismPortal2.Contract.FinalizeWithdrawalTransactionExternalProof(&_OptimismPortal2.TransactOpts, _tx, _proofSubmitter) +} + +// FinalizeWithdrawalTransactionExternalProof is a paid mutator transaction binding the contract method 0x43ca1c50. +// +// Solidity: function finalizeWithdrawalTransactionExternalProof((uint256,address,address,uint256,uint256,bytes) _tx, address _proofSubmitter) returns() +func (_OptimismPortal2 *OptimismPortal2TransactorSession) FinalizeWithdrawalTransactionExternalProof(_tx TypesWithdrawalTransaction, _proofSubmitter common.Address) (*types.Transaction, error) { + return _OptimismPortal2.Contract.FinalizeWithdrawalTransactionExternalProof(&_OptimismPortal2.TransactOpts, _tx, _proofSubmitter) +} + +// Initialize is a paid mutator transaction binding the contract method 0x8e819e54. +// +// Solidity: function initialize(address _disputeGameFactory, address _systemConfig, address _superchainConfig, uint32 _initialRespectedGameType) returns() +func (_OptimismPortal2 *OptimismPortal2Transactor) Initialize(opts *bind.TransactOpts, _disputeGameFactory common.Address, _systemConfig common.Address, _superchainConfig common.Address, _initialRespectedGameType uint32) (*types.Transaction, error) { + return _OptimismPortal2.contract.Transact(opts, "initialize", _disputeGameFactory, _systemConfig, _superchainConfig, _initialRespectedGameType) +} + +// Initialize is a paid mutator transaction binding the contract method 0x8e819e54. +// +// Solidity: function initialize(address _disputeGameFactory, address _systemConfig, address _superchainConfig, uint32 _initialRespectedGameType) returns() +func (_OptimismPortal2 *OptimismPortal2Session) Initialize(_disputeGameFactory common.Address, _systemConfig common.Address, _superchainConfig common.Address, _initialRespectedGameType uint32) (*types.Transaction, error) { + return _OptimismPortal2.Contract.Initialize(&_OptimismPortal2.TransactOpts, _disputeGameFactory, _systemConfig, _superchainConfig, _initialRespectedGameType) +} + +// Initialize is a paid mutator transaction binding the contract method 0x8e819e54. +// +// Solidity: function initialize(address _disputeGameFactory, address _systemConfig, address _superchainConfig, uint32 _initialRespectedGameType) returns() +func (_OptimismPortal2 *OptimismPortal2TransactorSession) Initialize(_disputeGameFactory common.Address, _systemConfig common.Address, _superchainConfig common.Address, _initialRespectedGameType uint32) (*types.Transaction, error) { + return _OptimismPortal2.Contract.Initialize(&_OptimismPortal2.TransactOpts, _disputeGameFactory, _systemConfig, _superchainConfig, _initialRespectedGameType) +} + +// ProveWithdrawalTransaction is a paid mutator transaction binding the contract method 0x4870496f. +// +// Solidity: function proveWithdrawalTransaction((uint256,address,address,uint256,uint256,bytes) _tx, uint256 _disputeGameIndex, (bytes32,bytes32,bytes32,bytes32) _outputRootProof, bytes[] _withdrawalProof) returns() +func (_OptimismPortal2 *OptimismPortal2Transactor) ProveWithdrawalTransaction(opts *bind.TransactOpts, _tx TypesWithdrawalTransaction, _disputeGameIndex *big.Int, _outputRootProof TypesOutputRootProof, _withdrawalProof [][]byte) (*types.Transaction, error) { + return _OptimismPortal2.contract.Transact(opts, "proveWithdrawalTransaction", _tx, _disputeGameIndex, _outputRootProof, _withdrawalProof) +} + +// ProveWithdrawalTransaction is a paid mutator transaction binding the contract method 0x4870496f. +// +// Solidity: function proveWithdrawalTransaction((uint256,address,address,uint256,uint256,bytes) _tx, uint256 _disputeGameIndex, (bytes32,bytes32,bytes32,bytes32) _outputRootProof, bytes[] _withdrawalProof) returns() +func (_OptimismPortal2 *OptimismPortal2Session) ProveWithdrawalTransaction(_tx TypesWithdrawalTransaction, _disputeGameIndex *big.Int, _outputRootProof TypesOutputRootProof, _withdrawalProof [][]byte) (*types.Transaction, error) { + return _OptimismPortal2.Contract.ProveWithdrawalTransaction(&_OptimismPortal2.TransactOpts, _tx, _disputeGameIndex, _outputRootProof, _withdrawalProof) +} + +// ProveWithdrawalTransaction is a paid mutator transaction binding the contract method 0x4870496f. +// +// Solidity: function proveWithdrawalTransaction((uint256,address,address,uint256,uint256,bytes) _tx, uint256 _disputeGameIndex, (bytes32,bytes32,bytes32,bytes32) _outputRootProof, bytes[] _withdrawalProof) returns() +func (_OptimismPortal2 *OptimismPortal2TransactorSession) ProveWithdrawalTransaction(_tx TypesWithdrawalTransaction, _disputeGameIndex *big.Int, _outputRootProof TypesOutputRootProof, _withdrawalProof [][]byte) (*types.Transaction, error) { + return _OptimismPortal2.Contract.ProveWithdrawalTransaction(&_OptimismPortal2.TransactOpts, _tx, _disputeGameIndex, _outputRootProof, _withdrawalProof) +} + +// SetRespectedGameType is a paid mutator transaction binding the contract method 0x7fc48504. +// +// Solidity: function setRespectedGameType(uint32 _gameType) returns() +func (_OptimismPortal2 *OptimismPortal2Transactor) SetRespectedGameType(opts *bind.TransactOpts, _gameType uint32) (*types.Transaction, error) { + return _OptimismPortal2.contract.Transact(opts, "setRespectedGameType", _gameType) +} + +// SetRespectedGameType is a paid mutator transaction binding the contract method 0x7fc48504. +// +// Solidity: function setRespectedGameType(uint32 _gameType) returns() +func (_OptimismPortal2 *OptimismPortal2Session) SetRespectedGameType(_gameType uint32) (*types.Transaction, error) { + return _OptimismPortal2.Contract.SetRespectedGameType(&_OptimismPortal2.TransactOpts, _gameType) +} + +// SetRespectedGameType is a paid mutator transaction binding the contract method 0x7fc48504. +// +// Solidity: function setRespectedGameType(uint32 _gameType) returns() +func (_OptimismPortal2 *OptimismPortal2TransactorSession) SetRespectedGameType(_gameType uint32) (*types.Transaction, error) { + return _OptimismPortal2.Contract.SetRespectedGameType(&_OptimismPortal2.TransactOpts, _gameType) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_OptimismPortal2 *OptimismPortal2Transactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { + return _OptimismPortal2.contract.RawTransact(opts, nil) // calldata is disallowed for receive function +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_OptimismPortal2 *OptimismPortal2Session) Receive() (*types.Transaction, error) { + return _OptimismPortal2.Contract.Receive(&_OptimismPortal2.TransactOpts) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_OptimismPortal2 *OptimismPortal2TransactorSession) Receive() (*types.Transaction, error) { + return _OptimismPortal2.Contract.Receive(&_OptimismPortal2.TransactOpts) +} + +// OptimismPortal2InitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the OptimismPortal2 contract. +type OptimismPortal2InitializedIterator struct { + Event *OptimismPortal2Initialized // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *OptimismPortal2InitializedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(OptimismPortal2Initialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(OptimismPortal2Initialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *OptimismPortal2InitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *OptimismPortal2InitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// OptimismPortal2Initialized represents a Initialized event raised by the OptimismPortal2 contract. +type OptimismPortal2Initialized struct { + Version uint8 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_OptimismPortal2 *OptimismPortal2Filterer) FilterInitialized(opts *bind.FilterOpts) (*OptimismPortal2InitializedIterator, error) { + + logs, sub, err := _OptimismPortal2.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &OptimismPortal2InitializedIterator{contract: _OptimismPortal2.contract, event: "Initialized", logs: logs, sub: sub}, nil +} + +// WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_OptimismPortal2 *OptimismPortal2Filterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *OptimismPortal2Initialized) (event.Subscription, error) { + + logs, sub, err := _OptimismPortal2.contract.WatchLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(OptimismPortal2Initialized) + if err := _OptimismPortal2.contract.UnpackLog(event, "Initialized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_OptimismPortal2 *OptimismPortal2Filterer) ParseInitialized(log types.Log) (*OptimismPortal2Initialized, error) { + event := new(OptimismPortal2Initialized) + if err := _OptimismPortal2.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// OptimismPortal2TransactionDepositedIterator is returned from FilterTransactionDeposited and is used to iterate over the raw logs and unpacked data for TransactionDeposited events raised by the OptimismPortal2 contract. +type OptimismPortal2TransactionDepositedIterator struct { + Event *OptimismPortal2TransactionDeposited // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *OptimismPortal2TransactionDepositedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(OptimismPortal2TransactionDeposited) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(OptimismPortal2TransactionDeposited) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *OptimismPortal2TransactionDepositedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *OptimismPortal2TransactionDepositedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// OptimismPortal2TransactionDeposited represents a TransactionDeposited event raised by the OptimismPortal2 contract. +type OptimismPortal2TransactionDeposited struct { + From common.Address + To common.Address + Version *big.Int + OpaqueData []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterTransactionDeposited is a free log retrieval operation binding the contract event 0xb3813568d9991fc951961fcb4c784893574240a28925604d09fc577c55bb7c32. +// +// Solidity: event TransactionDeposited(address indexed from, address indexed to, uint256 indexed version, bytes opaqueData) +func (_OptimismPortal2 *OptimismPortal2Filterer) FilterTransactionDeposited(opts *bind.FilterOpts, from []common.Address, to []common.Address, version []*big.Int) (*OptimismPortal2TransactionDepositedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + var versionRule []interface{} + for _, versionItem := range version { + versionRule = append(versionRule, versionItem) + } + + logs, sub, err := _OptimismPortal2.contract.FilterLogs(opts, "TransactionDeposited", fromRule, toRule, versionRule) + if err != nil { + return nil, err + } + return &OptimismPortal2TransactionDepositedIterator{contract: _OptimismPortal2.contract, event: "TransactionDeposited", logs: logs, sub: sub}, nil +} + +// WatchTransactionDeposited is a free log subscription operation binding the contract event 0xb3813568d9991fc951961fcb4c784893574240a28925604d09fc577c55bb7c32. +// +// Solidity: event TransactionDeposited(address indexed from, address indexed to, uint256 indexed version, bytes opaqueData) +func (_OptimismPortal2 *OptimismPortal2Filterer) WatchTransactionDeposited(opts *bind.WatchOpts, sink chan<- *OptimismPortal2TransactionDeposited, from []common.Address, to []common.Address, version []*big.Int) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + var versionRule []interface{} + for _, versionItem := range version { + versionRule = append(versionRule, versionItem) + } + + logs, sub, err := _OptimismPortal2.contract.WatchLogs(opts, "TransactionDeposited", fromRule, toRule, versionRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(OptimismPortal2TransactionDeposited) + if err := _OptimismPortal2.contract.UnpackLog(event, "TransactionDeposited", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseTransactionDeposited is a log parse operation binding the contract event 0xb3813568d9991fc951961fcb4c784893574240a28925604d09fc577c55bb7c32. +// +// Solidity: event TransactionDeposited(address indexed from, address indexed to, uint256 indexed version, bytes opaqueData) +func (_OptimismPortal2 *OptimismPortal2Filterer) ParseTransactionDeposited(log types.Log) (*OptimismPortal2TransactionDeposited, error) { + event := new(OptimismPortal2TransactionDeposited) + if err := _OptimismPortal2.contract.UnpackLog(event, "TransactionDeposited", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// OptimismPortal2WithdrawalFinalizedIterator is returned from FilterWithdrawalFinalized and is used to iterate over the raw logs and unpacked data for WithdrawalFinalized events raised by the OptimismPortal2 contract. +type OptimismPortal2WithdrawalFinalizedIterator struct { + Event *OptimismPortal2WithdrawalFinalized // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *OptimismPortal2WithdrawalFinalizedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(OptimismPortal2WithdrawalFinalized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(OptimismPortal2WithdrawalFinalized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *OptimismPortal2WithdrawalFinalizedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *OptimismPortal2WithdrawalFinalizedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// OptimismPortal2WithdrawalFinalized represents a WithdrawalFinalized event raised by the OptimismPortal2 contract. +type OptimismPortal2WithdrawalFinalized struct { + WithdrawalHash [32]byte + Success bool + Raw types.Log // Blockchain specific contextual infos +} + +// FilterWithdrawalFinalized is a free log retrieval operation binding the contract event 0xdb5c7652857aa163daadd670e116628fb42e869d8ac4251ef8971d9e5727df1b. +// +// Solidity: event WithdrawalFinalized(bytes32 indexed withdrawalHash, bool success) +func (_OptimismPortal2 *OptimismPortal2Filterer) FilterWithdrawalFinalized(opts *bind.FilterOpts, withdrawalHash [][32]byte) (*OptimismPortal2WithdrawalFinalizedIterator, error) { + + var withdrawalHashRule []interface{} + for _, withdrawalHashItem := range withdrawalHash { + withdrawalHashRule = append(withdrawalHashRule, withdrawalHashItem) + } + + logs, sub, err := _OptimismPortal2.contract.FilterLogs(opts, "WithdrawalFinalized", withdrawalHashRule) + if err != nil { + return nil, err + } + return &OptimismPortal2WithdrawalFinalizedIterator{contract: _OptimismPortal2.contract, event: "WithdrawalFinalized", logs: logs, sub: sub}, nil +} + +// WatchWithdrawalFinalized is a free log subscription operation binding the contract event 0xdb5c7652857aa163daadd670e116628fb42e869d8ac4251ef8971d9e5727df1b. +// +// Solidity: event WithdrawalFinalized(bytes32 indexed withdrawalHash, bool success) +func (_OptimismPortal2 *OptimismPortal2Filterer) WatchWithdrawalFinalized(opts *bind.WatchOpts, sink chan<- *OptimismPortal2WithdrawalFinalized, withdrawalHash [][32]byte) (event.Subscription, error) { + + var withdrawalHashRule []interface{} + for _, withdrawalHashItem := range withdrawalHash { + withdrawalHashRule = append(withdrawalHashRule, withdrawalHashItem) + } + + logs, sub, err := _OptimismPortal2.contract.WatchLogs(opts, "WithdrawalFinalized", withdrawalHashRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(OptimismPortal2WithdrawalFinalized) + if err := _OptimismPortal2.contract.UnpackLog(event, "WithdrawalFinalized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseWithdrawalFinalized is a log parse operation binding the contract event 0xdb5c7652857aa163daadd670e116628fb42e869d8ac4251ef8971d9e5727df1b. +// +// Solidity: event WithdrawalFinalized(bytes32 indexed withdrawalHash, bool success) +func (_OptimismPortal2 *OptimismPortal2Filterer) ParseWithdrawalFinalized(log types.Log) (*OptimismPortal2WithdrawalFinalized, error) { + event := new(OptimismPortal2WithdrawalFinalized) + if err := _OptimismPortal2.contract.UnpackLog(event, "WithdrawalFinalized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// OptimismPortal2WithdrawalProvenIterator is returned from FilterWithdrawalProven and is used to iterate over the raw logs and unpacked data for WithdrawalProven events raised by the OptimismPortal2 contract. +type OptimismPortal2WithdrawalProvenIterator struct { + Event *OptimismPortal2WithdrawalProven // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *OptimismPortal2WithdrawalProvenIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(OptimismPortal2WithdrawalProven) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(OptimismPortal2WithdrawalProven) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *OptimismPortal2WithdrawalProvenIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *OptimismPortal2WithdrawalProvenIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// OptimismPortal2WithdrawalProven represents a WithdrawalProven event raised by the OptimismPortal2 contract. +type OptimismPortal2WithdrawalProven struct { + WithdrawalHash [32]byte + From common.Address + To common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterWithdrawalProven is a free log retrieval operation binding the contract event 0x67a6208cfcc0801d50f6cbe764733f4fddf66ac0b04442061a8a8c0cb6b63f62. +// +// Solidity: event WithdrawalProven(bytes32 indexed withdrawalHash, address indexed from, address indexed to) +func (_OptimismPortal2 *OptimismPortal2Filterer) FilterWithdrawalProven(opts *bind.FilterOpts, withdrawalHash [][32]byte, from []common.Address, to []common.Address) (*OptimismPortal2WithdrawalProvenIterator, error) { + + var withdrawalHashRule []interface{} + for _, withdrawalHashItem := range withdrawalHash { + withdrawalHashRule = append(withdrawalHashRule, withdrawalHashItem) + } + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _OptimismPortal2.contract.FilterLogs(opts, "WithdrawalProven", withdrawalHashRule, fromRule, toRule) + if err != nil { + return nil, err + } + return &OptimismPortal2WithdrawalProvenIterator{contract: _OptimismPortal2.contract, event: "WithdrawalProven", logs: logs, sub: sub}, nil +} + +// WatchWithdrawalProven is a free log subscription operation binding the contract event 0x67a6208cfcc0801d50f6cbe764733f4fddf66ac0b04442061a8a8c0cb6b63f62. +// +// Solidity: event WithdrawalProven(bytes32 indexed withdrawalHash, address indexed from, address indexed to) +func (_OptimismPortal2 *OptimismPortal2Filterer) WatchWithdrawalProven(opts *bind.WatchOpts, sink chan<- *OptimismPortal2WithdrawalProven, withdrawalHash [][32]byte, from []common.Address, to []common.Address) (event.Subscription, error) { + + var withdrawalHashRule []interface{} + for _, withdrawalHashItem := range withdrawalHash { + withdrawalHashRule = append(withdrawalHashRule, withdrawalHashItem) + } + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _OptimismPortal2.contract.WatchLogs(opts, "WithdrawalProven", withdrawalHashRule, fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(OptimismPortal2WithdrawalProven) + if err := _OptimismPortal2.contract.UnpackLog(event, "WithdrawalProven", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseWithdrawalProven is a log parse operation binding the contract event 0x67a6208cfcc0801d50f6cbe764733f4fddf66ac0b04442061a8a8c0cb6b63f62. +// +// Solidity: event WithdrawalProven(bytes32 indexed withdrawalHash, address indexed from, address indexed to) +func (_OptimismPortal2 *OptimismPortal2Filterer) ParseWithdrawalProven(log types.Log) (*OptimismPortal2WithdrawalProven, error) { + event := new(OptimismPortal2WithdrawalProven) + if err := _OptimismPortal2.contract.UnpackLog(event, "WithdrawalProven", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/op-e2e2/bridge_test.go b/op-e2e2/bridge_test.go new file mode 100644 index 000000000000..5c9c41aacc51 --- /dev/null +++ b/op-e2e2/bridge_test.go @@ -0,0 +1,111 @@ +package op_e2e + +import ( + "context" + "math" + "math/big" + "testing" + + "github.com/ethereum-optimism/optimism/op-e2e2/bindings" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/receipts" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/transactions" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/wait" + "github.com/ethereum-optimism/optimism/op-node/rollup/derive" + "github.com/ethereum-optimism/optimism/op-service/predeploys" + "github.com/ethereum-optimism/optimism/op-service/testlog" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/params" + "github.com/stretchr/testify/require" +) + +// TestERC20BridgeDeposits tests the the L1StandardBridge bridge ERC20 +// functionality. +func TestERC20BridgeDeposits(t *testing.T) { + InitParallel(t) + + cfg := DefaultSystemConfig(t) + + sys, err := cfg.Start(t) + require.Nil(t, err, "Error starting up system") + defer sys.Close() + + log := testlog.Logger(t, log.LevelInfo) + log.Info("genesis", "l2", sys.RollupConfig.Genesis.L2, "l1", sys.RollupConfig.Genesis.L1, "l2_time", sys.RollupConfig.Genesis.L2Time) + + l1Client := sys.Clients["l1"] + l2Client := sys.Clients["sequencer"] + + opts, err := bind.NewKeyedTransactorWithChainID(sys.Cfg.Secrets.Alice, cfg.L1ChainIDBig()) + require.Nil(t, err) + + // Deploy WETH + wethAddress, tx, WETH, err := bindings.DeployWETH(opts, l1Client) + require.NoError(t, err) + _, err = wait.ForReceiptOK(context.Background(), l1Client, tx.Hash()) + require.NoError(t, err, "Waiting for deposit tx on L1") + + // Get some WETH + opts.Value = big.NewInt(params.Ether) + tx, err = WETH.Deposit(opts) + require.NoError(t, err) + _, err = wait.ForReceiptOK(context.Background(), l1Client, tx.Hash()) + require.NoError(t, err) + opts.Value = nil + wethBalance, err := WETH.BalanceOf(&bind.CallOpts{}, opts.From) + require.NoError(t, err) + require.Equal(t, big.NewInt(params.Ether), wethBalance) + + // Deploy L2 WETH + l2Opts, err := bind.NewKeyedTransactorWithChainID(sys.Cfg.Secrets.Alice, cfg.L2ChainIDBig()) + require.NoError(t, err) + optimismMintableTokenFactory, err := bindings.NewOptimismMintableERC20Factory(predeploys.OptimismMintableERC20FactoryAddr, l2Client) + require.NoError(t, err) + tx, err = optimismMintableTokenFactory.CreateOptimismMintableERC20(l2Opts, wethAddress, "L2-WETH", "L2-WETH") + require.NoError(t, err) + rcpt, err := wait.ForReceiptOK(context.Background(), l2Client, tx.Hash()) + require.NoError(t, err) + + event, err := receipts.FindLog(rcpt.Logs, optimismMintableTokenFactory.ParseOptimismMintableERC20Created) + require.NoError(t, err, "Should emit ERC20Created event") + + // Approve WETH with the bridge + tx, err = WETH.Approve(opts, cfg.L1Deployments.L1StandardBridgeProxy, new(big.Int).SetUint64(math.MaxUint64)) + require.NoError(t, err) + _, err = wait.ForReceiptOK(context.Background(), l1Client, tx.Hash()) + require.NoError(t, err) + + // Bridge the WETH + l1StandardBridge, err := bindings.NewL1StandardBridge(cfg.L1Deployments.L1StandardBridgeProxy, l1Client) + require.NoError(t, err) + tx, err = transactions.PadGasEstimate(opts, 1.1, func(opts *bind.TransactOpts) (*types.Transaction, error) { + return l1StandardBridge.BridgeERC20(opts, wethAddress, event.LocalToken, big.NewInt(100), 100000, []byte{}) + }) + require.NoError(t, err) + depositReceipt, err := wait.ForReceiptOK(context.Background(), l1Client, tx.Hash()) + require.NoError(t, err) + + t.Log("Deposit through L1StandardBridge", "gas used", depositReceipt.GasUsed) + + // compute the deposit transaction hash + poll for it + portal, err := bindings.NewOptimismPortal(cfg.L1Deployments.OptimismPortalProxy, l1Client) + require.NoError(t, err) + + depositEvent, err := receipts.FindLog(depositReceipt.Logs, portal.ParseTransactionDeposited) + require.NoError(t, err, "Should emit deposit event") + + depositTx, err := derive.UnmarshalDepositLogEvent(&depositEvent.Raw) + require.NoError(t, err) + _, err = wait.ForReceiptOK(context.Background(), l2Client, types.NewTx(depositTx).Hash()) + require.NoError(t, err) + + // Ensure that the deposit went through + optimismMintableToken, err := bindings.NewOptimismMintableERC20(event.LocalToken, l2Client) + require.NoError(t, err) + + // Should have balance on L2 + l2Balance, err := optimismMintableToken.BalanceOf(&bind.CallOpts{}, opts.From) + require.NoError(t, err) + require.Equal(t, l2Balance, big.NewInt(100)) +} diff --git a/op-e2e2/brotli_batcher_test.go b/op-e2e2/brotli_batcher_test.go new file mode 100644 index 000000000000..7c2885ae92d2 --- /dev/null +++ b/op-e2e2/brotli_batcher_test.go @@ -0,0 +1,125 @@ +package op_e2e + +import ( + "context" + "crypto/ecdsa" + "math/big" + "testing" + "time" + + "github.com/stretchr/testify/require" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/rpc" + + batcherFlags "github.com/ethereum-optimism/optimism/op-batcher/flags" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/wait" + "github.com/ethereum-optimism/optimism/op-service/client" + "github.com/ethereum-optimism/optimism/op-service/sources" + "github.com/ethereum-optimism/optimism/op-service/testlog" +) + +func setupAliceAccount(t *testing.T, cfg SystemConfig, sys *System, ethPrivKey *ecdsa.PrivateKey) { + l1Client := sys.Clients["l1"] + l2Verif := sys.Clients["verifier"] + + // Send Transaction & wait for success + fromAddr := cfg.Secrets.Addresses().Alice + log.Info("alice", "addr", fromAddr) + + ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) + defer cancel() + startBalance, err := l2Verif.BalanceAt(ctx, fromAddr, nil) + require.NoError(t, err) + + // Send deposit transaction + opts, err := bind.NewKeyedTransactorWithChainID(ethPrivKey, cfg.L1ChainIDBig()) + require.NoError(t, err) + mintAmount := big.NewInt(1_000_000_000_000) + opts.Value = mintAmount + SendDepositTx(t, cfg, l1Client, l2Verif, opts, func(l2Opts *DepositTxOpts) {}) + + // Confirm balance + ctx, cancel = context.WithTimeout(context.Background(), 15*time.Second) + defer cancel() + endBalance, err := wait.ForBalanceChange(ctx, l2Verif, fromAddr, startBalance) + require.NoError(t, err) + + diff := new(big.Int).Sub(endBalance, startBalance) + require.Equal(t, mintAmount, diff, "Did not get expected balance change") +} + +func TestBrotliBatcherFjord(t *testing.T) { + InitParallel(t) + + cfg := DefaultSystemConfig(t) + cfg.DataAvailabilityType = batcherFlags.BlobsType + + genesisActivation := hexutil.Uint64(0) + cfg.DeployConfig.L1CancunTimeOffset = &genesisActivation + cfg.DeployConfig.L2GenesisDeltaTimeOffset = &genesisActivation + cfg.DeployConfig.L2GenesisEcotoneTimeOffset = &genesisActivation + cfg.DeployConfig.L2GenesisFjordTimeOffset = &genesisActivation + + // set up batcher to use brotli + sys, err := cfg.Start(t, SystemConfigOption{"compressionAlgo", "brotli", nil}) + require.Nil(t, err, "Error starting up system") + defer sys.Close() + + log := testlog.Logger(t, log.LevelInfo) + log.Info("genesis", "l2", sys.RollupConfig.Genesis.L2, "l1", sys.RollupConfig.Genesis.L1, "l2_time", sys.RollupConfig.Genesis.L2Time) + + l2Seq := sys.Clients["sequencer"] + l2Verif := sys.Clients["verifier"] + + // Transactor Account and set up the account + ethPrivKey := cfg.Secrets.Alice + setupAliceAccount(t, cfg, sys, ethPrivKey) + + // Submit TX to L2 sequencer node + receipt := SendL2Tx(t, cfg, l2Seq, ethPrivKey, func(opts *TxOpts) { + opts.Value = big.NewInt(1_000_000_000) + opts.Nonce = 1 // Already have deposit + opts.ToAddr = &common.Address{0xff, 0xff} + opts.Gas, err = core.IntrinsicGas(opts.Data, nil, false, true, true, false) + require.NoError(t, err) + opts.VerifyOnClients(l2Verif) + }) + + // Verify blocks match after batch submission on verifiers and sequencers + verifBlock, err := l2Verif.BlockByNumber(context.Background(), receipt.BlockNumber) + require.NoError(t, err) + require.Equal(t, verifBlock.Hash(), receipt.BlockHash, "must be same block") + seqBlock, err := l2Seq.BlockByNumber(context.Background(), receipt.BlockNumber) + require.NoError(t, err) + require.Equal(t, seqBlock.Hash(), receipt.BlockHash, "must be same block") + require.Equal(t, verifBlock.NumberU64(), seqBlock.NumberU64(), "Verifier and sequencer blocks not the same after including a batch tx") + require.Equal(t, verifBlock.ParentHash(), seqBlock.ParentHash(), "Verifier and sequencer blocks parent hashes not the same after including a batch tx") + require.Equal(t, verifBlock.Hash(), seqBlock.Hash(), "Verifier and sequencer blocks not the same after including a batch tx") + + rollupRPCClient, err := rpc.DialContext(context.Background(), sys.RollupNodes["sequencer"].HTTPEndpoint()) + require.NoError(t, err) + rollupClient := sources.NewRollupClient(client.NewBaseRPCClient(rollupRPCClient)) + // basic check that sync status works + seqStatus, err := rollupClient.SyncStatus(context.Background()) + require.NoError(t, err) + require.LessOrEqual(t, seqBlock.NumberU64(), seqStatus.UnsafeL2.Number) + + // quick check that the batch submitter works + require.Eventually(t, func() bool { + // wait for chain to be marked as "safe" (i.e. confirm batch-submission works) + stat, err := rollupClient.SyncStatus(context.Background()) + require.NoError(t, err) + return stat.SafeL2.Number >= receipt.BlockNumber.Uint64() + }, time.Second*20, time.Second, "expected L2 to be batch-submitted and labeled as safe") + + // check that the L2 tx is still canonical + // safe and canonical => the block was batched successfully with brotli + seqBlock, err = l2Seq.BlockByNumber(context.Background(), receipt.BlockNumber) + require.NoError(t, err) + require.Equal(t, seqBlock.Hash(), receipt.BlockHash, "receipt block must match canonical block at tx inclusion height") +} diff --git a/op-e2e2/build_helper.go b/op-e2e2/build_helper.go new file mode 100644 index 000000000000..b84240135c68 --- /dev/null +++ b/op-e2e2/build_helper.go @@ -0,0 +1,26 @@ +package op_e2e + +import ( + "context" + "os/exec" + "strings" + "testing" + "time" + + "github.com/stretchr/testify/require" +) + +// BuildOpProgramClient builds the `op-program` client executable and returns the path to the resulting executable +func BuildOpProgramClient(t *testing.T) string { + t.Log("Building op-program-client") + ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute) + defer cancel() + cmd := exec.CommandContext(ctx, "make", "op-program-client") + cmd.Dir = "../op-program" + var out strings.Builder + cmd.Stdout = &out + cmd.Stderr = &out + require.NoErrorf(t, cmd.Run(), "Failed to build op-program-client: %v", &out) + t.Log("Built op-program-client successfully") + return "../op-program/bin/op-program-client" +} diff --git a/op-e2e2/check_scripts_test.go b/op-e2e2/check_scripts_test.go new file mode 100644 index 000000000000..28cdcca3ab8c --- /dev/null +++ b/op-e2e2/check_scripts_test.go @@ -0,0 +1,80 @@ +package op_e2e + +import ( + "context" + "testing" + + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/log" + + "github.com/stretchr/testify/require" + + fjordChecks "github.com/ethereum-optimism/optimism/op-chain-ops/cmd/check-fjord/checks" + "github.com/ethereum-optimism/optimism/op-service/testlog" +) + +// TestCheckFjordScript ensures the op-chain-ops/cmd/check-fjord script runs successfully +// against a test chain with the fjord hardfork activated/unactivated +func TestCheckFjordScript(t *testing.T) { + log := testlog.Logger(t, log.LevelInfo) + + cfg := DefaultSystemConfig(t) + genesisActivation := hexutil.Uint64(0) + cfg.DeployConfig.L1CancunTimeOffset = &genesisActivation + cfg.DeployConfig.L2GenesisRegolithTimeOffset = &genesisActivation + cfg.DeployConfig.L2GenesisCanyonTimeOffset = &genesisActivation + cfg.DeployConfig.L2GenesisDeltaTimeOffset = &genesisActivation + cfg.DeployConfig.L2GenesisEcotoneTimeOffset = &genesisActivation + + tests := []struct { + name string + fjordActivation *hexutil.Uint64 + expectErr bool + }{ + { + name: "fjord_activated", + fjordActivation: &genesisActivation, + expectErr: false, + }, + { + name: "fjord_unactivated", + fjordActivation: nil, + expectErr: true, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + InitParallel(t) + cfg.DeployConfig.L2GenesisFjordTimeOffset = tt.fjordActivation + + sys, err := cfg.Start(t) + require.NoError(t, err, "Error starting up system") + defer sys.Close() + + checkFjordConfig := &fjordChecks.CheckFjordConfig{ + Log: log, + L2: sys.Clients["sequencer"], + Key: sys.Cfg.Secrets.Alice, + Addr: sys.Cfg.Secrets.Addresses().Alice, + } + if tt.expectErr { + err = fjordChecks.CheckRIP7212(context.Background(), checkFjordConfig) + require.Error(t, err, "expected error for CheckRIP7212") + err = fjordChecks.CheckGasPriceOracle(context.Background(), checkFjordConfig) + require.Error(t, err, "expected error for CheckGasPriceOracle") + err = fjordChecks.CheckTxEmpty(context.Background(), checkFjordConfig) + require.Error(t, err, "expected error for CheckTxEmpty") + err = fjordChecks.CheckTxAllZero(context.Background(), checkFjordConfig) + require.Error(t, err, "expected error for CheckTxAllZero") + err = fjordChecks.CheckTxAll42(context.Background(), checkFjordConfig) + require.Error(t, err, "expected error for CheckTxAll42") + err = fjordChecks.CheckTxRandom(context.Background(), checkFjordConfig) + require.Error(t, err, "expected error for CheckTxRandom") + } else { + err = fjordChecks.CheckAll(context.Background(), checkFjordConfig) + require.NoError(t, err, "should not error on CheckAll") + } + }) + } +} diff --git a/op-e2e2/config/init.go b/op-e2e2/config/init.go new file mode 100644 index 000000000000..ee8ec7a27f20 --- /dev/null +++ b/op-e2e2/config/init.go @@ -0,0 +1,203 @@ +package config + +import ( + "encoding/json" + "errors" + "flag" + "fmt" + "os" + "path/filepath" + "testing" + "time" + + "golang.org/x/exp/slog" + + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/log" + + "github.com/ethereum-optimism/optimism/op-chain-ops/genesis" + "github.com/ethereum-optimism/optimism/op-e2e2/external" + op_service "github.com/ethereum-optimism/optimism/op-service" + oplog "github.com/ethereum-optimism/optimism/op-service/log" +) + +// legacy geth log levels - the geth command line --verbosity flag wasn't +// migrated to use slog's numerical levels. +const ( + LegacyLevelCrit = iota + LegacyLevelError + LegacyLevelWarn + LegacyLevelInfo + LegacyLevelDebug + LegacyLevelTrace +) + +var ( + // All of the following variables are set in the init function + // and read from JSON files on disk that are generated by the + // foundry deploy script. These are globally exported to be used + // in end to end tests. + + // L1Allocs represents the L1 genesis block state. + L1Allocs *genesis.ForgeAllocs + // L1Deployments maps contract names to accounts in the L1 + // genesis block state. + L1Deployments *genesis.L1Deployments + // l2Allocs represents the L2 allocs, by hardfork/mode (e.g. delta, ecotone, interop, other) + l2Allocs map[genesis.L2AllocsMode]*genesis.ForgeAllocs + // DeployConfig represents the deploy config used by the system. + DeployConfig *genesis.DeployConfig + // ExternalL2Shim is the shim to use if external ethereum client testing is + // enabled + ExternalL2Shim string + // ExternalL2TestParms is additional metadata for executing external L2 + // tests. + ExternalL2TestParms external.TestParms + // EthNodeVerbosity is the (legacy geth) level of verbosity to output + EthNodeVerbosity int +) + +func init() { + var l1AllocsPath, l2AllocsDir, l1DeploymentsPath, deployConfigPath, externalL2 string + + cwd, err := os.Getwd() + if err != nil { + panic(err) + } + root, err := op_service.FindMonorepoRoot(cwd) + if err != nil { + panic(err) + } + + defaultL1AllocsPath := filepath.Join(root, ".devnet", "allocs-l1.json") + defaultL2AllocsDir := filepath.Join(root, ".devnet") + defaultL1DeploymentsPath := filepath.Join(root, ".devnet", "addresses.json") + defaultDeployConfigPath := filepath.Join(root, "packages", "contracts-bedrock", "deploy-config", "devnetL1.json") + + flag.StringVar(&l1AllocsPath, "l1-allocs", defaultL1AllocsPath, "") + flag.StringVar(&l2AllocsDir, "l2-allocs-dir", defaultL2AllocsDir, "") + flag.StringVar(&l1DeploymentsPath, "l1-deployments", defaultL1DeploymentsPath, "") + flag.StringVar(&deployConfigPath, "deploy-config", defaultDeployConfigPath, "") + flag.StringVar(&externalL2, "externalL2", "", "Enable tests with external L2") + flag.IntVar(&EthNodeVerbosity, "ethLogVerbosity", LegacyLevelInfo, "The (legacy geth) level of verbosity to use for the eth node logs") + testing.Init() // Register test flags before parsing + flag.Parse() + + // Setup global logger + lvl := log.FromLegacyLevel(EthNodeVerbosity) + var handler slog.Handler + if lvl > log.LevelCrit { + handler = log.DiscardHandler() + } else { + if lvl < log.LevelTrace { // clip to trace level + lvl = log.LevelTrace + } + // We cannot attach a testlog logger, + // because the global logger is shared between different independent parallel tests. + // Tests that write to a testlogger of another finished test fail. + handler = oplog.NewLogHandler(os.Stdout, oplog.CLIConfig{ + Level: lvl, + Color: false, // some CI logs do not handle colors well + Format: oplog.FormatTerminal, + }) + } + oplog.SetGlobalLogHandler(handler) + + if err := allExist(l1AllocsPath, l1DeploymentsPath, deployConfigPath); err != nil { + return + } + + L1Allocs, err = genesis.LoadForgeAllocs(l1AllocsPath) + if err != nil { + panic(err) + } + l2Allocs = make(map[genesis.L2AllocsMode]*genesis.ForgeAllocs) + mustL2Allocs := func(mode genesis.L2AllocsMode) { + name := "allocs-l2" + if mode != "" { + name += "-" + string(mode) + } + allocs, err := genesis.LoadForgeAllocs(filepath.Join(l2AllocsDir, name+".json")) + if err != nil { + panic(err) + } + l2Allocs[mode] = allocs + } + mustL2Allocs(genesis.L2AllocsFjord) + mustL2Allocs(genesis.L2AllocsEcotone) + mustL2Allocs(genesis.L2AllocsDelta) + L1Deployments, err = genesis.NewL1Deployments(l1DeploymentsPath) + if err != nil { + panic(err) + } + DeployConfig, err = genesis.NewDeployConfig(deployConfigPath) + if err != nil { + panic(err) + } + + // Do not use clique in the in memory tests. Otherwise block building + // would be much more complex. + DeployConfig.L1UseClique = false + // Set the L1 genesis block timestamp to now + DeployConfig.L1GenesisBlockTimestamp = hexutil.Uint64(time.Now().Unix()) + DeployConfig.FundDevAccounts = true + // Speed up the in memory tests + DeployConfig.L1BlockTime = 2 + DeployConfig.L2BlockTime = 1 + + if L1Deployments != nil { + DeployConfig.SetDeployments(L1Deployments) + } + + if externalL2 != "" { + if err := initExternalL2(externalL2); err != nil { + panic(fmt.Errorf("could not initialize external L2: %w", err)) + } + } +} + +func L2Allocs(mode genesis.L2AllocsMode) *genesis.ForgeAllocs { + allocs, ok := l2Allocs[mode] + if !ok { + panic(fmt.Errorf("unknown L2 allocs mode: %q", mode)) + } + return allocs.Copy() +} + +func initExternalL2(externalL2 string) error { + var err error + ExternalL2Shim, err = filepath.Abs(filepath.Join(externalL2, "shim")) + if err != nil { + return fmt.Errorf("could not compute abs of externalL2Nodes shim: %w", err) + } + + _, err = os.Stat(ExternalL2Shim) + if err != nil { + return fmt.Errorf("failed to stat externalL2Nodes path: %w", err) + } + + file, err := os.Open(filepath.Join(externalL2, "test_parms.json")) + if err != nil { + if errors.Is(err, os.ErrNotExist) { + return nil + } + return fmt.Errorf("could not open external L2 test parms: %w", err) + } + defer file.Close() + + if err := json.NewDecoder(file).Decode(&ExternalL2TestParms); err != nil { + return fmt.Errorf("could not decode external L2 test parms: %w", err) + } + + return nil +} + +func allExist(filenames ...string) error { + for _, filename := range filenames { + if _, err := os.Stat(filename); err != nil { + fmt.Printf("file %s does not exist, skipping genesis generation\n", filename) + return err + } + } + return nil +} diff --git a/op-e2e2/custom_gas_token_test.go b/op-e2e2/custom_gas_token_test.go new file mode 100644 index 000000000000..3b31af7f1790 --- /dev/null +++ b/op-e2e2/custom_gas_token_test.go @@ -0,0 +1,459 @@ +package op_e2e + +import ( + "context" + "fmt" + "math/big" + "testing" + "time" + + "github.com/ethereum-optimism/optimism/op-e2e2/bindings" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/receipts" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/wait" + "github.com/ethereum-optimism/optimism/op-node/rollup/derive" + "github.com/ethereum-optimism/optimism/op-service/predeploys" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestCustomGasToken(t *testing.T) { + InitParallel(t, SkipOnFPAC) // Custom Gas Token feature is not yet compatible with FPAC + + cfg := DefaultSystemConfig(t) + offset := hexutil.Uint64(0) + cfg.DeployConfig.L2GenesisRegolithTimeOffset = &offset + cfg.DeployConfig.L1CancunTimeOffset = &offset + cfg.DeployConfig.L2GenesisCanyonTimeOffset = &offset + cfg.DeployConfig.L2GenesisDeltaTimeOffset = &offset + cfg.DeployConfig.L2GenesisEcotoneTimeOffset = &offset + + sys, err := cfg.Start(t) + require.NoError(t, err, "Error starting up system") + defer sys.Close() + l1Client := sys.Clients["l1"] + l2Client := sys.Clients["sequencer"] + + aliceOpts, err := bind.NewKeyedTransactorWithChainID(cfg.Secrets.Alice, cfg.L1ChainIDBig()) + require.NoError(t, err) + + // Deploy WETH9, we'll use this as our custom gas token for the purpose of the test + weth9Address, tx, weth9, err := bindings.DeployWETH9(aliceOpts, l1Client) + require.NoError(t, err) + _, err = wait.ForReceiptOK(context.Background(), l1Client, tx.Hash()) + require.NoError(t, err) + + // setup expectations using custom gas token + type Expectations struct { + tokenAddress common.Address + tokenName string + tokenSymbol string + tokenDecimals uint8 + } + disabledExpectations := Expectations{ + common.HexToAddress("0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"), + "Ether", + "ETH", + uint8(18), + } + enabledExpectations := Expectations{} + enabledExpectations.tokenAddress = weth9Address + enabledExpectations.tokenName, err = weth9.Name(&bind.CallOpts{}) + require.NoError(t, err) + enabledExpectations.tokenSymbol, err = weth9.Symbol(&bind.CallOpts{}) + require.NoError(t, err) + enabledExpectations.tokenDecimals, err = weth9.Decimals(&bind.CallOpts{}) + require.NoError(t, err) + + // Get some WETH + aliceOpts.Value = big.NewInt(10_000_000) + tx, err = weth9.Deposit(aliceOpts) + waitForTx(t, tx, err, l1Client) + aliceOpts.Value = nil + newBalance, err := weth9.BalanceOf(&bind.CallOpts{}, aliceOpts.From) + require.NoError(t, err) + require.Equal(t, newBalance, big.NewInt(10_000_000)) + + // Function to prepare and make call to depositERC20Transaction and make + // appropriate assertions dependent on whether custom gas tokens have been enabled or not. + checkDeposit := func(t *testing.T, enabled bool) { + // Set amount of WETH9 to bridge to the recipient on L2 + amountToBridge := big.NewInt(10) + recipient := common.HexToAddress("0xbeefdead") + + // Approve OptimismPortal + tx, err = weth9.Approve(aliceOpts, cfg.L1Deployments.OptimismPortalProxy, amountToBridge) + waitForTx(t, tx, err, l1Client) + + // Get recipient L2 balance before bridging + previousL2Balance, err := l2Client.BalanceAt(context.Background(), recipient, nil) + require.NoError(t, err) + + // Bridge the tokens + optimismPortal, err := bindings.NewOptimismPortal(cfg.L1Deployments.OptimismPortalProxy, l1Client) + require.NoError(t, err) + tx, err = optimismPortal.DepositERC20Transaction(aliceOpts, + recipient, + amountToBridge, + amountToBridge, + 50_0000, // _gasLimit + false, + []byte{}, + ) + if enabled { + require.NoError(t, err) + receipt, err := wait.ForReceiptOK(context.Background(), l1Client, tx.Hash()) + require.NoError(t, err) + + // compute the deposit transaction hash + poll for it + depositEvent, err := receipts.FindLog(receipt.Logs, optimismPortal.ParseTransactionDeposited) + require.NoError(t, err, "Should emit deposit event") + depositTx, err := derive.UnmarshalDepositLogEvent(&depositEvent.Raw) + require.NoError(t, err) + _, err = wait.ForReceiptOK(context.Background(), l2Client, types.NewTx(depositTx).Hash()) + require.NoError(t, err) + + require.EventuallyWithT(t, func(t *assert.CollectT) { + // check for balance increase on L2 + newL2Balance, err := l2Client.BalanceAt(context.Background(), recipient, nil) + require.NoError(t, err) + l2BalanceIncrease := big.NewInt(0).Sub(newL2Balance, previousL2Balance) + require.Equal(t, amountToBridge, l2BalanceIncrease) + }, 10*time.Second, 1*time.Second) + } else { + require.Error(t, err) + } + } + + // Function to prepare and execute withdrawal flow for CGTs + // and assert token balance is increased on L1. + checkWithdrawal := func(t *testing.T) { + l2Seq := l2Client + l2Verif := sys.Clients["verifier"] + fromAddr := aliceOpts.From + ethPrivKey := cfg.Secrets.Alice + + // Start L2 balance for withdrawal + startBalanceBeforeWithdrawal, err := l2Seq.BalanceAt(context.Background(), fromAddr, nil) + require.NoError(t, err) + + withdrawAmount := big.NewInt(5) + tx, receipt := SendWithdrawal(t, cfg, l2Seq, cfg.Secrets.Alice, func(opts *WithdrawalTxOpts) { + opts.Value = withdrawAmount + opts.VerifyOnClients(l2Verif) + }) + + // Verify L2 balance after withdrawal + header, err := l2Verif.HeaderByNumber(context.Background(), receipt.BlockNumber) + require.NoError(t, err) + + endBalanceAfterWithdrawal, err := wait.ForBalanceChange(context.Background(), l2Seq, fromAddr, startBalanceBeforeWithdrawal) + require.NoError(t, err) + + // Take fee into account + diff := new(big.Int).Sub(startBalanceBeforeWithdrawal, endBalanceAfterWithdrawal) + fees := calcGasFees(receipt.GasUsed, tx.GasTipCap(), tx.GasFeeCap(), header.BaseFee) + fees = fees.Add(fees, receipt.L1Fee) + diff = diff.Sub(diff, fees) + require.Equal(t, withdrawAmount, diff) + + // Take start token balance on L1 + startTokenBalanceBeforeFinalize, err := weth9.BalanceOf(&bind.CallOpts{}, fromAddr) + require.NoError(t, err) + + startETHBalanceBeforeFinalize, err := l1Client.BalanceAt(context.Background(), fromAddr, nil) + require.NoError(t, err) + + proveReceipt, finalizeReceipt, resolveClaimReceipt, resolveReceipt := ProveAndFinalizeWithdrawal(t, cfg, sys, "verifier", ethPrivKey, receipt) + + // Verify L1 ETH balance change + proveFee := new(big.Int).Mul(new(big.Int).SetUint64(proveReceipt.GasUsed), proveReceipt.EffectiveGasPrice) + finalizeFee := new(big.Int).Mul(new(big.Int).SetUint64(finalizeReceipt.GasUsed), finalizeReceipt.EffectiveGasPrice) + fees = new(big.Int).Add(proveFee, finalizeFee) + if e2eutils.UseFPAC() { + resolveClaimFee := new(big.Int).Mul(new(big.Int).SetUint64(resolveClaimReceipt.GasUsed), resolveClaimReceipt.EffectiveGasPrice) + resolveFee := new(big.Int).Mul(new(big.Int).SetUint64(resolveReceipt.GasUsed), resolveReceipt.EffectiveGasPrice) + fees = new(big.Int).Add(fees, resolveClaimFee) + fees = new(big.Int).Add(fees, resolveFee) + } + + // Verify L1ETHBalance after withdrawal + // On CGT chains, the only change in ETH balance from a withdrawal + // is a decrease to pay for gas + endETHBalanceAfterFinalize, err := l1Client.BalanceAt(context.Background(), fromAddr, nil) + require.NoError(t, err) + diff = new(big.Int).Sub(endETHBalanceAfterFinalize, startETHBalanceBeforeFinalize) + require.Equal(t, new(big.Int).Sub(big.NewInt(0), fees), diff) + + // Verify token balance after withdrawal + // L1 Fees are paid in ETH, and + // withdrawal is of a Custom Gas Token, so we do not subtract l1 fees from expected balance change + // as we would if ETH was the gas paying token + endTokenBalanceAfterFinalize, err := weth9.BalanceOf(&bind.CallOpts{}, fromAddr) + require.NoError(t, err) + diff = new(big.Int).Sub(endTokenBalanceAfterFinalize, startTokenBalanceBeforeFinalize) + require.Equal(t, withdrawAmount, diff) + } + + checkL1TokenNameAndSymbol := func(t *testing.T, enabled bool) { + systemConfig, err := bindings.NewSystemConfig(cfg.L1Deployments.SystemConfigProxy, l1Client) + require.NoError(t, err) + + token, err := systemConfig.GasPayingToken(&bind.CallOpts{}) + require.NoError(t, err) + + name, err := systemConfig.GasPayingTokenName(&bind.CallOpts{}) + require.NoError(t, err) + + symbol, err := systemConfig.GasPayingTokenSymbol(&bind.CallOpts{}) + require.NoError(t, err) + + if enabled { + require.Equal(t, enabledExpectations.tokenAddress, token.Addr) + require.Equal(t, enabledExpectations.tokenDecimals, token.Decimals) + require.Equal(t, enabledExpectations.tokenName, name) + require.Equal(t, enabledExpectations.tokenSymbol, symbol) + } else { + require.Equal(t, disabledExpectations.tokenAddress, token.Addr) + require.Equal(t, disabledExpectations.tokenDecimals, token.Decimals) + require.Equal(t, disabledExpectations.tokenName, name) + require.Equal(t, disabledExpectations.tokenSymbol, symbol) + } + } + + checkL2TokenNameAndSymbol := func(t *testing.T, enabled bool) { + l1Block, err := bindings.NewL1Block(predeploys.L1BlockAddr, l2Client) + require.NoError(t, err) + + token, err := l1Block.GasPayingToken(&bind.CallOpts{}) + require.NoError(t, err) + + name, err := l1Block.GasPayingTokenName(&bind.CallOpts{}) + require.NoError(t, err) + + symbol, err := l1Block.GasPayingTokenSymbol(&bind.CallOpts{}) + require.NoError(t, err) + + if enabled { + require.Equal(t, enabledExpectations.tokenAddress, token.Addr) + require.Equal(t, enabledExpectations.tokenDecimals, token.Decimals) + require.Equal(t, enabledExpectations.tokenName, name) + require.Equal(t, enabledExpectations.tokenSymbol, symbol) + } else { + require.Equal(t, disabledExpectations.tokenAddress, token.Addr) + require.Equal(t, disabledExpectations.tokenDecimals, token.Decimals) + require.Equal(t, disabledExpectations.tokenName, name) + require.Equal(t, disabledExpectations.tokenSymbol, symbol) + } + } + + checkWETHTokenNameAndSymbol := func(t *testing.T, enabled bool) { + // Check name and symbol in WETH predeploy + weth, err := bindings.NewWETH(predeploys.WETHAddr, l2Client) + require.NoError(t, err) + + name, err := weth.Name(&bind.CallOpts{}) + require.NoError(t, err) + + symbol, err := weth.Symbol(&bind.CallOpts{}) + require.NoError(t, err) + + if enabled { + require.Equal(t, "Wrapped "+enabledExpectations.tokenName, name) + require.Equal(t, "W"+enabledExpectations.tokenSymbol, symbol) + } else { + require.Equal(t, "Wrapped "+disabledExpectations.tokenName, name) + require.Equal(t, "W"+disabledExpectations.tokenSymbol, symbol) + } + } + + // Begin by testing behaviour when CGT feature is not enabled + enabled := false + checkDeposit(t, enabled) + checkL1TokenNameAndSymbol(t, enabled) + checkL2TokenNameAndSymbol(t, enabled) + checkWETHTokenNameAndSymbol(t, enabled) + + // Activate custom gas token feature (devnet does not have this activated at genesis) + setCustomGasToken(t, cfg, sys, weth9Address) + + // Now test behaviour given CGT feature is enabled + enabled = true + checkDeposit(t, enabled) + checkWithdrawal(t) + checkL1TokenNameAndSymbol(t, enabled) + checkL2TokenNameAndSymbol(t, enabled) + checkWETHTokenNameAndSymbol(t, enabled) +} + +// callViaSafe will use the Safe smart account at safeAddress to send a transaction to target using the provided data. The transaction signature is constructed from +// the supplied opts. +func callViaSafe(opts *bind.TransactOpts, client *ethclient.Client, safeAddress common.Address, target common.Address, data []byte) (*types.Transaction, error) { + signature := [65]byte{} + copy(signature[12:], opts.From[:]) + signature[64] = uint8(1) + + safe, err := bindings.NewSafe(safeAddress, client) + if err != nil { + return nil, err + } + + owners, err := safe.GetOwners(&bind.CallOpts{}) + if err != nil { + return nil, err + } + + isOwner, err := safe.IsOwner(&bind.CallOpts{}, opts.From) + if err != nil { + return nil, err + } + if !isOwner { + return nil, fmt.Errorf("address %s is not in owners list %s", opts.From, owners) + } + + return safe.ExecTransaction(opts, target, big.NewInt(0), data, 0, big.NewInt(0), big.NewInt(0), big.NewInt(0), common.Address{}, common.Address{}, signature[:]) +} + +// setCustomGasToeken enables the Custom Gas Token feature on a chain where it wasn't enabled at genesis. +// It reads existing parameters from the SystemConfig contract, inserts the supplied cgtAddress and reinitializes that contract. +// To do this it uses the ProxyAdmin and StorageSetter from the supplied cfg. +func setCustomGasToken(t *testing.T, cfg SystemConfig, sys *System, cgtAddress common.Address) { + l1Client := sys.Clients["l1"] + deployerOpts, err := bind.NewKeyedTransactorWithChainID(cfg.Secrets.Deployer, cfg.L1ChainIDBig()) + require.NoError(t, err) + + // Bind a SystemConfig at the SystemConfigProxy address + systemConfig, err := bindings.NewSystemConfig(cfg.L1Deployments.SystemConfigProxy, l1Client) + require.NoError(t, err) + + // Get existing parameters from SystemConfigProxy contract + owner, err := systemConfig.Owner(&bind.CallOpts{}) + require.NoError(t, err) + basefeeScalar, err := systemConfig.BasefeeScalar(&bind.CallOpts{}) + require.NoError(t, err) + blobbasefeeScalar, err := systemConfig.BlobbasefeeScalar(&bind.CallOpts{}) + require.NoError(t, err) + batcherHash, err := systemConfig.BatcherHash(&bind.CallOpts{}) + require.NoError(t, err) + gasLimit, err := systemConfig.GasLimit(&bind.CallOpts{}) + require.NoError(t, err) + unsafeBlockSigner, err := systemConfig.UnsafeBlockSigner(&bind.CallOpts{}) + require.NoError(t, err) + resourceConfig, err := systemConfig.ResourceConfig(&bind.CallOpts{}) + require.NoError(t, err) + batchInbox, err := systemConfig.BatchInbox(&bind.CallOpts{}) + require.NoError(t, err) + addresses := bindings.SystemConfigAddresses{} + addresses.L1CrossDomainMessenger, err = systemConfig.L1CrossDomainMessenger(&bind.CallOpts{}) + require.NoError(t, err) + addresses.L1ERC721Bridge, err = systemConfig.L1ERC721Bridge(&bind.CallOpts{}) + require.NoError(t, err) + addresses.L1StandardBridge, err = systemConfig.L1StandardBridge(&bind.CallOpts{}) + require.NoError(t, err) + addresses.DisputeGameFactory, err = systemConfig.DisputeGameFactory(&bind.CallOpts{}) + require.NoError(t, err) + addresses.OptimismPortal, err = systemConfig.OptimismPortal(&bind.CallOpts{}) + require.NoError(t, err) + addresses.OptimismMintableERC20Factory, err = systemConfig.OptimismMintableERC20Factory(&bind.CallOpts{}) + require.NoError(t, err) + + // Queue up custom gas token address ready for reinitialization + addresses.GasPayingToken = cgtAddress + + // Bind a ProxyAdmin to the ProxyAdmin address + proxyAdmin, err := bindings.NewProxyAdmin(cfg.L1Deployments.ProxyAdmin, l1Client) + require.NoError(t, err) + + // Compute Proxy Admin Owner (this is a SAFE with 1 owner) + proxyAdminOwner, err := proxyAdmin.Owner(&bind.CallOpts{}) + require.NoError(t, err) + + // Deploy a new StorageSetter contract + storageSetterAddr, tx, _, err := bindings.DeployStorageSetter(deployerOpts, l1Client) + waitForTx(t, tx, err, l1Client) + + // Set up a signer which controls the Proxy Admin Owner SAFE + safeOwnerOpts, err := bind.NewKeyedTransactorWithChainID(cfg.Secrets.Deployer, cfg.L1ChainIDBig()) + require.NoError(t, err) + + // Encode calldata for upgrading SystemConfigProxy to the StorageSetter implementation + proxyAdminABI, err := bindings.ProxyAdminMetaData.GetAbi() + require.NoError(t, err) + encodedUpgradeCall, err := proxyAdminABI.Pack("upgrade", + cfg.L1Deployments.SystemConfigProxy, storageSetterAddr) + require.NoError(t, err) + + // Execute the upgrade SystemConfigProxy -> StorageSetter + tx, err = callViaSafe(safeOwnerOpts, l1Client, proxyAdminOwner, cfg.L1Deployments.ProxyAdmin, encodedUpgradeCall) + waitForTx(t, tx, err, l1Client) + + // Bind a StorageSetter to the SystemConfigProxy address + storageSetter, err := bindings.NewStorageSetter(cfg.L1Deployments.SystemConfigProxy, l1Client) + require.NoError(t, err) + + // Use StorageSetter to clear out "initialize" slot + tx, err = storageSetter.SetBytes320(deployerOpts, [32]byte{0}, [32]byte{0}) + waitForTx(t, tx, err, l1Client) + + // Sanity check previous step worked + currentSlotValue, err := storageSetter.GetBytes32(&bind.CallOpts{}, [32]byte{0}) + require.NoError(t, err) + require.Equal(t, currentSlotValue, [32]byte{0}) + + // Prepare calldata for SystemConfigProxy -> SystemConfig upgrade + encodedUpgradeCall, err = proxyAdminABI.Pack("upgrade", + cfg.L1Deployments.SystemConfigProxy, cfg.L1Deployments.SystemConfig) + require.NoError(t, err) + + // Execute SystemConfigProxy -> SystemConfig upgrade + tx, err = callViaSafe(safeOwnerOpts, l1Client, proxyAdminOwner, cfg.L1Deployments.ProxyAdmin, encodedUpgradeCall) + waitForTx(t, tx, err, l1Client) + + // Reinitialise with existing initializer values but with custom gas token set + tx, err = systemConfig.Initialize(deployerOpts, owner, + basefeeScalar, + blobbasefeeScalar, + batcherHash, + gasLimit, + unsafeBlockSigner, + resourceConfig, + batchInbox, + addresses) + require.NoError(t, err) + receipt, err := wait.ForReceiptOK(context.Background(), l1Client, tx.Hash()) + require.NoError(t, err) + + // Read Custom Gas Token and check it has been set properly + gpt, err := systemConfig.GasPayingToken(&bind.CallOpts{}) + require.NoError(t, err) + require.Equal(t, cgtAddress, gpt.Addr) + + optimismPortal, err := bindings.NewOptimismPortal(cfg.L1Deployments.OptimismPortalProxy, l1Client) + require.NoError(t, err) + + depositEvent, err := receipts.FindLog(receipt.Logs, optimismPortal.ParseTransactionDeposited) + require.NoError(t, err, "Should emit deposit event") + depositTx, err := derive.UnmarshalDepositLogEvent(&depositEvent.Raw) + + require.NoError(t, err) + l2Client := sys.Clients["sequencer"] + receipt, err = wait.ForReceiptOK(context.Background(), l2Client, types.NewTx(depositTx).Hash()) + require.NoError(t, err) + + l1Block, err := bindings.NewL1Block(predeploys.L1BlockAddr, l2Client) + require.NoError(t, err) + _, err = receipts.FindLog(receipt.Logs, l1Block.ParseGasPayingTokenSet) + require.NoError(t, err) +} + +// waitForTx is a thing wrapper around wait.ForReceiptOK which asserts on there being no errors. +func waitForTx(t *testing.T, tx *types.Transaction, err error, client *ethclient.Client) { + require.NoError(t, err) + _, err = wait.ForReceiptOK(context.Background(), client, tx.Hash()) + require.NoError(t, err) +} diff --git a/op-e2e2/deposit_test.go b/op-e2e2/deposit_test.go new file mode 100644 index 000000000000..d3b4778d6e4c --- /dev/null +++ b/op-e2e2/deposit_test.go @@ -0,0 +1,141 @@ +package op_e2e + +import ( + "context" + "math/big" + "testing" + "time" + + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/wait" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/stretchr/testify/require" +) + +func TestMintOnRevertedDeposit(t *testing.T) { + InitParallel(t) + cfg := DefaultSystemConfig(t) + delete(cfg.Nodes, "verifier") + sys, err := cfg.Start(t) + require.Nil(t, err, "Error starting up system") + defer sys.Close() + + l1Client := sys.Clients["l1"] + l2Verif := sys.Clients["sequencer"] + + // create signer + aliceKey := cfg.Secrets.Alice + opts, err := bind.NewKeyedTransactorWithChainID(aliceKey, cfg.L1ChainIDBig()) + require.Nil(t, err) + fromAddr := opts.From + + ctx, cancel := context.WithTimeout(context.Background(), 1*time.Second) + startBalance, err := l2Verif.BalanceAt(ctx, fromAddr, nil) + cancel() + require.Nil(t, err) + + ctx, cancel = context.WithTimeout(context.Background(), 1*time.Second) + startNonce, err := l2Verif.NonceAt(ctx, fromAddr, nil) + require.NoError(t, err) + cancel() + + toAddr := common.Address{0xff, 0xff} + mintAmount := big.NewInt(9_000_000) + opts.Value = mintAmount + SendDepositTx(t, cfg, l1Client, l2Verif, opts, func(l2Opts *DepositTxOpts) { + l2Opts.ToAddr = toAddr + // trigger a revert by transferring more than we have available + l2Opts.Value = new(big.Int).Mul(common.Big2, startBalance) + l2Opts.ExpectedStatus = types.ReceiptStatusFailed + }) + + // Confirm balance + ctx, cancel = context.WithTimeout(context.Background(), 15*time.Second) + endBalance, err := wait.ForBalanceChange(ctx, l2Verif, fromAddr, startBalance) + cancel() + require.Nil(t, err) + + ctx, cancel = context.WithTimeout(context.Background(), 1*time.Second) + toAddrBalance, err := l2Verif.BalanceAt(ctx, toAddr, nil) + cancel() + require.NoError(t, err) + + diff := new(big.Int) + diff = diff.Sub(endBalance, startBalance) + require.Equal(t, mintAmount, diff, "Did not get expected balance change") + require.Equal(t, common.Big0.Int64(), toAddrBalance.Int64(), "The recipient account balance should be zero") + + ctx, cancel = context.WithTimeout(context.Background(), 1*time.Second) + endNonce, err := l2Verif.NonceAt(ctx, fromAddr, nil) + require.NoError(t, err) + cancel() + require.Equal(t, startNonce+1, endNonce, "Nonce of deposit sender should increment on L2, even if the deposit fails") +} + +func TestDepositTxCreateContract(t *testing.T) { + InitParallel(t) + cfg := DefaultSystemConfig(t) + delete(cfg.Nodes, "verifier") + + sys, err := cfg.Start(t) + require.Nil(t, err, "Error starting up system") + defer sys.Close() + + l1Client := sys.Clients["l1"] + l2Client := sys.Clients["sequencer"] + + opts, err := bind.NewKeyedTransactorWithChainID(cfg.Secrets.Alice, cfg.L1ChainIDBig()) + require.Nil(t, err) + + // Simple constructor that is prefixed to the actual contract code + // Results in the contract code being returned as the code for the new contract + deployPrefixSize := byte(16) + deployPrefix := []byte{ + // Copy input data after this prefix into memory starting at address 0x00 + // CODECOPY arg size + byte(vm.PUSH1), deployPrefixSize, + byte(vm.CODESIZE), + byte(vm.SUB), + // CODECOPY arg offset + byte(vm.PUSH1), deployPrefixSize, + // CODECOPY arg destOffset + byte(vm.PUSH1), 0x00, + byte(vm.CODECOPY), + + // Return code from memory + // RETURN arg size + byte(vm.PUSH1), deployPrefixSize, + byte(vm.CODESIZE), + byte(vm.SUB), + // RETURN arg offset + byte(vm.PUSH1), 0x00, + byte(vm.RETURN), + } + // Stores the first word from call data code to storage slot 0 + sstoreContract := []byte{ + // Load first word from call data + byte(vm.PUSH1), 0x00, + byte(vm.CALLDATALOAD), + + // Store it to slot 0 + byte(vm.PUSH1), 0x00, + byte(vm.SSTORE), + } + + deployData := append(deployPrefix, sstoreContract...) + + l2Receipt := SendDepositTx(t, cfg, l1Client, l2Client, opts, func(l2Opts *DepositTxOpts) { + l2Opts.Data = deployData + l2Opts.Value = common.Big0 + l2Opts.IsCreation = true + l2Opts.ToAddr = common.Address{} + l2Opts.GasLimit = 1_000_000 + }) + require.NotEqual(t, common.Address{}, l2Receipt.ContractAddress, "should not have zero address") + code, err := l2Client.CodeAt(context.Background(), l2Receipt.ContractAddress, nil) + require.NoError(t, err, "get deployed contract code") + require.Equal(t, sstoreContract, code, "should have deployed correct contract code") +} diff --git a/op-e2e2/e2eutils/addresses.go b/op-e2e2/e2eutils/addresses.go new file mode 100644 index 000000000000..46e639425a22 --- /dev/null +++ b/op-e2e2/e2eutils/addresses.go @@ -0,0 +1,66 @@ +package e2eutils + +import ( + "bytes" + "sort" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + + "github.com/ethereum-optimism/optimism/op-chain-ops/crossdomain" + "github.com/ethereum-optimism/optimism/op-service/predeploys" +) + +func collectAllocAddrs(alloc types.GenesisAlloc) []common.Address { + var out []common.Address + for addr := range alloc { + out = append(out, addr) + } + // make output deterministic + sort.Slice(out, func(i, j int) bool { + return bytes.Compare(out[i][:], out[j][:]) < 0 + }) + return out +} + +// CollectAddresses constructs a lists of addresses that may be used as fuzzing corpora +// or random address selection. +func CollectAddresses(sd *SetupData, dp *DeployParams) (out []common.Address) { + // This should be seeded with: + // - reserve 0 for selecting nil (contract creation) + out = append(out, common.Address{}) + // - zero address + out = append(out, common.Address{}) + // - addresses of signing accounts + out = append(out, dp.Addresses.All()...) + // prefunded L1/L2 accounts for testing + out = append(out, collectAllocAddrs(sd.L1Cfg.Alloc)...) + out = append(out, collectAllocAddrs(sd.L2Cfg.Alloc)...) + + // - addresses of system contracts + out = append(out, + sd.L1Cfg.Coinbase, + sd.L2Cfg.Coinbase, + dp.Addresses.SequencerP2P, + predeploys.SequencerFeeVaultAddr, + sd.RollupCfg.BatchInboxAddress, + sd.RollupCfg.Genesis.SystemConfig.BatcherAddr, + sd.RollupCfg.DepositContractAddress, + ) + // - precompiles + for i := 0; i <= 0xff; i++ { + out = append(out, common.Address{19: byte(i)}) + } + // - masked L2 version of all the original addrs + original := out[:] + for _, addr := range original { + masked := crossdomain.ApplyL1ToL2Alias(addr) + out = append(out, masked) + } + // - unmasked L1 version of all the original addrs + for _, addr := range original { + unmasked := crossdomain.UndoL1ToL2Alias(addr) + out = append(out, unmasked) + } + return out +} diff --git a/op-e2e2/e2eutils/addresses_test.go b/op-e2e2/e2eutils/addresses_test.go new file mode 100644 index 000000000000..c140a411937a --- /dev/null +++ b/op-e2e2/e2eutils/addresses_test.go @@ -0,0 +1,22 @@ +package e2eutils + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +func TestCollectAddresses(t *testing.T) { + tp := &TestParams{ + MaxSequencerDrift: 40, + SequencerWindowSize: 120, + ChannelTimeout: 120, + L1BlockTime: 15, + } + dp := MakeDeployParams(t, tp) + alloc := &AllocParams{PrefundTestUsers: true} + sd := Setup(t, dp, alloc) + addrs := CollectAddresses(sd, dp) + require.NotEmpty(t, addrs) + require.Contains(t, addrs, dp.Addresses.Batcher) +} diff --git a/op-e2e2/e2eutils/batcher/batcher.go b/op-e2e2/e2eutils/batcher/batcher.go new file mode 100644 index 000000000000..e826da2ca9e2 --- /dev/null +++ b/op-e2e2/e2eutils/batcher/batcher.go @@ -0,0 +1,56 @@ +package batcher + +import ( + "context" + "crypto/ecdsa" + "math/big" + "math/rand" + "testing" + + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/wait" + "github.com/ethereum-optimism/optimism/op-node/rollup" + "github.com/ethereum-optimism/optimism/op-service/testutils" + gethTypes "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/ethereum/go-ethereum/params" + "github.com/stretchr/testify/require" +) + +type Helper struct { + t *testing.T + privKey *ecdsa.PrivateKey + rollupCfg *rollup.Config + l1Client *ethclient.Client +} + +func NewHelper(t *testing.T, privKey *ecdsa.PrivateKey, rollupCfg *rollup.Config, l1Client *ethclient.Client) *Helper { + return &Helper{ + t: t, + privKey: privKey, + rollupCfg: rollupCfg, + l1Client: l1Client, + } +} + +func (h *Helper) SendLargeInvalidBatch(ctx context.Context) { + nonce, err := h.l1Client.PendingNonceAt(ctx, crypto.PubkeyToAddress(h.privKey.PublicKey)) + require.NoError(h.t, err, "Should get next batcher nonce") + + maxTxDataSize := 131072 // As per the Ethereum spec. + data := testutils.RandomData(rand.New(rand.NewSource(9849248)), maxTxDataSize-200) + tx := gethTypes.MustSignNewTx(h.privKey, h.rollupCfg.L1Signer(), &gethTypes.DynamicFeeTx{ + ChainID: h.rollupCfg.L1ChainID, + Nonce: nonce, + GasTipCap: big.NewInt(1 * params.GWei), + GasFeeCap: big.NewInt(10 * params.GWei), + Gas: 5_000_000, + To: &h.rollupCfg.BatchInboxAddress, + Value: big.NewInt(0), + Data: data, + }) + err = h.l1Client.SendTransaction(ctx, tx) + require.NoError(h.t, err, "Should send large batch transaction") + _, err = wait.ForReceiptOK(ctx, h.l1Client, tx.Hash()) + require.NoError(h.t, err, "Tx should be ok") +} diff --git a/op-e2e2/e2eutils/blobs.go b/op-e2e2/e2eutils/blobs.go new file mode 100644 index 000000000000..730aae1d94c5 --- /dev/null +++ b/op-e2e2/e2eutils/blobs.go @@ -0,0 +1,49 @@ +package e2eutils + +import ( + "context" + "fmt" + + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/common" + + "github.com/ethereum-optimism/optimism/op-node/rollup/derive" + "github.com/ethereum-optimism/optimism/op-service/eth" +) + +// BlobsStore is a simple in-memory store of blobs, for testing purposes +type BlobsStore struct { + // blockhash -> blob versioned hash -> blob + blobs map[common.Hash]map[common.Hash]*eth.Blob +} + +func NewBlobStore() *BlobsStore { + return &BlobsStore{blobs: make(map[common.Hash]map[common.Hash]*eth.Blob)} +} + +func (store *BlobsStore) StoreBlob(blockHash common.Hash, versionedHash common.Hash, blob *eth.Blob) { + m, ok := store.blobs[blockHash] + if !ok { + m = make(map[common.Hash]*eth.Blob) + store.blobs[blockHash] = m + } + m[versionedHash] = blob +} + +func (store *BlobsStore) GetBlobs(ctx context.Context, ref eth.L1BlockRef, hashes []eth.IndexedBlobHash) ([]*eth.Blob, error) { + out := make([]*eth.Blob, 0, len(hashes)) + m, ok := store.blobs[ref.Hash] + if !ok { + return nil, fmt.Errorf("no blobs known with given time: %w", ethereum.NotFound) + } + for _, h := range hashes { + b, ok := m[h.Hash] + if !ok { + return nil, fmt.Errorf("blob %d %s is not in store: %w", h.Index, h.Hash, ethereum.NotFound) + } + out = append(out, b) + } + return out, nil +} + +var _ derive.L1BlobsFetcher = (*BlobsStore)(nil) diff --git a/op-e2e2/e2eutils/challenger/helper.go b/op-e2e2/e2eutils/challenger/helper.go new file mode 100644 index 000000000000..7388629cef18 --- /dev/null +++ b/op-e2e2/e2eutils/challenger/helper.go @@ -0,0 +1,253 @@ +package challenger + +import ( + "context" + "crypto/ecdsa" + "encoding/json" + "errors" + "fmt" + "os" + "path/filepath" + "testing" + "time" + + "github.com/ethereum-optimism/optimism/op-service/metrics" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/stretchr/testify/require" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/log" + + challenger "github.com/ethereum-optimism/optimism/op-challenger" + "github.com/ethereum-optimism/optimism/op-challenger/config" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/wait" + "github.com/ethereum-optimism/optimism/op-node/rollup" + "github.com/ethereum-optimism/optimism/op-service/cliapp" + "github.com/ethereum-optimism/optimism/op-service/testlog" +) + +type EndpointProvider interface { + NodeEndpoint(name string) string + RollupEndpoint(name string) string + L1BeaconEndpoint() string +} + +type Helper struct { + log log.Logger + t *testing.T + require *require.Assertions + dir string + chl cliapp.Lifecycle + metrics *CapturingMetrics +} + +func NewHelper(log log.Logger, t *testing.T, require *require.Assertions, dir string, chl cliapp.Lifecycle, m *CapturingMetrics) *Helper { + return &Helper{ + log: log, + t: t, + require: require, + dir: dir, + chl: chl, + metrics: m, + } +} + +type Option func(config2 *config.Config) + +func WithFactoryAddress(addr common.Address) Option { + return func(c *config.Config) { + c.GameFactoryAddress = addr + } +} + +func WithGameAddress(addr common.Address) Option { + return func(c *config.Config) { + c.GameAllowlist = append(c.GameAllowlist, addr) + } +} + +func WithPrivKey(key *ecdsa.PrivateKey) Option { + return func(c *config.Config) { + c.TxMgrConfig.PrivateKey = e2eutils.EncodePrivKeyToString(key) + } +} + +func WithPollInterval(pollInterval time.Duration) Option { + return func(c *config.Config) { + c.PollInterval = pollInterval + } +} + +// FindMonorepoRoot finds the relative path to the monorepo root +// Different tests might be nested in subdirectories of the op-e2e dir. +func FindMonorepoRoot(t *testing.T) string { + path := "./" + // Only search up 5 directories + // Avoids infinite recursion if the root isn't found for some reason + for i := 0; i < 5; i++ { + _, err := os.Stat(path + "op-e2e") + if errors.Is(err, os.ErrNotExist) { + path = path + "../" + continue + } + require.NoErrorf(t, err, "Failed to stat %v even though it existed", path) + return path + } + t.Fatalf("Could not find monorepo root, trying up to %v", path) + return "" +} + +func applyCannonConfig(c *config.Config, t *testing.T, rollupCfg *rollup.Config, l2Genesis *core.Genesis) { + require := require.New(t) + root := FindMonorepoRoot(t) + c.CannonBin = root + "cannon/bin/cannon" + c.CannonServer = root + "op-program/bin/op-program" + c.CannonAbsolutePreState = root + "op-program/bin/prestate.json" + c.CannonSnapshotFreq = 10_000_000 + + genesisBytes, err := json.Marshal(l2Genesis) + require.NoError(err, "marshall l2 genesis config") + genesisFile := filepath.Join(c.Datadir, "l2-genesis.json") + require.NoError(os.WriteFile(genesisFile, genesisBytes, 0o644)) + c.CannonL2GenesisPath = genesisFile + + rollupBytes, err := json.Marshal(rollupCfg) + require.NoError(err, "marshall rollup config") + rollupFile := filepath.Join(c.Datadir, "rollup.json") + require.NoError(os.WriteFile(rollupFile, rollupBytes, 0o644)) + c.CannonRollupConfigPath = rollupFile +} + +func WithCannon(t *testing.T, rollupCfg *rollup.Config, l2Genesis *core.Genesis) Option { + return func(c *config.Config) { + c.TraceTypes = append(c.TraceTypes, config.TraceTypeCannon) + applyCannonConfig(c, t, rollupCfg, l2Genesis) + } +} + +func WithAlphabet() Option { + return func(c *config.Config) { + c.TraceTypes = append(c.TraceTypes, config.TraceTypeAlphabet) + } +} + +func NewChallenger(t *testing.T, ctx context.Context, sys EndpointProvider, name string, options ...Option) *Helper { + log := testlog.Logger(t, log.LevelDebug).New("role", name) + log.Info("Creating challenger") + cfg := NewChallengerConfig(t, sys, "sequencer", options...) + cfg.MetricsConfig.Enabled = false // Don't start the metrics server + m := NewCapturingMetrics() + chl, err := challenger.Main(ctx, log, cfg, m) + require.NoError(t, err, "must init challenger") + require.NoError(t, chl.Start(ctx), "must start challenger") + + return NewHelper(log, t, require.New(t), cfg.Datadir, chl, m) +} + +func NewChallengerConfig(t *testing.T, sys EndpointProvider, l2NodeName string, options ...Option) *config.Config { + // Use the NewConfig method to ensure we pick up any defaults that are set. + l1Endpoint := sys.NodeEndpoint("l1") + l1Beacon := sys.L1BeaconEndpoint() + cfg := config.NewConfig(common.Address{}, l1Endpoint, l1Beacon, sys.RollupEndpoint(l2NodeName), sys.NodeEndpoint(l2NodeName), t.TempDir()) + // The devnet can't set the absolute prestate output root because the contracts are deployed in L1 genesis + // before the L2 genesis is known. + cfg.AllowInvalidPrestate = true + cfg.TxMgrConfig.NumConfirmations = 1 + cfg.TxMgrConfig.ReceiptQueryInterval = 1 * time.Second + if cfg.MaxConcurrency > 4 { + // Limit concurrency to something more reasonable when there are also multiple tests executing in parallel + cfg.MaxConcurrency = 4 + } + cfg.MetricsConfig = metrics.CLIConfig{ + Enabled: true, + ListenAddr: "127.0.0.1", + ListenPort: 0, // Find any available port (avoids conflicts) + } + for _, option := range options { + option(&cfg) + } + require.NotEmpty(t, cfg.TxMgrConfig.PrivateKey, "Missing private key for TxMgrConfig") + require.NoError(t, cfg.Check(), "op-challenger config should be valid") + + if cfg.CannonBin != "" { + _, err := os.Stat(cfg.CannonBin) + require.NoError(t, err, "cannon should be built. Make sure you've run make cannon-prestate") + } + if cfg.CannonServer != "" { + _, err := os.Stat(cfg.CannonServer) + require.NoError(t, err, "op-program should be built. Make sure you've run make cannon-prestate") + } + if cfg.CannonAbsolutePreState != "" { + _, err := os.Stat(cfg.CannonAbsolutePreState) + require.NoError(t, err, "cannon pre-state should be built. Make sure you've run make cannon-prestate") + } + if cfg.PollInterval == 0 { + cfg.PollInterval = time.Second + } + + return &cfg +} + +func (h *Helper) Close() error { + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + return h.chl.Stop(ctx) +} + +type GameAddr interface { + Addr() common.Address +} + +func (h *Helper) VerifyGameDataExists(games ...GameAddr) { + for _, game := range games { + addr := game.Addr() + h.require.DirExistsf(h.gameDataDir(addr), "should have data for game %v", addr) + } +} + +func (h *Helper) WaitForGameDataDeletion(ctx context.Context, games ...GameAddr) { + ctx, cancel := context.WithTimeout(ctx, 30*time.Second) + defer cancel() + err := wait.For(ctx, time.Second, func() (bool, error) { + for _, game := range games { + addr := game.Addr() + dir := h.gameDataDir(addr) + _, err := os.Stat(dir) + if errors.Is(err, os.ErrNotExist) { + // This game has been successfully deleted + continue + } + if err != nil { + return false, fmt.Errorf("failed to check dir %v is deleted: %w", dir, err) + } + h.t.Logf("Game data directory %v not yet deleted", dir) + return false, nil + } + return true, nil + }) + h.require.NoErrorf(err, "should have deleted game data directories") +} + +func (h *Helper) gameDataDir(addr common.Address) string { + return filepath.Join(h.dir, "game-"+addr.Hex()) +} + +func (h *Helper) WaitL1HeadActedOn(ctx context.Context, client *ethclient.Client) { + l1Head, err := client.BlockNumber(ctx) + h.require.NoError(err) + h.WaitForHighestActedL1Block(ctx, l1Head) +} + +func (h *Helper) WaitForHighestActedL1Block(ctx context.Context, head uint64) { + timedCtx, cancel := context.WithTimeout(ctx, 30*time.Second) + defer cancel() + var actual uint64 + err := wait.For(timedCtx, time.Second, func() (bool, error) { + actual = h.metrics.HighestActedL1Block.Load() + h.log.Info("Waiting for highest acted L1 block", "target", head, "actual", actual) + return actual >= head, nil + }) + h.require.NoErrorf(err, "Highest acted L1 block did not reach %v, was: %v", head, actual) +} diff --git a/op-e2e2/e2eutils/challenger/metrics.go b/op-e2e2/e2eutils/challenger/metrics.go new file mode 100644 index 000000000000..de95121480f1 --- /dev/null +++ b/op-e2e2/e2eutils/challenger/metrics.go @@ -0,0 +1,23 @@ +package challenger + +import ( + "sync/atomic" + + "github.com/ethereum-optimism/optimism/op-challenger/metrics" +) + +type CapturingMetrics struct { + metrics.NoopMetricsImpl + + HighestActedL1Block atomic.Uint64 +} + +func NewCapturingMetrics() *CapturingMetrics { + return &CapturingMetrics{} +} + +var _ metrics.Metricer = (*CapturingMetrics)(nil) + +func (c *CapturingMetrics) RecordActedL1Block(block uint64) { + c.HighestActedL1Block.Store(block) +} diff --git a/op-e2e2/e2eutils/disputegame/claim_helper.go b/op-e2e2/e2eutils/disputegame/claim_helper.go new file mode 100644 index 000000000000..0effe44ad843 --- /dev/null +++ b/op-e2e2/e2eutils/disputegame/claim_helper.go @@ -0,0 +1,133 @@ +package disputegame + +import ( + "context" + "fmt" + "slices" + "time" + + "github.com/ethereum-optimism/optimism/op-challenger/game/fault/types" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/wait" + "github.com/ethereum/go-ethereum/common" + "github.com/stretchr/testify/require" +) + +type ClaimHelper struct { + require *require.Assertions + game *OutputGameHelper + Index int64 + ParentIndex int + Position types.Position + claim common.Hash +} + +func newClaimHelper(game *OutputGameHelper, idx int64, claim types.Claim) *ClaimHelper { + return &ClaimHelper{ + require: game.Require, + game: game, + Index: idx, + ParentIndex: claim.ParentContractIndex, + Position: claim.Position, + claim: claim.Value, + } +} + +func (c *ClaimHelper) AgreesWithOutputRoot() bool { + return c.Position.Depth()%2 == 0 +} + +func (c *ClaimHelper) IsRootClaim() bool { + return c.Position.IsRootPosition() +} + +func (c *ClaimHelper) IsOutputRoot(ctx context.Context) bool { + splitDepth := c.game.SplitDepth(ctx) + return c.Position.Depth() <= splitDepth +} + +func (c *ClaimHelper) IsOutputRootLeaf(ctx context.Context) bool { + splitDepth := c.game.SplitDepth(ctx) + return c.Position.Depth() == splitDepth +} + +func (c *ClaimHelper) IsBottomGameRoot(ctx context.Context) bool { + splitDepth := c.game.SplitDepth(ctx) + return c.Position.Depth() == splitDepth+1 +} + +func (c *ClaimHelper) IsMaxDepth(ctx context.Context) bool { + maxDepth := c.game.MaxDepth(ctx) + return c.Position.Depth() == maxDepth +} + +func (c *ClaimHelper) Depth() types.Depth { + return c.Position.Depth() +} + +// WaitForCounterClaim waits for the claim to be countered by another claim being posted. +// It returns a helper for the claim that countered this one. +func (c *ClaimHelper) WaitForCounterClaim(ctx context.Context, ignoreClaims ...*ClaimHelper) *ClaimHelper { + timeout := defaultTimeout + if c.IsOutputRootLeaf(ctx) { + // This is the first claim we need to run cannon on, so give it more time + timeout = timeout * 2 + } + counterIdx, counterClaim := c.game.waitForClaim(ctx, timeout, fmt.Sprintf("failed to find claim with parent idx %v", c.Index), func(claimIdx int64, claim types.Claim) bool { + return int64(claim.ParentContractIndex) == c.Index && !containsClaim(claimIdx, ignoreClaims) + }) + return newClaimHelper(c.game, counterIdx, counterClaim) +} + +// WaitForCountered waits until the claim is countered either by a child claim or by a step call. +func (c *ClaimHelper) WaitForCountered(ctx context.Context) { + timedCtx, cancel := context.WithTimeout(ctx, defaultTimeout) + defer cancel() + err := wait.For(timedCtx, time.Second, func() (bool, error) { + latestData := c.game.getClaim(ctx, c.Index) + return latestData.CounteredBy != common.Address{}, nil + }) + if err != nil { // Avoid waiting time capturing game data when there's no error + c.require.NoErrorf(err, "Claim %v was not countered\n%v", c.Index, c.game.GameData(ctx)) + } +} + +func (c *ClaimHelper) RequireCorrectOutputRoot(ctx context.Context) { + c.require.True(c.IsOutputRoot(ctx), "Should not expect a valid output root in the bottom game") + expected, err := c.game.CorrectOutputProvider.Get(ctx, c.Position) + c.require.NoError(err, "Failed to get correct output root") + c.require.Equalf(expected, c.claim, "Should have correct output root in claim %v and position %v", c.Index, c.Position) +} + +func (c *ClaimHelper) Attack(ctx context.Context, value common.Hash, opts ...MoveOpt) *ClaimHelper { + c.game.Attack(ctx, c.Index, value, opts...) + return c.WaitForCounterClaim(ctx) +} + +func (c *ClaimHelper) Defend(ctx context.Context, value common.Hash, opts ...MoveOpt) *ClaimHelper { + c.game.Defend(ctx, c.Index, value, opts...) + return c.WaitForCounterClaim(ctx) +} + +func (c *ClaimHelper) RequireDifferentClaimValue(other *ClaimHelper) { + c.require.NotEqual(c.claim, other.claim, "should have posted different claims") +} + +func (c *ClaimHelper) RequireOnlyCounteredBy(ctx context.Context, expected ...*ClaimHelper) { + claims := c.game.getAllClaims(ctx) + for idx, claim := range claims { + if int64(claim.ParentContractIndex) != c.Index { + // Doesn't counter this claim, so ignore + continue + } + if !containsClaim(int64(idx), expected) { + // Found a countering claim not in the expected list. Fail. + c.require.FailNowf("Found unexpected countering claim", "Parent claim index: %v Game state:\n%v", c.Index, c.game.GameData(ctx)) + } + } +} + +func containsClaim(claimIdx int64, haystack []*ClaimHelper) bool { + return slices.ContainsFunc(haystack, func(candidate *ClaimHelper) bool { + return candidate.Index == claimIdx + }) +} diff --git a/op-e2e2/e2eutils/disputegame/dishonest_helper.go b/op-e2e2/e2eutils/disputegame/dishonest_helper.go new file mode 100644 index 000000000000..015e2cd8049c --- /dev/null +++ b/op-e2e2/e2eutils/disputegame/dishonest_helper.go @@ -0,0 +1,72 @@ +package disputegame + +import ( + "context" + "errors" + "time" + + "github.com/ethereum-optimism/optimism/op-challenger/game/fault/types" + "github.com/ethereum/go-ethereum/common" +) + +type DishonestHelper struct { + *OutputGameHelper + *OutputHonestHelper + defender bool +} + +func newDishonestHelper(g *OutputGameHelper, correctTrace *OutputHonestHelper, defender bool) *DishonestHelper { + return &DishonestHelper{g, correctTrace, defender} +} + +// ExhaustDishonestClaims makes all possible significant moves (mod honest challenger's) in a game. +// It is very inefficient and should NOT be used on games with large depths +func (d *DishonestHelper) ExhaustDishonestClaims(ctx context.Context, rootClaim *ClaimHelper) { + depth := d.MaxDepth(ctx) + splitDepth := d.SplitDepth(ctx) + + move := func(claimIndex int64, claimData types.Claim) { + // dishonest level, valid attack + // dishonest level, invalid attack + // dishonest level, valid defense + // dishonest level, invalid defense + // honest level, invalid attack + // honest level, invalid defense + + if claimData.Depth() == depth { + return + } + + d.LogGameData(ctx) + d.OutputGameHelper.T.Logf("Dishonest moves against claimIndex %d", claimIndex) + agreeWithLevel := d.defender == (claimData.Depth()%2 == 0) + if !agreeWithLevel { + d.OutputHonestHelper.Attack(ctx, claimIndex, WithIgnoreDuplicates()) + if claimIndex != 0 && claimData.Depth() != splitDepth+1 { + d.OutputHonestHelper.Defend(ctx, claimIndex, WithIgnoreDuplicates()) + } + } + d.OutputGameHelper.Attack(ctx, claimIndex, common.Hash{byte(claimIndex)}, WithIgnoreDuplicates()) + if claimIndex != 0 && claimData.Depth() != splitDepth+1 { + d.OutputGameHelper.Defend(ctx, claimIndex, common.Hash{byte(claimIndex)}, WithIgnoreDuplicates()) + } + } + + numClaimsSeen := rootClaim.Index + for { + // Use a short timeout since we don't know the challenger will respond, + // and this is only designed for the alphabet game where the response should be fast. + newCount, err := d.waitForNewClaim(ctx, numClaimsSeen, 30*time.Second) + if errors.Is(err, context.DeadlineExceeded) { + // we assume that the honest challenger has stopped responding + // There's nothing to respond to. + break + } + d.OutputGameHelper.Require.NoError(err) + + for ; numClaimsSeen < newCount; numClaimsSeen++ { + claimData := d.getClaim(ctx, numClaimsSeen) + move(numClaimsSeen, claimData) + } + } +} diff --git a/op-e2e2/e2eutils/disputegame/helper.go b/op-e2e2/e2eutils/disputegame/helper.go new file mode 100644 index 000000000000..40c14ae48247 --- /dev/null +++ b/op-e2e2/e2eutils/disputegame/helper.go @@ -0,0 +1,279 @@ +package disputegame + +import ( + "context" + "encoding/binary" + "math/big" + "testing" + "time" + + "github.com/ethereum-optimism/optimism/op-chain-ops/genesis" + "github.com/ethereum-optimism/optimism/op-challenger/game/fault/contracts" + "github.com/ethereum-optimism/optimism/op-challenger/game/fault/contracts/metrics" + "github.com/ethereum-optimism/optimism/op-challenger/game/fault/trace/outputs" + "github.com/ethereum-optimism/optimism/op-e2e2/bindings" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/challenger" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/disputegame/preimage" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/geth" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/transactions" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/wait" + "github.com/ethereum-optimism/optimism/op-node/rollup" + "github.com/ethereum-optimism/optimism/op-service/eth" + "github.com/ethereum-optimism/optimism/op-service/sources" + "github.com/ethereum-optimism/optimism/op-service/sources/batching" + "github.com/ethereum-optimism/optimism/op-service/testlog" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/ethereum/go-ethereum/log" + "github.com/stretchr/testify/require" +) + +var ( + // TestKey is the same test key that geth uses + TestKey, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291") + TestAddress = crypto.PubkeyToAddress(TestKey.PublicKey) +) + +const ( + cannonGameType uint32 = 0 + alphabetGameType uint32 = 255 +) + +type GameCfg struct { + allowFuture bool + allowUnsafe bool +} +type GameOpt interface { + Apply(cfg *GameCfg) +} +type gameOptFn func(c *GameCfg) + +func (g gameOptFn) Apply(cfg *GameCfg) { + g(cfg) +} + +func WithUnsafeProposal() GameOpt { + return gameOptFn(func(c *GameCfg) { + c.allowUnsafe = true + }) +} + +func WithFutureProposal() GameOpt { + return gameOptFn(func(c *GameCfg) { + c.allowFuture = true + }) +} + +type DisputeSystem interface { + L1BeaconEndpoint() string + NodeEndpoint(name string) string + NodeClient(name string) *ethclient.Client + RollupEndpoint(name string) string + RollupClient(name string) *sources.RollupClient + + L1Deployments() *genesis.L1Deployments + RollupCfg() *rollup.Config + L2Genesis() *core.Genesis + + AdvanceTime(time.Duration) +} + +type FactoryHelper struct { + T *testing.T + Require *require.Assertions + System DisputeSystem + Client *ethclient.Client + Opts *bind.TransactOpts + FactoryAddr common.Address + Factory *bindings.DisputeGameFactory +} + +func NewFactoryHelper(t *testing.T, ctx context.Context, system DisputeSystem) *FactoryHelper { + require := require.New(t) + client := system.NodeClient("l1") + chainID, err := client.ChainID(ctx) + require.NoError(err) + opts, err := bind.NewKeyedTransactorWithChainID(TestKey, chainID) + require.NoError(err) + + l1Deployments := system.L1Deployments() + factoryAddr := l1Deployments.DisputeGameFactoryProxy + factory, err := bindings.NewDisputeGameFactory(factoryAddr, client) + require.NoError(err) + + return &FactoryHelper{ + T: t, + Require: require, + System: system, + Client: client, + Opts: opts, + Factory: factory, + FactoryAddr: factoryAddr, + } +} + +func (h *FactoryHelper) PreimageHelper(ctx context.Context) *preimage.Helper { + opts := &bind.CallOpts{Context: ctx} + gameAddr, err := h.Factory.GameImpls(opts, cannonGameType) + h.Require.NoError(err) + game, err := bindings.NewFaultDisputeGameCaller(gameAddr, h.Client) + h.Require.NoError(err) + vmAddr, err := game.Vm(opts) + h.Require.NoError(err) + vm, err := bindings.NewMIPSCaller(vmAddr, h.Client) + h.Require.NoError(err) + oracleAddr, err := vm.Oracle(opts) + h.Require.NoError(err) + return preimage.NewHelper(h.T, h.Opts, h.Client, oracleAddr) +} + +func NewGameCfg(opts ...GameOpt) *GameCfg { + cfg := &GameCfg{} + for _, opt := range opts { + opt.Apply(cfg) + } + return cfg +} + +func (h *FactoryHelper) StartOutputCannonGameWithCorrectRoot(ctx context.Context, l2Node string, l2BlockNumber uint64, opts ...GameOpt) *OutputCannonGameHelper { + cfg := NewGameCfg(opts...) + h.WaitForBlock(l2Node, l2BlockNumber, cfg) + output, err := h.System.RollupClient(l2Node).OutputAtBlock(ctx, l2BlockNumber) + h.Require.NoErrorf(err, "Failed to get output at block %v", l2BlockNumber) + return h.StartOutputCannonGame(ctx, l2Node, l2BlockNumber, common.Hash(output.OutputRoot), opts...) +} + +func (h *FactoryHelper) StartOutputCannonGame(ctx context.Context, l2Node string, l2BlockNumber uint64, rootClaim common.Hash, opts ...GameOpt) *OutputCannonGameHelper { + cfg := NewGameCfg(opts...) + logger := testlog.Logger(h.T, log.LevelInfo).New("role", "OutputCannonGameHelper") + rollupClient := h.System.RollupClient(l2Node) + l2Client := h.System.NodeClient(l2Node) + + extraData := h.CreateBisectionGameExtraData(l2Node, l2BlockNumber, cfg) + + ctx, cancel := context.WithTimeout(ctx, 1*time.Minute) + defer cancel() + + tx, err := transactions.PadGasEstimate(h.Opts, 2, func(opts *bind.TransactOpts) (*types.Transaction, error) { + return h.Factory.Create(opts, cannonGameType, rootClaim, extraData) + }) + h.Require.NoError(err, "create fault dispute game") + rcpt, err := wait.ForReceiptOK(ctx, h.Client, tx.Hash()) + h.Require.NoError(err, "wait for create fault dispute game receipt to be OK") + h.Require.Len(rcpt.Logs, 2, "should have emitted a single DisputeGameCreated event") + createdEvent, err := h.Factory.ParseDisputeGameCreated(*rcpt.Logs[1]) + h.Require.NoError(err) + gameBindings, err := bindings.NewFaultDisputeGame(createdEvent.DisputeProxy, h.Client) + h.Require.NoError(err) + game, err := contracts.NewFaultDisputeGameContract(ctx, metrics.NoopContractMetrics, createdEvent.DisputeProxy, batching.NewMultiCaller(h.Client.Client(), batching.DefaultBatchSize)) + h.Require.NoError(err) + + prestateBlock, poststateBlock, err := game.GetBlockRange(ctx) + h.Require.NoError(err, "Failed to load starting block number") + splitDepth, err := game.GetSplitDepth(ctx) + h.Require.NoError(err, "Failed to load split depth") + l1Head := h.GetL1Head(ctx, game) + + prestateProvider := outputs.NewPrestateProvider(rollupClient, prestateBlock) + provider := outputs.NewTraceProvider(logger, prestateProvider, rollupClient, l2Client, l1Head, splitDepth, prestateBlock, poststateBlock) + + return &OutputCannonGameHelper{ + OutputGameHelper: *NewOutputGameHelper(h.T, h.Require, h.Client, h.Opts, game, gameBindings, h.FactoryAddr, createdEvent.DisputeProxy, provider, h.System), + } +} + +func (h *FactoryHelper) GetL1Head(ctx context.Context, game contracts.FaultDisputeGameContract) eth.BlockID { + l1HeadHash, err := game.GetL1Head(ctx) + h.Require.NoError(err, "Failed to load L1 head") + l1Header, err := h.Client.HeaderByHash(ctx, l1HeadHash) + h.Require.NoError(err, "Failed to load L1 header") + l1Head := eth.HeaderBlockID(l1Header) + return l1Head +} + +func (h *FactoryHelper) StartOutputAlphabetGameWithCorrectRoot(ctx context.Context, l2Node string, l2BlockNumber uint64, opts ...GameOpt) *OutputAlphabetGameHelper { + cfg := NewGameCfg(opts...) + h.WaitForBlock(l2Node, l2BlockNumber, cfg) + output, err := h.System.RollupClient(l2Node).OutputAtBlock(ctx, l2BlockNumber) + h.Require.NoErrorf(err, "Failed to get output at block %v", l2BlockNumber) + return h.StartOutputAlphabetGame(ctx, l2Node, l2BlockNumber, common.Hash(output.OutputRoot)) +} + +func (h *FactoryHelper) StartOutputAlphabetGame(ctx context.Context, l2Node string, l2BlockNumber uint64, rootClaim common.Hash, opts ...GameOpt) *OutputAlphabetGameHelper { + cfg := NewGameCfg(opts...) + logger := testlog.Logger(h.T, log.LevelInfo).New("role", "OutputAlphabetGameHelper") + rollupClient := h.System.RollupClient(l2Node) + l2Client := h.System.NodeClient(l2Node) + + extraData := h.CreateBisectionGameExtraData(l2Node, l2BlockNumber, cfg) + + ctx, cancel := context.WithTimeout(ctx, 1*time.Minute) + defer cancel() + + tx, err := transactions.PadGasEstimate(h.Opts, 2, func(opts *bind.TransactOpts) (*types.Transaction, error) { + return h.Factory.Create(opts, alphabetGameType, rootClaim, extraData) + }) + h.Require.NoError(err, "create output bisection game") + rcpt, err := wait.ForReceiptOK(ctx, h.Client, tx.Hash()) + h.Require.NoError(err, "wait for create output bisection game receipt to be OK") + h.Require.Len(rcpt.Logs, 2, "should have emitted a single DisputeGameCreated event") + createdEvent, err := h.Factory.ParseDisputeGameCreated(*rcpt.Logs[1]) + h.Require.NoError(err) + gameBindings, err := bindings.NewFaultDisputeGame(createdEvent.DisputeProxy, h.Client) + h.Require.NoError(err) + game, err := contracts.NewFaultDisputeGameContract(ctx, metrics.NoopContractMetrics, createdEvent.DisputeProxy, batching.NewMultiCaller(h.Client.Client(), batching.DefaultBatchSize)) + h.Require.NoError(err) + + prestateBlock, poststateBlock, err := game.GetBlockRange(ctx) + h.Require.NoError(err, "Failed to load starting block number") + splitDepth, err := game.GetSplitDepth(ctx) + h.Require.NoError(err, "Failed to load split depth") + l1Head := h.GetL1Head(ctx, game) + prestateProvider := outputs.NewPrestateProvider(rollupClient, prestateBlock) + + provider := outputs.NewTraceProvider(logger, prestateProvider, rollupClient, l2Client, l1Head, splitDepth, prestateBlock, poststateBlock) + + return &OutputAlphabetGameHelper{ + OutputGameHelper: *NewOutputGameHelper(h.T, h.Require, h.Client, h.Opts, game, gameBindings, h.FactoryAddr, createdEvent.DisputeProxy, provider, h.System), + } +} + +func (h *FactoryHelper) CreateBisectionGameExtraData(l2Node string, l2BlockNumber uint64, cfg *GameCfg) []byte { + h.WaitForBlock(l2Node, l2BlockNumber, cfg) + h.T.Logf("Creating game with l2 block number: %v", l2BlockNumber) + extraData := make([]byte, 32) + binary.BigEndian.PutUint64(extraData[24:], l2BlockNumber) + return extraData +} + +func (h *FactoryHelper) WaitForBlock(l2Node string, l2BlockNumber uint64, cfg *GameCfg) { + if cfg.allowFuture { + // Proposing a block that doesn't exist yet, so don't perform any checks + return + } + + l2Client := h.System.NodeClient(l2Node) + if cfg.allowUnsafe { + _, err := geth.WaitForBlock(new(big.Int).SetUint64(l2BlockNumber), l2Client, 1*time.Minute) + h.Require.NoErrorf(err, "Block number %v did not become unsafe", l2BlockNumber) + } else { + _, err := geth.WaitForBlockToBeSafe(new(big.Int).SetUint64(l2BlockNumber), l2Client, 1*time.Minute) + h.Require.NoErrorf(err, "Block number %v did not become safe", l2BlockNumber) + } +} + +func (h *FactoryHelper) StartChallenger(ctx context.Context, name string, options ...challenger.Option) *challenger.Helper { + opts := []challenger.Option{ + challenger.WithFactoryAddress(h.FactoryAddr), + } + opts = append(opts, options...) + c := challenger.NewChallenger(h.T, ctx, h.System, name, opts...) + h.T.Cleanup(func() { + _ = c.Close() + }) + return c +} diff --git a/op-e2e2/e2eutils/disputegame/output_alphabet_helper.go b/op-e2e2/e2eutils/disputegame/output_alphabet_helper.go new file mode 100644 index 000000000000..e452f546f0ba --- /dev/null +++ b/op-e2e2/e2eutils/disputegame/output_alphabet_helper.go @@ -0,0 +1,52 @@ +package disputegame + +import ( + "context" + + "github.com/ethereum-optimism/optimism/op-challenger/game/fault/trace/outputs" + "github.com/ethereum-optimism/optimism/op-challenger/metrics" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/challenger" + "github.com/ethereum-optimism/optimism/op-service/testlog" + "github.com/ethereum/go-ethereum/log" +) + +type OutputAlphabetGameHelper struct { + OutputGameHelper +} + +func (g *OutputAlphabetGameHelper) StartChallenger( + ctx context.Context, + l2Node string, + name string, + options ...challenger.Option, +) *challenger.Helper { + opts := []challenger.Option{ + challenger.WithAlphabet(), + challenger.WithFactoryAddress(g.FactoryAddr), + challenger.WithGameAddress(g.Addr), + } + opts = append(opts, options...) + c := challenger.NewChallenger(g.T, ctx, g.System, name, opts...) + g.T.Cleanup(func() { + _ = c.Close() + }) + return c +} + +func (g *OutputAlphabetGameHelper) CreateHonestActor(ctx context.Context, l2Node string) *OutputHonestHelper { + logger := testlog.Logger(g.T, log.LevelInfo).New("role", "HonestHelper", "game", g.Addr) + prestateBlock, poststateBlock, err := g.Game.GetBlockRange(ctx) + g.Require.NoError(err, "Get block range") + splitDepth := g.SplitDepth(ctx) + l1Head := g.GetL1Head(ctx) + rollupClient := g.System.RollupClient(l2Node) + l2Client := g.System.NodeClient(l2Node) + prestateProvider := outputs.NewPrestateProvider(rollupClient, prestateBlock) + correctTrace, err := outputs.NewOutputAlphabetTraceAccessor(logger, metrics.NoopMetrics, prestateProvider, rollupClient, l2Client, l1Head, splitDepth, prestateBlock, poststateBlock) + g.Require.NoError(err, "Create trace accessor") + return NewOutputHonestHelper(g.T, g.Require, &g.OutputGameHelper, g.Game, correctTrace) +} + +func (g *OutputAlphabetGameHelper) CreateDishonestHelper(ctx context.Context, l2Node string, defender bool) *DishonestHelper { + return newDishonestHelper(&g.OutputGameHelper, g.CreateHonestActor(ctx, l2Node), defender) +} diff --git a/op-e2e2/e2eutils/disputegame/output_cannon_helper.go b/op-e2e2/e2eutils/disputegame/output_cannon_helper.go new file mode 100644 index 000000000000..c13c20f355fa --- /dev/null +++ b/op-e2e2/e2eutils/disputegame/output_cannon_helper.go @@ -0,0 +1,316 @@ +package disputegame + +import ( + "context" + "crypto/ecdsa" + "errors" + "io" + "math/big" + "path/filepath" + "time" + + "github.com/ethereum-optimism/optimism/op-challenger/game/fault/trace" + "github.com/ethereum-optimism/optimism/op-challenger/game/fault/trace/cannon" + "github.com/ethereum-optimism/optimism/op-challenger/game/fault/trace/outputs" + "github.com/ethereum-optimism/optimism/op-challenger/game/fault/trace/split" + "github.com/ethereum-optimism/optimism/op-challenger/game/fault/trace/utils" + "github.com/ethereum-optimism/optimism/op-challenger/game/fault/types" + "github.com/ethereum-optimism/optimism/op-challenger/metrics" + "github.com/ethereum-optimism/optimism/op-e2e2/bindings" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/challenger" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/wait" + preimage "github.com/ethereum-optimism/optimism/op-preimage" + "github.com/ethereum-optimism/optimism/op-service/sources/batching" + "github.com/ethereum-optimism/optimism/op-service/sources/batching/rpcblock" + "github.com/ethereum-optimism/optimism/op-service/testlog" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/log" +) + +type OutputCannonGameHelper struct { + OutputGameHelper +} + +func (g *OutputCannonGameHelper) StartChallenger(ctx context.Context, name string, options ...challenger.Option) *challenger.Helper { + opts := []challenger.Option{ + challenger.WithCannon(g.T, g.System.RollupCfg(), g.System.L2Genesis()), + challenger.WithFactoryAddress(g.FactoryAddr), + challenger.WithGameAddress(g.Addr), + } + opts = append(opts, options...) + c := challenger.NewChallenger(g.T, ctx, g.System, name, opts...) + g.T.Cleanup(func() { + _ = c.Close() + }) + return c +} + +func (g *OutputCannonGameHelper) CreateHonestActor(ctx context.Context, l2Node string, options ...challenger.Option) *OutputHonestHelper { + opts := g.defaultChallengerOptions() + opts = append(opts, options...) + cfg := challenger.NewChallengerConfig(g.T, g.System, l2Node, opts...) + + logger := testlog.Logger(g.T, log.LevelInfo).New("role", "HonestHelper", "game", g.Addr) + l2Client := g.System.NodeClient(l2Node) + + prestateBlock, poststateBlock, err := g.Game.GetBlockRange(ctx) + g.Require.NoError(err, "Failed to load block range") + dir := filepath.Join(cfg.Datadir, "honest") + splitDepth := g.SplitDepth(ctx) + rollupClient := g.System.RollupClient(l2Node) + prestateProvider := outputs.NewPrestateProvider(rollupClient, prestateBlock) + l1Head := g.GetL1Head(ctx) + accessor, err := outputs.NewOutputCannonTraceAccessor( + logger, metrics.NoopMetrics, cfg, l2Client, prestateProvider, cfg.CannonAbsolutePreState, rollupClient, dir, l1Head, splitDepth, prestateBlock, poststateBlock) + g.Require.NoError(err, "Failed to create output cannon trace accessor") + return NewOutputHonestHelper(g.T, g.Require, &g.OutputGameHelper, g.Game, accessor) +} + +type PreimageLoadCheck func(types.TraceProvider, uint64) error + +func (g *OutputCannonGameHelper) CreateStepLargePreimageLoadCheck(ctx context.Context, sender common.Address) PreimageLoadCheck { + return func(provider types.TraceProvider, targetTraceIndex uint64) error { + // Fetch the challenge period + challengePeriod := g.ChallengePeriod(ctx) + + // Get the preimage data + execDepth := g.ExecDepth(ctx) + _, _, preimageData, err := provider.GetStepData(ctx, types.NewPosition(execDepth, big.NewInt(int64(targetTraceIndex)))) + g.Require.NoError(err) + + // Wait until the challenge period has started by checking until the challenge + // period start time is not zero by calling the ChallengePeriodStartTime method + g.WaitForChallengePeriodStart(ctx, sender, preimageData) + + challengePeriodStart := g.ChallengePeriodStartTime(ctx, sender, preimageData) + challengePeriodEnd := challengePeriodStart + challengePeriod + + // Time travel past the challenge period. + g.System.AdvanceTime(time.Duration(challengePeriod) * time.Second) + g.Require.NoError(wait.ForBlockWithTimestamp(ctx, g.System.NodeClient("l1"), challengePeriodEnd)) + + // Assert that the preimage was indeed loaded by an honest challenger + g.WaitForPreimageInOracle(ctx, preimageData) + return nil + } +} + +func (g *OutputCannonGameHelper) CreateStepPreimageLoadCheck(ctx context.Context) PreimageLoadCheck { + return func(provider types.TraceProvider, targetTraceIndex uint64) error { + execDepth := g.ExecDepth(ctx) + _, _, preimageData, err := provider.GetStepData(ctx, types.NewPosition(execDepth, big.NewInt(int64(targetTraceIndex)))) + g.Require.NoError(err) + g.WaitForPreimageInOracle(ctx, preimageData) + return nil + } +} + +// ChallengeToPreimageLoad challenges the supplied execution root claim by inducing a step that requires a preimage to be loaded +// It does this by: +// 1. Identifying the first state transition that loads a global preimage +// 2. Descending the execution game tree to reach the step that loads the preimage +// 3. Asserting that the preimage was indeed loaded by an honest challenger (assuming the preimage is not preloaded) +// This expects an odd execution game depth in order for the honest challenger to step on our leaf claim +func (g *OutputCannonGameHelper) ChallengeToPreimageLoad(ctx context.Context, outputRootClaim *ClaimHelper, challengerKey *ecdsa.PrivateKey, preimage utils.PreimageOpt, preimageCheck PreimageLoadCheck, preloadPreimage bool) { + // Identifying the first state transition that loads a global preimage + provider, _ := g.createCannonTraceProvider(ctx, "sequencer", outputRootClaim, challenger.WithPrivKey(challengerKey)) + targetTraceIndex, err := provider.FindStep(ctx, 0, preimage) + g.Require.NoError(err) + + splitDepth := g.SplitDepth(ctx) + execDepth := g.ExecDepth(ctx) + g.Require.NotEqual(outputRootClaim.Position.TraceIndex(execDepth).Uint64(), targetTraceIndex, "cannot move to defend a terminal trace index") + g.Require.EqualValues(splitDepth+1, outputRootClaim.Depth(), "supplied claim must be the root of an execution game") + g.Require.EqualValues(execDepth%2, 1, "execution game depth must be odd") // since we're challenging the execution root claim + + if preloadPreimage { + _, _, preimageData, err := provider.GetStepData(ctx, types.NewPosition(execDepth, big.NewInt(int64(targetTraceIndex)))) + g.Require.NoError(err) + g.UploadPreimage(ctx, preimageData, challengerKey) + g.WaitForPreimageInOracle(ctx, preimageData) + } + + // Descending the execution game tree to reach the step that loads the preimage + bisectTraceIndex := func(claim *ClaimHelper) *ClaimHelper { + execClaimPosition, err := claim.Position.RelativeToAncestorAtDepth(splitDepth + 1) + g.Require.NoError(err) + + claimTraceIndex := execClaimPosition.TraceIndex(execDepth).Uint64() + g.T.Logf("Bisecting: Into targetTraceIndex %v: claimIndex=%v at depth=%v. claimPosition=%v execClaimPosition=%v claimTraceIndex=%v", + targetTraceIndex, claim.Index, claim.Depth(), claim.Position, execClaimPosition, claimTraceIndex) + + // We always want to position ourselves such that the challenger generates proofs for the targetTraceIndex as prestate + if execClaimPosition.Depth() == execDepth-1 { + if execClaimPosition.TraceIndex(execDepth).Uint64() == targetTraceIndex { + newPosition := execClaimPosition.Attack() + correct, err := provider.Get(ctx, newPosition) + g.Require.NoError(err) + g.T.Logf("Bisecting: Attack correctly for step at newPosition=%v execIndexAtDepth=%v", newPosition, newPosition.TraceIndex(execDepth)) + return claim.Attack(ctx, correct) + } else if execClaimPosition.TraceIndex(execDepth).Uint64() > targetTraceIndex { + g.T.Logf("Bisecting: Attack incorrectly for step") + return claim.Attack(ctx, common.Hash{0xdd}) + } else if execClaimPosition.TraceIndex(execDepth).Uint64()+1 == targetTraceIndex { + g.T.Logf("Bisecting: Defend incorrectly for step") + return claim.Defend(ctx, common.Hash{0xcc}) + } else { + newPosition := execClaimPosition.Defend() + correct, err := provider.Get(ctx, newPosition) + g.Require.NoError(err) + g.T.Logf("Bisecting: Defend correctly for step at newPosition=%v execIndexAtDepth=%v", newPosition, newPosition.TraceIndex(execDepth)) + return claim.Defend(ctx, correct) + } + } + + // Attack or Defend depending on whether the claim we're responding to is to the left or right of the trace index + // Induce the honest challenger to attack or defend depending on whether our new position will be to the left or right of the trace index + if execClaimPosition.TraceIndex(execDepth).Uint64() < targetTraceIndex && claim.Depth() != splitDepth+1 { + newPosition := execClaimPosition.Defend() + if newPosition.TraceIndex(execDepth).Uint64() < targetTraceIndex { + g.T.Logf("Bisecting: Defend correct. newPosition=%v execIndexAtDepth=%v", newPosition, newPosition.TraceIndex(execDepth)) + correct, err := provider.Get(ctx, newPosition) + g.Require.NoError(err) + return claim.Defend(ctx, correct) + } else { + g.T.Logf("Bisecting: Defend incorrect. newPosition=%v execIndexAtDepth=%v", newPosition, newPosition.TraceIndex(execDepth)) + return claim.Defend(ctx, common.Hash{0xaa}) + } + } else { + newPosition := execClaimPosition.Attack() + if newPosition.TraceIndex(execDepth).Uint64() < targetTraceIndex { + g.T.Logf("Bisecting: Attack correct. newPosition=%v execIndexAtDepth=%v", newPosition, newPosition.TraceIndex(execDepth)) + correct, err := provider.Get(ctx, newPosition) + g.Require.NoError(err) + return claim.Attack(ctx, correct) + } else { + g.T.Logf("Bisecting: Attack incorrect. newPosition=%v execIndexAtDepth=%v", newPosition, newPosition.TraceIndex(execDepth)) + return claim.Attack(ctx, common.Hash{0xbb}) + } + } + } + + g.LogGameData(ctx) + // Initial bisect to put us on defense + mover := bisectTraceIndex(outputRootClaim) + leafClaim := g.DefendClaim(ctx, mover, bisectTraceIndex, WithoutWaitingForStep()) + + // Validate that the preimage was loaded correctly + g.Require.NoError(preimageCheck(provider, targetTraceIndex)) + + // Now the preimage is available wait for the step call to succeed. + leafClaim.WaitForCountered(ctx) + g.LogGameData(ctx) +} + +func (g *OutputCannonGameHelper) VerifyPreimage(ctx context.Context, outputRootClaim *ClaimHelper, preimageKey preimage.Key) { + execDepth := g.ExecDepth(ctx) + + // Identifying the first state transition that loads a global preimage + provider, localContext := g.createCannonTraceProvider(ctx, "sequencer", outputRootClaim, challenger.WithPrivKey(TestKey)) + start := uint64(0) + found := false + for offset := uint32(0); ; offset += 4 { + preimageOpt := utils.PreimageLoad(preimageKey, offset) + g.T.Logf("Searching for step with key %x and offset %v", preimageKey.PreimageKey(), offset) + targetTraceIndex, err := provider.FindStep(ctx, start, preimageOpt) + if errors.Is(err, io.EOF) { + // Did not find any more reads + g.Require.True(found, "Should have found at least one preimage read") + g.T.Logf("Searching for step with key %x and offset %v did not find another read", preimageKey.PreimageKey(), offset) + return + } + g.Require.NoError(err, "Failed to find step that loads requested preimage") + start = targetTraceIndex + found = true + + g.T.Logf("Target trace index: %v", targetTraceIndex) + pos := types.NewPosition(execDepth, new(big.Int).SetUint64(targetTraceIndex)) + g.Require.Equal(targetTraceIndex, pos.TraceIndex(execDepth).Uint64()) + + prestate, proof, oracleData, err := provider.GetStepData(ctx, pos) + g.Require.NoError(err, "Failed to get step data") + g.Require.NotNil(oracleData, "Should have had required preimage oracle data") + g.Require.Equal(common.Hash(preimageKey.PreimageKey()).Bytes(), oracleData.OracleKey, "Must have correct preimage key") + + tx, err := g.GameBindings.AddLocalData(g.Opts, + oracleData.GetIdent(), + big.NewInt(outputRootClaim.Index), + new(big.Int).SetUint64(uint64(oracleData.OracleOffset))) + g.Require.NoError(err) + _, err = wait.ForReceiptOK(ctx, g.Client, tx.Hash()) + g.Require.NoError(err) + + expectedPostState, err := provider.Get(ctx, pos) + g.Require.NoError(err, "Failed to get expected post state") + + callOpts := &bind.CallOpts{Context: ctx} + vmAddr, err := g.GameBindings.Vm(callOpts) + g.Require.NoError(err, "Failed to get VM address") + + abi, err := bindings.MIPSMetaData.GetAbi() + g.Require.NoError(err, "Failed to load MIPS ABI") + caller := batching.NewMultiCaller(g.Client.Client(), batching.DefaultBatchSize) + result, err := caller.SingleCall(ctx, rpcblock.Latest, &batching.ContractCall{ + Abi: abi, + Addr: vmAddr, + Method: "step", + Args: []interface{}{ + prestate, proof, localContext, + }, + From: g.Addr, + }) + g.Require.NoError(err, "Failed to call step") + actualPostState := result.GetBytes32(0) + g.Require.Equal(expectedPostState, common.Hash(actualPostState)) + } +} + +func (g *OutputCannonGameHelper) createCannonTraceProvider(ctx context.Context, l2Node string, outputRootClaim *ClaimHelper, options ...challenger.Option) (*cannon.CannonTraceProviderForTest, common.Hash) { + splitDepth := g.SplitDepth(ctx) + g.Require.EqualValues(outputRootClaim.Depth(), splitDepth+1, "outputRootClaim must be the root of an execution game") + + logger := testlog.Logger(g.T, log.LevelInfo).New("role", "CannonTraceProvider", "game", g.Addr) + opt := g.defaultChallengerOptions() + opt = append(opt, options...) + cfg := challenger.NewChallengerConfig(g.T, g.System, l2Node, opt...) + + l2Client := g.System.NodeClient(l2Node) + + prestateBlock, poststateBlock, err := g.Game.GetBlockRange(ctx) + g.Require.NoError(err, "Failed to load block range") + rollupClient := g.System.RollupClient(l2Node) + prestateProvider := outputs.NewPrestateProvider(rollupClient, prestateBlock) + l1Head := g.GetL1Head(ctx) + outputProvider := outputs.NewTraceProvider(logger, prestateProvider, rollupClient, l2Client, l1Head, splitDepth, prestateBlock, poststateBlock) + + var localContext common.Hash + selector := split.NewSplitProviderSelector(outputProvider, splitDepth, func(ctx context.Context, depth types.Depth, pre types.Claim, post types.Claim) (types.TraceProvider, error) { + agreed, disputed, err := outputs.FetchProposals(ctx, outputProvider, pre, post) + g.Require.NoError(err) + g.T.Logf("Using trace between blocks %v and %v\n", agreed.L2BlockNumber, disputed.L2BlockNumber) + localInputs, err := utils.FetchLocalInputsFromProposals(ctx, l1Head.Hash, l2Client, agreed, disputed) + g.Require.NoError(err, "Failed to fetch local inputs") + localContext = outputs.CreateLocalContext(pre, post) + dir := filepath.Join(cfg.Datadir, "cannon-trace") + subdir := filepath.Join(dir, localContext.Hex()) + return cannon.NewTraceProviderForTest(logger, metrics.NoopMetrics, cfg, localInputs, subdir, g.MaxDepth(ctx)-splitDepth-1), nil + }) + + claims, err := g.Game.GetAllClaims(ctx, rpcblock.Latest) + g.Require.NoError(err) + game := types.NewGameState(claims, g.MaxDepth(ctx)) + + provider, err := selector(ctx, game, game.Claims()[outputRootClaim.ParentIndex], outputRootClaim.Position) + g.Require.NoError(err) + translatingProvider := provider.(*trace.TranslatingProvider) + return translatingProvider.Original().(*cannon.CannonTraceProviderForTest), localContext +} + +func (g *OutputCannonGameHelper) defaultChallengerOptions() []challenger.Option { + return []challenger.Option{ + challenger.WithCannon(g.T, g.System.RollupCfg(), g.System.L2Genesis()), + challenger.WithFactoryAddress(g.FactoryAddr), + challenger.WithGameAddress(g.Addr), + } +} diff --git a/op-e2e2/e2eutils/disputegame/output_game_helper.go b/op-e2e2/e2eutils/disputegame/output_game_helper.go new file mode 100644 index 000000000000..287fb9b2f06a --- /dev/null +++ b/op-e2e2/e2eutils/disputegame/output_game_helper.go @@ -0,0 +1,755 @@ +package disputegame + +import ( + "context" + "crypto/ecdsa" + "fmt" + "math/big" + "testing" + "time" + + "github.com/ethereum-optimism/optimism/op-challenger/game/fault/contracts" + "github.com/ethereum-optimism/optimism/op-challenger/game/fault/preimages" + "github.com/ethereum-optimism/optimism/op-challenger/game/fault/trace/outputs" + "github.com/ethereum-optimism/optimism/op-challenger/game/fault/types" + keccakTypes "github.com/ethereum-optimism/optimism/op-challenger/game/keccak/types" + gameTypes "github.com/ethereum-optimism/optimism/op-challenger/game/types" + "github.com/ethereum-optimism/optimism/op-e2e2/bindings" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/wait" + preimage "github.com/ethereum-optimism/optimism/op-preimage" + "github.com/ethereum-optimism/optimism/op-service/eth" + "github.com/ethereum-optimism/optimism/op-service/sources/batching/rpcblock" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + gethtypes "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/stretchr/testify/require" +) + +const defaultTimeout = 5 * time.Minute + +type OutputGameHelper struct { + T *testing.T + Require *require.Assertions + Client *ethclient.Client + Opts *bind.TransactOpts + Game contracts.FaultDisputeGameContract + GameBindings *bindings.FaultDisputeGame + FactoryAddr common.Address + Addr common.Address + CorrectOutputProvider *outputs.OutputTraceProvider + System DisputeSystem +} + +func NewOutputGameHelper(t *testing.T, require *require.Assertions, client *ethclient.Client, opts *bind.TransactOpts, + game contracts.FaultDisputeGameContract, gameBindings *bindings.FaultDisputeGame, factoryAddr common.Address, addr common.Address, correctOutputProvider *outputs.OutputTraceProvider, system DisputeSystem) *OutputGameHelper { + return &OutputGameHelper{ + T: t, + Require: require, + Client: client, + Opts: opts, + Game: game, + GameBindings: gameBindings, + FactoryAddr: factoryAddr, + Addr: addr, + CorrectOutputProvider: correctOutputProvider, + System: system, + } +} + +type moveCfg struct { + Opts *bind.TransactOpts + ignoreDupes bool +} + +type MoveOpt interface { + Apply(cfg *moveCfg) +} + +type moveOptFn func(c *moveCfg) + +func (f moveOptFn) Apply(c *moveCfg) { + f(c) +} + +func WithTransactOpts(Opts *bind.TransactOpts) MoveOpt { + return moveOptFn(func(c *moveCfg) { + c.Opts = Opts + }) +} + +func WithIgnoreDuplicates() MoveOpt { + return moveOptFn(func(c *moveCfg) { + c.ignoreDupes = true + }) +} + +func (g *OutputGameHelper) SplitDepth(ctx context.Context) types.Depth { + splitDepth, err := g.Game.GetSplitDepth(ctx) + g.Require.NoError(err, "failed to load split depth") + return splitDepth +} + +func (g *OutputGameHelper) ExecDepth(ctx context.Context) types.Depth { + return g.MaxDepth(ctx) - g.SplitDepth(ctx) - 1 +} + +func (g *OutputGameHelper) L2BlockNum(ctx context.Context) uint64 { + _, blockNum, err := g.Game.GetBlockRange(ctx) + g.Require.NoError(err, "failed to load l2 block number") + return blockNum +} + +func (g *OutputGameHelper) StartingBlockNum(ctx context.Context) uint64 { + blockNum, _, err := g.Game.GetBlockRange(ctx) + g.Require.NoError(err, "failed to load starting block number") + return blockNum +} + +func (g *OutputGameHelper) DisputeLastBlock(ctx context.Context) *ClaimHelper { + return g.DisputeBlock(ctx, g.L2BlockNum(ctx)) +} + +// DisputeBlock posts claims from both the honest and dishonest actor to progress the output root part of the game +// through to the split depth and the claims are setup such that the last block in the game range is the block +// to execute cannon on. ie the first block the honest and dishonest actors disagree about is the l2 block of the game. +func (g *OutputGameHelper) DisputeBlock(ctx context.Context, disputeBlockNum uint64) *ClaimHelper { + dishonestValue := g.GetClaimValue(ctx, 0) + correctRootClaim := g.correctOutputRoot(ctx, types.NewPositionFromGIndex(big.NewInt(1))) + rootIsValid := dishonestValue == correctRootClaim + if rootIsValid { + // Ensure that the dishonest actor is actually posting invalid roots. + // Otherwise, the honest challenger will defend our counter and ruin everything. + dishonestValue = common.Hash{0xff, 0xff, 0xff} + } + pos := types.NewPositionFromGIndex(big.NewInt(1)) + getClaimValue := func(parentClaim *ClaimHelper, claimPos types.Position) common.Hash { + claimBlockNum, err := g.CorrectOutputProvider.ClaimedBlockNumber(claimPos) + g.Require.NoError(err, "failed to calculate claim block number") + if claimBlockNum < disputeBlockNum { + // Use the correct output root for all claims prior to the dispute block number + // This pushes the game to dispute the last block in the range + return g.correctOutputRoot(ctx, claimPos) + } + if rootIsValid == parentClaim.AgreesWithOutputRoot() { + // We are responding to a parent claim that agrees with a valid root, so we're being dishonest + return dishonestValue + } else { + // Otherwise we must be the honest actor so use the correct root + return g.correctOutputRoot(ctx, claimPos) + } + } + + claim := g.RootClaim(ctx) + for !claim.IsOutputRootLeaf(ctx) { + parentClaimBlockNum, err := g.CorrectOutputProvider.ClaimedBlockNumber(pos) + g.Require.NoError(err, "failed to calculate parent claim block number") + if parentClaimBlockNum >= disputeBlockNum { + pos = pos.Attack() + claim = claim.Attack(ctx, getClaimValue(claim, pos)) + } else { + pos = pos.Defend() + claim = claim.Defend(ctx, getClaimValue(claim, pos)) + } + } + return claim +} + +func (g *OutputGameHelper) RootClaim(ctx context.Context) *ClaimHelper { + claim := g.getClaim(ctx, 0) + return newClaimHelper(g, 0, claim) +} + +func (g *OutputGameHelper) WaitForCorrectOutputRoot(ctx context.Context, claimIdx int64) { + g.WaitForClaimCount(ctx, claimIdx+1) + claim := g.getClaim(ctx, claimIdx) + output := g.correctOutputRoot(ctx, claim.Position) + g.Require.EqualValuesf(output, claim.Value, "Incorrect output root at claim %v at position %v", claimIdx, claim.Position.ToGIndex().Uint64()) +} + +func (g *OutputGameHelper) correctOutputRoot(ctx context.Context, pos types.Position) common.Hash { + outputRoot, err := g.CorrectOutputProvider.Get(ctx, pos) + g.Require.NoErrorf(err, "Failed to get correct output for position %v", pos) + return outputRoot +} + +func (g *OutputGameHelper) MaxClockDuration(ctx context.Context) time.Duration { + duration, err := g.Game.GetMaxClockDuration(ctx) + g.Require.NoError(err, "failed to get max clock duration") + return duration +} + +func (g *OutputGameHelper) WaitForNoAvailableCredit(ctx context.Context, addr common.Address) { + timedCtx, cancel := context.WithTimeout(ctx, defaultTimeout) + defer cancel() + err := wait.For(timedCtx, time.Second, func() (bool, error) { + bal, _, err := g.Game.GetCredit(timedCtx, addr) + if err != nil { + return false, err + } + g.T.Log("Waiting for zero available credit", "current", bal, "addr", addr) + return bal.Cmp(big.NewInt(0)) == 0, nil + }) + if err != nil { + g.LogGameData(ctx) + g.Require.NoError(err, "Failed to wait for zero available credit") + } +} + +func (g *OutputGameHelper) AvailableCredit(ctx context.Context, addr common.Address) *big.Int { + credit, _, err := g.Game.GetCredit(ctx, addr) + g.Require.NoErrorf(err, "Failed to fetch available credit for %v", addr) + return credit +} + +func (g *OutputGameHelper) CreditUnlockDuration(ctx context.Context) time.Duration { + weth, err := g.GameBindings.Weth(&bind.CallOpts{Context: ctx}) + g.Require.NoError(err, "Failed to get WETH contract") + contract, err := bindings.NewDelayedWETH(weth, g.Client) + g.Require.NoError(err) + period, err := contract.Delay(&bind.CallOpts{Context: ctx}) + g.Require.NoError(err, "Failed to get WETH unlock period") + float, _ := period.Float64() + return time.Duration(float) * time.Second +} + +func (g *OutputGameHelper) WethBalance(ctx context.Context, addr common.Address) *big.Int { + weth, err := g.GameBindings.Weth(&bind.CallOpts{Context: ctx}) + g.Require.NoError(err, "Failed to get WETH contract") + contract, err := bindings.NewDelayedWETH(weth, g.Client) + g.Require.NoError(err) + balance, err := contract.BalanceOf(&bind.CallOpts{Context: ctx}, addr) + g.Require.NoError(err, "Failed to get WETH balance") + return balance +} + +// WaitForClaimCount waits until there are at least count claims in the game. +// This does not check that the number of claims is exactly the specified count to avoid intermittent failures +// where a challenger posts an additional claim before this method sees the number of claims it was waiting for. +func (g *OutputGameHelper) WaitForClaimCount(ctx context.Context, count int64) { + timedCtx, cancel := context.WithTimeout(ctx, defaultTimeout) + defer cancel() + err := wait.For(timedCtx, time.Second, func() (bool, error) { + actual, err := g.Game.GetClaimCount(timedCtx) + if err != nil { + return false, err + } + g.T.Log("Waiting for claim count", "current", actual, "expected", count, "game", g.Addr) + return int64(actual) >= count, nil + }) + if err != nil { + g.LogGameData(ctx) + g.Require.NoErrorf(err, "Did not find expected claim count %v", count) + } +} + +type ContractClaim struct { + ParentIndex uint32 + CounteredBy common.Address + Claimant common.Address + Bond *big.Int + Claim [32]byte + Position *big.Int + Clock *big.Int +} + +func (g *OutputGameHelper) MaxDepth(ctx context.Context) types.Depth { + depth, err := g.Game.GetMaxGameDepth(ctx) + g.Require.NoError(err, "Failed to load game depth") + return depth +} + +func (g *OutputGameHelper) waitForClaim(ctx context.Context, timeout time.Duration, errorMsg string, predicate func(claimIdx int64, claim types.Claim) bool) (int64, types.Claim) { + timedCtx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + var matchedClaim types.Claim + var matchClaimIdx int64 + err := wait.For(timedCtx, time.Second, func() (bool, error) { + claims, err := g.Game.GetAllClaims(ctx, rpcblock.Latest) + if err != nil { + return false, fmt.Errorf("retrieve all claims: %w", err) + } + // Search backwards because the new claims are at the end and more likely the ones we want. + for i := len(claims) - 1; i >= 0; i-- { + claim := claims[i] + if predicate(int64(i), claim) { + matchClaimIdx = int64(i) + matchedClaim = claim + return true, nil + } + } + return false, nil + }) + if err != nil { // Avoid waiting time capturing game data when there's no error + g.Require.NoErrorf(err, "%v\n%v", errorMsg, g.GameData(ctx)) + } + return matchClaimIdx, matchedClaim +} + +func (g *OutputGameHelper) waitForNoClaim(ctx context.Context, errorMsg string, predicate func(claim types.Claim) bool) { + timedCtx, cancel := context.WithTimeout(ctx, defaultTimeout) + defer cancel() + err := wait.For(timedCtx, time.Second, func() (bool, error) { + claims, err := g.Game.GetAllClaims(ctx, rpcblock.Latest) + if err != nil { + return false, fmt.Errorf("retrieve all claims: %w", err) + } + // Search backwards because the new claims are at the end and more likely the ones we want. + for i := len(claims) - 1; i >= 0; i-- { + claim := claims[i] + if predicate(claim) { + return false, nil + } + } + return true, nil + }) + if err != nil { // Avoid waiting time capturing game data when there's no error + g.Require.NoErrorf(err, "%v\n%v", errorMsg, g.GameData(ctx)) + } +} + +func (g *OutputGameHelper) GetClaimValue(ctx context.Context, claimIdx int64) common.Hash { + g.WaitForClaimCount(ctx, claimIdx+1) + claim := g.getClaim(ctx, claimIdx) + return claim.Value +} + +func (g *OutputGameHelper) getAllClaims(ctx context.Context) []types.Claim { + claims, err := g.Game.GetAllClaims(ctx, rpcblock.Latest) + g.Require.NoError(err, "Failed to get all claims") + return claims +} + +// getClaim retrieves the claim data for a specific index. +// Note that it is deliberately not exported as tests should use WaitForClaim to avoid race conditions. +func (g *OutputGameHelper) getClaim(ctx context.Context, claimIdx int64) types.Claim { + claimData, err := g.Game.GetClaim(ctx, uint64(claimIdx)) + if err != nil { + g.Require.NoErrorf(err, "retrieve claim %v", claimIdx) + } + return claimData +} + +func (g *OutputGameHelper) WaitForClaimAtDepth(ctx context.Context, depth types.Depth) { + g.waitForClaim( + ctx, + defaultTimeout, + fmt.Sprintf("Could not find claim depth %v", depth), + func(_ int64, claim types.Claim) bool { + return claim.Depth() == depth + }) +} + +func (g *OutputGameHelper) WaitForClaimAtMaxDepth(ctx context.Context, countered bool) { + maxDepth := g.MaxDepth(ctx) + g.waitForClaim( + ctx, + defaultTimeout, + fmt.Sprintf("Could not find claim depth %v with countered=%v", maxDepth, countered), + func(_ int64, claim types.Claim) bool { + return claim.Depth() == maxDepth && (claim.CounteredBy != common.Address{}) == countered + }) +} + +func (g *OutputGameHelper) WaitForAllClaimsCountered(ctx context.Context) { + g.waitForNoClaim( + ctx, + "Did not find all claims countered", + func(claim types.Claim) bool { + return claim.CounteredBy == common.Address{} + }) +} + +func (g *OutputGameHelper) Resolve(ctx context.Context) { + ctx, cancel := context.WithTimeout(ctx, time.Minute) + defer cancel() + tx, err := g.GameBindings.Resolve(g.Opts) + g.Require.NoError(err) + _, err = wait.ForReceiptOK(ctx, g.Client, tx.Hash()) + g.Require.NoError(err) +} + +func (g *OutputGameHelper) Status(ctx context.Context) gameTypes.GameStatus { + status, err := g.Game.GetStatus(ctx) + g.Require.NoError(err) + return status +} + +func (g *OutputGameHelper) WaitForGameStatus(ctx context.Context, expected gameTypes.GameStatus) { + g.T.Logf("Waiting for game %v to have status %v", g.Addr, expected) + timedCtx, cancel := context.WithTimeout(ctx, defaultTimeout) + defer cancel() + err := wait.For(timedCtx, time.Second, func() (bool, error) { + ctx, cancel := context.WithTimeout(timedCtx, 30*time.Second) + defer cancel() + status, err := g.Game.GetStatus(ctx) + if err != nil { + return false, fmt.Errorf("game status unavailable: %w", err) + } + g.T.Logf("Game %v has state %v, waiting for state %v", g.Addr, status, expected) + return expected == status, nil + }) + g.Require.NoErrorf(err, "wait for Game status. Game state: \n%v", g.GameData(ctx)) +} + +func (g *OutputGameHelper) WaitForInactivity(ctx context.Context, numInactiveBlocks int, untilGameEnds bool) { + g.T.Logf("Waiting for game %v to have no activity for %v blocks", g.Addr, numInactiveBlocks) + headCh := make(chan *gethtypes.Header, 100) + headSub, err := g.Client.SubscribeNewHead(ctx, headCh) + g.Require.NoError(err) + defer headSub.Unsubscribe() + + var lastActiveBlock uint64 + for { + if untilGameEnds && g.Status(ctx) != gameTypes.GameStatusInProgress { + break + } + select { + case head := <-headCh: + if lastActiveBlock == 0 { + lastActiveBlock = head.Number.Uint64() + continue + } else if lastActiveBlock+uint64(numInactiveBlocks) < head.Number.Uint64() { + return + } + block, err := g.Client.BlockByNumber(ctx, head.Number) + g.Require.NoError(err) + numActions := 0 + for _, tx := range block.Transactions() { + if tx.To().Hex() == g.Addr.Hex() { + numActions++ + } + } + if numActions != 0 { + g.T.Logf("Game %v has %v actions in block %d. Resetting inactivity timeout", g.Addr, numActions, block.NumberU64()) + lastActiveBlock = head.Number.Uint64() + } + case err := <-headSub.Err(): + g.Require.NoError(err) + case <-ctx.Done(): + g.Require.Fail("Context canceled", ctx.Err()) + } + } +} + +func (g *OutputGameHelper) WaitForL2BlockNumberChallenged(ctx context.Context) { + g.T.Logf("Waiting for game %v to have L2 block number challenged", g.Addr) + timedCtx, cancel := context.WithTimeout(ctx, 30*time.Second) + defer cancel() + err := wait.For(timedCtx, time.Second, func() (bool, error) { + return g.Game.IsL2BlockNumberChallenged(ctx, rpcblock.Latest) + }) + g.Require.NoError(err, "L2 block number was not challenged in time") +} + +// Mover is a function that either attacks or defends the claim at parentClaimIdx +type Mover func(parent *ClaimHelper) *ClaimHelper + +// Stepper is a function that attempts to perform a step against the claim at parentClaimIdx +type Stepper func(parentClaimIdx int64) + +type defendClaimCfg struct { + skipWaitingForStep bool +} + +type DefendClaimOpt func(cfg *defendClaimCfg) + +func WithoutWaitingForStep() DefendClaimOpt { + return func(cfg *defendClaimCfg) { + cfg.skipWaitingForStep = true + } +} + +// DefendClaim uses the supplied Mover to perform moves in an attempt to defend the supplied claim. +// It is assumed that the specified claim is invalid and that an honest op-challenger is already running. +// When the game has reached the maximum depth it waits for the honest challenger to counter the leaf claim with step. +// Returns the final leaf claim +func (g *OutputGameHelper) DefendClaim(ctx context.Context, claim *ClaimHelper, performMove Mover, Opts ...DefendClaimOpt) *ClaimHelper { + g.T.Logf("Defending claim %v at depth %v", claim.Index, claim.Depth()) + cfg := &defendClaimCfg{} + for _, opt := range Opts { + opt(cfg) + } + for !claim.IsMaxDepth(ctx) { + g.LogGameData(ctx) + // Wait for the challenger to counter + claim = claim.WaitForCounterClaim(ctx) + g.LogGameData(ctx) + + // Respond with our own move + claim = performMove(claim) + } + + if !cfg.skipWaitingForStep { + claim.WaitForCountered(ctx) + } + return claim +} + +// ChallengeClaim uses the supplied functions to perform moves and steps in an attempt to challenge the supplied claim. +// It is assumed that the claim being disputed is valid and that an honest op-challenger is already running. +// When the game has reached the maximum depth it calls the Stepper to attempt to counter the leaf claim. +// Since the output root is valid, it should not be possible for the Stepper to call step successfully. +func (g *OutputGameHelper) ChallengeClaim(ctx context.Context, claim *ClaimHelper, performMove Mover, attemptStep Stepper) { + for !claim.IsMaxDepth(ctx) { + g.LogGameData(ctx) + // Perform our move + claim = performMove(claim) + + // Wait for the challenger to counter + g.LogGameData(ctx) + claim = claim.WaitForCounterClaim(ctx) + } + + // Confirm the game has reached max depth and the last claim hasn't been countered + g.WaitForClaimAtMaxDepth(ctx, false) + g.LogGameData(ctx) + + // It's on us to call step if we want to win but shouldn't be possible + attemptStep(claim.Index) +} + +func (g *OutputGameHelper) WaitForNewClaim(ctx context.Context, checkPoint int64) (int64, error) { + return g.waitForNewClaim(ctx, checkPoint, defaultTimeout) +} + +func (g *OutputGameHelper) waitForNewClaim(ctx context.Context, checkPoint int64, timeout time.Duration) (int64, error) { + timedCtx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + var newClaimLen int64 + err := wait.For(timedCtx, time.Second, func() (bool, error) { + actual, err := g.Game.GetClaimCount(ctx) + if err != nil { + return false, err + } + newClaimLen = int64(actual) + return int64(actual) > checkPoint, nil + }) + return newClaimLen, err +} + +func (g *OutputGameHelper) moveCfg(Opts ...MoveOpt) *moveCfg { + cfg := &moveCfg{ + Opts: g.Opts, + } + for _, opt := range Opts { + opt.Apply(cfg) + } + return cfg +} + +func (g *OutputGameHelper) Attack(ctx context.Context, claimIdx int64, claim common.Hash, Opts ...MoveOpt) { + g.T.Logf("Attacking claim %v with value %v", claimIdx, claim) + cfg := g.moveCfg(Opts...) + + claimData, err := g.Game.GetClaim(ctx, uint64(claimIdx)) + g.Require.NoError(err, "Failed to get claim data") + attackPos := claimData.Position.Attack() + transactOpts := g.makeBondedTransactOpts(ctx, claimData.Position.Attack().ToGIndex(), cfg.Opts) + + err = g.sendMove(ctx, func() (*gethtypes.Transaction, error) { + return g.GameBindings.Attack(transactOpts, claimData.Value, big.NewInt(claimIdx), claim) + }) + if err != nil { + if cfg.ignoreDupes && g.hasClaim(ctx, claimIdx, attackPos, claim) { + return + } + g.Require.NoErrorf(err, "Defend transaction failed. Game state: \n%v", g.GameData(ctx)) + } +} + +func (g *OutputGameHelper) Defend(ctx context.Context, claimIdx int64, claim common.Hash, Opts ...MoveOpt) { + g.T.Logf("Defending claim %v with value %v", claimIdx, claim) + cfg := g.moveCfg(Opts...) + + claimData, err := g.Game.GetClaim(ctx, uint64(claimIdx)) + g.Require.NoError(err, "Failed to get claim data") + defendPos := claimData.Position.Defend() + transactOpts := g.makeBondedTransactOpts(ctx, defendPos.ToGIndex(), cfg.Opts) + + err = g.sendMove(ctx, func() (*gethtypes.Transaction, error) { + return g.GameBindings.Defend(transactOpts, claimData.Value, big.NewInt(claimIdx), claim) + }) + if err != nil { + if cfg.ignoreDupes && g.hasClaim(ctx, claimIdx, defendPos, claim) { + return + } + g.Require.NoErrorf(err, "Defend transaction failed. Game state: \n%v", g.GameData(ctx)) + } +} + +func (g *OutputGameHelper) hasClaim(ctx context.Context, parentIdx int64, pos types.Position, value common.Hash) bool { + claims := g.getAllClaims(ctx) + for _, claim := range claims { + if int64(claim.ParentContractIndex) == parentIdx && claim.Position.ToGIndex().Cmp(pos.ToGIndex()) == 0 && claim.Value == value { + return true + } + } + return false +} + +func (g *OutputGameHelper) sendMove(ctx context.Context, send func() (*gethtypes.Transaction, error)) error { + tx, err := send() + if err != nil { + return fmt.Errorf("transaction did not send: %w", err) + } + _, err = wait.ForReceiptOK(ctx, g.Client, tx.Hash()) + if err != nil { + return fmt.Errorf("transaction was not ok: %w", err) + } + return nil +} + +func (g *OutputGameHelper) makeBondedTransactOpts(ctx context.Context, pos *big.Int, Opts *bind.TransactOpts) *bind.TransactOpts { + bOpts := *Opts + bond, err := g.GameBindings.GetRequiredBond(&bind.CallOpts{Context: ctx}, pos) + g.Require.NoError(err, "Failed to get required bond") + bOpts.Value = bond + return &bOpts +} + +type ErrWithData interface { + ErrorData() interface{} +} + +// StepFails attempts to call step and verifies that it fails with ValidStep() +func (g *OutputGameHelper) StepFails(claimIdx int64, isAttack bool, stateData []byte, proof []byte) { + g.T.Logf("Attempting step against claim %v isAttack: %v", claimIdx, isAttack) + _, err := g.GameBindings.Step(g.Opts, big.NewInt(claimIdx), isAttack, stateData, proof) + errData, ok := err.(ErrWithData) + g.Require.Truef(ok, "Error should provide ErrorData method: %v", err) + g.Require.Equal("0xfb4e40dd", errData.ErrorData(), "Revert reason should be abi encoded ValidStep()") +} + +// ResolveClaim resolves a single subgame +func (g *OutputGameHelper) ResolveClaim(ctx context.Context, claimIdx int64) { + tx, err := g.GameBindings.ResolveClaim(g.Opts, big.NewInt(claimIdx), common.Big0) + g.Require.NoError(err, "ResolveClaim transaction did not send") + _, err = wait.ForReceiptOK(ctx, g.Client, tx.Hash()) + g.Require.NoError(err, "ResolveClaim transaction was not OK") +} + +// ChallengePeriod returns the challenge period fetched from the PreimageOracle contract. +// The returned uint64 value is the number of seconds for the challenge period. +func (g *OutputGameHelper) ChallengePeriod(ctx context.Context) uint64 { + oracle := g.oracle(ctx) + period, err := oracle.ChallengePeriod(ctx) + g.Require.NoError(err, "Failed to get challenge period") + return period +} + +// WaitForChallengePeriodStart waits for the challenge period to start for a given large preimage claim. +func (g *OutputGameHelper) WaitForChallengePeriodStart(ctx context.Context, sender common.Address, data *types.PreimageOracleData) { + timedCtx, cancel := context.WithTimeout(ctx, defaultTimeout) + defer cancel() + err := wait.For(timedCtx, time.Second, func() (bool, error) { + ctx, cancel := context.WithTimeout(timedCtx, 30*time.Second) + defer cancel() + timestamp := g.ChallengePeriodStartTime(ctx, sender, data) + g.T.Log("Waiting for challenge period start", "timestamp", timestamp, "key", data.OracleKey, "game", g.Addr) + return timestamp > 0, nil + }) + if err != nil { + g.LogGameData(ctx) + g.Require.NoErrorf(err, "Failed to get challenge start period for preimage data %v", data) + } +} + +// ChallengePeriodStartTime returns the start time of the challenge period for a given large preimage claim. +// If the returned start time is 0, the challenge period has not started. +func (g *OutputGameHelper) ChallengePeriodStartTime(ctx context.Context, sender common.Address, data *types.PreimageOracleData) uint64 { + oracle := g.oracle(ctx) + uuid := preimages.NewUUID(sender, data) + metadata, err := oracle.GetProposalMetadata(ctx, rpcblock.Latest, keccakTypes.LargePreimageIdent{ + Claimant: sender, + UUID: uuid, + }) + g.Require.NoError(err, "Failed to get proposal metadata") + if len(metadata) == 0 { + return 0 + } + return metadata[0].Timestamp +} + +func (g *OutputGameHelper) WaitForPreimageInOracle(ctx context.Context, data *types.PreimageOracleData) { + timedCtx, cancel := context.WithTimeout(ctx, defaultTimeout) + defer cancel() + oracle := g.oracle(ctx) + err := wait.For(timedCtx, time.Second, func() (bool, error) { + g.T.Logf("Waiting for preimage (%v) to be present in oracle", common.Bytes2Hex(data.OracleKey)) + return oracle.GlobalDataExists(ctx, data) + }) + g.Require.NoErrorf(err, "Did not find preimage (%v) in oracle", common.Bytes2Hex(data.OracleKey)) +} + +func (g *OutputGameHelper) UploadPreimage(ctx context.Context, data *types.PreimageOracleData, privateKey *ecdsa.PrivateKey) { + oracle := g.oracle(ctx) + boundOracle, err := bindings.NewPreimageOracle(oracle.Addr(), g.Client) + g.Require.NoError(err) + var tx *gethtypes.Transaction + switch data.OracleKey[0] { + case byte(preimage.PrecompileKeyType): + tx, err = boundOracle.LoadPrecompilePreimagePart( + g.Opts, + new(big.Int).SetUint64(uint64(data.OracleOffset)), + data.GetPrecompileAddress(), + data.GetPrecompileInput(), + ) + default: + tx, err = boundOracle.LoadKeccak256PreimagePart(g.Opts, new(big.Int).SetUint64(uint64(data.OracleOffset)), data.GetPreimageWithoutSize()) + } + g.Require.NoError(err, "Failed to load preimage part") + _, err = wait.ForReceiptOK(ctx, g.Client, tx.Hash()) + g.Require.NoError(err) +} + +func (g *OutputGameHelper) oracle(ctx context.Context) *contracts.PreimageOracleContract { + oracle, err := g.Game.GetOracle(ctx) + g.Require.NoError(err, "Failed to create oracle contract") + return oracle +} + +func (g *OutputGameHelper) GameData(ctx context.Context) string { + maxDepth := g.MaxDepth(ctx) + splitDepth := g.SplitDepth(ctx) + claims, err := g.Game.GetAllClaims(ctx, rpcblock.Latest) + g.Require.NoError(err, "Fetching claims") + info := fmt.Sprintf("Claim count: %v\n", len(claims)) + for i, claim := range claims { + pos := claim.Position + extra := "" + if pos.Depth() <= splitDepth { + blockNum, err := g.CorrectOutputProvider.ClaimedBlockNumber(pos) + if err != nil { + } else { + extra = fmt.Sprintf("Block num: %v", blockNum) + } + } + info = info + fmt.Sprintf("%v - Position: %v, Depth: %v, IndexAtDepth: %v Trace Index: %v, ClaimHash: %v, Countered By: %v, ParentIndex: %v Claimant: %v Bond: %v %v\n", + i, claim.Position.ToGIndex().Int64(), pos.Depth(), pos.IndexAtDepth(), pos.TraceIndex(maxDepth), claim.Value.Hex(), claim.CounteredBy, claim.ParentContractIndex, claim.Claimant, claim.Bond, extra) + } + l2BlockNum := g.L2BlockNum(ctx) + status, err := g.Game.GetStatus(ctx) + g.Require.NoError(err, "Load game status") + return fmt.Sprintf("Game %v - %v - L2 Block: %v - Split Depth: %v - Max Depth: %v:\n%v\n", + g.Addr, status, l2BlockNum, splitDepth, maxDepth, info) +} + +func (g *OutputGameHelper) LogGameData(ctx context.Context) { + g.T.Log(g.GameData(ctx)) +} + +func (g *OutputGameHelper) Credit(ctx context.Context, addr common.Address) *big.Int { + amt, _, err := g.Game.GetCredit(ctx, addr) + g.Require.NoError(err) + return amt +} + +func (g *OutputGameHelper) GetL1Head(ctx context.Context) eth.BlockID { + l1HeadHash, err := g.Game.GetL1Head(ctx) + g.Require.NoError(err, "Failed to load L1 head") + l1Header, err := g.Client.HeaderByHash(ctx, l1HeadHash) + g.Require.NoError(err, "Failed to load L1 header") + l1Head := eth.HeaderBlockID(l1Header) + return l1Head +} diff --git a/op-e2e2/e2eutils/disputegame/output_honest_helper.go b/op-e2e2/e2eutils/disputegame/output_honest_helper.go new file mode 100644 index 000000000000..e2de7c4ec743 --- /dev/null +++ b/op-e2e2/e2eutils/disputegame/output_honest_helper.go @@ -0,0 +1,114 @@ +package disputegame + +import ( + "context" + "testing" + "time" + + "github.com/ethereum-optimism/optimism/op-challenger/game/fault/contracts" + "github.com/ethereum-optimism/optimism/op-challenger/game/fault/types" + "github.com/ethereum-optimism/optimism/op-service/sources/batching/rpcblock" + "github.com/stretchr/testify/require" +) + +const getTraceTimeout = 10 * time.Minute + +type OutputHonestHelper struct { + t *testing.T + require *require.Assertions + game *OutputGameHelper + contract contracts.FaultDisputeGameContract + correctTrace types.TraceAccessor +} + +func NewOutputHonestHelper(t *testing.T, require *require.Assertions, game *OutputGameHelper, contract contracts.FaultDisputeGameContract, correctTrace types.TraceAccessor) *OutputHonestHelper { + return &OutputHonestHelper{ + t: t, + require: require, + game: game, + contract: contract, + correctTrace: correctTrace, + } +} + +func (h *OutputHonestHelper) CounterClaim(ctx context.Context, claim *ClaimHelper, opts ...MoveOpt) *ClaimHelper { + game, target := h.loadState(ctx, claim.Index) + value, err := h.correctTrace.Get(ctx, game, target, target.Position) + h.require.NoErrorf(err, "Failed to determine correct claim at position %v with g index %v", target.Position, target.Position.ToGIndex()) + if value == claim.claim { + return h.DefendClaim(ctx, claim, opts...) + } else { + return h.AttackClaim(ctx, claim, opts...) + } +} + +func (h *OutputHonestHelper) AttackClaim(ctx context.Context, claim *ClaimHelper, opts ...MoveOpt) *ClaimHelper { + h.Attack(ctx, claim.Index, opts...) + return claim.WaitForCounterClaim(ctx) +} + +func (h *OutputHonestHelper) DefendClaim(ctx context.Context, claim *ClaimHelper, opts ...MoveOpt) *ClaimHelper { + h.Defend(ctx, claim.Index, opts...) + return claim.WaitForCounterClaim(ctx) +} + +func (h *OutputHonestHelper) Attack(ctx context.Context, claimIdx int64, opts ...MoveOpt) { + // Ensure the claim exists + h.game.WaitForClaimCount(ctx, claimIdx+1) + + ctx, cancel := context.WithTimeout(ctx, getTraceTimeout) + defer cancel() + + game, claim := h.loadState(ctx, claimIdx) + attackPos := claim.Position.Attack() + h.t.Logf("Attacking claim %v at position %v with g index %v", claimIdx, attackPos, attackPos.ToGIndex()) + value, err := h.correctTrace.Get(ctx, game, claim, attackPos) + h.require.NoErrorf(err, "Get correct claim at position %v with g index %v", attackPos, attackPos.ToGIndex()) + h.t.Log("Performing attack") + h.game.Attack(ctx, claimIdx, value, opts...) + h.t.Log("Attack complete") +} + +func (h *OutputHonestHelper) Defend(ctx context.Context, claimIdx int64, opts ...MoveOpt) { + // Ensure the claim exists + h.game.WaitForClaimCount(ctx, claimIdx+1) + + ctx, cancel := context.WithTimeout(ctx, getTraceTimeout) + defer cancel() + game, claim := h.loadState(ctx, claimIdx) + defendPos := claim.Position.Defend() + value, err := h.correctTrace.Get(ctx, game, claim, defendPos) + h.game.Require.NoErrorf(err, "Get correct claim at position %v with g index %v", defendPos, defendPos.ToGIndex()) + h.game.Defend(ctx, claimIdx, value, opts...) +} + +func (h *OutputHonestHelper) StepClaimFails(ctx context.Context, claim *ClaimHelper, isAttack bool) { + h.StepFails(ctx, claim.Index, isAttack) +} + +func (h *OutputHonestHelper) StepFails(ctx context.Context, claimIdx int64, isAttack bool) { + // Ensure the claim exists + h.game.WaitForClaimCount(ctx, claimIdx+1) + + ctx, cancel := context.WithTimeout(ctx, 2*time.Minute) + defer cancel() + + game, claim := h.loadState(ctx, claimIdx) + pos := claim.Position + if !isAttack { + // If we're defending, then the step will be from the trace to the next one + pos = pos.MoveRight() + } + prestate, proofData, _, err := h.correctTrace.GetStepData(ctx, game, claim, pos) + h.require.NoError(err, "Get step data") + h.game.StepFails(claimIdx, isAttack, prestate, proofData) +} + +func (h *OutputHonestHelper) loadState(ctx context.Context, claimIdx int64) (types.Game, types.Claim) { + claims, err := h.contract.GetAllClaims(ctx, rpcblock.Latest) + h.require.NoError(err, "Failed to load claims from game") + game := types.NewGameState(claims, h.game.MaxDepth(ctx)) + + claim := game.Claims()[claimIdx] + return game, claim +} diff --git a/op-e2e2/e2eutils/disputegame/preimage/preimage_helper.go b/op-e2e2/e2eutils/disputegame/preimage/preimage_helper.go new file mode 100644 index 000000000000..cdfda94c1128 --- /dev/null +++ b/op-e2e2/e2eutils/disputegame/preimage/preimage_helper.go @@ -0,0 +1,138 @@ +package preimage + +import ( + "bytes" + "context" + "errors" + "io" + "math/big" + "math/rand" + "sync/atomic" + "testing" + "time" + + "github.com/ethereum-optimism/optimism/op-challenger/game/fault/contracts" + "github.com/ethereum-optimism/optimism/op-challenger/game/fault/preimages" + "github.com/ethereum-optimism/optimism/op-challenger/game/keccak/matrix" + "github.com/ethereum-optimism/optimism/op-challenger/game/keccak/types" + "github.com/ethereum-optimism/optimism/op-e2e2/bindings" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/wait" + "github.com/ethereum-optimism/optimism/op-service/sources/batching" + "github.com/ethereum-optimism/optimism/op-service/sources/batching/rpcblock" + "github.com/ethereum-optimism/optimism/op-service/testutils" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/stretchr/testify/require" +) + +const MinPreimageSize = 10000 + +type Helper struct { + t *testing.T + require *require.Assertions + client *ethclient.Client + opts *bind.TransactOpts + oracleBindings *bindings.PreimageOracle + oracle *contracts.PreimageOracleContract + uuidProvider atomic.Int64 +} + +func NewHelper(t *testing.T, opts *bind.TransactOpts, client *ethclient.Client, addr common.Address) *Helper { + require := require.New(t) + oracleBindings, err := bindings.NewPreimageOracle(addr, client) + require.NoError(err) + + oracle := contracts.NewPreimageOracleContract(addr, batching.NewMultiCaller(client.Client(), batching.DefaultBatchSize)) + return &Helper{ + t: t, + require: require, + client: client, + opts: opts, + oracleBindings: oracleBindings, + oracle: oracle, + } +} + +type InputModifier func(startBlock uint64, input *types.InputData) + +func WithReplacedCommitment(idx uint64, value common.Hash) InputModifier { + return func(startBlock uint64, input *types.InputData) { + if startBlock > idx { + return + } + if startBlock+uint64(len(input.Commitments)) < idx { + return + } + input.Commitments[idx-startBlock] = value + } +} + +func WithLastCommitment(value common.Hash) InputModifier { + return func(startBlock uint64, input *types.InputData) { + if input.Finalize { + input.Commitments[len(input.Commitments)-1] = value + } + } +} + +// UploadLargePreimage inits the preimage upload and uploads the leaves, starting the challenge period. +// Squeeze is not called by this method as the challenge period has not yet elapsed. +func (h *Helper) UploadLargePreimage(ctx context.Context, dataSize int, modifiers ...InputModifier) types.LargePreimageIdent { + data := testutils.RandomData(rand.New(rand.NewSource(1234)), dataSize) + s := matrix.NewStateMatrix() + uuid := big.NewInt(h.uuidProvider.Add(1)) + bondValue, err := h.oracleBindings.MINBONDSIZE(&bind.CallOpts{}) + h.require.NoError(err) + h.opts.Value = bondValue + tx, err := h.oracleBindings.InitLPP(h.opts, uuid, 32, uint32(len(data))) + h.require.NoError(err) + _, err = wait.ForReceiptOK(ctx, h.client, tx.Hash()) + h.require.NoError(err) + h.opts.Value = big.NewInt(0) + + startBlock := big.NewInt(0) + totalBlocks := len(data) / types.BlockSize + in := bytes.NewReader(data) + for { + inputData, err := s.AbsorbUpTo(in, preimages.MaxChunkSize) + if !errors.Is(err, io.EOF) { + h.require.NoError(err) + } + for _, modifier := range modifiers { + modifier(startBlock.Uint64(), &inputData) + } + commitments := make([][32]byte, len(inputData.Commitments)) + for i, commitment := range inputData.Commitments { + commitments[i] = commitment + } + h.t.Logf("Uploading %v parts of preimage %v starting at block %v of about %v Finalize: %v", len(commitments), uuid.Uint64(), startBlock.Uint64(), totalBlocks, inputData.Finalize) + tx, err := h.oracleBindings.AddLeavesLPP(h.opts, uuid, startBlock, inputData.Input, commitments, inputData.Finalize) + h.require.NoError(err) + _, err = wait.ForReceiptOK(ctx, h.client, tx.Hash()) + h.require.NoError(err) + startBlock = new(big.Int).Add(startBlock, big.NewInt(int64(len(inputData.Commitments)))) + if inputData.Finalize { + break + } + } + + return types.LargePreimageIdent{ + Claimant: h.opts.From, + UUID: uuid, + } +} + +func (h *Helper) WaitForChallenged(ctx context.Context, ident types.LargePreimageIdent) { + timedCtx, cancel := context.WithTimeout(ctx, 30*time.Second) + defer cancel() + err := wait.For(timedCtx, time.Second, func() (bool, error) { + metadata, err := h.oracle.GetProposalMetadata(ctx, rpcblock.Latest, ident) + if err != nil { + return false, err + } + h.require.Len(metadata, 1) + return metadata[0].Countered, nil + }) + h.require.NoError(err, "Preimage was not challenged") +} diff --git a/op-e2e2/e2eutils/fakebeacon/blobs.go b/op-e2e2/e2eutils/fakebeacon/blobs.go new file mode 100644 index 000000000000..6be65bbb3521 --- /dev/null +++ b/op-e2e2/e2eutils/fakebeacon/blobs.go @@ -0,0 +1,211 @@ +package fakebeacon + +import ( + "encoding/binary" + "encoding/json" + "errors" + "fmt" + "io/fs" + "net" + "net/http" + "os" + "path/filepath" + "strconv" + "strings" + "sync" + "time" + + "github.com/ethereum-optimism/optimism/op-service/eth" + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/beacon/engine" + "github.com/ethereum/go-ethereum/log" +) + +// FakeBeacon presents a beacon-node in testing, without leading any chain-building. +// This merely serves a fake beacon API, and holds on to blocks, +// to complement the actual block-building to happen in testing (e.g. through the fake consensus geth module). +type FakeBeacon struct { + log log.Logger + + // directory to store blob contents in after the blobs are persisted in a block + blobsDir string + blobsLock sync.Mutex + + beaconSrv *http.Server + beaconAPIListener net.Listener + + genesisTime uint64 + blockTime uint64 +} + +func NewBeacon(log log.Logger, blobsDir string, genesisTime uint64, blockTime uint64) *FakeBeacon { + return &FakeBeacon{ + log: log, + blobsDir: blobsDir, + genesisTime: genesisTime, + blockTime: blockTime, + } +} + +func (f *FakeBeacon) Start(addr string) error { + listener, err := net.Listen("tcp", addr) + if err != nil { + return fmt.Errorf("failed to open tcp listener for http beacon api server: %w", err) + } + f.beaconAPIListener = listener + + mux := new(http.ServeMux) + mux.HandleFunc("/eth/v1/beacon/genesis", func(w http.ResponseWriter, r *http.Request) { + err := json.NewEncoder(w).Encode(ð.APIGenesisResponse{Data: eth.ReducedGenesisData{GenesisTime: eth.Uint64String(f.genesisTime)}}) + if err != nil { + f.log.Error("genesis handler err", "err", err) + } + }) + mux.HandleFunc("/eth/v1/config/spec", func(w http.ResponseWriter, r *http.Request) { + err := json.NewEncoder(w).Encode(ð.APIConfigResponse{Data: eth.ReducedConfigData{SecondsPerSlot: eth.Uint64String(f.blockTime)}}) + if err != nil { + f.log.Error("config handler err", "err", err) + } + }) + mux.HandleFunc("/eth/v1/beacon/blob_sidecars/", func(w http.ResponseWriter, r *http.Request) { + blockID := strings.TrimPrefix(r.URL.Path, "/eth/v1/beacon/blob_sidecars/") + slot, err := strconv.ParseUint(blockID, 10, 64) + if err != nil { + f.log.Error("could not parse block id from request", "url", r.URL.Path, "err", err) + w.WriteHeader(http.StatusBadRequest) + return + } + bundle, err := f.LoadBlobsBundle(slot) + if errors.Is(err, ethereum.NotFound) { + f.log.Error("failed to load blobs bundle - not found", "slot", slot, "err", err) + w.WriteHeader(http.StatusNotFound) + return + } else if err != nil { + f.log.Error("failed to load blobs bundle", "slot", slot, "err", err) + w.WriteHeader(http.StatusInternalServerError) + return + } + + query := r.URL.Query() + rawIndices := query["indices"] + indices := make([]uint64, 0, len(bundle.Blobs)) + if len(rawIndices) == 0 { + // request is for all blobs + for i := range bundle.Blobs { + indices = append(indices, uint64(i)) + } + } else { + for _, raw := range rawIndices { + ix, err := strconv.ParseUint(raw, 10, 64) + if err != nil { + f.log.Error("could not parse index from request", "url", r.URL) + w.WriteHeader(http.StatusBadRequest) + return + } + indices = append(indices, ix) + } + } + + var mockBeaconBlockRoot [32]byte + mockBeaconBlockRoot[0] = 42 + binary.LittleEndian.PutUint64(mockBeaconBlockRoot[32-8:], slot) + sidecars := make([]*eth.APIBlobSidecar, len(indices)) + for i, ix := range indices { + if ix >= uint64(len(bundle.Blobs)) { + f.log.Error("blob index from request is out of range", "url", r.URL) + w.WriteHeader(http.StatusBadRequest) + return + } + sidecars[i] = ð.APIBlobSidecar{ + Index: eth.Uint64String(ix), + KZGCommitment: eth.Bytes48(bundle.Commitments[ix]), + KZGProof: eth.Bytes48(bundle.Proofs[ix]), + SignedBlockHeader: eth.SignedBeaconBlockHeader{ + Message: eth.BeaconBlockHeader{ + StateRoot: mockBeaconBlockRoot, + Slot: eth.Uint64String(slot), + }, + }, + } + copy(sidecars[i].Blob[:], bundle.Blobs[ix]) + } + if err := json.NewEncoder(w).Encode(ð.APIGetBlobSidecarsResponse{Data: sidecars}); err != nil { + f.log.Error("blobs handler err", "err", err) + } + }) + mux.HandleFunc("/eth/v1/node/version", func(w http.ResponseWriter, r *http.Request) { + err := json.NewEncoder(w).Encode(ð.APIVersionResponse{Data: eth.VersionInformation{Version: "fakebeacon 1.2.3"}}) + if err != nil { + w.WriteHeader(http.StatusInternalServerError) + f.log.Error("version handler err", "err", err) + } else { + w.WriteHeader(http.StatusOK) + } + }) + f.beaconSrv = &http.Server{ + Handler: mux, + ReadTimeout: time.Second * 20, + ReadHeaderTimeout: time.Second * 20, + WriteTimeout: time.Second * 20, + IdleTimeout: time.Second * 20, + } + go func() { + if err := f.beaconSrv.Serve(f.beaconAPIListener); err != nil && !errors.Is(err, http.ErrServerClosed) { + f.log.Error("failed to start fake-pos beacon server for blobs testing", "err", err) + } + }() + return nil +} + +func (f *FakeBeacon) StoreBlobsBundle(slot uint64, bundle *engine.BlobsBundleV1) error { + data, err := json.Marshal(bundle) + if err != nil { + return fmt.Errorf("failed to encode blobs bundle of slot %d: %w", slot, err) + } + + f.blobsLock.Lock() + defer f.blobsLock.Unlock() + bundlePath := fmt.Sprintf("blobs_bundle_%d.json", slot) + if err := os.MkdirAll(f.blobsDir, 0755); err != nil { + return fmt.Errorf("failed to create dir for blob storage: %w", err) + } + err = os.WriteFile(filepath.Join(f.blobsDir, bundlePath), data, 0755) + if err != nil { + return fmt.Errorf("failed to write blobs bundle of slot %d: %w", slot, err) + } + return nil +} + +func (f *FakeBeacon) LoadBlobsBundle(slot uint64) (*engine.BlobsBundleV1, error) { + f.blobsLock.Lock() + defer f.blobsLock.Unlock() + bundlePath := fmt.Sprintf("blobs_bundle_%d.json", slot) + data, err := os.ReadFile(filepath.Join(f.blobsDir, bundlePath)) + if err != nil { + if errors.Is(err, fs.ErrNotExist) { + return nil, fmt.Errorf("no blobs bundle found for slot %d (%q): %w", slot, bundlePath, ethereum.NotFound) + } else { + return nil, fmt.Errorf("failed to read blobs bundle of slot %d (%q): %w", slot, bundlePath, err) + } + } + var out engine.BlobsBundleV1 + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("failed to decode blobs bundle of slot %d (%q): %w", slot, bundlePath, err) + } + return &out, nil +} + +func (f *FakeBeacon) Close() error { + var out error + if f.beaconSrv != nil { + out = errors.Join(out, f.beaconSrv.Close()) + } + if f.beaconAPIListener != nil { + out = errors.Join(out, f.beaconAPIListener.Close()) + } + return out +} + +func (f *FakeBeacon) BeaconAddr() string { + return "http://" + f.beaconAPIListener.Addr().String() +} diff --git a/op-e2e2/e2eutils/geth/fakepos.go b/op-e2e2/e2eutils/geth/fakepos.go new file mode 100644 index 000000000000..b46f2dc59f9c --- /dev/null +++ b/op-e2e2/e2eutils/geth/fakepos.go @@ -0,0 +1,207 @@ +package geth + +import ( + "encoding/binary" + "math/big" + "math/rand" + "time" + + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/beacon/engine" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/eth" + "github.com/ethereum/go-ethereum/eth/catalyst" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/log" + + "github.com/ethereum-optimism/optimism/op-service/clock" + opeth "github.com/ethereum-optimism/optimism/op-service/eth" + "github.com/ethereum-optimism/optimism/op-service/testutils" +) + +type Beacon interface { + StoreBlobsBundle(slot uint64, bundle *engine.BlobsBundleV1) error +} + +// fakePoS is a testing-only utility to attach to Geth, +// to build a fake proof-of-stake L1 chain with fixed block time and basic lagging safe/finalized blocks. +type fakePoS struct { + clock clock.Clock + eth *eth.Ethereum + log log.Logger + blockTime uint64 + + withdrawalsIndex uint64 + + finalizedDistance uint64 + safeDistance uint64 + + engineAPI *catalyst.ConsensusAPI + sub ethereum.Subscription + + beacon Beacon +} + +func (f *fakePoS) FakeBeaconBlockRoot(time uint64) common.Hash { + var dat [8]byte + binary.LittleEndian.PutUint64(dat[:], time) + return crypto.Keccak256Hash(dat[:]) +} + +func (f *fakePoS) Start() error { + if advancing, ok := f.clock.(*clock.AdvancingClock); ok { + advancing.Start() + } + withdrawalsRNG := rand.New(rand.NewSource(450368975843)) // avoid generating the same address as any test + f.sub = event.NewSubscription(func(quit <-chan struct{}) error { + // poll every half a second: enough to catch up with any block time when ticks are missed + t := f.clock.NewTicker(time.Second / 2) + for { + select { + case now := <-t.Ch(): + chain := f.eth.BlockChain() + head := chain.CurrentBlock() + finalized := chain.CurrentFinalBlock() + if finalized == nil { // fallback to genesis if nothing is finalized + finalized = chain.Genesis().Header() + } + safe := chain.CurrentSafeBlock() + if safe == nil { // fallback to finalized if nothing is safe + safe = finalized + } + if head.Number.Uint64() > f.finalizedDistance { // progress finalized block, if we can + finalized = f.eth.BlockChain().GetHeaderByNumber(head.Number.Uint64() - f.finalizedDistance) + } + if head.Number.Uint64() > f.safeDistance { // progress safe block, if we can + safe = f.eth.BlockChain().GetHeaderByNumber(head.Number.Uint64() - f.safeDistance) + } + // start building the block as soon as we are past the current head time + if head.Time >= uint64(now.Unix()) { + continue + } + newBlockTime := head.Time + f.blockTime + if time.Unix(int64(newBlockTime), 0).Add(5 * time.Minute).Before(f.clock.Now()) { + // We're a long way behind, let's skip some blocks... + newBlockTime = uint64(f.clock.Now().Unix()) + } + // create some random withdrawals + withdrawals := make([]*types.Withdrawal, withdrawalsRNG.Intn(4)) + for i := 0; i < len(withdrawals); i++ { + withdrawals[i] = &types.Withdrawal{ + Index: f.withdrawalsIndex + uint64(i), + Validator: withdrawalsRNG.Uint64() % 100_000_000, // 100 million fake validators + Address: testutils.RandomAddress(withdrawalsRNG), + // in gwei, consensus-layer quirk. withdraw non-zero value up to 50 ETH + Amount: uint64(withdrawalsRNG.Intn(50_000_000_000) + 1), + } + } + attrs := &engine.PayloadAttributes{ + Timestamp: newBlockTime, + Random: common.Hash{}, + SuggestedFeeRecipient: head.Coinbase, + Withdrawals: withdrawals, + } + parentBeaconBlockRoot := f.FakeBeaconBlockRoot(head.Time) // parent beacon block root + isCancun := f.eth.BlockChain().Config().IsCancun(new(big.Int).SetUint64(head.Number.Uint64()+1), newBlockTime) + if isCancun { + attrs.BeaconRoot = &parentBeaconBlockRoot + } + fcState := engine.ForkchoiceStateV1{ + HeadBlockHash: head.Hash(), + SafeBlockHash: safe.Hash(), + FinalizedBlockHash: finalized.Hash(), + } + var err error + var res engine.ForkChoiceResponse + if isCancun { + res, err = f.engineAPI.ForkchoiceUpdatedV3(fcState, attrs) + } else { + res, err = f.engineAPI.ForkchoiceUpdatedV2(fcState, attrs) + } + if err != nil { + f.log.Error("failed to start building L1 block", "err", err) + continue + } + if res.PayloadID == nil { + f.log.Error("failed to start block building", "res", res) + continue + } + // wait with sealing, if we are not behind already + delay := time.Unix(int64(newBlockTime), 0).Sub(f.clock.Now()) + tim := f.clock.NewTimer(delay) + select { + case <-tim.Ch(): + // no-op + case <-quit: + tim.Stop() + return nil + } + envelope, err := f.engineAPI.GetPayloadV3(*res.PayloadID) + if err != nil { + f.log.Error("failed to finish building L1 block", "err", err) + continue + } + + blobHashes := make([]common.Hash, 0) // must be non-nil even when empty, due to geth engine API checks + for _, commitment := range envelope.BlobsBundle.Commitments { + if len(commitment) != 48 { + f.log.Error("got malformed kzg commitment from engine", "commitment", commitment) + break + } + blobHashes = append(blobHashes, opeth.KZGToVersionedHash(*(*[48]byte)(commitment))) + } + if len(blobHashes) != len(envelope.BlobsBundle.Commitments) { + f.log.Error("invalid or incomplete blob data", "collected", len(blobHashes), "engine", len(envelope.BlobsBundle.Commitments)) + continue + } + if isCancun { + if _, err := f.engineAPI.NewPayloadV3(*envelope.ExecutionPayload, blobHashes, &parentBeaconBlockRoot); err != nil { + f.log.Error("failed to insert built L1 block", "err", err) + continue + } + } else { + if _, err := f.engineAPI.NewPayloadV2(*envelope.ExecutionPayload); err != nil { + f.log.Error("failed to insert built L1 block", "err", err) + continue + } + } + if envelope.BlobsBundle != nil { + slot := (envelope.ExecutionPayload.Timestamp - f.eth.BlockChain().Genesis().Time()) / f.blockTime + if f.beacon == nil { + f.log.Error("no blobs storage available") + continue + } + if err := f.beacon.StoreBlobsBundle(slot, envelope.BlobsBundle); err != nil { + f.log.Error("failed to persist blobs-bundle of block, not making block canonical now", "err", err) + continue + } + } + if _, err := f.engineAPI.ForkchoiceUpdatedV3(engine.ForkchoiceStateV1{ + HeadBlockHash: envelope.ExecutionPayload.BlockHash, + SafeBlockHash: safe.Hash(), + FinalizedBlockHash: finalized.Hash(), + }, nil); err != nil { + f.log.Error("failed to make built L1 block canonical", "err", err) + continue + } + // Increment global withdrawals index in the CL. + // The EL doesn't really care about the value, + // but it's nice to mock something consistent with the CL specs. + f.withdrawalsIndex += uint64(len(withdrawals)) + case <-quit: + return nil + } + } + }) + return nil +} + +func (f *fakePoS) Stop() error { + f.sub.Unsubscribe() + if advancing, ok := f.clock.(*clock.AdvancingClock); ok { + advancing.Stop() + } + return nil +} diff --git a/op-e2e2/e2eutils/geth/find.go b/op-e2e2/e2eutils/geth/find.go new file mode 100644 index 000000000000..6d86659a4c1d --- /dev/null +++ b/op-e2e2/e2eutils/geth/find.go @@ -0,0 +1,50 @@ +package geth + +import ( + "context" + "errors" + "fmt" + "math/big" + "time" + + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethclient" +) + +var ErrNotFound = errors.New("not found") + +// FindBlock finds the first block for which the predicate [pred] matches +// and returns it. It starts at [from] and iterates until [to], inclusively, +// using the provided [client]. It supports both search directions, forwards +// and backwards. +func FindBlock(client *ethclient.Client, + from, to int, timeout time.Duration, + pred func(*types.Block) (bool, error), +) (*types.Block, error) { + dir := 1 + if from > to { + dir = -1 + } + + ctx, cancel := context.WithTimeout(context.Background(), timeout) + defer cancel() + for n := from; ; n += dir { + b, err := client.BlockByNumber(ctx, big.NewInt(int64(n))) + if err != nil { + return nil, fmt.Errorf("fetching block[%d]: %w", n, err) + } + ok, err := pred(b) + if err != nil { + return nil, fmt.Errorf("predicate error[%d]: %w", n, err) + } else if ok { + return b, nil + } + + // include n in range + if n == to { + break + } + } + + return nil, ErrNotFound +} diff --git a/op-e2e2/e2eutils/geth/geth.go b/op-e2e2/e2eutils/geth/geth.go new file mode 100644 index 000000000000..fc8660acf943 --- /dev/null +++ b/op-e2e2/e2eutils/geth/geth.go @@ -0,0 +1,142 @@ +package geth + +import ( + "fmt" + "math/big" + + "github.com/ethereum-optimism/optimism/op-service/clock" + "github.com/ethereum/go-ethereum/cmd/utils" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/txpool/blobpool" + "github.com/ethereum/go-ethereum/eth" + "github.com/ethereum/go-ethereum/eth/catalyst" + "github.com/ethereum/go-ethereum/eth/ethconfig" + "github.com/ethereum/go-ethereum/eth/tracers" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/miner" + "github.com/ethereum/go-ethereum/node" + + // Force-load the tracer engines to trigger registration + _ "github.com/ethereum/go-ethereum/eth/tracers/js" + _ "github.com/ethereum/go-ethereum/eth/tracers/native" +) + +func InitL1(chainID uint64, blockTime uint64, genesis *core.Genesis, c clock.Clock, blobPoolDir string, beaconSrv Beacon, opts ...GethOption) (*node.Node, *eth.Ethereum, error) { + ethConfig := ðconfig.Config{ + NetworkId: chainID, + Genesis: genesis, + BlobPool: blobpool.Config{ + Datadir: blobPoolDir, + Datacap: blobpool.DefaultConfig.Datacap, + PriceBump: blobpool.DefaultConfig.PriceBump, + }, + } + nodeConfig := &node.Config{ + Name: "l1-geth", + HTTPHost: "127.0.0.1", + HTTPPort: 0, + WSHost: "127.0.0.1", + WSPort: 0, + WSModules: []string{"debug", "admin", "eth", "txpool", "net", "rpc", "web3", "personal", "engine"}, + HTTPModules: []string{"debug", "admin", "eth", "txpool", "net", "rpc", "web3", "personal", "engine"}, + } + + l1Node, l1Eth, err := createGethNode(false, nodeConfig, ethConfig, opts...) + if err != nil { + return nil, nil, err + } + // Activate merge + l1Eth.Merger().FinalizePoS() + + // Instead of running a whole beacon node, we run this fake-proof-of-stake sidecar that sequences L1 blocks using the Engine API. + l1Node.RegisterLifecycle(&fakePoS{ + clock: c, + eth: l1Eth, + log: log.Root(), // geth logger is global anyway. Would be nice to replace with a local logger though. + blockTime: blockTime, + // for testing purposes we make it really fast, otherwise we don't see it finalize in short tests + finalizedDistance: 8, + safeDistance: 4, + engineAPI: catalyst.NewConsensusAPI(l1Eth), + beacon: beaconSrv, + }) + + return l1Node, l1Eth, nil +} + +func defaultNodeConfig(name string, jwtPath string) *node.Config { + return &node.Config{ + Name: name, + WSHost: "127.0.0.1", + WSPort: 0, + AuthAddr: "127.0.0.1", + AuthPort: 0, + HTTPHost: "127.0.0.1", + HTTPPort: 0, + WSModules: []string{"debug", "admin", "eth", "txpool", "net", "rpc", "web3", "personal", "engine"}, + HTTPModules: []string{"debug", "admin", "eth", "txpool", "net", "rpc", "web3", "personal", "engine"}, + JWTSecret: jwtPath, + } +} + +type GethOption func(ethCfg *ethconfig.Config, nodeCfg *node.Config) error + +// InitL2 inits a L2 geth node. +func InitL2(name string, l2ChainID *big.Int, genesis *core.Genesis, jwtPath string, opts ...GethOption) (*node.Node, *eth.Ethereum, error) { + ethConfig := ðconfig.Config{ + NetworkId: l2ChainID.Uint64(), + Genesis: genesis, + Miner: miner.Config{ + Etherbase: common.Address{}, + ExtraData: nil, + GasFloor: 0, + GasCeil: 0, + GasPrice: nil, + Recommit: 0, + NewPayloadTimeout: 0, + }, + } + nodeConfig := defaultNodeConfig(fmt.Sprintf("l2-geth-%v", name), jwtPath) + return createGethNode(true, nodeConfig, ethConfig, opts...) +} + +// createGethNode creates an in-memory geth node based on the configuration. +// The private keys are added to the keystore and are unlocked. +// If the node is l2, catalyst is enabled. +// The node should be started and then closed when done. +func createGethNode(l2 bool, nodeCfg *node.Config, ethCfg *ethconfig.Config, opts ...GethOption) (*node.Node, *eth.Ethereum, error) { + for i, opt := range opts { + if err := opt(ethCfg, nodeCfg); err != nil { + return nil, nil, fmt.Errorf("failed to apply geth option %d: %w", i, err) + } + } + ethCfg.NoPruning = true // force everything to be an archive node + n, err := node.New(nodeCfg) + if err != nil { + n.Close() + return nil, nil, err + } + + backend, err := eth.New(n, ethCfg) + if err != nil { + n.Close() + return nil, nil, err + + } + + // PR 25459 changed this to only default in CLI, but not in default programmatic RPC selection. + // PR 25642 fixed it for the mobile version only... + utils.RegisterFilterAPI(n, backend.APIBackend, ethCfg) + + n.RegisterAPIs(tracers.APIs(backend.APIBackend)) + + // Enable catalyst if l2 + if l2 { + if err := catalyst.Register(n, backend); err != nil { + n.Close() + return nil, nil, err + } + } + return n, backend, nil +} diff --git a/op-e2e2/e2eutils/geth/peers.go b/op-e2e2/e2eutils/geth/peers.go new file mode 100644 index 000000000000..be64cea5cf71 --- /dev/null +++ b/op-e2e2/e2eutils/geth/peers.go @@ -0,0 +1,49 @@ +package geth + +import ( + "context" + "testing" + "time" + + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/wait" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/eth/ethconfig" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/ethereum/go-ethereum/node" + "github.com/ethereum/go-ethereum/p2p" + "github.com/stretchr/testify/require" +) + +// ConnectP2P creates a p2p peer connection between node1 and node2. +func ConnectP2P(t *testing.T, node1 *ethclient.Client, node2 *ethclient.Client) { + var targetInfo p2p.NodeInfo + require.NoError(t, node2.Client().Call(&targetInfo, "admin_nodeInfo"), "get node info") + + var peerAdded bool + require.NoError(t, node1.Client().Call(&peerAdded, "admin_addPeer", targetInfo.Enode), "add peer") + require.True(t, peerAdded, "should have added peer successfully") + + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + err := wait.For(ctx, time.Second, func() (bool, error) { + var peerCount hexutil.Uint64 + if err := node1.Client().Call(&peerCount, "net_peerCount"); err != nil { + return false, err + } + t.Logf("Peer count %v", uint64(peerCount)) + return peerCount >= hexutil.Uint64(1), nil + }) + require.NoError(t, err, "wait for a peer to be connected") +} + +func WithP2P() func(ethCfg *ethconfig.Config, nodeCfg *node.Config) error { + return func(ethCfg *ethconfig.Config, nodeCfg *node.Config) error { + ethCfg.RollupDisableTxPoolGossip = false + nodeCfg.P2P = p2p.Config{ + NoDiscovery: true, + ListenAddr: "127.0.0.1:0", + MaxPeers: 10, + } + return nil + } +} diff --git a/op-e2e2/e2eutils/geth/wait.go b/op-e2e2/e2eutils/geth/wait.go new file mode 100644 index 000000000000..823d40a52ab7 --- /dev/null +++ b/op-e2e2/e2eutils/geth/wait.go @@ -0,0 +1,144 @@ +package geth + +import ( + "context" + "errors" + "fmt" + "math/big" + "strings" + "time" + + "github.com/ethereum-optimism/optimism/op-node/rollup" + "github.com/ethereum-optimism/optimism/op-node/rollup/derive" + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/ethereum/go-ethereum/rpc" +) + +const errStrTxIdxingInProgress = "transaction indexing is in progress" + +// errTimeout represents a timeout +var errTimeout = errors.New("timeout") + +func WaitForL1OriginOnL2(rollupCfg *rollup.Config, l1BlockNum uint64, client *ethclient.Client, timeout time.Duration) (*types.Block, error) { + timeoutCh := time.After(timeout) + ctx, cancel := context.WithTimeout(context.Background(), timeout) + defer cancel() + + headChan := make(chan *types.Header, 100) + headSub, err := client.SubscribeNewHead(ctx, headChan) + if err != nil { + return nil, err + } + defer headSub.Unsubscribe() + + for { + select { + case head := <-headChan: + block, err := client.BlockByNumber(ctx, head.Number) + if err != nil { + return nil, err + } + l1Info, err := derive.L1BlockInfoFromBytes(rollupCfg, block.Time(), block.Transactions()[0].Data()) + if err != nil { + return nil, err + } + if l1Info.Number >= l1BlockNum { + return block, nil + } + + case err := <-headSub.Err(): + return nil, fmt.Errorf("error in head subscription: %w", err) + case <-timeoutCh: + return nil, errTimeout + } + } +} + +func WaitForTransaction(hash common.Hash, client *ethclient.Client, timeout time.Duration) (*types.Receipt, error) { + ticker := time.NewTicker(100 * time.Millisecond) + defer ticker.Stop() + ctx, cancel := context.WithTimeout(context.Background(), timeout) + defer cancel() + for { + receipt, err := client.TransactionReceipt(ctx, hash) + if receipt != nil && err == nil { + return receipt, nil + } else if err != nil && + !(errors.Is(err, ethereum.NotFound) || strings.Contains(err.Error(), errStrTxIdxingInProgress)) { + return nil, err + } + + select { + case <-ctx.Done(): + tip, err := client.BlockByNumber(context.Background(), nil) + if err != nil { + return nil, err + } + return nil, fmt.Errorf("receipt for transaction %s not found. tip block number is %d: %w", hash.Hex(), tip.NumberU64(), errTimeout) + case <-ticker.C: + } + } +} + +func WaitForBlock(number *big.Int, client *ethclient.Client, timeout time.Duration) (*types.Block, error) { + ctx, cancel := context.WithTimeout(context.Background(), timeout) + defer cancel() + + headChan := make(chan *types.Header, 100) + headSub, err := client.SubscribeNewHead(ctx, headChan) + if err != nil { + return nil, err + } + defer headSub.Unsubscribe() + + for { + select { + case head := <-headChan: + if head.Number.Cmp(number) >= 0 { + return client.BlockByNumber(ctx, number) + } + case err := <-headSub.Err(): + return nil, fmt.Errorf("error in head subscription: %w", err) + case <-ctx.Done(): + return nil, ctx.Err() + } + } +} + +func WaitForBlockToBeFinalized(number *big.Int, client *ethclient.Client, timeout time.Duration) (*types.Block, error) { + return waitForBlockTag(number, client, timeout, rpc.FinalizedBlockNumber) +} + +func WaitForBlockToBeSafe(number *big.Int, client *ethclient.Client, timeout time.Duration) (*types.Block, error) { + return waitForBlockTag(number, client, timeout, rpc.SafeBlockNumber) +} + +// waitForBlockTag polls for a block number to reach the specified tag & then returns that block at the number. +func waitForBlockTag(number *big.Int, client *ethclient.Client, timeout time.Duration, tag rpc.BlockNumber) (*types.Block, error) { + ctx, cancel := context.WithTimeout(context.Background(), timeout) + defer cancel() + + // Wait for it to be finalized. Poll every half second. + ticker := time.NewTicker(500 * time.Millisecond) + defer ticker.Stop() + + tagBigInt := big.NewInt(tag.Int64()) + + for { + select { + case <-ticker.C: + block, err := client.BlockByNumber(ctx, tagBigInt) + if err != nil { + return nil, err + } + if block != nil && block.NumberU64() >= number.Uint64() { + return client.BlockByNumber(ctx, number) + } + case <-ctx.Done(): + return nil, ctx.Err() + } + } +} diff --git a/op-e2e2/e2eutils/receipts/logs.go b/op-e2e2/e2eutils/receipts/logs.go new file mode 100644 index 000000000000..51f2c184aac1 --- /dev/null +++ b/op-e2e2/e2eutils/receipts/logs.go @@ -0,0 +1,25 @@ +package receipts + +import ( + "errors" + "fmt" + + "github.com/ethereum/go-ethereum/core/types" +) + +// FindLog searches the array of logs (typically retrieved from a receipt) to find one that can be parsed by the +// supplied parser (usually the Parse function from generated bindings for a contract). +// e.g. receipts.FindLog(receipt.Logs, optimismPortal.ParseTransactionDeposited) +// Either the first parsable event is returned or an error with the parse failures. +func FindLog[T any](logs []*types.Log, parser func(types.Log) (T, error)) (T, error) { + var errs error + for i, l := range logs { + parsed, err := parser(*l) + if err == nil { + return parsed, nil + } + errs = errors.Join(errs, fmt.Errorf("parse log %v: %w", i, err)) + } + var noMatch T + return noMatch, fmt.Errorf("no matching log found: %w", errs) +} diff --git a/op-e2e2/e2eutils/secrets.go b/op-e2e2/e2eutils/secrets.go new file mode 100644 index 000000000000..a4b7d0550c09 --- /dev/null +++ b/op-e2e2/e2eutils/secrets.go @@ -0,0 +1,191 @@ +package e2eutils + +import ( + "crypto/ecdsa" + "fmt" + + hdwallet "github.com/ethereum-optimism/go-ethereum-hdwallet" + "github.com/ethereum/go-ethereum/accounts" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/crypto" +) + +// DefaultMnemonicConfig is the default mnemonic used in testing. +// We prefer a mnemonic rather than direct private keys to make it easier +// to export all testing keys in external tooling for use during debugging. +// If these values are changed, it is subject to breaking tests. They +// must be in sync with the values in the DeployConfig used to create the system. +var DefaultMnemonicConfig = &MnemonicConfig{ + Mnemonic: "test test test test test test test test test test test junk", + CliqueSigner: "m/44'/60'/0'/0/0", + Proposer: "m/44'/60'/0'/0/1", + Batcher: "m/44'/60'/0'/0/2", + Deployer: "m/44'/60'/0'/0/3", + Alice: "m/44'/60'/0'/0/4", + SequencerP2P: "m/44'/60'/0'/0/5", + Bob: "m/44'/60'/0'/0/7", + Mallory: "m/44'/60'/0'/0/8", + SysCfgOwner: "m/44'/60'/0'/0/9", +} + +// MnemonicConfig configures the private keys for the hive testnet. +// It's json-serializable, so we can ship it to e.g. the hardhat script client. +type MnemonicConfig struct { + Mnemonic string + + CliqueSigner string + Deployer string + SysCfgOwner string + + // rollup actors + Proposer string + Batcher string + SequencerP2P string + + // prefunded L1/L2 accounts for testing + Alice string + Bob string + Mallory string +} + +// Secrets computes the private keys for all mnemonic paths, +// which can then be kept around for fast precomputed private key access. +func (m *MnemonicConfig) Secrets() (*Secrets, error) { + wallet, err := hdwallet.NewFromMnemonic(m.Mnemonic) + if err != nil { + return nil, fmt.Errorf("failed to create wallet: %w", err) + } + account := func(path string) accounts.Account { + return accounts.Account{URL: accounts.URL{Path: path}} + } + + deployer, err := wallet.PrivateKey(account(m.Deployer)) + if err != nil { + return nil, err + } + cliqueSigner, err := wallet.PrivateKey(account(m.CliqueSigner)) + if err != nil { + return nil, err + } + sysCfgOwner, err := wallet.PrivateKey(account(m.SysCfgOwner)) + if err != nil { + return nil, err + } + proposer, err := wallet.PrivateKey(account(m.Proposer)) + if err != nil { + return nil, err + } + batcher, err := wallet.PrivateKey(account(m.Batcher)) + if err != nil { + return nil, err + } + sequencerP2P, err := wallet.PrivateKey(account(m.SequencerP2P)) + if err != nil { + return nil, err + } + alice, err := wallet.PrivateKey(account(m.Alice)) + if err != nil { + return nil, err + } + bob, err := wallet.PrivateKey(account(m.Bob)) + if err != nil { + return nil, err + } + mallory, err := wallet.PrivateKey(account(m.Mallory)) + if err != nil { + return nil, err + } + + return &Secrets{ + Deployer: deployer, + SysCfgOwner: sysCfgOwner, + CliqueSigner: cliqueSigner, + Proposer: proposer, + Batcher: batcher, + SequencerP2P: sequencerP2P, + Alice: alice, + Bob: bob, + Mallory: mallory, + Wallet: wallet, + }, nil +} + +// Secrets bundles secp256k1 private keys for all common rollup actors for testing purposes. +type Secrets struct { + Deployer *ecdsa.PrivateKey + CliqueSigner *ecdsa.PrivateKey + SysCfgOwner *ecdsa.PrivateKey + + // rollup actors + Proposer *ecdsa.PrivateKey + Batcher *ecdsa.PrivateKey + SequencerP2P *ecdsa.PrivateKey + + // prefunded L1/L2 accounts for testing + Alice *ecdsa.PrivateKey + Bob *ecdsa.PrivateKey + Mallory *ecdsa.PrivateKey + + // Share the wallet to be able to generate more accounts + Wallet *hdwallet.Wallet +} + +// EncodePrivKey encodes the given private key in 32 bytes +func EncodePrivKey(priv *ecdsa.PrivateKey) hexutil.Bytes { + privkey := make([]byte, 32) + blob := priv.D.Bytes() + copy(privkey[32-len(blob):], blob) + return privkey +} + +func EncodePrivKeyToString(priv *ecdsa.PrivateKey) string { + return hexutil.Encode(EncodePrivKey(priv)) +} + +// Addresses computes the ethereum address of each account, +// which can then be kept around for fast precomputed address access. +func (s *Secrets) Addresses() *Addresses { + return &Addresses{ + Deployer: crypto.PubkeyToAddress(s.Deployer.PublicKey), + CliqueSigner: crypto.PubkeyToAddress(s.CliqueSigner.PublicKey), + SysCfgOwner: crypto.PubkeyToAddress(s.SysCfgOwner.PublicKey), + Proposer: crypto.PubkeyToAddress(s.Proposer.PublicKey), + Batcher: crypto.PubkeyToAddress(s.Batcher.PublicKey), + SequencerP2P: crypto.PubkeyToAddress(s.SequencerP2P.PublicKey), + Alice: crypto.PubkeyToAddress(s.Alice.PublicKey), + Bob: crypto.PubkeyToAddress(s.Bob.PublicKey), + Mallory: crypto.PubkeyToAddress(s.Mallory.PublicKey), + } +} + +// Addresses bundles the addresses for all common rollup addresses for testing purposes. +type Addresses struct { + Deployer common.Address + CliqueSigner common.Address + SysCfgOwner common.Address + + // rollup actors + Proposer common.Address + Batcher common.Address + SequencerP2P common.Address + + // prefunded L1/L2 accounts for testing + Alice common.Address + Bob common.Address + Mallory common.Address +} + +func (a *Addresses) All() []common.Address { + return []common.Address{ + a.Deployer, + a.CliqueSigner, + a.SysCfgOwner, + a.Proposer, + a.Batcher, + a.SequencerP2P, + a.Alice, + a.Bob, + a.Mallory, + } +} diff --git a/op-e2e2/e2eutils/setup.go b/op-e2e2/e2eutils/setup.go new file mode 100644 index 000000000000..4fa11a9034b6 --- /dev/null +++ b/op-e2e2/e2eutils/setup.go @@ -0,0 +1,237 @@ +package e2eutils + +import ( + "math/big" + "os" + "path" + "time" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/types" + + "github.com/stretchr/testify/require" + + "github.com/ethereum-optimism/optimism/op-chain-ops/genesis" + "github.com/ethereum-optimism/optimism/op-e2e2/config" + "github.com/ethereum-optimism/optimism/op-node/rollup" + plasma "github.com/ethereum-optimism/optimism/op-plasma" + "github.com/ethereum-optimism/optimism/op-service/eth" +) + +var testingJWTSecret = [32]byte{123} + +// WriteDefaultJWT writes a testing JWT to the temporary directory of the test and returns the path to the JWT file. +func WriteDefaultJWT(t TestingBase) string { + // Sadly the geth node config cannot load JWT secret from memory, it has to be a file + jwtPath := path.Join(t.TempDir(), "jwt_secret") + if err := os.WriteFile(jwtPath, []byte(hexutil.Encode(testingJWTSecret[:])), 0600); err != nil { + t.Fatalf("failed to prepare jwt file for geth: %v", err) + } + return jwtPath +} + +// DeployParams bundles the deployment parameters to generate further testing inputs with. +type DeployParams struct { + DeployConfig *genesis.DeployConfig + MnemonicConfig *MnemonicConfig + Secrets *Secrets + Addresses *Addresses +} + +// TestParams parametrizes the most essential rollup configuration parameters +type TestParams struct { + MaxSequencerDrift uint64 + SequencerWindowSize uint64 + ChannelTimeout uint64 + L1BlockTime uint64 + UsePlasma bool +} + +func MakeDeployParams(t require.TestingT, tp *TestParams) *DeployParams { + mnemonicCfg := DefaultMnemonicConfig + secrets, err := mnemonicCfg.Secrets() + require.NoError(t, err) + addresses := secrets.Addresses() + + deployConfig := config.DeployConfig.Copy() + deployConfig.MaxSequencerDrift = tp.MaxSequencerDrift + deployConfig.SequencerWindowSize = tp.SequencerWindowSize + deployConfig.ChannelTimeout = tp.ChannelTimeout + deployConfig.L1BlockTime = tp.L1BlockTime + deployConfig.UsePlasma = tp.UsePlasma + ApplyDeployConfigForks(deployConfig) + + require.NoError(t, deployConfig.Check()) + require.Equal(t, addresses.Batcher, deployConfig.BatchSenderAddress) + require.Equal(t, addresses.Proposer, deployConfig.L2OutputOracleProposer) + require.Equal(t, addresses.SequencerP2P, deployConfig.P2PSequencerAddress) + + return &DeployParams{ + DeployConfig: deployConfig, + MnemonicConfig: mnemonicCfg, + Secrets: secrets, + Addresses: addresses, + } +} + +// SetupData bundles the L1, L2, rollup and deployment configuration data: everything for a full test setup. +type SetupData struct { + L1Cfg *core.Genesis + L2Cfg *core.Genesis + RollupCfg *rollup.Config + ChainSpec *rollup.ChainSpec + DeploymentsL1 *genesis.L1Deployments +} + +// AllocParams defines genesis allocations to apply on top of the genesis generated by deploy parameters. +// These allocations override existing allocations per account, +// i.e. the allocations are merged with AllocParams having priority. +type AllocParams struct { + L1Alloc types.GenesisAlloc + L2Alloc types.GenesisAlloc + PrefundTestUsers bool +} + +var etherScalar = new(big.Int).Exp(big.NewInt(10), big.NewInt(18), nil) + +// Ether converts a uint64 Ether amount into a *big.Int amount in wei units, for allocating test balances. +func Ether(v uint64) *big.Int { + return new(big.Int).Mul(new(big.Int).SetUint64(v), etherScalar) +} + +// Setup computes the testing setup configurations from deployment configuration and optional allocation parameters. +func Setup(t require.TestingT, deployParams *DeployParams, alloc *AllocParams) *SetupData { + deployConf := deployParams.DeployConfig.Copy() + deployConf.L1GenesisBlockTimestamp = hexutil.Uint64(time.Now().Unix()) + require.NoError(t, deployConf.Check()) + + l1Deployments := config.L1Deployments.Copy() + require.NoError(t, l1Deployments.Check(deployConf)) + + l1Genesis, err := genesis.BuildL1DeveloperGenesis(deployConf, config.L1Allocs, l1Deployments) + require.NoError(t, err, "failed to create l1 genesis") + if alloc.PrefundTestUsers { + for _, addr := range deployParams.Addresses.All() { + l1Genesis.Alloc[addr] = types.Account{ + Balance: Ether(1e12), + } + } + } + for addr, val := range alloc.L1Alloc { + l1Genesis.Alloc[addr] = val + } + + l1Block := l1Genesis.ToBlock() + + var allocsMode genesis.L2AllocsMode + allocsMode = genesis.L2AllocsDelta + if ecotoneTime := deployConf.EcotoneTime(l1Block.Time()); ecotoneTime != nil && *ecotoneTime == 0 { + allocsMode = genesis.L2AllocsEcotone + } + l2Allocs := config.L2Allocs(allocsMode) + l2Genesis, err := genesis.BuildL2Genesis(deployConf, l2Allocs, l1Block) + require.NoError(t, err, "failed to create l2 genesis") + if alloc.PrefundTestUsers { + for _, addr := range deployParams.Addresses.All() { + l2Genesis.Alloc[addr] = types.Account{ + Balance: Ether(1e12), + } + } + } + for addr, val := range alloc.L2Alloc { + l2Genesis.Alloc[addr] = val + } + + var pcfg *rollup.PlasmaConfig + if deployConf.UsePlasma { + pcfg = &rollup.PlasmaConfig{ + DAChallengeAddress: l1Deployments.DataAvailabilityChallengeProxy, + DAChallengeWindow: deployConf.DAChallengeWindow, + DAResolveWindow: deployConf.DAResolveWindow, + CommitmentType: plasma.KeccakCommitmentString, + } + } + + rollupCfg := &rollup.Config{ + Genesis: rollup.Genesis{ + L1: eth.BlockID{ + Hash: l1Block.Hash(), + Number: 0, + }, + L2: eth.BlockID{ + Hash: l2Genesis.ToBlock().Hash(), + Number: 0, + }, + L2Time: uint64(deployConf.L1GenesisBlockTimestamp), + SystemConfig: SystemConfigFromDeployConfig(deployConf), + }, + BlockTime: deployConf.L2BlockTime, + MaxSequencerDrift: deployConf.MaxSequencerDrift, + SeqWindowSize: deployConf.SequencerWindowSize, + ChannelTimeout: deployConf.ChannelTimeout, + L1ChainID: new(big.Int).SetUint64(deployConf.L1ChainID), + L2ChainID: new(big.Int).SetUint64(deployConf.L2ChainID), + BatchInboxAddress: deployConf.BatchInboxAddress, + DepositContractAddress: deployConf.OptimismPortalProxy, + L1SystemConfigAddress: deployConf.SystemConfigProxy, + RegolithTime: deployConf.RegolithTime(uint64(deployConf.L1GenesisBlockTimestamp)), + CanyonTime: deployConf.CanyonTime(uint64(deployConf.L1GenesisBlockTimestamp)), + DeltaTime: deployConf.DeltaTime(uint64(deployConf.L1GenesisBlockTimestamp)), + EcotoneTime: deployConf.EcotoneTime(uint64(deployConf.L1GenesisBlockTimestamp)), + FjordTime: deployConf.FjordTime(uint64(deployConf.L1GenesisBlockTimestamp)), + InteropTime: deployConf.InteropTime(uint64(deployConf.L1GenesisBlockTimestamp)), + PlasmaConfig: pcfg, + } + + require.NoError(t, rollupCfg.Check()) + + // Sanity check that the config is correct + require.Equal(t, deployParams.Secrets.Addresses().Batcher, deployParams.DeployConfig.BatchSenderAddress) + require.Equal(t, deployParams.Secrets.Addresses().SequencerP2P, deployParams.DeployConfig.P2PSequencerAddress) + require.Equal(t, deployParams.Secrets.Addresses().Proposer, deployParams.DeployConfig.L2OutputOracleProposer) + + return &SetupData{ + L1Cfg: l1Genesis, + L2Cfg: l2Genesis, + RollupCfg: rollupCfg, + ChainSpec: rollup.NewChainSpec(rollupCfg), + DeploymentsL1: l1Deployments, + } +} + +func SystemConfigFromDeployConfig(deployConfig *genesis.DeployConfig) eth.SystemConfig { + return eth.SystemConfig{ + BatcherAddr: deployConfig.BatchSenderAddress, + Overhead: eth.Bytes32(common.BigToHash(new(big.Int).SetUint64(deployConfig.GasPriceOracleOverhead))), + Scalar: eth.Bytes32(deployConfig.FeeScalar()), + GasLimit: uint64(deployConfig.L2GenesisBlockGasLimit), + } +} + +func ApplyDeployConfigForks(deployConfig *genesis.DeployConfig) { + isFjord := os.Getenv("OP_E2E_USE_FJORD") == "true" + isEcotone := isFjord || os.Getenv("OP_E2E_USE_ECOTONE") == "true" + isDelta := isEcotone || os.Getenv("OP_E2E_USE_DELTA") == "true" + if isDelta { + deployConfig.L2GenesisDeltaTimeOffset = new(hexutil.Uint64) + } + if isEcotone { + deployConfig.L2GenesisEcotoneTimeOffset = new(hexutil.Uint64) + } + if isFjord { + deployConfig.L2GenesisFjordTimeOffset = new(hexutil.Uint64) + } + // Canyon and lower is activated by default + deployConfig.L2GenesisCanyonTimeOffset = new(hexutil.Uint64) + deployConfig.L2GenesisRegolithTimeOffset = new(hexutil.Uint64) +} + +func UseFPAC() bool { + return os.Getenv("OP_E2E_USE_FPAC") == "true" +} + +func UsePlasma() bool { + return os.Getenv("OP_E2E_USE_PLASMA") == "true" +} diff --git a/op-e2e2/e2eutils/setup_test.go b/op-e2e2/e2eutils/setup_test.go new file mode 100644 index 000000000000..9e446f54eb05 --- /dev/null +++ b/op-e2e2/e2eutils/setup_test.go @@ -0,0 +1,39 @@ +package e2eutils + +import ( + "encoding/hex" + "os" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/ethereum-optimism/optimism/op-e2e2/config" + "github.com/ethereum-optimism/optimism/op-service/predeploys" +) + +func TestWriteDefaultJWT(t *testing.T) { + jwtPath := WriteDefaultJWT(t) + data, err := os.ReadFile(jwtPath) + require.NoError(t, err) + require.Equal(t, "0x"+hex.EncodeToString(testingJWTSecret[:]), string(data)) +} + +func TestSetup(t *testing.T) { + tp := &TestParams{ + MaxSequencerDrift: 40, + SequencerWindowSize: 120, + ChannelTimeout: 120, + L1BlockTime: 15, + } + dp := MakeDeployParams(t, tp) + alloc := &AllocParams{PrefundTestUsers: true} + sd := Setup(t, dp, alloc) + require.Contains(t, sd.L1Cfg.Alloc, dp.Addresses.Alice) + require.Equal(t, sd.L1Cfg.Alloc[dp.Addresses.Alice].Balance, Ether(1e12)) + + require.Contains(t, sd.L2Cfg.Alloc, dp.Addresses.Alice) + require.Equal(t, sd.L2Cfg.Alloc[dp.Addresses.Alice].Balance, Ether(1e12)) + + require.Contains(t, sd.L1Cfg.Alloc, config.L1Deployments.OptimismPortalProxy) + require.Contains(t, sd.L2Cfg.Alloc, predeploys.L1BlockAddr) +} diff --git a/op-e2e2/e2eutils/testing.go b/op-e2e2/e2eutils/testing.go new file mode 100644 index 000000000000..8cd7419c0454 --- /dev/null +++ b/op-e2e2/e2eutils/testing.go @@ -0,0 +1,39 @@ +package e2eutils + +import ( + "context" + "testing" + "time" +) + +// TestingBase is an interface used for standard Go testing. +// This interface is used for unit tests, benchmarks, and fuzz tests and also emulated in Hive. +// +// The Go testing.TB interface does not allow extensions by embedding the interface, so we repeat it here. +type TestingBase interface { + Cleanup(func()) + Error(args ...any) + Errorf(format string, args ...any) + Fail() + FailNow() + Failed() bool + Fatal(args ...any) + Fatalf(format string, args ...any) + Helper() + Log(args ...any) + Logf(format string, args ...any) + Name() string + Setenv(key, value string) + Skip(args ...any) + SkipNow() + Skipf(format string, args ...any) + Skipped() bool + TempDir() string + Parallel() +} + +func TimeoutCtx(t *testing.T, timeout time.Duration) context.Context { + ctx, cancel := context.WithCancel(context.Background()) + t.Cleanup(cancel) + return ctx +} diff --git a/op-e2e2/e2eutils/transactions/blobs.go b/op-e2e2/e2eutils/transactions/blobs.go new file mode 100644 index 000000000000..980c357a1b68 --- /dev/null +++ b/op-e2e2/e2eutils/transactions/blobs.go @@ -0,0 +1,53 @@ +package transactions + +import ( + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto/kzg4844" + "github.com/holiman/uint256" +) + +var ( + emptyBlob kzg4844.Blob + emptyBlobCommit kzg4844.Commitment + emptyBlobProof kzg4844.Proof +) + +func init() { + var err error + emptyBlob = kzg4844.Blob{} + emptyBlobCommit, err = kzg4844.BlobToCommitment(emptyBlob) + if err != nil { + panic("failed to create empty blob commitment: " + err.Error()) + } + emptyBlobProof, err = kzg4844.ComputeBlobProof(emptyBlob, emptyBlobCommit) + if err != nil { + panic("failed to create empty blob proof: " + err.Error()) + } +} + +// with thanks to fjl +// https://github.com/ethereum/go-ethereum/commit/2a6beb6a39d7cb3c5906dd4465d65da6efcc73cd +func CreateEmptyBlobTx(withSidecar bool, chainID uint64) *types.BlobTx { + sidecar := &types.BlobTxSidecar{ + Blobs: []kzg4844.Blob{emptyBlob}, + Commitments: []kzg4844.Commitment{emptyBlobCommit}, + Proofs: []kzg4844.Proof{emptyBlobProof}, + } + blobTx := &types.BlobTx{ + ChainID: uint256.NewInt(chainID), + Nonce: 0, + GasTipCap: uint256.NewInt(2200000000000), + GasFeeCap: uint256.NewInt(5000000000000), + Gas: 25000, + To: common.Address{0x03, 0x04, 0x05}, + Value: uint256.NewInt(99), + Data: make([]byte, 50), + BlobFeeCap: uint256.NewInt(150000000000), + BlobHashes: sidecar.BlobHashes(), + } + if withSidecar { + blobTx.Sidecar = sidecar + } + return blobTx +} diff --git a/op-e2e2/e2eutils/transactions/gas.go b/op-e2e2/e2eutils/transactions/gas.go new file mode 100644 index 000000000000..84e13aec25a5 --- /dev/null +++ b/op-e2e2/e2eutils/transactions/gas.go @@ -0,0 +1,31 @@ +package transactions + +import ( + "fmt" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/core/types" +) + +// TxBuilder creates and sends a transaction using the supplied bind.TransactOpts. +// Returns the created transaction and any error reported. +type TxBuilder func(opts *bind.TransactOpts) (*types.Transaction, error) + +// PadGasEstimate multiplies the gas estimate for a transaction by the specified paddingFactor before sending the +// actual transaction. Useful for cases where the gas required is variable. +// The builder will be invoked twice, first with NoSend=true to estimate the gas and the second time with +// NoSend=false and GasLimit including the requested padding. +func PadGasEstimate(opts *bind.TransactOpts, paddingFactor float64, builder TxBuilder) (*types.Transaction, error) { + // Take a copy of the opts to avoid mutating the original + oCopy := *opts + o := &oCopy + o.NoSend = true + tx, err := builder(o) + if err != nil { + return nil, fmt.Errorf("failed to estimate gas: %w", err) + } + gas := float64(tx.Gas()) * paddingFactor + o.GasLimit = uint64(gas) + o.NoSend = false + return builder(o) +} diff --git a/op-e2e2/e2eutils/wait/blocks.go b/op-e2e2/e2eutils/wait/blocks.go new file mode 100644 index 000000000000..9617c71a69b3 --- /dev/null +++ b/op-e2e2/e2eutils/wait/blocks.go @@ -0,0 +1,123 @@ +package wait + +import ( + "context" + "fmt" + "math/big" + "time" + + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/rpc" + + "github.com/ethereum-optimism/optimism/op-service/eth" + "github.com/ethereum-optimism/optimism/op-service/sources" +) + +// BlockCaller is a subset of the [ethclient.Client] interface +// encompassing methods that query for block information. +type BlockCaller interface { + BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error) + BlockNumber(ctx context.Context) (uint64, error) +} + +func ForBlock(ctx context.Context, client BlockCaller, n uint64) error { + for { + select { + case <-ctx.Done(): + return ctx.Err() + default: + height, err := client.BlockNumber(ctx) + if err != nil { + return err + } + if height < n { + time.Sleep(500 * time.Millisecond) + continue + } + return nil + } + } +} + +func ForBlockWithTimestamp(ctx context.Context, client BlockCaller, target uint64) error { + _, err := AndGet(ctx, time.Second, func() (uint64, error) { + head, err := client.BlockByNumber(ctx, nil) + if err != nil { + return 0, err + } + return head.Time(), nil + }, func(actual uint64) bool { + return actual >= target + }) + return err +} + +func ForNextBlock(ctx context.Context, client BlockCaller) error { + current, err := client.BlockNumber(ctx) + // Long timeout so we don't have to care what the block time is. If the test passes this will complete early anyway. + ctx, cancel := context.WithTimeout(ctx, 60*time.Second) + defer cancel() + if err != nil { + return fmt.Errorf("get starting block number: %w", err) + } + return ForBlock(ctx, client, current+1) +} + +func ForProcessingFullBatch(ctx context.Context, rollupCl *sources.RollupClient) error { + _, err := AndGet(ctx, time.Second, func() (*eth.SyncStatus, error) { + return rollupCl.SyncStatus(ctx) + }, func(syncStatus *eth.SyncStatus) bool { + return syncStatus.PendingSafeL2 == syncStatus.SafeL2 + }) + return err +} + +func ForUnsafeBlock(ctx context.Context, rollupCl *sources.RollupClient, n uint64) error { + ctx, cancel := context.WithTimeout(ctx, 60*time.Second) + defer cancel() + + _, err := AndGet(ctx, time.Second, func() (*eth.SyncStatus, error) { + return rollupCl.SyncStatus(ctx) + }, func(syncStatus *eth.SyncStatus) bool { + return syncStatus.UnsafeL2.Number >= n + }) + return err +} + +func ForSafeBlock(ctx context.Context, rollupClient *sources.RollupClient, n uint64) error { + ctx, cancel := context.WithTimeout(ctx, 60*time.Second) + defer cancel() + _, err := AndGet(ctx, time.Second, func() (*eth.SyncStatus, error) { + return rollupClient.SyncStatus(ctx) + }, func(syncStatus *eth.SyncStatus) bool { + return syncStatus.SafeL2.Number >= n + }) + return err +} + +func ForNextSafeBlock(ctx context.Context, client BlockCaller) (*types.Block, error) { + safeBlockNumber := big.NewInt(rpc.SafeBlockNumber.Int64()) + current, err := client.BlockByNumber(ctx, safeBlockNumber) + if err != nil { + return nil, err + } + + // Long timeout so we don't have to care what the block time is. If the test passes this will complete early anyway. + ctx, cancel := context.WithTimeout(ctx, 60*time.Second) + defer cancel() + for { + select { + case <-ctx.Done(): + return nil, ctx.Err() + default: + next, err := client.BlockByNumber(ctx, safeBlockNumber) + if err != nil { + return nil, err + } + if next.NumberU64() > current.NumberU64() { + return next, nil + } + time.Sleep(500 * time.Millisecond) + } + } +} diff --git a/op-e2e2/e2eutils/wait/waits.go b/op-e2e2/e2eutils/wait/waits.go new file mode 100644 index 000000000000..c19db934fff4 --- /dev/null +++ b/op-e2e2/e2eutils/wait/waits.go @@ -0,0 +1,138 @@ +package wait + +import ( + "context" + "errors" + "fmt" + "math/big" + "os" + "strings" + "time" + + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethclient" +) + +func ForBalanceChange(ctx context.Context, client *ethclient.Client, address common.Address, initial *big.Int) (*big.Int, error) { + ctx, cancel := context.WithTimeout(ctx, 2*time.Minute) + defer cancel() + + return AndGet[*big.Int]( + ctx, + 100*time.Millisecond, + func() (*big.Int, error) { + return client.BalanceAt(ctx, address, nil) + }, + func(b *big.Int) bool { + return b.Cmp(initial) != 0 + }, + ) +} + +func ForReceiptOK(ctx context.Context, client *ethclient.Client, hash common.Hash) (*types.Receipt, error) { + return ForReceipt(ctx, client, hash, types.ReceiptStatusSuccessful) +} + +func ForReceiptFail(ctx context.Context, client *ethclient.Client, hash common.Hash) (*types.Receipt, error) { + return ForReceipt(ctx, client, hash, types.ReceiptStatusFailed) +} + +func ForReceipt(ctx context.Context, client *ethclient.Client, hash common.Hash, status uint64) (*types.Receipt, error) { + ctx, cancel := context.WithTimeout(ctx, 2*time.Minute) + defer cancel() + ticker := time.NewTicker(100 * time.Millisecond) + defer ticker.Stop() + for { + receipt, err := client.TransactionReceipt(ctx, hash) + if errors.Is(err, ethereum.NotFound) || (err != nil && strings.Contains(err.Error(), "transaction indexing is in progress")) { + select { + case <-ctx.Done(): + return nil, ctx.Err() + case <-ticker.C: + continue + } + } + if errors.Is(err, os.ErrDeadlineExceeded) { + continue + } + if err != nil { + return nil, fmt.Errorf("failed to get receipt: %w", err) + } + if receipt.Status != status { + printDebugTrace(ctx, client, hash) + return receipt, fmt.Errorf("expected status %d, but got %d", status, receipt.Status) + } + return receipt, nil + } +} + +type jsonRawString string + +func (s *jsonRawString) UnmarshalJSON(input []byte) error { + str := jsonRawString(input) + *s = str + return nil +} + +// printDebugTrace logs debug_traceTransaction output to aid in debugging unexpected receipt statuses +func printDebugTrace(ctx context.Context, client *ethclient.Client, txHash common.Hash) { + var trace jsonRawString + options := map[string]any{ + "enableReturnData": true, + "tracer": "callTracer", + "tracerConfig": map[string]any{}, + } + err := client.Client().CallContext(ctx, &trace, "debug_traceTransaction", hexutil.Bytes(txHash.Bytes()), options) + if err != nil { + fmt.Printf("TxTrace unavailable: %v\n", err) + return + } + fmt.Printf("TxTrace: %v\n", trace) +} + +func For(ctx context.Context, rate time.Duration, cb func() (bool, error)) error { + tick := time.NewTicker(rate) + defer tick.Stop() + + for { + // Perform the first check before any waiting. + done, err := cb() + if err != nil { + return err + } + if done { + return nil + } + + select { + case <-ctx.Done(): + return ctx.Err() + case <-tick.C: + // Allow loop to continue for next retry + } + } +} + +func AndGet[T interface{}](ctx context.Context, pollRate time.Duration, get func() (T, error), predicate func(T) bool) (T, error) { + tick := time.NewTicker(pollRate) + defer tick.Stop() + + var nilT T + for { + select { + case <-ctx.Done(): + return nilT, ctx.Err() + case <-tick.C: + val, err := get() + if err != nil { + return nilT, err + } + if predicate(val) { + return val, nil + } + } + } +} diff --git a/op-e2e2/e2eutils/wait/withdrawals.go b/op-e2e2/e2eutils/wait/withdrawals.go new file mode 100644 index 000000000000..b4c932177439 --- /dev/null +++ b/op-e2e2/e2eutils/wait/withdrawals.go @@ -0,0 +1,131 @@ +package wait + +import ( + "context" + "fmt" + "math/big" + "time" + + "github.com/ethereum-optimism/optimism/op-chain-ops/crossdomain" + "github.com/ethereum-optimism/optimism/op-node/bindings" + bindingspreview "github.com/ethereum-optimism/optimism/op-node/bindings/preview" + "github.com/ethereum-optimism/optimism/op-node/withdrawals" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethclient" +) + +// ForOutputRootPublished waits until there is an output published for an L2 block number larger than the supplied l2BlockNumber +// This function polls and can block for a very long time if used on mainnet. +// This returns the block number to use for proof generation. +func ForOutputRootPublished(ctx context.Context, client *ethclient.Client, l2OutputOracleAddr common.Address, l2BlockNumber *big.Int) (uint64, error) { + ctx, cancel := context.WithTimeout(ctx, 2*time.Minute) + defer cancel() + l2BlockNumber = new(big.Int).Set(l2BlockNumber) // Don't clobber caller owned l2BlockNumber + opts := &bind.CallOpts{Context: ctx} + + l2OO, err := bindings.NewL2OutputOracleCaller(l2OutputOracleAddr, client) + if err != nil { + return 0, err + } + + getL2BlockFromLatestOutput := func() (*big.Int, error) { return l2OO.LatestBlockNumber(opts) } + outputBlockNum, err := AndGet(ctx, time.Second, getL2BlockFromLatestOutput, func(latest *big.Int) bool { + return latest.Cmp(l2BlockNumber) >= 0 + }) + if err != nil { + return 0, err + } + return outputBlockNum.Uint64(), nil +} + +// ForFinalizationPeriod waits until the L1 chain has progressed far enough that l1ProvingBlockNum has completed +// the finalization period. +// This functions polls and can block for a very long time if used on mainnet. +func ForFinalizationPeriod(ctx context.Context, client *ethclient.Client, l1ProvingBlockNum *big.Int, l2OutputOracleAddr common.Address) error { + l1ProvingBlockNum = new(big.Int).Set(l1ProvingBlockNum) // Don't clobber caller owned l1ProvingBlockNum + opts := &bind.CallOpts{Context: ctx} + + // Load finalization period + l2OO, err := bindings.NewL2OutputOracleCaller(l2OutputOracleAddr, client) + if err != nil { + return fmt.Errorf("create L2OOCaller: %w", err) + } + finalizationPeriod, err := l2OO.FINALIZATIONPERIODSECONDS(opts) + if err != nil { + return fmt.Errorf("get finalization period: %w", err) + } + + provingHeader, err := client.HeaderByNumber(ctx, l1ProvingBlockNum) + if err != nil { + return fmt.Errorf("retrieve proving header: %w", err) + } + + targetTimestamp := new(big.Int).Add(new(big.Int).SetUint64(provingHeader.Time), finalizationPeriod) + targetTime := time.Unix(targetTimestamp.Int64(), 0) + // Assume clock is relatively correct + time.Sleep(time.Until(targetTime)) + // Poll for L1 Block to have a time greater than the target time + return For(ctx, time.Second, func() (bool, error) { + header, err := client.HeaderByNumber(ctx, nil) + if err != nil { + return false, fmt.Errorf("retrieve latest header: %w", err) + } + return header.Time > targetTimestamp.Uint64(), nil + }) +} + +// ForGamePublished waits until a game is published on L1 for the given l2BlockNumber. +func ForGamePublished(ctx context.Context, client *ethclient.Client, optimismPortalAddr common.Address, disputeGameFactoryAddr common.Address, l2BlockNumber *big.Int) (uint64, error) { + ctx, cancel := context.WithTimeout(ctx, 2*time.Minute) + defer cancel() + l2BlockNumber = new(big.Int).Set(l2BlockNumber) // Don't clobber caller owned l2BlockNumber + + optimismPortal2Contract, err := bindingspreview.NewOptimismPortal2Caller(optimismPortalAddr, client) + if err != nil { + return 0, err + } + + disputeGameFactoryContract, err := bindings.NewDisputeGameFactoryCaller(disputeGameFactoryAddr, client) + if err != nil { + return 0, err + } + + getL2BlockFromLatestGame := func() (*big.Int, error) { + latestGame, err := withdrawals.FindLatestGame(ctx, disputeGameFactoryContract, optimismPortal2Contract) + if err != nil { + return big.NewInt(-1), nil + } + + gameBlockNumber := new(big.Int).SetBytes(latestGame.ExtraData[0:32]) + return gameBlockNumber, nil + } + outputBlockNum, err := AndGet(ctx, time.Second, getL2BlockFromLatestGame, func(latest *big.Int) bool { + return latest.Cmp(l2BlockNumber) >= 0 + }) + if err != nil { + return 0, err + } + return outputBlockNum.Uint64(), nil +} + +// ForWithdrawalCheck waits until the withdrawal check in the portal succeeds. +func ForWithdrawalCheck(ctx context.Context, client *ethclient.Client, withdrawal crossdomain.Withdrawal, optimismPortalAddr common.Address, proofSubmitter common.Address) error { + ctx, cancel := context.WithTimeout(ctx, 2*time.Minute) + defer cancel() + opts := &bind.CallOpts{Context: ctx} + portal, err := bindingspreview.NewOptimismPortal2Caller(optimismPortalAddr, client) + if err != nil { + return fmt.Errorf("create portal caller: %w", err) + } + + return For(ctx, time.Second, func() (bool, error) { + wdHash, err := withdrawal.Hash() + if err != nil { + return false, fmt.Errorf("hash withdrawal: %w", err) + } + + err = portal.CheckWithdrawal(opts, wdHash, proofSubmitter) + return err == nil, nil + }) +} diff --git a/op-e2e2/eip4844_test.go b/op-e2e2/eip4844_test.go new file mode 100644 index 000000000000..289d3fbdf506 --- /dev/null +++ b/op-e2e2/eip4844_test.go @@ -0,0 +1,195 @@ +package op_e2e + +import ( + "context" + "math/big" + "math/rand" + "testing" + "time" + + "github.com/stretchr/testify/require" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/rpc" + + batcherFlags "github.com/ethereum-optimism/optimism/op-batcher/flags" + gethutils "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/geth" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/wait" + "github.com/ethereum-optimism/optimism/op-node/rollup/derive" + "github.com/ethereum-optimism/optimism/op-service/client" + "github.com/ethereum-optimism/optimism/op-service/eth" + "github.com/ethereum-optimism/optimism/op-service/sources" + "github.com/ethereum-optimism/optimism/op-service/testlog" + "github.com/ethereum-optimism/optimism/op-service/testutils" +) + +// TestSystem4844E2E runs the SystemE2E test with 4844 enabled on L1, +// and active on the rollup in the op-batcher and verifier. +func TestSystem4844E2E(t *testing.T) { + t.Run("single-blob", func(t *testing.T) { testSystem4844E2E(t, false) }) + t.Run("multi-blob", func(t *testing.T) { testSystem4844E2E(t, true) }) +} + +func testSystem4844E2E(t *testing.T, multiBlob bool) { + InitParallel(t) + + cfg := DefaultSystemConfig(t) + cfg.DataAvailabilityType = batcherFlags.BlobsType + const maxBlobs = 6 + var maxL1TxSize int + if multiBlob { + cfg.BatcherTargetNumFrames = 6 + cfg.BatcherUseMaxTxSizeForBlobs = true + // leads to 6 blobs for an L2 block with a user tx with 400 random bytes + // while all other L2 blocks take 1 blob (deposit tx) + maxL1TxSize = derive.FrameV0OverHeadSize + 100 + cfg.BatcherMaxL1TxSizeBytes = uint64(maxL1TxSize) + } + + genesisActivation := hexutil.Uint64(0) + cfg.DeployConfig.L1CancunTimeOffset = &genesisActivation + cfg.DeployConfig.L2GenesisDeltaTimeOffset = &genesisActivation + cfg.DeployConfig.L2GenesisEcotoneTimeOffset = &genesisActivation + + sys, err := cfg.Start(t) + require.Nil(t, err, "Error starting up system") + defer sys.Close() + + log := testlog.Logger(t, log.LevelInfo) + log.Info("genesis", "l2", sys.RollupConfig.Genesis.L2, "l1", sys.RollupConfig.Genesis.L1, "l2_time", sys.RollupConfig.Genesis.L2Time) + + l1Client := sys.Clients["l1"] + l2Seq := sys.Clients["sequencer"] + l2Verif := sys.Clients["verifier"] + + // Transactor Account + ethPrivKey := cfg.Secrets.Alice + + // Send Transaction & wait for success + fromAddr := cfg.Secrets.Addresses().Alice + log.Info("alice", "addr", fromAddr) + + ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) + defer cancel() + startBalance, err := l2Verif.BalanceAt(ctx, fromAddr, nil) + require.NoError(t, err) + + // Send deposit transaction + opts, err := bind.NewKeyedTransactorWithChainID(ethPrivKey, cfg.L1ChainIDBig()) + require.NoError(t, err) + mintAmount := big.NewInt(1_000_000_000_000) + opts.Value = mintAmount + SendDepositTx(t, cfg, l1Client, l2Verif, opts, func(l2Opts *DepositTxOpts) {}) + + // Confirm balance + ctx, cancel = context.WithTimeout(context.Background(), 15*time.Second) + defer cancel() + endBalance, err := wait.ForBalanceChange(ctx, l2Verif, fromAddr, startBalance) + require.NoError(t, err) + + diff := new(big.Int).Sub(endBalance, startBalance) + require.Equal(t, mintAmount, diff, "Did not get expected balance change") + + // Submit TX to L2 sequencer node + receipt := SendL2Tx(t, cfg, l2Seq, ethPrivKey, func(opts *TxOpts) { + opts.Value = big.NewInt(1_000_000_000) + opts.Nonce = 1 // Already have deposit + opts.ToAddr = &common.Address{0xff, 0xff} + // put some random data in the tx to make it fill up 6 blobs (multi-blob case) + opts.Data = testutils.RandomData(rand.New(rand.NewSource(420)), 400) + opts.Gas, err = core.IntrinsicGas(opts.Data, nil, false, true, true, false) + require.NoError(t, err) + opts.VerifyOnClients(l2Verif) + }) + + // Verify blocks match after batch submission on verifiers and sequencers + verifBlock, err := l2Verif.BlockByNumber(context.Background(), receipt.BlockNumber) + require.NoError(t, err) + require.Equal(t, verifBlock.Hash(), receipt.BlockHash, "must be same block") + seqBlock, err := l2Seq.BlockByNumber(context.Background(), receipt.BlockNumber) + require.NoError(t, err) + require.Equal(t, seqBlock.Hash(), receipt.BlockHash, "must be same block") + require.Equal(t, verifBlock.NumberU64(), seqBlock.NumberU64(), "Verifier and sequencer blocks not the same after including a batch tx") + require.Equal(t, verifBlock.ParentHash(), seqBlock.ParentHash(), "Verifier and sequencer blocks parent hashes not the same after including a batch tx") + require.Equal(t, verifBlock.Hash(), seqBlock.Hash(), "Verifier and sequencer blocks not the same after including a batch tx") + + rollupRPCClient, err := rpc.DialContext(context.Background(), sys.RollupNodes["sequencer"].HTTPEndpoint()) + require.NoError(t, err) + rollupClient := sources.NewRollupClient(client.NewBaseRPCClient(rollupRPCClient)) + // basic check that sync status works + seqStatus, err := rollupClient.SyncStatus(context.Background()) + require.NoError(t, err) + require.LessOrEqual(t, seqBlock.NumberU64(), seqStatus.UnsafeL2.Number) + // basic check that version endpoint works + seqVersion, err := rollupClient.Version(context.Background()) + require.NoError(t, err) + require.NotEqual(t, "", seqVersion) + + // quick check that the batch submitter works + require.Eventually(t, func() bool { + // wait for chain to be marked as "safe" (i.e. confirm batch-submission works) + stat, err := rollupClient.SyncStatus(context.Background()) + require.NoError(t, err) + return stat.SafeL2.Number >= receipt.BlockNumber.Uint64() + }, time.Second*20, time.Second, "expected L2 to be batch-submitted and labeled as safe") + + // check that the L2 tx is still canonical + seqBlock, err = l2Seq.BlockByNumber(context.Background(), receipt.BlockNumber) + require.NoError(t, err) + require.Equal(t, seqBlock.Hash(), receipt.BlockHash, "receipt block must match canonical block at tx inclusion height") + + // find L1 block that contained the blob(s) batch tx + tip, err := l1Client.HeaderByNumber(context.Background(), nil) + require.NoError(t, err) + var blobTx *types.Transaction + blobBlock, err := gethutils.FindBlock(l1Client, int(tip.Number.Int64()), 0, 5*time.Second, + func(b *types.Block) (bool, error) { + for _, tx := range b.Transactions() { + if tx.Type() != types.BlobTxType { + continue + } + // expect to find at least one tx with multiple blobs in multi-blob case + if !multiBlob || len(tx.BlobHashes()) > 1 { + blobTx = tx + return true, nil + } + } + return false, nil + }) + require.NoError(t, err) + + numBlobs := len(blobTx.BlobHashes()) + if !multiBlob { + require.NotZero(t, numBlobs, "single-blob: expected to find L1 blob tx") + } else { + require.Equal(t, maxBlobs, numBlobs, "multi-blob: expected to find L1 blob tx with 6 blobs") + // blob tx should have filled up all but last blob + bcl := sys.L1BeaconHTTPClient() + hashes := toIndexedBlobHashes(blobTx.BlobHashes()...) + sidecars, err := bcl.BeaconBlobSideCars(context.Background(), false, sys.L1Slot(blobBlock.Time()), hashes) + require.NoError(t, err) + require.Len(t, sidecars.Data, maxBlobs) + for i := 0; i < maxBlobs-1; i++ { + data, err := sidecars.Data[i].Blob.ToData() + require.NoError(t, err) + require.Len(t, data, maxL1TxSize) + } + // last blob should only be partially filled + data, err := sidecars.Data[maxBlobs-1].Blob.ToData() + require.NoError(t, err) + require.Less(t, len(data), maxL1TxSize) + } +} + +func toIndexedBlobHashes(hs ...common.Hash) []eth.IndexedBlobHash { + hashes := make([]eth.IndexedBlobHash, 0, len(hs)) + for i, hash := range hs { + hashes = append(hashes, eth.IndexedBlobHash{Index: uint64(i), Hash: hash}) + } + return hashes +} diff --git a/op-e2e2/external.go b/op-e2e2/external.go new file mode 100644 index 000000000000..54ca9b6d5a80 --- /dev/null +++ b/op-e2e2/external.go @@ -0,0 +1,148 @@ +package op_e2e + +import ( + "encoding/json" + "errors" + "math/big" + "os" + "os/exec" + "path/filepath" + "testing" + "time" + + "github.com/ethereum-optimism/optimism/op-e2e2/config" + "github.com/ethereum-optimism/optimism/op-e2e2/external" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/params" + "github.com/onsi/gomega/gexec" + "github.com/stretchr/testify/require" +) + +type ExternalRunner struct { + Name string + BinPath string + Genesis *core.Genesis + JWTPath string + // 4844: a datadir specifically for tx-pool blobs + BlobPoolPath string +} + +type ExternalEthClient struct { + Session *gexec.Session + Endpoints external.Endpoints +} + +func (eec *ExternalEthClient) HTTPEndpoint() string { + return eec.Endpoints.HTTPEndpoint +} + +func (eec *ExternalEthClient) WSEndpoint() string { + return eec.Endpoints.WSEndpoint +} + +func (eec *ExternalEthClient) HTTPAuthEndpoint() string { + return eec.Endpoints.HTTPAuthEndpoint +} + +func (eec *ExternalEthClient) WSAuthEndpoint() string { + return eec.Endpoints.WSAuthEndpoint +} + +func (eec *ExternalEthClient) Close() error { + eec.Session.Terminate() + select { + case <-time.After(5 * time.Second): + eec.Session.Kill() + select { + case <-time.After(30 * time.Second): + return errors.New("external client failed to terminate") + case <-eec.Session.Exited: + } + case <-eec.Session.Exited: + } + return nil +} + +func (er *ExternalRunner) Run(t testing.TB) *ExternalEthClient { + if er.BinPath == "" { + t.Error("no external bin path set") + } + + if er.JWTPath == "" { + er.JWTPath = writeDefaultJWT(t) + } + + if er.Genesis == nil { + er.Genesis = &core.Genesis{ + Alloc: types.GenesisAlloc{ + common.Address{1}: types.Account{Balance: big.NewInt(1)}, + }, + Config: params.OptimismTestConfig, + Difficulty: big.NewInt(0), + } + } + + workDir := t.TempDir() + + config := external.Config{ + DataDir: filepath.Join(workDir, "datadir"), + JWTPath: er.JWTPath, + ChainID: er.Genesis.Config.ChainID.Uint64(), + GenesisPath: filepath.Join(workDir, "genesis.json"), + EndpointsReadyPath: filepath.Join(workDir, "endpoints.json"), + Verbosity: uint64(config.EthNodeVerbosity), + } + + err := os.Mkdir(config.DataDir, 0o700) + require.NoError(t, err) + + genesisFile, err := os.Create(config.GenesisPath) + require.NoError(t, err) + err = json.NewEncoder(genesisFile).Encode(er.Genesis) + require.NoError(t, err) + + configPath := filepath.Join(workDir, "config.json") + configFile, err := os.Create(configPath) + require.NoError(t, err) + err = json.NewEncoder(configFile).Encode(config) + require.NoError(t, err) + + cmd := exec.Command(er.BinPath, "--config", configPath) + cmd.Dir = filepath.Dir(er.BinPath) + sess, err := gexec.Start( + cmd, + gexec.NewPrefixedWriter("[extout:"+er.Name+"]", os.Stdout), + gexec.NewPrefixedWriter("[exterr:"+er.Name+"]", os.Stderr), + ) + require.NoError(t, err) + + // 2 minutes may seem like a long timeout, and, it definitely is. That + // being said, when running these tests with high parallelism turned on, the + // node startup time can be substantial (remember, this usually is a + // multi-step process initializing the database and then starting the + // client). + require.Eventually( + t, + func() bool { + _, err := os.Stat(config.EndpointsReadyPath) + return err == nil + }, + 2*time.Minute, + 10*time.Millisecond, + "external runner did not create ready file at %s within timeout", + config.EndpointsReadyPath, + ) + + readyFile, err := os.Open(config.EndpointsReadyPath) + require.NoError(t, err) + var endpoints external.Endpoints + err = json.NewDecoder(readyFile).Decode(&endpoints) + require.NoError(t, err) + + return &ExternalEthClient{ + Session: sess, + Endpoints: endpoints, + } +} diff --git a/op-e2e2/external/config.go b/op-e2e2/external/config.go new file mode 100644 index 000000000000..943abe6346f9 --- /dev/null +++ b/op-e2e2/external/config.go @@ -0,0 +1,69 @@ +package external + +import ( + "bytes" + "encoding/json" + "os" + "strings" + "testing" +) + +type Config struct { + DataDir string `json:"data_dir"` + JWTPath string `json:"jwt_path"` + ChainID uint64 `json:"chain_id"` + GasCeil uint64 `json:"gas_ceil"` + GenesisPath string `json:"genesis_path"` + Verbosity uint64 `json:"verbosity"` + + // EndpointsReadyPath is the location to write the endpoint configuration file. + // Note, this should be written atomically by writing the JSON, then moving + // it to this path to avoid races. A helper AtomicEncode is provided for + // golang clients. + EndpointsReadyPath string `json:"endpoints_ready_path"` +} + +// AtomicEncode json encodes val to path+".atomic" then moves the path+".atomic" +// file to path +func AtomicEncode(path string, val any) error { + atomicPath := path + ".atomic" + atomicFile, err := os.Create(atomicPath) + if err != nil { + return err + } + defer atomicFile.Close() + if err = json.NewEncoder(atomicFile).Encode(val); err != nil { + return err + } + return os.Rename(atomicPath, path) +} + +type Endpoints struct { + HTTPEndpoint string `json:"http_endpoint"` + WSEndpoint string `json:"ws_endpoint"` + HTTPAuthEndpoint string `json:"http_auth_endpoint"` + WSAuthEndpoint string `json:"ws_auth_endpoint"` +} + +type TestParms struct { + // SkipTests is a map from test name to skip message. The skip message may + // be arbitrary, but the test name should match the skipped test (either + // base, or a sub-test) exactly. Precisely, the skip name must match rune for + // rune starting with the first rune. If the skip name does not match all + // runes, the first mismatched rune must be a '/'. + SkipTests map[string]string `json:"skip_tests"` +} + +func (tp TestParms) SkipIfNecessary(t testing.TB) { + if len(tp.SkipTests) == 0 { + return + } + var base bytes.Buffer + for _, name := range strings.Split(t.Name(), "/") { + base.WriteString(name) + if msg, ok := tp.SkipTests[base.String()]; ok { + t.Skip(msg) + } + base.WriteRune('/') + } +} diff --git a/op-e2e2/external_geth/.gitignore b/op-e2e2/external_geth/.gitignore new file mode 100644 index 000000000000..f034fb8a9e82 --- /dev/null +++ b/op-e2e2/external_geth/.gitignore @@ -0,0 +1 @@ +op-geth diff --git a/op-e2e2/external_geth/Makefile b/op-e2e2/external_geth/Makefile new file mode 100644 index 000000000000..f0dd9130282d --- /dev/null +++ b/op-e2e2/external_geth/Makefile @@ -0,0 +1,8 @@ +default: shim op-geth + +op-geth: + go build -o op-geth "github.com/ethereum/go-ethereum/cmd/geth" +.PHONY: op-geth + +shim: main.go + go build -o shim . diff --git a/op-e2e2/external_geth/README.md b/op-e2e2/external_geth/README.md new file mode 100644 index 000000000000..7438fb037f3b --- /dev/null +++ b/op-e2e2/external_geth/README.md @@ -0,0 +1,65 @@ +# external_geth shim + +This shim is an example of how to write an adapter for an external ethereum +client to allow for its use in the op-e2e tests. + +## Invocation + +Generally speaking, you can utilize this shim by simply executing: + +``` +make test-external-geth +``` + +The `Makefile` is structured such that if you duplicate this directory and +tweak this code, you may simply execute: + +``` +make test-external- +``` + +and the execution should happen as well. + +*NOTE:* Attempting to iterate for development requires explicit rebuilding of +the binary being shimmed. Most likely to accomplish this, you may want to add +initialization code to the TestMain of the e2e to build your binary, or use +some other technique like custom build scripts or IDE integrations which cause +the binary to be rebuilt before executing the tests. + +## Arguments + +*--config * The config path is a required argument, it points to a JSON +file that contains details of the L2 environment to bring up (including the +`genesis.json` path, the chain ID, the JWT path, and a ready file path). See +the data structures in `op-e2e/external/config.go` for more details. + +## Operation + +This shim will first execute a process to initialize the op-geth database. +Then, it will start the op-geth process itself. It watches the output of the +process and looks for the lines indicating that the HTTP server and Auth HTTP +server have started up. It then reads the ports which were allocated (because +the requested ports were passed in as ephemeral via the CLI arguments). + +## Skipping tests + +Although ideally, all tests would be structured such that they may execute +either with an in-process op-geth or with an extra-process ethereum client, +this is not always the case. You may optionally create a `test_parms.json` +file in the `external_` directory, as there is in the +`external_geth` directory which specifies a map of tests to skip, and +accompanying skip text. See the `op-e2e/external/config.go` file for more +details. + +## Generalization + +This shim is included to help document and demonstrates the usage of the +external ethereum process e2e test execution. It is configured to execute in +CI to help ensure that the tests remain compatible with external clients. + +To create your own external test client, these files can likely be used as a +starting point, changing the arguments, log scraping, and other details. Or, +depending on the client and your preference, any binary which is capable of +reading and writing the necessary JSON files should be sufficient (though +will be required to replicate some of the parsing and other logic encapsulated +here). diff --git a/op-e2e2/external_geth/main.go b/op-e2e2/external_geth/main.go new file mode 100644 index 000000000000..57dd48738a5f --- /dev/null +++ b/op-e2e2/external_geth/main.go @@ -0,0 +1,199 @@ +package main + +import ( + "encoding/json" + "errors" + "flag" + "fmt" + "os" + "os/exec" + "os/signal" + "path/filepath" + "strconv" + "syscall" + "time" + + "github.com/ethereum-optimism/optimism/op-e2e2/external" + "github.com/onsi/gomega/gbytes" + "github.com/onsi/gomega/gexec" +) + +func main() { + var configPath string + flag.StringVar(&configPath, "config", "", "Execute based on the config in this file") + flag.Parse() + if err := run(configPath); err != nil { + fmt.Println(err.Error()) + os.Exit(1) + } + os.Exit(0) +} + +func run(configPath string) error { + if configPath == "" { + return fmt.Errorf("must supply a '--config ' flag") + } + + configFile, err := os.Open(configPath) + if err != nil { + return fmt.Errorf("could not open config: %w", err) + } + + var config external.Config + if err := json.NewDecoder(configFile).Decode(&config); err != nil { + return fmt.Errorf("could not decode config file: %w", err) + } + + binPath, err := filepath.Abs("op-geth") + if err != nil { + return fmt.Errorf("could not get absolute path of op-geth") + } + if _, err := os.Stat(binPath); err != nil { + return fmt.Errorf("could not locate op-geth in working directory, did you forget to run '--init'?") + } + + fmt.Printf("================== op-geth shim initializing chain config ==========================\n") + if err := initialize(binPath, config); err != nil { + return fmt.Errorf("could not initialize datadir: %s %w", binPath, err) + } + + fmt.Printf("================== op-geth shim executing op-geth ==========================\n") + sess, err := execute(binPath, config) + if err != nil { + return fmt.Errorf("could not execute geth: %w", err) + } + defer sess.Close() + + fmt.Printf("================== op-geth shim encoding ready-file ==========================\n") + if err := external.AtomicEncode(config.EndpointsReadyPath, sess.endpoints); err != nil { + return fmt.Errorf("could not encode endpoints") + } + + fmt.Printf("================== op-geth shim awaiting termination ==========================\n") + + sigs := make(chan os.Signal, 1) + signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM) + + select { + case <-sigs: + fmt.Printf("================== op-geth shim caught signal, killing ==========================\n") + sess.session.Terminate() + return awaitExit(sess.session) + case <-sess.session.Exited: + return fmt.Errorf("geth exited with code %d", sess.session.ExitCode()) + case <-time.After(30 * time.Minute): + fmt.Printf("================== op-geth shim timed out, killing ==========================\n") + sess.session.Terminate() + if err := awaitExit(sess.session); err != nil { + fmt.Printf("error killing geth: %v\n", err) + } + return errors.New("geth timed out after 30 minutes") + } +} + +func awaitExit(sess *gexec.Session) error { + select { + case <-sess.Exited: + return nil + case <-time.After(5 * time.Second): + sess.Kill() + select { + case <-sess.Exited: + return nil + case <-time.After(30 * time.Second): + return fmt.Errorf("exiting after 30 second timeout") + } + } +} + +func initialize(binPath string, config external.Config) error { + cmd := exec.Command( + binPath, + "--datadir", config.DataDir, + "init", config.GenesisPath, + ) + return cmd.Run() +} + +type gethSession struct { + session *gexec.Session + endpoints *external.Endpoints +} + +func (es *gethSession) Close() { + es.session.Terminate() + select { + case <-time.After(5 * time.Second): + es.session.Kill() + case <-es.session.Exited: + } +} + +func execute(binPath string, config external.Config) (*gethSession, error) { + if config.Verbosity < 2 { + return nil, fmt.Errorf("a minimum configured verbosity of 2 is required") + } + cmd := exec.Command( + binPath, + "--datadir", config.DataDir, + "--http", + "--http.addr", "127.0.0.1", + "--http.port", "0", + "--http.api", "web3,debug,eth,txpool,net,engine", + "--ws", + "--ws.addr", "127.0.0.1", + "--ws.port", "0", + "--ws.api", "debug,eth,txpool,net,engine", + "--syncmode=full", + "--nodiscover", + "--port", "0", + "--maxpeers", "0", + "--networkid", strconv.FormatUint(config.ChainID, 10), + "--authrpc.addr", "127.0.0.1", + "--authrpc.port", "0", + "--authrpc.jwtsecret", config.JWTPath, + "--gcmode=archive", + "--verbosity", strconv.FormatUint(config.Verbosity, 10), + ) + sess, err := gexec.Start(cmd, os.Stdout, os.Stderr) + if err != nil { + return nil, fmt.Errorf("could not start op-geth session: %w", err) + } + matcher := gbytes.Say("HTTP server started\\s*endpoint=127.0.0.1:") + var enginePort, httpPort int + for enginePort == 0 || httpPort == 0 { + match, err := matcher.Match(sess.Err) + if err != nil { + return nil, fmt.Errorf("could not execute matcher") + } + if !match { + if sess.Err.Closed() { + return nil, fmt.Errorf("op-geth exited before announcing http ports") + } + // Wait for a bit more output, then try again + time.Sleep(10 * time.Millisecond) + continue + } + var authString string + var port int + fmt.Fscanf(sess.Err, "%d %s", &port, &authString) + switch authString { + case "auth=true": + enginePort = port + case "auth=false": + httpPort = port + default: + return nil, fmt.Errorf("unexpected auth string %q", authString) + } + } + + return &gethSession{ + session: sess, + endpoints: &external.Endpoints{ + HTTPEndpoint: fmt.Sprintf("http://127.0.0.1:%d/", httpPort), + WSEndpoint: fmt.Sprintf("ws://127.0.0.1:%d/", httpPort), + HTTPAuthEndpoint: fmt.Sprintf("http://127.0.0.1:%d/", enginePort), + WSAuthEndpoint: fmt.Sprintf("ws://127.0.0.1:%d/", enginePort), + }, + }, nil +} diff --git a/op-e2e2/external_geth/main_test.go b/op-e2e2/external_geth/main_test.go new file mode 100644 index 000000000000..4c6d387f163c --- /dev/null +++ b/op-e2e2/external_geth/main_test.go @@ -0,0 +1,55 @@ +package main + +import ( + "net" + "net/url" + "os" + "os/exec" + "path/filepath" + "testing" + "time" + + e2e "github.com/ethereum-optimism/optimism/op-e2e2" + "github.com/ethereum-optimism/optimism/op-e2e2/config" + "github.com/stretchr/testify/require" +) + +func TestShim(t *testing.T) { + shimPath, err := filepath.Abs("shim") + require.NoError(t, err) + cmd := exec.Command("go", "build", "-o", shimPath, ".") + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + err = cmd.Run() + require.NoError(t, err) + require.FileExists(t, "shim") + + opGethPath, err := filepath.Abs("op-geth") + require.NoError(t, err) + cmd = exec.Command("go", "build", "-o", opGethPath, "github.com/ethereum/go-ethereum/cmd/geth") + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + err = cmd.Run() + require.NoError(t, err) + require.FileExists(t, "op-geth") + + config.EthNodeVerbosity = config.LegacyLevelDebug + + ec := (&e2e.ExternalRunner{ + Name: "TestShim", + BinPath: shimPath, + }).Run(t) + t.Cleanup(func() { _ = ec.Close() }) + + for _, endpoint := range []string{ + ec.HTTPEndpoint(), + ec.HTTPAuthEndpoint(), + ec.WSEndpoint(), + ec.WSAuthEndpoint(), + } { + plainURL, err := url.ParseRequestURI(endpoint) + require.NoError(t, err) + _, err = net.DialTimeout("tcp", plainURL.Host, time.Second) + require.NoError(t, err, "could not connect to HTTP port") + } +} diff --git a/op-e2e2/external_geth/test_parms.json b/op-e2e2/external_geth/test_parms.json new file mode 100644 index 000000000000..c00d8722658e --- /dev/null +++ b/op-e2e2/external_geth/test_parms.json @@ -0,0 +1,5 @@ +{ + "skip_tests":{ + "TestPendingGasLimit":"This test requires directly modifying go structures and cannot be implemented with flags" + } +} diff --git a/op-e2e2/external_geth/tools.go b/op-e2e2/external_geth/tools.go new file mode 100644 index 000000000000..b78b4dd4a469 --- /dev/null +++ b/op-e2e2/external_geth/tools.go @@ -0,0 +1,5 @@ +//go:build tools + +package main + +import _ "github.com/ethereum/go-ethereum/cmd/geth" diff --git a/op-e2e2/fastlz/fastlz.c b/op-e2e2/fastlz/fastlz.c new file mode 100644 index 000000000000..c8c0fa4faefb --- /dev/null +++ b/op-e2e2/fastlz/fastlz.c @@ -0,0 +1,511 @@ +/* + FastLZ - Byte-aligned LZ77 compression library + Copyright (C) 2005-2020 Ariya Hidayat + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + + This implementation is taken from the following repository/commit: + https://github.com/ariya/FastLZ/tree/344eb4025f9ae866ebf7a2ec48850f7113a97a42 +*/ + +#include "fastlz.h" + +#include + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" + +/* + * Give hints to the compiler for branch prediction optimization. + */ +#if defined(__clang__) || (defined(__GNUC__) && (__GNUC__ > 2)) +#define FASTLZ_LIKELY(c) (__builtin_expect(!!(c), 1)) +#define FASTLZ_UNLIKELY(c) (__builtin_expect(!!(c), 0)) +#else +#define FASTLZ_LIKELY(c) (c) +#define FASTLZ_UNLIKELY(c) (c) +#endif + +/* + * Specialize custom 64-bit implementation for speed improvements. + */ +#if defined(__x86_64__) || defined(_M_X64) || defined(__aarch64__) +#define FLZ_ARCH64 +#endif + +/* + * Workaround for DJGPP to find uint8_t, uint16_t, etc. + */ +#if defined(__MSDOS__) && defined(__GNUC__) +#include +#endif + +#if defined(FASTLZ_USE_MEMMOVE) && (FASTLZ_USE_MEMMOVE == 0) + +static void fastlz_memmove(uint8_t* dest, const uint8_t* src, uint32_t count) { + do { + *dest++ = *src++; + } while (--count); +} + +static void fastlz_memcpy(uint8_t* dest, const uint8_t* src, uint32_t count) { + return fastlz_memmove(dest, src, count); +} + +#else + +#include + +static void fastlz_memmove(uint8_t* dest, const uint8_t* src, uint32_t count) { + if ((count > 4) && (dest >= src + count)) { + memmove(dest, src, count); + } else { + switch (count) { + default: + do { + *dest++ = *src++; + } while (--count); + break; + case 3: + *dest++ = *src++; + case 2: + *dest++ = *src++; + case 1: + *dest++ = *src++; + case 0: + break; + } + } +} + +static void fastlz_memcpy(uint8_t* dest, const uint8_t* src, uint32_t count) { memcpy(dest, src, count); } + +#endif + +#if defined(FLZ_ARCH64) + +static uint32_t flz_readu32(const void* ptr) { return *(const uint32_t*)ptr; } + +static uint32_t flz_cmp(const uint8_t* p, const uint8_t* q, const uint8_t* r) { + const uint8_t* start = p; + + if (flz_readu32(p) == flz_readu32(q)) { + p += 4; + q += 4; + } + while (q < r) + if (*p++ != *q++) break; + return p - start; +} + +#endif /* FLZ_ARCH64 */ + +#if !defined(FLZ_ARCH64) + +static uint32_t flz_readu32(const void* ptr) { + const uint8_t* p = (const uint8_t*)ptr; + return (p[3] << 24) | (p[2] << 16) | (p[1] << 8) | p[0]; +} + +static uint32_t flz_cmp(const uint8_t* p, const uint8_t* q, const uint8_t* r) { + const uint8_t* start = p; + while (q < r) + if (*p++ != *q++) break; + return p - start; +} + +#endif /* !FLZ_ARCH64 */ + +#define MAX_COPY 32 +#define MAX_LEN 264 /* 256 + 8 */ +#define MAX_L1_DISTANCE 8192 +#define MAX_L2_DISTANCE 8191 +#define MAX_FARDISTANCE (65535 + MAX_L2_DISTANCE - 1) + +#define HASH_LOG 13 +#define HASH_SIZE (1 << HASH_LOG) +#define HASH_MASK (HASH_SIZE - 1) + +static uint16_t flz_hash(uint32_t v) { + uint32_t h = (v * 2654435769LL) >> (32 - HASH_LOG); + return h & HASH_MASK; +} + +/* special case of memcpy: at most MAX_COPY bytes */ +static void flz_smallcopy(uint8_t* dest, const uint8_t* src, uint32_t count) { +#if defined(FLZ_ARCH64) + if (count >= 4) { + const uint32_t* p = (const uint32_t*)src; + uint32_t* q = (uint32_t*)dest; + while (count > 4) { + *q++ = *p++; + count -= 4; + dest += 4; + src += 4; + } + } +#endif + fastlz_memcpy(dest, src, count); +} + +/* special case of memcpy: exactly MAX_COPY bytes */ +static void flz_maxcopy(void* dest, const void* src) { +#if defined(FLZ_ARCH64) + const uint32_t* p = (const uint32_t*)src; + uint32_t* q = (uint32_t*)dest; + *q++ = *p++; + *q++ = *p++; + *q++ = *p++; + *q++ = *p++; + *q++ = *p++; + *q++ = *p++; + *q++ = *p++; + *q++ = *p++; +#else + fastlz_memcpy(dest, src, MAX_COPY); +#endif +} + +static uint8_t* flz_literals(uint32_t runs, const uint8_t* src, uint8_t* dest) { + while (runs >= MAX_COPY) { + *dest++ = MAX_COPY - 1; + flz_maxcopy(dest, src); + src += MAX_COPY; + dest += MAX_COPY; + runs -= MAX_COPY; + } + if (runs > 0) { + *dest++ = runs - 1; + flz_smallcopy(dest, src, runs); + dest += runs; + } + return dest; +} + +static uint8_t* flz1_match(uint32_t len, uint32_t distance, uint8_t* op) { + --distance; + if (FASTLZ_UNLIKELY(len > MAX_LEN - 2)) + while (len > MAX_LEN - 2) { + *op++ = (7 << 5) + (distance >> 8); + *op++ = MAX_LEN - 2 - 7 - 2; + *op++ = (distance & 255); + len -= MAX_LEN - 2; + } + if (len < 7) { + *op++ = (len << 5) + (distance >> 8); + *op++ = (distance & 255); + } else { + *op++ = (7 << 5) + (distance >> 8); + *op++ = len - 7; + *op++ = (distance & 255); + } + return op; +} + +#define FASTLZ_BOUND_CHECK(cond) \ + if (FASTLZ_UNLIKELY(!(cond))) return 0; + +int fastlz1_compress(const void* input, int length, void* output) { + const uint8_t* ip = (const uint8_t*)input; + const uint8_t* ip_start = ip; + const uint8_t* ip_bound = ip + length - 4; /* because readU32 */ + const uint8_t* ip_limit = ip + length - 12 - 1; + uint8_t* op = (uint8_t*)output; + + uint32_t htab[HASH_SIZE]; + uint32_t seq, hash; + + /* initializes hash table */ + for (hash = 0; hash < HASH_SIZE; ++hash) htab[hash] = 0; + + /* we start with literal copy */ + const uint8_t* anchor = ip; + ip += 2; + + /* main loop */ + while (FASTLZ_LIKELY(ip < ip_limit)) { + const uint8_t* ref; + uint32_t distance, cmp; + + /* find potential match */ + do { + seq = flz_readu32(ip) & 0xffffff; + hash = flz_hash(seq); + ref = ip_start + htab[hash]; + htab[hash] = ip - ip_start; + distance = ip - ref; + cmp = FASTLZ_LIKELY(distance < MAX_L1_DISTANCE) ? flz_readu32(ref) & 0xffffff : 0x1000000; + if (FASTLZ_UNLIKELY(ip >= ip_limit)) break; + ++ip; + } while (seq != cmp); + + if (FASTLZ_UNLIKELY(ip >= ip_limit)) break; + --ip; + + if (FASTLZ_LIKELY(ip > anchor)) { + op = flz_literals(ip - anchor, anchor, op); + } + + uint32_t len = flz_cmp(ref + 3, ip + 3, ip_bound); + op = flz1_match(len, distance, op); + + /* update the hash at match boundary */ + ip += len; + seq = flz_readu32(ip); + hash = flz_hash(seq & 0xffffff); + htab[hash] = ip++ - ip_start; + seq >>= 8; + hash = flz_hash(seq); + htab[hash] = ip++ - ip_start; + + anchor = ip; + } + + uint32_t copy = (uint8_t*)input + length - anchor; + op = flz_literals(copy, anchor, op); + + return op - (uint8_t*)output; +} + +int fastlz1_decompress(const void* input, int length, void* output, int maxout) { + const uint8_t* ip = (const uint8_t*)input; + const uint8_t* ip_limit = ip + length; + const uint8_t* ip_bound = ip_limit - 2; + uint8_t* op = (uint8_t*)output; + uint8_t* op_limit = op + maxout; + uint32_t ctrl = (*ip++) & 31; + + while (1) { + if (ctrl >= 32) { + uint32_t len = (ctrl >> 5) - 1; + uint32_t ofs = (ctrl & 31) << 8; + const uint8_t* ref = op - ofs - 1; + if (len == 7 - 1) { + FASTLZ_BOUND_CHECK(ip <= ip_bound); + len += *ip++; + } + ref -= *ip++; + len += 3; + FASTLZ_BOUND_CHECK(op + len <= op_limit); + FASTLZ_BOUND_CHECK(ref >= (uint8_t*)output); + fastlz_memmove(op, ref, len); + op += len; + } else { + ctrl++; + FASTLZ_BOUND_CHECK(op + ctrl <= op_limit); + FASTLZ_BOUND_CHECK(ip + ctrl <= ip_limit); + fastlz_memcpy(op, ip, ctrl); + ip += ctrl; + op += ctrl; + } + + if (FASTLZ_UNLIKELY(ip > ip_bound)) break; + ctrl = *ip++; + } + + return op - (uint8_t*)output; +} + +static uint8_t* flz2_match(uint32_t len, uint32_t distance, uint8_t* op) { + --distance; + if (distance < MAX_L2_DISTANCE) { + if (len < 7) { + *op++ = (len << 5) + (distance >> 8); + *op++ = (distance & 255); + } else { + *op++ = (7 << 5) + (distance >> 8); + for (len -= 7; len >= 255; len -= 255) *op++ = 255; + *op++ = len; + *op++ = (distance & 255); + } + } else { + /* far away, but not yet in the another galaxy... */ + if (len < 7) { + distance -= MAX_L2_DISTANCE; + *op++ = (len << 5) + 31; + *op++ = 255; + *op++ = distance >> 8; + *op++ = distance & 255; + } else { + distance -= MAX_L2_DISTANCE; + *op++ = (7 << 5) + 31; + for (len -= 7; len >= 255; len -= 255) *op++ = 255; + *op++ = len; + *op++ = 255; + *op++ = distance >> 8; + *op++ = distance & 255; + } + } + return op; +} + +int fastlz2_compress(const void* input, int length, void* output) { + const uint8_t* ip = (const uint8_t*)input; + const uint8_t* ip_start = ip; + const uint8_t* ip_bound = ip + length - 4; /* because readU32 */ + const uint8_t* ip_limit = ip + length - 12 - 1; + uint8_t* op = (uint8_t*)output; + + uint32_t htab[HASH_SIZE]; + uint32_t seq, hash; + + /* initializes hash table */ + for (hash = 0; hash < HASH_SIZE; ++hash) htab[hash] = 0; + + /* we start with literal copy */ + const uint8_t* anchor = ip; + ip += 2; + + /* main loop */ + while (FASTLZ_LIKELY(ip < ip_limit)) { + const uint8_t* ref; + uint32_t distance, cmp; + + /* find potential match */ + do { + seq = flz_readu32(ip) & 0xffffff; + hash = flz_hash(seq); + ref = ip_start + htab[hash]; + htab[hash] = ip - ip_start; + distance = ip - ref; + cmp = FASTLZ_LIKELY(distance < MAX_FARDISTANCE) ? flz_readu32(ref) & 0xffffff : 0x1000000; + if (FASTLZ_UNLIKELY(ip >= ip_limit)) break; + ++ip; + } while (seq != cmp); + + if (FASTLZ_UNLIKELY(ip >= ip_limit)) break; + + --ip; + + /* far, needs at least 5-byte match */ + if (distance >= MAX_L2_DISTANCE) { + if (ref[3] != ip[3] || ref[4] != ip[4]) { + ++ip; + continue; + } + } + + if (FASTLZ_LIKELY(ip > anchor)) { + op = flz_literals(ip - anchor, anchor, op); + } + + uint32_t len = flz_cmp(ref + 3, ip + 3, ip_bound); + op = flz2_match(len, distance, op); + + /* update the hash at match boundary */ + ip += len; + seq = flz_readu32(ip); + hash = flz_hash(seq & 0xffffff); + htab[hash] = ip++ - ip_start; + seq >>= 8; + hash = flz_hash(seq); + htab[hash] = ip++ - ip_start; + + anchor = ip; + } + + uint32_t copy = (uint8_t*)input + length - anchor; + op = flz_literals(copy, anchor, op); + + /* marker for fastlz2 */ + *(uint8_t*)output |= (1 << 5); + + return op - (uint8_t*)output; +} + +int fastlz2_decompress(const void* input, int length, void* output, int maxout) { + const uint8_t* ip = (const uint8_t*)input; + const uint8_t* ip_limit = ip + length; + const uint8_t* ip_bound = ip_limit - 2; + uint8_t* op = (uint8_t*)output; + uint8_t* op_limit = op + maxout; + uint32_t ctrl = (*ip++) & 31; + + while (1) { + if (ctrl >= 32) { + uint32_t len = (ctrl >> 5) - 1; + uint32_t ofs = (ctrl & 31) << 8; + const uint8_t* ref = op - ofs - 1; + + uint8_t code; + if (len == 7 - 1) do { + FASTLZ_BOUND_CHECK(ip <= ip_bound); + code = *ip++; + len += code; + } while (code == 255); + code = *ip++; + ref -= code; + len += 3; + + /* match from 16-bit distance */ + if (FASTLZ_UNLIKELY(code == 255)) + if (FASTLZ_LIKELY(ofs == (31 << 8))) { + FASTLZ_BOUND_CHECK(ip < ip_bound); + ofs = (*ip++) << 8; + ofs += *ip++; + ref = op - ofs - MAX_L2_DISTANCE - 1; + } + + FASTLZ_BOUND_CHECK(op + len <= op_limit); + FASTLZ_BOUND_CHECK(ref >= (uint8_t*)output); + fastlz_memmove(op, ref, len); + op += len; + } else { + ctrl++; + FASTLZ_BOUND_CHECK(op + ctrl <= op_limit); + FASTLZ_BOUND_CHECK(ip + ctrl <= ip_limit); + fastlz_memcpy(op, ip, ctrl); + ip += ctrl; + op += ctrl; + } + + if (FASTLZ_UNLIKELY(ip >= ip_limit)) break; + ctrl = *ip++; + } + + return op - (uint8_t*)output; +} + +int fastlz_compress(const void* input, int length, void* output) { + /* for short block, choose fastlz1 */ + if (length < 65536) return fastlz1_compress(input, length, output); + + /* else... */ + return fastlz2_compress(input, length, output); +} + +int fastlz_decompress(const void* input, int length, void* output, int maxout) { + /* magic identifier for compression level */ + int level = ((*(const uint8_t*)input) >> 5) + 1; + + if (level == 1) return fastlz1_decompress(input, length, output, maxout); + if (level == 2) return fastlz2_decompress(input, length, output, maxout); + + /* unknown level, trigger error */ + return 0; +} + +int fastlz_compress_level(int level, const void* input, int length, void* output) { + if (level == 1) return fastlz1_compress(input, length, output); + if (level == 2) return fastlz2_compress(input, length, output); + + return 0; +} + +#pragma GCC diagnostic pop diff --git a/op-e2e2/fastlz/fastlz.go b/op-e2e2/fastlz/fastlz.go new file mode 100644 index 000000000000..fc0a43cf3af7 --- /dev/null +++ b/op-e2e2/fastlz/fastlz.go @@ -0,0 +1,34 @@ +package fastlz + +// #include +// #include "fastlz.h" +import "C" + +import ( + "errors" + "runtime" + "unsafe" +) + +// Compress compresses the input data using the FastLZ algorithm. +// The version of FastLZ used is FastLZ level 1 with the implementation from +// this commit: https://github.com/ariya/FastLZ/commit/344eb4025f9ae866ebf7a2ec48850f7113a97a42 +// Which is the same commit that Solady uses: https://github.com/Vectorized/solady/blob/main/src/utils/LibZip.sol#L19 +// Note the FastLZ compression ratio does vary between different versions of the library. +func Compress(input []byte) ([]byte, error) { + length := len(input) + if length == 0 { + return nil, errors.New("no input provided") + } + + result := make([]byte, length*2) + size := C.fastlz_compress(unsafe.Pointer(&input[0]), C.int(length), unsafe.Pointer(&result[0])) + + runtime.KeepAlive(input) + + if size == 0 { + return nil, errors.New("error compressing data") + } + + return result[:size], nil +} diff --git a/op-e2e2/fastlz/fastlz.h b/op-e2e2/fastlz/fastlz.h new file mode 100644 index 000000000000..4754d647573a --- /dev/null +++ b/op-e2e2/fastlz/fastlz.h @@ -0,0 +1,100 @@ +/* + FastLZ - Byte-aligned LZ77 compression library + Copyright (C) 2005-2020 Ariya Hidayat + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + + This implementation is taken from the following repository/commit: + https://github.com/ariya/FastLZ/tree/344eb4025f9ae866ebf7a2ec48850f7113a97a42 +*/ + +#ifndef FASTLZ_H +#define FASTLZ_H + +#define FASTLZ_VERSION 0x000500 + +#define FASTLZ_VERSION_MAJOR 0 +#define FASTLZ_VERSION_MINOR 5 +#define FASTLZ_VERSION_REVISION 0 + +#define FASTLZ_VERSION_STRING "0.5.0" + +#if defined(__cplusplus) +extern "C" { +#endif + +/** + Compress a block of data in the input buffer and returns the size of + compressed block. The size of input buffer is specified by length. The + minimum input buffer size is 16. + + The output buffer must be at least 5% larger than the input buffer + and can not be smaller than 66 bytes. + + If the input is not compressible, the return value might be larger than + length (input buffer size). + + The input buffer and the output buffer can not overlap. + + Compression level can be specified in parameter level. At the moment, + only level 1 and level 2 are supported. + Level 1 is the fastest compression and generally useful for short data. + Level 2 is slightly slower but it gives better compression ratio. + + Note that the compressed data, regardless of the level, can always be + decompressed using the function fastlz_decompress below. +*/ + +int fastlz_compress_level(int level, const void* input, int length, void* output); + +/** + Decompress a block of compressed data and returns the size of the + decompressed block. If error occurs, e.g. the compressed data is + corrupted or the output buffer is not large enough, then 0 (zero) + will be returned instead. + + The input buffer and the output buffer can not overlap. + + Decompression is memory safe and guaranteed not to write the output buffer + more than what is specified in maxout. + + Note that the decompression will always work, regardless of the + compression level specified in fastlz_compress_level above (when + producing the compressed block). + */ + +int fastlz_decompress(const void* input, int length, void* output, int maxout); + +/** + DEPRECATED. + + This is similar to fastlz_compress_level above, but with the level + automatically chosen. + + This function is deprecated and it will be completely removed in some future + version. +*/ + +int fastlz_compress(const void* input, int length, void* output); + +#if defined(__cplusplus) +} +#endif + +#endif /* FASTLZ_H */ diff --git a/op-e2e2/fastlz_test.go b/op-e2e2/fastlz_test.go new file mode 100644 index 000000000000..29c2aabedc54 --- /dev/null +++ b/op-e2e2/fastlz_test.go @@ -0,0 +1,235 @@ +package op_e2e + +import ( + "context" + "encoding/binary" + "fmt" + "math/big" + "testing" + "time" + + "github.com/ethereum-optimism/optimism/op-e2e2/bindings" + "github.com/ethereum-optimism/optimism/op-e2e2/fastlz" + "github.com/ethereum-optimism/optimism/op-service/predeploys" + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethclient/simulated" + "github.com/ethereum/go-ethereum/params" + "github.com/stretchr/testify/require" +) + +var ( + // This bytecode and ABI is for a contract, which wraps the LibZip library for easier fuzz testing. + // The source of this contract is here: https://github.com/danyalprout/fastlz/blob/main/src/FastLz.sol#L6-L10 + contract = &bind.MetaData{ + ABI: "[{\"type\":\"function\",\"name\":\"fastLz\",\"inputs\":[{\"name\":\"_data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"pure\"}]", + } + + fastLzBytecode = "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063920a769114610030575b600080fd5b61004361003e366004610374565b610055565b60405190815260200160405180910390f35b600061006082610067565b5192915050565b60606101e0565b818153600101919050565b600082840393505b838110156100a25782810151828201511860001a1590930292600101610081565b9392505050565b825b602082106100d75782516100c0601f8361006e565b5260209290920191601f19909101906021016100ab565b81156100a25782516100ec600184038361006e565b520160010192915050565b60006001830392505b61010782106101385761012a8360ff1661012560fd6101258760081c60e0018961006e565b61006e565b935061010682039150610100565b600782106101655761015e8360ff16610125600785036101258760081c60e0018961006e565b90506100a2565b61017e8360ff166101258560081c8560051b018761006e565b949350505050565b80516101d890838303906101bc90600081901a600182901a60081b1760029190911a60101b17639e3779b90260131c611fff1690565b8060021b6040510182815160e01c1860e01b8151188152505050565b600101919050565b5060405161800038823961800081016020830180600d8551820103826002015b81811015610313576000805b50508051604051600082901a600183901a60081b1760029290921a60101b91909117639e3779b9810260111c617ffc16909101805160e081811c878603811890911b9091189091528401908183039084841061026857506102a3565b600184019350611fff821161029d578251600081901a600182901a60081b1760029190911a60101b17810361029d57506102a3565b5061020c565b8383106102b1575050610313565b600183039250858311156102cf576102cc87878886036100a9565b96505b6102e3600985016003850160038501610079565b91506102f08782846100f7565b9650506103088461030386848601610186565b610186565b915050809350610200565b5050617fe061032884848589518601036100a9565b03925050506020820180820383525b81811161034e57617fe08101518152602001610337565b5060008152602001604052919050565b634e487b7160e01b600052604160045260246000fd5b60006020828403121561038657600080fd5b813567ffffffffffffffff8082111561039e57600080fd5b818401915084601f8301126103b257600080fd5b8135818111156103c4576103c461035e565b604051601f8201601f19908116603f011681019083821181831017156103ec576103ec61035e565b8160405282815287602084870101111561040557600080fd5b82602086016020830137600092810160200192909252509594505050505056fea264697066735822122000646b2953fc4a6f501bd0456ac52203089443937719e16b3190b7979c39511264736f6c63430008190033" + + seeds = [][]byte{ + // https: //basescan.org/tx/0x5dadeb52979f29fc7a7494c43fdabc5be1d8ff404f3aafe93d729fa8e5d00769 + common.FromHex("0xb9047c02f904788221050883036ee48409c6c87383037f6f941195cf65f83b3a5768f3c496d3a05ad6412c64b78644364c5bb000b90404d123b4d80000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000038000000000000000000000000000000000f6476f90447748c19248ccaa31e6b8bfda4eb9d830f5f47df7f0998f7c2123d9e6137761b75d3184efb0f788e3b14516000000000000000000000000000000000000000000000000000044364c5bb000000000000000000000000000f38e53bd45c8225a7c94b513beadaa7afe5d222d0000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000084d6574614d61736b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035697066733a2f2f516d656852577a743347745961776343347564745657557233454c587261436746434259416b66507331696f48610000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000cd0d83d9e840f8e27d5c2e365fd365ff1c05b2480000000000000000000000000000000000000000000000000000000000000ce40000000000000000000000000000000000000000000000000000000000000041e4480d358dbae20880960a0a464d63b06565a0c9f9b1b37aa94b522247b23ce149c81359bf4239d1a879eeb41047ec710c15f5c0f67453da59a383e6abd742971c00000000000000000000000000000000000000000000000000000000000000c001a0b57f0ff8516ea29cb26a44ac5055a5420847d1e16a8e7b03b70f0c02291ff2d5a00ad3771e5f39ccacfff0faa8c5d25ef7a1c179f79e66e828ffddcb994c8b512e"), + // https://basescan.org/tx/0xfaada76a2dac09fc17f5a28d066aaabefc6d82ef6589b211ed8c9f766b070721 + common.FromHex("b87602f873822105528304320f8409cfe5c98252089480c67432656d59144ceff962e8faf8926599bcf888011dfe52d06b633f80c001a08632f069f837aea7a28bab0affee14dda116956bd5a850a355c045d25afedd17a0084b8f273efffe17ece527116053e5781a4915ff89ab9c379f1e62c25b697687"), + // https://basescan.org/tx/0x112864e9b971af6a1dac840018833c5a5a659acc187cfdaba919ad1da013678d + common.FromHex("b8b302f8b0822105308304320f8409cfe5c9827496944ed4e862860bed51a9570b96d89af5e1b0efefed80b844095ea7b3000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba300000000000000000000000000000000000000000000015e10fb0973595fffffc001a02020e39f07917c1a852feb131c857e12478c7e88a20772b91a8bf5cee38c5aeea06055981727f9aaa3471c1af800555b35a77916c154be3f9d02ad1a63029455ab"), + // https://basescan.org/tx/0x6905051352691641888d0c427fb137c5b95afb5870d5169ff014eff1d0952195 + common.FromHex("b87202f86f8221058303dc6c8310db1f84068fa8d7838954409436af2ff952a7355c8045fcd5e88bc9f6c8257f7b8080c001a0b89e7ff3d7694109e73e7f4244e032581670313c36e48e485c9c94b853bd81d2a038ffaf8f10859ce21d1f7f7046c3d08027fb8aa15b69038f6102be97aaa1179a"), + // https://basescan.org/tx/0x6a38e9a26d7202a2268de69d2d47531c1a9829867579a483fb48d78e9e0b080d + common.FromHex("b9049b02f904978221058201618506fc23ac008506fc23ac008306ddd0943fc91a3afd70395cd496c647d5a6cc9d4b2b7fad80b904243593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006641d67b00000000000000000000000000000000000000000000000000000000000000030a000c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000160000000000000000000000000088487bd8c3222d64d1d0b3fa7098dcf9d94d79e000000000000000000000000ffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000000000000000000006669635d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fc91a3afd70395cd496c647d5a6cc9d4b2b7fad000000000000000000000000000000000000000000000000000000006641d78900000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000418661369ca026f92ff88347bd0e3625a7b5ed65071b366368c68ad7c55aed136c18659b34f9246e30a784227a53dd374fbd3d2124696808c678cd987c4e954a681b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000549e5c020c764dbfffff00000000000000000000000000000000000000000000000002e5a629c093a2b600000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002b088487bd8c3222d64d1d0b3fa7098dcf9d94d79e0027104200000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000c001a014a3acef764ff6d3bb9bd81e420bfa94171a5734ab997dfbc9b41b653ce018a4a01ff5fccb01ef5c60ba3aef67d4e74f3f47312dd78bfbbff9e5090fbf2d3d62bb"), + } +) + +type testStateGetter struct { + baseFee, blobBaseFee, overhead, scalar *big.Int + baseFeeScalar, blobBaseFeeScalar uint32 +} + +func (sg *testStateGetter) GetState(addr common.Address, slot common.Hash) common.Hash { + buf := common.Hash{} + switch slot { + case types.L1BaseFeeSlot: + sg.baseFee.FillBytes(buf[:]) + case types.OverheadSlot: + sg.overhead.FillBytes(buf[:]) + case types.ScalarSlot: + sg.scalar.FillBytes(buf[:]) + case types.L1BlobBaseFeeSlot: + sg.blobBaseFee.FillBytes(buf[:]) + case types.L1FeeScalarsSlot: + // fetch Ecotone fee sclars + offset := 32 - types.BaseFeeScalarSlotOffset - 4 // todo maybe make scalarSelectSTartPublic + binary.BigEndian.PutUint32(buf[offset:offset+4], sg.baseFeeScalar) + binary.BigEndian.PutUint32(buf[offset+4:offset+8], sg.blobBaseFeeScalar) + default: + panic("unknown slot") + } + return buf +} + +func FuzzFjordCostFunction(f *testing.F) { + for _, seed := range seeds { + f.Add(seed) + } + + cfg := DefaultSystemConfig(f) + s := hexutil.Uint64(0) + cfg.DeployConfig.L2GenesisCanyonTimeOffset = &s + cfg.DeployConfig.L2GenesisDeltaTimeOffset = &s + cfg.DeployConfig.L2GenesisEcotoneTimeOffset = &s + cfg.DeployConfig.L2GenesisFjordTimeOffset = &s + + ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) + defer cancel() + + opGeth, err := NewOpGeth(f, ctx, &cfg) + require.NoError(f, err) + defer opGeth.Close() + + gpoCaller, err := bindings.NewGasPriceOracleCaller(predeploys.GasPriceOracleAddr, opGeth.L2Client) + require.NoError(f, err) + + isFjord, err := gpoCaller.IsFjord(&bind.CallOpts{}) + require.NoError(f, err) + require.True(f, isFjord) + + _, err = opGeth.AddL2Block(context.Background()) + require.NoError(f, err) + + baseFee, err := gpoCaller.L1BaseFee(&bind.CallOpts{}) + require.NoError(f, err) + require.Greater(f, baseFee.Uint64(), uint64(0)) + + blobBaseFee, err := gpoCaller.BlobBaseFee(&bind.CallOpts{}) + require.NoError(f, err) + require.Greater(f, blobBaseFee.Uint64(), uint64(0)) + + baseFeeScalar, err := gpoCaller.BaseFeeScalar(&bind.CallOpts{}) + require.NoError(f, err) + require.Greater(f, baseFeeScalar, uint32(0)) + + blobBaseFeeScalar, err := gpoCaller.BlobBaseFeeScalar(&bind.CallOpts{}) + require.NoError(f, err) + require.Equal(f, blobBaseFeeScalar, uint32(0)) + + // we can ignore the blobbasefee, as the scalar is set to zero. + feeScaled := big.NewInt(16) + feeScaled.Mul(feeScaled, baseFee) + feeScaled.Mul(feeScaled, big.NewInt(int64(baseFeeScalar))) + + db := &testStateGetter{ + baseFee: baseFee, + blobBaseFee: blobBaseFee, + overhead: big.NewInt(0), // not used for fjord + scalar: big.NewInt(0), // not used for fjord + baseFeeScalar: baseFeeScalar, + blobBaseFeeScalar: blobBaseFeeScalar, + } + + zeroTime := uint64(0) + // create a config where ecotone/fjord upgrades are active + config := ¶ms.ChainConfig{ + Optimism: params.OptimismTestConfig.Optimism, + RegolithTime: &zeroTime, + EcotoneTime: &zeroTime, + FjordTime: &zeroTime, + } + require.True(f, config.IsOptimismEcotone(zeroTime)) + require.True(f, config.IsOptimismFjord(zeroTime)) + costFunc := types.NewL1CostFunc(config, db) + + f.Fuzz(func(t *testing.T, fuzzedData []byte) { + flzSize := types.FlzCompressLen(fuzzedData) + + // Skip transactions that will be clamped to the minimum or less. These will fuzz to different values + // due to the solidity l1BlockGenesis adding 68 extra bytes to account for the signature. + estimatedSize := big.NewInt(int64(flzSize)) + estimatedSize.Mul(estimatedSize, types.L1CostFastlzCoef) + estimatedSize.Add(estimatedSize, types.L1CostIntercept) + + if estimatedSize.Cmp(types.MinTransactionSizeScaled) < 0 { + t.Skip() + return + } + + l1FeeSolidity, err := gpoCaller.GetL1Fee(&bind.CallOpts{}, fuzzedData) + require.NoError(t, err) + + // remove the adjustment + l1FeeSolidity.Mul(l1FeeSolidity, big.NewInt(1e12)) + l1FeeSolidity.Div(l1FeeSolidity, feeScaled) + + totalAdjustment := new(big.Int).Mul(big.NewInt(68), big.NewInt(836_500)) + l1FeeSolidity.Sub(l1FeeSolidity, totalAdjustment) + + l1FeeSolidity.Mul(l1FeeSolidity, feeScaled) + l1FeeSolidity.Div(l1FeeSolidity, big.NewInt(1e12)) + + costData := types.NewRollupCostData(fuzzedData) + + l1FeeGeth := costFunc(costData, zeroTime) + + require.Equal(t, l1FeeGeth.Uint64(), l1FeeSolidity.Uint64(), fmt.Sprintf("fuzzedData: %x", common.Bytes2Hex(fuzzedData))) + }) +} + +func FuzzFastLzGethSolidity(f *testing.F) { + for _, seed := range seeds { + f.Add(seed) + } + + contractAbi, err := contract.GetAbi() + require.NoError(f, err) + + b := simulated.NewBackend(map[common.Address]types.Account{ + predeploys.GasPriceOracleAddr: { + Code: common.FromHex(fastLzBytecode), + }, + }) + defer func() { + require.NoError(f, b.Close()) + }() + + client := b.Client() + + f.Fuzz(func(t *testing.T, data []byte) { + req, err := contractAbi.Pack("fastLz", data) + require.NoError(t, err) + + response, err := client.CallContract(context.Background(), ethereum.CallMsg{ + To: &predeploys.GasPriceOracleAddr, + Data: req, + }, nil) + require.NoError(t, err) + + result, err := contractAbi.Unpack("fastLz", response) + require.NoError(t, err) + + gethCompressedLen := types.FlzCompressLen(data) + require.Equal(t, result[0].(*big.Int).Uint64(), uint64(gethCompressedLen)) + }) +} + +func FuzzFastLzCgo(f *testing.F) { + for _, seed := range seeds { + f.Add(seed) + } + + f.Fuzz(func(t *testing.T, data []byte) { + if len(data) == 0 { + t.Skip() + return + } + + // Our implementation in go-ethereum + compressedLen := types.FlzCompressLen(data) + + out, err := fastlz.Compress(data) + require.NoError(t, err) + require.Equal(t, int(compressedLen), len(out)) + }) +} diff --git a/op-e2e2/faultproofs/challenge_preimage_test.go b/op-e2e2/faultproofs/challenge_preimage_test.go new file mode 100644 index 000000000000..4ff565cd8ed8 --- /dev/null +++ b/op-e2e2/faultproofs/challenge_preimage_test.go @@ -0,0 +1,68 @@ +package faultproofs + +import ( + "context" + "testing" + + op_e2e "github.com/ethereum-optimism/optimism/op-e2e2" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/challenger" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/disputegame" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/disputegame/preimage" + "github.com/ethereum/go-ethereum/common" + "github.com/stretchr/testify/require" +) + +func TestChallengeLargePreimages_ChallengeFirst(t *testing.T) { + op_e2e.InitParallel(t) + ctx := context.Background() + sys, _ := StartFaultDisputeSystem(t) + t.Cleanup(sys.Close) + + disputeGameFactory := disputegame.NewFactoryHelper(t, ctx, sys) + disputeGameFactory.StartChallenger(ctx, "Challenger", + challenger.WithAlphabet(), + challenger.WithPrivKey(sys.Cfg.Secrets.Alice)) + preimageHelper := disputeGameFactory.PreimageHelper(ctx) + ident := preimageHelper.UploadLargePreimage(ctx, preimage.MinPreimageSize, + preimage.WithReplacedCommitment(0, common.Hash{0xaa})) + + require.NotEqual(t, ident.Claimant, common.Address{}) + + preimageHelper.WaitForChallenged(ctx, ident) +} + +func TestChallengeLargePreimages_ChallengeMiddle(t *testing.T) { + op_e2e.InitParallel(t) + ctx := context.Background() + sys, _ := StartFaultDisputeSystem(t) + t.Cleanup(sys.Close) + disputeGameFactory := disputegame.NewFactoryHelper(t, ctx, sys) + disputeGameFactory.StartChallenger(ctx, "Challenger", + challenger.WithAlphabet(), + challenger.WithPrivKey(sys.Cfg.Secrets.Mallory)) + preimageHelper := disputeGameFactory.PreimageHelper(ctx) + ident := preimageHelper.UploadLargePreimage(ctx, preimage.MinPreimageSize, + preimage.WithReplacedCommitment(10, common.Hash{0xaa})) + + require.NotEqual(t, ident.Claimant, common.Address{}) + + preimageHelper.WaitForChallenged(ctx, ident) +} + +func TestChallengeLargePreimages_ChallengeLast(t *testing.T) { + op_e2e.InitParallel(t) + ctx := context.Background() + sys, _ := StartFaultDisputeSystem(t) + t.Cleanup(sys.Close) + disputeGameFactory := disputegame.NewFactoryHelper(t, ctx, sys) + disputeGameFactory.StartChallenger(ctx, "Challenger", + challenger.WithAlphabet(), + challenger.WithPrivKey(sys.Cfg.Secrets.Mallory)) + preimageHelper := disputeGameFactory.PreimageHelper(ctx) + ident := preimageHelper.UploadLargePreimage(ctx, preimage.MinPreimageSize, + preimage.WithLastCommitment(common.Hash{0xaa})) + + require.NotEqual(t, ident.Claimant, common.Address{}) + + preimageHelper.WaitForChallenged(ctx, ident) +} diff --git a/op-e2e2/faultproofs/multi_test.go b/op-e2e2/faultproofs/multi_test.go new file mode 100644 index 000000000000..7074f5cd2d63 --- /dev/null +++ b/op-e2e2/faultproofs/multi_test.go @@ -0,0 +1,41 @@ +package faultproofs + +import ( + "context" + "testing" + + op_e2e "github.com/ethereum-optimism/optimism/op-e2e2" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/challenger" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/disputegame" + "github.com/ethereum/go-ethereum/common" +) + +func TestMultipleGameTypes(t *testing.T) { + op_e2e.InitParallel(t, op_e2e.UsesCannon) + + ctx := context.Background() + sys, _ := StartFaultDisputeSystem(t) + t.Cleanup(sys.Close) + + gameFactory := disputegame.NewFactoryHelper(t, ctx, sys) + + game1 := gameFactory.StartOutputCannonGame(ctx, "sequencer", 1, common.Hash{0x01, 0xaa}) + game2 := gameFactory.StartOutputAlphabetGame(ctx, "sequencer", 1, common.Hash{0xbb}) + latestClaim1 := game1.DisputeLastBlock(ctx) + latestClaim2 := game2.DisputeLastBlock(ctx) + + // Start a challenger with both cannon and alphabet support + gameFactory.StartChallenger(ctx, "TowerDefense", + challenger.WithCannon(t, sys.RollupConfig, sys.L2GenesisCfg), + challenger.WithAlphabet(), + challenger.WithPrivKey(sys.Cfg.Secrets.Alice), + ) + + // Wait for the challenger to respond to both games + counter1 := latestClaim1.WaitForCounterClaim(ctx) + counter2 := latestClaim2.WaitForCounterClaim(ctx) + // The alphabet game always posts the same traces, so if they're different they can't both be from the alphabet. + // We're contesting the same block with different VMs, so if the challenger was just playing two cannon or alphabet + // games the responses would be equal. + counter1.RequireDifferentClaimValue(counter2) +} diff --git a/op-e2e2/faultproofs/output_alphabet_test.go b/op-e2e2/faultproofs/output_alphabet_test.go new file mode 100644 index 000000000000..14c8d42ce274 --- /dev/null +++ b/op-e2e2/faultproofs/output_alphabet_test.go @@ -0,0 +1,321 @@ +package faultproofs + +import ( + "context" + "math/big" + "testing" + "time" + + "github.com/ethereum-optimism/optimism/op-challenger/game/types" + op_e2e "github.com/ethereum-optimism/optimism/op-e2e2" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/challenger" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/disputegame" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/wait" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/stretchr/testify/require" +) + +func TestOutputAlphabetGame_ChallengerWins(t *testing.T) { + op_e2e.InitParallel(t) + ctx := context.Background() + sys, l1Client := StartFaultDisputeSystem(t) + t.Cleanup(sys.Close) + + disputeGameFactory := disputegame.NewFactoryHelper(t, ctx, sys) + game := disputeGameFactory.StartOutputAlphabetGame(ctx, "sequencer", 3, common.Hash{0xff}) + correctTrace := game.CreateHonestActor(ctx, "sequencer") + game.LogGameData(ctx) + + opts := challenger.WithPrivKey(sys.Cfg.Secrets.Alice) + game.StartChallenger(ctx, "sequencer", "Challenger", opts) + game.LogGameData(ctx) + + // Challenger should post an output root to counter claims down to the leaf level of the top game + claim := game.RootClaim(ctx) + for claim.IsOutputRoot(ctx) && !claim.IsOutputRootLeaf(ctx) { + if claim.AgreesWithOutputRoot() { + // If the latest claim agrees with the output root, expect the honest challenger to counter it + claim = claim.WaitForCounterClaim(ctx) + game.LogGameData(ctx) + claim.RequireCorrectOutputRoot(ctx) + } else { + // Otherwise we should counter + claim = claim.Attack(ctx, common.Hash{0xaa}) + game.LogGameData(ctx) + } + } + + // Wait for the challenger to post the first claim in the cannon trace + claim = claim.WaitForCounterClaim(ctx) + game.LogGameData(ctx) + + // Attack the root of the alphabet trace subgame + claim = correctTrace.AttackClaim(ctx, claim) + for !claim.IsMaxDepth(ctx) { + if claim.AgreesWithOutputRoot() { + // If the latest claim supports the output root, wait for the honest challenger to respond + claim = claim.WaitForCounterClaim(ctx) + game.LogGameData(ctx) + } else { + // Otherwise we need to counter the honest claim + claim = correctTrace.AttackClaim(ctx, claim) + game.LogGameData(ctx) + } + } + // Challenger should be able to call step and counter the leaf claim. + claim.WaitForCountered(ctx) + game.LogGameData(ctx) + + sys.TimeTravelClock.AdvanceTime(game.MaxClockDuration(ctx)) + require.NoError(t, wait.ForNextBlock(ctx, l1Client)) + game.WaitForGameStatus(ctx, types.GameStatusChallengerWon) + game.LogGameData(ctx) +} + +func TestOutputAlphabetGame_ReclaimBond(t *testing.T) { + op_e2e.InitParallel(t) + ctx := context.Background() + sys, l1Client := StartFaultDisputeSystem(t) + t.Cleanup(sys.Close) + + disputeGameFactory := disputegame.NewFactoryHelper(t, ctx, sys) + game := disputeGameFactory.StartOutputAlphabetGame(ctx, "sequencer", 3, common.Hash{0xff}) + game.LogGameData(ctx) + + // The dispute game should have a zero balance + balance := game.WethBalance(ctx, game.Addr) + require.Zero(t, balance.Uint64()) + + alice := sys.Cfg.Secrets.Addresses().Alice + + // Grab the root claim + claim := game.RootClaim(ctx) + opts := challenger.WithPrivKey(sys.Cfg.Secrets.Alice) + game.StartChallenger(ctx, "sequencer", "Challenger", opts) + game.LogGameData(ctx) + + // Perform a few moves + claim = claim.WaitForCounterClaim(ctx) + game.LogGameData(ctx) + claim = claim.Attack(ctx, common.Hash{}) + claim = claim.WaitForCounterClaim(ctx) + game.LogGameData(ctx) + claim = claim.Attack(ctx, common.Hash{}) + game.LogGameData(ctx) + _ = claim.WaitForCounterClaim(ctx) + + // Expect posted claims so the game balance is non-zero + balance = game.WethBalance(ctx, game.Addr) + require.Truef(t, balance.Cmp(big.NewInt(0)) > 0, "Expected game balance to be above zero") + + sys.TimeTravelClock.AdvanceTime(game.MaxClockDuration(ctx)) + require.NoError(t, wait.ForNextBlock(ctx, l1Client)) + game.WaitForGameStatus(ctx, types.GameStatusChallengerWon) + game.LogGameData(ctx) + + // Expect Alice's credit to be non-zero + // But it can't be claimed right now since there is a delay on the weth unlock + require.Truef(t, game.AvailableCredit(ctx, alice).Cmp(big.NewInt(0)) > 0, "Expected alice credit to be above zero") + + // The actor should have no credit available because all its bonds were paid to Alice. + actorCredit := game.AvailableCredit(ctx, disputegame.TestAddress) + require.True(t, actorCredit.Cmp(big.NewInt(0)) == 0, "Expected alice available credit to be zero") + + // Advance the time past the weth unlock delay + sys.TimeTravelClock.AdvanceTime(game.CreditUnlockDuration(ctx)) + require.NoError(t, wait.ForNextBlock(ctx, l1Client)) + + // Wait for alice to have no available credit + // aka, wait for the challenger to claim its credit + game.WaitForNoAvailableCredit(ctx, alice) + + // The dispute game delayed weth balance should be zero since it's all claimed + require.True(t, game.WethBalance(ctx, game.Addr).Cmp(big.NewInt(0)) == 0) +} + +func TestOutputAlphabetGame_ValidOutputRoot(t *testing.T) { + op_e2e.InitParallel(t) + ctx := context.Background() + sys, l1Client := StartFaultDisputeSystem(t) + t.Cleanup(sys.Close) + + disputeGameFactory := disputegame.NewFactoryHelper(t, ctx, sys) + game := disputeGameFactory.StartOutputAlphabetGameWithCorrectRoot(ctx, "sequencer", 2) + correctTrace := game.CreateHonestActor(ctx, "sequencer") + game.LogGameData(ctx) + claim := game.DisputeLastBlock(ctx) + // Invalid root claim of the alphabet game + claim = claim.Attack(ctx, common.Hash{0x01}) + + opts := challenger.WithPrivKey(sys.Cfg.Secrets.Alice) + game.StartChallenger(ctx, "sequencer", "Challenger", opts) + + claim = claim.WaitForCounterClaim(ctx) + game.LogGameData(ctx) + for !claim.IsMaxDepth(ctx) { + // Dishonest actor always attacks with the correct trace + claim = correctTrace.AttackClaim(ctx, claim) + claim = claim.WaitForCounterClaim(ctx) + game.LogGameData(ctx) + } + + sys.TimeTravelClock.AdvanceTime(game.MaxClockDuration(ctx)) + require.NoError(t, wait.ForNextBlock(ctx, l1Client)) + game.WaitForGameStatus(ctx, types.GameStatusDefenderWon) +} + +func TestChallengerCompleteExhaustiveDisputeGame(t *testing.T) { + op_e2e.InitParallel(t) + + testCase := func(t *testing.T, isRootCorrect bool) { + ctx := context.Background() + sys, l1Client := StartFaultDisputeSystem(t) + t.Cleanup(sys.Close) + + disputeGameFactory := disputegame.NewFactoryHelper(t, ctx, sys) + var game *disputegame.OutputAlphabetGameHelper + if isRootCorrect { + game = disputeGameFactory.StartOutputAlphabetGameWithCorrectRoot(ctx, "sequencer", 1) + } else { + game = disputeGameFactory.StartOutputAlphabetGame(ctx, "sequencer", 1, common.Hash{0xaa, 0xbb, 0xcc}) + } + claim := game.DisputeLastBlock(ctx) + + game.LogGameData(ctx) + + // Start honest challenger + game.StartChallenger(ctx, "sequencer", "Challenger", + challenger.WithAlphabet(), + challenger.WithPrivKey(sys.Cfg.Secrets.Alice), + // Ensures the challenger responds to all claims before test timeout + challenger.WithPollInterval(time.Millisecond*400), + ) + + if isRootCorrect { + // Attack the correct output root with an invalid alphabet trace + claim = claim.Attack(ctx, common.Hash{0x01}) + } else { + // Wait for the challenger to counter the invalid output root + claim = claim.WaitForCounterClaim(ctx) + } + + // Start dishonest challenger + dishonestHelper := game.CreateDishonestHelper(ctx, "sequencer", !isRootCorrect) + dishonestHelper.ExhaustDishonestClaims(ctx, claim) + + // Wait until we've reached max depth before checking for inactivity + game.WaitForClaimAtDepth(ctx, game.MaxDepth(ctx)) + + // Wait for 4 blocks of no challenger responses. The challenger may still be stepping on invalid claims at max depth + game.WaitForInactivity(ctx, 4, false) + + gameDuration := game.MaxClockDuration(ctx) + sys.TimeTravelClock.AdvanceTime(gameDuration) + require.NoError(t, wait.ForNextBlock(ctx, l1Client)) + + expectedStatus := types.GameStatusChallengerWon + if isRootCorrect { + expectedStatus = types.GameStatusDefenderWon + } + game.WaitForGameStatus(ctx, expectedStatus) + game.LogGameData(ctx) + } + + t.Run("RootCorrect", func(t *testing.T) { + op_e2e.InitParallel(t) + testCase(t, true) + }) + t.Run("RootIncorrect", func(t *testing.T) { + op_e2e.InitParallel(t) + testCase(t, false) + }) +} + +func TestOutputAlphabetGame_FreeloaderEarnsNothing(t *testing.T) { + op_e2e.InitParallel(t) + ctx := context.Background() + sys, l1Client := StartFaultDisputeSystem(t) + t.Cleanup(sys.Close) + + freeloaderOpts, err := bind.NewKeyedTransactorWithChainID(sys.Cfg.Secrets.Mallory, sys.Cfg.L1ChainIDBig()) + require.Nil(t, err) + + disputeGameFactory := disputegame.NewFactoryHelper(t, ctx, sys) + game := disputeGameFactory.StartOutputAlphabetGameWithCorrectRoot(ctx, "sequencer", 2) + correctTrace := game.CreateHonestActor(ctx, "sequencer") + game.LogGameData(ctx) + claim := game.DisputeLastBlock(ctx) + // Invalid root claim of the alphabet game + claim = claim.Attack(ctx, common.Hash{0x01}) + + // Chronology of claims: + // dishonest root claim: + // - honest counter + // - dishonest + // - freeloader + // - honest + // - freeloader + // The freeloader must be positioned leftmost (gindex positioning) or at the same position as honest claims. + + // honest counter + claim = correctTrace.AttackClaim(ctx, claim) + + var freeloaders []*disputegame.ClaimHelper + + // dishonest + dishonest := correctTrace.AttackClaim(ctx, claim) + + freeloaders = append(freeloaders, correctTrace.AttackClaim(ctx, dishonest, disputegame.WithTransactOpts(freeloaderOpts))) + freeloaders = append(freeloaders, dishonest.Attack(ctx, common.Hash{0x02}, disputegame.WithTransactOpts(freeloaderOpts))) + freeloaders = append(freeloaders, dishonest.Defend(ctx, common.Hash{0x03}, disputegame.WithTransactOpts(freeloaderOpts))) + + // Ensure freeloaders respond before the honest challenger + game.StartChallenger(ctx, "sequencer", "Challenger", challenger.WithPrivKey(sys.Cfg.Secrets.Alice)) + dishonest.WaitForCounterClaim(ctx, freeloaders...) + + // Freeloaders after the honest challenger + freeloaders = append(freeloaders, dishonest.Attack(ctx, common.Hash{0x04}, disputegame.WithTransactOpts(freeloaderOpts))) + freeloaders = append(freeloaders, dishonest.Defend(ctx, common.Hash{0x05}, disputegame.WithTransactOpts(freeloaderOpts))) + + for _, freeloader := range freeloaders { + if freeloader.IsMaxDepth(ctx) { + freeloader.WaitForCountered(ctx) + } else { + freeloader.WaitForCounterClaim(ctx) + } + } + + game.LogGameData(ctx) + sys.TimeTravelClock.AdvanceTime(game.MaxClockDuration(ctx)) + require.NoError(t, wait.ForNextBlock(ctx, l1Client)) + game.WaitForGameStatus(ctx, types.GameStatusDefenderWon) + + game.LogGameData(ctx) + amt := game.Credit(ctx, freeloaderOpts.From) + require.Truef(t, amt.BitLen() == 0, "freeloaders should not be rewarded. Credit: %v", amt) +} + +func TestHighestActedL1BlockMetric(t *testing.T) { + op_e2e.InitParallel(t) + ctx := context.Background() + sys, l1Client := StartFaultDisputeSystem(t) + t.Cleanup(sys.Close) + + disputeGameFactory := disputegame.NewFactoryHelper(t, ctx, sys) + honestChallenger := disputeGameFactory.StartChallenger(ctx, "Honest", challenger.WithAlphabet(), challenger.WithPrivKey(sys.Cfg.Secrets.Alice)) + + game1 := disputeGameFactory.StartOutputAlphabetGame(ctx, "sequencer", 1, common.Hash{0xaa}) + sys.AdvanceTime(game1.MaxClockDuration(ctx)) + require.NoError(t, wait.ForNextBlock(ctx, l1Client)) + + game1.WaitForGameStatus(ctx, types.GameStatusDefenderWon) + + disputeGameFactory.StartOutputAlphabetGame(ctx, "sequencer", 2, common.Hash{0xaa}) + disputeGameFactory.StartOutputAlphabetGame(ctx, "sequencer", 3, common.Hash{0xaa}) + + honestChallenger.WaitL1HeadActedOn(ctx, l1Client) + + require.NoError(t, wait.ForNextBlock(ctx, l1Client)) + honestChallenger.WaitL1HeadActedOn(ctx, l1Client) +} diff --git a/op-e2e2/faultproofs/output_cannon_test.go b/op-e2e2/faultproofs/output_cannon_test.go new file mode 100644 index 000000000000..c67f3bc95f2c --- /dev/null +++ b/op-e2e2/faultproofs/output_cannon_test.go @@ -0,0 +1,819 @@ +package faultproofs + +import ( + "context" + "fmt" + "math/big" + "testing" + + "github.com/ethereum-optimism/optimism/op-challenger/game/fault/trace/utils" + "github.com/ethereum-optimism/optimism/op-challenger/game/fault/types" + gameTypes "github.com/ethereum-optimism/optimism/op-challenger/game/types" + op_e2e "github.com/ethereum-optimism/optimism/op-e2e2" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/challenger" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/disputegame" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/disputegame/preimage" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/wait" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/rpc" + "github.com/stretchr/testify/require" +) + +func TestOutputCannonGame(t *testing.T) { + op_e2e.InitParallel(t, op_e2e.UsesCannon) + ctx := context.Background() + sys, l1Client := StartFaultDisputeSystem(t) + t.Cleanup(sys.Close) + + disputeGameFactory := disputegame.NewFactoryHelper(t, ctx, sys) + game := disputeGameFactory.StartOutputCannonGame(ctx, "sequencer", 4, common.Hash{0x01}) + game.LogGameData(ctx) + + game.StartChallenger(ctx, "Challenger", challenger.WithPrivKey(sys.Cfg.Secrets.Alice)) + + game.LogGameData(ctx) + + // Challenger should post an output root to counter claims down to the leaf level of the top game + claim := game.RootClaim(ctx) + for claim.IsOutputRoot(ctx) && !claim.IsOutputRootLeaf(ctx) { + if claim.AgreesWithOutputRoot() { + // If the latest claim agrees with the output root, expect the honest challenger to counter it + claim = claim.WaitForCounterClaim(ctx) + game.LogGameData(ctx) + claim.RequireCorrectOutputRoot(ctx) + } else { + // Otherwise we should counter + claim = claim.Attack(ctx, common.Hash{0xaa}) + game.LogGameData(ctx) + } + } + + // Wait for the challenger to post the first claim in the cannon trace + claim = claim.WaitForCounterClaim(ctx) + game.LogGameData(ctx) + + // Attack the root of the cannon trace subgame + claim = claim.Attack(ctx, common.Hash{0x00, 0xcc}) + for !claim.IsMaxDepth(ctx) { + if claim.AgreesWithOutputRoot() { + // If the latest claim supports the output root, wait for the honest challenger to respond + claim = claim.WaitForCounterClaim(ctx) + game.LogGameData(ctx) + } else { + // Otherwise we need to counter the honest claim + claim = claim.Defend(ctx, common.Hash{0x00, 0xdd}) + game.LogGameData(ctx) + } + } + // Challenger should be able to call step and counter the leaf claim. + claim.WaitForCountered(ctx) + game.LogGameData(ctx) + + sys.TimeTravelClock.AdvanceTime(game.MaxClockDuration(ctx)) + require.NoError(t, wait.ForNextBlock(ctx, l1Client)) + game.WaitForGameStatus(ctx, gameTypes.GameStatusChallengerWon) +} + +func TestOutputCannon_ChallengeAllZeroClaim(t *testing.T) { + // The dishonest actor always posts claims with all zeros. + op_e2e.InitParallel(t, op_e2e.UsesCannon) + ctx := context.Background() + sys, l1Client := StartFaultDisputeSystem(t) + t.Cleanup(sys.Close) + + disputeGameFactory := disputegame.NewFactoryHelper(t, ctx, sys) + game := disputeGameFactory.StartOutputCannonGame(ctx, "sequencer", 3, common.Hash{}) + game.LogGameData(ctx) + + claim := game.DisputeLastBlock(ctx) + game.StartChallenger(ctx, "Challenger", challenger.WithPrivKey(sys.Cfg.Secrets.Alice)) + + game.DefendClaim(ctx, claim, func(parent *disputegame.ClaimHelper) *disputegame.ClaimHelper { + if parent.IsBottomGameRoot(ctx) { + return parent.Attack(ctx, common.Hash{}) + } + return parent.Defend(ctx, common.Hash{}) + }) + + game.LogGameData(ctx) + + sys.TimeTravelClock.AdvanceTime(game.MaxClockDuration(ctx)) + require.NoError(t, wait.ForNextBlock(ctx, l1Client)) + game.WaitForGameStatus(ctx, gameTypes.GameStatusChallengerWon) + game.LogGameData(ctx) +} + +func TestOutputCannon_PublishCannonRootClaim(t *testing.T) { + op_e2e.InitParallel(t, op_e2e.UsesCannon) + tests := []struct { + disputeL2BlockNumber uint64 + }{ + {7}, // Post-state output root is invalid + {8}, // Post-state output root is valid + } + for _, test := range tests { + test := test + t.Run(fmt.Sprintf("Dispute_%v", test.disputeL2BlockNumber), func(t *testing.T) { + op_e2e.InitParallel(t, op_e2e.UsesCannon) + + ctx := context.Background() + sys, _ := StartFaultDisputeSystem(t) + + disputeGameFactory := disputegame.NewFactoryHelper(t, ctx, sys) + game := disputeGameFactory.StartOutputCannonGame(ctx, "sequencer", test.disputeL2BlockNumber, common.Hash{0x01}) + game.DisputeLastBlock(ctx) + game.LogGameData(ctx) + + game.StartChallenger(ctx, "Challenger", challenger.WithPrivKey(sys.Cfg.Secrets.Alice)) + + splitDepth := game.SplitDepth(ctx) + game.WaitForClaimAtDepth(ctx, splitDepth+1) + }) + } +} + +func TestOutputCannonDisputeGame(t *testing.T) { + op_e2e.InitParallel(t, op_e2e.UsesCannon) + tests := []struct { + name string + defendClaimDepth types.Depth + }{ + {"StepFirst", 0}, + {"StepMiddle", 28}, + {"StepInExtension", 1}, + } + for _, test := range tests { + test := test + t.Run(test.name, func(t *testing.T) { + op_e2e.InitParallel(t, op_e2e.UsesCannon) + + ctx := context.Background() + sys, l1Client := StartFaultDisputeSystem(t) + t.Cleanup(sys.Close) + + disputeGameFactory := disputegame.NewFactoryHelper(t, ctx, sys) + game := disputeGameFactory.StartOutputCannonGame(ctx, "sequencer", 1, common.Hash{0x01, 0xaa}) + require.NotNil(t, game) + game.LogGameData(ctx) + + outputClaim := game.DisputeLastBlock(ctx) + splitDepth := game.SplitDepth(ctx) + + game.StartChallenger(ctx, "Challenger", challenger.WithPrivKey(sys.Cfg.Secrets.Alice)) + + game.DefendClaim( + ctx, + outputClaim, + func(claim *disputegame.ClaimHelper) *disputegame.ClaimHelper { + if claim.Depth()+1 == splitDepth+test.defendClaimDepth { + return claim.Defend(ctx, common.Hash{byte(claim.Depth())}) + } else { + return claim.Attack(ctx, common.Hash{byte(claim.Depth())}) + } + }) + + sys.TimeTravelClock.AdvanceTime(game.MaxClockDuration(ctx)) + require.NoError(t, wait.ForNextBlock(ctx, l1Client)) + + game.LogGameData(ctx) + game.WaitForGameStatus(ctx, gameTypes.GameStatusChallengerWon) + }) + } +} + +func TestOutputCannonDefendStep(t *testing.T) { + op_e2e.InitParallel(t, op_e2e.UsesCannon) + + ctx := context.Background() + sys, l1Client := StartFaultDisputeSystem(t) + t.Cleanup(sys.Close) + + disputeGameFactory := disputegame.NewFactoryHelper(t, ctx, sys) + game := disputeGameFactory.StartOutputCannonGame(ctx, "sequencer", 1, common.Hash{0x01, 0xaa}) + require.NotNil(t, game) + outputRootClaim := game.DisputeLastBlock(ctx) + game.LogGameData(ctx) + + game.StartChallenger(ctx, "Challenger", challenger.WithPrivKey(sys.Cfg.Secrets.Alice)) + + correctTrace := game.CreateHonestActor(ctx, "sequencer", challenger.WithPrivKey(sys.Cfg.Secrets.Mallory)) + + maxDepth := game.MaxDepth(ctx) + game.DefendClaim(ctx, outputRootClaim, func(claim *disputegame.ClaimHelper) *disputegame.ClaimHelper { + // Post invalid claims for most steps to get down into the early part of the trace + if claim.Depth() < maxDepth-3 { + return claim.Attack(ctx, common.Hash{0xaa}) + } else { + // Post our own counter but using the correct hash in low levels to force a defense step + return correctTrace.AttackClaim(ctx, claim) + } + }) + + sys.TimeTravelClock.AdvanceTime(game.MaxClockDuration(ctx)) + require.NoError(t, wait.ForNextBlock(ctx, l1Client)) + + game.WaitForInactivity(ctx, 10, true) + game.LogGameData(ctx) + require.EqualValues(t, gameTypes.GameStatusChallengerWon, game.Status(ctx)) +} + +func TestOutputCannonStepWithLargePreimage(t *testing.T) { + op_e2e.InitParallel(t, op_e2e.UsesCannon) + + ctx := context.Background() + sys, _ := StartFaultDisputeSystem(t, WithBatcherStopped()) + t.Cleanup(sys.Close) + + // Manually send a tx from the correct batcher key to the batcher input with very large (invalid) data + // This forces op-program to load a large preimage. + sys.BatcherHelper().SendLargeInvalidBatch(ctx) + + require.NoError(t, sys.BatchSubmitter.Start(ctx)) + + safeHead, err := wait.ForNextSafeBlock(ctx, sys.NodeClient("sequencer")) + require.NoError(t, err, "Batcher should resume submitting valid batches") + + l2BlockNumber := safeHead.NumberU64() + disputeGameFactory := disputegame.NewFactoryHelper(t, ctx, sys) + // Dispute any block - it will have to read the L1 batches to see if the block is reached + game := disputeGameFactory.StartOutputCannonGame(ctx, "sequencer", l2BlockNumber, common.Hash{0x01, 0xaa}) + require.NotNil(t, game) + outputRootClaim := game.DisputeBlock(ctx, l2BlockNumber) + game.LogGameData(ctx) + + game.StartChallenger(ctx, "Challenger", challenger.WithPrivKey(sys.Cfg.Secrets.Alice)) + + // Wait for the honest challenger to dispute the outputRootClaim. + // This creates a root of an execution game that we challenge by + // coercing a step at a preimage trace index. + outputRootClaim = outputRootClaim.WaitForCounterClaim(ctx) + + game.LogGameData(ctx) + // Now the honest challenger is positioned as the defender of the + // execution game. We then move to challenge it to induce a large preimage load. + sender := sys.Cfg.Secrets.Addresses().Alice + preimageLoadCheck := game.CreateStepLargePreimageLoadCheck(ctx, sender) + game.ChallengeToPreimageLoad(ctx, outputRootClaim, sys.Cfg.Secrets.Alice, utils.PreimageLargerThan(preimage.MinPreimageSize), preimageLoadCheck, false) + // The above method already verified the image was uploaded and step called successfully + // So we don't waste time resolving the game - that's tested elsewhere. +} + +func TestOutputCannonStepWithPreimage(t *testing.T) { + op_e2e.InitParallel(t, op_e2e.UsesCannon) + testPreimageStep := func(t *testing.T, preimageType utils.PreimageOpt, preloadPreimage bool) { + op_e2e.InitParallel(t, op_e2e.UsesCannon) + + ctx := context.Background() + sys, _ := StartFaultDisputeSystem(t, WithBlobBatches()) + t.Cleanup(sys.Close) + + disputeGameFactory := disputegame.NewFactoryHelper(t, ctx, sys) + game := disputeGameFactory.StartOutputCannonGame(ctx, "sequencer", 1, common.Hash{0x01, 0xaa}) + require.NotNil(t, game) + outputRootClaim := game.DisputeLastBlock(ctx) + game.LogGameData(ctx) + + game.StartChallenger(ctx, "Challenger", challenger.WithPrivKey(sys.Cfg.Secrets.Alice)) + + // Wait for the honest challenger to dispute the outputRootClaim. This creates a root of an execution game that we challenge by coercing + // a step at a preimage trace index. + outputRootClaim = outputRootClaim.WaitForCounterClaim(ctx) + + // Now the honest challenger is positioned as the defender of the execution game + // We then move to challenge it to induce a preimage load + preimageLoadCheck := game.CreateStepPreimageLoadCheck(ctx) + game.ChallengeToPreimageLoad(ctx, outputRootClaim, sys.Cfg.Secrets.Alice, preimageType, preimageLoadCheck, preloadPreimage) + // The above method already verified the image was uploaded and step called successfully + // So we don't waste time resolving the game - that's tested elsewhere. + } + + preimageConditions := []string{"keccak", "sha256", "blob"} + for _, preimageType := range preimageConditions { + preimageType := preimageType + t.Run("non-existing preimage-"+preimageType, func(t *testing.T) { + testPreimageStep(t, utils.FirstPreimageLoadOfType(preimageType), false) + }) + } + // Only test pre-existing images with one type to save runtime + t.Run("preimage already exists", func(t *testing.T) { + testPreimageStep(t, utils.FirstKeccakPreimageLoad(), true) + }) +} + +func TestOutputCannonStepWithKZGPointEvaluation(t *testing.T) { + op_e2e.InitParallel(t, op_e2e.UsesCannon) + + testPreimageStep := func(t *testing.T, preloadPreimage bool) { + op_e2e.InitParallel(t, op_e2e.UsesCannon) + + ctx := context.Background() + sys, _ := StartFaultDisputeSystem(t, WithEcotone()) + t.Cleanup(sys.Close) + + // NOTE: Flake prevention + // Ensure that the L1 origin including the point eval tx isn't on the genesis epoch. + safeBlock, err := sys.Clients["sequencer"].BlockByNumber(ctx, big.NewInt(int64(rpc.SafeBlockNumber))) + require.NoError(t, err) + require.NoError(t, wait.ForSafeBlock(ctx, sys.RollupClient("sequencer"), safeBlock.NumberU64()+3)) + + receipt := SendKZGPointEvaluationTx(t, sys, "sequencer", sys.Cfg.Secrets.Alice) + precompileBlock := receipt.BlockNumber + t.Logf("KZG Point Evaluation block number: %d", precompileBlock) + + disputeGameFactory := disputegame.NewFactoryHelper(t, ctx, sys) + game := disputeGameFactory.StartOutputCannonGame(ctx, "sequencer", precompileBlock.Uint64(), common.Hash{0x01, 0xaa}) + require.NotNil(t, game) + outputRootClaim := game.DisputeLastBlock(ctx) + game.LogGameData(ctx) + + game.StartChallenger(ctx, "Challenger", challenger.WithPrivKey(sys.Cfg.Secrets.Alice)) + + // Wait for the honest challenger to dispute the outputRootClaim. This creates a root of an execution game that we challenge by coercing + // a step at a preimage trace index. + outputRootClaim = outputRootClaim.WaitForCounterClaim(ctx) + + // Now the honest challenger is positioned as the defender of the execution game + // We then move to challenge it to induce a preimage load + preimageLoadCheck := game.CreateStepPreimageLoadCheck(ctx) + game.ChallengeToPreimageLoad(ctx, outputRootClaim, sys.Cfg.Secrets.Alice, utils.FirstPrecompilePreimageLoad(), preimageLoadCheck, preloadPreimage) + // The above method already verified the image was uploaded and step called successfully + // So we don't waste time resolving the game - that's tested elsewhere. + } + + t.Run("non-existing preimage", func(t *testing.T) { + testPreimageStep(t, false) + }) + t.Run("preimage already exists", func(t *testing.T) { + testPreimageStep(t, true) + }) +} + +func TestOutputCannonProposedOutputRootValid(t *testing.T) { + op_e2e.InitParallel(t, op_e2e.UsesCannon) + // honestStepsFail attempts to perform both an attack and defend step using the correct trace. + honestStepsFail := func(ctx context.Context, game *disputegame.OutputCannonGameHelper, correctTrace *disputegame.OutputHonestHelper, parentClaimIdx int64) { + // Attack step should fail + correctTrace.StepFails(ctx, parentClaimIdx, true) + // Defending should fail too + correctTrace.StepFails(ctx, parentClaimIdx, false) + } + tests := []struct { + // name is the name of the test + name string + + // performMove is called to respond to each claim posted by the honest op-challenger. + // It should either attack or defend the claim at parentClaimIdx + performMove func(ctx context.Context, game *disputegame.OutputCannonGameHelper, correctTrace *disputegame.OutputHonestHelper, claim *disputegame.ClaimHelper) *disputegame.ClaimHelper + + // performStep is called once the maximum game depth is reached. It should perform a step to counter the + // claim at parentClaimIdx. Since the proposed output root is invalid, the step call should always revert. + performStep func(ctx context.Context, game *disputegame.OutputCannonGameHelper, correctTrace *disputegame.OutputHonestHelper, parentClaimIdx int64) + }{ + { + name: "AttackWithCorrectTrace", + performMove: func(ctx context.Context, game *disputegame.OutputCannonGameHelper, correctTrace *disputegame.OutputHonestHelper, claim *disputegame.ClaimHelper) *disputegame.ClaimHelper { + // Attack everything but oddly using the correct hash. + // Except the root of the cannon game must have an invalid VM status code. + if claim.IsOutputRootLeaf(ctx) { + return claim.Attack(ctx, common.Hash{0x01}) + } + return correctTrace.AttackClaim(ctx, claim) + }, + performStep: honestStepsFail, + }, + { + name: "DefendWithCorrectTrace", + performMove: func(ctx context.Context, game *disputegame.OutputCannonGameHelper, correctTrace *disputegame.OutputHonestHelper, claim *disputegame.ClaimHelper) *disputegame.ClaimHelper { + // Can only attack the root claim or the first cannon claim + if claim.IsRootClaim() { + return correctTrace.AttackClaim(ctx, claim) + } + // The root of the cannon game must have an invalid VM status code + // Attacking ensure we're running the cannon trace between two different blocks + // instead of being in the trace extension of the output root bisection + if claim.IsOutputRootLeaf(ctx) { + return claim.Attack(ctx, common.Hash{0x01}) + } + // Otherwise, defend everything using the correct hash. + return correctTrace.DefendClaim(ctx, claim) + }, + performStep: honestStepsFail, + }, + } + + for _, test := range tests { + test := test + t.Run(test.name, func(t *testing.T) { + op_e2e.InitParallel(t, op_e2e.UsesCannon) + + ctx := context.Background() + sys, l1Client := StartFaultDisputeSystem(t) + t.Cleanup(sys.Close) + + disputeGameFactory := disputegame.NewFactoryHelper(t, ctx, sys) + game := disputeGameFactory.StartOutputCannonGameWithCorrectRoot(ctx, "sequencer", 1) + correctTrace := game.CreateHonestActor(ctx, "sequencer", challenger.WithPrivKey(sys.Cfg.Secrets.Mallory)) + + game.StartChallenger(ctx, "Challenger", challenger.WithPrivKey(sys.Cfg.Secrets.Alice)) + + // Now maliciously play the game and it should be impossible to win + game.ChallengeClaim(ctx, + game.RootClaim(ctx), + func(claim *disputegame.ClaimHelper) *disputegame.ClaimHelper { + return test.performMove(ctx, game, correctTrace, claim) + }, + func(parentClaimIdx int64) { + test.performStep(ctx, game, correctTrace, parentClaimIdx) + }) + + // Time travel past when the game will be resolvable. + sys.TimeTravelClock.AdvanceTime(game.MaxClockDuration(ctx)) + require.NoError(t, wait.ForNextBlock(ctx, l1Client)) + + game.WaitForInactivity(ctx, 10, true) + game.LogGameData(ctx) + require.EqualValues(t, gameTypes.GameStatusDefenderWon, game.Status(ctx)) + }) + } +} + +func TestOutputCannonPoisonedPostState(t *testing.T) { + op_e2e.InitParallel(t, op_e2e.UsesCannon) + + ctx := context.Background() + sys, l1Client := StartFaultDisputeSystem(t) + t.Cleanup(sys.Close) + + disputeGameFactory := disputegame.NewFactoryHelper(t, ctx, sys) + // Root claim is dishonest + game := disputeGameFactory.StartOutputCannonGame(ctx, "sequencer", 1, common.Hash{0xaa}) + correctTrace := game.CreateHonestActor(ctx, "sequencer", challenger.WithPrivKey(sys.Cfg.Secrets.Alice)) + + // Honest first attack at "honest" level + claim := correctTrace.AttackClaim(ctx, game.RootClaim(ctx)) + + // Honest defense at "dishonest" level + claim = correctTrace.DefendClaim(ctx, claim) + + // Dishonest attack at "honest" level - honest move would be to ignore + claimToIgnore1 := claim.Attack(ctx, common.Hash{0x03, 0xaa}) + + // Honest attack at "dishonest" level - honest move would be to ignore + claimToIgnore2 := correctTrace.AttackClaim(ctx, claimToIgnore1) + game.LogGameData(ctx) + + // Start the honest challenger + game.StartChallenger(ctx, "Honest", challenger.WithPrivKey(sys.Cfg.Secrets.Bob)) + + // Start dishonest challenger that posts correct claims + for { + game.LogGameData(ctx) + // Wait for the challenger to counter + // Note that we need to ignore claimToIgnore1 which already counters this... + claim = claim.WaitForCounterClaim(ctx, claimToIgnore1) + + // Respond with our own move + if claim.IsBottomGameRoot(ctx) { + // Root of the cannon game must have the right VM status code (so it can't be honest). + // Note this occurs when there are splitDepth + 4 claims because there are multiple forks in this game. + claim = claim.Attack(ctx, common.Hash{0x01}) + } else { + claim = correctTrace.DefendClaim(ctx, claim) + } + + // Defender moves last. If we're at max depth, then we're done + if claim.IsMaxDepth(ctx) { + break + } + } + + // Wait for the challenger to call step + claim.WaitForCountered(ctx) + // Verify that the challenger didn't challenge our poisoned claims + claimToIgnore1.RequireOnlyCounteredBy(ctx, claimToIgnore2) + claimToIgnore2.RequireOnlyCounteredBy(ctx /* nothing */) + + // Time travel past when the game will be resolvable. + sys.TimeTravelClock.AdvanceTime(game.MaxClockDuration(ctx)) + require.NoError(t, wait.ForNextBlock(ctx, l1Client)) + + game.LogGameData(ctx) + game.WaitForGameStatus(ctx, gameTypes.GameStatusChallengerWon) +} + +func TestDisputeOutputRootBeyondProposedBlock_ValidOutputRoot(t *testing.T) { + op_e2e.InitParallel(t, op_e2e.UsesCannon) + + ctx := context.Background() + sys, l1Client := StartFaultDisputeSystem(t) + t.Cleanup(sys.Close) + + disputeGameFactory := disputegame.NewFactoryHelper(t, ctx, sys) + // Root claim is dishonest + game := disputeGameFactory.StartOutputCannonGameWithCorrectRoot(ctx, "sequencer", 1) + correctTrace := game.CreateHonestActor(ctx, "sequencer", challenger.WithPrivKey(sys.Cfg.Secrets.Alice)) + // Start the honest challenger + game.StartChallenger(ctx, "Honest", challenger.WithPrivKey(sys.Cfg.Secrets.Bob)) + + claim := game.RootClaim(ctx) + // Attack the output root + claim = correctTrace.AttackClaim(ctx, claim) + // Wait for the challenger to respond + claim = claim.WaitForCounterClaim(ctx) + // Then defend until the split depth to force the game into the extension part of the output root bisection + // ie. the output root we wind up disputing is theoretically for a block after block number 1 + for !claim.IsOutputRootLeaf(ctx) { + claim = correctTrace.DefendClaim(ctx, claim) + claim = claim.WaitForCounterClaim(ctx) + } + game.LogGameData(ctx) + // At this point we've reached the bottom of the output root bisection and every claim + // will have the same, valid, output root. We now need to post a cannon trace root that claims its invalid. + claim = claim.Defend(ctx, common.Hash{0x01, 0xaa}) + // Now defend with the correct trace + for { + game.LogGameData(ctx) + claim = claim.WaitForCounterClaim(ctx) + if claim.IsMaxDepth(ctx) { + break + } + claim = correctTrace.DefendClaim(ctx, claim) + } + // Should not be able to step either attacking or defending + correctTrace.StepClaimFails(ctx, claim, true) + correctTrace.StepClaimFails(ctx, claim, false) + + // Time travel past when the game will be resolvable. + sys.TimeTravelClock.AdvanceTime(game.MaxClockDuration(ctx)) + require.NoError(t, wait.ForNextBlock(ctx, l1Client)) + + game.WaitForGameStatus(ctx, gameTypes.GameStatusDefenderWon) + game.LogGameData(ctx) +} + +func TestDisputeOutputRootBeyondProposedBlock_InvalidOutputRoot(t *testing.T) { + op_e2e.InitParallel(t, op_e2e.UsesCannon) + + ctx := context.Background() + sys, l1Client := StartFaultDisputeSystem(t) + t.Cleanup(sys.Close) + + disputeGameFactory := disputegame.NewFactoryHelper(t, ctx, sys) + // Root claim is dishonest + game := disputeGameFactory.StartOutputCannonGame(ctx, "sequencer", 1, common.Hash{0xaa}) + correctTrace := game.CreateHonestActor(ctx, "sequencer", challenger.WithPrivKey(sys.Cfg.Secrets.Alice)) + + // Start the honest challenger + game.StartChallenger(ctx, "Honest", challenger.WithPrivKey(sys.Cfg.Secrets.Bob)) + + claim := game.RootClaim(ctx) + // Wait for the honest challenger to counter the root + claim = claim.WaitForCounterClaim(ctx) + // Then defend until the split depth to force the game into the extension part of the output root bisection + // ie. the output root we wind up disputing is theoretically for a block after block number 1 + // The dishonest actor challenges with the correct roots + for claim.IsOutputRoot(ctx) { + claim = correctTrace.DefendClaim(ctx, claim) + claim = claim.WaitForCounterClaim(ctx) + } + game.LogGameData(ctx) + // Now defend with the correct trace + for !claim.IsMaxDepth(ctx) { + game.LogGameData(ctx) + if claim.IsBottomGameRoot(ctx) { + claim = correctTrace.AttackClaim(ctx, claim) + } else { + claim = correctTrace.DefendClaim(ctx, claim) + } + if !claim.IsMaxDepth(ctx) { + // Have to attack the root of the cannon trace + claim = claim.WaitForCounterClaim(ctx) + } + } + + // Wait for our final claim to be countered by the challenger calling step + claim.WaitForCountered(ctx) + + // Time travel past when the game will be resolvable. + sys.TimeTravelClock.AdvanceTime(game.MaxClockDuration(ctx)) + require.NoError(t, wait.ForNextBlock(ctx, l1Client)) + + game.WaitForGameStatus(ctx, gameTypes.GameStatusChallengerWon) + game.LogGameData(ctx) +} + +func TestDisputeOutputRoot_ChangeClaimedOutputRoot(t *testing.T) { + op_e2e.InitParallel(t, op_e2e.UsesCannon) + + ctx := context.Background() + sys, l1Client := StartFaultDisputeSystem(t) + t.Cleanup(sys.Close) + + disputeGameFactory := disputegame.NewFactoryHelper(t, ctx, sys) + // Root claim is dishonest + game := disputeGameFactory.StartOutputCannonGame(ctx, "sequencer", 1, common.Hash{0xaa}) + correctTrace := game.CreateHonestActor(ctx, "sequencer", challenger.WithPrivKey(sys.Cfg.Secrets.Alice)) + + // Start the honest challenger + game.StartChallenger(ctx, "Honest", challenger.WithPrivKey(sys.Cfg.Secrets.Bob)) + + claim := game.RootClaim(ctx) + // Wait for the honest challenger to counter the root + claim = claim.WaitForCounterClaim(ctx) + + // Then attack every claim until the leaf of output root bisection + for { + claim = claim.Attack(ctx, common.Hash{0xbb}) + claim = claim.WaitForCounterClaim(ctx) + if claim.Depth() == game.SplitDepth(ctx)-1 { + // Post the correct output root as the leaf. + // This is for block 1 which is what the original output root was for too + claim = correctTrace.AttackClaim(ctx, claim) + // Challenger should post the first cannon trace + claim = claim.WaitForCounterClaim(ctx) + break + } + } + + game.LogGameData(ctx) + + // Now defend with the correct trace + for !claim.IsMaxDepth(ctx) { + game.LogGameData(ctx) + if claim.IsBottomGameRoot(ctx) { + claim = correctTrace.AttackClaim(ctx, claim) + } else { + claim = correctTrace.DefendClaim(ctx, claim) + } + if !claim.IsMaxDepth(ctx) { + // Have to attack the root of the cannon trace + claim = claim.WaitForCounterClaim(ctx) + } + } + + // Wait for our final claim to be countered by the challenger calling step + claim.WaitForCountered(ctx) + + // Time travel past when the game will be resolvable. + sys.TimeTravelClock.AdvanceTime(game.MaxClockDuration(ctx)) + require.NoError(t, wait.ForNextBlock(ctx, l1Client)) + + game.WaitForGameStatus(ctx, gameTypes.GameStatusChallengerWon) + game.LogGameData(ctx) +} + +func TestInvalidateUnsafeProposal(t *testing.T) { + op_e2e.InitParallel(t, op_e2e.UsesCannon) + ctx := context.Background() + + tests := []struct { + name string + strategy func(correctTrace *disputegame.OutputHonestHelper, parent *disputegame.ClaimHelper) *disputegame.ClaimHelper + }{ + { + name: "Attack", + strategy: func(correctTrace *disputegame.OutputHonestHelper, parent *disputegame.ClaimHelper) *disputegame.ClaimHelper { + return correctTrace.AttackClaim(ctx, parent) + }, + }, + { + name: "Defend", + strategy: func(correctTrace *disputegame.OutputHonestHelper, parent *disputegame.ClaimHelper) *disputegame.ClaimHelper { + return correctTrace.DefendClaim(ctx, parent) + }, + }, + { + name: "Counter", + strategy: func(correctTrace *disputegame.OutputHonestHelper, parent *disputegame.ClaimHelper) *disputegame.ClaimHelper { + return correctTrace.CounterClaim(ctx, parent) + }, + }, + } + + for _, test := range tests { + test := test + t.Run(test.name, func(t *testing.T) { + op_e2e.InitParallel(t, op_e2e.UsesCannon) + sys, l1Client := StartFaultDisputeSystem(t, WithSequencerWindowSize(100000), WithBatcherStopped()) + t.Cleanup(sys.Close) + + blockNum := uint64(1) + disputeGameFactory := disputegame.NewFactoryHelper(t, ctx, sys) + // Root claim is _dishonest_ because the required data is not available on L1 + game := disputeGameFactory.StartOutputCannonGameWithCorrectRoot(ctx, "sequencer", blockNum, disputegame.WithUnsafeProposal()) + + correctTrace := game.CreateHonestActor(ctx, "sequencer", challenger.WithPrivKey(sys.Cfg.Secrets.Alice)) + + // Start the honest challenger + game.StartChallenger(ctx, "Challenger", challenger.WithPrivKey(sys.Cfg.Secrets.Bob)) + + game.DefendClaim(ctx, game.RootClaim(ctx), func(parent *disputegame.ClaimHelper) *disputegame.ClaimHelper { + if parent.IsBottomGameRoot(ctx) { + return correctTrace.AttackClaim(ctx, parent) + } + return test.strategy(correctTrace, parent) + }) + + // Time travel past when the game will be resolvable. + sys.TimeTravelClock.AdvanceTime(game.MaxClockDuration(ctx)) + require.NoError(t, wait.ForNextBlock(ctx, l1Client)) + + game.WaitForGameStatus(ctx, gameTypes.GameStatusChallengerWon) + game.LogGameData(ctx) + }) + } +} + +func TestInvalidateProposalForFutureBlock(t *testing.T) { + op_e2e.InitParallel(t, op_e2e.UsesCannon) + ctx := context.Background() + + tests := []struct { + name string + strategy func(correctTrace *disputegame.OutputHonestHelper, parent *disputegame.ClaimHelper) *disputegame.ClaimHelper + }{ + { + name: "Attack", + strategy: func(correctTrace *disputegame.OutputHonestHelper, parent *disputegame.ClaimHelper) *disputegame.ClaimHelper { + return correctTrace.AttackClaim(ctx, parent) + }, + }, + { + name: "Defend", + strategy: func(correctTrace *disputegame.OutputHonestHelper, parent *disputegame.ClaimHelper) *disputegame.ClaimHelper { + return correctTrace.DefendClaim(ctx, parent) + }, + }, + { + name: "Counter", + strategy: func(correctTrace *disputegame.OutputHonestHelper, parent *disputegame.ClaimHelper) *disputegame.ClaimHelper { + return correctTrace.CounterClaim(ctx, parent) + }, + }, + } + + for _, test := range tests { + test := test + t.Run(test.name, func(t *testing.T) { + op_e2e.InitParallel(t, op_e2e.UsesCannon) + sys, l1Client := StartFaultDisputeSystem(t, WithSequencerWindowSize(100000)) + t.Cleanup(sys.Close) + + farFutureBlockNum := uint64(10_000_000) + disputeGameFactory := disputegame.NewFactoryHelper(t, ctx, sys) + // Root claim is _dishonest_ because the required data is not available on L1 + game := disputeGameFactory.StartOutputCannonGame(ctx, "sequencer", farFutureBlockNum, common.Hash{0xaa}, disputegame.WithFutureProposal()) + + correctTrace := game.CreateHonestActor(ctx, "sequencer", challenger.WithPrivKey(sys.Cfg.Secrets.Alice)) + + // Start the honest challenger + game.StartChallenger(ctx, "Honest", challenger.WithPrivKey(sys.Cfg.Secrets.Bob)) + + game.DefendClaim(ctx, game.RootClaim(ctx), func(parent *disputegame.ClaimHelper) *disputegame.ClaimHelper { + if parent.IsBottomGameRoot(ctx) { + return correctTrace.AttackClaim(ctx, parent) + } + return test.strategy(correctTrace, parent) + }) + + // Time travel past when the game will be resolvable. + sys.TimeTravelClock.AdvanceTime(game.MaxClockDuration(ctx)) + require.NoError(t, wait.ForNextBlock(ctx, l1Client)) + + game.WaitForGameStatus(ctx, gameTypes.GameStatusChallengerWon) + game.LogGameData(ctx) + }) + } +} + +func TestInvalidateCorrectProposalFutureBlock(t *testing.T) { + op_e2e.InitParallel(t, op_e2e.UsesCannon) + ctx := context.Background() + // Spin up the system without the batcher so the safe head doesn't advance + sys, l1Client := StartFaultDisputeSystem(t, WithBatcherStopped(), WithSequencerWindowSize(100000)) + t.Cleanup(sys.Close) + + // Create a dispute game factory helper. + disputeGameFactory := disputegame.NewFactoryHelper(t, ctx, sys) + + // No batches submitted so safe head is genesis + output, err := sys.RollupClient("sequencer").OutputAtBlock(ctx, 0) + require.NoError(t, err, "Failed to get output at safe head") + // Create a dispute game with an output root that is valid at `safeHead`, but that claims to correspond to block + // `safeHead.Number + 10000`. This is dishonest, because this block does not exist yet. + game := disputeGameFactory.StartOutputCannonGame(ctx, "sequencer", 10_000, common.Hash(output.OutputRoot), disputegame.WithFutureProposal()) + + // Start the honest challenger. + game.StartChallenger(ctx, "Honest", challenger.WithPrivKey(sys.Cfg.Secrets.Bob)) + + game.WaitForL2BlockNumberChallenged(ctx) + + // Time travel past when the game will be resolvable. + sys.TimeTravelClock.AdvanceTime(game.MaxClockDuration(ctx)) + require.NoError(t, wait.ForNextBlock(ctx, l1Client)) + + // The game should resolve as `CHALLENGER_WINS` always, because the root claim signifies a claim that does not exist + // yet in the L2 chain. + game.WaitForGameStatus(ctx, gameTypes.GameStatusChallengerWon) + game.LogGameData(ctx) +} diff --git a/op-e2e2/faultproofs/precompile_test.go b/op-e2e2/faultproofs/precompile_test.go new file mode 100644 index 000000000000..ea27d1fa61c0 --- /dev/null +++ b/op-e2e2/faultproofs/precompile_test.go @@ -0,0 +1,173 @@ +package faultproofs + +import ( + "context" + "encoding/json" + "fmt" + "math" + "path/filepath" + "testing" + + "github.com/ethereum-optimism/optimism/cannon/mipsevm" + "github.com/ethereum-optimism/optimism/op-challenger/config" + "github.com/ethereum-optimism/optimism/op-challenger/game/fault/trace/cannon" + "github.com/ethereum-optimism/optimism/op-challenger/game/fault/trace/utils" + "github.com/ethereum-optimism/optimism/op-challenger/metrics" + op_e2e "github.com/ethereum-optimism/optimism/op-e2e2" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/challenger" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/wait" + "github.com/ethereum-optimism/optimism/op-service/client" + "github.com/ethereum-optimism/optimism/op-service/ioutil" + "github.com/ethereum-optimism/optimism/op-service/sources" + "github.com/ethereum-optimism/optimism/op-service/testlog" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/rpc" + "github.com/stretchr/testify/require" +) + +func TestPrecompiles(t *testing.T) { + op_e2e.InitParallel(t, op_e2e.UsesCannon) + // precompile test vectors copied from go-ethereum + tests := []struct { + name string + address common.Address + input []byte + }{ + { + name: "ecrecover", + address: common.BytesToAddress([]byte{0x01}), + input: common.FromHex("18c547e4f7b0f325ad1e56f57e26c745b09a3e503d86e00e5255ff7f715d3d1c000000000000000000000000000000000000000000000000000000000000001c73b1693892219d736caba55bdb67216e485557ea6b6af75f37096c9aa6a5a75feeb940b1d03b21e36b0e47e79769f095fe2ab855bd91e3a38756b7d75a9c4549"), + }, + { + name: "sha256", + address: common.BytesToAddress([]byte{0x02}), + input: common.FromHex("68656c6c6f20776f726c64"), + }, + { + name: "ripemd160", + address: common.BytesToAddress([]byte{0x03}), + input: common.FromHex("68656c6c6f20776f726c64"), + }, + { + name: "bn256Pairing", + address: common.BytesToAddress([]byte{0x08}), + input: common.FromHex("1c76476f4def4bb94541d57ebba1193381ffa7aa76ada664dd31c16024c43f593034dd2920f673e204fee2811c678745fc819b55d3e9d294e45c9b03a76aef41209dd15ebff5d46c4bd888e51a93cf99a7329636c63514396b4a452003a35bf704bf11ca01483bfa8b34b43561848d28905960114c8ac04049af4b6315a416782bb8324af6cfc93537a2ad1a445cfd0ca2a71acd7ac41fadbf933c2a51be344d120a2a4cf30c1bf9845f20c6fe39e07ea2cce61f0c9bb048165fe5e4de877550111e129f1cf1097710d41c4ac70fcdfa5ba2023c6ff1cbeac322de49d1b6df7c2032c61a830e3c17286de9462bf242fca2883585b93870a73853face6a6bf411198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c21800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa"), + }, + { + name: "blake2F", + address: common.BytesToAddress([]byte{0x09}), + input: common.FromHex("0000000048c9bdf267e6096a3ba7ca8485ae67bb2bf894fe72f36e3cf1361d5f3af54fa5d182e6ad7f520e511f6c3e2b8c68059b6bbd41fbabd9831f79217e1319cde05b61626300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000001"), + }, + { + name: "kzgPointEvaluation", + address: common.BytesToAddress([]byte{0x0a}), + input: common.FromHex("01e798154708fe7789429634053cbf9f99b619f9f084048927333fce637f549b564c0a11a0f704f4fc3e8acfe0f8245f0ad1347b378fbf96e206da11a5d3630624d25032e67a7e6a4910df5834b8fe70e6bcfeeac0352434196bdf4b2485d5a18f59a8d2a1a625a17f3fea0fe5eb8c896db3764f3185481bc22f91b4aaffcca25f26936857bc3a7c2539ea8ec3a952b7873033e038326e87ed3e1276fd140253fa08e9fc25fb2d9a98527fc22a2c9612fbeafdad446cbc7bcdbdcd780af2c16a"), + }, + } + for _, test := range tests { + test := test + t.Run(test.name, func(t *testing.T) { + op_e2e.InitParallel(t, op_e2e.UsesCannon) + ctx := context.Background() + cfg := op_e2e.DefaultSystemConfig(t) + // We don't need a verifier - just the sequencer is enough + delete(cfg.Nodes, "verifier") + // Use a small sequencer window size to avoid test timeout while waiting for empty blocks + // But not too small to ensure that our claim and subsequent state change is published + cfg.DeployConfig.SequencerWindowSize = 16 + minTs := hexutil.Uint64(0) + cfg.DeployConfig.L2GenesisDeltaTimeOffset = &minTs + cfg.DeployConfig.L2GenesisEcotoneTimeOffset = &minTs + + sys, err := cfg.Start(t) + require.Nil(t, err, "Error starting up system") + defer sys.Close() + + log := testlog.Logger(t, log.LevelInfo) + log.Info("genesis", "l2", sys.RollupConfig.Genesis.L2, "l1", sys.RollupConfig.Genesis.L1, "l2_time", sys.RollupConfig.Genesis.L2Time) + + l1Client := sys.Clients["l1"] + l2Seq := sys.Clients["sequencer"] + rollupRPCClient, err := rpc.DialContext(context.Background(), sys.RollupNodes["sequencer"].HTTPEndpoint()) + require.Nil(t, err) + rollupClient := sources.NewRollupClient(client.NewBaseRPCClient(rollupRPCClient)) + + aliceKey := cfg.Secrets.Alice + + t.Log("Capture current L2 head as agreed starting point") + latestBlock, err := l2Seq.BlockByNumber(ctx, nil) + require.NoError(t, err) + agreedL2Output, err := rollupClient.OutputAtBlock(ctx, latestBlock.NumberU64()) + require.NoError(t, err, "could not retrieve l2 agreed block") + l2Head := agreedL2Output.BlockRef.Hash + l2OutputRoot := agreedL2Output.OutputRoot + + receipt := op_e2e.SendL2Tx(t, cfg, l2Seq, aliceKey, func(opts *op_e2e.TxOpts) { + opts.Gas = 1_000_000 + opts.ToAddr = &test.address + opts.Nonce = 0 + opts.Data = test.input + }) + + t.Log("Determine L2 claim") + l2ClaimBlockNumber := receipt.BlockNumber + l2Output, err := rollupClient.OutputAtBlock(ctx, l2ClaimBlockNumber.Uint64()) + require.NoError(t, err, "could not get expected output") + l2Claim := l2Output.OutputRoot + + t.Log("Determine L1 head that includes all batches required for L2 claim block") + require.NoError(t, wait.ForSafeBlock(ctx, rollupClient, l2ClaimBlockNumber.Uint64())) + l1HeadBlock, err := l1Client.BlockByNumber(ctx, nil) + require.NoError(t, err, "get l1 head block") + l1Head := l1HeadBlock.Hash() + + inputs := utils.LocalGameInputs{ + L1Head: l1Head, + L2Head: l2Head, + L2Claim: common.Hash(l2Claim), + L2OutputRoot: common.Hash(l2OutputRoot), + L2BlockNumber: l2ClaimBlockNumber, + } + runCannon(t, ctx, sys, inputs, "sequencer") + }) + } +} + +func runCannon(t *testing.T, ctx context.Context, sys *op_e2e.System, inputs utils.LocalGameInputs, l2Node string) { + l1Endpoint := sys.NodeEndpoint("l1") + l1Beacon := sys.L1BeaconEndpoint() + rollupEndpoint := sys.RollupEndpoint("sequencer") + l2Endpoint := sys.NodeEndpoint("sequencer") + cannonOpts := challenger.WithCannon(t, sys.RollupCfg(), sys.L2Genesis()) + dir := t.TempDir() + proofsDir := filepath.Join(dir, "cannon-proofs") + cfg := config.NewConfig(common.Address{}, l1Endpoint, l1Beacon, rollupEndpoint, l2Endpoint, dir) + cannonOpts(&cfg) + + logger := testlog.Logger(t, log.LevelInfo).New("role", "cannon") + executor := cannon.NewExecutor(logger, metrics.NoopMetrics, &cfg, cfg.CannonAbsolutePreState, inputs) + + t.Log("Running cannon") + err := executor.GenerateProof(ctx, proofsDir, math.MaxUint) + require.NoError(t, err, "failed to generate proof") + + state, err := parseState(filepath.Join(proofsDir, "final.json.gz")) + require.NoError(t, err, "failed to parse state") + t.Logf("Completed in %d steps", state.Step) +} + +func parseState(path string) (*mipsevm.State, error) { + file, err := ioutil.OpenDecompressed(path) + if err != nil { + return nil, fmt.Errorf("cannot open state file (%v): %w", path, err) + } + defer file.Close() + var state mipsevm.State + err = json.NewDecoder(file).Decode(&state) + if err != nil { + return nil, fmt.Errorf("invalid mipsevm state (%v): %w", path, err) + } + return &state, nil +} diff --git a/op-e2e2/faultproofs/preimages_test.go b/op-e2e2/faultproofs/preimages_test.go new file mode 100644 index 000000000000..cdcd422f7707 --- /dev/null +++ b/op-e2e2/faultproofs/preimages_test.go @@ -0,0 +1,53 @@ +package faultproofs + +import ( + "context" + "fmt" + "testing" + + op_e2e "github.com/ethereum-optimism/optimism/op-e2e2" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/disputegame" + preimage "github.com/ethereum-optimism/optimism/op-preimage" + "github.com/ethereum-optimism/optimism/op-program/client" + "github.com/ethereum/go-ethereum/common" + "github.com/stretchr/testify/require" +) + +func TestLocalPreimages(t *testing.T) { + op_e2e.InitParallel(t, op_e2e.UsesCannon) + tests := []struct { + key preimage.Key + }{ + {key: client.L1HeadLocalIndex}, + {key: client.L2OutputRootLocalIndex}, + {key: client.L2ClaimLocalIndex}, + {key: client.L2ClaimBlockNumberLocalIndex}, + // We don't check client.L2ChainIDLocalIndex because e2e tests use a custom chain configuration + // which requires using a custom chain ID indicator so op-program will load the full rollup config and + // genesis from the preimage oracle + } + for _, test := range tests { + test := test + t.Run(fmt.Sprintf("preimage-%v", test.key), func(t *testing.T) { + op_e2e.InitParallel(t, op_e2e.UsesCannon) + + ctx := context.Background() + sys, _ := StartFaultDisputeSystem(t) + t.Cleanup(sys.Close) + + disputeGameFactory := disputegame.NewFactoryHelper(t, ctx, sys) + game := disputeGameFactory.StartOutputCannonGame(ctx, "sequencer", 3, common.Hash{0x01, 0xaa}) + require.NotNil(t, game) + claim := game.DisputeLastBlock(ctx) + + // Create the root of the cannon trace. + claim = claim.Attack(ctx, common.Hash{0x01}) + + game.LogGameData(ctx) + + game.VerifyPreimage(ctx, claim, test.key) + + game.LogGameData(ctx) + }) + } +} diff --git a/op-e2e2/faultproofs/util.go b/op-e2e2/faultproofs/util.go new file mode 100644 index 000000000000..41433527ae76 --- /dev/null +++ b/op-e2e2/faultproofs/util.go @@ -0,0 +1,74 @@ +package faultproofs + +import ( + "crypto/ecdsa" + "testing" + + batcherFlags "github.com/ethereum-optimism/optimism/op-batcher/flags" + op_e2e "github.com/ethereum-optimism/optimism/op-e2e2" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/stretchr/testify/require" +) + +type faultDisputeConfigOpts func(cfg *op_e2e.SystemConfig) + +func WithBatcherStopped() faultDisputeConfigOpts { + return func(cfg *op_e2e.SystemConfig) { + cfg.DisableBatcher = true + } +} + +func WithBlobBatches() faultDisputeConfigOpts { + return func(cfg *op_e2e.SystemConfig) { + cfg.DataAvailabilityType = batcherFlags.BlobsType + + genesisActivation := hexutil.Uint64(0) + cfg.DeployConfig.L1CancunTimeOffset = &genesisActivation + cfg.DeployConfig.L2GenesisDeltaTimeOffset = &genesisActivation + cfg.DeployConfig.L2GenesisEcotoneTimeOffset = &genesisActivation + } +} + +func WithEcotone() faultDisputeConfigOpts { + return func(cfg *op_e2e.SystemConfig) { + genesisActivation := hexutil.Uint64(0) + cfg.DeployConfig.L1CancunTimeOffset = &genesisActivation + cfg.DeployConfig.L2GenesisDeltaTimeOffset = &genesisActivation + cfg.DeployConfig.L2GenesisEcotoneTimeOffset = &genesisActivation + } +} + +func WithSequencerWindowSize(size uint64) faultDisputeConfigOpts { + return func(cfg *op_e2e.SystemConfig) { + cfg.DeployConfig.SequencerWindowSize = size + } +} + +func StartFaultDisputeSystem(t *testing.T, opts ...faultDisputeConfigOpts) (*op_e2e.System, *ethclient.Client) { + cfg := op_e2e.DefaultSystemConfig(t) + delete(cfg.Nodes, "verifier") + cfg.Nodes["sequencer"].SafeDBPath = t.TempDir() + cfg.DeployConfig.SequencerWindowSize = 4 + cfg.DeployConfig.FinalizationPeriodSeconds = 2 + cfg.SupportL1TimeTravel = true + cfg.DeployConfig.L2OutputOracleSubmissionInterval = 1 + cfg.NonFinalizedProposals = true // Submit output proposals asap + for _, opt := range opts { + opt(&cfg) + } + sys, err := cfg.Start(t) + require.Nil(t, err, "Error starting up system") + return sys, sys.Clients["l1"] +} + +func SendKZGPointEvaluationTx(t *testing.T, sys *op_e2e.System, l2Node string, privateKey *ecdsa.PrivateKey) *types.Receipt { + return op_e2e.SendL2Tx(t, sys.Cfg, sys.Clients[l2Node], privateKey, func(opts *op_e2e.TxOpts) { + precompile := common.BytesToAddress([]byte{0x0a}) + opts.Gas = 100_000 + opts.ToAddr = &precompile + opts.Data = common.FromHex("01e798154708fe7789429634053cbf9f99b619f9f084048927333fce637f549b564c0a11a0f704f4fc3e8acfe0f8245f0ad1347b378fbf96e206da11a5d3630624d25032e67a7e6a4910df5834b8fe70e6bcfeeac0352434196bdf4b2485d5a18f59a8d2a1a625a17f3fea0fe5eb8c896db3764f3185481bc22f91b4aaffcca25f26936857bc3a7c2539ea8ec3a952b7873033e038326e87ed3e1276fd140253fa08e9fc25fb2d9a98527fc22a2c9612fbeafdad446cbc7bcdbdcd780af2c16a") + }) +} diff --git a/op-e2e2/helper.go b/op-e2e2/helper.go new file mode 100644 index 000000000000..457ac224e458 --- /dev/null +++ b/op-e2e2/helper.go @@ -0,0 +1,108 @@ +package op_e2e + +import ( + "crypto/md5" + "os" + "strconv" + "strings" + + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils" +) + +var enableParallelTesting bool = os.Getenv("OP_E2E_DISABLE_PARALLEL") != "true" + +func InitParallel(t e2eutils.TestingBase, args ...func(t e2eutils.TestingBase)) { + t.Helper() + if enableParallelTesting { + t.Parallel() + } + for _, arg := range args { + arg(t) + } + autoAllocateExecutor(t) +} + +// isSubTest determines if the test is a sub-test or top level test. +// It does this by checking if the test name contains / +// This is not a particularly great way check, but appears to be the only option currently. +func isSubTest(t e2eutils.TestingBase) bool { + return strings.Contains(t.Name(), "/") +} + +func autoAllocateExecutor(t e2eutils.TestingBase) { + if isSubTest(t) { + // Always run subtests, they only start on the same executor as their parent. + return + } + info := getExecutorInfo(t) + tName := t.Name() + tHash := md5.Sum([]byte(tName)) + executor := uint64(tHash[0]) % info.total + checkExecutor(t, info, executor) +} + +func UsesCannon(t e2eutils.TestingBase) { + if os.Getenv("OP_E2E_CANNON_ENABLED") == "false" { + t.Skip("Skipping cannon test") + } +} + +func SkipOnFPAC(t e2eutils.TestingBase) { + if e2eutils.UseFPAC() { + t.Skip("Skipping test for FPAC") + } +} + +func SkipOnNotFPAC(t e2eutils.TestingBase) { + if !e2eutils.UseFPAC() { + t.Skip("Skipping test for non-FPAC") + } +} + +type executorInfo struct { + total uint64 + idx uint64 + splitInUse bool +} + +func getExecutorInfo(t e2eutils.TestingBase) executorInfo { + var info executorInfo + envTotal := os.Getenv("CIRCLE_NODE_TOTAL") + envIdx := os.Getenv("CIRCLE_NODE_INDEX") + if envTotal == "" || envIdx == "" { + // Not using test splitting, so ignore assigned executor + t.Logf("Test splitting not in use.") + info.total = 1 + return info + } + total, err := strconv.ParseUint(envTotal, 10, 0) + if err != nil { + t.Fatalf("Could not parse CIRCLE_NODE_TOTAL env var %v: %v", envTotal, err) + } + idx, err := strconv.ParseUint(envIdx, 10, 0) + if err != nil { + t.Fatalf("Could not parse CIRCLE_NODE_INDEX env var %v: %v", envIdx, err) + } + + info.total = total + info.idx = idx + info.splitInUse = true + return info +} + +func checkExecutor(t e2eutils.TestingBase, info executorInfo, assignedIdx uint64) { + if !info.splitInUse { + t.Logf("Test splitting not in use.") + return + } + + if assignedIdx >= info.total && info.idx == info.total-1 { + t.Logf("Running test. Current executor (%v) is the last executor and assigned executor (%v) >= total executors (%v).", info.idx, assignedIdx, info.total) + return + } + if info.idx == assignedIdx { + t.Logf("Running test. Assigned executor (%v) matches current executor (%v) of total (%v)", assignedIdx, info.idx, info.total) + return + } + t.Skipf("Skipping test. Assigned executor %v, current executor %v of total %v", assignedIdx, info.idx, info.total) +} diff --git a/op-e2e2/l1_beacon_client_test.go b/op-e2e2/l1_beacon_client_test.go new file mode 100644 index 000000000000..37409d695287 --- /dev/null +++ b/op-e2e2/l1_beacon_client_test.go @@ -0,0 +1,53 @@ +package op_e2e + +import ( + "context" + "testing" + + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/fakebeacon" + "github.com/ethereum-optimism/optimism/op-service/client" + "github.com/ethereum-optimism/optimism/op-service/eth" + "github.com/ethereum-optimism/optimism/op-service/sources" + "github.com/ethereum-optimism/optimism/op-service/testlog" + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/log" + "github.com/stretchr/testify/require" +) + +func TestGetVersion(t *testing.T) { + InitParallel(t) + + l := testlog.Logger(t, log.LevelInfo) + + beaconApi := fakebeacon.NewBeacon(l, t.TempDir(), uint64(0), uint64(0)) + t.Cleanup(func() { + _ = beaconApi.Close() + }) + require.NoError(t, beaconApi.Start("127.0.0.1:0")) + + beaconCfg := sources.L1BeaconClientConfig{FetchAllSidecars: false} + cl := sources.NewL1BeaconClient(sources.NewBeaconHTTPClient(client.NewBasicHTTPClient(beaconApi.BeaconAddr(), l)), beaconCfg) + + version, err := cl.GetVersion(context.Background()) + require.NoError(t, err) + require.Equal(t, "fakebeacon 1.2.3", version) +} + +func Test404NotFound(t *testing.T) { + InitParallel(t) + + l := testlog.Logger(t, log.LevelInfo) + + beaconApi := fakebeacon.NewBeacon(l, t.TempDir(), uint64(0), uint64(12)) + t.Cleanup(func() { + _ = beaconApi.Close() + }) + require.NoError(t, beaconApi.Start("127.0.0.1:0")) + + beaconCfg := sources.L1BeaconClientConfig{FetchAllSidecars: false} + cl := sources.NewL1BeaconClient(sources.NewBeaconHTTPClient(client.NewBasicHTTPClient(beaconApi.BeaconAddr(), l)), beaconCfg) + + hashes := []eth.IndexedBlobHash{{Index: 1}} + _, err := cl.GetBlobs(context.Background(), eth.L1BlockRef{Number: 10, Time: 120}, hashes) + require.ErrorIs(t, err, ethereum.NotFound) +} diff --git a/op-e2e2/l2_gossip_test.go b/op-e2e2/l2_gossip_test.go new file mode 100644 index 000000000000..c67b9061dc64 --- /dev/null +++ b/op-e2e2/l2_gossip_test.go @@ -0,0 +1,32 @@ +package op_e2e + +import ( + "testing" + + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/geth" + "github.com/ethereum/go-ethereum/common" + "github.com/stretchr/testify/require" +) + +func TestTxGossip(t *testing.T) { + InitParallel(t) + cfg := DefaultSystemConfig(t) + gethOpts := []geth.GethOption{ + geth.WithP2P(), + } + cfg.GethOptions["sequencer"] = append(cfg.GethOptions["sequencer"], gethOpts...) + cfg.GethOptions["verifier"] = append(cfg.GethOptions["verifier"], gethOpts...) + sys, err := cfg.Start(t) + require.NoError(t, err, "Start system") + + seqClient := sys.Clients["sequencer"] + verifClient := sys.Clients["verifier"] + geth.ConnectP2P(t, seqClient, verifClient) + + // Send a transaction to the verifier and it should be gossiped to the sequencer and included in a block. + SendL2Tx(t, cfg, verifClient, cfg.Secrets.Alice, func(opts *TxOpts) { + opts.ToAddr = &common.Address{0xaa} + opts.Value = common.Big1 + opts.VerifyOnClients(seqClient, verifClient) + }) +} diff --git a/op-e2e2/op_geth.go b/op-e2e2/op_geth.go new file mode 100644 index 000000000000..fa444f62de92 --- /dev/null +++ b/op-e2e2/op_geth.go @@ -0,0 +1,249 @@ +package op_e2e + +import ( + "context" + "errors" + "fmt" + "math/big" + "reflect" + "testing" + + "github.com/ethereum-optimism/optimism/op-chain-ops/genesis" + "github.com/ethereum-optimism/optimism/op-e2e2/config" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/geth" + "github.com/ethereum-optimism/optimism/op-node/rollup" + "github.com/ethereum-optimism/optimism/op-node/rollup/derive" + "github.com/ethereum-optimism/optimism/op-service/client" + "github.com/ethereum-optimism/optimism/op-service/eth" + "github.com/ethereum-optimism/optimism/op-service/sources" + "github.com/ethereum-optimism/optimism/op-service/testlog" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/ethereum/go-ethereum/log" + gn "github.com/ethereum/go-ethereum/node" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rpc" + "github.com/stretchr/testify/require" +) + +var ( + // ErrForkChoiceUpdatedNotValid is returned when a forkChoiceUpdated returns a status other than Valid + ErrForkChoiceUpdatedNotValid = errors.New("forkChoiceUpdated status was not valid") + // ErrNewPayloadNotValid is returned when a newPayload call returns a status other than Valid, indicating the new block is invalid + ErrNewPayloadNotValid = errors.New("newPayload status was not valid") +) + +// OpGeth is an actor that functions as a l2 op-geth node +// It provides useful functions for advancing and querying the chain +type OpGeth struct { + node EthInstance + l2Engine *sources.EngineClient + L2Client *ethclient.Client + SystemConfig eth.SystemConfig + L1ChainConfig *params.ChainConfig + L2ChainConfig *params.ChainConfig + L1Head eth.BlockInfo + L2Head *eth.ExecutionPayload + sequenceNum uint64 + lgr log.Logger +} + +func NewOpGeth(t testing.TB, ctx context.Context, cfg *SystemConfig) (*OpGeth, error) { + logger := testlog.Logger(t, log.LevelCrit) + + l1Genesis, err := genesis.BuildL1DeveloperGenesis(cfg.DeployConfig, config.L1Allocs, config.L1Deployments) + require.Nil(t, err) + l1Block := l1Genesis.ToBlock() + + var allocsMode genesis.L2AllocsMode + allocsMode = genesis.L2AllocsDelta + if fjordTime := cfg.DeployConfig.FjordTime(l1Block.Time()); fjordTime != nil && *fjordTime <= 0 { + allocsMode = genesis.L2AllocsFjord + } else if ecotoneTime := cfg.DeployConfig.EcotoneTime(l1Block.Time()); ecotoneTime != nil && *ecotoneTime <= 0 { + allocsMode = genesis.L2AllocsEcotone + } + l2Allocs := config.L2Allocs(allocsMode) + l2Genesis, err := genesis.BuildL2Genesis(cfg.DeployConfig, l2Allocs, l1Block) + require.Nil(t, err) + l2GenesisBlock := l2Genesis.ToBlock() + + rollupGenesis := rollup.Genesis{ + L1: eth.BlockID{ + Hash: l1Block.Hash(), + Number: l1Block.NumberU64(), + }, + L2: eth.BlockID{ + Hash: l2GenesisBlock.Hash(), + Number: l2GenesisBlock.NumberU64(), + }, + L2Time: l2GenesisBlock.Time(), + SystemConfig: e2eutils.SystemConfigFromDeployConfig(cfg.DeployConfig), + } + + var node EthInstance + if cfg.ExternalL2Shim == "" { + gethNode, _, err := geth.InitL2("l2", big.NewInt(int64(cfg.DeployConfig.L2ChainID)), l2Genesis, cfg.JWTFilePath) + require.Nil(t, err) + require.Nil(t, gethNode.Start()) + node = gethNode + } else { + externalNode := (&ExternalRunner{ + Name: "l2", + BinPath: cfg.ExternalL2Shim, + Genesis: l2Genesis, + JWTPath: cfg.JWTFilePath, + }).Run(t) + node = externalNode + } + + auth := rpc.WithHTTPAuth(gn.NewJWTAuth(cfg.JWTSecret)) + l2Node, err := client.NewRPC(ctx, logger, node.WSAuthEndpoint(), client.WithGethRPCOptions(auth)) + require.NoError(t, err) + + // Finally create the engine client + rollupCfg, err := cfg.DeployConfig.RollupConfig(l1Block, l2GenesisBlock.Hash(), l2GenesisBlock.NumberU64()) + require.NoError(t, err) + rollupCfg.Genesis = rollupGenesis + l2Engine, err := sources.NewEngineClient( + l2Node, + logger, + nil, + sources.EngineClientDefaultConfig(rollupCfg), + ) + require.Nil(t, err) + + l2Client, err := ethclient.Dial(selectEndpoint(node)) + require.Nil(t, err) + + genesisPayload, err := eth.BlockAsPayload(l2GenesisBlock, cfg.DeployConfig.CanyonTime(l2GenesisBlock.Time())) + + require.Nil(t, err) + return &OpGeth{ + node: node, + L2Client: l2Client, + l2Engine: l2Engine, + SystemConfig: rollupGenesis.SystemConfig, + L1ChainConfig: l1Genesis.Config, + L2ChainConfig: l2Genesis.Config, + L1Head: eth.BlockToInfo(l1Block), + L2Head: genesisPayload, + lgr: logger, + }, nil +} + +func (d *OpGeth) Close() { + if err := d.node.Close(); err != nil { + d.lgr.Error("error closing node", "err", err) + } + d.l2Engine.Close() + d.L2Client.Close() +} + +// AddL2Block Appends a new L2 block to the current chain including the specified transactions +// The L1Info transaction is automatically prepended to the created block +func (d *OpGeth) AddL2Block(ctx context.Context, txs ...*types.Transaction) (*eth.ExecutionPayloadEnvelope, error) { + attrs, err := d.CreatePayloadAttributes(txs...) + if err != nil { + return nil, err + } + res, err := d.StartBlockBuilding(ctx, attrs) + if err != nil { + return nil, err + } + + envelope, err := d.l2Engine.GetPayload(ctx, eth.PayloadInfo{ID: *res.PayloadID, Timestamp: uint64(attrs.Timestamp)}) + payload := envelope.ExecutionPayload + + if err != nil { + return nil, err + } + if !reflect.DeepEqual(payload.Transactions, attrs.Transactions) { + return nil, errors.New("required transactions were not included") + } + + status, err := d.l2Engine.NewPayload(ctx, payload, envelope.ParentBeaconBlockRoot) + if err != nil { + return nil, err + } + if status.Status != eth.ExecutionValid { + return nil, fmt.Errorf("%w: %s", ErrNewPayloadNotValid, status.Status) + } + + fc := eth.ForkchoiceState{ + HeadBlockHash: payload.BlockHash, + SafeBlockHash: payload.BlockHash, + } + res, err = d.l2Engine.ForkchoiceUpdate(ctx, &fc, nil) + if err != nil { + return nil, err + } + if res.PayloadStatus.Status != eth.ExecutionValid { + return nil, fmt.Errorf("%w: %s", ErrForkChoiceUpdatedNotValid, res.PayloadStatus.Status) + } + d.L2Head = payload + d.sequenceNum = d.sequenceNum + 1 + return envelope, nil +} + +// StartBlockBuilding begins block building for the specified PayloadAttributes by sending a engine_forkChoiceUpdated call. +// The current L2Head is used as the parent of the new block. +// ErrForkChoiceUpdatedNotValid is returned if the forkChoiceUpdate call returns a status other than valid. +func (d *OpGeth) StartBlockBuilding(ctx context.Context, attrs *eth.PayloadAttributes) (*eth.ForkchoiceUpdatedResult, error) { + fc := eth.ForkchoiceState{ + HeadBlockHash: d.L2Head.BlockHash, + SafeBlockHash: d.L2Head.BlockHash, + } + res, err := d.l2Engine.ForkchoiceUpdate(ctx, &fc, attrs) + if err != nil { + return nil, err + } + if res.PayloadStatus.Status != eth.ExecutionValid { + return nil, fmt.Errorf("%w: %s", ErrForkChoiceUpdatedNotValid, res.PayloadStatus.Status) + } + if res.PayloadID == nil { + return nil, errors.New("forkChoiceUpdated returned nil PayloadID") + } + return res, nil +} + +// CreatePayloadAttributes creates a valid PayloadAttributes containing a L1Info deposit transaction followed by the supplied transactions. +func (d *OpGeth) CreatePayloadAttributes(txs ...*types.Transaction) (*eth.PayloadAttributes, error) { + timestamp := d.L2Head.Timestamp + 2 + l1Info, err := derive.L1InfoDepositBytes(d.l2Engine.RollupConfig(), d.SystemConfig, d.sequenceNum, d.L1Head, uint64(timestamp)) + if err != nil { + return nil, err + } + + var txBytes []hexutil.Bytes + txBytes = append(txBytes, l1Info) + for _, tx := range txs { + bin, err := tx.MarshalBinary() + if err != nil { + return nil, fmt.Errorf("tx marshalling failed: %w", err) + } + txBytes = append(txBytes, bin) + } + + var withdrawals *types.Withdrawals + if d.L2ChainConfig.IsCanyon(uint64(timestamp)) { + withdrawals = &types.Withdrawals{} + } + + var parentBeaconBlockRoot *common.Hash + if d.L2ChainConfig.IsEcotone(uint64(timestamp)) { + parentBeaconBlockRoot = d.L1Head.ParentBeaconRoot() + } + + attrs := eth.PayloadAttributes{ + Timestamp: timestamp, + Transactions: txBytes, + NoTxPool: true, + GasLimit: (*eth.Uint64Quantity)(&d.SystemConfig.GasLimit), + Withdrawals: withdrawals, + ParentBeaconBlockRoot: parentBeaconBlockRoot, + } + return &attrs, nil +} diff --git a/op-e2e2/op_geth_test.go b/op-e2e2/op_geth_test.go new file mode 100644 index 000000000000..90b117084ce7 --- /dev/null +++ b/op-e2e2/op_geth_test.go @@ -0,0 +1,1130 @@ +package op_e2e + +import ( + "context" + "fmt" + "math/big" + "testing" + "time" + + "github.com/ethereum-optimism/optimism/op-node/rollup" + "github.com/ethereum-optimism/optimism/op-node/rollup/derive" + "github.com/ethereum-optimism/optimism/op-service/eth" + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/txpool" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/params" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +var ( + rip7212Precompile = common.HexToAddress("0x0000000000000000000000000000000000000100") + invalid7212Data = []byte{0x00} + // This is a valid hash, r, s, x, y params for RIP-7212 taken from: + // https://gist.github.com/ulerdogan/8f1714895e23a54147fc529ea30517eb + valid7212Data = common.FromHex("4cee90eb86eaa050036147a12d49004b6b9c72bd725d39d4785011fe190f0b4da73bd4903f0ce3b639bbbf6e8e80d16931ff4bcf5993d58468e8fb19086e8cac36dbcd03009df8c59286b162af3bd7fcc0450c9aa81be5d10d312af6c66b1d604aebd3099c618202fcfe16ae7770b0c49ab5eadf74b754204a3bb6060e44eff37618b065f9832de4ca6ca971a7a1adc826d0f7c00181a5fb2ddf79ae00b4e10e") +) + +// TestMissingGasLimit tests that op-geth cannot build a block without gas limit while optimism is active in the chain config. +func TestMissingGasLimit(t *testing.T) { + InitParallel(t) + cfg := DefaultSystemConfig(t) + ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) + defer cancel() + opGeth, err := NewOpGeth(t, ctx, &cfg) + require.NoError(t, err) + defer opGeth.Close() + + attrs, err := opGeth.CreatePayloadAttributes() + require.NoError(t, err) + // Remove the GasLimit from the otherwise valid attributes + attrs.GasLimit = nil + + res, err := opGeth.StartBlockBuilding(ctx, attrs) + require.Error(t, err) + require.ErrorIs(t, err, eth.InputError{}) + require.Equal(t, eth.InvalidPayloadAttributes, err.(eth.InputError).Code) + require.Nil(t, res) +} + +// TestTxGasSameAsBlockGasLimit tests that op-geth rejects transactions that attempt to use the full block gas limit. +// The L1 Info deposit always takes gas so the effective gas limit is lower than the full block gas limit. +func TestTxGasSameAsBlockGasLimit(t *testing.T) { + InitParallel(t) + cfg := DefaultSystemConfig(t) + sys, err := cfg.Start(t) + require.Nil(t, err, "Error starting up system") + defer sys.Close() + + ethPrivKey := sys.Cfg.Secrets.Alice + tx := types.MustSignNewTx(ethPrivKey, types.LatestSignerForChainID(cfg.L2ChainIDBig()), &types.DynamicFeeTx{ + ChainID: cfg.L2ChainIDBig(), + Gas: 29_999_999, + }) + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + l2Seq := sys.Clients["sequencer"] + err = l2Seq.SendTransaction(ctx, tx) + require.ErrorContains(t, err, txpool.ErrGasLimit.Error()) + +} + +// TestInvalidDepositInFCU runs an invalid deposit through a FCU/GetPayload/NewPayload/FCU set of calls. +// This tests that deposits must always allow the block to be built even if they are invalid. +func TestInvalidDepositInFCU(t *testing.T) { + InitParallel(t) + cfg := DefaultSystemConfig(t) + ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) + defer cancel() + opGeth, err := NewOpGeth(t, ctx, &cfg) + require.NoError(t, err) + defer opGeth.Close() + + // Create a deposit from a new account that will always fail (not enough funds) + fromKey, err := crypto.GenerateKey() + require.NoError(t, err) + fromAddr := crypto.PubkeyToAddress(fromKey.PublicKey) + balance, err := opGeth.L2Client.BalanceAt(ctx, fromAddr, nil) + require.Nil(t, err) + t.Logf("alice balance: %d, %s", balance, fromAddr) + require.Equal(t, 0, balance.Cmp(common.Big0)) + + badDepositTx := types.NewTx(&types.DepositTx{ + From: fromAddr, + To: &fromAddr, // send it to ourselves + Value: big.NewInt(params.Ether), + Gas: 25000, + IsSystemTransaction: false, + }) + + // We are inserting a block with an invalid deposit. + // The invalid deposit should still remain in the block. + _, err = opGeth.AddL2Block(ctx, badDepositTx) + require.NoError(t, err) + + // Deposit tx was included, but our account still shouldn't have any ETH + balance, err = opGeth.L2Client.BalanceAt(ctx, fromAddr, nil) + require.Nil(t, err) + require.Equal(t, 0, balance.Cmp(common.Big0)) +} + +// TestGethOnlyPendingBlockIsLatest walks through an engine-API block building job, +// and asserts that the pending block is set to match the latest block at every stage, +// for stability and tx-privacy. +func TestGethOnlyPendingBlockIsLatest(t *testing.T) { + InitParallel(t) + cfg := DefaultSystemConfig(t) + cfg.DeployConfig.FundDevAccounts = true + ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) + defer cancel() + opGeth, err := NewOpGeth(t, ctx, &cfg) + require.NoError(t, err) + defer opGeth.Close() + + checkPending := func(stage string, number uint64) { + // TODO(CLI-4044): pending-block ID change + pendingBlock, err := opGeth.L2Client.BlockByNumber(ctx, big.NewInt(-1)) + require.NoError(t, err, "failed to fetch pending block at stage "+stage) + require.Equal(t, number, pendingBlock.NumberU64(), "pending block must have expected number") + latestBlock, err := opGeth.L2Client.BlockByNumber(ctx, nil) + require.NoError(t, err, "failed to fetch latest block at stage "+stage) + require.Equal(t, pendingBlock.Hash(), latestBlock.Hash(), "pending and latest do not match at stage "+stage) + } + + checkPending("genesis", 0) + + amount := big.NewInt(42) // send 42 wei + + aliceStartBalance, err := opGeth.L2Client.PendingBalanceAt(ctx, cfg.Secrets.Addresses().Alice) + require.NoError(t, err) + require.True(t, aliceStartBalance.Cmp(big.NewInt(0)) > 0, "alice must be funded") + + checkPendingBalance := func() { + pendingBalance, err := opGeth.L2Client.PendingBalanceAt(ctx, cfg.Secrets.Addresses().Alice) + require.NoError(t, err) + require.Equal(t, pendingBalance, aliceStartBalance, "pending balance must still be the same") + } + + startBlock, err := opGeth.L2Client.BlockByNumber(ctx, nil) + require.NoError(t, err) + + signer := types.LatestSigner(opGeth.L2ChainConfig) + tip := big.NewInt(7_000_000_000) // 7 gwei tip + tx := types.MustSignNewTx(cfg.Secrets.Alice, signer, &types.DynamicFeeTx{ + ChainID: big.NewInt(int64(cfg.DeployConfig.L2ChainID)), + Nonce: 0, + GasTipCap: tip, + GasFeeCap: new(big.Int).Add(startBlock.BaseFee(), tip), + Gas: 1_000_000, + To: &cfg.Secrets.Addresses().Bob, + Value: amount, + Data: nil, + }) + require.NoError(t, opGeth.L2Client.SendTransaction(ctx, tx), "send tx to make pending work different") + checkPending("prepared", 0) + + // Wait for tx to be in tx-pool, for it to be picked up in block building + var txPoolStatus struct { + Pending hexutil.Uint64 `json:"pending"` + } + for i := 0; i < 5; i++ { + require.NoError(t, opGeth.L2Client.Client().Call(&txPoolStatus, "txpool_status")) + if txPoolStatus.Pending == 0 { + time.Sleep(time.Second) + } else { + break + } + } + require.NotZero(t, txPoolStatus.Pending, "must have pending tx in pool") + + checkPending("in-pool", 0) + checkPendingBalance() + + // start building a block + attrs, err := opGeth.CreatePayloadAttributes() + require.NoError(t, err) + attrs.NoTxPool = false // we want to include a tx + fc := eth.ForkchoiceState{ + HeadBlockHash: opGeth.L2Head.BlockHash, + SafeBlockHash: opGeth.L2Head.BlockHash, + } + res, err := opGeth.l2Engine.ForkchoiceUpdate(ctx, &fc, attrs) + require.NoError(t, err) + + checkPending("building", 0) + checkPendingBalance() + + // Now we have to wait until the block-building job picks up the tx from the tx-pool. + // See go routine that spins up in buildPayload() func in payload_building.go in miner package. + // We can't check it, we don't want to finish block-building prematurely, and so we have to wait. + time.Sleep(time.Second * 4) // conservatively wait 4 seconds, CI might lag during block building. + + // retrieve the block + envelope, err := opGeth.l2Engine.GetPayload(ctx, eth.PayloadInfo{ID: *res.PayloadID, Timestamp: uint64(attrs.Timestamp)}) + require.NoError(t, err) + + payload := envelope.ExecutionPayload + checkPending("retrieved", 0) + require.Len(t, payload.Transactions, 2, "must include L1 info tx and tx from alice") + checkPendingBalance() + + // process the block + status, err := opGeth.l2Engine.NewPayload(ctx, payload, envelope.ParentBeaconBlockRoot) + require.NoError(t, err) + require.Equal(t, eth.ExecutionValid, status.Status) + checkPending("processed", 0) + checkPendingBalance() + + // make the block canonical + fc = eth.ForkchoiceState{ + HeadBlockHash: payload.BlockHash, + SafeBlockHash: payload.BlockHash, + } + res, err = opGeth.l2Engine.ForkchoiceUpdate(ctx, &fc, nil) + require.NoError(t, err) + require.Equal(t, eth.ExecutionValid, res.PayloadStatus.Status) + checkPending("canonical", 1) +} + +func TestPreregolith(t *testing.T) { + futureTimestamp := hexutil.Uint64(4) + tests := []struct { + name string + regolithTime *hexutil.Uint64 + }{ + {name: "RegolithNotScheduled"}, + {name: "RegolithNotYetActive", regolithTime: &futureTimestamp}, + } + for _, test := range tests { + test := test + t.Run("GasUsed_"+test.name, func(t *testing.T) { + InitParallel(t) + // Setup an L2 EE and create a client connection to the engine. + // We also need to setup a L1 Genesis to create the rollup genesis. + cfg := DefaultSystemConfig(t) + cfg.DeployConfig.L2GenesisRegolithTimeOffset = test.regolithTime + + ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) + defer cancel() + + opGeth, err := NewOpGeth(t, ctx, &cfg) + require.NoError(t, err) + defer opGeth.Close() + + fromAddr := cfg.Secrets.Addresses().Alice + + oldBalance, err := opGeth.L2Client.BalanceAt(ctx, fromAddr, nil) + require.NoError(t, err) + + // Simple transfer deposit tx + depositTx := types.NewTx(&types.DepositTx{ + From: fromAddr, + To: &fromAddr, // send it to ourselves + Value: big.NewInt(params.Ether), + Gas: 25000, + IsSystemTransaction: false, + }) + + envelope, err := opGeth.AddL2Block(ctx, depositTx) + require.NoError(t, err) + + // L1Info tx should report 0 gas used + infoTx, err := opGeth.L2Client.TransactionInBlock(ctx, envelope.ExecutionPayload.BlockHash, 0) + require.NoError(t, err) + infoRcpt, err := opGeth.L2Client.TransactionReceipt(ctx, infoTx.Hash()) + require.NoError(t, err) + require.Zero(t, infoRcpt.GasUsed, "should use 0 gas for system tx") + + // Deposit tx should report all gas used + receipt, err := opGeth.L2Client.TransactionReceipt(ctx, depositTx.Hash()) + require.NoError(t, err) + require.Equal(t, depositTx.Gas(), receipt.GasUsed, "should report all gas used") + + // Should not refund ETH for unused gas + newBalance, err := opGeth.L2Client.BalanceAt(ctx, fromAddr, nil) + require.NoError(t, err) + require.Equal(t, oldBalance, newBalance, "should not repay sender for unused gas") + }) + + t.Run("DepositNonce_"+test.name, func(t *testing.T) { + InitParallel(t) + // Setup an L2 EE and create a client connection to the engine. + // We also need to setup a L1 Genesis to create the rollup genesis. + cfg := DefaultSystemConfig(t) + cfg.DeployConfig.L2GenesisRegolithTimeOffset = test.regolithTime + + ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) + defer cancel() + + opGeth, err := NewOpGeth(t, ctx, &cfg) + require.NoError(t, err) + defer opGeth.Close() + + fromAddr := cfg.Secrets.Addresses().Alice + // Include a tx just to ensure Alice's nonce isn't 0 + incrementNonceTx := types.NewTx(&types.DepositTx{ + From: fromAddr, + To: &fromAddr, + Value: big.NewInt(0), + Gas: 21_000, + IsSystemTransaction: false, + }) + + // Contract creation deposit tx + contractCreateTx := types.NewTx(&types.DepositTx{ + From: fromAddr, + Value: big.NewInt(params.Ether), + Gas: 1000001, + Data: []byte{}, + IsSystemTransaction: false, + }) + + _, err = opGeth.AddL2Block(ctx, incrementNonceTx, contractCreateTx) + require.NoError(t, err) + + expectedNonce := uint64(1) + incorrectContractAddress := crypto.CreateAddress(fromAddr, uint64(0)) + correctContractAddress := crypto.CreateAddress(fromAddr, expectedNonce) + createRcpt, err := opGeth.L2Client.TransactionReceipt(ctx, contractCreateTx.Hash()) + require.NoError(t, err) + require.Equal(t, types.ReceiptStatusSuccessful, createRcpt.Status, "create should succeed") + require.Nil(t, createRcpt.DepositNonce, "should not report deposit nonce") + require.Equal(t, incorrectContractAddress, createRcpt.ContractAddress, "should report correct contract address") + + contractBalance, err := opGeth.L2Client.BalanceAt(ctx, incorrectContractAddress, nil) + require.NoError(t, err) + require.Equal(t, uint64(0), contractBalance.Uint64(), "balance unchanged on incorrect contract address") + + contractBalance, err = opGeth.L2Client.BalanceAt(ctx, correctContractAddress, nil) + require.NoError(t, err) + require.Equal(t, uint64(params.Ether), contractBalance.Uint64(), "balance changed on correct contract address") + + // Check the actual transaction nonce is reported correctly when retrieving the tx from the API. + tx, _, err := opGeth.L2Client.TransactionByHash(ctx, contractCreateTx.Hash()) + require.NoError(t, err) + require.Zero(t, *tx.EffectiveNonce(), "should report 0 as tx nonce") + }) + + t.Run("UnusedGasConsumed_"+test.name, func(t *testing.T) { + InitParallel(t) + cfg := DefaultSystemConfig(t) + cfg.DeployConfig.L2GenesisRegolithTimeOffset = test.regolithTime + + ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) + defer cancel() + + opGeth, err := NewOpGeth(t, ctx, &cfg) + require.NoError(t, err) + defer opGeth.Close() + + fromAddr := cfg.Secrets.Addresses().Alice + + // Deposit TX with a high gas limit but using very little actual gas + depositTx := types.NewTx(&types.DepositTx{ + From: fromAddr, + To: &fromAddr, // send it to ourselves + Value: big.NewInt(params.Ether), + // SystemTx is assigned 1M gas limit + Gas: uint64(cfg.DeployConfig.L2GenesisBlockGasLimit) - 1_000_000, + IsSystemTransaction: false, + }) + + signer := types.LatestSigner(opGeth.L2ChainConfig) + // Second tx with a gas limit that will fit in regolith but not bedrock + tx := types.MustSignNewTx(cfg.Secrets.Bob, signer, &types.DynamicFeeTx{ + ChainID: big.NewInt(int64(cfg.DeployConfig.L2ChainID)), + Nonce: 0, + GasTipCap: big.NewInt(100), + GasFeeCap: big.NewInt(100000), + Gas: 1_000_001, + To: &cfg.Secrets.Addresses().Alice, + Value: big.NewInt(0), + Data: nil, + }) + + _, err = opGeth.AddL2Block(ctx, depositTx, tx) + // Geth checks the gas limit usage of transactions as part of validating the payload attributes and refuses to even start building the block + require.ErrorContains(t, err, "Invalid payload attributes", "block should be invalid due to using too much gas") + }) + + t.Run("AllowSystemTx_"+test.name, func(t *testing.T) { + InitParallel(t) + cfg := DefaultSystemConfig(t) + cfg.DeployConfig.L2GenesisRegolithTimeOffset = test.regolithTime + + ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) + defer cancel() + + opGeth, err := NewOpGeth(t, ctx, &cfg) + require.NoError(t, err) + defer opGeth.Close() + + rollupCfg := rollup.Config{} + systemTx, err := derive.L1InfoDeposit(&rollupCfg, opGeth.SystemConfig, 1, opGeth.L1Head, 0) + systemTx.IsSystemTransaction = true + require.NoError(t, err) + + _, err = opGeth.AddL2Block(ctx, types.NewTx(systemTx)) + require.NoError(t, err, "should allow blocks containing system tx") + }) + } +} + +func TestRegolith(t *testing.T) { + tests := []struct { + name string + regolithTime hexutil.Uint64 + activateRegolith func(ctx context.Context, opGeth *OpGeth) + }{ + {name: "ActivateAtGenesis", regolithTime: 0, activateRegolith: func(ctx context.Context, opGeth *OpGeth) {}}, + {name: "ActivateAfterGenesis", regolithTime: 2, activateRegolith: func(ctx context.Context, opGeth *OpGeth) { + _, err := opGeth.AddL2Block(ctx) + require.NoError(t, err) + }}, + } + for _, test := range tests { + test := test + t.Run("GasUsedIsAccurate_"+test.name, func(t *testing.T) { + InitParallel(t) + // Setup an L2 EE and create a client connection to the engine. + // We also need to setup a L1 Genesis to create the rollup genesis. + cfg := DefaultSystemConfig(t) + cfg.DeployConfig.L2GenesisRegolithTimeOffset = &test.regolithTime + + ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) + defer cancel() + + opGeth, err := NewOpGeth(t, ctx, &cfg) + require.NoError(t, err) + defer opGeth.Close() + + test.activateRegolith(ctx, opGeth) + + fromAddr := cfg.Secrets.Addresses().Alice + + oldBalance, err := opGeth.L2Client.BalanceAt(ctx, fromAddr, nil) + require.NoError(t, err) + + // Simple transfer deposit tx + depositTx := types.NewTx(&types.DepositTx{ + From: fromAddr, + To: &fromAddr, // send it to ourselves + Value: big.NewInt(params.Ether), + Gas: 25000, + IsSystemTransaction: false, + }) + + envelope, err := opGeth.AddL2Block(ctx, depositTx) + require.NoError(t, err) + + // L1Info tx should report actual gas used, not 0 or the tx gas limit + infoTx, err := opGeth.L2Client.TransactionInBlock(ctx, envelope.ExecutionPayload.BlockHash, 0) + require.NoError(t, err) + infoRcpt, err := opGeth.L2Client.TransactionReceipt(ctx, infoTx.Hash()) + require.NoError(t, err) + require.NotZero(t, infoRcpt.GasUsed) + require.NotEqual(t, infoTx.Gas(), infoRcpt.GasUsed) + + // Deposit tx should report actual gas used (21,000 for a normal transfer) + receipt, err := opGeth.L2Client.TransactionReceipt(ctx, depositTx.Hash()) + require.NoError(t, err) + require.Equal(t, uint64(21_000), receipt.GasUsed, "should report actual gas used") + + // Should not refund ETH for unused gas + newBalance, err := opGeth.L2Client.BalanceAt(ctx, fromAddr, nil) + require.NoError(t, err) + require.Equal(t, oldBalance, newBalance, "should not repay sender for unused gas") + }) + + t.Run("DepositNonceCorrect_"+test.name, func(t *testing.T) { + InitParallel(t) + // Setup an L2 EE and create a client connection to the engine. + // We also need to setup a L1 Genesis to create the rollup genesis. + cfg := DefaultSystemConfig(t) + cfg.DeployConfig.L2GenesisRegolithTimeOffset = &test.regolithTime + + ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) + defer cancel() + + opGeth, err := NewOpGeth(t, ctx, &cfg) + require.NoError(t, err) + defer opGeth.Close() + + test.activateRegolith(ctx, opGeth) + + fromAddr := cfg.Secrets.Addresses().Alice + // Include a tx just to ensure Alice's nonce isn't 0 + incrementNonceTx := types.NewTx(&types.DepositTx{ + From: fromAddr, + To: &fromAddr, + Value: big.NewInt(0), + Gas: 21_000, + IsSystemTransaction: false, + }) + + // Contract creation deposit tx + contractCreateTx := types.NewTx(&types.DepositTx{ + From: fromAddr, + Value: big.NewInt(params.Ether), + Gas: 1000001, + Data: []byte{}, + IsSystemTransaction: false, + }) + + _, err = opGeth.AddL2Block(ctx, incrementNonceTx, contractCreateTx) + require.NoError(t, err) + + expectedNonce := uint64(1) + correctContractAddress := crypto.CreateAddress(fromAddr, expectedNonce) + createRcpt, err := opGeth.L2Client.TransactionReceipt(ctx, contractCreateTx.Hash()) + require.NoError(t, err) + require.Equal(t, types.ReceiptStatusSuccessful, createRcpt.Status, "create should succeed") + require.Equal(t, &expectedNonce, createRcpt.DepositNonce, "should report correct deposit nonce") + require.Equal(t, correctContractAddress, createRcpt.ContractAddress, "should report correct contract address") + + contractBalance, err := opGeth.L2Client.BalanceAt(ctx, createRcpt.ContractAddress, nil) + require.NoError(t, err) + require.Equal(t, uint64(params.Ether), contractBalance.Uint64(), "balance changed on correct contract address") + + // Check the actual transaction nonce is reported correctly when retrieving the tx from the API. + tx, _, err := opGeth.L2Client.TransactionByHash(ctx, contractCreateTx.Hash()) + require.NoError(t, err) + require.Equal(t, expectedNonce, *tx.EffectiveNonce(), "should report actual tx nonce") + + // Should be able to search for logs even though there are deposit transactions in blocks. + logs, err := opGeth.L2Client.FilterLogs(ctx, ethereum.FilterQuery{}) + require.NoError(t, err) + require.NotNil(t, logs) + require.Empty(t, logs) + }) + + t.Run("ReturnUnusedGasToPool_"+test.name, func(t *testing.T) { + InitParallel(t) + cfg := DefaultSystemConfig(t) + cfg.DeployConfig.L2GenesisRegolithTimeOffset = &test.regolithTime + + ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) + defer cancel() + + opGeth, err := NewOpGeth(t, ctx, &cfg) + require.NoError(t, err) + defer opGeth.Close() + + test.activateRegolith(ctx, opGeth) + + fromAddr := cfg.Secrets.Addresses().Alice + + // Deposit TX with a high gas limit but using very little actual gas + depositTx := types.NewTx(&types.DepositTx{ + From: fromAddr, + To: &fromAddr, // send it to ourselves + Value: big.NewInt(params.Ether), + // SystemTx is assigned 1M gas limit + Gas: uint64(cfg.DeployConfig.L2GenesisBlockGasLimit) - 1_000_000, + IsSystemTransaction: false, + }) + + signer := types.LatestSigner(opGeth.L2ChainConfig) + // Second tx with a gas limit that will fit in regolith but not bedrock + tx := types.MustSignNewTx(cfg.Secrets.Bob, signer, &types.DynamicFeeTx{ + ChainID: big.NewInt(int64(cfg.DeployConfig.L2ChainID)), + Nonce: 0, + GasTipCap: big.NewInt(100), + GasFeeCap: big.NewInt(100000), + Gas: 1_000_001, + To: &cfg.Secrets.Addresses().Alice, + Value: big.NewInt(0), + Data: nil, + }) + + _, err = opGeth.AddL2Block(ctx, depositTx, tx) + require.NoError(t, err, "block should be valid as cumulativeGasUsed only tracks actual usage now") + }) + + t.Run("RejectSystemTx_"+test.name, func(t *testing.T) { + InitParallel(t) + cfg := DefaultSystemConfig(t) + cfg.DeployConfig.L2GenesisRegolithTimeOffset = &test.regolithTime + + ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) + defer cancel() + + opGeth, err := NewOpGeth(t, ctx, &cfg) + require.NoError(t, err) + defer opGeth.Close() + + test.activateRegolith(ctx, opGeth) + + rollupCfg := rollup.Config{} + systemTx, err := derive.L1InfoDeposit(&rollupCfg, opGeth.SystemConfig, 1, opGeth.L1Head, 0) + systemTx.IsSystemTransaction = true + require.NoError(t, err) + + _, err = opGeth.AddL2Block(ctx, types.NewTx(systemTx)) + require.ErrorIs(t, err, ErrNewPayloadNotValid, "should reject blocks containing system tx") + }) + + t.Run("IncludeGasRefunds_"+test.name, func(t *testing.T) { + InitParallel(t) + // Simple constructor that is prefixed to the actual contract code + // Results in the contract code being returned as the code for the new contract + deployPrefixSize := byte(16) + deployPrefix := []byte{ + // Copy input data after this prefix into memory starting at address 0x00 + // CODECOPY arg size + byte(vm.PUSH1), deployPrefixSize, + byte(vm.CODESIZE), + byte(vm.SUB), + // CODECOPY arg offset + byte(vm.PUSH1), deployPrefixSize, + // CODECOPY arg destOffset + byte(vm.PUSH1), 0x00, + byte(vm.CODECOPY), + + // Return code from memory + // RETURN arg size + byte(vm.PUSH1), deployPrefixSize, + byte(vm.CODESIZE), + byte(vm.SUB), + // RETURN arg offset + byte(vm.PUSH1), 0x00, + byte(vm.RETURN), + } + // Stores the first word from call data code to storage slot 0 + sstoreContract := []byte{ + // Load first word from call data + byte(vm.PUSH1), 0x00, + byte(vm.CALLDATALOAD), + + // Store it to slot 0 + byte(vm.PUSH1), 0x00, + byte(vm.SSTORE), + } + + deployData := append(deployPrefix, sstoreContract...) + + cfg := DefaultSystemConfig(t) + cfg.DeployConfig.L2GenesisRegolithTimeOffset = &test.regolithTime + + ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) + defer cancel() + + opGeth, err := NewOpGeth(t, ctx, &cfg) + require.NoError(t, err) + defer opGeth.Close() + + test.activateRegolith(ctx, opGeth) + fromAddr := cfg.Secrets.Addresses().Alice + storeContractAddr := crypto.CreateAddress(fromAddr, 0) + + // Deposit TX to deploy a contract that lets us store an arbitrary value + deployTx := types.NewTx(&types.DepositTx{ + From: fromAddr, + Value: common.Big0, + Data: deployData, + Gas: 1_000_000, + IsSystemTransaction: false, + }) + + // Store a non-zero value + storeTx := types.NewTx(&types.DepositTx{ + From: fromAddr, + To: &storeContractAddr, + Value: common.Big0, + Data: []byte{0x06}, + Gas: 1_000_000, + IsSystemTransaction: false, + }) + + // Store a non-zero value + zeroTx := types.NewTx(&types.DepositTx{ + From: fromAddr, + To: &storeContractAddr, + Value: common.Big0, + Data: []byte{0x00}, + Gas: 1_000_000, + IsSystemTransaction: false, + }) + + // Store a non-zero value again + // Has same gas cost as zeroTx, except the first tx gets a gas refund for clearing the storage slot + rezeroTx := types.NewTx(&types.DepositTx{ + From: fromAddr, + To: &storeContractAddr, + Value: common.Big0, + Data: []byte{0x00}, + Gas: 1_000_001, + IsSystemTransaction: false, + }) + + _, err = opGeth.AddL2Block(ctx, deployTx, storeTx, zeroTx, rezeroTx) + require.NoError(t, err) + + // Sanity check the contract code deployed correctly + code, err := opGeth.L2Client.CodeAt(ctx, storeContractAddr, nil) + require.NoError(t, err) + require.Equal(t, sstoreContract, code, "should create contract with expected code") + + deployReceipt, err := opGeth.L2Client.TransactionReceipt(ctx, deployTx.Hash()) + require.NoError(t, err) + require.Equal(t, types.ReceiptStatusSuccessful, deployReceipt.Status) + require.Equal(t, storeContractAddr, deployReceipt.ContractAddress, "should create contract at expected address") + + storeReceipt, err := opGeth.L2Client.TransactionReceipt(ctx, storeTx.Hash()) + require.NoError(t, err) + require.Equal(t, types.ReceiptStatusSuccessful, storeReceipt.Status, "setting storage value should succeed") + + zeroReceipt, err := opGeth.L2Client.TransactionReceipt(ctx, zeroTx.Hash()) + require.NoError(t, err) + require.Equal(t, types.ReceiptStatusSuccessful, zeroReceipt.Status, "zeroing storage value should succeed") + + rezeroReceipt, err := opGeth.L2Client.TransactionReceipt(ctx, rezeroTx.Hash()) + require.NoError(t, err) + require.Equal(t, types.ReceiptStatusSuccessful, rezeroReceipt.Status, "rezeroing storage value should succeed") + + require.Greater(t, rezeroReceipt.GasUsed, zeroReceipt.GasUsed, "rezero should use more gas due to not getting gas refund for clearing slot") + }) + } +} + +func TestPreCanyon(t *testing.T) { + futureTimestamp := hexutil.Uint64(4) + + tests := []struct { + name string + canyonTime *hexutil.Uint64 + }{ + {name: "CanyonNotScheduled"}, + {name: "CanyonNotYetActive", canyonTime: &futureTimestamp}, + } + for _, test := range tests { + test := test + + t.Run(fmt.Sprintf("ReturnsNilWithdrawals_%s", test.name), func(t *testing.T) { + InitParallel(t) + cfg := DefaultSystemConfig(t) + cfg.DeployConfig.L2GenesisCanyonTimeOffset = test.canyonTime + + ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) + defer cancel() + + opGeth, err := NewOpGeth(t, ctx, &cfg) + require.NoError(t, err) + defer opGeth.Close() + + b, err := opGeth.AddL2Block(ctx) + require.NoError(t, err) + assert.Nil(t, b.ExecutionPayload.Withdrawals, "should not have withdrawals") + + l1Block, err := opGeth.L2Client.BlockByNumber(ctx, nil) + require.Nil(t, err) + assert.Equal(t, types.Withdrawals(nil), l1Block.Withdrawals()) + }) + + t.Run(fmt.Sprintf("RejectPushZeroTx_%s", test.name), func(t *testing.T) { + InitParallel(t) + cfg := DefaultSystemConfig(t) + cfg.DeployConfig.L2GenesisCanyonTimeOffset = test.canyonTime + + ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) + defer cancel() + + opGeth, err := NewOpGeth(t, ctx, &cfg) + require.NoError(t, err) + defer opGeth.Close() + + pushZeroContractCreateTxn := types.NewTx(&types.DepositTx{ + From: cfg.Secrets.Addresses().Alice, + Value: big.NewInt(params.Ether), + Gas: 1000001, + Data: []byte{ + byte(vm.PUSH0), + }, + IsSystemTransaction: false, + }) + + _, err = opGeth.AddL2Block(ctx, pushZeroContractCreateTxn) + require.NoError(t, err) + + receipt, err := opGeth.L2Client.TransactionReceipt(ctx, pushZeroContractCreateTxn.Hash()) + require.NoError(t, err) + assert.Equal(t, types.ReceiptStatusFailed, receipt.Status) + }) + } +} + +func TestCanyon(t *testing.T) { + tests := []struct { + name string + canyonTime hexutil.Uint64 + activateCanyon func(ctx context.Context, opGeth *OpGeth) + }{ + {name: "ActivateAtGenesis", canyonTime: 0, activateCanyon: func(ctx context.Context, opGeth *OpGeth) {}}, + {name: "ActivateAfterGenesis", canyonTime: 2, activateCanyon: func(ctx context.Context, opGeth *OpGeth) { + // Adding this block advances us to the fork time. + _, err := opGeth.AddL2Block(ctx) + require.NoError(t, err) + }}, + } + for _, test := range tests { + test := test + t.Run(fmt.Sprintf("ReturnsEmptyWithdrawals_%s", test.name), func(t *testing.T) { + InitParallel(t) + cfg := DefaultSystemConfig(t) + s := hexutil.Uint64(0) + cfg.DeployConfig.L2GenesisRegolithTimeOffset = &s + cfg.DeployConfig.L2GenesisCanyonTimeOffset = &test.canyonTime + cfg.DeployConfig.L2GenesisEcotoneTimeOffset = nil + + ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) + defer cancel() + + opGeth, err := NewOpGeth(t, ctx, &cfg) + require.NoError(t, err) + defer opGeth.Close() + + test.activateCanyon(ctx, opGeth) + + b, err := opGeth.AddL2Block(ctx) + require.NoError(t, err) + assert.Equal(t, *b.ExecutionPayload.Withdrawals, types.Withdrawals{}) + + l1Block, err := opGeth.L2Client.BlockByNumber(ctx, nil) + require.Nil(t, err) + assert.Equal(t, l1Block.Withdrawals(), types.Withdrawals{}) + }) + + t.Run(fmt.Sprintf("AcceptsPushZeroTxn_%s", test.name), func(t *testing.T) { + InitParallel(t) + cfg := DefaultSystemConfig(t) + cfg.DeployConfig.L2GenesisCanyonTimeOffset = &test.canyonTime + cfg.DeployConfig.L2GenesisEcotoneTimeOffset = nil + + ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) + defer cancel() + + opGeth, err := NewOpGeth(t, ctx, &cfg) + require.NoError(t, err) + defer opGeth.Close() + + pushZeroContractCreateTxn := types.NewTx(&types.DepositTx{ + From: cfg.Secrets.Addresses().Alice, + Value: big.NewInt(params.Ether), + Gas: 1000001, + Data: []byte{ + byte(vm.PUSH0), + }, + IsSystemTransaction: false, + }) + + _, err = opGeth.AddL2Block(ctx, pushZeroContractCreateTxn) + require.NoError(t, err) + + receipt, err := opGeth.L2Client.TransactionReceipt(ctx, pushZeroContractCreateTxn.Hash()) + require.NoError(t, err) + assert.Equal(t, types.ReceiptStatusSuccessful, receipt.Status) + }) + } +} + +func TestPreEcotone(t *testing.T) { + futureTimestamp := hexutil.Uint64(4) + + tests := []struct { + name string + ecotoneTime *hexutil.Uint64 + }{ + {name: "EcotoneNotScheduled"}, + {name: "EcotoneNotYetActive", ecotoneTime: &futureTimestamp}, + } + for _, test := range tests { + test := test + + t.Run(fmt.Sprintf("NilParentBeaconRoot_%s", test.name), func(t *testing.T) { + InitParallel(t) + cfg := DefaultSystemConfig(t) + cfg.DeployConfig.L2GenesisCanyonTimeOffset = test.ecotoneTime + + ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) + defer cancel() + + opGeth, err := NewOpGeth(t, ctx, &cfg) + require.NoError(t, err) + defer opGeth.Close() + + b, err := opGeth.AddL2Block(ctx) + require.NoError(t, err) + assert.Nil(t, b.ParentBeaconBlockRoot) + + l2Block, err := opGeth.L2Client.BlockByNumber(ctx, nil) + require.NoError(t, err) + assert.Nil(t, l2Block.Header().ParentBeaconRoot) + }) + + t.Run(fmt.Sprintf("RejectTstoreTxn%s", test.name), func(t *testing.T) { + InitParallel(t) + cfg := DefaultSystemConfig(t) + cfg.DeployConfig.L2GenesisCanyonTimeOffset = test.ecotoneTime + + ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) + defer cancel() + + opGeth, err := NewOpGeth(t, ctx, &cfg) + require.NoError(t, err) + defer opGeth.Close() + + tstoreTxn := types.NewTx(&types.DepositTx{ + From: cfg.Secrets.Addresses().Alice, + Value: big.NewInt(params.Ether), + Gas: 1000001, + Data: []byte{ + byte(vm.PUSH1), + byte(vm.PUSH2), + byte(vm.TSTORE), + }, + IsSystemTransaction: false, + }) + + _, err = opGeth.AddL2Block(ctx, tstoreTxn) + require.NoError(t, err) + + receipt, err := opGeth.L2Client.TransactionReceipt(ctx, tstoreTxn.Hash()) + require.NoError(t, err) + assert.Equal(t, types.ReceiptStatusFailed, receipt.Status) + }) + } +} + +func TestEcotone(t *testing.T) { + tests := []struct { + name string + ecotoneTime hexutil.Uint64 + activateEcotone func(ctx context.Context, opGeth *OpGeth) + }{ + {name: "ActivateAtGenesis", ecotoneTime: 0, activateEcotone: func(ctx context.Context, opGeth *OpGeth) {}}, + {name: "ActivateAfterGenesis", ecotoneTime: 2, activateEcotone: func(ctx context.Context, opGeth *OpGeth) { + // Adding this block advances us to the fork time. + _, err := opGeth.AddL2Block(ctx) + require.NoError(t, err) + }}, + } + for _, test := range tests { + test := test + t.Run(fmt.Sprintf("HashParentBeaconBlockRoot_%s", test.name), func(t *testing.T) { + InitParallel(t) + cfg := DefaultSystemConfig(t) + s := hexutil.Uint64(0) + cfg.DeployConfig.L2GenesisCanyonTimeOffset = &s + cfg.DeployConfig.L2GenesisDeltaTimeOffset = &s + cfg.DeployConfig.L2GenesisEcotoneTimeOffset = &test.ecotoneTime + + ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) + defer cancel() + + opGeth, err := NewOpGeth(t, ctx, &cfg) + require.NoError(t, err) + defer opGeth.Close() + + test.activateEcotone(ctx, opGeth) + + b, err := opGeth.AddL2Block(ctx) + require.NoError(t, err) + require.NotNil(t, b.ParentBeaconBlockRoot) + assert.Equal(t, b.ParentBeaconBlockRoot, opGeth.L1Head.ParentBeaconRoot()) + + l2Block, err := opGeth.L2Client.BlockByNumber(ctx, nil) + require.NoError(t, err) + assert.NotNil(t, l2Block.Header().ParentBeaconRoot) + assert.Equal(t, l2Block.Header().ParentBeaconRoot, opGeth.L1Head.ParentBeaconRoot()) + }) + + t.Run(fmt.Sprintf("TstoreTxn%s", test.name), func(t *testing.T) { + InitParallel(t) + cfg := DefaultSystemConfig(t) + s := hexutil.Uint64(0) + cfg.DeployConfig.L2GenesisCanyonTimeOffset = &s + cfg.DeployConfig.L2GenesisDeltaTimeOffset = &s + cfg.DeployConfig.L2GenesisEcotoneTimeOffset = &test.ecotoneTime + + ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) + defer cancel() + + opGeth, err := NewOpGeth(t, ctx, &cfg) + require.NoError(t, err) + defer opGeth.Close() + + tstoreTxn := types.NewTx(&types.DepositTx{ + From: cfg.Secrets.Addresses().Alice, + Value: big.NewInt(params.Ether), + Gas: 1000001, + Data: []byte{ + byte(vm.PUSH1), 0x01, + byte(vm.PUSH1), 0x01, + byte(vm.TSTORE), + byte(vm.PUSH0), + }, + IsSystemTransaction: false, + }) + + _, err = opGeth.AddL2Block(ctx, tstoreTxn) + require.NoError(t, err) + + _, err = opGeth.AddL2Block(ctx, tstoreTxn) + require.NoError(t, err) + + receipt, err := opGeth.L2Client.TransactionReceipt(ctx, tstoreTxn.Hash()) + require.NoError(t, err) + assert.Equal(t, types.ReceiptStatusSuccessful, receipt.Status) + }) + } +} + +func TestPreFjord(t *testing.T) { + futureTimestamp := hexutil.Uint64(4) + + tests := []struct { + name string + fjordTime *hexutil.Uint64 + }{ + {name: "FjordNotScheduled"}, + {name: "FjordNotYetActive", fjordTime: &futureTimestamp}, + } + for _, test := range tests { + test := test + + t.Run(fmt.Sprintf("RIP7212_%s", test.name), func(t *testing.T) { + InitParallel(t) + cfg := DefaultSystemConfig(t) + s := hexutil.Uint64(0) + cfg.DeployConfig.L2GenesisCanyonTimeOffset = &s + cfg.DeployConfig.L2GenesisDeltaTimeOffset = &s + cfg.DeployConfig.L2GenesisEcotoneTimeOffset = &s + cfg.DeployConfig.L2GenesisFjordTimeOffset = test.fjordTime + + ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) + defer cancel() + + opGeth, err := NewOpGeth(t, ctx, &cfg) + require.NoError(t, err) + defer opGeth.Close() + + // valid request pre-fjord returns empty response + response, err := opGeth.L2Client.CallContract(ctx, ethereum.CallMsg{ + To: &rip7212Precompile, + Data: valid7212Data, + }, nil) + + require.NoError(t, err) + require.Equal(t, []byte{}, response, "should return empty response pre-fjord for valid signature") + + // invalid request returns returns empty response + response, err = opGeth.L2Client.CallContract(ctx, ethereum.CallMsg{ + To: &rip7212Precompile, + Data: invalid7212Data, + }, nil) + + require.NoError(t, err) + require.Equal(t, []byte{}, response, "should return empty response for invalid signature") + }) + } +} + +func TestFjord(t *testing.T) { + tests := []struct { + name string + fjordTime hexutil.Uint64 + activateFjord func(ctx context.Context, opGeth *OpGeth) + }{ + {name: "ActivateAtGenesis", fjordTime: 0, activateFjord: func(ctx context.Context, opGeth *OpGeth) {}}, + {name: "ActivateAfterGenesis", fjordTime: 2, activateFjord: func(ctx context.Context, opGeth *OpGeth) { + // Adding this block advances us to the fork time. + _, err := opGeth.AddL2Block(ctx) + require.NoError(t, err) + }}, + } + + for _, test := range tests { + test := test + t.Run(fmt.Sprintf("RIP7212_%s", test.name), func(t *testing.T) { + InitParallel(t) + cfg := DefaultSystemConfig(t) + s := hexutil.Uint64(0) + cfg.DeployConfig.L2GenesisCanyonTimeOffset = &s + cfg.DeployConfig.L2GenesisDeltaTimeOffset = &s + cfg.DeployConfig.L2GenesisEcotoneTimeOffset = &s + cfg.DeployConfig.L2GenesisFjordTimeOffset = &test.fjordTime + + ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) + defer cancel() + + opGeth, err := NewOpGeth(t, ctx, &cfg) + require.NoError(t, err) + defer opGeth.Close() + + test.activateFjord(ctx, opGeth) + + // valid request returns one + response, err := opGeth.L2Client.CallContract(ctx, ethereum.CallMsg{ + To: &rip7212Precompile, + Data: valid7212Data, + }, nil) + + require.NoError(t, err) + require.Equal(t, common.LeftPadBytes([]byte{1}, 32), response, "should return 1 for valid signature") + + // invalid request returns empty response, this is how the spec denotes an error. + response, err = opGeth.L2Client.CallContract(ctx, ethereum.CallMsg{ + To: &rip7212Precompile, + Data: invalid7212Data, + }, nil) + + require.NoError(t, err) + require.Equal(t, []byte{}, response, "should return empty response for invalid signature") + }) + } +} diff --git a/op-e2e2/sequencer_failover_setup.go b/op-e2e2/sequencer_failover_setup.go new file mode 100644 index 000000000000..4e5e7d78651c --- /dev/null +++ b/op-e2e2/sequencer_failover_setup.go @@ -0,0 +1,508 @@ +package op_e2e + +import ( + "context" + "fmt" + "math/rand" + "net" + "strings" + "testing" + "time" + + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/rpc" + "github.com/stretchr/testify/require" + + bss "github.com/ethereum-optimism/optimism/op-batcher/batcher" + batcherFlags "github.com/ethereum-optimism/optimism/op-batcher/flags" + con "github.com/ethereum-optimism/optimism/op-conductor/conductor" + conrpc "github.com/ethereum-optimism/optimism/op-conductor/rpc" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/wait" + rollupNode "github.com/ethereum-optimism/optimism/op-node/node" + "github.com/ethereum-optimism/optimism/op-node/rollup" + "github.com/ethereum-optimism/optimism/op-node/rollup/derive" + "github.com/ethereum-optimism/optimism/op-node/rollup/driver" + "github.com/ethereum-optimism/optimism/op-node/rollup/sync" + oplog "github.com/ethereum-optimism/optimism/op-service/log" + "github.com/ethereum-optimism/optimism/op-service/retry" + oprpc "github.com/ethereum-optimism/optimism/op-service/rpc" + "github.com/ethereum-optimism/optimism/op-service/sources" + "github.com/ethereum-optimism/optimism/op-service/testlog" +) + +const ( + Sequencer1Name = "sequencer1" + Sequencer2Name = "sequencer2" + Sequencer3Name = "sequencer3" + VerifierName = "verifier" + + localhost = "127.0.0.1" + + maxSetupRetries = 5 +) + +var retryStrategy = &retry.FixedStrategy{Dur: 50 * time.Millisecond} + +type conductor struct { + service *con.OpConductor + client conrpc.API + consensusPort int + rpcPort int +} + +func (c *conductor) ConsensusEndpoint() string { + return fmt.Sprintf("%s:%d", localhost, c.consensusPort) +} + +func (c *conductor) RPCEndpoint() string { + return fmt.Sprintf("http://%s:%d", localhost, c.rpcPort) +} + +func setupSequencerFailoverTest(t *testing.T) (*System, map[string]*conductor, func()) { + InitParallel(t) + ctx := context.Background() + + sys, conductors, err := retry.Do2(ctx, maxSetupRetries, retryStrategy, func() (*System, map[string]*conductor, error) { + return setupHAInfra(t, ctx) + }) + require.NoError(t, err, "Expected to successfully setup sequencers and conductors after retry") + + // form a cluster + c1 := conductors[Sequencer1Name] + c2 := conductors[Sequencer2Name] + c3 := conductors[Sequencer3Name] + + require.NoError(t, waitForLeadership(t, c1)) + require.NoError(t, c1.client.AddServerAsVoter(ctx, Sequencer2Name, c2.ConsensusEndpoint())) + require.NoError(t, c1.client.AddServerAsVoter(ctx, Sequencer3Name, c3.ConsensusEndpoint())) + require.True(t, leader(t, ctx, c1)) + require.False(t, leader(t, ctx, c2)) + require.False(t, leader(t, ctx, c3)) + + // start sequencing on leader + lid, _ := findLeader(t, conductors) + unsafeHead, err := sys.Clients[lid].BlockByNumber(ctx, nil) + require.NoError(t, err) + require.Equal(t, uint64(0), unsafeHead.NumberU64()) + require.NoError(t, sys.RollupClient(lid).StartSequencer(ctx, unsafeHead.Hash())) + + // 1 batcher that listens to all 3 sequencers, in started mode. + setupBatcher(t, sys, conductors) + + // weirdly, batcher does not submit a batch until unsafe block 9. + // It became normal after that and submits a batch every L1 block (2s) per configuration. + // Since our health monitor checks on safe head progression, wait for batcher to become normal before proceeding. + _, err = wait.ForNextSafeBlock(ctx, sys.Clients[Sequencer1Name]) + require.NoError(t, err) + _, err = wait.ForNextSafeBlock(ctx, sys.Clients[Sequencer1Name]) + require.NoError(t, err) + + // make sure conductor reports all sequencers as healthy, this means they're syncing correctly. + require.Eventually(t, func() bool { + return healthy(t, ctx, c1) && + healthy(t, ctx, c2) && + healthy(t, ctx, c3) + }, 50*time.Second, 500*time.Millisecond, "Expected sequencers to become healthy") + + // unpause all conductors + require.NoError(t, c1.client.Resume(ctx)) + require.NoError(t, c2.client.Resume(ctx)) + require.NoError(t, c3.client.Resume(ctx)) + + // final check, make sure everything is in the right place + require.True(t, conductorResumed(t, ctx, c1)) + require.True(t, conductorResumed(t, ctx, c2)) + require.True(t, conductorResumed(t, ctx, c3)) + require.False(t, conductorStopped(t, ctx, c1)) + require.False(t, conductorStopped(t, ctx, c2)) + require.False(t, conductorStopped(t, ctx, c3)) + require.True(t, conductorActive(t, ctx, c1)) + require.True(t, conductorActive(t, ctx, c2)) + require.True(t, conductorActive(t, ctx, c3)) + + require.True(t, sequencerActive(t, ctx, sys.RollupClient(Sequencer1Name))) + require.False(t, sequencerActive(t, ctx, sys.RollupClient(Sequencer2Name))) + require.False(t, sequencerActive(t, ctx, sys.RollupClient(Sequencer3Name))) + + require.True(t, healthy(t, ctx, c1)) + require.True(t, healthy(t, ctx, c2)) + require.True(t, healthy(t, ctx, c3)) + + return sys, conductors, func() { + sys.Close() + for _, c := range conductors { + _ = c.service.Stop(ctx) + } + } +} + +func setupHAInfra(t *testing.T, ctx context.Context) (*System, map[string]*conductor, error) { + startTime := time.Now() + + var sys *System + var conductors map[string]*conductor + var err error + + // clean up if setup fails due to port in use. + defer func() { + if err != nil { + if sys != nil { + sys.Close() + } + + for _, c := range conductors { + if c == nil || c.service == nil { + // pass. Sometimes we can get nil in this map + } else if serr := c.service.Stop(ctx); serr != nil { + t.Log("Failed to stop conductor", "error", serr) + } + } + } + t.Logf("setupHAInfra took %s\n", time.Since(startTime)) + }() + + conductorRpcPorts := map[string]int{ + Sequencer1Name: findAvailablePort(t), + Sequencer2Name: findAvailablePort(t), + Sequencer3Name: findAvailablePort(t), + } + + // 3 sequencers, 1 verifier, 1 active sequencer. + cfg := sequencerFailoverSystemConfig(t, conductorRpcPorts) + if sys, err = cfg.Start(t); err != nil { + return nil, nil, err + } + + // 3 conductors that connects to 1 sequencer each. + conductors = make(map[string]*conductor) + + // initialize all conductors in paused mode + conductorCfgs := []struct { + name string + port int + bootstrap bool + }{ + {Sequencer1Name, conductorRpcPorts[Sequencer1Name], true}, // one in bootstrap mode so that we can form a cluster. + {Sequencer2Name, conductorRpcPorts[Sequencer2Name], false}, + {Sequencer3Name, conductorRpcPorts[Sequencer3Name], false}, + } + for _, cfg := range conductorCfgs { + cfg := cfg + nodePRC := sys.RollupNodes[cfg.name].HTTPEndpoint() + engineRPC := sys.EthInstances[cfg.name].HTTPEndpoint() + if conductors[cfg.name], err = setupConductor(t, cfg.name, t.TempDir(), nodePRC, engineRPC, cfg.port, cfg.bootstrap, *sys.RollupConfig); err != nil { + return nil, nil, err + } + } + + return sys, conductors, nil +} + +func setupConductor( + t *testing.T, + serverID, dir, nodeRPC, engineRPC string, + rpcPort int, + bootstrap bool, + rollupCfg rollup.Config, +) (*conductor, error) { + consensusPort := findAvailablePort(t) + cfg := con.Config{ + ConsensusAddr: localhost, + ConsensusPort: consensusPort, + RaftServerID: serverID, + RaftStorageDir: dir, + RaftBootstrap: bootstrap, + NodeRPC: nodeRPC, + ExecutionRPC: engineRPC, + Paused: true, + HealthCheck: con.HealthCheckConfig{ + Interval: 1, // per test setup, l2 block time is 1s. + MinPeerCount: 2, // per test setup, each sequencer has 2 peers + // CI is unstable in terms of the delay between now and the head time + // so we set the unsafe interval to 30s to avoid flakiness. + // This is fine because there's a progression check within health monitor to check progression. + UnsafeInterval: 30, + SafeInterval: 30, + }, + RollupCfg: rollupCfg, + RPCEnableProxy: true, + LogConfig: oplog.CLIConfig{ + Level: log.LevelInfo, + Color: false, + }, + RPC: oprpc.CLIConfig{ + ListenAddr: localhost, + ListenPort: rpcPort, + }, + } + + ctx := context.Background() + service, err := con.New(ctx, &cfg, testlog.Logger(t, log.LevelInfo), "0.0.1") + if err != nil { + return nil, err + } + + err = service.Start(ctx) + if err != nil { + return nil, err + } + + rawClient, err := rpc.DialContext(ctx, service.HTTPEndpoint()) + if err != nil { + return nil, err + } + client := conrpc.NewAPIClient(rawClient) + + return &conductor{ + service: service, + client: client, + consensusPort: consensusPort, + rpcPort: rpcPort, + }, nil +} + +func setupBatcher(t *testing.T, sys *System, conductors map[string]*conductor) { + // enable active sequencer follow mode. + // in sequencer HA, all batcher / proposer requests will be proxied by conductor so that we can make sure + // that requests are always handled by leader. + l2EthRpc := strings.Join([]string{ + conductors[Sequencer1Name].RPCEndpoint(), + conductors[Sequencer2Name].RPCEndpoint(), + conductors[Sequencer3Name].RPCEndpoint(), + }, ",") + rollupRpc := strings.Join([]string{ + conductors[Sequencer1Name].RPCEndpoint(), + conductors[Sequencer2Name].RPCEndpoint(), + conductors[Sequencer3Name].RPCEndpoint(), + }, ",") + batcherCLIConfig := &bss.CLIConfig{ + L1EthRpc: sys.EthInstances["l1"].WSEndpoint(), + L2EthRpc: l2EthRpc, + RollupRpc: rollupRpc, + MaxPendingTransactions: 0, + MaxChannelDuration: 1, + MaxL1TxSize: 120_000, + TargetNumFrames: 1, + ApproxComprRatio: 0.4, + SubSafetyMargin: 4, + PollInterval: 1 * time.Second, + TxMgrConfig: newTxMgrConfig(sys.EthInstances["l1"].WSEndpoint(), sys.Cfg.Secrets.Batcher), + LogConfig: oplog.CLIConfig{ + Level: log.LevelDebug, + Format: oplog.FormatText, + }, + Stopped: false, + BatchType: derive.SpanBatchType, + DataAvailabilityType: batcherFlags.CalldataType, + ActiveSequencerCheckDuration: 0, + CompressionAlgo: derive.Zlib, + } + + batcher, err := bss.BatcherServiceFromCLIConfig(context.Background(), "0.0.1", batcherCLIConfig, sys.Cfg.Loggers["batcher"]) + require.NoError(t, err) + err = batcher.Start(context.Background()) + require.NoError(t, err) + sys.BatchSubmitter = batcher +} + +func sequencerFailoverSystemConfig(t *testing.T, ports map[string]int) SystemConfig { + cfg := DefaultSystemConfig(t) + delete(cfg.Nodes, "sequencer") + cfg.Nodes[Sequencer1Name] = sequencerCfg(ports[Sequencer1Name]) + cfg.Nodes[Sequencer2Name] = sequencerCfg(ports[Sequencer2Name]) + cfg.Nodes[Sequencer3Name] = sequencerCfg(ports[Sequencer3Name]) + + delete(cfg.Loggers, "sequencer") + cfg.Loggers[Sequencer1Name] = testlog.Logger(t, log.LevelInfo).New("role", Sequencer1Name) + cfg.Loggers[Sequencer2Name] = testlog.Logger(t, log.LevelInfo).New("role", Sequencer2Name) + cfg.Loggers[Sequencer3Name] = testlog.Logger(t, log.LevelInfo).New("role", Sequencer3Name) + + cfg.P2PTopology = map[string][]string{ + Sequencer1Name: {Sequencer2Name, Sequencer3Name}, + Sequencer2Name: {Sequencer3Name, VerifierName}, + Sequencer3Name: {VerifierName, Sequencer1Name}, + VerifierName: {Sequencer1Name, Sequencer2Name}, + } + offset := hexutil.Uint64(0) + cfg.DeployConfig.L2GenesisDeltaTimeOffset = &offset + cfg.DeployConfig.L2GenesisEcotoneTimeOffset = &offset + + return cfg +} + +func sequencerCfg(rpcPort int) *rollupNode.Config { + return &rollupNode.Config{ + Driver: driver.Config{ + VerifierConfDepth: 0, + SequencerConfDepth: 0, + SequencerEnabled: true, + SequencerStopped: true, + }, + // Submitter PrivKey is set in system start for rollup nodes where sequencer = true + RPC: rollupNode.RPCConfig{ + ListenAddr: localhost, + ListenPort: 0, + EnableAdmin: true, + }, + L1EpochPollInterval: time.Second * 2, + RuntimeConfigReloadInterval: time.Minute * 10, + ConfigPersistence: &rollupNode.DisabledConfigPersistence{}, + Sync: sync.Config{SyncMode: sync.CLSync}, + ConductorEnabled: true, + ConductorRpc: fmt.Sprintf("http://%s:%d", localhost, rpcPort), + ConductorRpcTimeout: 1 * time.Second, + } +} + +func waitForLeadership(t *testing.T, c *conductor) error { + condition := func() (bool, error) { + isLeader, err := c.client.Leader(context.Background()) + if err != nil { + return false, err + } + return isLeader, nil + } + + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + return wait.For(ctx, 1*time.Second, condition) +} + +func waitForLeadershipChange(t *testing.T, prev *conductor, prevID string, conductors map[string]*conductor, sys *System) string { + condition := func() (bool, error) { + isLeader, err := prev.client.Leader(context.Background()) + if err != nil { + return false, err + } + return !isLeader, nil + } + + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + err := wait.For(ctx, 1*time.Second, condition) + require.NoError(t, err) + + ensureOnlyOneLeader(t, sys, conductors) + newLeader, err := prev.client.LeaderWithID(ctx) + require.NoError(t, err) + require.NotEmpty(t, newLeader.ID) + require.NotEqual(t, prevID, newLeader.ID, "Expected a new leader") + require.NoError(t, waitForSequencerStatusChange(t, sys.RollupClient(newLeader.ID), true)) + + return newLeader.ID +} + +func waitForSequencerStatusChange(t *testing.T, rollupClient *sources.RollupClient, active bool) error { + condition := func() (bool, error) { + isActive, err := rollupClient.SequencerActive(context.Background()) + if err != nil { + return false, err + } + return isActive == active, nil + } + + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + return wait.For(ctx, 1*time.Second, condition) +} + +func leader(t *testing.T, ctx context.Context, con *conductor) bool { + leader, err := con.client.Leader(ctx) + require.NoError(t, err) + return leader +} + +func healthy(t *testing.T, ctx context.Context, con *conductor) bool { + healthy, err := con.client.SequencerHealthy(ctx) + require.NoError(t, err) + return healthy +} + +func conductorActive(t *testing.T, ctx context.Context, con *conductor) bool { + active, err := con.client.Active(ctx) + require.NoError(t, err) + return active +} + +func conductorResumed(t *testing.T, ctx context.Context, con *conductor) bool { + paused, err := con.client.Paused(ctx) + require.NoError(t, err) + return !paused +} + +func conductorStopped(t *testing.T, ctx context.Context, con *conductor) bool { + stopped, err := con.client.Stopped(ctx) + require.NoError(t, err) + return stopped +} + +func sequencerActive(t *testing.T, ctx context.Context, rollupClient *sources.RollupClient) bool { + active, err := rollupClient.SequencerActive(ctx) + require.NoError(t, err) + return active +} + +func findAvailablePort(t *testing.T) int { + ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) + defer cancel() + for { + select { + case <-ctx.Done(): + t.Error("Failed to find available port") + default: + // private / ephemeral ports are in the range 49152-65535 + port := rand.Intn(65535-49152) + 49152 + addr := fmt.Sprintf("127.0.0.1:%d", port) + l, err := net.Listen("tcp", addr) + if err == nil { + l.Close() // Close the listener and return the port if it's available + return port + } + } + } +} + +func findLeader(t *testing.T, conductors map[string]*conductor) (string, *conductor) { + for id, con := range conductors { + if leader(t, context.Background(), con) { + return id, con + } + } + return "", nil +} + +func findFollower(t *testing.T, conductors map[string]*conductor) (string, *conductor) { + for id, con := range conductors { + if !leader(t, context.Background(), con) { + return id, con + } + } + return "", nil +} + +func ensureOnlyOneLeader(t *testing.T, sys *System, conductors map[string]*conductor) { + condition := func() (bool, error) { + leaders := 0 + ctx := context.Background() + for name, con := range conductors { + leader, err := con.client.Leader(ctx) + if err != nil { + continue + } + active, err := sys.RollupClient(name).SequencerActive(ctx) + if err != nil { + continue + } + + if leader && active { + leaders++ + } + } + return leaders == 1, nil + } + + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + require.NoError(t, wait.For(ctx, 1*time.Second, condition)) +} diff --git a/op-e2e2/sequencer_failover_test.go b/op-e2e2/sequencer_failover_test.go new file mode 100644 index 000000000000..6d98dc2af973 --- /dev/null +++ b/op-e2e2/sequencer_failover_test.go @@ -0,0 +1,174 @@ +package op_e2e + +import ( + "context" + "sort" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/ethereum-optimism/optimism/op-conductor/consensus" + "github.com/ethereum-optimism/optimism/op-service/retry" +) + +// [Category: Initial Setup] +// In this test, we test that we can successfully setup a working cluster. +func TestSequencerFailover_SetupCluster(t *testing.T) { + _, conductors, cleanup := setupSequencerFailoverTest(t) + defer cleanup() + + require.Equal(t, 3, len(conductors), "Expected 3 conductors") + for _, con := range conductors { + require.NotNil(t, con, "Expected conductor to be non-nil") + } +} + +// [Category: conductor rpc] +// In this test, we test all rpcs exposed by conductor. +func TestSequencerFailover_ConductorRPC(t *testing.T) { + ctx := context.Background() + sys, conductors, cleanup := setupSequencerFailoverTest(t) + defer cleanup() + + // SequencerHealthy, Leader, AddServerAsVoter are used in setup already. + + // Test ClusterMembership + t.Log("Testing ClusterMembership") + c1 := conductors[Sequencer1Name] + c2 := conductors[Sequencer2Name] + c3 := conductors[Sequencer3Name] + membership, err := c1.client.ClusterMembership(ctx) + require.NoError(t, err) + require.Equal(t, 3, len(membership), "Expected 3 members in cluster") + ids := make([]string, 0) + for _, member := range membership { + ids = append(ids, member.ID) + require.Equal(t, consensus.Voter, member.Suffrage, "Expected all members to be voters") + } + sort.Strings(ids) + require.Equal(t, []string{Sequencer1Name, Sequencer2Name, Sequencer3Name}, ids, "Expected all sequencers to be in cluster") + + // Test Active & Pause & Resume + t.Log("Testing Active & Pause & Resume") + active, err := c1.client.Active(ctx) + require.NoError(t, err) + require.True(t, active, "Expected conductor to be active") + + err = c1.client.Pause(ctx) + require.NoError(t, err) + active, err = c1.client.Active(ctx) + require.NoError(t, err) + require.False(t, active, "Expected conductor to be paused") + + err = c1.client.Resume(ctx) + require.NoError(t, err) + active, err = c1.client.Active(ctx) + require.NoError(t, err) + require.True(t, active, "Expected conductor to be active") + + t.Log("Testing LeaderWithID") + leader1, err := c1.client.LeaderWithID(ctx) + require.NoError(t, err) + leader2, err := c2.client.LeaderWithID(ctx) + require.NoError(t, err) + leader3, err := c3.client.LeaderWithID(ctx) + require.NoError(t, err) + require.Equal(t, leader1.ID, leader2.ID, "Expected leader ID to be the same") + require.Equal(t, leader1.ID, leader3.ID, "Expected leader ID to be the same") + + t.Log("Testing TransferLeader") + lid, leader := findLeader(t, conductors) + err = leader.client.TransferLeader(ctx) + require.NoError(t, err, "Expected leader to transfer leadership to another node") + _ = waitForLeadershipChange(t, leader, lid, conductors, sys) + + // old leader now became follower, we're trying to transfer leadership directly back to it. + t.Log("Testing TransferLeaderToServer") + fid, follower := lid, leader + lid, leader = findLeader(t, conductors) + err = leader.client.TransferLeaderToServer(ctx, fid, follower.ConsensusEndpoint()) + require.NoError(t, err, "Expected leader to transfer leadership to follower") + newID := waitForLeadershipChange(t, leader, lid, conductors, sys) + require.Equal(t, fid, newID, "Expected leader to transfer to %s", fid) + + leader = follower + + // Test AddServerAsNonvoter, do not start a new sequencer just for this purpose, use Sequencer3's rpc to start conductor. + // This is fine as this mainly tests conductor's ability to add itself into the raft consensus cluster as a nonvoter. + t.Log("Testing AddServerAsNonvoter") + nonvoter, err := retry.Do[*conductor](ctx, maxSetupRetries, retryStrategy, func() (*conductor, error) { + return setupConductor( + t, VerifierName, t.TempDir(), + sys.RollupEndpoint(Sequencer3Name), + sys.NodeEndpoint(Sequencer3Name), + findAvailablePort(t), + false, + *sys.RollupConfig, + ) + }) + require.NoError(t, err) + defer func() { + err = nonvoter.service.Stop(ctx) + require.NoError(t, err) + }() + + err = leader.client.AddServerAsNonvoter(ctx, VerifierName, nonvoter.ConsensusEndpoint()) + require.NoError(t, err, "Expected leader to add non-voter") + membership, err = leader.client.ClusterMembership(ctx) + require.NoError(t, err) + require.Equal(t, 4, len(membership), "Expected 4 members in cluster") + require.Equal(t, consensus.Nonvoter, membership[3].Suffrage, "Expected last member to be non-voter") + + t.Log("Testing RemoveServer, call remove on follower, expected to fail") + lid, leader = findLeader(t, conductors) + fid, follower = findFollower(t, conductors) + err = follower.client.RemoveServer(ctx, lid) + require.ErrorContains(t, err, "node is not the leader", "Expected follower to fail to remove leader") + membership, err = c1.client.ClusterMembership(ctx) + require.NoError(t, err) + require.Equal(t, 4, len(membership), "Expected 4 members in cluster") + + t.Log("Testing RemoveServer, call remove on leader, expect non-voter to be removed") + err = leader.client.RemoveServer(ctx, VerifierName) + require.NoError(t, err, "Expected leader to remove non-voter") + membership, err = c1.client.ClusterMembership(ctx) + require.NoError(t, err) + require.Equal(t, 3, len(membership), "Expected 2 members in cluster after removal") + require.NotContains(t, membership, VerifierName, "Expected follower to be removed from cluster") + + t.Log("Testing RemoveServer, call remove on leader, expect voter to be removed") + err = leader.client.RemoveServer(ctx, fid) + require.NoError(t, err, "Expected leader to remove follower") + membership, err = c1.client.ClusterMembership(ctx) + require.NoError(t, err) + require.Equal(t, 2, len(membership), "Expected 2 members in cluster after removal") + require.NotContains(t, membership, fid, "Expected follower to be removed from cluster") +} + +// [Category: Sequencer Failover] +// Test that the sequencer can successfully failover to a new sequencer once the active sequencer goes down. +func TestSequencerFailover_ActiveSequencerDown(t *testing.T) { + sys, conductors, cleanup := setupSequencerFailoverTest(t) + defer cleanup() + + ctx := context.Background() + leaderId, leader := findLeader(t, conductors) + err := sys.RollupNodes[leaderId].Stop(ctx) // Stop the current leader sequencer + require.NoError(t, err) + + // The leadership change should occur with no errors + newID := waitForLeadershipChange(t, leader, leaderId, conductors, sys) + require.NotEqual(t, leaderId, newID, "Expected leader to change") + + // Confirm the new leader is different from the old leader + newLeaderId, _ := findLeader(t, conductors) + require.NotEqual(t, leaderId, newLeaderId, "Expected leader to change") + + // Check that the sequencer is healthy + require.True(t, healthy(t, ctx, conductors[newLeaderId])) + + // Check if the new leader is sequencing + active, err := sys.RollupClient(newLeaderId).SequencerActive(ctx) + require.NoError(t, err) + require.True(t, active, "Expected new leader to be sequencing") +} diff --git a/op-e2e2/setup.go b/op-e2e2/setup.go new file mode 100644 index 000000000000..389b6df9956c --- /dev/null +++ b/op-e2e2/setup.go @@ -0,0 +1,974 @@ +package op_e2e + +import ( + "context" + "crypto/ecdsa" + "crypto/rand" + "errors" + "fmt" + "math/big" + "net" + "os" + "path" + "sort" + "strings" + "sync/atomic" + "testing" + "time" + + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/batcher" + ds "github.com/ipfs/go-datastore" + dsSync "github.com/ipfs/go-datastore/sync" + ic "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/peerstore" + "github.com/libp2p/go-libp2p/p2p/host/peerstore/pstoremem" + mocknet "github.com/libp2p/go-libp2p/p2p/net/mock" + ma "github.com/multiformats/go-multiaddr" + "github.com/stretchr/testify/require" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/types" + geth_eth "github.com/ethereum/go-ethereum/eth" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/node" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rpc" + + bss "github.com/ethereum-optimism/optimism/op-batcher/batcher" + batcherFlags "github.com/ethereum-optimism/optimism/op-batcher/flags" + "github.com/ethereum-optimism/optimism/op-chain-ops/genesis" + "github.com/ethereum-optimism/optimism/op-e2e2/config" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/fakebeacon" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/geth" + "github.com/ethereum-optimism/optimism/op-node/chaincfg" + "github.com/ethereum-optimism/optimism/op-node/metrics" + rollupNode "github.com/ethereum-optimism/optimism/op-node/node" + "github.com/ethereum-optimism/optimism/op-node/p2p" + "github.com/ethereum-optimism/optimism/op-node/p2p/store" + "github.com/ethereum-optimism/optimism/op-node/rollup" + "github.com/ethereum-optimism/optimism/op-node/rollup/derive" + "github.com/ethereum-optimism/optimism/op-node/rollup/driver" + "github.com/ethereum-optimism/optimism/op-node/rollup/sync" + l2os "github.com/ethereum-optimism/optimism/op-proposer/proposer" + "github.com/ethereum-optimism/optimism/op-service/cliapp" + "github.com/ethereum-optimism/optimism/op-service/client" + "github.com/ethereum-optimism/optimism/op-service/clock" + "github.com/ethereum-optimism/optimism/op-service/dial" + "github.com/ethereum-optimism/optimism/op-service/eth" + oplog "github.com/ethereum-optimism/optimism/op-service/log" + "github.com/ethereum-optimism/optimism/op-service/predeploys" + "github.com/ethereum-optimism/optimism/op-service/sources" + "github.com/ethereum-optimism/optimism/op-service/testlog" + "github.com/ethereum-optimism/optimism/op-service/txmgr" +) + +var testingJWTSecret = [32]byte{123} + +func newTxMgrConfig(l1Addr string, privKey *ecdsa.PrivateKey) txmgr.CLIConfig { + return txmgr.CLIConfig{ + L1RPCURL: l1Addr, + PrivateKey: hexPriv(privKey), + NumConfirmations: 1, + SafeAbortNonceTooLowCount: 3, + FeeLimitMultiplier: 5, + ResubmissionTimeout: 3 * time.Second, + ReceiptQueryInterval: 50 * time.Millisecond, + NetworkTimeout: 2 * time.Second, + TxNotInMempoolTimeout: 2 * time.Minute, + } +} + +func DefaultSystemConfig(t testing.TB) SystemConfig { + config.ExternalL2TestParms.SkipIfNecessary(t) + + secrets, err := e2eutils.DefaultMnemonicConfig.Secrets() + require.NoError(t, err) + deployConfig := config.DeployConfig.Copy() + deployConfig.L1GenesisBlockTimestamp = hexutil.Uint64(time.Now().Unix()) + e2eutils.ApplyDeployConfigForks(deployConfig) + require.NoError(t, deployConfig.Check(), "Deploy config is invalid, do you need to run make devnet-allocs?") + l1Deployments := config.L1Deployments.Copy() + require.NoError(t, l1Deployments.Check(deployConfig)) + + require.Equal(t, secrets.Addresses().Batcher, deployConfig.BatchSenderAddress) + require.Equal(t, secrets.Addresses().SequencerP2P, deployConfig.P2PSequencerAddress) + require.Equal(t, secrets.Addresses().Proposer, deployConfig.L2OutputOracleProposer) + + // Tests depend on premine being filled with secrets addresses + premine := make(map[common.Address]*big.Int) + for _, addr := range secrets.Addresses().All() { + premine[addr] = new(big.Int).Mul(big.NewInt(1000), big.NewInt(params.Ether)) + } + + return SystemConfig{ + Secrets: secrets, + Premine: premine, + DeployConfig: deployConfig, + L1Deployments: config.L1Deployments, + L1InfoPredeployAddress: predeploys.L1BlockAddr, + JWTFilePath: writeDefaultJWT(t), + JWTSecret: testingJWTSecret, + BlobsPath: t.TempDir(), + Nodes: map[string]*rollupNode.Config{ + "sequencer": { + Driver: driver.Config{ + VerifierConfDepth: 0, + SequencerConfDepth: 0, + SequencerEnabled: true, + }, + // Submitter PrivKey is set in system start for rollup nodes where sequencer = true + RPC: rollupNode.RPCConfig{ + ListenAddr: "127.0.0.1", + ListenPort: 0, + EnableAdmin: true, + }, + L1EpochPollInterval: time.Second * 2, + RuntimeConfigReloadInterval: time.Minute * 10, + ConfigPersistence: &rollupNode.DisabledConfigPersistence{}, + Sync: sync.Config{SyncMode: sync.CLSync}, + }, + "verifier": { + Driver: driver.Config{ + VerifierConfDepth: 0, + SequencerConfDepth: 0, + SequencerEnabled: false, + }, + L1EpochPollInterval: time.Second * 4, + RuntimeConfigReloadInterval: time.Minute * 10, + ConfigPersistence: &rollupNode.DisabledConfigPersistence{}, + Sync: sync.Config{SyncMode: sync.CLSync}, + }, + }, + Loggers: map[string]log.Logger{ + "verifier": testlog.Logger(t, log.LevelInfo).New("role", "verifier"), + "sequencer": testlog.Logger(t, log.LevelInfo).New("role", "sequencer"), + "batcher": testlog.Logger(t, log.LevelInfo).New("role", "batcher"), + "proposer": testlog.Logger(t, log.LevelCrit).New("role", "proposer"), + }, + GethOptions: map[string][]geth.GethOption{}, + P2PTopology: nil, // no P2P connectivity by default + NonFinalizedProposals: false, + ExternalL2Shim: config.ExternalL2Shim, + DataAvailabilityType: batcherFlags.CalldataType, + MaxPendingTransactions: 1, + BatcherTargetNumFrames: 1, + } +} + +func writeDefaultJWT(t testing.TB) string { + // Sadly the geth node config cannot load JWT secret from memory, it has to be a file + jwtPath := path.Join(t.TempDir(), "jwt_secret") + if err := os.WriteFile(jwtPath, []byte(hexutil.Encode(testingJWTSecret[:])), 0o600); err != nil { + t.Fatalf("failed to prepare jwt file for geth: %v", err) + } + return jwtPath +} + +type DepositContractConfig struct { + L2Oracle common.Address + FinalizationPeriod *big.Int +} + +type SystemConfig struct { + Secrets *e2eutils.Secrets + L1InfoPredeployAddress common.Address + + DeployConfig *genesis.DeployConfig + L1Deployments *genesis.L1Deployments + + JWTFilePath string + JWTSecret [32]byte + + BlobsPath string + + Premine map[common.Address]*big.Int + Nodes map[string]*rollupNode.Config // Per node config. Don't use populate rollup.Config + Loggers map[string]log.Logger + GethOptions map[string][]geth.GethOption + ProposerLogger log.Logger + BatcherLogger log.Logger + + ExternalL2Shim string + + // map of outbound connections to other nodes. Node names prefixed with "~" are unconnected but linked. + // A nil map disables P2P completely. + // Any node name not in the topology will not have p2p enabled. + P2PTopology map[string][]string + + // Enables req-resp sync in the P2P nodes + P2PReqRespSync bool + + // If the proposer can make proposals for L2 blocks derived from L1 blocks which are not finalized on L1 yet. + NonFinalizedProposals bool + + // Explicitly disable batcher, for tests that rely on unsafe L2 payloads + DisableBatcher bool + + // Configure data-availability type that is used by the batcher. + DataAvailabilityType batcherFlags.DataAvailabilityType + + // Max L1 tx size for the batcher transactions + BatcherMaxL1TxSizeBytes uint64 + + // Target number of frames to create per channel. Can be used to create + // multi-blob transactions. + // Default is 1 if unset. + BatcherTargetNumFrames int + + // whether to actually use BatcherMaxL1TxSizeBytes for blobs, insteaf of max blob size + BatcherUseMaxTxSizeForBlobs bool + + // SupportL1TimeTravel determines if the L1 node supports quickly skipping forward in time + SupportL1TimeTravel bool + + // MaxPendingTransactions determines how many transactions the batcher will try to send + // concurrently. 0 means unlimited. + MaxPendingTransactions uint64 +} + +type GethInstance struct { + Backend *geth_eth.Ethereum + Node *node.Node +} + +func (gi *GethInstance) HTTPEndpoint() string { + return gi.Node.HTTPEndpoint() +} + +func (gi *GethInstance) WSEndpoint() string { + return gi.Node.WSEndpoint() +} + +func (gi *GethInstance) WSAuthEndpoint() string { + return gi.Node.WSAuthEndpoint() +} + +func (gi *GethInstance) HTTPAuthEndpoint() string { + return gi.Node.HTTPAuthEndpoint() +} + +func (gi *GethInstance) Close() error { + return gi.Node.Close() +} + +// EthInstance is either an in process Geth or external process exposing its +// endpoints over the network +type EthInstance interface { + HTTPEndpoint() string + WSEndpoint() string + HTTPAuthEndpoint() string + WSAuthEndpoint() string + Close() error +} + +type System struct { + Cfg SystemConfig + + RollupConfig *rollup.Config + + L2GenesisCfg *core.Genesis + + // Connections to running nodes + EthInstances map[string]EthInstance + Clients map[string]*ethclient.Client + RawClients map[string]*rpc.Client + RollupNodes map[string]*rollupNode.OpNode + L2OutputSubmitter *l2os.ProposerService + BatchSubmitter *bss.BatcherService + Mocknet mocknet.Mocknet + + L1BeaconAPIAddr string + + // TimeTravelClock is nil unless SystemConfig.SupportL1TimeTravel was set to true + // It provides access to the clock instance used by the L1 node. Calling TimeTravelClock.AdvanceBy + // allows tests to quickly time travel L1 into the future. + // Note that this time travel may occur in a single block, creating a very large difference in the Time + // on sequential blocks. + TimeTravelClock *clock.AdvancingClock + + t *testing.T + closed atomic.Bool + + // rollupClients caches the lazily created RollupClient instances so they can be reused and closed + rollupClients map[string]*sources.RollupClient +} + +// AdvanceTime advances the system clock by the given duration. +// If the [System.TimeTravelClock] is nil, this is a no-op. +func (sys *System) AdvanceTime(d time.Duration) { + if sys.TimeTravelClock != nil { + sys.TimeTravelClock.AdvanceTime(d) + } +} + +func (sys *System) L1BeaconEndpoint() string { + return sys.L1BeaconAPIAddr +} + +func (sys *System) L1BeaconHTTPClient() *sources.BeaconHTTPClient { + logger := testlog.Logger(sys.t, log.LevelInfo).New("component", "beaconClient") + return sources.NewBeaconHTTPClient(client.NewBasicHTTPClient(sys.L1BeaconEndpoint(), logger)) +} + +func (sys *System) NodeEndpoint(name string) string { + return selectEndpoint(sys.EthInstances[name]) +} + +func (sys *System) NodeClient(name string) *ethclient.Client { + return sys.Clients[name] +} + +func (sys *System) RollupEndpoint(name string) string { + return sys.RollupNodes[name].HTTPEndpoint() +} + +func (sys *System) RollupClient(name string) *sources.RollupClient { + client, ok := sys.rollupClients[name] + if ok { + return client + } + logger := testlog.Logger(sys.t, log.LevelInfo).New("rollupClient", name) + endpoint := sys.RollupEndpoint(name) + client, err := dial.DialRollupClientWithTimeout(context.Background(), 30*time.Second, logger, endpoint) + require.NoErrorf(sys.t, err, "Failed to dial rollup client %v", name) + sys.rollupClients[name] = client + return client +} + +func (sys *System) L1Deployments() *genesis.L1Deployments { + return sys.Cfg.L1Deployments +} + +func (sys *System) RollupCfg() *rollup.Config { + return sys.RollupConfig +} + +func (sys *System) L2Genesis() *core.Genesis { + return sys.L2GenesisCfg +} + +func (sys *System) L1Slot(l1Timestamp uint64) uint64 { + return (l1Timestamp - uint64(sys.Cfg.DeployConfig.L1GenesisBlockTimestamp)) / + sys.Cfg.DeployConfig.L1BlockTime +} + +func (sys *System) Close() { + if !sys.closed.CompareAndSwap(false, true) { + // Already closed. + return + } + postCtx, postCancel := context.WithCancel(context.Background()) + postCancel() // immediate shutdown, no allowance for idling + + var combinedErr error + if sys.L2OutputSubmitter != nil { + if err := sys.L2OutputSubmitter.Kill(); err != nil && !errors.Is(err, l2os.ErrAlreadyStopped) { + combinedErr = errors.Join(combinedErr, fmt.Errorf("stop L2OutputSubmitter: %w", err)) + } + } + if sys.BatchSubmitter != nil { + if err := sys.BatchSubmitter.Kill(); err != nil && !errors.Is(err, bss.ErrAlreadyStopped) { + combinedErr = errors.Join(combinedErr, fmt.Errorf("stop BatchSubmitter: %w", err)) + } + } + + for name, node := range sys.RollupNodes { + if err := node.Stop(postCtx); err != nil && !errors.Is(err, rollupNode.ErrAlreadyClosed) { + combinedErr = errors.Join(combinedErr, fmt.Errorf("stop rollup node %v: %w", name, err)) + } + } + for name, ei := range sys.EthInstances { + if err := ei.Close(); err != nil && !errors.Is(err, node.ErrNodeStopped) { + combinedErr = errors.Join(combinedErr, fmt.Errorf("stop EthInstance %v: %w", name, err)) + } + } + for _, client := range sys.rollupClients { + client.Close() + } + if sys.Mocknet != nil { + if err := sys.Mocknet.Close(); err != nil { + combinedErr = errors.Join(combinedErr, fmt.Errorf("stop Mocknet: %w", err)) + } + } + require.NoError(sys.t, combinedErr, "Failed to stop system") +} + +type systemConfigHook func(sCfg *SystemConfig, s *System) + +type SystemConfigOption struct { + key string + role string + action systemConfigHook +} + +type SystemConfigOptions struct { + opts map[string]systemConfigHook +} + +func NewSystemConfigOptions(_opts []SystemConfigOption) (SystemConfigOptions, error) { + opts := make(map[string]systemConfigHook) + for _, opt := range _opts { + if _, ok := opts[opt.key+":"+opt.role]; ok { + return SystemConfigOptions{}, fmt.Errorf("duplicate option for key %s and role %s", opt.key, opt.role) + } + opts[opt.key+":"+opt.role] = opt.action + } + + return SystemConfigOptions{ + opts: opts, + }, nil +} + +func (s *SystemConfigOptions) Get(key, role string) (systemConfigHook, bool) { + v, ok := s.opts[key+":"+role] + return v, ok +} + +func (cfg SystemConfig) Start(t *testing.T, _opts ...SystemConfigOption) (*System, error) { + opts, err := NewSystemConfigOptions(_opts) + if err != nil { + return nil, err + } + + sys := &System{ + t: t, + Cfg: cfg, + EthInstances: make(map[string]EthInstance), + Clients: make(map[string]*ethclient.Client), + RawClients: make(map[string]*rpc.Client), + RollupNodes: make(map[string]*rollupNode.OpNode), + rollupClients: make(map[string]*sources.RollupClient), + } + // Automatically stop the system at the end of the test + t.Cleanup(sys.Close) + + c := clock.SystemClock + if cfg.SupportL1TimeTravel { + sys.TimeTravelClock = clock.NewAdvancingClock(100 * time.Millisecond) + c = sys.TimeTravelClock + } + + if err := cfg.DeployConfig.Check(); err != nil { + return nil, err + } + + l1Genesis, err := genesis.BuildL1DeveloperGenesis(cfg.DeployConfig, config.L1Allocs, config.L1Deployments) + if err != nil { + return nil, err + } + + for addr, amount := range cfg.Premine { + if existing, ok := l1Genesis.Alloc[addr]; ok { + l1Genesis.Alloc[addr] = types.Account{ + Code: existing.Code, + Storage: existing.Storage, + Balance: amount, + Nonce: existing.Nonce, + } + } else { + l1Genesis.Alloc[addr] = types.Account{ + Balance: amount, + Nonce: 0, + } + } + } + + l1Block := l1Genesis.ToBlock() + var allocsMode genesis.L2AllocsMode + allocsMode = genesis.L2AllocsDelta + if fjordTime := cfg.DeployConfig.FjordTime(l1Block.Time()); fjordTime != nil && *fjordTime <= 0 { + allocsMode = genesis.L2AllocsFjord + } else if ecotoneTime := cfg.DeployConfig.EcotoneTime(l1Block.Time()); ecotoneTime != nil && *ecotoneTime <= 0 { + allocsMode = genesis.L2AllocsEcotone + } + t.Log("Generating L2 genesis", "l2_allocs_mode", string(allocsMode)) + l2Allocs := config.L2Allocs(allocsMode) + l2Genesis, err := genesis.BuildL2Genesis(cfg.DeployConfig, l2Allocs, l1Block) + if err != nil { + return nil, err + } + sys.L2GenesisCfg = l2Genesis + for addr, amount := range cfg.Premine { + if existing, ok := l2Genesis.Alloc[addr]; ok { + l2Genesis.Alloc[addr] = types.Account{ + Code: existing.Code, + Storage: existing.Storage, + Balance: amount, + Nonce: existing.Nonce, + } + } else { + l2Genesis.Alloc[addr] = types.Account{ + Balance: amount, + Nonce: 0, + } + } + } + + makeRollupConfig := func() rollup.Config { + return rollup.Config{ + Genesis: rollup.Genesis{ + L1: eth.BlockID{ + Hash: l1Block.Hash(), + Number: 0, + }, + L2: eth.BlockID{ + Hash: l2Genesis.ToBlock().Hash(), + Number: 0, + }, + L2Time: uint64(cfg.DeployConfig.L1GenesisBlockTimestamp), + SystemConfig: e2eutils.SystemConfigFromDeployConfig(cfg.DeployConfig), + }, + BlockTime: cfg.DeployConfig.L2BlockTime, + MaxSequencerDrift: cfg.DeployConfig.MaxSequencerDrift, + SeqWindowSize: cfg.DeployConfig.SequencerWindowSize, + ChannelTimeout: cfg.DeployConfig.ChannelTimeout, + L1ChainID: cfg.L1ChainIDBig(), + L2ChainID: cfg.L2ChainIDBig(), + BatchInboxAddress: cfg.DeployConfig.BatchInboxAddress, + DepositContractAddress: cfg.DeployConfig.OptimismPortalProxy, + L1SystemConfigAddress: cfg.DeployConfig.SystemConfigProxy, + RegolithTime: cfg.DeployConfig.RegolithTime(uint64(cfg.DeployConfig.L1GenesisBlockTimestamp)), + CanyonTime: cfg.DeployConfig.CanyonTime(uint64(cfg.DeployConfig.L1GenesisBlockTimestamp)), + DeltaTime: cfg.DeployConfig.DeltaTime(uint64(cfg.DeployConfig.L1GenesisBlockTimestamp)), + EcotoneTime: cfg.DeployConfig.EcotoneTime(uint64(cfg.DeployConfig.L1GenesisBlockTimestamp)), + FjordTime: cfg.DeployConfig.FjordTime(uint64(cfg.DeployConfig.L1GenesisBlockTimestamp)), + InteropTime: cfg.DeployConfig.InteropTime(uint64(cfg.DeployConfig.L1GenesisBlockTimestamp)), + ProtocolVersionsAddress: cfg.L1Deployments.ProtocolVersionsProxy, + } + } + defaultConfig := makeRollupConfig() + if err := defaultConfig.Check(); err != nil { + return nil, err + } + sys.RollupConfig = &defaultConfig + + // Create a fake Beacon node to hold on to blobs created by the L1 miner, and to serve them to L2 + bcn := fakebeacon.NewBeacon(testlog.Logger(t, log.LevelInfo).New("role", "l1_cl"), + path.Join(cfg.BlobsPath, "l1_cl"), l1Genesis.Timestamp, cfg.DeployConfig.L1BlockTime) + t.Cleanup(func() { + _ = bcn.Close() + }) + require.NoError(t, bcn.Start("127.0.0.1:0")) + beaconApiAddr := bcn.BeaconAddr() + require.NotEmpty(t, beaconApiAddr, "beacon API listener must be up") + sys.L1BeaconAPIAddr = beaconApiAddr + + // Initialize nodes + l1Node, l1Backend, err := geth.InitL1(cfg.DeployConfig.L1ChainID, cfg.DeployConfig.L1BlockTime, l1Genesis, c, + path.Join(cfg.BlobsPath, "l1_el"), bcn, cfg.GethOptions["l1"]...) + if err != nil { + return nil, err + } + sys.EthInstances["l1"] = &GethInstance{ + Backend: l1Backend, + Node: l1Node, + } + err = l1Node.Start() + if err != nil { + return nil, err + } + + for name := range cfg.Nodes { + var ethClient EthInstance + if cfg.ExternalL2Shim == "" { + node, backend, err := geth.InitL2(name, big.NewInt(int64(cfg.DeployConfig.L2ChainID)), l2Genesis, cfg.JWTFilePath, cfg.GethOptions[name]...) + if err != nil { + return nil, err + } + gethInst := &GethInstance{ + Backend: backend, + Node: node, + } + err = gethInst.Node.Start() + if err != nil { + return nil, err + } + ethClient = gethInst + } else { + if len(cfg.GethOptions[name]) > 0 { + t.Skip("External L2 nodes do not support configuration through GethOptions") + } + ethClient = (&ExternalRunner{ + Name: name, + BinPath: cfg.ExternalL2Shim, + Genesis: l2Genesis, + JWTPath: cfg.JWTFilePath, + }).Run(t) + } + sys.EthInstances[name] = ethClient + } + + // Configure connections to L1 and L2 for rollup nodes. + // TODO: refactor testing to allow use of in-process rpc connections instead + // of only websockets (which are required for external eth client tests). + for name, nodeCfg := range cfg.Nodes { + configureL1(nodeCfg, sys.EthInstances["l1"]) + configureL2(nodeCfg, sys.EthInstances[name], cfg.JWTSecret) + if sys.RollupConfig.EcotoneTime != nil { + nodeCfg.Beacon = &rollupNode.L1BeaconEndpointConfig{BeaconAddr: sys.L1BeaconAPIAddr} + } + } + + // Geth Clients + ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second) + defer cancel() + l1Srv, err := l1Node.RPCHandler() + if err != nil { + return nil, err + } + rawL1Client := rpc.DialInProc(l1Srv) + l1Client := ethclient.NewClient(rawL1Client) + sys.Clients["l1"] = l1Client + sys.RawClients["l1"] = rawL1Client + for name, ethInst := range sys.EthInstances { + rawClient, err := rpc.DialContext(ctx, ethInst.WSEndpoint()) + if err != nil { + return nil, err + } + client := ethclient.NewClient(rawClient) + sys.RawClients[name] = rawClient + sys.Clients[name] = client + } + + _, err = geth.WaitForBlock(big.NewInt(2), l1Client, 6*time.Second*time.Duration(cfg.DeployConfig.L1BlockTime)) + if err != nil { + return nil, fmt.Errorf("waiting for blocks: %w", err) + } + + sys.Mocknet = mocknet.New() + + p2pNodes := make(map[string]*p2p.Prepared) + if cfg.P2PTopology != nil { + // create the peer if it doesn't exist yet. + initHostMaybe := func(name string) (*p2p.Prepared, error) { + if p, ok := p2pNodes[name]; ok { + return p, nil + } + h, err := sys.newMockNetPeer() + if err != nil { + return nil, fmt.Errorf("failed to init p2p host for node %s", name) + } + h.Network() + _, ok := cfg.Nodes[name] + if !ok { + return nil, fmt.Errorf("node %s from p2p topology not found in actual nodes map", name) + } + // TODO we can enable discv5 in the testnodes to test discovery of new peers. + // Would need to mock though, and the discv5 implementation does not provide nice mocks here. + p := &p2p.Prepared{ + HostP2P: h, + LocalNode: nil, + UDPv5: nil, + EnableReqRespSync: cfg.P2PReqRespSync, + } + p2pNodes[name] = p + return p, nil + } + for k, vs := range cfg.P2PTopology { + peerA, err := initHostMaybe(k) + if err != nil { + return nil, fmt.Errorf("failed to setup mocknet peer %s", k) + } + for _, v := range vs { + v = strings.TrimPrefix(v, "~") + peerB, err := initHostMaybe(v) + if err != nil { + return nil, fmt.Errorf("failed to setup mocknet peer %s (peer of %s)", v, k) + } + if _, err := sys.Mocknet.LinkPeers(peerA.HostP2P.ID(), peerB.HostP2P.ID()); err != nil { + return nil, fmt.Errorf("failed to setup mocknet link between %s and %s", k, v) + } + // connect the peers after starting the full rollup node + } + } + } + + // Don't log state snapshots in test output + snapLog := log.NewLogger(log.DiscardHandler()) + + // Rollup nodes + + // Ensure we are looping through the nodes in alphabetical order + ks := make([]string, 0, len(cfg.Nodes)) + for k := range cfg.Nodes { + ks = append(ks, k) + } + // Sort strings in ascending alphabetical order + sort.Strings(ks) + + for _, name := range ks { + nodeConfig := cfg.Nodes[name] + c := *nodeConfig // copy + c.Rollup = makeRollupConfig() + if err := c.LoadPersisted(cfg.Loggers[name]); err != nil { + return nil, err + } + + if p, ok := p2pNodes[name]; ok { + c.P2P = p + + if c.Driver.SequencerEnabled && c.P2PSigner == nil { + c.P2PSigner = &p2p.PreparedSigner{Signer: p2p.NewLocalSigner(cfg.Secrets.SequencerP2P)} + } + } + + c.Rollup.LogDescription(cfg.Loggers[name], chaincfg.L2ChainIDToNetworkDisplayName) + l := cfg.Loggers[name] + var cycle cliapp.Lifecycle + c.Cancel = func(errCause error) { + l.Warn("node requested early shutdown!", "err", errCause) + go func() { + postCtx, postCancel := context.WithCancel(context.Background()) + postCancel() // don't allow the stopping to continue for longer than needed + if err := cycle.Stop(postCtx); err != nil { + t.Error(err) + } + l.Warn("closed op-node!") + }() + } + node, err := rollupNode.New(context.Background(), &c, l, snapLog, "", metrics.NewMetrics("")) + if err != nil { + return nil, err + } + cycle = node + err = node.Start(context.Background()) + if err != nil { + return nil, err + } + sys.RollupNodes[name] = node + + if action, ok := opts.Get("afterRollupNodeStart", name); ok { + action(&cfg, sys) + } + } + + if cfg.P2PTopology != nil { + // We only set up the connections after starting the actual nodes, + // so GossipSub and other p2p protocols can be started before the connections go live. + // This way protocol negotiation happens correctly. + for k, vs := range cfg.P2PTopology { + peerA := p2pNodes[k] + for _, v := range vs { + unconnected := strings.HasPrefix(v, "~") + if unconnected { + v = v[1:] + } + if !unconnected { + peerB := p2pNodes[v] + if _, err := sys.Mocknet.ConnectPeers(peerA.HostP2P.ID(), peerB.HostP2P.ID()); err != nil { + return nil, fmt.Errorf("failed to setup mocknet connection between %s and %s", k, v) + } + } + } + } + } + + // Don't start batch submitter and proposer if there's no sequencer. + if sys.RollupNodes["sequencer"] == nil { + return sys, nil + } + + // L2Output Submitter + var proposerCLIConfig *l2os.CLIConfig + if e2eutils.UseFPAC() { + proposerCLIConfig = &l2os.CLIConfig{ + L1EthRpc: sys.EthInstances["l1"].WSEndpoint(), + RollupRpc: sys.RollupNodes["sequencer"].HTTPEndpoint(), + DGFAddress: config.L1Deployments.DisputeGameFactoryProxy.Hex(), + ProposalInterval: 6 * time.Second, + DisputeGameType: 0, + PollInterval: 50 * time.Millisecond, + TxMgrConfig: newTxMgrConfig(sys.EthInstances["l1"].WSEndpoint(), cfg.Secrets.Proposer), + AllowNonFinalized: cfg.NonFinalizedProposals, + LogConfig: oplog.CLIConfig{ + Level: log.LvlInfo, + Format: oplog.FormatText, + }, + } + } else { + proposerCLIConfig = &l2os.CLIConfig{ + L1EthRpc: sys.EthInstances["l1"].WSEndpoint(), + RollupRpc: sys.RollupNodes["sequencer"].HTTPEndpoint(), + L2OOAddress: config.L1Deployments.L2OutputOracleProxy.Hex(), + PollInterval: 50 * time.Millisecond, + TxMgrConfig: newTxMgrConfig(sys.EthInstances["l1"].WSEndpoint(), cfg.Secrets.Proposer), + AllowNonFinalized: cfg.NonFinalizedProposals, + LogConfig: oplog.CLIConfig{ + Level: log.LvlInfo, + Format: oplog.FormatText, + }, + } + } + proposer, err := l2os.ProposerServiceFromCLIConfig(context.Background(), "0.0.1", proposerCLIConfig, sys.Cfg.Loggers["proposer"]) + if err != nil { + return nil, fmt.Errorf("unable to setup l2 output submitter: %w", err) + } + if err := proposer.Start(context.Background()); err != nil { + return nil, fmt.Errorf("unable to start l2 output submitter: %w", err) + } + sys.L2OutputSubmitter = proposer + + var batchType uint = derive.SingularBatchType + if cfg.DeployConfig.L2GenesisDeltaTimeOffset != nil && *cfg.DeployConfig.L2GenesisDeltaTimeOffset == hexutil.Uint64(0) { + batchType = derive.SpanBatchType + } + // batcher defaults if unset + batcherMaxL1TxSizeBytes := cfg.BatcherMaxL1TxSizeBytes + if batcherMaxL1TxSizeBytes == 0 { + batcherMaxL1TxSizeBytes = 120_000 + } + batcherTargetNumFrames := cfg.BatcherTargetNumFrames + if batcherTargetNumFrames == 0 { + batcherTargetNumFrames = 1 + } + + var compressionAlgo derive.CompressionAlgo = derive.Zlib + // if opt has brotli key, set the compression algo as brotli + if _, ok := opts.Get("compressionAlgo", "brotli"); ok { + compressionAlgo = derive.Brotli10 + } + + batcherCLIConfig := &bss.CLIConfig{ + L1EthRpc: sys.EthInstances["l1"].WSEndpoint(), + L2EthRpc: sys.EthInstances["sequencer"].WSEndpoint(), + RollupRpc: sys.RollupNodes["sequencer"].HTTPEndpoint(), + MaxPendingTransactions: cfg.MaxPendingTransactions, + MaxChannelDuration: 1, + MaxL1TxSize: batcherMaxL1TxSizeBytes, + TestUseMaxTxSizeForBlobs: cfg.BatcherUseMaxTxSizeForBlobs, + TargetNumFrames: int(batcherTargetNumFrames), + ApproxComprRatio: 0.4, + SubSafetyMargin: 4, + PollInterval: 50 * time.Millisecond, + TxMgrConfig: newTxMgrConfig(sys.EthInstances["l1"].WSEndpoint(), cfg.Secrets.Batcher), + LogConfig: oplog.CLIConfig{ + Level: log.LevelInfo, + Format: oplog.FormatText, + }, + Stopped: sys.Cfg.DisableBatcher, // Batch submitter may be enabled later + BatchType: batchType, + DataAvailabilityType: sys.Cfg.DataAvailabilityType, + CompressionAlgo: compressionAlgo, + } + // Batch Submitter + batcher, err := bss.BatcherServiceFromCLIConfig(context.Background(), "0.0.1", batcherCLIConfig, sys.Cfg.Loggers["batcher"]) + if err != nil { + return nil, fmt.Errorf("failed to setup batch submitter: %w", err) + } + if err := batcher.Start(context.Background()); err != nil { + return nil, errors.Join(fmt.Errorf("failed to start batch submitter: %w", err), batcher.Stop(context.Background())) + } + sys.BatchSubmitter = batcher + + return sys, nil +} + +// IP6 range that gets blackholed (in case our traffic ever makes it out onto +// the internet). +var blackholeIP6 = net.ParseIP("100::") + +// mocknet doesn't allow us to add a peerstore without fully creating the peer ourselves +func (sys *System) newMockNetPeer() (host.Host, error) { + sk, _, err := ic.GenerateECDSAKeyPair(rand.Reader) + if err != nil { + return nil, err + } + id, err := peer.IDFromPrivateKey(sk) + if err != nil { + return nil, err + } + suffix := id + if len(id) > 8 { + suffix = id[len(id)-8:] + } + ip := append(net.IP{}, blackholeIP6...) + copy(ip[net.IPv6len-len(suffix):], suffix) + a, err := ma.NewMultiaddr(fmt.Sprintf("/ip6/%s/tcp/4242", ip)) + if err != nil { + return nil, fmt.Errorf("failed to create test multiaddr: %w", err) + } + p, err := peer.IDFromPublicKey(sk.GetPublic()) + if err != nil { + return nil, err + } + + ps, err := pstoremem.NewPeerstore() + if err != nil { + return nil, err + } + ps.AddAddr(p, a, peerstore.PermanentAddrTTL) + _ = ps.AddPrivKey(p, sk) + _ = ps.AddPubKey(p, sk.GetPublic()) + + ds := dsSync.MutexWrap(ds.NewMapDatastore()) + eps, err := store.NewExtendedPeerstore(context.Background(), log.Root(), clock.SystemClock, ps, ds, 24*time.Hour) + if err != nil { + return nil, err + } + return sys.Mocknet.AddPeerWithPeerstore(p, eps) +} + +func (sys *System) BatcherHelper() *batcher.Helper { + return batcher.NewHelper(sys.t, sys.Cfg.Secrets.Batcher, sys.RollupConfig, sys.NodeClient("l1")) +} + +func UseHTTP() bool { + return os.Getenv("OP_E2E_USE_HTTP") == "true" +} + +func selectEndpoint(node EthInstance) string { + if UseHTTP() { + log.Info("using HTTP client") + return node.HTTPEndpoint() + } + return node.WSEndpoint() +} + +func configureL1(rollupNodeCfg *rollupNode.Config, l1Node EthInstance) { + l1EndpointConfig := selectEndpoint(l1Node) + rollupNodeCfg.L1 = &rollupNode.L1EndpointConfig{ + L1NodeAddr: l1EndpointConfig, + L1TrustRPC: false, + L1RPCKind: sources.RPCKindStandard, + RateLimit: 0, + BatchSize: 20, + HttpPollInterval: time.Millisecond * 100, + MaxConcurrency: 10, + } +} + +type WSOrHTTPEndpoint interface { + WSAuthEndpoint() string + HTTPAuthEndpoint() string +} + +func configureL2(rollupNodeCfg *rollupNode.Config, l2Node WSOrHTTPEndpoint, jwtSecret [32]byte) { + l2EndpointConfig := l2Node.WSAuthEndpoint() + if UseHTTP() { + l2EndpointConfig = l2Node.HTTPAuthEndpoint() + } + + rollupNodeCfg.L2 = &rollupNode.L2EndpointConfig{ + L2EngineAddr: l2EndpointConfig, + L2EngineJWTSecret: jwtSecret, + } +} + +func (cfg SystemConfig) L1ChainIDBig() *big.Int { + return new(big.Int).SetUint64(cfg.DeployConfig.L1ChainID) +} + +func (cfg SystemConfig) L2ChainIDBig() *big.Int { + return new(big.Int).SetUint64(cfg.DeployConfig.L2ChainID) +} + +func hexPriv(in *ecdsa.PrivateKey) string { + b := e2eutils.EncodePrivKey(in) + return hexutil.Encode(b) +} diff --git a/op-e2e2/system_adminrpc_test.go b/op-e2e2/system_adminrpc_test.go new file mode 100644 index 000000000000..02a0e6b4f66e --- /dev/null +++ b/op-e2e2/system_adminrpc_test.go @@ -0,0 +1,222 @@ +package op_e2e + +import ( + "context" + "math/big" + "testing" + "time" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/rpc" + "github.com/stretchr/testify/require" + + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/wait" + "github.com/ethereum-optimism/optimism/op-node/node" + "github.com/ethereum-optimism/optimism/op-service/client" + "github.com/ethereum-optimism/optimism/op-service/eth" + "github.com/ethereum-optimism/optimism/op-service/sources" +) + +func TestStopStartSequencer(t *testing.T) { + InitParallel(t) + + cfg := DefaultSystemConfig(t) + sys, err := cfg.Start(t) + require.Nil(t, err, "Error starting up system") + defer sys.Close() + + l2Seq := sys.Clients["sequencer"] + rollupNode := sys.RollupNodes["sequencer"] + + nodeRPC, err := rpc.DialContext(context.Background(), rollupNode.HTTPEndpoint()) + require.Nil(t, err, "Error dialing node") + rollupClient := sources.NewRollupClient(client.NewBaseRPCClient(nodeRPC)) + + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) + defer cancel() + active, err := rollupClient.SequencerActive(ctx) + require.NoError(t, err) + require.True(t, active, "sequencer should be active") + + require.NoError( + t, + wait.ForNextBlock(ctx, l2Seq), + "Chain did not advance after starting sequencer", + ) + + ctx, cancel = context.WithTimeout(context.Background(), 5*time.Second) + defer cancel() + blockHash, err := rollupClient.StopSequencer(ctx) + require.Nil(t, err, "Error stopping sequencer") + + ctx, cancel = context.WithTimeout(context.Background(), 5*time.Second) + defer cancel() + active, err = rollupClient.SequencerActive(ctx) + require.NoError(t, err) + require.False(t, active, "sequencer should be inactive") + + blockBefore := latestBlock(t, l2Seq) + time.Sleep(time.Duration(cfg.DeployConfig.L2BlockTime+1) * time.Second) + blockAfter := latestBlock(t, l2Seq) + require.Equal(t, blockAfter, blockBefore, "Chain advanced after stopping sequencer") + + ctx, cancel = context.WithTimeout(context.Background(), 5*time.Second) + defer cancel() + err = rollupClient.StartSequencer(ctx, blockHash) + require.Nil(t, err, "Error starting sequencer") + + ctx, cancel = context.WithTimeout(context.Background(), 5*time.Second) + defer cancel() + active, err = rollupClient.SequencerActive(ctx) + require.NoError(t, err) + require.True(t, active, "sequencer should be active again") + + require.NoError( + t, + wait.ForNextBlock(ctx, l2Seq), + "Chain did not advance after starting sequencer", + ) +} + +func TestPersistSequencerStateWhenChanged(t *testing.T) { + InitParallel(t) + ctx := context.Background() + dir := t.TempDir() + stateFile := dir + "/state.json" + + cfg := DefaultSystemConfig(t) + // We don't need a verifier - just the sequencer is enough + delete(cfg.Nodes, "verifier") + cfg.Nodes["sequencer"].ConfigPersistence = node.NewConfigPersistence(stateFile) + + sys, err := cfg.Start(t) + require.NoError(t, err) + defer sys.Close() + + assertPersistedSequencerState(t, stateFile, node.StateStarted) + + rollupRPCClient, err := rpc.DialContext(ctx, sys.RollupNodes["sequencer"].HTTPEndpoint()) + require.Nil(t, err) + rollupClient := sources.NewRollupClient(client.NewBaseRPCClient(rollupRPCClient)) + + err = rollupClient.StartSequencer(ctx, common.Hash{0xaa}) + require.ErrorContains(t, err, "sequencer already running") + + head, err := rollupClient.StopSequencer(ctx) + require.NoError(t, err) + require.NotEqual(t, common.Hash{}, head) + assertPersistedSequencerState(t, stateFile, node.StateStopped) +} + +func TestLoadSequencerStateOnStarted_Stopped(t *testing.T) { + InitParallel(t) + ctx := context.Background() + dir := t.TempDir() + stateFile := dir + "/state.json" + + // Prepare the persisted state file with sequencer stopped + configReader := node.NewConfigPersistence(stateFile) + require.NoError(t, configReader.SequencerStopped()) + + cfg := DefaultSystemConfig(t) + // We don't need a verifier - just the sequencer is enough + delete(cfg.Nodes, "verifier") + seqCfg := cfg.Nodes["sequencer"] + seqCfg.ConfigPersistence = node.NewConfigPersistence(stateFile) + + sys, err := cfg.Start(t) + require.NoError(t, err) + defer sys.Close() + + rollupRPCClient, err := rpc.DialContext(ctx, sys.RollupNodes["sequencer"].HTTPEndpoint()) + require.Nil(t, err) + rollupClient := sources.NewRollupClient(client.NewBaseRPCClient(rollupRPCClient)) + + // Still persisted as stopped after startup + assertPersistedSequencerState(t, stateFile, node.StateStopped) + + // Sequencer is really stopped + _, err = rollupClient.StopSequencer(ctx) + require.ErrorContains(t, err, "sequencer not running") + assertPersistedSequencerState(t, stateFile, node.StateStopped) +} + +func TestLoadSequencerStateOnStarted_Started(t *testing.T) { + InitParallel(t) + ctx := context.Background() + dir := t.TempDir() + stateFile := dir + "/state.json" + + // Prepare the persisted state file with sequencer stopped + configReader := node.NewConfigPersistence(stateFile) + require.NoError(t, configReader.SequencerStarted()) + + cfg := DefaultSystemConfig(t) + // We don't need a verifier - just the sequencer is enough + delete(cfg.Nodes, "verifier") + seqCfg := cfg.Nodes["sequencer"] + seqCfg.Driver.SequencerStopped = true + seqCfg.ConfigPersistence = node.NewConfigPersistence(stateFile) + + sys, err := cfg.Start(t) + require.NoError(t, err) + defer sys.Close() + + rollupRPCClient, err := rpc.DialContext(ctx, sys.RollupNodes["sequencer"].HTTPEndpoint()) + require.Nil(t, err) + rollupClient := sources.NewRollupClient(client.NewBaseRPCClient(rollupRPCClient)) + + // Still persisted as stopped after startup + assertPersistedSequencerState(t, stateFile, node.StateStarted) + + // Sequencer is really stopped + err = rollupClient.StartSequencer(ctx, common.Hash{}) + require.ErrorContains(t, err, "sequencer already running") + assertPersistedSequencerState(t, stateFile, node.StateStarted) +} + +func TestPostUnsafePayload(t *testing.T) { + InitParallel(t) + ctx := context.Background() + + cfg := DefaultSystemConfig(t) + cfg.Nodes["verifier"].RPC.EnableAdmin = true + cfg.DisableBatcher = true + + sys, err := cfg.Start(t) + require.NoError(t, err) + defer sys.Close() + + l2Seq := sys.Clients["sequencer"] + l2Ver := sys.Clients["verifier"] + rollupClient := sys.RollupClient("verifier") + + require.NoError(t, wait.ForBlock(ctx, l2Seq, 2), "Chain did not advance after starting sequencer") + verBlock, err := l2Ver.BlockByNumber(ctx, nil) + require.NoError(t, err) + require.Equal(t, uint64(0), verBlock.NumberU64(), "Verifier should not have advanced any blocks since p2p & batcher are not enabled") + + blockNumberOne, err := l2Seq.BlockByNumber(ctx, big.NewInt(1)) + require.NoError(t, err) + payload, err := eth.BlockAsPayload(blockNumberOne, sys.RollupConfig.CanyonTime) + require.NoError(t, err) + err = rollupClient.PostUnsafePayload(ctx, ð.ExecutionPayloadEnvelope{ExecutionPayload: payload}) + require.NoError(t, err) + require.NoError(t, wait.ForUnsafeBlock(ctx, rollupClient, 1), "Chain did not advance after posting payload") + + // Test validation + blockNumberTwo, err := l2Seq.BlockByNumber(ctx, big.NewInt(2)) + require.NoError(t, err) + payload, err = eth.BlockAsPayload(blockNumberTwo, sys.RollupConfig.CanyonTime) + require.NoError(t, err) + payload.BlockHash = common.Hash{0xaa} + err = rollupClient.PostUnsafePayload(ctx, ð.ExecutionPayloadEnvelope{ExecutionPayload: payload}) + require.ErrorContains(t, err, "payload has bad block hash") +} + +func assertPersistedSequencerState(t *testing.T, stateFile string, expected node.RunningState) { + configReader := node.NewConfigPersistence(stateFile) + state, err := configReader.SequencerState() + require.NoError(t, err) + require.Equalf(t, expected, state, "expected sequencer state %v but was %v", expected, state) +} diff --git a/op-e2e2/system_fpp_test.go b/op-e2e2/system_fpp_test.go new file mode 100644 index 000000000000..2d8db49cf405 --- /dev/null +++ b/op-e2e2/system_fpp_test.go @@ -0,0 +1,339 @@ +package op_e2e + +import ( + "context" + "math/big" + "testing" + "time" + + "github.com/ethereum-optimism/optimism/op-chain-ops/genesis" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/geth" + "github.com/ethereum-optimism/optimism/op-program/client/driver" + opp "github.com/ethereum-optimism/optimism/op-program/host" + oppconf "github.com/ethereum-optimism/optimism/op-program/host/config" + "github.com/ethereum-optimism/optimism/op-service/client" + "github.com/ethereum-optimism/optimism/op-service/sources" + "github.com/ethereum-optimism/optimism/op-service/testlog" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/rpc" + "github.com/stretchr/testify/require" +) + +func TestVerifyL2OutputRoot(t *testing.T) { + testVerifyL2OutputRoot(t, false, false) +} + +func TestVerifyL2OutputRootSpanBatch(t *testing.T) { + testVerifyL2OutputRoot(t, false, true) +} + +func TestVerifyL2OutputRootDetached(t *testing.T) { + testVerifyL2OutputRoot(t, true, false) +} + +func TestVerifyL2OutputRootDetachedSpanBatch(t *testing.T) { + testVerifyL2OutputRoot(t, true, true) +} + +func TestVerifyL2OutputRootEmptyBlock(t *testing.T) { + testVerifyL2OutputRootEmptyBlock(t, false, false) +} + +func TestVerifyL2OutputRootEmptyBlockSpanBatch(t *testing.T) { + testVerifyL2OutputRootEmptyBlock(t, false, true) +} + +func TestVerifyL2OutputRootEmptyBlockDetached(t *testing.T) { + testVerifyL2OutputRootEmptyBlock(t, true, false) +} + +func TestVerifyL2OutputRootEmptyBlockDetachedSpanBatch(t *testing.T) { + testVerifyL2OutputRootEmptyBlock(t, true, true) +} + +func applySpanBatchActivation(active bool, dp *genesis.DeployConfig) { + if active { + // Activate delta hard fork + minTs := hexutil.Uint64(0) + dp.L2GenesisDeltaTimeOffset = &minTs + // readjust other activations + if dp.L2GenesisEcotoneTimeOffset != nil { + dp.L2GenesisEcotoneTimeOffset = &minTs + } + if dp.L2GenesisFjordTimeOffset != nil { + dp.L2GenesisFjordTimeOffset = &minTs + } + } else { + // cancel delta and any later hardfork activations + dp.L2GenesisDeltaTimeOffset = nil + dp.L2GenesisEcotoneTimeOffset = nil + dp.L2GenesisFjordTimeOffset = nil + } +} + +// TestVerifyL2OutputRootEmptyBlock asserts that the program can verify the output root of an empty block +// induced by missing batches. +// Setup is as follows: +// - create initial conditions and agreed l2 state +// - stop the batch submitter to induce empty blocks +// - wait for the seq window to expire so we can observe empty blocks +// - select an empty block as our claim +// - reboot the batch submitter +// - update the state root via a tx +// - run program +func testVerifyL2OutputRootEmptyBlock(t *testing.T, detached bool, spanBatchActivated bool) { + InitParallel(t) + ctx := context.Background() + + cfg := DefaultSystemConfig(t) + // We don't need a verifier - just the sequencer is enough + delete(cfg.Nodes, "verifier") + // Use a small sequencer window size to avoid test timeout while waiting for empty blocks + // But not too small to ensure that our claim and subsequent state change is published + cfg.DeployConfig.SequencerWindowSize = 16 + applySpanBatchActivation(spanBatchActivated, cfg.DeployConfig) + + sys, err := cfg.Start(t) + require.Nil(t, err, "Error starting up system") + defer sys.Close() + + log := testlog.Logger(t, log.LevelInfo) + log.Info("genesis", "l2", sys.RollupConfig.Genesis.L2, "l1", sys.RollupConfig.Genesis.L1, "l2_time", sys.RollupConfig.Genesis.L2Time) + + l1Client := sys.Clients["l1"] + l2Seq := sys.Clients["sequencer"] + rollupRPCClient, err := rpc.DialContext(context.Background(), sys.RollupNodes["sequencer"].HTTPEndpoint()) + require.Nil(t, err) + rollupClient := sources.NewRollupClient(client.NewBaseRPCClient(rollupRPCClient)) + + // Avoids flaky test by avoiding reorgs at epoch 0 + t.Log("Wait for safe head to advance once for setup") + // Safe head doesn't exist at genesis. Wait for the first one before proceeding + require.NoError(t, waitForSafeHead(ctx, 1, rollupClient)) + ss, err := l2Seq.BlockByNumber(ctx, big.NewInt(int64(rpc.SafeBlockNumber))) + require.NoError(t, err) + require.NoError(t, waitForSafeHead(ctx, ss.NumberU64()+cfg.DeployConfig.SequencerWindowSize+1, rollupClient)) + + t.Log("Sending transactions to setup existing state, prior to challenged period") + aliceKey := cfg.Secrets.Alice + receipt := SendL2Tx(t, cfg, l2Seq, aliceKey, func(opts *TxOpts) { + opts.ToAddr = &cfg.Secrets.Addresses().Bob + opts.Value = big.NewInt(1_000) + }) + require.NoError(t, waitForSafeHead(ctx, receipt.BlockNumber.Uint64(), rollupClient)) + + t.Logf("Capture current L2 head as agreed starting point. l2Head=%x l2BlockNumber=%v", receipt.BlockHash, receipt.BlockNumber) + agreedL2Output, err := rollupClient.OutputAtBlock(ctx, receipt.BlockNumber.Uint64()) + require.NoError(t, err, "could not retrieve l2 agreed block") + l2Head := agreedL2Output.BlockRef.Hash + l2OutputRoot := agreedL2Output.OutputRoot + + t.Log("=====Stopping batch submitter=====") + err = sys.BatchSubmitter.Driver().StopBatchSubmitting(ctx) + require.NoError(t, err, "could not stop batch submitter") + + // Wait for the sequencer to catch up with the current L1 head so we know all submitted batches are processed + t.Log("Wait for sequencer to catch up with last submitted batch") + l1HeadNum, err := l1Client.BlockNumber(ctx) + require.NoError(t, err) + _, err = geth.WaitForL1OriginOnL2(sys.RollupConfig, l1HeadNum, l2Seq, 30*time.Second) + require.NoError(t, err) + + // Get the current safe head now that the batcher is stopped + safeBlock, err := l2Seq.BlockByNumber(ctx, big.NewInt(int64(rpc.SafeBlockNumber))) + require.NoError(t, err) + + // Wait for safe head to start advancing again when the sequencing window elapses, for at least three blocks + t.Log("Wait for safe head to advance after sequencing window elapses") + require.NoError(t, waitForSafeHead(ctx, safeBlock.NumberU64()+3, rollupClient)) + + // Use the 2nd empty block as our L2 claim block + t.Log("Determine L2 claim") + l2ClaimBlock, err := l2Seq.BlockByNumber(ctx, big.NewInt(int64(safeBlock.NumberU64()+2))) + require.NoError(t, err, "get L2 claim block number") + l2ClaimBlockNumber := l2ClaimBlock.Number().Uint64() + l2Output, err := rollupClient.OutputAtBlock(ctx, l2ClaimBlockNumber) + require.NoError(t, err, "could not get expected output") + l2Claim := l2Output.OutputRoot + + t.Log("=====Restarting batch submitter=====") + err = sys.BatchSubmitter.Driver().StartBatchSubmitting() + require.NoError(t, err, "could not start batch submitter") + + t.Log("Add a transaction to the next batch after sequence of empty blocks") + receipt = SendL2Tx(t, cfg, l2Seq, aliceKey, func(opts *TxOpts) { + opts.ToAddr = &cfg.Secrets.Addresses().Bob + opts.Value = big.NewInt(1_000) + opts.Nonce = 1 + }) + require.NoError(t, waitForSafeHead(ctx, receipt.BlockNumber.Uint64(), rollupClient)) + + t.Log("Determine L1 head that includes batch after sequence of empty blocks") + l1HeadBlock, err := l1Client.BlockByNumber(ctx, nil) + require.NoError(t, err, "get l1 head block") + l1Head := l1HeadBlock.Hash() + + testFaultProofProgramScenario(t, ctx, sys, &FaultProofProgramTestScenario{ + L1Head: l1Head, + L2Head: l2Head, + L2OutputRoot: common.Hash(l2OutputRoot), + L2Claim: common.Hash(l2Claim), + L2ClaimBlockNumber: l2ClaimBlockNumber, + Detached: detached, + }) +} + +func testVerifyL2OutputRoot(t *testing.T, detached bool, spanBatchActivated bool) { + InitParallel(t) + ctx := context.Background() + + cfg := DefaultSystemConfig(t) + // We don't need a verifier - just the sequencer is enough + delete(cfg.Nodes, "verifier") + applySpanBatchActivation(spanBatchActivated, cfg.DeployConfig) + + sys, err := cfg.Start(t) + require.Nil(t, err, "Error starting up system") + defer sys.Close() + + log := testlog.Logger(t, log.LevelInfo) + log.Info("genesis", "l2", sys.RollupConfig.Genesis.L2, "l1", sys.RollupConfig.Genesis.L1, "l2_time", sys.RollupConfig.Genesis.L2Time) + + l1Client := sys.Clients["l1"] + l2Seq := sys.Clients["sequencer"] + rollupRPCClient, err := rpc.DialContext(context.Background(), sys.RollupNodes["sequencer"].HTTPEndpoint()) + require.Nil(t, err) + rollupClient := sources.NewRollupClient(client.NewBaseRPCClient(rollupRPCClient)) + + t.Log("Sending transactions to setup existing state, prior to challenged period") + aliceKey := cfg.Secrets.Alice + opts, err := bind.NewKeyedTransactorWithChainID(aliceKey, cfg.L1ChainIDBig()) + require.Nil(t, err) + SendDepositTx(t, cfg, l1Client, l2Seq, opts, func(l2Opts *DepositTxOpts) { + l2Opts.Value = big.NewInt(100_000_000) + }) + SendL2Tx(t, cfg, l2Seq, aliceKey, func(opts *TxOpts) { + opts.ToAddr = &cfg.Secrets.Addresses().Bob + opts.Value = big.NewInt(1_000) + opts.Nonce = 1 + }) + SendWithdrawal(t, cfg, l2Seq, aliceKey, func(opts *WithdrawalTxOpts) { + opts.Value = big.NewInt(500) + opts.Nonce = 2 + }) + + t.Log("Capture current L2 head as agreed starting point") + latestBlock, err := l2Seq.BlockByNumber(ctx, nil) + require.NoError(t, err) + agreedL2Output, err := rollupClient.OutputAtBlock(ctx, latestBlock.NumberU64()) + require.NoError(t, err, "could not retrieve l2 agreed block") + l2Head := agreedL2Output.BlockRef.Hash + l2OutputRoot := agreedL2Output.OutputRoot + + t.Log("Sending transactions to modify existing state, within challenged period") + SendDepositTx(t, cfg, l1Client, l2Seq, opts, func(l2Opts *DepositTxOpts) { + l2Opts.Value = big.NewInt(5_000) + }) + SendL2Tx(t, cfg, l2Seq, cfg.Secrets.Bob, func(opts *TxOpts) { + opts.ToAddr = &cfg.Secrets.Addresses().Alice + opts.Value = big.NewInt(100) + }) + SendWithdrawal(t, cfg, l2Seq, aliceKey, func(opts *WithdrawalTxOpts) { + opts.Value = big.NewInt(100) + opts.Nonce = 4 + }) + + t.Log("Determine L2 claim") + l2ClaimBlockNumber, err := l2Seq.BlockNumber(ctx) + require.NoError(t, err, "get L2 claim block number") + l2Output, err := rollupClient.OutputAtBlock(ctx, l2ClaimBlockNumber) + require.NoError(t, err, "could not get expected output") + l2Claim := l2Output.OutputRoot + + t.Log("Determine L1 head that includes all batches required for L2 claim block") + require.NoError(t, waitForSafeHead(ctx, l2ClaimBlockNumber, rollupClient)) + l1HeadBlock, err := l1Client.BlockByNumber(ctx, nil) + require.NoError(t, err, "get l1 head block") + l1Head := l1HeadBlock.Hash() + + testFaultProofProgramScenario(t, ctx, sys, &FaultProofProgramTestScenario{ + L1Head: l1Head, + L2Head: l2Head, + L2OutputRoot: common.Hash(l2OutputRoot), + L2Claim: common.Hash(l2Claim), + L2ClaimBlockNumber: l2ClaimBlockNumber, + Detached: detached, + }) +} + +type FaultProofProgramTestScenario struct { + L1Head common.Hash + L2Head common.Hash + L2OutputRoot common.Hash + L2Claim common.Hash + L2ClaimBlockNumber uint64 + Detached bool +} + +// testFaultProofProgramScenario runs the fault proof program in several contexts, given a test scenario. +func testFaultProofProgramScenario(t *testing.T, ctx context.Context, sys *System, s *FaultProofProgramTestScenario) { + preimageDir := t.TempDir() + fppConfig := oppconf.NewConfig(sys.RollupConfig, sys.L2GenesisCfg.Config, s.L1Head, s.L2Head, s.L2OutputRoot, common.Hash(s.L2Claim), s.L2ClaimBlockNumber) + fppConfig.L1URL = sys.NodeEndpoint("l1") + fppConfig.L2URL = sys.NodeEndpoint("sequencer") + fppConfig.DataDir = preimageDir + if s.Detached { + // When running in detached mode we need to compile the client executable since it will be called directly. + fppConfig.ExecCmd = BuildOpProgramClient(t) + } + + // Check the FPP confirms the expected output + t.Log("Running fault proof in fetching mode") + log := testlog.Logger(t, log.LevelInfo) + err := opp.FaultProofProgram(ctx, log, fppConfig) + require.NoError(t, err) + + t.Log("Shutting down network") + // Shutdown the nodes from the actual chain. Should now be able to run using only the pre-fetched data. + require.NoError(t, sys.BatchSubmitter.Kill()) + err = sys.L2OutputSubmitter.Driver().StopL2OutputSubmitting() + require.NoError(t, err) + sys.L2OutputSubmitter = nil + for _, node := range sys.EthInstances { + node.Close() + } + + t.Log("Running fault proof in offline mode") + // Should be able to rerun in offline mode using the pre-fetched images + fppConfig.L1URL = "" + fppConfig.L2URL = "" + err = opp.FaultProofProgram(ctx, log, fppConfig) + require.NoError(t, err) + + // Check that a fault is detected if we provide an incorrect claim + t.Log("Running fault proof with invalid claim") + fppConfig.L2Claim = common.Hash{0xaa} + err = opp.FaultProofProgram(ctx, log, fppConfig) + if s.Detached { + require.Error(t, err, "exit status 1") + } else { + require.ErrorIs(t, err, driver.ErrClaimNotValid) + } +} + +func waitForSafeHead(ctx context.Context, safeBlockNum uint64, rollupClient *sources.RollupClient) error { + ctx, cancel := context.WithTimeout(ctx, 60*time.Second) + defer cancel() + for { + seqStatus, err := rollupClient.SyncStatus(ctx) + if err != nil { + return err + } + if seqStatus.SafeL2.Number >= safeBlockNum { + return nil + } + } +} diff --git a/op-e2e2/system_test.go b/op-e2e2/system_test.go new file mode 100644 index 000000000000..e0a9c1efe2b6 --- /dev/null +++ b/op-e2e2/system_test.go @@ -0,0 +1,1748 @@ +package op_e2e + +import ( + "context" + "errors" + "fmt" + "math/big" + "os" + "runtime" + "slices" + "testing" + "time" + + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/consensus/misc/eip4844" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/eth/ethconfig" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/node" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rpc" + + "github.com/libp2p/go-libp2p/core/peer" + "github.com/stretchr/testify/require" + + "github.com/ethereum-optimism/optimism/op-e2e2/bindings" + "github.com/ethereum-optimism/optimism/op-e2e2/config" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/geth" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/transactions" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/wait" + "github.com/ethereum-optimism/optimism/op-node/metrics" + rollupNode "github.com/ethereum-optimism/optimism/op-node/node" + "github.com/ethereum-optimism/optimism/op-node/p2p" + "github.com/ethereum-optimism/optimism/op-node/rollup/derive" + "github.com/ethereum-optimism/optimism/op-node/rollup/driver" + "github.com/ethereum-optimism/optimism/op-service/client" + "github.com/ethereum-optimism/optimism/op-service/eth" + "github.com/ethereum-optimism/optimism/op-service/oppprof" + "github.com/ethereum-optimism/optimism/op-service/predeploys" + "github.com/ethereum-optimism/optimism/op-service/retry" + "github.com/ethereum-optimism/optimism/op-service/sources" + "github.com/ethereum-optimism/optimism/op-service/testlog" +) + +// TestSystemBatchType run each system e2e test case in singular batch mode and span batch mode. +// If the test case tests batch submission and advancing safe head, it should be tested in both singular and span batch mode. +func TestSystemBatchType(t *testing.T) { + tests := []struct { + name string + f func(gt *testing.T, deltaTimeOffset *hexutil.Uint64) + }{ + {"StopStartBatcher", StopStartBatcher}, + } + for _, test := range tests { + test := test + t.Run(test.name+"_SingularBatch", func(t *testing.T) { + test.f(t, nil) + }) + } + + deltaTimeOffset := hexutil.Uint64(0) + for _, test := range tests { + test := test + t.Run(test.name+"_SpanBatch", func(t *testing.T) { + test.f(t, &deltaTimeOffset) + }) + } +} + +func TestMain(m *testing.M) { + if config.ExternalL2Shim != "" { + fmt.Println("Running tests with external L2 process adapter at ", config.ExternalL2Shim) + // As these are integration tests which launch many other processes, the + // default parallelism makes the tests flaky. This change aims to + // reduce the flakiness of these tests. + maxProcs := runtime.NumCPU() / 4 + if maxProcs == 0 { + maxProcs = 1 + } + runtime.GOMAXPROCS(maxProcs) + } + + os.Exit(m.Run()) +} + +func TestL2OutputSubmitter(t *testing.T) { + InitParallel(t, SkipOnFPAC) + + cfg := DefaultSystemConfig(t) + cfg.NonFinalizedProposals = true // speed up the time till we see output proposals + + sys, err := cfg.Start(t) + require.Nil(t, err, "Error starting up system") + defer sys.Close() + + l1Client := sys.Clients["l1"] + + rollupRPCClient, err := rpc.DialContext(context.Background(), sys.RollupNodes["sequencer"].HTTPEndpoint()) + require.Nil(t, err) + rollupClient := sources.NewRollupClient(client.NewBaseRPCClient(rollupRPCClient)) + + // OutputOracle is already deployed + l2OutputOracle, err := bindings.NewL2OutputOracleCaller(cfg.L1Deployments.L2OutputOracleProxy, l1Client) + require.Nil(t, err) + + initialOutputBlockNumber, err := l2OutputOracle.LatestBlockNumber(&bind.CallOpts{}) + require.Nil(t, err) + + // Wait until the second output submission from L2. The output submitter submits outputs from the + // unsafe portion of the chain which gets reorged on startup. The sequencer has an out of date view + // when it creates it's first block and uses and old L1 Origin. It then does not submit a batch + // for that block and subsequently reorgs to match what the verifier derives when running the + // reconcillation process. + l2Verif := sys.Clients["verifier"] + _, err = geth.WaitForBlock(big.NewInt(6), l2Verif, 10*time.Duration(cfg.DeployConfig.L2BlockTime)*time.Second) + require.Nil(t, err) + + // Wait for batch submitter to update L2 output oracle. + timeoutCh := time.After(15 * time.Second) + ticker := time.NewTicker(1 * time.Second) + defer ticker.Stop() + for { + l2ooBlockNumber, err := l2OutputOracle.LatestBlockNumber(&bind.CallOpts{}) + require.Nil(t, err) + + // Wait for the L2 output oracle to have been changed from the initial + // timestamp set in the contract constructor. + if l2ooBlockNumber.Cmp(initialOutputBlockNumber) > 0 { + // Retrieve the l2 output committed at this updated timestamp. + committedL2Output, err := l2OutputOracle.GetL2OutputAfter(&bind.CallOpts{}, l2ooBlockNumber) + require.NotEqual(t, [32]byte{}, committedL2Output.OutputRoot, "Empty L2 Output") + require.Nil(t, err) + + // Fetch the corresponding L2 block and assert the committed L2 + // output matches the block's state root. + // + // NOTE: This assertion will change once the L2 output format is + // finalized. + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + l2Output, err := rollupClient.OutputAtBlock(ctx, l2ooBlockNumber.Uint64()) + require.Nil(t, err) + require.Equal(t, l2Output.OutputRoot[:], committedL2Output.OutputRoot[:]) + break + } + + select { + case <-timeoutCh: + t.Fatalf("State root oracle not updated") + case <-ticker.C: + } + } +} + +func TestL2OutputSubmitterFPAC(t *testing.T) { + InitParallel(t, SkipOnNotFPAC) + + cfg := DefaultSystemConfig(t) + cfg.NonFinalizedProposals = true // speed up the time till we see output proposals + + sys, err := cfg.Start(t) + require.Nil(t, err, "Error starting up system") + defer sys.Close() + + l1Client := sys.Clients["l1"] + + rollupRPCClient, err := rpc.DialContext(context.Background(), sys.RollupNodes["sequencer"].HTTPEndpoint()) + require.Nil(t, err) + rollupClient := sources.NewRollupClient(client.NewBaseRPCClient(rollupRPCClient)) + + disputeGameFactory, err := bindings.NewDisputeGameFactoryCaller(cfg.L1Deployments.DisputeGameFactoryProxy, l1Client) + require.Nil(t, err) + + initialGameCount, err := disputeGameFactory.GameCount(&bind.CallOpts{}) + require.Nil(t, err) + + l2Verif := sys.Clients["verifier"] + _, err = geth.WaitForBlock(big.NewInt(6), l2Verif, 10*time.Duration(cfg.DeployConfig.L2BlockTime)*time.Second) + require.Nil(t, err) + + timeoutCh := time.After(15 * time.Second) + ticker := time.NewTicker(1 * time.Second) + defer ticker.Stop() + for { + latestGameCount, err := disputeGameFactory.GameCount(&bind.CallOpts{}) + require.Nil(t, err) + + if latestGameCount.Cmp(initialGameCount) > 0 { + committedL2Output, err := disputeGameFactory.GameAtIndex(&bind.CallOpts{}, new(big.Int).Sub(latestGameCount, common.Big1)) + require.Nil(t, err) + proxy, err := bindings.NewFaultDisputeGameCaller(committedL2Output.Proxy, l1Client) + require.Nil(t, err) + committedOutputRoot, err := proxy.RootClaim(&bind.CallOpts{}) + require.Nil(t, err) + + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + extradata, err := proxy.ExtraData(&bind.CallOpts{}) + require.Nil(t, err) + gameBlockNumber := new(big.Int).SetBytes(extradata[0:32]) + l2Output, err := rollupClient.OutputAtBlock(ctx, gameBlockNumber.Uint64()) + require.Nil(t, err) + require.Equal(t, l2Output.OutputRoot[:], committedOutputRoot[:]) + break + } + + select { + case <-timeoutCh: + t.Fatalf("State root oracle not updated") + case <-ticker.C: + } + } +} + +func TestSystemE2EDencunAtGenesis(t *testing.T) { + InitParallel(t) + + cfg := DefaultSystemConfig(t) + genesisActivation := hexutil.Uint64(0) + cfg.DeployConfig.L1CancunTimeOffset = &genesisActivation + + sys, err := cfg.Start(t) + require.Nil(t, err, "Error starting up system") + defer sys.Close() + runE2ESystemTest(t, sys) + head, err := sys.Clients["l1"].BlockByNumber(context.Background(), big.NewInt(0)) + require.NoError(t, err) + require.NotNil(t, head.ExcessBlobGas(), "L1 is building dencun blocks since genesis") +} + +// TestSystemE2EDencunAtGenesis tests if L2 finalizes when blobs are present on L1 +func TestSystemE2EDencunAtGenesisWithBlobs(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + InitParallel(t) + + cfg := DefaultSystemConfig(t) + // cancun is on from genesis: + genesisActivation := hexutil.Uint64(0) + cfg.DeployConfig.L1CancunTimeOffset = &genesisActivation // i.e. turn cancun on at genesis time + 0 + + sys, err := cfg.Start(t) + require.Nil(t, err, "Error starting up system") + defer sys.Close() + + // send a blob-containing txn on l1 + ethPrivKey := sys.Cfg.Secrets.Alice + txData := transactions.CreateEmptyBlobTx(true, sys.Cfg.L1ChainIDBig().Uint64()) + tx := types.MustSignNewTx(ethPrivKey, types.LatestSignerForChainID(cfg.L1ChainIDBig()), txData) + // send blob-containing txn + sendCtx, sendCancel := context.WithTimeout(context.Background(), 15*time.Second) + defer sendCancel() + + l1Client := sys.Clients["l1"] + err = l1Client.SendTransaction(sendCtx, tx) + require.NoError(t, err, "Sending L1 empty blob tx") + // Wait for transaction on L1 + blockContainsBlob, err := wait.ForReceiptOK(ctx, l1Client, tx.Hash()) + require.Nil(t, err, "Waiting for blob tx on L1") + // end sending blob-containing txns on l1 + l2Client := sys.Clients["sequencer"] + finalizedBlock, err := geth.WaitForL1OriginOnL2(sys.RollupConfig, blockContainsBlob.BlockNumber.Uint64(), l2Client, 30*time.Duration(cfg.DeployConfig.L1BlockTime)*time.Second) + require.Nil(t, err, "Waiting for L1 origin of blob tx on L2") + finalizationTimeout := 30 * time.Duration(cfg.DeployConfig.L1BlockTime) * time.Second + _, err = geth.WaitForBlockToBeSafe(finalizedBlock.Header().Number, l2Client, finalizationTimeout) + require.Nil(t, err, "Waiting for safety of L2 block") +} + +// TestSystemE2E sets up a L1 Geth node, a rollup node, and a L2 geth node and then confirms that L1 deposits are reflected on L2. +// All nodes are run in process (but are the full nodes, not mocked or stubbed). +func TestSystemE2E(t *testing.T) { + InitParallel(t) + + cfg := DefaultSystemConfig(t) + + sys, err := cfg.Start(t) + require.Nil(t, err, "Error starting up system") + runE2ESystemTest(t, sys) + defer sys.Close() +} + +func runE2ESystemTest(t *testing.T, sys *System) { + log := testlog.Logger(t, log.LevelInfo) + log.Info("genesis", "l2", sys.RollupConfig.Genesis.L2, "l1", sys.RollupConfig.Genesis.L1, "l2_time", sys.RollupConfig.Genesis.L2Time) + + l1Client := sys.Clients["l1"] + l2Seq := sys.Clients["sequencer"] + l2Verif := sys.Clients["verifier"] + + // Transactor Account + ethPrivKey := sys.Cfg.Secrets.Alice + + // Send Transaction & wait for success + fromAddr := sys.Cfg.Secrets.Addresses().Alice + + ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) + defer cancel() + startBalance, err := l2Verif.BalanceAt(ctx, fromAddr, nil) + require.Nil(t, err) + + // Send deposit transaction + opts, err := bind.NewKeyedTransactorWithChainID(ethPrivKey, sys.Cfg.L1ChainIDBig()) + require.Nil(t, err) + mintAmount := big.NewInt(1_000_000_000_000) + opts.Value = mintAmount + SendDepositTx(t, sys.Cfg, l1Client, l2Verif, opts, func(l2Opts *DepositTxOpts) {}) + + // Confirm balance + ctx, cancel = context.WithTimeout(context.Background(), 15*time.Second) + defer cancel() + + endBalance, err := wait.ForBalanceChange(ctx, l2Verif, fromAddr, startBalance) + require.Nil(t, err) + + diff := new(big.Int) + diff = diff.Sub(endBalance, startBalance) + require.Equal(t, mintAmount, diff, "Did not get expected balance change") + + // Submit TX to L2 sequencer node + receipt := SendL2Tx(t, sys.Cfg, l2Seq, ethPrivKey, func(opts *TxOpts) { + opts.Value = big.NewInt(1_000_000_000) + opts.Nonce = 1 // Already have deposit + opts.ToAddr = &common.Address{0xff, 0xff} + opts.VerifyOnClients(l2Verif) + }) + + // Verify blocks match after batch submission on verifiers and sequencers + verifBlock, err := l2Verif.BlockByNumber(context.Background(), receipt.BlockNumber) + require.Nil(t, err) + seqBlock, err := l2Seq.BlockByNumber(context.Background(), receipt.BlockNumber) + require.Nil(t, err) + require.Equal(t, verifBlock.NumberU64(), seqBlock.NumberU64(), "Verifier and sequencer blocks not the same after including a batch tx") + require.Equal(t, verifBlock.ParentHash(), seqBlock.ParentHash(), "Verifier and sequencer blocks parent hashes not the same after including a batch tx") + require.Equal(t, verifBlock.Hash(), seqBlock.Hash(), "Verifier and sequencer blocks not the same after including a batch tx") + + rollupRPCClient, err := rpc.DialContext(context.Background(), sys.RollupNodes["sequencer"].HTTPEndpoint()) + require.Nil(t, err) + rollupClient := sources.NewRollupClient(client.NewBaseRPCClient(rollupRPCClient)) + // basic check that sync status works + seqStatus, err := rollupClient.SyncStatus(context.Background()) + require.Nil(t, err) + require.LessOrEqual(t, seqBlock.NumberU64(), seqStatus.UnsafeL2.Number) + // basic check that version endpoint works + seqVersion, err := rollupClient.Version(context.Background()) + require.Nil(t, err) + require.NotEqual(t, "", seqVersion) +} + +// TestConfirmationDepth runs the rollup with both sequencer and verifier not immediately processing the tip of the chain. +func TestConfirmationDepth(t *testing.T) { + InitParallel(t) + + cfg := DefaultSystemConfig(t) + cfg.DeployConfig.SequencerWindowSize = 4 + cfg.DeployConfig.MaxSequencerDrift = 10 * cfg.DeployConfig.L1BlockTime + seqConfDepth := uint64(2) + verConfDepth := uint64(5) + cfg.Nodes["sequencer"].Driver.SequencerConfDepth = seqConfDepth + cfg.Nodes["sequencer"].Driver.VerifierConfDepth = 0 + cfg.Nodes["verifier"].Driver.VerifierConfDepth = verConfDepth + + sys, err := cfg.Start(t) + require.Nil(t, err, "Error starting up system") + defer sys.Close() + + log := testlog.Logger(t, log.LevelInfo) + log.Info("genesis", "l2", sys.RollupConfig.Genesis.L2, "l1", sys.RollupConfig.Genesis.L1, "l2_time", sys.RollupConfig.Genesis.L2Time) + + l1Client := sys.Clients["l1"] + l2Seq := sys.Clients["sequencer"] + l2Verif := sys.Clients["verifier"] + + // Wait enough time for the sequencer to submit a block with distance from L1 head, submit it, + // and for the slower verifier to read a full sequence window and cover confirmation depth for reading and some margin + <-time.After(time.Duration((cfg.DeployConfig.SequencerWindowSize+verConfDepth+3)*cfg.DeployConfig.L1BlockTime) * time.Second) + + // within a second, get both L1 and L2 verifier and sequencer block heads + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + l1Head, err := l1Client.BlockByNumber(ctx, nil) + require.NoError(t, err) + l2SeqHead, err := l2Seq.BlockByNumber(ctx, nil) + require.NoError(t, err) + l2VerHead, err := l2Verif.BlockByNumber(ctx, nil) + require.NoError(t, err) + + seqInfo, err := derive.L1BlockInfoFromBytes(sys.RollupConfig, l2SeqHead.Time(), l2SeqHead.Transactions()[0].Data()) + require.NoError(t, err) + require.LessOrEqual(t, seqInfo.Number+seqConfDepth, l1Head.NumberU64(), "the seq L2 head block should have an origin older than the L1 head block by at least the sequencer conf depth") + + verInfo, err := derive.L1BlockInfoFromBytes(sys.RollupConfig, l2VerHead.Time(), l2VerHead.Transactions()[0].Data()) + require.NoError(t, err) + require.LessOrEqual(t, verInfo.Number+verConfDepth, l1Head.NumberU64(), "the ver L2 head block should have an origin older than the L1 head block by at least the verifier conf depth") +} + +// TestPendingGasLimit tests the configuration of the gas limit of the pending block, +// and if it does not conflict with the regular gas limit on the verifier or sequencer. +func TestPendingGasLimit(t *testing.T) { + InitParallel(t) + + cfg := DefaultSystemConfig(t) + + // configure the L2 gas limit to be high, and the pending gas limits to be lower for resource saving. + cfg.DeployConfig.L2GenesisBlockGasLimit = 30_000_000 + cfg.GethOptions["sequencer"] = append(cfg.GethOptions["sequencer"], []geth.GethOption{ + func(ethCfg *ethconfig.Config, nodeCfg *node.Config) error { + ethCfg.Miner.GasCeil = 10_000_000 + ethCfg.Miner.RollupComputePendingBlock = true + return nil + }, + }...) + cfg.GethOptions["verifier"] = append(cfg.GethOptions["verifier"], []geth.GethOption{ + func(ethCfg *ethconfig.Config, nodeCfg *node.Config) error { + ethCfg.Miner.GasCeil = 9_000_000 + ethCfg.Miner.RollupComputePendingBlock = true + return nil + }, + }...) + + sys, err := cfg.Start(t) + require.Nil(t, err, "Error starting up system") + defer sys.Close() + + log := testlog.Logger(t, log.LevelInfo) + log.Info("genesis", "l2", sys.RollupConfig.Genesis.L2, "l1", sys.RollupConfig.Genesis.L1, "l2_time", sys.RollupConfig.Genesis.L2Time) + + l2Verif := sys.Clients["verifier"] + l2Seq := sys.Clients["sequencer"] + + checkGasLimit := func(client *ethclient.Client, number *big.Int, expected uint64) *types.Header { + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + header, err := client.HeaderByNumber(ctx, number) + cancel() + require.NoError(t, err) + require.Equal(t, expected, header.GasLimit) + return header + } + + // check if the gaslimits are matching the expected values, + // and that the verifier/sequencer can use their locally configured gas limit for the pending block. + for { + checkGasLimit(l2Seq, big.NewInt(-1), 10_000_000) + checkGasLimit(l2Verif, big.NewInt(-1), 9_000_000) + checkGasLimit(l2Seq, nil, 30_000_000) + latestVerifHeader := checkGasLimit(l2Verif, nil, 30_000_000) + + // Stop once the verifier passes genesis: + // this implies we checked a new block from the sequencer, on both sequencer and verifier nodes. + if latestVerifHeader.Number.Uint64() > 0 { + break + } + time.Sleep(500 * time.Millisecond) + } +} + +// TestFinalize tests if L2 finalizes after sufficient time after L1 finalizes +func TestFinalize(t *testing.T) { + InitParallel(t) + + cfg := DefaultSystemConfig(t) + + sys, err := cfg.Start(t) + require.Nil(t, err, "Error starting up system") + defer sys.Close() + + l2Seq := sys.Clients["sequencer"] + + l2Finalized, err := geth.WaitForBlockToBeFinalized(big.NewInt(12), l2Seq, 1*time.Minute) + require.NoError(t, err, "must be able to fetch a finalized L2 block") + require.NotZerof(t, l2Finalized.NumberU64(), "must have finalized L2 block") +} + +func TestMissingBatchE2E(t *testing.T) { + InitParallel(t) + // 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.DeployConfig.SequencerWindowSize = 4 + + // Specifically set batch submitter balance to stop batches from being included + cfg.Premine[cfg.Secrets.Addresses().Batcher] = big.NewInt(0) + + sys, err := cfg.Start(t) + require.Nil(t, err, "Error starting up system") + defer sys.Close() + + l2Seq := sys.Clients["sequencer"] + l2Verif := sys.Clients["verifier"] + seqRollupRPCClient, err := rpc.DialContext(context.Background(), sys.RollupNodes["sequencer"].HTTPEndpoint()) + require.Nil(t, err) + seqRollupClient := sources.NewRollupClient(client.NewBaseRPCClient(seqRollupRPCClient)) + + // Transactor Account + ethPrivKey := cfg.Secrets.Alice + + // Submit TX to L2 sequencer node + receipt := SendL2Tx(t, cfg, l2Seq, ethPrivKey, func(opts *TxOpts) { + opts.ToAddr = &common.Address{0xff, 0xff} + opts.Value = big.NewInt(1_000_000_000) + }) + + // Wait until the block it was first included in shows up in the safe chain on the verifier + _, err = geth.WaitForBlock(receipt.BlockNumber, l2Verif, time.Duration((sys.RollupConfig.SeqWindowSize+4)*cfg.DeployConfig.L1BlockTime)*time.Second) + require.Nil(t, err, "Waiting for block on verifier") + + // Assert that the transaction is not found on the verifier + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + _, err = l2Verif.TransactionReceipt(ctx, receipt.TxHash) + require.Equal(t, ethereum.NotFound, err, "Found transaction in verifier when it should not have been included") + + // Wait a short time for the L2 reorg to occur on the sequencer as well. + err = waitForSafeHead(ctx, receipt.BlockNumber.Uint64(), seqRollupClient) + require.Nil(t, err, "timeout waiting for L2 reorg on sequencer safe head") + + // Assert that the reconciliation process did an L2 reorg on the sequencer to remove the invalid block + ctx2, cancel := context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + block, err := l2Seq.BlockByNumber(ctx2, receipt.BlockNumber) + if err != nil { + require.Equal(t, "not found", err.Error(), "A not found error indicates the chain must have re-orged back before it") + } else { + require.NotEqual(t, block.Hash(), receipt.BlockHash, "L2 Sequencer did not reorg out transaction on it's safe chain") + } +} + +func L1InfoFromState(ctx context.Context, contract *bindings.L1Block, l2Number *big.Int, ecotone bool) (*derive.L1BlockInfo, error) { + var err error + out := &derive.L1BlockInfo{} + opts := bind.CallOpts{ + BlockNumber: l2Number, + Context: ctx, + } + + out.Number, err = contract.Number(&opts) + if err != nil { + return nil, fmt.Errorf("failed to get number: %w", err) + } + + out.Time, err = contract.Timestamp(&opts) + if err != nil { + return nil, fmt.Errorf("failed to get timestamp: %w", err) + } + + out.BaseFee, err = contract.Basefee(&opts) + if err != nil { + return nil, fmt.Errorf("failed to get base fee: %w", err) + } + + blockHashBytes, err := contract.Hash(&opts) + if err != nil { + return nil, fmt.Errorf("failed to get block hash: %w", err) + } + out.BlockHash = common.BytesToHash(blockHashBytes[:]) + + out.SequenceNumber, err = contract.SequenceNumber(&opts) + if err != nil { + return nil, fmt.Errorf("failed to get sequence number: %w", err) + } + + if !ecotone { + overhead, err := contract.L1FeeOverhead(&opts) + if err != nil { + return nil, fmt.Errorf("failed to get l1 fee overhead: %w", err) + } + out.L1FeeOverhead = eth.Bytes32(common.BigToHash(overhead)) + + scalar, err := contract.L1FeeScalar(&opts) + if err != nil { + return nil, fmt.Errorf("failed to get l1 fee scalar: %w", err) + } + out.L1FeeScalar = eth.Bytes32(common.BigToHash(scalar)) + } + + batcherHash, err := contract.BatcherHash(&opts) + if err != nil { + return nil, fmt.Errorf("failed to get batch sender: %w", err) + } + out.BatcherAddr = common.BytesToAddress(batcherHash[:]) + + if ecotone { + blobBaseFeeScalar, err := contract.BlobBaseFeeScalar(&opts) + if err != nil { + return nil, fmt.Errorf("failed to get blob basefee scalar: %w", err) + } + out.BlobBaseFeeScalar = blobBaseFeeScalar + + baseFeeScalar, err := contract.BaseFeeScalar(&opts) + if err != nil { + return nil, fmt.Errorf("failed to get basefee scalar: %w", err) + } + out.BaseFeeScalar = baseFeeScalar + + blobBaseFee, err := contract.BlobBaseFee(&opts) + if err != nil { + return nil, fmt.Errorf("failed to get blob basefee: %w", err) + } + out.BlobBaseFee = blobBaseFee + } + + return out, nil +} + +// TestSystemMockP2P sets up a L1 Geth node, a rollup node, and a L2 geth node and then confirms that +// the nodes can sync L2 blocks before they are confirmed on L1. +func TestSystemMockP2P(t *testing.T) { + t.Skip("flaky in CI") // TODO(CLI-3859): Re-enable this test. + InitParallel(t) + + cfg := DefaultSystemConfig(t) + // Disable batcher, so we don't sync from L1 & set a large sequence window so we only have unsafe blocks + cfg.DisableBatcher = true + cfg.DeployConfig.SequencerWindowSize = 100_000 + cfg.DeployConfig.MaxSequencerDrift = 100_000 + // disable at the start, so we don't miss any gossiped blocks. + cfg.Nodes["sequencer"].Driver.SequencerStopped = true + + // connect the nodes + cfg.P2PTopology = map[string][]string{ + "verifier": {"sequencer"}, + } + + var published, received []common.Hash + seqTracer, verifTracer := new(FnTracer), new(FnTracer) + seqTracer.OnPublishL2PayloadFn = func(ctx context.Context, payload *eth.ExecutionPayloadEnvelope) { + published = append(published, payload.ExecutionPayload.BlockHash) + } + verifTracer.OnUnsafeL2PayloadFn = func(ctx context.Context, from peer.ID, payload *eth.ExecutionPayloadEnvelope) { + received = append(received, payload.ExecutionPayload.BlockHash) + } + cfg.Nodes["sequencer"].Tracer = seqTracer + cfg.Nodes["verifier"].Tracer = verifTracer + + sys, err := cfg.Start(t) + require.Nil(t, err, "Error starting up system") + defer sys.Close() + + // Enable the sequencer now that everyone is ready to receive payloads. + rollupRPCClient, err := rpc.DialContext(context.Background(), sys.RollupNodes["sequencer"].HTTPEndpoint()) + require.Nil(t, err) + + verifierPeerID := sys.RollupNodes["verifier"].P2P().Host().ID() + check := func() bool { + sequencerBlocksTopicPeers := sys.RollupNodes["sequencer"].P2P().GossipOut().AllBlockTopicsPeers() + return slices.Contains[[]peer.ID](sequencerBlocksTopicPeers, verifierPeerID) + } + + // poll to see if the verifier node is connected & meshed on gossip. + // Without this verifier, we shouldn't start sending blocks around, or we'll miss them and fail the test. + backOffStrategy := retry.Exponential() + for i := 0; i < 10; i++ { + if check() { + break + } + time.Sleep(backOffStrategy.Duration(i)) + } + require.True(t, check(), "verifier must be meshed with sequencer for gossip test to proceed") + + require.NoError(t, rollupRPCClient.Call(nil, "admin_startSequencer", sys.L2GenesisCfg.ToBlock().Hash())) + + l2Seq := sys.Clients["sequencer"] + l2Verif := sys.Clients["verifier"] + + // Transactor Account + ethPrivKey := cfg.Secrets.Alice + + // Submit TX to L2 sequencer node + receiptSeq := SendL2Tx(t, cfg, l2Seq, ethPrivKey, func(opts *TxOpts) { + opts.ToAddr = &common.Address{0xff, 0xff} + opts.Value = big.NewInt(1_000_000_000) + + // Wait until the block it was first included in shows up in the safe chain on the verifier + opts.VerifyOnClients(l2Verif) + }) + + // Verify that everything that was received was published + require.GreaterOrEqual(t, len(published), len(received)) + require.Subset(t, published, received) + + // Verify that the tx was received via p2p + require.Contains(t, received, receiptSeq.BlockHash) +} + +func TestSystemP2PAltSync(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + InitParallel(t) + + cfg := DefaultSystemConfig(t) + + // remove default verifier node + delete(cfg.Nodes, "verifier") + // Add more verifier nodes + cfg.Nodes["alice"] = &rollupNode.Config{ + Driver: driver.Config{ + VerifierConfDepth: 0, + SequencerConfDepth: 0, + SequencerEnabled: false, + }, + L1EpochPollInterval: time.Second * 4, + } + cfg.Nodes["bob"] = &rollupNode.Config{ + Driver: driver.Config{ + VerifierConfDepth: 0, + SequencerConfDepth: 0, + SequencerEnabled: false, + }, + L1EpochPollInterval: time.Second * 4, + } + cfg.Loggers["alice"] = testlog.Logger(t, log.LevelInfo).New("role", "alice") + cfg.Loggers["bob"] = testlog.Logger(t, log.LevelInfo).New("role", "bob") + + // connect the nodes + cfg.P2PTopology = map[string][]string{ + "sequencer": {"alice", "bob"}, + "alice": {"sequencer", "bob"}, + "bob": {"alice", "sequencer"}, + } + // Enable the P2P req-resp based sync + cfg.P2PReqRespSync = true + + // Disable batcher, so there will not be any L1 data to sync from + cfg.DisableBatcher = true + + var published []string + seqTracer := new(FnTracer) + // The sequencer still publishes the blocks to the tracer, even if they do not reach the network due to disabled P2P + seqTracer.OnPublishL2PayloadFn = func(ctx context.Context, payload *eth.ExecutionPayloadEnvelope) { + published = append(published, payload.ExecutionPayload.ID().String()) + } + // Blocks are now received via the RPC based alt-sync method + cfg.Nodes["sequencer"].Tracer = seqTracer + + sys, err := cfg.Start(t) + require.Nil(t, err, "Error starting up system") + defer sys.Close() + + l2Seq := sys.Clients["sequencer"] + + // Transactor Account + ethPrivKey := cfg.Secrets.Alice + + // Submit a TX to L2 sequencer node + receiptSeq := SendL2Tx(t, cfg, l2Seq, ethPrivKey, func(opts *TxOpts) { + opts.ToAddr = &common.Address{0xff, 0xff} + opts.Value = big.NewInt(1_000_000_000) + }) + + // Gossip is able to respond to IWANT messages for the duration of heartbeat_time * message_window = 0.5 * 12 = 6 + // Wait till we pass that, and then we'll have missed some blocks that cannot be retrieved in any way from gossip + time.Sleep(time.Second * 10) + + // set up our syncer node, connect it to alice/bob + cfg.Loggers["syncer"] = testlog.Logger(t, log.LevelInfo).New("role", "syncer") + snapLog := log.NewLogger(log.DiscardHandler()) + + // Create a peer, and hook up alice and bob + h, err := sys.newMockNetPeer() + require.NoError(t, err) + _, err = sys.Mocknet.LinkPeers(sys.RollupNodes["alice"].P2P().Host().ID(), h.ID()) + require.NoError(t, err) + _, err = sys.Mocknet.LinkPeers(sys.RollupNodes["bob"].P2P().Host().ID(), h.ID()) + require.NoError(t, err) + + // Configure the new rollup node that'll be syncing + var syncedPayloads []string + syncNodeCfg := &rollupNode.Config{ + Driver: driver.Config{VerifierConfDepth: 0}, + Rollup: *sys.RollupConfig, + P2PSigner: nil, + RPC: rollupNode.RPCConfig{ + ListenAddr: "127.0.0.1", + ListenPort: 0, + EnableAdmin: true, + }, + P2P: &p2p.Prepared{HostP2P: h, EnableReqRespSync: true}, + Metrics: rollupNode.MetricsConfig{Enabled: false}, // no metrics server + Pprof: oppprof.CLIConfig{}, + L1EpochPollInterval: time.Second * 10, + Tracer: &FnTracer{ + OnUnsafeL2PayloadFn: func(ctx context.Context, from peer.ID, payload *eth.ExecutionPayloadEnvelope) { + syncedPayloads = append(syncedPayloads, payload.ExecutionPayload.ID().String()) + }, + }, + } + configureL1(syncNodeCfg, sys.EthInstances["l1"]) + syncerL2Engine, _, err := geth.InitL2("syncer", big.NewInt(int64(cfg.DeployConfig.L2ChainID)), sys.L2GenesisCfg, cfg.JWTFilePath) + require.NoError(t, err) + require.NoError(t, syncerL2Engine.Start()) + + configureL2(syncNodeCfg, syncerL2Engine, cfg.JWTSecret) + + syncerNode, err := rollupNode.New(ctx, syncNodeCfg, cfg.Loggers["syncer"], snapLog, "", metrics.NewMetrics("")) + require.NoError(t, err) + err = syncerNode.Start(ctx) + require.NoError(t, err) + defer func() { + require.NoError(t, syncerNode.Stop(ctx)) + }() + + // connect alice and bob to our new syncer node + _, err = sys.Mocknet.ConnectPeers(sys.RollupNodes["alice"].P2P().Host().ID(), syncerNode.P2P().Host().ID()) + require.NoError(t, err) + _, err = sys.Mocknet.ConnectPeers(sys.RollupNodes["bob"].P2P().Host().ID(), syncerNode.P2P().Host().ID()) + require.NoError(t, err) + + rpc := syncerL2Engine.Attach() + l2Verif := ethclient.NewClient(rpc) + + // It may take a while to sync, but eventually we should see the sequenced data show up + receiptVerif, err := wait.ForReceiptOK(ctx, l2Verif, receiptSeq.TxHash) + require.Nil(t, err, "Waiting for L2 tx on verifier") + + require.Equal(t, receiptSeq, receiptVerif) + + // Verify that the tx was received via P2P sync + require.Contains(t, syncedPayloads, eth.BlockID{Hash: receiptVerif.BlockHash, Number: receiptVerif.BlockNumber.Uint64()}.String()) + + // Verify that everything that was received was published + require.GreaterOrEqual(t, len(published), len(syncedPayloads)) + require.Subset(t, published, syncedPayloads) +} + +// TestSystemDenseTopology sets up a dense p2p topology with 3 verifier nodes and 1 sequencer node. +func TestSystemDenseTopology(t *testing.T) { + t.Skip("Skipping dense topology test to avoid flakiness. @refcell address in p2p scoring pr.") + + InitParallel(t) + + cfg := DefaultSystemConfig(t) + // slow down L1 blocks so we can see the L2 blocks arrive well before the L1 blocks do. + // Keep the seq window small so the L2 chain is started quick + cfg.DeployConfig.L1BlockTime = 10 + + // Append additional nodes to the system to construct a dense p2p network + cfg.Nodes["verifier2"] = &rollupNode.Config{ + Driver: driver.Config{ + VerifierConfDepth: 0, + SequencerConfDepth: 0, + SequencerEnabled: false, + }, + L1EpochPollInterval: time.Second * 4, + } + cfg.Nodes["verifier3"] = &rollupNode.Config{ + Driver: driver.Config{ + VerifierConfDepth: 0, + SequencerConfDepth: 0, + SequencerEnabled: false, + }, + L1EpochPollInterval: time.Second * 4, + } + cfg.Loggers["verifier2"] = testlog.Logger(t, log.LevelInfo).New("role", "verifier") + cfg.Loggers["verifier3"] = testlog.Logger(t, log.LevelInfo).New("role", "verifier") + + // connect the nodes + cfg.P2PTopology = map[string][]string{ + "verifier": {"sequencer", "verifier2", "verifier3"}, + "verifier2": {"sequencer", "verifier", "verifier3"}, + "verifier3": {"sequencer", "verifier", "verifier2"}, + } + + // Set peer scoring for each node, but without banning + for _, node := range cfg.Nodes { + params, err := p2p.GetScoringParams("light", &node.Rollup) + require.NoError(t, err) + node.P2P = &p2p.Config{ + ScoringParams: params, + BanningEnabled: false, + } + } + + var published, received1, received2, received3 []common.Hash + seqTracer, verifTracer, verifTracer2, verifTracer3 := new(FnTracer), new(FnTracer), new(FnTracer), new(FnTracer) + seqTracer.OnPublishL2PayloadFn = func(ctx context.Context, payload *eth.ExecutionPayloadEnvelope) { + published = append(published, payload.ExecutionPayload.BlockHash) + } + verifTracer.OnUnsafeL2PayloadFn = func(ctx context.Context, from peer.ID, payload *eth.ExecutionPayloadEnvelope) { + received1 = append(received1, payload.ExecutionPayload.BlockHash) + } + verifTracer2.OnUnsafeL2PayloadFn = func(ctx context.Context, from peer.ID, payload *eth.ExecutionPayloadEnvelope) { + received2 = append(received2, payload.ExecutionPayload.BlockHash) + } + verifTracer3.OnUnsafeL2PayloadFn = func(ctx context.Context, from peer.ID, payload *eth.ExecutionPayloadEnvelope) { + received3 = append(received3, payload.ExecutionPayload.BlockHash) + } + cfg.Nodes["sequencer"].Tracer = seqTracer + cfg.Nodes["verifier"].Tracer = verifTracer + cfg.Nodes["verifier2"].Tracer = verifTracer2 + cfg.Nodes["verifier3"].Tracer = verifTracer3 + + sys, err := cfg.Start(t) + require.Nil(t, err, "Error starting up system") + defer sys.Close() + + l2Seq := sys.Clients["sequencer"] + l2Verif := sys.Clients["verifier"] + l2Verif2 := sys.Clients["verifier2"] + l2Verif3 := sys.Clients["verifier3"] + + // Transactor Account + ethPrivKey := cfg.Secrets.Alice + + // Submit TX to L2 sequencer node + receiptSeq := SendL2Tx(t, cfg, l2Seq, ethPrivKey, func(opts *TxOpts) { + opts.ToAddr = &common.Address{0xff, 0xff} + opts.Value = big.NewInt(1_000_000_000) + + // Wait until the block it was first included in shows up in the safe chain on the verifiers + opts.VerifyOnClients(l2Verif, l2Verif2, l2Verif3) + }) + + // Verify that everything that was received was published + require.GreaterOrEqual(t, len(published), len(received1)) + require.GreaterOrEqual(t, len(published), len(received2)) + require.GreaterOrEqual(t, len(published), len(received3)) + require.ElementsMatch(t, published, received1[:len(published)]) + require.ElementsMatch(t, published, received2[:len(published)]) + require.ElementsMatch(t, published, received3[:len(published)]) + + // Verify that the tx was received via p2p + require.Contains(t, received1, receiptSeq.BlockHash) + require.Contains(t, received2, receiptSeq.BlockHash) + require.Contains(t, received3, receiptSeq.BlockHash) +} + +func TestL1InfoContract(t *testing.T) { + InitParallel(t) + + cfg := DefaultSystemConfig(t) + + sys, err := cfg.Start(t) + require.Nil(t, err, "Error starting up system") + defer sys.Close() + + l1Client := sys.Clients["l1"] + l2Seq := sys.Clients["sequencer"] + l2Verif := sys.Clients["verifier"] + + endVerifBlockNumber := big.NewInt(4) + endSeqBlockNumber := big.NewInt(6) + endVerifBlock, err := geth.WaitForBlock(endVerifBlockNumber, l2Verif, time.Minute) + require.Nil(t, err) + endSeqBlock, err := geth.WaitForBlock(endSeqBlockNumber, l2Seq, time.Minute) + require.Nil(t, err) + + seqL1Info, err := bindings.NewL1Block(cfg.L1InfoPredeployAddress, l2Seq) + require.Nil(t, err) + + verifL1Info, err := bindings.NewL1Block(cfg.L1InfoPredeployAddress, l2Verif) + require.Nil(t, err) + + ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute) + defer cancel() + + fillInfoLists := func(start *types.Block, contract *bindings.L1Block, client *ethclient.Client) ([]*derive.L1BlockInfo, []*derive.L1BlockInfo) { + var txList, stateList []*derive.L1BlockInfo + for b := start; ; { + var infoFromTx *derive.L1BlockInfo + infoFromTx, err := derive.L1BlockInfoFromBytes(sys.RollupConfig, b.Time(), b.Transactions()[0].Data()) + require.NoError(t, err) + txList = append(txList, infoFromTx) + + ecotone := sys.RollupConfig.IsEcotone(b.Time()) && !sys.RollupConfig.IsEcotoneActivationBlock(b.Time()) + infoFromState, err := L1InfoFromState(ctx, contract, b.Number(), ecotone) + require.Nil(t, err) + stateList = append(stateList, infoFromState) + + // Genesis L2 block contains no L1 Deposit TX + if b.NumberU64() == 1 { + return txList, stateList + } + b, err = client.BlockByHash(ctx, b.ParentHash()) + require.Nil(t, err) + } + } + + l1InfosFromSequencerTransactions, l1InfosFromSequencerState := fillInfoLists(endSeqBlock, seqL1Info, l2Seq) + l1InfosFromVerifierTransactions, l1InfosFromVerifierState := fillInfoLists(endVerifBlock, verifL1Info, l2Verif) + + l1blocks := make(map[common.Hash]*derive.L1BlockInfo) + maxL1Hash := l1InfosFromSequencerTransactions[0].BlockHash + for h := maxL1Hash; ; { + b, err := l1Client.BlockByHash(ctx, h) + require.Nil(t, err) + + l1blocks[h] = &derive.L1BlockInfo{ + Number: b.NumberU64(), + Time: b.Time(), + BaseFee: b.BaseFee(), + BlockHash: h, + SequenceNumber: 0, // ignored, will be overwritten + BatcherAddr: sys.RollupConfig.Genesis.SystemConfig.BatcherAddr, + } + if sys.RollupConfig.IsEcotone(b.Time()) && !sys.RollupConfig.IsEcotoneActivationBlock(b.Time()) { + scalars, err := sys.RollupConfig.Genesis.SystemConfig.EcotoneScalars() + require.NoError(t, err) + l1blocks[h].BlobBaseFeeScalar = scalars.BlobBaseFeeScalar + l1blocks[h].BaseFeeScalar = scalars.BaseFeeScalar + if excess := b.ExcessBlobGas(); excess != nil { + l1blocks[h].BlobBaseFee = eip4844.CalcBlobFee(*excess) + } else { + l1blocks[h].BlobBaseFee = big.NewInt(1) + } + } else { + l1blocks[h].L1FeeOverhead = sys.RollupConfig.Genesis.SystemConfig.Overhead + l1blocks[h].L1FeeScalar = sys.RollupConfig.Genesis.SystemConfig.Scalar + } + + h = b.ParentHash() + if b.NumberU64() == 0 { + break + } + } + + checkInfoList := func(name string, list []*derive.L1BlockInfo) { + for _, info := range list { + if expected, ok := l1blocks[info.BlockHash]; ok { + expected.SequenceNumber = info.SequenceNumber // the seq nr is not part of the L1 info we know in advance, so we ignore it. + require.Equal(t, expected, info) + } else { + t.Fatalf("Did not find block hash for L1 Info: %v in test %s", info, name) + } + } + } + + checkInfoList("On sequencer with tx", l1InfosFromSequencerTransactions) + checkInfoList("On sequencer with state", l1InfosFromSequencerState) + checkInfoList("On verifier with tx", l1InfosFromVerifierTransactions) + checkInfoList("On verifier with state", l1InfosFromVerifierState) +} + +// calcGasFees determines the actual cost of the transaction given a specific base fee +// This does not include the L1 data fee charged from L2 transactions. +func calcGasFees(gasUsed uint64, gasTipCap *big.Int, gasFeeCap *big.Int, baseFee *big.Int) *big.Int { + x := new(big.Int).Add(gasTipCap, baseFee) + // If tip + basefee > gas fee cap, clamp it to the gas fee cap + if x.Cmp(gasFeeCap) > 0 { + x = gasFeeCap + } + return x.Mul(x, new(big.Int).SetUint64(gasUsed)) +} + +// TestWithdrawals checks that a deposit and then withdrawal execution succeeds. It verifies the +// balance changes on L1 and L2 and has to include gas fees in the balance checks. +// It does not check that the withdrawal can be executed prior to the end of the finality period. +func TestWithdrawals(t *testing.T) { + InitParallel(t) + + cfg := DefaultSystemConfig(t) + cfg.DeployConfig.FinalizationPeriodSeconds = 2 // 2s finalization period + + sys, err := cfg.Start(t) + require.Nil(t, err, "Error starting up system") + defer sys.Close() + + l1Client := sys.Clients["l1"] + l2Seq := sys.Clients["sequencer"] + l2Verif := sys.Clients["verifier"] + + // Transactor Account + ethPrivKey := cfg.Secrets.Alice + fromAddr := crypto.PubkeyToAddress(ethPrivKey.PublicKey) + + // Create L1 signer + opts, err := bind.NewKeyedTransactorWithChainID(ethPrivKey, cfg.L1ChainIDBig()) + require.Nil(t, err) + + // Start L2 balance + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + startBalanceBeforeDeposit, err := l2Verif.BalanceAt(ctx, fromAddr, nil) + require.Nil(t, err) + + // Send deposit tx + mintAmount := big.NewInt(1_000_000_000_000) + opts.Value = mintAmount + SendDepositTx(t, cfg, l1Client, l2Verif, opts, func(l2Opts *DepositTxOpts) { + l2Opts.Value = common.Big0 + }) + + // Confirm L2 balance + ctx, cancel = context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + endBalanceAfterDeposit, err := wait.ForBalanceChange(ctx, l2Verif, fromAddr, startBalanceBeforeDeposit) + require.Nil(t, err) + + diff := new(big.Int) + diff = diff.Sub(endBalanceAfterDeposit, startBalanceBeforeDeposit) + require.Equal(t, mintAmount, diff, "Did not get expected balance change after mint") + + // Start L2 balance for withdrawal + ctx, cancel = context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + startBalanceBeforeWithdrawal, err := l2Seq.BalanceAt(ctx, fromAddr, nil) + require.Nil(t, err) + + withdrawAmount := big.NewInt(500_000_000_000) + tx, receipt := SendWithdrawal(t, cfg, l2Seq, ethPrivKey, func(opts *WithdrawalTxOpts) { + opts.Value = withdrawAmount + opts.VerifyOnClients(l2Verif) + }) + + // Verify L2 balance after withdrawal + ctx, cancel = context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + header, err := l2Verif.HeaderByNumber(ctx, receipt.BlockNumber) + require.Nil(t, err) + + ctx, cancel = context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + endBalanceAfterWithdrawal, err := wait.ForBalanceChange(ctx, l2Seq, fromAddr, startBalanceBeforeWithdrawal) + require.Nil(t, err) + + // Take fee into account + diff = new(big.Int).Sub(startBalanceBeforeWithdrawal, endBalanceAfterWithdrawal) + fees := calcGasFees(receipt.GasUsed, tx.GasTipCap(), tx.GasFeeCap(), header.BaseFee) + fees = fees.Add(fees, receipt.L1Fee) + diff = diff.Sub(diff, fees) + require.Equal(t, withdrawAmount, diff) + + // Take start balance on L1 + ctx, cancel = context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + startBalanceBeforeFinalize, err := l1Client.BalanceAt(ctx, fromAddr, nil) + require.Nil(t, err) + + proveReceipt, finalizeReceipt, resolveClaimReceipt, resolveReceipt := ProveAndFinalizeWithdrawal(t, cfg, sys, "verifier", ethPrivKey, receipt) + + // Verify balance after withdrawal + ctx, cancel = context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + endBalanceAfterFinalize, err := wait.ForBalanceChange(ctx, l1Client, fromAddr, startBalanceBeforeFinalize) + require.Nil(t, err) + + // Ensure that withdrawal - gas fees are added to the L1 balance + // Fun fact, the fee is greater than the withdrawal amount + // NOTE: The gas fees include *both* the ProveWithdrawalTransaction and FinalizeWithdrawalTransaction transactions. + diff = new(big.Int).Sub(endBalanceAfterFinalize, startBalanceBeforeFinalize) + proveFee := new(big.Int).Mul(new(big.Int).SetUint64(proveReceipt.GasUsed), proveReceipt.EffectiveGasPrice) + finalizeFee := new(big.Int).Mul(new(big.Int).SetUint64(finalizeReceipt.GasUsed), finalizeReceipt.EffectiveGasPrice) + fees = new(big.Int).Add(proveFee, finalizeFee) + if e2eutils.UseFPAC() { + resolveClaimFee := new(big.Int).Mul(new(big.Int).SetUint64(resolveClaimReceipt.GasUsed), resolveClaimReceipt.EffectiveGasPrice) + resolveFee := new(big.Int).Mul(new(big.Int).SetUint64(resolveReceipt.GasUsed), resolveReceipt.EffectiveGasPrice) + fees = new(big.Int).Add(fees, resolveClaimFee) + fees = new(big.Int).Add(fees, resolveFee) + } + withdrawAmount = withdrawAmount.Sub(withdrawAmount, fees) + require.Equal(t, withdrawAmount, diff) +} + +type stateGetterAdapter struct { + ctx context.Context + t *testing.T + client *ethclient.Client + blockNum *big.Int +} + +func (sga *stateGetterAdapter) GetState(addr common.Address, key common.Hash) common.Hash { + sga.t.Helper() + val, err := sga.client.StorageAt(sga.ctx, addr, key, sga.blockNum) + require.NoError(sga.t, err) + var res common.Hash + copy(res[:], val) + return res +} + +// TestFees checks that L1/L2 fees are handled. +func TestFees(t *testing.T) { + t.Run("pre-regolith", func(t *testing.T) { + InitParallel(t) + cfg := DefaultSystemConfig(t) + cfg.DeployConfig.L1GenesisBlockBaseFeePerGas = (*hexutil.Big)(big.NewInt(7)) + + cfg.DeployConfig.L2GenesisRegolithTimeOffset = nil + cfg.DeployConfig.L2GenesisCanyonTimeOffset = nil + cfg.DeployConfig.L2GenesisDeltaTimeOffset = nil + cfg.DeployConfig.L2GenesisEcotoneTimeOffset = nil + testFees(t, cfg) + }) + t.Run("regolith", func(t *testing.T) { + InitParallel(t) + cfg := DefaultSystemConfig(t) + cfg.DeployConfig.L1GenesisBlockBaseFeePerGas = (*hexutil.Big)(big.NewInt(7)) + + cfg.DeployConfig.L2GenesisRegolithTimeOffset = new(hexutil.Uint64) + cfg.DeployConfig.L2GenesisCanyonTimeOffset = nil + cfg.DeployConfig.L2GenesisDeltaTimeOffset = nil + cfg.DeployConfig.L2GenesisEcotoneTimeOffset = nil + testFees(t, cfg) + }) + t.Run("ecotone", func(t *testing.T) { + InitParallel(t) + cfg := DefaultSystemConfig(t) + cfg.DeployConfig.L1GenesisBlockBaseFeePerGas = (*hexutil.Big)(big.NewInt(7)) + + cfg.DeployConfig.L2GenesisRegolithTimeOffset = new(hexutil.Uint64) + cfg.DeployConfig.L2GenesisCanyonTimeOffset = new(hexutil.Uint64) + cfg.DeployConfig.L2GenesisDeltaTimeOffset = new(hexutil.Uint64) + cfg.DeployConfig.L2GenesisEcotoneTimeOffset = new(hexutil.Uint64) + testFees(t, cfg) + }) + t.Run("fjord", func(t *testing.T) { + InitParallel(t) + cfg := DefaultSystemConfig(t) + cfg.DeployConfig.L1GenesisBlockBaseFeePerGas = (*hexutil.Big)(big.NewInt(7)) + + cfg.DeployConfig.L2GenesisRegolithTimeOffset = new(hexutil.Uint64) + cfg.DeployConfig.L2GenesisCanyonTimeOffset = new(hexutil.Uint64) + cfg.DeployConfig.L2GenesisDeltaTimeOffset = new(hexutil.Uint64) + cfg.DeployConfig.L2GenesisEcotoneTimeOffset = new(hexutil.Uint64) + cfg.DeployConfig.L2GenesisFjordTimeOffset = new(hexutil.Uint64) + testFees(t, cfg) + }) +} + +func testFees(t *testing.T, cfg SystemConfig) { + sys, err := cfg.Start(t) + require.Nil(t, err, "Error starting up system") + defer sys.Close() + + l2Seq := sys.Clients["sequencer"] + l2Verif := sys.Clients["verifier"] + l1 := sys.Clients["l1"] + + // Wait for first block after genesis. The genesis block has zero L1Block values and will throw off the GPO checks + _, err = geth.WaitForBlock(big.NewInt(1), l2Verif, time.Minute) + require.NoError(t, err) + + config := sys.L2Genesis().Config + + sga := &stateGetterAdapter{ + ctx: context.Background(), + t: t, + client: l2Seq, + } + + l1CostFn := types.NewL1CostFunc(config, sga) + + // Transactor Account + ethPrivKey := cfg.Secrets.Alice + fromAddr := crypto.PubkeyToAddress(ethPrivKey.PublicKey) + + require.NotEqual(t, cfg.DeployConfig.L2OutputOracleProposer, fromAddr) + require.NotEqual(t, cfg.DeployConfig.BatchSenderAddress, fromAddr) + + // Find gaspriceoracle contract + gpoContract, err := bindings.NewGasPriceOracle(predeploys.GasPriceOracleAddr, l2Seq) + require.Nil(t, err) + + if !sys.RollupConfig.IsEcotone(sys.L2GenesisCfg.Timestamp) { + overhead, err := gpoContract.Overhead(&bind.CallOpts{}) + require.Nil(t, err, "reading gpo overhead") + require.Equal(t, overhead.Uint64(), cfg.DeployConfig.GasPriceOracleOverhead, "wrong gpo overhead") + + scalar, err := gpoContract.Scalar(&bind.CallOpts{}) + require.Nil(t, err, "reading gpo scalar") + feeScalar := cfg.DeployConfig.FeeScalar() + require.Equal(t, scalar, new(big.Int).SetBytes(feeScalar[:]), "wrong gpo scalar") + } else { + _, err := gpoContract.Overhead(&bind.CallOpts{}) + require.ErrorContains(t, err, "deprecated") + _, err = gpoContract.Scalar(&bind.CallOpts{}) + require.ErrorContains(t, err, "deprecated") + } + + decimals, err := gpoContract.Decimals(&bind.CallOpts{}) + require.Nil(t, err, "reading gpo decimals") + + require.Equal(t, decimals.Uint64(), uint64(6), "wrong gpo decimals") + + // BaseFee Recipient + baseFeeRecipientStartBalance, err := l2Seq.BalanceAt(context.Background(), predeploys.BaseFeeVaultAddr, big.NewInt(rpc.EarliestBlockNumber.Int64())) + require.Nil(t, err) + + // L1Fee Recipient + l1FeeRecipientStartBalance, err := l2Seq.BalanceAt(context.Background(), predeploys.L1FeeVaultAddr, big.NewInt(rpc.EarliestBlockNumber.Int64())) + require.Nil(t, err) + + sequencerFeeVaultStartBalance, err := l2Seq.BalanceAt(context.Background(), predeploys.SequencerFeeVaultAddr, big.NewInt(rpc.EarliestBlockNumber.Int64())) + require.Nil(t, err) + + genesisBlock, err := l2Seq.BlockByNumber(context.Background(), big.NewInt(rpc.EarliestBlockNumber.Int64())) + require.NoError(t, err) + + coinbaseStartBalance, err := l2Seq.BalanceAt(context.Background(), genesisBlock.Coinbase(), big.NewInt(rpc.EarliestBlockNumber.Int64())) + require.NoError(t, err) + + // Simple transfer from signer to random account + startBalance, err := l2Seq.BalanceAt(context.Background(), fromAddr, big.NewInt(rpc.EarliestBlockNumber.Int64())) + require.Nil(t, err) + require.Greater(t, startBalance.Uint64(), big.NewInt(params.Ether).Uint64()) + + transferAmount := big.NewInt(params.Ether) + gasTip := big.NewInt(10) + receipt := SendL2Tx(t, cfg, l2Seq, ethPrivKey, func(opts *TxOpts) { + opts.ToAddr = &common.Address{0xff, 0xff} + opts.Value = transferAmount + opts.GasTipCap = gasTip + opts.Gas = 21000 + opts.GasFeeCap = big.NewInt(200) + opts.VerifyOnClients(l2Verif) + }) + + require.Equal(t, receipt.Status, types.ReceiptStatusSuccessful) + + header, err := l2Seq.HeaderByNumber(context.Background(), receipt.BlockNumber) + require.Nil(t, err) + + coinbaseEndBalance, err := l2Seq.BalanceAt(context.Background(), header.Coinbase, header.Number) + require.Nil(t, err) + + endBalance, err := l2Seq.BalanceAt(context.Background(), fromAddr, header.Number) + require.Nil(t, err) + + baseFeeRecipientEndBalance, err := l2Seq.BalanceAt(context.Background(), predeploys.BaseFeeVaultAddr, header.Number) + require.Nil(t, err) + + l1Header, err := l1.HeaderByNumber(context.Background(), nil) + require.Nil(t, err) + + l1FeeRecipientEndBalance, err := l2Seq.BalanceAt(context.Background(), predeploys.L1FeeVaultAddr, header.Number) + require.Nil(t, err) + + sequencerFeeVaultEndBalance, err := l2Seq.BalanceAt(context.Background(), predeploys.SequencerFeeVaultAddr, header.Number) + require.Nil(t, err) + + // Diff fee recipient + coinbase balances + baseFeeRecipientDiff := new(big.Int).Sub(baseFeeRecipientEndBalance, baseFeeRecipientStartBalance) + l1FeeRecipientDiff := new(big.Int).Sub(l1FeeRecipientEndBalance, l1FeeRecipientStartBalance) + sequencerFeeVaultDiff := new(big.Int).Sub(sequencerFeeVaultEndBalance, sequencerFeeVaultStartBalance) + coinbaseDiff := new(big.Int).Sub(coinbaseEndBalance, coinbaseStartBalance) + + // Tally L2 Fee + l2Fee := gasTip.Mul(gasTip, new(big.Int).SetUint64(receipt.GasUsed)) + require.Equal(t, sequencerFeeVaultDiff, coinbaseDiff, "coinbase is always sequencer fee vault") + require.Equal(t, l2Fee, coinbaseDiff, "l2 fee mismatch") + require.Equal(t, l2Fee, sequencerFeeVaultDiff) + + // Tally BaseFee + baseFee := new(big.Int).Mul(header.BaseFee, new(big.Int).SetUint64(receipt.GasUsed)) + require.Equal(t, baseFee, baseFeeRecipientDiff, "base fee fee mismatch") + + // Tally L1 Fee + tx, _, err := l2Seq.TransactionByHash(context.Background(), receipt.TxHash) + require.NoError(t, err, "Should be able to get transaction") + bytes, err := tx.MarshalBinary() + require.Nil(t, err) + + l1Fee := l1CostFn(tx.RollupCostData(), header.Time) + require.Equalf(t, l1Fee, l1FeeRecipientDiff, "L1 fee mismatch: start balance %v, end balance %v", l1FeeRecipientStartBalance, l1FeeRecipientEndBalance) + + gpoEcotone, err := gpoContract.IsEcotone(nil) + require.NoError(t, err) + require.Equal(t, sys.RollupConfig.IsEcotone(header.Time), gpoEcotone, "GPO and chain must have same ecotone view") + + gpoFjord, err := gpoContract.IsFjord(nil) + require.NoError(t, err) + require.Equal(t, sys.RollupConfig.IsFjord(header.Time), gpoFjord, "GPO and chain must have same fjord view") + + gpoL1Fee, err := gpoContract.GetL1Fee(&bind.CallOpts{}, bytes) + require.Nil(t, err) + + adjustedGPOFee := gpoL1Fee + if sys.RollupConfig.IsFjord(header.Time) { + // The fastlz size of the transaction is 102 bytes + require.Equal(t, uint64(102), tx.RollupCostData().FastLzSize) + // Which results in both the fjord cost function and GPO using the minimum value for the fastlz regression: + // Geth Linear Regression: -42.5856 + 102 * 0.8365 = 42.7374 + // GPO Linear Regression: -42.5856 + 170 * 0.8365 = 99.6194 + // The additional 68 (170 vs. 102) is due to the GPO adding 68 bytes to account for the signature. + require.Greater(t, types.MinTransactionSize.Uint64(), uint64(99)) + // Because of this, we don't need to do any adjustment as the GPO and cost func are both bounded to the minimum value. + // However, if the fastlz regression output is ever larger than the minimum, this will require an adjustment. + } else if sys.RollupConfig.IsRegolith(header.Time) { + // if post-regolith, adjust the GPO fee by removing the overhead it adds because of signature data + artificialGPOOverhead := big.NewInt(68 * 16) // it adds 68 bytes to cover signature and RLP data + l1BaseFee := big.NewInt(7) // we assume the L1 basefee is the minimum, 7 + // in our case we already include that, so we subtract it, to do a 1:1 comparison + adjustedGPOFee = new(big.Int).Sub(gpoL1Fee, new(big.Int).Mul(artificialGPOOverhead, l1BaseFee)) + } + require.Equal(t, l1Fee, adjustedGPOFee, "GPO reports L1 fee mismatch") + + require.Equal(t, receipt.L1Fee, l1Fee, "l1 fee in receipt is correct") + if !sys.RollupConfig.IsEcotone(header.Time) { // FeeScalar receipt attribute is removed as of Ecotone + require.Equal(t, + new(big.Float).Mul( + new(big.Float).SetInt(l1Header.BaseFee), + new(big.Float).Mul(new(big.Float).SetInt(receipt.L1GasUsed), receipt.FeeScalar), + ), + new(big.Float).SetInt(receipt.L1Fee), "fee field in receipt matches gas used times scalar times base fee") + } + + // Calculate total fee + baseFeeRecipientDiff.Add(baseFeeRecipientDiff, coinbaseDiff) + totalFee := new(big.Int).Add(baseFeeRecipientDiff, l1FeeRecipientDiff) + balanceDiff := new(big.Int).Sub(startBalance, endBalance) + balanceDiff.Sub(balanceDiff, transferAmount) + require.Equal(t, balanceDiff, totalFee, "balances should add up") +} + +func StopStartBatcher(t *testing.T, deltaTimeOffset *hexutil.Uint64) { + InitParallel(t) + + cfg := DefaultSystemConfig(t) + cfg.DeployConfig.L2GenesisDeltaTimeOffset = deltaTimeOffset + sys, err := cfg.Start(t) + require.NoError(t, err, "Error starting up system") + defer sys.Close() + + rollupRPCClient, err := rpc.DialContext(context.Background(), sys.RollupNodes["verifier"].HTTPEndpoint()) + require.NoError(t, err) + rollupClient := sources.NewRollupClient(client.NewBaseRPCClient(rollupRPCClient)) + + l2Seq := sys.Clients["sequencer"] + l2Verif := sys.Clients["verifier"] + + // retrieve the initial sync status + seqStatus, err := rollupClient.SyncStatus(context.Background()) + require.NoError(t, err) + + nonce := uint64(0) + sendTx := func() *types.Receipt { + // Submit TX to L2 sequencer node + receipt := SendL2Tx(t, cfg, l2Seq, cfg.Secrets.Alice, func(opts *TxOpts) { + opts.ToAddr = &common.Address{0xff, 0xff} + opts.Value = big.NewInt(1_000_000_000) + opts.Nonce = nonce + }) + nonce++ + return receipt + } + // send a transaction + receipt := sendTx() + + // wait until the block the tx was first included in shows up in the safe chain on the verifier + safeBlockInclusionDuration := time.Duration(6*cfg.DeployConfig.L1BlockTime) * time.Second + _, err = geth.WaitForBlock(receipt.BlockNumber, l2Verif, safeBlockInclusionDuration) + require.NoError(t, err, "Waiting for block on verifier") + require.NoError(t, wait.ForProcessingFullBatch(context.Background(), rollupClient)) + + // ensure the safe chain advances + newSeqStatus, err := rollupClient.SyncStatus(context.Background()) + require.NoError(t, err) + require.Greater(t, newSeqStatus.SafeL2.Number, seqStatus.SafeL2.Number, "Safe chain did not advance") + + // stop the batch submission + err = sys.BatchSubmitter.Driver().StopBatchSubmitting(context.Background()) + require.NoError(t, err) + + // wait for any old safe blocks being submitted / derived + time.Sleep(safeBlockInclusionDuration) + + // get the initial sync status + seqStatus, err = rollupClient.SyncStatus(context.Background()) + require.NoError(t, err) + + // send another tx + sendTx() + time.Sleep(safeBlockInclusionDuration) + + // ensure that the safe chain does not advance while the batcher is stopped + newSeqStatus, err = rollupClient.SyncStatus(context.Background()) + require.NoError(t, err) + require.Equal(t, newSeqStatus.SafeL2.Number, seqStatus.SafeL2.Number, "Safe chain advanced while batcher was stopped") + + // start the batch submission + err = sys.BatchSubmitter.Driver().StartBatchSubmitting() + require.NoError(t, err) + time.Sleep(safeBlockInclusionDuration) + + // send a third tx + receipt = sendTx() + + // wait until the block the tx was first included in shows up in the safe chain on the verifier + _, err = geth.WaitForBlock(receipt.BlockNumber, l2Verif, safeBlockInclusionDuration) + require.NoError(t, err, "Waiting for block on verifier") + require.NoError(t, wait.ForProcessingFullBatch(context.Background(), rollupClient)) + + // ensure that the safe chain advances after restarting the batcher + newSeqStatus, err = rollupClient.SyncStatus(context.Background()) + require.NoError(t, err) + require.Greater(t, newSeqStatus.SafeL2.Number, seqStatus.SafeL2.Number, "Safe chain did not advance after batcher was restarted") +} + +func TestBatcherMultiTx(t *testing.T) { + InitParallel(t) + + cfg := DefaultSystemConfig(t) + cfg.MaxPendingTransactions = 0 // no limit on parallel txs + // ensures that batcher txs are as small as possible + cfg.BatcherMaxL1TxSizeBytes = derive.FrameV0OverHeadSize + 1 /*version bytes*/ + 1 + cfg.DisableBatcher = true + sys, err := cfg.Start(t) + require.NoError(t, err, "Error starting up system") + defer sys.Close() + + l1Client := sys.Clients["l1"] + l2Seq := sys.Clients["sequencer"] + + _, err = geth.WaitForBlock(big.NewInt(10), l2Seq, time.Duration(cfg.DeployConfig.L2BlockTime*15)*time.Second) + require.NoError(t, err, "Waiting for L2 blocks") + + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + l1Number, err := l1Client.BlockNumber(ctx) + require.NoError(t, err) + + // start batch submission + err = sys.BatchSubmitter.Driver().StartBatchSubmitting() + require.NoError(t, err) + + totalTxCount := 0 + // wait for up to 10 L1 blocks, usually only 3 is required, but it's + // possible additional L1 blocks will be created before the batcher starts, + // so we wait additional blocks. + for i := int64(0); i < 10; i++ { + block, err := geth.WaitForBlock(big.NewInt(int64(l1Number)+i), l1Client, time.Duration(cfg.DeployConfig.L1BlockTime*5)*time.Second) + require.NoError(t, err, "Waiting for l1 blocks") + totalTxCount += len(block.Transactions()) + + if totalTxCount >= 10 { + return + } + } + + t.Fatal("Expected at least 10 transactions from the batcher") +} + +func latestBlock(t *testing.T, client *ethclient.Client) uint64 { + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + blockAfter, err := client.BlockNumber(ctx) + require.Nil(t, err, "Error getting latest block") + return blockAfter +} + +// TestPendingBlockIsLatest tests that we serve the latest block as pending block +func TestPendingBlockIsLatest(t *testing.T) { + InitParallel(t) + + cfg := DefaultSystemConfig(t) + sys, err := cfg.Start(t) + require.Nil(t, err, "Error starting up system") + defer sys.Close() + l2Seq := sys.Clients["sequencer"] + + t.Run("block", func(t *testing.T) { + for i := 0; i < 10; i++ { + // TODO(CLI-4044): pending-block ID change + pending, err := l2Seq.BlockByNumber(context.Background(), big.NewInt(-1)) + require.NoError(t, err) + latest, err := l2Seq.BlockByNumber(context.Background(), nil) + require.NoError(t, err) + if pending.NumberU64() == latest.NumberU64() { + require.Equal(t, pending.Hash(), latest.Hash(), "pending must exactly match latest block") + return + } + // re-try until we have the same number, as the requests are not an atomic bundle, and the sequencer may create a block. + } + t.Fatal("failed to get pending block with same number as latest block") + }) + t.Run("header", func(t *testing.T) { + for i := 0; i < 10; i++ { + // TODO(CLI-4044): pending-block ID change + pending, err := l2Seq.HeaderByNumber(context.Background(), big.NewInt(-1)) + require.NoError(t, err) + latest, err := l2Seq.HeaderByNumber(context.Background(), nil) + require.NoError(t, err) + if pending.Number.Uint64() == latest.Number.Uint64() { + require.Equal(t, pending.Hash(), latest.Hash(), "pending must exactly match latest header") + return + } + // re-try until we have the same number, as the requests are not an atomic bundle, and the sequencer may create a block. + } + t.Fatal("failed to get pending header with same number as latest header") + }) +} + +func TestRuntimeConfigReload(t *testing.T) { + InitParallel(t) + + cfg := DefaultSystemConfig(t) + // to speed up the test, make it reload the config more often, and do not impose a long conf depth + cfg.Nodes["verifier"].RuntimeConfigReloadInterval = time.Second * 5 + cfg.Nodes["verifier"].Driver.VerifierConfDepth = 1 + + sys, err := cfg.Start(t) + require.Nil(t, err, "Error starting up system") + defer sys.Close() + initialRuntimeConfig := sys.RollupNodes["verifier"].RuntimeConfig() + + // close the EL node, since we want to block derivation, to solely rely on the reloading mechanism for updates. + sys.EthInstances["verifier"].Close() + + l1 := sys.Clients["l1"] + + // Change the system-config via L1 + sysCfgContract, err := bindings.NewSystemConfig(cfg.L1Deployments.SystemConfigProxy, l1) + require.NoError(t, err) + newUnsafeBlocksSigner := common.Address{0x12, 0x23, 0x45} + require.NotEqual(t, initialRuntimeConfig.P2PSequencerAddress(), newUnsafeBlocksSigner, "changing to a different address") + opts, err := bind.NewKeyedTransactorWithChainID(cfg.Secrets.SysCfgOwner, cfg.L1ChainIDBig()) + require.Nil(t, err) + // the unsafe signer address is part of the runtime config + tx, err := sysCfgContract.SetUnsafeBlockSigner(opts, newUnsafeBlocksSigner) + require.NoError(t, err) + + // wait for the change to confirm + _, err = wait.ForReceiptOK(context.Background(), l1, tx.Hash()) + require.NoError(t, err) + + // wait for the address to change + _, err = retry.Do(context.Background(), 10, retry.Fixed(time.Second*10), func() (struct{}, error) { + v := sys.RollupNodes["verifier"].RuntimeConfig().P2PSequencerAddress() + if v == newUnsafeBlocksSigner { + return struct{}{}, nil + } + return struct{}{}, fmt.Errorf("no change yet, seeing %s but looking for %s", v, newUnsafeBlocksSigner) + }) + require.NoError(t, err) +} + +func TestRecommendedProtocolVersionChange(t *testing.T) { + InitParallel(t) + + cfg := DefaultSystemConfig(t) + require.NotEqual(t, common.Address{}, cfg.L1Deployments.ProtocolVersions, "need ProtocolVersions contract deployment") + // to speed up the test, make it reload the config more often, and do not impose a long conf depth + cfg.Nodes["verifier"].RuntimeConfigReloadInterval = time.Second * 5 + cfg.Nodes["verifier"].Driver.VerifierConfDepth = 1 + + sys, err := cfg.Start(t) + require.Nil(t, err, "Error starting up system") + defer sys.Close() + runtimeConfig := sys.RollupNodes["verifier"].RuntimeConfig() + + // Change the superchain-config via L1 + l1 := sys.Clients["l1"] + + _, build, major, minor, patch, preRelease := params.OPStackSupport.Parse() + newRecommendedProtocolVersion := params.ProtocolVersionV0{Build: build, Major: major + 1, Minor: minor, Patch: patch, PreRelease: preRelease}.Encode() + require.NotEqual(t, runtimeConfig.RecommendedProtocolVersion(), newRecommendedProtocolVersion, "changing to a different protocol version") + + protVersions, err := bindings.NewProtocolVersions(cfg.L1Deployments.ProtocolVersionsProxy, l1) + require.NoError(t, err) + + // ProtocolVersions contract is owned by same key as SystemConfig in devnet + opts, err := bind.NewKeyedTransactorWithChainID(cfg.Secrets.SysCfgOwner, cfg.L1ChainIDBig()) + require.NoError(t, err) + + // Change recommended protocol version + tx, err := protVersions.SetRecommended(opts, new(big.Int).SetBytes(newRecommendedProtocolVersion[:])) + require.NoError(t, err) + + // wait for the change to confirm + _, err = wait.ForReceiptOK(context.Background(), l1, tx.Hash()) + require.NoError(t, err) + + // wait for the recommended protocol version to change + _, err = retry.Do(context.Background(), 10, retry.Fixed(time.Second*10), func() (struct{}, error) { + v := sys.RollupNodes["verifier"].RuntimeConfig().RecommendedProtocolVersion() + if v == newRecommendedProtocolVersion { + return struct{}{}, nil + } + return struct{}{}, fmt.Errorf("no change yet, seeing %s but looking for %s", v, newRecommendedProtocolVersion) + }) + require.NoError(t, err) +} + +func TestRequiredProtocolVersionChangeAndHalt(t *testing.T) { + InitParallel(t) + + cfg := DefaultSystemConfig(t) + // to speed up the test, make it reload the config more often, and do not impose a long conf depth + cfg.Nodes["verifier"].RuntimeConfigReloadInterval = time.Second * 5 + cfg.Nodes["verifier"].Driver.VerifierConfDepth = 1 + // configure halt in verifier op-node + cfg.Nodes["verifier"].RollupHalt = "major" + // configure halt in verifier op-geth node + cfg.GethOptions["verifier"] = append(cfg.GethOptions["verifier"], []geth.GethOption{ + func(ethCfg *ethconfig.Config, nodeCfg *node.Config) error { + ethCfg.RollupHaltOnIncompatibleProtocolVersion = "major" + return nil + }, + }...) + + sys, err := cfg.Start(t) + require.Nil(t, err, "Error starting up system") + defer sys.Close() + runtimeConfig := sys.RollupNodes["verifier"].RuntimeConfig() + + // Change the superchain-config via L1 + l1 := sys.Clients["l1"] + + _, build, major, minor, patch, preRelease := params.OPStackSupport.Parse() + newRequiredProtocolVersion := params.ProtocolVersionV0{Build: build, Major: major + 1, Minor: minor, Patch: patch, PreRelease: preRelease}.Encode() + require.NotEqual(t, runtimeConfig.RequiredProtocolVersion(), newRequiredProtocolVersion, "changing to a different protocol version") + + protVersions, err := bindings.NewProtocolVersions(cfg.L1Deployments.ProtocolVersionsProxy, l1) + require.NoError(t, err) + + // ProtocolVersions contract is owned by same key as SystemConfig in devnet + opts, err := bind.NewKeyedTransactorWithChainID(cfg.Secrets.SysCfgOwner, cfg.L1ChainIDBig()) + require.NoError(t, err) + + // Change required protocol version + tx, err := protVersions.SetRequired(opts, new(big.Int).SetBytes(newRequiredProtocolVersion[:])) + require.NoError(t, err) + + // wait for the change to confirm + _, err = wait.ForReceiptOK(context.Background(), l1, tx.Hash()) + require.NoError(t, err) + + // wait for the required protocol version to take effect by halting the verifier that opted in, and halting the op-geth node that opted in. + _, err = retry.Do(context.Background(), 10, retry.Fixed(time.Second*10), func() (struct{}, error) { + if !sys.RollupNodes["verifier"].Stopped() { + return struct{}{}, errors.New("verifier rollup node is not closed yet") + } + return struct{}{}, nil + }) + require.NoError(t, err) + t.Log("verified that op-node closed!") + // Checking if the engine is down is not trivial in op-e2e. + // In op-geth we have halting tests covering the Engine API, in op-e2e we instead check if the API stops. + _, err = retry.Do(context.Background(), 10, retry.Fixed(time.Second*10), func() (struct{}, error) { + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + _, err := sys.Clients["verifier"].ChainID(ctx) + cancel() + if err != nil && !errors.Is(err, ctx.Err()) { // waiting for client to stop responding to chainID requests + return struct{}{}, nil + } + return struct{}{}, errors.New("verifier rollup node is not closed yet") + }) + require.NoError(t, err) + t.Log("verified that op-geth closed!") +} diff --git a/op-e2e2/system_tob_test.go b/op-e2e2/system_tob_test.go new file mode 100644 index 000000000000..c77ffe30fdb1 --- /dev/null +++ b/op-e2e2/system_tob_test.go @@ -0,0 +1,739 @@ +package op_e2e + +import ( + "bytes" + "context" + "crypto/ecdsa" + "fmt" + "math/big" + "math/rand" + "testing" + "time" + + "github.com/ethereum-optimism/optimism/op-chain-ops/crossdomain" + legacybindings "github.com/ethereum-optimism/optimism/op-e2e2/bindings" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/challenger" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/disputegame" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/geth" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/wait" + "github.com/ethereum-optimism/optimism/op-node/bindings" + bindingspreview "github.com/ethereum-optimism/optimism/op-node/bindings/preview" + "github.com/ethereum-optimism/optimism/op-service/predeploys" + "github.com/ethereum-optimism/optimism/op-service/testutils/fuzzerutils" + "github.com/ethereum/go-ethereum/accounts" + "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/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/ethereum/go-ethereum/ethclient/gethclient" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rpc" + fuzz "github.com/google/gofuzz" + "github.com/stretchr/testify/require" +) + +// TestGasPriceOracleFeeUpdates checks that the gas price oracle cannot be locked by mis-configuring parameters. +func TestGasPriceOracleFeeUpdates(t *testing.T) { + ctx, ctxCancel := context.WithCancel(context.Background()) + defer ctxCancel() + + InitParallel(t) + // Define our values to set in the GasPriceOracle (we set them high to see if it can lock L2 or stop bindings + // from updating the prices once again. + overheadValue := new(big.Int).Set(abi.MaxUint256) + // Ensure the most significant byte is 0x00 + scalarValue := new(big.Int).Rsh(new(big.Int).Set(abi.MaxUint256), 8) + var cancel context.CancelFunc + + // Create our system configuration for L1/L2 and start it + cfg := DefaultSystemConfig(t) + sys, err := cfg.Start(t) + require.Nil(t, err, "Error starting up system") + defer sys.Close() + + // Obtain our sequencer, verifier, and transactor keypair. + l1Client := sys.Clients["l1"] + l2Seq := sys.Clients["sequencer"] + // l2Verif := sys.Clients["verifier"] + ethPrivKey := cfg.Secrets.SysCfgOwner + + // Bind to the SystemConfig & GasPriceOracle contracts + sysconfig, err := legacybindings.NewSystemConfig(cfg.L1Deployments.SystemConfigProxy, l1Client) + require.Nil(t, err) + gpoContract, err := legacybindings.NewGasPriceOracleCaller(predeploys.GasPriceOracleAddr, l2Seq) + require.Nil(t, err) + + // Obtain our signer. + opts, err := bind.NewKeyedTransactorWithChainID(ethPrivKey, cfg.L1ChainIDBig()) + require.Nil(t, err) + + // Define our L1 transaction timeout duration. + txTimeoutDuration := 10 * time.Duration(cfg.DeployConfig.L1BlockTime) * time.Second + + // Update the gas config, wait for it to show up on L2, & verify that it was set as intended + opts.Context, cancel = context.WithTimeout(ctx, txTimeoutDuration) + tx, err := sysconfig.SetGasConfig(opts, overheadValue, scalarValue) + cancel() + require.Nil(t, err, "sending overhead update tx") + + receipt, err := wait.ForReceiptOK(ctx, l1Client, tx.Hash()) + require.Nil(t, err, "Waiting for sysconfig set gas config update tx") + + _, err = geth.WaitForL1OriginOnL2(sys.RollupConfig, receipt.BlockNumber.Uint64(), l2Seq, txTimeoutDuration) + require.NoError(t, err, "waiting for L2 block to include the sysconfig update") + + gpoOverhead, err := gpoContract.Overhead(&bind.CallOpts{}) + require.Nil(t, err, "reading gpo overhead") + gpoScalar, err := gpoContract.Scalar(&bind.CallOpts{}) + require.Nil(t, err, "reading gpo scalar") + + if gpoOverhead.Cmp(overheadValue) != 0 { + t.Errorf("overhead that was found (%v) is not what was set (%v)", gpoOverhead, overheadValue) + } + if gpoScalar.Cmp(scalarValue) != 0 { + t.Errorf("scalar that was found (%v) is not what was set (%v)", gpoScalar, scalarValue) + } + + // Now modify the scalar value & ensure that the gas params can be modified + scalarValue = big.NewInt(params.Ether) + + opts.Context, cancel = context.WithTimeout(context.Background(), txTimeoutDuration) + tx, err = sysconfig.SetGasConfig(opts, overheadValue, scalarValue) + cancel() + require.Nil(t, err, "sending overhead update tx") + + receipt, err = wait.ForReceiptOK(ctx, l1Client, tx.Hash()) + require.Nil(t, err, "Waiting for sysconfig set gas config update tx") + + _, err = geth.WaitForL1OriginOnL2(sys.RollupConfig, receipt.BlockNumber.Uint64(), l2Seq, txTimeoutDuration) + require.NoError(t, err, "waiting for L2 block to include the sysconfig update") + + gpoOverhead, err = gpoContract.Overhead(&bind.CallOpts{}) + require.Nil(t, err, "reading gpo overhead") + gpoScalar, err = gpoContract.Scalar(&bind.CallOpts{}) + require.Nil(t, err, "reading gpo scalar") + + if gpoOverhead.Cmp(overheadValue) != 0 { + t.Errorf("overhead that was found (%v) is not what was set (%v)", gpoOverhead, overheadValue) + } + if gpoScalar.Cmp(scalarValue) != 0 { + t.Errorf("scalar that was found (%v) is not what was set (%v)", gpoScalar, scalarValue) + } +} + +// TestL2SequencerRPCDepositTx checks that the L2 sequencer will not accept DepositTx type transactions. +// The acceptance of these transactions would allow for arbitrary minting of ETH in L2. +func TestL2SequencerRPCDepositTx(t *testing.T) { + InitParallel(t) + + // Create our system configuration for L1/L2 and start it + cfg := DefaultSystemConfig(t) + sys, err := cfg.Start(t) + require.Nil(t, err, "Error starting up system") + defer sys.Close() + + // Obtain our sequencer, verifier, and transactor keypair. + l2Seq := sys.Clients["sequencer"] + l2Verif := sys.Clients["verifier"] + txSigningKey := sys.Cfg.Secrets.Alice + require.Nil(t, err) + + // Create a deposit tx to send over RPC. + tx := types.NewTx(&types.DepositTx{ + SourceHash: common.Hash{}, + From: crypto.PubkeyToAddress(txSigningKey.PublicKey), + To: &common.Address{0xff, 0xff}, + Mint: big.NewInt(1000), + Value: big.NewInt(1000), + Gas: 0, + IsSystemTransaction: false, + Data: nil, + }) + + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) + err = l2Seq.SendTransaction(ctx, tx) + cancel() + require.Error(t, err, "a DepositTx was accepted by L2 sequencer over RPC when it should not have been.") + + ctx, cancel = context.WithTimeout(context.Background(), 5*time.Second) + err = l2Verif.SendTransaction(ctx, tx) + cancel() + require.Error(t, err, "a DepositTx was accepted by L2 verifier over RPC when it should not have been.") +} + +// TestAccount defines an account generated by startConfigWithTestAccounts +type TestAccount struct { + HDPath string + Key *ecdsa.PrivateKey + Addr common.Address + L1Opts *bind.TransactOpts + L2Opts *bind.TransactOpts +} + +// startConfigWithTestAccounts takes a SystemConfig, generates additional accounts, adds them to the config, so they +// are funded on startup, starts the system, and imports the keys into the keystore, and obtains transaction opts for +// each account. +func startConfigWithTestAccounts(t *testing.T, cfg *SystemConfig, accountsToGenerate int) (*System, []*TestAccount, error) { + // Create our test accounts and add them to the pre-mine cfg. + testAccounts := make([]*TestAccount, 0) + var err error + for i := 0; i < accountsToGenerate; i++ { + // Create our test account and add it to our list + testAccount := &TestAccount{ + HDPath: fmt.Sprintf("m/44'/60'/0'/0/%d", 1000+i), // offset by 1000 to avoid collisions. + Key: nil, + L1Opts: nil, + L2Opts: nil, + } + testAccounts = append(testAccounts, testAccount) + + // Obtain our generated private key + testAccount.Key, err = cfg.Secrets.Wallet.PrivateKey(accounts.Account{ + URL: accounts.URL{ + Path: testAccount.HDPath, + }, + }) + if err != nil { + return nil, nil, err + } + testAccount.Addr = crypto.PubkeyToAddress(testAccount.Key.PublicKey) + + // Obtain the transaction options for contract bindings for this account. + testAccount.L1Opts, err = bind.NewKeyedTransactorWithChainID(testAccount.Key, cfg.L1ChainIDBig()) + if err != nil { + return nil, nil, err + } + testAccount.L2Opts, err = bind.NewKeyedTransactorWithChainID(testAccount.Key, cfg.L2ChainIDBig()) + if err != nil { + return nil, nil, err + } + + // Fund the test account in our config + cfg.Premine[testAccount.Addr] = big.NewInt(params.Ether) + cfg.Premine[testAccount.Addr] = cfg.Premine[testAccount.Addr].Mul(cfg.Premine[testAccount.Addr], big.NewInt(1_000_000)) + + } + + // Start our system + sys, err := cfg.Start(t) + if err != nil { + return sys, nil, err + } + + // Return our results. + return sys, testAccounts, err +} + +// TestMixedDepositValidity makes a number of deposit transactions, some which will succeed in transferring value, +// while others do not. It ensures that the expected nonces/balances match after several interactions. +func TestMixedDepositValidity(t *testing.T) { + InitParallel(t) + // Define how many deposit txs we'll make. Each deposit mints a fixed amount and transfers up to 1/3 of the user's + // balance. As such, this number cannot be too high or else the test will always fail due to lack of balance in L1. + const depositTxCount = 15 + + // Define how many accounts we'll use to deposit funds + const accountUsedToDeposit = 5 + + // Create our system configuration, funding all accounts we created for L1/L2, and start it + cfg := DefaultSystemConfig(t) + sys, testAccounts, err := startConfigWithTestAccounts(t, &cfg, accountUsedToDeposit) + require.Nil(t, err, "Error starting up system") + defer sys.Close() + + // Obtain our sequencer, verifier, and transactor keypair. + l1Client := sys.Clients["l1"] + l2Seq := sys.Clients["sequencer"] + l2Verif := sys.Clients["verifier"] + require.NoError(t, err) + + // Define our L1 transaction timeout duration. + txTimeoutDuration := 10 * time.Duration(cfg.DeployConfig.L1BlockTime) * time.Second + + // Create a struct used to track our transactors and their transactions sent. + type TestAccountState struct { + Account *TestAccount + ExpectedL1Balance *big.Int + ExpectedL2Balance *big.Int + StartingL1Nonce uint64 + ExpectedL1Nonce uint64 + StartingL2Nonce uint64 + ExpectedL2Nonce uint64 + } + + // Create the state objects for every test account we'll track changes for. + transactors := make([]*TestAccountState, 0) + for i := 0; i < len(testAccounts); i++ { + // Obtain our account + testAccount := testAccounts[i] + + // Obtain the transactor's starting nonce on L1. + ctx, cancel := context.WithTimeout(context.Background(), txTimeoutDuration) + startL1Nonce, err := l1Client.NonceAt(ctx, testAccount.L1Opts.From, nil) + cancel() + require.NoError(t, err) + + // Obtain the transactor's starting balance on L2. + ctx, cancel = context.WithTimeout(context.Background(), txTimeoutDuration) + startL2Balance, err := l2Verif.BalanceAt(ctx, testAccount.L2Opts.From, nil) + cancel() + require.NoError(t, err) + + // Obtain the transactor's starting nonce on L2. + ctx, cancel = context.WithTimeout(context.Background(), txTimeoutDuration) + startL2Nonce, err := l2Verif.NonceAt(ctx, testAccount.L2Opts.From, nil) + cancel() + require.NoError(t, err) + + // Add our transactor to our list + transactors = append(transactors, &TestAccountState{ + Account: testAccount, + ExpectedL2Balance: startL2Balance, + ExpectedL1Nonce: startL1Nonce, + ExpectedL2Nonce: startL2Nonce, + }) + } + + // Create our random provider + randomProvider := rand.New(rand.NewSource(1452)) + + // Now we create a number of deposits from each transactor + for i := 0; i < depositTxCount; i++ { + // Determine if this deposit should succeed in transferring value (not minting) + validTransfer := randomProvider.Int()%2 == 0 + + // Determine the transactor to use + transactorIndex := randomProvider.Int() % len(transactors) + transactor := transactors[transactorIndex] + + // Determine the transactor to receive the deposit + receiverIndex := randomProvider.Int() % len(transactors) + receiver := transactors[receiverIndex] + toAddr := receiver.Account.L2Opts.From + + // Create our L1 deposit transaction and send it. + mintAmount := big.NewInt(randomProvider.Int63() % 9_000_000) + transactor.Account.L1Opts.Value = mintAmount + var transferValue *big.Int + if validTransfer { + transferValue = new(big.Int).Div(transactor.ExpectedL2Balance, common.Big3) // send 1/3 our balance which should succeed. + } else { + transferValue = new(big.Int).Mul(common.Big2, transactor.ExpectedL2Balance) // trigger a revert by trying to transfer our current balance * 2 + } + SendDepositTx(t, cfg, l1Client, l2Verif, transactor.Account.L1Opts, func(l2Opts *DepositTxOpts) { + l2Opts.GasLimit = 100_000 + l2Opts.IsCreation = false + l2Opts.Data = nil + l2Opts.ToAddr = toAddr + l2Opts.Value = transferValue + if validTransfer { + l2Opts.ExpectedStatus = types.ReceiptStatusSuccessful + } else { + l2Opts.ExpectedStatus = types.ReceiptStatusFailed + } + }) + + // Update our expected balances. + if validTransfer && transactor != receiver { + // Transactor balances changes by minted minus transferred value. + transactor.ExpectedL2Balance = new(big.Int).Add(transactor.ExpectedL2Balance, new(big.Int).Sub(mintAmount, transferValue)) + // Receiver balance changes by transferred value. + receiver.ExpectedL2Balance = new(big.Int).Add(receiver.ExpectedL2Balance, transferValue) + } else { + // If the transfer failed, minting should've still succeeded but the balance shouldn't have transferred + // to the recipient. + transactor.ExpectedL2Balance = new(big.Int).Add(transactor.ExpectedL2Balance, mintAmount) + } + transactor.ExpectedL1Nonce = transactor.ExpectedL1Nonce + 1 + transactor.ExpectedL2Nonce = transactor.ExpectedL2Nonce + 1 + } + + // At the end, assert our account balance/nonce states. + for _, transactor := range transactors { + // Obtain the L1 account nonce + ctx, cancel := context.WithTimeout(context.Background(), txTimeoutDuration) + endL1Nonce, err := l1Client.NonceAt(ctx, transactor.Account.L1Opts.From, nil) + cancel() + require.NoError(t, err) + + // Obtain the L2 sequencer account balance + ctx, cancel = context.WithTimeout(context.Background(), txTimeoutDuration) + endL2SeqBalance, err := l2Seq.BalanceAt(ctx, transactor.Account.L2Opts.From, nil) + cancel() + require.NoError(t, err) + + // Obtain the L2 sequencer account nonce + ctx, cancel = context.WithTimeout(context.Background(), txTimeoutDuration) + endL2SeqNonce, err := l2Seq.NonceAt(ctx, transactor.Account.L2Opts.From, nil) + cancel() + require.NoError(t, err) + + // Obtain the L2 verifier account balance + ctx, cancel = context.WithTimeout(context.Background(), txTimeoutDuration) + endL2VerifBalance, err := l2Verif.BalanceAt(ctx, transactor.Account.L2Opts.From, nil) + cancel() + require.NoError(t, err) + + // Obtain the L2 verifier account nonce + ctx, cancel = context.WithTimeout(context.Background(), txTimeoutDuration) + endL2VerifNonce, err := l2Verif.NonceAt(ctx, transactor.Account.L2Opts.From, nil) + cancel() + require.NoError(t, err) + + require.Equal(t, transactor.ExpectedL1Nonce, endL1Nonce, "Unexpected L1 nonce for transactor") + require.Equal(t, transactor.ExpectedL2Nonce, endL2SeqNonce, "Unexpected L2 sequencer nonce for transactor") + require.Equal(t, transactor.ExpectedL2Balance, endL2SeqBalance, "Unexpected L2 sequencer balance for transactor") + require.Equal(t, transactor.ExpectedL2Nonce, endL2VerifNonce, "Unexpected L2 verifier nonce for transactor") + require.Equal(t, transactor.ExpectedL2Balance, endL2VerifBalance, "Unexpected L2 verifier balance for transactor") + } +} + +// TestMixedWithdrawalValidity makes a number of withdrawal transactions and ensures ones with modified parameters are +// rejected while unmodified ones are accepted. This runs test cases in different systems. +func TestMixedWithdrawalValidity(t *testing.T) { + InitParallel(t) + + // There are 7 different fields we try modifying to cause a failure, plus one "good" test result we test. + for i := 0; i <= 8; i++ { + i := i // avoid loop var capture + t.Run(fmt.Sprintf("withdrawal test#%d", i+1), func(t *testing.T) { + ctx, bgCancel := context.WithCancel(context.Background()) + defer bgCancel() + + InitParallel(t) + + // Create our system configuration, funding all accounts we created for L1/L2, and start it + cfg := DefaultSystemConfig(t) + cfg.Nodes["sequencer"].SafeDBPath = t.TempDir() + cfg.DeployConfig.L2BlockTime = 2 + require.LessOrEqual(t, cfg.DeployConfig.FinalizationPeriodSeconds, uint64(6)) + require.Equal(t, cfg.DeployConfig.FundDevAccounts, true) + sys, err := cfg.Start(t) + require.NoError(t, err, "error starting up system") + defer sys.Close() + + // Obtain our sequencer, verifier, and transactor keypair. + l1Client := sys.Clients["l1"] + l2Seq := sys.Clients["sequencer"] + l2Verif := sys.Clients["verifier"] + require.NoError(t, err) + + systemConfig, err := legacybindings.NewSystemConfigCaller(cfg.L1Deployments.SystemConfigProxy, l1Client) + require.NoError(t, err) + unsafeBlockSigner, err := systemConfig.UnsafeBlockSigner(nil) + require.NoError(t, err) + require.Equal(t, cfg.DeployConfig.P2PSequencerAddress, unsafeBlockSigner) + + // The batcher has balance on L1 + batcherBalance, err := l1Client.BalanceAt(context.Background(), cfg.DeployConfig.BatchSenderAddress, nil) + require.NoError(t, err) + require.NotEqual(t, batcherBalance, big.NewInt(0)) + + // The proposer has balance on L1 + proposerBalance, err := l1Client.BalanceAt(context.Background(), cfg.DeployConfig.L2OutputOracleProposer, nil) + require.NoError(t, err) + require.NotEqual(t, proposerBalance, big.NewInt(0)) + + // Define our L1 transaction timeout duration. + txTimeoutDuration := 10 * time.Duration(cfg.DeployConfig.L1BlockTime) * time.Second + + // Bind to the deposit contract + depositContract, err := bindings.NewOptimismPortal(cfg.L1Deployments.OptimismPortalProxy, l1Client) + _ = depositContract + require.NoError(t, err) + + l2OutputOracle, err := bindings.NewL2OutputOracleCaller(cfg.L1Deployments.L2OutputOracleProxy, l1Client) + require.NoError(t, err) + + finalizationPeriod, err := l2OutputOracle.FINALIZATIONPERIODSECONDS(nil) + require.NoError(t, err) + require.Equal(t, cfg.DeployConfig.FinalizationPeriodSeconds, finalizationPeriod.Uint64()) + + disputeGameFactory, err := bindings.NewDisputeGameFactoryCaller(cfg.L1Deployments.DisputeGameFactoryProxy, l1Client) + require.NoError(t, err) + + optimismPortal2, err := bindingspreview.NewOptimismPortal2Caller(cfg.L1Deployments.OptimismPortalProxy, l1Client) + require.NoError(t, err) + + // Create a struct used to track our transactors and their transactions sent. + type TestAccountState struct { + Account *TestAccount + ExpectedL1Balance *big.Int + ExpectedL2Balance *big.Int + ExpectedL1Nonce uint64 + ExpectedL2Nonce uint64 + } + + // Create a test account state for our transactor. + transactor := &TestAccountState{ + Account: &TestAccount{ + HDPath: e2eutils.DefaultMnemonicConfig.Alice, + Key: cfg.Secrets.Alice, + L1Opts: nil, + L2Opts: nil, + }, + ExpectedL1Balance: nil, + ExpectedL2Balance: nil, + ExpectedL1Nonce: 0, + ExpectedL2Nonce: 0, + } + transactor.Account.L1Opts, err = bind.NewKeyedTransactorWithChainID(transactor.Account.Key, cfg.L1ChainIDBig()) + require.NoError(t, err) + transactor.Account.L2Opts, err = bind.NewKeyedTransactorWithChainID(transactor.Account.Key, cfg.L2ChainIDBig()) + require.NoError(t, err) + + // Obtain the transactor's starting balance on L1. + txCtx, txCancel := context.WithTimeout(context.Background(), txTimeoutDuration) + transactor.ExpectedL1Balance, err = l1Client.BalanceAt(txCtx, transactor.Account.L1Opts.From, nil) + txCancel() + require.NoError(t, err) + + // Obtain the transactor's starting balance on L2. + txCtx, txCancel = context.WithTimeout(context.Background(), txTimeoutDuration) + transactor.ExpectedL2Balance, err = l2Verif.BalanceAt(txCtx, transactor.Account.L2Opts.From, nil) + txCancel() + require.NoError(t, err) + + // Bind to the L2-L1 message passer + l2l1MessagePasser, err := bindings.NewL2ToL1MessagePasser(predeploys.L2ToL1MessagePasserAddr, l2Seq) + require.NoError(t, err, "error binding to message passer on L2") + + // Create our fuzzer wrapper to generate complex values (despite this not being a fuzz test, this is still a useful + // provider to fill complex data structures). + typeProvider := fuzz.NewWithSeed(time.Now().Unix()).NilChance(0).MaxDepth(10000).NumElements(0, 0x100) + fuzzerutils.AddFuzzerFunctions(typeProvider) + + // Now we create a number of withdrawals from each transactor + + // Determine the address our request will come from + fromAddr := crypto.PubkeyToAddress(transactor.Account.Key.PublicKey) + fromBalance, err := l2Verif.BalanceAt(context.Background(), fromAddr, nil) + require.NoError(t, err) + require.Greaterf(t, fromBalance.Uint64(), uint64(700_000_000_000), "insufficient balance for %s", fromAddr) + + // Initiate Withdrawal + withdrawAmount := big.NewInt(500_000_000_000) + transactor.Account.L2Opts.Value = withdrawAmount + tx, err := l2l1MessagePasser.InitiateWithdrawal(transactor.Account.L2Opts, fromAddr, big.NewInt(21000), nil) + require.Nil(t, err, "sending initiate withdraw tx") + + t.Logf("Waiting for tx %s to be in sequencer", tx.Hash().Hex()) + receiptSeq, err := wait.ForReceiptOK(ctx, l2Seq, tx.Hash()) + require.Nil(t, err, "withdrawal initiated on L2 sequencer") + + verifierTip, err := l2Verif.BlockByNumber(context.Background(), nil) + require.Nil(t, err) + + t.Logf("Waiting for tx %s to be in verifier. Verifier tip is %s:%d. Included in sequencer in block %s:%d", tx.Hash().Hex(), verifierTip.Hash().Hex(), verifierTip.NumberU64(), receiptSeq.BlockHash.Hex(), receiptSeq.BlockNumber) + receipt, err := wait.ForReceiptOK(ctx, l2Verif, tx.Hash()) + require.Nilf(t, err, "withdrawal tx %s not found in verifier. included in block %s:%d", tx.Hash().Hex(), receiptSeq.BlockHash.Hex(), receiptSeq.BlockNumber) + + // Obtain the header for the block containing the transaction (used to calculate gas fees) + txCtx, txCancel = context.WithTimeout(context.Background(), txTimeoutDuration) + header, err := l2Verif.HeaderByNumber(txCtx, receipt.BlockNumber) + txCancel() + require.Nil(t, err) + + // Calculate gas fees for the withdrawal in L2 to later adjust our balance. + withdrawalL2GasFee := calcGasFees(receipt.GasUsed, tx.GasTipCap(), tx.GasFeeCap(), header.BaseFee) + + // Adjust our expected L2 balance (should've decreased by withdraw amount + fees) + transactor.ExpectedL2Balance = new(big.Int).Sub(transactor.ExpectedL2Balance, withdrawAmount) + transactor.ExpectedL2Balance = new(big.Int).Sub(transactor.ExpectedL2Balance, withdrawalL2GasFee) + transactor.ExpectedL2Balance = new(big.Int).Sub(transactor.ExpectedL2Balance, receipt.L1Fee) + transactor.ExpectedL2Nonce = transactor.ExpectedL2Nonce + 1 + + // Wait for the finalization period, then we can finalize this withdrawal. + require.NotEqual(t, cfg.L1Deployments.L2OutputOracleProxy, common.Address{}) + var blockNumber uint64 + if e2eutils.UseFPAC() { + blockNumber, err = wait.ForGamePublished(ctx, l1Client, cfg.L1Deployments.OptimismPortalProxy, cfg.L1Deployments.DisputeGameFactoryProxy, receipt.BlockNumber) + } else { + blockNumber, err = wait.ForOutputRootPublished(ctx, l1Client, cfg.L1Deployments.L2OutputOracleProxy, receipt.BlockNumber) + } + require.Nil(t, err) + + header, err = l2Verif.HeaderByNumber(ctx, new(big.Int).SetUint64(blockNumber)) + require.Nil(t, err) + + rpcClient, err := rpc.Dial(sys.EthInstances["verifier"].WSEndpoint()) + require.Nil(t, err) + proofCl := gethclient.New(rpcClient) + receiptCl := ethclient.NewClient(rpcClient) + blockCl := ethclient.NewClient(rpcClient) + + // Now create the withdrawal + params, err := ProveWithdrawalParameters(context.Background(), proofCl, receiptCl, blockCl, tx.Hash(), header, l2OutputOracle, disputeGameFactory, optimismPortal2) + require.Nil(t, err) + + // Obtain our withdrawal parameters + withdrawal := crossdomain.Withdrawal{ + Nonce: params.Nonce, + Sender: ¶ms.Sender, + Target: ¶ms.Target, + Value: params.Value, + GasLimit: params.GasLimit, + Data: params.Data, + } + withdrawalTransaction := withdrawal.WithdrawalTransaction() + l2OutputIndexParam := params.L2OutputIndex + outputRootProofParam := params.OutputRootProof + withdrawalProofParam := params.WithdrawalProof + + // Determine if this will be a bad withdrawal. + badWithdrawal := i < 8 + if badWithdrawal { + // Select a field to overwrite depending on which test case this is. + fieldIndex := i + + // We ensure that each field changes to something different. + if fieldIndex == 0 { + originalValue := new(big.Int).Set(withdrawalTransaction.Nonce) + for originalValue.Cmp(withdrawalTransaction.Nonce) == 0 { + typeProvider.Fuzz(&withdrawalTransaction.Nonce) + } + } else if fieldIndex == 1 { + originalValue := withdrawalTransaction.Sender + for originalValue == withdrawalTransaction.Sender { + typeProvider.Fuzz(&withdrawalTransaction.Sender) + } + } else if fieldIndex == 2 { + originalValue := withdrawalTransaction.Target + for originalValue == withdrawalTransaction.Target { + typeProvider.Fuzz(&withdrawalTransaction.Target) + } + } else if fieldIndex == 3 { + originalValue := new(big.Int).Set(withdrawalTransaction.Value) + for originalValue.Cmp(withdrawalTransaction.Value) == 0 { + typeProvider.Fuzz(&withdrawalTransaction.Value) + } + } else if fieldIndex == 4 { + originalValue := new(big.Int).Set(withdrawalTransaction.GasLimit) + for originalValue.Cmp(withdrawalTransaction.GasLimit) == 0 { + typeProvider.Fuzz(&withdrawalTransaction.GasLimit) + } + } else if fieldIndex == 5 { + originalValue := new(big.Int).Set(l2OutputIndexParam) + for originalValue.Cmp(l2OutputIndexParam) == 0 { + typeProvider.Fuzz(&l2OutputIndexParam) + } + } else if fieldIndex == 6 { + // TODO: this is a large structure that is unlikely to ever produce the same value, however we should + // verify that we actually generated different values. + typeProvider.Fuzz(&outputRootProofParam) + } else if fieldIndex == 7 { + typeProvider.Fuzz(&withdrawalProofParam) + originalValue := make([][]byte, len(withdrawalProofParam)) + for i := 0; i < len(withdrawalProofParam); i++ { + originalValue[i] = make([]byte, len(withdrawalProofParam[i])) + copy(originalValue[i], withdrawalProofParam[i]) + for bytes.Equal(originalValue[i], withdrawalProofParam[i]) { + typeProvider.Fuzz(&withdrawalProofParam[i]) + } + } + + } + } + + // Prove withdrawal. This checks the proof so we only finalize if this succeeds + tx, err = depositContract.ProveWithdrawalTransaction( + transactor.Account.L1Opts, + withdrawalTransaction, + l2OutputIndexParam, + outputRootProofParam, + withdrawalProofParam, + ) + + // If we had a bad withdrawal, we don't update some expected value and skip to processing the next + // withdrawal. Otherwise, if it was valid, this should've succeeded so we proceed with updating our expected + // values and asserting no errors occurred. + if badWithdrawal { + require.Error(t, err) + } else { + require.NoError(t, err) + + if e2eutils.UseFPAC() { + // Start a challenger to resolve claims and games once the clock expires + factoryHelper := disputegame.NewFactoryHelper(t, ctx, sys) + factoryHelper.StartChallenger(ctx, "Challenger", + challenger.WithCannon(t, sys.RollupConfig, sys.L2GenesisCfg), + challenger.WithPrivKey(sys.Cfg.Secrets.Mallory)) + } + receipt, err = wait.ForReceiptOK(ctx, l1Client, tx.Hash()) + require.NoError(t, err, "finalize withdrawal") + + // Verify balance after withdrawal + header, err = l1Client.HeaderByNumber(ctx, receipt.BlockNumber) + require.NoError(t, err) + + // Ensure that withdrawal - gas fees are added to the L1 balance + // Fun fact, the fee is greater than the withdrawal amount + withdrawalL1GasFee := calcGasFees(receipt.GasUsed, tx.GasTipCap(), tx.GasFeeCap(), header.BaseFee) + transactor.ExpectedL1Balance = new(big.Int).Add(transactor.ExpectedL2Balance, withdrawAmount) + transactor.ExpectedL1Balance = new(big.Int).Sub(transactor.ExpectedL2Balance, withdrawalL1GasFee) + transactor.ExpectedL1Nonce++ + + // Ensure that our withdrawal was proved successfully + _, err := wait.ForReceiptOK(ctx, l1Client, tx.Hash()) + require.NoError(t, err, "prove withdrawal") + + // Wait for finalization and then create the Finalized Withdrawal Transaction + ctx, withdrawalCancel := context.WithTimeout(context.Background(), 60*time.Duration(cfg.DeployConfig.L1BlockTime)*time.Second) + defer withdrawalCancel() + if e2eutils.UseFPAC() { + err = wait.ForWithdrawalCheck(ctx, l1Client, withdrawal, cfg.L1Deployments.OptimismPortalProxy, transactor.Account.L1Opts.From) + require.NoError(t, err) + } else { + err = wait.ForFinalizationPeriod(ctx, l1Client, header.Number, cfg.L1Deployments.L2OutputOracleProxy) + require.NoError(t, err) + } + + // Finalize withdrawal + _, err = depositContract.FinalizeWithdrawalTransaction( + transactor.Account.L1Opts, + withdrawalTransaction, + ) + require.NoError(t, err) + } + + // At the end, assert our account balance/nonce states. + + // Obtain the L2 sequencer account balance + endL1Balance, err := l1Client.BalanceAt(ctx, transactor.Account.L1Opts.From, nil) + require.NoError(t, err) + + // Obtain the L1 account nonce + endL1Nonce, err := l1Client.NonceAt(ctx, transactor.Account.L1Opts.From, nil) + require.NoError(t, err) + + // Obtain the L2 sequencer account balance + endL2SeqBalance, err := l2Seq.BalanceAt(ctx, transactor.Account.L1Opts.From, nil) + require.NoError(t, err) + + // Obtain the L2 sequencer account nonce + endL2SeqNonce, err := l2Seq.NonceAt(ctx, transactor.Account.L1Opts.From, nil) + require.NoError(t, err) + + // Obtain the L2 verifier account balance + endL2VerifBalance, err := l2Verif.BalanceAt(ctx, transactor.Account.L1Opts.From, nil) + require.NoError(t, err) + + // Obtain the L2 verifier account nonce + endL2VerifNonce, err := l2Verif.NonceAt(ctx, transactor.Account.L1Opts.From, nil) + require.NoError(t, err) + + // TODO: Check L1 balance as well here. We avoided this due to time constraints as it seems L1 fees + // were off slightly. + _ = endL1Balance + // require.Equal(t, transactor.ExpectedL1Balance, endL1Balance, "Unexpected L1 balance for transactor") + require.Equal(t, transactor.ExpectedL1Nonce, endL1Nonce, "Unexpected L1 nonce for transactor") + require.Equal(t, transactor.ExpectedL2Nonce, endL2SeqNonce, "Unexpected L2 sequencer nonce for transactor") + require.Equal(t, transactor.ExpectedL2Balance, endL2SeqBalance, "Unexpected L2 sequencer balance for transactor") + require.Equal(t, transactor.ExpectedL2Nonce, endL2VerifNonce, "Unexpected L2 verifier nonce for transactor") + require.Equal(t, transactor.ExpectedL2Balance, endL2VerifBalance, "Unexpected L2 verifier balance for transactor") + }) + } +} diff --git a/op-e2e2/tracer.go b/op-e2e2/tracer.go new file mode 100644 index 000000000000..217c1762082a --- /dev/null +++ b/op-e2e2/tracer.go @@ -0,0 +1,36 @@ +package op_e2e + +import ( + "context" + + "github.com/libp2p/go-libp2p/core/peer" + + "github.com/ethereum-optimism/optimism/op-node/node" + "github.com/ethereum-optimism/optimism/op-service/eth" +) + +type FnTracer struct { + OnNewL1HeadFn func(ctx context.Context, sig eth.L1BlockRef) + OnUnsafeL2PayloadFn func(ctx context.Context, from peer.ID, payload *eth.ExecutionPayloadEnvelope) + OnPublishL2PayloadFn func(ctx context.Context, payload *eth.ExecutionPayloadEnvelope) +} + +func (n *FnTracer) OnNewL1Head(ctx context.Context, sig eth.L1BlockRef) { + if n.OnNewL1HeadFn != nil { + n.OnNewL1HeadFn(ctx, sig) + } +} + +func (n *FnTracer) OnUnsafeL2Payload(ctx context.Context, from peer.ID, payload *eth.ExecutionPayloadEnvelope) { + if n.OnUnsafeL2PayloadFn != nil { + n.OnUnsafeL2PayloadFn(ctx, from, payload) + } +} + +func (n *FnTracer) OnPublishL2Payload(ctx context.Context, payload *eth.ExecutionPayloadEnvelope) { + if n.OnPublishL2PayloadFn != nil { + n.OnPublishL2PayloadFn(ctx, payload) + } +} + +var _ node.Tracer = (*FnTracer)(nil) diff --git a/op-e2e2/tx_helper.go b/op-e2e2/tx_helper.go new file mode 100644 index 000000000000..ad528c50c615 --- /dev/null +++ b/op-e2e2/tx_helper.go @@ -0,0 +1,146 @@ +package op_e2e + +import ( + "context" + "crypto/ecdsa" + "math/big" + "testing" + "time" + + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/wait" + + "github.com/ethereum-optimism/optimism/op-e2e2/bindings" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/transactions" + "github.com/ethereum-optimism/optimism/op-node/rollup/derive" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/stretchr/testify/require" +) + +// SendDepositTx creates and sends a deposit transaction. +// The L1 transaction, including sender, is configured by the l1Opts param. +// The L2 transaction options can be configured by modifying the DepositTxOps value supplied to applyL2Opts +// Will verify that the transaction is included with the expected status on L1 and L2 +// Returns the receipt of the L2 transaction +func SendDepositTx(t *testing.T, cfg SystemConfig, l1Client *ethclient.Client, l2Client *ethclient.Client, l1Opts *bind.TransactOpts, applyL2Opts DepositTxOptsFn) *types.Receipt { + l2Opts := defaultDepositTxOpts(l1Opts) + applyL2Opts(l2Opts) + + // Find deposit contract + depositContract, err := bindings.NewOptimismPortal(cfg.L1Deployments.OptimismPortalProxy, l1Client) + require.Nil(t, err) + + // Finally send TX + // Add 10% padding for the L1 gas limit because the estimation process can be affected by the 1559 style cost scale + // for buying L2 gas in the portal contracts. + tx, err := transactions.PadGasEstimate(l1Opts, 1.1, func(opts *bind.TransactOpts) (*types.Transaction, error) { + return depositContract.DepositTransaction(opts, l2Opts.ToAddr, l2Opts.Value, l2Opts.GasLimit, l2Opts.IsCreation, l2Opts.Data) + }) + require.Nil(t, err, "with deposit tx") + + // Wait for transaction on L1 + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + l1Receipt, err := wait.ForReceiptOK(ctx, l1Client, tx.Hash()) + require.Nil(t, err, "Waiting for deposit tx on L1") + + // Wait for transaction to be included on L2 + reconstructedDep, err := derive.UnmarshalDepositLogEvent(l1Receipt.Logs[0]) + require.NoError(t, err, "Could not reconstruct L2 Deposit") + tx = types.NewTx(reconstructedDep) + l2Receipt, err := wait.ForReceipt(ctx, l2Client, tx.Hash(), l2Opts.ExpectedStatus) + require.NoError(t, err, "Waiting for deposit tx on L2") + return l2Receipt +} + +type DepositTxOptsFn func(l2Opts *DepositTxOpts) + +type DepositTxOpts struct { + ToAddr common.Address + Value *big.Int + GasLimit uint64 + IsCreation bool + Data []byte + ExpectedStatus uint64 +} + +func defaultDepositTxOpts(opts *bind.TransactOpts) *DepositTxOpts { + return &DepositTxOpts{ + ToAddr: opts.From, + Value: opts.Value, + GasLimit: 1_000_000, + IsCreation: false, + Data: nil, + ExpectedStatus: types.ReceiptStatusSuccessful, + } +} + +// SendL2Tx creates and sends a transaction. +// The supplied privKey is used to specify the account to send from and the transaction is sent to the supplied l2Client +// Transaction options and expected status can be configured in the applyTxOpts function by modifying the supplied TxOpts +// Will verify that the transaction is included with the expected status on l2Client and any clients added to TxOpts.VerifyClients +func SendL2Tx(t *testing.T, cfg SystemConfig, l2Client *ethclient.Client, privKey *ecdsa.PrivateKey, applyTxOpts TxOptsFn) *types.Receipt { + opts := defaultTxOpts() + applyTxOpts(opts) + tx := types.MustSignNewTx(privKey, types.LatestSignerForChainID(cfg.L2ChainIDBig()), &types.DynamicFeeTx{ + ChainID: cfg.L2ChainIDBig(), + Nonce: opts.Nonce, // Already have deposit + To: opts.ToAddr, + Value: opts.Value, + GasTipCap: opts.GasTipCap, + GasFeeCap: opts.GasFeeCap, + Gas: opts.Gas, + Data: opts.Data, + }) + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + err := l2Client.SendTransaction(ctx, tx) + require.NoError(t, err, "Sending L2 tx") + + receipt, err := wait.ForReceiptOK(ctx, l2Client, tx.Hash()) + require.NoError(t, err, "Waiting for L2 tx") + require.Equal(t, opts.ExpectedStatus, receipt.Status, "TX should have expected status") + + for i, client := range opts.VerifyClients { + t.Logf("Waiting for tx %v on verification client %d", tx.Hash(), i) + receiptVerif, err := wait.ForReceiptOK(ctx, client, tx.Hash()) + require.NoErrorf(t, err, "Waiting for L2 tx on verification client %d", i) + require.Equalf(t, receipt, receiptVerif, "Receipts should be the same on sequencer and verification client %d", i) + } + return receipt +} + +type TxOptsFn func(opts *TxOpts) + +type TxOpts struct { + ToAddr *common.Address + Nonce uint64 + Value *big.Int + Gas uint64 + GasTipCap *big.Int + GasFeeCap *big.Int + Data []byte + ExpectedStatus uint64 + VerifyClients []*ethclient.Client +} + +// VerifyOnClients adds additional l2 clients that should sync the block the tx is included in +// Checks that the receipt received from these clients is equal to the receipt received from the sequencer +func (o *TxOpts) VerifyOnClients(clients ...*ethclient.Client) { + o.VerifyClients = append(o.VerifyClients, clients...) +} + +func defaultTxOpts() *TxOpts { + return &TxOpts{ + ToAddr: nil, + Nonce: 0, + Value: common.Big0, + GasTipCap: big.NewInt(10), + GasFeeCap: big.NewInt(200), + Gas: 21_000, + Data: nil, + ExpectedStatus: types.ReceiptStatusSuccessful, + } +} diff --git a/op-e2e2/withdrawal_helper.go b/op-e2e2/withdrawal_helper.go new file mode 100644 index 000000000000..707ce2109735 --- /dev/null +++ b/op-e2e2/withdrawal_helper.go @@ -0,0 +1,243 @@ +package op_e2e + +import ( + "context" + "crypto/ecdsa" + "math/big" + "testing" + "time" + + "github.com/ethereum-optimism/optimism/op-chain-ops/crossdomain" + legacybindings "github.com/ethereum-optimism/optimism/op-e2e2/bindings" + "github.com/ethereum-optimism/optimism/op-e2e2/config" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/geth" + "github.com/ethereum-optimism/optimism/op-e2e2/e2eutils/wait" + "github.com/ethereum-optimism/optimism/op-node/bindings" + bindingspreview "github.com/ethereum-optimism/optimism/op-node/bindings/preview" + "github.com/ethereum-optimism/optimism/op-node/withdrawals" + "github.com/ethereum-optimism/optimism/op-service/predeploys" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/ethereum/go-ethereum/ethclient/gethclient" + "github.com/stretchr/testify/require" +) + +type ClientProvider interface { + NodeClient(name string) *ethclient.Client +} + +func SendWithdrawal(t *testing.T, cfg SystemConfig, l2Client *ethclient.Client, privKey *ecdsa.PrivateKey, applyOpts WithdrawalTxOptsFn) (*types.Transaction, *types.Receipt) { + opts := defaultWithdrawalTxOpts() + applyOpts(opts) + + // Bind L2 Withdrawer Contract + l2withdrawer, err := bindings.NewL2ToL1MessagePasser(predeploys.L2ToL1MessagePasserAddr, l2Client) + require.Nil(t, err, "binding withdrawer on L2") + + // Initiate Withdrawal + l2opts, err := bind.NewKeyedTransactorWithChainID(privKey, cfg.L2ChainIDBig()) + require.Nil(t, err) + l2opts.Value = opts.Value + tx, err := l2withdrawer.InitiateWithdrawal(l2opts, l2opts.From, big.NewInt(int64(opts.Gas)), opts.Data) + require.Nil(t, err, "sending initiate withdraw tx") + + receipt, err := geth.WaitForTransaction(tx.Hash(), l2Client, 10*time.Duration(cfg.DeployConfig.L1BlockTime)*time.Second) + require.Nil(t, err, "withdrawal initiated on L2 sequencer") + require.Equal(t, opts.ExpectedStatus, receipt.Status, "transaction had incorrect status") + + for i, client := range opts.VerifyClients { + t.Logf("Waiting for tx %v on verification client %d", tx.Hash(), i) + receiptVerif, err := geth.WaitForTransaction(tx.Hash(), client, 10*time.Duration(cfg.DeployConfig.L2BlockTime)*time.Second) + require.Nilf(t, err, "Waiting for L2 tx on verification client %d", i) + require.Equalf(t, receipt, receiptVerif, "Receipts should be the same on sequencer and verification client %d", i) + } + return tx, receipt +} + +type WithdrawalTxOptsFn func(opts *WithdrawalTxOpts) + +type WithdrawalTxOpts struct { + ToAddr *common.Address + Nonce uint64 + Value *big.Int + Gas uint64 + Data []byte + ExpectedStatus uint64 + VerifyClients []*ethclient.Client +} + +// VerifyOnClients adds additional l2 clients that should sync the block the tx is included in +// Checks that the receipt received from these clients is equal to the receipt received from the sequencer +func (o *WithdrawalTxOpts) VerifyOnClients(clients ...*ethclient.Client) { + o.VerifyClients = append(o.VerifyClients, clients...) +} + +func defaultWithdrawalTxOpts() *WithdrawalTxOpts { + return &WithdrawalTxOpts{ + ToAddr: nil, + Nonce: 0, + Value: common.Big0, + Gas: 21_000, + Data: nil, + ExpectedStatus: types.ReceiptStatusSuccessful, + } +} + +func ProveAndFinalizeWithdrawal(t *testing.T, cfg SystemConfig, clients ClientProvider, l2NodeName string, ethPrivKey *ecdsa.PrivateKey, l2WithdrawalReceipt *types.Receipt) (*types.Receipt, *types.Receipt, *types.Receipt, *types.Receipt) { + params, proveReceipt := ProveWithdrawal(t, cfg, clients, l2NodeName, ethPrivKey, l2WithdrawalReceipt) + finalizeReceipt, resolveClaimReceipt, resolveReceipt := FinalizeWithdrawal(t, cfg, clients.NodeClient("l1"), ethPrivKey, proveReceipt, params) + return proveReceipt, finalizeReceipt, resolveClaimReceipt, resolveReceipt +} + +func ProveWithdrawal(t *testing.T, cfg SystemConfig, clients ClientProvider, l2NodeName string, ethPrivKey *ecdsa.PrivateKey, l2WithdrawalReceipt *types.Receipt) (withdrawals.ProvenWithdrawalParameters, *types.Receipt) { + // Get l2BlockNumber for proof generation + ctx, cancel := context.WithTimeout(context.Background(), 40*time.Duration(cfg.DeployConfig.L1BlockTime)*time.Second) + defer cancel() + + l1Client := clients.NodeClient("l1") + var blockNumber uint64 + var err error + if e2eutils.UseFPAC() { + blockNumber, err = wait.ForGamePublished(ctx, l1Client, config.L1Deployments.OptimismPortalProxy, config.L1Deployments.DisputeGameFactoryProxy, l2WithdrawalReceipt.BlockNumber) + require.Nil(t, err) + } else { + blockNumber, err = wait.ForOutputRootPublished(ctx, l1Client, config.L1Deployments.L2OutputOracleProxy, l2WithdrawalReceipt.BlockNumber) + require.Nil(t, err) + } + + receiptCl := clients.NodeClient(l2NodeName) + blockCl := clients.NodeClient(l2NodeName) + proofCl := gethclient.New(receiptCl.Client()) + + ctx, cancel = context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + // Get the latest header + header, err := receiptCl.HeaderByNumber(ctx, new(big.Int).SetUint64(blockNumber)) + require.Nil(t, err) + + oracle, err := bindings.NewL2OutputOracleCaller(config.L1Deployments.L2OutputOracleProxy, l1Client) + require.Nil(t, err) + + factory, err := bindings.NewDisputeGameFactoryCaller(config.L1Deployments.DisputeGameFactoryProxy, l1Client) + require.Nil(t, err) + + portal2, err := bindingspreview.NewOptimismPortal2Caller(config.L1Deployments.OptimismPortalProxy, l1Client) + require.Nil(t, err) + + params, err := ProveWithdrawalParameters(context.Background(), proofCl, receiptCl, blockCl, l2WithdrawalReceipt.TxHash, header, oracle, factory, portal2) + require.Nil(t, err) + + portal, err := bindings.NewOptimismPortal(config.L1Deployments.OptimismPortalProxy, l1Client) + require.Nil(t, err) + + opts, err := bind.NewKeyedTransactorWithChainID(ethPrivKey, cfg.L1ChainIDBig()) + require.Nil(t, err) + + // Prove withdrawal + tx, err := portal.ProveWithdrawalTransaction( + opts, + bindings.TypesWithdrawalTransaction{ + Nonce: params.Nonce, + Sender: params.Sender, + Target: params.Target, + Value: params.Value, + GasLimit: params.GasLimit, + Data: params.Data, + }, + params.L2OutputIndex, + params.OutputRootProof, + params.WithdrawalProof, + ) + require.Nil(t, err) + + // Ensure that our withdrawal was proved successfully + proveReceipt, err := geth.WaitForTransaction(tx.Hash(), l1Client, 3*time.Duration(cfg.DeployConfig.L1BlockTime)*time.Second) + require.Nil(t, err, "prove withdrawal") + require.Equal(t, types.ReceiptStatusSuccessful, proveReceipt.Status) + return params, proveReceipt +} + +func ProveWithdrawalParameters(ctx context.Context, proofCl withdrawals.ProofClient, l2ReceiptCl withdrawals.ReceiptClient, l2BlockCl withdrawals.BlockClient, txHash common.Hash, header *types.Header, l2OutputOracleContract *bindings.L2OutputOracleCaller, disputeGameFactoryContract *bindings.DisputeGameFactoryCaller, optimismPortal2Contract *bindingspreview.OptimismPortal2Caller) (withdrawals.ProvenWithdrawalParameters, error) { + if e2eutils.UseFPAC() { + return withdrawals.ProveWithdrawalParametersFPAC(ctx, proofCl, l2ReceiptCl, l2BlockCl, txHash, disputeGameFactoryContract, optimismPortal2Contract) + } else { + return withdrawals.ProveWithdrawalParameters(ctx, proofCl, l2ReceiptCl, l2BlockCl, txHash, header, l2OutputOracleContract) + } +} + +func FinalizeWithdrawal(t *testing.T, cfg SystemConfig, l1Client *ethclient.Client, privKey *ecdsa.PrivateKey, withdrawalProofReceipt *types.Receipt, params withdrawals.ProvenWithdrawalParameters) (*types.Receipt, *types.Receipt, *types.Receipt) { + // Wait for finalization and then create the Finalized Withdrawal Transaction + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Duration(cfg.DeployConfig.L1BlockTime)*time.Second) + defer cancel() + + wd := crossdomain.Withdrawal{ + Nonce: params.Nonce, + Sender: ¶ms.Sender, + Target: ¶ms.Target, + Value: params.Value, + GasLimit: params.GasLimit, + Data: params.Data, + } + + opts, err := bind.NewKeyedTransactorWithChainID(privKey, cfg.L1ChainIDBig()) + require.Nil(t, err) + + var resolveClaimReceipt *types.Receipt + var resolveReceipt *types.Receipt + if e2eutils.UseFPAC() { + portal2, err := bindingspreview.NewOptimismPortal2(config.L1Deployments.OptimismPortalProxy, l1Client) + require.Nil(t, err) + + wdHash, err := wd.Hash() + require.Nil(t, err) + + game, err := portal2.ProvenWithdrawals(&bind.CallOpts{}, wdHash, opts.From) + require.Nil(t, err) + require.NotNil(t, game, "withdrawal should be proven") + + proxy, err := legacybindings.NewFaultDisputeGame(game.DisputeGameProxy, l1Client) + require.Nil(t, err) + + expiry, err := proxy.MaxClockDuration(&bind.CallOpts{}) + require.Nil(t, err) + + time.Sleep(time.Duration(expiry) * time.Second) + resolveClaimTx, err := proxy.ResolveClaim(opts, common.Big0, common.Big0) + require.Nil(t, err) + + resolveClaimReceipt, err = wait.ForReceiptOK(ctx, l1Client, resolveClaimTx.Hash()) + require.Nil(t, err, "resolve claim") + require.Equal(t, types.ReceiptStatusSuccessful, resolveClaimReceipt.Status) + + resolveTx, err := proxy.Resolve(opts) + require.Nil(t, err) + + resolveReceipt, err = wait.ForReceiptOK(ctx, l1Client, resolveTx.Hash()) + require.Nil(t, err, "resolve") + require.Equal(t, types.ReceiptStatusSuccessful, resolveReceipt.Status) + } + + if e2eutils.UseFPAC() { + err := wait.ForWithdrawalCheck(ctx, l1Client, wd, config.L1Deployments.OptimismPortalProxy, opts.From) + require.Nil(t, err) + } else { + err := wait.ForFinalizationPeriod(ctx, l1Client, withdrawalProofReceipt.BlockNumber, config.L1Deployments.L2OutputOracleProxy) + require.Nil(t, err) + } + + portal, err := bindings.NewOptimismPortal(config.L1Deployments.OptimismPortalProxy, l1Client) + require.Nil(t, err) + + // Finalize withdrawal + tx, err := portal.FinalizeWithdrawalTransaction(opts, wd.WithdrawalTransaction()) + require.Nil(t, err) + + // Ensure that our withdrawal was finalized successfully + finalizeReceipt, err := wait.ForReceiptOK(ctx, l1Client, tx.Hash()) + require.Nil(t, err, "finalize withdrawal") + require.Equal(t, types.ReceiptStatusSuccessful, finalizeReceipt.Status) + return finalizeReceipt, resolveClaimReceipt, resolveReceipt +}